-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-hyst.html
95 lines (72 loc) · 735 KB
/
test-hyst.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<html>
<head>
<title>Melown API Demo</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="//cdn.melown.com/libs/vtsjs/builtin/v2/browser/vts-browser.min.css" /></link>
<script type="text/javascript">
/*! Copyright (c) 2017 Melown Technologies SE
* For terms of use, see accompanying vts-browser.min.js.LICENSE file.
* For 3rd party libraries licenses, see 3rdpartylicenses.txt.
*/
var vts=function(t){function e(r){if(i[r])return i[r].exports;var s=i[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=178)}([function(t,e,i){"use strict";i.d(e,"h",function(){return r}),i.d(e,"i",function(){return s}),i.d(e,"l",function(){return a}),i.d(e,"k",function(){return n}),i.d(e,"f",function(){return o}),i.d(e,"a",function(){return h}),i.d(e,"m",function(){return l}),i.d(e,"n",function(){return u}),i.d(e,"o",function(){return c}),i.d(e,"d",function(){return d}),i.d(e,"g",function(){return p}),i.d(e,"j",function(){return f}),i.d(e,"b",function(){return g}),i.d(e,"e",function(){return m}),i.d(e,"c",function(){return v});var r=1,s=2,a=4,n=5,o=484813681109536e-20,h=Math.PI/2,l=.16666666666666666,u=.04722222222222222,c=.022156084656084655,d=void 0===Number.EPSILON?1e-10:Number.EPSILON,p=.017453292519943295,f=57.29577951308232,g=Math.PI/4,m=2*Math.PI,v=3.14159265359},function(t,e,i){"use strict";var r=i(0),s=i(10);e.a=function(t){return Math.abs(t)<=r.c?t:t-i.i(s.a)(t)*r.e}},function(t,e,i){"use strict";i.d(e,"a",function(){return r}),i.d(e,"b",function(){return a}),i.d(e,"c",function(){return s}),i.d(e,"d",function(){return n}),i.d(e,"e",function(){return o});var r={};r.create=function(t){var e=new Array(2);return t&&(e[0]=t[0],e[1]=t[1]),e};var s={};s.create=function(t){var e=new Array(4);return t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e},s.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},s.dot2=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]},s.dot3=function(t,e,i,r,s,a){return t[0]*(e[i]-r)+t[1]*(e[i+1]-s)+t[2]*(e[i+2]-a)+t[3]};var a={};a.create=function(t){var e=new Array(3);return t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2]),e},a.set=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},a.add=function(t,e,i){return i&&t!=i?(i[0]=t[0]+e[0],i[1]=t[1]+e[1],i[2]=t[2]+e[2],i):(t[0]+=e[0],t[1]+=e[1],t[2]+=e[2],t)},a.subtract=function(t,e,i){return i&&t!=i?(i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],i):(t[0]-=e[0],t[1]-=e[1],t[2]-=e[2],t)},a.negate=function(t,e){return e||(e=t),e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},a.scale=function(t,e,i){return i&&t!=i?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e,i):(t[0]*=e,t[1]*=e,t[2]*=e,t)},a.normalize=function(t,e){e||(e=t);var i=t[0],r=t[1],s=t[2],a=Math.sqrt(i*i+r*r+s*s);return a?1==a?(e[0]=i,e[1]=r,e[2]=s,e):(a=1/a,e[0]=i*a,e[1]=r*a,e[2]=s*a,e):(e[0]=0,e[1]=0,e[2]=0,e)},a.normalize2=function(t,e,i){var r=t[e],s=t[e+1],a=t[e+2],n=Math.sqrt(r*r+s*s+a*a);return n?1==n?(i[0]=r,i[1]=s,i[2]=a,i):(n=1/n,i[0]=r*n,i[1]=s*n,void(i[2]=a*n)):(i[0]=0,i[1]=0,i[2]=0,i)},a.normalize3=function(t,e,i,r){var s=t[e],a=t[e+1],n=t[e+2],o=Math.sqrt(s*s+a*a+n*n);return o?1==o?(i[r]=s,i[r+1]=a,i[r+2]=n,i):(o=1/o,i[r]=s*o,i[r+1]=a*o,void(i[r+2]=n*o)):(i[r]=0,i[r+1]=0,i[r+2]=0,i)},a.normalize4=function(t,e){e||(e=t);var i=t[0],r=t[1],s=t[2],a=Math.sqrt(i*i+r*r+s*s);if(!a)return e[0]=0,e[1]=0,e[2]=0,e;if(1==a)return e[0]=i,e[1]=r,e[2]=s,e;var n=a;return a=1/a,e[0]=i*a,e[1]=r*a,e[2]=s*a,n},a.cross=function(t,e,i){i||(i=t);var r=t[0],s=t[1];t=t[2];var a=e[0],n=e[1];return e=e[2],i[0]=s*e-t*n,i[1]=t*a-r*e,i[2]=r*n-s*a,i},a.length=function(t){var e=t[0],i=t[1];return t=t[2],Math.sqrt(e*e+i*i+t*t)},a.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},a.dot2=function(t,e,i){return t[0]*e[i]+t[1]*e[i+1]+t[2]*e[i+2]},a.dot3=function(t,e,i,r){return t[e]*i[r]+t[e+1]*i[r+1]+t[e+2]*i[r+2]},a.squareDistance=function(t,e){var i=e[0]-t[0],r=e[1]-t[1],s=e[2]-t[2];return i*i+r*r+s*s},a.direction=function(t,e,i){i||(i=t);var r=t[0]-e[0],s=t[1]-e[1];return t=t[2]-e[2],(e=Math.sqrt(r*r+s*s+t*t))?(e=1/e,i[0]=r*e,i[1]=s*e,i[2]=t*e,i):(i[0]=0,i[1]=0,i[2]=0,i)},a.lerp=function(t,e,i,r){return r||(r=t),r[0]=t[0]+i*(e[0]-t[0]),r[1]=t[1]+i*(e[1]-t[1]),r[2]=t[2]+i*(e[2]-t[2]),r},a.str=function(t){return"["+t[0]+", "+t[1]+", "+t[2]+"]"};var n={};n.create=function(t){var e=new Array(9);return t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9]),e},n.set=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.transpose=function(t,e){if(!e||t==e){var i=t[1],r=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=i,t[5]=t[7],t[6]=r,t[7]=s,t}return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e},n.toMat4=function(t,e){return e||(e=o.create()),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[3],e[5]=t[4],e[6]=t[5],e[7]=0,e[8]=t[6],e[9]=t[7],e[10]=t[8],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},n.str=function(t){return"["+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+"]"};var o={};o.create=function(t){var e=new Array(16);return t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e},o.set=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.transpose=function(t,e){if(!e||t==e){var i=t[1],r=t[2],s=t[3],a=t[6],n=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=i,t[6]=t[9],t[7]=t[13],t[8]=r,t[9]=a,t[11]=t[14],t[12]=s,t[13]=n,t[14]=o,t}return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e},o.determinant=function(t){var e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],n=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],g=t[14];return t=t[15],p*u*o*s-l*f*o*s-p*n*c*s+a*f*c*s+l*n*g*s-a*u*g*s-p*u*r*h+l*f*r*h+p*i*c*h-e*f*c*h-l*i*g*h+e*u*g*h+p*n*r*d-a*f*r*d-p*i*o*d+e*f*o*d+a*i*g*d-e*n*g*d-l*n*r*t+a*u*r*t+l*i*o*t-e*u*o*t-a*i*c*t+e*n*c*t},o.inverse=function(t,e){e||(e=t);var i=t[0],r=t[1],s=t[2],a=t[3],n=t[4],o=t[5],h=t[6],l=t[7],u=t[8],c=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],v=t[15],y=i*o-r*n,b=i*h-s*n,x=i*l-a*n,M=r*h-s*o,w=r*l-a*o,S=s*l-a*h,A=u*g-c*f,C=u*m-d*f,T=u*v-p*f,P=c*m-d*g,E=c*v-p*g,L=d*v-p*m,k=1/(y*L-b*E+x*P+M*T-w*C+S*A);return e[0]=(o*L-h*E+l*P)*k,e[1]=(-r*L+s*E-a*P)*k,e[2]=(g*S-m*w+v*M)*k,e[3]=(-c*S+d*w-p*M)*k,e[4]=(-n*L+h*T-l*C)*k,e[5]=(i*L-s*T+a*C)*k,e[6]=(-f*S+m*x-v*b)*k,e[7]=(u*S-d*x+p*b)*k,e[8]=(n*E-o*T+l*A)*k,e[9]=(-i*E+r*T-a*A)*k,e[10]=(f*w-g*x+v*y)*k,e[11]=(-u*w+c*x-p*y)*k,e[12]=(-n*P+o*C-h*A)*k,e[13]=(i*P-r*C+s*A)*k,e[14]=(-f*M+g*b-m*y)*k,e[15]=(u*M-c*b+d*y)*k,e},o.toRotationMat=function(t,e){return e||(e=o.create()),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},o.toMat3=function(t,e){return e||(e=n.create()),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},o.toInverseMat3=function(t,e){var i=t[0],r=t[1],s=t[2],a=t[4],o=t[5],h=t[6],l=t[8],u=t[9],c=t[10],d=c*o-h*u,p=-c*a+h*l,f=u*a-o*l,g=i*d+r*p+s*f;return g?(g=1/g,e||(e=n.create()),e[0]=d*g,e[1]=(-c*r+s*u)*g,e[2]=(h*r-s*o)*g,e[3]=p*g,e[4]=(c*i-s*l)*g,e[5]=(-h*i+s*a)*g,e[6]=f*g,e[7]=(-u*i+r*l)*g,e[8]=(o*i-r*a)*g,e):null},o.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],a=t[2],n=t[3],o=t[4],h=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],g=t[12],m=t[13],v=t[14];t=t[15];var y=e[0],b=e[1],x=e[2],M=e[3],w=e[4],S=e[5],A=e[6],C=e[7],T=e[8],P=e[9],E=e[10],L=e[11],k=e[12],I=e[13],N=e[14];return e=e[15],i[0]=y*r+b*o+x*c+M*g,i[1]=y*s+b*h+x*d+M*m,i[2]=y*a+b*l+x*p+M*v,i[3]=y*n+b*u+x*f+M*t,i[4]=w*r+S*o+A*c+C*g,i[5]=w*s+S*h+A*d+C*m,i[6]=w*a+S*l+A*p+C*v,i[7]=w*n+S*u+A*f+C*t,i[8]=T*r+P*o+E*c+L*g,i[9]=T*s+P*h+E*d+L*m,i[10]=T*a+P*l+E*p+L*v,i[11]=T*n+P*u+E*f+L*t,i[12]=k*r+I*o+N*c+e*g,i[13]=k*s+I*h+N*d+e*m,i[14]=k*a+I*l+N*p+e*v,i[15]=k*n+I*u+N*f+e*t,i},o.multiplyVec3=function(t,e,i){i||(i=e);var r=e[0],s=e[1];return e=e[2],i[0]=t[0]*r+t[4]*s+t[8]*e+t[12],i[1]=t[1]*r+t[5]*s+t[9]*e+t[13],i[2]=t[2]*r+t[6]*s+t[10]*e+t[14],i},o.multiplyVec4=function(t,e,i){i||(i=e);var r=e[0],s=e[1],a=e[2];return e=e[3],i[0]=t[0]*r+t[4]*s+t[8]*a+t[12]*e,i[1]=t[1]*r+t[5]*s+t[9]*a+t[13]*e,i[2]=t[2]*r+t[6]*s+t[10]*a+t[14]*e,i[3]=t[3]*r+t[7]*s+t[11]*a+t[15]*e,i},o.translate=function(t,e,i){var r=e[0],s=e[1];if(e=e[2],!i||t==i)return t[12]=t[0]*r+t[4]*s+t[8]*e+t[12],t[13]=t[1]*r+t[5]*s+t[9]*e+t[13],t[14]=t[2]*r+t[6]*s+t[10]*e+t[14],t[15]=t[3]*r+t[7]*s+t[11]*e+t[15],t;var a=t[0],n=t[1],o=t[2],h=t[3],l=t[4],u=t[5],c=t[6],d=t[7],p=t[8],f=t[9],g=t[10],m=t[11];return i[0]=a,i[1]=n,i[2]=o,i[3]=h,i[4]=l,i[5]=u,i[6]=c,i[7]=d,i[8]=p,i[9]=f,i[10]=g,i[11]=m,i[12]=a*r+l*s+p*e+t[12],i[13]=n*r+u*s+f*e+t[13],i[14]=o*r+c*s+g*e+t[14],i[15]=h*r+d*s+m*e+t[15],i},o.scale=function(t,e,i){var r=e[0],s=e[1];return e=e[2],i&&t!=i?(i[0]=t[0]*r,i[1]=t[1]*r,i[2]=t[2]*r,i[3]=t[3]*r,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7]*s,i[8]=t[8]*e,i[9]=t[9]*e,i[10]=t[10]*e,i[11]=t[11]*e,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i):(t[0]*=r,t[1]*=r,t[2]*=r,t[3]*=r,t[4]*=s,t[5]*=s,t[6]*=s,t[7]*=s,t[8]*=e,t[9]*=e,t[10]*=e,t[11]*=e,t)},o.rotate=function(t,e,i,r){var s=i[0],a=i[1];i=i[2];var n=Math.sqrt(s*s+a*a+i*i);if(!n)return null;1!=n&&(n=1/n,s*=n,a*=n,i*=n);var o=Math.sin(e),h=Math.cos(e),l=1-h;e=t[0],n=t[1];var u=t[2],c=t[3],d=t[4],p=t[5],f=t[6],g=t[7],m=t[8],v=t[9],y=t[10],b=t[11],x=s*s*l+h,M=a*s*l+i*o,w=i*s*l-a*o,S=s*a*l-i*o,A=a*a*l+h,C=i*a*l+s*o,T=s*i*l+a*o;return s=a*i*l-s*o,a=i*i*l+h,r?t!=r&&(r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]):r=t,r[0]=e*x+d*M+m*w,r[1]=n*x+p*M+v*w,r[2]=u*x+f*M+y*w,r[3]=c*x+g*M+b*w,r[4]=e*S+d*A+m*C,r[5]=n*S+p*A+v*C,r[6]=u*S+f*A+y*C,r[7]=c*S+g*A+b*C,r[8]=e*T+d*s+m*a,r[9]=n*T+p*s+v*a,r[10]=u*T+f*s+y*a,r[11]=c*T+g*s+b*a,r},o.rotateX=function(t,e,i){var r=Math.sin(e);e=Math.cos(e);var s=t[4],a=t[5],n=t[6],o=t[7],h=t[8],l=t[9],u=t[10],c=t[11];return i?t!=i&&(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]):i=t,i[4]=s*e+h*r,i[5]=a*e+l*r,i[6]=n*e+u*r,i[7]=o*e+c*r,i[8]=s*-r+h*e,i[9]=a*-r+l*e,i[10]=n*-r+u*e,i[11]=o*-r+c*e,i},o.rotateY=function(t,e,i){var r=Math.sin(e);e=Math.cos(e);var s=t[0],a=t[1],n=t[2],o=t[3],h=t[8],l=t[9],u=t[10],c=t[11];return i?t!=i&&(i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]):i=t,i[0]=s*e+h*-r,i[1]=a*e+l*-r,i[2]=n*e+u*-r,i[3]=o*e+c*-r,i[8]=s*r+h*e,i[9]=a*r+l*e,i[10]=n*r+u*e,i[11]=o*r+c*e,i},o.rotateZ=function(t,e,i){var r=Math.sin(e);e=Math.cos(e);var s=t[0],a=t[1],n=t[2],o=t[3],h=t[4],l=t[5],u=t[6],c=t[7];return i?t!=i&&(i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]):i=t,i[0]=s*e+h*r,i[1]=a*e+l*r,i[2]=n*e+u*r,i[3]=o*e+c*r,i[4]=s*-r+h*e,i[5]=a*-r+l*e,i[6]=n*-r+u*e,i[7]=o*-r+c*e,i},o.frustum=function(t,e,i,r,s,a,n){n||(n=o.create());var h=e-t,l=r-i,u=a-s;return n[0]=2*s/h,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=2*s/l,n[6]=0,n[7]=0,n[8]=(e+t)/h,n[9]=(r+i)/l,n[10]=-(a+s)/u,n[11]=-1,n[12]=0,n[13]=0,n[14]=-a*s*2/u,n[15]=0,n},o.perspective=function(t,e,i,r,s){return t=i*Math.tan(t*Math.PI/360),e*=t,o.frustum(-e,e,-t,t,i,r,s)},o.ortho=function(t,e,i,r,s,a,n){n||(n=o.create());var h=e-t,l=r-i,u=a-s;return n[0]=2/h,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=2/l,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-2/u,n[11]=0,n[12]=-(t+e)/h,n[13]=-(r+i)/l,n[14]=-(a+s)/u,n[15]=1,n},o.lookAt=function(t,e,i,r){r||(r=o.create());var s=t[0],a=t[1];t=t[2];var n=i[0],h=i[1],l=i[2];i=e[1];var u=e[2];if(s==e[0]&&a==i&&t==u)return o.identity(r);var c,d,p,f;return i=s-e[0],u=a-e[1],e=t-e[2],f=1/Math.sqrt(i*i+u*u+e*e),i*=f,u*=f,e*=f,c=h*e-l*u,l=l*i-n*e,n=n*u-h*i,f=Math.sqrt(c*c+l*l+n*n),f?(f=1/f,c*=f,l*=f,n*=f):n=l=c=0,h=u*n-e*l,d=e*c-i*n,p=i*l-u*c,f=Math.sqrt(h*h+d*d+p*p),f?(f=1/f,h*=f,d*=f,p*=f):p=d=h=0,r[0]=c,r[1]=h,r[2]=i,r[3]=0,r[4]=l,r[5]=d,r[6]=u,r[7]=0,r[8]=n,r[9]=p,r[10]=e,r[11]=0,r[12]=-(c*s+l*a+n*t),r[13]=-(h*s+d*a+p*t),r[14]=-(i*s+u*a+e*t),r[15]=1,r},o.str=function(t){return"["+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+"]"};var h={};h.create=function(t){var e=new Array(4);return t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e},h.set=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},h.calculateW=function(t,e){var i=t[0],r=t[1],s=t[2];return e&&t!=e?(e[0]=i,e[1]=r,e[2]=s,e[3]=-Math.sqrt(Math.abs(1-i*i-r*r-s*s)),e):(t[3]=-Math.sqrt(Math.abs(1-i*i-r*r-s*s)),t)},h.inverse=function(t,e){return e&&t!=e?(e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e):(t[0]*=1,t[1]*=1,t[2]*=1,t)},h.length=function(t){var e=t[0],i=t[1],r=t[2];return t=t[3],Math.sqrt(e*e+i*i+r*r+t*t)},h.normalize=function(t,e){e||(e=t);var i=t[0],r=t[1],s=t[2],a=t[3],n=Math.sqrt(i*i+r*r+s*s+a*a);return 0==n?(e[0]=0,e[1]=0,e[2]=0,e[3]=0,e):(n=1/n,e[0]=i*n,e[1]=r*n,e[2]=s*n,e[3]=a*n,e)},h.multiply=function(t,e,i){i||(i=t);var r=t[0],s=t[1],a=t[2];t=t[3];var n=e[0],o=e[1],h=e[2];return e=e[3],i[0]=r*e+t*n+s*h-a*o,i[1]=s*e+t*o+a*n-r*h,i[2]=a*e+t*h+r*o-s*n,i[3]=t*e-r*n-s*o-a*h,i},h.multiplyVec3=function(t,e,i){i||(i=e);var r=e[0],s=e[1],a=e[2];e=t[0];var n=t[1],o=t[2];t=t[3];var h=t*r+n*a-o*s,l=t*s+o*r-e*a,u=t*a+e*s-n*r;return r=-e*r-n*s-o*a,i[0]=h*t+r*-e+l*-o-u*-n,i[1]=l*t+r*-n+u*-e-h*-o,i[2]=u*t+r*-o+h*-n-l*-e,i},h.toMat3=function(t,e){e||(e=n.create());var i=t[0],r=t[1],s=t[2],a=t[3],o=i+i,h=r+r,l=s+s,u=i*o,c=i*h;i*=l;var d=r*h;return r*=l,s*=l,o*=a,h*=a,a*=l,e[0]=1-(d+s),e[1]=c-a,e[2]=i+h,e[3]=c+a,e[4]=1-(u+s),e[5]=r-o,e[6]=i-h,e[7]=r+o,e[8]=1-(u+d),e},h.toMat4=function(t,e){e||(e=o.create());var i=t[0],r=t[1],s=t[2],a=t[3],n=i+i,h=r+r,l=s+s,u=i*n,c=i*h;i*=l;var d=r*h;return r*=l,s*=l,n*=a,h*=a,a*=l,e[0]=1-(d+s),e[1]=c-a,e[2]=i+h,e[3]=0,e[4]=c+a,e[5]=1-(u+s),e[6]=r-n,e[7]=0,e[8]=i-h,e[9]=r+n,e[10]=1-(u+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},h.slerp=function(t,e,i,r){r||(r=t);var s=i;return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]<0&&(s=-1*i),r[0]=1-i*t[0]+s*e[0],r[1]=1-i*t[1]+s*e[1],r[2]=1-i*t[2]+s*e[2],r[3]=1-i*t[3]+s*e[3],r},h.str=function(t){return"["+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+"]"}},function(t,e,i){"use strict";var r=i(2);i.d(e,"a",function(){return a});var s=r.e,a={};a.isEqual=function(t,e,i){return Math.abs(t-e)<i},a.clamp=function(t,e,i){return t<e?t=e:t>i&&(t=i),t},a.radians=function(t){return t*Math.PI/180},a.degrees=function(t){return t/Math.PI*180},a.mix=function(t,e,i){return t+(e-t)*i},a.frustumMatrix=function(t,e,i,r,a,n){var o=e-t,h=r-i,l=n-a,u=s.create([2*a/o,0,(e+t)/o,0,0,2*a/h,(r+i)/h,0,0,0,-(n+a)/l,-2*n*a/l,0,0,-1,0]);return s.transpose(u),u},a.perspectiveMatrix=function(t,e,i,r){var s=i*Math.tan(t*Math.PI/180),n=s*e;return a.frustumMatrix(-n,n,-s,s,i,r)},a.orthographicMatrix=function(t,e,i,r){var a=.5*t*e,n=.5*t,o=r-i,h=s.create([1/a,0,0,0,0,1/n,0,0,0,0,-2/o,-(r+i)/o,0,0,0,1]);return s.transpose(h),h},a.rotationMatrix=function(t,e){var i=Math.cos(e),r=Math.sin(e);switch(t){case 0:return[1,0,0,0,0,i,r,0,0,-r,i,0,0,0,0,1];case 1:return[i,0,r,0,0,1,0,0,-r,0,i,0,0,0,0,1];default:return[i,r,0,0,-r,i,0,0,0,0,1,0,0,0,0,1]}},a.scaleMatrix=function(t,e,i){return[t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1]},a.scaleMatrixf=function(t){return a.scaleMatrix(t,t,t)},a.translationMatrix=function(t,e,i){return[1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1]},a.translationMatrix2f=function(t){return a.translationMatrix(t[0],t[1],0)},a.translationMatrix3f=function(t){return a.translationMatrix(t[0],t[1],t[2])}},function(t,e,i){"use strict";var r=i(3),s=i(11);i.d(e,"a",function(){return o});var a=r.a,n=s.a,o={};o.useCredentials=!1,o.instanceCounter=0,o.validateBool=function(t,e){return"boolean"==typeof t?t:e},o.validateNumber=function(t,e,i,r){return"number"==typeof t?a.clamp(t,e,i):r},o.validateNumberArray=function(t,e,i,r,s){if(Array.isArray(t)&&t.length==e){for(var n=0;n<e;n++)t[n]=a.clamp(t[n],i[n],r[n]);return t}return s},o.validateString=function(t,e){return"string"==typeof t?t:e},o.padNumber=function(t,e){return t<0?(t=-t+"",e--,t.length>=e?"-"+t:"-"+(new Array(e-t.length+1).join("0")+t)):(t+="",t.length>=e?t:new Array(e-t.length+1).join("0")+t)},o.decodeFloat16=function(t){var e=(31744&t)>>10,i=1023&t;return(t>>15?-1:1)*(e?31===e?i?NaN:1/0:Math.pow(2,e-15)*(1+i/1024):i/1024*6103515625e-14)},o.simpleFmtObj=function(t,e){return t&&""!=t?t.replace(/\{([$a-zA-Z0-9][$a-zA-Z0-9]*)\}/g,function(t,i){return i in e?e[i]:t}):""},o.simpleWikiLinks=function(t,e){return t&&""!=t?o.simpleFmtObj(t,{copy:"©",Y:(new Date).getFullYear()}).replace(/\[([^\]]*)\]/g,function(t,i){i=i.trim();var r=i.split(" ");return-1!=r[0].indexOf("//")?e?r.length>1?""+i.substring(r[0].length):""+r[0]:r.length>1?"<a href="+r[0]+' target="blank">'+i.substring(r[0].length)+"</a>":"<a href="+r[0]+' target="blank">'+r[0]+"</a>":i}):""},o.simpleFmtObjOrCall=function(t,e,i){return t&&""!=t?t.replace(/\{([$a-zA-Z(-9][$a-zA-Z(-9]*)\}/g,function(t,r){return r in e?e[r]:i(r)}):""},o.getABGRFromHexaCode=function(t){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[4],16),parseInt(e[3],16),parseInt(e[2],16),parseInt(e[1],16)]:[0,0,0,255]},o.stringifyFunction=function(t){return"("+t+").call(self);"},o.isPowerOfTwo=function(t){return 0==(t&t-1)&&0!==t},o.nearestPowerOfTwo=function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},o.fitToPowerOfTwo=function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},o.getHash=function(t){if(!t||0===t.length)return 0;for(var e,i=0,r=0,s=t.length;r<s;r++)e=t.charCodeAt(r),i=(i<<5)-i+e,i|=0;return i},o.loadText=function(t,e,i,r,s){o.loadJSON(t,e,i,!0,r,s)},o.loadXML=function(t,e,i,r,s){var a=function(t){t=(new DOMParser).parseFromString(t,"text/xml"),e&&e(t)};o.loadJSON(t,a,i,!0,r,s)},o.loadJSON=function(t,e,i,r,s,a){var n=new XMLHttpRequest;n.onreadystatechange=function(){switch(n.readyState){case 0:case 1:case 2:case 3:break;case 4:if(n.status>=400||0==n.status){i&&i(n.status);break}var s=n.response,a=s;if(!r)try{a=JSON.parse(s)}catch(e){return console.log("JSON Parse Error ("+t+"): "+(e.message?e.message:"")),void(i&&i(n.status))}e&&e(a)}}.bind(this),n.open("GET",t,!0),n.withCredentials=s,a&&a.token&&n.setRequestHeader("Accept","token/"+a.token+", */*"),a&&a.charset&&n.overrideMimeType("text/xml; charset="+a.charset),n.send("")},o.loadBinary=function(t,e,i,r,s,a){var n=new XMLHttpRequest;n.onreadystatechange=function(){switch(n.readyState){case 0:case 1:case 2:case 3:break;case 4:if(n.status>=400||0==n.status){i&&i(n.status);break}var t=n.response;if(!t){i&&i();break}e&&e(t);break;default:i&&i()}}.bind(this),n.open("GET",t,!0),n.responseType=a||"arraybuffer",n.withCredentials=r,s&&s.token&&n.setRequestHeader("Accept","token/"+s.token+", */*"),n.send("")},o.headRequest=function(t,e,i,r,s){var a=new XMLHttpRequest;a.onreadystatechange=function(){switch(a.readyState){case 0:case 1:case 2:case 3:break;case 4:null!=e&&e(a.getAllResponseHeaders(),a.status);break;default:null!=i&&i()}}.bind(this),a.onerror=function(){null!=i&&i()}.bind(this),a.open("HEAD",t,!0),a.withCredentials=r,s&&s.token&&a.setRequestHeader("Accept","token/"+s.token+", */*"),a.send("")},o.loadImage=function(t,e,i,r,s){var a=new Image;return a.onerror=i,a.onload=e,s||(a.crossOrigin=r?"use-credentials":"anonymous"),a.src=t,a},o.getParamsFromUrl=function(t){return n.getParamsFromUrl(t)}},function(t,e,i){"use strict";var r=function(t,e,i,r,s,a){this.min=[],this.max=[],this.min[0]=null!=t?t:Number.POSITIVE_INFINITY,this.min[1]=null!=e?e:Number.POSITIVE_INFINITY,this.min[2]=null!=i?i:Number.POSITIVE_INFINITY,this.max[0]=null!=r?r:Number.NEGATIVE_INFINITY,this.max[1]=null!=s?s:Number.NEGATIVE_INFINITY,this.max[2]=null!=a?a:Number.NEGATIVE_INFINITY,this.updateMaxSize()};r.prototype.clone=function(){return new r(this.min[0],this.min[1],this.min[2],this.max[0],this.max[1],this.max[2])},r.prototype.side=function(t){return this.max[t]-this.min[t]},r.prototype.updateMaxSize=function(){this.maxSize=Math.abs(Math.max(this.max[0]-this.min[0],this.max[1]-this.min[1],this.max[2]-this.min[2]))},r.prototype.center=function(t){return null!=t?(t[0]=.5*(this.min[0]+this.max[0]),t[1]=.5*(this.min[1]+this.max[1]),t):(this.middle||(this.middle=[.5*(this.min[0]+this.max[0]),.5*(this.min[1]+this.max[1]),.5*(this.min[2]+this.max[2])],isNaN(this.middle[0])&&(this.middle[0]=0),isNaN(this.middle[1])&&(this.middle[1]=0),isNaN(this.middle[2])&&(this.middle[2]=0)),this.middle)},r.prototype.translateXY=function(t){return new r(this.min[0]-t[0],this.min[1]-t[1],this.min[2],this.max[0]-t[0],this.max[1]-t[1],this.max[2])},e.a=r},function(t,e,i){"use strict";var r=i(4),s=r.a,a=function(t,e,i,r,s,a,n,o,h,l){this.gpu=t,this.gl=t.gl,this.texture=null,this.framebuffer=null,this.size=0,this.fileSize=r,this.width=0,this.height=0,this.repeat=a||!1,this.filter=n||"linear",this.image=null,this.loaded=!1,this.trilinear=!1,this.core=i,null!=e&&this.load(e,h,l,s,o)};a.prototype.kill=function(){this.gl.deleteTexture(this.texture),this.texture=null},a.prototype.size=function(){return this.size},a.prototype.createFromData=function(t,e,i,r,s){var a=this.gl;this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),s?(s=a.REPEAT,this.repeat=!0):s=a.CLAMP_TO_EDGE,a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,s),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,s);var n=!1;switch(r){case"linear":a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);break;case"trilinear":a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR_MIPMAP_LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),n=!0;break;default:a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST)}a.pixelStorei(a.UNPACK_ALIGNMENT,1),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,t,e,0,a.RGBA,a.UNSIGNED_BYTE,i),n&&a.generateMipmap(a.TEXTURE_2D),a.bindTexture(a.TEXTURE_2D,null),this.width=t,this.height=e,this.size=t*e*4,this.loaded=!0},a.prototype.createFromImage=function(t,e,i){var r=this.gl,a=t.naturalWidth,n=t.naturalHeight,o=t;this.texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.texture),i?(i=r.REPEAT,this.repeat=!0):i=r.CLAMP_TO_EDGE,r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,i),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,i);var h=!1;switch(this.filter=e,e){case"linear":r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR);break;case"trilinear":r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),h=!0;break;default:r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST)}if((this.repeat||h)&&(!s.isPowerOfTwo(a)||!s.isPowerOfTwo(n))){a=s.nearestPowerOfTwo(a),n=s.nearestPowerOfTwo(n);var l=document.createElement("canvas");l.width=a,l.height=n;l.getContext("2d").drawImage(t,0,0,a,n),o=l}!0!==this.gpu.noTextures&&(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,o),h&&r.generateMipmap(r.TEXTURE_2D)),r.bindTexture(r.TEXTURE_2D,null),this.width=a,this.height=n,this.size=a*n*4,this.loaded=!0},a.prototype.load=function(t,e,i,r,a){this.image=s.loadImage(t,function(){null!=this.core&&this.core.killed||(this.createFromImage(this.image,this.filter,this.repeat),a||(this.image=null),e?e():this.core.map&&this.core.map.markDirty&&this.core.map.markDirty())}.bind(this),function(){null!=this.core&&this.core.killed||i&&i()}.bind(this),null,r)},a.prototype.createFramebufferFromData=function(t,e,i){var r=this.gl,s=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,s),s.width=t,s.height=e;var a=r.createTexture();r.bindTexture(r.TEXTURE_2D,a),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),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.pixelStorei(r.UNPACK_ALIGNMENT,1),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t,e,0,r.RGBA,r.UNSIGNED_BYTE,i);var n=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,n),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,t,e),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,n),this.width=t,this.height=e,this.size=t*e*4,this.texture=a,this.renderbuffer=n,this.framebuffer=s,r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindFramebuffer(r.FRAMEBUFFER,null)},a.prototype.createFramebuffer=function(t,e){if(null!=this.texture){var i=this.gl,r=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,r),r.width=t,r.height=e,i.bindTexture(i.TEXTURE_2D,this.texture);var s=i.createRenderbuffer();i.bindRenderbuffer(i.RENDERBUFFER,s),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,this.texture,0),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,s),i.bindTexture(i.TEXTURE_2D,null),i.bindRenderbuffer(i.RENDERBUFFER,null),i.bindFramebuffer(i.FRAMEBUFFER,null),this.framebuffer=r,this.renderbuffer=s}},a.prototype.readFramebufferPixels=function(t,e,i,r){if(null!=this.texture){this.gpu.bindTexture(this),this.gpu.setFramebuffer(this);var s=this.gl,a=new Uint8Array(i*r*4);return s.readPixels(t,e,i,r,s.RGBA,s.UNSIGNED_BYTE,a),this.gpu.setFramebuffer(null),a}},e.a=a},function(t,e,i){"use strict";e.a=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}},function(t,e,i){"use strict";e.a=function(t,e,i){var r=t*e;return i/Math.sqrt(1-r*r)}},function(t,e,i){"use strict";var r=i(0),s=i(10);e.a=function(t){return Math.abs(t)<r.a?t:t-i.i(s.a)(t)*Math.PI}},function(t,e,i){"use strict";e.a=function(t){return t<0?-1:1}},function(t,e,i){"use strict";i.d(e,"a",function(){return r});var r={};r.isSameOrigin=function(t){if("string"!=typeof t)return!1;var e=document.location.hostname;return r.parse(t).hostname===e},r.parse=function(t){if("string"!=typeof t)return null;var e=document.createElement("a");return e.href=t,e},r.getParamsFromUrl=function(t){var e=r.parse(t),i={},s=e.search.substring(1),a=s.split("&");if(1!=a.length||""!=a[0])for(var n=0;n<a.length;n++){var o=a[n].split("=");if(void 0===i[o[0]])i[o[0]]=o[1];else if("string"==typeof i[o[0]]){var h=[i[o[0]],o[1]];i[o[0]]=h}else i[o[0]].push(o[1])}return i},r.getHost=function(t){var e=document.createElement("a");return e.href=t,e.hostname},r.getSchema=function(t){if(-1!=t.indexOf("http://"))return"http:";if(-1!=t.indexOf("https://"))return"https:";var e=document.createElement("a");return e.href=t,e.protocol},r.getOrigin=function(t){var e=document.createElement("a");return e.href=t,e.origin?e.origin:e.protocol+"//"+e.hostname+(e.port?":"+e.port:"")},r.getBase=function(t){return t.split("?")[0].split("/").slice(0,-1).join("/")+"/"},r.getProcessUrl=function(t,e){if(!t||!e)return t;t=t.trim(),e=e.trim();var i=r.getBase(e),s=r.getSchema(e),a=r.getOrigin(e);return-1!=t.indexOf("://")?t:0==t.indexOf("//")?s+t:0==t.indexOf("/")?a+t:i+t}},function(t,e,i){"use strict";var r=i(167),s=r.a,a={};a.hasClass=function(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=a.getClass(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)},a.addClass=function(t,e){if(void 0!==t.classList)for(var i=a.splitWords(e),r=0,s=i.length;r<s;r++)t.classList.add(i[r]);else if(!a.hasClass(t,e)){var n=a.getClass(t);a.setClass(t,(n?n+" ":"")+e)}},a.removeClass=function(t,e){void 0!==t.classList?t.classList.remove(e):a.setClass(t,(" "+a.getClass(t)+" ").replace(" "+e+" "," ").trim())},a.setClass=function(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e},a.getClass=function(t){return void 0===t.className.baseVal?t.className:t.className.baseVal},a.preventDefault=function(t){t=t instanceof s?t.event:t,t.preventDefault?t.preventDefault():t.returnValue=!1},a.stopPropagation=function(t){t=t instanceof s?t.event:t,t.stopPropagation()},a.disableTextSelection=function(){window.addEventListener("selectstart",a.preventDefault)},a.enableTextSelection=function(){window.removeEventListener("selectstart",a.preventDefault)},a.disableImageDrag=function(){window.addEventListener("dragstart",a.preventDefault)},a.enableImageDrag=function(){window.removeEventListener("dragstart",a.preventDefault)},a.disableContexMenu=function(t){t.addEventListener("contextmenu",a.preventDefault)},a.enableContexMenu=function(t){t.removeEventListener("contextmenu",a.preventDefault)},a.getSupportedProperty=function(t){for(var e=document.documentElement.style,i=0,r=t.length;i<r;i++)if(t[i]in e)return t[i];return!1},a.stampCounter=0,a.stamp=function(t){return t.vtsStamp=t.vtsStamp||++a.stampCounter,t.vtsStamp},a.TRANSFORM=a.getSupportedProperty(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),e.a=a},function(t,e,i){"use strict";function r(t){return(t?"Core: ":"")+"2.14.9"}function s(){S.init();var t=document.createElement("canvas");if(null==t)return!1;if(t.width=1024,t.height=768,null==t.getContext)return!1;var e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(t){return!1}return!!e}var a=i(21),n=i(138),o=i(119),h=i(164),l=i(163),u=i(31),c=i(136),d=i(4),p=i(11),f=i(22);i.d(e,"c",function(){return A}),i.d(e,"a",function(){return r}),i.d(e,"b",function(){return s});var g=n.a,m=o.a,v=h.a,y=l.a,b=u.a,x=c.a,M=d.a,w=p.a,S=f.a,A=function(t,e,i){var r=navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage;this.killed=!1,this.config={map:null,mapCache:1100,mapGPUCache:600,mapMetatileCache:60,mapTexelSizeFit:1.1,mapMaxHiresLodLevels:2,mapLowresBackground:0,mapDownloadThreads:20,mapMaxProcessingTime:2e4,mapMobileMode:!1,mapMobileModeAutodect:!0,mapMobileDetailDegradation:1,mapNavSamplesPerViewExtent:4,mapIgnoreNavtiles:!1,mapVirtualSurfaces:!0,mapAllowHires:!0,mapAllowLowres:!0,mapAllowSmartSwitching:!0,mapDisableCulling:!1,mapPreciseCulling:!0,mapHeightLodBlend:!0,mapHeightNodeBlend:!0,mapBasicTileSequence:!1,mapPreciseBBoxTest:!1,mapPreciseDistanceTest:!1,mapHeightfiledWhenUnloaded:!0,mapForceMetatileV3:!1,mapSmartNodeParsing:!0,mapLoadErrorRetryTime:3e3,mapLoadErrorMaxRetryCount:3,mapLoadMode:"topdown",mapGeodataLoadMode:"fit",mapGridMode:"linear",mapGridSurrogatez:!1,mapXhrImageLoad:!0,mapStoreLoadStats:!1,mapRefreshCycles:3,mapDegradeHorizon:!1,mapDegradeHorizonParams:[1,1500,97500,3500],mapDefaultFont:"//cdn.melown.com/libs/vtsjs/fonts/noto-basic/1.0.0/noto.fnt",mapFog:!0,mapMetricUnits:!("en"==r||0==r.indexOf("en-")),rendererAntialiasing:!0,rendererAllowScreenshots:!1,inspector:!0,authorization:null,mario:!1},this.configStorage={},this.element=t,this.coreInterface=i,this.ready=!1,this.listeners=[],this.listenerCounter=0,this.tokenCookieHost=null,this.tokenIFrame=null,this.xhrParams={},this.inspector=null!=m?new m(this):null,this.setConfigParams(e),this.map=null,this.mapInterface=null,this.renderer=new v(this,this.element,null,this.onResize.bind(this),this.config),this.rendererInterface=new y(this.renderer),this.proj4=a.a,S.init(),this.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},window.performance=window.performance||{},performance.now=function(){return performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow||function(){return(new Date).getTime()}}(),this.loadMap(this.config.map),this.requestAnimFrame.call(window,this.onUpdate.bind(this))};A.prototype.onResize=function(){null!=this.map&&this.map.markDirty()},A.prototype.loadMap=function(t){if(null!=this.map&&this.destroyMap(),null!=t){t=w.getProcessUrl(t,window.location.href),this.tokenCookieLoaded=!0,this.mapConfigData=null,this.tokenExpiration=null,this.tokenExpirationCallback=null,this.tokenExpirationLoop=!1,this.tokenCanBeSkiped=!0,this.mapRunnig=!1;var e=function(){if((this.tokenCookieLoaded||this.tokenCanBeSkiped)&&this.mapConfigData&&!this.mapRunnig){this.mapRunnig=!0;var e=this.mapConfigData;this.callListener("map-mapconfig-loaded",e),this.map=new g(this,e,t,this.config),this.mapInterface=new x(this.map),this.setConfigParams(this.map.browserOptions),this.setConfigParams(this.configStorage),this.config.position&&(this.map.setPosition(this.config.position),this.config.position=null),this.config.view&&(this.map.setView(this.config.view),this.config.view=null)}}.bind(this),i=function(t){this.mapConfigData=t,e()}.bind(this),r=function(){}.bind(this),s=function(e){this.tokenLoaded=!0,this.xhrParams.token=e.token,this.xhrParams.tokenHeader=e.header,this.tokenExpiration=1e3*e.expires,this.tokenExpirationCallback=function(){this.tokenExpiration=null,this.tokenExpirationLoop=!0,"string"==typeof this.config.authorization?M.loadJSON(this.config.authorization,s,a,null,M.useCredentials,this.xhrParams):this.config.authorization(s)}.bind(this),this.tokenExpirationLoop||o(t),"string"==typeof this.config.authorization?h(e.cookieInjector,this.config.authorization):h(e.cookieInjector,t)}.bind(this),a=function(){console.log("auth token not loaded"),this.tokenCanBeSkiped&&o(t)}.bind(this),n=function(){document.body.removeChild(this.tokenIFrame),this.tokenIFrame=null,this.tokenCookieLoaded=!0,e()}.bind(this),o=function(t){M.loadJSON(t,i,r,null,M.useCredentials,this.xhrParams)}.bind(this),h=function(t,e){t=w.getProcessUrl(t,e),this.tokenCookieHost=w.getHost(t);var i=document.createElement("iframe");this.tokenIFrame=i,i.onload=n,i.src=t,i.style.display="none",document.body.appendChild(i)}.bind(this);this.config.authorization?(this.tokenCookieLoaded=!1,"string"==typeof this.config.authorization?M.loadJSON(this.config.authorization,s,a,null,M.useCredentials,this.xhrParams):this.config.authorization(s)):o(t)}},A.prototype.destroy=function(){this.killed||(this.destroyMap(),this.renderer&&this.renderer.kill(),this.element=null,this.killed=!0)},A.prototype.destroyMap=function(){this.map&&(this.map.kill(),this.map=null,this.mapInterface=null,this.callListener("map-unloaded",{}))},A.prototype.getMap=function(){return this.map},A.prototype.getMapInterface=function(){return this.mapInterface},A.prototype.getRenderer=function(){return this.renderer},A.prototype.getRendererInterface=function(){return this.rendererInterface},A.prototype.getProj4=function(){return this.proj4},A.prototype.getOption=function(){},A.prototype.setOption=function(){},A.prototype.on=function(t,e){if(!this.killed&&null!=e)return this.listenerCounter++,this.listeners.push({name:t,listener:e,id:this.listenerCounter}),function(t){this.removeListener(t)}.bind(this,this.listenerCounter)},A.prototype.callListener=function(t,e,i){for(var r=0;r<this.listeners.length;r++)this.listeners[r].name==t&&this.listeners[r].listener(e);i&&console.log("event "+t+": "+JSON.stringify(e))},A.prototype.removeListener=function(t){for(var e=0;e<this.listeners.length;e++)if(this.listeners[e].id==t)return void this.listeners.splice(e,1)},A.prototype.markDirty=function(){null!=this.map&&this.map.markDirty()},A.prototype.onUpdate=function(){this.killed||(null!=this.map&&(!this.map.srsReady&&this.map.isReferenceFrameReady()&&(this.map.srsReady=!0,this.callListener("map-loaded",{browserOptions:this.map.browserOptions})),this.map.update()),this.callListener("tick",{}),this.requestAnimFrame.call(window,this.onUpdate.bind(this)))},A.prototype.setConfigParams=function(t){if("object"==typeof t&&null!==t)for(var e in t)this.setConfigParam(e,t[e])},A.prototype.setConfigParam=function(t,e){"pos"==t||"position"==t||"view"==t?this.getMap()?("view"==t?this.getMap().setView(e):this.getMap().setPosition(new b(e)),this.configStorage[t]&&delete this.configStorage[t]):this.configStorage[t]=e:"map"==t?this.config.map=M.validateString(e,null):"mapVirtualSurfaces"==t?this.config.mapVirtualSurfaces=M.validateBool(e,!0):"inspector"==t?this.config.inspector=M.validateBool(e,!0):"authorization"==t?this.config.authorization="string"==typeof e||"function"==typeof e?e:null:(0!=t.indexOf("map")&&"mario"!=t||(this.configStorage[t]=e,null!=this.getMap()&&this.getMap().setConfigParam(t,e)),0==t.indexOf("renderer")&&this.setRendererConfigParam(t,e),0==t.indexOf("debug")&&(this.configStorage[t]=e,null!=this.getMap()&&this.inspector.setParameter(t,e)))},A.prototype.getConfigParam=function(t){return"map"==t?this.config.map:"inspector"==t?this.config.inspector:0==t.indexOf("map")&&null!=this.getMap()?this.getMap().getConfigParam(t):0==t.indexOf("renderer")?this.getRendererConfigParam(t):void 0},A.prototype.setRendererConfigParam=function(t,e){switch(t){case"rendererAntialiasing":this.config.rendererAntialiasing=M.validateBool(e,!0);break;case"rendererAllowScreenshots":this.config.rendererAllowScreenshots=M.validateBool(e,!1)}},A.prototype.getRendererConfigParam=function(t){switch(t){case"rendererAntialiasing":return this.config.rendererAntialiasing;case"rendererAllowScreenshots":return this.config.rendererAllowScreenshots}}},function(t,e,i){"use strict";e.a=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))}},function(t,e,i){"use strict";e.a=function(t){return.375*t*(1+.25*t*(1+.46875*t))}},function(t,e,i){"use strict";e.a=function(t){return.05859375*t*t*(1+.75*t)}},function(t,e,i){"use strict";e.a=function(t){return t*t*t*(35/3072)}},function(t,e,i){"use strict";e.a=function(t,e,i,r,s){return t*s-e*Math.sin(2*s)+i*Math.sin(4*s)-r*Math.sin(6*s)}},function(t,e,i){"use strict";var r=i(0);e.a=function(t,e){for(var i,s,a=.5*t,n=r.a-2*Math.atan(e),o=0;o<=15;o++)if(i=t*Math.sin(n),s=r.a-2*Math.atan(e*Math.pow((1-i)/(1+i),a))-n,n+=s,Math.abs(s)<=1e-10)return n;return-9999}},function(t,e,i){"use strict";var r=i(0);e.a=function(t,e,i){var s=t*i,a=.5*t;return s=Math.pow((1-s)/(1+s),a),Math.tan(.5*(r.a-e))/s}},function(t,e,i){"use strict";var r=i(74),s=i(24),a=i(59),n=i(39),o=i(41),h=i(44),l=i(34),u=i(110),c=i(112);r.a.defaultDatum="WGS84",r.a.Proj=s.a,r.a.WGS84=new r.a.Proj("WGS84"),r.a.Point=a.a,r.a.toPoint=n.a,r.a.defs=o.a,r.a.transform=h.a,r.a.mgrs=l.a,r.a.version=u.a,i.i(c.a)(r.a),e.a=r.a},function(t,e,i){"use strict";i.d(e,"a",function(){return r});var r={initialized:!1,init:function(){var t=r;t.browser=t.searchString(t.dataBrowser)||"An unknown browser",t.version=t.searchVersion(navigator.userAgent.toLowerCase())||t.searchVersion(navigator.appVersion)||"an unknown version",t.OS=t.searchString(t.dataOS)||"an unknown os: ua: "+navigator.userAgent+" pl: "+navigator.platform,t.mobile="iphone/ipod"==t.OS||"android"==t.OS||"ipad"==t.OS||"windows ce"==t.OS||"windows phone"==t.OS||"kindle"==t.OS,t.mobileAndroid="android"==t.OS,t.initialized=!0},getBrowser:function(){return r.initialized||r.init(),r.browser},getBrowserVersion:function(){return r.initialized||r.init(),r.browser},getOS:function(){return r.initialized||r.init(),r.browser},isMobile:function(){return r.initialized||r.init(),r.mobile},isAndroid:function(){return r.initialized||r.init(),r.mobileAndroid},searchString:function(t){for(var e=r,i=0;i<t.length;i++){var s=t[i].string,a=t[i].prop;if(e.versionSearchString=t[i].versionSearch||t[i].identity,s){if(-1!=s.toLowerCase().indexOf(t[i].subString))return null!=t[i].version&&(e.version=t[i].version),t[i].identity}else if(a)return t[i].identity}},searchVersion:function(t){var e=r;if(null!=e.version)return e.version;var i=t.indexOf(e.versionSearchString);if(-1!=i)return parseFloat(t.substring(i+e.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"chrome",identity:"chrome"},{string:navigator.userAgent,subString:"firefox",identity:"firefox"},{string:navigator.vendor,subString:"apple",identity:"safari",versionSearch:"version"},{prop:window.opera,identity:"opera",versionSearch:"version"},{string:navigator.vendor,subString:"icab",identity:"icab"},{string:navigator.vendor,subString:"kde",identity:"konqueror"},{string:navigator.vendor,subString:"camino",identity:"camino"},{string:navigator.userAgent,subString:"netscape",identity:"netscape"},{string:navigator.userAgent,subString:"msie",identity:"explorer",versionSearch:"msie"},{string:navigator.userAgent,subString:"trident/",identity:"explorer",version:"11"},{string:navigator.userAgent,subString:"edge/",identity:"explorer",version:"12"},{string:navigator.userAgent,subString:"omniweb",versionSearch:"omniweb/",identity:"omniweb"},{string:navigator.userAgent,subString:"silk",versionSearch:"silk/",identity:"silk"},{string:navigator.userAgent,subString:"gecko",identity:"mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"mozilla",identity:"netscape",versionSearch:"mozilla"}],dataOS:[{string:navigator.userAgent,subString:"windows ce",identity:"windows ce"},{string:navigator.userAgent,subString:"windows phone",identity:"windows phone"},{string:navigator.platform,subString:"win",identity:"windows"},{string:navigator.platform,subString:"mac",identity:"mac"},{string:navigator.userAgent,subString:"iphone",identity:"iphone/ipod"},{string:navigator.userAgent,subString:"ipod",identity:"iphone/ipod"},{string:navigator.userAgent,subString:"ipad",identity:"ipad"},{string:navigator.userAgent,subString:"android",identity:"android"},{string:navigator.userAgent,subString:"silk",identity:"kindle"},{string:navigator.userAgent,subString:"blackberry",identity:"blackberry"},{string:navigator.platform,subString:"linux",identity:"linux"}]}},function(t,e,i){var r,s;!function(i){"use strict";var a={};a.Constants={},a.Math={},a.Accumulator={},function(t){t.WGS84={a:6378137,f:1/298.257223563},t.version={major:1,minor:48,patch:0},t.version_string="1.48"}(a.Constants),function(t){t.digits=53,t.epsilon=Math.pow(.5,t.digits-1),t.degree=Math.PI/180,t.sq=function(t){return t*t},t.hypot=function(t,e){var i,r;return t=Math.abs(t),e=Math.abs(e),i=Math.max(t,e),r=Math.min(t,e)/(i||1),i*Math.sqrt(1+r*r)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.log1p=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i},t.atanh=function(e){var i=Math.abs(e);return i=t.log1p(2*i/(1-i))/2,e<0?-i:i},t.copysign=function(t,e){return Math.abs(t)*(e<0||0===e&&1/e<0?-1:1)},t.sum=function(t,e){var i,r=t+e,s=r-e,a=r-s;return s-=t,a-=e,i=-(s+a),{s:r,t:i}},t.polyval=function(t,e,i,r){for(var s=t<0?0:e[i++];--t>=0;)s=s*r+e[i++];return s},t.AngRound=function(t){if(0===t)return t;var e=1/16,i=Math.abs(t);return i=i<e?e-(e-i):i,t<0?-i:i},t.AngNormalize=function(t){return t%=360,t<=-180?t+360:t<=180?t:t-360},t.LatFix=function(t){return Math.abs(t)>90?Number.NaN:t},t.AngDiff=function(e,i){var r=t.sum(t.AngNormalize(-e),t.AngNormalize(i)),s=t.AngNormalize(r.s),a=r.t;return t.sum(180===s&&a>0?-180:s,a)},t.sincosd=function(t){var e,i,r,s,a,n;switch(e=t%360,i=Math.floor(e/90+.5),e-=90*i,e*=this.degree,r=Math.sin(e),s=Math.cos(e),3&i){case 0:a=r,n=s;break;case 1:a=s,n=-r;break;case 2:a=-r,n=-s;break;default:a=-s,n=r}return t&&(a+=0,n+=0),{s:a,c:n}},t.atan2d=function(t,e){var i,r,s=0;switch(Math.abs(t)>Math.abs(e)&&(i=e,e=t,t=i,s=2),e<0&&(e=-e,++s),r=Math.atan2(t,e)/this.degree,s){case 1:r=(t>=0?180:-180)-r;break;case 2:r=90-r;break;case 3:r=-90+r}return r}}(a.Math),function(t,e){t.Accumulator=function(t){this.Set(t)},t.Accumulator.prototype.Set=function(e){e||(e=0),e.constructor===t.Accumulator?(this._s=e._s,this._t=e._t):(this._s=e,this._t=0)},t.Accumulator.prototype.Add=function(t){var i=e.sum(t,this._t),r=e.sum(i.s,this._s);i=i.t,this._s=r.s,this._t=r.t,0===this._s?this._s=i:this._t+=i},t.Accumulator.prototype.Sum=function(e){var i;return e?(i=new t.Accumulator(this),i.Add(e),i._s):this._s},t.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1}}(a.Accumulator,a.Math),a.Geodesic={},a.GeodesicLine={},a.PolygonArea={},function(t,e,i,r,s){var a,n,o,h,l,u,c,d,p,f,g,m=20+r.digits+10,v=r.epsilon,y=200*v,b=Math.sqrt(v),x=v*y,M=1e3*b;t.tiny_=Math.sqrt(Number.MIN_VALUE),t.nC1_=6,t.nC1p_=6,t.nC2_=6,t.nC3_=6,t.nC4_=6,a=t.nC3_*(t.nC3_-1)/2,n=t.nC4_*(t.nC4_+1)/2,t.CAP_C1=1,t.CAP_C1p=2,t.CAP_C2=4,t.CAP_C3=8,t.CAP_C4=16,t.NONE=0,t.ARC=64,t.LATITUDE=128,t.LONGITUDE=256|t.CAP_C3,t.AZIMUTH=512,t.DISTANCE=1024|t.CAP_C1,t.STANDARD=t.LATITUDE|t.LONGITUDE|t.AZIMUTH|t.DISTANCE,t.DISTANCE_IN=2048|t.CAP_C1|t.CAP_C1p,t.REDUCEDLENGTH=4096|t.CAP_C1|t.CAP_C2,t.GEODESICSCALE=8192|t.CAP_C1|t.CAP_C2,t.AREA=16384|t.CAP_C4,t.ALL=32671,t.LONG_UNROLL=32768,t.OUT_MASK=32640|t.LONG_UNROLL,t.SinCosSeries=function(t,e,i,r){var s=r.length,a=s-(t?1:0),n=2*(i-e)*(i+e),o=1&a?r[--s]:0,h=0;for(a=Math.floor(a/2);a--;)h=n*o-h+r[--s],o=n*h-o+r[--s];return t?2*e*i*o:i*(o-h)},o=function(t,e){var i,s,a,n,o,h,l,u,c,d,p,f,g=r.sq(t),m=r.sq(e),v=(g+m-1)/6;return 0===m&&v<=0?i=0:(s=g*m/4,a=r.sq(v),n=v*a,o=s*(s+2*n),h=v,o>=0?(l=s+n,l+=l<0?-Math.sqrt(o):Math.sqrt(o),u=r.cbrt(l),h+=u+(0!==u?a/u:0)):(c=Math.atan2(Math.sqrt(-o),-(s+n)),h+=2*v*Math.cos(c/3)),d=Math.sqrt(r.sq(h)+m),p=h<0?m/(d-h):h+d,f=(p-m)/(2*d),i=p/(Math.sqrt(p+r.sq(f))+f)),i},h=[1,4,64,0,256],t.A1m1f=function(t){var e=Math.floor(3);return(r.polyval(e,h,0,r.sq(t))/h[e+1]+t)/(1-t)},l=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],t.C1f=function(e,i){var s,a,n=r.sq(e),o=e,h=0;for(s=1;s<=t.nC1_;++s)a=Math.floor((t.nC1_-s)/2),i[s]=o*r.polyval(a,l,h,n)/l[h+a+1],h+=a+2,o*=e},u=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],t.C1pf=function(e,i){var s,a,n=r.sq(e),o=e,h=0;for(s=1;s<=t.nC1p_;++s)a=Math.floor((t.nC1p_-s)/2),i[s]=o*r.polyval(a,u,h,n)/u[h+a+1],h+=a+2,o*=e},c=[-11,-28,-192,0,256],t.A2m1f=function(t){var e=Math.floor(3);return(r.polyval(e,c,0,r.sq(t))/c[e+1]-t)/(1+t)},d=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],t.C2f=function(e,i){var s,a,n=r.sq(e),o=e,h=0;for(s=1;s<=t.nC2_;++s)a=Math.floor((t.nC2_-s)/2),i[s]=o*r.polyval(a,d,h,n)/d[h+a+1],h+=a+2,o*=e},t.Geodesic=function(t,e){if(this.a=t,this.f=e,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/r.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(r.sq(this.a)+r.sq(this._b)*(0===this._e2?1:(this._e2>0?r.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*b/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(6),this._C3x=new Array(a),this._C4x=new Array(n),this.A3coeff(),this.C3coeff(),this.C4coeff()},p=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],t.Geodesic.prototype.A3coeff=function(){var t,e,i=0,s=0;for(t=5;t>=0;--t)e=Math.min(6-t-1,t),this._A3x[s++]=r.polyval(e,p,i,this._n)/p[i+e+1],i+=e+2},f=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],t.Geodesic.prototype.C3coeff=function(){var e,i,s,a=0,n=0;for(e=1;e<t.nC3_;++e)for(i=t.nC3_-1;i>=e;--i)s=Math.min(t.nC3_-i-1,i),this._C3x[n++]=r.polyval(s,f,a,this._n)/f[a+s+1],a+=s+2},g=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],t.Geodesic.prototype.C4coeff=function(){var e,i,s,a=0,n=0;for(e=0;e<t.nC4_;++e)for(i=t.nC4_-1;i>=e;--i)s=t.nC4_-i-1,this._C4x[n++]=r.polyval(s,g,a,this._n)/g[a+s+1],a+=s+2},t.Geodesic.prototype.A3f=function(t){return r.polyval(5,this._A3x,0,t)},t.Geodesic.prototype.C3f=function(e,i){var s,a,n=1,o=0;for(s=1;s<t.nC3_;++s)a=t.nC3_-s-1,n*=e,i[s]=n*r.polyval(a,this._C3x,o,e),o+=a+1},t.Geodesic.prototype.C4f=function(e,i){var s,a,n=1,o=0;for(s=0;s<t.nC4_;++s)a=t.nC4_-s-1,i[s]=n*r.polyval(a,this._C4x,o,e),o+=a+1,n*=e},t.Geodesic.prototype.Lengths=function(e,i,r,s,a,n,o,h,l,u,c,d,p){c&=t.OUT_MASK;var f,g,m,v,y,b={},x=0,M=0,w=0,S=0;if(c&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&(w=t.A1m1f(e),t.C1f(e,d),c&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(S=t.A2m1f(e),t.C2f(e,p),x=w-S,S=1+S),w=1+w),c&t.DISTANCE)f=t.SinCosSeries(!0,n,o,d)-t.SinCosSeries(!0,r,s,d),b.s12b=w*(i+f),c&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(g=t.SinCosSeries(!0,n,o,p)-t.SinCosSeries(!0,r,s,p),M=x*i+(w*f-S*g));else if(c&(t.REDUCEDLENGTH|t.GEODESICSCALE)){for(m=1;m<=t.nC2_;++m)p[m]=w*d[m]-S*p[m];M=x*i+(t.SinCosSeries(!0,n,o,p)-t.SinCosSeries(!0,r,s,p))}return c&t.REDUCEDLENGTH&&(b.m0=x,b.m12b=h*(s*n)-a*(r*o)-s*o*M),c&t.GEODESICSCALE&&(v=s*o+r*n,y=this._ep2*(l-u)*(l+u)/(a+h),b.M12=v+(y*n-o*M)*r/a,b.M21=v-(y*r-s*M)*n/h),b},t.Geodesic.prototype.InverseStart=function(e,i,s,a,n,h,l,u,c,d,p){var f,g,m,v,b,x,w,S,A,C,T,P,E,L,k,I,N,F,B,R,_,D,U,z={},G=a*i-n*e,V=n*i+a*e;return z.sig12=-1,f=a*i,f+=n*e,g=V>=0&&G<.5&&n*l<.5,g?(v=r.sq(e+a),v/=v+r.sq(i+n),z.dnm=Math.sqrt(1+this._ep2*v),m=l/(this._f1*z.dnm),b=Math.sin(m),x=Math.cos(m)):(b=u,x=c),z.salp1=n*b,z.calp1=x>=0?G+n*e*r.sq(b)/(1+x):f-n*e*r.sq(b)/(1-x),S=r.hypot(z.salp1,z.calp1),A=e*a+i*n*x,g&&S<this._etol2?(z.salp2=i*b,z.calp2=G-i*a*(x>=0?r.sq(b)/(1+x):1-x),w=r.hypot(z.salp2,z.calp2),z.salp2/=w,z.calp2/=w,z.sig12=Math.atan2(S,A)):Math.abs(this._n)>.1||A>=0||S>=6*Math.abs(this._n)*Math.PI*r.sq(i)||(U=Math.atan2(-u,-c),this.f>=0?(L=r.sq(e)*this._ep2,k=L/(2*(1+Math.sqrt(1+L))+L),P=this.f*i*this.A3f(k)*Math.PI,E=P*i,C=U/P,T=f/E):(I=n*i-a*e,N=Math.atan2(f,I),R=this.Lengths(this._n,Math.PI+N,e,-i,s,a,n,h,i,n,t.REDUCEDLENGTH,d,p),F=R.m12b,B=R.m0,C=F/(i*n*B*Math.PI)-1,E=C<-.01?f/C:-this.f*r.sq(i)*Math.PI,P=E/i,T=l/P),T>-y&&C>-1-M?this.f>=0?(z.salp1=Math.min(1,-C),z.calp1=-Math.sqrt(1-r.sq(z.salp1))):(z.calp1=Math.max(C>-y?0:-1,C),z.salp1=Math.sqrt(1-r.sq(z.calp1))):(_=o(C,T),D=P*(this.f>=0?-C*_/(1+_):-T*(1+_)/_),b=Math.sin(D),x=-Math.cos(D),z.salp1=n*b,z.calp1=f-n*e*r.sq(b)/(1-x))),z.salp1<=0?(z.salp1=1,z.calp1=0):(w=r.hypot(z.salp1,z.calp1),z.salp1/=w,z.calp1/=w),z},t.Geodesic.prototype.Lambda12=function(e,i,s,a,n,o,h,l,u,c,d,p,f,g){var m,v,y,b,x,M,w,S,A,C,T,P,E,L={};return 0===e&&0===l&&(l=-t.tiny_),v=h*i,y=r.hypot(l,h*e),L.ssig1=e,b=v*e,L.csig1=x=l*i,m=r.hypot(L.ssig1,L.csig1),L.ssig1/=m,L.csig1/=m,L.salp2=n!==i?v/n:h,L.calp2=n!==i||Math.abs(a)!==-e?Math.sqrt(r.sq(l*i)+(i<-e?(n-i)*(i+n):(e-a)*(e+a)))/n:Math.abs(l),L.ssig2=a,M=v*a,L.csig2=w=L.calp2*n,m=r.hypot(L.ssig2,L.csig2),L.ssig2/=m,L.csig2/=m,L.sig12=Math.atan2(Math.max(0,L.csig1*L.ssig2-L.ssig1*L.csig2),L.csig1*L.csig2+L.ssig1*L.ssig2),S=Math.max(0,x*M-b*w),A=x*w+b*M,T=Math.atan2(S*c-A*u,A*c+S*u),P=r.sq(y)*this._ep2,L.eps=P/(2*(1+Math.sqrt(1+P))+P),this.C3f(L.eps,g),C=t.SinCosSeries(!0,L.ssig2,L.csig2,g)-t.SinCosSeries(!0,L.ssig1,L.csig1,g),L.domg12=-this.f*this.A3f(L.eps)*v*(L.sig12+C),L.lam12=T+L.domg12,d&&(0===L.calp2?L.dlam12=-2*this._f1*s/e:(E=this.Lengths(L.eps,L.sig12,L.ssig1,L.csig1,s,L.ssig2,L.csig2,o,i,n,t.REDUCEDLENGTH,p,f),L.dlam12=E.m12b,L.dlam12*=this._f1/(L.calp2*n))),L},t.Geodesic.prototype.Inverse=function(e,i,s,a,n){var o,h;return n||(n=t.STANDARD),n===t.LONG_UNROLL&&(n|=t.STANDARD),n&=t.OUT_MASK,o=this.InverseInt(e,i,s,a,n),h=o.vals,n&t.AZIMUTH&&(h.azi1=r.atan2d(o.salp1,o.calp1),h.azi2=r.atan2d(o.salp2,o.calp2)),h},t.Geodesic.prototype.InverseInt=function(e,i,s,a,n){var o,h,l,u,c,d,p,f,g,y,b,M,w,S,A,C,T,P,E,L,k,I,N,F,B,R,_,D,U,z,G,V,O,j,H,q,J,Z,Y,W,X,Q,K,$,tt,et,it,rt,st,at,nt,ot,ht,lt,ut,ct,dt,pt,ft,gt,mt,vt,yt,bt,xt,Mt={};if(Mt.lat1=e=r.LatFix(e),Mt.lat2=s=r.LatFix(s),e=r.AngRound(e),s=r.AngRound(s),o=r.AngDiff(i,a),h=o.t,o=o.s,n&t.LONG_UNROLL?(Mt.lon1=i,Mt.lon2=i+o+h):(Mt.lon1=r.AngNormalize(i),Mt.lon2=r.AngNormalize(a)),l=o>=0?1:-1,o=l*r.AngRound(o),h=r.AngRound(180-o-l*h),A=o*r.degree,u=r.sincosd(o>90?h:o),C=u.s,T=(o>90?-1:1)*u.c,c=Math.abs(e)<Math.abs(s)?-1:1,c<0&&(l*=-1,u=e,e=s,s=u),d=e<0?1:-1,e*=d,s*=d,u=r.sincosd(e),p=this._f1*u.s,f=u.c,u=r.hypot(p,f),p/=u,f/=u,f=Math.max(t.tiny_,f),u=r.sincosd(s),g=this._f1*u.s,y=u.c,u=r.hypot(g,y),g/=u,y/=u,y=Math.max(t.tiny_,y),f<-p?y===f&&(g=g<0?p:-p):Math.abs(g)===-p&&(y=f),w=Math.sqrt(1+this._ep2*r.sq(p)),S=Math.sqrt(1+this._ep2*r.sq(g)),N=new Array(t.nC1_+1),F=new Array(t.nC2_+1),B=new Array(t.nC3_),R=-90===e||0===C,R&&(E=T,L=C,k=1,I=0,D=p,U=E*f,z=g,G=k*y,P=Math.atan2(Math.max(0,U*z-D*G),U*G+D*z),_=this.Lengths(this._n,P,D,U,w,z,G,S,f,y,n|t.DISTANCE|t.REDUCEDLENGTH,N,F),b=_.s12b,M=_.m12b,0!=(n&t.GEODESICSCALE)&&(Mt.M12=_.M12,Mt.M21=_.M21),P<1||M>=0?(P<3*t.tiny_&&(P=M=b=0),M*=this._b,b*=this._b,Mt.a12=P/r.degree):R=!1),dt=2,!R&&0===p&&(this.f<=0||h>=180*this.f))E=k=0,L=I=1,b=this.a*A,P=O=A/this._f1,M=this._b*Math.sin(P),n&t.GEODESICSCALE&&(Mt.M12=Mt.M21=Math.cos(P)),Mt.a12=o/this._f1;else if(!R)if(_=this.InverseStart(p,f,w,g,y,S,A,C,T,N,F),P=_.sig12,L=_.salp1,E=_.calp1,P>=0)I=_.salp2,k=_.calp2,j=_.dnm,b=P*this._b*j,M=r.sq(j)*this._b*Math.sin(P/j),n&t.GEODESICSCALE&&(Mt.M12=Mt.M21=Math.cos(P/j)),Mt.a12=P/r.degree,O=A/(this._f1*j);else{for(H=0,q=t.tiny_,J=1,Z=t.tiny_,Y=-1,W=!1,X=!1;H<m&&(_=this.Lambda12(p,f,w,g,y,S,L,E,C,T,H<20,N,F,B),Q=_.lam12,I=_.salp2,k=_.calp2,P=_.sig12,D=_.ssig1,U=_.csig1,z=_.ssig2,G=_.csig2,V=_.eps,ft=_.domg12,K=_.dlam12,!X&&Math.abs(Q)>=(W?8:1)*v);++H)Q>0&&(H<20||E/L>Y/Z)?(Z=L,Y=E):Q<0&&(H<20||E/L<J/q)&&(q=L,J=E),H<20&&K>0&&($=-Q/K,tt=Math.sin($),et=Math.cos($),(it=L*et+E*tt)>0&&Math.abs($)<Math.PI)?(E=E*et-L*tt,L=it,u=r.hypot(L,E),L/=u,E/=u,W=Math.abs(Q)<=16*v):(L=(q+Z)/2,E=(J+Y)/2,u=r.hypot(L,E),L/=u,E/=u,W=!1,X=Math.abs(q-L)+(J-E)<x||Math.abs(L-Z)+(E-Y)<x);rt=n|(n&(t.REDUCEDLENGTH|t.GEODESICSCALE)?t.DISTANCE:t.NONE),_=this.Lengths(V,P,D,U,w,z,G,S,f,y,rt,N,F),b=_.s12b,M=_.m12b,0!=(n&t.GEODESICSCALE)&&(Mt.M12=_.M12,Mt.M21=_.M21),M*=this._b,b*=this._b,Mt.a12=P/r.degree,n&t.AREA&&(bt=Math.sin(ft),xt=Math.cos(ft),dt=C*xt-T*bt,pt=T*xt+C*bt)}return n&t.DISTANCE&&(Mt.s12=0+b),n&t.REDUCEDLENGTH&&(Mt.m12=0+M),n&t.AREA&&(st=L*f,at=r.hypot(E,L*p),0!==at&&0!==st?(D=p,U=E*f,z=g,G=k*y,ot=r.sq(at)*this._ep2,V=ot/(2*(1+Math.sqrt(1+ot))+ot),ht=r.sq(this.a)*at*st*this._e2,u=r.hypot(D,U),D/=u,U/=u,u=r.hypot(z,G),z/=u,G/=u,lt=new Array(t.nC4_),this.C4f(V,lt),ut=t.SinCosSeries(!1,D,U,lt),ct=t.SinCosSeries(!1,z,G,lt),Mt.S12=ht*(ct-ut)):Mt.S12=0,!R&&dt>1&&(dt=Math.sin(O),pt=Math.cos(O)),!R&&pt>-.7071&&g-p<1.75?(ft=1+pt,gt=1+f,mt=1+y,nt=2*Math.atan2(dt*(p*mt+g*gt),ft*(p*g+gt*mt))):(vt=I*E-k*L,yt=k*E+I*L,0===vt&&yt<0&&(vt=t.tiny_*E,yt=-1),nt=Math.atan2(vt,yt)),Mt.S12+=this._c2*nt,Mt.S12*=c*l*d,Mt.S12+=0),c<0&&(u=L,L=I,I=u,u=E,E=k,k=u,n&t.GEODESICSCALE&&(u=Mt.M12,Mt.M12=Mt.M21,Mt.M21=u)),L*=c*l,E*=c*d,I*=c*l,k*=c*d,{vals:Mt,salp1:L,calp1:E,salp2:I,calp2:k}},t.Geodesic.prototype.GenDirect=function(i,r,s,a,n,o){var h;return o?o===t.LONG_UNROLL&&(o|=t.STANDARD):o=t.STANDARD,a||(o|=t.DISTANCE_IN),h=new e.GeodesicLine(this,i,r,s,o),h.GenPosition(a,n,o)},t.Geodesic.prototype.Direct=function(t,e,i,r,s){return this.GenDirect(t,e,i,!1,r,s)},t.Geodesic.prototype.ArcDirect=function(t,e,i,r,s){return this.GenDirect(t,e,i,!0,r,s)},t.Geodesic.prototype.Line=function(t,i,r,s){return new e.GeodesicLine(this,t,i,r,s)},t.Geodesic.prototype.DirectLine=function(t,e,i,r,s){return this.GenDirectLine(t,e,i,!1,r,s)},t.Geodesic.prototype.ArcDirectLine=function(t,e,i,r,s){return this.GenDirectLine(t,e,i,!0,r,s)},t.Geodesic.prototype.GenDirectLine=function(i,r,s,a,n,o){var h;return o||(o=t.STANDARD|t.DISTANCE_IN),a||(o|=t.DISTANCE_IN),h=new e.GeodesicLine(this,i,r,s,o),h.GenSetDistance(a,n),h},t.Geodesic.prototype.InverseLine=function(i,s,a,n,o){var h,l,u;return o||(o=t.STANDARD|t.DISTANCE_IN),h=this.InverseInt(i,s,a,n,t.ARC),u=r.atan2d(h.salp1,h.calp1),o&t.OUT_MASK&t.DISTANCE_IN&&(o|=t.DISTANCE),l=new e.GeodesicLine(this,i,s,u,o,h.salp1,h.calp1),l.SetArc(h.vals.a12),l},t.Geodesic.prototype.Polygon=function(t){return new i.PolygonArea(this,t)},t.WGS84=new t.Geodesic(s.WGS84.a,s.WGS84.f)}(a.Geodesic,a.GeodesicLine,a.PolygonArea,a.Math,a.Constants),function(t,e,i){e.GeodesicLine=function(e,r,s,a,n,o,h){var l,u,c,d,p,f;n||(n=t.STANDARD|t.DISTANCE_IN),this.a=e.a,this.f=e.f,this._b=e._b,this._c2=e._c2,this._f1=e._f1,this.caps=n|t.LATITUDE|t.AZIMUTH|t.LONG_UNROLL,this.lat1=i.LatFix(r),this.lon1=s,void 0===o||void 0===h?(this.azi1=i.AngNormalize(a),l=i.sincosd(i.AngRound(this.azi1)),this.salp1=l.s,this.calp1=l.c):(this.azi1=a,this.salp1=o,this.calp1=h),l=i.sincosd(i.AngRound(this.lat1)),c=this._f1*l.s,u=l.c,l=i.hypot(c,u),c/=l,u/=l,u=Math.max(t.tiny_,u),this._dn1=Math.sqrt(1+e._ep2*i.sq(c)),this._salp0=this.salp1*u,this._calp0=i.hypot(this.calp1,this.salp1*c),this._ssig1=c,this._somg1=this._salp0*c,this._csig1=this._comg1=0!==c||0!==this.calp1?u*this.calp1:1,l=i.hypot(this._ssig1,this._csig1),this._ssig1/=l,this._csig1/=l,this._k2=i.sq(this._calp0)*e._ep2,d=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&t.CAP_C1&&(this._A1m1=t.A1m1f(d),this._C1a=new Array(t.nC1_+1),t.C1f(d,this._C1a),this._B11=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),p=Math.sin(this._B11),f=Math.cos(this._B11),this._stau1=this._ssig1*f+this._csig1*p,this._ctau1=this._csig1*f-this._ssig1*p),this.caps&t.CAP_C1p&&(this._C1pa=new Array(t.nC1p_+1),t.C1pf(d,this._C1pa)),this.caps&t.CAP_C2&&(this._A2m1=t.A2m1f(d),this._C2a=new Array(t.nC2_+1),t.C2f(d,this._C2a),this._B21=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&t.CAP_C3&&(this._C3a=new Array(t.nC3_),e.C3f(d,this._C3a),this._A3c=-this.f*this._salp0*e.A3f(d),this._B31=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&t.CAP_C4&&(this._C4a=new Array(t.nC4_),e.C4f(d,this._C4a),this._A4=i.sq(this.a)*this._calp0*this._salp0*e._e2,this._B41=t.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=Number.NaN},e.GeodesicLine.prototype.GenPosition=function(e,r,s){var a,n,o,h,l,u,c,d,p,f,g,m,v,y,b,x,M,w,S,A,C,T,P,E,L,k,I,N,F,B={};return s?s===t.LONG_UNROLL&&(s|=t.STANDARD):s=t.STANDARD,s&=this.caps&t.OUT_MASK,B.lat1=this.lat1,B.azi1=this.azi1,B.lon1=s&t.LONG_UNROLL?this.lon1:i.AngNormalize(this.lon1),e?B.a12=r:B.s12=r,e||this.caps&t.DISTANCE_IN&t.OUT_MASK?(h=0,l=0,e?(a=r*i.degree,k=i.sincosd(r),n=k.s,o=k.c):(d=r/(this._b*(1+this._A1m1)),p=Math.sin(d),f=Math.cos(d),h=-t.SinCosSeries(!0,this._stau1*f+this._ctau1*p,this._ctau1*f-this._stau1*p,this._C1pa),a=d-(h-this._B11),n=Math.sin(a),o=Math.cos(a),Math.abs(this.f)>.01&&(u=this._ssig1*o+this._csig1*n,c=this._csig1*o-this._ssig1*n,h=t.SinCosSeries(!0,u,c,this._C1a),g=(1+this._A1m1)*(a+(h-this._B11))-r/this._b,a-=g/Math.sqrt(1+this._k2*i.sq(u)),n=Math.sin(a),o=Math.cos(a))),u=this._ssig1*o+this._csig1*n,c=this._csig1*o-this._ssig1*n,T=Math.sqrt(1+this._k2*i.sq(u)),s&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&((e||Math.abs(this.f)>.01)&&(h=t.SinCosSeries(!0,u,c,this._C1a)),l=(1+this._A1m1)*(h-this._B11)),x=this._calp0*u,M=i.hypot(this._salp0,this._calp0*c),0===M&&(M=c=t.tiny_),A=this._salp0,C=this._calp0*c,e&&s&t.DISTANCE&&(B.s12=this._b*((1+this._A1m1)*a+l)),s&t.LONGITUDE&&(w=this._salp0*u,S=c,b=i.copysign(1,this._salp0),m=s&t.LONG_UNROLL?b*(a-(Math.atan2(u,c)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(b*w,S)-Math.atan2(b*this._somg1,this._comg1))):Math.atan2(w*this._comg1-S*this._somg1,S*this._comg1+w*this._somg1),v=m+this._A3c*(a+(t.SinCosSeries(!0,u,c,this._C3a)-this._B31)),y=v/i.degree,B.lon2=s&t.LONG_UNROLL?this.lon1+y:i.AngNormalize(i.AngNormalize(this.lon1)+i.AngNormalize(y))),s&t.LATITUDE&&(B.lat2=i.atan2d(x,this._f1*M)),s&t.AZIMUTH&&(B.azi2=i.atan2d(A,C)),s&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(P=t.SinCosSeries(!0,u,c,this._C2a),E=(1+this._A2m1)*(P-this._B21),L=(this._A1m1-this._A2m1)*a+(l-E),s&t.REDUCEDLENGTH&&(B.m12=this._b*(T*(this._csig1*u)-this._dn1*(this._ssig1*c)-this._csig1*c*L)),s&t.GEODESICSCALE&&(k=this._k2*(u-this._ssig1)*(u+this._ssig1)/(this._dn1+T),B.M12=o+(k*u-c*L)*this._ssig1/this._dn1,B.M21=o-(k*this._ssig1-this._csig1*L)*u/T)),s&t.AREA&&(I=t.SinCosSeries(!1,u,c,this._C4a),0===this._calp0||0===this._salp0?(N=A*this.calp1-C*this.salp1,F=C*this.calp1+A*this.salp1):(N=this._calp0*this._salp0*(o<=0?this._csig1*(1-o)+n*this._ssig1:n*(this._csig1*n/(1+o)+this._ssig1)),F=i.sq(this._salp0)+i.sq(this._calp0)*this._csig1*c),B.S12=this._c2*Math.atan2(N,F)+this._A4*(I-this._B41)),e||(B.a12=a/i.degree),B):(B.a12=Number.NaN,B)},e.GeodesicLine.prototype.Position=function(t,e){return this.GenPosition(!1,t,e)},e.GeodesicLine.prototype.ArcPosition=function(t,e){return this.GenPosition(!0,t,e)},e.GeodesicLine.prototype.GenSetDistance=function(t,e){t?this.SetArc(e):this.SetDistance(e)},e.GeodesicLine.prototype.SetDistance=function(e){var i;this.s13=e,i=this.GenPosition(!1,this.s13,t.ARC),this.a13=0+i.a12},e.GeodesicLine.prototype.SetArc=function(e){var i;this.a13=e,i=this.GenPosition(!0,this.a13,t.DISTANCE),this.s13=0+i.s12}}(a.Geodesic,a.GeodesicLine,a.Math),function(t,e,i,r){var s,a;s=function(t,e){var r;return t=i.AngNormalize(t),e=i.AngNormalize(e),r=i.AngDiff(t,e).s,t<=0&&e>0&&r>0?1:e<=0&&t>0&&r<0?-1:0},a=function(t,e){return t%=720,e%=720,(e>=0&&e<360||e<-360?0:1)-(t>=0&&t<360||t<-360?0:1)},t.PolygonArea=function(t,i){this._geod=t,this.a=this._geod.a,this.f=this._geod.f,this._area0=4*Math.PI*t._c2,this.polyline=i||!1,this._mask=e.LATITUDE|e.LONGITUDE|e.DISTANCE|(this.polyline?e.NONE:e.AREA|e.LONG_UNROLL),this.polyline||(this._areasum=new r.Accumulator(0)),this._perimetersum=new r.Accumulator(0),this.Clear()},t.PolygonArea.prototype.Clear=function(){this.num=0,this._crossings=0,this.polyline||this._areasum.Set(0),this._perimetersum.Set(0),this._lat0=this._lon0=this.lat=this.lon=Number.NaN},t.PolygonArea.prototype.AddPoint=function(t,e){var i;0===this.num?(this._lat0=this.lat=t,this._lon0=this.lon=e):(i=this._geod.Inverse(this.lat,this.lon,t,e,this._mask),this._perimetersum.Add(i.s12),this.polyline||(this._areasum.Add(i.S12),this._crossings+=s(this.lon,e)),this.lat=t,this.lon=e),++this.num},t.PolygonArea.prototype.AddEdge=function(t,e){var i;this.num&&(i=this._geod.Direct(this.lat,this.lon,t,e,this._mask),this._perimetersum.Add(e),this.polyline||(this._areasum.Add(i.S12),this._crossings+=a(this.lon,i.lon2)),this.lat=i.lat2,this.lon=i.lon2),++this.num},t.PolygonArea.prototype.Compute=function(t,e){var i,a,n,o={number:this.num};return this.num<2?(o.perimeter=0,this.polyline||(o.area=0),o):this.polyline?(o.perimeter=this._perimetersum.Sum(),o):(i=this._geod.Inverse(this.lat,this.lon,this._lat0,this._lon0,this._mask),o.perimeter=this._perimetersum.Sum(i.s12),a=new r.Accumulator(this._areasum),a.Add(i.S12),n=this._crossings+s(this.lon,this._lon0),1&n&&a.Add((a.Sum()<0?1:-1)*this._area0/2),t||a.Negate(),e?a.Sum()>this._area0/2?a.Add(-this._area0):a.Sum()<=-this._area0/2&&a.Add(+this._area0):a.Sum()>=this._area0?a.Add(-this._area0):a<0&&a.Add(-this._area0),o.area=a.Sum(),o)},t.PolygonArea.prototype.TestPoint=function(t,e,i,r){var a,n,o,h,l={number:this.num+1};if(0===this.num)return l.perimeter=0,this.polyline||(l.area=0),l;for(l.perimeter=this._perimetersum.Sum(),n=this.polyline?0:this._areasum.Sum(),o=this._crossings,h=0;h<(this.polyline?1:2);++h)a=this._geod.Inverse(0===h?this.lat:t,0===h?this.lon:e,0!==h?this._lat0:t,0!==h?this._lon0:e,this._mask),l.perimeter+=a.s12,this.polyline||(n+=a.S12,o+=s(0===h?this.lon:e,0!==h?this._lon0:e));return this.polyline?l:(1&o&&(n+=(n<0?1:-1)*this._area0/2),i||(n*=-1),r?n>this._area0/2?n-=this._area0:n<=-this._area0/2&&(n+=this._area0):n>=this._area0?n-=this._area0:n<0&&(n+=this._area0),l.area=n,l)},t.PolygonArea.prototype.TestEdge=function(t,e,i,r){var n,o,h,l={number:this.num?this.num+1:0};return 0===this.num?l:(l.perimeter=this._perimetersum.Sum()+e,this.polyline?l:(o=this._areasum.Sum(),h=this._crossings,n=this._geod.Direct(this.lat,this.lon,t,e,this._mask),o+=n.S12,h+=a(this.lon,n.lon2),n=this._geod.Inverse(n.lat2,n.lon2,this._lat0,this._lon0,this._mask),l.perimeter+=n.s12,o+=n.S12,h+=s(n.lon2,this._lon0),1&h&&(o+=(o<0?1:-1)*this._area0/2),i||(o*=-1),r?o>this._area0/2?o-=this._area0:o<=-this._area0/2&&(o+=this._area0):o>=this._area0?o-=this._area0:o<0&&(o+=this._area0),l.area=o,l))}}(a.PolygonArea,a.Geodesic,a.Math,a.Accumulator),a.DMS={},function(t){var e,i,r,s,a="SNWE",n="°'\"",o=["degrees","minutes","seconds"];e=function(t,e){return t.indexOf(e.toUpperCase())},i=function(t,e){return String("0000").substr(0,Math.max(0,Math.min(4,e-t.length)))+t},t.NONE=0,t.LATITUDE=1,t.LONGITUDE=2,t.AZIMUTH=3,t.DEGREE=0,t.MINUTE=1,t.SECOND=2,t.Decode=function(i){var s,n,o,h,l,u,c,d,p=i,f=0,g=0,m=t.NONE;for(p=p.replace(/\u00b0/g,"d").replace(/\u00ba/g,"d").replace(/\u2070/g,"d").replace(/\u02da/g,"d").replace(/\u2032/g,"'").replace(/\u00b4/g,"'").replace(/\u2019/g,"'").replace(/\u2033/g,'"').replace(/\u201d/g,'"').replace(/\u2212/g,"-").replace(/''/g,'"').trim(),s=p.length,u=0;u<s;u=d,++g)if(c=u,0===g&&e(a,p.charAt(c))>=0&&++c,(g>0||c<s&&e("-+",p.charAt(c))>=0)&&++c,n=p.substr(c,s-c).indexOf("-"),o=p.substr(c,s-c).indexOf("+"),n<0?n=s:n+=c,o<0?o=s:o+=c,d=Math.min(n,o),h=r(p.substr(u,d-u)),f+=h.val,l=h.ind,m==t.NONE)m=l;else if(l!=t.NONE&&m!=l)throw new Error("Incompatible hemisphere specifies in "+p.substr(0,d));if(0===g)throw new Error("Empty or incomplete DMS string "+p);return{val:f,ind:m}},r=function(i){var r,n,h,l,u,c,d,p,f,g,m,v,y,b,x,M,w={},S="";do{if(r=1,n=0,h=i.length,l=t.NONE,u=-1,h>n&&(u=e(a,i.charAt(n)))>=0&&(l=2&u?t.LONGITUDE:t.LATITUDE,r=1&u?1:-1,++n),h>n&&(u=e(a,i.charAt(h-1)))>=0&&u>=0){if(l!==t.NONE){S=i.charAt(n-1).toUpperCase()===i.charAt(h-1).toUpperCase()?"Repeated hemisphere indicators "+i.charAt(n-1)+" in "+i.substr(n-1,h-n+1):"Contradictory hemisphere indicators "+i.charAt(n-1)+" and "+i.charAt(h-1)+" in "+i.substr(n-1,h-n+1);break}l=2&u?t.LONGITUDE:t.LATITUDE,r=1&u?1:-1,--h}if(h>n&&(u=e("-+",i.charAt(n)))>=0&&u>=0&&(r*=u?1:-1,++n),h===n){S="Empty or incomplete DMS string "+i;break}for(c=[0,0,0],d=[0,0,0],p=0,f=0,g=0,m=0,v=n,y=!1,b=0,x=0;v<h;)if(M=i.charAt(v++),(u=e("0123456789",M))>=0)++m,b>0?++b:(f=10*f+u,++x);else if("."===M){if(y){S="Multiple decimal points in "+i.substr(n,h-n);break}y=!0,b=1}else{if(!((u=e("D'\":",M))>=0)){if(e("-+",M)>=0){S="Internal sign in DMS string "+i.substr(n,h-n);break}S="Illegal character "+M+" in DMS string "+i.substr(n,h-n);break}if(u>=3){if(v===h){S="Illegal for colon to appear at the end of "+i.substr(n,h-n);break}u=p}if(u===p-1){S="Repeated "+o[u]+" component in "+i.substr(n,h-n);break}if(u<p){S=o[u]+" component follows "+o[p-1]+" component in "+i.substr(n,h-n);break}if(0===m){S="Missing numbers in "+o[u]+" component of "+i.substr(n,h-n);break}b>0&&(g=parseFloat(i.substr(v-x-b-1,x+b)),f=0),c[u]=f,d[u]=f+g,v<h&&(p=u+1,f=g=0,m=b=x=0)}if(S.length)break;if(e("D'\":",i.charAt(v-1))<0){if(p>=3){S="Extra text following seconds in DMS string "+i.substr(n,h-n);break}if(0===m){S="Missing numbers in trailing component of "+i.substr(n,h-n);break}b>0&&(g=parseFloat(i.substr(v-x-b,x+b)),f=0),c[p]=f,d[p]=f+g}if(y&&0===b){S="Decimal point in non-terminal component of "+i.substr(n,h-n);break}if(c[1]>=60||d[1]>60){S="Minutes "+d[1]+" not in range [0,60)";break}if(c[2]>=60||d[2]>60){S="Seconds "+d[2]+" not in range [0,60)";break}return w.ind=l,w.val=r*(d[2]?(60*(60*d[0]+d[1])+d[2])/3600:d[1]?(60*d[0]+d[1])/60:d[0]),w}while(!1);if(w.val=s(i),0===w.val)throw new Error(S);return w.ind=t.NONE,w},s=function(t){var e,i,r,s;return t.length<3?0:(e=t.toUpperCase().replace(/0+$/,""),i="-"===e.charAt(0)?-1:1,r="-"===e.charAt(0)||"+"===e.charAt(0)?1:0,(s=e.length-1)+1<r+3?0:(e=e.substr(r,s+1-r),"NAN"===e||"1.#QNAN"===e||"1.#SNAN"===e||"1.#IND"===e||"1.#R"===e?Number.NaN:"INF"===e||"1.#INF"===e?i*Number.POSITIVE_INFINITY:0))},t.DecodeLatLon=function(e,i,r){var s,a,n={},o=t.Decode(e),h=t.Decode(i),l=o.val,u=o.ind,c=h.val,d=h.ind;if(r||(r=!1),u===t.NONE&&d===t.NONE?(u=r?t.LONGITUDE:t.LATITUDE,d=r?t.LATITUDE:t.LONGITUDE):u===t.NONE?u=t.LATITUDE+t.LONGITUDE-d:d===t.NONE&&(d=t.LATITUDE+t.LONGITUDE-u),u===d)throw new Error("Both "+e+" and "+i+" interpreted as "+(u===t.LATITUDE?"latitudes":"longitudes"));if(s=u===t.LATITUDE?l:c,a=u===t.LATITUDE?c:l,Math.abs(s)>90)throw new Error("Latitude "+s+" not in [-90,90]");return n.lat=s,n.lon=a,n},t.DecodeAngle=function(e){var i=t.Decode(e),r=i.val;if(i.ind!==t.NONE)throw new Error("Arc angle "+e+" includes a hemisphere N/E/W/S");return r},t.DecodeAzimuth=function(e){var i=t.Decode(e),r=i.val;if(i.ind===t.LATITUDE)throw new Error("Azimuth "+e+" has a latitude hemisphere N/S");return r},t.Encode=function(e,r,s,o){var h,l,u,c,d,p,f,g,m,v=1;if(o||(o=t.NONE),!isFinite(e))return e<0?String("-inf"):e>0?String("inf"):String("nan");for(s=Math.min(15-2*r,s),h=0;h<r;++h)v*=60;for(h=0;h<s;++h)v*=10;for(o===t.AZIMUTH&&(e-=360*Math.floor(e/360)),l=e<0?-1:1,e*=l,u=Math.floor(e),c=(e-u)*v+.5,d=Math.floor(c),c=d==c&&1&d?d-1:d,c/=v,c=Math.floor((e-u)*v+.5)/v,c>=1&&(u+=1,c-=1),p=[c,0,0],h=1;h<=r;++h)f=Math.floor(p[h-1]),g=p[h-1]-f,p[h]=60*g,p[h-1]=f;switch(p[0]+=u,m="",o===t.NONE&&l<0&&(m+="-"),r){case t.DEGREE:m+=i(p[0].toFixed(s),o===t.NONE?0:1+Math.min(o,2)+s+(s?1:0))+n.charAt(0);break;default:switch(m+=i(p[0].toFixed(0),o===t.NONE?0:1+Math.min(o,2))+n.charAt(0),r){case t.MINUTE:m+=i(p[1].toFixed(s),2+s+(s?1:0))+n.charAt(1);break;case t.SECOND:m+=i(p[1].toFixed(0),2)+n.charAt(1),m+=i(p[2].toFixed(s),2+s+(s?1:0))+n.charAt(2)}}return o!==t.NONE&&o!==t.AZIMUTH&&(m+=a.charAt((o===t.LATITUDE?0:2)+(l<0?0:1))),m}}(a.DMS),function(i){"object"==typeof t&&t.exports?t.exports=i:(r=[],void 0!==(s=function(){return i}.apply(e,r))&&(t.exports=s))}(a)}()},function(t,e,i){"use strict";function r(t,e){if(!(this instanceof r))return new r(t);e=e||function(t){if(t)throw t};var n=i.i(s.a)(t);if("object"!=typeof n)return void e(t);var c=r.projections.get(n.projName);if(!c)return void e(t);if(n.datumCode&&"none"!==n.datumCode){var d=i.i(u.a)(h.a,n.datumCode);d&&(n.datum_params=d.towgs84?d.towgs84.split(","):null,n.ellps=d.ellipse,n.datumName=d.datumName?d.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84";var p=i.i(o.a)(n.a,n.b,n.rf,n.ellps,n.sphere),f=i.i(o.b)(p.a,p.b,p.rf,n.R_A),g=n.datum||i.i(l.a)(n.datumCode,n.datum_params,p.a,p.b,f.es,f.ep2);i.i(a.a)(this,n),i.i(a.a)(this,c),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=g,this.init(),e(null,this)}var s=i(80),a=i(78),n=i(81),o=i(77),h=i(70),l=i(75),u=i(29);r.projections=n.a,r.projections.start(),e.a=r},function(t,e,i){"use strict";e.a=function(t,e,i){var r=e*i;return t/Math.sqrt(1-r*r)}},function(t,e,i){"use strict";e.a=function(t,e,i,r,s){var a,n;a=t/e;for(var o=0;o<15;o++)if(n=(t-(e*a-i*Math.sin(2*a)+r*Math.sin(4*a)-s*Math.sin(6*a)))/(e-2*i*Math.cos(2*a)+4*r*Math.cos(4*a)-6*s*Math.cos(6*a)),a+=n,Math.abs(n)<=1e-10)return a;return NaN}},function(t,e,i){"use strict";e.a=function(t,e,i,r){return i*=e,e*=e,r[0]*t-i*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}},function(t,e,i){"use strict";e.a=function(t,e){var i;return t>1e-7?(i=t*e,(1-t*t)*(e/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*e}},function(t,e,i){"use strict";function r(t,e){if(t[e])return t[e];for(var i,r=Object.keys(t),a=e.toLowerCase().replace(s,""),n=-1;++n<r.length;)if(i=r[n],i.toLowerCase().replace(s,"")===a)return t[i]}e.a=r;var s=/[\s_\-\/\(\)]/g},function(t,e,i){"use strict";var r=i(4),s=r.a,a=function(t,e){this.map=t,this.id=e.id||null,this.notice=e.notice||null,this.copyrighted=e.copyrighted||!0,this.url=e.url||null,this.html=s.simpleWikiLinks(this.notice),this.plain=s.simpleWikiLinks(this.notice)};a.prototype.getInfo=function(){return{id:this.id,notice:this.notice,html:this.html,plain:this.plain}},e.a=a},function(t,e,i){"use strict";var r=i(3),s=r.a,a=function(t){t instanceof a?this.pos=t.pos.slice():(null!=t&&t instanceof Array?this.pos=t.slice():this.pos=[],this.validate())};a.prototype.clone=function(){return new a(this.pos)},a.prototype.getCoords=function(){return[this.pos[1],this.pos[2],this.pos[4]]},a.prototype.getCoords2=function(){return[this.pos[1],this.pos[2]]},a.prototype.setCoords=function(t){return this.pos[1]=t[0],this.pos[2]=t[1],this.pos[4]=t[2],this},a.prototype.setCoords2=function(t){return this.pos[1]=t[0],this.pos[2]=t[1],this},a.prototype.getHeight=function(){return this.pos[4]},a.prototype.setHeight=function(t){return this.pos[4]=t,this},a.prototype.getOrientation=function(){return[this.pos[5],this.pos[6],this.pos[7]]},a.prototype.setOrientation=function(t){return this.pos[5]=t[0],this.pos[6]=t[1],this.pos[7]=t[2],this},a.prototype.getFov=function(){return this.pos[9]},a.prototype.setFov=function(t){return this.pos[9]=t,this},a.prototype.getViewExtent=function(){return this.pos[8]},a.prototype.setViewExtent=function(t){return this.pos[8]=t,this},a.prototype.getViewDistance=function(){return.5*this.getViewExtent()/Math.tan(s.radians(.5*this.getFov()))},a.prototype.getViewMode=function(){return this.pos[0]},a.prototype.getHeightMode=function(){return this.pos[3]},a.prototype.check=function(){this.getViewMode(),this.pos[6]=s.clamp(this.pos[6],-90,90),this.pos[5]=this.pos[5]%360,this.pos[7]=this.pos[7]%360},a.prototype.isSame=function(t){return t=t.pos,this.pos[0]==t[0]&&s.isEqual(this.pos[1],t[1],1e-7)&&s.isEqual(this.pos[2],t[2],1e-7)&&this.pos[3]==t[3]&&s.isEqual(this.pos[4],t[4],.001)&&s.isEqual(this.pos[5],t[5],.001)&&s.isEqual(this.pos[6],t[6],.001)&&s.isEqual(this.pos[7],t[7],.001)&&s.isEqual(this.pos[8],t[8],.001)&&s.isEqual(this.pos[9],t[9],.001)},a.prototype.validate=function(){var t=this.pos;"fixed"==t[0]&&(t[0]="obj",t[9]=t[8],t[8]=t[7],t[7]=t[6],t[6]=t[5],t[5]=t[4],t[4]=t[3],t[3]="fix"),t[0]="obj"==t[0]||"subj"==t[0]?t[0]:"obj",t[1]=null!=t[1]?t[1]:0,t[2]=null!=t[2]?t[2]:0,t[3]="fix"==t[3]||"fixed"==t[3]||"float"==t[3]?t[3]:"float",t[4]=null!=t[4]?t[4]:0,t[5]=null!=t[5]?t[5]:0,t[6]=null!=t[6]?t[6]:-90,t[7]=null!=t[7]?t[7]:0,t[8]=null!=t[8]?t[8]:900,t[9]=null!=t[9]?t[9]:45,t[3]="fixed"==t[3]?"fix":t[3]},a.prototype.toString=function(){var t=this.pos;return t[0]+", "+t[1].toFixed(0)+", "+t[2].toFixed(0)+", "+t[3]+", "+t[4].toFixed(0)+", "+t[5].toFixed(0)+", "+t[6].toFixed(0)+", "+t[7].toFixed(0)+", , "+t[8].toFixed(0)+", "+t[9].toFixed(0)},a.prototype.toArray=function(){return this.pos.slice()},e.a=a},function(t,e,i){"use strict";var r=function(t,e,i,r){this.gpu=t,this.gl=t.gl,this.bbox=e.bbox,this.fileSize=i,this.core=r,this.vertexBuffer=null,this.uvBuffer=null,this.uv2Buffer=null;var s=e.vertices,a=e.uvs,n=e.uvs2,o=e.vertexSize||3,h=e.uvSize||2,l=e.uv2Size||2,u=this.gl;s&&u&&(this.vertexBuffer=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,this.vertexBuffer),u.bufferData(u.ARRAY_BUFFER,new Float32Array(s),u.STATIC_DRAW),this.vertexBuffer.itemSize=o,this.vertexBuffer.numItems=s.length/o,null!=a&&(this.uvBuffer=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,this.uvBuffer),u.bufferData(u.ARRAY_BUFFER,new Float32Array(a),u.STATIC_DRAW),this.uvBuffer.itemSize=h,this.uvBuffer.numItems=a.length/h),null!=n&&(this.uv2Buffer=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,this.uv2Buffer),u.bufferData(u.ARRAY_BUFFER,new Float32Array(n),u.STATIC_DRAW),this.uv2Buffer.itemSize=l,this.uv2Buffer.numItems=n.length/l),this.size=this.vertexBuffer.numItems*o*4,this.size+=null==a?0:this.uvBuffer.numItems*h*4,this.size+=null==n?0:this.uv2Buffer.numItems*l*4,this.polygons=this.vertexBuffer.numItems/3,this.valid=!0)};r.prototype.kill=function(){this.gl&&this.valid&&(this.vertexBuffer&&this.gl.deleteBuffer(this.vertexBuffer),this.uvBuffer&&this.gl.deleteBuffer(this.uvBuffer),this.uv2Buffer&&this.gl.deleteBuffer(this.uv2Buffer),this.vertexBuffer=null,this.uvBuffer=null,this.uv2Buffer=null)},r.prototype.draw=function(t,e,i,r,s){var a=this.gl;if(null!=a&&this.valid){var n=t.getAttribute(e);if(a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.vertexAttribPointer(n,this.vertexBuffer.itemSize,a.FLOAT,!1,0,0),this.uvBuffer&&i){var o=t.getAttribute(i);a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),a.vertexAttribPointer(o,this.uvBuffer.itemSize,a.FLOAT,!1,0,0)}if(this.uv2Buffer&&r){var h=t.getAttribute(r);a.bindBuffer(a.ARRAY_BUFFER,this.uv2Buffer),a.vertexAttribPointer(h,this.uv2Buffer.itemSize,a.FLOAT,!1,0,0)}if(s&&s){var l=t.getAttribute(s);-1!=l&&(a.bindBuffer(a.ARRAY_BUFFER,this.gpu.barycentricBuffer),a.vertexAttribPointer(l,this.gpu.barycentricBuffer.itemSize,a.FLOAT,!1,0,0))}a.drawArrays(a.TRIANGLES,0,this.vertexBuffer.numItems)}},r.prototype.size=function(){return this.size},r.prototype.bbox=function(){return this.bbox},r.prototype.getPolygons=function(){return this.polygons},e.a=r},function(t,e,i){"use strict";function r(t,e,i){i=i||2;var r=e&&e.length,a=r?e[0]*i:t.length,o=s(t,0,a,i,!0),h=[];if(!o)return h;var l,u,d,p,f,g,m;if(r&&(o=c(t,e,o,i)),t.length>80*i){l=d=t[0],u=p=t[1];for(var v=i;v<a;v+=i)f=t[v],g=t[v+1],f<l&&(l=f),g<u&&(u=g),f>d&&(d=f),g>p&&(p=g);m=Math.max(d-l,p-u)}return n(o,h,i,l,u,m),h}function s(t,e,i,r,s){var a,n;if(s===I(t,e,i,r)>0)for(a=e;a<i;a+=r)n=E(a,t[a],t[a+1],n);else for(a=i-r;a>=e;a-=r)n=E(a,t[a],t[a+1],n);return n&&w(n,n.next)&&(L(n),n=n.next),n}function a(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!w(r,r.next)&&0!==M(r.prev,r,r.next))r=r.next;else{if(L(r),(r=e=r.prev)===r.next)return null;i=!0}}while(i||r!==e);return e}function n(t,e,i,r,s,c,d){if(t){!d&&c&&g(t,r,s,c);for(var p,f,m=t;t.prev!==t.next;)if(p=t.prev,f=t.next,c?h(t,r,s,c):o(t))e.push(p.i/i),e.push(t.i/i),e.push(f.i/i),L(t),t=f.next,m=f.next;else if((t=f)===m){d?1===d?(t=l(t,e,i),n(t,e,i,r,s,c,2)):2===d&&u(t,e,i,r,s,c):n(a(t),e,i,r,s,c,1);break}}}function o(t){var e=t.prev,i=t,r=t.next;if(M(e,i,r)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(b(e.x,e.y,i.x,i.y,r.x,r.y,s.x,s.y)&&M(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,r){var s=t.prev,a=t,n=t.next;if(M(s,a,n)>=0)return!1;for(var o=s.x<a.x?s.x<n.x?s.x:n.x:a.x<n.x?a.x:n.x,h=s.y<a.y?s.y<n.y?s.y:n.y:a.y<n.y?a.y:n.y,l=s.x>a.x?s.x>n.x?s.x:n.x:a.x>n.x?a.x:n.x,u=s.y>a.y?s.y>n.y?s.y:n.y:a.y>n.y?a.y:n.y,c=v(o,h,e,i,r),d=v(l,u,e,i,r),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&b(s.x,s.y,a.x,a.y,n.x,n.y,p.x,p.y)&&M(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&b(s.x,s.y,a.x,a.y,n.x,n.y,p.x,p.y)&&M(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,i){var r=t;do{var s=r.prev,a=r.next.next;!w(s,a)&&S(s,r,r.next,a)&&C(s,a)&&C(a,s)&&(e.push(s.i/i),e.push(r.i/i),e.push(a.i/i),L(r),L(r.next),r=t=a),r=r.next}while(r!==t);return r}function u(t,e,i,r,s,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&x(h,l)){var u=P(h,l);return h=a(h,h.next),u=a(u,u.next),n(h,e,i,r,s,o),void n(u,e,i,r,s,o)}l=l.next}h=h.next}while(h!==t)}function c(t,e,i,r){var n,o,h,l,u,c=[];for(n=0,o=e.length;n<o;n++)h=e[n]*r,l=n<o-1?e[n+1]*r:t.length,u=s(t,h,l,r,!1),u===u.next&&(u.steiner=!0),c.push(y(u));for(c.sort(d),n=0;n<c.length;n++)p(c[n],i),i=a(i,i.next);return i}function d(t,e){return t.x-e.x}function p(t,e){if(e=f(t,e)){var i=P(e,t);a(i,i.next)}}function f(t,e){var i,r=e,s=t.x,a=t.y,n=-1/0;do{if(a<=r.y&&a>=r.next.y){var o=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=s&&o>n){if(n=o,o===s){if(a===r.y)return r;if(a===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!i)return null;if(s===n)return i.prev;var h,l=i,u=i.x,c=i.y,d=1/0;for(r=i.next;r!==l;)s>=r.x&&r.x>=u&&b(a<c?s:n,a,u,c,a<c?n:s,a,r.x,r.y)&&((h=Math.abs(a-r.y)/(s-r.x))<d||h===d&&r.x>i.x)&&C(r,t)&&(i=r,d=h),r=r.next;return i}function g(t,e,i,r){var s=t;do{null===s.z&&(s.z=v(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,m(s)}function m(t){var e,i,r,s,a,n,o,h,l=1;do{for(i=t,t=null,a=null,n=0;i;){for(n++,r=i,o=0,e=0;e<l&&(o++,r=r.nextZ);e++);for(h=l;o>0||h>0&&r;)0===o?(s=r,r=r.nextZ,h--):0!==h&&r?i.z<=r.z?(s=i,i=i.nextZ,o--):(s=r,r=r.nextZ,h--):(s=i,i=i.nextZ,o--),a?a.nextZ=s:t=s,s.prevZ=a,a=s;i=r}a.nextZ=null,l*=2}while(n>1);return t}function v(t,e,i,r,s){return t=32767*(t-i)/s,e=32767*(e-r)/s,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,i=t;do{e.x<i.x&&(i=e),e=e.next}while(e!==t);return i}function b(t,e,i,r,s,a,n,o){return(s-n)*(e-o)-(t-n)*(a-o)>=0&&(t-n)*(r-o)-(i-n)*(e-o)>=0&&(i-n)*(a-o)-(s-n)*(r-o)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!A(t,e)&&C(t,e)&&C(e,t)&&T(t,e)}function M(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function S(t,e,i,r){return!!(w(t,e)&&w(i,r)||w(t,r)&&w(i,e))||M(t,e,i)>0!=M(t,e,r)>0&&M(i,r,t)>0!=M(i,r,e)>0}function A(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&S(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function C(t,e){return M(t.prev,t,t.next)<0?M(t,e,t.next)>=0&&M(t,t.prev,e)>=0:M(t,e,t.prev)<0||M(t,t.next,e)<0}function T(t,e){var i=t,r=!1,s=(t.x+e.x)/2,a=(t.y+e.y)/2;do{i.y>a!=i.next.y>a&&s<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}function P(t,e){var i=new k(t.i,t.x,t.y),r=new k(e.i,e.x,e.y),s=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function E(t,e,i,r){var s=new k(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function L(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function k(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,i,r){for(var s=0,a=e,n=i-r;a<i;a+=r)s+=(t[n]-t[a])*(t[a+1]+t[n+1]),n=a;return s}t.exports=r,r.deviation=function(t,e,i,r){var s=e&&e.length,a=s?e[0]*i:t.length,n=Math.abs(I(t,0,a,i));if(s)for(var o=0,h=e.length;o<h;o++){var l=e[o]*i,u=o<h-1?e[o+1]*i:t.length;n-=Math.abs(I(t,l,u,i))}var c=0;for(o=0;o<r.length;o+=3){var d=r[o]*i,p=r[o+1]*i,f=r[o+2]*i;c+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===n&&0===c?0:Math.abs((c-n)/n)},r.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,s=0;s<t.length;s++){for(var a=0;a<t[s].length;a++)for(var n=0;n<e;n++)i.vertices.push(t[s][a][n]);s>0&&(r+=t[s-1].length,i.holes.push(r))}return i}},function(t,e,i){"use strict";function r(t,e){return e=e||5,c(h({lat:t[1],lon:t[0]}),e)}function s(t){var e=l(g(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function a(t){var e=l(g(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function n(t){return t*(Math.PI/180)}function o(t){return t/Math.PI*180}function h(t){var e,i,r,s,a,o,h,l,c,d=t.lat,p=t.lon,f=6378137,g=n(d),m=n(p);c=Math.floor((p+180)/6)+1,180===p&&(c=60),d>=56&&d<64&&p>=3&&p<12&&(c=32),d>=72&&d<84&&(p>=0&&p<9?c=31:p>=9&&p<21?c=33:p>=21&&p<33?c=35:p>=33&&p<42&&(c=37)),e=6*(c-1)-180+3,l=n(e),i=.006739496752268451,r=f/Math.sqrt(1-.00669438*Math.sin(g)*Math.sin(g)),s=Math.tan(g)*Math.tan(g),a=i*Math.cos(g)*Math.cos(g),o=Math.cos(g)*(m-l),h=f*(.9983242984503243*g-.002514607064228144*Math.sin(2*g)+2639046602129982e-21*Math.sin(4*g)-3.418046101696858e-9*Math.sin(6*g));var v=.9996*r*(o+(1-s+a)*o*o*o/6+(5-18*s+s*s+72*a-58*i)*o*o*o*o*o/120)+5e5,y=.9996*(h+r*Math.tan(g)*(o*o/2+(5-s+9*a+4*a*a)*o*o*o*o/24+(61-58*s+s*s+600*a-330*i)*o*o*o*o*o*o/720));return d<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(v),zoneNumber:c,zoneLetter:u(d)}}function l(t){var e=t.northing,i=t.easting,r=t.zoneLetter,s=t.zoneNumber;if(s<0||s>60)return null;var a,n,h,u,c,d,p,f,g,m,v=6378137,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),b=i-5e5,x=e;r<"N"&&(x-=1e7),f=6*(s-1)-180+3,a=.006739496752268451,p=x/.9996,g=p/6367449.145945056,m=g+(3*y/2-27*y*y*y/32)*Math.sin(2*g)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*g)+151*y*y*y/96*Math.sin(6*g),n=v/Math.sqrt(1-.00669438*Math.sin(m)*Math.sin(m)),h=Math.tan(m)*Math.tan(m),u=a*Math.cos(m)*Math.cos(m),c=.99330562*v/Math.pow(1-.00669438*Math.sin(m)*Math.sin(m),1.5),d=b/(.9996*n);var M=m-n*Math.tan(m)/c*(d*d/2-(5+3*h+10*u-4*u*u-9*a)*d*d*d*d/24+(61+90*h+298*u+45*h*h-252*a-3*u*u)*d*d*d*d*d*d/720);M=o(M);var w=(d-(1+2*h+u)*d*d*d/6+(5-2*u+28*h-3*u*u+8*a+24*h*h)*d*d*d*d*d/120)/Math.cos(m);w=f+o(w);var S;if(t.accuracy){var A=l({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});S={top:A.lat,right:A.lon,bottom:M,left:w}}else S={lat:M,lon:w};return S}function u(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function c(t,e){var i="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+d(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+r.substr(r.length-5,e)}function d(t,e,i){var r=p(i);return f(Math.floor(t/1e5),Math.floor(e/1e5)%20,r)}function p(t){var e=t%b;return 0===e&&(e=b),e}function f(t,e,i){var r=i-1,s=x.charCodeAt(r),a=M.charCodeAt(r),n=s+t-1,o=a+e,h=!1;return n>T&&(n=n-T+w-1,h=!0),(n===S||s<S&&n>S||(n>S||s<S)&&h)&&n++,(n===A||s<A&&n>A||(n>A||s<A)&&h)&&++n===S&&n++,n>T&&(n=n-T+w-1),o>C?(o=o-C+w-1,h=!0):h=!1,(o===S||a<S&&o>S||(o>S||a<S)&&h)&&o++,(o===A||a<A&&o>A||(o>A||a<A)&&h)&&++o===S&&o++,o>C&&(o=o-C+w-1),String.fromCharCode(n)+String.fromCharCode(o)}function g(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,i=t.length,r=null,s="",a=0;!/[A-Z]/.test(e=t.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+t;s+=e,a++}var n=parseInt(s,10);if(0===a||a+3>i)throw"MGRSPoint bad conversion from: "+t;var o=t.charAt(a++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+t;r=t.substring(a,a+=2);for(var h=p(n),l=m(r.charAt(0),h),u=v(r.charAt(1),h);u<y(o);)u+=2e6;var c=i-a;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var d,f,g,b,x,M=c/2,w=0,S=0;return M>0&&(d=1e5/Math.pow(10,M),f=t.substring(a,a+M),w=parseFloat(f)*d,g=t.substring(a+M),S=parseFloat(g)*d),b=w+l,x=S+u,{easting:b,northing:x,zoneLetter:o,zoneNumber:n,accuracy:d}}function m(t,e){for(var i=x.charCodeAt(e-1),r=1e5,s=!1;i!==t.charCodeAt(0);){if(i++,i===S&&i++,i===A&&i++,i>T){if(s)throw"Bad character: "+t;i=w,s=!0}r+=1e5}return r}function v(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=M.charCodeAt(e-1),r=0,s=!1;i!==t.charCodeAt(0);){if(i++,i===S&&i++,i===A&&i++,i>C){if(s)throw"Bad character: "+t;i=w,s=!0}r+=1e5}return r}function y(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}e.c=r,e.b=a;var b=6,x="AJSAJS",M="AFAFAF",w=65,S=73,A=79,C=86,T=90;e.a={forward:r,inverse:s,toPoint:a}},function(t,e,i){"use strict";e.a=function(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),r=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))}},function(t,e,i){"use strict";var r=.01068115234375;e.a=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*r))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*r)));var i=t*t;return e[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,e[3]=i*(.3645833333333333-.005696614583333333*t),e[4]=i*t*.3076171875,e}},function(t,e,i){"use strict";var r=i(27),s=i(0);e.a=function(t,e,a){for(var n=1/(1-e),o=t,h=20;h;--h){var l=Math.sin(o),u=1-e*l*l;if(u=(i.i(r.a)(o,l,Math.cos(o),a)-t)*(u*Math.sqrt(u))*n,o-=u,Math.abs(u)<s.d)return o}return o}},function(t,e,i){"use strict";e.a=function(t){var e=Math.exp(t);return e=(e-1/e)/2}},function(t,e,i){"use strict";e.a=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}},function(t,e,i){"use strict";function r(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===h.h?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==h.i||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}function s(t,e,i){var r,s,a,n,o=t.x,l=t.y,u=t.z?t.z:0;if(l<-h.a&&l>-1.001*h.a)l=-h.a;else if(l>h.a&&l<1.001*h.a)l=h.a;else if(l<-h.a||l>h.a)return null;return o>Math.PI&&(o-=2*Math.PI),s=Math.sin(l),n=Math.cos(l),a=s*s,r=i/Math.sqrt(1-e*a),{x:(r+u)*n*Math.cos(o),y:(r+u)*n*Math.sin(o),z:(r*(1-e)+u)*s}}function a(t,e,i,r){var s,a,n,o,l,u,c,d,p,f,g,m,v,y,b,x,M=t.x,w=t.y,S=t.z?t.z:0;if(s=Math.sqrt(M*M+w*w),a=Math.sqrt(M*M+w*w+S*S),s/i<1e-12){if(y=0,a/i<1e-12)return b=h.a,x=-r,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(w,M);n=S/a,o=s/a,l=1/Math.sqrt(1-e*(2-e)*o*o),d=o*(1-e)*l,p=n*l,v=0;do{v++,c=i/Math.sqrt(1-e*p*p),x=s*d+S*p-c*(1-e*p*p),u=e*c/(c+x),l=1/Math.sqrt(1-u*(2-u)*o*o),f=o*(1-u)*l,g=n*l,m=g*d-f*p,d=f,p=g}while(m*m>1e-24&&v<30);return b=Math.atan(g/Math.abs(f)),{x:y,y:b,z:x}}function n(t,e,i){if(e===h.h)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(e===h.i){var r=i[0],s=i[1],a=i[2],n=i[3],o=i[4],l=i[5],u=i[6];return{x:u*(t.x-l*t.y+o*t.z)+r,y:u*(l*t.x+t.y-n*t.z)+s,z:u*(-o*t.x+n*t.y+t.z)+a}}}function o(t,e,i){if(e===h.h)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(e===h.i){var r=i[0],s=i[1],a=i[2],n=i[3],o=i[4],l=i[5],u=i[6],c=(t.x-r)/u,d=(t.y-s)/u,p=(t.z-a)/u;return{x:c+l*d-o*p,y:-l*c+d+n*p,z:o*c-n*d+p}}}var h=i(0);e.c=r,e.b=s,e.a=a,e.d=n,e.e=o},function(t,e,i){"use strict";function r(t){var e=this;if(2===arguments.length){var s=arguments[1];"string"==typeof s?"+"===s.charAt(0)?r[t]=i.i(a.a)(arguments[1]):r[t]=i.i(n.a)(arguments[1]):r[t]=s}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?r.apply(e,t):r(t)});if("string"==typeof t){if(t in r)return r[t]}else"EPSG"in t?r["EPSG:"+t.EPSG]=t:"ESRI"in t?r["ESRI:"+t.ESRI]=t:"IAU2000"in t?r["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var s=i(79),a=i(42),n=i(45);i.i(s.a)(r),e.a=r},function(t,e,i){"use strict";var r=i(0),s=i(72),a=i(73),n=i(29);e.a=function(t){var e,o,h,l={},u=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var i=e.split("=");return i.push(!0),t[i[0].toLowerCase()]=i[1],t},{}),c={proj:"projName",datum:"datumCode",rf:function(t){l.rf=parseFloat(t)},lat_0:function(t){l.lat0=t*r.g},lat_1:function(t){l.lat1=t*r.g},lat_2:function(t){l.lat2=t*r.g},lat_ts:function(t){l.lat_ts=t*r.g},lon_0:function(t){l.long0=t*r.g},lon_1:function(t){l.long1=t*r.g},lon_2:function(t){l.long2=t*r.g},alpha:function(t){l.alpha=parseFloat(t)*r.g},lonc:function(t){l.longc=t*r.g},x_0:function(t){l.x0=parseFloat(t)},y_0:function(t){l.y0=parseFloat(t)},k_0:function(t){l.k0=parseFloat(t)},k:function(t){l.k0=parseFloat(t)},a:function(t){l.a=parseFloat(t)},b:function(t){l.b=parseFloat(t)},r_a:function(){l.R_A=!0},zone:function(t){l.zone=parseInt(t,10)},south:function(){l.utmSouth=!0},towgs84:function(t){l.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){l.to_meter=parseFloat(t)},units:function(t){l.units=t;var e=i.i(n.a)(a.a,t);e&&(l.to_meter=e.to_meter)},from_greenwich:function(t){l.from_greenwich=t*r.g},pm:function(t){var e=i.i(n.a)(s.a,t);l.from_greenwich=(e||parseFloat(t))*r.g},nadgrids:function(t){"@null"===t?l.datumCode="none":l.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(l.axis=t)}};for(e in u)o=u[e],e in c?(h=c[e],"function"==typeof h?h(o):l[h]=o):l[e]=o;return"string"==typeof l.datumCode&&"WGS84"!==l.datumCode&&(l.datumCode=l.datumCode.toLowerCase()),l}},function(t,e,i){"use strict";function r(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(.25+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=-.03233083094085698*r,this.gtu[5]=.6650675310896665*r;var s=i.i(l.a)(this.cbg,this.lat0);this.Zb=-this.Qn*(s+i.i(u.a)(this.gtu,2*s))}function s(t){var e=i.i(d.a)(t.x-this.long0),r=t.y;r=i.i(l.a)(this.cbg,r);var s=Math.sin(r),a=Math.cos(r),n=Math.sin(e),u=Math.cos(e);r=Math.atan2(s,u*a),e=Math.atan2(n*a,i.i(o.a)(s,a*u)),e=i.i(h.a)(Math.tan(e));var p=i.i(c.a)(this.gtu,2*r,2*e);r+=p[0],e+=p[1];var f,g;return Math.abs(e)<=2.623395162778?(f=this.a*(this.Qn*e)+this.x0,g=this.a*(this.Qn*r+this.Zb)+this.y0):(f=1/0,g=1/0),t.x=f,t.y=g,t}function a(t){var e=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);r=(r-this.Zb)/this.Qn,e/=this.Qn;var s,a;if(Math.abs(e)<=2.623395162778){var h=i.i(c.a)(this.utg,2*r,2*e);r+=h[0],e+=h[1],e=Math.atan(i.i(n.a)(e));var u=Math.sin(r),p=Math.cos(r),f=Math.sin(e),g=Math.cos(e);r=Math.atan2(u*g,i.i(o.a)(f,g*p)),e=Math.atan2(f,g*p),s=i.i(d.a)(e+this.long0),a=i.i(l.a)(this.cgb,r)}else s=1/0,a=1/0;return t.x=s,t.y=a,t}var n=i(38),o=i(35),h=i(62),l=i(66),u=i(63),c=i(64),d=i(1),p=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"];e.a={init:r,forward:s,inverse:a,names:p}},function(t,e,i){"use strict";function r(t,e){return(t.datum.datum_type===a.h||t.datum.datum_type===a.i)&&"WGS84"!==e.datumCode||(e.datum.datum_type===a.h||e.datum.datum_type===a.i)&&"WGS84"!==t.datumCode}function s(t,e,c){var d;return Array.isArray(c)&&(c=i.i(u.a)(c)),t.datum&&e.datum&&r(t,e)&&(d=new l.a("WGS84"),c=s(t,d,c),t=d),"enu"!==t.axis&&(c=i.i(h.a)(t,!1,c)),"longlat"===t.projName?(c.x*=a.g,c.y*=a.g):t.isGeocent?(t.to_meter&&(c.x*=t.to_meter,c.y*=t.to_meter,c.z*=t.to_meter),c=i.i(o.a)(c,e.es,e.a,e.b)):(t.to_meter&&(c.x*=t.to_meter,c.y*=t.to_meter),c=t.inverse(c)),t.from_greenwich&&(c.x+=t.from_greenwich),c=i.i(n.a)(t.datum,e.datum,c),e.from_greenwich&&(c.x-=e.from_greenwich),"longlat"===e.projName?(c.x*=a.j,c.y*=a.j):e.isGeocent?(c=i.i(o.b)(c,e.es,e.a),e.to_meter&&(c.x/=e.to_meter,c.y/=e.to_meter,c.z/=e.to_meter)):(e.forward(c),e.to_meter&&(c.x/=e.to_meter,c.y/=e.to_meter)),"enu"!==e.axis?i.i(h.a)(e,!0,c):c}var a=i(0),n=i(76),o=i(40),h=i(60),l=i(24),u=i(39);e.a=s},function(t,e,i){"use strict";function r(t,e){var i=e[0],r=e[1];!(i in t)&&r in t&&(t[i]=t[r],3===e.length&&(t[i]=e[2](t[i])))}function s(t){return t*h}function a(t){function e(e){return e*(t.to_meter||1)}"GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var i=t.GEOGCS;"GEOGCS"===t.type&&(i=t),i&&(i.DATUM?t.datumCode=i.DATUM.name.toLowerCase():t.datumCode=i.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"===t.datumCode&&("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),i.DATUM&&i.DATUM.SPHEROID&&(t.ellps=i.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=i.DATUM.SPHEROID.a,t.rf=parseFloat(i.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",s],["longitude_of_center","Longitude_Of_Center"],["longc","longitude_of_center",s],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",s],["lat0","latitude_of_origin",s],["lat0","standard_parallel_1",s],["lat1","standard_parallel_1",s],["lat2","standard_parallel_2",s],["alpha","azimuth",s],["srsCode","name"]].forEach(function(e){return r(t,e)}),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=s(t.lat1>0?90:-90),t.lat_ts=t.lat1)}var n=i(113),o=i(114),h=.017453292519943295;e.a=function(t){var e=i.i(n.a)(t),r=e.shift(),s=e.shift();e.unshift(["name",s]),e.unshift(["type",r]);var h={};return i.i(o.a)(e,h),a(h),h}},function(t,e,i){"use strict";var r=i(30),s=i(4),a=i(11),n=s.a,o=a.a,h=r.a,l=function(t,e,i){if(this.map=t,this.id=i,this.currentAlpha=1,this.tileSize=[256,256],this.lodRange=[0,100],this.credits=[],this.tileRange=[[0,0],[0,0]],this.jsonUrl=null,this.baseUrl=this.map.url.baseUrl,this.baseUrlSchema=this.map.url.baseUrlSchema,this.baseUrlOrigin=this.map.url.baseUrlOrigin,this.ready=!1,"esri-world-imagery"==i&&(e.availability={type:"negative-size",size:2521}),"string"==typeof e){this.jsonUrl=this.map.url.processUrl(e),this.baseUrl=o.getBase(this.jsonUrl),this.baseUrlSchema=o.getSchema(this.jsonUrl),this.baseUrlOrigin=o.getOrigin(this.jsonUrl);var r=function(t){this.parseJson(t),this.ready=!0,this.map.refreshView()}.bind(this),s=function(){}.bind(this);n.loadJSON(this.jsonUrl,r,s,null,!!n.useCredentials&&-1!=this.jsonUrl.indexOf(this.map.url.baseUrl),this.map.core.xhrParams)}else this.parseJson(e),this.ready=!0};l.prototype.parseJson=function(t){if(this.numberId=t.id||null,this.type=t.type||"raster",this.url=this.processUrl(t.url,""),this.tileSize=t.tileSize||[256,256],this.lodRange=t.lodRange||[0,0],this.tileRange=t.tileRange||[[0,0],[0,0]],this.metaUrl=this.processUrl(t.metaUrl),this.maskUrl=this.processUrl(t.maskUrl),this.isTransparent=t.isTransparent||!1,this.credits=t.credits||[],this.creditsUrl=null,this.specificity=Math.pow(2,this.lodRange[0])/((this.tileRange[1][0]-this.tileRange[1][0]+1)*(this.tileRange[1][1]-this.tileRange[1][1]+1)),this.availability=t.availability?{}:null,this.availability){var e=t.availability;switch(e.type){case"negative-type":this.availability.type=2;break;case"negative-code":this.availability.type=3;break;case"negative-size":this.availability.type=4}this.availability.mime=e.mime,this.availability.codes=e.codes,this.availability.size=e.size}switch(this.metaUrl&&this.maskUrl&&(this.availability={type:1}),typeof this.credits){case"string":this.creditsUrl=this.credits,this.credits=[];break;case"object":if(!Array.isArray(this.credits)){var i=this.credits;this.credits=[];for(var r in i)this.map.addCredit(r,new h(this.map,i[r])),this.credits.push(r)}}},l.prototype.kill=function(){},l.prototype.setOptions=function(){},l.prototype.getOptions=function(){return this.getInfo()},l.prototype.getInfo=function(){return{type:this.type,url:this.url,tileSize:this.tileSize,credits:this.credits,lodRange:this.lodRange,tileRange:this.tileRange,mataUrl:this.metaUrl,maskUrl:this.maskUrl,isTransparent:this.isTransparent}},l.prototype.processUrl=function(t,e){return t?(t=t.trim(),-1!=t.indexOf("://")?t:0==t.indexOf("//")?this.baseUrlSchema+t:0==t.indexOf("/")?this.baseUrlOrigin+t:this.baseUrl+t):e},l.prototype.hasTile=function(t){var e=t[0]-this.lodRange[0];if(e<0)return!1;var i=t[1]>>e,r=t[2]>>e;return!(t[0]<this.lodRange[0]||t[0]>this.lodRange[1]||i<this.tileRange[0][0]||i>this.tileRange[1][0]||r<this.tileRange[0][1]||r>this.tileRange[1][1])},l.prototype.hasTileOrInfluence=function(t){var e=t[0]-this.lodRange[0];if(e<0)return!1;var i=t[1]>>e,r=t[2]>>e;return i<this.tileRange[0][0]||i>this.tileRange[1][0]||r<this.tileRange[0][1]||r>this.tileRange[1][1]?0:t[0]>this.lodRange[1]?1:2},l.prototype.getUrl=function(t,e){return this.map.url.makeUrl(this.url,{lod:t[0],ix:t[1],iy:t[2]},null,e)},l.prototype.getMetatileUrl=function(t,e){return this.map.url.makeUrl(this.metaUrl,{lod:t[0],ix:t[1],iy:t[2]},null,e)},l.prototype.getMaskUrl=function(t,e){return this.map.url.makeUrl(this.maskUrl,{lod:t[0],ix:t[1],iy:t[2]},null,e)},e.a=l},function(t,e,i){"use strict";var r=i(2),s=i(3),a=i(159),n=i(135),o=r.e,h=s.a,l=a.a,u=n.a,c=function(t,e,i){if(this.map=t,this.stats=t.stats,this.geodata=e,this.gpu=this.map.renderer.gpu,this.renderer=this.map.renderer,this.gpuGroups=[],this.currentGpuGroup=null,this.tile=i.tile,this.surface=i.surface,this.surface.geodataProcessor)this.surface.styleChanged&&(this.surface.geodataProcessor.setStylesheet(this.surface.stylesheet),this.surface.styleChanged=!1);else{var r=new u(this,this.onGeodataProcessorMessage.bind(this));r.setStylesheet(this.surface.stylesheet),this.surface.geodataProcessor=r,this.map.geodataProcessors.push(r)}this.geodataProcessor=this.surface.geodataProcessor,this.statsCounter=0,this.size=0,this.killed=!1,this.killedByCache=!1,this.ready=!1,this.isReady()};c.prototype.kill=function(){this.killed=!0,this.geodata=null,this.killGeodataView(!1)},c.prototype.killGeodataView=function(t){this.killedByCache=t;for(var e=0,i=this.gpuGroups.length;e<i;e++)this.gpuGroups[e].kill();this.gpuGroups=[],!0!==t&&null!=this.gpuCacheItem&&this.map.gpuCache.remove(this.gpuCacheItem),this.stats.gpuGeodata-=this.size,this.stats.graphsFluxGeodata[1][0]++,this.stats.graphsFluxGeodata[1][1]+=this.size,this.ready=!1,this.size=0,this.gpuCacheItem=null},c.prototype.onGeodataProcessorMessage=function(t,e,i){if(!this.killed&&!this.killedByCache)switch(t){case"beginGroup":i?(this.currentGpuGroup=new l(e.id,e.bbox,e.origin,this.gpu,this.renderer),this.gpuGroups.push(this.currentGpuGroup)):(this.map.markDirty(),this.map.addProcessingTask(this.onGeodataProcessorMessage.bind(this,t,e,!0)));break;case"addRenderJob":if(i){if(this.currentGpuGroup){var r=performance.now();this.currentGpuGroup.addRenderJob(e,this.tile),this.stats.renderBuild+=performance.now()-r}}else this.map.markDirty(),this.map.addProcessingTask(this.onGeodataProcessorMessage.bind(this,t,e,!0));break;case"endGroup":i?this.currentGpuGroup&&(this.size+=this.currentGpuGroup.size):(this.map.markDirty(),this.map.addProcessingTask(this.onGeodataProcessorMessage.bind(this,t,e,!0)));break;case"allProcessed":this.geodataProcessor.busy=!1,i?(this.map.markDirty(),this.gpuCacheItem=this.map.gpuCache.insert(this.killGeodataView.bind(this,!0),this.size),this.stats.gpuGeodata+=this.size,this.stats.graphsFluxGeodata[0][0]++,this.stats.graphsFluxGeodata[0][1]+=this.size,this.ready=!0):(this.map.markDirty(),this.map.addProcessingTask(this.onGeodataProcessorMessage.bind(this,t,e,!0)));break;case"ready":this.map.markDirty()}},c.prototype.isReady=function(t,e,i){if(this.killed)return!1;var r=this.map.stats.gpuRenderUsed>=this.map.draw.maxGpuUsed;return t=t||r,this.ready||t||!this.surface.stylesheet.isReady()||this.geodata.isReady(t,e,i)&&this.geodataProcessor.isReady()&&(this.killedByCache=!1,this.geodataProcessor.setListener(this.onGeodataProcessorMessage.bind(this)),this.geodataProcessor.sendCommand("processGeodata",this.geodata.geodata,this.tile),this.geodataProcessor.busy=!0),!t&&this.gpuCacheItem&&this.map.gpuCache.updateItem(this.gpuCacheItem),this.ready},c.prototype.getWorldMatrix=function(t,e,i){var r=i;return null!=r||(r=o.create(),o.multiply(h.translationMatrix(t.min[0]-e[0],t.min[1]-e[1],t.min[2]-e[2]),h.scaleMatrix(1,1,1),r)),r},c.prototype.draw=function(t){if(this.ready){for(var e=this.renderer,i=this.tile?Math.abs(this.tile.tiltAngle):e.cameraTiltFator,r=0,s=this.gpuGroups.length;r<s;r++){var a=this.gpuGroups[r];if(a.jobs.length){var n=o.create(),h=o.create();o.multiply(e.camera.getModelviewMatrix(),this.getWorldMatrix(a.bbox,t),h);var l=e.camera.getProjectionMatrix();o.multiply(l,h,n),a.draw(h,n,null,i,this.tile?this.tile.texelSize:1),this.stats.drawnFaces+=a.polygons,this.stats.drawCalls+=a.jobs.length}}this.statsCoutner!=this.stats.counter&&(this.statsCoutner=this.stats.counter,this.stats.gpuRenderUsed+=this.size)}return this.ready},e.a=c},function(t,e,i){"use strict";var r=i(5),s=i(4),a=r.a,n=s.a,o=function(t,e,i){this.map=t,this.stats=t.stats,this.mapLoaderUrl=e,this.extraInfo=i,this.bbox=new a,this.size=0,this.fileSize=0,this.geodata=null,this.cacheItem=null,this.loadState=0,this.loadErrorTime=null,this.loadErrorCounter=0,this.map.markDirty()};o.prototype.kill=function(){this.bbox=null,this.killGeodata()},o.prototype.killGeodata=function(t){this.geodata&&(this.geodata=null),!0!==t&&null!=this.cacheItem&&this.map.resourcesCache.remove(this.cacheItem),this.loadState=0,this.size=0,this.fileSize=0,this.cacheItem=null},o.prototype.isReady=function(t,e){var i=this.map.stats.gpuRenderUsed>=this.map.maxGpuUsed;if(t=t||i,2==this.loadState)return this.map.resourcesCache.updateItem(this.cacheItem),!0;if(0==this.loadState)if(t);else{if("object"==typeof this.mapLoaderUrl)return this.geodata=JSON.stringify(this.mapLoaderUrl),this.loadState=2,this.cacheItem=this.map.resourcesCache.insert(this.killGeodata.bind(this,!0),this.geodata.length),this.map.resourcesCache.updateItem(this.cacheItem),!0;this.scheduleLoad(e)}else 3==this.loadState&&this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&performance.now()>this.loadErrorTime+this.map.config.mapLoadErrorRetryTime&&this.scheduleLoad(e);return!1},o.prototype.scheduleLoad=function(t){this.map.loader.load(this.mapLoaderUrl,this.onLoad.bind(this),t,this.extraInfo.tile,"geodata")},o.prototype.onLoad=function(t,e,i){this.mapLoaderCallLoaded=e,this.mapLoaderCallError=i,this.loadState=1,n.loadJSON(t,this.onLoaded.bind(this),this.onLoadError.bind(this),!0,!!n.useCredentials&&-1!=this.mapLoaderUrl.indexOf(this.map.url.baseUrl),this.map.core.xhrParams)},o.prototype.onLoadError=function(){this.map.killed||(this.loadState=3,this.loadErrorTime=performance.now(),this.loadErrorCounter++,this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&setTimeout(function(){this.map.killed||this.map.markDirty()}.bind(this),this.map.config.mapLoadErrorRetryTime),this.mapLoaderCallError())},o.prototype.onLoaded=function(t){if(!this.map.killed){var e=t.length;this.size=e,this.fileSize=e,this.geodata=t,this.cacheItem=this.map.resourcesCache.insert(this.killGeodata.bind(this,!0),e),this.map.markDirty(),this.loadState=2,this.loadErrorTime=null,this.loadErrorCounter=0,this.mapLoaderCallLoaded()}},e.a=o},function(t,e,i){"use strict";var r=i(54),s=i(3),a=i(23),n=i.n(a),o=r.a,h=s.a,l=n.a,u=function(t,e,i){if(this.map=t,this.id=e,this.proj4=t.proj4,this.comment=i.comment||null,this.srsDef=i.srsDef||null,this.srsModifiers=i.srsModifiers||[],this.type=i.type||"projected",this.vdatum=i.vdatum||"orthometric",this.srsDef=i.srsDefEllps||this.srsDef,this.periodicity=this.parsePeriodicity(i.periodicity),this.srsInfo=this.proj4(this.srsDef).info(),this.geoidGrid=null,this.geoidGridMap=null,this.srsProj4=this.proj4(this.srsDef,null,null,!0),this.latlonProj4=null,this.proj4Cache={},i.geoidGrid){var r=i.geoidGrid;if(this.geoidGrid={definition:r.definition||null,srsDefEllps:r.srsDefEllps||null,valueRange:r.valueRange||[0,1]},r.extents?this.geoidGrid.extents={ll:r.extents.ll,ur:r.extents.ur}:this.geoidGrid.extents={ll:[0,0],ur:[1,1]},this.geoidGrid.definition){var s=this.map.url.makeUrl(this.geoidGrid.definition,{},null);this.geoidGridMap=new o(this.map,s,!0)}this.geoidGrid.srsDefEllps&&(this.geoidGrid.srsProj4=this.proj4(this.geoidGrid.srsDefEllps,null,null,!0))}"geographic"==this.type&&(this.spheroid=i.spheroid||null,this.spheroid)};u.prototype.parsePeriodicity=function(t){return null==t?null:{type:t.type||"",period:t.period||0}},u.prototype.getInfo=function(){return{comment:this.comment,srsDef:this.srsDef,srsModifiers:this.srsModifiers,type:this.type,vdatum:this.vdatum,srsDefEllps:this.srsDef,a:this.srsInfo.a,b:this.srsInfo.b}},u.prototype.getSrsInfo=function(){return this.srsInfo},u.prototype.isReady=function(){return this.isGeoidGridReady()},u.prototype.isGeoidGridReady=function(){return null==this.geoidGrid||null!=this.geoidGridMap&&this.geoidGridMap.isReady()},u.prototype.isProjected=function(){return"projected"==this.type},u.prototype.getOriginalHeight=function(t){var e=t[2]||0;return e/=this.getVerticalAdjustmentFactor(t),e+=this.getGeoidGridDelta(t)},u.prototype.getFinalHeight=function(t){var e=t[2]||0;return e-=this.getGeoidGridDelta(t),e*=this.getVerticalAdjustmentFactor(t)},u.prototype.getGeoidGridDelta=function(t){if(null!=this.geoidGridMap&&this.isGeoidGridReady()){var e=this.proj4(this.srsProj4,this.geoidGrid.srsProj4,[t[0],t[1]]),i=e[0]-this.geoidGrid.extents.ll[0],r=this.geoidGrid.extents.ur[1]-e[1],s=this.geoidGridMap.getImageExtents();i*=s[0]/(this.geoidGrid.extents.ur[0]-this.geoidGrid.extents.ll[0]),r*=s[1]/(this.geoidGrid.extents.ur[1]-this.geoidGrid.extents.ll[1]),i=h.clamp(i,0,s[0]-2),r=h.clamp(r,0,s[1]-2);var a=Math.floor(i),n=Math.floor(r),o=i-a,l=r-n,u=this.geoidGridMap.getImageData(),c=n*s[0],d=c+s[0],p=u[4*(c+a)],f=u[4*(c+a+1)],g=u[4*(d+a)],m=u[4*(d+a+1)],v=p+(f-p)*o,y=g+(m-g)*o,b=v+(y-v)*l;return b=this.geoidGrid.valueRange[0]+b*((this.geoidGrid.valueRange[1]-this.geoidGrid.valueRange[0])/255)}return 0},u.prototype.getVerticalAdjustmentFactor=function(t){if(-1!=this.srsModifiers.indexOf("adjustVertical")){var e=this.getSrsInfo(),i="+proj=longlat +alpha=0 +gamma=0 +a="+e.a+" +b="+e.b+" +x0=0 +y0=0";this.latlonProj4||(this.latlonProj4=this.proj4(i,null,null,!0));var r=this.proj4(this.srsProj4,this.latlonProj4,[t[0],t[1]]),s=new l.Geodesic.Geodesic(e.a,e.a/e.b-1),a=s.Direct(r[1],r[0],90,1e3);r=[a.lon2,a.lat2],r=this.proj4(this.latlonProj4,this.srsProj4,r);var n=r[0]-t[0],o=r[1]-t[1];return Math.sqrt(n*n+o*o)/1e3}return 1},u.prototype.convertCoordsTo=function(t,e,i){if(this.isReady(),"string"!=typeof e){if(e.id==this.id)return t.slice();e.isReady()}t=t.slice();var r="string"==typeof e;t[2]=this.getOriginalHeight(t);var s=r?e:e.srsProj4,a=r?e:e.srsDef,n=this.proj4Cache[a];n||(n=this.proj4(this.srsProj4,s),this.proj4Cache[a]=n);var o=n.forward(t);return i||r||(o[2]=e.getFinalHeight(o)),o},u.prototype.convertCoordsToFast=function(t,e,i,r,s,a){var n=e.srsProj4,o=e.srsDef,h=this.proj4Cache[o];h||(h=this.proj4(this.srsProj4,n),this.proj4Cache[o]=h);var l=h.forward(t);r[a]=l[0],r[a+1]=l[1],r[a+2]=l[2],e.geoidGrid&&(r[a+2]-=e.getGeoidGridDelta(t))},u.prototype.convertCoordsFrom=function(t,e){if(this.isReady(),"string"!=typeof e){if(e.id==this.id)return t.slice();e.isReady()}t=t.slice(),"string"!=typeof e&&(t[2]=e.getOriginalHeight(t));var i="string"==typeof e?e:e.srsProj4,r="string"==typeof e?e:e.srsDef,s=this.proj4Cache[r];s||(s=this.proj4(this.srsProj4,i),this.proj4Cache[r]=s);var a=s.inverse(t);return a[2]=this.getFinalHeight(a),a},u.prototype.phi2z=function(t,e){for(var i,r,s=.5*Math.PI,a=.5*t,n=s-2*Math.atan(e),o=0;o<=15;o++)if(i=t*Math.sin(n),r=s-2*Math.atan(e*Math.pow((1-i)/(1+i),a))-n,n+=r,Math.abs(r)<=1e-10)return n;return-9999},u.prototype.convertMercToWGS=function(t,e,i,r){var s=2*Math.PI,a=.5*Math.PI,n=this.srsProj4,o=t[i]-n.x0,h=t[i+1]-n.y0;if(n.sphere)e[r+1]=a-2*Math.atan(Math.exp(-h/(n.a*n.k0)));else{var l=Math.exp(-h/(n.a*n.k0)),u=this.phi2z(n.e,l);if(e[r+1]=u,-9999===u)return}o=n.long0+o/(n.a*n.k0);e[r]=Math.abs(o)<=3.14159265359?o:o-(o<0?-1:1)*s,e[r+2]=t[i+2]},u.prototype.convertWGSToGeocent=function(t,e,i,r,s){var a,n,o,h,l=e.datum,u=.5*Math.PI,c=t[r],d=t[r+1],p=t[r+2];if(d<-u&&d>-1.001*u)d=-u;else if(d>u&&d<1.001*u)d=u;else if(d<-u||d>u)return null;c>Math.PI&&(c-=2*Math.PI),n=Math.sin(d),h=Math.cos(d),o=n*n,a=l.a/Math.sqrt(1-l.es*o),i[s]=(a+p)*h*Math.cos(c),i[s+1]=(a+p)*h*Math.sin(c),i[s+2]=(a*(1-l.es)+p)*n},e.a=u},function(t,e,i){"use strict";var r=i(4),s=r.a,a=function(t,e,i,r){this.generateLines=!0,this.map=t,this.renderer=this.map.renderer,this.stats=t.stats,this.id=e,this.url=null,this.data=null,this.loadState=0,this.size=0,this.fileSize=0,this.freeLayer=r,this.fonts={},this.fontsReady=!1,"object"==typeof i?(this.data=i,this.setFonts(this.data),this.loadState=2,this.map.markDirty()):(this.freeLayer?this.url=this.freeLayer.processUrl(i,""):this.url=this.map.url.processUrl(i),s.loadJSON(this.url,this.onLoaded.bind(this),this.onLoadError.bind(this),null,!!s.useCredentials&&-1!=this.url.indexOf(this.map.url.baseUrl),this.map.core.xhrParams),this.loadState=1)};a.prototype.kill=function(){},a.prototype.setData=function(t){this.data=t,this.setFonts(t),this.loadState=2,this.checkFonts()},a.prototype.checkFonts=function(){var t=!0;for(var e in this.fonts)t=t&&this.renderer.getFont(this.fonts[e]).isReady();return this.fontsReady=t,t},a.prototype.isReady=function(t,e){return 2==this.loadState?!!this.fontsReady||this.checkFonts():(0==this.loadState&&(t||this.scheduleLoad(e)),!1)},a.prototype.scheduleLoad=function(t){this.map.loader.load(this.url,this.onLoad.bind(this),t)},a.prototype.onLoad=function(){this.loadState=1},a.prototype.onLoadError=function(){this.map.killed},a.prototype.setFonts=function(t){this.fonts=t.fonts||{},this.fonts["#default"]||(this.fonts["#default"]=this.map.core.config.mapDefaultFont)},a.prototype.onLoaded=function(t){this.map.killed||(this.data=t,this.setFonts(t),this.loadState=2,this.map.markDirty())},e.a=a},function(t,e,i){"use strict";var r=i(4),s=i(6),a=r.a,n=s.a,o=function(t,e,i,r,s){this.map=t,this.stats=t.stats,this.tile=r,this.internal=s,this.image=null,this.imageData=null,this.imageExtents=null,this.gpuTexture=null,this.loadState=0,this.loadErrorTime=null,this.loadErrorCounter=0,this.neverReady=!1,this.mapLoaderUrl=e,this.heightMap=i||!1,this.statsCounter=0,this.checkStatus=0,this.checkType=null,this.checkValue=null,this.fastHeaderCheck=!1,this.gpuSize=0,this.fileSize=0,this.cacheItem=null,this.gpuCacheItem=null};o.prototype.kill=function(){this.killImage(),this.killGpuTexture(),this.mask&&(this.mask.killImage(),this.mask.killGpuTexture())},o.prototype.killImage=function(t){this.image=null,this.imageData=null,!0!==t&&this.cacheItem&&this.map.resourcesCache.remove(this.cacheItem),this.mask&&this.mask.killImage(),this.gpuTexture||(this.loadState=0),this.cacheItem=null},o.prototype.killGpuTexture=function(t){null!=this.gpuTexture&&(this.stats.gpuTextures-=this.gpuTexture.size,this.gpuTexture.kill(),this.stats.graphsFluxTexture[1][0]++,this.stats.graphsFluxTexture[1][1]+=this.gpuTexture.size,this.mask&&this.mask.killGpuTexture()),this.gpuTexture=null,!0!==t&&this.gpuCacheItem&&this.map.gpuCache.remove(this.gpuCacheItem),this.image||this.imageData||(this.loadState=0),this.gpuCacheItem=null},o.prototype.isReady=function(t,e,i,r){var s=this.map.stats.gpuRenderUsed>=this.map.draw.maxGpuUsed;if(t=t||s,this.neverReady)return!1;switch(r.checkType){case 2:case 3:case 4:if(2!=this.checkStatus){if(this.checkType=r.checkType,this.checkValue=r.checkValue,0==this.checkStatus)this.scheduleHeadRequest(e,4==this.checkType);else if(3==this.checkStatus)this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&performance.now()>this.loadErrorTime+this.map.config.mapLoadErrorRetryTime&&this.scheduleHeadRequest(e,4==this.checkType);else if(-1==this.checkStatus&&r.extraInfo)for(r.extraBound||(r.extraBound={tile:r.extraInfo.tile,layer:r.extraInfo.layer},r.setBoundTexture(r.extraBound.tile.parent,r.extraBound.layer));r.extraBound.texture.extraBound||-1==r.extraBound.texture.checkStatus;)r.setBoundTexture(r.extraBound.sourceTile.parent,r.extraBound.layer);return!1}}if(2==this.loadState){var a;if(!t&&this.cacheItem&&this.map.resourcesCache.updateItem(this.cacheItem),(this.heightMap&&!this.imageData||!this.heightMap&&!this.gpuTexture)&&this.stats.renderBuild>this.map.config.mapMaxProcessingTime)return this.map.markDirty(),!1;if(i)return this.heightMap&&(this.imageData||(a=performance.now(),this.buildHeightMap(),this.stats.renderBuild+=performance.now()-a)),!0;if(this.heightMap)this.imageData||(a=performance.now(),this.buildHeightMap(),this.stats.renderBuild+=performance.now()-a);else{if(!this.gpuTexture){if(this.map.stats.gpuRenderUsed>=this.map.draw.maxGpuUsed)return!1;if(s)return!1;a=performance.now(),this.buildGpuTexture(),this.stats.renderBuild+=performance.now()-a}!t&&this.gpuCacheItem&&this.map.gpuCache.updateItem(this.gpuCacheItem)}return!0}return 0==this.loadState?t||this.scheduleLoad(e):3==this.loadState&&this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&performance.now()>this.loadErrorTime+this.map.config.mapLoadErrorRetryTime&&this.scheduleLoad(e),!1},o.prototype.scheduleLoad=function(t,e){this.map.loader.load(this.mapLoaderUrl,this.onLoad.bind(this,e),t,this.tile,this.internal?"texture-in":"texture-ex")},o.prototype.onLoad=function(t,e,i,r){this.mapLoaderCallLoaded=i,this.mapLoaderCallError=r;var s=this.onLoadError.bind(this),n=this.onLoaded.bind(this);t?this.checkStatus=1:this.loadState=1,this.map.config.mapXhrImageLoad?a.loadBinary(e,this.onBinaryLoaded.bind(this),s,!!a.useCredentials&&-1!=this.mapLoaderUrl.indexOf(this.map.url.baseUrl),this.map.core.xhrParams,"blob"):this.image=a.loadImage(e,n,s,!!this.map.core.tokenCookieHost&&-1!=e.indexOf(this.map.core.tokenCookieHost))},o.prototype.onLoadError=function(t){this.map.killed||(t&&window.URL.revokeObjectURL(this.image.src),this.loadState=3,this.loadErrorTime=performance.now(),this.loadErrorCounter++,this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&setTimeout(function(){this.map.killed||this.map.markDirty()}.bind(this),this.map.config.mapLoadErrorRetryTime),this.mapLoaderCallError())},o.prototype.onBinaryLoaded=function(t){if(this.fastHeaderCheck&&this.checkType&&1!=this.checkType&&(this.onHeadLoaded(null,t,null),-1==this.checkStatus))return void this.mapLoaderCallLoaded();var e=new Image;e.onerror=this.onLoadError.bind(this,!0),e.onload=this.onLoaded.bind(this,!0),this.image=e,e.src=window.URL.createObjectURL(t),this.fileSize=t.size},o.prototype.onLoaded=function(t){if(!this.map.killed){t&&window.URL.revokeObjectURL(this.image.src);var e=this.image.naturalWidth*this.image.naturalHeight*(this.heightMap,3);this.gpuSize=this.image.naturalWidth*this.image.naturalHeight*4,this.cacheItem=this.map.resourcesCache.insert(this.killImage.bind(this,!0),e),this.map.markDirty(),this.loadState=2,this.loadErrorTime=null,this.loadErrorCounter=0,this.mapLoaderCallLoaded()}},o.prototype.scheduleHeadRequest=function(t,e){this.map.config.mapXhrImageLoad&&this.fastHeaderCheck?this.scheduleLoad(t,!0):this.map.loader.load(this.mapLoaderUrl,this.onLoadHead.bind(this,e),t,this.tile,this.internal,this.internal?"texture-in":"texture-ex")},o.prototype.onLoadHead=function(t,e,i,r){this.mapLoaderCallLoaded=i,this.mapLoaderCallError=r;var s=this.onLoadHeadError.bind(this,t),n=this.onHeadLoaded.bind(this,t);this.checkStatus=1,t?a.loadBinary(e,n,s,!!a.useCredentials&&-1!=this.mapLoaderUrl.indexOf(this.map.url.baseUrl),this.map.core.xhrParams,"blob"):a.headRequest(e,n,s,!!a.useCredentials&&-1!=this.mapLoaderUrl.indexOf(this.map.url.baseUrl),this.map.core.xhrParams,"blob")},o.prototype.onLoadHeadError=function(){this.map.killed||(this.checkStatus=3,this.loadErrorTime=performance.now(),this.loadErrorCounter++,this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&setTimeout(function(){this.map.killed||this.map.markDirty()}.bind(this),this.map.config.mapLoadErrorRetryTime),this.mapLoaderCallError())},o.prototype.onHeadLoaded=function(t,e,i){if(!this.map.killed)if(this.checkStatus=2,this.loadErrorTime=null,this.loadErrorCounter=0,this.map.config.mapXhrImageLoad&&this.fastHeaderCheck)switch(this.checkType){case 4:e&&e.size==this.checkValue&&(this.checkStatus=-1);break;case 2:e&&e.type==this.checkValue&&(this.checkStatus=-1);break;case 3:i&&-1!=this.checkValue.indexOf(i)&&(this.checkStatus=-1)}else{switch(this.checkType){case 4:e&&e.byteLength==this.checkValue&&(this.checkStatus=-1);break;case 2:e&&-1!=e.indexOf(this.checkValue)&&(this.checkStatus=-1);break;case 3:i&&-1!=this.checkValue.indexOf(i)&&(this.checkStatus=-1)}this.mapLoaderCallLoaded()}},o.prototype.buildGpuTexture=function(){this.gpuTexture=new n(this.map.renderer.gpu,null,this.map.core),this.gpuTexture.createFromImage(this.image,"linear",!1),this.stats.gpuTextures+=this.gpuTexture.size,this.stats.graphsFluxTexture[0][0]++,this.stats.graphsFluxTexture[0][1]+=this.gpuTexture.size,this.gpuCacheItem=this.map.gpuCache.insert(this.killGpuTexture.bind(this,!0),this.gpuTexture.size),this.gpuSize=this.gpuTexture.size},o.prototype.buildHeightMap=function(){var t=document.createElement("canvas");t.width=this.image.naturalWidth,t.height=this.image.naturalHeight;var e=t.getContext("2d");e.drawImage(this.image,0,0),this.imageData=e.getImageData(0,0,this.image.naturalWidth,this.image.naturalHeight).data,this.imageExtents=[this.image.naturalWidth,this.image.naturalHeight],this.image=null},o.prototype.getGpuTexture=function(){return this.gpuTexture},o.prototype.getHeightMapValue=function(t,e){return this.imageData?this.imageData[4*(e*this.imageExtents[0]+t)]:0},e.a=o},function(t,e,i){"use strict";var r=i(150),s=r.a,a=function(t,e,i){this.map=t,this.camera=t.camera,this.rootId=[0,0,0],this.freeLayer=e,this.freeLayerSurface=i,this.metaBinaryOrder=this.map.referenceFrame.params.metaBinaryOrder,this.surfaceTree=new s(this.map,null,this.rootId),this.surfaceSequence=[],this.surfaceOnlySequence=[],this.config=this.map.config,this.cameraPos=[0,0,0],this.worldPos=[0,0,0],this.ndcToScreenPixel=1,this.counter=0};a.prototype.kill=function(){this.surfaceTree=null,this.metastorageTree=null,this.surfaceTracer=null,this.heightTracer=null},a.prototype.findSurfaceTile=function(t){for(var e=this.surfaceTree,i=t[0];i>0;i--){var r=1<<i-1,s=0;if(0!=(t[1]&r)&&(s+=1),0!=(t[2]&r)&&(s+=2),!(e=e.children[s]))return null}return e},a.prototype.findNavTile=function(t){var e=this.surfaceTree;if(0==t[0])return e.metanode&&e.metanode.hasNavtile()?e:null;for(var i=null,r=t[0];r>0;r--){var s=1<<r-1,a=0;if(0!=(t[1]&s)&&(a+=1),0!=(t[2]&s)&&(a+=2),!(e=e.children[a]))return i;e.metanode&&e.metanode.hasNavtile()&&(i=e)}return i},a.prototype.draw=function(){this.cameraPos=[0,0,0],this.worldPos=[0,0,0];var t=this.map,e=t.draw;this.ndcToScreenPixel=e.ndcToScreenPixel;var i=t.getPhysicalSrs(),r=i.periodicity;if(!this.freeLayerSurface||!this.freeLayerSurface.geodata||0==e.drawChannel)if(null!=r)this.drawSurface([0,0,0]),"X"==r.type&&(this.drawSurface([r.period,0,0]),this.drawSurface([-r.period,0,0]));else{switch(this.freeLayerSurface&&this.freeLayerSurface.geodata?t.config.mapGeodataLoadMode:t.config.mapLoadMode){case"topdown":this.drawSurface([0,0,0]);break;case"fit":this.drawSurfaceFit([0,0,0]);break;case"fitonly":this.drawSurfaceFitOnly([0,0,0])}}},a.prototype.updateNodeHeightExtents=function(t,e){if(!e.heightReady&&e.metatile.useVersion<4){for(var i=t.parent;i;){var r=i.metanode;if(r.hasNavtile()){e.minHeight=r.minHeight,e.maxHeight=r.maxHeight,e.minZ=r.minZ,e.maxZ=r.maxZ,e.generateCullingHelpers();break}i=i.parent}e.heightReady=!0}},a.prototype.logTileInfo=function(t,e,i){if(t&&e){var r=t.bboxVisible(t.id,e.bbox,i,e);t.updateTexelSize(),console.log("tile: "+JSON.stringify(t.id)+" visible: "+r+" texelsize: "+t.texelSize+" center: "+JSON.stringify(e.diskPos)+" vec: "+e.diskNormal+"ang: "+e.diskAngle+" dist: "+e.diskDistance)}},a.prototype.drawSurface=function(){this.counter++;var t=this.surfaceTree;if(t.isMetanodeReady(this,0)){var e=this.map,i=t.metanode,r=e.camera.position;if(t.bboxVisible(t.id,i.bbox,r,i)){t.updateTexelSize();var s=(this.freeLayerSurface,1),a=e.draw,n=a.drawTiles,o=a.drawBuffer,h=a.processBuffer,l=a.processBuffer2,u=0,c=0,d=0,p=0,f=0,g=0;h[0]=t,c=1;var m=a.texelSizeFit,v=a.replay,y=v.storeNodes||v.storeFreeNodes,b=v.nodeBuffer;a.drawCounter++;var x,M,w,S=1,A=1,C=1,T=a.drawCounter;do{var P=0;for(d=0,x=c-1;x>=0;x--)if(t=h[x],i=t.metanode,i&&(S++,i.metatile.drawCounter!=T&&(i.metatile.drawCounter=T,A++)),t.bboxVisible(t.id,i.bbox,r,i))if(C++,t.texelSize!=Number.POSITIVE_INFINITY&&t.texelSize>P&&(P=t.texelSize),y&&b.push(t),t.texelSize<=m)g=a.getDrawCommandsGpuSize(t.drawCommands[a.drawChannel]||t.lastRenderState.drawCommands[a.drawChannel]),p+=g,f+=g,t.drawCounter=a.drawCounter,o[u]=t,u++;else{g=a.getDrawCommandsGpuSize(t.drawCommands[a.drawChannel]||t.lastRenderState.drawCommands[a.drawChannel]),p+=g;var E=0,L=0,k=[];for(M=0;M<4;M++){var I=t.children[M];if(I&&(E++,I.isMetanodeReady(this,I.id[0]))){this.updateNodeHeightExtents(I,I.metanode),I.updateTexelSize(1);var N=I.id[0]*s*I.distance;t.surface&&I.metanode.hasGeometry()?n.drawSurfaceTile(I,I.metanode,r,I.texelSize,N,!0,!1,!0)&&(L++,k.push(I)):(L++,k.push(I))}}if(E>0&&E==L&&0!=E){do{var F=!0;for(M=0,w=k.length-1;M<w;M++)if(k[M].distance>k[M+1].distance){var B=k[M];k[M]=k[M+1],k[M+1]=B,F=!1}}while(!F);for(M=0,w=k.length;M<w;M++)l[d]=k[M],d++}else f+=g,t.drawCounter=a.drawCounter,o[u]=t,u++}var R=h;h=l,l=R,c=d}while(c>0);0>a.bestMeshTexelSize&&(a.bestMeshTexelSize=0);var _=e.stats;if(_.usedNodes=C,_.processedNodes=S,_.processedMetatiles=A,_.gpuNeeded=p,v.storeTiles||v.storeFreeTiles){a.tileBuffer[0]||(a.tileBuffer[0]=[]);var D=a.tileBuffer[0];for(x=u-1;x>=0;x--)D.push(o[x])}for(e.gpuCache.skipCostCheck=!0,x=u-1;x>=0&&(t=o[x],!(_.gpuRenderUsed>=a.maxGpuUsed));x--)n.drawSurfaceTile(t,t.metanode,r,t.texelSize,0,!1,!1);e.gpuCache.skipCostCheck=!1,e.gpuCache.checkCost()}}},a.prototype.drawSurfaceFitOnly=function(){this.counter++;var t=this.surfaceTree;if(t.isMetanodeReady(this,0)){var e=this.map,i=t.metanode,r=e.camera.position;if(t.bboxVisible(t.id,i.bbox,r,i)){t.updateTexelSize();var s=e.draw,a=s.drawTiles,n=s.drawBuffer,o=s.processBuffer,h=s.processBuffer2,l=0,u=0,c=0;o[0]=t,u=1;var d=s.texelSizeFit,p=e.draw.replay,f=p.storeNodes||p.storeFreeNodes,g=p.nodeBuffer;s.drawCounter++;var m,v,y,b=1,x=1,M=1,w=e.drawCounter;do{var S=0;for(c=0,m=u-1;m>=0;m--)if(t=o[m],i=t.metanode,i&&(x++,i.metatile.drawCounter!=w&&(i.metatile.drawCounter=w,M++)),t.bboxVisible(t.id,i.bbox,r,i))if(b++,f&&g.push(t),t.texelSize!=Number.POSITIVE_INFINITY&&t.texelSize>S&&(S=t.texelSize),t.texelSize<=d)t.drawCounter=s.drawCounter,n[l]=t,l++;else{var A=0,C=[];for(v=0;v<4;v++){var T=t.children[v];T&&(A++,T.isMetanodeReady(this,T.id[0])&&(this.updateNodeHeightExtents(T,T.metanode),T.updateTexelSize(),C.push(T)))}if(A>0){do{var P=!0;for(v=0,y=C.length-1;v<y;v++)if(C[v].distance>C[v+1].distance){var E=C[v];C[v]=C[v+1],C[v+1]=E,P=!1}}while(!P);for(v=0,y=C.length;v<y;v++)h[c]=C[v],c++}else t.drawCounter=s.drawCounter,n[l]=t,l++}var L=o;o=h,h=L,u=c}while(u>0);var k=e.stats;if(k.usedNodes=b,k.processedNodes=x,k.processedMetatiles=M,p.storeTiles||p.storeFreeTiles){s.tileBuffer[0]||(s.tileBuffer[0]=[]);var I=s.tileBuffer[0];for(m=l-1;m>=0;m--)I.push(n[m])}for(e.gpuCache.skipCostCheck=!0,m=l-1;m>=0&&(t=n[m],!(k.gpuRenderUsed>=s.maxGpuUsed));m--)a.drawSurfaceTile(t,t.metanode,r,t.texelSize,0,!1,!1);e.gpuCache.skipCostCheck=!1,e.gpuCache.checkCost()}}},a.prototype.drawSurfaceFit=function(){this.counter++;var t=this.surfaceTree;if(t.isMetanodeReady(this,0)){var e=this.map,i=t.metanode,r=e.camera.position;if(t.bboxVisible(t.id,i.bbox,r,i)){t.updateTexelSize();var s=t.surface?t.surface.geodata:null,a=t.surface?t.surface.free:null,n=!s&&!a&&e.config.mapHeightfiledWhenUnloaded,o=e.draw,h=o.drawTiles,l=o.replay,u=o.drawBuffer,c=o.processBuffer,d=o.processBuffer2,p=0,f=0,g=0;c[0]=[t,0],f=1;var m=o.texelSizeFit,v=l.storeNodes||l.storeFreeNodes,y=l.nodeBuffer;o.drawCounter++;var b,x,M,w,S,A,C=1,T=1,P=1,E=o.drawCounter,L=e.config.mapMaxHiresLodLevels;do{var k=0;for(g=0,b=f-1;b>=0;b--){var I=c[b];t=I[0];var N=I[1];if(t.childrenReadyCount=0,N>=L){if(n){for(A=t,x=N;x>0&&(A.parent&&0==A.parent.childrenReadyCount);x--)A=A.parent;A.drawCounter!=o.drawCounter&&(A.drawCounter=o.drawCounter,u[p]=[A,!0],p++)}}else{if(i=t.metanode,i&&(T++,i.metatile.drawCounter!=E&&(i.metatile.drawCounter=E,P++)),t.bboxVisible(t.id,i.bbox,r,i)){C++,t.texelSize!=Number.POSITIVE_INFINITY&&t.texelSize>k&&(k=t.texelSize),v&&y.push(t);var F=g,B=p;if(!i.hasChildren()||t.texelSize<=m)if(S=2e3*(t.id[0]+4)*t.distance,i.hasChildren()&&!h.drawSurfaceTile(t,t.metanode,r,t.texelSize,S,!0,N>0,!0)){for(N++,x=0;x<4;x++)(w=t.children[x])&&w.isMetanodeReady(this,w.id[0],!0)&&(this.updateNodeHeightExtents(w,w.metanode),w.updateTexelSize(),h.drawSurfaceTile(w,w.metanode,r,w.texelSize,S,!0,N>0,!0)?(t.childrenReadyCount++,w.drawCounter=o.drawCounter,u[p]=[w,!1],p++):(d[g]=[w,N],g++));F==g&&B==p&&N--}else t.drawCounter=o.drawCounter,u[p]=[t,!1],p++;else if(0==N&&i.hasGeometry()&&t.texelSize<=2*m){var R=0,_=0,D=[];for(x=0;x<4;x++)(w=t.children[x])&&(R++,w.isMetanodeReady(this,w.id[0])&&(this.updateNodeHeightExtents(w,w.metanode),w.updateTexelSize(),S=2e3*(w.id[0]+4)*w.distance,h.drawSurfaceTile(w,w.metanode,r,w.texelSize,S,!0,!0,!0)&&(_++,D.push(w))));if(R>0&&R==_){do{var U=!0;for(x=0,M=D.length-1;x<M;x++)if(D[x].distance>D[x+1].distance){var z=D[x];D[x]=D[x+1],D[x+1]=z,U=!1}}while(!U);for(x=0,M=D.length;x<M;x++)d[g]=[D[x],N],g++}else if(S=2e3*(t.id[0]+4)*t.distance,h.drawSurfaceTile(t,t.metanode,r,t.texelSize,S,!0,!0,!0))for(t.drawCounter=o.drawCounter,u[p]=[t,!1],p++,x=0;x<4;x++)(w=t.children[x])&&w.isMetanodeReady(this,w.id[0])&&(S=2e3*(w.id[0]+4)*w.distance,h.drawSurfaceTile(w,w.metanode,r,w.texelSize,S,!0,!1,!0));else for(x=0;x<4;x++)(w=t.children[x])&&w.isMetanodeReady(this,w.id[0])&&(this.updateNodeHeightExtents(w,w.metanode),w.updateTexelSize(),d[g]=[w,N],g++)}else for(x=0;x<4;x++)(w=t.children[x])&&w.isMetanodeReady(this,w.id[0])&&(this.updateNodeHeightExtents(w,w.metanode),w.updateTexelSize(),d[g]=[w,N],g++)}if(n&&F==g&&B==p){for(A=t,x=N;x>0&&(A.parent&&0==A.parent.childrenReadyCount);x--)A=A.parent;A.drawCounter!=o.drawCounter&&(A.drawCounter=o.drawCounter,u[p]=[A,!0],p++)}}}var G=c;c=d,d=G,f=g}while(f>0);var V=e.stats;if(V.usedNodes=C,V.processedNodes=T,V.processedMetatiles=P,l.storeTiles||l.storeFreeTiles){o.tileBuffer[0]||(o.tileBuffer[0]=[]);var O=o.tileBuffer[0];for(b=p-1;b>=0;b--)O.push(u[b])}for(e.gpuCache.skipCostCheck=!0,b=p-1;b>=0;b--){var j=u[b];t=j[0],n&&j[1]||V.gpuRenderUsed>=o.maxGpuUsed?(h.debug.drawBBoxes&&h.drawTileInfo(t,t.metanode,r),t.drawGrid(r)):j[1]||h.drawSurfaceTile(t,t.metanode,r,t.texelSize,0,!1,!1)}e.gpuCache.skipCostCheck=!1,e.gpuCache.checkCost()}}},a.prototype.traceHeight=function(t,e,i){if(t){this.params=e;var r=i?this.traceHeightTileByNodeOnly:this.traceHeightTileByMap;(1!=t.id[0]||(this.traceHeightTile(t.parent,0,!0),t.parent.metanode))&&this.traceHeightTile(t,0,!1,r)}},a.prototype.traceHeightTile=function(t,e,i,r){if(null!=t){if(!t.isMetanodeReady(this,0)||i)return void(this.params.waitingForNode=!0);t.metanode.metatile.used(),t.lastSurface&&t.lastSurface==t.surface&&(t.lastSurface=null,t.restoreLastState());if(r(t,this.params,e)){var s=this.traceHeightChild(t,this.params),a=t.children[s];a||(this.params.finalNode=!0),this.traceHeightTile(a,0,!1,r)}}},a.prototype.traceHeightChild=function(t,e){var i=e.coords,r=e.extents,s=[.5*(r.ll[0]+r.ur[0]),.5*(r.ll[1]+r.ur[1])],a=i[0]>=s[0],n=i[1]>=s[1];return a?(r.ll[0]=s[0],n?r.ll[1]=s[1]:r.ur[1]=s[1]):(r.ur[0]=s[0],n?r.ll[1]=s[1]:r.ur[1]=s[1]),a?n?1:3:n?0:2},a.prototype.traceHeightTileByMap=function(t,e){if(!t||t.id[0]>e.desiredLod&&e.heightMap)return!1;var i=t.metanode;if(!i)return!1;if(!i.hasNavtile())return e.heightMap||(e.metanode=i),!0;if(e.bestHeightMap=t.id[0],t.heightMap){if(t.heightMap.isReady(null,null,!0))return e.parent={metanode:e.metanode,heightMap:e.heightMap,heightMapExtents:e.heightMapExtents},e.metanode=i,e.heightMap=t.heightMap,e.heightMapExtents={ll:e.extents.ll.slice(),ur:e.extents.ur.slice()},t.id[0]!=e.desiredLod}else{if(!t.surface||!t.resourceSurface)return!1;if(!t.resourceSurface.getNavUrl)return!1;var r=t.resourceSurface.getNavUrl(t.id);t.heightMap=t.resources.getTexture(r,!0)}return!1},a.prototype.traceHeightTileByNodeOnly=function(t,e){if(!t||t.id[0]>e.desiredLod)return!1;var i=t.metanode;return!!i&&(e.parent={metanode:e.metanode},e.metanode=i,t.id[0]!=e.desiredLod)},a.prototype.getNodeById=function(t,e){var i=this.surfaceTree;if(null!=i){for(var r=t[0];r>0;r--){var s=1<<r-1,a=0;if(0!=(t[1]&s)&&(a+=1),0!=(t[2]&s)&&(a+=2),!i.children[a]){if(!i.isMetanodeReady(this,0,e))return null;if(!i.metanode.hasChild(a))return null;i.addChild(a)}i=i.children[a]}if(i&&i.isMetanodeReady(this,0,e)){var n=i.metanode;return i.metanode.metatile.used(),n}}},a.prototype.getRenderedNodeById=function(t,e){var i=this.surfaceTree;if(null!=i){if(i.drawCounter==e){if(!i.isMetanodeReady(this,0))return;return i.metanode}for(var r=t[0];r>0;r--){var s=1<<r-1,a=0;if(0!=(t[1]&s)&&(a+=1),0!=(t[2]&s)&&(a+=2),!i.children[a]){if(!i.isMetanodeReady(this,0))return;if(!i.metanode.hasChild(a))return}if(i=i.children[a],i.drawCounter==e){if(!i.isMetanodeReady(this,0))return;return i.metanode}}}},e.a=a},function(t,e,i){"use strict";var r=i(30),s=i(50),a=i(52),n=i(5),o=i(4),h=i(11),l=r.a,u=s.a,c=a.a,d=n.a,p=o.a,f=h.a,g=function(t,e,i){if(this.map=t,this.id=null,this.type="basic",this.metaBinaryOrder=1,this.metaUrl="",this.navUrl="",this.navDelta=1,this.meshUrl="",this.textureUrl="",this.baseUrl=this.map.url.baseUrl,this.baseUrlSchema=this.map.url.baseUrlSchema,this.baseUrlOrigin=this.map.url.baseUrlOrigin,this.lodRange=[0,0],this.tileRange=[[0,0],[0,0]],this.textureLayer=null,this.boundLayerSequence=[],this.glue="glue"==i,this.free="free"==i,this.virtual=!1,this.zFactor=0,this.ready=!1,this.geodataProcessor=null,this.geodataCounter=0,this.geodataNavtileInfo=!1,this.monoGeodata=null,this.monoGeodataView=null,this.monoGeodataCounter=-1,this.creditsNumbers=[],this.style=null,this.stylesheet=null,this.originalStyle=null,this.originalStylesheet=null,this.styleChanged=!0,this.free?this.tree=new c(this.map,!0,this):this.tree=null,"string"==typeof e){this.jsonUrl=this.map.url.processUrl(e),this.baseUrl=f.getBase(this.jsonUrl),this.baseUrlSchema=f.getSchema(this.jsonUrl),this.baseUrlOrigin=f.getOrigin(this.jsonUrl);var r=function(t){this.parseJson(t),this.ready=!0,this.map.refreshView()}.bind(this),s=function(){}.bind(this);p.loadJSON(this.jsonUrl,r,s,null,!!p.useCredentials&&-1!=this.jsonUrl.indexOf(this.map.url.baseUrl),this.map.core.xhrParams)}else this.parseJson(e),this.ready=!0};g.prototype.parseJson=function(t){this.id=t.id||null,this.type=t.type||"basic",this.metaBinaryOrder=t.metaBinaryOrder||1,this.metaUrl=this.processUrl(t.metaUrl,""),this.navUrl=this.processUrl(t.navUrl,""),this.navDelta=t.navDelta||1,this.meshUrl=this.processUrl(t.meshUrl,""),this.textureUrl=this.processUrl(t.textureUrl,""),this.geodataUrl=this.processUrl(t.geodataUrl||t.geodata,""),this.lodRange=t.lodRange||[0,0],this.tileRange=t.tileRange||[[0,0],[0,0]],this.textureLayer=t.textureLayer||null,this.geodata="geodata"==this.type||"geodata-tiles"==this.type,this.credits=t.credits||[],this.creditsUrl=null,this.displaySize=t.displaySize||256;var e,i;if(t.extents){var r=t.extents.ll,s=t.extents.ur;this.extents=new d(r[0],r[1],r[2],s[0],s[1],s[2])}else this.extents=new d(0,0,0,1,1,1);switch(this.specificity=Math.pow(2,this.lodRange[0])/((this.tileRange[1][0]-this.tileRange[1][0]+1)*(this.tileRange[1][1]-this.tileRange[1][1]+1)),typeof this.credits){case"string":this.creditsUrl=this.credits,this.credits=[];break;case"object":if(!Array.isArray(this.credits)){var a=this.credits;this.credits=[];for(var n in a)this.map.addCredit(n,new l(this.map,a[n])),this.credits.push(n)}for(e=0,i=this.credits.length;e<i;e++){var o=this.map.getCreditById(this.credits[e]);this.creditsNumbers.push(o?o.id:null)}}if(this.geodataUrl&&"string"==typeof this.geodataUrl&&-1!=this.geodataUrl.indexOf("{geonavtile}")&&(this.geodataNavtileInfo=!1),this.geodata){var h=t.style;this.originalStyle=h,h&&(this.setStyle(h),this.originalStylesheet=this.stylesheet)}if(this.surfaceReference=[],this.glue)for(e=0,i=this.id.length;e<i;e++)this.surfaceReference.push(this.map.getSurface(this.id[e]))},g.prototype.kill=function(){this.geodataProcessor&&(this.geodataProcessor.kill(),this.geodataProcessor=null),this.geodataUrl=null,this.style=null,this.stylesheet=null,this.originalStyle=null,this.originalStylesheet=null},g.prototype.setOptions=function(){},g.prototype.getOptions=function(){return this.getInfo()},g.prototype.getInfo=function(){return this.geodata?{type:this.type,metaUrl:this.metaUrl,geodataUrl:this.geodataUrl,lodRange:this.lodRange,tileRange:this.tileRange,style:this.originalStyle}:{type:this.type,metaUrl:this.metaUrl,navUrl:this.navUrl,meshUrl:this.meshUrl,textureUrl:this.textureUrl,lodRange:this.lodRange,tileRange:this.tileRange,textureLayer:this.textureLayer}},g.prototype.processUrl=function(t,e){return t?"string"!=typeof t?t:(t=t.trim(),-1!=t.indexOf("://")?t:0==t.indexOf("//")?this.baseUrlSchema+t:0==t.indexOf("/")?this.baseUrlOrigin+t:this.baseUrl+t):e},g.prototype.hasTile=function(t){var e=t[0]-this.lodRange[0];if(e<0)return!1;var i=t[1]>>e,r=t[2]>>e;return!(t[0]<this.lodRange[0]||t[0]>this.lodRange[1]||i<this.tileRange[0][0]||i>this.tileRange[1][0]||r<this.tileRange[0][1]||r>this.tileRange[1][1])},g.prototype.hasTile2=function(t){var e=t[0]-this.lodRange[0],i=e<0;if(t[0]<this.lodRange[0]){e=-e;var r=this.tileRange[0][0]>>e,s=this.tileRange[0][1]>>e,a=this.tileRange[1][0]>>e,n=this.tileRange[1][1]>>e;if(t[0]>this.lodRange[1]||t[1]<r||t[1]>a||t[2]<s||t[2]>n)return[!1,!1]}else{var o=t[1]>>e,h=t[2]>>e;if(t[0]>this.lodRange[1]||o<this.tileRange[0][0]||o>this.tileRange[1][0]||h<this.tileRange[0][1]||h>this.tileRange[1][1])return[!1,!1]}return[!0,i]},g.prototype.hasMetatile=function(t){if(t[0]>this.lodRange[1])return!1;var e=t[0]-this.lodRange[0];if(e>=0){var i=t[1]>>e,r=t[2]>>e;if(i<this.tileRange[0][0]||i>this.tileRange[1][0]||r<this.tileRange[0][1]||r>this.tileRange[1][1])return!1}else if(e=-e,t[1]<this.tileRange[0][0]>>e||t[1]>this.tileRange[1][0]>>e||t[2]<this.tileRange[0][1]>>e||t[2]>this.tileRange[1][1]>>e)return!1;return!0},g.prototype.setStyle=function(t){if(this.style!=t){var e=t;"object"!=typeof e?e=this.processUrl(e,""):(e=JSON.stringify(e),e=p.getHash(e),e="#obj#"+e.toString(16)),this.stylesheet=this.map.getStylesheet(e),this.stylesheet||(this.stylesheet=new u(this.map,e,t,this),this.map.addStylesheet(e,this.stylesheet)),this.style=t,this.styleChanged=!0,this.geodataCounter++,this.map.markDirty()}},g.prototype.getSurfaceReference=function(t){return this.surfaceReference[t-1]},g.prototype.getMetaUrl=function(t,e){return this.map.url.makeUrl(this.metaUrl,{lod:t[0],ix:t[1],iy:t[2]},null,e)},g.prototype.getNavUrl=function(t,e){return this.map.url.makeUrl(this.navUrl,{lod:t[0],ix:t[1],iy:t[2]},null,e)},g.prototype.getMeshUrl=function(t,e){return this.map.url.makeUrl(this.meshUrl,{lod:t[0],ix:t[1],iy:t[2]},null,e)},g.prototype.getTextureUrl=function(t,e,i){return this.map.url.makeUrl(this.textureUrl,{lod:t[0],ix:t[1],iy:t[2]},e,i)},g.prototype.getGeodataUrl=function(t,e,i){return this.map.url.makeUrl(this.geodataUrl,{lod:t[0],ix:t[1],iy:t[2]},e,i)},g.prototype.getMonoGeodataUrl=function(t,e){return this.map.url.makeUrl(this.geodataUrl,{},null,e)},e.a=g},function(t,e,i){"use strict";var r=i(51),s=r.a,a=function(t,e,i,r,a,n,o){if(this.map=t,this.stats=t.stats,this.tile=n,this.internal=o,this.mainTexture=n?n.resources.getSubtexture(this,e,i,n,o):new s(t,e,i,n,o),this.maskTexture=null,this.loadState=0,this.loadErrorTime=null,this.loadErrorCounter=0,this.neverReady=!1,this.maskTexture=null,this.mapLoaderUrl=e,this.heightMap=i||!1,this.extraBound=r,this.extraInfo=a,this.statsCounter=0,this.checkStatus=0,this.checkType=null,this.checkValue=null,this.fastHeaderCheck=!1,this.fileSize=0,a&&a.layer){var h=a.layer;if(h.availability)switch(this.checkType=h.availability.type,this.checkType){case 2:this.checkValue=h.availability.mime;break;case 3:this.checkValue=h.availability.codes;break;case 4:this.checkValue=h.availability.size}}};a.prototype.kill=function(){this.mainTexture.killImage(),this.mainTexture.killGpuTexture(),this.mainTexture=null,this.maskTexture&&(this.maskTexture.killImage(),this.maskTexture.killGpuTexture())},a.prototype.killImage=function(){this.mainTexture.killImage(),this.maskTexture&&this.maskTexture.killImage()},a.prototype.killGpuTexture=function(){this.mainTexture.killGpuTexture(),this.maskTexture&&this.maskTexture.killGpuTexture()},a.prototype.setBoundTexture=function(t,e){if(t&&e){if(this.extraBound.sourceTile=t,this.extraBound.layer=e,!t.boundTextures[e.id]){t.boundLayers[e.id]=e;var i=e.getUrl(t.id);t.boundTextures[e.id]=t.resources.getTexture(i,null,null,{tile:t,layer:e},this.tile,this.internal)}this.extraBound.texture=t.boundTextures[e.id],this.extraBound.transform=this.map.draw.drawTiles.getTileTextureTransform(t,this.extraBound.tile),this.map.markDirty()}},a.prototype.isReady=function(t,e,i){var r=this.map.stats.gpuRenderUsed>=this.map.draw.maxGpuUsed;if(t=t||r,this.neverReady)return!1;var s;if(this.extraBound){if(this.extraBound.texture){for(;this.extraBound.texture.extraBound||-1==this.extraBound.texture.checkStatus;){if(s=this.extraBound.sourceTile.parent,s.id[0]<this.extraBound.layer.lodRange[0])return this.neverReady=!0,this.extraBound.tile.resetDrawCommands=!0,this.map.markDirty(),!1;this.setBoundTexture(s,this.extraBound.layer)}var a=this.extraBound.texture.isReady(t,e,i);return a&&this.checkMask&&(this.extraBound.tile.resetDrawCommands=null!=this.extraBound.texture.getMaskTexture(),this.checkMask=!1),a}return this.setBoundTexture(this.extraBound.sourceTile,this.extraBound.layer),!1}switch(this.checkType){case 1:if(2!=this.checkStatus){if(0==this.checkStatus&&this.extraInfo&&this.extraInfo.tile){var n=this.extraInfo.tile.boundmetaresources;n||(n=this.map.resourcesTree.findAgregatedNode(this.extraInfo.tile.id,8),this.extraInfo.tile.boundmetaresources=n);var o=this.extraInfo.layer,h=this.extraInfo.metaPath;this.extraInfo.metaPath||(h=o.getMetatileUrl(n.id),this.extraInfo.metaPath=h);var l=n.getTexture(h,!0,null,null,this.tile,this.internal);if(this.maskTexture)this.maskTexture.isReady(t,e,i,this)&&(this.checkStatus=2);else if(l.isReady(t,e,i)){var u=this.extraInfo.tile,c=l.getHeightMapValue(255&u.id[1],255&u.id[2]);this.checkStatus=128&c?2:-1,2==this.checkStatus&&(64&c||(h=o.getMaskUrl(u.id),this.maskTexture=u.resources.getTexture(h,null,null,null,this.tile,this.internal),this.checkStatus=0)),u.resetDrawCommands=!0,this.map.markDirty()}}if(-1==this.checkStatus){if(!this.extraBound){if(s=this.extraInfo.tile.parent,s.id[0]<this.extraInfo.layer.lodRange[0])return this.neverReady=!0,this.extraInfo.tile.resetDrawCommands=!0,this.map.markDirty(),!1;this.extraBound={tile:this.extraInfo.tile,layer:this.extraInfo.layer},this.setBoundTexture(this.extraBound.tile.parent,this.extraBound.layer),this.checkMask=!0}for(;this.extraBound.texture.extraBound||-1==this.extraBound.texture.checkStatus;){if(s=this.extraBound.sourceTile.parent,s.id[0]<this.extraBound.layer.lodRange[0])return this.neverReady=!0,this.extraBound.tile.resetDrawCommands=!0,this.map.markDirty(),!1;this.setBoundTexture(s,this.extraBound.layer)}}return!1}}var d=!0;return this.maskTexture&&(d=this.maskTexture.isReady(t,e,i,this)),this.mainTexture.isReady(t,e,i,this)&&d},a.prototype.isMaskPosible=function(){var t=this;return this.extraBound&&this.extraBound.texture&&(t=this.extraBound.texture),1==t.checkType},a.prototype.isMaskInfoReady=function(){var t=this;return this.extraBound&&this.extraBound.texture&&(t=this.extraBound.texture),1!=t.checkType||!(!this.maskTexture&&2!=t.checkStatus&&-1!=t.checkStatus)},a.prototype.getGpuTexture=function(){return this.extraBound?this.extraBound.texture?this.extraBound.texture.getGpuTexture():null:this.mainTexture.getGpuTexture()},a.prototype.getMaskTexture=function(){return this.extraBound&&this.extraBound.texture?this.extraBound.texture.getMaskTexture():this.maskTexture},a.prototype.getGpuMaskTexture=function(){return this.extraBound?this.extraBound.texture&&this.extraBound.texture.maskTexture?this.extraBound.texture.getGpuMaskTexture():null:this.maskTexture?this.maskTexture.getGpuTexture():null},a.prototype.getGpuSize=function(){return(this.mainTexture&&this.mainTexture.gpuSize?this.mainTexture.gpuSize:0)+(this.maskTexture&&this.maskTexture.gpuSize?this.maskTexture.gpuSize:0)},a.prototype.getImageData=function(){return this.mainTexture.imageData},a.prototype.getImageExtents=function(){return this.mainTexture.imageExtents},a.prototype.getHeightMapValue=function(t,e){return this.mainTexture.getHeightMapValue(t,e)},a.prototype.getTransform=function(){return this.extraBound?this.extraBound.texture?this.extraBound.transform:null:[1,1,0,0]},e.a=a},function(t,e,i){"use strict";var r=function(t,e){this.parse(e)};r.prototype.parse=function(t){if(this.description=t.description||"",this.freeLayers=t.freeLayers||{},this.surfaces={},t.surfaces){var e=t.surfaces;if(Array.isArray(e))for(var i=0,r=e.length;i<r;i++)this.surfaces[e[i]]=[];else this.surfaces=e}!this.freeLayers||Array.isArray(this.freeLayers)?this.freeLayers={}:this.freeLayers=JSON.parse(JSON.stringify(this.freeLayers)),this.surfaces=JSON.parse(JSON.stringify(this.surfaces))},r.prototype.getInfo=function(){return{description:JSON.parse(JSON.stringify(this.description)),surfaces:JSON.parse(JSON.stringify(this.surfaces)),freeLayers:JSON.parse(JSON.stringify(this.freeLayers))}},e.a=r},function(t,e,i){"use strict";var r=i(6),s=i(4),a=r.a,n=s.a,o=function(t,e,i,r,s){this.bbox=null,this.gpu=t,this.gl=t.gl,this.core=e,this.data=null,this.path=s,this.texture={width:256,height:256},this.textures=[],this.images=[],this.ready=!1,this.version=1,this.load(s)};o.prototype.kill=function(){},o.prototype.size=function(){return this.size},o.prototype.load=function(t){n.loadBinary(t,this.onLoaded.bind(this),this.onError.bind(this))},o.prototype.onLoaded=function(t){this.data=t,this.ready=!0,this.core.markDirty()},o.prototype.isReady=function(){return this.ready},o.prototype.onError=function(){},o.prototype.onFileLoaded=function(t,e){this.core.markDirty(),this.textures[t].createFromData(256,256,new Uint8Array(e),"linear")},o.prototype.onFileLoadError=function(){},o.prototype.areTexturesReady=function(t){for(var e=!0,i=0,r=t.length;i<r;i++){var s=t[i];this.textures[s]?e=e&&this.textures[s].loaded:(n.loadBinary(this.path+(s+2),this.onFileLoaded.bind(this,s),this.onFileLoadError.bind(this)),this.textures[s]=new a(this.gpu,null,this.core),e=!1)}return e},o.prototype.getTexture=function(t){return this.textures[t]},e.a=o},function(t,e,i){"use strict";var r=function(t,e,i){this.gpu=t,this.gl=t.gl,this.vertex=e,this.fragment=i,this.program=null,this.uniformLocationCache=[],this.attributeLocationCache=[],this.m=new Float32Array(16),this.ready=!1,this.createProgram(e,i)};r.prototype.createShader=function(t,e){var i=this.gl;if(!t||!i)return null;var r;if(r=!0!==e?i.createShader(i.FRAGMENT_SHADER):i.createShader(i.VERTEX_SHADER),i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS)){var s=i.getShaderInfoLog(r);return console.log("An error occurred compiling the shaders: "+s),this.gpu.renderer.core.callListener("renderer-shader-error",{where:"compilation",info:s}),null}return r},r.prototype.createProgram=function(t,e){var i=this.gl;if(null!=i){var r=this.createShader(t,!0),s=this.createShader(e,!1);if(r&&s){var a=i.createProgram();i.attachShader(a,r),i.attachShader(a,s),i.linkProgram(a),i.getProgramParameter(a,i.LINK_STATUS)||(console.log("Unable to initialize the shader program."),this.gpu.renderer.core.callListener("renderer-shader-error",{where:"linking"})),i.useProgram(a),this.program=a,this.ready=!0}}},r.prototype.setSampler=function(t,e){var i=this.gl;if(null!=i&&null!=this.program){var r=this.getUniform(t);null!=r&&i.uniform1i(r,e)}},r.prototype.isReady=function(t,e){return this.ready},r.prototype.setMat4=function(t,e,i){var r=this.gl;if(null!=r&&null!=this.program){var s=this.getUniform(t);if(null!=s)if(i){i=2*(1+i)-1;var a=this.m;a[0]=e[0],a[1]=e[1],a[2]=e[2]*i,a[3]=e[3],a[4]=e[4],a[5]=e[5],a[6]=e[6]*i,a[7]=e[7],a[8]=e[8],a[9]=e[9],a[10]=e[10]*i,a[11]=e[11],a[12]=e[12],a[13]=e[13],a[14]=e[14]*i,a[15]=e[15],r.uniformMatrix4fv(s,!1,a)}else r.uniformMatrix4fv(s,!1,e)}},r.prototype.setMat3=function(t,e){var i=this.gl;if(null!=i&&null!=this.program){var r=this.getUniform(t);null!=r&&i.uniformMatrix3fv(r,!1,e)}},r.prototype.setVec2=function(t,e){var i=this.gl;if(null!=i&&null!=this.program){var r=this.getUniform(t);null!=r&&i.uniform2fv(r,e)}},r.prototype.setVec3=function(t,e){var i=this.gl;if(null!=i&&null!=this.program){var r=this.getUniform(t);null!=r&&i.uniform3fv(r,e)}},r.prototype.setVec4=function(t,e){var i=this.gl;if(null!=i&&null!=this.program){var r=this.getUniform(t);null!=r&&i.uniform4fv(r,e)}},r.prototype.setFloat=function(t,e){var i=this.gl;if(null!=i&&null!=this.program){var r=this.getUniform(t);null!=r&&i.uniform1f(r,e)}},r.prototype.setFloatArray=function(t,e){var i=this.gl;if(null!=i&&null!=this.program){var r=this.getUniform(t);null!=r&&i.uniform1fv(r,e)}},r.prototype.getAttribute=function(t){var e=this.gl;if(null!=e&&null!=this.program){if(null==this.attributeLocationCache[t]){var i=e.getAttribLocation(this.program,t);return this.attributeLocationCache[t]=i,i}return this.attributeLocationCache[t]}},r.prototype.getUniform=function(t){var e=this.gl;if(null!=e&&null!=this.program){if(null==this.uniformLocationCache[t]){var i=e.getUniformLocation(this.program,t);return this.uniformLocationCache[t]=i,i}return this.uniformLocationCache[t]}},e.a=r},function(t,e,i){"use strict";var r=i(21),s=i(33),a=i.n(s),n=i(13);i.d(e,"a",function(){return l});var o=n.c,h=r.a,l=function(t,e){this.core=new o(t,e,this),Object.defineProperty(this,"map",{get:function(){return this.core?this.core.getMapInterface():null}}),Object.defineProperty(this,"renderer",{get:function(){return this.core?this.core.getRendererInterface():null}}),Object.defineProperty(this,"proj4",{get:function(){return this.core?h:null}}),Object.defineProperty(this,"earcut",{get:function(){return this.core?a.a:null}})};l.prototype.destroy=function(){this.core.destroy(),this.core=null},l.prototype.loadMap=function(t){return this.core?this.core.loadMap(t):null},l.prototype.destroyMap=function(){return this.core?this.core.destroyMap():null},l.prototype.on=function(t,e){if(!this.core)return null;this.core.on(t,e)},l.prototype.callListener=function(t,e){if(!this.core)return null;this.core.callListener(t,e)}},function(t,e,i){"use strict";function r(t,e,i){if(!(this instanceof r))return new r(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var s=t.split(",");this.x=parseFloat(s[0],10),this.y=parseFloat(s[1],10),this.z=parseFloat(s[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}var s=i(34);r.fromMGRS=function(t){return new r(i.i(s.b)(t))},r.prototype.toMGRS=function(t){return i.i(s.c)([this.x,this.y],t)},e.a=r},function(t,e,i){"use strict";e.a=function(t,e,i){var r,s,a,n=i.x,o=i.y,h=i.z||0,l={};for(a=0;a<3;a++)if(!e||2!==a||void 0!==i.z)switch(0===a?(r=n,s="x"):1===a?(r=o,s="y"):(r=h,s="z"),t.axis[a]){case"e":l[s]=r;break;case"w":l[s]=-r;break;case"n":l[s]=r;break;case"s":l[s]=-r;break;case"u":void 0!==i[s]&&(l.z=r);break;case"d":void 0!==i[s]&&(l.z=-r);break;default:return null}return l}},function(t,e,i){"use strict";var r=i(1);e.a=function(t,e){if(void 0===t){if((t=Math.floor(30*(i.i(r.a)(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}},function(t,e,i){"use strict";var r=i(35),s=i(68);e.a=function(t){var e=Math.abs(t);return e=i.i(s.a)(e*(1+e/(i.i(r.a)(1,e)+1))),t<0?-e:e}},function(t,e,i){"use strict";e.a=function(t,e){for(var i,r=2*Math.cos(e),s=t.length-1,a=t[s],n=0;--s>=0;)i=r*a-n+t[s],n=a,a=i;return Math.sin(e)*i}},function(t,e,i){"use strict";var r=i(38),s=i(65);e.a=function(t,e,a){for(var n,o,h=Math.sin(e),l=Math.cos(e),u=i.i(r.a)(a),c=i.i(s.a)(a),d=2*l*c,p=-2*h*u,f=t.length-1,g=t[f],m=0,v=0,y=0;--f>=0;)n=v,o=m,v=g,m=y,g=d*v-n-p*m+t[f],y=p*v-o+d*m;return d=h*c,p=l*u,[d*g-p*y,d*y+p*g]}},function(t,e,i){"use strict";e.a=function(t){var e=Math.exp(t);return e=(e+1/e)/2}},function(t,e,i){"use strict";e.a=function(t,e){for(var i,r=2*Math.cos(2*e),s=t.length-1,a=t[s],n=0;--s>=0;)i=r*a-n+t[s],n=a,a=i;return e+i*Math.sin(2*e)}},function(t,e,i){"use strict";var r=i(0);e.a=function(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*r.a:r.a;for(var s,a,n,o,h=Math.asin(.5*e),l=0;l<30;l++)if(a=Math.sin(h),n=Math.cos(h),o=t*a,s=Math.pow(1-o*o,2)/(2*n)*(e/(1-t*t)-a/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),h+=s,Math.abs(s)<=1e-10)return h;return NaN}},function(t,e,i){"use strict";e.a=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i}},function(t,e,i){"use strict";e.a=function(t,e){return Math.pow((1-t)/(1+t),e)}},function(t,e,i){"use strict";i.d(e,"a",function(){return r});var r={};r.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},r.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},r.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},r.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},r.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},r.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},r.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},r.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},r.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},r.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},r.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},r.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},r.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},r.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},r.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},r.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(t,e,i){"use strict";i.d(e,"a",function(){return r}),i.d(e,"b",function(){return s});var r={};r.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},r.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},r.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},r.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},r.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},r.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},r.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},r.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},r.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},r.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},r.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},r.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},r.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},r.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},r.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},r.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},r.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},r.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},r.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},r.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},r.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},r.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},r.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},r.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},r.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},r.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},r.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},r.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},r.hough={a:6378270,rf:297,ellipseName:"Hough"},r.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},r.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},r.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},r.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},r.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},r.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},r.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},r.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},r.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},r.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},r.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},r.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var s=r.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};r.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(t,e,i){"use strict";i.d(e,"a",function(){return r});var r={};r.greenwich=0,r.lisbon=-9.131906111111,r.paris=2.337229166667,r.bogota=-74.080916666667,r.madrid=-3.687938888889,r.rome=12.452333333333,r.bern=7.439583333333,r.jakarta=106.807719444444,r.ferro=-17.666666666667,r.brussels=4.367975,r.stockholm=18.058277777778,r.athens=23.7163375,r.oslo=10.722916666667},function(t,e,i){"use strict";e.a={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}}},function(t,e,i){"use strict";function r(t,e,r){var s;return Array.isArray(r)?(s=i.i(o.a)(t,e,r),3===r.length?[s.x,s.y,s.z]:[s.x,s.y]):i.i(o.a)(t,e,r)}function s(t){return t instanceof n.a?t:t.oProj?t.oProj:i.i(n.a)(t)}function a(t,e,i,a){if(a)return t;t=s(t);var n,o=!1;return void 0===e?(e=t,t=h,o=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=h,o=!0),e=s(e),i?r(t,e,i):(n={forward:function(i){return r(t,e,i)},inverse:function(i){return r(e,t,i)},info:function(){return{a:e.a,b:e.b,ra:e.R_A,"proj-name":e.projName}}},o&&(n.oProj=e),n)}var n=i(24),o=i(44),h=i.i(n.a)("WGS84");e.a=a},function(t,e,i){"use strict";function r(t,e,i,r,a,n){var o={};return o.datum_type=void 0===t||"none"===t?s.k:s.l,e&&(o.datum_params=e.map(parseFloat),0===o.datum_params[0]&&0===o.datum_params[1]&&0===o.datum_params[2]||(o.datum_type=s.h),o.datum_params.length>3&&(0===o.datum_params[3]&&0===o.datum_params[4]&&0===o.datum_params[5]&&0===o.datum_params[6]||(o.datum_type=s.i,o.datum_params[3]*=s.f,o.datum_params[4]*=s.f,o.datum_params[5]*=s.f,o.datum_params[6]=o.datum_params[6]/1e6+1))),o.a=i,o.b=r,o.es=a,o.ep2=n,o}var s=i(0);e.a=r},function(t,e,i){"use strict";function r(t){return t===s.h||t===s.i}var s=i(0),a=i(40);e.a=function(t,e,n){return i.i(a.c)(t,e)?n:t.datum_type===s.k||e.datum_type===s.k?n:t.es!==e.es||t.a!==e.a||r(t.datum_type)||r(e.datum_type)?(n=i.i(a.b)(n,t.es,t.a),r(t.datum_type)&&(n=i.i(a.d)(n,t.datum_type,t.datum_params)),r(e.datum_type)&&(n=i.i(a.e)(n,e.datum_type,e.datum_params)),i.i(a.a)(n,e.es,e.a,e.b)):n}},function(t,e,i){"use strict";function r(t,e,i,r){var s=t*t,n=e*e,o=(s-n)/s,h=0;return r?(t*=1-o*(a.m+o*(a.n+o*a.o)),s=t*t,o=0):h=Math.sqrt(o),{es:o,e:h,ep2:(s-n)/n}}function s(t,e,r,s,h){if(!t){var l=i.i(o.a)(n.a,s);l||(l=n.b),t=l.a,e=l.b,r=l.rf}return r&&!e&&(e=(1-1/r)*t),(0===r||Math.abs(t-e)<a.d)&&(h=!0,e=t),{a:t,b:e,rf:r,sphere:h}}var a=i(0),n=i(71),o=i(29);e.b=r,e.a=s},function(t,e,i){"use strict";e.a=function(t,e){t=t||{};var i,r;if(!e)return t;for(r in e)void 0!==(i=e[r])&&(t[r]=i);return t}},function(t,e,i){"use strict";e.a=function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}},function(t,e,i){"use strict";function r(t){return"string"==typeof t}function s(t){return t in h.a}function a(t){return c.some(function(e){return t.indexOf(e)>-1})}function n(t){return"+"===t[0]}function o(t){return r(t)?s(t)?h.a[t]:a(t)?i.i(l.a)(t):n(t)?i.i(u.a)(t):void 0:t}var h=i(41),l=i(45),u=i(42),c=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];e.a=o},function(t,e,i){"use strict";function r(t,e){var i=u.length;return t.names?(u[i]=t,t.names.forEach(function(t){l[t.toLowerCase()]=i}),this):(console.log(e),!0)}function s(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==l[e]&&u[l[e]]?u[l[e]]:void 0}function a(){h.forEach(r)}var n=i(95),o=i(94),h=[n.a,o.a],l={},u=[];e.a={start:a,add:r,get:s}},function(t,e,i){"use strict";function r(){Math.abs(this.lat1+this.lat2)<c.d||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=i.i(o.a)(this.e3,this.sin_po,this.cos_po),this.qs1=i.i(h.a)(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=i.i(o.a)(this.e3,this.sin_po,this.cos_po),this.qs2=i.i(h.a)(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=i.i(h.a)(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>c.d?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function s(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var s=i.i(h.a)(this.e3,this.sin_phi,this.cos_phi),a=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,n=this.ns0*i.i(l.a)(e-this.long0),o=a*Math.sin(n)+this.x0,u=this.rh-a*Math.cos(n)+this.y0;return t.x=o,t.y=u,t}function a(t){var e,r,s,a,n,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),a=0,0!==e&&(a=Math.atan2(s*t.x,s*t.y)),s=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-s*s)/(2*this.ns0)):(r=(this.c-s*s)/this.ns0,o=this.phi1z(this.e3,r)),n=i.i(l.a)(a/this.ns0+this.long0),t.x=n,t.y=o,t}function n(t,e){var r,s,a,n,o,h=i.i(u.a)(.5*e);if(t<c.d)return h;for(var l=t*t,d=1;d<=25;d++)if(r=Math.sin(h),s=Math.cos(h),a=t*r,n=1-a*a,o=.5*n*n/s*(e/(1-l)-r/n+.5/t*Math.log((1-a)/(1+a))),h+=o,Math.abs(o)<=1e-7)return h;return null}var o=i(8),h=i(28),l=i(1),u=i(7),c=i(0),d=["Albers_Conic_Equal_Area","Albers","aea"];e.a={init:r,forward:s,inverse:a,names:d,phi1z:n}},function(t,e,i){"use strict";function r(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function s(t){var e,r,s,a,f,g,m,v,y,b,x,M,w,S,A,C,T,P,E,L,k,I,N,F=t.x,B=t.y,R=Math.sin(t.y),_=Math.cos(t.y),D=i.i(n.a)(F-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=o.d?(t.x=this.x0+this.a*(o.a-B)*Math.sin(D),t.y=this.y0-this.a*(o.a-B)*Math.cos(D),t):Math.abs(this.sin_p12+1)<=o.d?(t.x=this.x0+this.a*(o.a+B)*Math.sin(D),t.y=this.y0+this.a*(o.a+B)*Math.cos(D),t):(P=this.sin_p12*R+this.cos_p12*_*Math.cos(D),C=Math.acos(P),T=C/Math.sin(C),t.x=this.x0+this.a*T*_*Math.sin(D),t.y=this.y0+this.a*T*(this.cos_p12*R-this.sin_p12*_*Math.cos(D)),t):(e=i.i(l.a)(this.es),r=i.i(u.a)(this.es),s=i.i(c.a)(this.es),a=i.i(d.a)(this.es),Math.abs(this.sin_p12-1)<=o.d?(f=this.a*i.i(h.a)(e,r,s,a,o.a),g=this.a*i.i(h.a)(e,r,s,a,B),t.x=this.x0+(f-g)*Math.sin(D),t.y=this.y0-(f-g)*Math.cos(D),t):Math.abs(this.sin_p12+1)<=o.d?(f=this.a*i.i(h.a)(e,r,s,a,o.a),g=this.a*i.i(h.a)(e,r,s,a,B),t.x=this.x0+(f+g)*Math.sin(D),t.y=this.y0+(f+g)*Math.cos(D),t):(m=R/_,v=i.i(p.a)(this.a,this.e,this.sin_p12),y=i.i(p.a)(this.a,this.e,R),b=Math.atan((1-this.es)*m+this.es*v*this.sin_p12/(y*_)),x=Math.atan2(Math.sin(D),this.cos_p12*Math.tan(b)-this.sin_p12*Math.cos(D)),E=0===x?Math.asin(this.cos_p12*Math.sin(b)-this.sin_p12*Math.cos(b)):Math.abs(Math.abs(x)-Math.PI)<=o.d?-Math.asin(this.cos_p12*Math.sin(b)-this.sin_p12*Math.cos(b)):Math.asin(Math.sin(D)*Math.cos(b)/Math.sin(x)),M=this.e*this.sin_p12/Math.sqrt(1-this.es),w=this.e*this.cos_p12*Math.cos(x)/Math.sqrt(1-this.es),S=M*w,A=w*w,L=E*E,k=L*E,I=k*E,N=I*E,C=v*E*(1-L*A*(1-A)/6+k/8*S*(1-2*A)+I/120*(A*(4-7*A)-3*M*M*(1-7*A))-N/48*S),t.x=this.x0+C*Math.sin(x),t.y=this.y0+C*Math.cos(x),t))}function a(t){t.x-=this.x0,t.y-=this.y0;var e,r,s,a,m,v,y,b,x,M,w,S,A,C,T,P,E,L,k,I,N,F,B;if(this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*o.a*this.a)return;return r=e/this.a,s=Math.sin(r),a=Math.cos(r),m=this.long0,Math.abs(e)<=o.d?v=this.lat0:(v=i.i(f.a)(a*this.sin_p12+t.y*s*this.cos_p12/e),y=Math.abs(this.lat0)-o.a,m=Math.abs(y)<=o.d?this.lat0>=0?i.i(n.a)(this.long0+Math.atan2(t.x,-t.y)):i.i(n.a)(this.long0-Math.atan2(-t.x,t.y)):i.i(n.a)(this.long0+Math.atan2(t.x*s,e*this.cos_p12*a-t.y*this.sin_p12*s))),t.x=m,t.y=v,t}return b=i.i(l.a)(this.es),x=i.i(u.a)(this.es),M=i.i(c.a)(this.es),w=i.i(d.a)(this.es),Math.abs(this.sin_p12-1)<=o.d?(S=this.a*i.i(h.a)(b,x,M,w,o.a),e=Math.sqrt(t.x*t.x+t.y*t.y),A=S-e,v=i.i(g.a)(A/this.a,b,x,M,w),m=i.i(n.a)(this.long0+Math.atan2(t.x,-1*t.y)),t.x=m,t.y=v,t):Math.abs(this.sin_p12+1)<=o.d?(S=this.a*i.i(h.a)(b,x,M,w,o.a),e=Math.sqrt(t.x*t.x+t.y*t.y),A=e-S,v=i.i(g.a)(A/this.a,b,x,M,w),m=i.i(n.a)(this.long0+Math.atan2(t.x,t.y)),t.x=m,t.y=v,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),P=Math.atan2(t.x,t.y),C=i.i(p.a)(this.a,this.e,this.sin_p12),E=Math.cos(P),L=this.e*this.cos_p12*E,k=-L*L/(1-this.es),I=3*this.es*(1-k)*this.sin_p12*this.cos_p12*E/(1-this.es),N=e/C,F=N-k*(1+k)*Math.pow(N,3)/6-I*(1+3*k)*Math.pow(N,4)/24,B=1-k*F*F/2-N*F*F*F/6,T=Math.asin(this.sin_p12*Math.cos(F)+this.cos_p12*Math.sin(F)*E),m=i.i(n.a)(this.long0+Math.asin(Math.sin(P)*Math.sin(F)/Math.cos(T))),v=Math.atan((1-this.es*B*this.sin_p12/Math.sin(T))*Math.tan(T)/(1-this.es)),t.x=m,t.y=v,t)}var n=i(1),o=i(0),h=i(18),l=i(14),u=i(15),c=i(16),d=i(17),p=i(25),f=i(7),g=i(26),m=["Azimuthal_Equidistant","aeqd"];e.a={init:r,forward:s,inverse:a,names:m}},function(t,e,i){"use strict";function r(){this.sphere||(this.e0=i.i(o.a)(this.es),this.e1=i.i(h.a)(this.es),this.e2=i.i(l.a)(this.es),this.e3=i.i(u.a)(this.es),this.ml0=this.a*i.i(n.a)(this.e0,this.e1,this.e2,this.e3,this.lat0))}function s(t){var e,r,s=t.x,a=t.y;if(s=i.i(d.a)(s-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(a)*Math.sin(s)),r=this.a*(Math.atan2(Math.tan(a),Math.cos(s))-this.lat0);else{var o=Math.sin(a),h=Math.cos(a),l=i.i(c.a)(this.a,this.e,o),u=Math.tan(a)*Math.tan(a),p=s*Math.cos(a),f=p*p,g=this.es*h*h/(1-this.es),m=this.a*i.i(n.a)(this.e0,this.e1,this.e2,this.e3,a);e=l*p*(1-f*u*(1/6-(8-u+8*g)*f/120)),r=m-this.ml0+l*o/h*f*(.5+(5-u+6*g)*f/24)}return t.x=e+this.x0,t.y=r+this.y0,t}function a(t){t.x-=this.x0,t.y-=this.y0;var e,r,s=t.x/this.a,a=t.y/this.a;if(this.sphere){var n=a+this.lat0;e=Math.asin(Math.sin(n)*Math.cos(s)),r=Math.atan2(Math.tan(s),Math.cos(n))}else{var o=this.ml0/this.a+a,h=i.i(f.a)(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(h)-g.a)<=g.d)return t.x=this.long0,t.y=g.a,a<0&&(t.y*=-1),t;var l=i.i(c.a)(this.a,this.e,Math.sin(h)),u=l*l*l/this.a/this.a*(1-this.es),m=Math.pow(Math.tan(h),2),v=s*this.a/l,y=v*v;e=h-l*Math.tan(h)/u*v*v*(.5-(1+3*m)*v*v/24),r=v*(1-y*(m/3+(1+3*m)*m*y/15))/Math.cos(h)}return t.x=i.i(d.a)(r+this.long0),t.y=i.i(p.a)(e),t}var n=i(18),o=i(14),h=i(15),l=i(16),u=i(17),c=i(25),d=i(1),p=i(9),f=i(26),g=i(0),m=["Cassini","Cassini_Soldner","cass"];e.a={init:r,forward:s,inverse:a,names:m}},function(t,e,i){"use strict";function r(){this.sphere||(this.k0=i.i(h.a)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function s(t){var e,r,s=t.x,a=t.y,h=i.i(n.a)(s-this.long0);if(this.sphere)e=this.x0+this.a*h*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(a)/Math.cos(this.lat_ts);else{var l=i.i(o.a)(this.e,Math.sin(a));e=this.x0+this.a*this.k0*h,r=this.y0+this.a*l*.5/this.k0}return t.x=e,t.y=r,t}function a(t){t.x-=this.x0,t.y-=this.y0;var e,r;return this.sphere?(e=i.i(n.a)(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=i.i(l.a)(this.e,2*t.y*this.k0/this.a),e=i.i(n.a)(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t}var n=i(1),o=i(28),h=i(8),l=i(67),u=["cea"];e.a={init:r,forward:s,inverse:a,names:u}},function(t,e,i){"use strict";function r(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function s(t){var e=t.x,r=t.y,s=i.i(n.a)(e-this.long0),a=i.i(o.a)(r-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*a,t}function a(t){var e=t.x,r=t.y;return t.x=i.i(n.a)(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=i.i(o.a)(this.lat0+(r-this.y0)/this.a),t}var n=i(1),o=i(9),h=["Equirectangular","Equidistant_Cylindrical","eqc"];e.a={init:r,forward:s,inverse:a,names:h}},function(t,e,i){"use strict";function r(){Math.abs(this.lat1+this.lat2)<g.d||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=i.i(n.a)(this.es),this.e1=i.i(o.a)(this.es),this.e2=i.i(h.a)(this.es),this.e3=i.i(l.a)(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=i.i(u.a)(this.e,this.sinphi,this.cosphi),this.ml1=i.i(c.a)(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<g.d?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=i.i(u.a)(this.e,this.sinphi,this.cosphi),this.ml2=i.i(c.a)(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=i.i(c.a)(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function s(t){var e,r=t.x,s=t.y;if(this.sphere)e=this.a*(this.g-s);else{var a=i.i(c.a)(this.e0,this.e1,this.e2,this.e3,s);e=this.a*(this.g-a)}var n=this.ns*i.i(d.a)(r-this.long0),o=this.x0+e*Math.sin(n),h=this.y0+this.rh-e*Math.cos(n);return t.x=o,t.y=h,t}function a(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,r,s,a;this.ns>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var n=0;if(0!==r&&(n=Math.atan2(e*t.x,e*t.y)),this.sphere)return a=i.i(d.a)(this.long0+n/this.ns),s=i.i(p.a)(this.g-r/this.a),t.x=a,t.y=s,t;var o=this.g-r/this.a;return s=i.i(f.a)(o,this.e0,this.e1,this.e2,this.e3),a=i.i(d.a)(this.long0+n/this.ns),t.x=a,t.y=s,t}var n=i(14),o=i(15),h=i(16),l=i(17),u=i(8),c=i(18),d=i(1),p=i(9),f=i(26),g=i(0),m=["Equidistant_Conic","eqdc"];e.a={init:r,forward:s,inverse:a,names:m}},function(t,e,i){"use strict";function r(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+o.b)/(Math.pow(Math.tan(.5*this.lat0+o.b),this.C)*i.i(n.a)(this.e*t,this.ratexp))}function s(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+o.b),this.C)*i.i(n.a)(this.e*Math.sin(r),this.ratexp))-o.a,t.x=this.C*e,t}function a(t){for(var e=t.x/this.C,r=t.y,s=Math.pow(Math.tan(.5*r+o.b)/this.K,1/this.C),a=h;a>0&&(r=2*Math.atan(s*i.i(n.a)(this.e*Math.sin(t.y),-.5*this.e))-o.a,!(Math.abs(r-t.y)<1e-14));--a)t.y=r;return a?(t.x=e,t.y=r,t):null}var n=i(69),o=i(0),h=20,l=["gauss"];e.a={init:r,forward:s,inverse:a,names:l}},function(t,e,i){"use strict";function r(){this.isGeocent=!0}function s(t){return t}var a=["geocent"];e.a={init:r,forward:s,inverse:s,names:a}},function(t,e,i){"use strict";function r(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function s(t){var e,r,s,a,o,l,u,c,d=t.x,p=t.y;return s=i.i(n.a)(d-this.long0),e=Math.sin(p),r=Math.cos(p),a=Math.cos(s),l=this.sin_p14*e+this.cos_p14*r*a,o=1,l>0||Math.abs(l)<=h.d?(u=this.x0+this.a*o*r*Math.sin(s)/l,c=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*r*a)/l):(u=this.x0+this.infinity_dist*r*Math.sin(s),c=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*a)),t.x=u,t.y=c,t}function a(t){var e,r,s,a,h,l;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(a=Math.atan2(e,this.rc),r=Math.sin(a),s=Math.cos(a),l=i.i(o.a)(s*this.sin_p14+t.y*r*this.cos_p14/e),h=Math.atan2(t.x*r,e*this.cos_p14*s-t.y*this.sin_p14*r),h=i.i(n.a)(this.long0+h)):(l=this.phic0,h=0),t.x=h,t.y=l,t}var n=i(1),o=i(7),h=i(0),l=["gnom"];e.a={init:r,forward:s,inverse:a,names:l}},function(t,e,i){"use strict";function r(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function s(t){var e,r,s,a,o,h,l,u=t.x,c=t.y,d=i.i(n.a)(u-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),s=-d*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(s)),o=Math.asin(Math.cos(r)*Math.sin(s)/Math.cos(a)),h=this.n*o,l=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),t.y=l*Math.cos(h)/1,t.x=l*Math.sin(h)/1,this.czech||(t.y*=-1,t.x*=-1),t}function a(t){var e,i,r,s,a,n,o,h,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),n=Math.sqrt(t.x*t.x+t.y*t.y),a=Math.atan2(t.y,t.x),s=a/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/n,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(s)),i=Math.asin(Math.cos(r)*Math.sin(s)/Math.cos(e)),t.x=this.long0-i/this.alfa,o=e,h=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(h=1),o=t.y,u+=1}while(0===h&&u<15);return u>=15?null:t}var n=i(1),o=["Krovak","krovak"];e.a={init:r,forward:s,inverse:a,names:o}},function(t,e,i){"use strict";function r(){var t=Math.abs(this.lat0);if(Math.abs(t-h.a)<h.d?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<h.d?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var e;switch(this.qp=i.i(l.a)(this.e,1),this.mmf=.5/(1-this.es),this.apa=n(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=i.i(l.a)(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function s(t){var e,r,s,a,n,o,c,d,p,f,g=t.x,m=t.y;if(g=i.i(u.a)(g-this.long0),this.sphere){if(n=Math.sin(m),f=Math.cos(m),s=Math.cos(g),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+f*s:1+this.sinph0*n+this.cosph0*f*s)<=h.d)return null;r=Math.sqrt(2/r),e=r*f*Math.sin(g),r*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*f*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(m+this.phi0)<h.d)return null;r=h.b-.5*m,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),e=r*Math.sin(g),r*=s}}else{switch(c=0,d=0,p=0,s=Math.cos(g),a=Math.sin(g),n=Math.sin(m),o=i.i(l.a)(this.e,n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(c=o/this.qp,d=Math.sqrt(1-c*c)),this.mode){case this.OBLIQ:p=1+this.sinb1*c+this.cosb1*d*s;break;case this.EQUIT:p=1+d*s;break;case this.N_POLE:p=h.a+m,o=this.qp-o;break;case this.S_POLE:p=m-h.a,o=this.qp+o}if(Math.abs(p)<h.d)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:p=Math.sqrt(2/p),r=this.mode===this.OBLIQ?this.ymf*p*(this.cosb1*c-this.sinb1*d*s):(p=Math.sqrt(2/(1+d*s)))*c*this.ymf,e=this.xmf*p*d*a;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(p=Math.sqrt(o))*a,r=s*(this.mode===this.S_POLE?p:-p)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t}function a(t){t.x-=this.x0,t.y-=this.y0;var e,r,s,a,n,l,c,d=t.x/this.a,p=t.y/this.a;if(this.sphere){var f,g=0,m=0;if(f=Math.sqrt(d*d+p*p),(r=.5*f)>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(r),g=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(f)<=h.d?0:Math.asin(p*m/f),d*=m,p=g*f;break;case this.OBLIQ:r=Math.abs(f)<=h.d?this.phi0:Math.asin(g*this.sinph0+p*m*this.cosph0/f),d*=m*this.cosph0,p=(g-Math.sin(r)*this.sinph0)*f;break;case this.N_POLE:p=-p,r=h.a-r;break;case this.S_POLE:r-=h.a}e=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(d,p):0}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(d/=this.dd,p*=this.dd,(l=Math.sqrt(d*d+p*p))<h.d)return t.x=0,t.y=this.phi0,t;a=2*Math.asin(.5*l/this.rq),s=Math.cos(a),d*=a=Math.sin(a),this.mode===this.OBLIQ?(c=s*this.sinb1+p*a*this.cosb1/l,n=this.qp*c,p=l*this.cosb1*s-p*this.sinb1*a):(c=p*a/l,n=this.qp*c,p=l*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(n=d*d+p*p))return t.x=0,t.y=this.phi0,t;c=1-n/this.qp,this.mode===this.S_POLE&&(c=-c)}e=Math.atan2(d,p),r=o(Math.asin(c),this.apa)}return t.x=i.i(u.a)(this.long0+e),t.y=r,t}function n(t){var e,i=[];return i[0]=t*c,e=t*t,i[0]+=e*d,i[1]=e*f,e*=t,i[0]+=e*p,i[1]+=e*g,i[2]=e*m,i}function o(t,e){var i=t+t;return t+e[0]*Math.sin(i)+e[1]*Math.sin(i+i)+e[2]*Math.sin(i+i+i)}var h=i(0),l=i(28),u=i(1),c=.3333333333333333,d=.17222222222222222,p=.10257936507936508,f=.06388888888888888,g=.0664021164021164,m=.016415012942191543,v=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];e.a={init:r,forward:s,inverse:a,names:v,S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4}},function(t,e,i){"use strict";function r(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<c.d)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),r=Math.cos(this.lat1),s=i.i(n.a)(this.e,e,r),a=i.i(o.a)(this.e,this.lat1,e),h=Math.sin(this.lat2),l=Math.cos(this.lat2),u=i.i(n.a)(this.e,h,l),d=i.i(o.a)(this.e,this.lat2,h),p=i.i(o.a)(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>c.d?this.ns=Math.log(s/u)/Math.log(a/d):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(p,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function s(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=c.d&&(r=i.i(h.a)(r)*(c.a-2*c.d));var s,a,n=Math.abs(Math.abs(r)-c.a);if(n>c.d)s=i.i(o.a)(this.e,r,Math.sin(r)),a=this.a*this.f0*Math.pow(s,this.ns);else{if((n=r*this.ns)<=0)return null;a=0}var u=this.ns*i.i(l.a)(e-this.long0);return t.x=this.k0*(a*Math.sin(u))+this.x0,t.y=this.k0*(this.rh-a*Math.cos(u))+this.y0,t}function a(t){var e,r,s,a,n,o=(t.x-this.x0)/this.k0,h=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+h*h),r=1):(e=-Math.sqrt(o*o+h*h),r=-1);var d=0;if(0!==e&&(d=Math.atan2(r*o,r*h)),0!==e||this.ns>0){if(r=1/this.ns,s=Math.pow(e/(this.a*this.f0),r),-9999===(a=i.i(u.a)(this.e,s)))return null}else a=-c.a;return n=i.i(l.a)(d/this.ns+this.long0),t.x=n,t.y=a,t}var n=i(8),o=i(20),h=i(10),l=i(1),u=i(19),c=i(0),d=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"];e.a={init:r,forward:s,inverse:a,names:d}},function(t,e,i){"use strict";function r(){}function s(t){return t}var a=["longlat","identity"];e.a={init:r,forward:s,inverse:s,names:a}},function(t,e,i){"use strict";function r(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=i.i(n.a)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function s(t){var e=t.x,r=t.y;if(r*u.j>90&&r*u.j<-90&&e*u.j>180&&e*u.j<-180)return null;var s,a;if(Math.abs(Math.abs(r)-u.a)<=u.d)return null;if(this.sphere)s=this.x0+this.a*this.k0*i.i(o.a)(e-this.long0),a=this.y0+this.a*this.k0*Math.log(Math.tan(u.b+.5*r));else{var n=Math.sin(r),l=i.i(h.a)(this.e,r,n);s=this.x0+this.a*this.k0*i.i(o.a)(e-this.long0),a=this.y0-this.a*this.k0*Math.log(l)}return t.x=s,t.y=a,t}function a(t){var e,r,s=t.x-this.x0,a=t.y-this.y0;if(this.sphere)r=u.a-2*Math.atan(Math.exp(-a/(this.a*this.k0)));else{var n=Math.exp(-a/(this.a*this.k0));if(-9999===(r=i.i(l.a)(this.e,n)))return null}return e=i.i(o.a)(this.long0+s/(this.a*this.k0)),t.x=e,t.y=r,t}var n=i(8),o=i(1),h=i(20),l=i(19),u=i(0),c=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];e.a={init:r,forward:s,inverse:a,names:c}},function(t,e,i){"use strict";function r(){}function s(t){var e=t.x,r=t.y,s=i.i(n.a)(e-this.long0),a=this.x0+this.a*s,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return t.x=a,t.y=o,t}function a(t){t.x-=this.x0,t.y-=this.y0;var e=i.i(n.a)(this.long0+t.x/this.a),r=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=r,t}var n=i(1),o=["Miller_Cylindrical","mill"];e.a={init:r,forward:s,inverse:a,names:o}},function(t,e,i){"use strict";function r(){}function s(t){for(var e=t.x,r=t.y,s=i.i(n.a)(e-this.long0),a=r,h=Math.PI*Math.sin(r),l=0;!0;l++){var u=-(a+Math.sin(a)-h)/(1+Math.cos(a));if(a+=u,Math.abs(u)<o.d)break}a/=2,Math.PI/2-Math.abs(r)<o.d&&(s=0);var c=.900316316158*this.a*s*Math.cos(a)+this.x0,d=1.4142135623731*this.a*Math.sin(a)+this.y0;return t.x=c,t.y=d,t}function a(t){var e,r;t.x-=this.x0,t.y-=this.y0,r=t.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),e=Math.asin(r);var s=i.i(n.a)(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var a=Math.asin(r);return t.x=s,t.y=a,t}var n=i(1),o=i(0),h=["Mollweide","moll"];e.a={init:r,forward:s,inverse:a,names:h}},function(t,e,i){"use strict";function r(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function s(t){var e,i=t.x,r=t.y,s=r-this.lat0,a=i-this.long0,o=s/n.f*1e-5,h=a,l=1,u=0;for(e=1;e<=10;e++)l*=o,u+=this.A[e]*l;var c,d,p=u,f=h,g=1,m=0,v=0,y=0;for(e=1;e<=6;e++)c=g*p-m*f,d=m*p+g*f,g=c,m=d,v=v+this.B_re[e]*g-this.B_im[e]*m,y=y+this.B_im[e]*g+this.B_re[e]*m;return t.x=y*this.a+this.x0,t.y=v*this.a+this.y0,t}function a(t){var e,i,r,s=t.x,a=t.y,o=s-this.x0,h=a-this.y0,l=h/this.a,u=o/this.a,c=1,d=0,p=0,f=0;for(e=1;e<=6;e++)i=c*l-d*u,r=d*l+c*u,c=i,d=r,p=p+this.C_re[e]*c-this.C_im[e]*d,f=f+this.C_im[e]*c+this.C_re[e]*d;for(var g=0;g<this.iterations;g++){var m,v,y=p,b=f,x=l,M=u;for(e=2;e<=6;e++)m=y*p-b*f,v=b*p+y*f,y=m,b=v,x+=(e-1)*(this.B_re[e]*y-this.B_im[e]*b),M+=(e-1)*(this.B_im[e]*y+this.B_re[e]*b);y=1,b=0;var w=this.B_re[1],S=this.B_im[1];for(e=2;e<=6;e++)m=y*p-b*f,v=b*p+y*f,y=m,b=v,w+=e*(this.B_re[e]*y-this.B_im[e]*b),S+=e*(this.B_im[e]*y+this.B_re[e]*b);var A=w*w+S*S;p=(x*w+M*S)/A,f=(M*w-x*S)/A}var C=p,T=f,P=1,E=0;for(e=1;e<=9;e++)P*=C,E+=this.D[e]*P;var L=this.lat0+E*n.f*1e5,k=this.long0+T;return t.x=k,t.y=L,t}var n=i(0),o=["New_Zealand_Map_Grid","nzmg"];e.a={init:r,forward:s,inverse:a,names:o}},function(t,e,i){"use strict";function r(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),r=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-r*r);var s=i.i(n.a)(this.e,this.lat0,t),a=this.bl/e*Math.sqrt((1-this.es)/(1-r*r));a*a<1&&(a=1);var h,l;if(isNaN(this.longc)){var u=i.i(n.a)(this.e,this.lat1,Math.sin(this.lat1)),c=i.i(n.a)(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(a+Math.sqrt(a*a-1))*Math.pow(s,this.bl):this.el=(a-Math.sqrt(a*a-1))*Math.pow(s,this.bl);var d=Math.pow(u,this.bl),p=Math.pow(c,this.bl);h=this.el/d,l=.5*(h-1/h);var f=(this.el*this.el-p*d)/(this.el*this.el+p*d),g=(p-d)/(p+d),m=i.i(o.a)(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(f*Math.tan(.5*this.bl*m)/g)/this.bl,this.long0=i.i(o.a)(this.long0);var v=i.i(o.a)(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*v)/l),this.alpha=Math.asin(a*Math.sin(this.gamma0))}else h=this.lat0>=0?a+Math.sqrt(a*a-1):a-Math.sqrt(a*a-1),this.el=h*Math.pow(s,this.bl),l=.5*(h-1/h),this.gamma0=Math.asin(Math.sin(this.alpha)/a),this.long0=this.longc-Math.asin(l*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha))}function s(t){var e,r,s,a=t.x,h=t.y,u=i.i(o.a)(a-this.long0);if(Math.abs(Math.abs(h)-l.a)<=l.d)s=h>0?-1:1,r=this.al/this.bl*Math.log(Math.tan(l.b+s*this.gamma0*.5)),e=-1*s*l.a*this.al/this.bl;else{var c=i.i(n.a)(this.e,h,Math.sin(h)),d=this.el/Math.pow(c,this.bl),p=.5*(d-1/d),f=.5*(d+1/d),g=Math.sin(this.bl*u),m=(p*Math.sin(this.gamma0)-g*Math.cos(this.gamma0))/f;r=Math.abs(Math.abs(m)-1)<=l.d?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-m)/(1+m))/this.bl,e=Math.abs(Math.cos(this.bl*u))<=l.d?this.al*this.bl*u:this.al*Math.atan2(p*Math.cos(this.gamma0)+g*Math.sin(this.gamma0),Math.cos(this.bl*u))/this.bl}return this.no_rot?(t.x=this.x0+e,t.y=this.y0+r):(e-=this.uc,t.x=this.x0+r*Math.cos(this.alpha)+e*Math.sin(this.alpha),t.y=this.y0+e*Math.cos(this.alpha)-r*Math.sin(this.alpha)),t}function a(t){var e,r;this.no_rot?(r=t.y-this.y0,e=t.x-this.x0):(r=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var s=Math.exp(-1*this.bl*r/this.al),a=.5*(s-1/s),n=.5*(s+1/s),u=Math.sin(this.bl*e/this.al),c=(u*Math.cos(this.gamma0)+a*Math.sin(this.gamma0))/n,d=Math.pow(this.el/Math.sqrt((1+c)/(1-c)),1/this.bl);return Math.abs(c-1)<l.d?(t.x=this.long0,t.y=l.a):Math.abs(c+1)<l.d?(t.x=this.long0,t.y=-1*l.a):(t.y=i.i(h.a)(this.e,d),t.x=i.i(o.a)(this.long0-Math.atan2(a*Math.cos(this.gamma0)-u*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t}var n=i(20),o=i(1),h=i(19),l=i(0),u=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"];e.a={init:r,forward:s,inverse:a,names:u}},function(t,e,i){"use strict";function r(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function s(t){var e,r,s,a,o,l,u,c,d=t.x,p=t.y;return s=i.i(n.a)(d-this.long0),e=Math.sin(p),r=Math.cos(p),a=Math.cos(s),l=this.sin_p14*e+this.cos_p14*r*a,o=1,(l>0||Math.abs(l)<=h.d)&&(u=this.a*o*r*Math.sin(s),c=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*r*a)),t.x=u,t.y=c,t}function a(t){var e,r,s,a,l,u,c;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),r=i.i(o.a)(e/this.a),s=Math.sin(r),a=Math.cos(r),u=this.long0,Math.abs(e)<=h.d?(c=this.lat0,t.x=u,t.y=c,t):(c=i.i(o.a)(a*this.sin_p14+t.y*s*this.cos_p14/e),l=Math.abs(this.lat0)-h.a,Math.abs(l)<=h.d?(u=this.lat0>=0?i.i(n.a)(this.long0+Math.atan2(t.x,-t.y)):i.i(n.a)(this.long0-Math.atan2(-t.x,t.y)),t.x=u,t.y=c,t):(u=i.i(n.a)(this.long0+Math.atan2(t.x*s,e*this.cos_p14*a-t.y*this.sin_p14*s)),t.x=u,t.y=c,t))}var n=i(1),o=i(7),h=i(0),l=["ortho"];e.a={init:r,forward:s,inverse:a,names:l}},function(t,e,i){"use strict";function r(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=i.i(n.a)(this.es),this.e1=i.i(o.a)(this.es),this.e2=i.i(h.a)(this.es),this.e3=i.i(l.a)(this.es),this.ml0=this.a*i.i(d.a)(this.e0,this.e1,this.e2,this.e3,this.lat0)}function s(t){var e,r,s,a=t.x,n=t.y,o=i.i(u.a)(a-this.long0);if(s=o*Math.sin(n),this.sphere)Math.abs(n)<=p.d?(e=this.a*o,r=-1*this.a*this.lat0):(e=this.a*Math.sin(s)/Math.tan(n),r=this.a*(i.i(c.a)(n-this.lat0)+(1-Math.cos(s))/Math.tan(n)));else if(Math.abs(n)<=p.d)e=this.a*o,r=-1*this.ml0;else{var h=i.i(f.a)(this.a,this.e,Math.sin(n))/Math.tan(n);e=h*Math.sin(s),r=this.a*i.i(d.a)(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+h*(1-Math.cos(s))}return t.x=e+this.x0,t.y=r+this.y0,t}function a(t){var e,r,s,a,n,o,h,l,c;if(s=t.x-this.x0,a=t.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=p.d)e=i.i(u.a)(s/this.a+this.long0),r=0;else{o=this.lat0+a/this.a,h=s*s/this.a/this.a+o*o,l=o;var f;for(n=g;n;--n)if(f=Math.tan(l),c=-1*(o*(l*f+1)-l-.5*(l*l+h)*f)/((l-o)/f-1),l+=c,Math.abs(c)<=p.d){r=l;break}e=i.i(u.a)(this.long0+Math.asin(s*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(a+this.ml0)<=p.d)r=0,e=i.i(u.a)(this.long0+s/this.a);else{o=(this.ml0+a)/this.a,h=s*s/this.a/this.a+o*o,l=o;var m,v,y,b,x;for(n=g;n;--n)if(x=this.e*Math.sin(l),m=Math.sqrt(1-x*x)*Math.tan(l),v=this.a*i.i(d.a)(this.e0,this.e1,this.e2,this.e3,l),y=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),b=v/this.a,c=(o*(m*b+1)-b-.5*m*(b*b+h))/(this.es*Math.sin(2*l)*(b*b+h-2*o*b)/(4*m)+(o-b)*(m*y-2/Math.sin(2*l))-y),l-=c,Math.abs(c)<=p.d){r=l;break}m=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=i.i(u.a)(this.long0+Math.asin(s*m/this.a)/Math.sin(r))}return t.x=e,t.y=r,t}var n=i(14),o=i(15),h=i(16),l=i(17),u=i(1),c=i(9),d=i(18),p=i(0),f=i(25),g=20,m=["Polyconic","poly"];e.a={init:r,forward:s,inverse:a,names:m}},function(t,e,i){"use strict";function r(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=h.a-h.b/2?this.face=l.TOP:this.lat0<=-(h.a-h.b/2)?this.face=l.BOTTOM:Math.abs(this.long0)<=h.b?this.face=l.FRONT:Math.abs(this.long0)<=h.a+h.b?this.face=this.long0>0?l.RIGHT:l.LEFT:this.face=l.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function s(t){var e,i,r,s,a,c,d={x:0,y:0},p={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,i=t.x,this.face===l.TOP)s=h.a-e,i>=h.b&&i<=h.a+h.b?(p.value=u.AREA_0,r=i-h.a):i>h.a+h.b||i<=-(h.a+h.b)?(p.value=u.AREA_1,r=i>0?i-h.c:i+h.c):i>-(h.a+h.b)&&i<=-h.b?(p.value=u.AREA_2,r=i+h.a):(p.value=u.AREA_3,r=i);else if(this.face===l.BOTTOM)s=h.a+e,i>=h.b&&i<=h.a+h.b?(p.value=u.AREA_0,r=-i+h.a):i<h.b&&i>=-h.b?(p.value=u.AREA_1,r=-i):i<-h.b&&i>=-(h.a+h.b)?(p.value=u.AREA_2,r=-i-h.a):(p.value=u.AREA_3,r=i>0?-i+h.c:-i-h.c);else{var f,g,m,v,y,b,x;this.face===l.RIGHT?i=o(i,+h.a):this.face===l.BACK?i=o(i,+h.c):this.face===l.LEFT&&(i=o(i,-h.a)),v=Math.sin(e),y=Math.cos(e),b=Math.sin(i),x=Math.cos(i),f=y*x,g=y*b,m=v,this.face===l.FRONT?(s=Math.acos(f),r=n(s,m,g,p)):this.face===l.RIGHT?(s=Math.acos(g),r=n(s,m,-f,p)):this.face===l.BACK?(s=Math.acos(-f),r=n(s,m,-g,p)):this.face===l.LEFT?(s=Math.acos(-g),r=n(s,m,f,p)):(s=r=0,p.value=u.AREA_0)}return c=Math.atan(12/h.c*(r+Math.acos(Math.sin(r)*Math.cos(h.b))-h.a)),a=Math.sqrt((1-Math.cos(s))/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(r))))),p.value===u.AREA_1?c+=h.a:p.value===u.AREA_2?c+=h.c:p.value===u.AREA_3&&(c+=1.5*h.c),d.x=a*Math.cos(c),d.y=a*Math.sin(c),d.x=d.x*this.a+this.x0,d.y=d.y*this.a+this.y0,t.x=d.x,t.y=d.y,t}function a(t){var e,i,r,s,a,n,c,d,p,f={lam:0,phi:0},g={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,i=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?g.value=u.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(g.value=u.AREA_1,e-=h.a):t.x<0&&-t.x>=Math.abs(t.y)?(g.value=u.AREA_2,e=e<0?e+h.c:e-h.c):(g.value=u.AREA_3,e+=h.a),p=h.c/12*Math.tan(e),a=Math.sin(p)/(Math.cos(p)-1/Math.sqrt(2)),n=Math.atan(a),r=Math.cos(e),s=Math.tan(i),c=1-r*r*s*s*(1-Math.cos(Math.atan(1/Math.cos(n)))),c<-1?c=-1:c>1&&(c=1),this.face===l.TOP)d=Math.acos(c),f.phi=h.a-d,g.value===u.AREA_0?f.lam=n+h.a:g.value===u.AREA_1?f.lam=n<0?n+h.c:n-h.c:g.value===u.AREA_2?f.lam=n-h.a:f.lam=n;else if(this.face===l.BOTTOM)d=Math.acos(c),f.phi=d-h.a,g.value===u.AREA_0?f.lam=-n+h.a:g.value===u.AREA_1?f.lam=-n:g.value===u.AREA_2?f.lam=-n-h.a:f.lam=n<0?-n-h.c:-n+h.c;else{var m,v,y;m=c,p=m*m,y=p>=1?0:Math.sqrt(1-p)*Math.sin(n),p+=y*y,v=p>=1?0:Math.sqrt(1-p),g.value===u.AREA_1?(p=v,v=-y,y=p):g.value===u.AREA_2?(v=-v,y=-y):g.value===u.AREA_3&&(p=v,v=y,y=-p),this.face===l.RIGHT?(p=m,m=-v,v=p):this.face===l.BACK?(m=-m,v=-v):this.face===l.LEFT&&(p=m,m=v,v=-p),f.phi=Math.acos(-y)-h.a,f.lam=Math.atan2(v,m),this.face===l.RIGHT?f.lam=o(f.lam,-h.a):this.face===l.BACK?f.lam=o(f.lam,-h.c):this.face===l.LEFT&&(f.lam=o(f.lam,+h.a))}if(0!==this.es){var b,x,M;b=f.phi<0?1:0,x=Math.tan(f.phi),M=this.b/Math.sqrt(x*x+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-M*M)/(this.one_minus_f*M)),b&&(f.phi=-f.phi)}return f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t}function n(t,e,i,r){var s;return t<h.d?(r.value=u.AREA_0,s=0):(s=Math.atan2(e,i),Math.abs(s)<=h.b?r.value=u.AREA_0:s>h.b&&s<=h.a+h.b?(r.value=u.AREA_1,s-=h.a):s>h.a+h.b||s<=-(h.a+h.b)?(r.value=u.AREA_2,s=s>=0?s-h.c:s+h.c):(r.value=u.AREA_3,s+=h.a)),s}function o(t,e){var i=t+e;return i<-h.c?i+=h.e:i>+h.c&&(i-=h.e),i}var h=i(0),l={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},u={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4},c=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];e.a={init:r,forward:s,inverse:a,names:c}},function(t,e,i){"use strict";function r(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=i.i(h.a)(this.es)}function s(t){var e,r,s=t.x,a=t.y;if(s=i.i(n.a)(s-this.long0),this.sphere){if(this.m)for(var o=this.n*Math.sin(a),h=p;h;--h){var u=(this.m*a+Math.sin(a)-o)/(this.m+Math.cos(a));if(a-=u,Math.abs(u)<c.d)break}else a=1!==this.n?Math.asin(this.n*Math.sin(a)):a;e=this.a*this.C_x*s*(this.m+Math.cos(a)),r=this.a*this.C_y*a}else{var d=Math.sin(a),f=Math.cos(a);r=this.a*i.i(l.a)(a,d,f,this.en),e=this.a*s*f/Math.sqrt(1-this.es*d*d)}return t.x=e,t.y=r,t}function a(t){var e,r,s,a;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,s/=this.C_x*(this.m+Math.cos(e)),this.m?e=i.i(d.a)((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=i.i(d.a)(Math.sin(e)/this.n)),s=i.i(n.a)(s+this.long0),e=i.i(o.a)(e)):(e=i.i(u.a)(t.y/this.a,this.es,this.en),a=Math.abs(e),a<c.a?(a=Math.sin(e),r=this.long0+t.x*Math.sqrt(1-this.es*a*a)/(this.a*Math.cos(e)),s=i.i(n.a)(r)):a-c.d<c.a&&(s=this.long0)),t.x=s,t.y=e,t}var n=i(1),o=i(9),h=i(36),l=i(27),u=i(37),c=i(0),d=i(7),p=20,f=["Sinusoidal","sinu"];e.a={init:r,forward:s,inverse:a,names:f}},function(t,e,i){"use strict";function r(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,r=this.rf,s=1/r,a=2*s-Math.pow(s,2),n=this.e=Math.sqrt(a);this.R=this.k0*i*Math.sqrt(1-a)/(1-a*Math.pow(e,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+n*e)/(1-n*e));this.K=o-this.alpha*h+this.alpha*n/2*l}function s(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+i)+this.K,s=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(a))),o=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(a));return t.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,t.x=this.R*n+this.x0,t}function a(t){for(var e=t.x-this.x0,i=t.y-this.y0,r=e/this.R,s=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(r)),n=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(s))),o=this.lambda0+n/this.alpha,h=0,l=a,u=-1e3,c=0;Math.abs(l-u)>1e-7;){if(++c>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=o,t.y=l,t}var n=["somerc"];e.a={init:r,forward:s,inverse:a,names:n}},function(t,e,i){"use strict";function r(t,e,i){return e*=i,Math.tan(.5*(o.a+t))*Math.pow((1-e)/(1+e),.5*i)}function s(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=o.d&&(this.k0=.5*(1+i.i(h.a)(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=o.d&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=o.d&&(this.k0=.5*this.cons*i.i(l.a)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/i.i(u.a)(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=i.i(l.a)(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-o.a,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function a(t){var e,r,s,a,n,h,l=t.x,c=t.y,p=Math.sin(c),f=Math.cos(c),g=i.i(d.a)(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=o.d&&Math.abs(c+this.lat0)<=o.d?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*p+this.coslat0*f*Math.cos(g)),t.x=this.a*e*f*Math.sin(g)+this.x0,t.y=this.a*e*(this.coslat0*p-this.sinlat0*f*Math.cos(g))+this.y0,t):(r=2*Math.atan(this.ssfn_(c,p,this.e))-o.a,a=Math.cos(r),s=Math.sin(r),Math.abs(this.coslat0)<=o.d?(n=i.i(u.a)(this.e,c*this.con,this.con*p),h=2*this.a*this.k0*n/this.cons,t.x=this.x0+h*Math.sin(l-this.long0),t.y=this.y0-this.con*h*Math.cos(l-this.long0),t):(Math.abs(this.sinlat0)<o.d?(e=2*this.a*this.k0/(1+a*Math.cos(g)),t.y=e*s):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*a*Math.cos(g))),t.y=e*(this.cosX0*s-this.sinX0*a*Math.cos(g))+this.y0),t.x=e*a*Math.sin(g)+this.x0,t))}function n(t){t.x-=this.x0,t.y-=this.y0;var e,r,s,a,n,h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var l=2*Math.atan(h/(.5*this.a*this.k0));return e=this.long0,(r=this.lat0,h<=o.d)?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(l)*this.sinlat0+t.y*Math.sin(l)*this.coslat0/h),e=Math.abs(this.coslat0)<o.d?this.lat0>0?i.i(d.a)(this.long0+Math.atan2(t.x,-1*t.y)):i.i(d.a)(this.long0+Math.atan2(t.x,t.y)):i.i(d.a)(this.long0+Math.atan2(t.x*Math.sin(l),h*this.coslat0*Math.cos(l)-t.y*this.sinlat0*Math.sin(l))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=o.d){if(h<=o.d)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,s=h*this.cons/(2*this.a*this.k0),r=this.con*i.i(c.a)(this.e,s),e=this.con*i.i(d.a)(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else a=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,h<=o.d?n=this.X0:(n=Math.asin(Math.cos(a)*this.sinX0+t.y*Math.sin(a)*this.cosX0/h),e=i.i(d.a)(this.long0+Math.atan2(t.x*Math.sin(a),h*this.cosX0*Math.cos(a)-t.y*this.sinX0*Math.sin(a)))),r=-1*i.i(c.a)(this.e,Math.tan(.5*(o.a+n)));return t.x=e,t.y=r,t}var o=i(0),h=i(10),l=i(8),u=i(20),c=i(19),d=i(1),p=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];e.a={init:s,forward:a,inverse:n,names:p,ssfn_:r}},function(t,e,i){"use strict";function r(){n.a.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function s(t){var e,r,s,a;return t.x=i.i(o.a)(t.x-this.long0),n.a.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),s=Math.cos(t.x),a=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*s),t.x=a*r*Math.sin(t.x),t.y=a*(this.cosc0*e-this.sinc0*r*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function a(t){var e,r,s,a,h;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,h=Math.sqrt(t.x*t.x+t.y*t.y)){var l=2*Math.atan2(h,this.R2);e=Math.sin(l),r=Math.cos(l),a=Math.asin(r*this.sinc0+t.y*e*this.cosc0/h),s=Math.atan2(t.x*e,h*this.cosc0*r-t.y*this.sinc0*e)}else a=this.phic0,s=0;return t.x=s,t.y=a,n.a.inverse.apply(this,[t]),t.x=i.i(o.a)(t.x+this.long0),t}var n=i(88),o=i(1),h=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"];e.a={init:r,forward:s,inverse:a,names:h}},function(t,e,i){"use strict";function r(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=i.i(n.a)(this.es),this.ml0=i.i(o.a)(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function s(t){var e,r,s,a=t.x,n=t.y,h=i.i(l.a)(a-this.long0),c=Math.sin(n),d=Math.cos(n);if(this.es){var p=d*h,f=Math.pow(p,2),g=this.ep2*Math.pow(d,2),m=Math.pow(g,2),v=Math.abs(d)>u.d?Math.tan(n):0,y=Math.pow(v,2),b=Math.pow(y,2);e=1-this.es*Math.pow(c,2),p/=Math.sqrt(e);var x=i.i(o.a)(n,c,d,this.en);r=this.a*(this.k0*p*(1+f/6*(1-y+g+f/20*(5-18*y+b+14*g-58*y*g+f/42*(61+179*b-b*y-479*y)))))+this.x0,s=this.a*(this.k0*(x-this.ml0+c*h*p/2*(1+f/12*(5-y+9*g+4*m+f/30*(61+b-58*y+270*g-330*y*g+f/56*(1385+543*b-b*y-3111*y))))))+this.y0}else{var M=d*Math.sin(h);if(Math.abs(Math.abs(M)-1)<u.d)return 93;if(r=.5*this.a*this.k0*Math.log((1+M)/(1-M))+this.x0,s=d*Math.cos(h)/Math.sqrt(1-Math.pow(M,2)),(M=Math.abs(s))>=1){if(M-1>u.d)return 93;s=0}else s=Math.acos(s);n<0&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return t.x=r,t.y=s,t}function a(t){var e,r,s,a,n=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,r=i.i(h.a)(e,this.es,this.en),Math.abs(r)<u.a){var d=Math.sin(r),p=Math.cos(r),f=Math.abs(p)>u.d?Math.tan(r):0,g=this.ep2*Math.pow(p,2),m=Math.pow(g,2),v=Math.pow(f,2),y=Math.pow(v,2);e=1-this.es*Math.pow(d,2);var b=n*Math.sqrt(e)/this.k0,x=Math.pow(b,2);e*=f,s=r-e*x/(1-this.es)*.5*(1-x/12*(5+3*v-9*g*v+g-4*m-x/30*(61+90*v-252*g*v+45*y+46*g-x/56*(1385+3633*v+4095*y+1574*y*v)))),a=i.i(l.a)(this.long0+b*(1-x/6*(1+2*v+g-x/20*(5+28*v+24*y+8*g*v+6*g-x/42*(61+662*v+1320*y+720*y*v))))/p)}else s=u.a*i.i(c.a)(o),a=0;else{var M=Math.exp(n/this.k0),w=.5*(M-1/M),S=this.lat0+o/this.k0,A=Math.cos(S);e=Math.sqrt((1-Math.pow(A,2))/(1+Math.pow(w,2))),s=Math.asin(e),o<0&&(s=-s),a=0===w&&0===A?0:i.i(l.a)(Math.atan2(w,A)+this.long0)}return t.x=a,t.y=s,t}var n=i(36),o=i(27),h=i(37),l=i(1),u=i(0),c=i(10),d=["Transverse_Mercator","Transverse Mercator","tmerc"];e.a={init:r,forward:s,inverse:a,names:d}},function(t,e,i){"use strict";function r(){var t=i.i(s.a)(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*n.g,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,a.a.init.apply(this),this.forward=a.a.forward,this.inverse=a.a.inverse}var s=i(61),a=i(43),n=i(0),o=["Universal Transverse Mercator System","utm"];e.a={init:r,names:o,dependsOn:"etmerc"}},function(t,e,i){"use strict";function r(){this.R=this.a}function s(t){var e,r,s=t.x,a=t.y,l=i.i(n.a)(s-this.long0);Math.abs(a)<=o.d&&(e=this.x0+this.R*l,r=this.y0);var u=i.i(h.a)(2*Math.abs(a/Math.PI));(Math.abs(l)<=o.d||Math.abs(Math.abs(a)-o.a)<=o.d)&&(e=this.x0,r=a>=0?this.y0+Math.PI*this.R*Math.tan(.5*u):this.y0+Math.PI*this.R*-Math.tan(.5*u));var c=.5*Math.abs(Math.PI/l-l/Math.PI),d=c*c,p=Math.sin(u),f=Math.cos(u),g=f/(p+f-1),m=g*g,v=g*(2/p-1),y=v*v,b=Math.PI*this.R*(c*(g-y)+Math.sqrt(d*(g-y)*(g-y)-(y+d)*(m-y)))/(y+d);l<0&&(b=-b),e=this.x0+b;var x=d+g;return b=Math.PI*this.R*(v*x-c*Math.sqrt((y+d)*(d+1)-x*x))/(y+d),r=a>=0?this.y0+b:this.y0-b,t.x=e,t.y=r,t}function a(t){var e,r,s,a,h,l,u,c,d,p,f,g,m;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,s=t.x/f,a=t.y/f,h=s*s+a*a,l=-Math.abs(a)*(1+h),u=l-2*a*a+s*s,c=-2*l+1+2*a*a+h*h,m=a*a/c+(2*u*u*u/c/c/c-9*l*u/c/c)/27,d=(l-u*u/3/c)/c,p=2*Math.sqrt(-d/3),f=3*m/d/p,Math.abs(f)>1&&(f=f>=0?1:-1),g=Math.acos(f)/3,r=t.y>=0?(-p*Math.cos(g+Math.PI/3)-u/3/c)*Math.PI:-(-p*Math.cos(g+Math.PI/3)-u/3/c)*Math.PI,e=Math.abs(s)<o.d?this.long0:i.i(n.a)(this.long0+Math.PI*(h-1+Math.sqrt(1+2*(s*s-a*a)+h*h))/2/s),t.x=e,t.y=r,t}var n=i(1),o=i(0),h=i(7),l=["Van_der_Grinten_I","VanDerGrinten","vandg"];e.a={init:r,forward:s,inverse:a,names:l}},function(t,e,i){"use strict";var r=i(111);i.n(r);i.o(r,"version")&&i.d(e,"a",function(){return r.version})},function(t,e){t.exports={_args:[[{raw:"C:\\Users\\David\\AppData\\Local\\Temp\\npm-git-117725-13600-x0yd79.599i93haor",scope:null,escapedName:null,name:null,rawSpec:"C:\\Users\\David\\AppData\\Local\\Temp\\npm-git-117725-13600-x0yd79.599i93haor",spec:"C:\\Users\\David\\AppData\\Local\\Temp\\npm-git-117725-13600-x0yd79.599i93haor",type:"directory"},"g:\\code\\melown"]],_from:"C:\\Users\\David\\AppData\\Local\\Temp\\npm-git-117725-13600-x0yd79.599i93haor",_id:"[email protected]",_inCache:!0,_location:"/proj4",_phantomChildren:{},_requested:{raw:"C:\\Users\\David\\AppData\\Local\\Temp\\npm-git-117725-13600-x0yd79.599i93haor",scope:null,escapedName:null,name:null,rawSpec:"C:\\Users\\David\\AppData\\Local\\Temp\\npm-git-117725-13600-x0yd79.599i93haor",spec:"C:\\Users\\David\\AppData\\Local\\Temp\\npm-git-117725-13600-x0yd79.599i93haor",type:"directory"},_requiredBy:["#USER"],_resolved:"file:C:\\Users\\David\\AppData\\Local\\Temp\\npm-git-117725-13600-x0yd79.599i93haor",_shasum:"762f64abdcff3ac4aaa425107b49b02cb4386ec6",_shrinkwrap:null,_spec:"C:\\Users\\David\\AppData\\Local\\Temp\\npm-git-117725-13600-x0yd79.599i93haor",_where:"g:\\code\\melown",author:"",bugs:{url:"https://github.com/proj4js/proj4js/issues"},contributors:[{name:"Mike Adair",email:"[email protected]"},{name:"Richard Greenwood",email:"[email protected]"},{name:"Calvin Metcalf",email:"[email protected]"},{name:"Richard Marsden",url:"http://www.winwaed.com"},{name:"T. Mittan"},{name:"D. Steinwand"},{name:"S. Nelson"}],dependencies:{mgrs:"1.0.0","wkt-parser":"^1.1.3"},description:"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",devDependencies:{chai:"~1.8.1",curl:"git://github.com/cujojs/curl.git",grunt:"~0.4.2","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~1.1.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","grunt-rollup":"^1.0.1",istanbul:"~0.2.4",mocha:"~1.17.1",rollup:"^0.41.4","rollup-plugin-json":"^2.0.1","rollup-plugin-node-resolve":"^2.0.0",tin:"~0.4.0"},directories:{test:"test",doc:"docs"},gitHead:"3494d52f2c543b2ee7bea04292924a771dbd3eb8",homepage:"https://github.com/proj4js/proj4js#readme",license:"MIT",main:"dist/proj4-src.js",module:"lib/index.js",name:"proj4",optionalDependencies:{},readme:'# PROJ4JS [![Build Status](https://travis-ci.org/proj4js/proj4js.svg)](https://travis-ci.org/proj4js/proj4js)\n\nProj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.\nOriginally a port of [PROJ.4](http://trac.osgeo.org/proj/) and [GCTCP C](http://edcftp.cr.usgs.gov/pub//software/gctpc) it is\na part of the [MetaCRS](http://wiki.osgeo.org/wiki/MetaCRS) group of projects.\n\n## Installing\n\nDepending on your preferences\n\n```bash\nnpm install proj4\nbower install proj4\ncomponent install proj4js/proj4js\n```\n\nor just manually grab the file `proj4.js` from the [latest release](https://github.com/proj4js/proj4js/releases)\'s `dist/` folder.\n\nif you do not want to download anything, Proj4js is also hosted on [cdnjs](http://www.cdnjs.com/libraries/proj4js) for direct use in your browser applications.\n\n## Using\n\nthe basic signature is:\n\n```javascript\nproj4(fromProjection[, toProjection, coordinates])\n```\n\nProjections can be proj or wkt strings.\n\nCoordinates may an object of the form `{x:x,y:y}` or an array of the form `[x,y]`.\n\nWhen all 3 arguments are given, the result is that the coordinates are transformed from projection1 to projection 2. And returned in the same format that they were given in.\n\n```javascript\nvar firstProjection = \'PROJCS["NAD83 / Massachusetts Mainland",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.68333333333333],PARAMETER["standard_parallel_2",41.71666666666667],PARAMETER["latitude_of_origin",41],PARAMETER["central_meridian",-71.5],PARAMETER["false_easting",200000],PARAMETER["false_northing",750000],AUTHORITY["EPSG","26986"],AXIS["X",EAST],AXIS["Y",NORTH]]\';\nvar secondProjection = "+proj=gnom +lat_0=90 +lon_0=0 +x_0=6300000 +y_0=6300000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs";\n//I\'m not going to redefine those two in latter examples.\nproj4(firstProjection,secondProjection,[2,5]);\n// [-2690666.2977344505, 3662659.885459918]\n```\n\nIf only 1 projection is given then it is assumed that it is being projected *from* WGS84 (fromProjection is WGS84).\n\n```javascript\nproj4(firstProjection,[-71,41]);\n// [242075.00535055372, 750123.32090043]\n```\n\nIf no coordinates are given an object with two methods is returned, its methods are `forward` which projects from the first projection to the second and `inverse` which projects from the second to the first.\n\n```javascript\nproj4(firstProjection,secondProjection).forward([2,5]);\n// [-2690666.2977344505, 3662659.885459918]\nproj4(secondProjection,firstProjection).inverse([2,5]);\n// [-2690666.2977344505, 3662659.885459918]\n```\n\nand as above if only one projection is given, it\'s assumed to be coming from wgs84\n\n```javascript\nproj4(firstProjection).forward([-71,41]);\n// [242075.00535055372, 750123.32090043]\nproj4(firstProjection).inverse([242075.00535055372, 750123.32090043]);\n//[-71, 40.99999999999986]\n//the floating points to answer your question\n```\n\n## Named Projections\n\nIf you prefer to define a projection as a string and reference it that way, you may use the proj4.defs method which can be called 2 ways, with a name and projection:\n\n```js\nproj4.defs(\'WGS84\', "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");\n```\n\nor with an array\n\n```js\nproj4.defs([\n [\n \'EPSG:4326\',\n \'+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\'],\n [\n \'EPSG:4269\',\n \'+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\'\n ]\n]);\n```\n\nyou can then do\n\n```js\nproj4(\'EPSG:4326\');\n```\n\ninstead of writing out the whole proj definition, by default proj4 has the following projections predefined:\n\n- \'EPSG:4326\', which has the following alias\n - \'WGS84\'\n- \'EPSG:4269\'\n- \'EPSG:3857\', which has the following aliases\n - \'EPSG:3785\'\n - \'GOOGLE\'\n - \'EPSG:900913\'\n - \'EPSG:102113\'\n\ndefined projections can also be accessed through the proj4.defs function (`proj4.defs(\'EPSG:4326\')`).\n\nproj4.defs can also be used to define a named alias:\n\n```javascript\nproj4.defs(\'urn:x-ogc:def:crs:EPSG:4326\', proj4.defs(\'EPSG:4326\'));\n```\n\n## TypeScript\n\nTypeScript implementation was added to the [DefinitelyTyped repository](https://github.com/DefinitelyTyped/DefinitelyTyped).\n\n```bash\n$ npm install --save @types/proj4\n```\n\n## Developing\nto set up build tools make sure you have node and grunt-cli installed and then run `npm install`\n\nto do the complete build and browser tests run\n\n```bash\nnode_modules/.bin/grunt\n```\n\nto run node tests run\n\n```bash\nnpm test\n```\n\nto run node tests with coverage run\n\n```bash\nnpm test --coverage\n```\n\nto create a build with only default projections (latlon and Mercator) run\n\n```bash\nnode_modules/.bin/grunt build\n```\n\nto create a build with only custom projections include a comma separated list of projections codes (the file name in \'lib/projections\' without the \'.js\') after a colon, e.g.\n\n```bash\nnode_modules/.bin/grunt build:tmerc\n#includes transverse Mercator\nnode_modules/.bin/grunt build:lcc\n#includes lambert conformal conic\nnode_modules/.bin/grunt build:omerc,moll\n#includes oblique Mercator and Mollweide\n```\n',readmeFilename:"README.md",repository:{type:"git",url:"git://github.com/proj4js/proj4js.git"},scripts:{build:"grunt","build:tmerc":"grunt build:tmerc",test:"npm run build && istanbul test _mocha test/test.js"},version:"2.4.4-alpha"}},function(t,e,i){"use strict";var r=i(107),s=i(43),a=i(108),n=i(106),o=i(105),h=i(104),l=i(99),u=i(93),c=i(91),d=i(84),p=i(92),f=i(82),g=i(90),m=i(85),v=i(86),y=i(101),b=i(98),x=i(96),M=i(103),w=i(97),S=i(87),A=i(109),C=i(83),T=i(100),P=i(89),E=i(102);e.a=function(t){t.Proj.projections.add(r.a),t.Proj.projections.add(s.a),t.Proj.projections.add(a.a),t.Proj.projections.add(n.a),t.Proj.projections.add(o.a),t.Proj.projections.add(h.a),t.Proj.projections.add(l.a),t.Proj.projections.add(u.a),t.Proj.projections.add(c.a),t.Proj.projections.add(d.a),t.Proj.projections.add(p.a),t.Proj.projections.add(f.a),t.Proj.projections.add(g.a),t.Proj.projections.add(m.a),t.Proj.projections.add(v.a),t.Proj.projections.add(y.a),t.Proj.projections.add(b.a),t.Proj.projections.add(x.a),t.Proj.projections.add(M.a),t.Proj.projections.add(w.a),t.Proj.projections.add(S.a),t.Proj.projections.add(A.a),t.Proj.projections.add(C.a),t.Proj.projections.add(T.a),t.Proj.projections.add(P.a),t.Proj.projections.add(E.a)}},function(t,e,i){"use strict";function r(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=a}function s(t){return new r(t).output()}e.a=s;var a=1,n=/\s/,o=/[A-Za-z]/,h=/[A-Za-z84]/,l=/[,\]]/,u=/[\d\.E\-\+]/;r.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;n.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case a:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},r.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(l.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},r.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=a)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=a,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},r.prototype.number=function(t){if(u.test(t))return void(this.word+=t);if(l.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)},r.prototype.quoted=function(t){if('"'===t)return void(this.state=5);this.word+=t},r.prototype.keyword=function(t){if(h.test(t))return void(this.word+=t);if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=a)}if(l.test(t))return void this.afterItem(t);throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place)},r.prototype.neutral=function(t){if(o.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(u.test(t))return this.word=t,void(this.state=3);if(l.test(t))return void this.afterItem(t);throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place)},r.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)}},function(t,e,i){"use strict";function r(t,e,i){Array.isArray(e)&&(i.unshift(e),e=null);var r=e?{}:t,a=i.reduce(function(t,e){return s(e,t),t},r);e&&(t[e]=a)}function s(t,e){if(!Array.isArray(t))return void(e[t]=!0);var i=t.shift();if("PARAMETER"===i&&(i=t.shift()),1===t.length)return Array.isArray(t[0])?(e[i]={},void s(t[0],e[i])):void(e[i]=t[0]);if(!t.length)return void(e[i]=!0);if("TOWGS84"===i)return void(e[i]=t);Array.isArray(i)||(e[i]={});var a;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[i]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&s(t[2],e[i]));case"SPHEROID":case"ELLIPSOID":return e[i]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&s(t[3],e[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void r(e,i,t);default:for(a=-1;++a<t.length;)if(!Array.isArray(t[a]))return s(t,e[i]);return r(e,i,t)}}e.a=s},function(t,e){var i=window.URL||window.webkitURL;t.exports=function(t,e){try{try{var r;try{var s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;r=new s,r.append(t),r=r.getBlob()}catch(e){r=new Blob([t])}return new Worker(i.createObjectURL(r))}catch(e){return new Worker("data:application/javascript,"+encodeURIComponent(t))}}catch(t){if(!e)throw Error("Inline worker is not supported");return new Worker(e)}}},function(t,e,i){t.exports=function(){return i(115)('/*! Copyright (c) 2017 Melown Technologies SE\n * For terms of use, see accompanying e6e3fe9bab0393856682.worker.js.LICENSE file.\n * For 3rd party libraries licenses, see 3rdpartylicenses.txt.\n */\n!function(e){function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}var t={};r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="",r(r.s=9)}([function(e,r,t){"use strict";function a(e,r,t){return e<r&&(e=r),e>t&&(e=t),e}function n(e,r){r||(r=e);var t=e[0],a=e[1],n=e[2],o=Math.sqrt(t*t+a*a+n*n);return o?1==o?(r[0]=t,r[1]=a,r[2]=n,r):(o=1/o,r[0]=t*o,r[1]=a*o,r[2]=n*o,r):(r[0]=0,r[1]=0,r[2]=0,r)}function o(e){var r=e[0],t=e[1];return e=e[2],Math.sqrt(r*r+t*t+e*e)}function s(e,r,t){t||(t=e);var a=e[0],n=e[1];e=e[2];var o=r[0],s=r[1];return r=r[2],t[0]=n*r-e*s,t[1]=e*o-a*r,t[2]=a*s-n*o,t}t.d(r,"a",function(){return i}),t.d(r,"f",function(){return a}),t.d(r,"c",function(){return n}),t.d(r,"d",function(){return o}),t.d(r,"e",function(){return s}),t.d(r,"b",function(){return l});var i={stylesheetData:{},stylesheetLayers:{},stylesheetBitmaps:{},stylesheetFonts:{},stylesheetConstants:{},stylesheetVariables:{},fonts:{},fontsMap:{},fontsStorage:{},forceOrigin:!1,forceScale:[1,1,1],bboxMin:[0,0,0],bboxMax:[1,1,1],geocent:!1,tileX:0,tileY:0,tileLod:0,tileSize:1,hitState:0,metricUnits:!0,groupOptimize:!0,groupOrigin:[0,0,0],messageBuffer:new Array(65536),messageBuffer2:new Array(65536),messageBufferIndex:0,messageBufferSize:65536,signatureCounter:0,autoLod:!1,featureType:null,groupId:null,disableLog:!1},l=function(e,r){if(!e||""==e)return"";for(var t=0,a=-1,n="",o=0,s=e.length;o<s;o++){var i=e.charAt(o);"{"==i&&(0==t&&(a=o),t++),"}"==i?0==--t&&(n+=r(e.substring(a+1,o))):0==t&&(n+=i)}return n}},function(e,r,t){"use strict";function a(e,r,t){if(s.groupOptimize){if(s.messageBufferIndex>=s.messageBufferSize){var a=s.messageBuffer;s.messageBufferSize+=65536,s.messageBuffer=new Array(s.messageBufferSize),s.messageBuffer2=new Array(s.messageBufferSize);for(var n=0,o=s.messageBufferIndex;n<o;n++)s.messageBuffer[n]=a[n]}s.messageBuffer[s.messageBufferIndex]={job:e,arrays:r,signature:t},s.messageBufferIndex++}else postMessage(e,r)}function n(){var e,r,t,a,n,o,i,l,u,f,c=s.messageBuffer;if(s.messageBufferIndex<=2)return void(s.messageBufferIndex=0);for(var d=0,v=s.messageBufferIndex;d<v;d++){var h=c[d],p=h.job,b=p.type,g=h.signature;if(p.hitable||h.reduced||"icon"==b||"label"==b||"line-geometry"==b||"point-geometry"==b)h.reduced||postMessage(h.job,h.arrays);else{switch(b){case"flat-line":for(o=p.vertexBuffer.length,e=d+1;e<v;e++)a=c[e],a.signature==g&&(a.reduced=!0,o+=a.job.vertexBuffer.length);for(i=new Float32Array(o),l=0,e=d;e<v;e++)if(a=c[e],n=a.job,a.signature==g){for(u=n.vertexBuffer,n.vertexBuffer=null,t=0,r=u.length;t<r;t++)i[l+t]=u[t];l+=r}p.vertexBuffer=i,h.arrays=[i.buffer];break;case"pixel-line":case"line-label":case"flat-rline":for(o=p.vertexBuffer.length,e=d+1;e<v;e++)a=c[e],a.signature==g&&(a.reduced=!0,o+=a.job.vertexBuffer.length);i=new Float32Array(o);var y=new Float32Array(o);for(l=0,e=d;e<v;e++)if(a=c[e],n=a.job,a.signature==g){for(u=n.vertexBuffer,n.vertexBuffer=null,"line-label"==b?(f=n.texcoordsBuffer,n.texcoordsBuffer=null):(f=n.normalBuffer,n.normalBuffer=null),t=0,r=u.length;t<r;t++)i[l+t]=u[t],y[l+t]=f[t];if(l+=r,"line-label"==b){var L=p.files,A=n.files;for(t=0,r=A.length;t<r;t++){L[t]||(L[t]=[]);for(var m=0,N=A[t].length;m<N;m++)-1==L[t].indexOf(A[t][m])&&L[t].push(A[t][m])}}}p.vertexBuffer=i,"line-label"==b?p.texcoordsBuffer=y:p.normalBuffer=y,h.arrays=[i.buffer,y.buffer]}postMessage(h.job,h.arrays)}}s.messageBufferIndex=0}var o=t(0);t.d(r,"a",function(){return a}),t.d(r,"b",function(){return n});var s=o.a},function(e,r,t){"use strict";function a(e,r,t,n,o,i,l,u){var f,c;if(!e||!Array.isArray(e))return!1;if(u>100)return!1;switch(e[0]){case"all":for(f=1,c=e.length;f<c;f++)if(!a(e[f],r,t,n,o,i,l,u+1))return!1;return!0;case"any":for(f=1,c=e.length;f<c;f++)if(a(e[f],r,t,n,i,l,u+1))return!0;return!1;case"none":for(f=1,c=e.length;f<c;f++)if(a(e[f],r,t,n,i,l,u+1))return!1;return!0;case"skip":return!1}s.disableLog="has"==e[0]||"!has"==e[0];var d,v=h(o,i,r,l,e[1],0);switch(s.disableLog=!1,e[0]){case"==":case"!=":case">=":case"<=":case">":case"<":if(void 0===e[2])return!1;d=h(o,i,r,l,e[2],0)}switch(e[0]){case"==":return v==d;case"!=":return v!=d;case">=":return v>=d;case"<=":return v<=d;case">":return v>d;case"<":return v<d;case"has":return void 0!==v;case"!has":return void 0===v;case"in":for(f=2,c=e.length;f<c;f++)if(e[f]==v)return!0;return!1;case"!in":for(f=2,c=e.length;f<c;f++)if(e[f]==v)return!1;return!0}return!1}var n=t(0),o=t(3);t.d(r,"d",function(){return a}),t.d(r,"c",function(){return N}),t.d(r,"a",function(){return c}),t.d(r,"b",function(){return v}),t.d(r,"f",function(){return d}),t.d(r,"e",function(){return h});var s=n.a,i=n.b,l=o.c,u=o.d,f=o.e,c=function(e,r,t){var a=s.stylesheetData.layers[e];return null==a?(g("wrong-Layer",e,null,null,t,r),{}):a},d=function(e,r,t,a,n){var o;switch(typeof r){case"string":if(r.length>0){switch(r.charAt(0)){case"#":switch(r){case"#id":o=t.id;break;case"#type":o=s.featureType;break;case"#group":o=s.groupId;break;case"#lod":o=s.tileLod;break;case"#tileSize":o=s.tileSize;break;case"#metric":o=s.metricUnits}case"$":case"@":switch(r.charAt(0)){case"$":o=t.properties[r.substr(1)];break;case"@":o=s.stylesheetConstants[r]}return void 0===o&&g("wrong-expresion",e["$$layer-id"],r,r,null,"feature-property"),d(e,o,t,a,n)}return i(r,function(i){if(i.length>0){switch(i.charAt(0)){case"#":switch(i){case"#id":o=t.id;break;case"#type":o=s.featureType;break;case"#group":o=s.groupId;break;case"#lod":o=s.tileLod;break;case"#tileSize":o=s.tileSize;break;case"#metric":o=s.metricUnits}case"$":case"@":switch(i.charAt(0)){case"$":o=t.properties[i.substr(1)];break;case"@":o=s.stylesheetConstants[i]}return void 0===o&&g("wrong-expresion",e["$$layer-id"],r,r,null,"feature-property"),o=h(e,n,t,a,o,0),d(e,o,t,a,n)}if(-1!=i.indexOf("{")){try{i=i.replace(/\'/g,\'"\'),o=JSON.parse(i)}catch(t){return g("wrong-expresion",e["$$layer-id"],r,r,null,"feature-property"),""}return void 0===o?(g("wrong-expresion",e["$$layer-id"],r,r,null,"feature-property"),""):h(e,n,t,a,o,0)}return i}})}}return r},v=function(e,r,t,a){var n=h(e,r,t,a);return L(e["$$layer-id"],r,n)},h=function(e,r,t,n,o,i){var c,d,v,p,b,y,L;if(void 0===o)o=e[r],p=!0,i=0;else if(i>100)return;switch(typeof o){case"string":if(o.length>0){switch(v=o,o.charAt(0)){case"$":v=t.properties[o.substr(1)];break;case"@":v=s.stylesheetConstants[o];break;case"&":v=s.stylesheetVariables[o.substr(1)];break;case"#":switch(o){case"#id":v=t.id;break;case"#type":v=s.featureType;break;case"#group":v=s.groupId;break;case"#lod":v=s.tileLod;break;case"#tileSize":v=s.tileSize;break;case"#metric":v=s.metricUnits}}return void 0!==v&&"@"==o.charAt(0)&&(v=h(e,r,t,n,v,i+1)),void 0!==v?v:(g("wrong-object",e["$$layer-id"],r,o,null,"feature-property"),p?A(r):void 0)}return o;case"object":if(null==o)return p?A(r):void 0;if(Array.isArray(o)){if("icon-source"==r&&null==s.stylesheetBitmaps[o[0]])return g("wrong-object",e["$$layer-id"],r,o,null,"bitmap"),p?A(r):void 0;if("filter"!=r){for(L=new Array(o.length),c=0,d=o.length;c<d;c++)L[c]=h(e,r,t,n,o[c],i+1);return L}return o}var m,N,U,v;for(m in o)break;if(!m)return p?A(r):void 0;switch(N=o[m],m){case"if":if(Array.isArray(N)&&3==N.length){if(void 0!==(v=a(N[0],t,s.featureType,s.groupId,e,r,n,0)?h(e,r,t,n,N[1],i+1):h(e,r,t,n,N[2],i+1)))return v;U=!0}else U=!0;case"add":case"sub":case"mul":case"div":case"pow":case"atan2":if(Array.isArray(N)&&2==N.length)if(b=h(e,r,t,n,N[0],i+1),y=h(e,r,t,n,N[1],i+1),"number"!=typeof b||"number"!=typeof y)U=!0;else switch(m){case"add":return b+y;case"sub":return b-y;case"mul":return b*y;case"div":return b/y;case"pow":return Math.pow(b,y);case"atan2":return Math.atan2(b,y)}else U=!0;case"sgn":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"sqrt":case"abs":case"round":case"floor":case"ceil":case"deg2rad":case"rad2deg":if("number"!=typeof(N=h(e,r,t,n,N,i+1)))U=!0;else switch(m){case"sgn":return N<0?-1:1;case"sin":return Math.sin(N);case"cos":return Math.cos(N);case"tan":return Math.tan(N);case"asin":return Math.asin(N);case"acos":return Math.acos(N);case"atan":return Math.atan(N);case"sqrt":return Math.sqrt(N);case"abs":return Math.abs(N);case"round":return Math.round(N);case"floor":return Math.floor(N);case"ceil":return Math.ceil(N);case"deg2rad":return N/180*Math.PI;case"rad2deg":return N/Math.PI*180}break;case"strlen":case"str2num":case"lowercase":case"uppercase":case"capitalize":case"has-fonts":case"has-latin":case"is-cjk":if("string"!=typeof(N=h(e,r,t,n,N,i+1)))U=!0;else switch(m){case"strlen":return N.length;case"str2num":return parseFloat(N);case"lowercase":return N.toLowerCase();case"uppercase":return N.toUpperCase();case"capitalize":return N.replace(/(?:^|\\s)\\S/g,function(e){return e.toUpperCase()});case"has-fonts":return f(N);case"has-latin":return l(N);case"is-cjk":return u(N)}break;case"min":case"max":if(Array.isArray(N)){for(v=h(e,r,t,n,N[0],i+1),c=0,d=o.length;c<d;c++){if("number"!=typeof(L=h(e,r,t,n,N[c],i+1))){U=!0;break}v="max"==m?Math.max(v,L):Math.min(v,L)}return v}U=!0;break;case"linear":case"discrete":case"lod-scaled":var S=null,x=null;if(null!=o["lod-scaled"]){var w=o["lod-scaled"];if("number"==typeof w[1])return w[1]*Math.pow(2*w[2],w[0]-n);S=w[1],x=w}else S=o.discrete||o.linear;for(var B,M,_=S[0][0],O=S[0][1],k=typeof O,E=O,c=0,d=S.length;c<=d;c++){if(c==d){E=O;break}if(S[c][0]>n){if(null!=o.discrete||null!=x){E=O;break}if(B=S[c][0],M=S[c][1],B==_)break;switch(k){case"boolean":O=O?1:0,M=O?1:0,E=O+(n-_)/(B-_)*(M-O),E=E>.5;break;case"number":E=O+(n-_)/(B-_)*(M-O);break;case"object":E=[];for(var C=0,I=O.length;C<I;C++)E[C]=O[C]+(M[C]-O[C])*((n-_)/(B-_))}break}_=S[c][0],O=S[c][1]}return null!=x&&(E*=Math.pow(2*x[2],x[0]-n)),E;default:U=!0}if(U)return p?A(r):void 0;case"number":case"boolean":return o}return p?A(r):void 0},p=function(e,r,t,a,n){if(n>100)return void g("custom","infinite inherit loop in Layer: "+e);if(null!=t.inherit){var o=a.layers[t.inherit];if(null==o)return g("wrong-object",e,"inherit",o,"Layer"),A(s);null!=o.inherit&&p(t.inherit,r,o,a,n++);for(var s in o)r[s]=o[s]}},b=function(e,r,t,a){null!=t.inherit&&p(e,r,t,a,0);for(var n in t)r[n]=t[n];r["$$layer-id"]=e},g=function(e,r,t,a,n,o){if(!s.disableLog){"object"==typeof a&&(a=JSON.stringify(a));var i=null;switch(e){case"wrong-property-value":i="Error: wrong layer property "+(o?"\'"+o+"\'":"")+": "+r+"."+t+" = "+a;break;case"wrong-property-value[]":i="Error: wrong layer property "+(o?"\'"+o+"\'":"")+"["+n+"]: "+r+"."+t+" = "+a;break;case"wrong-object":i="Error: reffered "+o+" does not exist: "+r+"."+t+" = "+a;break;case"wrong-object[]":i="Error: reffered "+o+" does not exist: "+r+"."+t+"["+n+"] = "+a;break;case"wrong-Layer":i="Error: reffered "+o+" Layer does not exist: "+o+"["+n+"].Layer = "+r;break;case"wrong-bitmap":i="Error: wrong definition of bitmap: "+r;break;case"custom":i="Error: "+r}i&&console.log(i)}},y=function(e,r,t,a,n,o,i){var l,u;if(null!=t&&"object"==typeof t&&!Array.isArray(t))return g("wrong-property-value",e,r,t),A(r);if(typeof t!=a&&(null!==t||"icon-source"!=r&&"visibility"!=r&&"label-no-overlap-factor"!=r))return g("wrong-property-value",e,r,t),A(r);switch(typeof t){case"object":if(null===t)return t;if("reduce"==r||"dynamic-reduce"==r||"label-no-overlap-factor"==r){if(!(Array.isArray(t)&&t.length>0&&"string"==typeof t[0]))return g("wrong-property-value",e,r,t),A(r);if("dynamic-reduce"==r){if("tilt"!=t[0]&&"tilt-cos"!=t[0]&&"tilt-cos2"!=t[0]&&"scr-count"!=t[0]&&"scr-count2"!=t[0]&&"scr-count3"!=t[0]||"number"!=typeof t[1]||"number"!=typeof t[2])return g("wrong-property-value",e,r,t),A(r)}else if("reduce"==r){if("odd"!=t[0]&&"even"!=t&&("number"!=typeof t[1]||("top"!=t[0]||"bottom"!=t)&&"string"!=typeof t[2]))return g("wrong-property-value",e,r,t),A(r)}else if("label-no-overlap-factor"==r&&"direct"!=t[0]&&"div-by-dist"!=t[0])return g("wrong-property-value",e,r,t),A(r)}if("next-pass"==r){if(!(Array.isArray(t)&&t.length>0))return g("wrong-property-value",e,r,t),A(r);for(l=0;l<u;l++){var f=t[l];if("object"!=typeof f||!Array.isArray(f)||2!=f.length||"number"!=typeof f[0]||"string"!=typeof f[1])return g("wrong-property-value[]",e,r,t,l),A(r)}}if("label-font"==r||"line-label-font"==r){if(!Array.isArray(t)||t.length<1)return g("wrong-property-value[]",e,r,t,0),A(r);for(l=0,u=t.length;l<u;l++)if("string"!=typeof t[l]||!s.fonts[t[l]])return g("wrong-property-value[]",e,r,t,0),A(r);return t}if(null!=n){if(Array.isArray(t)&&t.length==n){if(l=0,"icon-source"==r||"line-style-texture"==r){if("string"!=typeof t[0])return g("wrong-property-value[]",e,r,t,0),A(r);if(null==s.stylesheetBitmaps[t[0]])return g("wrong-object",e,r,t,null,"bitmap"),A(r);l=1}for(u=t.length;l<u;l++)if("number"!=typeof t[l])return g("wrong-property-value[]",e,r,t,l),A(r);return t}return g("wrong-property-value",e,r,t),A(r)}return t;case"string":if("line-style"==r)switch(t){case"solid":case"texture":return t;default:return g("wrong-property-value",e,r,t),A(r)}if("line-width-units"==r)switch(t){case"pixels":case"meters":case"ratio":return t;default:return g("wrong-property-value",e,r,t),A(r)}if("label-origin"==r||"icon-origin"==r)switch(t){case"top-left":case"top-right":case"top-center":case"center-left":case"center-right":case"center-center":case"bottom-left":case"bottom-right":case"bottom-center":return t;default:return g("wrong-property-value",e,r,t),A(r)}if("label-align"==r)switch(t){case"left":case"right":case"center":return t;default:return g("wrong-property-value",e,r,t),A(r)}return t;case"number":return t>i||t<o?(g("wrong-property-value",e,r,t),A(r)):t;case"boolean":return t}},L=function(e,r,t){switch(r){case"inherit":return y(e,r,t,"string");case"reduce":case"dynamic-reduce":return y(e,r,t,"object");case"line":case"line-flat":return y(e,r,t,"boolean");case"line-width":return y(e,r,t,"number",null,1e-4,Number.MAX_VALUE);case"line-width-units":return y(e,r,t,"string");case"line-color":return y(e,r,t,"object",4,0,255);case"line-style":return y(e,r,t,"string");case"line-style-texture":return y(e,r,t,"object",3,-Number.MAX_VALUE,Number.MAX_VALUE);case"line-style-background":return y(e,r,t,"object",4,0,255);case"line-label":return y(e,r,t,"boolean");case"line-label-source":return y(e,r,t,"string");case"line-label-color":case"line-label-color2":return y(e,r,t,"object",4,0,255);case"line-label-size":return y(e,r,t,"number",null,1e-4,Number.MAX_VALUE);case"line-label-offset":return y(e,r,t,"number",null,-Number.MAX_VALUE,Number.MAX_VALUE);case"point":case"point-flat":return y(e,r,t,"boolean");case"point-radius":return y(e,r,t,"number",null,1e-4,Number.MAX_VALUE);case"point-Layer":return y(e,r,t,"string");case"point-color":return y(e,r,t,"object",4,0,255);case"icon":return y(e,r,t,"boolean");case"icon-source":return y(e,r,t,"object",5,-Number.MAX_VALUE,Number.MAX_VALUE);case"icon-scale":return y(e,r,t,"number",null,1e-4,Number.MAX_VALUE);case"icon-offset":return y(e,r,t,"object",2,-Number.MAX_VALUE,Number.MAX_VALUE);case"icon-origin":return y(e,r,t,"string");case"icon-stick":return y(e,r,t,"object",7,-Number.MAX_VALUE,Number.MAX_VALUE);case"icon-color":return y(e,r,t,"object",4,0,255);case"label":return y(e,r,t,"boolean");case"label-color":case"label-color2":return y(e,r,t,"object",4,0,255);case"label-source":return y(e,r,t,"string");case"label-size":return y(e,r,t,"number",null,1e-4,Number.MAX_VALUE);case"label-offset":return y(e,r,t,"object",2,-Number.MAX_VALUE,Number.MAX_VALUE);case"label-origin":case"label-align":return y(e,r,t,"string");case"label-stick":return y(e,r,t,"object",7,-Number.MAX_VALUE,Number.MAX_VALUE);case"label-width":return y(e,r,t,"number",null,1e-4,Number.MAX_VALUE);case"label-no-overlap":return y(e,r,t,"boolean");case"label-no-overlap-factor":return y(e,r,t,"object");case"label-no-overlap-margin":return y(e,r,t,"object",2,-Number.MAX_VALUE,Number.MAX_VALUE);case"polygon":return y(e,r,t,"boolean");case"polygon-color":return y(e,r,t,"object",4,0,255);case"z-index":return y(e,r,t,"number",null,-Number.MAX_VALUE,Number.MAX_VALUE);case"zbuffer-offset":return y(e,r,t,"object",3,0,Number.MAX_VALUE);case"selected-hover-layer":case"selected-layer":return y(e,r,t,"string");case"hover-event":return y(e,r,t,"boolean");case"hover-layer":return y(e,r,t,"string");case"enter-event":case"leave-event":case"click-event":case"draw-event":case"advanced-hit":case"export-geometry":case"visible":return y(e,r,t,"boolean");case"visibility":return y(e,r,t,"number",null,1e-5,Number.MAX_VALUE);case"visibility-abs":return y(e,r,t,"object",2,1e-5,Number.MAX_VALUE);case"visibility-rel":return y(e,r,t,"object",4,1e-5,Number.MAX_VALUE);case"hysteresis":return y(e,r,t,"object");case"culling":return y(e,r,t,"number",180,1e-4,180);case"next-pass":return y(e,r,t,"object")}return t},A=function(e){switch(e){case"inherit":return"";case"filter":case"reduce":case"dynamic-reduce":return null;case"line":case"line-flat":return!1;case"line-width":return 1;case"line-width-units":return"meters";case"line-color":return[255,255,255,255];case"line-style":return"solid";case"line-style-texture":return null;case"line-style-background":return[0,0,0,0];case"line-label":return!1;case"line-label-font":return["#default"];case"line-label-color":return[255,255,255,255];case"line-label-color2":return[0,0,0,255];case"line-label-outline":return[.27,.75,2.2,2.2];case"line-label-source":return"$name";case"line-label-size":return 1;case"line-label-offset":return 0;case"point":case"point-flat":return!1;case"point-radius":return 1;case"point-Layer":return"solid";case"point-color":return[255,255,255,255];case"icon":return!1;case"icon-source":return null;case"icon-scale":return 1;case"icon-offset":return[0,0];case"icon-origin":return"bottom-center";case"icon-stick":return[0,0,0,255,255,255,255];case"icon-color":return[255,255,255,255];case"label":return!1;case"label-font":return["#default"];case"label-color":return[255,255,255,255];case"label-color2":return[0,0,0,255];case"label-outline":return[.27,.75,2.2,2.2];case"label-source":return"$name";case"label-size":return 10;case"label-offset":return[0,0];case"label-origin":return"bottom-center";case"label-align":return"center";case"label-stick":return[0,0,0,255,255,255,255];case"label-width":return 200;case"label-no-overlap":return!0;case"label-no-overlap-factor":return null;case"label-no-overlap-margin":return[5,5];case"polygon":return!1;case"polygon-color":return[255,255,255,255];case"z-index":return 0;case"zbuffer-offset":return[0,0,0];case"selected-hover-layer":case"selected-layer":return"";case"hover-event":return!1;case"hover-layer":return"";case"enter-event":case"leave-event":case"click-event":case"draw-event":case"advanced-hit":case"export-geometry":return!1;case"visible":return!0;case"visibility":case"visibility-abs":case"visibility-rel":case"hysteresis":return null;case"culling":return 180;case"next-pass":return null}},m=function(e,r,t){var a,n,o={};b(e,o,r,t);for(a in o)if("string"==typeof(n=o[a])&&n.length>0)switch(n.charAt(0)){case"@":null!=s.stylesheetConstants[n]?o[a]=s.stylesheetConstants[n]:(g("wrong-object",e,a,n,null,"constant"),o[a]=A(a));break;case"&":null!=s.stylesheetVariables[n]?(o["$$layer-variables"]||(o["$$layer-variables"]={}),o["$$layer-variables"][a]=n,o[a]=s.stylesheetVariables[n]):(g("wrong-object",e,a,n,null,"variable"),o[a]=A(a))}return o},N=function(e){var r;s.stylesheetBitmaps={},s.stylesheetFonts={},s.stylesheetConstants=e.constants||{},s.stylesheetVariables=e.variables||{};var t=e.bitmaps||{};for(r in t){var a=t[r];"string"==typeof a?a={url:a}:"object"==typeof a?null==a.url&&g("wrong-bitmap",r):g("wrong-bitmap",r),s.stylesheetBitmaps[r]=a}postMessage({command:"loadBitmaps",bitmaps:s.stylesheetBitmaps});var n=e.fonts||{};for(r in n){var o=n[r];"string"==typeof o?o={url:o}:"object"==typeof o?null==o.url&&g("wrong-font",r):g("wrong-font",r),s.stylesheetFonts[r]=o}postMessage({command:"loadFonts",fonts:s.stylesheetFonts}),s.stylesheetData={layers:{}};var i=e.layers||{};s.stylesheetLayers=s.stylesheetData.layers;for(r in i)s.stylesheetData.layers[r]=m(r,i[r],e)}},function(e,r,t){"use strict";var a=t(0),n=t(8);t.d(r,"n",function(){return b}),t.d(r,"i",function(){return L}),t.d(r,"m",function(){return y}),t.d(r,"g",function(){return A}),t.d(r,"e",function(){return S}),t.d(r,"f",function(){return h}),t.d(r,"a",function(){return f}),t.d(r,"b",function(){return c}),t.d(r,"l",function(){return v}),t.d(r,"j",function(){return B}),t.d(r,"k",function(){return M}),t.d(r,"c",function(){return x}),t.d(r,"d",function(){return w}),t.d(r,"h",function(){return _});var o=a.a,s=a.c,i=a.d,l=a.e,u=n.a,f=function(e){console.log("setFont "+e.url);var r=u.parse(e.data);o.fontsStorage[e.url]=r},c=function(e){var r=e.map;for(var t in r)o.fonts[t]=o.fontsStorage[r[t]];o.fontsMap=r},d=function(e,r,t,a,n,i,u,f,c,d,v,h,p,b){var g,y=c[b];if(o.geocent&&!h){g=[0,0,0];var L=[0,0,0];s(o.bboxMin,L),l(L,r,g)}else g=[-r[1],r[0],0];var A=[e[0],e[1],e[2]],m=[A[0],A[1],A[2]],N=y.glyphs[a];if(a=0,!N)return[e,i,u,U];var U=0,S=f[0],x=f[1],w=f[2];if(9==a||32==a)(N=chars[32])&&(e[0]+=r[0]*N.step*n,e[1]+=r[1]*N.step*n,U=N.lx*n);else if(0==N.lx)e[0]=e[0]+r[0]*N.step*n,e[1]=e[1]+r[1]*N.step*n,U=N.lx*n;else{var B=N.lx*n,M=N.ly*n,_=[g[0]*t,g[1]*t,g[2]*t],O=[_[0]+g[0]*M,_[1]+g[1]*M,_[2]+g[2]*M];A[0]=A[0]+r[0]*N.sx*n,A[1]=A[1]+r[1]*N.sx*n,A[2]=A[2]+r[2]*N.sx*n,A[0]=A[0]+g[0]*(N.sy-y.size)*n,A[1]=A[1]+g[1]*(N.sy-y.size)*n,A[2]=A[2]+g[2]*(N.sy-y.size)*n,m[0]=A[0]+r[0]*B,m[1]=A[1]+r[1]*B,m[2]=A[2]+r[2]*B;var k=4e3*b,E=N.plane+k;p&&(p[b]||(p[b]={}),p[b][E]=!0),d[i]=A[0]-_[0],d[i+1]=A[1]-_[1],d[i+2]=A[2]-_[2],d[i+3]=w,v[u]=N.u1,v[u+1]=N.v1+k,v[u+2]=S,v[u+3]=x,d[i+4]=A[0]-O[0],d[i+5]=A[1]-O[1],d[i+6]=A[2]-O[2],d[i+7]=w,v[u+4]=N.u1,v[u+5]=N.v2+k,v[u+6]=S,v[u+7]=x,d[i+8]=m[0]-_[0],d[i+9]=m[1]-_[1],d[i+10]=m[2]-_[2],d[i+11]=w,v[u+8]=N.u2,v[u+9]=N.v1+k,v[u+10]=S,v[u+11]=x,d[i+12]=A[0]-O[0],d[i+13]=A[1]-O[1],d[i+14]=A[2]-O[2],d[i+15]=w,v[u+12]=N.u1,v[u+13]=N.v2+k,v[u+14]=S,v[u+15]=x,d[i+16]=m[0]-O[0],d[i+17]=m[1]-O[1],d[i+18]=m[2]-O[2],d[i+19]=w,v[u+16]=N.u2,v[u+17]=N.v2+k,v[u+18]=S,v[u+19]=x,d[i+20]=m[0]-_[0],d[i+21]=m[1]-_[1],d[i+22]=m[2]-_[2],d[i+23]=w,v[u+20]=N.u2,v[u+21]=N.v1+k,v[u+22]=S,v[u+23]=x,i+=24,u+=24,e[0]=e[0]+r[0]*N.step*n,e[1]=e[1]+r[1]*N.step*n,U=N.lx*n}return[e,i,u,U]},v=function(e){return 3*(e?3:4)*2},h=function(e,r,t,a,n,o,s,i,l,f,c){for(var v=[0,1,0],h=[e[0],e[1],e[2]],p=c||u.U.stringToGlyphs(n,t),b=p[0],y=p[1],L=0,A=b.length;L<A;L++){var m=b[L],N=n[y[L]];if(N){var U=g(a,N),S=d(h,r,0,m,U,l,l,v,n,o,s,i,f,y[L]);h=S[0],l=S[1]}}return l},p=function(e,r,t,a,n,o,i,l,f,c,v,h){null==n&&(n=[0,1,0]);var p=e[0];p=[p[0],p[1],p[2]];for(var b=r,y=h||u.U.stringToGlyphs(o,t),L=y[0],A=y[1],m=0,U=L.length;m<U;m++){var S=L[m],x=o[A[m]];if(x){var w=g(a,x),B=.01,M=x.glyphs[S];M&&(B=M.step*w);var _=N(e,b),O=N(e,b+B),k=[.5*(O[1][0]+_[1][0]),.5*(O[1][1]+_[1][1]),.5*(O[1][2]+_[1][2])];s(k);var E=d(_[0],k,-w*x.size*.7+i,S,w,c,c,n,o,l,f,null,v,A[m]);p=E[0],c=E[1],b+=B}}return c},b=function(e,r,t,a,n,o,s,i,l,u){var f=L(r,t,a,u),c=m(e),d=.5*(c-f);if(d<0&&(d=0),!(f>c)){var v=U(e,d,r,t,a,u);return p(e,d,r,t,v,a,n,o,s,i,l,u)}},g=function(e,r){return r?e/r.size*1.52:1},y=function(e,r){var t=g(e,r[0]);return r[0].cly*t},L=function(e,r,t,a){for(var n=0,o=a||u.U.stringToGlyphs(t,e),s=o[0],i=o[1],l=0,f=s.length;l<f;l++){var c=s[l],d=t[i[l]];if(d){var v=g(r,d),h=d.glyphs[c];h&&(n+=l==f-1?h.lx*v:h.step*v)}}return n},A=function(e,r,t,a,n){for(var o=0,s=n||u.U.stringToGlyphs(a,e),i=s[0],l=s[1],f=s[2],c=0,d=i.length;c<d;c++){var v=i[c],h=f[c];if(o>r&&(10==h||9==h||32==h))return c;if(10!=h){var p=a[l[c]];if(p){var b=g(t,p),y=p.glyphs[v];y&&(o+=c==d-1?y.lx*b:y.step*b)}}}return d},m=function(e){for(var r=0,t=0,a=e.length-1;t<a;t++){var n=e[t],o=e[t+1],s=[o[0]-n[0],o[1]-n[1],o[2]-n[2]];r+=i(s)}return r},N=function(e,r){for(var t=0,a=[0,0,0],n=[1,0,0],o=0,l=e.length-1;o<l;o++){a=e[o];var u=e[o+1];n=[u[0]-a[0],u[1]-a[1],u[2]-a[2]];var f=i(n);if(t+f>r){var c=(r-t)/f,d=[a[0]+n[0]*c,a[1]+n[1]*c,a[2]+n[2]*c];return s(n),[d,n]}t+=f}return[a,n]},U=function(e,r,t,a,n,u){for(var f=0,c=[0,0,0],d=[1,0,0],v=[0,0,0],h=r,p=r+L(t,a,n,u),b=o.bboxMin,g=o.geocent,y=0,A=e.length-1;y<A;y++){c=e[y];var m=e[y+1];if(d=[m[0]-c[0],m[1]-c[1],m[2]-c[2]],f+=i(d),f>h&&(s(d),v[0]+=d[0],v[1]+=d[1],v[2]+=d[2]),f>p){if(s(v),g){var N=[0,0,0];return s(b,N),l(N,v,N),N}return[-v[1],v[0],0]}}return v},S=function(e,r,t){return!(!e||""==e)&&-1==(t||u.U.stringToGlyphs(r,e))[0].indexOf(0)},x=function(e){for(var r=0,t=e.length;r<t;r++){var a=e.charCodeAt(r);if(a>=65&&a<=90||a>=97&&a<=122||a>=192&&a<=255&&215!=a&&247!=a||a>=256&&a<=383)return!0}return!1},w=function(e){for(var r=0,t=e.length;r<t;r++){var a=e.charCodeAt(r);if(!(a>=19968&&a<=25343||a>=25344&&a<=30719||a>=30720&&a<=36095||a>=36096&&a<=40959||a>=13312&&a<=19903||a>=131072&&a<=136703||a>=136704&&a<=143615||a>=143616&&a<=148991||a>=148992&&a<=155903||a>=155904&&a<=161279||a>=161280&&a<=168191||a>=168192&&a<=173791||a>=173824&&a<=177983||a>=177984&&a<=178207||a>=178208&&a<=183983||a>=183984&&a<=191471||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=65072&&a<=65103||a>=63744&&a<=64255||a>=194560&&a<=195103||a>=0&&a<=64||a>=160&&a<=191))return!1}return!0},B=function(e){for(var r=[],t=0,a=e.length;t<a;t++)r.push(o.fonts[e[t]]);return r},M=function(e){for(var r=[],t=0,a=e.length;t<a;t++)r.push(o.fontsMap[e[t]]);return r},_=function(e,r){return u.U.stringToGlyphs(r,e)}},function(e,r,t){"use strict";var a=t(0),n=t(2),o=t(3),s=t(1);t.d(r,"a",function(){return L}),t.d(r,"b",function(){return m});var i=a.a,l=a.c,u=a.e,f=n.b,c=n.f,d=o.n,v=o.e,h=o.l,p=o.j,b=o.k,g=s.a,y=o.h,L=function(e,r,t,a,n,o){var s=e.lines||e["d-lines"]||[];if(0!=s.length){var c=!!e["d-lines"],d=f(t,"line",e,r),v=f(t,"line-label",e,r);if(d||v){var h=f(t,"hover-event",e,r),p=f(t,"click-event",e,r),b=f(t,"draw-event",e,r),y=f(t,"enter-event",e,r),L=f(t,"leave-event",e,r),m=f(t,"advanced-hit",e,r),N=f(t,"zbuffer-offset",e,r),U=f(t,"line-flat",e,r),S=f(t,"line-color",e,r),x=.5*f(t,"line-width",e,r),w=f(t,"line-width-units",e,r),B=f(t,"line-style",e,r),M=f(t,"line-style-texture",e,r),_=f(t,"line-style-background",e,r),O=f(t,"line-label-size",e,r),k="solid"!=B,E="ratio"==w,C=0,I=0,z=0,F=!1;F=E?!U&&1080*x<2.1:!U&&x<2.1;var j,T,G,V,R,$,X,P,D,J,q,H,Y=1;if(!F){var W=[],Z=[],K=8,Q=0,ee=2*Math.PI/K;for(T=0;T<K;T++)W[T]=[-Math.sin(Q),Math.cos(Q)],Z[T]=Q,Q+=ee;W[K]=[0,1],Z[K]=0}var re=0;for(j=0;j<s.length;j++)Array.isArray(s[j])&&(re+=s[j].length);U&&(K=2);var te=3*(k||E||!U?4:3)*2,ae=F?0:K*(k||E||!U?4:3)*3,ne=new Float32Array((re-1)*te+re*ae);if(m)var oe=new Float32Array(6*(re-1)+re*(F?0:K)*3);if(!U||k||E)var se=F?0:3*K*4,ie=new Float32Array(24*(re-1)+re*se);var le=[0,0,0],ue=[],fe=i.forceOrigin,ce=i.bboxMin,de=i.geocent,ve=i.tileX,he=i.tileY,pe=i.forceScale,be=[1,0,0],ge=[-1,0,0];for(j=0;j<s.length;j++)if(Array.isArray(s[j])&&s[j].length){var ye=s[j];if(v){var Le=new Array(ye.length),Ae=new Array(ye.length);ue.push({points:Le,points2:Ae})}q=ye[0],J=[q[0],q[1],q[2]],fe&&(J=[J[0]-ve,J[1]-he,J[2]]),null!=pe&&(J=[J[0]*pe[0],J[1]*pe[1],J[2]*pe[2]]);var me=.001,Ne=.001,Ue=C,Se=I;for(T=0,G=ye.length-1;T<G;T++)c?(V=ye[T+1],V=[J[0]+V[0],J[1]+V[1],J[2]+V[2]],fe&&(V=[V[0]-ve,V[1]-he,V[2]]),null!=pe&&(V=[V[0]*pe[0],V[1]*pe[1],V[2]*pe[2]])):(J=ye[T],V=ye[T+1],fe&&(J=[J[0]-ve,J[1]-he,J[2]],V=[V[0]-ve,V[1]-he,V[2]]),null!=pe&&(J=[J[0]*pe[0],J[1]*pe[1],J[2]*pe[2]],V=[V[0]*pe[0],V[1]*pe[1],V[2]*pe[2]])),m&&(H=Y+T,oe[z]=H,oe[z+1]=H,oe[z+2]=H,oe[z+3]=H,oe[z+4]=H,oe[z+5]=H,z+=6),!U||k||E?U?(de?(R=[V[0]-J[0],V[1]-J[1],V[2]-J[2]],X=Math.sqrt(R[0]*R[0]+R[1]*R[1]+R[2]*R[2]),Ne+=X,X=0!=X?1/X:0,$=[R[0]*X,R[1]*X,R[2]*X],P=[0,0,0],D=[0,0,0],0==T&&(be=$),T==G-1&&(ge=$),l(ce,D),u(D,$,P),P=[P[0],P[1],P[2]]):(R=[V[0]-J[0],V[1]-J[1],0],X=Math.sqrt(R[0]*R[0]+R[1]*R[1]),Ne+=X,X=0!=X?x/X:0,P=[-R[1],R[0],0],0==T&&(be=[R[0]*X,R[1]*X,0]),T==G-1&&(ge=[R[0]*X,R[1]*X,0])),ne[C]=J[0],ne[C+1]=J[1],ne[C+2]=J[2],ne[C+3]=me,ie[I]=P[0],ie[I+1]=P[1],ie[I+2]=P[2],ie[I+3]=x,ne[C+4]=J[0],ne[C+5]=J[1],ne[C+6]=J[2],ne[C+7]=-me,ie[I+4]=-P[0],ie[I+5]=-P[1],ie[I+6]=-P[2],ie[I+7]=x,ne[C+8]=V[0],ne[C+9]=V[1],ne[C+10]=V[2],ne[C+11]=Ne,ie[I+8]=P[0],ie[I+9]=P[1],ie[I+10]=P[2],ie[I+11]=x,ne[C+12]=J[0],ne[C+13]=J[1],ne[C+14]=J[2],ne[C+15]=-me,ie[I+12]=-P[0],ie[I+13]=-P[1],ie[I+14]=-P[2],ie[I+15]=x,ne[C+16]=V[0],ne[C+17]=V[1],ne[C+18]=V[2],ne[C+19]=-Ne,ie[I+16]=-P[0],ie[I+17]=-P[1],ie[I+18]=-P[2],ie[I+19]=x,ne[C+20]=V[0],ne[C+21]=V[1],ne[C+22]=V[2],ne[C+23]=Ne,ie[I+20]=P[0],ie[I+21]=P[1],ie[I+22]=P[2],ie[I+23]=x,C+=24,I+=24):(R=[V[0]-J[0],V[1]-J[1],0],X=Math.sqrt(R[0]*R[0]+R[1]*R[1]),Ne+=X,ne[C]=J[0],ne[C+1]=J[1],ne[C+2]=J[2],ne[C+3]=me,ie[I]=V[0],ie[I+1]=V[1],ie[I+2]=V[2],ie[I+3]=x,ne[C+4]=J[0],ne[C+5]=J[1],ne[C+6]=J[2],ne[C+7]=-me,ie[I+4]=V[0],ie[I+5]=V[1],ie[I+6]=V[2],ie[I+7]=-x,ne[C+8]=V[0],ne[C+9]=V[1],ne[C+10]=V[2],ne[C+11]=-Ne,ie[I+8]=J[0],ie[I+9]=J[1],ie[I+10]=J[2],ie[I+11]=x,ne[C+12]=J[0],ne[C+13]=J[1],ne[C+14]=J[2],ne[C+15]=me,ie[I+12]=V[0],ie[I+13]=V[1],ie[I+14]=V[2],ie[I+15]=x,ne[C+16]=V[0],ne[C+17]=V[1],ne[C+18]=V[2],ne[C+19]=-Ne,ie[I+16]=J[0],ie[I+17]=J[1],ie[I+18]=J[2],ie[I+19]=x,ne[C+20]=V[0],ne[C+21]=V[1],ne[C+22]=V[2],ne[C+23]=Ne,ie[I+20]=J[0],ie[I+21]=J[1],ie[I+22]=J[2],ie[I+23]=-x,C+=24,I+=24):(de?(R=[V[0]-J[0],V[1]-J[1],V[2]-J[2]],X=Math.sqrt(R[0]*R[0]+R[1]*R[1]+R[2]*R[2]),Ne+=X,X=0!=X?1/X:0,$=[R[0]*X,R[1]*X,R[2]*X],P=[0,0,0],D=[0,0,0],l(ce,D),u(D,$,P),0==T&&(be=$),T==G-1&&(ge=$),P=[P[0]*x,P[1]*x,P[2]*x]):(R=[V[0]-J[0],V[1]-J[1],0],X=Math.sqrt(R[0]*R[0]+R[1]*R[1]),Ne+=X,X=0!=X?x/X:0,P=[-R[1]*X,R[0]*X,0],0==T&&(be=[R[0]*X,R[1]*X,0]),T==G-1&&(ge=[R[0]*X,R[1]*X,0])),ne[C]=J[0]+P[0],ne[C+1]=J[1]+P[1],ne[C+2]=J[2]+P[2],ne[C+3]=J[0]-P[0],ne[C+4]=J[1]-P[1],ne[C+5]=J[2]-P[2],ne[C+6]=V[0]+P[0],ne[C+7]=V[1]+P[1],ne[C+8]=V[2]+P[2],ne[C+9]=J[0]-P[0],ne[C+10]=J[1]-P[1],ne[C+11]=J[2]-P[2],ne[C+12]=V[0]-P[0],ne[C+13]=V[1]-P[1],ne[C+14]=V[2]-P[2],ne[C+15]=V[0]+P[0],ne[C+16]=V[1]+P[1],ne[C+17]=V[2]+P[2],C+=18),me=Ne,J=V;for(J=[q[0],q[1],q[2]],T=0,G=ye.length;T<G;T++){if(fe&&(J=[J[0]-ve,J[1]-he,J[2]]),null!=pe&&(J=[J[0]*pe[0],J[1]*pe[1],J[2]*pe[2]]),le[0]+=J[0],le[1]+=J[1],le[2]+=J[2],!F){if(U){m&&(H=Y+(T!=G-1?T:T-1),oe[z]=H,oe[z+1]=H,oe[z+2]=H,oe[z+3]=H,oe[z+4]=H,oe[z+5]=H,z+=6);var xe,we;k||E?(me=T!=G-1?ne[T*te+3]:ne[(T-1)*te+11],xe=T!=G-1?Se+T*te:Se+(T-1)*te+8,we=T>0?Se+(T-1)*te+8:Se+xe,ne[C]=J[0],ne[C+1]=J[1],ne[C+2]=J[2],ne[C+3]=me,ne[C+4]=J[0],ne[C+5]=J[1],ne[C+6]=J[2],ne[C+7]=me,ne[C+8]=J[0],ne[C+9]=J[1],ne[C+10]=J[2],ne[C+11]=me,ne[C+12]=J[0],ne[C+1+12]=J[1],ne[C+2+12]=J[2],ne[C+3+12]=me,ne[C+4+12]=J[0],ne[C+5+12]=J[1],ne[C+6+12]=J[2],ne[C+7+12]=-me,ne[C+8+12]=J[0],ne[C+9+12]=J[1],ne[C+10+12]=J[2],ne[C+11+12]=-me,0==T?(ie[I]=0,ie[I+1]=0,ie[I+2]=0,ie[I+3]=-x,ie[I+4]=ie[xe],ie[I+5]=ie[xe+1],ie[I+6]=ie[xe+2],ie[I+7]=x,ie[I+8]=-be[0],ie[I+9]=-be[1],ie[I+10]=-be[2],ie[I+11]=-x,ie[I+12]=0,ie[I+1+12]=0,ie[I+2+12]=0,ie[I+3+12]=-x,ie[I+4+12]=-ie[xe],ie[I+5+12]=-ie[xe+1],ie[I+6+12]=-ie[xe+2],ie[I+7+12]=x,ie[I+8+12]=-be[0],ie[I+9+12]=-be[1],ie[I+10+12]=-be[2],ie[I+11+12]=-x):T==G-1?(ie[I]=0,ie[I+1]=0,ie[I+2]=0,ie[I+3]=-x,ie[I+4]=ie[we],ie[I+5]=ie[we+1],ie[I+6]=ie[we+2],ie[I+7]=x,ie[I+8]=ge[0],ie[I+9]=ge[1],ie[I+10]=ge[2],ie[I+11]=-x,ie[I+12]=0,ie[I+1+12]=0,ie[I+2+12]=0,ie[I+3+12]=-x,ie[I+4+12]=-ie[we],ie[I+5+12]=-ie[we+1],ie[I+6+12]=-ie[we+2],ie[I+7+12]=x,ie[I+8+12]=ge[0],ie[I+9+12]=ge[1],ie[I+10+12]=ge[2],ie[I+11+12]=-x):(ie[I]=0,ie[I+1]=0,ie[I+2]=0,ie[I+3]=-x,ie[I+4]=ie[xe],ie[I+5]=ie[xe+1],ie[I+6]=ie[xe+2],ie[I+7]=x,ie[I+8]=ie[we],ie[I+9]=ie[we+1],ie[I+10]=ie[we+2],ie[I+11]=x,ie[I+12]=0,ie[I+1+12]=0,ie[I+2+12]=0,ie[I+3+12]=-x,ie[I+4+12]=-ie[xe],ie[I+5+12]=-ie[xe+1],ie[I+6+12]=-ie[xe+2],ie[I+7+12]=x,ie[I+8+12]=-ie[we],ie[I+9+12]=-ie[we+1],ie[I+10+12]=-ie[we+2],ie[I+11+12]=x),C+=24,I+=24):(xe=T!=G-1?Ue+T*te:Ue+(T-1)*te,we=T>0?Ue+(T-1)*te:Ue+xe,0==T?(ne[C]=J[0],ne[C+1]=J[1],ne[C+2]=J[2],ne[C+3]=ne[xe],ne[C+4]=ne[xe+1],ne[C+5]=ne[xe+2],ne[C+6]=J[0]-be[0]*x,ne[C+7]=J[1]-be[1]*x,ne[C+8]=J[2]-be[2]*x,ne[C+9]=J[0],ne[C+9+1]=J[1],ne[C+9+2]=J[2],ne[C+9+3]=ne[xe+3],ne[C+9+4]=ne[xe+4],ne[C+9+5]=ne[xe+5],ne[C+9+6]=J[0]-be[0]*x,ne[C+9+7]=J[1]-be[1]*x,ne[C+9+8]=J[2]-be[2]*x):T==G-1?(ne[C]=J[0],ne[C+1]=J[1],ne[C+2]=J[2],ne[C+3]=ne[xe+15],ne[C+4]=ne[xe+16],ne[C+5]=ne[xe+17],ne[C+6]=J[0]+ge[0]*x,ne[C+7]=J[1]+ge[1]*x,ne[C+8]=J[2]+ge[2]*x,ne[C+9]=J[0],ne[C+9+1]=J[1],ne[C+9+2]=J[2],ne[C+9+3]=ne[xe+12],ne[C+9+4]=ne[xe+13],ne[C+9+5]=ne[xe+14],ne[C+9+6]=J[0]+ge[0]*x,ne[C+9+7]=J[1]+ge[1]*x,ne[C+9+8]=J[2]+ge[2]*x):(ne[C]=J[0],ne[C+1]=J[1],ne[C+2]=J[2],ne[C+3]=ne[xe],ne[C+4]=ne[xe+1],ne[C+5]=ne[xe+2],ne[C+6]=ne[we+15],ne[C+7]=ne[we+16],ne[C+8]=ne[we+17],ne[C+9]=J[0],ne[C+9+1]=J[1],ne[C+9+2]=J[2],ne[C+9+3]=ne[xe+3],ne[C+9+4]=ne[xe+4],ne[C+9+5]=ne[xe+5],ne[C+9+6]=ne[we+12],ne[C+9+7]=ne[we+13],ne[C+9+8]=ne[we+14]),C+=18)}else for(var Be=T!=G-1?T:T-1,Me=0;Me<K;Me++)m&&(H=Y+Be,oe[z]=H,oe[z+1]=H,oe[z+2]=H,z+=3),me=ne[Be*te+3],ne[C]=J[0],ne[C+1]=J[1],ne[C+2]=J[2],ne[C+3]=me,ie[I]=0,ie[I+1]=0,ie[I+2]=0,ie[I+3]=0,ne[C+4]=J[0],ne[C+5]=J[1],ne[C+6]=J[2],ne[C+7]=me,ie[I+4]=W[Me][0]*x,ie[I+5]=W[Me][1]*x,ie[I+6]=Z[Me]+0,ie[I+7]=0,ne[C+8]=J[0],ne[C+9]=J[1],ne[C+10]=J[2],ne[C+11]=me,ie[I+8]=W[Me+1][0]*x,ie[I+9]=W[Me+1][1]*x,ie[I+10]=Z[Me+1]+0,ie[I+11]=0,C+=12,I+=12}v&&(q=[J[0],J[1],J[2]+.1*O],Le[T]=q,Ae[G-T-1]=q),T+1<G&&(c?(V=ye[T+1],J=[J[0]+V[0],J[1]+V[1],J[2]+V[2]]):J=ye[T+1])}Y+=ye.length}re>0&&(le[0]/=re,le[1]/=re,le[2]/=re),le[0]+=i.groupOrigin[0],le[1]+=i.groupOrigin[1],le[2]+=i.groupOrigin[2];var _e=h||p||y||L;if(d){var Oe={command:"addRenderJob",vertexBuffer:ne,color:S,"z-index":n,center:le,normalBuffer:ie,elementBuffer:oe,"hover-event":h,"click-event":p,"draw-event":b,hitable:_e,state:i.hitState,eventInfo:o,advancedHit:m,"enter-event":y,"leave-event":L,"zbuffer-offset":N,"width-units":w,"line-width":2*x,lod:i.autoLod?null:i.tileLod};Oe.type=U?k?"flat-tline":E?"flat-rline":"flat-line":k?"pixel-tline":"pixel-line",k&&null!=M&&(Oe.texture=[i.stylesheetBitmaps[M[0]],M[1],M[2]],Oe.background=_);var ke=JSON.stringify({type:Oe.type,color:S,zIndex:n,zOffset:N,state:i.hitState});ie?g(Oe,[ne.buffer,ie.buffer],ke):g(Oe,[ne.buffer],ke)}if(v)for(T=0,G=ue.length;T<G;T++)A(ue[T].points,ue[T].points2,e,le,r,t,a,n,o)}}},A=function(e,r,t,a,n,o,s,l,u){var L=f(o,"line-label-color",t,n),A=f(o,"line-label-color2",t,n),m=f(o,"line-label-outline",t,n),N=f(o,"line-label-source",t,n),U=f(o,"line-label-size",t,n),S=f(o,"line-label-offset",t,n);if(!(Math.abs(U)<1e-4)){var x=c(o,N,t,n,N);x=x?x.replace("\\r\\n","\\n").replace("\\r","\\n"):"";var w=f(o,"line-label-font",t,n),B=p(w),M=b(w),_=y(x,B);if("$name"==N&&!v(x,B,_)){var O=c(o,"$name:en",t,n,N);O=O?O.replace("\\r\\n","\\n").replace("\\r","\\n"):"";var k=y(x,B);v(O,B,k)&&(x=O,_=k)}if(x&&""!=x){var E=f(o,"hover-event",t,n),C=f(o,"click-event",t,n),I=f(o,"draw-event",t,n),z=f(o,"enter-event",t,n),F=f(o,"leave-event",t,n),j=f(o,"advanced-hit",t,n),T=f(o,"zbuffer-offset",t,n),G=h()*x.length*2,V=new Float32Array(G),R=new Float32Array(G),$={},X=E||C||z||F,P=d(e,x,U,B,S,V,R,0,$,_);if(P=d(r,x,U,B,S,V,R,P,null,_)){for(var D=new Array(B.length),J=0,q=B.length;J<q;J++)D[J]=[];for(var H in $){var Y=parseInt(H),W=$[H],Z=[];for(var K in W){var Q=parseInt(K)-4e3*Y,ee=Math.round((Q-Q%4)/4);-1==Z.indexOf(ee)&&Z.push(ee)}D[Y]=Z}var re=JSON.stringify({type:"line-label",color:L,color2:A,outline:m,fonts:w,zIndex:l,zOffset:T});g({command:"addRenderJob",type:"line-label",vertexBuffer:V,texcoordsBuffer:R,color:L,color2:A,outline:m,"z-index":l,center:a,"hover-event":E,"click-event":C,"draw-event":I,files:D,"enter-event":z,"leave-event":F,"zbuffer-offset":T,fonts:M,hitable:X,state:i.hitState,eventInfo:u,advancedHit:j,lod:i.autoLod?null:i.tileLod},[V.buffer,R.buffer],re)}}}},m=function(e){var r=e.lines||e["d-lines"]||[];if(0!=r.length){var t=!!e["d-lines"],a=0,n=new Uint32Array(r.length);for(v=0;v<r.length;v++)n[v]=a,Array.isArray(r[v])&&(a+=r[v].length);for(var o,s,l,u,f=new Float64Array(3*a),c=i.forceScale,d=0,v=0;v<r.length;v++)if(Array.isArray(r[v])&&r[v].length){var h=r[v];u=h[0],o=[u[0],u[1],u[2]];for(var p=0,b=h.length;p<b&&(null!=c&&(l=[o[0]*c[0],o[1]*c[1],o[2]*c[2]]),f[d]=l[0],f[d+1]=l[1],f[d+2]=l[2],d+=3,p!=b-1);p++)t?(s=h[p+1],o=[o[0]+s[0],o[1]+s[1],o[2]+s[2]]):o=h[p+1]}i.signatureCounter++,g({command:"addRenderJob",type:"line-geometry",id:e.id,geometryBuffer:f,indicesBuffer:n},[f.buffer,n.buffer],""+i.signatureCounter)}}},function(e,r,t){"use strict";var a=t(0),n=t(2),o=t(3),s=t(1);t.d(r,"a",function(){return m}),t.d(r,"b",function(){return x});var i=a.a,l=a.f,u=n.b,f=n.f,c=o.f,d=o.g,v=o.h,h=o.i,p=o.j,b=o.k,g=o.e,y=o.l,L=o.m,A=s.a,m=function(e,r,t,a,n,o){var s,c,d=[],h=!1;if(e.lines||e["d-lines"]?(d=e.lines||e["d-lines"],h=!!e["d-lines"]):(e.points||e["d-points"])&&(d=[e.points||e["d-points"]],h=!!e["d-points"]),0!=d.length){var L,m,N,x,w,B,M=u(t,"visibility-rel",e,r)||u(t,"visibility-abs",e,r)||u(t,"visibility",e,r),_=u(t,"culling",e,r),O=u(t,"hover-event",e,r),k=u(t,"click-event",e,r),E=u(t,"draw-event",e,r),C=u(t,"enter-event",e,r),I=u(t,"leave-event",e,r),z=u(t,"advanced-event",e,r),F=u(t,"zbuffer-offset",e,r),j=u(t,"point",e,r),T=u(t,"point-flat",e,r),G=u(t,"point-color",e,r),V=.5*u(t,"point-radius",e,r),R=0;for(w=0,B=d.length;w<B;w++)x=d[w],Array.isArray(x)&&x.length>0&&(R+=x.length);var $=u(t,"icon",e,r);if($)if(L=u(t,"icon-source",e,r)){m=y()*R,N=y(!0)*R;var X={color:u(t,"icon-color",e,r),scale:u(t,"icon-scale",e,r),offset:u(t,"icon-offset",e,r),stick:u(t,"icon-stick",e,r),reduce:u(t,"dynamic-reduce",e,r),origin:u(t,"icon-origin",e,r),source:u(t,"icon-source",e,r),vertexBuffer:new Float32Array(m),originBuffer:new Float32Array(N),texcoordsBuffer:new Float32Array(m),index:0,index2:0}}else $=!1;var P=u(t,"label",e,r);if(P){L=u(t,"label-source",e,r);var D=f(t,L,e,r,L);D=D?D.replace("\\r\\n","\\n").replace("\\r","\\n"):"";var J=u(t,"label-size",e,r),q=u(t,"label-font",e,r),H=p(q),Y=v(D,H);if("$name"==L&&!g(D,H,Y)){var W=f(t,"$name:en",e,r,L);W=W?W.replace("\\r\\n","\\n").replace("\\r","\\n"):"";var Z=v(W,H);g(W,H)&&(D=W,Y=Z)}if(D&&""!=D&&Math.abs(J)>1e-4){m=y()*D.length*R,N=y(!0)*D.length*R;var K={color:u(t,"label-color",e,r),color2:u(t,"label-color2",e,r),outline:u(t,"label-outline",e,r),reduce:u(t,"dynamic-reduce",e,r),size:J,offset:u(t,"label-offset",e,r),stick:u(t,"label-stick",e,r),origin:u(t,"label-origin",e,r),align:u(t,"label-align",e,r),fonts:H,fontsStorage:b(q),text:D,hysteresis:u(t,"hysteresis",e,r),width:u(t,"label-width",e,r),noOverlap:u(t,"label-no-overlap",e,r),noOverlapMargin:u(t,"label-no-overlap-margin",e,r),noOverlapFactor:u(t,"label-no-overlap-factor",e,r),vertexBuffer:new Float32Array(m),originBuffer:new Float32Array(N),texcoordsBuffer:new Float32Array(m),index:0,index2:0,glyphsRes:Y}}else P=!1}var Q=0,ee=0,re=[],te=l(8*V*.5,8,32),ae=0,ne=2*Math.PI/te;for(s=0;s<te;s++)re[s]=[-Math.sin(ae),Math.cos(ae)],ae+=ne;re[te]=[0,1];var oe,se,ie,le,ue,fe,ce,de=[0,0,0],ve=i.forceOrigin,he=i.bboxMin,pe=i.tileX,be=i.tileY,ge=i.forceScale;for(T?(le=3*te*3,ue=new Float32Array(R*le)):(le=3*te*4,ue=new Float32Array(R*le),fe=3*te*4,ce=new Float32Array(R*fe)),w=0,B=d.length;w<B;w++)if(x=d[w],Array.isArray(x)&&x.length>0)for(se=x[0],ie=[se[0],se[1],se[2]],s=0,c=x.length;s<c;s++){ve&&(ie=[ie[0]-pe,ie[1]-be,ie[2]]),null!=ge&&(ie=[ie[0]*ge[0],ie[1]*ge[1],ie[2]*ge[2]]),de[0]+=ie[0],de[1]+=ie[1],de[2]+=ie[2],$&&U(ie,X),P&&(oe=S(ie,K));for(var ye=0;ye<te;ye++)j&&(T?(ue[Q]=ie[0],ue[Q+1]=ie[1],ue[Q+2]=ie[2],ue[Q+3]=ie[0]+re[ye][0]*V,ue[Q+4]=ie[1]+re[ye][1]*V,ue[Q+5]=ie[2],ue[Q+6]=ie[0]+re[ye+1][0]*V,ue[Q+7]=ie[1]+re[ye+1][1]*V,ue[Q+8]=ie[2],Q+=9):(ue[Q]=ie[0],ue[Q+1]=ie[1],ue[Q+2]=ie[2],ue[Q+3]=0,ce[ee]=0,ce[ee+1]=0,ce[ee+2]=0,ce[ee+3]=0,ue[Q+4]=ie[0],ue[Q+5]=ie[1],ue[Q+6]=ie[2],ue[Q+7]=0,ce[ee+4]=re[ye][0]*V,ce[ee+5]=re[ye][1]*V,ce[ee+6]=0,ce[ee+7]=0,ue[Q+8]=ie[0],ue[Q+9]=ie[1],ue[Q+10]=ie[2],ue[Q+11]=0,ce[ee+8]=re[ye+1][0]*V,ce[ee+9]=re[ye+1][1]*V,ce[ee+10]=0,ce[ee+11]=0,Q+=12,ee+=12));if(s+1<c)if(h){var Le=x[s+1];ie=[ie[0]+Le[0],ie[1]+Le[1],ie[2]+Le[2]]}else ie=x[s+1]}R>0&&(de[0]/=R,de[1]/=R,de[2]/=R),de[0]+=he[0],de[1]+=he[1],de[2]+=he[2];var Ae=O||k||C||I;i.signatureCounter++;var me=""+i.signatureCounter;if(j&&(T?A({command:"addRenderJob",type:"flat-line",vertexBuffer:ue,color:G,"z-index":n,visibility:M,center:de,"hover-event":O,"click-event":k,"draw-event":E,"enter-event":C,"leave-event":I,"zbuffer-offset":F,hitable:Ae,state:i.hitState,eventInfo:o,advancedHit:z,lod:i.autoLod?null:i.tileLod},[ue.buffer],me):A({command:"addRenderJob",type:"pixel-line",vertexBuffer:ue,normalBuffer:ce,color:G,"z-index":n,visibility:M,center:de,"hover-event":O,"click-event":k,"draw-event":E,"enter-event":C,"leave-event":I,"zbuffer-offset":F,hitable:Ae,state:i.hitState,eventInfo:o,lod:i.autoLod?null:i.tileLod},[ue.buffer,ce.buffer],me)),$&&X.vertexBuffer.length>0&&(i.signatureCounter++,me=""+i.signatureCounter,A({command:"addRenderJob",type:"icon",vertexBuffer:X.vertexBuffer,originBuffer:X.originBuffer,texcoordsBuffer:X.texcoordsBuffer,icon:i.stylesheetBitmaps[X.source[0]],color:X.color,"z-index":n,visibility:M,culling:_,center:de,stick:X.stick,"hover-event":O,"click-event":k,"draw-event":E,advancedHit:z,"enter-event":C,"leave-event":I,"zbuffer-offset":F,hitable:Ae,state:i.hitState,eventInfo:o,index:a,reduce:X.reduce,lod:i.autoLod?null:i.tileLod},[X.vertexBuffer.buffer,X.originBuffer.buffer,X.texcoordsBuffer.buffer],me)),P&&K.vertexBuffer.length>0){if(i.signatureCounter++,me=""+i.signatureCounter,K.noOverlap){var Ne=K.noOverlapMargin,Ue=null,Se=null;if(null!==K.noOverlapFactor){switch(K.noOverlapFactor[0]){case"direct":Ue=0;break;case"div-by-dist":Ue=1}Se=K.noOverlapFactor[1]}var xe=[oe[0]-Ne[0],oe[1]-Ne[1],oe[2]+Ne[0],oe[3]+Ne[1],Ue,Se]}A({command:"addRenderJob",type:"label",vertexBuffer:K.vertexBuffer,originBuffer:K.originBuffer,texcoordsBuffer:K.texcoordsBuffer,size:K.size,color:K.color,color2:K.color2,outline:K.outline,"z-index":n,visibility:M,culling:_,center:de,stick:K.stick,noOverlap:K.noOverlap?xe:null,"hover-event":O,"click-event":k,"draw-event":E,files:K.files,index:a,"enter-event":C,"leave-event":I,"zbuffer-offset":F,fonts:K.fontsStorage,hysteresis:K.hysteresis,hitable:Ae,state:i.hitState,eventInfo:o,advancedHit:z,reduce:K.reduce,lod:i.autoLod?null:i.tileLod},[K.vertexBuffer.buffer,K.originBuffer.buffer,K.texcoordsBuffer.buffer],me)}}},N=function(e,r,t){switch(e){case"top-left":return[0,0];case"top-right":return[-r,0];case"top-center":return[.5*-r,0];case"center-left":return[0,.5*-t];case"center-right":return[-r,.5*-t];case"center-center":return[.5*-r,.5*-t];case"bottom-left":return[0,-t];case"bottom-right":return[-r,-t];case"bottom-center":return[.5*-r,-t]}},U=function(e,r){var t=r.source,a=r.index,n=r.index2,o=a,s=Math.abs(t[3]*r.scale),i=Math.abs(t[4]*r.scale),l=r.vertexBuffer,u=r.texcoordsBuffer,f=r.originBuffer;l[a]=0,l[a+1]=0,l[a+2]=0,l[a+3]=0,l[a+4]=s,l[a+5]=0,l[a+6]=0,l[a+7]=0,l[a+8]=s,l[a+9]=-i,l[a+10]=0,l[a+11]=0,u[a]=t[1],u[a+1]=t[2],u[a+2]=0,u[a+3]=0,u[a+4]=t[1]+t[3],u[a+5]=t[2],u[a+6]=0,u[a+7]=0,u[a+8]=t[1]+t[3],u[a+9]=t[2]+t[4],u[a+10]=0,u[a+11]=0,a+=12,l[a]=0,l[a+1]=0,l[a+2]=0,l[a+3]=0,l[a+4]=0,l[a+5]=-i,l[a+6]=0,l[a+7]=0,l[a+8]=s,l[a+9]=-i,l[a+10]=0,l[a+11]=0,u[a]=t[1],u[a+1]=t[2],u[a+2]=0,u[a+3]=0,u[a+4]=t[1],u[a+5]=t[2]+t[4],u[a+6]=0,u[a+7]=0,u[a+8]=t[1]+t[3],u[a+9]=t[2]+t[4],u[a+10]=0,u[a+11]=0,a+=12;for(var c=N(r.origin,s,i),d=c[0]+r.offset[0],v=c[1]+r.offset[1],h=e[0],p=e[1],b=e[2],g=o;g<a;g+=4)l[g]+=d,l[g+1]-=v,f[n]=h,f[n+1]=p,f[n+2]=b,n+=3;r.index=a,r.index2=n},S=function(e,r){var t,a,n=r.vertexBuffer,o=r.texcoordsBuffer,s=r.originBuffer,i=r.index,l=r.index2,u=i,f=(r.text,r.fonts),v={},p=r.glyphsRes,b=[],g=[];do{var y=p[2].indexOf(10);-1!=y?(b.push([p[0].slice(0,y),p[1].slice(0,y),p[2].slice(0,y)]),p=[p[0].slice(y+1),p[1].slice(y+1),p[2].slice(y+1)]):b.push(p)}while(-1!=y);for(var t=0,a=b.length;t<a;t++)for(var p=b[t];;){var A=d(null,r.width,r.size,f,p),m=p[2];if(m.length==A){g.push(p);break}g.push([p[0].slice(0,A),p[1].slice(0,A),p[2].slice(0,A)]),p=[p[0].slice(A+1),p[1].slice(A+1),p[2].slice(A+1)]}var U=0,S=0,x=L(r.size,f),w=0,B=[];for(t=0,a=g.length;t<a;t++)B[t]=h(null,r.size,f,g[t]),w=Math.max(B[t],w);for(t=0,a=g.length;t<a;t++){var M=B[t];switch(r.align){case"left":U=0;break;case"right":U=w-M;break;case"center":U=.5*(w-M)}i=c([U,S,0],[1,0,0],null,r.size,f,n,o,!0,i,v,g[t]),S-=x}var _=N(r.origin,w,-S),O=_[0]+r.offset[0],k=_[1]+r.offset[1],E=e[0],C=e[1],I=e[2];for(t=u;t<i;t+=4)n[t]+=O,n[t+1]-=k,s[l]=E,s[l+1]=C,s[l+2]=I,l+=3;var f=r.fonts;for(r.files=new Array(f.length),t=0,a=f.length;t<a;t++)r.files[t]=[];for(var z in v){var F=parseInt(z),j=v[z],T=[];for(var G in j){var V=parseInt(G)-4e3*F,R=Math.round((V-V%4)/4);-1==T.indexOf(R)&&T.push(R)}r.files[F]=T}return r.index=i,r.index2=l,[.5*O,.5*k,.5*(O+w)+1,.5*(k+Math.abs(S))]},x=function(e){var r,t,a=!1;if(!e.points&&!e["d-points"]||(points=e.points||e["d-points"],a=!!e["d-points"],Array.isArray(points)&&points.length>0)){var n,o,s=0,l=i.forceScale,u=new Float64Array(points.length),f=points[0],c=[f[0],f[1],f[2]];for(r=0,t=points.length;r<t&&(null!=l&&(n=[c[0]*l[0],c[1]*l[1],c[2]*l[2]]),u[s]=n[0],u[s+1]=n[1],u[s+2]=n[2],s+=3,!(r>=t-1));r++)a?(o=points[r+1],c=[c[0]+o[0],c[1]+o[1],c[2]+o[2]]):c=points[r+1];A({command:"addRenderJob",type:"point-geometry",id:lineString.id,geometryBuffer:u},[u.buffer,indicesBuffer.buffer],""+i.signatureCounter)}}},function(e,r,t){"use strict";var a=t(0),n=t(2),o=t(1),s=t(4),i=t(5);t.d(r,"a",function(){return v});var l=a.a,u=n.b,f=o.a,c=s.a,d=i.a,v=function(e,r,t,a,n,o){var s=e.vertices||[];if(0!=s.length){(u(t,"point",e,r)||u(t,"label",e,r))&&p(e,s,r,t,n,o,!1),(u(t,"line",e,r)||u(t,"line-label",e,r))&&p(e,s,r,t,n,o,!0);if(u(t,"polygon",e,r)){var i=e.surface||[];if(0!=i.length){for(var c,d,v=u(t,"hover-event",e,r),h=u(t,"click-event",e,r),b=u(t,"draw-event",e,r),g=u(t,"enter-event",e,r),y=u(t,"leave-event",e,r),L=u(t,"advanced-hit",e,r),A=u(t,"zbuffer-offset",e,r),m=u(t,"polygon-color",e,r),N=[0,0,0],U=i.length/3,S=3*U,x=new Array(3*S),w=0,B=0,M=l.tileX,_=l.tileY,O=l.forceOrigin,k=l.forceScale,E=0;E<S;E++)d=3*i[w++],c=[s[d++],s[d++],s[d]],O&&(c=[c[0]-M,c[1]-_,c[2]]),null!=k&&(c=[c[0]*k[0],c[1]*k[1],c[2]*k[2]]),N[0]+=c[0],N[1]+=c[1],N[2]+=c[2],x[B++]=c[0],x[B++]=c[1],x[B++]=c[2];if(S>0){var C=1/S;N[0]*=C,N[1]*=C,N[2]*=C}N[0]+=l.groupOrigin[0],N[1]+=l.groupOrigin[1],N[2]+=l.groupOrigin[2];var I=v||h||g||y,z={command:"addRenderJob",type:"flat-line",vertexBuffer:x,color:m,"z-index":n,center:N,"hover-event":v,"click-event":h,"draw-event":b,hitable:I,state:l.hitState,eventInfo:o,advancedHit:L,"enter-event":g,"leave-event":y,"zbuffer-offset":A,lod:l.autoLod?null:l.tileLod};f(z)}}}},h=function(e){var r={};for(var t in e)"surface"!=t&&"vertices"!=t&&"borders"!=t&&(r[t]=e[t]);return r},p=function(e,r,t,a,n,o,s,i){var l=e.borders||[];if(0!=l.length)for(var u=h(e),f=l.length,v=0;v<f;v++){var p,b=l[v],g=b.length,y=0;if(g>0){var L,A;for(L=i?new Array(g+1):new Array(g),A=0;A<g;A++)b[A]>=0?(p=3*b[A],y++):p=3*-b[A],L[A]=[r[p],r[p+1],r[p+2]],i&&0==A&&(L[g]=L[0]);var m=new Array(y),N=0;for(A=0;A<g;A++)b[A]>=0&&(p=3*b[A],m[N]=[r[p],r[p+1],r[p+2]],N++);i?(u.lines=[L],c(u,t,a,n,o,s)):(u.points=m,d(u,t,a,n,o,s))}}}},function(e,r,t){"use strict";function a(e){return 0!=(1&e)}function n(e){return 0==(1&e)}function o(e,r,t){for(var a=r,n=e.length;a<n;++a)if(e[a]!==t)return a;return a}function s(e,r,t,a){for(var n=r;n<t;++n)e[n]=a}function i(e,r,t,a){for(var n=t,o=a-1;n<o;++n,--o){var s=e[n];e[n]=e[o],e[o]=s,s=r[n],r[n]=r[o],r[o]=s}}function l(e,r,t){return{str:e,indices:h,types:v,dir:t?"ttb":r?"ltr":"rtl"}}function u(e,r,t){var u=!0,p=e.length;if(0===p||t)return l(e,u,t);d.length=p,v.length=p;var b,g,y=0;for(b=0;b<p;++b){d[b]=e.charAt(b),h[b]=b;var L=e.charCodeAt(b),A="L";L<=255?A=f[L]:1424<=L&&L<=1524?A="R":1536<=L&&L<=1791?A=c[255&L]:1792<=L&&L<=2220&&(A="AL"),"R"!==A&&"AL"!==A&&"AN"!==A||y++,v[b]=A}if(0===y)return u=!0,l(e,u);-1===r&&(y/p<.3?(u=!0,r=0):(u=!1,r=1));var m=[];for(b=0;b<p;++b)m[b]=r;var N=a(r)?"R":"L",U=N,S=U,x=U;for(b=0;b<p;++b)"NSM"===v[b]?v[b]=x:x=v[b];x=U;var w;for(b=0;b<p;++b)w=v[b],"EN"===w?v[b]="AL"===x?"AN":"EN":"R"!==w&&"L"!==w&&"AL"!==w||(x=w);for(b=0;b<p;++b)"AL"===(w=v[b])&&(v[b]="R");for(b=1;b<p-1;++b)"ES"===v[b]&&"EN"===v[b-1]&&"EN"===v[b+1]&&(v[b]="EN"),"CS"!==v[b]||"EN"!==v[b-1]&&"AN"!==v[b-1]||v[b+1]!==v[b-1]||(v[b]=v[b-1]);for(b=0;b<p;++b)if("EN"===v[b]){var B;for(B=b-1;B>=0&&"ET"===v[B];--B)v[B]="EN";for(B=b+1;B<p&&"ET"===v[B];++B)v[B]="EN"}for(b=0;b<p;++b)"WS"!==(w=v[b])&&"ES"!==w&&"ET"!==w&&"CS"!==w||(v[b]="ON");for(x=U,b=0;b<p;++b)w=v[b],"EN"===w?v[b]="L"===x?"L":"EN":"R"!==w&&"L"!==w||(x=w);for(b=0;b<p;++b)if("ON"===v[b]){var M=o(v,b+1,"ON"),_=U;b>0&&(_=v[b-1]);var O=S;M+1<p&&(O=v[M+1]),"L"!==_&&(_="R"),"L"!==O&&(O="R"),_===O&&s(v,b,M,_),b=M-1}for(b=0;b<p;++b)"ON"===v[b]&&(v[b]=N);for(b=0;b<p;++b)w=v[b],n(m[b])?"R"===w?m[b]+=1:"AN"!==w&&"EN"!==w||(m[b]+=2):"L"!==w&&"AN"!==w&&"EN"!==w||(m[b]+=1);var k,E=-1,C=99;for(b=0,g=m.length;b<g;++b)k=m[b],E<k&&(E=k),C>k&&a(k)&&(C=k);for(k=E;k>=C;--k){var I=-1;for(b=0,g=m.length;b<g;++b)m[b]<k?I>=0&&(i(d,h,I,b),I=-1):I<0&&(I=b);I>=0&&i(d,h,I,m.length)}for(b=0,g=d.length;b<g;++b){var z=d[b];"<"!==z&&">"!==z||(d[b]="")}return l(d.join(""),u)}t.d(r,"a",function(){return u});var f=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],c=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"],d=[],v=[],h=[]},function(e,r,t){"use strict";var a=t(7);t.d(r,"a",function(){return o});var n=a.a,o={};o.parse=function(e){var r=o._bin,t=new Uint8Array(e),a=0;r.readFixed(t,a);a+=4;var n=r.readUshort(t,a);a+=2;r.readUshort(t,a);a+=2;r.readUshort(t,a);a+=2;r.readUshort(t,a);a+=2;for(var s=["cmap","head","hhea","maxp","hmtx","kern","GPOS","GSUB"],i={_data:t},l={},u=0,f=0;f<n;f++){var c=r.readASCII(t,a,4);a+=4;r.readUint(t,a);a+=4;var d=r.readUint(t,a);a+=4;var v=r.readUint(t,a);a+=4,l[c]={offset:d,length:v},u=d+v}for(var f=0;f<s.length;f++){var h=s[f];l[h]&&(i[h.trim()]=o[h.trim()].parse(t,l[h].offset,l[h].length,i))}return i._tabs=l,o._processGlyphs(t,u,l,i),i},o._processGlyphs=function(e,r,t,a){var n=e[r];r+=1;var s=e[r]<<8|e[r+1];r+=2;var i=e[r]<<8|e[r+1];r+=2;var l=e[r];r+=1;var u=e[r];r+=1,a.version=n,a.textureLX=s,a.textureLY=i,a.size=l,a.cly=1.5*l,a.flags=u;var f=new Array(a.maxp.numGlyphs),c=1/s,d=1/i,v=s>256?7:6,h=r+a.maxp.numGlyphs*v,p=e[h]<<8|e[h+1],b=new Array(p);h+=2;for(var g=0,y=p;g<y;g++)b[g]=e[h+2*g]<<8|e[h+2*g+1];var L=0;for(g=0,y=a.maxp.numGlyphs;g<y;g++)g==b[L]&&L++,f[g]=o._processGlyph(e,r,c,d,s,a,g,L),r+=v;a.glyphs=f},o._processGlyph=function(e,r,t,a,n,o,s,i){var l=e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3],u=l>>22&63,f=l>>16&63,c=(l>>9&63)*(l>>15&1?-1:1),d=-(l>>2&63)*(l>>8&1?-1:1),v=(3&l)+4*i;l=n>256?e[r+4]<<16|e[r+5]<<8|e[r+6]:e[r+4]<<8|e[r+5];var h,p,b=o.size/.75/o.head.unitsPerEm*.75,g=o.hmtx.aWidth[s]*b;switch(n){case 2048:h=l>>11&2047,p=2047&l;break;case 1024:h=l>>10&1023,p=1023&l;break;case 512:h=l>>9&511,p=511&l;break;default:h=l>>8&255,p=255&l}return{u1:h*t,v1:p*a+v,u2:(h+u)*t,v2:(p+f)*a+v,lx:u,ly:f,sx:c,sy:d,step:g,plane:v}},o._tabOffset=function(e,r){for(var t=o._bin,a=t.readUshort(e,4),n=12,s=0;s<a;s++){var i=t.readASCII(e,n,4);n+=4;t.readUint(e,n);n+=4;var l=t.readUint(e,n);n+=4;t.readUint(e,n);if(n+=4,i==r)return l}return 0},o._bin={readFixed:function(e,r){return(e[r]<<8|e[r+1])+(e[r+2]<<8|e[r+3])/65540},readF2dot14:function(e,r){var t=o._bin.readShort(e,r);return t/16384},readInt:function(e,r){var t=o._bin.t.uint8;return t[0]=e[r+3],t[1]=e[r+2],t[2]=e[r+1],t[3]=e[r],o._bin.t.int32[0]},readInt8:function(e,r){return o._bin.t.uint8[0]=e[r],o._bin.t.int8[0]},readShort:function(e,r){var t=o._bin.t.uint8;return t[1]=e[r],t[0]=e[r+1],o._bin.t.int16[0]},readUshort:function(e,r){return e[r]<<8|e[r+1]},readUshorts:function(e,r,t){for(var a=[],n=0;n<t;n++)a.push(o._bin.readUshort(e,r+2*n));return a},readUint:function(e,r){var t=o._bin.t.uint8;return t[3]=e[r],t[2]=e[r+1],t[1]=e[r+2],t[0]=e[r+3],o._bin.t.uint32[0]},readUint64:function(e,r){return 4294967296*o._bin.readUint(e,r)+o._bin.readUint(e,r+4)},readASCII:function(e,r,t){for(var a="",n=0;n<t;n++)a+=String.fromCharCode(e[r+n]);return a},readUnicode:function(e,r,t){for(var a="",n=0;n<t;n++){var o=e[r++]<<8|e[r++];a+=String.fromCharCode(o)}return a},readBytes:function(e,r,t){for(var a=[],n=0;n<t;n++)a.push(e[r+n]);return a},readASCIIArray:function(e,r,t){for(var a=[],n=0;n<t;n++)a.push(String.fromCharCode(e[r+n]));return a}},o._bin.t={buff:new ArrayBuffer(8)},o._bin.t.int8=new Int8Array(o._bin.t.buff),o._bin.t.uint8=new Uint8Array(o._bin.t.buff),o._bin.t.int16=new Int16Array(o._bin.t.buff),o._bin.t.uint16=new Uint16Array(o._bin.t.buff),o._bin.t.int32=new Int32Array(o._bin.t.buff),o._bin.t.uint32=new Uint32Array(o._bin.t.buff),o._lctf={},o._lctf.parse=function(e,r,t,a,n){var s=o._bin,i={},l=r;s.readFixed(e,r);r+=4;var u=s.readUshort(e,r);r+=2;var f=s.readUshort(e,r);r+=2;var c=s.readUshort(e,r);return r+=2,i.scriptList=o._lctf.readScriptList(e,l+u),i.featureList=o._lctf.readFeatureList(e,l+f),i.lookupList=o._lctf.readLookupList(e,l+c,n),i},o._lctf.readLookupList=function(e,r,t){var a=o._bin,n=r,s=[],i=a.readUshort(e,r);r+=2;for(var l=0;l<i;l++){var u=a.readUshort(e,r);r+=2;var f=o._lctf.readLookupTable(e,n+u,t);s.push(f)}return s},o._lctf.readLookupTable=function(e,r,t){var a=o._bin,n=r,s={tabs:[]};s.ltype=a.readUshort(e,r),r+=2,s.flag=a.readUshort(e,r),r+=2;var i=a.readUshort(e,r);r+=2;for(var l=0;l<i;l++){var u=a.readUshort(e,r);r+=2;var f=t(e,s.ltype,n+u);s.tabs.push(f)}return s},o._lctf.numOfOnes=function(e){for(var r=0,t=0;t<32;t++)0!=(e>>>t&1)&&r++;return r},o._lctf.readClassDef=function(e,r){var t=o._bin,a={start:[],end:[],class:[]},n=t.readUshort(e,r);if(r+=2,1==n){var s=t.readUshort(e,r);r+=2;var i=t.readUshort(e,r);r+=2;for(var l=0;l<i;l++)a.start.push(s+l),a.end.push(s+l),a.class.push(t.readUshort(e,r)),r+=2}if(2==n){var u=t.readUshort(e,r);r+=2;for(var l=0;l<u;l++)a.start.push(t.readUshort(e,r)),r+=2,a.end.push(t.readUshort(e,r)),r+=2,a.class.push(t.readUshort(e,r)),r+=2}return a},o._lctf.readValueRecord=function(e,r,t){var a=o._bin,n=[];return n.push(1&t?a.readShort(e,r):0),r+=1&t?2:0,n.push(2&t?a.readShort(e,r):0),r+=2&t?2:0,n.push(4&t?a.readShort(e,r):0),r+=4&t?2:0,n.push(8&t?a.readShort(e,r):0),r+=8&t?2:0,n},o._lctf.readCoverage=function(e,r){var t=o._bin,a={};a.fmt=t.readUshort(e,r),r+=2;var n=t.readUshort(e,r);return r+=2,1==a.fmt&&(a.tab=t.readUshorts(e,r,n)),2==a.fmt&&(a.tab=t.readUshorts(e,r,3*n)),a},o._lctf.coverageIndex=function(e,r){var t=e.tab;if(1==e.fmt)return t.indexOf(r);for(var a=0;a<t.length;a+=3){var n=t[a],o=t[a+1],s=t[a+2];if(n<=r&&r<=o)return s+(r-n)}return-1},o._lctf.readFeatureList=function(e,r){var t=o._bin,a=r,n=[],s=t.readUshort(e,r);r+=2;for(var i=0;i<s;i++){var l=t.readASCII(e,r,4);r+=4;var u=t.readUshort(e,r);r+=2,n.push({tag:l.trim(),tab:o._lctf.readFeatureTable(e,a+u)})}return n},o._lctf.readFeatureTable=function(e,r){var t=o._bin;t.readUshort(e,r);r+=2;var a=t.readUshort(e,r);r+=2;for(var n=[],s=0;s<a;s++)n.push(t.readUshort(e,r+2*s));return n},o._lctf.readScriptList=function(e,r){var t=o._bin,a=r,n={},s=t.readUshort(e,r);r+=2;for(var i=0;i<s;i++){var l=t.readASCII(e,r,4);r+=4;var u=t.readUshort(e,r);r+=2,n[l.trim()]=o._lctf.readScriptTable(e,a+u)}return n},o._lctf.readScriptTable=function(e,r){var t=o._bin,a=r,n={},s=t.readUshort(e,r);r+=2,n.default=o._lctf.readLangSysTable(e,a+s);var i=t.readUshort(e,r);r+=2;for(var l=0;l<i;l++){var u=t.readASCII(e,r,4);r+=4;var f=t.readUshort(e,r);r+=2,n[u.trim()]=o._lctf.readLangSysTable(e,a+f)}return n},o._lctf.readLangSysTable=function(e,r){var t=o._bin,a={};t.readUshort(e,r);r+=2,a.reqFeature=t.readUshort(e,r),r+=2;var n=t.readUshort(e,r);return r+=2,a.features=t.readUshorts(e,r,n),a},o.cmap={},o.cmap.parse=function(e,r,t){e=new Uint8Array(e.buffer,r,t),r=0;var a=o._bin,n={};a.readUshort(e,r);r+=2;var s=a.readUshort(e,r);r+=2;var i=[];n.tables=[];for(var l=0;l<s;l++){var u=a.readUshort(e,r);r+=2;var f=a.readUshort(e,r);r+=2;var c=a.readUint(e,r);r+=4;var d="p"+u+"e"+f,v=i.indexOf(c);if(-1==v){v=n.tables.length;var h;i.push(c);var p=a.readUshort(e,c);0==p?h=o.cmap.parse0(e,c):4==p?h=o.cmap.parse4(e,c):6==p?h=o.cmap.parse6(e,c):12==p?h=o.cmap.parse12(e,c):console.log("unknown format: "+p,u,f,c),n.tables.push(h)}if(null!=n[d])throw"multiple tables for one platform+encoding";n[d]=v}return n},o.cmap.parse0=function(e,r){var t=o._bin,a={};a.format=t.readUshort(e,r),r+=2;var n=t.readUshort(e,r);r+=2;t.readUshort(e,r);r+=2,a.map=[];for(var s=0;s<n-6;s++)a.map.push(e[r+s]);return a},o.cmap.parse4=function(e,r){var t=o._bin,a=r,n={};n.format=t.readUshort(e,r),r+=2;var s=t.readUshort(e,r);r+=2;t.readUshort(e,r);r+=2;var i=t.readUshort(e,r);r+=2;var l=i/2;n.searchRange=t.readUshort(e,r),r+=2,n.entrySelector=t.readUshort(e,r),r+=2,n.rangeShift=t.readUshort(e,r),r+=2,n.endCount=t.readUshorts(e,r,l),r+=2*l,r+=2,n.startCount=t.readUshorts(e,r,l),r+=2*l,n.idDelta=[];for(var u=0;u<l;u++)n.idDelta.push(t.readShort(e,r)),r+=2;for(n.idRangeOffset=t.readUshorts(e,r,l),r+=2*l,n.glyphIdArray=[];r<a+s;)n.glyphIdArray.push(t.readUshort(e,r)),r+=2;return n},o.cmap.parse6=function(e,r){var t=o._bin,a={};a.format=t.readUshort(e,r),r+=2;t.readUshort(e,r);r+=2;t.readUshort(e,r);r+=2,a.firstCode=t.readUshort(e,r),r+=2;var n=t.readUshort(e,r);r+=2,a.glyphIdArray=[];for(var s=0;s<n;s++)a.glyphIdArray.push(t.readUshort(e,r)),r+=2;return a},o.cmap.parse12=function(e,r){var t=o._bin,a={};a.format=t.readUshort(e,r),r+=2,r+=2;t.readUint(e,r);r+=4;t.readUint(e,r);r+=4;var n=t.readUint(e,r);r+=4,a.groups=[];for(var s=0;s<n;s++){var i=r+12*s,l=t.readUint(e,i+0),u=t.readUint(e,i+4),f=t.readUint(e,i+8);a.groups.push([l,u,f])}return a},o.GPOS={},o.GPOS.parse=function(e,r,t,a){return o._lctf.parse(e,r,t,a,o.GPOS.subt)},o.GPOS.subt=function(e,r,t){if(2!=r)return null;var a=o._bin,n=t,s={};s.format=a.readUshort(e,t),t+=2;var i=a.readUshort(e,t);t+=2,s.coverage=o._lctf.readCoverage(e,i+n),s.valFmt1=a.readUshort(e,t),t+=2,s.valFmt2=a.readUshort(e,t),t+=2;var l=o._lctf.numOfOnes(s.valFmt1),u=o._lctf.numOfOnes(s.valFmt2);if(1==s.format){s.pairsets=[];var f=a.readUshort(e,t);t+=2;for(var c=0;c<f;c++){var d=a.readUshort(e,t);t+=2,d+=n;var v=a.readUshort(e,d);d+=2;for(var h=[],p=0;p<v;p++){var b=a.readUshort(e,d);d+=2;var g,y;0!=s.valFmt1&&(g=o._lctf.readValueRecord(e,d,s.valFmt1),d+=2*l),0!=s.valFmt2&&(y=o._lctf.readValueRecord(e,d,s.valFmt2),d+=2*u),h.push({gid2:b,val1:g,val2:y})}s.pairsets.push(h)}}if(2==s.format){var L=a.readUshort(e,t);t+=2;var A=a.readUshort(e,t);t+=2;var m=a.readUshort(e,t);t+=2;var N=a.readUshort(e,t);t+=2,s.classDef1=o._lctf.readClassDef(e,n+L),s.classDef2=o._lctf.readClassDef(e,n+A),s.matrix=[];for(var c=0;c<m;c++){for(var U=[],p=0;p<N;p++){var g=null,y=null;0!=s.valFmt1&&(g=o._lctf.readValueRecord(e,t,s.valFmt1),t+=2*l),0!=s.valFmt2&&(y=o._lctf.readValueRecord(e,t,s.valFmt2),t+=2*u),U.push({val1:g,val2:y})}s.matrix.push(U)}}return s},o.GSUB={},o.GSUB.parse=function(e,r,t,a){return o._lctf.parse(e,r,t,a,o.GSUB.subt)},o.GSUB.subt=function(e,r,t){var a=o._bin,n=t,s={};if(1!=r&&4!=r)return null;s.fmt=a.readUshort(e,t),t+=2;var i=a.readUshort(e,t);if(t+=2,s.coverage=o._lctf.readCoverage(e,i+n),1==r){if(1==s.fmt)s.delta=a.readShort(e,t),t+=2;else if(2==s.fmt){var l=a.readUshort(e,t);t+=2,s.newg=a.readUshorts(e,t,l),t+=2*s.newg.length}}else if(4==r){s.vals=[];var l=a.readUshort(e,t);t+=2;for(var u=0;u<l;u++){var f=a.readUshort(e,t);t+=2,s.vals.push(o.GSUB.readLigatureSet(e,n+f))}}return s},o.GSUB.readChainSubClassSet=function(e,r){var t=o._bin,a=r,n=[],s=t.readUshort(e,r);r+=2;for(var i=0;i<s;i++){var l=t.readUshort(e,r);r+=2,n.push(o.GSUB.readChainSubClassRule(e,a+l))}return n},o.GSUB.readChainSubClassRule=function(e,r){for(var t=o._bin,a={},n=["backtrack","input","lookahead"],s=0;s<n.length;s++){var i=t.readUshort(e,r);r+=2,1==s&&i--,a[n[s]]=t.readUshorts(e,r,i),r+=2*a[n[s]].length}var i=t.readUshort(e,r);return r+=2,a.subst=t.readUshorts(e,r,2*i),r+=2*a.subst.length,a},o.GSUB.readLigatureSet=function(e,r){var t=o._bin,a=r,n=[],s=t.readUshort(e,r);r+=2;for(var i=0;i<s;i++){var l=t.readUshort(e,r);r+=2,n.push(o.GSUB.readLigature(e,a+l))}return n},o.GSUB.readLigature=function(e,r){var t=o._bin,a={chain:[]};a.nglyph=t.readUshort(e,r),r+=2;var n=t.readUshort(e,r);r+=2;for(var s=0;s<n-1;s++)a.chain.push(t.readUshort(e,r)),r+=2;return a},o.head={},o.head.parse=function(e,r,t){var a=o._bin,n={};a.readFixed(e,r);r+=4,n.fontRevision=a.readFixed(e,r),r+=4;a.readUint(e,r);r+=4;a.readUint(e,r);return r+=4,n.flags=a.readUshort(e,r),r+=2,n.unitsPerEm=a.readUshort(e,r),r+=2,n.created=a.readUint64(e,r),r+=8,n.modified=a.readUint64(e,r),r+=8,n.xMin=a.readShort(e,r),r+=2,n.yMin=a.readShort(e,r),r+=2,n.xMax=a.readShort(e,r),r+=2,n.yMax=a.readShort(e,r),r+=2,n.macStyle=a.readUshort(e,r),r+=2,n.lowestRecPPEM=a.readUshort(e,r),r+=2,n.fontDirectionHint=a.readShort(e,r),r+=2,n.indexToLocFormat=a.readShort(e,r),r+=2,n.glyphDataFormat=a.readShort(e,r),r+=2,n},o.hhea={},o.hhea.parse=function(e,r,t){var a=o._bin,n={};a.readFixed(e,r);return r+=4,n.ascender=a.readShort(e,r),r+=2,n.descender=a.readShort(e,r),r+=2,n.lineGap=a.readShort(e,r),r+=2,n.advanceWidthMax=a.readUshort(e,r),r+=2,n.minLeftSideBearing=a.readShort(e,r),r+=2,n.minRightSideBearing=a.readShort(e,r),r+=2,n.xMaxExtent=a.readShort(e,r),r+=2,n.caretSlopeRise=a.readShort(e,r),r+=2,n.caretSlopeRun=a.readShort(e,r),r+=2,n.caretOffset=a.readShort(e,r),r+=2,r+=8,n.metricDataFormat=a.readShort(e,r),r+=2,n.numberOfHMetrics=a.readUshort(e,r),r+=2,n},o.hmtx={},o.hmtx.parse=function(e,r,t,a){var n=o._bin,s={};s.aWidth=[],s.lsBearing=[];for(var i=0,l=0,u=0;u<a.maxp.numGlyphs;u++)u<a.hhea.numberOfHMetrics&&(i=n.readUshort(e,r),r+=2,l=n.readShort(e,r),r+=2),s.aWidth.push(i),s.lsBearing.push(l);return s},o.kern={},o.kern.parse=function(e,r,t,a){var n=o._bin,s=n.readUshort(e,r);if(r+=2,1==s)return o.kern.parseV1(e,r-2,t,a);var i=n.readUshort(e,r);r+=2;for(var l={glyph1:[],rval:[]},u=0;u<i;u++){r+=2;var t=n.readUshort(e,r);r+=2;var f=n.readUshort(e,r);r+=2;var c=f>>>8;if(0!=(c&=15))throw"unknown kern table format: "+c;r=o.kern.readFormat0(e,r,l)}return l},o.kern.parseV1=function(e,r,t,a){var n=o._bin;n.readFixed(e,r);r+=4;var s=n.readUint(e,r);r+=4;for(var i={glyph1:[],rval:[]},l=0;l<s;l++){n.readUint(e,r);r+=4;var u=n.readUshort(e,r);r+=2;n.readUshort(e,r);r+=2;var f=u>>>8;if(0!=(f&=15))throw"unknown kern table format: "+f;r=o.kern.readFormat0(e,r,i)}return i},o.kern.readFormat0=function(e,r,t){var a=o._bin,n=-1,s=a.readUshort(e,r);r+=2;a.readUshort(e,r);r+=2;a.readUshort(e,r);r+=2;a.readUshort(e,r);r+=2;for(var i=0;i<s;i++){var l=a.readUshort(e,r);r+=2;var u=a.readUshort(e,r);r+=2;var f=a.readShort(e,r);r+=2,l!=n&&(t.glyph1.push(l),t.rval.push({glyph2:[],vals:[]}));var c=t.rval[t.rval.length-1];c.glyph2.push(u),c.vals.push(f),n=l}return r},o.maxp={},o.maxp.parse=function(e,r,t){var a=o._bin,n={},s=a.readUint(e,r);return r+=4,n.numGlyphs=a.readUshort(e,r),r+=2,65536==s&&(n.maxPoints=a.readUshort(e,r),r+=2,n.maxContours=a.readUshort(e,r),r+=2,n.maxCompositePoints=a.readUshort(e,r),r+=2,n.maxCompositeContours=a.readUshort(e,r),r+=2,n.maxZones=a.readUshort(e,r),r+=2,n.maxTwilightPoints=a.readUshort(e,r),r+=2,n.maxStorage=a.readUshort(e,r),r+=2,n.maxFunctionDefs=a.readUshort(e,r),r+=2,n.maxInstructionDefs=a.readUshort(e,r),r+=2,n.maxStackElements=a.readUshort(e,r),r+=2,n.maxSizeOfInstructions=a.readUshort(e,r),r+=2,n.maxComponentElements=a.readUshort(e,r),r+=2,n.maxComponentDepth=a.readUshort(e,r),r+=2),n},o.U={},o.U.codeToGlyph=function(e,r){var t=e.cmap,a=-1;if(null!=t.p0e4?a=t.p0e4:null!=t.p3e1?a=t.p3e1:null!=t.p1e0&&(a=t.p1e0),-1==a)throw"no familiar platform and encoding!";var n=t.tables[a];if(0==n.format)return r>=n.map.length?0:n.map[r];if(4==n.format){for(var o=-1,s=0;s<n.endCount.length;s++)if(r<=n.endCount[s]){o=s;break}if(-1==o)return 0;if(n.startCount[o]>r)return 0;return 65535&(0!=n.idRangeOffset[o]?n.glyphIdArray[r-n.startCount[o]+(n.idRangeOffset[o]>>1)-(n.idRangeOffset.length-o)]:r+n.idDelta[o])}if(12==n.format){if(r>n.groups[n.groups.length-1][1])return 0;for(var s=0;s<n.groups.length;s++){var i=n.groups[s];if(i[0]<=r&&r<=i[1])return i[2]+(r-i[0])}return 0}throw"unknown cmap table format "+n.format},o.U._getGlyphClass=function(e,r){for(var t=0;t<r.start.length;t++)if(r.start[t]<=e&&r.end[t]>=e)return r.class[t];return 0},o.U.getPairAdjustment=function(e,r,t){if(e.GPOS){for(var a=null,n=0;n<e.GPOS.featureList.length;n++){var s=e.GPOS.featureList[n];if("kern"==s.tag)for(var i=0;i<s.tab.length;i++)2==e.GPOS.lookupList[s.tab[i]].ltype&&(a=e.GPOS.lookupList[s.tab[i]])}if(a)for(var n=0;n<a.tabs.length;n++){var l=a.tabs[n],u=o._lctf.coverageIndex(l.coverage,r);if(-1!=u){var f=0;if(1==l.format){for(var c=l.pairsets[u],i=0;i<c.length;i++)c[i].gid2==t&&(f=c[i]);if(null==f)continue}else if(2==l.format){var d=o.U._getGlyphClass(r,l.classDef1),v=o.U._getGlyphClass(t,l.classDef2);f=l.matrix[d][v]}return f.val1[2]}}}if(e.kern){var h=e.kern.glyph1.indexOf(r);if(-1!=h){var p=e.kern.rval[h].glyph2.indexOf(t);if(-1!=p)return e.kern.rval[h].vals[p]}}return 0},o.U.isRTL=function(e){return new RegExp("^[\\0-@[-`{-¿×÷ʹ-˿ -⯿‐-\\u2029 -⯿]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e)},o.U.stringToGlyphs=function(e,r){var t,a,s,i,l,u,f,c,d,v,h,p=[],b=[],g=[],y="",L=\'\\n\\t" ,.:;!?() ،\',A=n(r,-1,!1);for(a=0,s=r.length;a<s;a++)u=r.charCodeAt(a),a<s-2&&(f=r.charCodeAt(a+1),-1==L.indexOf(u)&&4156==f)?(y+=String.fromCharCode(f),y+=String.fromCharCode(u),a++):y+=String.fromCharCode(u);for(r=y,a=0,s=r.length;a<s;a++){for(u=r.charCodeAt(a),i=0,l=e.length;i<l&&(d=e[i],!(t=o.U.codeToGlyph(d,u)));i++);p.push(t),b.push(t?i:0),g.push(u)}d=null;for(var m="آأؤإاةدذرزوٱٲٳٵٶٷڈډڊڋڌڍڎڏڐڑڒړڔڕږڗژڙۀۃۄۅۆۇۈۉۊۋۍۏےۓەۮۯܐܕܖܗܘܙܞܨܪܬܯݍݙݚݛݫݬݱݳݴݸݹࡀࡆࡇࡉࡔࡧࡩࡪࢪࢫࢬࢮࢱࢲࢹૅેૉૐૡ૯ஃஅஉஎஏனப",N="ꡲ્",U=0;U<p.length;U++){var S=p[U];if(d!=b[U]){if(d=e[b[U]],!(c=d.GSUB))continue;v=c.lookupList,h=c.featureList}if(c){var x=0==U||-1!=L.indexOf(r[U-1]),w=U==p.length-1||-1!=L.indexOf(r[U+1]);x||-1==m.indexOf(r[U-1])||(x=!0),w||-1==m.indexOf(r[U])||(w=!0),w||-1==N.indexOf(r[U+1])||(w=!0),x||-1==N.indexOf(r[U])||(x=!0);var B=null;B=x?w?"isol":"init":w?"fina":"medi";for(var M=0;M<h.length;M++)if(h[M].tag==B)for(var _=0;_<h[M].tab.length;_++){var O=v[h[M].tab[_]];if(1==O.ltype)for(var i=0;i<O.tabs.length;i++){var k=O.tabs[i],E=o._lctf.coverageIndex(k.coverage,S);-1!=E&&(0==k.fmt?p[U]=E+k.delta:k.newg?p[U]=k.newg[E]:(p[U]=S,console.log(U,S,"subst-error",h[M].tag,a,i," original:",r)))}}}}for(var C=["rlig","liga"],U=0;U<p.length;U++){var S=p[U],I=Math.min(3,p.length-U-1);if(c){if(d!=b[U]){if(d=e[b[U]],!(c=d.GSUB))continue;v=c.lookupList,h=c.featureList}for(var M=0;M<h.length;M++){var z=h[M];if(-1!=C.indexOf(z.tag))for(var _=0;_<z.tab.length;_++){var O=v[z.tab[_]];if(4==O.ltype)for(var i=0;i<O.tabs.length;i++){var E=o._lctf.coverageIndex(O.tabs[i].coverage,S);if(-1!=E)for(var F=O.tabs[i].vals[E],j=0;j<F.length;j++){var T=F[j],G=T.chain.length;if(!(G>I)){for(var V=!0,R=0;R<G;R++)T.chain[R]!=p[U+(1+R)]&&(V=!1);if(V){p[U]=T.nglyph;for(var R=0;R<G;R++)p[U+R+1]=-1}}}}}}}}var $=A.indices,X=p.slice(),P=p.slice();for(a=0,s=p.length;a<s;a++)u=$[a],X[a]=p[u],P[a]=g[u];return[X,b,P]}},function(e,r,t){"use strict";function a(e,r,t,a,n,o,s){switch(e){case"line-string":(A(a,"point",r,t)||A(a,"label",r,t))&&S(r,t,a,o,s),U(r,t,a,n,o,s);break;case"point-array":S(r,t,a,n,o,s);break;case"polygon":x(r,t,a,n,o,s)}}function n(e,r,t,a,n){for(var o in b.stylesheetLayers){var i,l,u=b.stylesheetLayers[o],f=u.filter,c=u.reduce;for(C=0,z=0,F=0,i=0,l=r.length;i<l;i++){var d=r[i];d.properties=d.properties||{},d.id&&(d.properties["#id"]=d.id),f&&!N(f,d,a,n,u,"filter",t,0)||(c?(E[C]=d,C++):s(e,d,t,u,i))}if(c){var v=c[1],h=c[2];switch(c[0]){case"top":case"bottom":if("string"==typeof h&&"@"==h.charAt(0)&&void 0===(h=b.stylesheetConstants[h]))break;if("string"==typeof h&&"$"==h.charAt(0)||"object"==typeof h){var p="object"==typeof h;p||(h=h.substr(1)),v>C&&(v=C);var g,y="top"==c[0],L=0,A=y?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;do{var m=y?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;for(F=z,i=0,l=C;i<l;i++)d=E[i],L?g=d.tmp:(g=p?O(u,null,d,t,h,0):parseFloat(d.properties[h]),d.tmp=g),!isNaN(g)&&(y&&g>=m&&g<A||g<=m&&g>A)&&(m!=g&&(z=F),I[z]=d,z++,m=g);A=m,L++}while(L<v)}break;case"odd":case"even":for(i="odd"==c[0]?1:0,l=C;i<l;i+=2)d=E[i],I[z]=d,z++;case"every":for(v>C&&(v=C),i=0,l=C;i<l;i+=v)d=E[i],I[z]=d,z++}for(i=0,l=z;i<l;i++)s(e,I[i],t,u,i)}}}function o(e,r,t,n,o,s){var i,l=A(n,"next-pass",r,t);if(null!=l)for(var u=0,f=l.length;u<f;u++){var c=l[u][0];i=L(l[u][1],e,o);var d=A(i,"visible",r,t);if(d){var v=A(i,"selected-layer",r,t),h=""!=v?L(v,e,o):null,p=A(i,"selected-hover-layer",r,t),g=""!=p?L(p,e,o):null,y=A(i,"hover-layer",r,t),m=""!=y?L(y,e,o):null,N=(null!=m?256:0)|(null!=h?512:0)|(null!=g?1024:0),U=b.hitState;null!=h&&(b.hitState=2|N,a(e,r,t,h,o,c,s)),null!=g&&(b.hitState=3|N,a(e,r,t,g,o,c,s)),null!=m&&(b.hitState=1|N,a(e,r,t,m,o,c,s)),a(e,r,t,i,o,c,s),b.hitState=U}}}function s(e,r,t,n,s){var i=A(n,"visible",r,t),l=A(n,"z-index",r,t);if(i){if(A(n,"export-geometry",r,t)&&void 0!==r.id&&!k[r]){switch(e){case"line-string":w(r);break;case"point-array":B(r)}k[r]=!0}var u=r.properties,f=A(n,"selected-layer",r,t),c=""!=f?L(f,e,s):null,d=A(n,"selected-hover-layer",r,t),v=""!=d?L(d,e,s):null,h=A(n,"hover-layer",r,t),p=""!=h?L(h,e,s):null,g=(null!=p?256:0)|(null!=c?512:0)|(null!=v?1024:0);null!=c&&(b.hitState=2|g,a(e,r,t,c,s,l,u),o(e,r,t,c,s,u)),null!=v&&(b.hitState=3|g,a(e,r,t,v,s,l,u),o(e,r,t,v,s,u)),null!=p&&(b.hitState=1|g,a(e,r,t,p,s,l,u),o(e,r,t,p,s,u)),b.hitState=0|g,a(e,r,t,n,s,l,u),o(e,r,t,n,s,u)}}function i(e,r){var t=e.id||"";b.groupId=t;var a=e.bbox;if(a){var o=a[0],s=a[1];b.bboxMin=o,b.bboxMax=s;var i=[a[1][0]-a[0][0],a[1][1]-a[0][1],a[1][2]-a[0][2]],l=e.resolution||4096;b.groupOrigin=[0,0,0],b.forceScale=[i[0]/l,i[1]/l,i[2]/l],M({command:"beginGroup",id:e.id,bbox:[o,s],origin:o});var u=e.points||[];b.featureType="point",n("point-array",u,r,"point",t);var f=e.lines||[];b.featureType="line",n("line-string",f,r,"line",t);var c=e.polygons||[];b.featureType="polygon",n("polygon",c,r,"polygon",t),M({command:"endGroup"}),b.groupOptimize&&_()}}function l(e,r){if("string"==typeof e)try{var t=JSON.parse(e)}catch(e){t=null}else t=e;if(t)for(var a=t.groups||[],n=0,o=a.length;n<o;n++)i(a[n],r)}Object.defineProperty(r,"__esModule",{value:!0});var u=t(0),f=t(3),c=t(2),d=t(4),v=t(5),h=t(6),p=t(1),b=u.a,g=f.a,y=f.b,L=c.a,A=c.b,m=c.c,N=c.d,U=d.a,S=v.a,x=h.a,w=d.b,B=v.b,M=p.a,_=p.b,O=c.e,k=[],E=new Array(1024),C=0,I=new Array(1024),z=0,F=0;self.onmessage=function(e){var r=e.data,t=r.command,a=r.data;switch(t){case"setStylesheet":a&&(b.geocent=a.geocent,b.metricUnits=a.metric,m(a.data)),postMessage({command:"ready"});break;case"setFont":g(a),postMessage({command:"ready"});break;case"setFontMap":y(a),postMessage({command:"styleDone"}),postMessage({command:"ready"});break;case"processGeodata":b.tileLod=r.lod||0,b.tileSize=r.tileSize||1,a=JSON.parse(a),k=[],l(a,b.tileLod),b.groupOptimize&&_(),postMessage({command:"allProcessed"}),postMessage({command:"ready"})}}}]);',null)}},function(t,e,i){"use strict";var r=function(t){this.inspector=t,this.core=t.core};r.prototype.init=function(){var t=this.inspector;t.addStyle('#vts-graphs-panel {position:absolute;left:10px;top:10px;z-index: 7;background-color: #FFFFFF;padding: 5px;border-radius: 4px;font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;color:#000000;text-align: left;font-size: 12px;display:none;}.vts-graphs-canvas {border: solid 1px #bbb;image-rendering : pixelated;}.vts-graphs-info {padding: 5px 2px;font-size: 10px;}.vts-graphs-button {padding: 2px 5px;display:inline-block;margin-right: 4px;border-radius: 4px;cursor:pointer;}.vts-graphs-button:hover {box-shadow: 0 0 1px #0066ff;}'),this.element=document.createElement("div"),this.element.id="vts-graphs-panel",this.element.innerHTML='<canvas id="vts-graphs-render" class="vts-graphs-canvas" width="900" height="100" ></canvas><div id="vts-graphs-info" class="vts-graphs-info" >◼ Frame: 1234   <span style="color:#ff0000">◼</span> Render: 1234   <span style="color:#0000ff">◼</span> Textures: 1234   <span style="color:#005500">◼</span> Mesh: 1234   <span style="color:#00bb00">◼</span> GpuMesh: 1234</div><canvas id="vts-graphs-cache" class="vts-graphs-canvas" width="900" height="100" ></canvas><div id="vts-graphs-info2" class="vts-graphs-info" >◼ Cache: 1234   <span style="color:#ff0000">◼</span> Used: 123   <span style="color:#0000ff">◼</span> Textures: 1234   <span style="color:#00bb00">◼</span> Mesh:   1234</div><div id="vts-graphs-rec" class="vts-graphs-button" >Recording On</div><div id="vts-graphs-ref" class="vts-graphs-button" >Refresh On</div><div id="vts-graphs-res" class="vts-graphs-button" >Reset</div><div id="vts-graphs-zoom" class="vts-graphs-button" >Scale: Max value</div><div id="vts-graphs-magnify" class="vts-graphs-button" >Magnify Off</div><div id="vts-graphs-graph" class="vts-graphs-button" >Graph: Cache</div>',this.core.element.appendChild(this.element),this.canvasRender=document.getElementById("vts-graphs-render"),this.canvasCache=document.getElementById("vts-graphs-cache"),this.canvasRenderCtx=this.canvasRender.getContext("2d"),this.canvasCacheCtx=this.canvasCache.getContext("2d"),document.getElementById("vts-graphs-rec").onclick=this.recordingPressed.bind(this),document.getElementById("vts-graphs-rec").onclick=this.recordingPressed.bind(this),document.getElementById("vts-graphs-ref").onclick=this.refreshPressed.bind(this),document.getElementById("vts-graphs-res").onclick=this.resetPressed.bind(this),document.getElementById("vts-graphs-zoom").onclick=this.zoomPressed.bind(this),document.getElementById("vts-graphs-magnify").onclick=this.magnifyPressed.bind(this),document.getElementById("vts-graphs-graph").onclick=this.graphPressed.bind(this),document.getElementById("vts-graphs-render").onmousemove=this.onMouseMove.bind(this),document.getElementById("vts-graphs-render").onmouseout=this.onMouseOut.bind(this),document.getElementById("vts-graphs-cache").onmousemove=this.onMouseMove.bind(this),document.getElementById("vts-graphs-cache").onmouseout=this.onMouseOut.bind(this),this.element.addEventListener("mouseup",t.doNothing.bind(this),!0),this.element.addEventListener("mousedown",t.doNothing.bind(this),!0),this.element.addEventListener("mousewheel",t.doNothing.bind(this),!1),this.element.addEventListener("dblclick",t.doNothing.bind(this),!1),this.zoom="max",this.graph="Cache",this.refresh=!0,this.panelVisible=!1},r.prototype.showPanel=function(){this.element.style.display="block",this.panelVisible=!0,this.recordingPressed(!0)},r.prototype.hidePanel=function(){this.element.style.display="none",this.panelVisible=!1,this.recordingPressed(!0)},r.prototype.switchPanel=function(){this.panelVisible?this.hidePanel():this.showPanel()},r.prototype.recordingPressed=function(t){var e=this.core.getMap();e&&(e.stats.recordGraphs=null==t?t:!e.stats.recordGraphs,this.updateGraphsPanel(),this.updateGraphs(null,!0))},r.prototype.refreshPressed=function(){this.refresh=!this.refresh,this.updateGraphsPanel(),this.updateGraphs()},r.prototype.resetPressed=function(){var t=this.core.getMap();t&&(t.stats.resetGraphs(),this.updateGraphs(null,!0))},r.prototype.zoomPressed=function(){switch(this.zoom){case"max":this.zoom="120avrg";break;case"120avrg":this.zoom="180avrg";break;case"180avrg":this.zoom="max"}this.updateGraphsPanel(),this.updateGraphs()},r.prototype.graphPressed=function(){switch(this.graph){case"Cache":this.graph="Polygons";break;case"Polygons":this.graph="Processing";break;case"Processing":this.graph="LODs";break;case"LODs":this.graph="Flux";break;case"Flux":this.graph="Cache"}this.updateGraphsPanel(),this.updateGraphs()},r.prototype.magnifyPressed=function(){this.magnify=!this.magnify,this.magnify?(this.canvasRender.style.width="1400px",this.canvasRender.style.height="200px",this.canvasCache.style.width="1400px",this.canvasCache.style.height="200px",document.getElementById("vts-graphs-magnify").innerHTML="Magnify On"):(this.canvasRender.style.width="900px",this.canvasRender.style.height="100px",this.canvasCache.style.width="900px",this.canvasCache.style.height="100px",document.getElementById("vts-graphs-magnify").innerHTML="Magnify Off"),this.updateGraphsPanel(),this.updateGraphs()},r.prototype.updateGraphsPanel=function(){var t=this.core.getMap();if(t){switch(t.stats.recordGraphs?document.getElementById("vts-graphs-rec").innerHTML="Recording On":document.getElementById("vts-graphs-rec").innerHTML="Recording Off",this.refresh?document.getElementById("vts-graphs-ref").innerHTML="Refresh On":document.getElementById("vts-graphs-ref").innerHTML="Refresh Off",this.zoom){case"max":document.getElementById("vts-graphs-zoom").innerHTML="Scale: Max value";break;case"120avrg":document.getElementById("vts-graphs-zoom").innerHTML="Scale: 100% Avrg";break;case"180avrg":document.getElementById("vts-graphs-zoom").innerHTML="Scale: 50% Avrg"}document.getElementById("vts-graphs-graph").innerHTML="Graph: "+this.graph}},r.prototype.onMouseMove=function(t){var e=t.clientX-this.canvasRender.getBoundingClientRect().left;this.showCursor=!0,this.magnify&&(e=Math.floor(900*e/1400)),this.cursorIndex=e;var i=this.core.getMap();i&&(i.stats.recordGraphs||this.updateGraphs(null))},r.prototype.onMouseOut=function(){this.showCursor=!1,this.updateGraphs(null)},r.prototype.updateGraphs=function(t,e){var i=this.core.getMap();if(i&&(this.refresh||e)&&this.panelVisible){t=t||i.stats;var r=this.canvasRender.width,s=this.canvasRender.height,a=this.canvasRenderCtx,n=t.graphsTimeSamples,o=t.graphsTimeIndex,h=r/n;a.clearRect(0,0,r,s);var l,u,c,d,p,f,g,m,v,y,b,x,M=0,w=0,S=0,A=0,C=0,T=0,P=0,E=t.graphsFrameTimes,L=t.graphsRenderTimes,k=t.graphsCreateTextureTimes,I=t.graphsCreateMeshTimes,N=t.graphsCreateGpuMeshTimes;for(l=0;l<n;l++){w+=E[l],S+=L[l],A+=k[l],C+=I[l],T+=N[l];var F=E[l];F>M&&(M=F),F>0&&P++}for("120avrg"==this.zoom&&(M=w/P*1),"180avrg"==this.zoom&&(M=w/P*.5),v=s/M,l=0;l<n;l++)d=o+l,d%=n,a.fillStyle="#000000",a.fillRect(l*h,s,1,-E[d]*v),a.fillStyle="#ff0000",a.fillRect(l*h,s,1,-L[d]*v),a.fillStyle="#0000ff",a.fillRect(l*h,s,1,-k[d]*v),m=s-k[d]*v,a.fillStyle="#007700",a.fillRect(l*h,m,1,-I[d]*v),m-=I[d]*v,a.fillStyle="#00ff00",a.fillRect(l*h,m,1,-N[d]*v);switch(this.showCursor?(a.fillStyle="#aa00aa",d=this.cursorIndex%n,a.fillRect(Math.floor(d*h)-1,0,1,s),a.fillRect(Math.floor(d*h)+1,0,1,s),d=(this.cursorIndex+o)%n,g="◼ Frame: "+E[d].toFixed(2)+'   <span style="color:#ff0000">◼</span> Render: '+L[d].toFixed(2)+'   <span style="color:#0000ff">◼</span> Textures: '+k[d].toFixed(2)+'   <span style="color:#005500">◼</span> Meshes: '+I[d].toFixed(2)+'   <span style="color:#00bb00">◼</span> GpuMeshes: '+N[d].toFixed(2)+"</div>"):g="◼ Frame: "+Math.round(w)+'   <span style="color:#ff0000">◼</span> Render: '+Math.round(S)+'   <span style="color:#0000ff">◼</span> Textures: '+Math.round(A)+'   <span style="color:#005500">◼</span> Meshes: '+Math.round(C)+'   <span style="color:#00bb00">◼</span> GpuMeshes: '+Math.round(T)+"</div>",document.getElementById("vts-graphs-info").innerHTML=g,r=this.canvasCache.width,s=this.canvasCache.height,a=this.canvasCacheCtx,h=r/n,a.clearRect(0,0,r,s),this.graph){case"Cache":v=s/(i.gpuCache.maxCost+i.resourcesCache.maxCost+i.metatileCache.maxCost);var B=0,R=0,_=0,D=0,U=0,z=0,G=t.graphsCpuMemoryMetatiles,V=t.graphsCpuMemoryUsed,O=t.graphsGpuMemoryRender;for(x=t.graphsGpuMemoryGeodata,k=t.graphsGpuMemoryTextures,I=t.graphsGpuMemoryMeshes,l=0;l<n;l++)B=G[l]>B?G[l]:B,R=V[l]>R?V[l]:R,_=k[l]>_?k[l]:_,D=I[l]>D?I[l]:D,U=x[l]>U?x[l]:U,z=O[l]>z?O[l]:z;for(l=0;l<n;l++)d=o+l,d%=n,p=G[d]+I[d]+k[d]+x[d]+V[d],a.fillStyle="#000000",a.fillRect(l*h,s,1,-p*v),p-=V[d],a.fillStyle="#0000ff",a.fillRect(l*h,s,1,-p*v),p-=k[d],a.fillStyle="#009999",a.fillRect(l*h,s,1,-p*v),p-=x[d],a.fillStyle="#007700",a.fillRect(l*h,s,1,-p*v),p-=I[d],a.fillStyle="#ff0000",a.fillRect(l*h,s,1,-p*v),p=O[d],a.fillStyle="#ffff00",a.fillRect(l*h,s-p*v,1,1);this.showCursor?(d=(this.cursorIndex+o)%n,g='<span style="color:#555">◼</span> Total: '+Math.ceil((G[d]+V[d]+k[d]+I[d])/1048576)+'MB   <span style="color:#000000">◼</span> CPU: '+Math.ceil(V[d]/1048576)+'MB   <span style="color:#000000">◼</span> GPU: '+Math.ceil((k[d]+I[d])/1048576)+'MB   <span style="color:#0000ff">◼</span> Te: '+Math.ceil(k[d]/1048576)+'MB   <span style="color:#005500">◼</span> Me: '+Math.ceil(I[d]/1048576)+'MB   <span style="color:#009999">◼</span> Ge: '+Math.ceil(x[d]/1048576)+'MB   <span style="color:#ff0000">◼</span> Met: '+Math.ceil(G[d]/1048576)+'MB   <span style="color:#ffff00">◼</span> Render: '+Math.ceil(O[d]/1048576)+"MB</div>"):g='<span style="color:#555">◼</span> Total: '+Math.round((B+R+_+D)/1048576)+'MB   <span style="color:#000000">◼</span> CPU: '+Math.ceil(R/1048576)+'MB   <span style="color:#000000">◼</span> GPU: '+Math.ceil((_+D)/1048576)+'MB   <span style="color:#0000ff">◼</span> Te '+Math.ceil(_/1048576)+'MB   <span style="color:#005500">◼</span> Me: '+Math.ceil(D/1048576)+'MB   <span style="color:#009999">◼</span> Ge: '+Math.ceil(U/1048576)+'MB   <span style="color:#ff0000">◼</span> Met: '+Math.ceil(B/1048576)+'MB   <span style="color:#ffff00">◼</span> Render: '+Math.ceil(z/1048576)+"MB</div>";break;case"Polygons":case"Processing":y=0,b=99999999999,P=0,f="Polygons"==this.graph?t.graphsPolygons:t.graphsBuild;var j=0;for(l=0;l<n;l++)y=f[l]>y?f[l]:y,f[l]>0&&(b=f[l]<b?f[l]:b,j+=f[l],P++);for(v=s/y,l=0;l<n;l++)d=o+l,d%=n,a.fillStyle="#007700",a.fillRect(l*h,s,1,-f[d]*v);this.showCursor?(d=(this.cursorIndex+o)%n,g='<span style="color:#007700">◼</span> '+this.graph+" Max: "+Math.round(f[d])+"</div>"):(g='<span style="color:#007700">◼</span> '+this.graph+" Max: "+y+"</div>",g+="   Min: "+b,g+="   Avrg: "+Math.round(j/P)+"</div>");break;case"LODs":for(y=0,f=t.graphsLODs,l=0;l<n;l++)y=f[l][0]>y?f[l][0]:y;v=s/y,a.fillStyle="#000000",a.fillRect(0,0,r,s);var H;for(l=0;l<n;l++)for(d=o+l,d%=n,m=s,H=f[d][1],u=0,c=H.length;u<c;u++)H[u]&&(a.fillStyle="hsl("+23*u%360+",100%,50%)",p=Math.round(H[u]*v),a.fillRect(l*h,m,1,-p),m-=p);if(this.showCursor)for(d=(this.cursorIndex+o)%n,g="LODs:"+f[d][0],H=f[d][1],u=0,c=H.length;u<c;u++)H[u]&&(g+='<span style="color:hsl('+23*u%360+',100%,50%)">◼</span>'+u+":"+H[u]);else g="LODs:"+f[d][0];g+="</div>";break;case"Flux":var q=0,J=0,Z=0,Y=0,W=0,X=0,Q=0,K=0,$=0,tt=0,et=0,it=0,rt=0,st=0;for(k=t.graphsFluxTextures,I=t.graphsFluxMeshes,x=t.graphsFluxGeodatas,l=0;l<n;l++){var at=k[l][0][0]+I[l][0][0];q=at>q?at:q,at=k[l][1][0]+I[l][1][0],q=at>q?at:q,at=k[l][0][1]+I[l][0][1],J=at>J?at:J,at=k[l][1][1]+I[l][1][1],J=at>J?at:J,Z=k[l][0][0]>Z?k[l][0][0]:Z,Y=k[l][0][1]>Y?k[l][0][1]:Y,W=k[l][1][0]>W?k[l][1][0]:W,X=k[l][1][1]?k[l][1][1]:X,Q=I[l][0][0]>Q?I[l][0][0]:Q,K=I[l][0][1]>K?I[l][0][1]:K,$=I[l][1][0]>$?I[l][1][0]:$,tt=I[l][1][1]>tt?I[l][1][1]:tt,et=x[l][0][0]>et?x[l][0][0]:et,it=x[l][0][1]>it?x[l][0][1]:it,rt=x[l][1][0]>rt?x[l][1][0]:rt,st=x[l][1][1]>st?x[l][1][1]:st}v=(.25*s-2)/q;var nt=(.25*s-2)/J,ot=Math.floor(.25*s),ht=Math.floor(.75*s);for(l=0;l<n;l++){d=o+l,d%=n;var lt=ot,ut=ot+1,ct=ht,dt=ht+1;a.fillStyle="#0000aa",a.fillRect(l*h,lt,1,-k[d][0][0]*v),a.fillRect(l*h,ut,1,k[d][1][0]*v),a.fillRect(l*h,ct,1,-k[d][0][1]*nt),a.fillRect(l*h,dt,1,k[d][1][1]*nt),lt-=k[d][0][0]*v,ut+=k[d][1][0]*v,ct-=k[d][0][1]*nt,dt+=k[d][1][1]*nt,a.fillStyle="#007700",a.fillRect(l*h,lt,1,-I[d][0][0]*v),a.fillRect(l*h,ut,1,I[d][1][0]*v),a.fillRect(l*h,ct,1,-I[d][0][1]*nt),a.fillRect(l*h,dt,1,I[d][1][1]*nt),lt-=I[d][0][0]*v,ut+=I[d][1][0]*v,ct-=I[d][0][1]*nt,dt+=I[d][1][1]*nt,a.fillStyle="#009999",a.fillRect(l*h,lt,1,-x[d][0][0]*v),a.fillRect(l*h,ut,1,x[d][1][0]*v),a.fillRect(l*h,ct,1,-x[d][0][1]*nt),a.fillRect(l*h,dt,1,x[d][1][1]*nt),a.fillStyle="#aaaaaa",a.fillRect(0,Math.floor(.5*s),r,1),a.fillStyle="#dddddd",a.fillRect(0,ot,r,1),a.fillRect(0,ht,r,1)}this.showCursor?(d=(this.cursorIndex+o)%n,g='<span style="color:#007700">◼</span> Textures Count +/-: '+k[d][0][0]+"/"+k[d][1][0],g+="   Size +/-: "+(k[d][0][1]/1024/1024).toFixed(2)+"/"+(k[d][1][1]/1024/1024).toFixed(2),g+='   <span style="color:#0000aa">◼</span> Meshes Count +/-: '+I[d][0][0]+"/"+I[d][1][0],g+="   Size +/-: "+(I[d][0][1]/1024/1024).toFixed(2)+"/"+(I[d][1][1]/1024/1024).toFixed(2),g+='   <span style="color:#009999">◼</span> Geodata Count +/-: '+x[d][0][0]+"/"+x[d][1][0],g+="   Size +/-: "+(x[d][0][1]/1024/1024).toFixed(2)+"/"+(x[d][1][1]/1024/1024).toFixed(2),g+="</div>"):(g='<span style="color:#007700">◼</span> Textures Count +/-: '+Z+"/"+W,g+="   Size +/-: "+(Y/1024/1024).toFixed(2)+"/"+(X/1024/1024).toFixed(2),g+='   <span style="color:#0000aa">◼</span> Meshes Count +/-: '+Q+"/"+$,g+="   Size +/-: "+(K/1024/1024).toFixed(2)+"/"+(tt/1024/1024).toFixed(2),g+='   <span style="color:#009999">◼</span> Geodata Count +/-: '+et+"/"+rt,g+="   Size +/-: "+(it/1024/1024).toFixed(2)+"/"+(st/1024/1024).toFixed(2),g+="</div>")}this.showCursor&&(a.fillStyle="#aa00aa",d=this.cursorIndex%n,a.fillRect(Math.floor(d*h)-1,0,1,s),a.fillRect(Math.floor(d*h)+1,0,1,s)),document.getElementById("vts-graphs-info2").innerHTML=g}},e.a=r},function(t,e,i){"use strict";var r=function(t){this.inspector=t,this.core=t.core};r.prototype.init=function(){document.addEventListener("keyup",this.onKeyUp.bind(this),!1),document.addEventListener("keypress",this.onKeyPress.bind(this),!1),document.addEventListener("keydown",this.onKeyDown.bind(this),!1)},r.prototype.onKeyDown=function(t){void 0===t&&(t=window.event),this.altDown=t.altKey,this.ctrlDown=t.ctrlKey,this.shiftDown=t.shiftKey,this.onKeyUp(t,!0)},r.prototype.onKeyPress=function(t){this.onKeyUp(t,!0)},r.prototype.onKeyUp=function(t,e){void 0===t&&(t=window.event);var i=this.core.getMap(),r=this.inspector;if(i){var s=i.draw.debug;this.altDown=t.altKey,this.ctrlDown=t.ctrlKey,this.shiftDown=t.shiftKey;var a=!1,n=!0;if(t){var o;if(o=window.event?window.event.keyCode:t.which?t.which:t.charCode,this.shiftDown&&this.ctrlDown)switch(o){case 68:case 100:r.preventDefault(t)}if(this.shiftDown&&!0!==e){if(this.ctrlDown)switch(o){case 68:case 100:r.enableInspector(),this.diagnosticMode=!0,a=!0}if(this.diagnosticMode){switch(n=!0,o){case 67:case 99:i.config.mapDegradeHorizon=!i.config.mapDegradeHorizon;break;case 49:case 50:case 51:case 48:break;case 72:case 104:s.heightmapOnly=!s.heightmapOnly;break;case 81:case 113:var h=i.getPosition();console.log("pos-before: "+JSON.stringify(h.pos)),i.convert.convertPositionViewMode(h,"obj"==h.getViewMode()?"subj":"obj"),console.log("new mode: "+h.getViewMode()),console.log("pos-after: "+JSON.stringify(h.pos)),i.setPosition(h),this.altDown&&"obj"!=h.getViewMode()?i.camera.near=.1:i.camera.near=2,r.preventDefault(t);break;case 80:case 112:i.renderer.saveScreenshot("file","vts-screenshot.png","png");break;case 83:case 115:r.stats.switchPanel();break;case 86:case 118:r.layers.switchPanel();break;case 69:case 101:r.stylesheets.switchPanel();break;case 84:case 116:r.replay.switchPanel();break;case 66:case 98:s.drawBBoxes=!s.drawBBoxes;break;case 87:case 119:var l=s.drawWireframe+1;s.drawWireframe=l>2?0:l;break;case 70:case 102:s.drawWireframe=3!=s.drawWireframe?3:0;break;case 77:case 109:i.loaderSuspended=!i.loaderSuspended,console.log("loader state "+i.loaderSuspended);break;case 74:case 106:s.drawEarth=!s.drawEarth,a=!0;break;case 88:case 120:s.drawFog=!s.drawFog,a=!0;break;case 82:case 114:r.graphs.switchPanel();break;case 79:case 111:i.camera.camera.setOrtho(!i.camera.camera.getOrtho());break;case 76:case 108:r.drawRadar=!r.drawRadar;break;case 90:case 122:s.maxZoom=!s.maxZoom;break;case 78:case 110:r.shakeCamera=!r.shakeCamera;break;default:n=!1}n&&(a=!0)}}if(this.diagnosticMode&&r.drawRadar&&!this.shiftDown&&!e){switch(n=!0,o){case 43:case 107:null==r.radarLod&&(r.radarLod=8),r.radarLod++;break;case 45:case 109:null==r.radarLod&&(r.radarLod=8),r.radarLod=Math.max(0,r.radarLod-1);break;case 42:case 106:r.radarLod=null;break;default:n=!1}n&&(a=!0)}if(this.diagnosticMode&&s.drawBBoxes&&!this.shiftDown&&!e){switch(n=!0,o){case 76:case 108:s.drawLods=!s.drawLods;break;case 80:case 112:s.drawPositions=!s.drawPositions;break;case 84:case 116:s.drawTextureSize=!s.drawTextureSize;break;case 70:case 102:s.drawFaceCount=!s.drawFaceCount;break;case 71:case 103:s.drawGeodataOnly=!s.drawGeodataOnly;break;case 68:case 100:s.drawDistance=!s.drawDistance;break;case 78:case 110:s.drawNodeInfo=!s.drawNodeInfo;break;case 77:case 109:s.drawMeshBBox=!s.drawMeshBBox;break;case 73:case 105:s.drawIndices=!s.drawIndices;break;case 66:case 98:s.drawBoundLayers=!s.drawBoundLayers;break;case 83:case 115:s.drawSurfaces=!s.drawSurfaces;break;case 67:case 99:s.drawCredits=!s.drawCredits;break;case 79:case 111:s.drawOrder=!s.drawOrder;break;case 65:case 97:s.drawLabelBoxes=!s.drawLabelBoxes;break;case 69:case 101:s.debugTextSize=2==s.debugTextSize?3:2;break;case 88:case 120:i.config.mapPreciseBBoxTest=!i.config.mapPreciseBBoxTest;break;case 90:case 122:i.config.mapPreciseDistanceTest=!i.config.mapPreciseDistanceTest;break;default:n=!1}n&&(a=!0)}}a&&(i.markDirty(),r.preventDefault(t))}},r.prototype.setParameter=function(t,e){var i=this.core.getMap(),r=this.inspector;if(i){var s=i.draw.debug;switch(t){case"debugBBox":s.drawBBoxes=!0;var a=function(t){return-1!=e.indexOf(t)};a("L")&&(s.drawLods=!0),a("P")&&(s.drawPositions=!0),a("T")&&(s.drawTextureSize=!0),a("F")&&(s.drawFaceCount=!0),a("G")&&(s.drawGeodataOnly=!0),a("D")&&(s.drawDistance=!0),a("N")&&(s.drawNodeInfo=!0),a("M")&&(s.drawMeshBBox=!0),a("I")&&(s.drawIndices=!0),a("B")&&(s.drawBoundLayers=!0),a("S")&&(s.drawSurfaces=!0),a("C")&&(s.drawCredits=!0),a("O")&&(s.drawOrder=!0),a("E")&&(s.debugTextSize=3);break;case"debugLBox":s.drawLabelBoxes=!0;break;case"debugNoEarth":s.drawEarth=!1;break;case"debugShader":s.drawWireframe=parseInt(e);break;case"debugHeightmap":s.heightmapOnly=!0;break;case"debugRadar":r.enableInspector(),r.drawRadar=!0,r.radarLod=parseInt(e),isNaN(r.radarLod)&&(r.radarLod=null)}i.markDirty()}},e.a=r},function(t,e,i){"use strict";var r=i(2),s=i(3),a=i(4),n=i(118),o=i(122),h=i(117),l=i(120),u=i(121),c=i(123),d=r.e,p=s.a,f=a.a,g=n.a,m=o.a,v=h.a,y=l.a,b=u.a,x=c.a,M=function(t){this.core=t,this.enabled=!1,this.input=new g(this),this.stats=new m(this),this.graphs=new v(this),this.layers=new y(this),this.replay=new b(this),this.stylesheets=new x(this),this.core.config.inspector&&this.input.init(),this.shakeCamera=!1,this.drawReplayCamera=!1,this.drawRadar=!1,this.radarLod=null,this.debugValue=0,this.measureMode=!1,this.measurePoints=[]};M.prototype.enableInspector=function(){this.enabled||(this.stats.init(),this.graphs.init(),this.layers.init(),this.replay.init(),this.stylesheets.init(),this.circleImage||(this.circleImage=f.loadImage("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t/AAAACW9GRnMAAAAgAAAA4ACD+EAUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/UlEQVRYw+2VPwqDMBTG3dz1Am56EnH2XLroETxGuwc3Z7cOdhY8QJpfSUBspUvStJAPPggvD973/uQligICAgL+DKViqygUV02hbaXLwJlio7gpyhNu2idzEXwwgfI8H+u6vnZdN/V9P3EuimLcCRlsiyArGcfxjWDLsmzyAGzc4aNFNDZ7/iw7AeQH4LNrh5WZYLgkJTaZCyHuVVVdkiSZ0zSdOWMzlaBFWkRrQ4A4Zk/A4wBie1MFYUMAz0wybCYAmR8FUAlzj6+2r18TgM2VAO8tOB1Cyk7mrofQ+zP0voheVjHtIBjDxjrmvCu7k1Xs/TP6ie84ICDAGR5uCYdPo0MWiAAAAABJRU5ErkJggg==",function(){this.circleTexture=this.core.getRendererInterface().createTexture({source:this.circleImage})}.bind(this))),this.core.on("map-update",this.onMapUpdate.bind(this)),this.enabled=!0)},M.prototype.setParameter=function(t,e){this.input.setParameter(t,e)},M.prototype.addStyle=function(t){var e=document.createElement("style");e.type="text/css",e.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(e)},M.prototype.doNothing=function(t){return t.stopPropagation(),!1},M.prototype.preventDefault=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},M.prototype.onMapUpdate=function(){var t=this.core.getMapInterface();if(t){this.shakeCamera&&t.redraw();var e,i,r,s,a,n,o,h=this.core.getRendererInterface();if(this.replay.drawGlobe){o=t.convertCoordsFromPhysToCameraSpace([0,0,0]);var l=this.core.getRenderer();l.draw.drawTBall(o,6371e3,l.progStardome,this.replay.globeTexture,6371e3,!0)}if(this.replay.drawCamera){for(a=this.replay.cameraLines,n=[],e=0,i=a.length;e<i;e++)n.push(t.convertCoordsFromPhysToCanvas(a[e]));for(h.drawLineString({points:n,size:2,screenSpace:!0,color:[0,128,255,255],depthTest:!1,blend:!1}),a=this.replay.cameraLines3,e=0,i=a.length;e<i;e++){for(n=[],r=0,s=a[e].length;r<s;r++)n.push(t.convertCoordsFromPhysToCanvas(a[e][r]));h.drawLineString({points:n,size:2,screenSpace:!0,color:[0,255,128,255],depthTest:!1,blend:!1})}for(a=this.replay.cameraLines2,e=0,i=a.length;e<i;e++){for(n=[],r=0,s=a[e].length;r<s;r++)n.push(t.convertCoordsFromPhysToCanvas(a[e][r]));h.drawLineString({points:n,size:2,screenSpace:!0,color:[0,255,255,255],depthTest:!1,blend:!1})}var u=t.getCameraInfo(),c=t.convertCoordsFromPhysToCameraSpace(this.replay.cameraLines[0]),f=d.create(this.replay.cameraMatrix);f[12]=c[0],f[13]=c[1],f[14]=c[2];var g=[255,128,128,0,0,0,0,0,0,0,0,0,0,.5,0,0];d.multiply(u.viewMatrix,f,f);var m=[0,0,0,0,0,0,0,0,0];d.toInverseMat3(f,m),h.setState(this.replay.frustumState),h.drawMesh({mesh:this.replay.frustumMesh,texture:null,shader:"shaded",shaderVariables:{uMV:["mat4",f],uNorm:["mat3",m],uMaterial:["mat4",g]}})}if(this.drawRadar&&this.circleTexture){var v=t.getPosition(),y=v.getViewExtent()/64,b=new Array(256);for(r=0;r<16;r++)for(e=0;e<16;e++){var x=e*y-8*y,M=r*y-8*y,w=Math.atan2(M,x),S=Math.sqrt(x*x+M*M),A=t.movePositionCoordsTo(v,p.degrees(w),S),C=A.getCoords(),T=t.convertCoordsFromNavToCanvas([C[0],C[1],0],"float",this.radarLod);b[16*r+e]=T}var P=new Array(16);for(r=0;r<16;r++){for(e=0;e<16;e++)P[e]=b[16*r+e];h.drawLineString({points:P,size:2,screenSpace:!0,color:[0,255,255,255],depthTest:!1,blend:!1})}for(e=0;e<16;e++){for(r=0;r<16;r++)P[r]=b[16*r+e];h.drawLineString({points:P,size:2,screenSpace:!0,color:[0,255,255,255],depthTest:!1,blend:!1})}for(e=0,i=b.length;e<i;e++)o=b[e],h.drawImage({rect:[o[0]-10,o[1]-10,20,20],texture:this.circleTexture,color:[255,0,255,255],depth:o[2],depthTest:!1,blend:!0})}}},e.a=M},function(t,e,i){"use strict";var r=function(t){this.inspector=t,this.core=t.core};r.prototype.init=function(){var t=this.inspector;t.addStyle('#vts-layers-panel {font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;display: none;padding:15px;font-size: 14px;position: absolute;right: 10px;bottom: 10px;cursor: default;background-color: rgba(255,255,255,0.95);border-radius: 5px;border: solid 1px #ccc;text-align: left;z-index: 7;padding: 10px;}#vts-layers-panel button {max-width: 23px;max-height: 21px;}#vts-layers-panel-title {margin-bottom: 3px;}#vts-layers-views-panel {margin-top: 5px;float: left;}#vts-layers-views-items {width: 191px;overflow-y: scroll;overflow-x: hidden;height: 200px;border: 1px solid #ddd;}#vts-layers-surfaces-panel {margin-top: 5px;float: left;}#vts-layers-surfaces-items {width: 150px;overflow-y: scroll;overflow-x: hidden;height: 200px;border-top: 1px solid #ddd;border-bottom: 1px solid #ddd;}#vts-layers-boundlayers-panel {margin-top: 5px;float: left;}#vts-layers-boundlayers-items {width: 250px;overflow-y: scroll;overflow-x: hidden;height: 200px;border: 1px solid #ddd;border-right: none;}#vts-layers-freelayers-panel {margin-top: 5px;float: left;}#vts-layers-freelayers-items {width: 150px;overflow-y: scroll;overflow-x: hidden;height: 200px;border: 1px solid #ddd;}#vts-layers-fl-properties-panel {margin-top: 5px;float: left;}#vts-layers-fl-properties-items {width: 250px;overflow-y: scroll;overflow-x: hidden;height: 200px;border: 1px solid #ddd;border-right: none;}#vts-layers-json-panel {margin-top: 5px;float: right;}#vts-layers-json-text {width: 200px;resize: none;height: 180px;border: 1px solid #ddd;white-space: pre;padding: 0px;}#vts-layers-json-text2 {width: 200px;height: 21px;border: 1px solid #ddd;}.vts-layers-panel-title {margin: 0px;margin-bottom: 5px;}.vts-layers-item {width: 100%;}.vts-layers-item input[type=number]{width: 43px;}.vts-layers-name {width: 120px;display: inline-block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}.vts-layers-name2 {width: 126px;display: inline-block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}#vts-layers-fl-properties-style {width: 175px;height: 21px;}.vts-surface-item {width: 100%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}'),this.element=document.createElement("div"),this.element.id="vts-layers-panel",this.element.innerHTML='<div id="vts-layers-views-panel"><p class="vts-layers-panel-title">Named Views:</p><div id="vts-layers-views-items"></div></div><div id="vts-layers-surfaces-panel"><p class="vts-layers-panel-title">Surfaces:</p><div id="vts-layers-surfaces-items"></div></div><div id="vts-layers-boundlayers-panel"><p class="vts-layers-panel-title">Surface Bound Layers:</p><div id="vts-layers-boundlayers-items"></div></div><div id="vts-layers-freelayers-panel"><p class="vts-layers-panel-title">Free Layers:</p><div id="vts-layers-freelayers-items"></div></div><div id="vts-layers-fl-properties-panel"><p class="vts-layers-panel-title">Free Layer Properties:</p><div id="vts-layers-fl-properties-items"></div></div><div id="vts-layers-json-panel"><p class="vts-layers-panel-title">Definition:</p><textarea id="vts-layers-json-text" cols="48"></textarea><br/><input id="vts-layers-json-text2" type="text"></div>',this.core.element.appendChild(this.element),this.viewItems=document.getElementById("vts-layers-views-items"),this.surfacesItems=document.getElementById("vts-layers-surfaces-items"),this.boundLayersItems=document.getElementById("vts-layers-boundlayers-items"),this.freeLayersItems=document.getElementById("vts-layers-freelayers-items"),this.freeLayersPropertiesItems=document.getElementById("vts-layers-fl-properties-items"),this.jsonText=document.getElementById("vts-layers-json-text"),this.jsonText2=document.getElementById("vts-layers-json-text2"),this.element.addEventListener("mouseup",t.doNothing.bind(this),!0),this.element.addEventListener("mousedown",t.doNothing.bind(this),!0),this.element.addEventListener("mousewheel",t.doNothing.bind(this),!1),this.element.addEventListener("dblclick",t.doNothing.bind(this),!1),this.views=[],this.panelVisible=!1,this.panelInitialized=!1,this.currentView="",this.currentSurface="",this.currentFreeLayer=""},r.prototype.initViews=function(){var t=this.core.getMap();if(t){var e,i,r,s,a,n,o,h,l,u,c,d=t.getNamedViews(),p="--initial--";for(this.views[p]={surfaces:{},freeLayers:{},original:JSON.parse(JSON.stringify(t.getView()))},i=0,r=d.length;i<r;i++)l=d[i],this.views[l]={surfaces:{},freeLayers:{},original:JSON.parse(JSON.stringify(t.getNamedView(l).getInfo()))};this.currentView=p,d=this.views;for(var f in d){for(l=d[f],u=t.getSurfaces(),i=0,r=u.length;i<r;i++){for(p=u[i],y=t.getSurface(p),n=t.getBoundLayers(),o=[],s=0,a=n.length;s<a;s++)o.push({id:n[s],alpha:100,enabled:!1});l.surfaces[p]={enabled:!1,layers:o}}var g=t.getFreeLayers();for(i=0,r=g.length;i<r;i++){for(p=g[i],n=t.getBoundLayers(),o=[],s=0,a=n.length;s<a;s++)o.push({id:n[s],alpha:100,enabled:!1});e=t.getFreeLayer(p);var m=e.getInfo();l.freeLayers[p]={enabled:!1,style:null,originalStyle:m.style,depthShift:0,depthShift2:0,depthShift3:0,layers:o}}var v=l.original.surfaces;for(c in v)if(n=v[c],l.surfaces[c]){var y=l.surfaces[c];for(y.enabled=!0,i=0,r=n.length;i<r;i++)"string"==typeof n[i]?-1!=(h=this.findIdInArray(y.layers,n[i]))&&y.layers[h]&&(y.layers[h].enabled=!0,y.layers.splice(i,0,y.layers.splice(h,1)[0])):(p=n[i].id,-1!=(h=this.findIdInArray(y.layers,p))&&y.layers[h]&&(y.layers[h].enabled=!0,y.layers[h].alpha=n[i].alpha?100*parseFloat(n[i].alpha):100,y.layers.splice(i,0,y.layers.splice(h,1)[0])))}var b=l.original.freeLayers;for(c in b){var x=b[c];if(l.freeLayers[c]){e=l.freeLayers[c],e.enabled=!0;var M=x.depthOffset||[0,0,0];for(e.depthShift=M[0],e.depthShift2=M[1],e.depthShift3=M[2],e.style=x.style,n=x.boundLayers||[],i=0,r=n.length;i<r;i++)"string"==typeof n[i]?-1!=(h=this.findIdInArray(e.layers,n[i]))&&e.layers[h]&&(e.layers[h].enabled=!0,e.layers.splice(i,0,e.layers.splice(h,1)[0])):(p=n[i].id,-1!=(h=this.findIdInArray(e.layers,p))&&y.layers[h]&&(e.layers[h].enabled=!0,e.layers[h].alpha=n[i].alpha?100*parseFloat(n[i].alpha):100,e.layers.splice(i,0,y.layers.splice(h,1)[0])))}}}}},r.prototype.findIdInArray=function(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i].id==e)return i;return-1},r.prototype.buildViews=function(){if(this.core.getMap()){var t=this.views,e="";for(var i in t)e+='<div class="vts-views-item" id="vts-views-item-'+i+'"><div class="vts-layers-name2">'+i+'</div><button id="vts-views-cbutton-'+i+'" type="button" title="Clone">C</button><button id="vts-views-xbutton-'+i+'" type="button" title="Remove">X</button></div>';this.viewItems.innerHTML=e;for(i in t){r="vts-views-cbutton-"+i,document.getElementById(r).onclick=this.switchView.bind(this,i,r,"clone"),r="vts-views-xbutton-"+i,document.getElementById(r).onclick=this.switchView.bind(this,i,r,"remove");var r="vts-views-item-"+i;document.getElementById(r).onclick=this.selectView.bind(this,i)}}},r.prototype.buildSurfaces=function(){var t,e,i=this.views[this.currentView],r=i.surfaces,s="",a=null;for(e in r)s+='<div id="vts-surface-item-'+e+'" class="vts-surface-item"><input id="vts-surface-checkbox-'+e+'" type="checkbox"/><span title='+e+">"+e+"</span></div>",null===a&&(a=e);this.surfacesItems.innerHTML=s,this.currentSurface=a;for(e in r)r[e].enabled&&(t="vts-surface-checkbox-"+e,document.getElementById(t).checked=!0);for(e in r)t="vts-surface-checkbox-"+e,document.getElementById(t).onchange=this.switchSurface.bind(this,e,t),t="vts-surface-item-"+e,document.getElementById(t).onclick=this.selectSurface.bind(this,e)},r.prototype.buildBoundLayers=function(t){var e=this.views[this.currentView],i="";if(e.surfaces[t])for(var r=e.surfaces[t].layers,s=0,a=r.length;s<a;s++){var n=r[s];i+='<div class="vts-layers-item"><input id="vts-boundlayer-checkbox-'+n.id+'" type="checkbox" '+(n.enabled?"checked":"")+'/><div class="vts-layers-name">'+n.id+'</div><input id="vts-boundlayer-spinner-'+n.id+'" type="number" title="Alpha" min="0" max="100" step="10" value="'+n.alpha+'"><button id="vts-boundlayer-ubutton-'+n.id+'" type="button" title="Move Above">↑</button><button id="vts-boundlayer-dbutton-'+n.id+'" type="button" title="Move Bellow">↓</button></div>'}if(this.boundLayersItems.innerHTML=i,e.surfaces[t])for(s=0,a=r.length;s<a;s++){var o="vts-boundlayer-checkbox-"+r[s].id;document.getElementById(o).onchange=this.switchBoundLayer.bind(this,r[s].id,o,"enable"),o="vts-boundlayer-spinner-"+r[s].id,document.getElementById(o).onchange=this.switchBoundLayer.bind(this,r[s].id,o,"alpha"),o="vts-boundlayer-ubutton-"+r[s].id,document.getElementById(o).onclick=this.switchBoundLayer.bind(this,r[s].id,o,"up"),o="vts-boundlayer-dbutton-"+r[s].id,document.getElementById(o).onclick=this.switchBoundLayer.bind(this,r[s].id,o,"down")}},r.prototype.buildFreeLayers=function(){var t=this.views[this.currentView],e=t.freeLayers,i="";for(var r in e)i+='<div class="vts-surface-item" id="vts-freelayer-item-'+r+'"><input id="vts-freelayer-checkbox-'+r+'" type="checkbox" '+(e[r].enabled?"checked":"")+"/><span title="+r+">"+r+"</span></div>";this.freeLayersItems.innerHTML=i;for(r in e){var s="vts-freelayer-checkbox-"+r;document.getElementById(s).onchange=this.switchFreeLayer.bind(this,r,s),s="vts-freelayer-item-"+r,document.getElementById(s).onclick=this.selectFreeLayer.bind(this,r)}},r.prototype.buildFreeLayerProperties=function(t){var e,i,r,s=this.core.getMap(),a=this.views[this.currentView],n=a.freeLayers[t].layers,o="";if(s&&s.getFreeLayer(t)){switch(s.getFreeLayer(t).getInfo().type){case"mesh":case"mesh-tiles":for(o+='<div class="vts-layers-item"><div class="vts-layers-name" style="width:90px">DepthOffset:</div><input id="vts-fl-properties-depth-shift" type="number" min="-100" max="100" step="1" value="'+a.freeLayers[t].depthShift+'"><input id="vts-fl-properties-depth-shift2" type="number" min="-100" max="100" step="1" value="'+a.freeLayers[t].depthShift2+'"><input id="vts-fl-properties-depth-shift3" type="number" min="-100" max="100" step="1" value="'+a.freeLayers[t].depthShift3+'"></div>',o+='<div class="vts-layers-item"><div class="vts-layers-name">BoundLayers:</div></div>',e=0,i=n.length;e<i;e++){var h=n[e];o+='<div class="vts-layers-item"><input id="vts-fl-properties-checkbox-'+h.id+'" type="checkbox" '+(h.enabled?"checked":"")+'/><div class="vts-layers-name">'+h.id+'</div><input id="vts-fl-properties-spinner-'+h.id+'" type="number" title="Alpha" min="0" max="100" step="10" value="'+h.alpha+'"><button id="vts-fl-properties-ubutton-'+h.id+'" type="button" title="Move Above">↑</button><button id="vts-fl-properties-dbutton-'+h.id+'" type="button" title="Move Bellow">↓</button></div>'}for(this.freeLayersPropertiesItems.innerHTML=o,r="vts-fl-properties-depth-shift",document.getElementById(r).onchange=this.switchFreeLayerProperty.bind(this,r,"depthShift"),r="vts-fl-properties-depth-shift2",document.getElementById(r).onchange=this.switchFreeLayerProperty.bind(this,r,"depthShift2"),r="vts-fl-properties-depth-shift3",document.getElementById(r).onchange=this.switchFreeLayerProperty.bind(this,r,"depthShift3"),e=0,i=n.length;e<i;e++)r="vts-fl-properties-checkbox-"+n[e].id,document.getElementById(r).onchange=this.switchFreeLayerBoundLayer.bind(this,n[e].id,r,"enable"),r="vts-fl-properties-spinner-"+n[e].id,document.getElementById(r).onchange=this.switchFreeLayerBoundLayer.bind(this,n[e].id,r,"alpha"),r="vts-fl-properties-ubutton-"+n[e].id,document.getElementById(r).onclick=this.switchFreeLayerBoundLayer.bind(this,n[e].id,r,"up"),r="vts-fl-properties-dbutton-"+n[e].id,document.getElementById(r).onclick=this.switchFreeLayerBoundLayer.bind(this,n[e].id,r,"down");break;case"geodata":case"geodata-tiles":o+='<div class="vts-layers-item"><div class="vts-layers-name" style="width:50px">Style:</div><select id="vts-layers-fl-properties-style">';var l=s.getStylesheets(),u=l.indexOf(a.freeLayers[t].style||a.freeLayers[t].originalStyle);for(e=0,i=l.length;e<i;e++)o+='<option value="'+l[e]+'" '+(e==u?"selected":"")+">"+l[e]+"</option>";o+="</select></div>",this.freeLayersPropertiesItems.innerHTML=o,r="vts-layers-fl-properties-style",document.getElementById(r).onchange=this.switchFreeLayerProperty.bind(this,r,"style")}}},r.prototype.selectView=function(t){if(this.views[t]){var e;this.currentView&&(e=document.getElementById("vts-views-item-"+this.currentView))&&(e.style.backgroundColor="initial"),e=document.getElementById("vts-views-item-"+t),e.style.backgroundColor="#ddd",this.currentView=t,this.buildSurfaces(),this.selectSurface(this.currentSurface),this.buildFreeLayers(),this.applyMapView()}},r.prototype.switchView=function(t,e,i){var r=this.views;for(var s in this.views)if(s==t){switch(i){case"clone":for(var a=2;;){if(!r[t+" #"+a]){r[t+" #"+a]=JSON.parse(JSON.stringify(r[t]));break}a++}this.buildViews();break;case"remove":var n=0;for(s in r)n++;if(n>1)if(delete r[t],this.buildViews(),this.currentView==t)for(s in r){this.selectView(s);break}else this.selectView(this.currentView)}break}},r.prototype.switchSurface=function(t,e){var i=document.getElementById(e);this.views[this.currentView].surfaces[t].enabled=i.checked,this.applyMapView()},r.prototype.selectSurface=function(t){var e;this.currentSurface&&(e=document.getElementById("vts-surface-item-"+this.currentSurface),e.style.backgroundColor="initial"),e=document.getElementById("vts-surface-item-"+t),e&&(e.style.backgroundColor="#ddd"),this.currentSurface=t,this.buildBoundLayers(this.currentSurface)},r.prototype.switchBoundLayer=function(t,e,i){for(var r=document.getElementById(e),s=this.views[this.currentView],a=s.surfaces[this.currentSurface].layers,n=0,o=a.length;n<o;n++)if(a[n].id==t){switch(i){case"enable":a[n].enabled=r.checked;break;case"alpha":a[n].alpha=parseInt(r.value,10);break;case"up":a.splice(Math.max(0,n-1),0,a.splice(n,1)[0]),this.selectSurface(this.currentSurface);break;case"down":a.splice(Math.max(0,n+1),0,a.splice(n,1)[0]),this.selectSurface(this.currentSurface)}break}this.applyMapView()},r.prototype.switchFreeLayer=function(t,e){var i=document.getElementById(e);this.views[this.currentView].freeLayers[t].enabled=i.checked,this.applyMapView()},r.prototype.selectFreeLayer=function(t){var e;this.currentFreeLayer&&(e=document.getElementById("vts-freelayer-item-"+this.currentFreeLayer),e.style.backgroundColor="initial"),e=document.getElementById("vts-freelayer-item-"+t),e.style.backgroundColor="#ddd",this.currentFreeLayer=t,this.buildFreeLayerProperties(this.currentFreeLayer)},r.prototype.switchFreeLayerBoundLayer=function(t,e,i){for(var r=document.getElementById(e),s=this.views[this.currentView],a=s.freeLayers[this.currentFreeLayer].layers,n=0,o=a.length;n<o;n++)if(a[n].id==t){switch(i){case"enable":a[n].enabled=r.checked;break;case"alpha":a[n].alpha=parseInt(r.value,10);break;case"up":a.splice(Math.max(0,n-1),0,a.splice(n,1)[0]),this.selectFreeLayer(this.currentFreeLayer);break;case"down":a.splice(Math.max(0,n+1),0,a.splice(n,1)[0]),this.selectFreeLayer(this.currentFreeLayer)}break}this.applyMapView()},r.prototype.switchFreeLayerProperty=function(t,e){var i=document.getElementById(t),r=this.views[this.currentView],s=r.freeLayers[this.currentFreeLayer];switch(e){case"depthShift":s.depthShift=parseInt(i.value,10);break;case"depthShift2":s.depthShift2=parseInt(i.value,10);break;case"depthShift3":s.depthShift3=parseInt(i.value,10);break;case"style":s.style=i.value}this.applyMapView()},r.prototype.applyMapView=function(t){var e,i,r,s={surfaces:{},freeLayers:{}},a=this.views[this.currentView],n=a.surfaces;for(var o in n)if(n[o].enabled){var h=[];for(r=n[o].layers,e=0,i=r.length;e<i;e++)r[e].enabled&&(r[e].alpha<100?h.push({id:r[e].id,alpha:(.01*r[e].alpha).toFixed(2)}):h.push(r[e].id));s.surfaces[o]=h}var l=a.freeLayers;for(o in l)if(l[o].enabled){var u=[];for(r=l[o].layers,e=0,i=r.length;e<i;e++)r[e].enabled&&(r[e].alpha<100?u.push({id:r[e].id,alpha:parseFloat((.01*r[e].alpha).toFixed(2))}):u.push(r[e].id));s.freeLayers[o]={},u.length>0&&(s.freeLayers[o].boundLayers=u),l[o].style&&l[o].style!=l[o].originalStyle&&(s.freeLayers[o].style=l[o].style),0==l[o].depthShift&&0==l[o].depthShift2&&0==l[o].depthShift3||(s.freeLayers[o].depthOffset=[parseFloat(l[o].depthShift.toFixed(2)),parseFloat(l[o].depthShift2.toFixed(2)),parseFloat(l[o].depthShift3.toFixed(2))])}if(this.jsonText.value=JSON.stringify(s,null," "),this.jsonText2.value=encodeURIComponent(JSON.stringify(s)),!t){var c=this.core.getMap();if(!c)return;c.setView(s)}},r.prototype.showPanel=function(){this.element.style.display="block",this.panelVisible=!0,this.updatePanel()},r.prototype.hidePanel=function(){this.element.style.display="none",this.panelVisible=!1},r.prototype.switchPanel=function(){this.panelVisible?this.hidePanel():this.showPanel()},r.prototype.updatePanel=function(){this.panelInitialized||(this.panelInitialized=!1,this.initViews(),this.buildViews(),this.selectView(this.currentView))},e.a=r},function(t,e,i){"use strict";var r=i(6),s=i(3),a=i(2),n=s.a,o=r.a,h=a.b,l=a.e,u=function(t){this.inspector=t,this.core=t.core};u.prototype.init=function(){var t=this.inspector;t.addStyle("#vts-replay-panel {font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;display: none;padding:15px;width: 618px;font-size: 14px;position: absolute;right: 10px;top: 10px;cursor: default;background-color: rgba(255,255,255,0.95);border-radius: 5px;border: solid 1px #ccc;text-align: left;z-index: 7;padding: 10px;}#vts-replay-panel-left {width: 253px;height: 100%;float: left;}#vts-replay-panel-right {width: 340px;height: 100%;float: right;}#vts-replay-items {width: 240px;overflow-x: hidden;border: 1px solid #ddd;padding-right: 5px;}.vts-replay-item {width: 100%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}#vts-replay-lod-slider {width: 240px;}#vts-replay-lod-text {width: 60px;margin-left: 10px;margin-right: 10px;}#vts-replay-lod-single {margin-left: 10px;}#vts-replay-time-slider {width: 330px;}#vts-replay-time-text {width: 60px;margin-left: 10px;margin-right: 10px;}#vts-replay-time-single {margin-left: 10px;}#vts-replay-panel-gtime canvas{border: 1px solid #555;}#vts-replay-panel-gtime span{font-size: 10px;}#vts-replay-info {width: 240px;height: 140px;overflow-x: hidden;border: 1px solid #ddd;padding-right: 5px;margin-top: 10px;font-size: 12px;word-wrap: break-word;}"),this.element=document.createElement("div"),this.element.id="vts-replay-panel",this.element.innerHTML='<div id="vts-replay-panel-left"><div id="vts-replay-items"></div><div id="vts-replay-panel-lod"><input id="vts-replay-lod-slider" type="range" min="0" max="30" step="1" value="30" /><br/><span>LOD:</span><input id="vts-replay-lod-text" type="text" value="30"/><input id="vts-replay-lod-up" type="button" value="<"/><input id="vts-replay-lod-down" type="button" value=">"/><input id="vts-replay-lod-single" type="checkbox"/><span>Single</span></div><div id="vts-replay-info"></div></div><div id="vts-replay-panel-right"><div id="vts-replay-panel-gtime"><span id="vts-replay-info-meshes">Meshes Count: 0 Min/Max: 0/0 Avg. 0</span><br/><canvas id="vts-replay-canvas-meshes" width=340 height=30></canvas><br/><span id="vts-replay-info-textures">Internal Textures Count: 0 Min/Max: 0/0 Avg. 0</span><br/><canvas id="vts-replay-canvas-textures" width=340 height=30></canvas><br/><span id="vts-replay-info-textures2">External Textures Count: 0 Min/Max: 0/0 Avg. 0</span><br/><canvas id="vts-replay-canvas-textures2" width=340 height=30></canvas><br/><span id="vts-replay-info-geodata">Geodata Count: 0 Min/Max: 0/0 Avg. 0</span><br/><canvas id="vts-replay-canvas-geodata" width=340 height=30></canvas><br/><span id="vts-replay-info-metatiles">Metatiles Count: 0 Min/Max: 0/0 Avg. 0</span><br/><canvas id="vts-replay-canvas-metatiles" width=340 height=30></canvas><br/><span id="vts-replay-info-intervals">Interval Count: 0 Min/Max: 0/0 Avg. 0</span><br/><canvas id="vts-replay-canvas-intervals" width=340 height=30></canvas><br/><span id="vts-replay-info-threads">Threads Min/Max: 0/0 Avg. 0 </span><br/><canvas id="vts-replay-canvas-threads" width=340 height=30></canvas><br/></div><div id="vts-replay-panel-time"><input id="vts-replay-time-slider" type="range" min="0" max="2000" value="0" /><br/><span>File:</span><input id="vts-replay-time-text" type="text" value="0"/><input id="vts-replay-time-up" type="button" value="<"/><input id="vts-replay-time-down" type="button" value=">"/><input id="vts-replay-time-single" type="checkbox"/><span>Single</span></div></div>',this.core.element.appendChild(this.element),this.items=document.getElementById("vts-replay-items"),this.lodSlider=document.getElementById("vts-replay-lod-slider"),this.lodSlider.onchange=this.onSliderChange.bind(this,"lod"),this.lodSlider.oninput=this.onSliderChange.bind(this,"lod"),this.lodText=document.getElementById("vts-replay-lod-text"),this.lodText.onchange=this.onTextChange.bind(this,"lod"),document.getElementById("vts-replay-lod-up").onclick=this.onSliderChange.bind(this,"lod","down"),document.getElementById("vts-replay-lod-down").onclick=this.onSliderChange.bind(this,"lod","up"),document.getElementById("vts-replay-lod-single").onclick=this.onSliderChange.bind(this,"lod","single"),this.timeSlider=document.getElementById("vts-replay-time-slider"),this.timeSlider.onchange=this.onSliderChange.bind(this,"time"),this.timeSlider.oninput=this.onSliderChange.bind(this,"time"),this.timeText=document.getElementById("vts-replay-time-text"),this.timeText.onchange=this.onTextChange.bind(this,"time"),this.timeInfo=document.getElementById("vts-replay-info"),document.getElementById("vts-replay-time-up").onclick=this.onSliderChange.bind(this,"time","down"),document.getElementById("vts-replay-time-down").onclick=this.onSliderChange.bind(this,"time","up"),document.getElementById("vts-replay-time-single").onclick=this.onSliderChange.bind(this,"time","single"),this.element.addEventListener("mouseup",t.doNothing.bind(this),!0),this.element.addEventListener("mousedown",t.doNothing.bind(this),!0),this.element.addEventListener("mousewheel",t.doNothing.bind(this),!1),this.element.addEventListener("dblclick",t.doNothing.bind(this),!1),this.infoMeshes=document.getElementById("vts-replay-info-meshes"),this.ctxMeshes=document.getElementById("vts-replay-canvas-meshes").getContext("2d"),this.infoTextures=document.getElementById("vts-replay-info-textures"),this.ctxTextures=document.getElementById("vts-replay-canvas-textures").getContext("2d"),this.infoTextures2=document.getElementById("vts-replay-info-textures2"),this.ctxTextures2=document.getElementById("vts-replay-canvas-textures2").getContext("2d"),this.infoGeodata=document.getElementById("vts-replay-info-geodata"),this.ctxGeodata=document.getElementById("vts-replay-canvas-geodata").getContext("2d"),this.infoMetatiles=document.getElementById("vts-replay-info-metatiles"),this.ctxMetatiles=document.getElementById("vts-replay-canvas-metatiles").getContext("2d"),this.infoIntervals=document.getElementById("vts-replay-info-intervals"),this.ctxIntervals=document.getElementById("vts-replay-canvas-intervals").getContext("2d"),this.infoThreads=document.getElementById("vts-replay-info-threads"),this.ctxThreads=document.getElementById("vts-replay-canvas-threads").getContext("2d"),this.cameraLines=[],this.cameraLines2=[],this.cameraLines3=[],this.cameraGenarated=!1,this.panelVisible=!1},u.prototype.showPanel=function(){this.buildReplayCombo(),this.element.style.display="block",this.panelVisible=!0;var t=this.core.getMap();if(t){var e=t.draw.replay;this.updateFileInfo(e.loadedIndex),this.updateLoadGraphs()}},u.prototype.hidePanel=function(){this.element.style.display="none",this.panelVisible=!1},u.prototype.switchPanel=function(){this.panelVisible?this.hidePanel():this.showPanel()},u.prototype.onSliderChange=function(t,e){if("lod"==t)switch(e){case"up":this.lodSlider.stepUp(),this.lodText.value=this.lodSlider.value;break;case"down":this.lodSlider.stepDown(),this.lodText.value=this.lodSlider.value;break;default:this.lodText.value=this.lodSlider.value}else switch(e){case"up":this.timeSlider.stepUp(),this.timeText.value=this.timeSlider.value;break;case"down":this.timeSlider.stepDown(),this.timeText.value=this.timeSlider.value;break;default:this.timeText.value=this.timeSlider.value}var i=this.core.getMap();if(i){var r=i.draw.replay;"lod"==t?(r.lod=parseFloat(this.lodText.value),r.singleLod=document.getElementById("vts-replay-lod-single").checked):(r.loadedIndex=parseFloat(this.timeText.value),r.singleLodedIndex=document.getElementById("vts-replay-time-single").checked,this.updateFileInfo(r.loadedIndex),this.updateLoadGraphs()),i.markDirty()}},u.prototype.onTextChange=function(t){"lod"==t?this.lodSlider.value=this.lodText.value:this.timeSlider.value=this.timeText.value;var e=this.core.getMap();if(e){var i=e.draw.replay;"lod"==t?i.lod=parseFloat(this.lodText.value):(i.loadedIndex=parseFloat(this.timeText.value),this.updateFileInfo(i.loadedIndex),this.updateLoadGraphs()),e.markDirty()}},u.prototype.generateCameraLines=function(t){var e=this.core.getRendererInterface(),i=t.position,r=t.center;this.cameraLines=[i,r],this.cameraLines2=[[i],[i],[i],[i]];var s=16,a=this.core.getMap(),o=a.camera.getRotationviewMatrix(),u=l.create();l.inverse(o,u),this.cameraMatrix=u;for(var c,d,p,f,g=Math.tan(n.radians(a.camera.getFov())),m=g*a.camera.getAspect(),v=Math.sqrt(g*g+m*m),y=Math.atan(v/1),b=t.cameraDistance/s,x=.5*b*Math.tan(y),M=x*a.camera.getAspect(),w=0;w<s;w++)c=[-M,-x,-b],d=[M,-x,-b],p=[M,x,-b],f=[-M,x,-b],h.scale(c,w+1),h.scale(d,w+1),h.scale(p,w+1),h.scale(f,w+1),l.multiplyVec3(u,c),l.multiplyVec3(u,d),l.multiplyVec3(u,p),l.multiplyVec3(u,f),h.add(c,i),h.add(d,i),h.add(p,i),h.add(f,i),this.cameraLines2[0].push(c),this.cameraLines2[1].push(d),this.cameraLines2[2].push(p),this.cameraLines2[3].push(f);for(this.cameraLines3=[[i],[i],[i],[i]],s=256,b=(t.distance+12742e3*1.1)/s,x=.5*b*Math.tan(y),M=x*a.camera.getAspect(),w=0;w<s;w++)c=[-M,-x,-b],d=[M,-x,-b],p=[M,x,-b],f=[-M,x,-b],h.scale(c,w+1),h.scale(d,w+1),h.scale(p,w+1),h.scale(f,w+1),l.multiplyVec3(u,c),l.multiplyVec3(u,d),l.multiplyVec3(u,p),l.multiplyVec3(u,f),h.add(c,i),h.add(d,i),h.add(p,i),h.add(f,i),this.cameraLines3[0].push(c),this.cameraLines3[1].push(d),this.cameraLines3[2].push(p),this.cameraLines3[3].push(f);c=[-M,-x,-b],d=[M,-x,-b],p=[M,x,-b],f=[-M,x,-b],h.scale(c,s),h.scale(d,s),h.scale(p,s),h.scale(f,s),i=[0,0,0];var S=[i[0],i[1],i[2],c[0],c[1],c[2],d[0],d[1],d[2],i[0],i[1],i[2],d[0],d[1],d[2],p[0],p[1],p[2],i[0],i[1],i[2],p[0],p[1],p[2],f[0],f[1],f[2],i[0],i[1],i[2],f[0],f[1],f[2],c[0],c[1],c[2]],A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1];this.frustumState=e.createState({blend:!0,zwrite:!1,ztest:!0,culling:!1}),this.frustumMesh=e.createMesh({vertices:S,uvs:A,normals:C}),this.cameraGenarated=!0},u.prototype.itemButton=function(t,e){var i=this.core.getMap();if(i){var r=i.draw.replay;switch(t){case"DrawnTiles":r.storeTiles=!0;break;case"DrawnTilesFreeLayers":r.storeFreeTiles=!0;break;case"TracedNodes":r.storeNodes=!0;break;case"TracedNodesFreeLayers":r.storeFreeNodes=!0;break;case"LoadSequence":r.storeLoaded="S"==e,"S"==e?(r.loadedIndex=0,r.loaded=[]):(this.updateFileInfo(r.loadedIndex),this.updateLoadGraphs());break;case"Camera":if("S"==e){var s=r.camera={distance:i.camera.distance,position:i.camera.position.slice(),vector:i.camera.vector.slice(),center:i.camera.center.slice(),height:i.camera.height};r.cameraPos=i.getPosition(),this.generateCameraLines(s)}else r.cameraPos&&i.setPosition(r.cameraPos)}i.markDirty()}},u.prototype.switchItem=function(t,e){var i=document.getElementById(e),r=this.core.getMap();if(r){var s=r.draw.replay;switch(t){case"DrawnTiles":s.drawTiles=i.checked;break;case"DrawnTilesFreeLayers":s.drawFreeTiles=i.checked;break;case"TracedNodes":s.drawNodes=i.checked;break;case"TracedNodesFreeLayers":s.drawFreeNodes=i.checked;break;case"LoadSequence":s.drawLoaded=i.checked;break;case"Camera":this.cameraGenarated||this.itemButton("Camera"),this.drawCamera=i.checked;break;case"Globe":var a=this.core.getRenderer();if(!this.globeTexture){this.globeTexture=new o(a.gpu,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAEACAMAAADyTj5VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NDkxMSwgMjAxMy8xMC8yOS0xMTo0NzoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0Mzk4RkVFMzlGNjUxMUU2OTBDM0I0OEM1NjU0RURBMyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0Mzk4RkVFNDlGNjUxMUU2OTBDM0I0OEM1NjU0RURBMyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjQzOThGRUUxOUY2NTExRTY5MEMzQjQ4QzU2NTRFREEzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjQzOThGRUUyOUY2NTExRTY5MEMzQjQ4QzU2NTRFREEzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+5rvbhAAAAAZQTFRFwcHBLS0tMDfv/wAAAiZJREFUeNrs2LENAEEIA0HTf9ME5DTgIZn8ta+TnLjymzuW6kMIwIcQgA8hAAqAAmBdAM4O4E/wBPgQAqAAKAAKgAKgHcDZAegJoAAoAAqAAqAAaAdwdgB6AigACoACoAAoANoBnB2AngAKgAKgACgACoB2AGcHoCeAAqAAKAAKgAKgHcDZAegJoAAoAAqAAqAAaAdwdgB6AigACoACoAAoANoBnB2AngAKgAKgACgACoB2AGcHoCeAAqAAKAAKgAKgHcDZAegJoAAoAAqAAqAAaAdwdgB6AigACoACEIAPIQAfwg7g7AD0BFAAFAAFQAFQALQDODsAPQEUAAVAAVAAFADtAM4OQE8ABUABUAAUAAVAO4CzA9ATQAFQABQABUAB0A7g7AD0BFAAFAAFQAFQALQDODsAPQEUAAVAAVAAFADtAM4OQE8ABUABUAAUAAVAO4CzA9ATQAFQABQABUAB0A7g7AD0BFAAFAAFQAFQALQDODsAPQEUAAVAAVAAFADtAM4OQE8ABSAAH0IAPoQAfAgB0A7g7AD0BFAAFAAFQAFQALQDODsAPQEUAAVAAVAAFADtAM4OQE8ABUABUAAUAAVAO4CzA9ATQAFQABQABUAB0A7g7AD0BFAAFAAFQAFQALQDODsAPQEUAAVAAVAAFADtAM4OQE8ABUABUAAUAAVAO4CzA9ATQAFQABQABUAB0A7g7AD0BFAAFAAFQAFQAPxcAQYAZt2IEFFJhxsAAAAASUVORK5CYII=",this.core,null,!0)}this.drawGlobe=i.checked,this.drawGlobe=this.drawGlobe}r.markDirty()}},u.prototype.updateLoadGraphs=function(){var t=this.core.getMap();if(t){var e=t.draw.replay,i=e.loaded,r=e.loadedIndex;this.timeSlider.max=i.length;var s,a=340;this.ctxMeshes.fillStyle="#000000",this.ctxMeshes.fillRect(0,0,a,30),this.ctxTextures.fillStyle="#000000",this.ctxTextures.fillRect(0,0,a,30),this.ctxTextures2.fillStyle="#000000",this.ctxTextures2.fillRect(0,0,a,30),this.ctxGeodata.fillStyle="#000000",this.ctxGeodata.fillRect(0,0,a,30),this.ctxMetatiles.fillStyle="#000000",this.ctxMetatiles.fillRect(0,0,a,30),this.ctxIntervals.fillStyle="#000000",this.ctxIntervals.fillRect(0,0,a,30),this.ctxThreads.fillStyle="#000000",this.ctxThreads.fillRect(0,0,a,30);var n,o=Math.floor(e.loadedIndex/a)*a,h=339,l=o;for(o=0;o<h;o++)if(n=i[o+l]){switch(n.kind){case"mesh":s=this.ctxMeshes;break;case"texture-in":s=this.ctxTextures;break;case"texture-ex":s=this.ctxTextures2;break;case"geodata":s=this.ctxGeodata;break;case"metatile":s=this.ctxMetatiles;break;default:continue}var u=Math.round(Math.min(255,60+20*Math.max(1,n.duration/300)));s.fillStyle="rgb("+u+","+u+","+u+")";var c=n.duration/300*30;s.fillRect(o,30,1,-c),u=Math.round(Math.min(255,60+20*Math.max(1,n.interval/300))),this.ctxIntervals.fillStyle="rgb("+u+","+u+","+u+")",c=n.interval/300*30,this.ctxIntervals.fillRect(o,30,1,-c),this.ctxThreads.fillStyle="rgb(80,80,80)",c=n.threads/t.config.mapDownloadThreads*30,this.ctxThreads.fillRect(o,30,1,-c)}var d=Number.MAX_VALUE,p=0,f=0,g=0,m=Number.MAX_VALUE,v=0,y=0,b=0,x=Number.MAX_VALUE,M=0,w=0,S=0,A=Number.MAX_VALUE,C=0,T=0,P=0,E=Number.MAX_VALUE,L=0,k=0,I=0,N=Number.MAX_VALUE,F=0,B=0,R=0,_=Number.MAX_VALUE,D=0,U=0,z=0;for(h=i.length,o=0;o<h;o++)if(n=i[o]){switch(n.kind){case"mesh":n.duration<d&&(d=n.duration),n.duration>p&&(p=n.duration),f+=n.duration,g++;break;case"texture-in":n.duration<m&&(m=n.duration),n.duration>v&&(v=n.duration),y+=n.duration,b++;break;case"texture-ex":n.duration<x&&(x=n.duration),n.duration>M&&(M=n.duration),w+=n.duration,S++;break;case"geodata":n.duration<A&&(A=n.duration),n.duration>C&&(C=n.duration),T+=n.duration,P++;break;case"metatile":n.duration<E&&(E=n.duration),n.duration>L&&(L=n.duration),k+=n.duration,I++;break;default:continue}n.threads<N&&(N=n.threads),n.threads>F&&(F=n.threads),B+=n.threads,R++,n.threads<_&&(_=n.threads),n.threads>D&&(D=n.threads),U+=n.threads,z++}r-=l,this.ctxMeshes.fillStyle="#ff0000",this.ctxMeshes.fillRect(r-1,0,1,30),this.ctxMeshes.fillRect(r+1,0,1,30),this.ctxTextures.fillStyle="#ff0000",this.ctxTextures.fillRect(r-1,0,1,30),this.ctxTextures.fillRect(r+1,0,1,30),this.ctxTextures2.fillStyle="#ff0000",this.ctxTextures2.fillRect(r-1,0,1,30),this.ctxTextures2.fillRect(r+1,0,1,30),this.ctxGeodata.fillStyle="#ff0000",this.ctxGeodata.fillRect(r-1,0,1,30),this.ctxGeodata.fillRect(r+1,0,1,30),this.ctxMetatiles.fillStyle="#ff0000",this.ctxMetatiles.fillRect(r-1,0,1,30),this.ctxMetatiles.fillRect(r+1,0,1,30),this.ctxIntervals.fillStyle="#ff0000",this.ctxIntervals.fillRect(r-1,0,1,30),this.ctxIntervals.fillRect(r+1,0,1,30),this.ctxThreads.fillStyle="#ff0000",this.ctxThreads.fillRect(r-1,0,1,30),this.ctxThreads.fillRect(r+1,0,1,30),g||(d=0,p=0),b||(m=0,v=0),S||(x=0,M=0),P||(A=0,C=0),I||(E=0,L=0),R||(N=0,F=0),z||(_=0,D=0),f=g?f/g:0,y=b?y/b:0,w=S?w/S:0,T=P?T/P:0,k=I?k/I:0,U=z?U/z:0,B=R?B/R:0,this.infoMeshes.innerHTML="Meshes Min/Max/Avg/Count: "+d.toFixed(0)+"/"+p.toFixed(0)+"/"+f.toFixed(1)+"/"+g,this.infoTextures.innerHTML="Internal Textures Min/Max/Avg/Count: "+m.toFixed(0)+"/"+v.toFixed(0)+"/"+y.toFixed(1)+"/"+b,this.infoTextures2.innerHTML="External Textures Min/Max/Avg/Count: "+x.toFixed(0)+"/"+M.toFixed(0)+"/"+w.toFixed(1)+"/"+S,this.infoGeodata.innerHTML="Geodata Min/Max/Avg/Count: "+A.toFixed(0)+"/"+C.toFixed(0)+"/"+T.toFixed(1)+"/"+P,this.infoMetatiles.innerHTML="Metatiles Min/Max/Avg/Count: "+E.toFixed(0)+"/"+L.toFixed(0)+"/"+k.toFixed(1)+"/"+I,this.infoIntervals.innerHTML="Intervals Min/Max/Avg: "+_.toFixed(0)+"/"+D.toFixed(0)+"/"+U.toFixed(1),this.infoThreads.innerHTML="Threads Min/Max/Avg: "+N+"/"+F+"/"+B.toFixed(1)}},u.prototype.updateFileInfo=function(t){var e=this.core.getMap();if(e){var i=e.draw.replay,r=i.loaded[t];this.timeInfo.innerHTML=r?"Resource Kind: "+r.kind+"<br/>Time: "+r.time.toFixed(2)+"<br/>Duration: "+r.duration.toFixed(2)+"<br/>Interval: "+r.interval.toFixed(2)+"<br/>Priority: "+r.priority.toFixed(2)+"<br/>Threads: "+r.threads+"<br/>"+r.url:""}},u.prototype.buildReplayCombo=function(){if(this.core.getMap()){var t,e,i,r=[["Drawn Tiles",1],["Drawn Tiles - Free Layers",1],["Traced Nodes",1],["Traced Nodes - Free Layers",1],["Load Sequence",2],["Camera",2],["Globe",0]],s=["DrawnTiles","DrawnTilesFreeLayers","TracedNodes","TracedNodesFreeLayers","LoadSequence","Camera","Globe"],a="";for(t=0,e=r.length;t<e;t++)a+='<div id="vts-replay-item-'+s[t]+'" class="vts-replay-item"><input id="vts-replay-checkbox-'+s[t]+'" type="checkbox"/><span title='+r[t][0]+">"+r[t][0]+" </span>",r[t][1]>0&&(a+='<input id="vts-replay-sbutton-'+s[t]+'" type="button" value="S"/>'),r[t][1]>1&&(a+='<input id="vts-replay-fbutton-'+s[t]+'" type="button" value="'+("Camera"==s[t]?"R":"F")+'"/>'),a+="</div>";for(this.items.innerHTML=a,t=0,e=r.length;t<e;t++)i="vts-replay-checkbox-"+s[t],document.getElementById(i).onchange=this.switchItem.bind(this,s[t],i),r[t][1]>0&&(i="vts-replay-sbutton-"+s[t],document.getElementById(i).onclick=this.itemButton.bind(this,s[t],"S")),r[t][1]>1&&(i="vts-replay-fbutton-"+s[t],document.getElementById(i).onclick=this.itemButton.bind(this,s[t],"Camera"==s[t]?"R":"F"))}},e.a=u},function(t,e,i){"use strict";var r=i(13),s=function(t){this.inspector=t,this.core=t.core};s.prototype.init=function(){var t=this.inspector;t.addStyle('#vts-stats-panel {font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;display: none;padding:15px;width: 305px;font-size: 14px;position: absolute;right: 10px;top: 10px;cursor: default;background-color: rgba(255,255,255,0.95);border-radius: 5px;border: solid 1px #ccc;text-align: left;z-index: 7;padding: 10px;}#vts-stats-panel-info {margin-top: 5px;margin-bottom: 3px;overflow: hidden;}#vts-stats-panel-info table {color:#000000;text-align: left;font-size: 12px;}#vts-stats-panel-info table td {vertical-align: top;}#vts-stats-panel-pos {width: 100%;}'),this.element=document.createElement("div"),this.element.id="vts-stats-panel",this.element.innerHTML='<span id="vts-stats-panel-title">Render statistics v'+i.i(r.a)()+'</h3><p id="vts-stats-panel-info"></p><input id="vts-stats-panel-pos" type="text">',this.core.element.appendChild(this.element),this.infoElement=document.getElementById("vts-stats-panel-info"),this.posElement=document.getElementById("vts-stats-panel-pos"),this.element.addEventListener("mouseup",t.doNothing.bind(this),!0),this.element.addEventListener("mousedown",t.doNothing.bind(this),!0),this.element.addEventListener("mousewheel",t.doNothing.bind(this),!1),this.element.addEventListener("dblclick",t.doNothing.bind(this),!1),this.panelVisible=!1},s.prototype.showPanel=function(){this.element.style.display="block",this.panelVisible=!0},s.prototype.hidePanel=function(){this.element.style.display="none",this.panelVisible=!1},s.prototype.switchPanel=function(){this.panelVisible?this.hidePanel():this.showPanel()},s.prototype.updateStatsPanel=function(t){if(this.infoElement){for(var e=this.inspector,i="FPS: "+Math.round(t.fps)+"<br/>Render time: "+Math.round(1e3*t.renderTime)+"<br/> - resources: "+Math.round(t.gpuRenderUsed/1048576)+"MB<br/> - topdown: "+Math.round(t.gpuNeeded/1048576)+"MB<br/>GPU Cache: "+Math.round(t.gpuUsed/1048576)+"MB<br/> - textures: "+Math.round(t.gpuTextures/1048576)+"MB<br/> - meshes: "+Math.round(t.gpuMeshes/1048576)+"MB<br/> - geodata: "+Math.round(t.gpuGeodata/1048576)+"MB<br/>CPU Cache: "+Math.round(t.resourcesUsed/1048576)+"MB<br/>Metaile Cache: "+Math.round(t.metaUsed/1048576)+"MB<br/>Draw calls: "+t.drawCalls+"<br/>Polygons: "+t.drawnFaces+"<br/><br/>Terrain Height: "+t.heightTerrain.toFixed(2)+"<br/>- float: "+t.heightDelta.toFixed(2)+"<br/>- desired lod: "+t.heightLod.toFixed(2)+"<br/>- used lod: "+t.heightNode.toFixed(2)+"<br/>- used source: "+(2==t.heightClass?"navtile":1==t.heightClass?"node":"---")+"<br/>Terrain Radar Lod: "+e.radarLod+"<br/><br/>Loaded/Errors: "+t.loadedCount+" / "+t.loadErrorCount+"<br/>Load time: "+(.001*(t.loadLast-t.loadFirst)).toFixed(2)+"s <br/>",r="Metatiles: "+t.processedMetatiles+"<br/>Metanodes: "+t.processedNodes+" / "+t.usedNodes+"<br/>GeodataTiles: "+t.drawnGeodataTiles+"<br/>GVGeodataTiles: "+t.drawnGeodataTilesPerLayer+"<br/><br/>Tiles: "+t.drawnTiles+"<br/>",s=0,a=t.renderedLods.length;s<a;s++)t.renderedLods[s]&&(r+="LOD "+s+": "+t.renderedLods[s]+"<br/>");var n='<table style="width:305px"><tr><td>'+i+"</td><td>"+r+"</td></tr></table>";this.infoElement.innerHTML=n;var o=this.core.getMap();if(null!=o){var h=o.getPosition(),l="";l+=h.getViewMode()+",";var u=h.getCoords();l+=u[0]+","+u[1]+","+h.getHeightMode()+","+u[2].toFixed(2)+",";var c=h.getOrientation();l+=c[0].toFixed(2)+","+c[1].toFixed(2)+","+c[2].toFixed(2)+",",l+=h.getViewExtent().toFixed(2)+","+h.getFov().toFixed(2),this.posElement.value!=l&&(this.posElement.value=l)}}},e.a=s},function(t,e,i){"use strict";var r=function(t){this.inspector=t,this.core=t.core};r.prototype.init=function(){var t=this.inspector;t.addStyle('#vts-stylesheets-panel * {all: initial;}#vts-stylesheets-panel {font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;display: none;padding:15px;width: 1200px;height: 350px;font-size: 14px;position: absolute;right: 10px;bottom: 10px;cursor: default;background-color: rgba(255,255,255,0.95);border-radius: 5px;border: solid 1px #ccc;text-align: left;z-index: 7;padding: 10px;}#vts-stylesheets-panel-header {width: 100%;height: 28px;}#vts-stylesheets-panel-combo {font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;font-size: 13px;border: 1px solid #a9a9a9;width: 1070px;height: 17px;padding: 2px;margin-bottom: 5px;-webkit-appearance: menulist;-moz-appearance: menulist;}#vts-stylesheets-panel-combo option {font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;font-size: 13px;}#vts-stylesheets-panel-update-button {font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;font-size: 14px;float: right;background-color: #dedede;padding: 3px 2px 2px 2px;border: 1px solid #a0a0a0;border-radius: 2px;margin-right: 5px;}#vts-stylesheets-panel-hide-button {font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;font-size: 14px;float: right;background-color: #dedede;padding: 3px 2px 2px 2px;border: 1px solid #a0a0a0;border-radius: 2px;}#vts-stylesheets-panel-text {font-family: monospace;border: 1px solid #a9a9a9;padding: 2px 0px 0px 2px;width: 100%;height: 300px;resize: none;white-space: pre;}'),this.element=document.createElement("div"),this.element.id="vts-stylesheets-panel",this.element.innerHTML='<div id="vts-stylesheets-panel-header"><select id="vts-stylesheets-panel-combo"></select><button id="vts-stylesheets-panel-hide-button" type="button" title="Hide">Hide</button><button id="vts-stylesheets-panel-update-button" type="button" title="Update">Update</button></div><textarea id="vts-stylesheets-panel-text" rows="4" cols="50">aa\naa\n</textarea>',this.core.element.appendChild(this.element),this.optionsElement=document.getElementById("vts-stylesheets-panel-combo"),this.optionsElement.onchange=this.onComboSwitched.bind(this),this.textElement=document.getElementById("vts-stylesheets-panel-text"),document.getElementById("vts-stylesheets-panel-update-button").onclick=this.onUpdate.bind(this),document.getElementById("vts-stylesheets-panel-hide-button").onclick=this.hidePanel.bind(this),this.element.addEventListener("mouseup",t.doNothing.bind(this),!0),this.element.addEventListener("mousedown",t.doNothing.bind(this),!0),this.element.addEventListener("mousewheel",t.doNothing.bind(this),!1),this.element.addEventListener("dblclick",t.doNothing.bind(this),!1),this.textElement.addEventListener("keyup",t.doNothing.bind(this),!1),this.textElement.addEventListener("keydown",t.doNothing.bind(this),!1),this.panelVisible=!1},r.prototype.showPanel=function(){this.buildStylesheetsCombo(),this.element.style.display="block",this.panelVisible=!0},r.prototype.hidePanel=function(){this.element.style.display="none",this.panelVisible=!1},r.prototype.switchPanel=function(){this.panelVisible?this.hidePanel():this.showPanel()},r.prototype.onComboSwitched=function(){var t=this.core.getMap();if(t){var e=t.getStylesheet(this.optionsElement.value);this.textElement.value=this.niceStyleFormat(e)}},r.prototype.onUpdate=function(){var t=this.core.getMap();t&&t.setStylesheetData(this.optionsElement.value,JSON.parse(this.textElement.value))},r.prototype.niceStyleFormat=function(t){if(!t||!t.data)return"";t=t.data;var e="";e+="{\n";var i=[];t.constants&&i.push("constants"),t.bitmaps&&i.push("bitmaps"),t.fonts&&i.push("fonts"),t.layers&&i.push("layers");for(var r=0,s=i.length;r<s;r++){var a=i[r];e+=' "'+a+'": {\n';var n=t[a],o=[];for(var h in n)o.push(h);for(var l=0,u=o.length;l<u;l++)if("layers"==a){var c=n[o[l]],d=[];for(var p in c)d.push(p);e+=' "'+o[l]+'": {\n';for(var f=0,g=d.length;f<g;f++)e+=' "'+d[f]+'": '+JSON.stringify(c[d[f]])+(f==g-1?"":",")+"\n";e+=" }"+(l==u-1?"":",\n")}else e+=' "'+o[l]+'": '+JSON.stringify(n[o[l]])+(l==u-1?"":",")+"\n";e+="\n }"+(r==s-1?"":",\n")}return e+="\n}"},r.prototype.buildStylesheetsCombo=function(){var t=this.core.getMap();if(t){for(var e="",i=t.getStylesheets(),r=0,s=i.length;r<s;r++)e+='<option value="'+i[r]+'">'+i[r]+"</option>";this.optionsElement.innerHTML=e;var a=t.getStylesheet(i[0]);this.textElement.value=this.niceStyleFormat(a)}},e.a=r},function(t,e,i){"use strict";var r=function(t,e){this.map=t,this.maxCost=null!=e?e:Number.MAX_VALUE,this.skipCostCheck=!1,this.last=null,this.first=null,this.totalCost=0,this.totalItems=0};r.prototype.updateItem=function(t){if(null!=t&&this.first!=t){null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),this.last==t&&(this.last=t.prev);var e=this.first;this.first=t,this.first.next=e,this.first.prev=null,e.prev=this.first}},r.prototype.getMaxCost=function(){return this.maxCost},r.prototype.setMaxCost=function(t){this.maxCost=t,this.checkCost()},r.prototype.clear=function(){for(var t=this.first;null!=t;)null!=t.destructor&&t.destructor(),t=t.next;this.last=null,this.first=null,this.totalCost=0,this.totalItems=0},r.prototype.insert=function(t,e){this.totalItems++;var i={destructor:t,cost:e,prev:null,next:this.first};return null!=this.first&&(this.first.prev=i),this.first=i,null==this.last&&(this.last=i),this.totalCost+=e,this.checkCost(),i},r.prototype.remove=function(t){this.totalItems++;var e=!1;t==this.first&&(this.first=t.next,e=!0,null!=this.first&&(this.first.prev=null)),t==this.last&&(this.last=t.prev,e=!0,null!=this.last&&(this.last.next=null)),e||(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev)),this.totalCost-=t.cost,t.destructor(),this.checkCost()},r.prototype.checkCost=function(){if(!this.skipCostCheck)for(;this.totalCost>this.maxCost;){this.totalItems--;var t=this.last;if(null==t)break;this.last=this.last.prev,null!=this.last&&(this.last.next=null),this.totalCost-=t.cost,t.destructor()}},r.prototype.addItem=function(t,e){return this.insert(e,t)},r.prototype.removeItem=function(t){return this.remove(t)},r.prototype.itemUsed=function(t){return this.updateItem(t)},e.a=r},function(t,e,i){"use strict";var r=i(2),s=i(3),a=r.b,n=s.a,o=function(t){this.map=t,this.camera=t.renderer.camera,this.distance=10,this.distance2=10,this.position=[0,0,0],this.vector=[0,0,1],this.vector2=[0,0,1,1],this.center=[0,0,0],this.height=0,this.terrainHeight=0,this.lastTerrainHeight=0,this.near=2};o.prototype.update=function(){var t=this.map;t.position.check();var e=t.position.getHeight(),i=t.measure.getOptimalHeightLod(t.position.getCoords(),t.position.getViewExtent(),t.config.mapNavSamplesPerViewExtent),r=t.measure.getSurfaceHeight(t.position.getCoords(),i,!0);t.stats.heightTerrain=r[0],t.stats.heightDelta=e,"float"==t.position.getHeightMode()&&(e+=r[0]);var s=t.measure.getPositionCameraInfo(t.position,t.getNavigationSrs().isProjected());this.camera.setPosition(s.orbitCoords),this.camera.setRotationMatrix(s.rotMatrix),this.vector=s.vector,this.vector2=s.vector2,this.position=s.orbitCoords,this.height=s.orbitHeight+e,this.terrainHeight=this.height-r[0],this.distance2=t.position.getViewDistance(),this.distance=Math.max(this.terrainHeight,this.distance2),this.distance=n.clamp(this.distance,.1,this.camera.getFar()),this.distanceFactor=Math.tan(n.radians(.5*t.position.getFov())),this.perceivedDistance=Math.max(this.terrainHeight,this.distance2*this.distanceFactor),t.renderer.cameraDistance=this.distance,this.camera.setViewHeight(t.position.getViewExtent());var o=t.position.getCoords(),h=t.convert.convertCoords([o[0],o[1],e],"navigation","physical");if(this.center=[h[0],h[1],h[2]],h[0]+=s.orbitCoords[0],h[1]+=s.orbitCoords[1],h[2]+=s.orbitCoords[2],this.camera.setPosition([0,0,0]),this.position=h,this.vector2=[-h[0],-h[1],-h[2],1],a.normalize(this.vector2),this.mapIsProjected=t.getNavigationSrs().isProjected(),this.mapIsProjected)this.vector2[3]=0;else{this.geocentDistance=a.length(this.position);var l=[0,0,0];a.normalize(this.position,l),this.geocentNormal=l}var u=Math.max(this.height,this.distance)/6e5,c=Math.max(this.near,this.near*(20*u));u=Math.max(1,u);var d=10*u*6e5;return this.camera.setParams(.5*t.position.getFov(),c,2*d),s},o.prototype.getCameraHeight=function(){return this.cameraHeight},o.prototype.getMvpMatrix=function(){return this.camera.getMvpMatrix()},o.prototype.getRotationMatrix=function(){return this.camera.getRotationMatrix()},o.prototype.getRotationviewMatrix=function(){return this.camera.getRotationviewMatrix()},o.prototype.getFar=function(){return this.camera.getFar()},o.prototype.getFov=function(){return this.camera.getFov()},o.prototype.getAspect=function(){return this.camera.getAspect()},e.a=o},function(t,e,i){"use strict";var r=i(46),s=i(30),a=i(143),n=i(55),o=i(49),h=i(53),l=i(153),u=i(50),c=s.a,d=r.a,p=a.a,f=n.a,g=o.a,m=h.a,v=l.a,y=u.a,b=function(t,e){this.map=t,this.mapConfig=e,this.parseConfig()};b.prototype.parseConfig=function(){this.parseSrses()&&this.parseReferenceFrame()&&this.parseCredits()&&this.parseStylesheets()&&this.parseSurfaces()&&this.parseGlues()&&this.parseVirtualSurfaces()&&this.parseBoundLayers()&&this.parseFreeLayers()&&this.parseViews()&&this.parseParams()&&this.parseBrowserOptions();var t=this.map.stats;t.loadedCount=0,t.loadErrorCount=0,t.loadFirst=performance.now(),t.loadLast=this.map.loadFirst},b.prototype.afterConfigParsed=function(){null!=this.mapConfig.position&&this.map.setPosition(this.mapConfig.position,!1),this.map.setView(this.map.initialView)},b.prototype.parseSrses=function(){var t=this.mapConfig.srses;if(this.map.srses={},null==t)return!1;for(var e in t)this.map.addSrs(e,new g(this.map,e,t[e]));return!0},b.prototype.parseReferenceFrame=function(){var t=this.mapConfig.referenceFrame;return null!=t&&(this.map.referenceFrame=new p(this.map,t),!!this.map.referenceFrame.valid)},b.prototype.parseCredits=function(){var t=this.mapConfig.credits;if(this.map.credits={},null==t)return!1;for(var e in t)this.map.addCredit(e,new c(this.map,t[e]));return!0},b.prototype.parseSurfaces=function(){var t=this.mapConfig.surfaces;if(this.map.surfaces=[],null==t)return!1;for(var e=0,i=t.length;e<i;e++){var r=new m(this.map,t[e]);this.map.addSurface(r.id,r)}return!0},b.prototype.parseVirtualSurfaces=function(){var t=this.mapConfig.virtualSurfaces;if(this.map.virtualSurfaces=[],!this.map.config.mapVirtualSurfaces)return!0;if(null==t)return!0;for(var e=0,i=t.length;e<i;e++){var r=new v(this.map,t[e]);this.map.virtualSurfaces[r.strId]=r}return!0},b.prototype.parseViews=function(){var t=this.mapConfig.namedViews;if(this.map.namedViews=[],null!=t)for(var e in t)this.map.addNamedView(e,new f(this.map,t[e]));var i=this.mapConfig.view;return null==i||(this.map.initialView=JSON.parse(JSON.stringify(i)),!0)},b.prototype.parseGlues=function(){var t=this.mapConfig.glue;if(this.map.glues=[],null==t)return!0;for(var e=0,i=t.length;e<i;e++){var r=new m(this.map,t[e],"glue");this.map.addGlue(r.id.join(";"),r)}return!0},b.prototype.parseBoundLayers=function(){var t=this.mapConfig.boundLayers;if(this.map.boundLayers=[],null==t)return!0;for(var e in t){var i=new d(this.map,t[e],e);this.map.addBoundLayer(e,i)}return!0},b.prototype.parseFreeLayers=function(){var t=this.mapConfig.freeLayers;if(this.map.freeLayers=[],null==t)return!0;for(var e in t){var i=new m(this.map,t[e],"free");this.map.addFreeLayer(e,i)}return!0},b.prototype.parseStylesheets=function(){var t=this.mapConfig.stylesheets;if(this.map.stylesheets=[],null==t)return!0;for(var e in t){var i=new y(this.map,e,t[e]);this.map.addStylesheet(e,i)}return!0},b.prototype.parseParams=function(){return!0},b.prototype.parseBrowserOptions=function(){var t=this.mapConfig.browserOptions;return this.map.browserOptions={},null==t||(this.map.browserOptions=JSON.parse(JSON.stringify(t)),!0)},b.prototype.cloneConfig=function(){return JSON.parse(JSON.stringify(this.mapConfig))},e.a=b},function(t,e,i){"use strict";var r=i(2),s=i(3),a=i(23),n=i.n(a),o=r.e,h=s.a,l=n.a,u=function(t){this.map=t,this.config=t.config,this.measure=t.measure,this.isProjected=this.map.getNavigationSrs().isProjected()};u.prototype.convertCoords=function(t,e,i){return this.map.referenceFrame.convertCoords(t,e,i)},u.prototype.movePositionCoordsTo=function(t,e,i,r){var s=t.getCoords(),a=this.map.getNavigationSrs().getSrsInfo();if(r=null==r?1:r,this.isProjected){var n=h.radians(e),o=[-Math.sin(n),Math.cos(n)];t.setCoords2([s[0]+o[0]*i,s[1]+o[1]*i])}else{var u=new l.Geodesic.Geodesic(a.a,a.a/a.b-1),c=u.Direct(s[1],s[0],e,i);t.setCoords2([c.lon2,c.lat2]);var d=t.getOrientation();d[0]-=(c.azi1-c.azi2)*r,t.setOrientation(d)}return t},u.prototype.convertPositionViewMode=function(t,e){if(e==t.pos[0])return t;if("obj"==e){if("float"==t.getHeightMode()){var i=!0;this.convertPositionHeightMode(t,"fix",!0)}var r,s=t.getViewDistance(),a=t.getOrientation(),n=h.radians(-a[1]),o=s*Math.sin(n);if(s*=Math.cos(n),this.isProjected){var l=h.radians(a[0]),u=[-Math.sin(l),Math.cos(l)];r=t.getCoords(),r[0]=r[0]+u[0]*s,r[1]=r[1]+u[1]*s}else this.movePositionCoordsTo(t,-a[0],s),r=t.getCoords();r[2]-=o,t.setCoords(r),i&&this.convertPositionHeightMode(t,"float",!0)}else"subj"==e&&(r=this.getPositionCameraCoords(t,t.getHeightMode()),t.setCoords(r));return t.pos[0]=e,t},u.prototype.convertPositionHeightMode=function(t,e,i){if(t.pos[3]==e)return t;var r=this.measure.getOptimalHeightLod(t.getCoords(),t.getViewExtent(),this.config.mapNavSamplesPerViewExtent),s=this.measure.getSurfaceHeight(t.getCoords(),r);return s[1],"float"==e?(t.pos[3]=e,t.pos[4]=t.pos[4]-s[0]):"fix"==e&&(t.pos[3]=e,t.pos[4]=t.pos[4]+s[0]),t},u.prototype.getPositionCameraCoords=function(t,e){var i=t.getOrientation(),r=o.create();o.multiply(h.rotationMatrix(2,h.radians(-i[0])),h.rotationMatrix(0,h.radians(i[1])),r);var s,a,n=0,l=-1;if("obj"==t.getViewMode()){s=t.getCoords(),"float"==t.getHeightMode()&&(l=this.measure.getOptimalHeightLod(s,t.getViewExtent(),this.config.mapNavSamplesPerViewExtent),a=this.measure.getSurfaceHeight(s,l),n=a[0]);var u=this.measure.getPositionCameraInfo(t,this.isProjected);if(this.isProjected)s[0]+=u.orbitCoords[0],s[1]+=u.orbitCoords[1],s[2]+=u.orbitCoords[2]+n;else{var c=this.convertCoords([s[0],s[1],s[2]+n],"navigation","physical");c[0]+=u.orbitCoords[0],c[1]+=u.orbitCoords[1],c[2]+=u.orbitCoords[2],s=this.convertCoords(c,"physical","navigation")}return"fix"==e?s:(-1==l&&(l=this.measure.getOptimalHeightLod(s,t.getViewExtent(),this.config.mapNavSamplesPerViewExtent)),a=this.measure.getSurfaceHeight(s,l),s[2]-=a[0],s)}return t.getHeightMode()==e?t.getCoords():(l=this.measure.getOptimalHeightLod(t.getCoords(),t.getViewExtent(),this.config.mapNavSamplesPerViewExtent),a=this.measure.getSurfaceHeight(t.getCoords(),l),s=t.getCoords(),"fix"==e?s[2]+=a[0]:s[2]-=a[0],s)},u.prototype.getPositionNavCoordsFromPublic=function(t,e){var i=t.getCoords();if("float"==t.getHeightMode()){e=null!=e?e:this.measure.getOptimalHeightLod(t.getCoords(),t.getViewExtent(),this.config.mapNavSamplesPerViewExtent);var r=this.measure.getSurfaceHeight(t.getCoords(),e);i[2]+=r[0]}return this.convertCoords(i,"public","navigation")},u.prototype.getPositionPublicCoords=function(t,e){var i=t.getCoords();if("float"==t.getHeightMode()){e=null!=e?e:this.measure.getOptimalHeightLod(t.getCoords(),t.getViewExtent(),this.config.mapNavSamplesPerViewExtent);var r=this.measure.getSurfaceHeight(t.getCoords(),e);i[2]+=r[0]}return this.convertCoords(i,"navigation","public")},u.prototype.getPositionPhysCoords=function(t,e){var i=t.getCoords();if("float"==t.getHeightMode()){e=null!=e?e:this.measure.getOptimalHeightLod(t.getCoords(),t.getViewExtent(),this.config.mapNavSamplesPerViewExtent);var r=this.measure.getSurfaceHeight(t.getCoords(),e);i[2]+=r[0]}return this.convertCoords(i,"navigation","physical")},u.prototype.getPositionCameraSpaceCoords=function(t,e){var i=t.getCoords();if("float"==t.getHeightMode()){e=null!=e?e:this.measure.getOptimalHeightLod(t.getCoords(),t.getViewExtent(),this.config.mapNavSamplesPerViewExtent);var r=this.measure.getSurfaceHeight(t.getCoords(),e);i[2]+=r[0]}var s=this.convertCoords(i,"navigation","physical"),a=this.map.camera.position;return s[0]-=a[0],s[1]-=a[1],s[2]-=a[2],s},u.prototype.getPositionCanvasCoords=function(t,e,i){var r;if(i){var s=this.map.camera.position,a=t.getCoords();r=[a[0]-s[0],a[1]-s[1],a[2]-s[2]]}else r=this.getPositionCameraSpaceCoords(t,e);return this.map.renderer.project2(r,this.map.camera.getMvpMatrix())},u.prototype.convertCoordsFromPhysToNav=function(t,e,i){if(t=this.convertCoords(t,"physical","navigation"),"float"==e){i=null!=i?i:this.measure.getOptimalHeightLod(t,10,this.config.mapNavSamplesPerViewExtent);var r=this.measure.getSurfaceHeight(t,i);t[2]-=r[0]}return t},e.a=u},function(t,e,i){"use strict";var r=function(t,e,i,r,s,a){this.map=t,this.id=e,this.srs=this.map.getMapsSrs(i),this.extents=r,this.heightRange=s,this.partitioning=a,this.isPole=1==e[0]&&(0==e[1]&&1==e[2]||1==e[1]&&0==e[2])};r.prototype.getInnerCoords=function(t){return this.srs.convertCoordsFrom(t,this.map.getNavigationSrs())},r.prototype.getOuterCoords=function(t){return this.srs.convertCoordsTo(t,this.map.getNavigationSrs())},r.prototype.getPhysicalCoords=function(t,e){return this.srs.convertCoordsTo(t,this.map.getPhysicalSrs(),e)},r.prototype.getPhysicalCoordsFast=function(t,e,i,r,s){return this.srs.convertCoordsToFast(t,this.map.getPhysicalSrs(),e,i,r,s)},r.prototype.getExtents=function(t){return this.srs.convertCoordsFrom(t,this.map.getNavigationSrs())},e.a=r},function(t,e,i){"use strict";var r=i(47),s=r.a,a=function(t,e){this.map=t,this.config=t.config,this.isProjected=this.map.getNavigationSrs().isProjected(),this.stats=t.stats,this.draw=e,this.debug=e.debug,this.core=t.core,this.camera=t.camera,this.renderer=t.renderer,this.getTextSize=this.renderer.draw.getTextSize.bind(this.renderer.draw),this.drawText=this.renderer.draw.drawText.bind(this.renderer.draw)};a.prototype.drawSurfaceTile=function(t,e,i,r,s,a,n,o){if(this.stats.gpuRenderUsed>=this.draw.maxGpuUsed)return!1;if(t.renderReady=!1,t.surface){if(e.hasGeometry()){if(this.debug.drawBBoxes&&!a&&(!t.surface.geodata&&this.debug.drawGeodataOnly||this.drawTileInfo(t,e,i,t.surfaceMesh,r)),this.debug.heightmapOnly&&!a)return t.surface.geodata||t.drawGrid(i),!0;if(!a&&(this.stats.renderedLods[t.id[0]]++,this.stats.drawnTiles++,t.surface.geodata)){var h=this.renderer.project2([.25*(e.bbox2[12]+e.bbox2[15]+e.bbox2[18]+e.bbox2[21])-i[0],.25*(e.bbox2[13]+e.bbox2[16]+e.bbox2[19]+e.bbox2[22])-i[1],.25*(e.bbox2[14]+e.bbox2[17]+e.bbox2[20]+e.bbox2[23])-i[2]],this.camera.getMvpMatrix());h[0]<0||h[1]<0||h[0]>this.renderer.curSize[0]||h[1]>this.renderer.curSize[1]||(this.stats.drawnGeodataTilesPerLayer++,this.stats.drawnGeodataTilesFactor+=Math.pow(Math.abs(t.tiltAngle*t.texelSize),.5)),this.stats.drawnGeodataTiles++}var l=0;do{if(t.resetDrawCommands){if(t.drawCommands=[[],[],[]],t.updateBounds=!0,t.bounds)for(var u in t.bounds)t.bounds[u].viewCoutner=0;t.resetDrawCommands=!1}var c;if(c=t.surface.geodata?this.drawGeodataTile(t,e,i,r,s,a,n,o):this.drawMeshTile(t,e,i,r,s,a,n,o),++l>10)break}while(t.resetDrawCommands);return c}return!0}if(!a&&t.lastRenderState){var d=this.draw.drawChannel;return this.draw.processDrawCommands(i,t.lastRenderState.drawCommands[d],s,!0),this.map.applyCredits(t),!0}},a.prototype.drawMeshTile=function(t,e,i,r,s,a,n,o){var h;if(!t.surfaceMesh){if(t.resourceSurface.virtual)return!0;h=t.resourceSurface.getMeshUrl(t.id),t.surfaceMesh=t.resources.getMesh(h,t)}var l,u,c,d=this.draw,p=d.drawChannel,f=!1;if(t.drawCommands[p].length>0&&this.draw.areDrawCommandsReady(t.drawCommands[p],s,n,o))return a||(d.processDrawCommands(i,t.drawCommands[p],s),this.map.applyCredits(t)),t.lastRenderState=null,!0;if(t.lastRenderState)if(t.surfaceMesh.isReady(!0,s,o)){if(t.drawCommands[p].length>0)return a||(d.processDrawCommands(i,t.lastRenderState.drawCommands[p],s,!0),this.map.applyCredits(t)),!0}else a||(d.processDrawCommands(i,t.lastRenderState.drawCommands[p],s,!0),this.map.applyCredits(t)),f=!0;if(t.drawCommands[p].length>0)return!(!this.config.mapHeightfiledWhenUnloaded||a)&&(t.drawGrid(i),!1);if(t.surfaceMesh.isReady(n,s,o)&&!n){var g=t.surfaceMesh.submeshes;t.drawCommands=[[],[],[]],t.imageryCredits={},t.boundsDebug={};var m,v,y,b,x,M,w,S=0;if(w=t.resourceSurface,w||(w=t.surface),w.glue){var A=w.id;for(m=0,v=A.length;m<v;m++){var C=this.map.getSurface(A[m]);C&&(S=Math.max(S,C.specificity))}for(x=0,M=e.credits.length;x<M;x++)t.glueImageryCredits[e.credits[x]]=S}else for(S=w.specificity,x=0,M=e.credits.length;x<M;x++)t.imageryCredits[e.credits[x]]=S;for(m=0,v=g.length;m<v;m++){var T=g[m];if(this.debug.drawBBoxes&&this.debug.drawMeshBBox&&!a&&T.drawBBox(i),T.externalUVs){if(t.updateBounds&&(t.updateBounds=!1,this.updateTileBounds(t,g)),w=t.resourceSurface,t.resourceSurface.glue&&(w=t.resourceSurface.getSurfaceReference(T.surfaceReference)),null!=w){var P=t.bounds[w.id];if(P)if(T.externalUVs)if(P.sequence.length>0)if(P.transparent){T.internalUVs&&(null==t.surfaceTextures[m]&&(h=t.resourceSurface.getTextureUrl(t.id,m),t.surfaceTextures[m]=t.resources.getTexture(h,null,null,null,t,!0)),t.drawCommands[0].push({type:2,mesh:t.surfaceMesh,submesh:m,texture:t.surfaceTextures[m],material:5})),t.drawCommands[0].push({type:1,state:d.drawBlendedTileState});var E=P.sequence;for(y=0,b=E.length;y<b;y++)if(l=t.boundTextures[E[y]]){for(t.boundsDebug[w.id]||(t.boundsDebug[w.id]=[]),t.boundsDebug[w.id].push(E[y]),u=t.boundLayers[E[y]],c=u.credits,x=0,M=c.length;x<M;x++)t.imageryCredits[c[x]]=u.specificity;t.drawCommands[0].push({type:2,mesh:t.surfaceMesh,submesh:m,texture:l,material:7,alpha:P.alpha[E[y]][1]})}t.drawCommands[0].push({type:2,mesh:t.surfaceMesh,submesh:m,texture:null,material:3}),t.drawCommands[0].push({type:1,state:d.drawTileState})}else{var L=P.sequence[P.sequence.length-1];if(l=t.boundTextures[L]){for(t.boundsDebug[w.id]||(t.boundsDebug[w.id]=[]),t.boundsDebug[w.id].push(L),u=t.boundLayers[L],c=u.credits,x=0,M=c.length;x<M;x++)t.imageryCredits[c[x]]=u.specificity;t.drawCommands[0].push({type:2,mesh:t.surfaceMesh,submesh:m,texture:l,material:6})}}else if(T.textureLayer){if((u=this.map.getBoundLayerByNumber(T.textureLayer))&&(l=t.boundTextures[u.id])){for(t.boundsDebug[w.id]||(t.boundsDebug[w.id]=[]),t.boundsDebug[w.id].push(u.id),u=t.boundLayers[u.id],c=u.credits,x=0,M=c.length;x<M;x++)t.imageryCredits[c[x]]=u.specificity;t.drawCommands[0].push({type:2,mesh:t.surfaceMesh,submesh:m,texture:l,material:6})}}else T.internalUVs?(null==t.surfaceTextures[m]&&(h=t.resourceSurface.getTextureUrl(t.id,m),t.surfaceTextures[m]=t.resources.getTexture(h,null,null,null,t,!0)),t.drawCommands[0].push({type:2,mesh:t.surfaceMesh,submesh:m,texture:t.surfaceTextures[m],material:4})):t.drawCommands[0].push({type:2,mesh:t.surfaceMesh,submesh:m,texture:null,material:2});else T.internalUVs&&(null==t.surfaceTextures[m]&&(h=t.resourceSurface.getTextureUrl(t.id,m),t.surfaceTextures[m]=t.resources.getTexture(h,null,null,null,t,!0)),t.drawCommands[0].push({type:2,mesh:t.surfaceMesh,submesh:m,texture:t.surfaceTextures[m],material:4}))}}else T.internalUVs&&(null==t.surfaceTextures[m]&&(h=t.resourceSurface.getTextureUrl(t.id,m),t.surfaceTextures[m]=t.resources.getTexture(h,null,null,null,t,!0)),t.drawCommands[0].push({type:2,mesh:t.surfaceMesh,submesh:m,texture:t.surfaceTextures[m],material:4}));t.drawCommands[1].push({type:2,mesh:t.surfaceMesh,submesh:m,material:1})}if(t.resetDrawCommands)return!1;if(d.areDrawCommandsReady(t.drawCommands[p],s,n,o)){if(t.resetDrawCommands)return!1;a||(d.processDrawCommands(i,t.drawCommands[p],s),this.map.applyCredits(t)),t.lastRenderState=null,f=!0}else t.lastRenderState?(a||(d.processDrawCommands(i,t.lastRenderState.drawCommands[p],s,!0),this.map.applyCredits(t)),f=!0):this.config.mapHeightfiledWhenUnloaded&&!a&&(t.drawGrid(i),f=!(t.drawCommands[p].length>0))}else this.config.mapHeightfiledWhenUnloaded&&!a&&(t.drawGrid(i),f=!(t.drawCommands[p].length>0));return f},a.prototype.drawGeodataTile=function(t,e,i,r,a,n,o,h){if(t.id[0]<=1)return!0;if(null==t.surfaceGeodata){var l;if(t.surface.geodataNavtileInfo){var u=this.tree.findNavTile(t.id);if(u&&u.surface){var c=u.surface.getNavUrl(u.id)+";"+u.id[0]+"-"+u.id[1]+"-"+u.id[2]+";"+u.metanode.minHeight+";"+u.metanode.maxHeight;l=t.surface.getGeodataUrl(t.id,encodeURIComponent(c))}}l||(l=t.resourceSurface.getGeodataUrl(t.id,"")),t.surfaceGeodata=t.resources.getGeodata(l,{tile:t,surface:t.surface})}var d=this.draw.drawChannel;if(t.geodataCounter!=t.surface.geodataCounter&&(t.drawCommands=[[],[],[]],null!=t.surfaceGeodataView&&t.surfaceGeodataView.kill(),t.surfaceGeodataView=null,t.geodataCounter=t.surface.geodataCounter),t.drawCommands[d].length>0&&this.draw.areDrawCommandsReady(t.drawCommands[d],a,o,h))return n||(this.draw.processDrawCommands(i,t.drawCommands[d],a),this.map.applyCredits(t)),t.lastRenderState=null,!0;if(t.surfaceGeodataView||t.surfaceGeodata.isReady(o,a,h)&&!o&&(t.surfaceGeodataView=new s(this.map,t.surfaceGeodata,{tile:t,surface:t.surface})),t.surfaceGeodataView){t.mapdataCredits={};for(var p=t.surface?t.surface.specificity:0,f=0,g=e.credits.length;f<g;f++)t.mapdataCredits[e.credits[f]]=p;return t.drawCommands[d][0]={type:3,geodataView:t.surfaceGeodataView},t.surfaceGeodataView.isReady()}return!1},a.prototype.updateTileBounds=function(t,e){for(var i=0,r=e.length;i<r;i++){var s=e[i];if(s.externalUVs){var a=t.resourceSurface;if(t.resourceSurface.glue&&(a=t.resourceSurface.getSurfaceReference(s.surfaceReference)),a){var n=t.bounds[a.id];n||(n={sequence:[],alpha:[],transparent:!1,viewCoutner:0},t.bounds[a.id]=n),n.viewCoutner!=t.viewCoutner&&this.updateTileSurfaceBounds(t,s,a,n,n.viewCoutner!=t.viewCoutner)}}}for(var o in t.bounds)t.bounds[o].viewCoutner=t.viewCoutner},a.prototype.getParentTile=function(t,e){for(;t&&t.id[0]>e;)t=t.parent;return t},a.prototype.getTileTextureTransform=function(t,e){var i=e.id[0]-t.id[0],r=t.id[1]<<i,s=t.id[2]<<i,a=1/Math.pow(2,i);return[a,a,(e.id[1]-r)*a,(e.id[2]-s)*a]},a.prototype.updateTileSurfaceBounds=function(t,e,i,r,s){var a,n,o,h;if(i.boundLayerSequence.length>0){if(s){r.sequence=[];for(var l=[],u=[],c=0,d=0,p=i.boundLayerSequence.length;d<p;d++)if((o=i.boundLayerSequence[d][0])&&o.ready&&o.hasTileOrInfluence(t.id)&&i.boundLayerSequence[d][1]>0){if(n=null,t.id[0]>o.lodRange[1]&&(n={sourceTile:this.getParentTile(t,o.lodRange[1]),sourceTexture:null,layer:o,tile:t}),h=t.boundTextures[o.id],h||(a=o.getUrl(t.id),h=t.resources.getTexture(a,null,n,{tile:t,layer:o},t,!1),1==h.checkType&&(h.checkMask=!0),h.isReady(!0),t.boundTextures[o.id]=h),h.neverReady)continue;var f=!1,g=!1;h.isMaskPosible()&&(h.isMaskInfoReady()?h.getMaskTexture()&&(r.transparent=!0,f=!0):(g=!0,f=!0)),u.push(f);var m=!(i.boundLayerSequence[d][1]<1||f||o.isTransparent);if(m&&c++,l.push(m),r.sequence.push(o.id),r.alpha[o.id]=i.boundLayerSequence[d],t.boundLayers[o.id]=o,(r.alpha[o.id][1]<1||o.isTransparent)&&(r.transparent=!0),g)break}if(c>0){for(var v=[],y=r.sequence.length-1;y>=0;y--){var b=r.sequence[y];if(l[y]){v.unshift(b);break}h=t.boundTextures[b],(r.alpha[b][1]<1||t.boundLayers[b].isTransparent||u[y])&&v.unshift(b)}r.sequence=v}}}else null!=i.textureLayer?s&&(o=this.map.getBoundLayerById(i.textureLayer))&&o.hasTileOrInfluence(t.id)&&(n=null,t.id[0]>o.lodRange[1]&&(n={sourceTile:this.getParentTile(t,o.lodRange[1]),sourceTexture:null,layer:o,tile:t}),r.sequence.push(o.id),t.boundLayers[o.id]=o,t.boundTextures[o.id]||(a=o.getUrl(t.id),t.boundTextures[o.id]=t.resources.getTexture(a,null,n,{tile:t,layer:o},t,!1))):0!=e.textureLayer&&(o=this.map.getBoundLayerByNumber(e.textureLayer))&&o.hasTileOrInfluence(t.id)&&(n=null,t.id[0]>o.lodRange[1]&&(n={sourceTile:this.getParentTile(t,o.lodRange[1]),sourceTexture:null,layer:o,tile:t}),t.boundLayers[o.id]=o,t.boundTextures[o.id]||(a=o.getUrl(t.id),t.boundTextures[o.id]=t.resources.getTexture(a,null,n,{tile:t,layer:o},t,!1)))},a.prototype.drawTileInfo=function(t,e,i,r){var s,a=this.debug;if(a.drawMeshBBox||e.drawBBox(i),e.metatile.useVersion<4){var n=e.bbox.min,o=e.bbox.max;s=this.core.getRendererInterface().getCanvasCoords([n[0]+.5*(o[0]-n[0])-i[0],n[1]+.5*(o[1]-n[1])-i[1],o[2]-i[2]],this.camera.getMvpMatrix()),s[2]=.9992*s[2]}else{var h=e.bbox2[3]-e.bbox2[0],l=e.bbox2[4]-e.bbox2[1],u=e.bbox2[5]-e.bbox2[2],c=Math.sqrt(h*h+l*l+u*u);s=this.core.getRendererInterface().getCanvasCoords([.25*(e.bbox2[12]+e.bbox2[15]+e.bbox2[18]+e.bbox2[21])+e.diskNormal[0]*c*.1-i[0],.25*(e.bbox2[13]+e.bbox2[16]+e.bbox2[19]+e.bbox2[22])+e.diskNormal[1]*c*.1-i[1],.25*(e.bbox2[14]+e.bbox2[17]+e.bbox2[20]+e.bbox2[23])+e.diskNormal[2]*c*.1-i[2]],this.camera.getMvpMatrix())}var d,p,f,g=a.debugTextSize;if(a.drawLods&&(d=t.id[0]+" c:"+(Math.pow(Math.abs(t.tiltAngle*t.texelSize),.5)/Math.max(1e-5,this.renderer.drawnGeodataTilesFactor)*50).toFixed(3)+" l:"+Math.pow(Math.abs(t.tiltAngle*t.texelSize),.5).toFixed(3)+" g:"+this.renderer.drawnGeodataTilesFactor.toFixed(3),this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]-4*g),4*g,d,[1,0,0,1],s[2])),a.drawIndices&&(d=t.id[1]+" "+t.id[2],this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]-11*g),4*g,d,[0,1,1,1],s[2])),a.drawPositions&&(d="llx:"+Math.floor(e.llx)+" lly:"+Math.floor(e.lly)+" urx:"+Math.floor(e.urx)+" ury:"+Math.floor(e.ury),this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+3*g),4*g,d,[0,1,1,1],s[2])),a.drawFaceCount&&r&&(d=r.faces+" - "+r.submeshes.length+(t.surface&&t.surface.glue?" - 1":" - 0"),this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+10*g),4*g,d,[0,1,0,1],s[2])),a.drawOrder&&(d=this.drawTileCounter+" cmds: "+t.drawCommands[0].length,this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+10*g),4*g,d,[0,1,0,1],s[2])),a.drawSurfaces&&(d=JSON.stringify(t.surface.id),e.alien&&(d="[A]"+d),this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+10*g),4*g,d,[1,1,1,1],s[2])),a.drawBoundLayers&&t.boundsDebug){var m=t.resourceSurface;if(m.glue)for(p=0,f=m.id.length;p<f;p++)t.boundsDebug[m.id[p]]&&(d="< "+m.id[p]+" >",this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+(10+7*p*2)*g),4*g,d,[1,1,1,1],s[2]),d=JSON.stringify(t.boundsDebug[m.id[p]]),this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+(17+7*p*2)*g),4*g,d,[1,1,1,1],s[2]));else t.boundsDebug[m.id]&&(d="< "+m.id+" >",this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+10*g),4*g,d,[1,1,1,1],s[2]),d=JSON.stringify(t.boundsDebug[m.id]),this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+17*g),4*g,d,[1,1,1,1],s[2]))}if(a.drawCredits){d="{ ";for(var v in t.imageryCredits)t.imageryCredits[v]&&(d+=v+":"+t.imageryCredits[v]+", ");for(v in t.glueImageryCredits)t.imageryCredits[v]||(d+=v+":"+t.glueImageryCredits[v]+", ");d+="}",this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+10*g),4*g,d,[1,1,1,1],s[2])}if(a.drawDistance&&(d=t.distance.toFixed(2)+" "+t.texelSize.toFixed(3)+" "+e.pixelSize.toFixed(3),d+="--"+t.texelSize2.toFixed(3),this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+17*g),4*g,d,[1,0,1,1],s[2])),a.drawNodeInfo){var y=(240&e.flags)>>4;d="v"+e.metatile.version+"-"+e.flags.toString(2)+"-"+(1&y?"1":"0")+(2&y?"1":"0")+(4&y?"1":"0")+(8&y?"1":"0"),d+="-"+e.minHeight+"/"+e.maxHeight+"-"+Math.floor(e.minZ)+"/"+Math.floor(e.maxZ)+"-"+Math.floor(e.surrogatez),this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]-18*g),4*g,d,[1,0,1,1],s[2])}if(a.drawTextureSize&&r){var b=r.submeshes;for(p=0,f=b.length;p<f;p++)if(b[p].internalUVs){var x=t.surfaceTextures[p];if(x){var M=x.getGpuTexture();M&&(d="["+p+"]: "+M.width+" x "+M.height,this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+(17+4*p*2)*g),4*g,d,[1,1,1,1],s[2]))}}else d="["+p+"]: 256 x 256",this.drawText(Math.round(s[0]-.5*this.getTextSize(4*g,d)),Math.round(s[1]+(17+4*p*2)*g),4*g,d,[1,1,1,1],s[2])}},e.a=a},function(t,e,i){"use strict";var r=i(2),s=i(3),a=i(48),n=i(47),o=i(129),h=r.b,l=s.a,u=o.a,c=n.a,d=a.a,p=function(t){this.map=t,this.config=t.config,this.isProjected=t.getNavigationSrs().isProjected(),this.isGeocent=t.isGeocent,this.renderer=t.renderer,this.stats=t.stats,this.camera=t.camera,this.tree=t.tree,this.ndcToScreenPixel=.5*this.renderer.curSize[0],this.debug={heightmapOnly:!1,blendHeightmap:!0,drawBBoxes:!1,drawMeshBBox:!1,drawLods:!1,drawPositions:!1,drawTexelSize:!1,drawWireframe:0,drawFaceCount:!1,drawDistance:!1,drawMaxLod:!1,drawGeodataOnly:!1,drawTextureSize:!1,drawNodeInfo:!1,drawLayers:!0,drawBoundLayers:!1,drawSurfaces:!1,drawCredits:!1,drawOrder:!1,drawLabelBoxes:!1,drawEarth:!0,drawTileCounter:0,drawFog:this.config.mapFog,debugTextSize:2,ignoreTexelSize:!1,maxZoom:!1},this.gridFlat=!1,this.gridGlues=!1,this.gridSkipped=!1,this.atmoColor=[216/255,232/255,243/255,1],this.atmoColor2=[72/255,154/255,1,1],this.atmoHeight=5e4,this.atmoHeightFactor=1,this.atmoDensity=1,this.fogDensity=0,this.zFactor=0,this.zFactor2=.003,this.zbufferOffset=null,this.zShift=0,this.zLastShift=0,this.bestMeshTexelSize=1,this.bestGeodataTexelSize=1,this.log8=Math.log(8),this.log2=Math.log(2),this.geodataTilesPerLayer=0,this.drawCounter=0,this.drawChannel=0,this.drawChannelNames=["base","hit"],this.planetRadius=this.isGeocent?t.getNavigationSrs().getSrsInfo().a:100,this.tileBuffer=new Array(500),this.processBuffer=new Array(6e4),this.processBuffer2=new Array(6e4),this.drawBuffer=new Array(6e4),this.tmpVec3=new Array(3),this.tmpVec5=new Array(5),this.bboxBuffer=new Float32Array(24),this.planeBuffer=new Float32Array(27);var e=this.renderer.gpu;this.drawTileState=e.createState({}),this.drawStardomeState=e.createState({zwrite:!1,ztest:!1}),this.drawBlendedTileState=e.createState({zequal:!0,blend:!0}),this.drawAuraState=e.createState({zwrite:!1,blend:!0}),this.drawAtmoState=e.createState({zwrite:!1,ztest:!1,blend:!0}),this.drawAtmoState2=e.createState({zwrite:!1,ztest:!0,blend:!1}),this.degradeHorizonFactor=0,this.degradeHorizonTiltFactor=0,this.replay={camera:null,drawnTiles:null,drawnFreeTiles:null,nodeBuffer:null,tracedNodes:null,tracedFreeNodes:null,storeTiles:!1,storeFreeTiles:!1,storeNodes:!1,storeFreeNodes:!1,storeLoaded:this.config.mapStoreLoadStats,drawGlobe:!1,drawTiles:!1,drawNodes:!1,drawFreeTiles:!1,drawFreeNodes:!1,drawLoaded:!1,lod:30,singleLod:!1,loadedIndex:0,singleLodedIndex:0,loaded:[],loadFirst:0,loadLast:0},this.drawTiles=new u(t,this)};p.prototype.drawMap=function(t){var e=this.map,i=this.renderer,r=this.camera,s=this.replay,a=i.gpu,n=this.debug;1!=this.drawChannel&&(a.setViewport(),e.visibleCredits={imagery:{},glueImagery:{},mapdata:{}});var o=this.isProjected;switch(this.config.mapGridMode){case"none":this.gridSkipped=!0,this.gridFlat=!1,this.gridGlues=!1;break;case"flat":this.gridSkipped=!1,this.gridFlat=!0,this.gridGlues=!1;break;case"linear":this.gridSkipped=!1,this.gridFlat=!1,this.gridGlues=!0;break;case"fastlinear":this.gridSkipped=!1,this.gridFlat=!1,this.gridGlues=!1}var u=this.drawTiles,c=r.update();if(this.renderer.dirty=!0,this.renderer.drawFog=this.debug.drawFog,this.renderer.frameTime=this.stats.frameTime,this.renderer.hoverFeatureCounter=0,this.renderer.hoverFeatureList=e.hoverFeatureList,this.renderer.hoverFeature=e.hoverFeature,this.renderer.cameraPosition=r.position,this.renderer.cameraOrientation=e.position.getOrientation(),this.renderer.cameraTiltFator=Math.cos(l.radians(i.cameraOrientation[1])),this.renderer.cameraVector=r.vector,this.renderer.cameraViewExtent=e.position.getViewExtent(),this.renderer.cameraViewExtent2=Math.pow(2,Math.max(1,Math.floor(Math.log(e.position.getViewExtent())/Math.log(2)))),this.renderer.drawLabelBoxes=this.debug.drawLabelBoxes,o){var d=l.radians(i.cameraOrientation[0]);i.labelVector=[-Math.sin(d),Math.cos(d),0,0,0]}else{var p=c.vector;i.labelVector=[p[0],p[1],p[2],0]}i.distanceFactor=1/Math.max(1,Math.log(r.distance)/Math.log(1.04)),i.tiltFactor=Math.abs(i.cameraOrientation[1]/-90),i.localViewExtentFactor=2*Math.tan(l.radians(.5*e.position.getFov())),this.degradeHorizonFactor=200*this.config.mapDegradeHorizonParams[0],this.degradeHorizonTiltFactor=.5*(1+Math.cos(l.radians(Math.min(180,Math.abs(2*i.cameraOrientation[1]*3))))),1!=this.drawChannel?a.clear(!0,!1):a.clear(!0,!0,[255,255,255,255]),a.setState(this.drawStardomeState),1!=this.drawChannel&&this.config.mapLowresBackground<.8&&(2==n.drawWireframe?i.draw.drawSkydome(i.whiteTexture,i.progStardome):i.draw.drawSkydome(i.blackTexture,i.progStardome)),a.setState(this.drawTileState),this.setupDetailDegradation(),e.loader.setChannel(0),this.zFactor=0,this.ndcToScreenPixel=.5*this.renderer.curSize[0],this.updateFogDensity(),this.updateGridFactors(),this.maxGpuUsed=Math.max(3929856,e.gpuCache.getMaxCost()-3929856),this.stats.renderBuild=0,this.drawTileCounter=0;var f,g,m,v,y,b,x,M,w,S,A=r.position;if(e.freeLayersHaveGeodata&&0==this.drawChannel&&i.draw.clearJobBuffer(),this.debug.drawEarth){if((s.storeNodes||s.storeFreeNodes)&&(s.nodeBuffer=[]),s.drawGlobe||s.drawTiles||s.drawFreeTiles||s.drawNodes||s.drawFreeNodes||s.drawLoaded){var C=s.lod,T=s.singleLod;if(s.drawTiles&&s.drawnTiles)for(b=s.drawnTiles,f=0,g=b.length;f<g;f++)b[f][1]?(y=b[f][0],u.debug.drawBBoxes&&u.drawTileInfo(y,y.metanode,A),y.drawGrid(A)):(y=b[f][0])&&(T&&y.id[0]==C||!T&&y.id[0]<=C)&&u.drawSurfaceTile(y,y.metanode,A,y.pixelSize,y.priority,!1,!1);if(s.drawFreeTiles&&s.drawnFreeTiles)for(b=s.drawnFreeTiles,f=0,g=b.length;f<g;f++)b[f][1]||(y=b[f][0])&&(T&&y.id[0]==C||!T&&y.id[0]<=C)&&u.drawSurfaceTile(y,y.metanode,A,y.pixelSize,y.priority,!1,!1);if(s.drawNodes&&s.tracedNodes){for(b=s.tracedNodes,x=n.drawBBoxes,n.drawBBoxes=!0,f=0,g=b.length;f<g;f++)(y=b[f])&&(T&&y.id[0]==C||!T&&y.id[0]<=C)&&u.drawTileInfo(y,y.metanode,A,y.surfaceMesh,y.pixelSize);n.drawBBoxes=x}if(s.drawFreeNodes&&s.tracedFreeNodes){for(b=s.tracedFreeNodes,x=n.drawBBoxes,n.drawBBoxes=!0,f=0,g=b.length;f<g;f++)y=b[f],(T&&y.id[0]==C||!T&&y.id[0]<=C)&&u.drawTileInfo(y,y.metanode,A,y.surfaceMesh,y.pixelSize);n.drawBBoxes=x}var P=s.loadedIndex,E=s.singleLodedIndex;if(s.drawLoaded&&s.loaded){var L=s.loaded;for(n.drawBBoxes=!0,f=0,g=L.length;f<g;f++){var k=L[f];k&&k.tile&&k.tile.id&&(y=k.tile,(E&&f==P||!E&&f<=P)&&(T&&y.id[0]==C||!T&&y.id[0]<=C)&&y.metanode&&(y.metanode.hasGeometry()?u.drawSurfaceTile(y,y.metanode,A,y.pixelSize,y.priority,!1,!1):u.drawTileInfo(y,y.metanode,A,y.surfaceMesh,y.pixelSize)))}n.drawBBoxes=x}return void((s.drawFreeTiles&&s.drawnFreeTiles||s.drawLoaded&&s.loaded)&&this.freeLayersHaveGeodata&&0==this.drawChannel&&(this.renderer.drawnGeodataTiles=this.stats.drawnGeodataTilesPerLayer,this.renderer.drawnGeodataTilesFactor=this.stats.drawnGeodataTilesFactor,this.renderer.draw.drawGpuJobs()))}for(f=0,g=this.tileBuffer.length;f<g;f++)this.tileBuffer[f]=null;if(this.tree.surfaceSequence.length>0&&this.tree.draw(c),s.storeTiles){for(w=[],f=0,g=this.tileBuffer.length;f<g;f++)if(b=this.tileBuffer[f])for(m=0,v=b.length;m<v;m++)w.push(b[m]);s.cameraPos=A,s.drawnTiles=w,s.storeTiles=!1}if(s.storeNodes){for(S=[],f=0,g=s.nodeBuffer.length;f<g;f++)y=s.nodeBuffer[f],S.push(y);s.cameraPos=A,s.tracedNodes=S,s.storeNodes=!1}for(f=0,g=e.freeLayerSequence.length;f<g;f++)M=e.freeLayerSequence[f],M.ready&&M.tree&&(!M.geodata||M.stylesheet&&M.stylesheet.isReady())&&0==this.drawChannel&&(M.zFactor&&(this.zbufferOffset=M.zFactor),"geodata"==M.type?this.drawMonoliticGeodata(M):M.tree.draw(c),this.zbufferOffset=null);if(s.storeFreeTiles){for(w=[],f=0,g=this.tileBuffer.length;f<g;f++)if(b=this.tileBuffer[f])for(m=0,v=b.length;m<v;m++)y=b[m],y.surface&&y.surface.free&&w.push(y);s.cameraPos=A,s.drawnFreeTiles=w,s.storeFreeTiles=!1}if(s.storeFreeNodes){for(S=[],f=0,g=s.nodeBuffer.length;f<g;f++)y=s.nodeBuffer[f],y.surface&&y.surface.free&&S.push(y);s.cameraPos=A,s.tracedFreeNodes=S,s.storeFreeNodes=!1}}if(1!=this.drawChannel&&!o&&n.drawFog&&("melown2015"==e.referenceFrame.id||"mars-qsc"==e.referenceFrame.id)&&i.progAtmo.isReady()&&i.progAtmo2.isReady()){var I=e.getNavigationSrs().getSrsInfo(),N=I.a,F=I.b,B=this.atmoHeight,R=[0,0,0,0];h.normalize(r.position,R);var _,D,U=e.getPosition(),z=1-l.clamp(Math.max(.1*B,r.geocentDistance-N)/(10*B),0,1),G=[Math.max(2,128*z),0,0,0];a.setState(this.drawAtmoState);G=[2,(N+B)/N*2,.25,(N+B)/N*2];var V=1/N*2;_=[r.position[0]*V,r.position[1]*V,r.position[2]*V,1];var O=.5*U.getViewExtent()/Math.tan(l.radians(.5*U.getFov())),j=N/(O+N);D=[l.mix(4.4,1.01,j),1,l.mix(5,1.05,j),0],a.setState(this.drawAuraState),i.draw.drawBall([-r.position[0],-r.position[1],-r.position[2]],N+B,F+B,i.progAtmo,G,_,D,this.atmoColor,this.atmoColor2),a.setState(this.drawTileState)}n.drawEarth&&(t||e.freeLayersHaveGeodata&&0==this.drawChannel&&(this.renderer.drawnGeodataTiles=this.stats.drawnGeodataTilesPerLayer,this.renderer.drawnGeodataTilesFactor=this.stats.drawnGeodataTilesFactor,i.draw.drawGpuJobs()))},p.prototype.drawToTexture=function(t){this.renderer.switchToFramebuffer("texture",t),this.drawChannel=0,this.map.renderSlots.processRenderSlots(),this.renderer.switchToFramebuffer("base")},p.prototype.drawHitmap=function(){this.drawChannel=1,this.renderer.switchToFramebuffer("depth"),this.map.renderSlots.processRenderSlots(),this.renderer.switchToFramebuffer("base"),this.drawChannel=0,this.map.hitMapDirty=!1},p.prototype.drawGeodataHitmap=function(){this.renderer.gpu.setState(this.drawTileState),this.renderer.switchToFramebuffer("geo"),this.renderer.draw.drawGpuJobs(),this.renderer.advancedPassNeeded&&(this.renderer.switchToFramebuffer("geo2"),this.renderer.draw.drawGpuJobs()),this.renderer.switchToFramebuffer("base"),this.map.geoHitMapDirty=!1},p.prototype.getDrawCommandsGpuSize=function(t){for(var e=0,i=0,r=t.length;i<r;i++){var s=t[i];switch(s.type){case 2:var a=s.mesh,n=s.texture;a&&(e+=a.gpuSize),n&&(e+=n.getGpuSize());break;case 3:var o=s.geodataView;o&&(e+=o.size)}}return e},p.prototype.areDrawCommandsReady=function(t,e,i,r){for(var s=!0,a=!!r,n=0,o=t.length;n<o;n++){var h=t[n];switch(h.type){case 2:var l=h.mesh,u=h.texture,c=l&&l.isReady(i,e,a),d=!u||u&&u.isReady(i,e,a);c&&d||(s=!1);break;case 3:var p=h.geodataView;p&&p.isReady(i,e,a)||(s=!1)}}return s},p.prototype.processDrawCommands=function(t,e,i,r){e.length>0&&this.drawTileCounter++;for(var s=0,a=e.length;s<a;s++){var n=e[s];switch(n.type){case 1:this.renderer.gpu.setState(n.state);break;case 2:var o=n.mesh,h=n.texture,l=o&&o.isReady(r,i),u=!h||h&&h.isReady(r,i);if(l&&u)if(this.debug.drawBBoxes&&this.debug.drawMeshBBox&&o.submeshes[n.submesh].drawBBox(t),h)o.drawSubmesh(t,n.submesh,h,n.material,n.alpha);else{var c=n.material;switch(c){case 6:case 4:c=2}o.drawSubmesh(t,n.submesh,h,c,n.alpha)}break;case 3:var d=n.geodataView;d&&d.isReady(r,i,!0)&&d.draw(t)}}},p.prototype.drawMonoliticGeodata=function(t){if(t&&0==this.drawChannel&&this.camera.camera.bboxVisible(t.extents,this.camera.position)){var e;null==t.monoGeodata&&(e="object"==typeof t.geodataUrl?t.geodataUrl:t.getMonoGeodataUrl(t.id),t.monoGeodata=new d(this.map,e,{tile:null,surface:t})),t.monoGeodataCounter!=t.geodataCounter&&(t.monoGeodataView=null,t.monoGeodataCounter=t.geodataCounter),t.monoGeodata.isReady()&&(t.monoGeodataView||(t.monoGeodataView=new c(this.map,t.monoGeodata,{tile:null,surface:t})),t.monoGeodataView.isReady()&&t.monoGeodataView.draw(this.camera.position))}},p.prototype.updateFogDensity=function(){var t=this.map.getPosition(),e=t.getOrientation(),i=this.camera.getFar(),r=Math.max(5,-e[1])/90,s=Math.log(.05)/(this.atmoDensity*i*this.atmoHeightFactor*Math.max(1,1e-4*this.camera.height)*r);s*=5/(Math.min(5e4,Math.max(this.camera.distance,1e3))/5e3),this.debug.drawFog||(s=0),this.fogDensity=s,this.renderer.fogDensity=s},p.prototype.updateGridFactors=function(){for(var t=this.map.referenceFrame.getSpatialDivisionNodes(),e=0,i=t.length;e<i;e++){var r=t[e],s=Math.max(10,this.camera.distance+20),a=2*(r.extents.ur[0]-r.extents.ll[0]),n=Math.log(Math.min(a,s))/this.log8;n=Math.log(a)/this.log8-n,r.gridBlend=n-Math.floor(n),n=Math.floor(Math.floor(n))+1,r.gridStep1=Math.pow(8,n),r.gridStep2=8*r.gridStep1}},p.prototype.setupDetailDegradation=function(t){var e=0;this.map.mobile&&(e=this.config.mapMobileDetailDegradation),t&&(e+=t),this.texelSizeFit=this.config.mapTexelSizeFit*Math.pow(2,e)},e.a=p},function(t,e,i){"use strict";var r=i(132),s=i(133),a=i(134),n=i(2),o=r.a,h=s.a,l=a.a,u=n.b,c=n.e,d=function(t){this.map=t,this.groups=[],this.currentGroup=null,this.bboxMin=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],this.bboxMax=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],this.navSrs=this.map.getNavigationSrs(),this.physSrs=this.map.getPhysicalSrs(),this.heightsToProcess=0,this.heightsProcessBuffer=null,this.heightsProcessBufferFirst=null,this.heightsProcessBufferLast=null,this.heightsLod=8,this.heightsSource="heightmap-by-precision",this.updateCallback=null,this.processingHeights=!1,this.processHeightsCalls=[]};d.prototype.addToHeightsBuffer=function(t){var e={coords:t,prev:null,next:this.heightsProcessBufferFirst};null!=this.heightsProcessBufferFirst&&(this.heightsProcessBufferFirst.prev=e),this.heightsProcessBufferFirst=e,null==this.heightsProcessBufferLast&&(this.heightsProcessBufferLast=e)},d.prototype.removeFromHeightsBuffer=function(t){var e=!1;t==this.heightsProcessBufferFirst&&(this.heightsProcessBufferFirst=t.next,e=!0,null!=this.heightsProcessBufferFirst&&(this.heightsProcessBufferFirst.prev=null)),t==this.heightsProcessBufferLast&&(this.heightsProcessBufferLast=t.prev,e=!0,null!=this.heightsProcessBufferLast&&(this.heightsProcessBufferLast.next=null)),e||(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev))},d.prototype.addGroup=function(t){return this.groups.push({points:[],lines:[],polygons:[],id:t}),this.currentGroup=this.groups[this.groups.length-1],this},d.prototype.addPoint=function(t,e,i,r,s,a){this.currentGroup||this.addGroup("some-group");var n,o=!e||"float"==e,h={id:r,properties:i};return o?(n=[t[0],t[1],t[2]||0,h,null,null],this.addToHeightsBuffer(n),h.points=[n],h.floatHeights=!0,h.srs=s||this.navSrs,h.heightsToProcess=1,this.heightsToProcess++):h.points=a?[[t[0],t[1],t[2]]]:[this.physSrs.convertCoordsFrom(t,s||this.navSrs)],this.currentGroup.points.push(h),this},d.prototype.addPointArray=function(t,e,i,r,s,a){this.currentGroup||this.addGroup("some-group");var n,o,h,l,u=!e||"float"==e;s=s||this.navSrs;var c={id:r,properties:i},d=new Array(t.length);if(u){for(n=0,o=t.length;n<o;n++)h=t[n],l=[h[0],h[1],h[2]||0,c,null,null],this.addToHeightsBuffer(l),d[n]=l;c.floatHeights=!0,c.srs=s,c.heightsToProcess=o,this.heightsToProcess++}else if(a)for(n=0,o=t.length;n<o;n++)h=t[n],d[n]=[h[0],h[1],h[2]];else for(n=0,o=t.length;n<o;n++)d[n]=this.physSrs.convertCoordsFrom(t[n],s);return c.points=d,this.currentGroup.points.push(c),this},d.prototype.addLineString=function(t,e,i,r,s,a){this.currentGroup||this.addGroup("some-group");var n,o,h,l,u=!e||"float"==e;s=s||this.navSrs;var c={id:r,properties:i},d=new Array(t.length);if(u){for(n=0,o=t.length;n<o;n++)h=t[n],l=[h[0],h[1],h[2]||0,c,null,null],this.addToHeightsBuffer(l),d[n]=l;c.floatHeights=!0,c.srs=s,c.heightsToProcess=o,this.heightsToProcess+=o}else if(a)for(n=0,o=t.length;n<o;n++)h=t[n],d[n]=[h[0],h[1],h[2]];else for(n=0,o=t.length;n<o;n++)d[n]=this.physSrs.convertCoordsFrom(t[n],s);return c.lines=[d],this.currentGroup.lines.push(c),this},d.prototype.addLineStringArray=function(t,e,i,r,s,a){this.currentGroup||this.addGroup("some-group");var n,o,h,l,u,c,d,p,f=!e||"float"==e;s=s||this.navSrs;var g={id:r,properties:i},m=new Array(t.length);if(f){var v=0;for(h=0,l=t.length;h<l;h++){for(n=t[h],o=new Array(n.length),u=0,c=n.length;u<c;u++)d=n[u],p=[d[0],d[1],d[2]||0,g,null,null],this.addToHeightsBuffer(p),o[u]=p;v+=c,m[h]=o}g.floatHeights=!0,g.srs=s,g.heightsToProcess=v,this.heightsToProcess+=v}else for(h=0,l=t.length;h<l;h++){if(n=t[h],o=new Array(n.length),a)for(u=0,c=n.length;u<c;u++)d=n[u],o[u]=[d[0],d[1],d[2]];else for(u=0,c=n.length;u<c;u++)o[u]=this.physSrs.convertCoordsFrom(n[u],s);m[h]=o}return g.lines=m,this.currentGroup.lines.push(g),this},d.prototype.addPolygon=function(t,e,i,r,s,a,n){n=n||this.navSrs.srsProj4,e=e||[];var o,h,l,u,c,d,p,f,g,m,v,y=t;-1!=n.indexOf("+proj=longlat")&&(g=this.map.proj4(n,"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"));var b=3*t.length;for(o=0,h=e.length;o<h;o++)b+=3*e[o].length;y=new Array(b),v=new Array(b),l=0;var x=new Array(e.length+1),M=new Array(t.length);for(x[0]=M,o=0,h=t.length;o<h;o++)M[o]=o,f=t[o],v[l]=f[0],v[l+1]=f[1],v[l+2]=f[2],f=g?g.forward(t[o]):t[o],y[l]=f[0],y[l+1]=f[1],y[l+2]=f[2],l+=3;for(new Array(e.length),m=new Array(e.length),o=0,h=e.length;o<h;o++)for(p=e[o],m[o]=Math.round(l/3),M=new Array(p.length),x[o+1]=M,d=Math.floor(l/3),u=0,c=p.length;u<c;u++)f=p[u],v[l]=f[0],v[l+1]=f[1],v[l+2]=f[2],f=g?g.forward(p[u]):p[u],y[l]=f[0],y[l+1]=f[1],y[l+2]=f[2],l+=3,M[u]=d++;var w=vts.earcut(y,m,3);return this.addPolygonRAW(v,w,x,i,r,s,a,n),this},d.prototype.getPolygonCenter=function(t,e,i){if(t&&!t.length)return[0,0];var r=0,s=0,a=0;if(e){for(var n=0,o=t.length;n<o;n++){var h=t[n];r+=h[0],s+=h[1],a+=h[2]}return[r/o,s/o,a/o]}for(var n=0,o=t.length;n<o;n++){var h=t[n];h=i.forward(h),r+=h[0],s+=h[1],a+=h[2]}var l=r/o,u=s/o,c=a/o;return h=i.inverse([l,u,c]),[h[0],h[1],0]},d.prototype.addPolygon2=function(t,e,i,r,s,a,n){n=n||this.navSrs.srsProj4,e=e||[];var o,h,l,u,d,p,f,g,m,v,y,b=t,x=!0;-1!=n.indexOf("+proj=longlat")&&(x=!1,m=this.map.proj4(n,"+proj=geocent +datum=WGS84 +units=m +no_defs"));var M,w,S,A=document.getElementById("dbg-canvas"),C=A.getContext("2d"),T=300,P=4e-5,E=this.getPolygonCenter(t,x,m);this.addPoint(E,"fix",{},"aaa");var L=this.map.measure.getNewNED(E);S=L.direction,M=L.north,w=L.east,g=m.forward(E);var k=[g[0]+1e6*w[0],g[1]+1e6*w[1],g[2]+1e6*w[2]];this.addLineString([g,k],"fix",{},"line",null,!0);var k=[g[0]+1e6*S[0],g[1]+1e6*S[1],g[2]+1e6*S[2]];this.addLineString([g,k],"fix",{},"line",null,!0);var k=[g[0]+1e6*M[0],g[1]+1e6*M[1],g[2]+1e6*M[2]];if(this.addLineString([g,k],"fix",{},"line",null,!0),!x){var I=this.map.getPosition();I.setCoords(E),I.setOrientation([0,0,-90]);L=this.map.measure.getPositionCameraInfo(I,!1,!1).rotMatrix,c.inverse(L),S=[L[2],L[6],L[10]],M=[L[1],L[5],L[9]],w=[L[0],L[4],L[8]]}var N=3*t.length;for(o=0,h=e.length;o<h;o++)N+=3*e[o].length;b=new Array(N),y=new Array(N),l=0;var F=new Array(e.length+1),B=new Array(t.length);for(F[0]=B,o=0,h=t.length;o<h;o++)B[o]=o,g=t[o],y[l]=g[0],y[l+1]=g[1],y[l+2]=g[2],m?(g=m.forward(t[o]),g[0]=w[0]*g[0]+w[1]*g[1]+w[2]*g[2],g[1]=S[0]*g[0]+S[1]*g[1]+S[2]*g[2],g[2]=0):g=t[o],0==o?C.moveTo(g[0]*P+T,g[1]*P+T):C.lineTo(g[0]*P+T,g[1]*P+T),b[l]=g[0],b[l+1]=g[1],b[l+2]=g[2],l+=3;for(new Array(e.length),v=new Array(e.length),o=0,h=e.length;o<h;o++)for(f=e[o],v[o]=Math.round(l/3),B=new Array(f.length),F[o+1]=B,p=Math.floor(l/3),u=0,d=f.length;u<d;u++)g=f[u],y[l]=g[0],y[l+1]=g[1],y[l+2]=g[2],m?(g=m.forward(f[u]),g[0]=w[0]*g[0]+w[1]*g[1]+w[2]*g[2],g[1]=S[0]*g[0]+S[1]*g[1]+S[2]*g[2],g[2]=0):g=f[u],0==u?C.moveTo(g[0]*P+T,g[1]*P+T):C.lineTo(g[0]*P+T,g[1]*P+T),b[l]=g[0],b[l+1]=g[1],b[l+2]=g[2],l+=3,B[u]=p++;C.strokeStyle="#ff0000",C.stroke();var R=vts.earcut(b,v,3);return this.addPolygonRAW(y,R,F,i,r,s,a,n),this},d.prototype.insidePolygon=function(t,e,i){for(var r=t[0],s=t[1],a=!1,n=0,o=e.length-1,h=i||e.length;n<h;o=n++){var l=e[3*n],u=e[3*n+1],c=e[3*o],d=e[3*o+1];u>s!=d>s&&r<(c-l)*(s-u)/(d-u)+l&&(a=!a)}return a},d.prototype.addPolygon3=function(t,e,i,r,s,a,n){n=n||this.navSrs.srsProj4,e=e||[];var o,h,l,d,p,f,g,m,v,y,b,x,M,w,S,A=t,C=!0,T=0,P=e.length;-1!=n.indexOf("+proj=longlat")&&(C=!1,y=this.map.proj4(n,"+proj=geocent +datum=WGS84 +units=m +no_defs"));var E,L,k,I=this.getPolygonCenter(t,C,y);if(!C){var N=this.map.getPosition();N.setCoords(I),N.setOrientation([0,0,-90]);var F=this.map.measure.getPositionCameraInfo(N,!1,!1),B=F.rotMatrix;c.inverse(B),k=[B[2],B[6],B[10]],E=[B[1],B[5],B[9]],L=[B[0],B[4],B[8]]}var R=y.forward(I);R[0]=L[0]*R[0]+L[1]*R[1]+L[2]*R[2],R[1]=k[0]*R[0]+k[1]*R[1]+k[2]*R[2],R[2]=0;var _=3*t.length;for(o=0,h=e.length;o<h;o++)_+=3*e[o].length;A=new Array(_),x=new Array(_),l=0;var D=new Array(e.length+1),U=new Array(t.length);for(D[0]=U,y&&(v=y.forward(I),v[0]=L[0]*v[0]+L[1]*v[1]+L[2]*v[2],v[1]=E[0]*v[0]+E[1]*v[1]+E[2]*v[2],v[2]=0,v),o=0,h=t.length;o<h;o++)U[o]=o,v=t[o],x[l]=v[0],x[l+1]=v[1],x[l+2]=v[2],y?(v=y.forward(t[o]),v[0]=L[0]*v[0]+L[1]*v[1]+L[2]*v[2],v[1]=k[0]*v[0]+k[1]*v[1]+k[2]*v[2],v[2]=0):v=t[o],M=v[0]-R[0],w=v[1]-R[1],S=M*M+w*w,S>T&&(T=S,t[o]),A[l]=v[0],A[l+1]=v[1],A[l+2]=v[2],l+=3;for(new Array(e.length),b=new Array(e.length),o=0,h=e.length;o<h;o++)for(m=e[o],b[o]=Math.round(l/3),o<P&&(U=new Array(m.length),D[o+1]=U),g=Math.floor(l/3),p=0,f=m.length;p<f;p++)v=m[p],x[l]=v[0],x[l+1]=v[1],x[l+2]=v[2],y?(v=y.forward(m[p]),v[0]=L[0]*v[0]+L[1]*v[1]+L[2]*v[2],v[1]=k[0]*v[0]+k[1]*v[1]+k[2]*v[2],v[2]=0):v=m[p],A[l]=v[0],A[l+1]=v[1],A[l+2]=v[2],l+=3,o<P&&(U[p]=g++);var z,G,V,O,j,H,q,J,Z,Y,W=vts.earcut(A,b,3),X=Math.sqrt(T)/19,Q=new Array(D.length);for(o=0,h=D.length;o<h;o++)Q[o]=D[o].slice();var K,$,tt,et,it,rt,st=new Array(196608),at=new Array(196608),nt=new Array(196608),ot=0,ht=0,lt=0,ut=new Array(196608);for(o=0,h=x.length;o<h;o+=3)ut[o]=x[o],ut[o+1]=x[o+1],ut[o+2]=x[o+2];var ct=Math.round(h/3),dt=X;for(o=0,h=W.length;o<h;o+=3){z=W[o],G=W[o+1],V=W[o+2],ot=3;var pt=null,ft=null,gt=null;for(l=0,d=D.length;l<d;l++)for(U=D[l],Y=Q[l],p=0,f=U.length;p<f;p++){var mt=p<U.length-1?p+1:0;(z==U[p]&&G==U[mt]||z==U[mt]&&G==U[p])&&(Y[p]=[U[p]],pt=Y[p]),(G==U[p]&&V==U[mt]||G==U[mt]&&V==U[p])&&(Y[p]=[U[p]],ft=Y[p]),(V==U[p]&&z==U[mt]||z==U[mt]&&V==U[p])&&(Y[p]=[U[p]],gt=Y[p])}st[0]=[z,pt],st[1]=[G,ft],st[2]=[V,gt];var vt=0;do{for(l=0,d=ot;l<d;l+=3)if(et=st[l][0],it=st[l+1][0],rt=st[l+2][0],pt=st[l][1],ft=st[l+1][1],gt=st[l+2][1],O=[ut[3*et],ut[3*et+1],ut[3*et+2]],j=[ut[3*it],ut[3*it+1],ut[3*it+2]],H=[ut[3*rt],ut[3*rt+1],ut[3*rt+2]],O=y.forward(O),j=y.forward(j),H=y.forward(H),K=u.length([O[0]-j[0],O[1]-j[1],O[2]-j[2]]),$=u.length([j[0]-H[0],j[1]-H[1],j[2]-H[2]]),tt=u.length([H[0]-O[0],H[1]-O[1],H[2]-O[2]]),(g=Math.max(K,$,tt))<X)nt[lt]=et,nt[lt+1]=it,nt[lt+2]=rt,lt+=3;else{q=[.5*(O[0]+j[0]),.5*(O[1]+j[1]),.5*(O[2]+j[2])],J=[.5*(j[0]+H[0]),.5*(j[1]+H[1]),.5*(j[2]+H[2])],Z=[.5*(H[0]+O[0]),.5*(H[1]+O[1]),.5*(H[2]+O[2])],q=y.inverse(q),q[2]=.5*(x[3*z+2]+x[3*G+2]),J=y.inverse(J),J[2]=.5*(x[3*G+2]+x[3*V+2]),Z=y.inverse(Z),Z[2]=.5*(x[3*V+2]+x[3*z+2]);var yt=3*ct;K==g?(ut[yt]=q[0],ut[yt+1]=q[1],ut[yt+2]=q[2],pt&&(pt[0]=[[pt[0]],[-ct]],pt=pt[0]),g=ht,at[g]=[et,pt?pt[0]:null],at[g+1]=[ct,null],at[g+2]=[rt,gt||null],at[g+3]=[ct,pt?pt[1]:null],at[g+4]=[it,ft||null],at[g+5]=[rt,null]):$==g?(console.log("l2"),ut[yt]=J[0],ut[yt+1]=J[1],ut[yt+2]=J[2],ft&&(ft[0]=[[ft[0]],[-ct]],ft=ft[0]),g=ht,at[g]=[et,pt||null],at[g+1]=[it,ft?ft[0]:null],at[g+2]=[ct,null],at[g+3]=[ct,ft?ft[1]:null],at[g+4]=[rt,gt||null],at[g+5]=[et,null]):tt==g&&(ut[yt]=Z[0],ut[yt+1]=Z[1],ut[yt+2]=Z[2],gt&&(gt[0]=[[gt[0]],[-ct]],gt=gt[0]),g=ht,at[g]=[et,pt||null],at[g+1]=[it,null],at[g+2]=[ct,gt?gt[1]:null],at[g+3]=[ct,null],at[g+4]=[it,ft||null],at[g+5]=[rt,gt?gt[0]:null]),ct+=1,ht+=6}var bt=st;st=at,at=bt,ot=ht,ht=0,vt++}while(ot>0);X=dt}var xt=new Array(196608),Mt=0,wt=function(t){for(var e=0,i=t.length;e<i;e++)Array.isArray(t[e])?wt(t[e]):(xt[Mt]=t[e],Mt++)},St=0;for(o=0,h=Q.length;o<h;o++)wt(Q[o]),Q[o]=xt.slice(St,Mt),St=Mt;for(W=new Array(ot),o=0,h=lt;o<h;o+=3)W[o]=nt[o],W[o+1]=nt[o+1],W[o+2]=nt[o+2];for(x=new Array(3*ct),l=0,o=0,h=3*ct;o<h;o+=3)x[o]=ut[o],x[o+1]=ut[o+1],x[o+2]=ut[o+2],l++;this.addPolygonRAW(x,W,Q,i,r,s,a,n)},d.prototype.addTerrainPolygon=function(t,e,i,r,s,a,n,o){},d.prototype.addPolygonRAW=function(t,e,i,r,s,a,n,o,h){this.currentGroup||this.addGroup("some-group");var l,u,c,d=!s||"float"==s,p=0;o=o||this.navSrs;var f={id:n,properties:a},g=new Array(Math.round(t.length/3));if(d){for(l=0,u=t.length;l<u;l+=3)c=[t[l],t[l+1],t[l+2],f,null,null],this.addToHeightsBuffer(c),g[p++]=c;f.floatHeights=!0,f.srs=o,f.heightsToProcess=g.length,this.heightsToProcess+=g.length}else for(l=0,u=t.length;l<u;l+=3)c=[t[l],t[l+1],t[l+2]],g[p++]=h?c:this.physSrs.convertCoordsFrom(c,o);var m=e.slice(),v=new Array(i.length);for(l=0,u=i.length;l<u;l++)v[l]=i[l].slice();return f.vertices=g,f.surface=m,f.borders=v,this.currentGroup.polygons.push(f),this},d.prototype.importVTSGeodata=function(t,e,i){return new l(this,e,i).processJSON(t)},d.prototype.importGeoJson=function(t,e,i,r,s){return new h(this,e,i,r,s).processJSON(t)},d.prototype.processHeights=function(t,e,i){if(this.heightsToProcess<=0)return void(i&&i(this));this.processingHeights&&this.processHeightsCalls.push(this.processHeights.bind(this,t,e)),this.processingHeights=!0,this.heightsSource=t,this.heightsLod=e;var r,s,a,n,o,n,h,l=this.heightsProcessBufferFirst;switch(t){case"node-by-precision":n=!0;case"heightmap-by-precision":h=l.coords,s=h[3].srs?this.navSrs.convertCoordsFrom(h,h[3].srs):h,o=this.map.measure.getOptimalHeightLodBySampleSize(s,e);break;case"node-by-lod":n=!0;case"heightmap-by-lod":o=e}do{h=l.coords,null==h[4]&&(s=h[3].srs?this.navSrs.convertCoordsFrom(h,h[3].srs):h,a=this.map.measure.getSpatialDivisionNode(s),h[4]=a[0],h[5]=a[1]),a=this.map.measure.getSurfaceHeight(h,o,null,h[4],h[5],null,n),(a[1]||a[2])&&(h[2]+=a[0],this.removeFromHeightsBuffer(l,r),h[3].heightsToProcess--,this.heightsToProcess--,h[3].heightsToProcess<=0&&(h[3].floatHeights=!1),s=[h[0],h[1],h[2]],s=this.physSrs.convertCoordsFrom(s,h[3].srs),h[0]=s[0],h[1]=s[1],h[2]=s[2]),r=l,l=l.next}while(l);this.heightsToProcess<=0?(this.updateCallback&&this.updateCallback(),this.processingHeights=!1,i&&i(this),this.processHeightsCalls.length>1&&this.processHeightsCalls.shift()()):this.updateCallback||(this.updateCallback=this.map.core.on("map-update",this.processHeights.bind(this,this.heightsSource,this.heightsLod,i)))},d.prototype.extractGeometry=function(t){for(var e,i,r,s,a,n,h,l,u,c,d,i=0,r=this.groups.length;i<r;i++){var s,a,p=this.groups[i],f=p.points,g=p.lines;for(s=0,a=f.length;s<a;s++)f[s].id==t&&(e=f[s]);for(s=0,a=g.length;s<a;s++)g[s].id==t&&(e=g[s])}if(e){if(e.points){if(n=e.points,n.length>0)for(l=new Float64Array(3*n.length),i=0,r=n.length;i<r;i++)c=3*i,d=n[i],l[c]=d[0],l[c+1]=d[1],l[c+2]=d[2];return new o(this.map,{type:"point-geometry",id:e.id,geometryBuffer:l})}if(e.lines){if(h=e.lines,h.length>0){var m=0;for(i=0,r=h.length;i<r;i++)m+=h[i].length;for(l=new Float64Array(3*m),u=new Uint32Array(r),c=0,i=0,r=h.length;i<r;i++){var n=h[i];for(s=0,a=n.length;s<a;s++)d=n[s],l[c]=d[0],l[c+1]=d[1],l[c+2]=d[2],c+=3}}return new o(this.map,{type:"line-geometry",id:e.id,geometryBuffer:l,indicesBuffer:u})}}else;},d.prototype.compileGroup=function(t,e){var i,r,s,a,n,o,h,l,u,c,d,p,f,g=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],m=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],v={},y=t.points,b=t.lines,x=t.polygons;for(v.id=t.id,h=0,l=y.length;h<l;h++)for(i=y[h].points,u=0,c=i.length;u<c;u++)r=i[u],r[0]>m[0]&&(m[0]=r[0]),r[1]>m[1]&&(m[1]=r[1]),r[2]>m[2]&&(m[2]=r[2]),r[0]<g[0]&&(g[0]=r[0]),r[1]<g[1]&&(g[1]=r[1]),r[2]<g[2]&&(g[2]=r[2]);for(h=0,l=b.length;h<l;h++)for(n=b[h].lines,u=0,c=n.length;u<c;u++)for(o=n[u],d=0,p=o.length;d<p;d++)r=o[d],r[0]>m[0]&&(m[0]=r[0]),r[1]>m[1]&&(m[1]=r[1]),r[2]>m[2]&&(m[2]=r[2]),r[0]<g[0]&&(g[0]=r[0]),r[1]<g[1]&&(g[1]=r[1]),r[2]<g[2]&&(g[2]=r[2]);for(h=0,l=x.length;h<l;h++)for(i=x[h].vertices,u=0,c=i.length;u<c;u++)r=i[u],r[0]>m[0]&&(m[0]=r[0]),r[1]>m[1]&&(m[1]=r[1]),r[2]>m[2]&&(m[2]=r[2]),r[0]<g[0]&&(g[0]=r[0]),r[1]<g[1]&&(g[1]=r[1]),r[2]<g[2]&&(g[2]=r[2]);if(!e){e=Math.max(m[0]-g[0]+1,m[1]-g[1]+1,m[2]-g[2]+1)/.25,e=Math.max(e,1024),e=Math.min(e,2<<20)}v.resolution=e;var M=[e/(m[0]-g[0]+1),e/(m[1]-g[1]+1),e/(m[2]-g[2]+1)];for(v.points=new Array(y.length),h=0,l=y.length;h<l;h++){s=y[h],i=s.points;var w=new Array(i.length);for(u=0,c=i.length;u<c;u++)r=i[u],w[u]=[Math.round((r[0]-g[0])*M[0]),Math.round((r[1]-g[1])*M[1]),Math.round((r[2]-g[2])*M[2])];a={points:w},s.id&&(a.id=s.id),s.properties&&(a.properties=s.properties),v.points[h]=a}for(v.lines=new Array(b.length),h=0,l=b.length;h<l;h++){s=b[h],n=s.lines;var S=new Array(n.length);for(u=0,c=n.length;u<c;u++){for(o=n[u],w=new Array(o.length),d=0,p=o.length;d<p;d++)r=o[d],w[d]=[Math.round((r[0]-g[0])*M[0]),Math.round((r[1]-g[1])*M[1]),Math.round((r[2]-g[2])*M[2])];S[u]=w}a={lines:S},s.id&&(a.id=s.id),s.properties&&(a.properties=s.properties),v.lines[h]=a}for(v.polygons=new Array(x.length),h=0,l=x.length;h<l;h++){s=x[h],i=s.vertices;var A=new Array(i.length);for(d=0,u=0,c=i.length;u<c;u++)r=i[u],A[d++]=Math.round((r[0]-g[0])*M[0]),A[d++]=Math.round((r[1]-g[1])*M[1]),A[d++]=Math.round((r[2]-g[2])*M[2]);a={vertices:A,surface:s.surface.slice()},f=s.borders;var C=new Array(f.length);for(u=0,c=C.length;u<c;u++)C[u]=f[u].slice();a.borders=C,s.id&&(a.id=s.id),s.properties&&(a.properties=s.properties),v.polygons[h]=a}return v.bbox=[g,m],m[0]>this.bboxMax[0]&&(this.bboxMax[0]=m[0]),m[1]>this.bboxMax[1]&&(this.bboxMax[1]=m[1]),m[2]>this.bboxMax[2]&&(this.bboxMax[2]=m[2]),g[0]<this.bboxMin[0]&&(this.bboxMin[0]=g[0]),g[1]<this.bboxMin[1]&&(this.bboxMin[1]=g[1]),g[2]<this.bboxMin[2]&&(this.bboxMin[2]=g[2]),v},d.prototype.makeGeodata=function(t){this.bboxMin=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],this.bboxMax=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(var e={version:1,groups:[]},i=0,r=this.groups.length;i<r;i++)e.groups.push(this.compileGroup(this.groups[i],t));return e},d.prototype.makeFreeLayer=function(t,e){var i=this.makeGeodata(e);return t||(t={layers:{"my-lines":{filter:["==","#type","line"],line:!0,"line-width":4,"line-color":[255,0,255,255],"zbuffer-offset":[-5,0,0]},"my-points":{filter:["==","#type","point"],point:!0,"point-radius":10,"point-color":[0,0,255,255],"zbuffer-offset":[-5,0,0]}}}),{credits:[],displaySize:1024,extents:{ll:this.bboxMin,ur:this.bboxMax},geodata:i,style:t,type:"geodata"}},e.a=d},function(t,e,i){"use strict";var r=i(2),s=r.b,a=function(t,e){switch(this.map=t,this.data=e,this.camera=t.camera,this.renderer=t.renderer,e.type){case"point-geometry":this.type=1,this.vertexBuffer=this.data.geometryBuffer;break;case"line-geometry":this.type=2,this.vertexBuffer=this.data.geometryBuffer,this.indicesBuffer=this.data.indicesBuffer;break;case"polygon-geometry":this.type=3}};a.prototype.getType=function(){switch(this.type){case 1:return"point";case 2:return"line";case 3:return"polygon"}},a.prototype.getElement=function(t){var e=this.vertexBuffer,i=3*t;switch(this.type){case 1:return[e[i],e[i+1],e[i+2]];case 2:return[[e[i],e[i+1],e[i+2]],[e[i+3],e[i+4],e[i+5]]]}},a.prototype.getElements=function(t){switch(this.type){case 1:return this.vertexBuffer.length/3;case 2:t=t||0;var e=3*this.indicesBuffer[t],i=t+1>=this.indicesBuffer.length?this.vertexBuffer.length:3*this.indicesBuffer[t];return Math.max(0,(i-e)/3-1)}},a.prototype.getRelationToCanvasPoint=function(t,e,i){var r,a,n,o,h,l,u,c,d,p,f,g,m,v,m=this.vertexBuffer,y=3*t,b=[0,0,0];switch(r=this.camera.position,a=this.renderer.getScreenRay(e,i),this.type){case 1:var n=[m[y],m[y+1],m[y+2]],x=[n[0]-l[0],n[0]-l[0]];return s.cross(a,x,b),u=s.length(n),{distance:u,point:n};case 2:var M=[m[y],m[y+1],m[y+2]],w=[m[y+3],m[y+4],m[y+5]];g=a,m=[w[0]-M[0],w[1]-M[1],w[2]-M[2]],v=[r[0]-M[0],r[1]-M[1],r[2]-M[2]],o=s.dot(g,g),h=s.dot(g,m),l=s.dot(m,m),u=s.dot(g,v),c=s.dot(m,v),d=o*l-h*h,d<1e-7?(p=0,f=h>l?u/h:c/l):(p=(h*c-l*u)/d,f=(o*c-h*u)/d);var S=[v[0]+g[0]*p-m[0]*f,v[1]+g[1]*p-m[1]*f,v[2]+g[2]*p-m[2]*f];return{closest:[M[0]+m[0]*f,M[1]+m[1]*f,M[2]+m[2]*f],"line-distance":s.length(S),distance:f,line:[M,w]}}},a.prototype.getPathElement=function(t,e){if(2!=this.type)return null;var i=3*(this.indicesBuffer[e||0]+t),r=this.vertexBuffer;return[[r[i],r[i+1],r[i+2]],[r[i+3],r[i+4],r[i+5]]]},a.prototype.getPathPoint=function(t,e){e=e||0;for(var i,r,a=3*this.indicesBuffer[e],n=e+1>=this.indicesBuffer.length?this.vertexBuffer.length:3*this.indicesBuffer[e],o=0,h=this.vertexBuffer,l=a;l<n-3;l+=3){if(i=[h[l+3]-h[l],h[l+4]-h[l+1],h[l+5]-h[l+2]],r=s.length(i),o+r>t){var u=(t-o)/r;return[h[l]+i[0]*u,h[l+1]+i[1]*u,h[l+2]+i[2]*u]}o+=r}return[h[n-3],h[n-2],h[n-1]]},a.prototype.getPathNED=function(t,e,i){i=i||0;for(var r,a,n,o=3*this.indicesBuffer[i],h=i+1>=this.indicesBuffer.length?this.vertexBuffer.length:3*this.indicesBuffer[i],l=0,u=this.vertexBuffer,c=o;c<h-5;c+=3){if(a=[u[c+3]-u[c],u[c+4]-u[c+1],u[c+5]-u[c+2]],n=s.length(a),l+n>t){var p=(l+n)/t;r=[u[c]+d[0]*p,u[c+1]+d[1]*p,u[c+2]+d[2]*p];break}l+=n}r||(r=[u[h-3],u[h-2],u[h-1]]);var f=[0,0,0],g=[0,0,0],m=[0,0,0];s.nomalize(a,f),s.nomalize(r,m),s.cross(m,f,g),e&&s.cross(m,g,f);var v=g,y=f,b=m;return{east:v,direction:y,north:b,position:r,matrix:[v[0],v[1],v[2],0,b[0],b[1],b[2],0,y[0],y[1],y[2],0,0,0,0,1]}},a.prototype.getPathLengthToElement=function(t,e){e=e||0;for(var i,r,a=3*this.indicesBuffer[e],n=e+1>=this.indicesBuffer.length?this.vertexBuffer.length:3*this.indicesBuffer[e],o=0,h=this.vertexBuffer,l=0,u=a;u<n-5;u+=3){if(i=[h[u+3]-h[u],h[u+4]-h[u+1],h[u+5]-h[u+2]],r=s.length(i),t==l)return{lengthToElement:o,elementLengh:r};l++,o+=r}return o},a.prototype.getPathLength=function(t){t=t||0;for(var e,i,r=3*this.indicesBuffer[t],a=t+1>=this.indicesBuffer.length?this.vertexBuffer.length:3*this.indicesBuffer[t],n=0,o=this.vertexBuffer,h=r;h<a-5;h+=3)e=[o[h+3]-o[h],o[h+4]-o[h+1],o[h+5]-o[h+2]],i=s.length(e),n+=i;return n},a.prototype.getPathsCount=function(){return 2!=this.type?0:this.indicesBuffer.length},e.a=a},function(t,e,i){"use strict";var r=function(t,e,i,r,s){this.builder=t,this.map=t.map,this.heightMode=e||"float",this.srs=i,this.groupIdPrefix=r||"",this.dontCreateGroups=s};r.prototype.processGeometry=function(t,e){var i=t.coordinates;if(i)switch(t.type){case"Point":this.builder.addPoint(i,this.heightMode,e.properties,e.properties?e.properties.id:null,this.srs);break;case"MultiPoint":this.builder.addPointArray(cords,this.heightMode,e.properties,e.properties?e.properties.id:null,this.srs);break;case"LineString":this.builder.addLineString(i,this.heightMode,e.properties,e.properties?e.properties.id:null,this.srs);break;case"MultiLineString":this.builder.addLineStringArray(i,this.heightMode,e.properties,e.properties?e.properties.id:null,this.srs);break;case"GeometryCollection":var r=t.gemetries;if(r)for(var s=0,a=r.length;s<a;s++)this.processGeometry(r[s],e)}},r.prototype.processFeature=function(t){var e=t.geometry;e&&this.processGeometry(e,t)},r.prototype.processCollection=function(t){var e=t.features;if(e)for(var i=0,r=e.length;i<r;i++)this.processFeature(e[i])},r.prototype.processJSON=function(t){if(t)if(t.type)switch(t.type){case"FeatureCollection":this.dontCreateGroups||this.builder.addGroup(""!=this.groupIdPrefix?this.groupIdPrefix:null),this.processCollection(t);break;case"Feature":this.dontCreateGroups||this.builder.addGroup(""!=this.groupIdPrefix?this.groupIdPrefix:null),this.processFeature(t)}else for(var e in t){var i=t[e];switch(this.dontCreateGroups||this.builder.addGroup(this.groupIdPrefix+e),t.type){case"FeatureCollection":this.processCollection(i);break;case"Feature":this.processFeature(i)}}},e.a=r},function(t,e,i){"use strict";var r=function(t,e,i){this.builder=t,this.map=t.map,this.groupIdPrefix=e||"",this.dontCreateGroups=i};r.prototype.processJSON=function(t){if(t){var e,i,r,s,a,n,o,h,l,u=t.groups,c=this.builder;if(u)for(e=0,i=u.length;e<i;e++){var d=u[e],p=d.bbox,f=d.resolution;if(p&&f){var g=p[0],m=p[1];if(g&&m){this.dontCreateGroups||c.addGroup(this.groupIdPrefix+(d.id||""));var v=(m[0]-g[0])/f,y=(m[1]-g[1])/f,b=(m[2]-g[2])/f,x=d.points;if(x)for(l=x.points,r=0,s=x.length;r<s;r++){var M=x[r],w=M.points,S=new Array(w.length);for(a=0,n=w.length;a<n;a++)o=w[a],S[a]=[g[0]+o[0]*v,g[1]+o[1]*y,g[2]+o[2]*b];c.addPointArray(S,"fix",M.properties,M.id,null,!0)}var A=d.lines;if(A)for(r=0,s=A.length;r<s;r++){var C=A[r],T=C.lines,P=new Array(T.length);for(a=0,n=T.length;a<n;a++){l=T[a],h=new Array(l.length);for(var E=0,L=l.length;E<L;E++)o=l[E],h[E]=[g[0]+o[0]*v,g[1]+o[1]*y,g[2]+o[2]*b];P[a]=h}c.addLineStringArray(P,"fix",C.properties,C.id,null,!0)}}}}}},e.a=r},function(t,e,i){"use strict";var r=function(t,e){this.layer=t,this.map=t.map,this.renderer=this.map.renderer,this.killed=!1,this.listener=e,this.busy=!1,this.ready=!0,this.waitingForStylesheet=!1,this.stylesheet=null,this.fonts={};var r=i(116);this.processWorker=new r,this.processWorker.onerror=function(t){throw new Error(t.message+" ("+t.filename+":"+t.lineno+")")},this.processWorker.onmessage=this.onMessage.bind(this)};r.prototype.kill=function(){this.killed||(this.killed=!0,null!=this.processWorker&&this.processWorker.terminate())},r.prototype.isReady=function(){return this.waitingForStylesheet&&(this.waitingForStylesheet=!this.stylesheet.isReady()),(this.ready&&!this.busy||this.killed)&&!this.waitingForStylesheet},r.prototype.onMessage=function(t){if(!this.killed){t=t.data;var e=t.command;"ready"==e?this.ready=!0:"styleDone"==e&&(this.busy=!1),null!=this.listener&&this.listener(e,t)}},r.prototype.setListener=function(t){this.listener=t},r.prototype.sendCommand=function(t,e,i){if(!this.killed){this.ready=!1;var r={command:t,data:e};i&&i.id&&(r.lod=i.id[0],i.metanode&&(r.tileSize=i.metanode.diskAngle*i.metanode.diskDistance)),this.processWorker.postMessage(r)}},r.prototype.setStylesheet=function(t,e){if(this.stylesheet=t,!t.isReady())return void(this.waitingForStylesheet=!0);this.busy=!0,this.sendCommand("setStylesheet",{data:t.data,geocent:!this.map.getNavigationSrs().isProjected(),metric:this.map.config.mapMetricUnits});var i=t.fonts,r={};for(var s in i){var a=i[s],n=this.renderer.fonts[a];r[s]=a,n&&this.setFont(a,n)}this.sendCommand("setFontMap",{map:r})},r.prototype.setFont=function(t,e){this.fonts[t]||(this.fonts[t]=e,this.sendCommand("setFont",{url:t,data:e.data},[e.data]))},e.a=r},function(t,e,i){"use strict";var r=i(151),s=i(46),a=i(53),n=i(31),o=i(131),h=r.a,l=s.a,u=a.a,c=n.a,d=o.a,p=function(t){this.map=t,this.config=t.config};p.prototype.setPosition=function(t){return this.map.setPosition(t),this},p.prototype.getPosition=function(){return this.map.getPosition()},p.prototype.setView=function(t){return this.map.setView(t),this},p.prototype.getView=function(){return this.map.getView()},p.prototype.getCredits=function(){return this.map.getCredits()},p.prototype.getCurrentCredits=function(){return this.map.getVisibleCredits()},p.prototype.getCreditInfo=function(t){var e=this.map.getCreditById(t);return e?e.getInfo():{}},p.prototype.getViews=function(){return this.map.getNamedViews()},p.prototype.getViewInfo=function(t){var e=this.map.getNamedView(t);return e?e.getInfo():{}},p.prototype.getBoundLayers=function(){return this.map.getBoundLayers()},p.prototype.getBoundLayerInfo=function(t){return this.map.getBoundLayerInfo(t)},p.prototype.getFreeLayers=function(){return this.map.getFreeLayers()},p.prototype.getFreeLayerInfo=function(t){var e=this.map.getFreeLayer(t);return e?e.getInfo():{}},p.prototype.getSurfaces=function(){return this.map.getSurfaces()},p.prototype.getSurfaceInfo=function(t){var e=this.map.getFreeLayer(t);return e?e.getInfo():{}},p.prototype.getSrses=function(){return this.map.getSrses()},p.prototype.getSrsInfo=function(t){var e=this.map.getSrs(t);return e?e.getInfo():{}},p.prototype.getReferenceFrame=function(){return this.map.referenceFrame.getInfo()},p.prototype.addFreeLayer=function(t,e){var i=new u(this.map,e,"free");this.map.addFreeLayer(t,i)},p.prototype.removeFreeLayer=function(t){this.map.removeFreeLayer(t)},p.prototype.addBoundLayer=function(t,e){var i=new l(this.map,e,t);this.map.addBoundLayer(t,i)},p.prototype.removeBoundLayer=function(t){this.map.removeBoundLayer(t)},p.prototype.convertPositionViewMode=function(t,e){return this.map.convert.convertPositionViewMode(new c(t),e)},p.prototype.convertPositionHeightMode=function(t,e,i){return this.map.convert.convertPositionHeightMode(new c(t),e,i)},p.prototype.convertCoords=function(t,e,i){var r=this.map.getSrs(t),s=this.map.getSrs(e);return r&&s?s.convertCoordsFrom(i,r):null},p.prototype.convertCoordsFromNavToPublic=function(t,e,i){var r=["obj",t[0],t[1],e,t[2],0,0,0,10,45];return this.map.convert.getPositionPublicCoords(new c(r),i)},p.prototype.convertCoordsFromPublicToNav=function(t,e,i){var r=["obj",t[0],t[1],e,t[2],0,0,0,10,45];return this.map.convert.getPositionNavCoordsFromPublic(new c(r),i)},p.prototype.convertCoordsFromPhysToPublic=function(t){return this.map.convert.convertCoords(t,"physical","public")},p.prototype.convertCoordsFromNavToPhys=function(t,e,i){var r=["obj",t[0],t[1],e,t[2],0,0,0,10,45];return this.map.convert.getPositionPhysCoords(new c(r),i)},p.prototype.convertCoordsFromPhysToNav=function(t,e,i){return this.map.convert.convertCoordsFromPhysToNav(t,e,i)},p.prototype.convertCoordsFromNavToCanvas=function(t,e,i){var r=["obj",t[0],t[1],e,t[2],0,0,0,10,45];return this.map.convert.getPositionCanvasCoords(new c(r),i)},p.prototype.convertCoordsFromPhysToCanvas=function(t){var e=["obj",t[0],t[1],"fix",t[2],0,0,0,10,45];return this.map.convert.getPositionCanvasCoords(new c(e),null,!0)},p.prototype.convertCoordsFromNavToCameraSpace=function(t,e,i){var r=["obj",t[0],t[1],e,t[2],0,0,0,10,45];return this.map.convert.getPositionCameraSpaceCoords(new c(r),i)},p.prototype.convertCoordsFromPhysToCameraSpace=function(t){var e=this.map.camera.position;return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]},p.prototype.getPositionCanvasCoords=function(t,e){return this.map.convert.getPositionCanvasCoords(new c(t),e)},p.prototype.getPositionCameraCoords=function(t,e){return this.map.convert.getPositionCameraCoords(new c(t),e)},p.prototype.movePositionCoordsTo=function(t,e,i,r){return this.map.convert.movePositionCoordsTo(new c(t),e,i,r)},p.prototype.getSurfaceHeight=function(t,e){return this.map.measure.getSurfaceHeight(t,this.map.measure.getOptimalHeightLodBySampleSize(t,e))},p.prototype.getDistance=function(t,e,i){return this.map.measure.getDistance(t,e,i)},p.prototype.getAzimuthCorrection=function(t,e){return this.map.measure.getAzimuthCorrection(t,e)},p.prototype.getNED=function(t){return this.map.measure.getNewNED(t,!0)},p.prototype.getCameraInfo=function(){var t=this.map.camera;return{projectionMatrix:t.camera.projection.slice(),viewMatrix:t.camera.modelview.slice(),viewProjectionMatrix:t.camera.mvp.slice(),rotationMatrix:t.camera.rotationview.slice(),position:this.map.camera.position.slice(),vector:this.map.camera.vector.slice(),distance:this.map.camera.distance,height:this.map.camera.height}},p.prototype.isPointInsideCameraFrustum=function(t){return this.map.camera.camera.pointVisible(t,this.map.camera.position)},p.prototype.isBBoxInsideCameraFrustum=function(t){return this.map.camera.camera.bboxVisible({min:t[0],max:t[1]},this.map.camera.position)},p.prototype.generateTrajectory=function(t,e,i){return t=new c(t),e=new c(e),new h(this.map,t,e,i).generate()},p.prototype.generatePIHTrajectory=function(t,e,i,r){var s=new c(t);return r.distance=i,r.azimuth=e,r.distanceAzimuth=!0,new h(this.map,s,s,r).generate()},p.prototype.setConfigParams=function(t){return this.map.setConfigParams(t),this},p.prototype.setConfigParam=function(t,e){return this.map.setConfigParam(t,e),this},p.prototype.getConfigParam=function(t){return this.map.getConfigParam(t)},p.prototype.redraw=function(){return this.map.markDirty(),this},p.prototype.addRenderSlot=function(t,e,i){return this.map.renderSlots.addRenderSlot(t,e,i),this},p.prototype.moveRenderSlotBefore=function(t,e){return this.map.renderSlots.moveRenderSlotBefore(t,e),this},p.prototype.moveRenderSlotAfter=function(t,e){return this.map.renderSlots.moveRenderSlotAfter(t,e),this},p.prototype.removeRenderSlot=function(t){return this.map.renderSlots.removeRenderSlot(t),this},p.prototype.setRenderSlotEnabled=function(t,e){return this.map.renderSlots.setRenderSlotEnabled(t,e),this},p.prototype.getRenderSlotEnabled=function(t){return this.map.renderSlots.getRenderSlotEnabled(t)},p.prototype.setLoaderSuspended=function(t){return this.map.loaderSuspended=t,this},p.prototype.getLoaderSuspended=function(){return this.map.loaderSuspended},p.prototype.getGpuCache=function(){return this.map.gpuCache},p.prototype.getHitCoords=function(t,e,i,r){return this.map.getHitCoords(t,e,i,r)},p.prototype.getScreenRay=function(t,e){return this.map.getScreenRay(t,e)},p.prototype.renderToImage=function(){return this.map.renderToImage()},p.prototype.getStats=function(t){if(t)return{maxZoom:this.map.draw.debug.maxZoom};for(var e=0,i=0,r=this.map.geodataProcessors;i<r;i++)this.map.geodataProcessors[i].busy&&e++;return{bestMeshTexelSize:this.map.bestMeshTexelSize,bestGeodataTexelSize:this.map.bestGeodataTexelSize,downloading:this.map.loader.downloading.length,lastDownload:this.map.loader.lastDownloadTime,surfaces:this.map.tree.surfaceSequence.length,freeLayers:this.map.freeLayerSequence.length,texelSizeFit:this.map.texelSizeFit,loadMode:this.map.config.mapLoadMode,processingTasks:this.map.processingTasks.length,busyWorkers:e,dirty:this.map.dirty,drawnTiles:this.map.stats.drawnTiles,drawnGeodataTiles:this.map.stats.drawnGeodataTiles}},p.prototype.click=function(t,e,i){this.map.click(t,e,i)},p.prototype.hover=function(t,e,i,r){this.map.hover(t,e,i,r)},p.prototype.createGeodata=function(){return new d(this.map)},p.prototype.getGeodataGeometry=function(t){return this.map.renderer.geometries[t]},p.prototype.setGeodataSelection=function(t){return this.map.renderer.geodataSelection=t,this.map.markDirty(),this},p.prototype.getGeodataSelection=function(){return this.map.renderer.geodataSelection},e.a=p},function(t,e,i){"use strict";var r=function(t,e){this.map=t,this.maxThreads=e||1,this.usedThreads=0,this.maxPending=2*this.maxThreads,this.fadeout=.95,this.pending=[[],[]],this.channel=0,this.downloading=[],this.downloadingTime=[],this.lastDownloadTime=0,this.downloaded=0,this.updateThreadCount()};r.prototype.updateThreadCount=function(){this.maxThreads=this.map.config.mapDownloadThreads,this.maxPending=Math.max(20,2*this.maxThreads),this.fadeout=(this.maxPending-1)/this.maxPending},r.prototype.setChannel=function(t){this.channel=t},r.prototype.load=function(t,e,i,r,s){var a=this.downloading.indexOf(t);if(-1==a){var n=this.pending[this.channel];a=this.map.searchArrayIndexById(n,t),-1!=a?n[a].priority=i:n.unshift({id:t,call:e,priority:i||0,tile:r,kind:s});do{for(var o=!0,h=0,l=n.length-1;h<l;h++)if(n[h].priority>n[h+1].priority){var u=n[h];n[h]=n[h+1],n[h+1]=u,o=!1}}while(!o);n.length>this.maxPending&&n.pop()}},r.prototype.remove=function(t){var e=this.map.searchArrayIndexById(this.pending[this.channel],t);-1!=e&&this.pending[this.channel].splice(e,1)},r.prototype.onLoaded=function(t){var e=this.downloading.indexOf(t.id),i=performance.now(),r=this.map.stats;this.map.draw.replay.storeLoaded&&this.map.draw.replay.loaded.push({url:t.id,kind:t.kind,tile:t.tile,priority:t.priority,time:i,duration:i-this.downloadingTime[e],interval:i-this.lastDownloadTime,threads:this.downloading.length}),this.downloading.splice(e,1),this.downloadingTime.splice(e,1),this.lastDownloadTime=i,this.usedThreads--,this.map.markDirty(),this.update(),r.loadedCount++,r.loadLast=i},r.prototype.onLoadError=function(t){var e=this.downloading.indexOf(t.id),i=performance.now(),r=this.map.stats;this.map.draw.replay.storeLoaded&&this.map.draw.replay.loaded.push({url:t.id,kind:t.kind,tile:t.tile,priority:t.priority,time:i,duration:i-this.downloadingTime[e],interval:i-this.lastDownloadTime,threads:this.downloading.length}),this.downloading.splice(e,1),this.downloadingTime.splice(e,1),this.lastDownloadTime=i,this.usedThreads--,this.map.markDirty(),this.update(),r.loadErrorCount++,r.loadLast=i},r.prototype.updateChannel=function(t){var e=this.pending[t];this.updateThreadCount();for(var i=0,r=e.length;i<r;i++)e[i].priority*=this.fadeout;for(var s=performance.now();e.length>0&&this.usedThreads<this.maxThreads;){var a=e.shift();-1==this.downloading.indexOf(a.id)&&null!=a.call&&(this.downloading.push(a.id),this.downloadingTime.push(s),this.usedThreads++,this.downloaded++,a.call(a.id,this.onLoaded.bind(this,a),this.onLoadError.bind(this,a)))}},r.prototype.update=function(){if(!this.map.loaderSuspended)for(var t=this.pending.length-1;t>=0;t--)if(this.pending[t].length>0){this.updateChannel(t);break}},e.a=r},function(t,e,i){"use strict";var r=i(2),s=i(4),a=i(22),n=i(55),o=i(52),h=i(146),l=i(49),u=i(124),c=i(125),d=i(126),p=i(127),f=i(139),g=i(130),m=i(137),v=i(31),y=i(144),b=i(147),x=i(149),M=i(152),w=i(6),S=r.b,A=s.a,C=a.a,T=n.a,P=o.a,E=h.a,L=l.a,k=u.a,I=c.a,N=d.a,F=p.a,B=f.a,R=g.a,_=m.a,D=v.a,U=y.a,z=b.a,G=x.a,V=M.a,O=w.a,j=function(t,e,i,r){switch(this.config=r||{},this.setConfigParams(r),this.core=t,this.proj4=this.core.getProj4(),this.coreConfig=t.coreConfig,this.killed=!1,this.config=r||{},this.loaderSuspended=!1,this.url=new V(this,i),this.position=new D(["obj",0,0,"fix",0,0,0,0,0,0]),this.lastPosition=this.position.clone(),this.srses={},this.referenceFrame={},this.credits={},this.creditsByNumber={},this.surfaces=[],this.virtualSurfaces={},this.glues={},this.freeLayers=[],this.boundLayers=[],this.dynamicLayers=[],this.stylesheets=[],this.processingTasks=[],this.geodataProcessors=[],this.surfaceSequence=new G(this),this.initialView=null,this.currentView=new T(this,{}),this.currentViewString="",this.namedViews=[],this.viewCounter=0,this.srsReady=!1,this.freeLayerSequence=[],this.freeLayersHaveGeodata=!1,this.visibleCredits={imagery:{},glueImagery:{},mapdata:{}},this.mobile=!1,this.metanodeBuffer=new Uint8Array(1024),this.gpuCache=new k(this,1024*this.config.mapGPUCache*1024),this.resourcesCache=new k(this,1024*this.config.mapCache*1024),this.metatileCache=new k(this,1024*this.config.mapMetatileCache*1024),this.setupMobileMode(this.config.mapMobileMode),this.setupCache(),this.loader=new _(this,this.config.mapDownloadThreads),this.renderer=this.core.renderer,this.camera=new I(this),this.stats=new z(this),this.resourcesTree=new E(this),this.mapConfig=new N(this,e),this.convert=new F(this),this.measure=new B(this),this.convert.measure=this.measure,this.isGeocent=!this.getNavigationSrs().isProjected(),this.tree=new P(this,!1),this.mapConfig.afterConfigParsed(),this.updateCoutner=0,this.dirty=!0,this.dirtyCountdown=0,this.hitMapDirty=!0,this.geoHitMapDirty=!0,this.clickEvent=null,this.hoverEvent=null,this.hoverFeature=null,this.hoverFeatureId=null,this.lastHoverFeature=null,this.lastHoverFeatureId=null,this.hoverFeatureCounter=0,this.hoverFeatureList=[],this.draw=new R(this),this.draw.setupDetailDegradation(),this.referenceFrame.id){case"melown2015":this.draw.atmoColor=[216/255,232/255,243/255,1],this.draw.atmoColor2=[72/255,154/255,1,1],this.draw.atmoColor3=[216/255,232/255,243/255,1],this.draw.atmoHeight=5e4;break;case"mars-qsc":this.draw.atmoColor=[1,187/255,157/255,1],this.draw.atmoColor2=[1,155/255,113/255,1],this.draw.atmoColor3=[1,187/255,157/255,.5],this.draw.atmoHeight=25e3,this.draw.atmoDensity=4}this.draw.atmoHeightFactor=this.draw.atmoHeight/5e4,this.renderSlots=new U(this),this.renderSlots.addRenderSlot("map",this.drawMap.bind(this),!0)};j.prototype.kill=function(){this.killed=!0,this.tree&&this.tree.kill();for(var t in this.freeLayers){var e=this.freeLayers[t];e&&e.tree&&e.tree.kill()}this.gpuCache.clear(),this.resourcesCache.clear(),this.metatileCache.clear(),null!=this.renderer&&(this.renderer.kill(),this.renderer=null)},j.prototype.setupMobileMode=function(){this.mobile=this.config.mapMobileMode,!this.mobile&&this.config.mapMobileModeAutodect&&(this.mobile=C.isMobile()),this.setupCache()},j.prototype.setupCache=function(){if(this.resourcesCache){var t=1/(this.mobile?Math.pow(2,Math.max(0,this.config.mapMobileDetailDegradation-1)):1);t=.5*(t+1/(this.mobile?Math.pow(2,this.config.mapMobileDetailDegradation):1)),this.resourcesCache.setMaxCost(1024*this.config.mapCache*1024*t),this.gpuCache.setMaxCost(1024*this.config.mapGPUCache*1024*t),this.metatileCache.setMaxCost(1024*this.config.mapMetatileCache*1024*(t<.8?.5:1))}},j.prototype.getCoreInterface=function(){return this.core.interface},j.prototype.getRendererInterface=function(){return this.core.interface.getRendererInterface()},j.prototype.setOption=function(){},j.prototype.getOption=function(){},j.prototype.addSrs=function(t,e){this.srses[t]=e},j.prototype.getSrs=function(t){return this.srses[t]},j.prototype.getSrses=function(){return this.getMapKeys(this.srses)},j.prototype.setReferenceFrame=function(t){this.referenceFrame=t},j.prototype.addCredit=function(t,e){this.credits[t]=e,this.creditsByNumber[e.id]=e,e.key=t},j.prototype.getCreditByNumber=function(t){return this.creditsByNumber[t]},j.prototype.getCreditById=function(t){return this.credits[t]},j.prototype.getCredits=function(){return this.getMapKeys(this.credits)},j.prototype.getVisibleCredits=function(){var t,e,i,r,s=this.visibleCredits.imagery,a=this.visibleCredits.glueImagery,n=[],o=[];for(var h in a)s[h]||(s[h]=a[h]);this.visibleCredits.glueImagery={};for(h in s)n.push(h),o.push(s[h]);do{for(r=!0,t=0,e=o.length-1;t<e;t++)o[t]<o[t+1]&&(i=o[t],o[t]=o[t+1],o[t+1]=i,i=n[t],n[t]=n[t+1],n[t+1]=i,r=!1)}while(!r);var l=this.visibleCredits.mapdata,u=[],c=[];for(h in l)u.push(h),c.push(l[h]);do{for(r=!0,t=0,e=c.length-1;t<e;t++)c[t]<c[t+1]&&(i=c[t],c[t]=c[t+1],c[t+1]=i,i=u[t],u[t]=u[t+1],u[t+1]=i,r=!1)}while(!r);return{"3D":[],imagery:n,mapdata:u}},j.prototype.addSurface=function(t,e){this.surfaces.push(e),e.index=this.surfaces.length-1},j.prototype.getSurface=function(t){return this.searchArrayById(this.surfaces,t)},j.prototype.getSurfaces=function(){for(var t=[],e=0,i=this.surfaces.length;e<i;e++)t.push(this.surfaces[e].id);return t},j.prototype.addGlue=function(t,e){this.glues[t]=e},j.prototype.getGlue=function(t){return this.glues[t]},j.prototype.addBoundLayer=function(t,e){this.boundLayers[t]=e},j.prototype.setBoundLayerOptions=function(t,e){this.boundLayers[t]&&this.boundLayers[t].setOptions(e)},j.prototype.getBoundLayerOptions=function(t){return this.boundLayers[t]?this.boundLayers[t].getOptions():null},j.prototype.removeBoundLayer=function(t){this.boundLayers[t]&&(this.boundLayers[t].kill(),this.boundLayers[t]=null)},j.prototype.getBoundLayerByNumber=function(t){var e=this.boundLayers;for(var i in e)if(e[i].numberId==t)return e[i];return null},j.prototype.getBoundLayerById=function(t){return this.boundLayers[t]},j.prototype.getBoundLayers=function(){return this.getMapKeys(this.boundLayers)},j.prototype.addFreeLayer=function(t,e){this.freeLayers[t]=e,this.setView(this.getView()),this.markDirty()},j.prototype.removeFreeLayer=function(t){this.freeLayers[t]&&(this.freeLayers[t].kill(),this.freeLayers[t]=null,this.setView(this.getView()),this.markDirty())},j.prototype.setFreeLayerOptions=function(t,e){this.freeLayers[t]&&this.freeLayers[t].setOptions(e)},j.prototype.getFreeLayerOptions=function(t){return this.freeLayers[t]?this.freeLayers[t].getOptions():null},j.prototype.getFreeLayer=function(t){return this.freeLayers[t]},j.prototype.getFreeLayers=function(){var t=[];for(var e in this.freeLayers)t.push(e);return t},j.prototype.getMapsSrs=function(t){return null==t?null:-1!=t.indexOf("+proj")?new L(this,{srsDef:t}):this.srses[t]},j.prototype.addNamedView=function(t,e){this.namedViews[t]=e},j.prototype.getNamedView=function(t){return this.namedViews[t]},j.prototype.getNamedViews=function(){return this.getMapKeys(this.namedViews)},j.prototype.setView=function(t,e){if(null!=t){if("string"==typeof t)if(t=t.trim(),"{"==t.charAt(0))try{t=JSON.parse(t)}catch(t){return}else{if(!(t=this.getNamedView(t)))return;t=t.getInfo()}var i=JSON.stringify(t);(i!=this.currentViewString||e)&&(this.currentView.parse(t),this.currentViewString=i,this.viewCounter++),this.surfaceSequence.generateSurfaceSequence(),this.surfaceSequence.generateBoundLayerSequence(),this.refreshFreelayesInView(),this.markDirty()}},j.prototype.addStylesheet=function(t,e){this.stylesheets[t]=e},j.prototype.getStylesheet=function(t){return this.stylesheets[t]},j.prototype.getStylesheets=function(){var t=[];for(var e in this.stylesheets)t.push(e);return t},j.prototype.getStylesheetData=function(t){var e=this.getStylesheet(t);return e?{url:e.url,data:e.data}:{url:null,data:{}}},j.prototype.setStylesheetData=function(t,e){var i=this.getStylesheet(t);if(i){e&&i.setData(e);for(var r in this.freeLayers){var s=this.getFreeLayer(r);s&&s.geodata&&s.stylesheet==i&&(s.geodataProcessor&&s.geodataProcessor.setStylesheet(s.stylesheet),s.geodataCounter++)}}this.markDirty()},j.prototype.getView=function(){return this.currentView.getInfo()},j.prototype.refreshFreelayesInView=function(){var t=this.currentView.freeLayers;this.freeLayerSequence=[];for(var e in t){var i=this.getFreeLayer(e);i&&(i.zFactor=t[e].depthOffset,this.freeLayerSequence.push(i),t[e].style?i.setStyle(t[e].style):i.setStyle(i.originalStyle))}},j.prototype.refreshView=function(){this.viewCounter++,this.surfaceSequence.generateSurfaceSequence(),this.surfaceSequence.generateBoundLayerSequence(),this.refreshFreelayesInView(),this.markDirty()},j.prototype.searchArrayIndexById=function(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i].id==e)return i;return-1},j.prototype.searchArrayById=function(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i].id==e)return t[i];return null},j.prototype.searchMapByInnerId=function(t,e){for(var i in t)if(t[i].id==e)return t[i];return null},j.prototype.getMapKeys=function(t){var e=[];for(var i in t)e.push(i);return e},j.prototype.getMapIds=function(t){var e=[];for(var i in t)e.push(i.id);return e},j.prototype.setPosition=function(t){this.position=new D(t),this.markDirty()},j.prototype.isReferenceFrameReady=function(){return this.referenceFrame.model.physicalSrs.isReady()&&this.referenceFrame.model.publicSrs.isReady()&&this.referenceFrame.model.navigationSrs.isReady()},j.prototype.getPhysicalSrs=function(){return this.referenceFrame.model.physicalSrs},j.prototype.getPublicSrs=function(){return this.referenceFrame.model.publicSrs},j.prototype.getNavigationSrs=function(){return this.referenceFrame.model.navigationSrs},j.prototype.getPosition=function(){return this.position.clone()},j.prototype.setConfigParams=function(t){if("object"==typeof t&&null!==t)for(var e in t)this.setConfigParam(e,t[e])},j.prototype.setConfigParam=function(t,e){switch(t){case"map":this.config.map=A.validateString(e,null);break;case"mapCache":this.config.mapCache=A.validateNumber(e,10,Number.MAXINTEGER,900),this.setupCache();break;case"mapGPUCache":this.config.mapGPUCache=A.validateNumber(e,10,Number.MAXINTEGER,360),this.setupCache();break;case"mapMetatileCache":this.config.mapMetatileCache=A.validateNumber(e,10,Number.MAXINTEGER,60),this.setupCache();break;case"mapTexelSizeFit":this.config.mapTexelSizeFit=A.validateNumber(e,1e-4,Number.MAXINTEGER,1.1);break;case"mapLowresBackground":this.config.mapLowresBackground=A.validateNumber(e,0,Number.MAXINTEGER,0);break;case"mapDownloadThreads":this.config.mapDownloadThreads=A.validateNumber(e,1,Number.MAXINTEGER,6);break;case"mapMaxProcessingTime":this.config.mapMaxProcessingTime=A.validateNumber(e,1,Number.MAXINTEGER,50);break;case"mapMobileMode":this.config.mapMobileMode=A.validateBool(e,!1),this.setupMobileMode();break;case"mapMobileModeAutodect":this.config.mapMobileModeAutodect=A.validateBool(e,!1);break;case"mapMobileDetailDegradation":this.config.mapMobileDetailDegradation=A.validateNumber(e,1,Number.MAXINTEGER,2);break;case"mapNavSamplesPerViewExtent":this.config.mapNavSamplesPerViewExtent=A.validateNumber(e,1e-11,Number.MAXINTEGER,4);break;case"mapFog":this.config.mapFog=A.validateBool(e,!1),this.draw&&(this.draw.debug.drawFog=this.config.mapFog,this.dirty=!0);break;case"mapFlatshade":this.config.mapFlatshade=A.validateBool(e,!1),this.draw&&(this.draw.debug.drawWireframe=this.config.mapFlatshade?3:0,this.dirty=!0);break;case"mapIgnoreNavtiles":this.config.mapIgnoreNavtiles=A.validateBool(e,!1);break;case"mapAllowHires":this.config.mapAllowHires=A.validateBool(e,!0);break;case"mapAllowLowres":this.config.mapAllowLowres=A.validateBool(e,!0);break;case"mapAllowSmartSwitching":this.config.mapAllowSmartSwitching=A.validateBool(e,!0);break;case"mapDisableCulling":this.config.mapDisableCulling=A.validateBool(e,!1);break;case"mapPreciseCulling":this.config.mapPreciseCulling=A.validateBool(e,!1);break;case"mapHeightLodBlend":this.config.mapHeightLodBlend=A.validateBool(e,!0);break;case"mapHeightNodeBlend":this.config.mapHeightNodeBlend=A.validateBool(e,!0);break;case"mapBasicTileSequence":this.config.mapBasicTileSequence=A.validateBool(e,!0);break;case"mapSmartNodeParsing":this.config.mapSmartNodeParsing=A.validateBool(e,!0);break;case"mapStoreLoadStats":this.config.mapStoreLoadStats=A.validateBool(e,!0),this.draw&&this.draw.replay&&(this.draw.replay.storeLoaded=this.config.mapStoreLoadStats);break;case"mapXhrImageLoad":this.config.mapXhrImageLoad=A.validateBool(e,!1);break;case"mapLoadMode":this.config.mapLoadMode=A.validateString(e,"topdown");break;case"mapGeodataLoadMode":this.config.mapGeodataLoadMode=A.validateString(e,"fit");break;case"mapGridMode":this.config.mapGridMode=A.validateString(e,"linear");break;case"mapPreciseBBoxTest":this.config.mapPreciseBBoxTest=A.validateBool(e,!0);break;case"mapPreciseDistanceTest":this.config.mapPreciseDistanceTest=A.validateBool(e,!1);break;case"mapHeightfiledWhenUnloaded":this.config.mapHeightfiledWhenUnloaded=A.validateBool(e,!1);break;case"mapForceMetatileV3":this.config.mapForceMetatileV3=A.validateBool(e,!1);break;case"mapVirtualSurfaces":this.config.mapVirtualSurfaces=A.validateBool(e,!0);break;case"mapDegradeHorizon":this.config.mapDegradeHorizon=A.validateBool(e,!0);break;case"mapDegradeHorizonParams":this.config.mapDegradeHorizonParams=A.validateNumberArray(e,4,[0,1,1,1],[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],[1,3e3,15e3,7e3]);break;case"mapGridSurrogatez":this.config.mapGridSurrogatez=A.validateBool(e,!1);break;case"mapRefreshCycles":this.config.mapRefreshCycles=A.validateNumber(e,0,Number.MAXINTEGER,3);break;case"mapDefaultFont":this.config.mapDefaultFont=A.validateString(e,"");break;case"mapMetricUnits":this.config.mapMetricUnits=A.validateBool(e,!0);break;case"mario":this.config.mario=A.validateBool(e,!0)}},j.prototype.getConfigParam=function(t){switch(t){case"map":return this.config.map;case"mapCache":return this.config.mapCache;case"mapGPUCache":return this.config.mapGPUCache;case"mapMetatileCache":return this.config.mapMetatileCache;case"mapTexelSizeFit":return this.config.mapTexelSizeFit;case"mapLowresBackground":return this.config.mapLowresBackground;case"mapDownloadThreads":return this.config.mapDownloadThreads;case"mapMaxProcessingTime":return this.config.mapMaxProcessingTime;case"mapMobileMode":return this.config.mapMobileMode;case"mapMobileModeAutodect":return this.config.mapMobileModeAutodect;case"mapMobileDetailDegradation":return this.config.mapMobileDetailDegradation;case"mapNavSamplesPerViewExtent":return this.config.mapNavSamplesPerViewExtent;case"mapFog":return this.config.mapFog;case"mapFlatshade":return this.config.mapFlatshade;case"mapIgnoreNavtiles":return this.config.mapIgnoreNavtiles;case"mapAllowHires":return this.config.mapAllowHires;case"mapAllowLowres":return this.config.mapAllowLowres;case"mapAllowSmartSwitching":return this.config.mapAllowSmartSwitching;case"mapDisableCulling":return this.config.mapDisableCulling;case"mapPreciseCulling":return this.config.mapPreciseCulling;case"mapHeightLodBlend":return this.config.mapHeightLodBlend;case"mapHeightNodeBlend":return this.config.mapHeightNodeBlend;case"mapBasicTileSequence":return this.config.mapBasicTileSequence;case"mapSmartNodeParsing":return this.config.mapSmartNodeParsing;case"mapStoreLoadStats":return this.config.mapStoreLoadStats;case"mapXhrImageLoad":return this.config.mapXhrImageLoad;case"mapLoadMode":return this.config.mapLoadMode;case"mapGeodataLoadMode":return this.config.mapGeodataLoadMode;case"mapGridMode":return this.config.mapGridMode;case"mapPreciseBBoxTest":return this.config.mapPreciseBBoxTest;case"mapPreciseDistanceTest":return this.config.mapPreciseDistanceTest;case"mapHeightfiledWhenUnloaded":return this.config.mapHeightfiledWhenUnloaded;case"mapForceMetatileV3":return this.config.mapForceMetatileV3;case"mapVirtualSurfaces":return this.config.mapVirtualSurfaces;case"mapDegradeHorizon":return this.config.mapDegradeHorizon;case"mapDegradeHorizonParams":return this.config.mapDegradeHorizonParams;case"mapGridSurrogatez":return this.config.mapGridSurrogatez;case"mapRefreshCycles":return this.config.mapRefreshCycles;case"mapDefaultFont":return this.config.mapDefaultFont;case"mapMetricUnits":return this.config.mapMetricUnits;case"mario":return this.config.mario}},j.prototype.click=function(t,e,i){this.clickEvent=[t,e,i]},j.prototype.hover=function(t,e,i,r){this.hoverEvent=[t,e,i,r]},j.prototype.markDirty=function(){this.dirty=!0,this.hitMapDirty=!0,this.geoHitMapDirty=!0},j.prototype.getScreenRay=function(t,e){return this.renderer.getScreenRay(t,e)},j.prototype.renderToImage=function(t){var e=this.renderer.gpu.canvas,i=e.width,r=e.height,s=A.fitToPowerOfTwo(i),a=A.fitToPowerOfTwo(r),n=new Uint8Array(s*a*4),t=new O(this.renderer.gpu);t.createFromData(s,a,n),t.createFramebuffer(s,a),this.draw.drawToTexture(t),n=t.readFramebufferPixels(0,0,i,r),t.kill();for(var o=new Uint8Array(i*r*4),h=0;h<r;h++)for(var l=h*i*4,u=(r-h-1)*i*4,c=0;c<i;c++)o[u]=n[l],o[u+1]=n[l+1],o[u+2]=n[l+2],o[u+3]=n[l+3],l+=4,u+=4;return{width:i,height:r,data:o}},j.prototype.getHitCoords=function(t,e,i,r){this.hitMapDirty&&this.draw.drawHitmap();var s,a,n,o=this.renderer.hitTest(t,e),h=!1,l=this.camera.position,u=o[4];if(this.getNavigationSrs().isProjected()){var c=[0,0,Math.min(-1e3,this.referenceFrame.getGlobalHeightRange()[0])],d=[0,0,1];n=S.dot(d,u),a=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],b=S.dot(a,d)/n,b>=0&&(!o[3]||b<o[5])&&(s=[u[0]*b+l[0],u[1]*b+l[1],u[2]*b+l[2]],h=!0)}else{var p=this.getNavigationSrs().getSrsInfo(),f=p.b+this.referenceFrame.getGlobalHeightRange()[0],g=[l[0],l[1],l[2]];a=S.dot(u,u);var m=2*S.dot(u,g);if((n=m*m-4*a*(S.dot(g,g)-f*f))>0){n=Math.sqrt(n);var v=(-m-n)/(2*a),y=(-m+n)/(2*a),b=v<y?v:y;(!o[3]||b<o[5])&&(s=[u[0]*b+l[0],u[1]*b+l[1],u[2]*b+l[2]],h=!0)}}if(!o[3]&&!h)return null;h||(s=[o[0]+l[0],o[1]+l[1],o[2]+l[2]]);var x=this.convert.convertCoords(s,"physical","navigation");if("float"==i){r=null!=r?r:this.measure.getOptimalHeightLod(x,100,this.config.mapNavSamplesPerViewExtent);var M=this.measure.getSurfaceHeight(x,r);x[2]-=M[0]}return x},j.prototype.hitTestGeoLayers=function(t,e,i){if(this.geoHitMapDirty&&this.freeLayersHaveGeodata&&this.draw.drawGeodataHitmap(),!this.freeLayersHaveGeodata)return this.lastHoverFeature=null,this.lastHoverFeatureId=null,this.hoverFeature=null,this.hoverFeatureId=null,[null,!1,[]];var r,s,a=this.renderer.hitTestGeoLayers(t,e);if(!a[0])return r=[],"hover"==i&&(this.lastHoverFeature=this.hoverFeature,this.lastHoverFeatureId=this.hoverFeatureId,this.hoverFeature=null,this.hoverFeatureId=null,null!=this.lastHoverFeatureId&&(null!=this.lastHoverFeatureId&&r.push(["leave",this.lastHoverFeature,this.lastHoverFeatureId]),this.dirty=!0)),[null,!1,r,s];var n=a[1]+(a[2]<<8),o=this.hoverFeatureList[n];return o?(o[6]&&(a=this.renderer.hitTestGeoLayers(t,e,!0),a[0]&&(s=a[1]+(a[2]<<8))),"hover"==i?(this.lastHoverFeature=this.hoverFeature,this.lastHoverFeatureId=this.hoverFeatureId,o&&o[3]?(this.hoverFeature=o,this.hoverFeatureId=null!=o?o[0]["#id"]:null):(this.hoverFeature=null,this.hoverFeatureId=null),r=[],this.hoverFeatureId!=this.lastHoverFeatureId&&(null!=this.lastHoverFeatureId&&r.push(["leave",this.lastHoverFeature,this.lastHoverFeatureId]),null!=this.hoverFeatureId&&r.push(["enter",this.hoverFeature,this.hoverFeatureId]),this.dirty=!0),null!=this.hoverFeature&&this.hoverFeature[3]?[this.hoverFeature,!0,r,s]:[null,!1,r,s]):"click"==i?null!=o&&o[2]?[o,!0,[],s]:[null,!1,[],s]:void 0):[null,!1,[],s]},j.prototype.applyCredits=function(t){var e,i;for(var r in t.imageryCredits)e=t.imageryCredits[r],i=this.visibleCredits.imagery[r],this.visibleCredits.imagery[r]=i?e>i?e:i:e;for(r in t.glueImageryCredits)e=t.glueImageryCredits[r],i=this.visibleCredits.imagery[r],this.visibleCredits.glueImagery[r]=i?e>i?e:i:e;for(r in t.mapdataCredits)e=t.mapdataCredits[r],i=this.visibleCredits.mapdata[r],this.visibleCredits.mapdata[r]=i?e>i?e:i:e},j.prototype.drawMap=function(){this.draw.drawMap(null)},j.prototype.processProcessingTasks=function(){for(;this.processingTasks.length>0;){if(this.stats.renderBuild>this.config.mapMaxProcessingTime)return void this.markDirty();this.processingTasks[0](),this.processingTasks.shift()}},j.prototype.addProcessingTask=function(t){this.processingTasks.push(t)},j.prototype.update=function(){if(!this.killed){if(this.core.tokenExpiration&&Date.now()>this.core.tokenExpiration-6e4&&this.core.tokenExpirationCallback(),!this.srsReady)return void this.loader.update();if(!this.div||"hidden"!=this.div.style.visibility){this.position.isSame(this.lastPosition)||this.core.callListener("map-position-changed",{position:this.position.toArray(),"last-position":this.lastPosition.toArray()}),this.camera.lastTerrainHeight!=this.camera.terrainHeight&&this.core.callListener("map-position-fixed-height-changed",{height:this.camera.terrainHeight,"last-height":this.camera.lastTerrainHeight}),this.lastPosition=this.position.clone(),this.camera.lastTerrainHeight=this.camera.terrainHeight,this.drawFog=this.config.mapFog;var t,e=this.renderer.div.getBoundingClientRect(),i=this.renderer,r=i.cameraPosition;i.curSize[0]==e.width&&i.curSize[1]==e.height||(i.onResize(),this.dirty=!0);var s,a=this.dirty||this.dirtyCountdown>0;if(this.stats.begin(a),this.loader.update(),this.processProcessingTasks(),a&&(this.dirty?this.dirtyCountdown=this.config.mapRefreshCycles:this.dirtyCountdown--,this.dirty=!1,this.bestMeshTexelSize=0,this.bestGeodataTexelSize=0,this.renderSlots.processRenderSlots(),this.loader.update(),this.core.callListener("map-update",{})),null!=this.clickEvent||null!=this.hoverEvent){if(null!=this.hoverEvent){s=this.hitTestGeoLayers(this.hoverEvent[0],this.hoverEvent[1],"hover");var n=s[2];if(null!=n)for(var o=0,h=n.length;o<h;o++){var l=n[o];switch(l[0]){case"enter":t=l[1][1],this.core.callListener("geo-feature-enter",{feature:l[1][0],"canvas-coords":i.project2(l[1][1],i.camera.mvp,r),"physical-coords":[t[0]+r[0],t[1]+r[1],t[2]+r[2]],state:this.hoverEvent[3],element:s[3]});break;case"leave":t=l[1][1],this.core.callListener("geo-feature-leave",{feature:l[1][0],"canvas-coords":i.project2(l[1][1],i.camera.mvp,r),"physical-coords":[t[0]+r[0],t[1]+r[1],t[2]+r[2]],state:this.hoverEvent[3],element:s[3]})}}s[1]&&null!=s[0]&&(t=s[0][1],this.core.callListener("geo-feature-hover",{feature:s[0][0],"canvas-coords":i.project2(s[0][1],i.camera.mvp,r),"physical-coords":[t[0]+r[0],t[1]+r[1],t[2]+r[2]],state:this.hoverEvent[3],element:s[3]})),!0!==this.hoverEvent[2]&&(this.hoverEvent=null)}null!=this.clickEvent&&(s=this.hitTestGeoLayers(this.clickEvent[0],this.clickEvent[1],"click"),s[1]&&null!=s[0]&&(t=s[0][1],this.core.callListener("geo-feature-click",{feature:s[0][0],"canvas-coords":i.project2(s[0][1],i.camera.mvp,r),"physical-coords":[t[0]+r[0],t[1]+r[1],t[2]+r[2]],state:this.clickEvent[2],element:s[3]})),this.clickEvent=null)}this.stats.end(a)}}},e.a=j},function(t,e,i){"use strict";var r=i(2),s=i(3),a=i(23),n=i.n(a),o=r.b,h=r.e,l=s.a,u=n.a,c=function(t){this.map=t,this.config=t.config,this.convert=t.convert,this.getPhysicalSrs=this.map.getPhysicalSrs(),this.navigationSrs=this.map.getNavigationSrs(),this.navigationSrsInfo=this.navigationSrs.getSrsInfo(),this.isProjected=this.navigationSrs.isProjected();var e=this.getSpatialDivisionNodeDepths();this.minDivisionNodeDepth=e[0],this.maxDivisionNodeDepth=e[1]};c.prototype.getSurfaceHeight=function(t,e,i,r,s,a,n){if(!r){var o=this.getSpatialDivisionNode(t);r=o[0],s=o[1]}if(this.config.mapHeightLodBlend||(e=Math.floor(e)),n||this.config.mapIgnoreNavtiles)return this.getSurfaceHeightNodeOnly(null,e+8,i,e,null,r,s,a);var h=this.map.tree;if(null!=r&&null!==e){var l=h.findSurfaceTile(r.id),u={ll:r.extents.ll.slice(),ur:r.extents.ur.slice()},c={coords:s,desiredLod:Math.ceil(e),extents:u,metanode:null,heightMap:null,heightMapExtents:null,traceHeight:!0,waitingForNode:!1,finalNode:!1,bestHeightMap:999};h.traceHeight(l,c,!1);var d,p,f,g=c.metanode;if(c.heightMap){if(i){var m=this.map.stats;m.heightClass=2,m.heightLod=e,m.heightNode=g.id[0]}var v,y,b,x=g.id[0]>=Math.ceil(e);if(this.config.mapHeightLodBlend&&g.id[0]>0&&c.parent&&c.parent.heightMap&&e<=g.id[0]){y=this.getHeightmapValue(s,c.parent.metanode,c.parent),b=this.getHeightmapValue(s,g,c);var M=e-Math.floor(e);if(f=y+(b-y)*M,a)for(v=new Array(a.length),d=0,p=a.length;d<p;d++){var w=a[d];y=this.getHeightmapValue(w,c.parent.metanode,c.parent),b=this.getHeightmapValue(w,g,c),v[d]=[y+(b-y)*M,x,!0]}}else if(f=this.getHeightmapValue(s,g,c),a)for(v=new Array(a.length),d=0,p=a.length;d<p;d++)b=this.getHeightmapValue(a[d],g,c),v[d]=[b,x,!0];return[f,x,!0,null,null,v]}if(g)return x=this.getSurfaceHeightNodeOnly(t,e+8,i,e,null,r,s,a),[x[0],x[1],x[2],null,null,x[5]]}return[0,!1,!1,null,null,null]},c.prototype.getSurfaceHeightNodeOnly=function(t,e,i,r,s,a,n,o){var h,l,u=this.map.stats;if(s)a=s[0],n=s[1];else{if(!a){var c=this.getSpatialDivisionNode(t);a=c[0],n=c[1]}if(o){h=new Array(o.length);for(var d=0,p=o.length;d<p;d++)h[d]=this.getSurfaceHeightNodeOnly(null,e,i,r,s,a,o[d])}}if(this.config.mapHeightLodBlend||(e=Math.floor(e)),!s&&this.config.mapHeightNodeBlend){var f=this.getSurfaceHeightNodeOnly(null,e,i,r,[a,[n[0],n[1],n[2]]]);if(f[2]){var g=f[3].ur[0]-f[3].ll[0],m=f[3].ur[1]-f[3].ll[1],v=(n[0]-f[3].ll[0])/g,y=(n[1]-f[3].ll[1])/m,b=this.getSurfaceHeightNodeOnly(null,e,i,r,[a,[n[0]+g,n[1],n[2]]]),x=this.getSurfaceHeightNodeOnly(null,e,i,r,[a,[n[0],n[1]+m,n[2]]]),M=this.getSurfaceHeightNodeOnly(null,e,i,r,[a,[n[0]+g,n[1]+m,n[2]]]),w=f[0]+(b[0]-f[0])*v;return l=w+(x[0]+(M[0]-x[0])*v-w)*y,[l,f[1],f[2],f[3],null,h]}return[f[0],f[1],f[2],f[3],null,h]}var S=this.map.tree;if(null!=a&&null!==e){var A=S.findSurfaceTile(a.id),C={ll:a.extents.ll.slice(),ur:a.extents.ur.slice()},T={coords:n,desiredLod:Math.ceil(e),extents:C,metanode:null,heightMap:null,heightMapExtents:null,traceHeight:!0,waitingForNode:!1,finalNode:!1,bestHeightMap:999};S.traceHeight(A,T,!0);var P=T.metanode;if(null!=P){var E=P.bbox.center();if(E=this.convert.convertCoords(E,"physical","navigation"),i&&(u.heightClass=1,u.heightLod=r,u.heightNode=P.id[0]),this.config.mapHeightLodBlend&&P.id[0]>0&&T.parent&&T.parent.metanode){var L=this.convert.convertCoords(T.parent.metanode.bbox.center(),"physical","navigation"),k=e-Math.floor(e);return l=E[2]+(L[2]-E[2])*k,[l,P.id[0]>=Math.floor(e)||T.finalNode,!T.waitingForNode||P.id[0]>=Math.floor(e)||T.finalNode,T.extents,P,h]}return[E[2],P.id[0]>=Math.floor(e)||T.finalNode,!T.waitingForNode||P.id[0]>=Math.floor(e)||T.finalNode,T.extents,P,h]}}return i&&(u.heightClass=0,u.heightLod=r,u.heightNode=0),[0,!1,!1,null,null,h]},c.prototype.getHeightmapValue=function(t,e,i){var r=i.heightMap,s=r.getImageData(),a=r.getImageExtents(),n=i.heightMapExtents,o=t[0]-n.ll[0],h=n.ur[1]-t[1],l=a[0]-1,u=a[1]-1;o=l*(o/(n.ur[0]-n.ll[0])),h=u*(h/(n.ur[1]-n.ll[1])),o<0&&(o=0),h<0&&(h=0),o>l&&(o=l),h>u&&(h=u);var c=Math.floor(o),d=Math.floor(h),p=o-c,f=h-d,g=d*a[0],m=d==u?g:g+a[0],v=c==l?c:c+1,y=s[4*(g+c)],b=s[4*(g+v)],x=s[4*(m+c)],M=s[4*(m+v)],w=y+(b-y)*p,S=x+(M-x)*p,A=w+(S-w)*f;return A=e.minHeight+(e.maxHeight-e.minHeight)*(A/255)},c.prototype.getSpatialDivisionNode=function(t){for(var e=this.map.referenceFrame.getSpatialDivisionNodes(),i=null,r=-1,s=[0,0],a=0,n=e.length;a<n;a++){var o=e[a],h=o.getInnerCoords(t),l=o.extents;h[0]>=l.ll[0]&&h[0]<=l.ur[0]&&h[1]>=l.ll[1]&&h[1]<=l.ur[1]&&o.id[0]>r&&(i=o,r=o.id[0],s=h)}return[i,s]},c.prototype.getSpatialDivisionNodeAndExtents=function(t){for(var e,i=this.map.referenceFrame.getSpatialDivisionNodes(),r=null,s=[0,0],a=0,n=i.length;a<n;a++){var o=i[a];if((e=t[0]-o.id[0])>=0){var h=t[1]>>e,l=t[2]>>e;o.id[1]==h&&o.id[2]==l&&(r=o,s=[o.id[1]<<e,o.id[2]<<e])}}if(!r)return null;e=t[0]-r.id[0];var u=1/Math.pow(2,e),c=r.extents.ur,d=r.extents.ll,p=(c[0]-d[0])*u,f=(d[1]-c[1])*u,g=t[1]-s[0],m=t[2]-s[1];return[r,[[d[0]+p*g,c[1]+f*m],[d[0]+p*(g+1),c[1]+f*(m+1)]]]},c.prototype.getSpatialDivisionNodeFromId=function(t){var e=t[0]-this.maxDivisionNodeDepth,i=t[1]>>e,r=t[2]>>e;return this.map.referenceFrame.nodesMap[this.maxDivisionNodeDepth+"."+i+"."+r]},c.prototype.getSpatialDivisionNodeAndExtents2=function(t,e,i){if(!i)return[null,0,0,0,0];var r=t[0]-i.id[0],s=1/Math.pow(2,r),a=i.extents.ur,n=i.extents.ll,o=(a[0]-n[0])*s,h=(n[1]-a[1])*s,l=t[1]-(i.id[1]<<r),u=t[2]-(i.id[2]<<r);e[0]=i,e[1]=n[0]+o*l,e[2]=a[1]+h*u,e[3]=n[0]+o*(l+1),e[4]=a[1]+h*(u+1)},c.prototype.getSpatialDivisionNodeDepths=function(){for(var t=this.map.referenceFrame.getSpatialDivisionNodes(),e=-1,i=Number.MAX_VALUE,r=0,s=t.length;r<s;r++){var a=t[r];a.id[0]<i&&(i=a.id[0]),a.id[0]>e&&(e=a.id[0])}return[i,e]},c.prototype.getOptimalHeightLodBySampleSize=function(t,e){var i=this.getSpatialDivisionNode(t),r=i[0];if(null!=r){var s=r.id[0],a=r.extents.ur[1]-r.extents.ll[1],n=Math.log(a/e)/Math.log(2);return n=n-8+s,Math.max(0,n)}return null},c.prototype.getOptimalHeightLod=function(t,e,i){var r=this.getSpatialDivisionNode(t),s=r[0];if(null!=s){var a=s.id[0],n=s.extents.ur[1]-s.extents.ll[1],o=Math.log(i*n/e)/Math.log(2);return o=o-8+a,Math.max(0,o)}return null},c.prototype.getDistance=function(t,e,i){var r=this.getPhysicalSrs.convertCoordsFrom(t,this.navigationSrs),s=this.getPhysicalSrs.convertCoordsFrom(e,this.navigationSrs),a=0,n=s[0]-r[0],o=s[1]-r[1],h=s[2]-r[2];a=i?Math.sqrt(n*n+o*o+h*h):Math.sqrt(n*n+o*o);var u=this.navigationSrsInfo;if(this.isProjected)return[a,l.degrees(Math.atan2(n,o))];var c=this.getGeodesic(),d=c.Inverse(t[1],t[0],e[1],e[0]);return a>2*u.a*Math.PI/4007.5?i?[Math.sqrt(d.s12*d.s12+h*h),-d.azi1]:[d.s12,-d.azi1]:[a,-d.azi1]},c.prototype.getGeodesic=function(){var t=this.navigationSrsInfo;return new u.Geodesic.Geodesic(t.a,t.a/t.b-1)},c.prototype.getAzimuthCorrection=function(t,e){if(!this.getNavigationSrs().isProjected()){var i=this.getGeodesic(),r=i.Inverse(t[0],t[1],e[0],e[1]),s=r.azi1-r.azi2;return isNaN(s)&&(s=0),s}return 0},c.prototype.getNED=function(t){var e,i,r=this.convert.convertCoords([t[0],t[1],0],"navigation","physical");if(this.isProjected)e=this.convert.convertCoords([t[0],t[1]+100,0],"navigation","physical"),i=this.convert.convertCoords([t[0]+100,t[1],0],"navigation","physical");else{var s=t[1]+90-1e-4,a=t[0]+180+1e-4;if(s<0||a>180){var n=this.getGeodesic(),h=n.Direct(t[1],t[0],0,-100);e=this.convert.convertCoords([h.lon2,h.lat2,0],"navigation","physical"),h=n.Direct(t[1],t[0],90,100),i=this.convert.convertCoords([h.lon2,h.lat2,0],"navigation","physical")}else e=this.convert.convertCoords([t[0],t[1]-1e-4,0],"navigation","physical"),i=this.convert.convertCoords([t[0]+1e-4,t[1],0],"navigation","physical")}var l=[e[0]-r[0],e[1]-r[1],e[2]-r[2]],u=[i[0]-r[0],i[1]-r[1],i[2]-r[2]],c=[0,0,0];return o.normalize(l),o.normalize(u),o.cross(l,u,c),o.normalize(c),{east:u,direction:l,north:c}},c.prototype.getNewNED=function(t,e){var i,r,s=this.convert.convertCoords([t[0],t[1],0],"navigation","physical");if(this.isProjected)i=this.convert.convertCoords([t[0],t[1]+100,0],"navigation","physical"),r=this.convert.convertCoords([t[0]+100,t[1],0],"navigation","physical");else{var a=t[1]+90+1e-4,n=t[0]+180+1e-4;if(a<0||n>180){var h=this.getGeodesic(),l=h.Direct(t[1],t[0],0,-100);i=this.convert.convertCoords([l.lon2,l.lat2,0],"navigation","physical"),l=h.Direct(t[1],t[0],90,-100),r=this.convert.convertCoords([l.lon2,l.lat2,0],"navigation","physical")}else i=this.convert.convertCoords([t[0],t[1]+1e-4,0],"navigation","physical"),r=this.convert.convertCoords([t[0]+1e-4,t[1],0],"navigation","physical")}var u=[i[0]-s[0],i[1]-s[1],i[2]-s[2]],c=[r[0]-s[0],r[1]-s[1],r[2]-s[2]],d=[0,0,0];if(o.normalize(u),o.normalize(c),o.cross(u,c,d),o.normalize(d),e){var p=c,f=u,g=d;return[p[0],p[1],p[2],0,g[0],g[1],g[2],0,f[0],f[1],f[2],0,0,0,0,1]}return{east:c,direction:u,north:d}},c.prototype.getPositionCameraInfo=function(t,e,i){var r=t.getOrientation(),s=t.getViewDistance();i&&(r[1]=l.clamp(r[1],-89,90));var a=l.clamp(r[1],-89.5,89.5),n=h.create();h.multiply(l.rotationMatrix(2,l.radians(-r[0])),l.rotationMatrix(0,l.radians(a)),n);var u,c,d,p,f,g,m,v,y,b,x,M,w;"obj"==t.getViewMode()?(u=[0,-s,0],h.multiplyVec3(n,u)):u=[0,0,0];var S={orbitCoords:null,distance:s,rotMatrix:null,vector:null,orbitHeight:u[2]},A=t.getCoords();if(e){n=h.create(),h.multiply(l.rotationMatrix(0,l.radians(-a-90)),l.rotationMatrix(2,l.radians(r[0])),n),c=this.getNED(A),d=c.north,p=c.east,f=c.direction,g=[p[0],p[1],p[2],0,f[0],f[1],f[2],0,d[0],d[1],d[2],0,0,0,0,1],v=[1,0,0],b=[0,1,0],y=[0,0,1],x=[1,0,0],M=[0,0,-1],w=[0,0,0],o.cross(x,M,w),h.multiplyVec3(n,y),h.multiplyVec3(n,v),h.multiplyVec3(n,b),h.multiplyVec3(n,x),h.multiplyVec3(n,M),h.multiplyVec3(n,w);var C=0;C=x[0],x[0]=x[1],x[1]=C,C=M[0],M[0]=M[1],M[1]=C,C=w[0],w[0]=w[1],w[1]=C,x[2]=-x[2],M[2]=-M[2],w[2]=-w[2],m=[v[0],v[1],v[2],0,b[0],b[1],b[2],0,y[0],y[1],y[2],0,0,0,0,1],S.vector=o.normalize([-u[0],-u[1],-u[2]]),S.vector2=S.vector,S.orbitCoords=u,S.rotMatrix=m}else{c=this.getNED(A),d=c.north,p=c.east,f=c.direction,g=[p[0],p[1],p[2],0,f[0],f[1],f[2],0,d[0],d[1],d[2],0,0,0,0,1];var T=h.create();h.multiply(l.rotationMatrix(0,l.radians(-a-90)),l.rotationMatrix(2,l.radians(r[0])),T),v=[1,0,0],b=[0,1,0],y=[0,0,1],A=t.getCoords();var P=h.create();h.multiply(l.rotationMatrix(0,l.radians(A[1]-90)),l.rotationMatrix(2,l.radians(-A[0]-90)),P),h.multiplyVec3(P,y),h.multiplyVec3(P,v),h.multiplyVec3(P,b),g=[v[0],v[1],v[2],0,b[0],b[1],b[2],0,y[0],y[1],y[2],0,0,0,0,1],w=[1,0,0],x=[0,1,0],M=[0,0,1],h.multiplyVec3(g,x),h.multiplyVec3(g,M),h.multiplyVec3(g,w),h.multiplyVec3(T,w),h.multiplyVec3(T,x),h.multiplyVec3(T,M),m=[w[0],w[1],w[2],0,x[0],x[1],x[2],0,M[0],M[1],M[2],0,0,0,0,1],g=h.inverse(g),h.multiplyVec3(g,u),S.vector=[-m[2],-m[6],-m[10]]}return S.orbitCoords=u,S.rotMatrix=m,S},e.a=c},function(t,e,i){"use strict";var r=i(2),s=i(4),a=i(148),n=i(5),o=r.e,h=n.a,l=a.a,u=s.a,c=function(t,e,i){this.generateLines=!0,this.map=t,this.stats=t.stats,this.mapLoaderUrl=e,this.tile=i,this.bbox=new h,this.size=0,this.gpuSize=0,this.fileSize=0,this.faces=0,this.cacheItem=null,this.gpuCacheItem=null,this.loadState=0,this.loadErrorTime=null,this.loadErrorCounter=0,this.mBuffer=o.create(),this.mBuffer2=o.create(),this.submeshes=[],this.gpuSubmeshes=[],this.submeshesKilled=!1};c.prototype.kill=function(){this.bbox=null,this.killSubmeshes(),this.killGpuSubmeshes()},c.prototype.killSubmeshes=function(t){for(var e=0,i=this.submeshes.length;e<i;e++)this.submeshes[e].kill();this.submeshesKilled=!0,!0!==t&&this.cacheItem&&this.map.resourcesCache.remove(this.cacheItem),0==this.gpuSubmeshes.length&&(this.loadState=0),this.cacheItem=null},c.prototype.killGpuSubmeshes=function(t){for(var e=0,i=0,r=this.gpuSubmeshes.length;i<r;i++)this.gpuSubmeshes[i].kill(),e+=this.gpuSubmeshes[i].size;r>0&&(this.stats.gpuMeshes-=e,this.stats.graphsFluxMesh[1][0]++,this.stats.graphsFluxMesh[1][1]+=e),this.gpuSubmeshes=[],!0!==t&&this.gpuCacheItem&&this.map.gpuCache.remove(this.gpuCacheItem),this.submeshesKilled&&(this.loadState=0),this.gpuCacheItem=null},c.prototype.isReady=function(t,e,i){var r=this.map.stats.gpuRenderUsed>=this.map.draw.maxGpuUsed;if(t=t||r,2==this.loadState){if(this.cacheItem&&this.map.resourcesCache.updateItem(this.cacheItem),i)return!0;if(0==this.gpuSubmeshes.length){if(this.map.stats.gpuRenderUsed>=this.map.draw.maxGpuUsed)return!1;if(this.stats.renderBuild>this.map.config.mapMaxProcessingTime)return this.map.markDirty(),!1;if(r)return!1;var s=performance.now();this.buildGpuSubmeshes(),this.stats.renderBuild+=performance.now()-s}return!t&&this.gpuCacheItem&&this.map.gpuCache.updateItem(this.gpuCacheItem),!0}return 0==this.loadState?t||this.scheduleLoad(e):3==this.loadState&&this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&performance.now()>this.loadErrorTime+this.map.config.mapLoadErrorRetryTime&&this.scheduleLoad(e),!1},c.prototype.scheduleLoad=function(t){this.mapLoaderUrl||(this.mapLoaderUrl=this.map.url.makeUrl(this.tile.resourceSurface.meshUrl,{lod:this.tile.id[0],ix:this.tile.id[1],iy:this.tile.id[2]})),this.map.loader.load(this.mapLoaderUrl,this.onLoad.bind(this),t,this.tile,"mesh")},c.prototype.onLoad=function(t,e,i){this.mapLoaderCallLoaded=e,this.mapLoaderCallError=i,u.loadBinary(t,this.onLoaded.bind(this),this.onLoadError.bind(this),!!u.useCredentials&&-1!=this.mapLoaderUrl.indexOf(this.map.url.baseUrl),this.map.core.xhrParams),this.loadState=1},c.prototype.onLoadError=function(){this.map.killed||(this.loadState=3,this.loadErrorTime=performance.now(),this.loadErrorCounter++,this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&setTimeout(function(){this.map.killed||this.map.markDirty()}.bind(this),this.map.config.mapLoadErrorRetryTime),this.mapLoaderCallError())},c.prototype.onLoaded=function(t,e){if(!this.map.killed){if(!e)return this.map.markDirty(),void this.map.addProcessingTask(this.onLoaded.bind(this,t,!0));this.fileSize=t.byteLength;var i={data:new DataView(t),buffer:t,index:0},r=performance.now();this.parseMapMesh(i),this.map.stats.renderBuild+=performance.now()-r,this.submeshesKilled=!1,this.cacheItem=this.map.resourcesCache.insert(this.killSubmeshes.bind(this,!0),this.size),this.map.markDirty(),this.loadState=2,this.loadErrorTime=null,this.loadErrorCounter=0,this.mapLoaderCallLoaded()}},c.prototype.parseMapMesh=function(t){this.killSubmeshes();var e=t.data,i="";if(e.length<2)return!1;if(i+=String.fromCharCode(e.getUint8(t.index,!0)),t.index+=1,i+=String.fromCharCode(e.getUint8(t.index,!0)),t.index+=1,"ME"!=i)return!1;if(this.version=e.getUint16(t.index,!0),t.index+=2,this.version>3)return!1;t.uint8Data=new Uint8Array(t.buffer),this.meanUndulation=e.getFloat64(t.index,!0),t.index+=8,this.numSubmeshes=e.getUint16(t.index,!0),t.index+=2,this.submeshes=[],this.gpuSize=0;for(var r=0,s=this.numSubmeshes;r<s;r++){var a=new l(this,t);a.valid&&(this.submeshes.push(a),this.size+=a.size,this.faces+=a.faces,this.gpuSize+=3*(a.vertices?a.vertices.length:0)*4+2*(a.internalUVs?a.internalUVs.length:0)*4+2*(a.externalUVs?a.externalUVs.length:0)*4)}this.numSubmeshes=this.submeshes.length},c.prototype.addSubmesh=function(t){this.submeshes.push(t),this.size+=t.size,this.faces+=t.faces},c.prototype.buildGpuSubmeshes=function(){var t=0;this.gpuSubmeshes=new Array(this.submeshes.length);for(var e=0,i=this.submeshes.length;e<i;e++)this.gpuSubmeshes[e]=this.submeshes[e].buildGpuMesh(),t+=this.gpuSubmeshes[e].size;this.stats.gpuMeshes+=t,this.stats.graphsFluxMesh[0][0]++,this.stats.graphsFluxMesh[0][1]+=t,this.gpuCacheItem=this.map.gpuCache.insert(this.killGpuSubmeshes.bind(this,!0),t),this.gpuSize=t},c.prototype.drawSubmesh=function(t,e,i,r,s){null!=this.gpuSubmeshes[e]||null==this.submeshes[e]||this.submeshes[e].killed||(this.gpuSubmeshes[e]=this.submeshes[e].buildGpuMesh());var a=this.submeshes[e],n=this.gpuSubmeshes[e];if(n){var h=this.map.renderer,l=this.map.draw,u=null,c=null,d=null,p=null,f=l.debug.drawWireframe,g=0!=f?["aPosition","aBarycentric"]:["aPosition"];if(1==r)u=h.progDepthTile;else if(2==r)u=h.progFlatShadeTile;else if(f>0)switch(f){case 2:u=h.progWireframeTile2;break;case 3:u=h.progFlatShadeTile;break;case 1:switch(r){case 4:case 5:u=h.progWireframeTile,d="aTexCoord",g.push("aTexCoord");break;case 6:case 7:u=h.progWireframeTile3,p="aTexCoord2",g.push("aTexCoord2");break;case 3:return}}else switch(r){case 4:case 5:u=h.progTile,d="aTexCoord",g.push("aTexCoord");break;case 6:case 7:u=h.progTile2,i&&(c=i.getGpuMaskTexture())&&(u=h.progTile3),p="aTexCoord2",g.push("aTexCoord2");break;case 3:u=h.progFogTile}if(u&&u.isReady()){if(h.gpu.useProgram(u,g,c),i){var m=i.getGpuTexture();if(!m)return;i.statsCoutner!=this.stats.counter&&(i.statsCoutner=this.stats.counter,this.stats.gpuRenderUsed+=m.size),h.gpu.bindTexture(m),c&&h.gpu.bindTexture(c,1)}else if(3!=r&&1!=r&&2!=r)return;var v=this.mBuffer;o.multiply(h.camera.getModelviewMatrix(),a.getWorldMatrix(t,this.mBuffer2),v);var y=h.camera.getProjectionMatrix();if(u.setMat4("uMV",v),l.zbufferOffset?u.setMat4("uProj",y,h.getZoffsetFactor(l.zbufferOffset)):u.setMat4("uProj",y),0==f)switch(r){case 4:case 3:u.setVec4("uParams",[l.zFactor,l.fogDensity,0,0]),u.setVec4("uFogColor",l.atmoColor),a.getWorldMatrix([0,0,0],this.mBuffer2),u.setMat4("uMV2",this.mBuffer2),u.setVec4("uCamVec",this.map.camera.vector2);break;case 5:u.setVec4("uParams",[l.zFactor,0,0,0]);break;case 6:u.setFloat("uAlpha",1),u.setVec4("uParams",[l.zFactor,l.fogDensity,0,0]),u.setVec4("uTransform",i.getTransform()),u.setVec4("uFogColor",l.atmoColor),a.getWorldMatrix([0,0,0],this.mBuffer2),u.setMat4("uMV2",this.mBuffer2),u.setVec4("uCamVec",this.map.camera.vector2);break;case 7:u.setFloat("uAlpha",s),u.setVec4("uParams",[l.zFactor,0,0,0]),u.setVec4("uTransform",i.getTransform()),a.getWorldMatrix([0,0,0],this.mBuffer2),u.setMat4("uMV2",this.mBuffer2),u.setVec4("uCamVec",[1,0,0,0])}a.statsCoutner!=this.stats.counter&&(a.statsCoutner=this.stats.counter,this.stats.gpuRenderUsed+=n.size),n.draw(u,"aPosition",d,p,0!=f?"aBarycentric":null),this.stats.drawnFaces+=this.faces,this.stats.drawCalls++}}},e.a=c},function(t,e,i){"use strict";var r=i(2),s=i(4),a=i(3),n=i(5),o=r.b,h=r.e,l=n.a,u=a.a,c=s.a,d=function(t,e,i,r){this.metatile=t,this.map=t.map,this.id=e,this.credits=[],this.alien=!1,this.ready=!1,this.heightReady=!1,this.divisionNode=r,this.diskPos=new Array(3),this.diskDistance=1,this.diskNormal=new Array(3),this.diskAngle=1,this.diskAngle2=1,this.diskAngle2A=1,this.bbox2=new Array(24),i&&this.parseMetanode(i)};d.prototype.kill=function(){},d.prototype.hasChild=function(t){return 0!=(this.flags&1<<t+4)},d.prototype.hasChildById=function(t){var e=t[1]-(this.id[1]<<1),i=t[2]-(this.id[2]<<1);return this.hasChild((i<<1)+e)},d.prototype.hasChildren=function(){return 0!=(240&this.flags)},d.prototype.parseExtentBits=function(t,e,i){for(var r=0,s=0,a=e;s<a;s++){var n=i>>3,o=7&i;t[n]&1<<7-o&&(r|=1<<a-s-1),i++}return r/=(1<<a)-1},d.prototype.hasGeometry=function(){return 0!=(1&this.flags)},d.prototype.hasNavtile=function(){return 0!=(2&this.flags)},d.prototype.usedTexelSize=function(){return 0!=(4&this.flags)},d.prototype.usedDisplaySize=function(){return 0!=(8&this.flags)},d.prototype.parseMetanode=function(t){var e=t.data,i=this.metatile.version;if(this.flags=e.getUint8(t.index,!0),t.index+=1,i<5){for(var r=6*(this.id[0]+2)+7>>3,s=this.map.metanodeBuffer,a=0,n=r;a<n;a++)s[a]=e.getUint8(t.index,!0),t.index+=1;var o=this.id[0]+2,h=[0,0,0],u=[0,0,0],d=0,p=this.map.spaceExtentSize,f=this.map.spaceExtentOffset;for(a=0;a<3;a++)h[a]=this.parseExtentBits(s,o,d)*p[a]+f[a],d+=o,u[a]=this.parseExtentBits(s,o,d)*p[a]+f[a],d+=o;var g=0;for(a=0,n=s.length;a<n;a++)g+=s[a];0==g&&(h[0]=Number.POSITIVE_INFINITY,h[1]=Number.POSITIVE_INFINITY,h[2]=Number.POSITIVE_INFINITY,u[0]=Number.NEGATIVE_INFINITY,u[1]=Number.NEGATIVE_INFINITY,u[2]=Number.NEGATIVE_INFINITY),this.bbox=new l(h[0],h[1],h[2],u[0],u[1],u[2])}i>=4&&(this.minZ=e.getFloat32(t.index,!0),t.index+=4,this.maxZ=e.getFloat32(t.index,!0),t.index+=4,this.surrogatez=e.getFloat32(t.index,!0),t.index+=4),this.internalTextureCount=e.getUint8(t.index,!0),t.index+=1,this.pixelSize=c.decodeFloat16(e.getUint16(t.index,!0)),t.index+=2,this.displaySize=e.getUint16(t.index,!0),t.index+=2,this.displaySize=1024,0==(4&this.flags)&&(this.pixelSize=Number.POSITIVE_INFINITY),0==(8&this.flags)&&(this.displaySize=256),this.minHeight=e.getInt16(t.index,!0),t.index+=2,this.maxHeight=e.getInt16(t.index,!0),t.index+=2,i<4&&(this.minZ=this.minHeight,this.maxZ=this.maxHeight,this.surrogatez=this.minHeight),this.metatile.version>=3&&(128&this.metatile.flags?(this.sourceReference=e.getUint16(t.index,!0),t.index+=2):64&this.metatile.flags&&(this.sourceReference=e.getUint8(t.index,!0),t.index+=1)),this.heightReady=this.hasNavtile(),this.alien=!1,this.generateCullingHelpers()},d.prototype.clone=function(){var t=new d(this.metatile,this.id);t.flags=this.flags,t.minHeight=this.minHeight,t.maxHeight=this.maxHeight,t.minZ=this.minZ,t.maxZ=this.maxZ,t.surrogatez=this.surrogatez,t.internalTextureCount=this.internalTextureCount,t.pixelSize=this.pixelSize,t.displaySize=this.displaySize,t.ready=this.ready,t.stream=this.stream,t.heightReady=this.heightReady,t.credits=new Array(this.credits.length);for(var e=0,i=this.credits.length;e<i;e++)t.credits[e]=this.credits[e];return this.bbox&&(t.bbox=this.bbox.clone()),t.diskPos=this.diskPos,t.diskNormal=this.diskNormal,t.diskAngle=this.diskAngle,t.diskAngle2=this.diskAngle2,t.diskAngle2A=this.diskAngle2A,t.diskDistance=this.diskDistance,t.bbox2=this.bbox2,t.divisionNode=this.divisionNode,this.plane&&(t.plane=this.plane.slice()),t},d.prototype.generateCullingHelpers=function(t){this.ready=!0;var e=this.map,i=e.draw,r=e.isGeocent,s=this.metatile.useVersion;if(!(this.id[0]<e.measure.minDivisionNodeDepth||!r&&s<4)&&(e.config.mapPreciseCulling||s>=4)){if(t)return;var a,n,h,l,u,c=i.tmpVec3;if(this.id[0]>e.measure.maxDivisionNodeDepth){var d=i.tmpVec5;if(!(a=e.measure.getSpatialDivisionNodeFromId(this.id)))return;e.measure.getSpatialDivisionNodeAndExtents2(this.id,d,a),n=d[1],h=d[2],l=d[3],u=d[4],this.divisionNode=a}else{var p=e.measure.getSpatialDivisionNodeAndExtents(this.id);if(!(a=p?p[0]:null))return;n=p[1][0][0],h=p[1][0][1],l=p[1][1][0],u=p[1][1][1],this.divisionNode=a}this.llx=n,this.lly=h,this.urx=l,this.ury=u;var f=this.minZ;c[0]=.5*(l+n),c[1]=.5*(u+h),c[2]=f,a.getPhysicalCoordsFast(c,!0,this.diskPos,0,0),r?(this.diskDistance=o.length(this.diskPos),o.normalize(this.diskPos,this.diskNormal)):(this.diskNormal[0]=0,this.diskNormal[1]=0,this.diskNormal[2]=1);var g=this.diskNormal;c[0]=l,c[1]=u,c[2]=f;var m=this.bbox2;a.getPhysicalCoordsFast(c,!0,m,0,0),c[1]=h,a.getPhysicalCoordsFast(c,!0,m,0,3),c[0]=n,a.getPhysicalCoordsFast(c,!0,m,0,6),c[1]=u,a.getPhysicalCoordsFast(c,!0,m,0,9);var v;if(!r)return v=this.maxZ-f,m[12]=m[0],m[13]=m[1],m[14]=m[2]+v,m[15]=m[3],m[16]=m[4],m[17]=m[5]+v,m[18]=m[6],m[19]=m[7],m[20]=m[8]+v,m[21]=m[9],m[22]=m[10],void(m[23]=m[11]+v);var y,b,x,M,w,S,A=o.dot;if(e.config.mapPreciseBBoxTest||s>=4)if(v=this.maxZ-f,this.id[0]<=3){y=o.normalize2,y(m,0,c),b=A(g,c),y(m,3,c),x=A(g,c),y(m,6,c),M=A(g,c),y(m,9,c),w=A(g,c),S=Math.min(b,x,M,w),c[0]=.5*(l+n),c[1]=u,c[2]=f,a.getPhysicalCoordsFast(c,!0,m,0,12),c[1]=h,a.getPhysicalCoordsFast(c,!0,m,0,15),c[0]=l,c[1]=.5*(u+h),a.getPhysicalCoordsFast(c,!0,m,0,18),c[0]=n,a.getPhysicalCoordsFast(c,!0,m,0,21);var C=this.diskPos,T=Math.max(m[0],m[3],m[6],m[9],m[12],m[15],m[18],m[21],C[0]),P=Math.min(m[0],m[3],m[6],m[9],m[12],m[15],m[18],m[21],C[0]),E=Math.max(m[1],m[4],m[7],m[10],m[13],m[16],m[19],m[22],C[1]),L=Math.min(m[1],m[4],m[7],m[10],m[13],m[16],m[19],m[22],C[1]),k=Math.max(m[2],m[5],m[8],m[11],m[14],m[17],m[20],m[23],C[2]),I=Math.min(m[2],m[5],m[8],m[11],m[14],m[17],m[20],m[23],C[2]);this.id[0]<=1&&(c[0]=l+.25*(n-l),c[1]=.5*(u+h),a.getPhysicalCoordsFast(c,!0,m,0,12),c[0]=l+.75*(n-l),a.getPhysicalCoordsFast(c,!0,m,0,15),c[0]=.5*(l+n),c[1]=u+.25*(h-u),a.getPhysicalCoordsFast(c,!0,m,0,18),c[1]=u+.75*(h-u),a.getPhysicalCoordsFast(c,!0,m,0,21),T=Math.max(T,m[12],m[15],m[18],m[21]),P=Math.min(P,m[12],m[15],m[18],m[21]),E=Math.max(E,m[13],m[16],m[19],m[22]),L=Math.min(L,m[13],m[16],m[19],m[22]),k=Math.max(k,m[14],m[17],m[20],m[23]),I=Math.min(I,m[14],m[17],m[20],m[23]),S=-1),m[0]=P,m[1]=L,m[2]=I,m[3]=T,m[4]=L,m[5]=I,m[6]=T,m[7]=E,m[8]=I,m[9]=P,m[10]=E,m[11]=I,m[12]=P,m[13]=L,m[14]=k,m[15]=T,m[16]=L,m[17]=k,m[18]=T,m[19]=E,m[20]=k,m[21]=P,m[22]=E,m[23]=k}else{if(y=o.normalize3,A=o.dot2,y(m,0,m,12),b=A(g,m,12),y(m,3,m,15),x=A(g,m,15),y(m,6,m,18),M=A(g,m,18),y(m,9,m,21),w=A(g,m,21),S=Math.min(b,x,M,w),this.id[0]<=8){c=this.diskPos;var N=.024*(5-(this.id[0]-4));m[0]+=(m[0]-c[0])*N,m[1]+=(m[1]-c[1])*N,m[2]+=(m[2]-c[2])*N,m[3]+=(m[3]-c[0])*N,m[4]+=(m[4]-c[1])*N,m[5]+=(m[5]-c[2])*N,m[6]+=(m[6]-c[0])*N,m[7]+=(m[7]-c[1])*N,m[8]+=(m[8]-c[2])*N,m[9]+=(m[9]-c[0])*N,m[10]+=(m[10]-c[1])*N,m[11]+=(m[11]-c[2])*N}v+=i.planetRadius-i.planetRadius*S,m[12]=m[0]+m[12]*v,m[13]=m[1]+m[13]*v,m[14]=m[2]+m[14]*v,m[15]=m[3]+m[15]*v,m[16]=m[4]+m[16]*v,m[17]=m[5]+m[17]*v,m[18]=m[6]+m[18]*v,m[19]=m[7]+m[19]*v,m[20]=m[8]+m[20]*v,m[21]=m[9]+m[21]*v,m[22]=m[10]+m[22]*v,m[23]=m[11]+m[23]*v}else y=o.normalize2,y(m,0,c),b=A(g,c),y(m,3,c),x=A(g,c),y(m,6,c),M=A(g,c),y(m,9,c),w=A(g,c),S=Math.min(b,x,M,w);this.diskAngle=Math.cos(Math.max(0,.5*Math.PI-Math.acos(S))),this.diskAngle2=S,this.diskAngle2A=Math.acos(S)}},d.prototype.getWorldMatrix=function(t,e){var i=e;return null!=i?(i[0]=this.bbox.side(0),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=this.bbox.side(1),i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=this.bbox.side(2),i[11]=0,i[12]=this.bbox.min[0]-t[0],i[13]=this.bbox.min[1]-t[1],i[14]=this.bbox.min[2]-t[2],i[15]=1):(i=h.create(),h.multiply(u.translationMatrix(this.bbox.min[0]-t[0],this.bbox.min[1]-t[1],this.bbox.min[2]-t[2]),u.scaleMatrix(this.bbox.side(0),this.bbox.side(1),this.bbox.side(2)),i)),i},d.prototype.drawBBox=function(t){if(this.metatile.useVersion>=4)return this.drawBBox2(t);var e=this.map.renderer;e.gpu.useProgram(e.progBBox,["aPosition"]);var i=h.create(),r=h.create();h.multiply(e.camera.getModelviewMatrix(),this.getWorldMatrix(t),r);var s=e.camera.getProjectionMatrix();h.multiply(s,r,i),e.progBBox.setMat4("uMVP",i),e.bboxMesh.draw(e.progBBox,"aPosition")},d.prototype.drawBBox2=function(){for(var t=this.bbox2,e=this.map.draw.bboxBuffer,i=this.map.camera.position,r=this.map.renderer,s=r.progBBox2,a=0;a<24;a+=3)e[a]=t[a]-i[0],e[a+1]=t[a+1]-i[1],e[a+2]=t[a+2]-i[2];r.gpu.useProgram(s,["aPosition"]),s.setFloatArray("uPoints",e);var n=r.camera.getMvpMatrix();s.setMat4("uMVP",n),r.bboxMesh2.draw(s,"aPosition")},d.prototype.drawPlane=function(t,e){var i=this.map.renderer,r=this.map.draw.planeBuffer,s=this.plane;if(s){i.gpu.useProgram(i.progPlane,["aPosition","aTexCoord"]);var a=h.create(),n=i.camera.getModelviewMatrix(),o=i.camera.getProjectionMatrix();h.multiply(o,n,a);for(var l=t[0],u=t[1],c=t[2],d=0;d<9;d++){var p=3*d;r[p]=s[p]-l,r[p+1]=s[p+1]-u,r[p+2]=s[p+2]-c}var f=i.progPlane;f.setMat4("uMV",n),f.setMat4("uProj",o),f.setFloatArray("uPoints",r);var g=Math.max(10,e.distance+20),m=Math.log(g)/Math.log(8),v=m-Math.floor(m);f.setVec4("uParams",[4,0,1/15,8]),f.setVec4("uParams2",[0,0,v,0]),i.gpu.bindTexture(i.heightmapTexture),i.planeMesh.draw(i.progPlane,"aPosition","aTexCoord")}},d.prototype.getGridHeight=function(t,e,i){var r=t[0]-this.llx,s=t[1]-this.lly,a=i-1,n=i-1;r=a*(r/(this.urx-this.llx)),s=n*(s/(this.ury-this.lly)),r<0&&(r=0),s<0&&(s=0),r>a&&(r=a),s>n&&(s=n);var o=Math.floor(r),h=Math.floor(s),l=r-o,u=s-h,c=h*i,d=h==n?c:c+i,p=o==a?o:o+1,f=e[c+o],g=e[c+p],m=e[d+o],v=e[d+p],y=f+(g-f)*l;return y+(m+(v-m)*l-y)*u},e.a=d},function(t,e,i){"use strict";var r=i(4),s=i(141),a=r.a,n=s.a,o=function(t,e,i){this.metaresources=t,this.map=t.map,this.surface=e,this.id=t.id,this.tile=i,this.nodes=[],this.drawCounter=0,this.loadState=0,this.loadErrorTime=null,this.loadErrorCounter=0,this.size=0,this.cacheItem=null};o.prototype.kill=function(t){!0!==t&&null!=this.cacheItem&&this.map.metatileCache.remove(this.cacheItem),this.metaresources&&this.metaresources.removeMetatile(this),this.loadState=0,this.surface=0,this.cacheItem=null,this.nodes=[]},o.prototype.clone=function(t){var e=new o(this.metaresources,t);return e.nodes=this.nodes,e.loadState=this.loadState,e.nodes=this.nodes,e.size=this.size,e.lod=this.lod,e.metatileIdx=this.metatileIdx,e.metatileIdy=this.metatileIdy,e.offsetx=this.offsetx,e.offsety=this.offsety,e.sizex=this.sizex,e.sizey=this.sizey,e.version=this.version,e.credits=this.credits,this.version<2?e.nodeSize=this.nodeSize:(e.flags=this.flags,e.creditCount=this.creditCount,e.flagPlanes=this.flagPlanes),e.cacheItem=this.map.metatileCache.insert(e.kill.bind(e,!0),e.size),e},o.prototype.isReady=function(t){return 2==this.loadState||(0==this.loadState&&(3==this.loadState?this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&performance.now()>this.loadErrorTime+this.map.config.mapLoadErrorRetryTime&&this.scheduleLoad(t):this.scheduleLoad(t)),!1)},o.prototype.used=function(){null!=this.cacheItem&&this.map.metatileCache.updateItem(this.cacheItem)},o.prototype.getNode=function(t){var e=t[1]-this.id[1]-this.offsetx,i=t[2]-this.id[2]-this.offsety;if(e<0||i<0||e>=this.sizex||i>=this.sizey)return null;var r=this.nodes[this.sizex*i+e];if(!r){var s=this.sizex*i+e,a={data:this.data,index:this.metanodesIndex+s*this.metanodeSize};r=new n(this,[this.lod,this.metatileIdx+this.offsetx+e,this.metatileIdy+this.offsety+i],a,this.divisionNode),this.nodes[s]=r,this.applyMetanodeCredits(e,i),this.applyMetatanodeBitplanes(e,i)}return r},o.prototype.scheduleLoad=function(){null==this.mapLoaderUrl&&(this.mapLoaderUrl=this.surface.getMetaUrl(this.id)),this.map.loader.load(this.mapLoaderUrl,this.onLoad.bind(this),null,this.tile,"metatile")},o.prototype.onLoad=function(t,e,i){this.mapLoaderCallLoaded=e,this.mapLoaderCallError=i,a.loadBinary(t,this.onLoaded.bind(this),this.onLoadError.bind(this),!!a.useCredentials&&-1!=this.mapLoaderUrl.indexOf(this.map.url.baseUrl),this.map.core.xhrParams),this.loadState=1},o.prototype.onLoadError=function(){this.map.killed||(this.loadState=3,this.loadErrorTime=performance.now(),this.loadErrorCounter++,this.loadErrorCounter<=this.map.config.mapLoadErrorMaxRetryCount&&setTimeout(function(){this.map.killed||this.map.markDirty()}.bind(this),this.map.config.mapLoadErrorRetryTime),this.mapLoaderCallError())},o.prototype.onLoaded=function(t,e){if(!this.map.killed){if(!e)return this.map.markDirty(),void this.map.addProcessingTask(this.onLoaded.bind(this,t,!0));t=new DataView(t),this.size+=4*t.byteLength,this.data=t;var i=performance.now();this.parseMetatatile({data:t,index:0}),this.map.stats.renderBuild+=performance.now()-i,this.cacheItem=this.map.metatileCache.insert(this.kill.bind(this,!0),this.size),this.map.markDirty(),this.loadState=2,this.loadErrorTime=null,this.loadErrorCounter=0,this.mapLoaderCallLoaded()}},o.prototype.parseMetatatile=function(t){var e=t.data,i="";i+=String.fromCharCode(e.getUint8(t.index,!0)),t.index+=1,i+=String.fromCharCode(e.getUint8(t.index,!0)),t.index+=1,"MT"==i&&(this.version=e.getUint16(t.index,!0),t.index+=2,this.version>5||(this.lod=e.getUint8(t.index,!0),t.index+=1,this.metatileIdx=e.getUint32(t.index,!0),t.index+=4,this.metatileIdy=e.getUint32(t.index,!0),t.index+=4,this.offsetx=e.getUint16(t.index,!0),t.index+=2,this.offsety=e.getUint16(t.index,!0),t.index+=2,this.sizex=e.getUint16(t.index,!0),t.index+=2,this.sizey=e.getUint16(t.index,!0),t.index+=2,this.flagPlanes=new Array(8),this.version<2?(this.nodeSize=e.getUint8(t.index,!0),t.index+=1):(this.flags=e.getUint8(t.index,!0),t.index+=1,this.creditCount=e.getUint8(t.index,!0),t.index+=1,this.parseFlagPlanes(t)),this.parseMetatatileCredits(t),this.parseMetatatileNodes(t),this.useVersion=this.map.config.mapForceMetatileV3&&this.version<5?3:this.version))},o.prototype.parseFlagPlanes=function(t){for(var e=t.data,i=this.sizex*this.sizey+7>>3,r=0;r<6;r++)if(0!=(this.flags&1<<r)){for(var s=new Uint8Array(i),a=0;a<i;a++)s[a]=e.getUint8(t.index,!0),t.index+=1;this.flagPlanes[r]=s}},o.prototype.parseMetatatileCredits=function(t){var e=t.data;if(this.version<2&&(this.creditCount=e.getUint8(t.index,!0),t.index+=1,this.creditSize=e.getUint16(t.index,!0),t.index+=2),0==this.creditCount)return void(this.credits=[]);var i=this.sizex*this.sizey+7>>3;this.credits=new Array(this.creditCount);for(var r=0,s=this.credits.length;r<s;r++){var a=e.getUint16(t.index,!0);t.index+=2;for(var n=new Uint8Array(i),o=0;o<i;o++)n[o]=e.getUint8(t.index,!0),t.index+=1;var h=this.map.getCreditByNumber(a),l=h?h.key:null;this.credits[r]={creditId:l,creditMask:n}}},o.prototype.applyMetatatileBitplanes=function(){for(var t=0;t<1;t++)if(this.flagPlanes[t])for(var e=this.flagPlanes[t],i=0;i<this.sizey;i++)for(var r=0;r<this.sizex;r++){var s=this.sizex*i+r,a=7&s,n=1<<a;if(s>>=3,e[s]&n)switch(t){case 0:this.nodes[i*this.sizex+r].alien=!0}}},o.prototype.applyMetatanodeBitplanes=function(t,e){for(var i=0;i<1;i++)if(this.flagPlanes[i]){var r=this.flagPlanes[i],s=this.sizex*e+t,a=7&s,n=1<<a;if(s>>=3,r[s]&n)switch(i){case 0:this.nodes[e*this.sizex+t].alien=!0}}},o.prototype.applyMetatatileCredits=function(){for(var t=0;t<this.sizey;t++)for(var e=0;e<this.sizex;e++){var i=this.sizex*t+e,r=7&i,s=1<<r;i>>=3;for(var a=0,n=this.credits.length;a<n;a++)if(this.credits[a].creditMask[i]&s){var o=this.credits[a].creditId;o&&this.nodes[t*this.sizex+e].credits.push(o)}}},o.prototype.applyMetanodeCredits=function(t,e){var i=this.sizex*e+t,r=7&i,s=1<<r;i>>=3;for(var a=0,n=this.credits.length;a<n;a++)if(this.credits[a].creditMask[i]&s){var o=this.credits[a].creditId;o&&this.nodes[e*this.sizex+t].credits.push(o)}},o.prototype.parseMetatatileNodes=function(t){this.metanodesIndex=t.index,this.metanodeSize=10,this.version>=5?this.metanodeSize+=12:(this.metanodeSize+=Math.floor((6*(this.id[0]+2)+7)/8),4==this.version&&(this.metanodeSize+=12)),this.version>=3&&(128&this.flags?this.metanodeSize+=2:64&this.flags&&(this.metanodeSize+=1)),this.lod>=this.map.measure.minDivisionNodeDepth?(this.divisionNode=this.map.measure.getSpatialDivisionNodeAndExtents([this.lod,this.metatileIdx+this.offsetx,this.metatileIdy+this.offsety]),this.divisionNode&&(this.divisionNode=this.divisionNode[0])):this.divisionNode=null,this.nodes=new Array(this.sizex*this.sizey)},e.a=o},function(t,e,i){"use strict";var r=i(128),s=r.a,a=function(t,e){this.map=t,this.proj4=t.proj4,this.valid=!1,this.id=e.id||null,this.description=e.description||"",this.nodesMap=[];var i=e.model;if(null!=i){if(this.model={physicalSrs:t.getMapsSrs(i.physicalSrs),navigationSrs:t.getMapsSrs(i.navigationSrs),publicSrs:t.getMapsSrs(i.publicSrs)},this.params={},null!=e.parameters){var r=e.parameters;this.params.metaBinaryOrder=r.metaBinaryOrder||1,this.params.navDelta=r.navDelta||8}var s=e.division;if(null!=s){this.division={rootLod:s.rootLod||0,arity:s.arity||null,heightRange:s.heightRange||[0,1]};var a=this.parseSpaceExtents(s.extents);this.division.extents=a,t.spaceExtentSize=[a.ur[0]-a.ll[0],a.ur[1]-a.ll[1],a.ur[2]-a.ll[2]],t.spaceExtentOffset=a.ll;var n=s.nodes;if(this.division.nodes=[],null!=n){this.hasPoles=4==n.length;for(var o=0,h=n.length;o<h;o++){var l=this.parseNode(n[o]);this.nodesMap[l.id[0]+"."+l.id[1]+"."+l.id[2]]=l,this.division.nodes.push(l)}this.valid=!0}}}};a.prototype.getInfo=function(){return{id:this.id,physicalSrs:this.model.physicalSrs.id,navigationSrs:this.model.navigationSrs.id,publicSrs:this.model.publicSrs.id}},a.prototype.getGlobalHeightRange=function(){return this.division.heightRange},a.prototype.parseNode=function(t){var e={srs:t.srs,partitioning:t.partitioning};e.extents=this.parseExtents(t.extents);var i=t.id;if(null!=i)return e.id={lod:i.lod||0,position:i.position||[0,0]},new s(this.map,[e.id.lod,e.id.position[0],e.id.position[1]],e.srs,e.extents,this.heightRange,e.partitioning)},a.prototype.parseExtents=function(t){return null==t?{ll:[0,0],ur:[1,1]}:{ll:t.ll||[0,0],ur:t.ur||[1,1]}},a.prototype.parseSpaceExtents=function(t){return null==t?{ll:[0,0,0],ur:[1,1,1]}:{ll:t.ll||[0,0,0],ur:t.ur||[1,1,1]}},a.prototype.getSpatialDivisionNodes=function(){return this.division.nodes},a.prototype.convertCoords=function(t,e,i){var r,s;switch(e){case"public":r=this.model.publicSrs;break;case"physical":r=this.model.physicalSrs;break;case"navigation":r=this.model.navigationSrs}switch(i){case"public":s=this.model.publicSrs;break;case"physical":s=this.model.physicalSrs;break;case"navigation":s=this.model.navigationSrs}return r.convertCoordsTo(t,s)},e.a=a},function(t,e,i){"use strict";var r=function(t){this.map=t,this.draw=t.draw,this.renderer=t.renderer,this.config=t.config,this.renderSlots=[]};r.prototype.createRenderSlot=function(t,e,i){return{id:t,callback:e,enabled:i}},r.prototype.addRenderSlot=function(t,e,i){this.renderSlots.push(this.createRenderSlot(t,e,i))},r.prototype.getRenderSlotIndex=function(t){return this.map.searchArrayIndexById(this.renderSlots,t)},r.prototype.checkRenderSlotId=function(t){return"after-map-render"==t?"map":t},r.prototype.moveRenderSlotBefore=function(t,e){var i=this.getRenderSlotIndex(this.checkRenderSlotId(t)),r=this.getRenderSlotIndex(e);-1!=i&&-1!=r&&r!=i-1&&this.renderSlots.splice(r,0,this.renderSlots.splice(i,1)[0])},r.prototype.moveRenderSlotAfter=function(t,e){var i=this.getRenderSlotIndex(this.checkRenderSlotId(t)),r=this.getRenderSlotIndex(e);-1!=i&&-1!=r&&r!=i+1&&(r++,this.renderSlots.splice(r,0,this.renderSlots.splice(i,1)[0]))},r.prototype.removeRenderSlot=function(t){var e=this.getRenderSlotIndex(t);-1!=e&&this.renderSlots.splice(e,1)},r.prototype.setRenderSlotEnabled=function(t,e){var i=this.getRenderSlotIndex(t);-1!=i&&(this.renderSlots[i].enabled=e)},r.prototype.getRenderSlotEnabled=function(t){var e=this.getRenderSlotIndex(t);return-1!=e&&this.renderSlots[e].enabled},r.prototype.processRenderSlots=function(){1!=this.draw.drawChannel&&this.renderer.gpu.setViewport();for(var t=0,e=this.renderSlots.length;t<e;t++){var i=this.renderSlots[t];i.enabled&&i.callback&&(this.renderer.gpu.setState(this.draw.drawTileState),i.callback(this.draw.drawChannelNames[this.draw.drawChannel]))}},e.a=r},function(t,e,i){"use strict";var r=i(54),s=i(51),a=i(142),n=i(140),o=i(48),h=r.a,l=s.a,u=a.a,c=n.a,d=o.a,p=function(t,e,i){this.map=t,this.id=i,this.parent=e,this.metatiles={},this.meshes={},this.textures={},this.subtextures={},this.geodata={},this.credits={},this.children=[null,null,null,null]};p.prototype.kill=function(){for(var t=0;t<4;t++)null!=this.children[t]&&this.children[t].kill();this.children=[null,null,null,null];var e=this.parent;this.parent=null,null!=e&&e.removeChild(this)},p.prototype.addChild=function(t){if(!this.children[t]){var e=this.id,i=[e[0]+1,e[1]<<1,e[2]<<1];switch(t){case 1:i[1]++;break;case 2:i[2]++;break;case 3:i[1]++,i[2]++}this.children[t]=new p(this.map,this,i)}},p.prototype.removeChildByIndex=function(t){null!=this.children[t]&&(this.children[t].kill(),this.children[t]=null)},p.prototype.removeChild=function(t){for(var e=0;e<4;e++)this.children[e]==t&&(this.children[e].kill(),this.children[e]=null)},p.prototype.getMesh=function(t,e){var i=this.meshes[t];return i||(i=new c(this.map,t,e),this.meshes[t]=i),i},p.prototype.getGeodata=function(t,e){var i=this.geodata[t];return i||(i=new d(this.map,t,e),this.geodata[t]=i),i},p.prototype.getTexture=function(t,e,i,r,s,a){var n;if(r&&r.layer){var o=t+r.layer.id;n=this.textures[o],n||(n=new h(this.map,t,e,i,r,s,a),this.textures[o]=n)}else(n=this.textures[t])||(n=new h(this.map,t,e,i,r,s,a),this.textures[t]=n);return n},p.prototype.getSubtexture=function(t,e,i,r,s,a,n){return t=this.subtextures[e],t||(t=new l(this.map,e,i,r,s,a,n),this.subtextures[e]=t),t},p.prototype.addMetatile=function(t,e){this.metatiles[t]=e},p.prototype.removeMetatile=function(t){for(var e in this.metatiles)this.metatiles[e]==t&&delete this.metatiles[e]},p.prototype.getMetatile=function(t,e,i){var r,s=this.metatiles;for(var a in s)if(s[a].surface==t)return s[a];var n=t.getMetaUrl(this.id);return s[n]?(r=s[n].clone(t),this.addMetatile(n,r),r):e?(r=new u(this,t,i),this.addMetatile(n,r),r):null},e.a=p},function(t,e,i){"use strict";var r=i(145),s=r.a,a=function(t){this.map=t,this.tree=new s(t,null,[0,0,0])};a.prototype.kill=function(){this.tree.kill()},a.prototype.findNode=function(t,e){for(var i=this.tree,r=t[0];r>0;r--){var s=1<<r-1,a=0;if(0!=(t[1]&s)&&(a+=1),0!=(t[2]&s)&&(a+=2),!i.children[a]){if(!e)return null;i.addChild(a)}i=i.children[a]}return i},a.prototype.findAgregatedNode=function(t,e,i){for(var r=this.tree,s=t[1]>>e<<e,a=t[2]>>e<<e,n=t[0];n>0;n--){var o=1<<n-1,h=0;if(0!=(s&o)&&(h+=1),0!=(a&o)&&(h+=2),!r.children[h]){if(!i)return null;r.addChild(h)}r=r.children[h]}return r},e.a=a},function(t,e,i){"use strict";var r=function(t){this.map=t,this.core=t.core,this.inspector=t.core.inspector,this.drawnTiles=0,this.drawnGeodataTiles=0,this.drawnGeodataTilesFactor=0,this.drawnGeodataTilesPerLayer=0,this.drawnFaces=0,this.drawCalls=0,this.usedNodes=0,this.processedNodes=0,this.processedMetatiles=0,this.counter=0,this.statsCycle=0,this.fps=0,this.frameTime=0,this.renderTime=0,this.renderTimeTmp=0,this.renderTimeBegin=0,this.renderBuild=0,this.lastRenderTime=0,this.lastFrameTime=0,this.renderedLods=new Array(32),this.debugIds={},this.recordGraphs=!1,this.graphsTimeIndex=0,this.graphsLastTimeIndex=0,this.graphsTimeSamples=900,this.graphsRenderTimes=new Array(this.graphsTimeSamples),this.graphsCreateMeshTimes=new Array(this.graphsTimeSamples),this.graphsCreateGpuMeshTimes=new Array(this.graphsTimeSamples),this.graphsCreateTextureTimes=new Array(this.graphsTimeSamples),this.graphsFrameTimes=new Array(this.graphsTimeSamples),this.graphsCpuMemoryMetatiles=new Array(this.graphsTimeSamples),this.graphsCpuMemoryUsed=new Array(this.graphsTimeSamples),this.graphsGpuMemoryTextures=new Array(this.graphsTimeSamples),this.graphsGpuMemoryMeshes=new Array(this.graphsTimeSamples),this.graphsGpuMemoryGeodata=new Array(this.graphsTimeSamples),this.graphsGpuMemoryRender=new Array(this.graphsTimeSamples),this.graphsPolygons=new Array(this.graphsTimeSamples),this.graphsLODs=new Array(this.graphsTimeSamples),this.graphsBuild=new Array(this.graphsTimeSamples),this.graphsFluxTextures=new Array(this.graphsTimeSamples),this.graphsFluxMeshes=new Array(this.graphsTimeSamples),this.graphsFluxGeodatas=new Array(this.graphsTimeSamples),this.graphsFluxTexture=[[0,0],[0,0]],this.graphsFluxMesh=[[0,0],[0,0]],this.graphsFluxGeodata=[[0,0],[0,0]],this.graphsCreateTextureTime=0,this.graphsCreateGpuMeshTime=0,this.graphsCreateMeshTime=0,this.resetGraphs(),this.gpuMeshes=0,this.gpuTextures=0,this.gpuGeodata=0,this.gpuUsed=0,this.resourcesUsed=0,this.metaUsed=0,this.gpuRenderUsed=0,this.loadedCount=0,this.loadErrorCount=0,this.loadFirst=0,this.loadLast=0,this.gpuNeeded=0,this.gpuNeeded2=0,this.heightClass=0,this.heightLod=0,this.heightNode=0,this.heightTerrain=0,this.heightDelta=0};r.prototype.resetGraphs=function(){this.graphsTimeIndex=0;for(var t=0;t<this.graphsTimeSamples;t++)this.graphsRenderTimes[t]=0,this.graphsCreateMeshTimes[t]=0,this.graphsCreateGpuMeshTimes[t]=0,this.graphsCreateTextureTimes[t]=0,this.graphsFrameTimes[t]=0,this.graphsCpuMemoryUsed[t]=0,this.graphsCpuMemoryMetatiles[t]=0,this.graphsGpuMemoryTextures[t]=0,this.graphsGpuMemoryMeshes[t]=0,this.graphsGpuMemoryGeodata[t]=0,this.graphsGpuMemoryRender[t]=0,this.graphsPolygons[t]=0,this.graphsLODs[t]=[0,[]],this.graphsBuild[t]=0,this.graphsFluxTextures[t]=[[0,0],[0,0]],this.graphsFluxMeshes[t]=[[0,0],[0,0]],this.graphsFluxGeodatas[t]=[[0,0],[0,0]]},r.prototype.begin=function(t){if(t){this.drawnTiles=0,this.drawnGeodataTiles=0,this.drawnGeodataTilesFactor=0,this.drawnGeodataTilesPerLayer=0,this.drawCalls=0,this.drawnFaces=0,this.gpuRenderUsed=0,this.gpuNeeded=0,this.usedNodes=0,this.processedNodes=0,this.processedMetatiles=0;for(var e=0,i=this.renderedLods.length;e<i;e++)this.renderedLods[e]=0}this.debugIds={},this.counter++,this.statsCycle++,this.renderTimeBegin=performance.now(),t&&(this.lastFrameTime&&(this.frameTime=this.renderTimeBegin-this.lastFrameTime),this.lastFrameTime=this.renderTimeBegin)},r.prototype.end=function(t){var e=performance.now(),i=e-this.renderTimeBegin;if(t?(this.renderTimeTmp+=i,this.lastRenderTime=i):this.renderTimeTmp+=this.lastRenderTime,this.recordGraphs){var r=this.graphsTimeIndex;this.graphsRenderTimes[r]=i,this.graphsCreateMeshTimes[r]=0,this.graphsCreateGpuMeshTimes[r]=0,this.graphsCreateTextureTimes[r]=0,this.graphsFrameTimes[r]=this.frameTime,this.graphsCpuMemoryUsed[r]=this.map.resourcesCache.totalCost,this.graphsCpuMemoryMetatiles[r]=this.map.metatileCache.totalCost,this.graphsGpuMemoryTextures[r]=this.gpuTextures,this.graphsGpuMemoryMeshes[r]=this.gpuMeshes,this.graphsGpuMemoryGeodata[r]=this.gpuGeodata,this.graphsGpuMemoryRender[r]=this.gpuRenderUsed,this.graphsPolygons[r]=this.drawnFaces,this.graphsFluxTextures[r]=[[this.graphsFluxTexture[0][0],this.graphsFluxTexture[0][1]],[this.graphsFluxTexture[1][0],this.graphsFluxTexture[1][1]]],this.graphsFluxMeshes[r]=[[this.graphsFluxMesh[0][0],this.graphsFluxMesh[0][1]],[this.graphsFluxMesh[1][0],this.graphsFluxMesh[1][1]]],this.graphsFluxGeodatas[r]=[[this.graphsFluxGeodata[0][0],this.graphsFluxGeodata[0][1]],[this.graphsFluxGeodata[1][0],this.graphsFluxGeodata[1][1]]],this.graphsLODs[r]=[this.drawnTiles,this.renderedLods.slice()],this.graphsBuild[r]=this.renderBuild,this.graphsTimeIndex=(this.graphsTimeIndex+1)%this.graphsTimeSamples,this.inspector&&this.inspector.graphs&&this.inspector.graphs.updateGraphs(this)}this.statsCycle%50==0&&(this.renderTime=this.renderTimeTmp/100,this.fps=1e3/this.renderTime,this.renderTimeTmp=0,this.inspector&&this.inspector.stats&&(this.gpuUsed=this.map.gpuCache.totalCost,this.resourcesUsed=this.map.resourcesCache.totalCost,this.metaUsed=this.map.metatileCache.totalCost,this.inspector.stats.updateStatsPanel(this))),this.graphsFluxTexture=[[0,0],[0,0]],this.graphsFluxMesh=[[0,0],[0,0]],this.graphsFluxGeodata=[[0,0],[0,0]]},e.a=r},function(t,e,i){"use strict";var r=i(2),s=i(3),a=i(32),n=i(5),o=r.e,h=s.a,l=a.a,u=n.a,c=function(t,e){this.generateLines=!0,this.map=t.map,this.vertices=null,this.internalUVs=null,this.externalUVs=null,this.mesh=t,this.statsCounter=0,this.valid=!0,this.killed=!1,this.bbox=new u,this.size=0,this.faces=0,this.flagsInternalTexcoords=1,this.flagsExternalTexcoords=2,this.flagsPerVertexUndulation=4,this.flagsTextureMode=8,null!=e&&this.parseSubmesh(e)};c.prototype.kill=function(){this.killed=!0,this.vertices=null,this.internalUVs=null,this.externalUVs=null},c.prototype.parseSubmesh=function(t){this.parseHeader(t),this.mesh.version>=3?this.parseVerticesAndFaces2(t):this.parseVerticesAndFaces(t)},c.prototype.parseHeader=function(t){var e=t.data;this.flags=e.getUint8(t.index,!0),t.index+=1,this.mesh.version>1?(this.surfaceReference=e.getUint8(t.index,!0),t.index+=1):this.surfaceReference=0,this.textureLayer=e.getUint16(t.index,!0),t.index+=2,this.textureLayer2=this.textureLayer;var i=this.bbox.min,r=this.bbox.max;i[0]=e.getFloat64(t.index,!0),t.index+=8,i[1]=e.getFloat64(t.index,!0),t.index+=8,i[2]=e.getFloat64(t.index,!0),t.index+=8,r[0]=e.getFloat64(t.index,!0),t.index+=8,r[1]=e.getFloat64(t.index,!0),t.index+=8,r[2]=e.getFloat64(t.index,!0),t.index+=8,this.bbox.updateMaxSize()},c.prototype.parseVerticesAndFaces=function(t){var e=t.data,i=t.index,r=t.uint8Data,s=e.getUint16(i,!0);i+=2,s||(this.valid=!1);var a=null,n=null,o=new Float32Array(3*s);this.flags&this.flagsExternalTexcoords&&(n=new Float32Array(2*s));var h,l,u=0,c=0;for(h=0;h<s;h++)o[u]=(r[i]+(r[i+1]<<8))*(1/65535),o[u+1]=(r[i+2]+(r[i+3]<<8))*(1/65535),o[u+2]=(r[i+4]+(r[i+5]<<8))*(1/65535),u+=3,null!=n?(n[c]=(r[i+6]+(r[i+7]<<8))*(1/65535),n[c+1]=(65535-(r[i+8]+(r[i+9]<<8)))*(1/65535),c+=2,i+=10):i+=6;if(this.tmpVertices=o,this.tmpExternalUVs=n,this.flags&this.flagsInternalTexcoords){var d=e.getUint16(i,!0);for(i+=2,a=new Float32Array(2*d),h=0,l=2*d;h<l;h+=2)a[h]=(r[i]+(r[i+1]<<8))*(1/65535),a[h+1]=(65535-(r[i+2]+(r[i+3]<<8)))*(1/65535),i+=4;this.tmpInternalUVs=a}var p=e.getUint16(i,!0);i+=2,a=null,n=null,o=new Float32Array(3*p*3),this.flags&this.flagsInternalTexcoords&&(a=new Float32Array(3*p*2)),this.flags&this.flagsExternalTexcoords&&(n=new Float32Array(3*p*2));var f=this.tmpVertices,g=this.tmpExternalUVs,m=this.tmpInternalUVs;for(h=0;h<p;h++){u=9*h;var v=r[i]+(r[i+1]<<8),y=r[i+2]+(r[i+3]<<8),b=r[i+4]+(r[i+5]<<8),x=3*v;o[u]=f[x],o[u+1]=f[x+1],o[u+2]=f[x+2],x=3*y,o[u+3]=f[x],o[u+4]=f[x+1],o[u+5]=f[x+2],x=3*b,o[u+6]=f[x],o[u+7]=f[x+1],o[u+8]=f[x+2],null!=n&&(u=6*h,n[u]=g[2*v],n[u+1]=g[2*v+1],n[u+2]=g[2*y],n[u+3]=g[2*y+1],n[u+4]=g[2*b],n[u+5]=g[2*b+1]),null!=a?(v=r[i+6]+(r[i+7]<<8),y=r[i+8]+(r[i+9]<<8),b=r[i+10]+(r[i+11]<<8),i+=12,u=6*h,a[u]=m[2*v],a[u+1]=m[2*v+1],a[u+2]=m[2*y],a[u+3]=m[2*y+1],a[u+4]=m[2*b],a[u+5]=m[2*b+1]):i+=6}this.vertices=o,this.internalUVs=a,this.externalUVs=n,this.tmpVertices=null,this.tmpInternalUVs=null,this.tmpExternalUVs=null,t.index=i,this.size=this.vertices.length,this.internalUVs&&(this.size+=this.internalUVs.length),this.externalUVs&&(this.size+=this.externalUVs.length),this.size*=4,this.faces=p},c.prototype.parseWord=function(t,e){var i=t[e[1]];128&i?(e[0]=127&i|t[e[1]+1]<<7,e[1]+=2):(e[0]=i,e[1]++)},c.prototype.parseDelta=function(t,e){var i=t[e[1]];128&i?(i=127&i|t[e[1]+1]<<7,1&i?(e[0]=-(1+(i>>1)),e[1]+=2):(e[0]=i>>1,e[1]+=2)):1&i?(e[0]=-(1+(i>>1)),e[1]++):(e[0]=i>>1,e[1]++)},c.prototype.parseVerticesAndFaces2=function(t){var e=t.data,i=t.index,r=t.uint8Data,s=e.getUint16(i,!0);i+=2;var a=e.getUint16(i,!0);i+=2,s||(this.valid=!1);var n,o,h,l=this.bbox.center(),u=this.bbox.maxSize,c=1/a,d=null,p=new Float32Array(3*s),f=0,g=0,m=0,v=l[0],y=l[1],b=l[2],x=this.bbox.min[0],M=this.bbox.min[1],w=this.bbox.min[2],S=1/(this.bbox.max[0]-this.bbox.min[0]),A=1/(this.bbox.max[1]-this.bbox.min[1]),C=1/(this.bbox.max[2]-this.bbox.min[2]),T=[0,i];for(o=0;o<s;o++)this.parseDelta(r,T),f+=T[0],this.parseDelta(r,T),g+=T[0],this.parseDelta(r,T),m+=T[0],n=3*o,p[n]=(f*c*u+v-x)*S,p[n+1]=(g*c*u+y-M)*A,p[n+2]=(m*c*u+b-w)*C;if(i=T[1],this.flags&this.flagsExternalTexcoords)for(a=e.getUint16(i,!0),i+=2,c=1/a,d=new Float32Array(2*s),f=0,g=0,T[1]=i,o=0;o<s;o++){this.parseDelta(r,T),f+=T[0],this.parseDelta(r,T),g+=T[0];var P=2*o;d[P]=f*c,d[P+1]=1-g*c}if(i=T[1],this.tmpVertices=p,this.tmpExternalUVs=d,this.flags&this.flagsInternalTexcoords){var E=e.getUint16(i,!0);i+=2;var L=e.getUint16(i,!0);i+=2;var k=e.getUint16(i,!0);i+=2;var I=1/L,N=1/k;f=0,g=0;var F=new Float32Array(2*E);for(T[1]=i,o=0,h=2*E;o<h;o+=2)this.parseDelta(r,T),f+=T[0],this.parseDelta(r,T),g+=T[0],F[o]=f*I,F[o+1]=1-g*N;i=T[1],this.tmpInternalUVs=F}var B=e.getUint16(i,!0);i+=2,F=null,d=null,p=new Float32Array(3*B*3),this.flags&this.flagsInternalTexcoords&&(F=new Float32Array(3*B*2)),this.flags&this.flagsExternalTexcoords&&(d=new Float32Array(3*B*2));var R,_,D,U=this.tmpVertices,z=this.tmpExternalUVs,G=this.tmpInternalUVs,V=0;for(T[1]=i,o=0;o<B;o++){n=9*o,this.parseWord(r,T),R=V-T[0],T[0]||V++,this.parseWord(r,T),_=V-T[0],T[0]||V++,this.parseWord(r,T),D=V-T[0],T[0]||V++;var O=3*R;p[n]=U[O],p[n+1]=U[O+1],p[n+2]=U[O+2],O=3*_,p[n+3]=U[O],p[n+4]=U[O+1],p[n+5]=U[O+2],O=3*D,p[n+6]=U[O],p[n+7]=U[O+1],p[n+8]=U[O+2],null!=d&&(n=6*o,d[n]=z[2*R],d[n+1]=z[2*R+1],d[n+2]=z[2*_],d[n+3]=z[2*_+1],d[n+4]=z[2*D],d[n+5]=z[2*D+1])}if(V=0,null!=F)for(o=0;o<B;o++)this.parseWord(r,T),R=V-T[0],T[0]||V++,this.parseWord(r,T),_=V-T[0],T[0]||V++,this.parseWord(r,T),D=V-T[0],T[0]||V++,n=6*o,F[n]=G[2*R],F[n+1]=G[2*R+1],F[n+2]=G[2*_],F[n+3]=G[2*_+1],F[n+4]=G[2*D],F[n+5]=G[2*D+1];i=T[1],this.vertices=p,this.internalUVs=F,this.externalUVs=d,this.tmpVertices=null,this.tmpInternalUVs=null,this.tmpExternalUVs=null,t.index=i,this.size=this.vertices.length,this.internalUVs&&(this.size+=this.internalUVs.length),this.externalUVs&&(this.size+=this.externalUVs.length),this.size*=4,this.faces=B},c.prototype.size=function(){return this.size},c.prototype.fileSize=function(){return this.fileSize},c.prototype.buildGpuMesh=function(){return new l(this.map.renderer.gpu,{bbox:this.bbox,vertices:this.vertices,uvs:this.internalUVs,uvs2:this.externalUVs},1,this.map.core)},c.prototype.getWorldMatrix=function(t,e){var i=e;return null!=i?(i[0]=this.bbox.side(0),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=this.bbox.side(1),i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=this.bbox.side(2),i[11]=0,i[12]=this.bbox.min[0]-t[0],i[13]=this.bbox.min[1]-t[1],i[14]=this.bbox.min[2]-t[2],i[15]=1):(i=o.create(),o.multiply(h.translationMatrix(this.bbox.min[0]-t[0],this.bbox.min[1]-t[1],this.bbox.min[2]-t[2]),h.scaleMatrix(this.bbox.side(0),this.bbox.side(1),this.bbox.side(2)),i)),i},c.prototype.drawBBox=function(t){var e=this.map.renderer;e.gpu.useProgram(e.progBBox,["aPosition"]);var i=o.create(),r=o.create();o.multiply(e.camera.getModelviewMatrix(),this.getWorldMatrix(t),r);var s=e.camera.getProjectionMatrix();o.multiply(s,r,i),e.progBBox.setMat4("uMVP",i),e.bboxMesh.draw(e.progBBox,"aPosition")},e.a=c},function(t,e,i){"use strict";var r=function(t){this.map=t};r.prototype.generateSurfaceSequence=function(){var t=this.map.currentView,e=this.map.tree;if(e){e.surfaceSequence=[],e.surfaceSequenceIndices=[],e.surfaceOnlySequence=[];var i,r,s,a,n,o,h,l,u={},c=0,d=[],p=[];for(l in t.surfaces)(i=this.map.getSurface(l))&&(p.push(i.id),c++,u[l]=i.index+1,d.push([[i.index+1],i,!0,!1]));if(c>=1&&(p.sort(),p=p.join(";"),(i=this.map.virtualSurfaces[p])&&(d=[[[i.index+1],i,!0,!1]],c=1)),c>1){var f=[];for(l in this.map.glues){r=this.map.glues[l];var g=r.id;if(g.length<=c){var m=!1;for(o=0,h=g.length;o<h;o++)if(!u[g[o]]){m=!0;break}if(!m){for(s=[],o=0,h=g.length;o<h;o++)s.unshift(u[g[o]]);f.push([s,r,!1,!1])}}}for(a=0,n=f.length;a<n;a++){var v=f[a];r=v[1],r.flagProper=!0,r.flagAlien=!0,r.flagProper&&d.push(v),r.flagAlien&&(s=v[0].slice(1),d.push([s,v[1],!1,!0]))}do{var y=!0;for(a=0,n=d.length-1;a<n;a++){var b=d[a][0],x=d[a+1][0],M=!1;for(o=0,h=Math.min(b.length,x.length);o<h;o++)if(b[o]<x[o]||o==h-1&&b[o]==x[o]&&x.length>b.length){M=!0;break}if(M){var w=d[a];d[a]=d[a+1],d[a+1]=w,y=!1}}}while(!y);var S=c-1;for(a=0,n=d.length;a<n;a++)e.surfaceSequence.push([d[a][1],d[a][3]]),d[a][1].viewSurfaceIndex=S,d[a][2]&&(S--,e.surfaceOnlySequence.push(d[a][1]))}else 1==c&&(e.surfaceSequence.push([d[0][1],d[0][3]]),d[0][1].viewSurfaceIndex=c-1,e.surfaceOnlySequence=[d[0][1]]);this.map.freeLayersHaveGeodata=!1;for(l in t.freeLayers){var A=this.map.getFreeLayer(l);A&&(A.surfaceSequence=[A],A.surfaceOnlySequence=[A],A.geodata&&(this.map.freeLayersHaveGeodata=!0))}this.map.renderer.draw.clearJobBuffer()}},r.prototype.generateBoundLayerSequence=function(){var t,e,i,r,s,a,n=this.map.currentView;for(t in n.surfaces){var o=n.surfaces[t],h=this.map.getSurface(t);if(null!=h)for(h.boundLayerSequence=[],s=0,a=o.length;s<a;s++)e=o[s],"string"==typeof e?(i=this.map.getBoundLayerById(e))&&h.boundLayerSequence.push([i,1]):(i=this.map.getBoundLayerById(e.id))&&(r=1,void 0!==e.alpha&&(r=e.alpha),h.boundLayerSequence.push([i,r]))}for(t in n.freeLayers){var l=n.freeLayers[t],u=this.map.getFreeLayer(t);if(null!=u&&u.ready){u.boundLayerSequence=[];var c=l.boundLayers;if(c&&Array.isArray(c))for(s=0,a=c.length;s<a;s++)e=c[s],"string"==typeof e?(i=this.map.getBoundLayerById(e))&&u.boundLayerSequence.push([i,1]):(i=this.map.getBoundLayerById(e.id))&&(r=1,void 0!==e.alpha&&(r=e.alpha),u.boundLayerSequence.push([i,r]))}}},e.a=r},function(t,e,i){"use strict";var r=i(2),s=r.b,a=[[-1,-1,0,0],[0,-1,.5,1],[1,-1,1,0],[-1,0,0,.5],[0,0,.5,.5],[1,0,1,.5],[-1,1,0,1],[0,1,.5,0],[1,1,1,1]],n=[[0,1,3],[2,1,5],[6,3,7],[8,7,5]],o=function(t,e,i){this.map=t,this.id=i,this.parent=e,this.viewCounter=t.viewCounter,this.drawCounter=0,this.childrenReadyCount=0,this.renderReady=!1,this.geodataCounter=0,this.texelSize=1,this.texelSize2=1,this.distance=1,this.tiltAngle=1,this.metanode=null,this.lastMetanode=null,this.boundmetaresources=null,this.surface=null,this.surfaceMesh=null,this.surfaceGeodata=null,this.surfaceGeodataView=null,this.surfaceTextures=[],this.resourceSurface=null,this.virtual=!1,this.virtualReady=!1,this.virtualSurfaces=[],this.resetDrawCommands=!1,this.drawCommands=[[],[],[]],this.bounds={},this.boundLayers={},this.boundTextures={},this.updateBounds=!0,this.heightMap=null,this.drawCommands=[[],[],[]],this.imageryCredits={},this.glueImageryCredits={},this.mapdataCredits={},this.resources=this.map.resourcesTree.findNode(i,!0),this.metaresources=this.map.resourcesTree.findAgregatedNode(i,5,!0),this.boundresources=this.map.resourcesTree.findAgregatedNode(i,8,!0),this.children=[null,null,null,null]};o.prototype.kill=function(){for(var t=0;t<4;t++)null!=this.children[t]&&this.children[t].kill();this.resources=null,this.metaresources=null,this.metanode=null,this.surface=null,this.surfaceMesh=null,this.surfaceTextures=[],this.surfaceGeodata=null,this.surfaceGeodataView=null,this.resourceSurface=null,this.bounds={},this.boundLayers={},this.boundTextures={},this.updateBounds=!0,this.virtual=!1,this.virtualReady=!1,this.virtualSurfaces=[],this.renderReady=!1,this.lastSurface=null,this.lastState=null,this.lastRenderState=null,this.heightMap=null,this.drawCommands=[[],[],[]],this.imageryCredits={},this.glueImageryCredits={},this.mapdataCredits={},this.verifyChildren=!1,this.children=[null,null,null,null];var e=this.parent;this.parent=null,null!=e&&e.removeChild(this)},o.prototype.validate=function(){null==this.metaresources||this.metaresources.getMetatile(this.surface,null,this)},o.prototype.viewSwitched=function(){this.lastSurface=this.surface,this.lastState={surfaceMesh:this.surfaceMesh,surfaceTextures:this.surfaceTextures,boundTextures:this.boundTextures,surfaceGeodata:this.surfaceGeodata,surfaceGeodataView:this.surfaceGeodataView,resourceSurface:this.resourceSurface},this.drawCommands[0].length>0?this.lastRenderState={drawCommands:this.drawCommands,imageryCredits:this.imageryCredits,mapdataCredits:this.mapdataCredits}:this.lastRenderState=null,this.verifyChildren=!0,this.renderReady=!1,this.lastMetanode=this.metanode;for(var t in this.bounds)this.bounds[t]={sequence:[],alpha:[],transparent:!1,viewCoutner:0};this.boundLayers={},this.boundTextures={},this.updateBounds=!0,this.transparentBounds=!1,this.surface=null,this.surfaceMesh=null,this.surfaceTextures=[],this.surfaceGeodata=null,this.surfaceGeodataView=null,this.resourceSurface=null,this.virtual=!1,this.virtualReady=!1,this.virtualSurfaces=[],this.drawCommands=[[],[],[]],this.imageryCredits={},this.glueImageryCredits={},this.mapdataCredits={}},o.prototype.restoreLastState=function(){this.lastState&&(this.surfaceMesh=this.lastState.surfaceMesh,this.surfaceTextures=this.lastState.surfaceTextures,this.boundTextures=this.lastState.boundTextures,this.surfaceGeodata=this.lastState.surfaceGeodata,this.surfaceGeodataView=this.lastState.surfaceGeodataView,this.resourceSurface=this.lastState.resourceSurface,this.lastSurface=null,this.lastState=null,this.lastResourceSurface=null)},o.prototype.addChild=function(t){if(!this.children[t]){var e=this.id,i=[e[0]+1,e[1]<<1,e[2]<<1];switch(t){case 1:i[1]++;break;case 2:i[2]++;break;case 3:i[1]++,i[2]++}this.children[t]=new o(this.map,this,i)}},o.prototype.removeChildByIndex=function(t){null!=this.children[t]&&(this.children[t].kill(),this.children[t]=null)},o.prototype.removeChild=function(t){for(var e=0;e<4;e++)this.children[e]==t&&(this.children[e].kill(),this.children[e]=null)},o.prototype.isMetanodeReady=function(t,e,i){if(this.map.viewCounter!=this.viewCoutner&&(this.viewSwitched(),this.viewCoutner=this.map.viewCounter,this.map.markDirty(),this.lastRenderState&&(this.lastRenderState=this.lastRenderState)),!i&&((this.virtualSurfacesUncomplete||null==this.surface&&0==this.virtualSurfaces.length)&&this.checkSurface(t,e),(null==this.metanode||this.lastMetanode)&&!this.virtualSurfacesUncomplete)){if(!(this.checkMetanode(t,e)||null!=this.metanode&&this.lastMetanode))return}return null!=this.metanode&&(this.metanode.metatile.used(),this.lastSurface&&this.lastSurface==this.surface&&(this.lastSurface=null,this.restoreLastState()),this.surface&&(this.surface.virtual?(this.resourceSurface=this.surface.getSurface(this.metanode.sourceReference),this.resourceSurface||(this.resourceSurface=this.surface)):this.resourceSurface=this.surface),!0)},o.prototype.checkSurface=function(t,e){if(this.surface=null,this.virtual=!1,this.virtualReady=!1,this.virtualSurfaces=[],this.virtualSurfacesUncomplete=!1,t.freeLayerSurface)return void(this.surface=t.freeLayerSurface);for(var i=t.surfaceSequence,r=0,s=i.length;r<s;r++){var a=i[r][0],n=i[r][1];if(a.hasTile2(this.id)[0]){if(this.id[0]>0){var o=this.parent;if(o){if(o.virtualSurfacesUncomplete)return this.virtualSurfacesUncomplete=!0,void(this.virtualSurfaces=[]);var h=o.metaresources.getMetatile(a,null,this);if(!h)continue;if(!h.isReady(e)){this.virtualSurfacesUncomplete=!0;continue}var l=h.getNode(o.id);if(!l)continue;if(!l.hasChildById(this.id))continue}}this.virtualSurfaces.push([a,n])}}this.virtualSurfaces.length>1?this.virtual=!0:this.surface=this.virtualSurfaces[0]?this.virtualSurfaces[0][0]:null},o.prototype.checkMetanode=function(t,e){if(this.virtual){if(!this.isVirtualMetanodeReady(t,e))return!1;this.metanode=this.createVirtualMetanode(t,e),this.lastMetanode=null,this.map.markDirty()}var i=this.surface;if(null==i)return!1;var r=this.metaresources.getMetatile(i,!0,this);if(!r.isReady(e))return!1;if(this.virtual||(this.metanode=r.getNode(this.id),this.lastMetanode=null,this.map.markDirty()),null!=this.metanode){this.metanode.tile=this,this.lastMetanode=null,this.map.markDirty();for(var s=0;s<4;s++)this.metanode.hasChild(s)?this.addChild(s):this.removeChildByIndex(s)}return!0},o.prototype.isVirtualMetanodeReady=function(t,e){for(var i=this.virtualSurfaces,r=0,s=0,a=i.length;s<a;s++){var n=i[s][0];this.metaresources.getMetatile(n,!0,this).isReady(e)&&r++}return r==a},o.prototype.createVirtualMetanode=function(t,e){var i,r,s,a,n,o=this.virtualSurfaces,h=null;for(i=0,r=o.length;i<r;i++){s=o[i][0];var l=o[i][1];if(a=this.metaresources.getMetatile(s,null,this),a.isReady(e)&&null!=(n=a.getNode(this.id))){if(l!=n.alien)continue;if(!l&&s.glue&&!n.hasGeometry()&&n.internalTextureCount>0){var u=n.internalTextureCount-1;u=this.map.getSurface(s.id[u]).viewSurfaceIndex;for(var c=!1,d=i;d<r;d++)if(o[d].viewSurfaceIndex<=u){c=d>i,i=d-1;break}if(c)continue}if(n.hasGeometry()){h=n.clone(),this.surface=s;break}}}for(i=0,r=o.length;i<r;i++)s=o[i][0],a=this.metaresources.getMetatile(s,null,this),a.isReady(e)&&null!=(n=a.getNode(this.id))&&(h?(h.flags|=240&n.flags,a.useVersion<4&&(h.bbox.min[0]=Math.min(h.bbox.min[0],n.bbox.min[0]),h.bbox.min[1]=Math.min(h.bbox.min[1],n.bbox.min[1]),h.bbox.min[2]=Math.min(h.bbox.min[2],n.bbox.min[2]),h.bbox.max[0]=Math.max(h.bbox.max[0],n.bbox.max[0]),h.bbox.max[1]=Math.max(h.bbox.max[1],n.bbox.max[1]),h.bbox.max[2]=Math.max(h.bbox.max[2],n.bbox.max[2]))):(h=n.clone(),this.surface=s));return h&&h.generateCullingHelpers(!0),h},o.prototype.bboxVisible=function(t,e,i,r){var a=this.map,n=a.camera;if(t[0]<a.measure.minDivisionNodeDepth)return!0;if(!a.config.mapDisableCulling&&a.isGeocent&&r){var o=r.diskPos,h=n.position,l=[o[0]-h[0],o[1]-h[1],o[2]-h[2]],u=s.normalize4(l)*n.distanceFactor,c=s.dot(l,r.diskNormal);if(this.tiltAngle=c,u>15e4&&c>r.diskAngle)return!1}return r.metatile.useVersion>=4?n.camera.pointsVisible(r.bbox2,i):!a.isGeocent||!a.config.mapPreciseBBoxTest||t[0]<4?n.camera.bboxVisible(e,i):n.camera.pointsVisible(r.bbox2,i)},o.prototype.getPixelSize=function(t,e,i,r,s){var a=t.min,n=t.max,o=a[0]-i[0],h=a[1]-i[1],l=n[0]-i[0],u=a[1]-i[1],c=n[0]-i[0],d=n[1]-i[1],p=a[0]-i[0],f=n[1]-i[1],g=a[2]-i[2],m=n[2]-i[2];if(!this.map.config.mapLowresBackground&&i[0]>a[0]&&i[0]<n[0]&&i[1]>a[1]&&i[1]<n[1]&&i[2]>a[2]&&i[2]<n[2])return s?[Number.POSITIVE_INFINITY,.1]:Number.POSITIVE_INFINITY;var v=0,y=this.map.camera.camera;return v=0<h?0<o?0>m?y.scaleFactor([o,h,m],s):0<g?y.scaleFactor([o,h,g],s):y.scaleFactor([o,h,.5*(g+m)],s):0>l?0>m?y.scaleFactor([l,u,m],s):0<g?y.scaleFactor([l,u,g],s):y.scaleFactor([l,u,.5*(g+m)],s):0>m?y.scaleFactor([.5*(o+l),u,m],s):0<g?y.scaleFactor([.5*(o+l),u,g],s):y.scaleFactor([.5*(o+l),u,.5*(g+m)],s):0>f?0<p?0>m?y.scaleFactor([p,f,m],s):0<g?y.scaleFactor([p,f,g],s):y.scaleFactor([p,f,.5*(g+m)],s):0>c?0>m?y.scaleFactor([c,d,m],s):0<g?y.scaleFactor([c,d,g],s):y.scaleFactor([c,d,.5*(g+m)],s):0>m?y.scaleFactor([.5*(p+c),d,m],s):0<g?y.scaleFactor([.5*(p+c),d,g],s):y.scaleFactor([.5*(p+c),d,.5*(g+m)],s):0<p?0>m?y.scaleFactor([o,.5*(u+d),m],s):0<g?y.scaleFactor([o,.5*(u+d),g],s):y.scaleFactor([o,.5*(u+d),.5*(g+m)],s):0>c?0>m?y.scaleFactor([l,.5*(u+d),m],s):0<g?y.scaleFactor([l,.5*(u+d),g],s):y.scaleFactor([l,.5*(u+d),.5*(g+m)],s):0>m?y.scaleFactor([.5*(o+l),.5*(u+d),m],s):0<g?y.scaleFactor([.5*(o+l),.5*(u+d),g],s):y.scaleFactor([.5*(o+l),.5*(u+d),.5*(g+m)],s),s?[v[0]*e,v[1]]:v*e},o.prototype.getPixelSize3Old=function(t,e,i){var r=this.map.camera,a=r.geocentDistance*i-t.diskDistance;a<0&&(a=-a);var n=s.dot(r.geocentNormal,t.diskNormal);if(n<t.diskAngle2){var o=Math.acos(n);o-=Math.acos(t.diskAngle2);var h=Math.tan(o)*t.diskDistance;a=Math.sqrt(h*h+a*a)}return i=r.camera.scaleFactor2(a),[i*e,a]},o.prototype.getPixelSize3=function(t,e){var i,r=this.map.camera,a=r.geocentDistance,n=s.dot(r.geocentNormal,t.diskNormal),o=a-(t.diskDistance+(t.maxZ-t.minZ));if(n<t.diskAngle2){var h=Math.acos(n);h-=t.diskAngle2A;var l=Math.tan(h)*t.diskDistance;o<0?(i=a-t.diskDistance,i<0?(o=-i,o=Math.sqrt(l*l+o*o)):o=l):o=Math.sqrt(l*l+o*o)}else if(o<0){if(!((i=a-t.diskDistance)<0))return[Number.POSITIVE_INFINITY,.1];o=-i}return[r.camera.scaleFactor2(o)*e,o]},o.prototype.updateTexelSize=function(){var t,e,i,r,s=this.map,a=s.draw,n=s.camera,o=a.texelSizeFit,h=this.metanode,l=s.camera.position,u=s.isGeocent&&(s.config.mapPreciseDistanceTest||h.metatile.useVersion>=4);if(h.hasGeometry()){var c=Number.POSITIVE_INFINITY;if(h.usedTexelSize()?c=a.ndcToScreenPixel*h.pixelSize:h.usedDisplaySize()&&(c=a.ndcToScreenPixel*(h.bbox.maxSize/h.displaySize)),n.camera.ortho){var d=n.camera.getViewHeight();t=[2*c/d,d]}else h.usedDisplaySize()?u?(c=a.ndcToScreenPixel*(h.bbox.maxSize/256)*(256/h.displaySize),t=this.getPixelSize3(h,c)):(c=a.ndcToScreenPixel*(h.bbox.maxSize/256),e=h.displaySize/256*n.distance,i=n.vector,r=[l[0]-i[0]*e,l[1]-i[1]*e,l[2]-i[2]*e],t=this.getPixelSize(h.bbox,c,r,r,!0)):!u&&o>1.1?(c=a.ndcToScreenPixel*h.pixelSize*(o/1.1),e=o/1.1*n.distance,i=n.vector,r=[l[0]-i[0]*e,l[1]-i[1]*e,l[2]-i[2]*e],t=this.getPixelSize(h.bbox,c,r,r,!0)):t=u?this.getPixelSize3(h,c):this.getPixelSize(h.bbox,c,l,l,!0)}else t=u?this.getPixelSize3(h,1,1):this.getPixelSize(h.bbox,1,l,l,!0),t[0]=Number.POSITIVE_INFINITY;if(this.texelSize=t[0],this.distance=t[1],s.config.mapDegradeHorizon&&!(a.degradeHorizonFactor<1)){var p=s.config.mapDegradeHorizonParams,f=p[1],g=p[2],m=a.degradeHorizonFactor*a.degradeHorizonTiltFactor,v=this.distance*n.distanceFactor;v<f?m=1:v>f&&v<g&&(m=1+(v-f)/(g-f)*(m-1)),m=Math.max(m,1);var y=n.perceivedDistance,b=p[3];y>b?m=1:y<b&&m>1&&(m=1+(m-1)*(1-y/b)),this.texelSize/=m}},o.prototype.drawGrid=function(t,e,i){if(!((this.texelSize==Number.POSITIVE_INFINITY||this.texelSize>4.4)&&this.metanode&&this.metanode.hasChildren())&&this.metanode){var r,s,o,h,l=this.map;if(!l.draw.gridSkipped){e?(r=e[0],s=e[1][0],o=e[1][1]):(h=l.measure.getSpatialDivisionNodeAndExtents(this.id),r=h[0],s=h[1][0],o=h[1][1]);var u=[.5*(o[0]+s[0]),.5*(o[1]+s[1])],c=l.referenceFrame.hasPoles;if(i=i||this.metanode.diskAngle2,c&&!r.isPole&&Math.acos(i)>.1*Math.PI)return i=Math.cos(.5*Math.acos(i)),this.drawGrid(t,[r,[[s[0],s[1]],[u[0],u[1]]]],i),this.drawGrid(t,[r,[[u[0],s[1]],[o[0],u[1]]]],i),this.drawGrid(t,[r,[[s[0],u[1]],[u[0],o[1]]]],i),void this.drawGrid(t,[r,[[u[0],u[1]],[o[0],o[1]]]],i);var d=r.extents.ur[1]-r.extents.ll[1],p=this.distance,f=Math.log(5*d/p)/l.log2;f=Math.max(0,f-8+r.id[0]);var g,m,v,y=l.draw,b=t[0],b=t[0],x=t[1],M=t[2],w=y.planeBuffer,S=y.gridFlat,A=y.gridGlues,C=this.gridPoints,T=l.config.mapGridSurrogatez;if(!C){g=T?this.metanode.surrogatez:this.metanode.minZ;var P=r.getPhysicalCoords([o[0],o[1],g],!0),E=r.getPhysicalCoords([o[0],s[1],g],!0),L=r.getPhysicalCoords([s[0],s[1],g],!0),k=r.getPhysicalCoords([s[0],o[1],g],!0),I=r.getPhysicalCoords([u[0],o[1],g],!0),N=r.getPhysicalCoords([u[0],s[1],g],!0),F=r.getPhysicalCoords([s[0],u[1],g],!0),B=r.getPhysicalCoords([o[0],u[1],g],!0);if(u[2]=g,u=r.getPhysicalCoords(u,!0),e)w[0]=k[0]-b,w[1]=k[1]-x,w[2]=k[2]-M,w[3]=I[0]-b,w[4]=I[1]-x,w[5]=I[2]-M,w[6]=P[0]-b,w[7]=P[1]-x,w[8]=P[2]-M,w[9]=F[0]-b,w[10]=F[1]-x,w[11]=F[2]-M,w[12]=u[0]-b,w[13]=u[1]-x,w[14]=u[2]-M,w[15]=B[0]-b,w[16]=B[1]-x,w[17]=B[2]-M,w[18]=L[0]-b,w[19]=L[1]-x,w[20]=L[2]-M,w[21]=N[0]-b,w[22]=N[1]-x,w[23]=N[2]-M,w[24]=E[0]-b,w[25]=E[1]-x,w[26]=E[2]-M;else{var C=[k[0],k[1],k[2],I[0],I[1],I[2],P[0],P[1],P[2],F[0],F[1],F[2],u[0],u[1],u[2],B[0],B[1],B[2],L[0],L[1],L[2],N[0],N[1],N[2],E[0],E[1],E[2]];this.gridPoints=C}}if(!S){var R,_,D,U=this.metanode,z=U.border,G=U.borderNodes,V=l.tree,O=this.id;z||(U.border=new Array(9),U.borderNodes=new Array(9),z=U.border,G=U.borderNodes,z[4]=T?U.surrogatez:U.minZ);var j=a;if(!U.borderReady){var H=!1;for(R=0;R<9;R++)4==R||G[R]||(D=V.getNodeById([O[0],O[1]+j[R][0],O[2]+j[R][1]],!0),D?(G[R]=D,z[R]=T?D.surrogatez:D.minZ):(z[R]=z[4],H=!0));H||(U.borderReady=!0)}var q=U.border2;if(g=T?U.surrogatez:U.minZ,q&&U.borderReady||(q=[.25*(z[0]+z[1]+z[3]+z[4])-g,.5*(z[1]+z[4])-g,.25*(z[2]+z[1]+z[5]+z[4])-g,.5*(z[3]+z[4])-g,z[4]-g,.5*(z[5]+z[4])-g,.25*(z[6]+z[7]+z[3]+z[4])-g,.5*(z[7]+z[4])-g,.25*(z[8]+z[7]+z[5]+z[4])-g],U.border2=q),A){var J=n,Z=this.nodeTable;for(Z||(Z=new Array(9),this.nodeTable=Z),R=0,_=j.length;R<_;R++)4!=R&&(Z[R]=V.getRenderedNodeById([O[0],O[1]+j[R][0],O[2]+j[R][1]],y.drawCounter));var Y=U.border3;for(Y||(Y=new Array(9),U.border3=Y),R=0,_=J.length;R<_;R++){for(var W=Z[J[R][0]],X=1;X<3;X++)(D=Z[J[R][X]])&&(W?D.id[0]<W.id[0]&&(W=D):W=D);Z[J[R][0]]=W}for(R=0,_=j.length;R<_;R++)if(D=Z[R],4!=R&&D&&D.id[0]<O[0]){var Q;switch(R){case 0:Q=[U.llx,U.lly];break;case 1:Q=[.5*(U.urx+U.llx),U.lly];break;case 2:Q=[U.urx,U.lly];break;case 3:Q=[U.llx,.5*(U.ury+U.lly)];break;case 5:Q=[U.urx,.5*(U.ury+U.lly)];break;case 6:Q=[U.llx,U.ury];break;case 7:Q=[.5*(U.urx+U.llx),U.ury];break;case 8:Q=[U.urx,U.ury]}D.border2&&(U.border3[R]=D.getGridHeight(Q,D.border2,3)+(T?D.surrogatez:D.minZ)-g)}else U.border3[R]=q[R]}}var K=l.renderer,$=K.camera.getModelviewMatrix(),tt=K.camera.getProjectionMatrix();if(C&&(w[0]=C[0]-b,w[1]=C[1]-x,w[2]=C[2]-M,w[3]=C[3]-b,w[4]=C[4]-x,w[5]=C[5]-M,w[6]=C[6]-b,w[7]=C[7]-x,w[8]=C[8]-M,w[9]=C[9]-b,w[10]=C[10]-x,w[11]=C[11]-M,w[12]=C[12]-b,w[13]=C[13]-x,w[14]=C[14]-M,w[15]=C[15]-b,w[16]=C[16]-x,w[17]=C[17]-M,w[18]=C[18]-b,w[19]=C[19]-x,w[20]=C[20]-M,w[21]=C[21]-b,w[22]=C[22]-x,w[23]=C[23]-M,w[24]=C[24]-b,w[25]=C[25]-x,w[26]=C[26]-M),c&&!l.poleRadius&&1==r.id[0]&&!r.isPole){var et=r.getPhysicalCoords([r.extents.ur[0],r.extents.ur[1],0]);l.poleRadius=Math.sqrt(et[0]*et[0]+et[1]*et[1]),l.poleRadiusFactor=8*Math.pow(2,552058/l.poleRadius)}if(m=1,c&&r.isPole)m=l.poleRadiusFactor,v=K.progPlane2,K.gpu.useProgram(v,["aPosition","aTexCoord"]),v.setVec4("uParams4",[-b,-x,l.poleRadius,0]);else if(S)v=K.progPlane,K.gpu.useProgram(v,["aPosition","aTexCoord"]);else{v=K.progPlane3,K.gpu.useProgram(v,["aPosition","aTexCoord"]);var z;z=A?U.border3:U.border2,v.setFloatArray("uHeights",z),v.setVec3("uVector",U.diskNormal)}v.setMat4("uMV",$),v.setMat4("uProj",tt),v.setFloatArray("uPoints",w);var it=r.gridStep1*m,rt=1/(o[0]-s[0]),st=1/(s[1]-o[1]),at=it/((r.extents.ur[0]-r.extents.ll[0])*rt),nt=it/((r.extents.ur[1]-r.extents.ll[1])*st),ot=(s[0]-r.extents.ll[0])*rt*at,ht=(o[1]-r.extents.ll[1])*st*nt;v.setVec4("uParams",[it*m,y.fogDensity,1/15,r.gridStep2*m]),v.setVec4("uParams3",[ht-Math.floor(ht),ot-Math.floor(ot),nt,at]),v.setVec4("uParams2",[0,0,r.gridBlend,0]),v.setVec4("uFogColor",y.atmoColor),K.gpu.bindTexture(K.heightmapTexture),K.planeMesh.draw(v,"aPosition","aTexCoord"),this.map.stats.drawnFaces+=K.planeMesh.polygons}}},e.a=o},function(t,e,i){"use strict";var r=i(3),s=r.a,a=function(t,e,i,r){this.map=t,this.p1=e.clone(),this.p2=i.clone(),this.op2=i.clone();var s=this.p1.getHeightMode(),a=this.p2.getHeightMode();"fix"==s&&"float"==a?this.p1=this.map.convert.convertPositionHeightMode(this.p1,"float",!0):"float"==s&&"fix"==a&&(this.p1=this.map.convert.convertPositionHeightMode(this.p1,"fix",!0));var n=this.p1.getViewMode(),o=this.p2.getViewMode();if("subj"==n&&"obj"==o?this.p2=this.map.convert.convertPositionViewMode(this.p2,"subj"):"obj"==n&&"subj"==o&&(this.p1=this.map.convert.convertPositionViewMode(this.p1,"subj")),this.p1.pos[5]=this.p1.pos[5]<0?360+this.p1.pos[5]%360:this.p1.pos[5]%360,this.p2.pos[5]=this.p2.pos[5]<0?360+this.p2.pos[5]%360:this.p2.pos[5]%360,this.pp1=this.p1.clone(),this.mode=r.mode||"auto",this.submode=r.submode||"none",this.submode="none",this.maxHeight=r.maxHeight||1e9,this.minDuration=r.minDuration||0,this.maxDuration=r.maxDuration||1e4,this.samplePeriod=r.samplePeriod||10,this.fade=r.fade||"none",this.fadePower=r.fadePower||1,this.yawInterpolation=r.yawInterpolation||"shortest",this.pv=r.pv||.15,this.map.getNavigationSrs().isProjected()||(this.geodesic=this.map.measure.getGeodesic()),r.distanceAzimuth)this.distanceAzimuth=!0,this.pp2=this.p1.clone(),r.destHeight&&this.pp2.setHeight(r.destHeight),r.destOrientation&&this.pp2.setHeight(r.destOrientation),r.destFov&&this.pp2.setHeight(r.destFov),this.geoAzimuth=r.azimuth||0,this.geoDistance=r.distance||100,this.distance=this.geoDistance,this.azimuth=this.geoAzimuth%360,this.azimuth=this.azimuth<0?360+this.azimuth:this.azimuth;else{this.distanceAzimuth=!1,this.pp2=this.p2.clone();var h=this.map.measure.getDistance(this.pp1.getCoords(),this.pp2.getCoords());this.distance=h[0],this.azimuth=(h[1]+90)%360,this.azimuth=this.azimuth<0?360+this.azimuth:this.azimuth,this.map.getNavigationSrs().isProjected()||(h=this.geodesic.Inverse(this.pp1.pos[2],this.pp1.pos[1],this.pp2.pos[2],this.pp2.pos[1]),this.geoAzimuth=h.azi1,this.geoDistance=h.s12,this.azimuth=this.geoAzimuth%360,this.azimuth=this.azimuth<0?360+this.azimuth:this.azimuth)}this.detectMode(),this.detectDuration(),this.detectFlightHeight(r.height)};a.prototype.detectFlightHeight=function(t){"ballistic"==this.mode&&(this.flightHeight=Math.max(this.pp1.getHeight(),this.pp2.getHeight()),this.flightHeight+=t||.5*this.distance,this.flightHeight=Math.min(this.flightHeight,this.maxHeight),this.flightHeight-=Math.max(this.pp1.getHeight(),this.pp2.getHeight()))},a.prototype.detectMode=function(){"auto"==this.mode&&(this.mode=this.distance>2e3?"ballistic":"direct")},a.prototype.detectDuration=function(){if(this.duration=0,this.headingDuration=1e3,this.distance<500?this.duration=1e3:this.distance<2e3?this.duration=2e3:(this.duration=this.distance/100,this.duration<300?this.duration=3e3:this.headingDuration=1500,this.duration<6e3&&(this.duration=6e3),this.duration>1e4&&(this.duration=1e4),"direct"!=this.mode&&(this.duration*=1.8,this.headingDuration*=1.8)),"direct"!=this.mode){var t=3*this.headingDuration;this.duration=Math.max(this.duration,t),this.maxDuration<t&&(this.duration=this.maxDuration,this.headingDuration=this.maxDuration/3)}this.duration=Math.min(this.duration,this.maxDuration),this.duration=Math.max(this.duration,this.minDuration)},a.prototype.generate=function(){for(var t=new Array(Math.ceil(this.duration/this.samplePeriod)+(this.distanceAzimuth?0:1)),e=0,i=0;i<=this.duration;i+=this.samplePeriod){var r,a,n=i/this.duration,o=this.pp1.clone();if("direct"==this.mode){switch(r=n,this.fade){case"in":switch(this.fadePower){case 1:n=r*r;break;case 2:n=r*r*r;break;case 3:n=r*r*r*r;break;case 4:n=r*r*r*r*r;break;case 5:n=r*r*r*r*r*r;break;case 6:n=r*r*r*r*r*r*r}break;case"out":switch(r=1-r,this.fadePower){case 1:n=1-r*r;break;case 2:n=1-r*r*r;break;case 3:n=1-r*r*r*r;break;case 4:n=1-r*r*r*r*r;break;case 5:n=1-r*r*r*r*r*r;break;case 6:n=1-r*r*r*r*r*r*r}break;case"inout":switch(this.fadePower){case 1:n=r*r*(3-2*r);break;case 2:n=r*r*r*(r*(6*r-15)+10);break;case 3:n=r*r*(3-2*r),r=n,n=r*r*(3-2*r);break;case 4:n=r*r*r*(r*(6*r-15)+10),r=n,n=r*r*r*(r*(6*r-15)+10);break;case 5:n=r*r*(3-2*r),r=n,n=r*r*(3-2*r),r=n,n=r*r*(3-2*r);break;case 6:n=r*r*r*(r*(6*r-15)+10),r=n,n=r*r*r*(r*(6*r-15)+10),r=n,n=r*r*r*(r*(6*r-15)+10)}}o.setCoords(this.getInterpolatedCoords(n)),o.setHeight(this.getInterpolatedHeight(n));var h=this.pp1.getOrientation(),l=this.pp2.getOrientation();o.setOrientation(this.getInterpolatedOrinetation(h,l,n)),o.setFov(this.getInterpolatedFov(n)),o.setViewExtent(this.getInterpolatedViewExtent(n)),t[e]=o.pos,e++}else{r=n,n=r*r*(3-2*r),r=n,n=r*r*(3-2*r);var u=this.getSmoothFactor(i);if("piha"==this.submode){var c=this.distance/this.duration*(i-this.duration/(2*Math.PI)*Math.sin(2*Math.PI/this.duration*i))/this.distance,d=this.pv,p=this.pp1.getCoords()[2],f=this.pp2.getCoords()[2],g=this.distance/(.001*this.duration*d*Math.tan(.5*s.radians(this.pp1.getFov())))*(1-Math.cos(2*Math.PI*i/this.duration))+p+(f-p)*i/this.duration;a=this.getInterpolatedCoords(c),o.setCoords(a),o.setHeight(g)}else a=this.getInterpolatedCoords(u),o.setCoords(a),o.setHeight(this.getSineHeight(n));null!=a[3]&&(this.azimuth=-a[3]),o.setOrientation(this.getFlightOrienation(i)),o.setFov(this.getInterpolatedFov(n)),o.setViewExtent(this.getInterpolatedViewExtent(n)),t[e]=o.pos,t[e]=o.pos,e++}}return this.distanceAzimuth||(t[e]=this.op2.clone().pos),t},a.prototype.getInterpolatedCoords=function(t){var e=this.pp1.getCoords(),i=this.pp2.getCoords();if(this.map.getNavigationSrs().isProjected())return[e[0]+(i[0]-e[0])*t,e[1]+(i[1]-e[1])*t,e[2]+(i[2]-e[2])*t];var r=this.geodesic.Direct(e[1],e[0],this.geoAzimuth,this.geoDistance*t),s=r.azi1-r.azi2;return s=this.azimuth<0?360+s:s,[r.lon2,r.lat2,e[2]+(i[2]-e[2])*t,s]},a.prototype.getInterpolatedOrinetation=function(t,e,i){var r=e[0]-t[0],s=e[1]-t[1],a=e[2]-t[2];return"shortest"==this.yawInterpolation&&Math.abs(r)>180&&(r=r>0?-(360-r):360-Math.abs(r)),[t[0]+r*i,t[1]+s*i,t[2]+a*i]},a.prototype.getInterpolatedFov=function(t){var e=this.pp1.getFov();return e+(this.pp2.getFov()-e)*t},a.prototype.getInterpolatedViewExtent=function(t){var e=this.pp1.getViewExtent();return e+(this.pp2.getViewExtent()-e)*t},a.prototype.getInterpolatedHeight=function(t){var e=this.pp1.getHeight();return e+(this.pp2.getHeight()-e)*t},a.prototype.getSineHeight=function(t){var e=this.pp1.getCoords(),i=this.pp2.getCoords();return e[2]+(i[2]-e[2])*t+Math.sin(Math.PI*t)*this.flightHeight},a.prototype.getSmoothFactor=function(t){var e=0;return e=t<this.headingDuration?0:t>this.duration-this.headingDuration?1:Math.min(1,(t-this.headingDuration)/(this.duration-2*this.headingDuration)),(e=e*e*(3-2*e))*e*(3-2*e)},a.prototype.getFlightOrienation=function(t){var e=null,i=null,r=[0,-90,0],s=0;return r[0]=this.azimuth%360,r[0]<0&&(r[0]=360-Math.abs(r[0])),t<=this.headingDuration?(s=t/this.headingDuration,e=this.pp1.getOrientation(),i=r):t>=this.duration-this.headingDuration?(s=(t-(this.duration-this.headingDuration))/this.headingDuration,e=r,i=this.pp2.getOrientation()):(s=0,e=r,i=r),this.getInterpolatedOrinetation(e,i,s)},e.a=a},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0__utils_utils__=__webpack_require__(4),__WEBPACK_IMPORTED_MODULE_1__utils_url__=__webpack_require__(11),utilsUrl=__WEBPACK_IMPORTED_MODULE_1__utils_url__.a,utils=__WEBPACK_IMPORTED_MODULE_0__utils_utils__.a,MapUrl=function(t,e){this.map=t,e=e.trim(),this.baseUrl=utilsUrl.getBase(e),this.baseUrlSchema=utilsUrl.getSchema(e),this.baseUrlOrigin=utilsUrl.getOrigin(e),this.urlCounter=0};MapUrl.prototype.quad=function(t,e,i){for(var r="",s=t;s>0;s--){var a=0,n=1<<s-1;0!=(e&n)&&(a+=1),0!=(i&n)&&(a+=2),r+=a}return r},MapUrl.prototype.msDigit=function(t,e){return((3&t)<<1)+(1&e)},MapUrl.prototype.hex=function(t){for(var e=t.toString(16);e.length<8;)e="0"+e;return e},MapUrl.prototype.ppx=function(t,e){return this.hex(e<<28-t,7)},MapUrl.prototype.ppy=function(t,e){return this.hex((1<<28)-(e+1<<28-t),7)},MapUrl.prototype.processUrlFunction=function(id,counter,string){var string2,fc;if("string"!=typeof string)return string;if(-1!=string.indexOf("quad")){string2="(function(lod,x,y,loclod,locx,locy){"+string.replace("quad","return this.quad")+"})";try{return(fc=eval(string2).bind(this))(id.lod,id.ix,id.iy,id.loclod,id.locx,id.locy)}catch(t){return string}}else if(-1!=string.indexOf("msdigit")){string2="(function(x,y,loclod,locx,locy){"+string.replace("msdigit","return this.msDigit")+"})";try{return(fc=eval(string2).bind(this))(id.ix,id.iy,id.loclod,id.locx,id.locy)}catch(t){return string}}else{if(-1!=string.indexOf("alt")){var result=/\(([^)]*)\)/.exec(string);if(result&&result[1]){var strings=result[1].match(/([^,]+)/g);if(strings.length>0)return strings[counter%strings.length]}return string}if(-1!=string.indexOf("ppx")){string2="(function(lod,x,loclod,locx){"+string.replace("ppx","return this.ppx")+"})";try{return(fc=eval(string2).bind(this))(id.lod,id.ix,id.loclod,id.locx)}catch(t){return string}}else{if(-1==string.indexOf("ppy"))return string;string2="(function(lod,y,loclod,locy){"+string.replace("ppy","return this.ppy")+"})";try{return(fc=eval(string2).bind(this))(id.lod,id.iy,id.loclod,id.locy)}catch(t){return string}}}},MapUrl.prototype.findLocalRoot=function(t){for(var e=this.map.referenceFrame.getSpatialDivisionNodes(),i=[],r=0,s=e.length;r<s;r++){var a=e[r],n=t[0]-a.id[0],o=t[1]>>n,h=t[2]>>n;o==a.id[1]&&h==a.id[2]&&i.push(a)}var l=null;for(r=0,s=i.length;r<s;r++)i[r].id[0]>-1&&(l=i[r]);return l?l.id.slice():[0,0,0]},MapUrl.prototype.makeUrl=function(t,e,i,r){var s=0,a=0,n=0;if(e.lod){var o=this.findLocalRoot([e.lod,e.ix,e.iy]);n=e.lod-o[0];var h=(1<<n)-1;s=e.ix&h,a=e.iy&h}var l={lod:e.lod,ix:e.ix,iy:e.iy,loclod:n,locx:s,locy:a};t=t.replace(/ /g,"");var u=utils.simpleFmtObjOrCall(t,{lod:e.lod,x:e.ix,y:e.iy,sub:i,locx:s,locy:a,loclod:n,geonavtile:i,hereappid:"abcde",hereappcode:"12345"},this.processUrlFunction.bind(this,l,this.urlCounter));return this.urlCounter++,r=-1!=u.indexOf("//"),r?0==u.indexOf("//")?this.baseUrlSchema+u:u:this.baseUrl+u},MapUrl.prototype.processUrl=function(t,e){return t?(t=t.trim(),-1!=t.indexOf("://")?t:0==t.indexOf("//")?this.baseUrlSchema+t:0==t.indexOf("/")?this.baseUrlOrigin+t:this.baseUrl+t):e},__webpack_exports__.a=MapUrl},function(t,e,i){"use strict";var r=i(4),s=i(5),a=s.a,n=r.a,o=function(t,e){this.map=t,this.id=null,this.metaUrl="",this.mappingUrl="",this.baseUrl=this.map.url.baseUrl,this.baseUrlSchema=this.map.url.baseUrlSchema,this.baseUrlOrigin=this.map.url.baseUrlOrigin,this.lodRange=[0,0],this.tileRange=[[0,0],[0,0]],this.surfaces=[],this.parseJson(e),this.virtual=!0,this.ready=!1};o.prototype.parseJson=function(t){if(this.id=t.id||null,this.metaUrl=this.processUrl(t.metaUrl,""),this.mappingUrl=this.processUrl(t.mapping,""),this.lodRange=t.lodRange||[0,0],this.tileRange=t.tileRange||[[0,0],[0,0]],this.strId=this.id?this.id.join(";"):null,this.id){var e=this.id.slice();e.sort(),this.strId=e.join(";")}if(t.extents){var i=t.extents.ll,r=t.extents.ur;this.extents=new a(i[0],i[1],i[2],r[0],r[1],r[2])}else this.extents=new a(0,0,0,1,1,1);this.specificity=Math.pow(2,this.lodRange[0])/((this.tileRange[1][0]-this.tileRange[1][0]+1)*(this.tileRange[1][1]-this.tileRange[1][1]+1)),n.loadBinary(this.mappingUrl,this.onMappingFileLoaded.bind(this),this.onMappingFileLoadError.bind(this),!!n.useCredentials&&-1!=this.jsonUrl.indexOf(this.map.url.baseUrl),this.map.core.xhrParams)},o.prototype.onMappingFileLoaded=function(t){this.parseMappingFile(new DataView(t)),this.ready=!0,this.map.refreshView()},o.prototype.onMappingFileLoadError=function(){},o.prototype.parseMappingFile=function(t){var e=0,i="";if(i+=String.fromCharCode(t.getUint8(e,!0)),e+=1,i+=String.fromCharCode(t.getUint8(e,!0)),e+=1,"TM"!=i)return!1;var r=t.getUint16(e,!0);e+=2;for(var s=0;s<r;s++){var a=t.getUint8(e,!0);e+=1;for(var n=[],o=0;o<a;o++){var h=t.getUint16(e,!0);e+=2,h=this.id[h],h&&n.push(h)}1==n.length?this.surfaces.push(this.map.getSurface(n[0])):this.surfaces.push(this.map.getGlue(n.join(";")))}return!0},o.prototype.getInfo=function(){return{metaUrl:this.metaUrl,mapping:this.mappingUrl,lodRange:this.lodRange,tileRange:this.tileRange}},o.prototype.processUrl=function(t,e){return t?(t=t.trim(),-1!=t.indexOf("://")?t:0==t.indexOf("//")?this.baseUrlSchema+t:0==t.indexOf("/")?this.baseUrlOrigin+t:this.baseUrl+t):e},o.prototype.hasTile=function(t){var e=t[0]-this.lodRange[0];if(e<0)return!1;var i=t[1]>>e,r=t[2]>>e;return!(t[0]<this.lodRange[0]||t[0]>this.lodRange[1]||i<this.tileRange[0][0]||i>this.tileRange[1][0]||r<this.tileRange[0][1]||r>this.tileRange[1][1])},o.prototype.hasTile2=function(t){var e=t[0]-this.lodRange[0],i=e<0;if(t[0]<this.lodRange[0]){e=-e;var r=this.tileRange[0][0]>>e,s=this.tileRange[0][1]>>e,a=this.tileRange[1][0]>>e,n=this.tileRange[1][1]>>e;if(t[0]>this.lodRange[1]||t[1]<r||t[1]>a||t[2]<s||t[2]>n)return[!1,!1]}else{var o=t[1]>>e,h=t[2]>>e;if(t[0]>this.lodRange[1]||o<this.tileRange[0][0]||o>this.tileRange[1][0]||h<this.tileRange[0][1]||h>this.tileRange[1][1])return[!1,!1]}return[!0,i]},o.prototype.hasMetatile=function(t){if(t[0]>this.lodRange[1])return!1;var e=t[0]-this.lodRange[0];if(e>=0){var i=t[1]>>e,r=t[2]>>e;if(i<this.tileRange[0][0]||i>this.tileRange[1][0]||r<this.tileRange[0][1]||r>this.tileRange[1][1])return!1}else if(e=-e,t[1]<this.tileRange[0][0]>>e||t[1]>this.tileRange[1][0]>>e||t[2]<this.tileRange[0][1]>>e||t[2]>this.tileRange[1][1]>>e)return!1;return!0},o.prototype.getSurface=function(t){return this.surfaces[t-1]},o.prototype.getMetaUrl=function(t,e){return this.map.url.makeUrl(this.metaUrl,{lod:t[0],ix:t[1],iy:t[2]},null,e)},e.a=o},function(t,e,i){"use strict";var r=i(2),s=i(3),a=r.b,n=r.c,o=r.e,h=s.a,l=function(t,e,i,r){this.parent=t,this.position=[0,0,0],this.orientation=[0,0,0],this.aspect=1,this.fov=e,this.near=i,this.far=r,this.rotationByMatrix=!1,this.modelview=o.create(),this.rotationview=o.create(),this.projection=o.create(),this.projection2=o.create(),this.mvp=o.create(),this.mvp2=o.create(),this.frustumPlanes=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],this.bboxPoints=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.scaleFactorVec=[0,0,0,0],this.dirty=!0};l.prototype.setPosition=function(t){this.position=t,this.dirty=!0},l.prototype.setOrientation=function(t){this.rotationByMatrix=!1,this.orientation=t,this.dirty=!0},l.prototype.setRotationMatrix=function(t){this.rotationByMatrix=!0,this.rotationview=t.slice(),this.dirty=!0},l.prototype.setAspect=function(t){this.aspect=t,this.dirty=!0},l.prototype.setViewHeight=function(t){this.viewHeight=t,this.dirty=!0},l.prototype.setOrtho=function(t){this.ortho=t,this.dirty=!0},l.prototype.setParams=function(t,e,i){this.fov=t,this.near=e,this.far=i,this.dirty=!0},l.prototype.clone=function(t){var e=new l(this.parent,null!=t?t:this.getFov(),this.getNear(),this.getFar());return e.setPosition(this.getPosition()),e.setOrientation(this.getOrientation()),e.setAspect(this.getAspect()),e.update(),e},l.prototype.getPosition=function(){return[this.position[0],this.position[1],this.position[2]]},l.prototype.getOrientation=function(){return[this.orientation[0],this.orientation[1],this.orientation[2]]},l.prototype.getAspect=function(){return this.aspect},l.prototype.getFov=function(){return this.fov},l.prototype.getNear=function(){return this.near},l.prototype.getFar=function(){return this.far},l.prototype.getViewHeight=function(){return this.viewHeight},l.prototype.getOrtho=function(){return this.ortho},l.prototype.getRotationviewMatrix=function(){return this.dirty&&this.update(),this.rotationview},l.prototype.getModelviewMatrix=function(){return this.dirty&&this.update(),this.modelview},l.prototype.getProjectionMatrix=function(){return this.dirty&&this.update(),this.projection},l.prototype.getMvpMatrix=function(){return this.dirty&&this.update(),this.mvp},l.prototype.scaleFactor=function(t,e){this.dirty&&this.update(),o.multiplyVec3(this.modelview,t,this.scaleFactorVec);var i=a.length(this.scaleFactorVec);return e?i<this.near?[Number.POSITIVE_INFINITY,i]:[this.projection[0]/i,i]:i<this.near?Number.POSITIVE_INFINITY:this.projection[0]/i},l.prototype.scaleFactor2=function(t){return this.dirty&&this.update(),t<this.near?Number.POSITIVE_INFINITY:this.projection[0]/t},l.prototype.distance=function(t){var e=a.create();return a.subtract(this.position,t,e),a.length(e)},l.prototype.pointVisible=function(t,e){this.dirty&&this.update();var i;i=e?[t[0]-e[0],t[1]-e[1],t[2]-e[2],1]:[t[0],t[1],t[2],1];for(var r=0;r<6;r++)if(n.dot(this.frustumPlanes[r],i)<0)return!1;return!0},l.prototype.pointsVisible=function(t,e){this.dirty&&this.update();var i,r,s,a=this.frustumPlanes,o=t.length;e?(i=e[0],r=e[1],s=e[2]):(i=0,r=0,s=0);for(var h=n.dot3,l=0;l<6;l++){for(var u=!0,c=a[l],d=0;d<o;d+=3)if(h(c,t,d,i,r,s)>=0){u=!1;break}if(u)return!1}return!0},l.prototype.bboxVisible=function(t,e){this.dirty&&this.update();var i,r,s,a,o,h,l,u=t.min,c=t.max,d=this.bboxPoints;e?(r=u[0]-e[0],s=u[1]-e[1],a=u[2]-e[2],o=c[0]-e[0],h=c[1]-e[1],l=c[2]-e[2]):(r=u[0],s=u[1],a=u[2],o=c[0],h=c[1],l=c[2]),i=d[0],i[0]=r,i[1]=s,i[2]=a,i=d[1],i[0]=r,i[1]=s,i[2]=l,i=d[2],i[0]=r,i[1]=h,i[2]=a,i=d[3],i[0]=r,i[1]=h,i[2]=l,i=d[4],i[0]=o,i[1]=s,i[2]=a,i=d[5],i[0]=o,i[1]=s,i[2]=l,i=d[6],i[0]=o,i[1]=h,i[2]=a,i=d[7],i[0]=o,i[1]=h,i[2]=l;for(var p=n.dot2,f=this.frustumPlanes,g=0;g<6;g++){for(var m=!0,v=f[g],y=0;y<8;y++)if(p(v,d[y])>=0){m=!1;break}if(m)return!1}return!0},l.prototype.update=function(t){this.rotationByMatrix||(o.multiply(h.rotationMatrix(2,h.radians(-this.orientation[2])),h.rotationMatrix(0,h.radians(-this.orientation[1]-90)),this.rotationview),o.multiply(this.rotationview,h.rotationMatrix(2,h.radians(-this.orientation[0])),this.rotationview)),o.multiply(this.rotationview,h.translationMatrix(-this.position[0],-this.position[1],-this.position[2]),this.modelview),this.ortho?this.projection=h.orthographicMatrix(this.viewHeight,this.aspect,this.near,this.far):this.projection=h.perspectiveMatrix(this.fov,this.aspect,this.near,this.far),o.multiply(this.projection,this.modelview,this.mvp),this.frustumPlanes[0]=[0,0,1,1],this.frustumPlanes[1]=[0,0,-1,1],this.frustumPlanes[2]=[1,0,0,1],this.frustumPlanes[3]=[-1,0,0,1],this.frustumPlanes[4]=[0,1,0,1],this.frustumPlanes[5]=[0,-1,0,1];var e=o.create();o.transpose(this.mvp,e);for(var i=0;i<6;i++)this.frustumPlanes[i]=o.multiplyVec4(e,this.frustumPlanes[i]);this.dirty=!1},e.a=l},function(t,e,i){"use strict";var r=i(2),s=i(3),a=r.b,n=r.d,o=r.e,h=s.a,l=function(t){this.renderer=t,this.core=t.core,this.gpu=t.gpu,this.gl=t.gpu.gl,this.rmap=t.rmap};l.prototype.drawSkydome=function(t,e){if(t){var i=this.gpu,r=this.gl,s=this.renderer,a=o.create();o.multiply(h.scaleMatrix(2,2,2),h.translationMatrix(-.5,-.5,-.5),a);var n=o.create(),l=s.camera.getPosition();o.multiply(h.translationMatrix(l[0],l[1],l[2]-400),h.scaleMatrixf(Math.min(.9*s.camera.getFar(),6e5)),n);var u=o.create();o.multiply(s.camera.getMvpMatrix(),n,u),o.multiply(u,a,u),i.useProgram(e,["aPosition","aTexCoord"]),i.bindTexture(t),e.setSampler("uSampler",0),e.setMat4("uMVP",u),r.depthMask(!1),s.skydomeMesh.draw(e,"aPosition","aTexCoord"),r.depthMask(!0),r.enable(r.CULL_FACE),s.renderedPolygons+=s.skydomeMesh.getPolygons()}},l.prototype.drawTBall=function(t,e,i,r,s,a){var n=this.gpu,l=this.gl,u=this.renderer;a&&l.disable(l.CULL_FACE);var c=o.create();o.multiply(h.scaleMatrix(2,2,2),h.translationMatrix(-.5,-.5,-.5),c);var d=[t[0],t[1],t[2]];e=null!=e?e:1.5;var p=o.create();o.multiply(h.translationMatrix(d[0],d[1],d[2]),h.scaleMatrix(e,e,s||e),p);var f=o.create();o.multiply(u.camera.getMvpMatrix(),p,f),o.multiply(f,c,f),n.useProgram(i,["aPosition","aTexCoord"]),n.bindTexture(r||u.redTexture),i.setSampler("uSampler",0),i.setMat4("uMVP",f),u.skydomeMesh.draw(i,"aPosition","aTexCoord"),u.renderedPolygons+=u.skydomeMesh.getPolygons(),a&&l.enable(l.CULL_FACE)},l.prototype.drawBall=function(t,e,i,r,s,a,l,u,c,d){var p=this.gpu,f=this.gl,g=this.renderer,m=o.create();o.multiply(h.scaleMatrix(2,2,2),h.translationMatrix(-.5,-.5,-.5),m);var v=[t[0],t[1],t[2]],y=o.create();e=e||1.5,i=i||1.5,o.multiply(h.translationMatrix(v[0],v[1],v[2]),h.scaleMatrix(e,e,i),y);var b=o.create();o.multiply(g.camera.getModelviewMatrix(),y,b),o.multiply(b,m,b);var x=g.camera.getProjectionMatrix(),M=[0,0,0,0,0,0,0,0,0];o.toInverseMat3(b,M),n.transpose(M),p.useProgram(r,["aPosition"]),p.bindTexture(g.redTexture),r.setSampler("uSampler",0),r.setMat4("uProj",x),r.setMat4("uMV",b),d&&(r.setMat3("uNorm",M),f.cullFace(f.FRONT)),s&&r.setVec4("uParams",s),a&&r.setVec4("uParams2",a),a&&r.setVec4("uParams3",l),u&&r.setVec4("uFogColor",u),c&&r.setVec4("uFogColor2",c),g.atmoMesh.draw(r,"aPosition",null),g.renderedPolygons+=g.skydomeMesh.getPolygons(),d&&f.cullFace(f.BACK)},l.prototype.drawBall2=function(t,e,i,r,s,a){var l=this.gpu,u=this.renderer,c=o.create();o.multiply(h.scaleMatrix(2,2,2),h.translationMatrix(-.5,-.5,-.5),c);var d=[t[0],t[1],t[2]],p=o.create();o.multiply(h.translationMatrix(d[0],d[1],d[2]),h.scaleMatrixf(null!=e?e:1.5),p);var f=o.create();o.multiply(u.camera.getModelviewMatrix(),p,f),o.multiply(f,c,f);var g=u.camera.getProjectionMatrix(),m=[0,0,0,0,0,0,0,0,0];o.toInverseMat3(f,m),n.transpose(m),l.useProgram(i,["aPosition"]),l.bindTexture(u.redTexture),i.setSampler("uSampler",0),i.setMat4("uProj",g),i.setMat4("uMV",f),i.setMat3("uNorm",m),i.setFloat("uNFactor",r),i.setVec3("uCenter",t),i.setVec2("uRadius",[e,a]),u.atmoMesh.draw(i,"aPosition",null),u.renderedPolygons+=u.skydomeMesh.getPolygons()},l.prototype.drawLineString=function(t,e,i,r,s,a,n,h,l){var u,c,d=this.gpu,p=this.gl,f=this.renderer,g=0,m=t.length;if(m>32)for(c=0;c<m;c+=31)u=t.slice(c,c+32),this.drawLineString(u,e,i,r,s,a,n,h,l);else{var v=f.plineBuffer;if(e)for(c=0;c<m;c++)u=t[c],v[g]=u[0],v[g+1]=u[1],v[g+2]=u[2]||0,g+=3;else{var y=f.camera.getMvpMatrix(),b=f.curSize,x=f.cameraPosition;for(c=0;c<m;c++)u=t[c],u=o.multiplyVec4(y,[point[0]-x[0],point[1]-x[1],point[2]-x[2],1]),0!=u[3]?(v[g]=.5*(u[0]/u[3]+1)*b[0],v[g+1]=.5*(-u[1]/u[3]+1)*b[1],v[g+2]=u[2]/u[3]):(v[g]=0,v[g+1]=0,v[g+2]=0),g+=3}!0!==l&&(!0!==a&&p.disable(p.DEPTH_TEST),n&&(p.blendEquationSeparate(p.FUNC_ADD,p.FUNC_ADD),p.blendFuncSeparate(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA,p.ONE,p.ONE_MINUS_SRC_ALPHA),p.enable(p.BLEND)),!1===h&&p.depthMask(!1),p.disable(p.CULL_FACE));var M=f.progLine4;d.useProgram(M,["aPosition"]),M.setMat4("uMVP",f.imageProjectionMatrix,s?f.getZoffsetFactor(s):null),M.setVec3("uScale",[2/f.curSize[0],2/f.curSize[1],.5*i]),M.setVec4("uColor",null!=r?r:[255,255,255,255]),M.setVec3("uPoints",v),f.plines.draw(M,"aPosition",m),!0!==l&&(!0!==a&&p.enable(p.DEPTH_TEST),n&&p.disable(p.BLEND),!1===h&&p.depthMask(!0),p.enable(p.CULL_FACE))}},l.prototype.drawImage=function(t,e,i,r,s,a,n,o,h,l,u,c){var d=this.gpu,p=this.gl,f=this.renderer;if(null!=s&&null!=f.imageProjectionMatrix){!0!==c&&(!0!==h&&p.disable(p.DEPTH_TEST),l&&(p.blendEquationSeparate(p.FUNC_ADD,p.FUNC_ADD),p.blendFuncSeparate(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA,p.ONE,p.ONE_MINUS_SRC_ALPHA),p.enable(p.BLEND)),!1===u&&p.depthMask(!1),p.disable(p.CULL_FACE));var g=f.progImage;d.useProgram(g,["aPosition"]),d.bindTexture(s);var m=f.rectVerticesBuffer;p.bindBuffer(p.ARRAY_BUFFER,m),p.vertexAttribPointer(g.getAttribute("aPosition"),m.itemSize,p.FLOAT,!1,0,0);var v=f.rectIndicesBuffer;p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,v),g.setMat4("uProjectionMatrix",f.imageProjectionMatrix),g.setMat4("uData",[t,e,0,0,t+i,e,1,0,t+i,e+r,1,1,t,e+r,0,1]),o&&(n*=1+2*f.getZoffsetFactor(o)),g.setVec4("uColor",null!=a?a:[1,1,1,1]),g.setFloat("uDepth",n),p.drawElements(p.TRIANGLES,v.numItems,p.UNSIGNED_SHORT,0),!0!==c&&(!1===u&&p.depthMask(!0),!0!==h&&p.enable(p.DEPTH_TEST),l&&p.disable(p.BLEND),p.enable(p.CULL_FACE))}},l.prototype.drawBillboard=function(t,e,i,r,s,a,n,o){var h=this.gpu,l=this.gl,u=this.renderer;!0!==o&&(!0!==s&&l.disable(l.DEPTH_TEST),a&&(l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA),l.enable(l.BLEND)),!1===n&&l.depthMask(!1),l.disable(l.CULL_FACE));var c=u.progImage;h.useProgram(c,["aPosition","aTexCoord"]),h.bindTexture(e),c.setSampler("uSampler",0);var d=u.rectVerticesBuffer;l.bindBuffer(l.ARRAY_BUFFER,d),l.vertexAttribPointer(c.getAttribute("aPosition"),d.itemSize,l.FLOAT,!1,0,0);var p=u.rectIndicesBuffer;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,p),c.setMat4("uProjectionMatrix",t,r?u.getZoffsetFactor(r):null);c.setMat4("uData",[0,0,0,0,1,0,1,0,1,1,1,1,0,1,0,1]),c.setVec4("uColor",null!=i?i:[1,1,1,1]),c.setFloat("uDepth",0),l.drawElements(l.TRIANGLES,p.numItems,l.UNSIGNED_SHORT,0),!0!==o&&(!1===n&&l.depthMask(!0),!0!==s&&l.enable(l.DEPTH_TEST),a&&l.disable(l.BLEND),l.enable(l.CULL_FACE))},l.prototype.drawFlatImage=function(t,e,i,r,s,a,n,o){var h=this.gpu,l=this.gl,u=this.renderer;if(null!=s&&null!=u.imageProjectionMatrix){var c=u.progImage;h.useProgram(c,["aPosition"]),h.bindTexture(s);var d=u.rectVerticesBuffer;l.bindBuffer(l.ARRAY_BUFFER,d),l.vertexAttribPointer(c.getAttribute("aPosition"),d.itemSize,l.FLOAT,!1,0,0);var p=u.rectIndicesBuffer;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,p),c.setMat4("uProjectionMatrix",u.imageProjectionMatrix),c.setMat4("uData",[t,e,0,0,t+i,e,1,0,t+i,e+r,1,1,t,e+r,0,1]),c.setVec4("uColor",null!=a?a:[1,1,1,1]),c.setFloat("uDepth",null!=n?n:0),l.drawElements(l.TRIANGLES,p.numItems,l.UNSIGNED_SHORT,0)}},l.prototype.drawText=function(t,e,i,r,s,a,n){var o=this.gpu,h=this.gl,l=this.renderer;if(null!=l.imageProjectionMatrix){!0!==n&&(h.disable(h.CULL_FACE),null==a?h.disable(h.DEPTH_TEST):(h.depthFunc(h.LEQUAL),h.enable(h.DEPTH_TEST)));var u=l.progImage;o.useProgram(u,["aPosition"]),o.bindTexture(l.textTexture2);var c=l.rectVerticesBuffer;h.bindBuffer(h.ARRAY_BUFFER,c),h.vertexAttribPointer(u.getAttribute("aPosition"),c.itemSize,h.FLOAT,!1,0,0);var d=l.rectIndicesBuffer;h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,d),u.setMat4("uProjectionMatrix",l.imageProjectionMatrix),u.setVec4("uColor",s),u.setFloat("uDepth",null!=a?a:0);var p=i-1,f=i,g=Math.round(.5*i),m=this.getTextSize(i,r)+2,v=0,y=(15&v)<<4,b=v>>4<<4;u.setMat4("uData",[t-2,e-2,y*(1/256),b*(1/128),t-2+m,e-2,(y+15)*(1/256),b*(1/128),t-2+m,e+f+1,(y+15)*(1/256),(b+15)*(1/128),t-2,e+f+1,y*(1/256),(b+15)*(1/128)]),h.drawElements(h.TRIANGLES,d.numItems,h.UNSIGNED_SHORT,0);for(var x=0,M=r.length;x<M;x++){switch(v=r.charCodeAt(x)-32,y=(15&v)<<4,b=v>>4<<4,v){case 12:case 14:case 27:case 28:case 64:case 73:case 76:case 84:u.setMat4("uData",[t,e,y*(1/256),b*(1/128),t+g,e,(y+8)*(1/256),b*(1/128),t+g,e+f,(y+8)*(1/256),(b+16)*(1/128),t,e+f,y*(1/256),(b+16)*(1/128)]),t+=g;break;default:u.setMat4("uData",[t,e,y*(1/256),b*(1/128),t+p,e,(y+15)*(1/256),b*(1/128),t+p,e+f,(y+15)*(1/256),(b+16)*(1/128),t,e+f,y*(1/256),(b+16)*(1/128)]),t+=p}h.drawElements(h.TRIANGLES,d.numItems,h.UNSIGNED_SHORT,0)}!0!==n&&(h.enable(h.CULL_FACE),null==a&&h.enable(h.DEPTH_TEST))}},l.prototype.getTextSize=function(t,e){for(var i=t-1,r=Math.round(.5*t),s=0,a=0,n=e.length;a<n;a++){switch(e.charCodeAt(a)-32){case 12:case 14:case 27:case 28:case 64:case 73:case 76:case 84:s+=r;break;default:s+=i}}return s},l.prototype.drawGpuJobs=function(){var t=this.gpu,e=this.gl,i=this.renderer;i.geoRenderCounter++,e.stencilMask(255),e.clear(e.STENCIL_BUFFER_BIT),e.stencilFunc(e.EQUAL,0,255),e.stencilOp(e.KEEP,e.KEEP,e.INCR);var r,s,a=[1/i.curSize[0],1/i.curSize[1]],n=this.rmap,l=513,u=0,c=i.clearStencilPasses,d=i.jobZBuffer,p=i.jobZBufferSize,f=i.jobZBuffer2,g=i.jobZBuffer2Size,m=i.onlyHitLayers,v=i.onlyAdvancedHitLayers,y=i.geoRenderCounter;c.length>0&&(l=c[0],u++),this.rmap.counter!=this.renderer.geoRenderCounter&&this.rmap.clear();var b=!1;i.jobHBuffer={};for(var x=i.frameTime,M=0,w=d.length;M<w;M++){var S,A=p[M],C=(g[M],d[M]),T=f[M];if(A>0&&M>=l&&(e.clear(e.STENCIL_BUFFER_BIT),c.length>u?(l=c[u],u++):l=513),m)if(v)for(S=0;S<A;S++)C[S].advancedHit&&this.drawGpuJob(t,e,i,C[S],a,!0);else for(S=0;S<A;S++){var r=C[S];r.hitable&&(this.drawGpuJob(t,e,i,r,a),r.advancedHit&&(i.advancedPassNeeded=!0))}else for(S=0;S<A;S++)if(r=C[S],this.drawGpuJob(t,e,i,r,a),r.hysteresis&&r.id){var P=T[r.id];P||(r.timerShow=0,r.timerHide=0,r.draw=!1,T[r.id]=r,g[M]++,b=!0)}if(n.rectanglesCount>0&&n.processRectangles(t,e,i,a),g[M]){var E=i.jobHBuffer;for(s in T)if(r=E[s],r?(r.draw||(r.timerShow+=x,r.timerShow>r.hysteresis[0]?(r.draw=!0,r.timerShow=0):b=!0),r.timerHide=0):(r=T[s],r.draw&&(r.timerHide+=x,r.timerHide>r.hysteresis[1]?(delete T[s],g[M]--,r.draw=!1,r.timerHide=0):b=!0),r.timerShow=0),r.draw){if(r.renderCounter[0][0]!==y&&null!==r.renderCounter[0][0]){var L=r.renderCounter[0],k=o.create(),I=o.create(),N=L[3],F=N.bbox,B=i.cameraPosition,R=h.translationMatrix(F.min[0]-B[0],F.min[1]-B[1],F.min[2]-B[2]);o.multiply(i.camera.getModelviewMatrix(),R,I);var _=i.camera.getProjectionMatrix();o.multiply(_,I,k),r.mv=I,r.mvp=k}this.drawGpuSubJob(t,e,i,a,r.lastSubJob)}}}b&&this.core.markDirty()},l.prototype.clearJobBuffer=function(){for(var t=this.renderer,e=t.jobZBuffer,i=t.jobZBufferSize,r=0,s=e.length;r<s;r++){for(var a=i[r],n=e[r],o=0;o<a;o++)n[o]=null;i[r]=0}},l.prototype.paintGL=function(){var t=this.renderer;this.gpu.clear(!0,!1),t.onlyLayers||t.onlyDepth||t.onlyHitLayers||this.drawSkydome()},l.prototype.drawGpuJob=function(t,e,i,r,s,n,o){if(r.ready){var l=255&r.state,u=r.eventInfo["#id"];if(null!=u){if(512&r.state){if(-1!=i.geodataSelection.indexOf(u)){if(768&r.state)if(i.hoverFeature&&i.hoverFeature[0]["#id"]==u){if(3!=l)return}else if(2!=l)return}else if(256&r.state){if(i.hoverFeature&&i.hoverFeature[0]["#id"]==u){if(1!=l)return}else if(0!=l)return}else if(0!=l)return}else if(256&r.state){if(i.hoverFeature&&i.hoverFeature[0]["#id"]==u){if(1!=l)return}else if(0!=l)return}else if(0!=l)return}else if(0!=l)return;var c,d,p,f,g,m,v,y,b=r.mvp,x=r.hitable&&i.onlyHitLayers,M=r.color;if(x){var w=i.hoverFeatureCounter;M=[(255&w)/255,(w>>8&255)/255,0,0],i.hoverFeatureList[w]=[r.eventInfo,r.center,r.clickEvent,r.hoverEvent,r.enterEvent,r.leaveEvent,n],i.hoverFeatureCounter++}switch(r.type){case 1:t.setState(x?i.stencilLineHitState:i.stencilLineState);var S=0===t;if(c=n?r.program2:S?i.progLineWireframe:r.program,t.useProgram(c,n?["aPosition","aElement"]:S?["aPosition","aBarycentric"]:["aPosition"]),c.setVec4("uColor",M),c.setMat4("uMVP",b,i.getZoffsetFactor(r.zbufferOffset)),p=c.getAttribute("aPosition"),e.bindBuffer(e.ARRAY_BUFFER,r.vertexPositionBuffer),e.vertexAttribPointer(p,r.vertexPositionBuffer.itemSize,e.FLOAT,!1,0,0),n&&(v=c.getAttribute("aElement"),e.bindBuffer(e.ARRAY_BUFFER,r.vertexElementBuffer),e.vertexAttribPointer(v,r.vertexElementBuffer.itemSize,e.FLOAT,!1,0,0)),S){var A=c.getAttribute("aBarycentric");e.bindBuffer(e.ARRAY_BUFFER,t.barycentricBuffer),e.vertexAttribPointer(A,t.barycentricBuffer.itemSize,e.FLOAT,!1,0,0)}e.drawArrays(e.TRIANGLES,0,r.vertexPositionBuffer.numItems);break;case 2:case 3:case 4:case 5:t.setState(x?i.stencilLineHitState:i.stencilLineState),c=n?r.program2:r.program,d=null;var C=[0,0,0,0];if(y=s,x&&5==r.type&&(r.widthByRatio&&(y=[s[0]*i.curSize[1],s[1]*i.curSize[1]]),c=n?this.renderer.progELine3:this.renderer.progLine3,!c.isReady()))return;if(4!=r.type)if(2==r.type)C=[0,0,0,r.widthByRatio?i.cameraViewExtent:1];else{if(x)d=i.whiteTexture,3!=r.type&&2!=r.type||(C=[0,0,0,r.widthByRatio?i.cameraViewExtent:1]);else{var T=r.texture;if(null==T||null==T[0])return;d=T[0],C=[0,T[1]/T[0].height,(T[1]+T[2])/T[0].height,r.widthByRatio?i.cameraViewExtent:1],3==r.type||2==r.type?r.widthByRatio?C[0]=1/(i.cameraViewExtent2*r.lineWidth)/(d.width/T[2]):C[0]=1/r.lineWidth/(d.width/T[2]):r.widthByRatio?(C[0]=1/(i.cameraViewExtent2/i.curSize[1])/(d.width/T[2]),C[0]/=i.curSize[1]*r.lineWidth*.5,C[3]=i.curSize[1]):(C[0]=1/(i.cameraViewExtent2/i.curSize[1])/(d.width/T[2]),C[0]/=.5*r.lineWidth,C[3]=1)}if(!d.loaded)return;t.bindTexture(d)}else r.widthByRatio&&(y=[s[0]*i.curSize[1],s[1]*i.curSize[1]]);t.useProgram(c,n?["aPosition","aNormal","aElement"]:["aPosition","aNormal"]),c.setVec4("uColor",M),c.setVec2("uScale",y),c.setMat4("uMVP",b,i.getZoffsetFactor(r.zbufferOffset)),4!=r.type&&(null!=r.background&&c.setVec4("uColor2",x?[0,0,0,0]:r.background),c.setVec4("uParams",C),c.setSampler("uSampler",0)),p=c.getAttribute("aPosition"),g=c.getAttribute("aNormal"),e.bindBuffer(e.ARRAY_BUFFER,r.vertexPositionBuffer),e.vertexAttribPointer(p,r.vertexPositionBuffer.itemSize,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,r.vertexNormalBuffer),e.vertexAttribPointer(g,r.vertexNormalBuffer.itemSize,e.FLOAT,!1,0,0),n&&(v=c.getAttribute("aElement"),e.bindBuffer(e.ARRAY_BUFFER,r.vertexElementBuffer),e.vertexAttribPointer(v,r.vertexElementBuffer.itemSize,e.FLOAT,!1,0,0)),e.drawArrays(e.TRIANGLES,0,r.vertexPositionBuffer.numItems);break;case 6:t.setState(x?i.lineLabelHitState:i.lineLabelState);var P=r.files;if(P.length>0){for(var E=0,L=P.length;E<L;E++)if(P[E].length>0){var k=r.fonts[E];if(k&&!k.areTexturesReady(P[E]))return}}else{if(!x)return;d=i.whiteTexture}c=r.program,t.useProgram(c,["aPosition","aTexCoord"]),c.setSampler("uSampler",0),c.setMat4("uMVP",b,i.getZoffsetFactor(r.zbufferOffset)),c.setVec4("uVec",i.labelVector);var I=1.4142*r.outline[2]/20,N=1.4142*r.outline[3]/20;c.setVec4("uColor",x?M:r.color2),c.setVec2("uParams",[r.outline[0],N]),p=c.getAttribute("aPosition"),f=c.getAttribute("aTexCoord"),e.bindBuffer(e.ARRAY_BUFFER,r.vertexPositionBuffer),e.vertexAttribPointer(p,r.vertexPositionBuffer.itemSize,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,r.vertexTexcoordBuffer),e.vertexAttribPointer(f,r.vertexTexcoordBuffer.itemSize,e.FLOAT,!1,0,0);for(var F=0;F<(x?1:2);F++)if(1==F&&(c.setVec4("uColor",M),c.setVec2("uParams",[r.outline[1],I])),P.length>0)for(var E=0,L=P.length;E<L;E++)for(var B=P[E],R=0,_=B.length;R<_;R++){var D=B[R];c.setFloat("uFile",Math.round(D+1e3*E)),t.bindTexture(r.fonts[E].getTexture(D)),e.drawArrays(e.TRIANGLES,0,r.vertexPositionBuffer.numItems)}else t.bindTexture(d),e.drawArrays(e.TRIANGLES,0,r.vertexPositionBuffer.numItems);break;case 7:case 8:if(r.reduce){var U;if(r.reduce[0]>4){if(4==r.reduce[0]){if(U=Math.max(r.reduce[1],Math.floor(r.reduce[2]/Math.max(1,i.drawnGeodataTiles))),r.index>=U)return}else if(U=Math.pow(r.texelSize*r.tiltAngle,.5),U=Math.max(r.reduce[1],Math.round(r.reduce[2]*(U/Math.max(1e-5,this.renderer.drawnGeodataTilesFactor)))),r.index>=U)return}else{U=r.tiltAngle,1==r.reduce[0]?U=1-Math.acos(U)*(1/(.5*Math.PI)):3==r.reduce[0]&&(U=.5*(Math.cos(2*Math.acos(U))+1));var z=Math.round(r.reduce[1]+U*r.reduce[2])-1;if(r.index>z)return}}var P=r.files;if(P.length>0){for(var E=0,L=P.length;E<L;E++)if(P[E].length>0){var k=r.fonts[E];if(k&&!k.areTexturesReady(P[E]))return}}else if(d=x?i.whiteTexture:r.texture,!d.loaded)return;var G,V,O,j,H=null;if(o||180==r.culling){if(!o&&r.visibility)switch(V=r.center,G=i.cameraPosition,O=[V[0]-G[0],V[1]-G[1],V[2]-G[2]],H=a.length(O),r.visibility.length){case 1:if(H>r.visibility[0])return;break;case 2:if((H*=i.localViewExtentFactor)<r.visibility[0]||H>r.visibility[1])return;break;case 4:H*=i.localViewExtentFactor;var q=r.visibility[0]*r.visibility[1];if(q<r.visibility[2]*H||q>r.visibility[3]*H)return}}else{if(V=r.center,G=i.cameraPosition,O=[V[0]-G[0],V[1]-G[1],V[2]-G[2]],r.visibility){switch(H=a.length(O),r.visibility.length){case 1:if(H>r.visibility[0])return;break;case 2:if((j=H*i.localViewExtentFactor)<r.visibility[0]||j>r.visibility[1])return;break;case 4:j=H*i.localViewExtentFactor;var q=r.visibility[0]*r.visibility[1];if(q<r.visibility[2]*j||q>r.visibility[3]*j)return}H=1/H,O[0]*=H,O[1]*=H,O[2]*=H}else a.normalize(O);r.normal=[0,0,0],a.normalize(r.center,r.normal);var U=-a.dot(O,r.normal);if(U<Math.cos(h.radians(r.culling)))return}var J,Z,Y,W=r.stick,X=0;if(0!=W[0]&&(X=i.cameraTiltFator*W[0],X<W[1]?X=0:0!=W[2]&&(J=i.project2(r.center,i.camera.mvp,i.cameraPosition),J[0]=Math.round(J[0]),J[1]-=X)),!o&&r.noOverlap){if(J||(J=i.project2(r.center,i.camera.mvp,i.cameraPosition)),Z=r.noOverlap,Y=J[2],Y<0||Y>1)return;return null!==Z[4]&&(0===Z[4]?Y=Z[5]:(null===H&&(V=r.center,G=i.cameraPosition,O=[V[0]-G[0],V[1]-G[1],V[2]-G[2]],H=a.length(O)+1e-4),Y=Z[5]/H)),r.lastSubJob=[r,X,d,P,M,J],void i.rmap.addRectangle(J[0]+Z[0],J[1]+Z[1],J[0]+Z[2],J[1]+Z[3],Y,r.lastSubJob)}if(r.hysteresis&&r.id)return J||(J=i.project2(r.center,i.camera.mvp,i.cameraPosition)),r.lastSubJob=[r,X,d,P,M,J],void(i.jobHBuffer[r.id]=r);i.drawLabelBoxes&&(J||(J=i.project2(r.center,i.camera.mvp,i.cameraPosition)),Z=r.noOverlap,t.setState(x?i.lineLabelHitState:i.lineLabelState),this.drawLineString([[J[0]+Z[0],J[1]+Z[1],.5],[J[0]+Z[2],J[1]+Z[1],.5],[J[0]+Z[2],J[1]+Z[3],.5],[J[0]+Z[0],J[1]+Z[3],.5],[J[0]+Z[0],J[1]+Z[1],.5]],!0,1,[255,0,0,255],null,!0,null,null,null)),t.setState(x?i.lineLabelHitState:i.labelState),0!=W[0]&&0!=W[2]&&(J||(J=i.project2(r.center,i.camera.mvp,i.cameraPosition)),this.drawLineString([[J[0],J[1]+X,J[2]],[J[0],J[1],J[2]]],!0,W[2],[W[3],W[4],W[5],W[6]],null,null,null,null,!0)),c=r.program,t.useProgram(c,["aPosition","aTexCoord","aOrigin"]),c.setSampler("uSampler",0),c.setMat4("uMVP",b,i.getZoffsetFactor(r.zbufferOffset)),c.setVec4("uScale",[s[0],s[1],8==r.type?1:1/d.width,2*X]);var F=0,Q=1,I=0,N=0;for(c!=i.progIcon?(I=1.4142*r.outline[2]/r.size,N=1.4142*r.outline[3]/r.size,c.setVec4("uColor",x?M:r.color2),c.setVec2("uParams",[r.outline[0],N]),Q=x?1:2):c.setVec4("uColor",M),p=c.getAttribute("aPosition"),f=c.getAttribute("aTexCoord"),m=c.getAttribute("aOrigin"),e.bindBuffer(e.ARRAY_BUFFER,r.vertexPositionBuffer),e.vertexAttribPointer(p,r.vertexPositionBuffer.itemSize,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,r.vertexTexcoordBuffer),e.vertexAttribPointer(f,r.vertexTexcoordBuffer.itemSize,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,r.vertexOriginBuffer),e.vertexAttribPointer(m,r.vertexOriginBuffer.itemSize,e.FLOAT,!1,0,0);F<Q;F++)if(1==F&&(c.setVec4("uColor",M),c.setVec2("uParams",[r.outline[1],I])),P.length>0)for(var E=0,L=P.length;E<L;E++)for(var B=P[E],R=0,_=B.length;R<_;R++){var D=B[R];c.setFloat("uFile",Math.round(D+1e3*E)),t.bindTexture(r.fonts[E].getTexture(D)),e.drawArrays(e.TRIANGLES,0,r.vertexPositionBuffer.numItems)}else t.bindTexture(d),e.drawArrays(e.TRIANGLES,0,r.vertexPositionBuffer.numItems)}}},l.prototype.drawGpuSubJob=function(t,e,i,r,s){if(s){var a=s[0],n=s[1],o=s[2],h=s[3],l=s[4],u=s[5],c=a.stick,d=a.hitable&&i.onlyHitLayers;if(i.drawLabelBoxes){var p=a.noOverlap;t.setState(d?i.lineLabelHitState:i.lineLabelState),this.drawLineString([[u[0]+p[0],u[1]+p[1],.5],[u[0]+p[2],u[1]+p[1],.5],[u[0]+p[2],u[1]+p[3],.5],[u[0]+p[0],u[1]+p[3],.5],[u[0]+p[0],u[1]+p[1],.5]],!0,1,[255,0,0,255],null,!0,null,null,null)}t.setState(d?i.lineLabelHitState:i.labelState),0!=c[0]&&0!=c[2]&&this.drawLineString([[u[0],u[1]+n,u[2]],[u[0],u[1],u[2]]],!0,c[2],[c[3],c[4],c[5],c[6]],null,null,null,null,!0);var f=a.program;t.useProgram(f,["aPosition","aTexCoord","aOrigin"]),f.setSampler("uSampler",0),f.setMat4("uMVP",a.mvp,i.getZoffsetFactor(a.zbufferOffset)),f.setVec4("uScale",[r[0],r[1],8==a.type?1:1/o.width,2*n]);var g=0,m=1,v=0,y=0;f!=i.progIcon?(v=1.4142*a.outline[2]/a.size,y=1.4142*a.outline[3]/a.size,f.setVec4("uColor",d?l:a.color2),f.setVec2("uParams",[a.outline[0],y]),m=d?1:2):f.setVec4("uColor",l);var b=f.getAttribute("aPosition"),x=f.getAttribute("aTexCoord"),M=f.getAttribute("aOrigin");for(e.bindBuffer(e.ARRAY_BUFFER,a.vertexPositionBuffer),e.vertexAttribPointer(b,a.vertexPositionBuffer.itemSize,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,a.vertexTexcoordBuffer),e.vertexAttribPointer(x,a.vertexTexcoordBuffer.itemSize,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,a.vertexOriginBuffer),e.vertexAttribPointer(M,a.vertexOriginBuffer.itemSize,e.FLOAT,!1,0,0);g<m;g++)if(1==g&&(f.setVec4("uColor",l),f.setVec2("uParams",[a.outline[1],v])),h.length>0)for(var w=0,S=h.length;w<S;w++)for(var A=h[w],C=0,T=A.length;C<T;C++){var P=A[C];f.setFloat("uFile",Math.round(P+1e3*w)),t.bindTexture(a.fonts[w].getTexture(P)),e.drawArrays(e.TRIANGLES,0,a.vertexPositionBuffer.numItems)}else t.bindTexture(o),e.drawArrays(e.TRIANGLES,0,a.vertexPositionBuffer.numItems)}},e.a=l},function(t,e,i){"use strict";var r=i(5),s=r.a,a={};a.setFaceVertices=function(t,e,i,r,s){t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=i[0],t[s+4]=i[1],t[s+5]=i[2],t[s+6]=r[0],t[s+7]=r[1],t[s+8]=r[2]},a.setFaceUVs=function(t,e,i,r,s){t[s]=e[0],t[s+1]=e[1],t[s+2]=i[0],t[s+3]=i[1],t[s+4]=r[0],t[s+5]=r[1]},a.buildHeightmap=function(t){t--;for(var e=a,i=t*t*2,r=new Float32Array(3*i*3),n=new Float32Array(3*i*2),o=1*t,h=0,l=0,u=0;u<t;u++)for(var c=0;c<t;c++){var d=c*o,p=(c+1)*o,f=u*o,g=(u+1)*o;e.setFaceVertices(r,[d,f,0],[p,f,0],[p,g,0],h),e.setFaceUVs(n,[d,f],[p,f],[p,g],l),h+=9,l+=6,e.setFaceVertices(r,[p,g,0],[d,g,0],[d,f,0],h),e.setFaceUVs(n,[p,g],[d,g],[d,f],l),h+=9,l+=6}return{bbox:new s(0,0,0,1,1,1),vertices:r,uvs:n}},a.buildPlane=function(t){t--;for(var e=a,i=t*t*2,r=new Float32Array(3*i*3),n=new Float32Array(3*i*2),o=1/t,h=0,l=0,u=0;u<t;u++)for(var c=0;c<t;c++){var d=c,p=c+1,f=u,g=u+1,m=c*o,v=(c+1)*o,y=u*o,b=(u+1)*o;e.setFaceVertices(r,[d,f,0],[d,g,0],[p,g,0],h),e.setFaceUVs(n,[m,y],[m,b],[v,b],l),h+=9,l+=6,e.setFaceVertices(r,[p,g,0],[p,f,0],[d,f,0],h),e.setFaceUVs(n,[v,b],[v,y],[m,y],l),h+=9,l+=6}return{bbox:new s(0,0,0,1,1,1),vertices:r,uvs:n}},a.spherePos=function(t,e){return e*=Math.PI,t*=2*Math.PI,[Math.cos(t)*Math.sin(e)*.5+.5,Math.sin(t)*Math.sin(e)*.5+.5,.5*Math.cos(e)+.5]},a.buildSkydome=function(t,e){for(var i=a,r=t*e*2,n=new Float32Array(3*r*3),o=new Float32Array(3*r*2),h=0,l=0,u=0;u<t;u++)for(var c=0;c<e;c++){var d=c/e,p=(c+1)/e,f=u/t,g=(u+1)/t;i.makeQuad(d,f,p,g,n,h,o,l),h+=18,l+=12}return{bbox:new s(0,0,0,1,1,1),vertices:n,uvs:o}},a.makeQuad=function(t,e,i,r,s,n,o,h){var l=a,u=l.spherePos(t,e),c=[t,e],d=l.spherePos(t,r),p=[t,r],f=l.spherePos(i,e),g=[i,e],m=l.spherePos(i,r),v=[i,r];l.setFaceVertices(s,d,u,f,n),l.setFaceUVs(o,p,c,g,h),l.setFaceVertices(s,f,m,d,n+9),l.setFaceUVs(o,g,v,p,h+6)},e.a=a},function(t,e,i){"use strict";var r=function(t,e){this.gl=t.gl;var i=this.gl;if(null!=i){this.free=e,this.vertexPositionBuffer=null,this.vertexPositionBuffer=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,this.vertexPositionBuffer);var r;r=e?[0,0,0,0,0,1,0,0,1,0,0,2,0,0,2,0,0,3,0,0,3,0,0,0,0,0,4,0,0,5,0,0,5,0,0,6,0,0,6,0,0,7,0,0,7,0,0,4,0,0,0,0,0,4,0,0,1,0,0,5,0,0,2,0,0,6,0,0,3,0,0,7]:[0,0,0,1,0,0,1,0,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,0,1,1,0,1,1,0,0,1,0,0,0,0,0,1,1,0,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,1],i.bufferData(i.ARRAY_BUFFER,new Float32Array(r),i.STATIC_DRAW),this.vertexPositionBuffer.itemSize=3,this.vertexPositionBuffer.numItems=r.length/3,this.size=36,this.lines=this.vertexPositionBuffer.numItems/3}};r.prototype.kill=function(){this.gl.deleteBuffer(this.vertexPositionBuffer)},r.prototype.draw=function(t,e){var i=this.gl;if(null!=i){var r=t.getAttribute(e);i.bindBuffer(i.ARRAY_BUFFER,this.vertexPositionBuffer),i.vertexAttribPointer(r,this.vertexPositionBuffer.itemSize,i.FLOAT,!1,0,0),i.drawArrays(i.LINES,0,this.vertexPositionBuffer.numItems)}},e.a=r},function(t,e,i){"use strict";var r=function(t,e,i,r,s){this.renderer=t,this.div=e,this.canvas=null,this.curSize=i,this.currentProgram=null,this.maxAttributesCount=8,this.newAttributes=new Uint8Array(this.maxAttributesCount),this.enabledAttributes=new Uint8Array(this.maxAttributesCount),this.noTextures=!1,this.barycentricBuffer=null,this.defaultState=this.createState({}),this.currentState=this.defaultState,this.currentOffset=0,this.keepFrameBuffer=null!=r&&r,this.antialias=!!s};r.prototype.init=function(){if(this.canvas=document.createElement("canvas"),null!=this.canvas&&(this.canvas.width=this.curSize[0],this.canvas.height=this.curSize[1],this.canvas.style.display="block",null!=this.canvas.getContext)){try{this.gl=this.canvas.getContext("webgl",{preserveDrawingBuffer:this.keepFrameBuffer,antialias:this.antialias,stencil:!0})||this.canvas.getContext("experimental-webgl",{preserveDrawingBuffer:this.keepFrameBuffer})}catch(t){}this.gl&&(this.gl.getExtension("OES_standard_derivatives"),this.div.appendChild(this.canvas),this.gl.viewportWidth=this.canvas.width,this.gl.viewportHeight=this.canvas.height,this.gl.clearColor(0,0,0,1),this.gl.enable(this.gl.DEPTH_TEST),this.gl.viewport(0,0,this.gl.viewportWidth,this.gl.viewportHeight),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT))}},r.prototype.kill=function(){this.div.removeChild(this.canvas),delete this.canvas,this.canvas=null},r.prototype.resize=function(t,e){this.curSize=t,null!=this.canvas&&!0!==e&&(this.canvas.width=this.curSize[0],this.canvas.height=this.curSize[1]),null!=this.gl&&(this.gl.viewportWidth=this.canvas.width,this.gl.viewportHeight=this.canvas.height)},r.prototype.getCanvas=function(){return this.canvas},r.prototype.setViewport=function(){this.gl.viewport(0,0,this.gl.viewportWidth,this.gl.viewportHeight)},r.prototype.clear=function(t,e,i){null!=i&&this.gl.clearColor(i[0]/255,i[1]/255,i[2]/255,i[3]/255),this.gl.clear((e?this.gl.COLOR_BUFFER_BIT:0)|(t?this.gl.DEPTH_BUFFER_BIT:0))},r.prototype.useProgram=function(t,e,i){if(this.currentProgram!=t){this.gl.useProgram(t.program),this.currentProgram=t,t.setSampler("uSampler",0),i&&t.setSampler("uSampler2",1);for(var r=this.newAttributes,s=this.enabledAttributes,a=0,n=r.length;a<n;a++)r[a]=0;for(a=0,n=e.length;a<n;a++){var o=t.getAttribute(e[a]);-1!=o&&(r[o]=1)}for(a=0,n=r.length;a<n;a++)s[a]!=r[a]&&(r[a]?(this.gl.enableVertexAttribArray(a),s[a]=1):(this.gl.disableVertexAttribArray(a),s[a]=0))}},r.prototype.bindTexture=function(t,e){t.loaded&&(this.gl.activeTexture(e?this.gl.TEXTURE1:this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,t.texture))},r.prototype.setFramebuffer=function(t){null!=t?this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t.framebuffer):(this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.gl.bindRenderbuffer(this.gl.RENDERBUFFER,null),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null))},r.prototype.createState=function(t){return null==t.blend&&(t.blend=!1),null==t.stencil&&(t.stencil=!1),null==t.zwrite&&(t.zwrite=!0),null==t.ztest&&(t.ztest=!0),null==t.zequal&&(t.zequal=!1),null==t.culling&&(t.culling=!0),t},r.prototype.setState=function(t){if(t){var e=this.gl,i=this.currentState;i.blend!=t.blend&&(t.blend?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.enable(e.BLEND)):e.disable(e.BLEND)),i.stencil!=t.stencil&&(t.stencil?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST)),i.zwrite!=t.zwrite&&(t.zwrite?e.depthMask(!0):e.depthMask(!1)),i.ztest!=t.ztest&&(0!=t.ztest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST)),i.zequal!=t.zequal&&(0!=t.zequal?e.depthFunc(e.LEQUAL):e.depthFunc(e.LESS)),i.culling!=t.culling&&(t.culling?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE)),this.currentState=t}},e.a=r},function(t,e,i){"use strict";var r=i(2),s=i(5),a=i(3),n=r.b,o=r.e,h=s.a,l=a.a,u=function(t,e,i,r,s){this.id=t,this.bbox=null,this.origin=i||[0,0,0],this.gpu=r,this.gl=r.gl,this.renderer=s,this.jobs=[],this.reduced=0,this.geometries={},null!=e&&null!=e[0]&&null!=e[1]&&(this.bbox=new h(e[0][0],e[0][1],e[0][2],e[1][0],e[1][1],e[1][2])),this.size=0,this.polygons=0};u.prototype.kill=function(){for(var t=0,e=this.jobs.length;t<e;t++){var i=this.jobs[t];switch(i.type){case 1:i.vertexPositionBuffer&&this.gl.deleteBuffer(i.vertexPositionBuffer),i.vertexElementBuffer&&this.gl.deleteBuffer(i.vertexElementBuffer);break;case 3:case 2:case 4:case 5:i.vertexPositionBuffer&&this.gl.deleteBuffer(i.vertexPositionBuffer),i.vertexNormalBuffer&&this.gl.deleteBuffer(i.vertexNormalBuffer),i.vertexElementBuffer&&this.gl.deleteBuffer(i.vertexElementBuffer);break;case 6:i.vertexPositionBuffer&&this.gl.deleteBuffer(i.vertexPositionBuffer),i.vertexTexcoordBuffer&&this.gl.deleteBuffer(i.vertexTexcoordBuffer),i.vertexElementBuffer&&this.gl.deleteBuffer(i.vertexElementBuffer);break;case 7:case 8:i.vertexPositionBuffer&&this.gl.deleteBuffer(i.vertexPositionBuffer),i.vertexTexcoordBuffer&&this.gl.deleteBuffer(i.vertexTexcoordBuffer),i.vertexOriginBuffer&&this.gl.deleteBuffer(i.vertexOriginBuffer),i.vertexElementBuffer&&this.gl.deleteBuffer(i.vertexElementBuffer)}}for(var r in this.geometries){var s=this.geometries[r],a=this.renderer.geometries[r];for(this.geometries[r]=null,t=0,e=s.length;t<e;t++)s[t]==a&&(this.renderer.geometries[r]=null)}},u.prototype.size=function(){return this.size},u.prototype.getZbufferOffset=function(){return this.size},u.prototype.addGeometry=function(t){var e=t.id;this.geometries[e]?this.geometries[e].push(t):this.geometries[e]=[t],this.renderer.geometries[e]=t},u.prototype.convertColor=function(t){var e=1/255;return[t[0]*e,t[1]*e,t[2]*e,t[3]*e]},u.prototype.addLineJob=function(t){var e=this.gl,i=t.vertexBuffer,r={};if(r.type=1,r.program=this.renderer.progLine,r.color=this.convertColor(t.color),r.zIndex=t["z-index"]+256,r.clickEvent=t["click-event"],r.hoverEvent=t["hover-event"],r.enterEvent=t["enter-event"],r.leaveEvent=t["leave-event"],r.advancedHit=t.advancedHit,r.hitable=t.hitable,r.eventInfo=t.eventInfo,r.state=t.state,r.center=t.center,r.lod=t.lod,r.lineWidth=t["line-width"],r.zbufferOffset=t["zbuffer-offset"],r.reduced=!1,r.ready=!0,r.program.isReady()&&(!r.advancedHit||(r.program2=this.renderer.progELine,r.program2.isReady()))){if(r.vertexPositionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,r.vertexPositionBuffer),e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW),r.vertexPositionBuffer.itemSize=3,r.vertexPositionBuffer.numItems=i.length/3,r.advancedHit){r.program=this.renderer.progLine;var s=t.elementBuffer;r.vertexElementBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,r.vertexElementBuffer),e.bufferData(e.ARRAY_BUFFER,s,e.STATIC_DRAW),r.vertexElementBuffer.itemSize=1,r.vertexElementBuffer.numItems=s.length}this.jobs.push(r),this.size+=4*i.length,this.polygons+=i.length/9}},u.prototype.addExtentedLineJob=function(t){var e=this.gl,i=t.vertexBuffer,r=t.normalBuffer,s={};switch(s.type=t.type,t.type){case"flat-tline":s.type=3;break;case"flat-rline":s.type=2;break;case"pixel-line":s.type=4;break;case"pixel-tline":s.type=5}if(s.color=this.convertColor(t.color),s.zIndex=t["z-index"]+256,s.clickEvent=t["click-event"],s.hoverEvent=t["hover-event"],s.hitable=t.hitable,s.eventInfo=t.eventInfo,s.enterEvent=t["enter-event"],s.leaveEvent=t["leave-event"],s.advancedHit=t.advancedHit,s.widthByRatio="ratio"==t["width-units"],s.state=t.state,s.center=t.center,s.lod=t.lod,s.lineWidth=t["line-width"],s.zbufferOffset=t["zbuffer-offset"],s.reduced=!1,s.ready=!0,null!=t.texture){var a=t.texture,n=a[0];s.texture=[this.renderer.getBitmap(n.url,n.filter||"linear",n.tiled||!1),a[1],a[2],a[3],a[4]];var o=this.convertColor(t.background);0!=o[3]&&(s.background=o)}switch(s.type){case 3:s.program=0!=o[3]?this.renderer.progTBLine:this.renderer.progTLine;break;case 2:s.program=this.renderer.progRLine;break;case 4:s.program=this.renderer.progLine3;break;case 5:s.program=0!=o[3]?this.renderer.progTPBLine:this.renderer.progTPLine}if(s.program.isReady()){if(s.advancedHit){switch(s.type){case 3:s.program2=this.renderer.progETLine;break;case 2:s.program2=this.renderer.progERLine;break;case 4:s.program2=this.renderer.progELine3;break;case 5:s.program2=this.renderer.progETPLine}if(!s.program2.isReady())return}if(s.vertexPositionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,s.vertexPositionBuffer),e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW),s.vertexPositionBuffer.itemSize=4,s.vertexPositionBuffer.numItems=i.length/4,s.vertexNormalBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,s.vertexNormalBuffer),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),s.vertexNormalBuffer.itemSize=4,s.vertexNormalBuffer.numItems=r.length/4,s.advancedHit){var h=t.elementBuffer;s.vertexElementBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,s.vertexElementBuffer),e.bufferData(e.ARRAY_BUFFER,h,e.STATIC_DRAW),s.vertexElementBuffer.itemSize=1,s.vertexElementBuffer.numItems=h.length}this.jobs.push(s),this.size+=4*i.length+4*r.length,this.polygons+=i.length/12}},u.prototype.addLineLabelJob=function(t){var e=this.gl,i=t.vertexBuffer,r=t.texcoordsBuffer,s={};s.type=6,s.program=this.renderer.progText,s.color=this.convertColor(t.color),s.color2=this.convertColor(t.color2),s.outline=t.outline,s.zIndex=t["z-index"]+256,s.clickEvent=t["click-event"],s.hoverEvent=t["hover-event"],s.enterEvent=t["enter-event"],s.leaveEvent=t["leave-event"],s.hitable=t.hitable,s.eventInfo=t.eventInfo,s.state=t.state,s.center=t.center,s.lod=t.lod,s.zbufferOffset=t["zbuffer-offset"],s.reduced=!1,s.ready=!0,s.files=t.files||[];var a=t.fonts||["#default"];s.fonts=a;for(var n=0,o=a.length;n<o;n++)a[n]=this.renderer.fonts[a[n]];s.program=this.renderer.progText2,s.program.isReady()&&(s.vertexPositionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,s.vertexPositionBuffer),e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW),s.vertexPositionBuffer.itemSize=4,s.vertexPositionBuffer.numItems=i.length/4,s.vertexTexcoordBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,s.vertexTexcoordBuffer),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),s.vertexTexcoordBuffer.itemSize=4,s.vertexTexcoordBuffer.numItems=r.length/4,this.jobs.push(s),this.size+=4*i.length+4*r.length,this.polygons+=i.length/12)},u.prototype.addIconJob=function(t,e,i){var r=this.gl,s=t.vertexBuffer,a=t.texcoordsBuffer,n=t.originBuffer,o=t.stick,h=1/255,l={tile:i};if(l.type=e?8:7,l.program=this.renderer.progIcon,l.color=this.convertColor(t.color),l.zIndex=t["z-index"]+256,l.visibility=t.visibility,l.culling=t.culling,l.clickEvent=t["click-event"],l.hoverEvent=t["hover-event"],l.enterEvent=t["enter-event"],l.leaveEvent=t["leave-event"],l.hitable=t.hitable,l.eventInfo=t.eventInfo,l.state=t.state,l.center=t.center,l.stick=[o[0],o[1],o[2],o[3]*h,o[4]*h,o[5]*h,o[6]*h],l.lod=t.lod,l.zbufferOffset=t["zbuffer-offset"],l.hysteresis=t.hysteresis,l.id=l.eventInfo&&l.hysteresis?l.eventInfo[l.hysteresis[2]]:null,l.reduced=!1,l.ready=!0,l.reduce=t.reduce,l.reduce)switch(l.reduce[0]){case"tilt":l.reduce[0]=1;break;case"tilt-cos":l.reduce[0]=2;break;case"tilt-cos2":l.reduce[0]=3;break;case"scr-count":l.reduce[0]=4;break;case"scr-count2":l.reduce[0]=5;break;case"scr-count3":l.reduce[0]=6}if(l.program.isReady()){if(!0!==e){var u=t.icon;l.texture=this.renderer.getBitmap(u.url,u.filter||"linear",u.tiled||!1),l.files=[]}else{l.color2=this.convertColor(t.color2),l.outline=t.outline,l.size=t.size,l.files=t.files||[],l.index=t.index||0,l.noOverlap=t.noOverlap;var c=t.fonts||["#default"];l.fonts=c;for(var d=0,p=c.length;d<p;d++)c[d]=this.renderer.fonts[c[d]];l.program=this.renderer.progIcon2}null==l.visibility||Array.isArray(l.visibility)||(l.visibility=[l.visibility]),l.vertexPositionBuffer=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,l.vertexPositionBuffer),r.bufferData(r.ARRAY_BUFFER,s,r.STATIC_DRAW),l.vertexPositionBuffer.itemSize=4,l.vertexPositionBuffer.numItems=s.length/4,l.vertexTexcoordBuffer=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,l.vertexTexcoordBuffer),r.bufferData(r.ARRAY_BUFFER,a,r.STATIC_DRAW),l.vertexTexcoordBuffer.itemSize=4,l.vertexTexcoordBuffer.numItems=a.length/4,l.vertexOriginBuffer=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,l.vertexOriginBuffer),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),l.vertexOriginBuffer.itemSize=3,l.vertexOriginBuffer.numItems=n.length/3,this.jobs.push(l),this.size+=4*l.vertexPositionBuffer.numItems+4*l.vertexOriginBuffer.numItems+4*l.vertexTexcoordBuffer.numItems,this.polygons+=l.vertexPositionBuffer.numItems/12}},u.prototype.addRenderJob=function(t,e){switch(t.type){case"flat-line":this.addLineJob(t);break;case"flat-tline":case"flat-rline":case"pixel-line":case"pixel-tline":this.addExtentedLineJob(t);break;case"line-label":this.addLineLabelJob(t);break;case"icon":this.addIconJob(t);break;case"label":this.addIconJob(t,!0,e);break;case"point-geometry":case"line-geometry":this.addGeometry(t)}},u.prototype.draw=function(t,e,i,r,s){if(null==this.id||!1!==this.renderer.layerGroupVisible[this.id]){var a=this.renderer,h=[[a.geoRenderCounter,t,e,this]];if(i){var u=o.create(),c=o.create(),d=this.renderer.position,p=this.origin;p=[p[0]-d[0],p[1]-d[1],p[2]],o.multiply(t,l.translationMatrix(p[0],p[1],p[2]),c),o.multiply(e,c,u),t=c,e=u}for(var f=a.cameraPosition,g=a.jobZBuffer,m=a.jobZBufferSize,v=(a.jobZBuffer2,a.jobZBuffer2Size,a.onlyHitLayers),y=0,b=this.jobs.length;y<b;y++){var x=this.jobs[y];if((7==x.type||8==x.type)&&x.visibility>0){var M=x.center;if(n.length([M[0]-f[0],M[1]-f[1],M[2]-f[2]])>x.visibility)continue}if(!v||x.hitable){x.mv=t,x.mvp=e,x.renderCounter=h,x.tiltAngle=r,x.texelSize=s;var w=x.zIndex;g[w][m[w]]=x,m[w]++}}}},e.a=u},function(t,e,i){"use strict";var r=function(t,e,i,r,s,a){this.bbox=null,this.gpu=t,this.gl=t.gl,this.core=e,null!=this.gl&&(this.vertices=[],this.normals=[],this.vertexBuffer=null,this.lines=i,this.joins=s,this.joinSides=a,this.maxLines=r,this.init())};r.prototype.kill=function(){this.gl.deleteBuffer(this.vertexBuffer)},r.prototype.init=function(){var t;if(this.lines)for(this.joins&&this.addCircle(0,this.joinSides),t=0;t<this.maxLines;t++)this.addLine(t,t+1),this.joins&&this.addCircle(t+1,this.joinSides);else if(this.joins)for(t=0;t<=this.maxLines;t++)this.addCircle(t,this.joinSides);this.compile()},r.prototype.addLine=function(t,e){var i=this.vertices.length;this.vertices[i]=t,this.vertices[i+1]=e,this.vertices[i+2]=1,this.vertices[i+3]=t,this.vertices[i+4]=e,this.vertices[i+5]=-1,this.vertices[i+6]=e,this.vertices[i+7]=t,this.vertices[i+8]=1,this.vertices[i+9]=t,this.vertices[i+10]=e,this.vertices[i+11]=1,this.vertices[i+12]=e,this.vertices[i+13]=t,this.vertices[i+14]=1,this.vertices[i+15]=e,this.vertices[i+16]=t,this.vertices[i+17]=-1,this.polygons+=2},r.prototype.addCircle=function(t,e){for(var i=this.vertices.length,r=2*Math.PI/e,s=0;s<e;s++)this.vertices[i]=t,this.vertices[i+1]=-1,this.vertices[i+2]=0,this.vertices[i+3]=t,this.vertices[i+4]=-2,this.vertices[i+5]=r*s,this.vertices[i+6]=t,this.vertices[i+7]=-2,this.vertices[i+8]=r*(s+1),i+=9;this.polygons+=e},r.prototype.compile=function(){var t=this.gl;this.vertexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,new Float32Array(this.vertices),t.STATIC_DRAW),this.vertexBuffer.itemSize=3,this.vertexBuffer.numItems=this.vertices.length/3,this.size=3*this.vertexBuffer.numItems*4*2,this.polygons=this.vertexBuffer.numItems/3},r.prototype.draw=function(t,e,i){var r=this.gl;if(!(null==r||null==this.vertexBuffer||i>this.maxLines)){var s=t.getAttribute(e);r.bindBuffer(r.ARRAY_BUFFER,this.vertexBuffer),r.vertexAttribPointer(s,this.vertexBuffer.itemSize,r.FLOAT,!1,0,0);var a=0;this.lines&&(a+=3*(i-1)*2),this.joins&&(a+=i*(3*this.joinSides)),r.drawArrays(r.TRIANGLES,0,a)}},r.prototype.size=function(){return this.size},r.prototype.bbox=function(){return this.bbox},r.prototype.getPolygons=function(){return this.polygons},e.a=r},function(t,e,i){"use strict";var r={};r.bboxVertexShader="attribute vec3 aPosition;\nuniform mat4 uMVP;\nvoid main(){ \ngl_Position = uMVP * vec4(aPosition, 1.0);\n}",r.bbox2VertexShader="attribute vec3 aPosition;\nuniform mat4 uMVP;\nuniform float uPoints[8*3];\nvoid main(){ \nint index = int(aPosition.z) * 3; \ngl_Position = uMVP * vec4(uPoints[index], uPoints[index+1], uPoints[index+2], 1.0);\n}",r.bboxFragmentShader="precision mediump float;\nvoid main() {\ngl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);\n}",r.lineVertexShader="attribute vec3 aPosition;\nuniform mat4 uMVP;\nvoid main(){ \ngl_Position = uMVP * vec4(aPosition, 1.0);\n}",r.lineFragmentShader="precision mediump float;\nuniform vec4 uColor;\nvoid main() {\ngl_FragColor = uColor;\n}",r.lineWireframeVertexShader="attribute vec3 aPosition;\nattribute vec3 aBarycentric;\nvarying vec3 vBarycentric;\nuniform mat4 uMVP;\nvoid main(){ \ngl_Position = uMVP * vec4(aPosition, 1.0);\nvBarycentric = aBarycentric;\n}",r.lineWireframeFragmentShader="precision mediump float;\n#extension GL_OES_standard_derivatives : enable\nuniform vec4 uColor;\nvarying vec3 vBarycentric;\nfloat edgeFactor(){\n#ifdef GL_OES_standard_derivatives\nvec3 d = fwidth(vBarycentric);\nvec3 a3 = smoothstep(vec3(0.0), d*1.0, vBarycentric);\nreturn min(min(a3.x, a3.y), a3.z);\n#else\nfloat a = min(min(vBarycentric.x, vBarycentric.y), vBarycentric.z);\nreturn a > 0.1 ? 1.0 : smoothstep(0.0,1.0,a*10.0);\n#endif\n}\nvoid main() {\ngl_FragColor = vec4( mix(vec3(0.0), uColor.rgb, edgeFactor()) , uColor.a);\n}",r.elineVertexShader="attribute vec3 aPosition;\nattribute float aElement;\nuniform mat4 uMVP;\nvarying float vElement;\nvoid main(){ \nvElement = aElement;\ngl_Position = uMVP * vec4(aPosition, 1.0);\n}",r.elineFragmentShader="precision mediump float;\nuniform vec4 uColor;\nvarying float vElement;\nvoid main() {\ngl_FragColor.xyz = fract(vec3(1.0/255.0, 1.0/65025.0, 1.0/16581375.0) * vElement) + (-0.5/255.0);\ngl_FragColor.w = 1.0;\n}",r.line3VertexShader="attribute vec4 aPosition;\nattribute vec4 aNormal;\nuniform mat4 uMVP;\nuniform vec2 uScale;\nvoid main(){ \nvec4 pp0 = (uMVP * vec4(aPosition.xyz, 1.0));\nif (aNormal.w == 0.0) {\ngl_Position = pp0 + vec4((vec3(aNormal.x*uScale.x*pp0.w, aNormal.y*uScale.y*pp0.w, 0.0)), 0.0);\n} else {\nvec2 pp1 = pp0.xy / pp0.w;\nvec4 pp3 = (uMVP * vec4(aNormal.xyz, 1.0));\nvec2 pp2 = pp3.xy / pp3.w;\nvec2 n = normalize(pp2 - pp1);\ngl_Position = pp0 + vec4((vec3(-n.y*uScale.x*aNormal.w*pp0.w, n.x*uScale.y*aNormal.w*pp0.w, 0.0)), 0.0);\n}\n}",r.eline3VertexShader="attribute vec4 aPosition;\nattribute vec4 aNormal;\nattribute float aElement;\nuniform mat4 uMVP;\nuniform vec2 uScale;\nvarying float vElement;\nvoid main(){ \nvec4 pp0 = (uMVP * vec4(aPosition.xyz, 1.0));\nvElement = aElement;\nif (aNormal.w == 0.0) {\ngl_Position = pp0 + vec4((vec3(aNormal.x*uScale.x*pp0.w, aNormal.y*uScale.y*pp0.w, 0.0)), 0.0);\n} else {\nvec2 pp1 = pp0.xy / pp0.w;\nvec4 pp3 = (uMVP * vec4(aNormal.xyz, 1.0));\nvec2 pp2 = pp3.xy / pp3.w;\nvec2 n = normalize(pp2 - pp1);\ngl_Position = pp0 + vec4((vec3(-n.y*uScale.x*aNormal.w*pp0.w, n.x*uScale.y*aNormal.w*pp0.w, 0.0)), 0.0);\n}\n}",r.line4VertexShader="attribute vec3 aPosition;\nuniform mat4 uMVP;\nuniform vec3 uScale;\nuniform vec3 uPoints[32];\nvoid main(){ \nvec4 pp0 = (uMVP * vec4(uPoints[int(aPosition.x)], 1.0));\nif (aPosition.y < 0.0) {\nif (aPosition.y == -1.0) {\ngl_Position = pp0;\n} else {\ngl_Position = pp0 + vec4((vec3(-sin(aPosition.z)*uScale.x*uScale.z, cos(aPosition.z)*uScale.y*uScale.z, 0.0)), 0.0);\n}\n} else {\nvec2 pp1 = pp0.xy / pp0.w;\nvec4 pp3 = (uMVP * vec4(uPoints[int(aPosition.y)], 1.0));\nvec2 pp2 = pp3.xy / pp3.w;\nvec2 n = normalize(pp2 - pp1);\ngl_Position = pp0 + vec4((vec3(-n.y*uScale.x*aPosition.z*uScale.z, n.x*uScale.y*aPosition.z*uScale.z, 0.0)), 0.0);\n}\n}",r.tlineVertexShader="attribute vec4 aPosition;\nattribute vec4 aNormal;\nuniform mat4 uMVP;\nuniform vec2 uScale;\nuniform vec4 uParams;\nvarying vec2 vTexCoord;\nvoid main(){ \nvec4 p=vec4(aPosition.xyz, 1.0);\np.xyz+=aNormal.xyz*(abs(aNormal.w)*uParams[3]);\nif (aNormal.w < 0.0){\nvTexCoord=vec2(abs(aPosition.w)*uParams[0], (uParams[1]+uParams[2])*0.5);\n} else {\nvTexCoord=vec2(abs(aPosition.w)*uParams[0], aPosition.w < 0.0 ? uParams[1] : uParams[2]);\n}\ngl_Position = uMVP * p;\n}",r.rlineVertexShader="attribute vec4 aPosition;\nattribute vec4 aNormal;\nuniform mat4 uMVP;\nuniform vec2 uScale;\nuniform vec4 uParams;\nvoid main(){ \nvec4 p=vec4(aPosition.xyz, 1.0);\np.xyz+=aNormal.xyz*(abs(aNormal.w)*uParams[3]);\ngl_Position = uMVP * p;\n}",r.erlineVertexShader="attribute vec4 aPosition;\nattribute vec4 aNormal;\nattribute float aElement;\nuniform mat4 uMVP;\nuniform vec2 uScale;\nuniform vec4 uParams;\nvarying float vElement;\nvoid main(){ \nvec4 p=vec4(aPosition.xyz, 1.0);\np.xyz+=aNormal.xyz*(abs(aNormal.w)*uParams[3]);\nvElement = aElement;\ngl_Position = uMVP * p;\n}",r.etlineVertexShader="attribute vec4 aPosition;\nattribute vec4 aNormal;\nattribute float aElement;\nuniform mat4 uMVP;\nuniform vec2 uScale;\nuniform vec4 uParams;\nvarying float vElement;\nvoid main(){ \nvec4 p=vec4(aPosition.xyz, 1.0);\np.xyz+=aNormal.xyz*(abs(aNormal.w)*uParams[3]);\nvElement = aElement;\ngl_Position = uMVP * p;\n}",r.tplineVertexShader="attribute vec4 aPosition;\nattribute vec4 aNormal;\nuniform mat4 uMVP;\nuniform vec2 uScale;\nuniform vec4 uParams;\nvarying vec2 vTexCoord;\nvoid main(){ \nvec4 pp0 = (uMVP * vec4(aPosition.xyz, 1.0));\nvTexCoord=vec2(abs(aPosition.w)*uParams[0], aPosition.w < 0.0 ? uParams[1] : uParams[2]);\nif (aNormal.w == 0.0) {\ngl_Position = pp0 + vec4((vec3(aNormal.x*uParams[3]*uScale.x*pp0.w, aNormal.y*uParams[3]*uScale.y*pp0.w, 0.0)), 0.0);\n} else {\nvec2 pp1 = pp0.xy / pp0.w;\nvec4 pp3 = (uMVP * vec4(aNormal.xyz, 1.0));\nvec2 pp2 = pp3.xy / pp3.w;\nvec2 n = normalize(pp2 - pp1);\ngl_Position = pp0 + vec4((vec3(-n.y*uParams[3]*uScale.x*aNormal.w*pp0.w, n.x*uParams[3]*uScale.y*aNormal.w*pp0.w, 0.0)), 0.0);\n}\n}",r.etplineVertexShader="attribute vec4 aPosition;\nattribute vec4 aNormal;\nattribute float aElement;\nuniform mat4 uMVP;\nuniform vec2 uScale;\nuniform vec4 uParams;\nvarying float vElement;\nvoid main(){ \nvec4 pp0 = (uMVP * vec4(aPosition.xyz, 1.0));\nvElement = aElement;\nif (aNormal.w == 0.0) {\ngl_Position = pp0 + vec4((vec3(aNormal.x*uParams[3]*uScale.x*pp0.w, aNormal.y*uParams[3]*uScale.y*pp0.w, 0.0)), 0.0);\n} else {\nvec2 pp1 = pp0.xy / pp0.w;\nvec4 pp3 = (uMVP * vec4(aNormal.xyz, 1.0));\nvec2 pp2 = pp3.xy / pp3.w;\nvec2 n = normalize(pp2 - pp1);\ngl_Position = pp0 + vec4((vec3(-n.y*uParams[3]*uScale.x*aNormal.w*pp0.w, n.x*uParams[3]*uScale.y*aNormal.w*pp0.w, 0.0)), 0.0);\n}\n}",r.tlineFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform vec4 uColor2;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 c=texture2D(uSampler, vTexCoord)*uColor;\ngl_FragColor = c;\n}",r.tblineFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform vec4 uColor2;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 c1=texture2D(uSampler, vTexCoord)*uColor;\nvec4 c2=uColor2,c=c1;\nc.xyz*=c.w; c2.xyz*=c2.w;\nc=mix(c,c2,1.0-c.w);\nc.xyz/=(c.w+0.00001);\nc.w=max(c1.w,c2.w);\ngl_FragColor = c;\n}",r.polygonVertexShader="attribute vec3 aPosition;\nattribute vec3 aNormal;\nuniform mat4 uMVP;\nuniform mat4 uRot;\nuniform vec4 uColor;\nvarying vec4 vColor;\nvoid main(){ \nfloat l = dot((uRot*vec4(aNormal,1.0)).xyz, vec3(0.0,0.0,1.0)) * 0.5;\nvec3 c = uColor.xyz;\nc = (l > 0.0) ? mix(c,vec3(1.0,1.0,1.0),l) : mix(vec3(0.0,0.0,0.0),c,1.0+l);\nvColor = vec4(c, uColor.w);\ngl_Position = uMVP * vec4(aPosition, 1.0);\n}",r.polygonFragmentShader="precision mediump float;\nvarying vec4 vColor;\nvoid main() {\ngl_FragColor = vColor;\n}",r.textVertexShader="attribute vec4 aPosition;\nattribute vec4 aTexCoord;\nuniform mat4 uMVP;\nuniform vec4 uVec;\nvarying vec2 vTexCoord;\nvoid main(){ \nvTexCoord = aTexCoord.xy;\nif (dot(uVec.xyz, vec3(aTexCoord.z, aTexCoord.w, aPosition.w)) < 0.0) {\ngl_Position = uMVP * vec4(2.0, 0.0, 0.0, 1.0);\n}else{\ngl_Position = uMVP * vec4(aPosition.xyz, 1.0);\n}\n}",r.text2VertexShader="attribute vec4 aPosition;\nattribute vec4 aTexCoord;\nuniform mat4 uMVP;\nuniform vec4 uVec;\nuniform float uFile;\nvarying vec2 vTexCoord;\nvoid main(){ \nvTexCoord = aTexCoord.xy;\nif (dot(uVec.xyz, vec3(aTexCoord.z, aTexCoord.w, aPosition.w)) < 0.0) {\ngl_Position = uMVP * vec4(8.0, 0.0, 0.0, 1.0);\n}else{\nfloat file = floor(aTexCoord.y/4.0);\nvTexCoord.y = mod(aTexCoord.y,4.0);\nif (file != floor(uFile)) {\ngl_Position = uMVP * vec4(8.0, 0.0, 0.0, 1.0);\n}else{\ngl_Position = uMVP * vec4(aPosition.xyz, 1.0);\n}\n}\n}",r.iconVertexShader="attribute vec4 aPosition;\nattribute vec4 aTexCoord;\nattribute vec3 aOrigin;\nuniform mat4 uMVP;\nuniform vec4 uScale;\nvarying vec2 vTexCoord;\nvoid main(){ \nvTexCoord = aTexCoord.xy * uScale[2];\nvec4 pos = (uMVP * vec4(aOrigin, 1.0));\ngl_Position = pos + vec4(aPosition.x*uScale.x*pos.w, (aPosition.y+uScale.w)*uScale.y*pos.w, 0.0, 0.0);\n}",r.icon2VertexShader="attribute vec4 aPosition;\nattribute vec4 aTexCoord;\nattribute vec3 aOrigin;\nuniform mat4 uMVP;\nuniform vec4 uScale;\nuniform float uFile;\nvarying vec2 vTexCoord;\nvoid main(){ \nvTexCoord = aTexCoord.xy * uScale[2];\nfloat file = floor(aTexCoord.y/4.0);\nvTexCoord.y = mod(aTexCoord.y,4.0);\nif (file != floor(uFile)) {\ngl_Position = uMVP * vec4(8.0, 0.0, 0.0, 1.0);\n}else{\nvec4 pos = (uMVP * vec4(aOrigin, 1.0));\ngl_Position = pos + vec4(aPosition.x*uScale.x*pos.w, (aPosition.y+uScale.w)*uScale.y*pos.w, 0.0, 0.0);\n}}",r.textFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 c=texture2D(uSampler, vTexCoord);\nif(c.w < 0.01){ discard; }\ngl_FragColor = c*uColor;\n}",r.text2FragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform vec2 uParams;\nconst vec4 uColor1 = vec4(1.0, 1.0, 1.0, 1.0);\nconst vec4 uColor2 = vec4(0.0, 0.0, 0.0, 1.0);\nvarying vec2 vTexCoord;\nfloat round(float x) { return floor(x + 0.5); }\nvoid main() {\nvec4 mask;\nint i=int(floor(vTexCoord.y));\nif (i == 0) mask=vec4(1.0,0.0,0.0,0.0);else\nif (i == 1) mask=vec4(0.0,1.0,0.0,0.0);else\nif (i == 2) mask=vec4(0.0,0.0,1.0,0.0);\nif (i == 3) mask=vec4(0.0,0.0,0.0,1.0);\nvec2 uv=(vTexCoord);\nuv.y=fract(uv.y);\nvec4 c=vec4(dot(mask, texture2D(uSampler, uv)));\nfloat u_buffer = uParams[0];\nfloat u_gamma = uParams[1];\nfloat alpha = uColor.a * smoothstep(u_buffer - u_gamma, u_buffer + u_gamma, c.r);\nif(alpha < 0.01){ discard; }\ngl_FragColor = vec4(uColor.rgb, alpha);\n}",r.skydomeVertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uMVP;\nvarying vec2 vTexCoord;\nvoid main(){ \ngl_Position = uMVP * vec4(aPosition, 1.0);\nvTexCoord = aTexCoord;\n}",r.skydomeFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nvarying vec2 vTexCoord;\nconst vec4 gray = vec4(0.125, 0.125, 0.125, 1.0);\nvoid main() {\nfloat fade = smoothstep(0.51, 0.55, vTexCoord.t);\ngl_FragColor = mix(texture2D(uSampler, vTexCoord), gray, fade);\n}",r.stardomeFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uSampler, vTexCoord);\n}",r.atmoVertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uMV, uProj;\nuniform mat3 uNorm;\nvarying vec3 vNormal;\nvarying vec4 vPosition;\nvoid main(){ \nvec4 camSpacePos = uMV * vec4(aPosition, 1.0);\ngl_Position = uProj * camSpacePos;\nvec4 c = uMV * vec4(aPosition, 1.0);\nvNormal = (aPosition.xyz - vec3(0.5));\nvPosition = camSpacePos;\n}",r.atmoFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform vec4 uParams;\nuniform vec4 uParams2;\nvarying vec4 vPosition;\nvarying vec3 vNormal;\nuniform vec4 uFogColor;\nuniform vec4 uFogColor2;\nvoid main() {\nfloat l = dot(normalize(vNormal),-uParams2.xyz);\nl = (1.0-pow(abs(l),uParams.x));\nvec4 c = mix(uFogColor2, uFogColor, l);\ngl_FragColor = vec4(c.xyz, c.w*l);\n}",r.atmoFragmentShader2="precision mediump float;\nuniform sampler2D uSampler;\nuniform float uNFactor;\nuniform vec2 uRadius;\nuniform vec3 uPos;\nvarying vec4 vPosition;\nvarying vec3 vNormal;\nuniform vec4 uFogColor;\nvoid main() {\nvec3 ldir = normalize(-vPosition.xyz);\nvec3 diff = uPos;\nfloat a = dot(ldir, ldir);\nfloat b = 2 * dot(ldir, diff);\nfloat c = dot(diff, diff) - (uRadius[0] * uRadius[0]);\nfloat i = 0;\nfloat discr = b * b - 4 * a * c;\nif (discr > 0.0) {}\n}\ngl_FragColor = uFogColor;\n}",r.atmoVertexShader3="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uMV, uProj;\nuniform vec4 uParams;\nuniform vec4 uParams2;\nvarying vec2 vTexcoords;\nvoid main(){ \ngl_Position = uProj * (uMV * vec4(aPosition, 1.0));\nvec3 position = (aPosition.xyz - vec3(0.5)) * vec3(uParams.w * 2.0);\nvec4 camPos = uParams2;\nfloat SurfaceRadius = uParams.x;\nfloat AtmosphereRadius = uParams.y;\nfloat StretchAmt = uParams.z;\nfloat camHeight = length(camPos.xyz);\nvec3 camToPos = position - camPos.xyz;\nfloat farDist = length(camToPos);\nfloat altitude = max(0.0,camHeight - SurfaceRadius);\nfloat horizonDist = sqrt((altitude*altitude) + (2.0 * SurfaceRadius * altitude));\nfloat maxDot = horizonDist / camHeight;\naltitude = max(0.0,camHeight - AtmosphereRadius);\nhorizonDist = sqrt((altitude*altitude) + (2.0 * AtmosphereRadius * altitude));\nfloat tweakAmount = 0.1;\nfloat minDot = max(tweakAmount,horizonDist / camHeight);\nfloat minDot2 = ((camHeight - SurfaceRadius) * (1.0 / (AtmosphereRadius - SurfaceRadius))) - (1.0 - tweakAmount);\nminDot = min(minDot, minDot2);\nfloat posDot = dot(camToPos / farDist,-camPos.xyz / camHeight) - minDot;\nfloat height = posDot * (1.0 / (maxDot - minDot));\nvTexcoords.y = height;\nheight -= min(0.0,minDot2 + ((1.0 + StretchAmt) * minDot2));\nvTexcoords.x = height;\n}",r.atmoFragmentShader3="precision mediump float;\nvarying vec2 vTexcoords;\nuniform vec4 uParams3;\nuniform vec4 uFogColor;\nuniform vec4 uFogColor2;\nconst vec4 fogColor3 = vec4(0.0/255.0, 0.0/255.0, 0.0/255.0, 1.0);\nvoid main() {\nfloat l = vTexcoords.y;\nif (l > uParams3.z){ discard; } else {\nfloat l2 = clamp((l*l)*0.9+0.1, 0.0, 1.5);\nvec4 c = mix(uFogColor2, uFogColor, l2);\ngl_FragColor = vec4(c.xyz, c.w*l);\nif (l > uParams3.x){ gl_FragColor.xyz = mix(gl_FragColor.xyz, fogColor3.xyz, (l-uParams3.x)*uParams3.y); }\n}}",r.heightmapVertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uMV, uProj;\nuniform float uFogDensity;\nuniform mat4 uGridMat;\nuniform float uGridStep1, uGridStep2;\nconst int HMSize = 5;\nconst float HMSize1 = float(HMSize-1);\nuniform float uHeight[HMSize*HMSize];\nvarying vec2 vTexCoord1;\nvarying vec2 vTexCoord2;\nvarying float vFogFactor;\nfloat round(float x) { return floor(x + 0.5); }\nvoid main() {\nvec3 pos = aPosition;\nfloat z = uHeight[int(round(pos.y*HMSize1)*float(HMSize) + round(pos.x*HMSize1))];\nvec4 camSpacePos = uMV * vec4(pos.xy, z, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = exp(uFogDensity * camDist);\nvec4 gridCoord = uGridMat * vec4(pos, 1.0);\nvTexCoord1 = aTexCoord;\nvTexCoord1 = gridCoord.xy * vec2(uGridStep1);\nvTexCoord2 = gridCoord.xy * vec2(uGridStep2);\n}",r.heightmapFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform float uGridBlend;\nvarying vec2 vTexCoord1;\nvarying vec2 vTexCoord2;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nvoid main() {\nvec4 gridColor = mix(texture2D(uSampler, vTexCoord1), texture2D(uSampler, vTexCoord2), uGridBlend);\ngl_FragColor = mix(uFogColor, gridColor, vFogFactor);\n}",r.heightmapDepthVertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uMV, uProj;\nuniform float uFogDensity;\nuniform mat4 uGridMat;\nuniform float uGridStep1, uGridStep2;\nconst int HMSize = 5;\nconst float HMSize1 = float(HMSize-1);\nuniform float uHeight[HMSize*HMSize];\nvarying vec2 vTexCoord1;\nvarying vec2 vTexCoord2;\nvarying float vDepth;\nfloat round(float x) { return floor(x + 0.5); }\nvoid main() {\nvec3 pos = aPosition;\nfloat z = uHeight[int(round(pos.y*HMSize1)*float(HMSize) + round(pos.x*HMSize1))];\nvec4 camSpacePos = uMV * vec4(pos.xy, z, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvDepth = camDist;\nvec4 gridCoord = uGridMat * vec4(pos, 1.0);\nvTexCoord1 = aTexCoord;\nvTexCoord1 = gridCoord.xy * vec2(uGridStep1);\nvTexCoord2 = gridCoord.xy * vec2(uGridStep2);\n}",r.heightmapDepthFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform float uGridBlend;\nvarying vec2 vTexCoord1;\nvarying vec2 vTexCoord2;\nvarying float vDepth;\nvoid main() {\ngl_FragColor = fract(vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0) * vDepth) + (-0.5/255.0);\n}",r.planeVertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uMV, uProj;\nuniform vec4 uParams;\nuniform vec4 uParams3;\nuniform float uPoints[9*3];\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvarying float vFogFactor;\nvec3 quadPoint(int i1, int i2, int i3, float t, float t2) {\nfloat p1x = uPoints[i1], p1y = uPoints[i1+1], p1z = uPoints[i1+2];\nfloat p3x = uPoints[i3], p3y = uPoints[i3+1], p3z = uPoints[i3+2];\nfloat p2x = 2.0*uPoints[i2]-p1x*0.5-p3x*0.5;\nfloat p2y = 2.0*uPoints[i2+1]-p1y*0.5-p3y*0.5;\nfloat p2z = 2.0*uPoints[i2+2]-p1z*0.5-p3z*0.5;\nreturn vec3(t2*t2*p1x+2.0*t2*t*p2x+t*t*p3x, t2*t2*p1y+2.0*t2*t*p2y+t*t*p3y, t2*t2*p1z+2.0*t2*t*p2z+t*t*p3z); }\nvoid main() {\nvec3 indices = aPosition;\nfloat t = aPosition.y * uParams[2];\nfloat t2 = (1.0-t);\nvec3 p1 = quadPoint(0, 3, 6, t, t2);\nvec3 p2 = quadPoint(9, 9+3, 9+6, t, t2);\nvec3 p3 = quadPoint(18, 18+3, 18+6, t, t2);\nt = aPosition.x * uParams[2];\nt2 = (1.0-t);\nfloat p2x = 2.0*p2.x-p1.x*0.5-p3.x*0.5;\nfloat p2y = 2.0*p2.y-p1.y*0.5-p3.y*0.5;\nfloat p2z = 2.0*p2.z-p1.z*0.5-p3.z*0.5;\nvec4 p = vec4(t2*t2*p1.x+2.0*t2*t*p2x+t*t*p3.x, t2*t2*p1.y+2.0*t2*t*p2y+t*t*p3.y, t2*t2*p1.z+2.0*t2*t*p2z+t*t*p3.z, 1);\nvec4 camSpacePos = uMV * p;\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = exp(uParams[1] * camDist);\nvec2 uv = aTexCoord;\nuv.x = uv.x * uParams3[2] + uParams3[0];\nuv.y = uv.y * uParams3[3] + uParams3[1];\nvTexCoord = uv;\n}",r.planeFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform vec4 uParams2;\nvarying vec2 vTexCoord;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nvoid main() {\nvec4 c = mix(texture2D(uSampler, vTexCoord), texture2D(uSampler, vTexCoord*8.0), uParams2[2]);\ngl_FragColor = mix(uFogColor, c, vFogFactor);\n}",r.planeVertex2Shader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uMV, uProj;\nuniform vec4 uParams;\nuniform vec4 uParams3;\nuniform float uPoints[9*3];\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvarying float vFogFactor;\nvec3 quadPoint(int i1, int i2, int i3, float t, float t2) {\nfloat p1x = uPoints[i1], p1y = uPoints[i1+1], p1z = uPoints[i1+2];\nfloat p3x = uPoints[i3], p3y = uPoints[i3+1], p3z = uPoints[i3+2];\nfloat p2x = 2.0*uPoints[i2]-p1x*0.5-p3x*0.5;\nfloat p2y = 2.0*uPoints[i2+1]-p1y*0.5-p3y*0.5;\nfloat p2z = 2.0*uPoints[i2+2]-p1z*0.5-p3z*0.5;\nreturn vec3(t2*t2*p1x+2.0*t2*t*p2x+t*t*p3x, t2*t2*p1y+2.0*t2*t*p2y+t*t*p3y, t2*t2*p1z+2.0*t2*t*p2z+t*t*p3z); }\nvoid main() {\nvec3 indices = aPosition;\nfloat t = aPosition.y * uParams[2];\nfloat t2 = (1.0-t);\nvec3 p1 = quadPoint(0, 3, 6, t, t2);\nvec3 p2 = quadPoint(9, 9+3, 9+6, t, t2);\nvec3 p3 = quadPoint(18, 18+3, 18+6, t, t2);\nt = aPosition.x * uParams[2];\nt2 = (1.0-t);\nfloat p2x = 2.0*p2.x-p1.x*0.5-p3.x*0.5;\nfloat p2y = 2.0*p2.y-p1.y*0.5-p3.y*0.5;\nfloat p2z = 2.0*p2.z-p1.z*0.5-p3.z*0.5;\nvec4 p = vec4(t2*t2*p1.x+2.0*t2*t*p2x+t*t*p3.x, t2*t2*p1.y+2.0*t2*t*p2y+t*t*p3.y, t2*t2*p1.z+2.0*t2*t*p2z+t*t*p3.z, 1);\nvec4 camSpacePos = uMV * p;\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = exp(uParams[1] * camDist);\nvec2 uv = aTexCoord;\nuv.x = uv.x * uParams3[2] + uParams3[0];\nuv.y = uv.y * uParams3[3] + uParams3[1];\nvTexCoord = uv;\nvTexCoord2 = p.xy;\n}",r.planeFragment2Shader="precision mediump float;\nuniform sampler2D uSampler;\nuniform vec4 uParams2;\nuniform vec4 uParams4;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nvoid main() {\nif (length(uParams4.xy - vTexCoord2.xy) > uParams4.z){ discard; }vec4 c = mix(texture2D(uSampler, vTexCoord), texture2D(uSampler, vTexCoord*8.0), uParams2[2]);\ngl_FragColor = mix(uFogColor, c, vFogFactor);\n}",r.planeVertex3Shader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uMV, uProj;\nuniform vec4 uParams;\nuniform vec4 uParams3;\nuniform float uPoints[9*3];\nuniform vec3 uVector;\nuniform float uHeights[9];\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvarying float vFogFactor;\nvec3 quadPoint(int i1, int i2, int i3, float t, float t2) {\nfloat p1x = uPoints[i1], p1y = uPoints[i1+1], p1z = uPoints[i1+2];\nfloat p3x = uPoints[i3], p3y = uPoints[i3+1], p3z = uPoints[i3+2];\nfloat p2x = 2.0*uPoints[i2]-p1x*0.5-p3x*0.5;\nfloat p2y = 2.0*uPoints[i2+1]-p1y*0.5-p3y*0.5;\nfloat p2z = 2.0*uPoints[i2+2]-p1z*0.5-p3z*0.5;\nreturn vec3(t2*t2*p1x+2.0*t2*t*p2x+t*t*p3x, t2*t2*p1y+2.0*t2*t*p2y+t*t*p3y, t2*t2*p1z+2.0*t2*t*p2z+t*t*p3z); }\nfloat linearHeight(float x, float y) {\nint ix = int(x);\nint iy = int(y);\nint index = (2-iy)*3+ix;\nint index2 = (2-(iy+1))*3+ix;\nfloat fx = fract(x);\nfloat fy = fract(y);\nfloat w0 = (uHeights[index] + (uHeights[index+1] - uHeights[index])*fx);\nfloat w1 = (uHeights[index2] + (uHeights[index2+1] - uHeights[index2])*fx);\nreturn (w0 + (w1 - w0)*fy);\n}\nvoid main() {\nvec3 indices = aPosition;\nfloat t = aPosition.y * uParams[2];\nfloat tt = t;\nfloat t2 = (1.0-t);\nvec3 p1 = quadPoint(0, 3, 6, t, t2);\nvec3 p2 = quadPoint(9, 9+3, 9+6, t, t2);\nvec3 p3 = quadPoint(18, 18+3, 18+6, t, t2);\nt = aPosition.x * uParams[2];\nfloat tt2 = t;\nt2 = (1.0-t);\nfloat p2x = 2.0*p2.x-p1.x*0.5-p3.x*0.5;\nfloat p2y = 2.0*p2.y-p1.y*0.5-p3.y*0.5;\nfloat p2z = 2.0*p2.z-p1.z*0.5-p3.z*0.5;\nvec4 p = vec4(t2*t2*p1.x+2.0*t2*t*p2x+t*t*p3.x, t2*t2*p1.y+2.0*t2*t*p2y+t*t*p3.y, t2*t2*p1.z+2.0*t2*t*p2z+t*t*p3.z, 1);\np.xyz += uVector * linearHeight(tt*2.0, tt2*2.0);\nvec4 camSpacePos = uMV * p;\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = exp(uParams[1] * camDist);\nvec2 uv = aTexCoord;\nuv.x = uv.x * uParams3[2] + uParams3[0];\nuv.y = uv.y * uParams3[3] + uParams3[1];\nvTexCoord = uv;\n}",r.tileVertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uMV, uMV2, uProj;\nuniform vec4 uParams;\nuniform vec4 uCamVec;\nvarying vec2 vTexCoord;\nvarying float vFogFactor;\nvoid main() {\nvec4 camSpacePos = uMV * vec4(aPosition, 1.0);\nvec4 worldPos = uMV2 * vec4(aPosition, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = 1.0-exp(uParams[1] * camDist);\nvTexCoord = aTexCoord;\nfloat l = dot(normalize(worldPos.xyz),uCamVec.xyz);\nvFogFactor = clamp((1.0-abs(l))*uCamVec.w + vFogFactor, 0.0, 1.0);\n}",r.tileFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nvarying vec2 vTexCoord;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nvoid main() {\ngl_FragColor = mix(texture2D(uSampler, vTexCoord), uFogColor, vFogFactor);\n}",r.tile2VertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord2;\nuniform mat4 uMV, uMV2, uProj;\nuniform vec4 uParams;\nuniform vec4 uCamVec;\nuniform vec4 uTransform;\nvarying vec2 vTexCoord;\nvarying float vFogFactor;\nvoid main() {\nvec4 camSpacePos = uMV * vec4(aPosition, 1.0);\nvec4 worldPos = uMV2 * vec4(aPosition, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = 1.0-exp(uParams[1] * camDist);\nvTexCoord = vec2(uTransform[0] * aTexCoord2[0] + uTransform[2], uTransform[1] * aTexCoord2[1] + uTransform[3]);\nfloat l = dot(normalize(worldPos.xyz),uCamVec.xyz);\nvFogFactor = clamp((1.0-abs(l))*uCamVec.w + vFogFactor, 0.0, 1.0);\n}",r.tile2FragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform float uAlpha;\nvarying vec2 vTexCoord;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nvoid main() {\nvec4 c = texture2D(uSampler, vTexCoord);\ngl_FragColor = mix(c, uFogColor, vFogFactor);\ngl_FragColor[3] = c.w * uAlpha;\n}",r.tile3FragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nuniform sampler2D uSampler2;\nuniform float uAlpha;\nvarying vec2 vTexCoord;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nvoid main() {\nvec4 c = texture2D(uSampler, vTexCoord);\nvec4 c2 = texture2D(uSampler2, vTexCoord);\ngl_FragColor = mix(c, uFogColor, vFogFactor);\ngl_FragColor[3] = c.w * uAlpha * c2.x;\n}",r.fogTileVertexShader="attribute vec3 aPosition;\nuniform mat4 uMV, uMV2, uProj;\nuniform vec4 uParams;\nuniform vec4 uCamVec;\nvarying float vFogFactor;\nvoid main() {\nvec4 camSpacePos = uMV * vec4(aPosition, 1.0);\nvec4 worldPos = uMV2 * vec4(aPosition, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = 1.0-exp(uParams[1] * camDist);\nfloat l = dot(normalize(worldPos.xyz),uCamVec.xyz);\nvFogFactor = clamp((1.0-abs(l))*uCamVec.w + vFogFactor, 0.0, 1.0);\n}",r.fogTileFragmentShader="precision mediump float;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nvoid main() {\ngl_FragColor = vec4(uFogColor.xyz, vFogFactor);\n}",r.tileTShadedVertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nattribute vec3 aNormal;\nuniform mat4 uMV, uProj;\nuniform mat3 uNorm;\nuniform float uFogDensity;\nvarying vec2 vTexCoord;\nvarying vec4 vPosition;\nvarying vec3 vNormal;\nvarying float vFogFactor;\nvoid main() {\nvec4 camSpacePos = uMV * vec4(aPosition, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = exp(uFogDensity * camDist);\nvTexCoord = aTexCoord;\nvPosition = camSpacePos;\nvNormal = aNormal * uNorm;\n}",r.tileTShadedFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nvarying vec2 vTexCoord;\nvarying vec4 vPosition;\nvarying vec3 vNormal;\nuniform mat4 uMaterial;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nvoid main() {\nvec3 ldir = normalize(-vPosition.xyz);\nvec3 normal = normalize(vNormal);\nvec3 eyeDir = ldir;\nvec3 refDir = reflect(-ldir, normal);\nfloat specW = min(1.0, pow(max(dot(refDir, eyeDir), 0.0), uMaterial[3][0]));\nfloat diffW = min(1.0, max(dot(normal, ldir), 0.0));\nvec4 lcolor = uMaterial[0]+(uMaterial[1]*diffW)+(uMaterial[2]*specW);\nvec4 tcolor = texture2D(uSampler, vTexCoord);\ngl_FragColor = mix(uFogColor, vec4(lcolor.xyz*(1.0/255.0), 1.0) * tcolor, vFogFactor); gl_FragColor.w *= uMaterial[3][1];\n}",r.tileShadedFragmentShader="precision mediump float;\nvarying vec2 vTexCoord;\nvarying vec4 vPosition;\nvarying vec3 vNormal;\nuniform mat4 uMaterial;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nvoid main() {\nvec3 ldir = normalize(-vPosition.xyz);\nvec3 normal = normalize(vNormal);\nvec3 eyeDir = ldir;\nvec3 refDir = reflect(-ldir, normal);\nfloat specW = min(1.0,pow(max(dot(refDir, eyeDir), 0.0), uMaterial[3][0]));\nfloat diffW = min(1.0,max(dot(normal, ldir), 0.0));\nvec4 lcolor = uMaterial[0]+(uMaterial[1]*diffW)+(uMaterial[2]*specW);\ngl_FragColor = mix(uFogColor, vec4(lcolor.xyz*(1.0/255.0), 1.0), vFogFactor); gl_FragColor.w = uMaterial[3][1];\n}",r.tileFlatShadeVertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nattribute vec3 aBarycentric;\nuniform mat4 uMV, uProj;\nuniform float uFogDensity;\nvarying vec2 vTexCoord;\nvarying vec3 vBarycentric;\nvarying float vFogFactor;\nvoid main() {\nvec4 camSpacePos = uMV * vec4(aPosition, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = exp(uFogDensity * camDist);\nvTexCoord = aTexCoord;\nvBarycentric = camSpacePos.xyz;\n}",r.tileFlatShadeFragmentShader="precision mediump float;\n#extension GL_OES_standard_derivatives : enable\nuniform sampler2D uSampler;\nvarying vec2 vTexCoord;\nvarying vec3 vBarycentric;\nvarying float vFogFactor;\nvoid main() {\n#ifdef GL_OES_standard_derivatives\nvec3 nx = dFdx(vBarycentric);\nvec3 ny = dFdy(vBarycentric);\nvec3 normal=normalize(cross(nx,ny));\ngl_FragColor = vec4(vec3(max(0.0,normal.z*(204.0/255.0))+(32.0/255.0)),1.0);\n#else\ngl_FragColor = vec4(1.0,1.0,1.0,1.0);\n#endif\n}",r.tileWireframeVertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord;\nattribute vec3 aBarycentric;\nuniform mat4 uMV, uProj;\nuniform float uFogDensity;\nvarying vec2 vTexCoord;\nvarying vec3 vBarycentric;\nvarying float vFogFactor;\nvoid main() {\nvec4 camSpacePos = uMV * vec4(aPosition, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = exp(uFogDensity * camDist);\nvTexCoord = aTexCoord;\nvBarycentric = aBarycentric;\n}",r.tileWireframeFragmentShader="precision mediump float;\n#extension GL_OES_standard_derivatives : enable\nuniform sampler2D uSampler;\nvarying vec2 vTexCoord;\nvarying vec3 vBarycentric;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nfloat edgeFactor(){\n#ifdef GL_OES_standard_derivatives\nvec3 d = fwidth(vBarycentric);\nvec3 a3 = smoothstep(vec3(0.0), d*1.0, vBarycentric);\nreturn min(min(a3.x, a3.y), a3.z);\n#else\nfloat a = min(min(vBarycentric.x, vBarycentric.y), vBarycentric.z);\nreturn a > 0.1 ? 1.0 : smoothstep(0.0,1.0,a*10.0);\n#endif\n}\nvoid main() {\ngl_FragColor = mix(uFogColor, vec4( mix(vec3(0.0), texture2D(uSampler, vTexCoord).rgb, edgeFactor()) , 1.0), vFogFactor);\n}",r.tileWireframe2FragmentShader="precision mediump float;\n#extension GL_OES_standard_derivatives : enable\nuniform sampler2D uSampler;\nvarying vec2 vTexCoord;\nvarying vec3 vBarycentric;\nvarying float vFogFactor;\nuniform vec4 uFogColor;\nfloat edgeFactor(){\n#ifdef GL_OES_standard_derivatives\nvec3 d = fwidth(vBarycentric);\nvec3 a3 = smoothstep(vec3(0.0), d*1.0, vBarycentric);\nreturn min(min(a3.x, a3.y), a3.z);\n#else\nfloat a = min(min(vBarycentric.x, vBarycentric.y), vBarycentric.z);\nreturn a > 0.1 ? 1.0 : smoothstep(0.0,1.0,a*10.0);\n#endif\n}\nvoid main() {\nif (edgeFactor() < 0.5){ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); } else { discard; }}",r.tileWireframe3VertexShader="attribute vec3 aPosition;\nattribute vec2 aTexCoord2;\nattribute vec3 aBarycentric;\nuniform mat4 uMV, uProj;\nuniform float uFogDensity;\nvarying vec2 vTexCoord;\nvarying vec3 vBarycentric;\nvarying float vFogFactor;\nvoid main() {\nvec4 camSpacePos = uMV * vec4(aPosition, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvFogFactor = exp(uFogDensity * camDist);\nvTexCoord = aTexCoord2;\nvBarycentric = aBarycentric;\n}",r.tileDepthVertexShader="attribute vec3 aPosition;\nuniform mat4 uMV, uProj;\nvarying float vDepth;\nvoid main() {\nvec4 camSpacePos = uMV * vec4(aPosition, 1.0);\ngl_Position = uProj * camSpacePos;\nfloat camDist = length(camSpacePos.xyz);\nvDepth = camDist;\n}",r.tileDepthFragmentShader="precision mediump float;\nuniform sampler2D uSampler;\nvarying float vDepth;\nvoid main() {\ngl_FragColor = fract(vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0) * vDepth) + (-0.5/255.0);\n}",r.imageVertexShader="\nattribute vec4 aPosition;\nuniform mat4 uProjectionMatrix;\nuniform mat4 uData;\nuniform vec4 uColor;\nuniform float uDepth;\nvarying vec4 vColor;\nvarying vec2 vTexcoords;\nvoid main(void){\nint i=int(aPosition.x);\nif(i==0) gl_Position=uProjectionMatrix*vec4(floor(uData[0][0]+0.1),floor(uData[0][1]+0.1),uDepth,1.0), vTexcoords=vec2(uData[0][2], uData[0][3]);\nif(i==1) gl_Position=uProjectionMatrix*vec4(floor(uData[1][0]+0.1),floor(uData[1][1]+0.1),uDepth,1.0), vTexcoords=vec2(uData[1][2], uData[1][3]);\nif(i==2) gl_Position=uProjectionMatrix*vec4(floor(uData[2][0]+0.1),floor(uData[2][1]+0.1),uDepth,1.0), vTexcoords=vec2(uData[2][2], uData[2][3]);\nif(i==3) gl_Position=uProjectionMatrix*vec4(floor(uData[3][0]+0.1),floor(uData[3][1]+0.1),uDepth,1.0), vTexcoords=vec2(uData[3][2], uData[3][3]);\nvec4 c=uColor;\nc.w*=1.0;\nvColor=c;\n}",r.imageFragmentShader="precision mediump float;\nvarying vec4 vColor;\nvarying vec2 vTexcoords;\nuniform sampler2D uSampler;\nvoid main(void){\nvec4 c=texture2D(uSampler, vec2(vTexcoords.x, vTexcoords.y) );\nc*=vColor;\nif(c.w < 0.01){ discard; }\ngl_FragColor = c;\n}",e.a=r},function(t,e,i){"use strict";var r=i(156),s=i(157),a=i(56),n=i(32),o=i(160),h=i(57),l=i(161),u=i(6),c=r.a,d=s.a,p=(a.a,n.a),f=o.a,g=h.a,m=l.a,v=u.a,y=function(t){this.renderer=t,this.core=t.core,this.gpu=t.gpu,this.initShaders(),this.initHeightmap(),this.initSkydome(),this.initHitmap(),this.initTextMap(),this.initImage(),this.initTestMap(),this.initBBox(),this.initLines(),this.initBaricentricBuffer()};y.prototype.initShaders=function(){var t=m,e=this.renderer,i=this.gpu;e.progTile=new g(i,t.tileVertexShader,t.tileFragmentShader),e.progTile2=new g(i,t.tile2VertexShader,t.tile2FragmentShader),e.progTile3=new g(i,t.tile2VertexShader,t.tile3FragmentShader),e.progShadedTile=new g(i,t.tileTShadedVertexShader,t.tileShadedFragmentShader),e.progTShadedTile=new g(i,t.tileTShadedVertexShader,t.tileTShadedFragmentShader),e.progFogTile=new g(i,t.fogTileVertexShader,t.fogTileFragmentShader),e.progWireframeTile=new g(i,t.tileWireframeVertexShader,t.tileWireframeFragmentShader),e.progWireframeTile2=new g(i,t.tileWireframeVertexShader,t.tileWireframe2FragmentShader),e.progWireframeTile3=new g(i,t.tileWireframe3VertexShader,t.tileWireframeFragmentShader),e.progFlatShadeTile=new g(i,t.tileFlatShadeVertexShader,t.tileFlatShadeFragmentShader),e.progHeightmap=new g(i,t.heightmapVertexShader,t.heightmapFragmentShader),e.progPlane=new g(i,t.planeVertexShader,t.planeFragmentShader),e.progPlane2=new g(i,t.planeVertex2Shader,t.planeFragment2Shader),e.progPlane3=new g(i,t.planeVertex3Shader,t.planeFragmentShader),e.progSkydome=new g(i,t.skydomeVertexShader,t.skydomeFragmentShader),e.progStardome=new g(i,t.skydomeVertexShader,t.stardomeFragmentShader),e.progAtmo2=new g(i,t.atmoVertexShader,t.atmoFragmentShader),e.progAtmo=new g(i,t.atmoVertexShader3,t.atmoFragmentShader3),e.progDepthTile=new g(i,t.tileDepthVertexShader,t.tileDepthFragmentShader),e.progDepthHeightmap=new g(i,t.heightmapDepthVertexShader,t.heightmapDepthFragmentShader),e.progBBox=new g(i,t.bboxVertexShader,t.bboxFragmentShader),e.progBBox2=new g(i,t.bbox2VertexShader,t.bboxFragmentShader),e.progLine=new g(i,t.lineVertexShader,t.lineFragmentShader),e.progELine=new g(i,t.elineVertexShader,t.elineFragmentShader),e.progLine3=new g(i,t.line3VertexShader,t.lineFragmentShader),e.progELine3=new g(i,t.eline3VertexShader,t.elineFragmentShader),e.progLine4=new g(i,t.line4VertexShader,t.lineFragmentShader),e.progRLine=new g(i,t.rlineVertexShader,t.lineFragmentShader),e.progERLine=new g(i,t.erlineVertexShader,t.elineFragmentShader),e.progTLine=new g(i,t.tlineVertexShader,t.tlineFragmentShader),e.progTPLine=new g(i,t.tplineVertexShader,t.tlineFragmentShader),e.progTBLine=new g(i,t.tlineVertexShader,t.tblineFragmentShader),e.progTPBLine=new g(i,t.tplineVertexShader,t.tblineFragmentShader),e.progETLine=new g(i,t.etlineVertexShader,t.elineFragmentShader),e.progETPLine=new g(i,t.etplineVertexShader,t.elineFragmentShader),e.progLineWireframe=new g(i,t.lineWireframeVertexShader,t.lineWireframeFragmentShader),e.progPolygon=new g(i,t.polygonVertexShader,t.polygonFragmentShader),e.progText=new g(i,t.textVertexShader,t.textFragmentShader),e.progText2=new g(i,t.text2VertexShader,t.text2FragmentShader),e.progImage=new g(i,t.imageVertexShader,t.imageFragmentShader),e.progIcon=new g(i,t.iconVertexShader,t.textFragmentShader),e.progIcon2=new g(i,t.icon2VertexShader,t.text2FragmentShader)},y.prototype.initHeightmap=function(){var t=this.renderer,e=this.gpu,i=c.buildHeightmap(5);t.heightmapMesh=new p(e,i,null,this.core),i=c.buildPlane(16),t.planeMesh=new p(e,i,null,this.core);for(var r=new Uint8Array(16384),s=0;s<64;s++)for(var a=0;a<64;a++){var n=4*(64*s+a);s<1||s>=63||a<1||a>=63?(r[n]=255,r[n+1]=255,r[n+2]=255):(r[n]=32,r[n+1]=32,r[n+2]=32),r[n+3]=255}t.heightmapTexture=new v(e),t.heightmapTexture.createFromData(64,64,r,"trilinear",!0)},y.prototype.initHitmap=function(){var t=this.renderer,e=t.hitmapSize,i=new Uint8Array(e*e*4);t.hitmapTexture=new v(this.gpu),t.hitmapTexture.createFromData(e,e,i),t.hitmapTexture.createFramebuffer(e,e),t.geoHitmapTexture=new v(this.gpu),t.geoHitmapTexture.createFromData(e,e,i),t.geoHitmapTexture.createFramebuffer(e,e),t.geoHitmapTexture2=new v(this.gpu),t.geoHitmapTexture2.createFromData(e,e,i),t.geoHitmapTexture2.createFramebuffer(e,e)},y.prototype.initTestMap=function(){var t,e,i,r=this.renderer,s=this.gpu,a=new Uint8Array(1024);for(t=0;t<16;t++)for(e=0;e<16;e++)i=4*(16*t+e),a[i]=255,a[i+1]=0,a[i+2]=0,a[i+3]=255;for(r.redTexture=new v(s),r.redTexture.createFromData(16,16,a),a=new Uint8Array(1024),t=0;t<16;t++)for(e=0;e<16;e++)i=4*(16*t+e),a[i]=255,a[i+1]=255,a[i+2]=255,a[i+3]=255;for(r.whiteTexture=new v(s),r.whiteTexture.createFromData(16,16,a),a=new Uint8Array(1024),t=0;t<16;t++)for(e=0;e<16;e++)i=4*(16*t+e),a[i]=0,a[i+1]=0,a[i+2]=0,a[i+3]=255;r.blackTexture=new v(s),r.blackTexture.createFromData(16,16,a)},y.prototype.initTextMap=function(){this.renderer.textTexture2=new v(this.gpu,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAACACAMAAADTa0c4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFAAAA////pdmf3QAABIFJREFUeNrsnNuyqzAIhsP7v/Se6Yxra0L4OUVNCzetVqP5DAQItrVOiLg95739NnfOaR99RDj6esBw+CKZXiMK4PiuBkAcANoHAP3J5fzzAV2jePQIt6f4Ndb/MIChlVcCEFpAACZPfN4KUAF0/ufboDW3AuBMFgBwHTCfg2ftYgDUKBuA1ABuHKvA2P+5XdONIEt7BO2o2MdlAJoTQOsV6GEAswt0Zq/bsBhdeQQkqEDMwmIAnJHzA8i3ASkWRFKBbADyLGB3mlYD6DyhA4DfBlgsBDtirUPcBgC5woStYMgVtgKATWcB6DskKUEkGFLYrGw3+l3ydR16wKbbPDlWp4Xfo9vZwR1jtOMA6GkABrdvNmt1Vluy6pyvxu4Xt62fquyTggCTsIkCoIuv8gAA08w+ATBXAdSRY56xPDFPx/VPWFZp5v65kFMPgFjP70YASMfRsDn01xLPcwkRq1HLMoK647hR8v+nId74MQBjvIbUQePra42ZVXVcBCR3mIY89mYAlNGLflqA0V1seosCQNMg80B0bsLGAIDNwvFyiqu66ngVGGMGVBwyWwIwpty2DqEr/qf0Bq+DbjYkkcr4VUoOxiRjrYn3YY5SC4BQB/cF0Lq4kD1RCJ+tN4g6Jps5zfWu+QmSz9sUABkA0BIAXocmBwCJ99MDIASATkmtLQAIft4IgE/ZDStZ59yQbOQQAGZWYMbZ3FFCAGRHnwHQznegGAE+zwxNi8kALCOgS9tzAC4jYG1Qo0myRm0Ae/z8eleqewBoZLwfUswCsbT1KgBZD6QAzAEoXUe3K+xxVf2uLf5U3nBeMPRyACW/LtrwVX989id3PRQOG5Io6vh9XwC6stHIdGdJozun03lxNlwvH4u6UgDM8/LmJyx7ak12feEebaXmUwCOYJWk1JcYKsl74HL74wAaH93NqkE1FSKXc4cv0AjaPEEPgE4ru/ieWdvzVq/4psG3AYDFHlEAioQCuEgMgPjK1VDrqlkbTABAiQBGK38B0BlBSf9xtiAJQDM4NtDqMlaeyduTtkDjHgAtEQBj5ZGK2QE0aCcMAIxLSw0WVYlGDgOQXWE+afouAM0S398O4Nej3wIQf4cIHSfz9pbWugyep4MFIAFARvspbm8BcE2DOdvWnCJQAWFhJ/hKzh4AaB2A7NxedKmLPc+6PN4cL2S8GYC1QMIEQJvmFsJfxdvkEQAoLV4AogBS8/kNvdXlWe5GKhABvQUAZASDALJffY1XfsrToFXFbvYD1gBo6wC8LR7/uvj9CwHcfWuoUJItsVl5nwWAnhxxqsXatUq0OYCcaS/fkbK61u5H8jwAuUIEZXHNL1Jmub5oSKZWiDR9FttM4HEAigqRpn8TeB2AuWNiByAXSHCGbB7/3qYCfgCgPgADEEskbjCCaJDB/+kR6wP4P1Obl8jsBwDUB4yAxqKkthaATjX0KmCtDyCxm+yIMLjCbwBgrg94FYC3h8vLPPmfAVBSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlLy9fJPgAEAvWMULbGsSjwAAAAASUVORK5CYII=",this.core,null,!0)},y.prototype.initImage=function(){var t=this.renderer,e=this.gpu.gl;t.rectVerticesBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t.rectVerticesBuffer);var i=[0,0,0,1,1,0,0,1,2,0,0,1,3,0,0,1];e.bufferData(e.ARRAY_BUFFER,new Float32Array(i),e.STATIC_DRAW),t.rectVerticesBuffer.itemSize=4,t.rectVerticesBuffer.numItems=4,t.rectIndicesBuffer=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.rectIndicesBuffer);var r=[0,2,1,0,3,2];e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Uint16Array(r),e.STATIC_DRAW),t.rectIndicesBuffer.itemSize=1,t.rectIndicesBuffer.numItems=6},y.prototype.initSkydome=function(){var t=this.renderer,e=c.buildSkydome(32,64);t.skydomeMesh=new p(this.gpu,e,null,this.core),e=c.buildSkydome(128,256),t.atmoMesh=new p(this.gpu,e,null,this.core)},y.prototype.initBBox=function(){var t=this.renderer,e=this.gpu;t.bboxMesh=new d(e),t.bboxMesh2=new d(e,!0)},y.prototype.initLines=function(){var t=this.gpu,e=this.renderer;e.plineBuffer=new Float32Array(96),e.plines=new f(t,this.core,!0,64,!0,8),e.plineJoints=new f(t,this.core,!1,64,!0,8),e.stencilLineState=t.createState({blend:!0,stencil:!0,culling:!1}),e.lineLabelState=t.createState({blend:!0,culling:!1,zequal:!0,zwrite:!1}),e.labelState=t.createState({blend:!0,culling:!1,zequal:!0}),e.stencilLineHitState=t.createState({blend:!1,stencil:!0,culling:!1}),e.lineLabelHitState=t.createState({blend:!1,culling:!1})},y.prototype.initBaricentricBuffer=function(){for(var t=this.gpu,e=new Array(196605),i=0;i<196605;i+=9)e[i]=1,e[i+1]=0,e[i+2]=0,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1;var r=t.gl;t.barycentricBuffer=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,t.barycentricBuffer),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e),r.STATIC_DRAW),t.barycentricBuffer.itemSize=3,t.barycentricBuffer.numItems=e.length/3},e.a=y},function(t,e,i){"use strict";var r=i(6),s=i(32),a=i(57),n=r.a,o=s.a,h=a.a,l=function(t){this.renderer=t,this.gpu=t.gpu};l.prototype.clear=function(t){return null!=t&&this.gpu.clear(t.clearDepth||!0,t.clearColor||!1,t.color||[255,255,255,255],null!=t.depth?t.depth:1),this},l.prototype.createState=function(t){if(null==t||"object"!=typeof t)return this;var e={blend:null!=t.blend&&t.blend,stencil:null!=t.stencil&&t.stencil,zoffset:null!=t.zoffset?t.zoffset:0,zwrite:null==t.zwrite||t.zwrite,ztest:null==t.ztest||t.ztest,zequal:null==t.zequal||t.zequal,culling:null==t.culling||t.culling};return this.gpu.createState(e)},l.prototype.setState=function(t){return null!=t&&this.gpu.setState(t),this},l.prototype.createTexture=function(t){if(null==t||"object"!=typeof t)return null;var e=t.source;if(null==e)return null;var i,r=t.filter||"linear",s=t.repeat||!1;if(e instanceof Uint8Array){var a=t.width,o=t.height;if(a&&o)return i=new n(this.gpu),i.createFromData(a,o,e,r,s),i}return e instanceof Image?(i=new n(this.gpu),i.createFromImage(e,r,s),i):null},l.prototype.removeTexture=function(t){return t&&t.kill(),this},l.prototype.createMesh=function(t){if(null==t||"object"!=typeof t)return null;var e={vertices:t.vertices,uvs:t.uvs,uvs2:t.normals,vertexSize:t.vertexSize,uvSize:t.uvSize,uv2Size:t.normalSize||3,vertexAttr:t.vertexAttr,uvAttr:t.uvAttr,uv2Attr:t.normalAttr,bbox:t.bbox};return new o(this.gpu,e,0,this.renderer.core)},l.prototype.removeMesh=function(t){return t&&t.kill(),this},l.prototype.createShader=function(t){if(null==t||"object"!=typeof t)return null;var e=t.vertexShader,i=t.fragmentShader;return null!=e&&i?new h(this.gpu,e,i):void 0},l.prototype.removeResource=function(t){return null!=t&&null!=t.kill&&t.kill(),this},l.prototype.addJob=function(){return this},l.prototype.clearJobs=function(){return this},l.prototype.drawMesh=function(t){if(null==t||"object"!=typeof t)return this;if(null==!t.mesh||!t.shaderVariables)return this;var e=t.vertex||"aPosition",i=t.uv||"aTexCoord",r=t.normal||"aNormal",s=null!=t.depthOffset?t.depthOffset:null,a=t.shaderVariables,n=t.shader||"textured",o=this.renderer,h=t.mesh,l=t.texture,u=o.camera.getModelviewMatrix(),c=o.camera.getProjectionMatrix(),d=o.fogDensity;if("string"==typeof n)switch(n){case"hit":a.uMV||(a.uMV=["mat4",u]),a.uProj||(a.uProj=["mat4",c]),i=null,r=null,l=null,n=o.progDepthTile;break;case"shaded":i=null;case"textured":case"textured-and-shaded":a.uMV||(a.uMV=["mat4",u]),a.uProj||(a.uProj=["mat4",c]),a.uFogDensity||(a.uFogDensity=["float",d]),r="textured"==n?null:"aNormal",n="textured"==n?o.progTile:"shaded"==n?o.progShadedTile:o.progTShadedTile}if(n&&n.isReady()){var p=[e];i&&p.push(i),r&&p.push(r),o.gpu.useProgram(n,p);for(var f in a){var g=a[f];if(2==g.length)switch(g[0]){case"floatArray":n.setFloatArray(f,g[1]);break;case"float":n.setFloat(f,g[1]);break;case"mat3":n.setMat3(f,g[1]);break;case"mat4":s&&"uProj"==f?n.setMat4(f,g[1],o.getZoffsetFactor(s)):n.setMat4(f,g[1]);break;case"vec2":n.setVec2(f,g[1]);break;case"vec3":n.setVec3(f,g[1]);break;case"vec4":n.setVec4(f,g[1]);break;case"sampler":n.setSampler(f,g[1])}}return l&&o.gpu.bindTexture(l),h.draw(n,e,i,r,null),this}},l.prototype.drawImage=function(t){if(null==t||"object"!=typeof t)return this;if(null==t.texture||null==t.rect)return this;var e=t.rect,i=t.color||[255,255,255,255],r=null!=t.depth?t.depth:0,s=null!=t.depthOffset?t.depthOffset:null,a=null!=t.depthTest&&t.depthTest,n=null!=t.blend&&t.blend,o=null!=t.writeDepth&&t.writeDepth,h=null!=t.useState&&t.useState;return i[0]*=1/255,i[1]*=1/255,i[2]*=1/255,i[3]*=1/255,this.renderer.draw.drawImage(e[0],e[1],e[2],e[3],t.texture,i,r,s,a,n,o,h),this},l.prototype.drawBillboard=function(t){if(null==t||"object"!=typeof t)return this;if(null==t.texture||null==t.mvp)return this;var e=t.mvp,i=t.color||[255,255,255,255],r=null!=t.depthOffset?t.depthOffset:null,s=null!=t.depthTest&&t.depthTest,a=null!=t.blend&&t.blend,n=null!=t.writeDepth&&t.writeDepth,o=null!=t.useState&&t.useState;return i[0]*=1/255,i[1]*=1/255,i[2]*=1/255,i[3]*=1/255,this.renderer.draw.drawBillboard(e,t.texture,i,r,s,a,n,o),this},l.prototype.drawLineString=function(t){if(null==t||"object"!=typeof t)return this;if(null==t.points)return this;var e=t.points,i=t.color||[255,255,255,255],r=null!=t.depthOffset?t.depthOffset:null,s=t.size||2,a=null==t.screenSpace||t.screenSpace,n=null!=t.depthTest&&t.depthTest,o=null!=t.blend&&t.blend,h=null!=t.writeDepth&&t.writeDepth,l=null!=t.useState&&t.useState;return i[0]*=1/255,i[1]*=1/255,i[2]*=1/255,i[3]*=1/255,this.renderer.draw.drawLineString(e,a,s,i,r,n,o,h,l),this},l.prototype.drawJobs=function(){return this},l.prototype.drawBBox=function(){return this},l.prototype.drawDebugText=function(t){if(null==t||"object"!=typeof t)return this;var e=t.text,i=t.coords;if(!e||!i)return this;var r=t.color||[255,255,255,255],s=t.size||16,a=t.depth,n=t.useState||!1;r[0]*=1/255,r[1]*=1/255,r[2]*=1/255,r[3]*=1/255;var o=this.renderer.draw.getTextSize(s,e);return this.renderer.draw.drawText(i[0]-.5*o,i[1],s,e,r,a,n),this},l.prototype.saveScreenshot=function(t,e,i){return this.renderer.saveScreenshot(t,e,i)},l.prototype.getCanvasCoords=function(t,e){return this.renderer.project2(t,e)},l.prototype.getCanvasSize=function(){return this.renderer.curSize.slice()},l.prototype.setConfigParams=function(t){return this.renderer.setConfigParams(t),this},l.prototype.setConfigParam=function(t,e){return this.renderer.setConfigParam(t,e),this},l.prototype.getConfigParam=function(t){return this.renderer.getConfigParam(t)},e.a=l},function(t,e,i){"use strict";var r=i(2),s=i(158),a=i(6),n=i(56),o=i(154),h=i(162),l=i(155),u=i(165),c=r.b,d=r.e,p=s.a,f=a.a,g=n.a,m=o.a,v=h.a,y=l.a,b=u.a,x=function(t,e,i,r,s){this.config=s||{},this.core=t,this.progTile=null,this.progHeightmap=null,this.progSkydome=null,this.progWireframeTile=null,this.progWireframeTile2=null,this.progText=null,this.div=e,this.onUpdate=i,this.killed=!1,this.onlyDepth=!1,this.onlyLayers=!1,this.onlyHitLayers=!1,this.onlyAdvancedHitLayers=!1,this.advancedPassNeeded=!1,this.hitmapCounter=0,this.geoRenderCounter=0,this.geoHitmapCounter=0,this.frameTime=0,this.geometries={},this.clearStencilPasses=[],this.onResizeCall=r,this.stencilLineState=null,this.drawLabelBoxes=!1,this.geodataSelection=[],this.hoverFeatureCounter=0,this.hoverFeatureList=[],this.touchSurfaceEvent=[];var a=this.div.getBoundingClientRect();this.winSize=[a.width,a.height],this.curSize=[a.width,a.height],this.oldSize=[a.width,a.height],this.dirty=!0,this.cameraVector=[0,1,0],this.gpu=new p(this,e,this.curSize,this.config.rendererAllowScreenshots,this.config.rendererAntialiasing),this.camera=new m(this,45,2,12e5),this.drawTileMatrix=d.create(),this.drawTileMatrix2=d.create(),this.drawTileVec=[0,0,0],this.drawTileWorldMatrix=d.create(),this.pixelTileSizeMatrix=d.create(),this.heightmapMesh=null,this.heightmapTexture=null,this.skydomeMesh=null,this.skydomeTexture=null,this.hitmapTexture=null,this.geoHitmapTexture=null,this.hitmapSize=1024,this.updateHitmap=!0,this.updateGeoHitmap=!0,this.redTexture=null,this.rectVerticesBuffer=null,this.rectIndicesBuffer=null,this.imageProjectionMatrix=null,this.font=null,this.fonts={},this.fogDensity=0,this.jobZBuffer=new Array(512),this.jobZBufferSize=new Array(512),this.jobZBuffer2=new Array(512),this.jobZBuffer2Size=new Array(512),this.jobHBuffer={},this.jobHBufferSize=0;for(var n=0,o=this.jobZBuffer.length;n<o;n++)this.jobZBuffer[n]=[],this.jobZBufferSize[n]=0,this.jobZBuffer2[n]={},this.jobZBuffer2Size[n]=0;this.layerGroupVisible=[],this.bitmaps={},this.cameraPosition=[0,0,0],this.cameraOrientation=[0,0,0],this.cameraTiltFator=1,this.cameraViewExtent=1,this.distanceFactor=1,this.tiltFactor=1,this.localViewExtentFactor=1,this.cameraVector=[0,0,0],this.labelVector=[0,0,0],this.drawnGeodataTiles=0,this.drawnGeodataTilesFactor=0,this.updateCameraMatrix=d.create(),this.lastHitPosition=[0,0,100],this.logTilePos=null,window.addEventListener("resize",this.onResize.bind(this),!1),this.gpu.init(),this.init=new v(this),this.rmap=new b(this,50),this.draw=new y(this);this.resizeGL(Math.floor(1*this.curSize[0]),Math.floor(1*this.curSize[1]))};x.prototype.onResize=function(){if(!this.killed){var t=this.div.getBoundingClientRect();this.resizeGL(Math.floor(t.width),Math.floor(t.height)),this.onResizeCall&&this.onResizeCall()}},x.prototype.kill=function(){this.killed||(this.killed=!0,null!=this.planet&&this.planet.kill(),this.heightmapMesh&&this.heightmapMesh.kill(),this.heightmapTexture&&this.heightmapTexture.kill(),this.skydomeMesh&&this.skydomeMesh.kill(),this.skydomeTexture&&this.skydomeTexture.kill(),this.hitmapTexture&&this.hitmapTexture.kill(),this.geoHitmapTexture&&this.geoHitmapTexture.kill(),this.redTexture&&this.redTexture.kill(),this.whiteTexture&&this.whiteTexture.kill(),this.blackTexture&&this.blackTexture.kill(),this.lineTexture&&this.lineTexture.kill(),this.textTexture2&&this.textTexture2.kill(),this.atmoMesh&&this.atmoMesh.kill(),this.bboxMesh&&this.bboxMesh.kill(),this.font&&this.font.kill(),this.plines&&this.plines.kill(),this.plineJoints&&this.plineJoints.kill(),this.gpu.kill())},x.prototype.getPlanet=function(){return this.planet},x.prototype.resizeGL=function(t,e,i,r){this.camera.setAspect(t/e),this.curSize=[t,e],this.oldSize=[t,e],this.gpu.resize(this.curSize,i),!0!==r&&this.draw.paintGL();var s=[];s[0]=2/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=-2/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=.5*-t*s[0],s[13]=.5*-e*s[5],s[14]=0,s[15]=1,this.imageProjectionMatrix=s},x.prototype.project2=function(t,e,i){var r=[0,0,0,1];if(r=i?d.multiplyVec4(e,[t[0]-i[0],t[1]-i[1],t[2]-i[2],1]):d.multiplyVec4(e,[t[0],t[1],t[2],1]),0!=r[3]){var s=[0,0,0];return s[0]=.5*(r[0]/r[3]+1)*this.curSize[0],s[1]=.5*(-r[1]/r[3]+1)*this.curSize[1],s[2]=r[2]/r[3],s}return[0,0,0]},x.prototype.project=function(t){var e=this.camera.getMvpMatrix(),i=this.camera.getPosition(),r=this.cameraPosition(),s=[t[0]-r[0]+i[0],t[1]-r[1]+i[1],t[2]-r[2]+i[2],1],a=[0,0,0,1];if(a=d.multiplyVec4(e,s),0!=a[3]){var n=[0,0,0];return n[0]=.5*(a[0]/a[3]+1)*this.curSize[0],n[1]=.5*(-a[1]/a[3]+1)*this.curSize[1],n[2]=a[2]/a[3],n}return[0,0,0]},x.prototype.getScreenRay=function(t,e){if(null==this.camera)return[0,0,1];this.camera.dirty=!0;var i=2*t/this.curSize[0]-1,r=1-2*e/this.curSize[1],s=[i,r,1],a=[s[0],s[1],-1,1],n=d.create();n=d.inverse(this.camera.getProjectionMatrix());var o=[0,0,0,0];d.multiplyVec4(n,a,o),o[2]=-1,o[3]=0;var h=d.create();h=d.inverse(this.camera.getModelviewMatrix());var l=[0,0,0,0];return d.multiplyVec4(h,o,l),l=c.normalize([l[0],l[1],l[2]])},x.prototype.hitTestGeoLayers=function(t,e,i){var r=this.gpu.gl;if(r.checkFramebufferStatus(r.FRAMEBUFFER)!=r.FRAMEBUFFER_COMPLETE)return[!1,0,0,0,0];var s,a=!1;if(t>=0&&t<this.curSize[0]&&e>=0&&e<this.curSize[1]){var n=0,o=0;n=Math.floor(t*(this.hitmapSize/this.curSize[0])),o=Math.floor(e*(this.hitmapSize/this.curSize[1])),s=i?this.geoHitmapTexture2.readFramebufferPixels(n,this.hitmapSize-o-1,1,1):this.geoHitmapTexture.readFramebufferPixels(n,this.hitmapSize-o-1,1,1),a=!(255==s[0]&&255==s[1]&&255==s[2]&&255==s[3])}return a?[!0,s[0],s[1],s[2],s[3]]:[!1,0,0,0,0]},x.prototype.switchToFramebuffer=function(t,e){var i,r,s,a=this.gpu.gl;switch(t){case"base":r=this.oldSize[0],s=this.oldSize[1],a.clearColor(0,0,0,1),this.gpu.setFramebuffer(null),this.camera.setAspect(r/s),this.curSize=[r,s],this.gpu.resize(this.curSize,!0),this.camera.update(),this.onlyDepth=!1,this.onlyHitLayers=!1,this.onlyAdvancedHitLayers=!1,this.advancedPassNeeded=!1;break;case"depth":this.gpu.setFramebuffer(this.hitmapTexture),this.oldSize=[this.curSize[0],this.curSize[1]],a.clearColor(1,1,1,1),a.enable(a.DEPTH_TEST),i=this.hitmapSize,a.viewport(0,0,i,i),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),this.curSize=[i,i],this.gpu.clear(),this.camera.update(),this.onlyDepth=!0,this.onlyHitLayers=!1,this.onlyAdvancedHitLayers=!1,this.advancedPassNeeded=!1;break;case"geo":case"geo2":this.hoverFeatureCounter=0,i=this.hitmapSize,this.gpu.setFramebuffer("geo"==t?this.geoHitmapTexture:this.geoHitmapTexture2),r=i,s=i,a.clearColor(1,1,1,1),a.enable(a.DEPTH_TEST),a.viewport(0,0,i,i),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),this.curSize=[r,s],this.onlyHitLayers=!0,this.advancedPassNeeded=!1,this.onlyAdvancedHitLayers="geo2"==t,this.gpu.clear(),this.camera.update();break;case"texture":this.gpu.setFramebuffer(e),this.oldSize=[this.curSize[0],this.curSize[1]],a.clearColor(0,0,0,1),a.enable(a.DEPTH_TEST),a.viewport(0,0,this.gpu.canvas.width,this.gpu.canvas.height),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),this.curSize=[this.gpu.canvas.width,this.gpu.canvas.height],this.gpu.clear(),this.camera.update(),this.onlyDepth=!1,this.onlyHitLayers=!1,this.onlyAdvancedHitLayers=!1,this.advancedPassNeeded=!1}},x.prototype.hitTest=function(t,e){var i=this.gpu.gl,r=this.getScreenRay(t,e),s=this.camera.getPosition();if(i.checkFramebufferStatus(i.FRAMEBUFFER)!=i.FRAMEBUFFER_COMPLETE)return[0,0,0,null,r,Number.MAX_VALUE,s];var a=0,n=0;a=Math.floor(t*(this.hitmapSize/this.curSize[0])),n=Math.floor(e*(this.hitmapSize/this.curSize[1]));var o=this.hitmapTexture.readFramebufferPixels(a,this.hitmapSize-n-1,1,1),h=o[0]*(1/255)+o[1]+255*o[2]+65025*o[3],l=!(255==o[0]&&255==o[1]&&255==o[2]&&255==o[3]);return this.lastHitPosition=[s[0]+r[0]*h,s[1]+r[1]*h,s[2]+r[2]*h],[this.lastHitPosition[0],this.lastHitPosition[1],this.lastHitPosition[2],l,r,h,s]},x.prototype.getZoffsetFactor=function(t){return 1e-4*(t[0]+t[1]*this.distanceFactor+t[2]*this.tiltFactor)},x.prototype.saveScreenshot=function(t,e,i){var r=this.gpu.gl,s=this.curSize[0],a=this.curSize[1],n=new Uint8Array(s*a*4);r.readPixels(0,0,s,a,r.RGBA,r.UNSIGNED_BYTE,n);for(var o=new Uint8Array(s*a*4),h=0,l=0;l<a;l++)for(var u=(a-1-l)*s*4,c=0;c<s;c++)o[h]=n[u],o[h+1]=n[u+1],o[h+2]=n[u+2],o[h+3]=n[u+3],h+=4,u+=4;var d=document.createElement("canvas");d.width=s,d.height=a;var p=d.getContext("2d"),f=p.createImageData(s,a);if(f.data.set(o),p.putImageData(f,0,0),i=i||"jpg","file"==t){for(var g=document.createElement("a"),m=d.toDataURL("image/"+i),v=atob(m.split(",")[1]),y=new ArrayBuffer(v.length),b=new Uint8Array(y),x=0;x<v.length;x++)b[x]=v.charCodeAt(x);var M=new Blob([y],{type:i}),w=URL.createObjectURL(M);g.href=w,g.download=e,document.body.appendChild(g),g.click(),setTimeout(function(){document.body.removeChild(g),window.URL.revokeObjectURL(w)},0)}return"tab"==t&&window.open(d.toDataURL("image/"+i)),f},x.prototype.getBitmap=function(t,e,i){var r=t+"*"+e+"*"+i,s=this.bitmaps[r];return s||(s=new f(this.gpu,t,this.core,null,null,i,e),this.bitmaps[r]=s),s},x.prototype.getFont=function(t){var e=this.fonts[t];return e||(e=new g(this.gpu,this.core,null,null,t),this.fonts[t]=e),e},e.a=x},function(t,e,i){"use strict";var r=function(t,e,i){this.renderer=t,this.maxBlockRectangles=i||50,this.blockSize=e,this.blockSizeFactor=1/e,this.blocks=[],this.blocksRCount=[],this.allocatedBlocks=0,this.lx=1,this.ly=1,this.counter=0,this.rectangles=null,this.rectanglesCount=0};r.prototype.clear=function(){this.slx=this.renderer.curSize[0],this.sly=this.renderer.curSize[1],this.lx=Math.floor(this.slx*this.blockSizeFactor)+1,this.ly=Math.floor(this.sly*this.blockSizeFactor)+1;var t=this.ly*this.lx;if(this.rectangles||(this.rectangles=new Array(t*this.maxBlockRectangles*6)),this.rectanglesCount>0||this.allocatedBlocks!=t){this.allocatedBlocks=t;for(var e=0;e<t;e++)this.blocks[e]||(this.blocks[e]=[]),this.blocksRCount[e]=0}this.rectanglesCount=0,this.counter=this.renderer.geoRenderCounter},r.prototype.addRectangle=function(t,e,i,r,s,a){var n,o,h,l,u,c,d,p,f=this.rectangles;t>i&&(p=t,t=i,i=p),e>r&&(p=e,e=r,r=p);var g=Math.floor(t*this.blockSizeFactor),m=Math.floor(e*this.blockSizeFactor),v=Math.floor(i*this.blockSizeFactor),y=Math.floor(r*this.blockSizeFactor);if(v<0||y<0||g>=this.lx||m>=this.ly)return!1;g<0&&(g=0),v>=this.lx&&(v=this.lx-1),m<0&&(m=0),y>=this.ly&&(y=this.ly-1);var b=v-g+1,x=y-m+1,M={};for(o=0;o<x;o++)for(n=0;n<b;n++){for(l=(m+o)*this.lx+(g+n),u=this.blocks[l],c=this.blocksRCount[l],h=0;h<c;h++)if(d=u[h],t<f[d+2]&&i>f[d+0]&&e<f[d+3]&&r>f[d+1]){if(s>f[d+4])return!1;M[d]=!0}if(c+1>=this.maxBlockRectangles)return!1}for(var w in M)this.removeRectangle(parseInt(w));for(d=this.rectanglesCount,f[d]=t,f[d+1]=e,f[d+2]=i,f[d+3]=r,f[d+4]=s,f[d+5]=a,this.rectanglesCount+=6,o=0;o<x;o++)for(n=0;n<b;n++)l=(m+o)*this.lx+(g+n),this.blocks[l][this.blocksRCount[l]]=d,this.blocksRCount[l]++;return!0},r.prototype.removeRectangle=function(t){var e,i,r,s,a,n,o,h,l,u,c=this.rectangles;e=c[t],i=c[t+1],r=c[t+2],s=c[t+3],c[t+5]=null;var d=Math.floor(e*this.blockSizeFactor),p=Math.floor(i*this.blockSizeFactor),f=Math.floor(r*this.blockSizeFactor),g=Math.floor(s*this.blockSizeFactor);d<0&&(d=0),f>=this.lx&&(f=this.lx-1),p<0&&(p=0),g>=this.ly&&(g=this.ly-1);var m=f-d+1,v=g-p+1;for(n=0;n<v;n++)for(a=0;a<m;a++)for(h=(p+n)*this.lx+(d+a),l=this.blocks[h],u=this.blocksRCount[h],o=0;o<u;o++)if(l[o]==t){l[o]=l[u-1],this.blocksRCount[h]--;break}},r.prototype.processRectangles=function(t,e,i,r){for(var s=this.rectangles,a=i.draw,n=0,o=this.rectanglesCount;n<o;n+=6){var h=s[n+5];h&&(h[0].hysteresis?i.jobHBuffer[h[0].id]=h[0]:a.drawGpuSubJob(t,e,i,r,h))}this.clear()},e.a=r},function(t,e,i){"use strict";function r(t,e){if(!t.config.constrainCamera)return e;var i,r=t.config.minViewExtent,s=t.config.maxViewExtent,a=t.getMap(),n=o.clamp(e.getViewExtent(),r,s);e.setViewExtent(n);var h=.5*n/Math.tan(o.radians(.5*e.getFov()));if("obj"==e.getViewMode()){var l=a.getReferenceFrame(),u=a.getSrsInfo(l.navigationSrs);if(u.a){var c,d=Math.asin(u.a/(h+u.a)),p=Math.tan(o.radians(.5*e.getFov()))/Math.tan(d),f=t.config.tiltConstrainThreshold,g=f[0],m=f[1];g>m||g==m?c=20:(p=o.clamp(p,g,m),p=(p-g)/(m-g),c=20+-110*p),i=e.getOrientation(),i[1]=o.clamp(i[1],-90,c),e.setOrientation(i)}var v=a.getPositionCameraCoords(e,"float"),y=.5*r/Math.tan(o.radians(.5*e.getFov()));y*=.5;var b=Math.max(y,h*Math.tan(o.radians(3)));if(v[2]<b){i=e.getOrientation();var x=function(t,r,s){var n=.5*(t+r);return s>20?n:(i[1]=n,e.setOrientation(i),a.getPositionCameraCoords(e,"float")[2]<b?x(t,n,s+1):x(n,r,s+1))};i[1]=x(-90,Math.min(20,i[1]),0),e.setOrientation(i)}}return e}var s=i(12),a=i(3);i.d(e,"a",function(){return h}),i.d(e,"b",function(){return r});var n=s.a,o=a.a,h=function(t){this.browser=t,this.config=t.config,this.coordsDeltas=[],this.orientationDeltas=[],this.viewExtentDeltas=[],this.northResetAnimation=!1,this.drag=this.drag,this.wheel=this.wheel,this.tick=this.tick,this.reset=this.reset,this.keyup=this.keyup,this.keydown=this.keydown,this.keypress=this.keypress,this.doubleclick=this.doubleclick,this.retinaFactor=1/Math.max(1,(window.devicePixelRatio||1)-1)};h.prototype.drag=function(t){var e=this.browser.getMap();if(e){var i,r=e.getPosition(),s=r.getCoords(),a=t.getDragDelta(),n=t.getDragTouches(),h=this.getAzimuthAndDistance(a[0],a[1]),l=this.browser.controlMode.altKey||this.browser.controlMode.shiftKey||this.browser.controlMode.ctrlKey;if(2==n){if("obj"!=r.getViewMode())return;if("pan"==t.getTouchParameter("touchMode")&&this.config.rotationAllowed)i=this.config.sensitivity[1]*this.retinaFactor,this.orientationDeltas.push([a[0]*i,-a[1]*i,0]),this.browser.callListener("map-position-rotated",{});else if(this.config.zoomAllowed){var u=1+.01*(t.getTouchParameter("touchDistanceDelta")>1?-1:1);this.viewExtentDeltas.push(u),this.reduceFloatingHeight(.8),this.browser.callListener("map-position-zoomed",{})}}else if(t.getDragButton("left")&&!l&&this.config.panAllowed)if("fix"==r.getHeightMode()){var c=e.convertPositionHeightMode(r,"float",!0);null!=c&&(r=c,this.setPosition(r))}else{i=this.config.sensitivity[0]*this.retinaFactor;var d=r.getFov(),p=d>.01&&d<179?1/Math.tan(o.radians(.5*d)):1,f=o.radians(h[0]),g=[Math.sin(f),Math.cos(f),h[1]*p*i,h[0],s[0],s[1]];this.coordsDeltas.push(g),this.reduceFloatingHeight(.9),this.browser.callListener("map-position-panned",{})}else(n<=1&&t.getDragButton("right")||t.getDragButton("middle")||l)&&this.config.rotationAllowed&&(i=this.config.sensitivity[1]*this.retinaFactor*("obj"!=r.getViewMode()?.5:1),this.orientationDeltas.push([a[0]*i,-a[1]*i,0]),this.browser.callListener("map-position-rotated",{}))}},h.prototype.wheel=function(t){n.preventDefault(t);var e=this.browser.getMap();if(e&&this.config.zoomAllowed){e.getStats(!0).maxZoom&&(this.browser.config.minViewExtent=.5);var i=e.getPosition(),r=t.getWheelDelta(),s=this.config.sensitivity[2],a=1+(r>0?-1:1)*s;if(this.browser.controlMode.altKey&&this.browser.controlMode.shiftKey&&this.browser.controlMode.ctrlKey){var h=o.clamp(i.getFov()*a,1,179);i.setFov(h),e.setPosition(i)}else{if("obj"!=i.getViewMode()){var l=i.getCoords(),u=e.getCameraInfo(),c=u.vector,d=u.height,p=Math.max(100,d)*(this.browser.controlMode.shiftKey?25e-5:.0025)*(r>0?1:-1);return l=e.convertCoordsFromNavToPhys(l,"float"),l[0]+=c[0]*p,l[1]+=c[1]*p,l[2]+=c[2]*p,l=e.convertCoordsFromPhysToNav(l,"float"),i.setCoords(l),void e.setPosition(i)}this.viewExtentDeltas.push(a),this.reduceFloatingHeight(.8),this.browser.callListener("map-position-zoomed",{})}}},h.prototype.doubleclick=function(t){n.preventDefault(t);var e=this.browser.getMap();if(e&&this.config.jumpAllowed){if(this.browser.controlMode.altKey&&this.browser.controlMode.shiftKey&&this.browser.controlMode.ctrlKey)return void(this.browser.config.minViewExtent=.5);var i=t.getMouseCoords(),r=e.getHitCoords(i[0],i[1],"fix");if(r){var s=e.getPosition();s.setCoords(r),s=e.convertPositionHeightMode(s,"fix"),s.setHeight(r[2]),this.browser.autopilot.flyTo(s,{mode:"direct",maxDuration:2e3})}}},h.prototype.keyup=function(){},h.prototype.keydown=function(){},h.prototype.keypress=function(){},h.prototype.setPosition=function(t){t=r(this.browser,t),this.browser.getMap().setPosition(t)},h.prototype.reduceFloatingHeight=function(t){var e=this.browser.getMap(),i=e.getPosition(),r=i.getCoords();"float"==i.getHeightMode()&&"obj"==i.getViewMode()&&0!=r[2]&&(r[2]*=t,Math.abs(r[2])<.1&&(r[2]=0),i.setCoords(r),this.setPosition(i))},h.prototype.isNavigationSRSProjected=function(){var t=this.browser.getMap(),e=t.getReferenceFrame(),i=t.getSrsInfo(e.navigationSrs);return!!i&&"projected"==i.type},h.prototype.getAzimuthAndDistance=function(t,e){var i=this.browser.getMap(),r=i.getPosition(),s=r.getViewExtent(),a=.5*r.getFov(),n=.5*s*Math.tan(o.radians(a))/800;t*=n,e*=n;var h=Math.sqrt(t*t+e*e);return[-o.degrees(Math.atan2(t,e))+r.getOrientation()[0],h]},h.prototype.tick=function(){var t=this.browser.getMap();if(t){var e,i,r,s,a,n=t.getPosition(),h=!1,l=this.config.inertia;if(this.coordsDeltas.length>0){i=this.coordsDeltas;var u=[0,0],c=n.getCoords();for(a=0;a<i.length;a++)e=i[a],r=e[3],r=o.radians(r),u[0]+=Math.sin(r)*e[2],u[1]+=Math.cos(r)*e[2],e[2]*=l[0],e[2]<.01&&(i.splice(a,1),a--);var d=Math.sqrt(u[0]*u[0]+u[1]*u[1]);for(r=o.degrees(Math.atan2(u[0],u[1])),this.isNavigationSRSProjected()||!this.northResetAnimation&&"azimuthal"==this.config.navigationMode&&(Math.abs(c[1])>75||Math.abs(n.getOrientation()[0])>1)&&(this.config.navigationMode="azimuthal2"),s=n.getOrientation()[0],n=t.movePositionCoordsTo(n,(this.isNavigationSRSProjected()?-1:1)*r,d,"free"!=this.config.navigationMode&&"azimuthal2"!=this.config.navigationMode?0:1),s=n.getOrientation()[0]-s,a=0;a<i.length;a++)e=i[a],e[3]+=s;h=!0}if(this.orientationDeltas.length>0){i=this.orientationDeltas;var p=n.getOrientation();for(a=0;a<i.length;a++)e=i[a],p[0]+=e[0],p[1]+=e[1],p[2]+=e[2],e[0]*=l[1],e[1]*=l[1],e[2]*=l[1],e[0]*e[0]+e[1]*e[1]+e[2]*e[2]<.1&&(i.splice(a,1),a--);n.setOrientation(p),h=!0}if(this.viewExtentDeltas.length>0){i=this.viewExtentDeltas;var f=n.getViewExtent();for(a=0;a<i.length;a++)f*=i[a],i[a]+=(1-i[a])*(1-l[2]),Math.abs(1-i[a])<.001&&(i.splice(a,1),a--);f=Math.max(1,f),n.setViewExtent(f),h=!0}h&&this.setPosition(n)}},h.prototype.reset=function(){this.coordsDeltas=[],this.orientationDeltas=[],this.viewExtentDeltas=[]}},function(t,e,i){"use strict";var r=function(t,e,i){this.type=t,this.event=i,this.element=e};r.prototype.getMouseButton=function(){switch(this.type){case"touchstart":case"touchend":case"touchmove":var t=this.event.touches;if(t)switch(t.length){case 1:return"left";case 2:return"right";case 3:return"middle"}return"";default:if(this.event.which)switch(this.event.which){case 1:return"left";case 2:return"middle";case 3:return"right"}else if(this.event.button)switch(this.event.button){case 1:return"left";case 2:return"right";case 3:return"middle"}}return""},r.prototype.getMouseCoords=function(t){var e=[0,0];switch(this.type){case"touchstart":case"touchend":case"touchmove":var i=this.event.touches;if(!i||0==i.length)break;for(var r=0,s=i.length;r<s;r++){var a=this.getEventCoords(this.event.touches[r],t);e[0]+=a[0],e[1]+=a[1]}e[0]/=s,e[1]/=s;break;case"mousedown":case"mouseup":case"mousemove":case"mouseenter":case"mouseover":case"mouseleave":case"click":case"dblclick":case"dragstart":case"dragend":case"drag":e=this.getEventCoords(this.event,t)}return e},r.prototype.getEventCoords=function(t,e){if(null==this.element.getBoundingClientRect||e)return[t.clientX,t.clientY];var i=this.element.getBoundingClientRect();return[t.clientX-i.left,t.clientY-i.top]},r.prototype.getDragDelta=function(){switch(this.type){case"drag":return[this.event.deltaX,this.event.deltaY]}return[0,0]},r.prototype.getDragZoom=function(){switch(this.type){case"drag":return this.event.zoom}return 1},r.prototype.getDragTouches=function(){switch(this.type){case"drag":return this.event.touches}return 0},r.prototype.getModifierKey=function(t){switch(this.type){case"mouseup":case"mousedown":case"dblclick":case"keyup":case"keydown":case"keypress":switch(t){case"alt":return this.event.altKey;case"ctrl":return this.event.ctrlKey;case"shift":return this.event.shiftKey}}return!1},r.prototype.getKeyCode=function(){switch(this.type){case"keyup":case"keydown":case"keypress":return this.event.keyCode?this.event.keyCode:this.event.which?this.event.which:this.event.charCode}return null},r.prototype.getDragButton=function(t){switch(t){case"left":case"right":case"middle":switch(this.getTouchesCount()){case-1:return this.event[t];case 0:return!1;case 1:return"left"==t;case 2:return"right"==t;case 3:return"middle"==t}}return!1},r.prototype.getWheelDelta=function(){switch(this.type){case"mousewheel":var t=0;return this.event.wheelDelta&&(t=this.event.wheelDelta/120),this.event.detail&&(t=-this.event.detail/3),t}return 0},r.prototype.getTouchesCount=function(){switch(this.type){case"touchstart":case"touchend":case"touchmove":if(!this.event.touches)break;return this.event.touches.length}return-1},r.prototype.getTouchParameter=function(t){switch(this.type){case"drag":return this.event[t]}return null},r.prototype.getTouchCoords=function(t,e){switch(this.type){case"touchstart":case"touchend":case"touchmove":if(!this.event.touches)break;var i=this.event.touches[t];if(!i)break;if(null==this.element.getBoundingClientRect||e)return[i.clientX,i.clientY];var r=this.element.getBoundingClientRect();return[i.clientX-r.left,i.clientY-r.top]}return[0,0]},r.prototype.getType=function(){return this.type},e.a=r},function(t,e,i){"use strict";var r=i(169),s=(i.n(r),i(170)),a=(i.n(s),i(171)),n=(i.n(a),i(172)),o=(i.n(n),i(174)),h=o.a,l=function(t,e){this.browser=new h(t,e),this.core=this.browser.getCore(),this.killed=!1,Object.defineProperty(this,"map",{get:function(){if(!this.killed)return this.core.map}}),Object.defineProperty(this,"renderer",{get:function(){if(!this.killed)return this.core.renderer}}),Object.defineProperty(this,"autopilot",{get:function(){if(!this.killed)return this.browser.autopilot}}),Object.defineProperty(this,"presenter",{get:function(){if(!this.killed)return this.browser.presenter}}),Object.defineProperty(this,"ui",{get:function(){if(!this.killed)return this.browser.ui}})};l.prototype.destroy=function(){if(!this.killed)return this.core.destroy(),this.browser.kill(),this.killed=!0,null},l.prototype.setControlMode=function(t){if(!this.killed)return this.browser.setControlMode(t),this},l.prototype.getControlMode=function(){if(!this.killed)return this.browser.getControlMode()},l.prototype.loadMap=function(t){if(!this.killed)return this.core.loadMap(t),this},l.prototype.destroyMap=function(){if(!this.killed)return this.core.destroyMap(),this.map=null,this},l.prototype.on=function(t,e){return this.core.on(t,e),this},l.prototype.setParams=function(t){return this.setConfigParams(t),this},l.prototype.setParam=function(t,e){return this.setConfigParam(t,e),this},l.prototype.getParam=function(t){return this.getConfigParam(t)},e.a=l},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e,i){"use strict";var r=function(t){this.browser=t,this.trajectory=[],this.flightDuration=1,this.flightTime=0,this.trajectoryIndex=0,this.finished=!0,this.autoMovement=!1,this.autoRotate=0,this.autoPan=0,this.autoPanAzimuth=0,this.center=[0,0,0],this.orientation=[0,0,0],this.viewHeight=0,this.fov=90,this.lastTime=0};r.prototype.setAutorotate=function(t){this.autoRotate!=t&&this.browser.callListener("autorotate-changed",{autorotate:t}),this.autoRotate=t},r.prototype.getAutorotate=function(){return this.autoRotate},r.prototype.setAutopan=function(t,e){this.autoPan=t,this.autoPanAzimuth=e},r.prototype.getAutopan=function(){return[this.autoPan,this.autoPanAzimuth]},r.prototype.flyToDAH=function(t,e,i,r){var s=this.browser.core.map;if(s){r=r||{};var a=s.generatePIHTrajectory(s.getPosition(),t,e,i,r);this.setTrajectory(a,r.samplePeriod||10,r)}},r.prototype.flyTo=function(t,e){var i=this.browser.core.map;if(i){e=e||{};var r=i.generateTrajectory(i.getPosition(),t,e);this.setTrajectory(r,e.samplePeriod||10,e)}},r.prototype.flyTrajectory=function(t,e){this.setTrajectory(t,e||10,{})},r.prototype.cancelFlight=function(){this.browser.getControlMode().setCurrentControlMode(this.lastControlMode),this.finished=!0},r.prototype.setTrajectory=function(t,e,i){null!=t&&0!=t.length&&(this.setAutorotate(0),this.setAutopan(0,0),this.speed=i.speed||1,this.finished&&(this.lastControlMode=this.browser.getControlMode().getCurrentControlMode()),this.browser.getControlMode().setCurrentControlMode("disabled"),this.trajectory=t,this.sampleDuration=e,this.browser.callListener("fly-start",{startPosition:this.trajectory[0],endPosition:this.trajectory[this.trajectory.length-1],options:i}),this.timeStart=performance.now(),this.finished=!1)},r.prototype.tick=function(){var t=this.browser.getMap();if(t){var e,i=performance.now(),r=(i-this.lastTime)/1e3;if(this.lastTime=i,!(this.browser.ui&&this.browser.ui.loading&&this.browser.ui.loading.control.getVisible())){if(0!=this.autoRotate){e=t.getPosition();var s=e.getOrientation();s[0]=(s[0]+this.autoRotate*r)%360,e.setOrientation(s),t.setPosition(e)}if(0!=this.autoPan&&(e=t.getPosition(),e=t.movePositionCoordsTo(e,this.autoPanAzimuth,e.getViewExtent()*(.01*this.autoPan)*r,0),t.setPosition(e)),!this.finished&&this.trajectory){i-=this.timeStart;var a=Math.floor(i/this.sampleDuration*this.speed),n=this.trajectory.length-1;a<n?(t.setPosition(this.trajectory[a]),this.browser.callListener("fly-progress",{position:this.trajectory[a],progress:a/n*100})):t.setPosition(this.trajectory[n]),a>=this.trajectory.length&&(this.browser.callListener("fly-end",{position:this.trajectory[n]}),this.browser.getControlMode().setCurrentControlMode(this.lastControlMode),this.finished=!0)}}}},r.prototype.generateTrajectory=function(t,e,i){var r=this.browser.core.map;if(r)return i=i||{},r.generateTrajectory(t,e,i)},r.prototype.generatePIHTrajectory=function(t,e,i,r){var s=this.browser.core.map;if(s)return r=r||{},s.generatePIHTrajectory(t,e,i,r)},e.a=r},function(t,e,i){"use strict";var r=i(13),s=i(58),a=i(4),n=i(198),o=i(173),h=i(175),l=i(179),u=i(180),c=s.a,d=a.a,p=n.a,f=o.a,g=h.a,m=l.a,v=u.a,y=r.b,b=function(t,e){return this.killed=!1,this.configStorage={},this.initConfig(),this.setConfigParams(e,!0),this.originalConfig=JSON.parse(JSON.stringify(e)),this.element="string"==typeof t?document.getElementById(t):t,this.ui=new p(this,this.element),t="string"!=typeof t?t:document.getElementById(t),y()?(this.core=new c(this.ui.getMapControl().getMapElement().getElement(),e),null==this.core?void this.ui.setControlDisplayState("fallback",!0):(this.updatePosInUrl=!1,this.lastUrlUpdateTime=!1,this.mapLoaded=!1,this.mapInteracted=!1,this.autopilot=new f(this),this.rois=new v(this),this.controlMode=new g(this,this.ui),this.presenter=new m(this,e),this.on("map-loaded",this.onMapLoaded.bind(this)),this.on("map-unloaded",this.onMapUnloaded.bind(this)),this.on("map-update",this.onMapUpdate.bind(this)),this.on("map-position-changed",this.onMapPositionChanged.bind(this)),this.on("map-position-fixed-height-changed",this.onMapPositionFixedHeightChanged.bind(this)),this.on("map-position-panned",this.onMapPositionPanned.bind(this)),this.on("map-position-rotated",this.onMapPositionRotated.bind(this)),this.on("map-position-zoomed",this.onMapPositionZoomed.bind(this)),void this.on("tick",this.onTick.bind(this)))):void this.ui.setControlDisplayState("fallback",!0)};b.prototype.kill=function(){this.ui.kill(),this.killed=!0},b.prototype.getCore=function(){return this.core},b.prototype.getMap=function(){return this.core?this.core.map:null},b.prototype.getRenderer=function(){return this.core?this.core.renderer:null},b.prototype.getProj4=function(){return this.core?this.core.proj4:null},b.prototype.getUI=function(){return this.ui},b.prototype.setControlMode=function(t){this.controlMode=t},b.prototype.getControlMode=function(){return this.controlMode},b.prototype.on=function(t,e){this.core.on(t,e)},b.prototype.callListener=function(t,e){this.core.callListener(t,e)},b.prototype.onMapLoaded=function(t){this.mapLoaded=!0;var e=t.browserOptions||{},i=this.originalConfig;for(var r in i)void 0!==e[r]&&(e[r]=i[r]);if(this.setConfigParams(e),this.config.geojson||this.config.geodata){var s=this.config.geojson||this.config.geodata;if("string"==typeof s)if(s=s.trim(),"{"==s.charAt(0))try{s=JSON.parse(s),this.onGeoJsonLoaded(s)}catch(t){}else d.loadJSON(s,this.onGeoJsonLoaded.bind(this))}this.autopilot&&(this.autopilot.setAutorotate(this.config.autoRotate),this.autopilot.setAutopan(this.config.autoPan[0],this.config.autoPan[1]))},b.prototype.getLinkWithCurrentPos=function(){var t=this.getMap();if(!t)return"";var e=d.getParamsFromUrl(window.location.href),i=t.getPosition();i=t.convertPositionHeightMode(i,"fix",!0);var r="";r+=i.getViewMode()+",";var s=i.getCoords();r+=s[0].toFixed(6)+","+s[1].toFixed(6)+","+i.getHeightMode()+","+s[2].toFixed(2)+",";var a=i.getOrientation();if(r+=a[0].toFixed(2)+","+a[1].toFixed(2)+","+a[2].toFixed(2)+",",r+=i.getViewExtent().toFixed(2)+","+i.getFov().toFixed(2),e.pos=r,this.mapInteracted){(e.rotate||this.getConfigParam("rotate"))&&(e.rotate="0");var n=this.getConfigParam("pan");(e.pan||n&&(n[0]||n[1]))&&(e.pan="0,0")}r="";for(var o in e)r+=(r.length>0?"&":"")+o+"="+e[o];var h=window.location.href.split("?");if(h.length>1){var l=h[1].split("#");return h[0]+"?"+r+(l[1]||"")}return h[0]+"?"+r},b.prototype.onMapPositionChanged=function(){this.config.positionInUrl&&(this.updatePosInUrl=!0)},b.prototype.onMapPositionPanned=function(){this.mapInteracted=!0},b.prototype.onMapPositionRotated=function(){this.mapInteracted=!0},b.prototype.onMapPositionZoomed=function(){this.mapInteracted=!0},b.prototype.onMapPositionFixedHeightChanged=function(){this.config.positionInUrl&&(this.updatePosInUrl=!0)},b.prototype.onMapUnloaded=function(){},b.prototype.onMapUpdate=function(){this.dirty=!0},b.prototype.onGeoJsonLoaded=function(t){var e=this.getMap(),i=e.createGeodata(),r=function(){var t=i.makeFreeLayer(this.config.geojsonStyle);e.addFreeLayer("geojson",t);var r=e.getView();r.freeLayers.geojson={},e.setView(r)}.bind(this);this.config.geodata?(i.importVTSGeodata(t),r()):(i.importGeoJson(t),i.processHeights("node-by-precision",62,r))},b.prototype.onTick=function(){if(!this.killed&&(this.autopilot.tick(),this.ui.tick(this.dirty),this.dirty=!1,this.updatePosInUrl)){var t=performance.now();t-this.lastUrlUpdateTime>1e3&&(window.history.replaceState&&window.history.replaceState({},null,this.getLinkWithCurrentPos()),this.updatePosInUrl=!1,this.lastUrlUpdateTime=t)}},b.prototype.initConfig=function(){this.config={panAllowed:!0,rotationAllowed:!0,zoomAllowed:!0,jumpAllowed:!1,sensitivity:[1,.06,.05],inertia:[.81,.9,.7],positionInUrl:!1,positionUrlHistory:!1,constrainCamera:!0,navigationMode:"azimuthal",controlCompass:!0,controlZoom:!0,controlSpace:!0,controlSearch:!0,controlSearchSrs:null,controlSearchUrl:null,controlSearchFilter:!0,controlMeasure:!1,controlLink:!1,controlGithub:!1,controlScale:!0,controlLayers:!1,controlCredits:!0,controlFullscreen:!1,controlLoading:!0,searchElement:null,searchValue:null,geojson:null,tiltConstrainThreshold:[.5,1],minViewExtent:20,maxViewExtent:Number.MAXINTEGER,autoRotate:0,autoPan:[0,0]}},b.prototype.setConfigParams=function(t,e){if("object"==typeof t&&null!==t)for(var i in t)this.setConfigParam(i,t[i],e)},b.prototype.updateUI=function(t){null!=this.ui&&this.ui.setParam(t)},b.prototype.setConfigParam=function(t,e,i){var r=this.getMap();switch(t){case"pos":case"position":this.config.position=e,r&&r.setPosition(this.config.position);break;case"view":this.config.view=e,r&&r.setView(this.config.view);break;case"panAllowed":this.config.panAllowed=d.validateBool(e,!0);break;case"rotationAllowed":this.config.rotationAllowed=d.validateBool(e,!0);break;case"zoomAllowed":this.config.zoomAllowed=d.validateBool(e,!0);break;case"jumpAllowed":this.config.jumpAllowed=d.validateBool(e,!1);break;case"constrainCamera":this.config.constrainCamera=d.validateBool(e,!0);break;case"navigationMode":this.config.navigationMode=e;break;case"positionInUrl":this.config.positionInUrl=d.validateBool(e,!1);break;case"positionUrlHistory":this.config.positionUrlHistory=d.validateBool(e,!1);break;case"controlCompass":this.config.controlCompass=d.validateBool(e,!0),this.updateUI(t);break;case"controlZoom":this.config.controlZoom=d.validateBool(e,!0),this.updateUI(t);break;case"controlMeasure":this.config.controlMeasure=d.validateBool(e,!1),this.updateUI(t);break;case"controlScale":this.config.controlScale=d.validateBool(e,!0),this.updateUI(t);break;case"controlLayers":this.config.controlLayers=d.validateBool(e,!1),this.updateUI(t);break;case"controlSpace":this.config.controlSpace=d.validateBool(e,!1),this.updateUI(t);break;case"controlSearch":this.config.controlSearch=d.validateBool(e,!1),this.updateUI(t);break;case"controlSearchUrl":this.config.controlSearchUrl=e;break;case"controlSearchSrs":this.config.controlSearchSrs=e;break;case"controlSearchFilter":this.config.controlSearchFilter=d.validateBool(e,!0);break;case"controlSearchElement":this.config.controlSearchElement=e,this.updateUI(t);break;case"controlSearchValue":this.config.controlSearchValue=e,this.updateUI(t);break;case"controlLink":this.config.controlLink=d.validateBool(e,!1),this.updateUI(t);break;case"controlGithub":this.config.controlGithub=d.validateBool(e,!1),this.updateUI(t);break;case"controlMeasure":this.config.controlMeasure=d.validateBool(e,!1),this.updateUI(t);break;case"controlLogo":this.config.controlLogo=d.validateBool(e,!1),this.updateUI(t);break;case"controlFullscreen":this.config.controlFullscreen=d.validateBool(e,!0),this.updateUI(t);break;case"controlCredits":this.config.controlCredits=d.validateBool(e,!0),this.updateUI(t);break;case"controlLoading":this.config.controlLoading=d.validateBool(e,!0),this.updateUI(t);break;case"minViewExtent":this.config.minViewExtent=d.validateNumber(e,.01,Number.MAXINTEGER,100);break;case"maxViewExtent":this.config.maxViewExtent=d.validateNumber(e,.01,Number.MAXINTEGER,Number.MAXINTEGER);break;case"sensitivity":this.config.sensitivity=d.validateNumberArray(e,3,[0,0,0],[10,10,10],[1,.12,.05]);break;case"inertia":this.config.inertia=d.validateNumberArray(e,3,[0,0,0],[.99,.99,.99],[.85,.9,.7]);break;case"tiltConstrainThreshold":this.config.tiltConstrainThreshold=d.validateNumberArray(e,2,[.5,1],[-Number.MAXINTEGER,-Number.MAXINTEGER],[Number.MAXINTEGER,Number.MAXINTEGER]);break;case"geodata":this.config.geodata=e;break;case"geojson":this.config.geojson=e;break;case"geojsonStyle":this.config.geojsonStyle=JSON.parse(e);break;case"rotate":this.config.autoRotate=d.validateNumber(e,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,0),r&&this.autopilot&&this.autopilot.setAutorotate(this.config.autoRotate);break;case"pan":Array.isArray(e)&&2==e.length&&(this.config.autoPan=[d.validateNumber(e[0],Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,0),d.validateNumber(e[1],-360,360,0)]),r&&this.autopilot&&this.autopilot.setAutorotate(this.config.autoRotate)}i&&(0!=t.indexOf("map")&&0!=t.indexOf("mario")&&0!=t.indexOf("authorization")||!r||r.setConfigParam(t,e),0==t.indexOf("renderer")&&this.getRenderer()&&this.getRenderer().setConfigParam(t,e),0==t.indexOf("debug")&&this.core&&this.core.setConfigParam(t,e))},b.prototype.getConfigParam=function(t){var e=this.getMap();switch(t){case"pos":case"position":if(!e)return this.config.position;e.getPosition();break;case"view":return e?e.getView():this.config.view;case"panAllowed":return this.config.panAllowed;case"rotationAllowed":return this.config.rotationAllowed;case"zoomAllowed":return this.config.zoomAllowed;case"jumpAllowed":return this.config.jumpAllowed;case"sensitivity":return this.config.sensitivity;case"inertia":return this.config.inertia;case"navigationMode":return this.config.navigationMode;case"constrainCamera":return this.config.constrainCamera;case"positionInUrl":return this.config.positionInUrl;case"positionUrlHistory":return this.config.positionUrlHistory;case"controlCompass":return this.config.controlCompass;case"controlZoom":return this.config.controlZoom;case"controlMeasure":return this.config.controlMeasure;case"controlScale":return this.config.controlScale;case"controlLayers":return this.config.controlLayers;case"controlSpace":return this.config.controlSpace;case"controlSearch":return this.config.controlSearch;case"controlLink":return this.config.controlLink;case"controlGithub":return this.config.controlGithub;case"controlMeasure":return this.config.controlMeasure;case"controlLogo":return this.config.controlLogo;case"controlFullscreen":return this.config.controlFullscreen;case"controlCredits":return this.config.controlCredits;case"controlLoading":return this.config.controlLoading;case"controlSearchElement":return this.config.controlSearchElement;case"controlSearchValue":return this.config.controlSearchValue;case"controlSearchUrl":return this.config.controlSearchUrl;case"controlSearchSrs":return this.config.controlSearchSrs;case"controlSearchFilter":return this.config.controlSearchFilter;case"minViewExtent":return this.config.minViewExtent;case"maxViewExtent":return this.config.maxViewExtent;case"rotate":return this.config.autoRotate;case"pan":return this.config.autoPan}return 0==t.indexOf("map")&&e?e.getConfigParam(t):0==t.indexOf("renderer")?e.getConfigParam(t):void 0},e.a=b},function(t,e,i){"use strict";var r=i(176),s=i(166),a=i(177),n=r.a,o=s.a,h=a.a,l=function(t){this.browser=t,this.ui=t.ui,this.mapControl=this.ui.getMapControl(),this.mapElement=this.mapControl.getMapElement(),this.altKey=!1,this.shiftKey=!1,this.ctrlKey=!1,this.mapElement.on("drag",this.onDrag.bind(this)),this.mapElement.on("mousedown",this.onDown.bind(this)),this.mapElement.on("mouseup",this.onUp.bind(this)),this.mapElement.on("mousewheel",this.onWheel.bind(this)),this.mapElement.on("keyup",this.onKeyUp.bind(this),window),this.mapElement.on("keydown",this.onKeyDown.bind(this),window),this.mapElement.on("keypress",this.onKeyPress.bind(this),window),this.mapElement.on("dblclick",this.onDoubleClick.bind(this),window),this.browser.on("tick",this.onTick.bind(this)),this.controlModes={},this.currentCotnrolModeId="map-observer",this.currentControlMode=this.controlModes["map-observer"],this.addControlMode("map-observer",new o(t)),this.addControlMode("disabled",new n),this.addControlMode("pano",new h(t)),this.setDefaultControlMode()};l.prototype.addControlMode=function(t,e){this.controlModes[t]=e},l.prototype.removeControlMode=function(t){t!==this.currentCotnrolModeId&&delete this.controlModes[t]},l.prototype.setCurrentControlMode=function(t,e){var i=this.controlModes[t];i&&(this.currentControlModeId=t,this.currentControlMode=i,i.reset&&i.reset(e))},l.prototype.setDefaultControlMode=function(){this.setCurrentControlMode("map-observer")},l.prototype.getCurrentControlMode=function(){return this.currentControlModeId},l.prototype.getCurrentController=function(){return this.currentControlMode},l.prototype.onDrag=function(t){this.checkAutopilot(),this.currentControlMode.drag&&this.currentControlMode.drag(t)},l.prototype.onDown=function(t){this.checkAutopilot(),this.updateModifierKeys(t),this.currentControlMode.down&&this.currentControlMode.down(t)},l.prototype.onUp=function(t){this.updateModifierKeys(t),this.currentControlMode.up&&this.currentControlMode.up(t)},l.prototype.onWheel=function(t){this.checkAutopilot(),this.currentControlMode.wheel&&this.currentControlMode.wheel(t)},l.prototype.onKeyUp=function(t){this.updateModifierKeys(t),this.currentControlMode.keyup&&this.currentControlMode.keyup(t)},l.prototype.onKeyDown=function(t){this.updateModifierKeys(t),this.currentControlMode.keydown&&this.currentControlMode.keydown(t)},l.prototype.onKeyPress=function(t){this.updateModifierKeys(t),this.currentControlMode.keypress&&this.currentControlMode.keypress(t)},l.prototype.onDoubleClick=function(t){this.updateModifierKeys(t),this.currentControlMode.doubleclick&&this.currentControlMode.doubleclick(t)},l.prototype.onTick=function(t){this.currentControlMode.tick&&(t.draggingState=this.mapElement.getDraggingState(),this.currentControlMode.tick(t))},l.prototype.updateModifierKeys=function(t){this.altKey=t.getModifierKey("alt"),this.shiftKey=t.getModifierKey("shift"),this.ctrlKey=t.getModifierKey("ctrl")},l.prototype.checkAutopilot=function(){this.browser.autopilot&&(this.browser.autopilot.setAutorotate(0),this.browser.autopilot.setAutopan(0,0))},e.a=l},function(t,e,i){"use strict";var r=function(){};e.a=r},function(t,e,i){"use strict";var r=i(3),s=r.a,a=function(t){this.browser=t,this.config=null,this.center=[0,0],this.dragging=!1,this.velocity=[0,0],this.impulse=[0,0],this.drag=this.drag,this.down=this.drag,this.up=this.drag,this.wheel=this.wheel,this.tick=this.tick,this.reset=this.reset,this.keyup=this.keyup,this.keydown=this.keydown,this.keypress=this.keypress};a.prototype.drag=function(t){if(this.dragging){var e=t.getMouseCoords(),i=[e[0]-this.center[0],e[1]-this.center[1]];this.velocity[0]=.008*i[0],this.velocity[1]=.008*i[1],this.impulse[0]=.008*i[0],this.impulse[1]=.008*i[1]}},a.prototype.down=function(t){"left"===t.getMouseButton()&&(this.center=t.getMouseCoords(),this.dragging=!0)},a.prototype.up=function(t){"left"===t.getMouseButton()&&(this.dragging=!1)},a.prototype.wheel=function(t){var e=this.browser.getMap();if(e){var i=e.getPosition(),r=t.getWheelDelta(),a=1*(r>0?-1:1);i.setViewExtent(s.clamp(i.getViewExtent()+a,1,179)),e.setPosition(i)}},a.prototype.keyup=function(){},a.prototype.keydown=function(){},a.prototype.keypress=function(){},a.prototype.tick=function(){if(0!=this.velocity[0]||0!=this.velocity[1]){var t=this.browser.getMap();if(t){var e=t.getPosition(),i=e.getCoords();if(i[0]-=this.velocity[0],i[1]-=this.velocity[1],e.setCoords(i),t.setPosition(e),!this.dragging){Math.abs(this.velocity[0])<5e-4?this.velocity[0]=0:this.velocity[0]*=.9,Math.abs(this.velocity[1])<5e-4?this.velocity[1]=0:this.velocity[1]*=.9}}}},a.prototype.reset=function(t){this.config=t},e.a=a},function(t,e,i){"use strict";function r(t,e){var i=new S(t,e);return i.core?i:null}function s(){return""+f()}Object.defineProperty(e,"__esModule",{value:!0});var a=i(21),n=i(33),o=i.n(n),h=i(13),l=i(2),u=i(4),c=i(3),d=i(22),p=i(168);i.d(e,"earcut",function(){return o.a}),i.d(e,"vec2",function(){return m}),i.d(e,"vec3",function(){return v}),i.d(e,"vec4",function(){return y}),i.d(e,"mat3",function(){return b}),i.d(e,"mat4",function(){return x}),i.d(e,"math",function(){return w}),i.d(e,"utils",function(){return M}),i.d(e,"getCoreVersion",function(){return f}),i.d(e,"checkSupport",function(){return g}),i.d(e,"browser",function(){return r}),i.d(e,"getBrowserVersion",function(){return s}),i.d(e,"proj4",function(){return A}),i.d(e,"platform",function(){return C});var f=h.a,g=h.b,m=l.a,v=l.b,y=l.c,b=l.d,x=l.e,M=u.a,w=c.a,S=p.a,A=a.a,C=d.a},function(t,e,i){"use strict";var r=function(t,e){this.container=null,this.aTags=null,this.sectionTags=null,this.defaultHeight=0,this.maxHeight=0,this.subtitlesHeights=[],this.firstTitleMargin=20,this.swipeOffset=60,this.actualNode=0,this.maxNodes=1,this.animTime=600,this.currentToolbox="right",this.browser=t,this.id=[],this.current=null,this.presenter=void 0!==e.presenter?JSON.parse(JSON.stringify(e.presenter)):{},this.presenterAutoplay=e.presenterAutoplay,void 0!==this.presenter&&this.playPresentation()};r.prototype.addPresentation=function(t,e){0!==Object.keys(this.presenter).length?this.presenter[t]=e:void 0!==t&&(this.presenter={},this.presenter[t]=e)},r.prototype.removePresentation=function(t){return void 0!==t?(this.getCurrentPresentation()==t&&(this.stopPresentation(),this.current=null),delete this.presenter[t],"Removed presentation id: "+t):(null!==this.getCurrentPresentation()&&this.stopPresentation(),this.presenter={},this.presenterAutoplay="",this.current=null,"All presentations removed.")},r.prototype.getCurrentPresentation=function(){return this.current},r.prototype.getCurrentPresentationType=function(){return this.currentToolbox},r.prototype.playPresentation=function(t){if(this.stopPresentation(),void 0!==this.presenterAutoplay&&void 0===t)t=this.presenterAutoplay;else if(void 0===t&&void 0!==this.presenter&&Object.keys(this.presenter).length>0)for(var e in this.presenter){t=e;break}return void 0!==t&&-1!=Object.keys(this.presenter).indexOf(t)&&(this.current=t,this.readTextInput(t),!0)},r.prototype.stopPresentation=function(){var t=this.getCurrentPresentation();return this.currentToolbox="right",null!==t&&(this.current=null,this.browser.ui.removeControl(t),this.container.getElementsByTagName("article")[0].parentNode.parentNode.parentNode.remove(),!0)},r.prototype.listPresentations=function(t){if(0===Object.keys(this.presenter).length)return[];if(void 0!==t)return"undefined"!==this.presenter[t]?this.presenter[t]:null;var e=[];for(var i in this.presenter)e.push(i);return e},r.prototype.initPresentation=function(t,e){var i=this,r='<div class="vts-presenter panelContainer"><div class="vts-presenter swipeControl top"></div><div class="vts-presenter toolboxContainer">'+e+'</div><div class="vts-presenter swipeControl"></div></div>',s='<div class="vts-presenter subtitlesContainer"><button type="button"></button><button type="button"></button><div class="vts-presenter swipeSubtitles"><div><div></div></div></div><div class="vts-presenter swipeSubtitles"><div><div></div></div></div><div class="vts-presenter innerContainer">'+e+"</div></div>",a=r+s,n=this.browser.ui.addControl(t,a);this.id.push(t),this.setContainer(n),this.aTags=this.container.getElementsByTagName("a");for(var o=0;o<this.aTags.length;o++)this.aTags[o].onclick=function(){i.linksDecode(this)};setTimeout(function(){this.renderControl()}.bind(this),200)},r.prototype.readTextInput=function(t){var e={htmlDataStorage:this.presenter[t],id:t,checkID:function(){var t=/^(ftp|http|https):\/\/[^ "]+$/,e=/.*\/+.*/,i=/(\.\.\/|\.\/)/g,r=/^#.*$/;if(/(<article)/g.test(this.htmlDataStorage))return"string";if(t.test(this.htmlDataStorage))return"url";if(e.test(this.htmlDataStorage)){for(var s,a=0,n="",o=window.location.href.split("/"),h="";null!==(s=i.exec(this.htmlDataStorage))&&(n+=s[0],"./"!==s[0]);)a++;a++;for(var l=0;l<o.length-a;l++)h=h+o[l]+"/";return h+=this.htmlDataStorage.split(n)[1],this.htmlDataStorage=h,"url"}return r.test(this.htmlDataStorage)?"hash":"string"}},i=e.checkID();if("url"==i){var r=new XMLHttpRequest;r.open("GET",e.htmlDataStorage,!1),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||0==r.status){var t=r.responseText;this.html=t,this.initPresentation(e.id,this.html)}else this.file="undefined"}.bind(this),r.send(null)}else if("hash"==i){var s=document.getElementById(e.htmlDataStorage).innerHTML;this.initPresentation(e.id,s)}else"string"==i&&this.initPresentation(e.id,e.htmlDataStorage)},r.prototype.linksDecode=function(t){var e=null,i=null,r=null,s=null;return null!==t.getAttribute("data-mln-navigate")&&null!==(s=t.getAttribute("data-mln-navigate"))?("prev"==s?this.nextArticle("-1"):"next"==s?this.nextArticle("+1"):"first"==s?this.nextArticle(0):"last"==s?this.nextArticle(this.maxNodes-1):this.nextArticle(s),"navigation:true"):null===t.getAttribute("data-mln-position")?"position:false":(e=this.getNumbers(t.getAttribute("data-mln-position").split(",")),null!==t.getAttribute("data-mln-autorotate")&&(i=this.getNumbers(t.getAttribute("data-mln-autorotate"))),null!==t.getAttribute("data-mln-transition")&&(r=t.getAttribute("data-mln-transition")),null===r?this.browser.autopilot.flyTo(e):"teleport"==r?this.browser.core.getMap().setPosition(e):this.browser.autopilot.flyTo(e),null!==i&&this.browser.autopilot.setAutorotate(i),"Moving to position: "+e)},r.prototype.getNumbers=function(t){for(var e=0;e<t.length;e++){if("string"==typeof t&&parseFloat(t)){t=parseFloat(t);break}parseFloat(t[e])&&(t[e]=parseFloat(t[e]))}return t},r.prototype.nextArticle=function(t,e,i){return"+1"===t?t=1:"-1"===t?t=-1:(this.actualNode=t,t=0),this.actualNode=this.actualNode+t,this.actualNode>=0&&this.actualNode<this.maxNodes?(e||("right"==this.currentToolbox?this.handleArticle(this.actualNode):"wide"==this.currentToolbox&&this.handleSubtitlesPosition(this.actualNode)),void 0!==i&&(this.maxNodes=i),this.linksDecode(this.container.getElementsByTagName("section")[this.actualNode]),!0):(this.actualNode=this.actualNode-t,!1)},r.prototype.useToolbox=function(){var t=this.container.getElementsByTagName("article")[0].getAttribute("data-mln-style");null===t&&(t="right");var e,i=this.container.getElementsByClassName("vts-presenter panelContainer")[0],r=this.container.getElementsByClassName("vts-presenter subtitlesContainer")[0],s=this.container.getElementsByClassName("vts-presenter swipeControl");if(this.currentToolbox=t,r.setAttribute("style","opacity: 0;"),r.setAttribute("class","vts-presenter subtitlesContainer"),"right"==t){for(i.style.display="block",setTimeout(function(){i.style.opacity=1},20),s[0].style.display="block",s[1].style.display="block",e=0;e<this.sectionTags.length;e++)this.sectionTags[e].style.height=this.maxHeight+"px";this.nextArticle(0)}else if("wide"==t){for(r.style.display="block",setTimeout(function(){r.style.opacity=1},20),i.style.display="none",i.style.opacity=0,s[0].style.display="none",s[1].style.display="none",e=0;e<this.sectionTags.length;e++)this.sectionTags[e].style.height="auto";this.handleSubtitlesPosition(0,!0)}},r.prototype.setContainer=function(t){this.container=t.element},r.prototype.renderControl=function(){this.sectionTags=this.container.getElementsByClassName("vts-presenter toolboxContainer")[0].querySelectorAll("section");var t=this.container.getElementsByClassName("vts-presenter swipeControl")[0],e=this.container.getElementsByClassName("vts-presenter swipeControl")[1],i=document.createElement("button");i.innerHTML="<div><div></div></div>",i.setAttribute("type","button"),i.setAttribute("class","vts-presenter-btnDw"),i.onclick=function(){this.nextArticle("+1")}.bind(this);var r=document.createElement("button");r.innerHTML="<div><div></div></div>",r.setAttribute("type","button"),r.setAttribute("class","vts-presenter-btnUp"),r.onclick=function(){this.nextArticle("-1")}.bind(this),t.appendChild(r),e.appendChild(i),this.getElementsTrueHeight(this.sectionTags);var s=this.maxHeight+this.swipeOffset;this.container.getElementsByClassName("vts-presenter panelContainer")[0].style.height=s+this.swipeOffset+"px",e.style.top=s+"px",t.style.opacity="1",e.style.opacity="1",setTimeout(function(){this.useToolbox()}.bind(this),this.animTime),this.nextArticle(0,!1,this.sectionTags.length)},r.prototype.getElementsTrueHeight=function(t){for(var e=0;e<t.length;e++)t[e].offsetHeight>this.maxHeight&&(this.maxHeight=t[e].offsetHeight);for(e=0;e<t.length;e++)t[e].style.height=this.maxHeight+"px"},r.prototype.handleArticle=function(t){var e=this.container.getElementsByClassName("vts-presenter toolboxContainer")[0],i=this.container.getElementsByClassName("vts-presenter-btnUp")[0],r=this.container.getElementsByClassName("vts-presenter-btnDw")[0],s=function(t){this.container.getElementsByClassName("vts-presenter toolboxContainer")[0].querySelectorAll("article")[0].setAttribute("class",t)}.bind(this),a=this.maxHeight*this.actualNode*-1;return i.setAttribute("class","vts-presenter-btnUp"),r.setAttribute("class","vts-presenter-btnDw"),0===t?i.setAttribute("class","vts-presenter-btnUp vts-presenter hidden"):t===this.maxNodes-1&&r.setAttribute("class","vts-presenter-btnDw vts-presenter hidden"),this.container.getElementsByTagName("article")[0].setAttribute("style","top: "+a+"px"),0===this.actualNode?(e.style.height=this.maxHeight+this.swipeOffset+"px",e.style.top=0,s("vts-presenter"),this.container.getElementsByClassName("vts-presenter swipeControl")[0].style.height=0,this.container.getElementsByTagName("article")[0].style.top=0,this.container.getElementsByTagName("section")[0].style.height=this.maxHeight+(this.swipeOffset-this.firstTitleMargin)+"px"):(e.style.height=this.maxHeight+"px",e.style.top=this.swipeOffset+"px",s("vts-presenter nonFirst"),this.container.getElementsByClassName("vts-presenter swipeControl")[0].style.height=this.swipeOffset+"px",this.container.getElementsByTagName("section")[0].style.height=this.maxHeight+this.swipeOffset+"px"),!0},r.prototype.handleSubtitlesPosition=function(t,e){void 0===t&&(t=0);var i=this.container.getElementsByClassName("vts-presenter subtitlesContainer")[0],r=i.childNodes[0],s=i.childNodes[1],a=i.childNodes[4].querySelectorAll("article")[0].querySelectorAll("section"),n=this.container.getElementsByClassName("vts-presenter swipeSubtitles");this.linksDecode(a[t]),a[t].removeAttribute("style"),i.setAttribute("class","vts-presenter subtitlesContainer"),i.removeAttribute("onclick"),n[0].removeAttribute("onclick"),n[1].removeAttribute("onclick"),n[0].removeAttribute("style"),n[1].removeAttribute("style"),r.removeAttribute("onclick"),s.removeAttribute("onclick"),r.setAttribute("class","vts-presenter hidden"),s.setAttribute("class","vts-presenter hidden");for(var o=0;o<a.length;o++)a[o].style.opacity=0,void 0===this.subtitlesHeights[o]&&(a[o].style.display="block",this.subtitlesHeights[o]=a[o].offsetHeight,a[o].style.display="none"),o!==t&&this.hideSections(a[o]);this.showSections(a[t]);var h=a[t].getAttribute("data-mln-style");void 0==h&&(h="full"),"full"==h?(n[0].style.opacity=0,n[1].style.opacity=0,n[0].style.cursor="default",n[1].style.cursor="default",0===t?(r.setAttribute("class","vts-presenter hidden"),s.setAttribute("class","vts-presenter"),s.onclick=function(){this.nextArticle(1)}.bind(this),s.innerHTML="Continue"):t===a.length-2&&(r.setAttribute("class","vts-presenter"),r.onclick=function(){this.nextArticle("-1")}.bind(this),r.innerHTML="Back",s.setAttribute("class","vts-presenter"),s.onclick=function(){this.nextArticle("+1")}.bind(this),s.innerHTML="Explore"),void 0===e&&i.setAttribute("style","display: block;"),i.setAttribute("class","vts-presenter subtitlesContainer full")):"title"==h?(n[0].style.opacity=1,n[1].style.opacity=1,n[0].onclick=function(){this.nextArticle("-1")}.bind(this),n[1].onclick=function(){this.nextArticle("+1")}.bind(this),r.setAttribute("class","vts-presenter hidden"),s.setAttribute("class","vts-presenter hidden"),i.style.height=this.subtitlesHeights[t]+"px",i.setAttribute("class","vts-presenter subtitlesContainer title")):"mini"==h&&(i.setAttribute("style","display: block;"),i.setAttribute("class","vts-presenter subtitlesContainer mini"),r.setAttribute("class","vts-presenter hidden"),s.setAttribute("class","vts-presenter hidden"))},r.prototype.hideSections=function(t){setTimeout(function(){t.style.display="none"},this.animTime)},r.prototype.showSections=function(t){setTimeout(function(){t.style.display="block",setTimeout(function(){t.style.opacity=1},50)},this.animTime)},e.a=r},function(t,e,i){"use strict";var r=function(t){this.roiServers=t};r.prototype.roisAtPosition=function(){},e.a=r},function(t,e,i){"use strict";var r=i(12),s=r.a,a=function(t,e){this.ui=t,this.browser=t.browser,this.control=this.ui.addControl("compass",'<div id="vts-compass"><div id="vts-compass-frame"><img id="vts-compass-compass" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGMAAABjCAYAAACPO76VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODRDNjZFNDJCQjNCMTFFM0IyN0ZCQTZFQTAwNzEzNDUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODRDNjZFNDNCQjNCMTFFM0IyN0ZCQTZFQTAwNzEzNDUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4NEM2NkU0MEJCM0IxMUUzQjI3RkJBNkVBMDA3MTM0NSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4NEM2NkU0MUJCM0IxMUUzQjI3RkJBNkVBMDA3MTM0NSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pgg3VBcAAAzUSURBVHja7F1bbBTXGf7tNdiAbTAXYxscMJe04GDLwVwKNDgNhaogRB+4qKgtzUMrISEhIXjiLsT9gQd4oQ8lPFRtEdACoWCCuASRBCelJBASEnM1xsbgGwYbg03PN/4PHI93vTO7s7tnxv6kX7Pe9Y7H/zf/5fxnzn/iXr16Rd3QA3HdZHST0Q2XktFTSLKQNCGpQlKEJLL4WFqFvGRp5uMTIfVCaoQ08PvdZNgEFJ8uZIiQQQ6fu0rIfSEPmaBuMvygv5CRQrJN78cLyeLPQc4AIX2ZsB5Cegn5qZBqIff47oc8F1In5DErH5+XswWpwHdK+fMuTQYUOUrIaJPy3xLyEyYnV0iGQ3+vQsg1Vv73Qu6ayPlByI9CGrsSGf34bs5SCMgRksfKL4jSdVxmcr4WckshBhb0nZBaL5ORysrO5J+ThExmmRBjD3FJyBdCPhfSxO89YLLqvUQGsp18IcP5Z2RD04X8jC1EJ8AiPhNyjrMx4LaQK0Ja3E7GGBaZon4gZCbHBZ2BeHJKyCdKSnydxXVk+Nj1ZHFMeEfIbCGFLhuHfSnkYyFXOaYgnpREykoiQQbSz2lMCFLS+WwNbkaxkAOcAoOIC5w2a03GOCVVRXa0UMO4EE48+QdnXzIV/kZXMibwoA0WMU/Ib8mb+JuQf7GF3GO3pQ0Z8ZwZDeZMaYmQIvI2zgrZxxlXJWdgrbEmA0T8nOMEyPijBmOGaAEW8VcmA/Hj03AJCYeMOA7UKOYNFfJ7IeOpa+ErIfuFlFFbERKB/VU4d3aomMhEoID3oVUijhw5QqWlpV4hYzz/77LCPDFcNxMK3uULQJ3pdzzCtoSmpiaqqanxknXksw7SWCfvRpOMd7i0gTL2n63EiKqqKrp+vW3w2qtXL3r27JnX3BV08CfWyXDWUcTJgCW8zenrEqtmWVlZSSUlbRlg7969qbGxkTyIiawTH+soLZJk4Hen8OtfC3nfikuSBMjXHrUMifdZN8Tpvq2bPcEm8yh7j7E6oNu8eTNt3LjRIEMS0LdvXzp27BhdvnyZfD6f8RkIeu+99ygvL88LhEA3mKS6zjr73GkyQICc/kStqaedq+vTp89ry8jNzTVIAl68eEFPnz41iEpOTvaKdfRkHe1WdHfdKTJ8fMJ4/iP5wVJX3OX9+vVrRwaC+KFDhwwrgMAiBg4cSCNGjGj3ux7KsKCrv7DubpCFSm+8xRMDKAIGrb6WlZXRkydt8zJwQy9fvqT4+HhasmQJZWVlUWJiIjU0NNCdO3fo1q1brtEuLLi52dbTPjMV3eU7YRmpnKolKoGpUyQlJb2OD7AAKD09Pd1wTyDFjbh48SJduHCBVq1aZfervxLyLesQcaQ+HDJy+TiDLE4Mwf3gLgLGjh1LR48epefPnxvpbGtrK8XFxdH69euNoxusYefOnXTu3Dk6cOBAKKcoZN19zLr8LFQy4Mjx8EAKn9AS1NR1zpw5rnX6sIZNmzbRw4cPacOGDTRgwIBQTwXdnVd0WhsKGXJSqIhszFmDjOPHj9OlS5deB2vI9OnTKSMjwzXWAIsGpk2bRrNnzw7nlG+xDo+yTgOmuoGqtkkcI3DcSG0PlFkGLEOmrPL1yJEjKS0tzTXWYATM1FTDPYVhFRKojK6ltseA/kMBHpQLZBly6nSyXSJk3IC4KVNSrUFixYoVThBBrEPo8iy1PUX5jZ3UdjR/Nok8DgTn+fPndyDCAfdkxiTW6Wg7MaM/H3MozPq8zsBYaNu2bXTixImO+bxwT2vWrHH6T05knZayjqutWIZ0S3letwZ/RADLly93yj2ZkWfScVDLyGaScruSNUhMnjyZ5s6dG6lLgE7/zTouCUaGrNZhxFjgNWvYsmULPXr0KODvoFi5du3aSF5GAev2Juu6oTMy0k3ZVJewBtU9oXQTYbzNZKQHI2NIZz7Ni9aguqd58+ZF47JGKLq+2RkZeMLB5/Z4YccaouSezHHDR37WK6pkyAkj1KMyuoI1RNk9SWSwjstY583+yEg2jTNchbq6OsMaiouLbX0viu7JPJYrY51X+xtnpJnihmtw+vRpY9xgl4gouycVQ00672AZqXwc4CZr2Lp1K506dSqk70fZPfmrcqQGIiOFj33dYg1wS9XVoS3hjpF7IpOOUwKRkWSKHdoCAfrgwYMhfz+G7skcn5PUN+P9ZFM9dLcISUSoU7cxdE8SiSaddyDDx8deumdMAOZLMAeBCqsdTJo0KZbuyWwZvmBkaLsGD8Faxohly5YZU7l79uyxTAgIXL16tQ7/yshgZMhVN9U6EgH3JLOmCRMmGKksMGbMGMuEgMDMzExtXbBKxks+3tPdPZmDrxVCVAI1gFwt1BKMDO2aZG3fvr2de/J3d3dGiD8CY4yGYGRIEl7odNWoNZ08edLS3R2IEA3d03N/N75KhiRBm5UsqL5iTGHn7gYhixYt0tU9mS2jKdCgD8+BDtIpgCNOyOqrlbvbXB7R0D1JyFYXdYHIkKseH+ninuR8hJW721weARF4wkPT7OmRSecdyJD9lcrd5J78FQtBHr6jcRpbbtJ5BzKkH6t1i3vyZw34fQ1jhBm1Jp13IEMGcLRfQHPFjFi7p8LCQr+Kdak1SFSwjjtkruY58CoO4tdiQYbqnvDkur/ShYutQeIajy+qzB+YybjPZGCE+EEs3dPSpUtp6NChnVoD5iQQpAcPHkwuwk1F152S8ZCPP8TSPRUUFLQbK5itAfMRKINrUH0NBTdMug5Ihgwot6mt72tBLNzTunXrjLkKKB8kgAzVGhAbYjwfESous247BG9/ZAAoFGazbyuIlXtCCWTHjh1UW1vrBWuQwGLLVgpQjPVHRimT8XU0ru78+fPt3NOsWbNo5cqVdObMGa9Yg4orio4tkSHLIVikjU7IEVujgRVDCMrSPU2dOpUWLFjgNWuQuMQ6pUAlp0DLyBDA8fDzF5EkA9Omcv0csHv3bi9ag0QJu6iAyVEgMn5kMrAyEwstHX8QGosZ1aVbsu2RbtaARmXoHIeWG3KtonxtA3BLFxXd2iKjkesnaN7yqdNkwD1hVakZOloDGgqADNwsUpBsFBUV0cyZlnsnQ4dNrNNGu2QA3zEZZ4X8ghzsX252T5gMgjVEcMVQyMDa9YULF7Z7D60rHj+23PD5LusQ+L6zX0wIUsx6wK/RoP3DSLgnrCrFKDpCa+hCAtbGo6UGjuh3guQCDWhGjRpldH2Ai0LDGouA7p6wLmtCJUPWUTL5hFgcWOiUe4I1YJ21w8t7HQEGnGhRAaDfCa4bloyH50AGYobFbnJfsu6kLikcMup5xDhcyIlwyZDuSUdrkGUXjPplPywZrMeNG2e8J5MMtc1fEEBnmO++QxY2RbHSc+iKciwOxz2h/oQ7bteuXdoRAeTk5NCwYcOMjA6Bu7y8nPbt22dYR0JCArW0tD3MkZKS0q6IGQDFiu7+Z+XvW+nEhitAWzd0FEOfH5RI8+26JwQ9h/pwOIr6+nqjGRnu9uzsbKMznIobN24Y1w8CJNA5LkiycYV11cq6a3GKDOITysfYDzAxlvsU9ujRI5TGWVHB7du3jZIMXBDiAO5+dI9bvHix0bAMzczMZARBM73Za6OcbOxGY6cXOlwaOovhMXbcFn8gj+Lw4cPGHMmUKVNo7969NGPGDMNiECdAThB8JOQIjytOkI1m9Xb61OGkspMYOoud8SoZaiNktc2fBSLOsG6IQtjGwW7TQOTJshPlPnJwIw+doHaTw9y6xZnEEtZJC+vIdsP3hBCu9SrHi+FskiB0vNcso6KiwniNJxQt4CvWRQMPBa6G8ncTQrze/9KbRTX7+Tz5XiEDHeMsuCQ1c9rPI+xK1k1og80wNjOBRWAzk4HUvZkJaiOYqrxAYewu4+Q2P5mcYXWlbX4+YouI+TY/KiFdbQOsc0xEHWm0AZYKuTUc4sdvhCzyKBF/x1CE2hYXabc1nIruTRM1IoOo43aiC4T80uVE4DHGf5LLthOVMG+0C4vBXLobN9o9zhbgyo12VahbUKMrwAwWN2xB/QmLXH/n2i2ozVZi3py9iFNi3drvlXKKepY8uDm7CixBzeXxCIAhLjbUmqjB2ASuBw+Z4XEaOYWH8QOmSuujdRHRJON1tYEzrExlnJLD1jOWotfCFQ8hf8t3/S1lnPCAM6eo7+wYCzIkUNsaRe3btsZzPAFZI9iSnFq0U8F3+k1W9l3TQA2pKh4wi9nS61iSoaI/x49sP6N7uQvaEE6bMeOYzAlBmpIM3OW7GQG3gUfHSD/v05tZN/Mo+R6T81gHJehChopkLq2AhEEOn7uKSakkP+sjuskIjp5MUBonASkc/HtypibbBLWwNHMQfsLBt4YV36z7P+oGMroMusnQCP8XYACgtQtbAKLiKwAAAABJRU5ErkJggg=="></div><div id="vts-compass-frame2"><img id="vts-compass-compass2" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGMAAABjCAYAAACPO76VAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABG9JREFUeNrtnM9LFGEcxkeEPCQVmbkh7EXoEgW6noIQzQwKoQ5Lkgh7SA8iddlCQfAQFApdghAxooJCsEMe9JAEek8i81YQCIEYQvgHZM9L37Fpmpl9Z3d+rs8DDw7unuaz3+ddX+d9DIOiKIqiKIqiKIqiKIqiKIqiKIqiKMpTQ0NDyqNwTq7/MRUNAKsfwL2EER+MLHxBru/BA4QR3zR0wY/lWmmEMKKHcVh+tsEv5PoGPE4Y0cP4LD9b4AW57oC/whvwB3gZfgN3886FG1EmjAZ41WEa6uAm+DTcyLsXPAz11fWkDUYtvAVPwHfgAnwdbmVMhQtjDj4jN3gNPiTXF+E8fAsuwvfhQScIuVwuMusK762H69IGYwY+LwDew+3wcZkOQ2fhThoMvK8TnkrjZEzCV+RGF2XhXoE/wuvwJ7jGK5aSAkOm4Qm8DTemEcYYfNNtCnTWiCTAkGn4Bu/B+bSuGcPwF3gJfg1Pww/l661uLMQGwzINe+L5tH+1PSpbIOdkG0TtRWWSDsM2Dco/UhlPQSpqGA7TsJfqeEorDLjHNg3pj6cUwjgCzzpAYDxFDENNw6YLCOU+Uggfhtc0mH5LAuHDKDUNyjtwhgTCg6EzDab7effDg6EzDYynkGH4mQbGU4gw/EwD4ykkGMfgZz4hMJ5CgHEV/l4GCMZTgDDUNDwvAwLjKeD1odxp2I8nP/92JQx3P6oAwn48EUYw64N5U3+VG09+H0ggDOc1woymn/Bl2WH1A2KhnKdDCON/WxfrgvzurA8gCmAzYVQOwxpPi7bXdIEUyn1uijDc46nZ4T2lgCxW8hAbYfz1U69PtwYQN4AE4BNGT6lPtwaQQqWPdxLGn93XzVKfbgff1QVI6cOY1Ywnt+2RkgApPRh+48m+PaJA9Ab1FPpBhuEnnpw2Cxd1I40qDUM3npymoRDG+YyDCsMaT0thTANh6MGwxtMunA1jGghDD4Y1ngY1pkH9T+JUFMfIDhoMazy9g2s8pmHHug1OGMHCcIunBvilwzRkoj5geZBgOMXTNXgrjGkgDHcYl2zxdAJ+FeY0EIYziHrLQRUVT7ejmAbCcIZhPbq1G9U06MIo97RuGkF0ejy50Z9LwDlwuekZOSB6QQ6MZuUAaVXGU+TT4BNGixydnpaj1EtytHq4GuPJPEPXF/HBSkcYOmUCUjowVo3xNK8OM8YBwgNGjdRqrEvNxorUbhTldVXHMVlN8aSmIR8XBDsMjymolSKadimmMaSoZqZa4mnePNqbMBiDUr1UlCqmvFQzGVLVtCbXqsJpLu3xtG1vHYgThMMUtEopWUFKyiaktKzWVmamys1G0xxPU04H3RMAo1Fq+Zqkps8OaFVq/aww0vt3hleDWQJgdEth5bIUWG5IoWWHvL5gNgJZYVABy2PRHpfKV0MqYNts1bC8eRHCGJEyZEPKkbvYwRsfjAGpCTdkGyRLAPHB6JUCfU5DAmDkpJ+XN4miKIqiKIqiKIqiKIqiKIqiKIpKpn4DKrVAiBFUfdUAAAAASUVORK5CYII="></div><div id="vts-compass-frame3"><img id="vts-compass-compass3" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGMAAABjCAYAAACPO76VAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABG9JREFUeNrtnM9LFGEcxkeEPCQVmbkh7EXoEgW6noIQzQwKoQ5Lkgh7SA8iddlCQfAQFApdghAxooJCsEMe9JAEek8i81YQCIEYQvgHZM9L37Fpmpl9Z3d+rs8DDw7unuaz3+ddX+d9DIOiKIqiKIqiKIqiKIqiKIqiKIqiKMpTQ0NDyqNwTq7/MRUNAKsfwL2EER+MLHxBru/BA4QR3zR0wY/lWmmEMKKHcVh+tsEv5PoGPE4Y0cP4LD9b4AW57oC/whvwB3gZfgN3886FG1EmjAZ41WEa6uAm+DTcyLsXPAz11fWkDUYtvAVPwHfgAnwdbmVMhQtjDj4jN3gNPiTXF+E8fAsuwvfhQScIuVwuMusK762H69IGYwY+LwDew+3wcZkOQ2fhThoMvK8TnkrjZEzCV+RGF2XhXoE/wuvwJ7jGK5aSAkOm4Qm8DTemEcYYfNNtCnTWiCTAkGn4Bu/B+bSuGcPwF3gJfg1Pww/l661uLMQGwzINe+L5tH+1PSpbIOdkG0TtRWWSDsM2Dco/UhlPQSpqGA7TsJfqeEorDLjHNg3pj6cUwjgCzzpAYDxFDENNw6YLCOU+Uggfhtc0mH5LAuHDKDUNyjtwhgTCg6EzDab7effDg6EzDYynkGH4mQbGU4gw/EwD4ykkGMfgZz4hMJ5CgHEV/l4GCMZTgDDUNDwvAwLjKeD1odxp2I8nP/92JQx3P6oAwn48EUYw64N5U3+VG09+H0ggDOc1woymn/Bl2WH1A2KhnKdDCON/WxfrgvzurA8gCmAzYVQOwxpPi7bXdIEUyn1uijDc46nZ4T2lgCxW8hAbYfz1U69PtwYQN4AE4BNGT6lPtwaQQqWPdxLGn93XzVKfbgff1QVI6cOY1Ywnt+2RkgApPRh+48m+PaJA9Ab1FPpBhuEnnpw2Cxd1I40qDUM3npymoRDG+YyDCsMaT0thTANh6MGwxtMunA1jGghDD4Y1ngY1pkH9T+JUFMfIDhoMazy9g2s8pmHHug1OGMHCcIunBvilwzRkoj5geZBgOMXTNXgrjGkgDHcYl2zxdAJ+FeY0EIYziHrLQRUVT7ejmAbCcIZhPbq1G9U06MIo97RuGkF0ejy50Z9LwDlwuekZOSB6QQ6MZuUAaVXGU+TT4BNGixydnpaj1EtytHq4GuPJPEPXF/HBSkcYOmUCUjowVo3xNK8OM8YBwgNGjdRqrEvNxorUbhTldVXHMVlN8aSmIR8XBDsMjymolSKadimmMaSoZqZa4mnePNqbMBiDUr1UlCqmvFQzGVLVtCbXqsJpLu3xtG1vHYgThMMUtEopWUFKyiaktKzWVmamys1G0xxPU04H3RMAo1Fq+Zqkps8OaFVq/aww0vt3hleDWQJgdEth5bIUWG5IoWWHvL5gNgJZYVABy2PRHpfKV0MqYNts1bC8eRHCGJEyZEPKkbvYwRsfjAGpCTdkGyRLAPHB6JUCfU5DAmDkpJ+XN4miKIqiKIqiKIqiKIqiKIqiKIpKpn4DKrVAiBFUfdUAAAAASUVORK5CYII="></div> </div>',e);var i=this.control.getElement("vts-compass");i.setDraggableState(!0),i.on("drag",this.onDrag.bind(this)),i.on("dblclick",this.onDoubleClick.bind(this)),this.image=this.control.getElement("vts-compass-compass"),this.image2=this.control.getElement("vts-compass-compass2"),this.image3=this.control.getElement("vts-compass-compass3"),this.lastStyle=""};a.prototype.update=function(){var t=this.browser.getMap();if(t){var e=t.getPosition(),i=e.getOrientation(),r="rotateX("+.7*Math.round(i[1]+90)+"deg) rotateZ("+Math.round(-i[0]-45)+"deg)";r!=this.lastStyle&&(this.lastStyle=r,this.image.setStyle(s.TRANSFORM,r),this.image2.setStyle(s.TRANSFORM,r),this.image3.setStyle(s.TRANSFORM,r))}},a.prototype.onDrag=function(t){if(this.browser.getMap()){this.browser.autopilot&&(this.browser.autopilot.setAutorotate(0),this.browser.autopilot.setAutopan(0,0));var e=t.getDragDelta(),i=this.browser.controlMode.getCurrentController();i.orientationDeltas&&i.orientationDeltas.push([.4*e[0],.4*-e[1],0])}},a.prototype.onDoubleClick=function(t){var e=this.browser.getMap();if(e){this.browser.autopilot&&(this.browser.autopilot.setAutorotate(0),this.browser.autopilot.setAutopan(0,0));var i=e.getPosition(),r=i.getOrientation();r[0]=0,r[1]=-90,i.setOrientation(r),e.setPosition(i),"azimuthal2"==this.browser.config.navigationMode&&(this.browser.config.navigationMode="azimuthal"),s.stopPropagation(t)}},e.a=a},function(t,e,i){"use strict";var r=function(t,e){this.ui=t,this.browser=t.browser,this.control=this.ui.addControl("credits",'<div id="vts-credits" class="vts-credits"> </div>',e),this.lastHTML="",this.lastHTML2="",this.lastHTML3="",this.credits=this.control.getElement("vts-credits")};r.prototype.getCreditsString=function(t,e,i){for(var r,s=this.browser.getMap(),a="",n=t.length,o="",h=!1,l=0;l<n;l++)r=s.getCreditInfo(t[l]),r.plain&&(o+=r.plain);if(o&&o.length>30&&n>1&&!i){for(l=0;l<n;l++)if(r=s.getCreditInfo(t[l]),""!=r.html.trim()){n=l+1;break}n<t.length?h=!0:n=t.length}for(l=0;l<n;l++)r=s.getCreditInfo(t[l]),r.html&&""!=r.html.trim()&&(a+=r.html,l+1<n&&(a+=e));return[a,h]},r.prototype.update=function(){var t=this.browser.getMap();if(t){var e,i="",r="",s="",a=t.getCurrentCredits();if(a.imagery.length>0&&(e=this.getCreditsString(a.imagery,", "),""!=e[0]&&(i+='<div class="vts-credits-supercell">',i+='<div class="vts-credits-cell">Imagery: '+e[0]+"</div>",i+=e[1]?'<div class="vts-credits-cell-button" id="vts-credits-imagery-more">and others</div>':"",i+='<div class="vts-credits-separator"></div>',i+="</div>",r='<div class="vts-credits-list">',r+=this.getCreditsString(a.imagery,"<br/>",!0)[0]+"</div>")),a.mapdata.length>0&&(e=this.getCreditsString(a.mapdata,", "),""!=e[0]&&(i+='<div class="vts-credits-supercell">',i+='<div class="vts-credits-cell">Map Data: '+e[0]+"</div>",i+=e[1]?'<div class="vts-credits-cell-button" id="vts-credits-mapdata-more">and others</div>':"",i+='<div class="vts-credits-separator"></div>',i+="</div>",s='<div class="vts-credits-list">',s+=this.getCreditsString(a.mapdata,"<br/>",!0)[0]+"</div>")),i+='<div class="vts-credits-supercell">',i+='<div class="vts-credits-cell">Powered by <a class="vts-logo" href="https://melown.com" target="blank">MELOWN</a></div>',i+='<div class="vts-credits-separator"></div>',i+="</div>",this.lastHTML!=i){this.lastHTML=i,this.credits.setHtml(i);var n=this.control.getElement("vts-credits-imagery-more");n&&n.on("click",this.onMoreButton.bind(this,n,"2")),n=this.control.getElement("vts-credits-mapdata-more"),n&&n.on("click",this.onMoreButton.bind(this,n,"3"))}this.lastHTML2=r,this.lastHTML3=s}},r.prototype.onMoreButton=function(t,e){var i=t.getRect();e="2"==e?this.lastHTML2:this.lastHTML3,this.ui.popup.show({right:Math.max(0,i.fromRight-i.width)+"px",bottom:i.fromBottom+7+"px"},e)},e.a=r},function(t,e,i){"use strict";var r=function(t,e){this.ui=t,this.control=this.ui.addControl("fallback",'<div class="vts-fallback"><div class="vts-fallback-text"><p>VTS Browser needs <a href="http://get.webgl.org/">WebGL</a> capable web browser.</p></div> </div>',e)};e.a=r},function(t,e,i){"use strict";var r=i(12),s=r.a,a=function(t,e){this.ui=t,this.control=this.ui.addControl("fullscreen",'<img id="vts-fullscreen" class="vts-fullscreen" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAwUlEQVRo3u2YwRWDIBBEIc+SLMKmckpTFkFPePKQQ57DsitR/z/D6KgMDikBAMCTycKYxai9Bul8MYkic+NFS7BOs4FUa/1IrzTn9xk6O6+rrwEMjGayTlS/UXWeujbcDKgpEZRObgYOc1oYt7CIMXCFFLKmTrS+aqAEP8iSAGBYI1s776FLv7eReaWHWd/cyLz3Bas+vxIYGNXIhBTxOhcKNdCaHvPfGPjVYb3OhVjEGLhrI/Pewc9uZDQvAABwZQMKFi+DmFdLbgAAAABJRU5ErkJggg==">',e);var i=this.control.getElement("vts-fullscreen");i.on("click",this.onClick.bind(this)),i.on("dblclick",this.onDoNothing.bind(this)),this.enabled=!1};a.prototype.onDoNothing=function(t){s.preventDefault(t),s.stopPropagation(t)},a.prototype.requestFullscreen=function(t){t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()},a.prototype.exitFullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},a.prototype.fullscreenEnabled=function(){return document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled},a.prototype.onClick=function(){var t=this.ui.element;this.enabled?(this.enabled=!1,this.exitFullscreen()):(this.enabled=!0,this.requestFullscreen(t))},e.a=a},function(t,e,i){"use strict";var r=function(t,e){this.ui=t,this.control=this.ui.addControl("github",'<a target="_blank" href="https://github.com/Melown/vts-browser-js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/52760788cde945287fbb584134c4cbc2bc36f904/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"></a>',e)};e.a=r},function(t,e,i){"use strict";var r=i(197),s=r.a,a=function(t,e,i,r){this.ui=t,this.html=e,this.elementsById=[],this.visible=null==i||i,this.element=document.createElement("div"),this.setVisible(this.visible),this.setHtml(e),r?r.appendChild(this.element):this.ui.element.appendChild(this.element)};a.prototype.setHtml=function(t){this.element.innerHTML=t;for(var e=this.element.getElementsByTagName("*"),i=0,r=e.length;i<r;i++){var a=e[i].getAttribute("id");null!==a&&(this.elementsById[a]=new s(this,e[i]))}},a.prototype.getElement=function(t){return this.elementsById[t]},a.prototype.setVisible=function(t){this.element.style.display=t?"block":"none",this.visible=t},a.prototype.getVisible=function(){return this.visible},e.a=a},function(t,e,i){"use strict";var r=function(t,e){this.ui=t,this.control=this.ui.addControl("layers",'<div class="vts-layers"</div>',e)};e.a=r},function(t,e,i){"use strict";var r=i(12),s=r.a,a=function(t,e){this.ui=t,this.browser=t.browser,this.control=this.ui.addControl("link",'<div id="vts-link" class="vts-link"><div id="vts-link-button" class="vts-link-button"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAABrUlEQVRIx+2VMWtUQRSFz5nZjVrpD9gNVhpLQbZZ5vWaIoUECayNRSpbo9UiJI1pBRs7DVjYGBC1ntm3yHaiwgYsZP+EmMe7x8K3YJEH+xYLwT3NcGe483HvnJkBVvovxWWSsiy7BeAxgGuSpmY2zPP8/V+DhBAekDysQgPgAMDMbo5Gow9n5bgmgF6vd47kAYBC0t0Y45qkPQAguV+X1wgymUx+ShqUZZmllI4AlEVRPJckkht1ea1FNu/3+1ve+31JV0h+dc49mq+12+0dkpQ0XfpMQgh7JJ9U4SmANf3WZUnXvfevAbQBbMYY3zVu1x+Awsx2YoznzewOgKcke3OApId1AADwCwIGJG90u12f5/nx+vr6Jefc0RyQUjpsfE9CCJsk3wIoyrLcljRttVrznv8AcAEAFgHUtovksNrkXp7nx+Px+ETSbQBfKrN8NrOtRQC17pK0QbJMKb2az5nZd+fc/ZRSBKAm1q+r5ASADyHsVuPAe/+R5JtlnqEzIWY2rGDPsiw7JfmysulB0ypq3TWbzb51Op0JyaskLwL4BGA3xvhi9aes9G/pF4AdwlhUZ8RfAAAAAElFTkSuQmCC"></div><div id="vts-link-text-holder" class="vts-link-text-holder"><div class="vts-link-text"><textarea id="vts-link-text-input" rows="4" cols="50" wrap="hard"></textarea></div></div> </div>',e),this.div=this.control.getElement("vts-link");var i=this.control.getElement("vts-link-button");i.on("click",this.onSwitch.bind(this)),i.on("dblclick",this.onDoNothing.bind(this)),this.linkPanel=this.control.getElement("vts-link-text-holder"),this.link=this.control.getElement("vts-link-text-input"),this.linkVisible=!1,this.update()};a.prototype.onDoNothing=function(t){s.stopPropagation(t)},a.prototype.onSwitch=function(){this.linkVisible=!this.linkVisible,this.updateLink(),this.update()},a.prototype.update=function(){var t=10+(this.ui.config.controlZoom?70:0)+(this.ui.config.controlSpace?35:0);this.div.setStyle("left",t+"px"),this.linkPanel.setStyle("display",this.linkVisible?"block":"none")},a.prototype.updateLink=function(){var t=this.browser.getLinkWithCurrentPos();this.link.getElement().value!=t&&(this.link.getElement().value=t)},e.a=a},function(t,e,i){"use strict";var r=function(t,e){this.ui=t,this.control=this.ui.addControl("loading",'<div id="vts-loading" class="vts-loading"><div class="vts-loading-progress"><div id="vts-loading-dot1" class="vts-loading-dot"></div><div id="vts-loading-dot2" class="vts-loading-dot"></div><div id="vts-loading-dot3" class="vts-loading-dot"></div><div id="vts-loading-dot4" class="vts-loading-dot"></div><div id="vts-loading-dot5" class="vts-loading-dot"></div></div> </div>',e),this.loading=this.control.getElement("vts-loading"),this.dots=[this.control.getElement("vts-loading-dot1"),this.control.getElement("vts-loading-dot2"),this.control.getElement("vts-loading-dot3"),this.control.getElement("vts-loading-dot4"),this.control.getElement("vts-loading-dot5")],this.time=Date.now(),this.hiding=null};r.prototype.show=function(){this.hiding=null,this.ui.setControlVisible("compass",!1),this.ui.setControlVisible("zoom",!1),this.ui.setControlVisible("space",!1),this.ui.setControlVisible("search",!1),this.ui.setControlVisible("link",!1),this.ui.setControlVisible("github",!1),this.ui.setControlVisible("measure",!1),this.ui.setControlVisible("fullscreen",!1),this.ui.setControlVisible("credits",!1),this.ui.setControlVisible("loading",!0),this.time=Date.now()},r.prototype.hide=function(){this.hiding=Date.now();var t=this.ui.config.controlSearch;if(t&&!this.ui.browser.config.controlSearchUrl){var e=this.ui.browser.getMap();if(e){var i=e.getSrsInfo(e.getReferenceFrame().physicalSrs).a;t=i<6428137&&i>6328137}}this.ui.setControlVisible("compass",this.ui.config.controlCompass),this.ui.setControlVisible("zoom",this.ui.config.controlZoom),this.ui.setControlVisible("space",this.ui.config.controlSpace),this.ui.setControlVisible("search",t),this.ui.setControlVisible("link",this.ui.config.controlLink),this.ui.setControlVisible("github",this.ui.config.controlGithub),this.ui.setControlVisible("measure",this.ui.config.controlMeasure),this.ui.setControlVisible("fullscreen",this.ui.config.controlFullscreen),this.ui.setControlVisible("credits",this.ui.config.controlCredits),this.ui.setControlVisible("loading",!1)},r.prototype.update=function(){var t,e=Date.now();this.hiding&&(t=.001*(e-this.hiding),this.loading.setStyle("opacity",1-Math.min(1,2*t)+""),t>.5&&this.control.setVisible(!1)),t=.001*(e-this.time);for(var i=0;i<5;i++)this.dots[i].setStyle("opacity",.6*Math.sin(1.5*Math.PI/5*i-t*Math.PI*2)+.2);var r=this.ui.browser.getMap();if(r){var s=r.getStats();(0==s.surfaces&&0==s.freeLayers||e-this.time>7e3||0==s.downloading&&s.lastDownload>0&&e-s.lastDownload>1e3||0!=s.bestMeshTexelSize&&s.bestMeshTexelSize<=3*s.texelSizeFit||("fit"==s.loadMode||"fitonly"==s.loadMode)&&s.drawnTiles-s.drawnGeodataTiles>1)&&(this.hide(),this.ui.browser.callListener("loading-screen-hidden",{}))}},e.a=r},function(t,e,i){"use strict";var r=function(t,e){this.ui=t,this.browser=t.browser,this.control=this.ui.addControl("map",'<div id="vts-map" class="vts-map"> </div>',e),this.getMapElement().setDraggableState(!0)};r.prototype.getMapElement=function(){return this.control.getElement("vts-map")},e.a=r},function(t,e,i){"use strict";var r=i(12),s=r.a,a=function(t,e){this.ui=t,this.browser=t.browser,this.control=this.ui.addControl("measure",'<div id="vts-measure" class="vts-measure"><img id="vts-measure-button" class="vts-measure-button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2lpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NDkxMSwgMjAxMy8xMC8yOS0xMTo0NzoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpkNjI1MjFjMi1mYzE5LTcyNDUtOTI5My1kNTU3MmE5N2E1MjgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODJGRUI2NzE2NzkwMTFFN0EzRUZFNzQ1NEFCMkVFQUQiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODJGRUI2NzA2NzkwMTFFN0EzRUZFNzQ1NEFCMkVFQUQiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRBMjkwN0JENjc4QzExRTc5QTQwRjk4NjQzOEI4RDczIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRBMjkwN0JFNjc4QzExRTc5QTQwRjk4NjQzOEI4RDczIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k3ySjQAAAdJJREFUeNrclk0oBGEYgHemjZOLm8tSyt9BqT2I1O7JSdSSkpsDxZGLi5MTjn5K4SDh4OfiaPfkIDebOPiPUqKUiLKet96pzzT7MztxMPX0le+b95n3Z2ZZmUwm9NuXHfqLK1smsVhsED5hKkhswc4mYJmHVxgNIvIslyE4hnLYDSqycwiaoCGVSnUFFdk5BH2wKHtBRbYKqlVwbQhGoNU5GETkZHKpggjMqaBFhaGgIltv/mKphRuQss1oZkPuG4oRWTLHlmU5fSlhOYNKSEK7xIUugj+6hmSHpROm2RvL9Q7arqf80IykdDEdgll4IWi/Bm+ECT8Z2R7l+DBKV6N/PoRnEbBuwIKf0nm+8S7RGuzDLaxLMuw/5OuR+bn60ROPt9/pUUQnUEa6A56SyeSWeTYejzs9GkC8ZIpySjxEy1APbdCM6MAlGmeZdIahYIlLVAU9kIA7KZFxrJrA5+bU8RBjBf+eGD26gk0oI4AItiU4dMOqHh+GTylbQT3JU7oj2IMLmNBJrIATKIUoD5L2LfEQJbRPvXAP0iPZj5J92vNl9Fk6mSCZsBV4dwuyflb8XJrRqX6C3iDsFhSdiXOzZlSnwxD2yuBHJv/iX6JvAQYAPSICqA82OnoAAAAASUVORK5CYII="><img id="vts-measure-button2" class="vts-measure-button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NDkxMSwgMjAxMy8xMC8yOS0xMTo0NzoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo2Nzg3NzczMzY3OEMxMUU3QjU2QUUxNTNCNzc4MzVBQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo2Nzg3NzczNDY3OEMxMUU3QjU2QUUxNTNCNzc4MzVBQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjY3ODc3NzMxNjc4QzExRTdCNTZBRTE1M0I3NzgzNUFCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjY3ODc3NzMyNjc4QzExRTdCNTZBRTE1M0I3NzgzNUFCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+owD8TQAAAepJREFUeNrcls8rBGEYx993lIMfxR4kF/+AKMqBg7K1ajelLEWK025tKOTnjVykuAklNgcHuzmQg4MiTtz4Aza3TeGActDr+45nZt41s7tmBwdbn2l35933M9/3eead5UII9tsvjf3FK2uSiGgBKdDtZW6JllXA2DG4A3teRM7LZQl2QRuY9irScghGQRXb5KteRVoOQSMY0895FGkk8JHgSBH0gllzpAeRkeSRBAEwQIIZUJMxukARly3GOZdpivA5DnpAM2iQ5zFx3KE55DIugT6cT+a7PTTlKt9xHAT74AzU6vWJiEVQ4iWR9uXHhkgu3QhYB/JK3zBZE6WoBkE3Ivt9YolOQBd9uwJedQFjC+A8XyJ1J3G+4zNFV+CCmmMejINnY8sQG0wVzZnFlnW2Fd55ezGaIUAtPgzqwAsmv8mYMCLW8DaqdyY1g73w+RMFQRh0glse1RtDHRvDcdJp6XInsScKU3u3gnukSfCoOcoH0YPa3jif/P7zxEqUoPqUkWBZ398YqwdTNHqLdu+YuyTONToEl+AaTIAhUE61qwTtuJC0e4klkssQAn7QTy3+BA5AhRQgfdoovHvJp6iYli5EdTqlBKZA7a7CJFaiHdABUqBUFfyMxBJt06PBrwpskn/xl+hDgAEAH0j0b9rsgVUAAAAASUVORK5CYII="><div id="vts-measure-text-holder" class="vts-measure-text-holder"><div class="vts-measure-text"><textarea id="vts-measure-text-input" rows="4" cols="50" wrap="hard"></textarea></div></div><div id="vts-measure-info" class="vts-measure-info"></div> </div>',e),this.div=this.control.getElement("vts-measure"),this.buttonOff=this.control.getElement("vts-measure-button"),this.buttonOff.on("click",this.onSwitch.bind(this)),this.buttonOff.on("dblclick",this.onDoNothing.bind(this)),this.buttonOn=this.control.getElement("vts-measure-button2"),this.buttonOn.on("click",this.onSwitch.bind(this)),this.buttonOn.on("dblclick",this.onDoNothing.bind(this)),this.info=this.control.getElement("vts-measure-info"),this.measuring=!1,this.counter=1,this.listPanel=this.control.getElement("vts-measure-text-holder"),this.list=this.control.getElement("vts-measure-text-input"),this.measuring?(this.buttonOn.setStyle("display","block"),this.buttonOff.setStyle("display","none")):(this.buttonOn.setStyle("display","none"),this.buttonOff.setStyle("display","block")),this.onMouseMoveCall=this.onMouseMove.bind(this),this.onMouseLeaveCall=this.onMouseLeave.bind(this),this.onMouseClickCall=this.onMouseClick.bind(this),this.update()};a.prototype.onDoNothing=function(t){s.stopPropagation(t)},a.prototype.onMouseLeave=function(t){this.info.setStyle("display","none")},a.prototype.onMouseClick=function(t){var e=this.browser.getMap();if(e){var i=t.getMouseCoords(),r=e.getHitCoords(i[0],i[1],"fix");r=e.convertCoordsFromNavToPublic(r,"fix");var s="#"+this.counter+" "+r[0].toFixed(7)+", "+r[1].toFixed(7)+", "+r[2].toFixed(2);this.counter++;var a=this.list.getElement();a.value+=s+"\n",a.scrollTop=a.scrollHeight}},a.prototype.onMouseMove=function(t){var e=this.browser.getMap();if(e){var i=t.getMouseCoords(),r=e.getHitCoords(i[0],i[1],"fix");r=e.convertCoordsFromNavToPublic(r,"fix");var s=r[0].toFixed(7)+", "+r[1].toFixed(7)+", "+r[2].toFixed(2);i[0]-=this.divRect.left,i[1]-=this.divRect.top,this.info.setStyle("display","block"),this.info.setStyle("left",i[0]+20+"px"),this.info.setStyle("top",i[1]+10+"px"),this.info.setHtml(s)}},a.prototype.onSwitch=function(){this.measuring=!this.measuring;var t=this.ui.getMapElement();this.measuring?(this.buttonOn.setStyle("display","block"),this.buttonOff.setStyle("display","none"),this.divRect=this.div.getRect(),t.on("mousemove",this.onMouseMoveCall),t.on("mouseleave",this.onMouseLeaveCall),t.on("click",this.onMouseClickCall)):(this.buttonOn.setStyle("display","none"),this.buttonOff.setStyle("display","block"),t.off("mousemove",this.onMouseMoveCall),t.off("mouseleave",this.onMouseLeaveCall),t.off("click",this.onMouseClickCall)),this.updateLink(),this.update()},a.prototype.update=function(){var t=10+(this.ui.config.controlZoom?70:0)+(this.ui.config.controlSpace?35:0);this.div.setStyle("left",t+"px"),this.listPanel.setStyle("display",this.measuring?"block":"none")},a.prototype.updateLink=function(){},e.a=a},function(t,e,i){"use strict";var r=function(t,e){this.ui=t,this.browser=t.browser,this.control=this.ui.addControl("popup",'<div class="vts-popup-background" id="vts-popup-background"><div id="vts-popup"</div></div>',e),this.lastHTML="",this.popup=this.control.getElement("vts-popup"),this.background=this.control.getElement("vts-popup-background"),this.background.on("click",this.hide.bind(this))};r.prototype.show=function(t,e){this.control.setVisible(!0);for(var i in t)this.popup.setStyle(i,t[i]);this.popup.setHtml(e)},r.prototype.hide=function(){this.control.setVisible(!1)},e.a=r},function(t,e,i){"use strict";function r(t){for(var e,i=[],r=[],s=function(t){for(var e=0;e<t.length;e++)switch(t[e].type){case"hamlet":case"village":case"town":case"city":return t[e]}return t[0]},a=0;a<t.length-1;a++)e=t[a],e.display_name===t[a+1].display_name?r.push(e):r.length>0?(r.push(e),i.push(s(r)),r.length=0):i.push(e);return r.length&&i.push(s(r)),i}function s(t,e,i,r){var s=u.radians(e),a=u.radians(r),n=u.radians(r-e),o=u.radians(i-t),h=Math.sin(n/2)*Math.sin(n/2)+Math.cos(s)*Math.cos(a)*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))*6371e3}function a(t,e){return+e.lat>+t.lat-.1&&+e.lat<+t.lat+.1&&+e.lon>+t.lon-.1&&+e.lon<+t.lon+.1}function n(t){var e,i;do{i=!0;for(var r=0;r<t.length-1;r++){var s=t[r],a=t[r+1];s.rank<.4&&a.rank<.4&&Math.abs(s.rank-a.rank)<.06&&s.distance>a.distance&&(s.note="reshaked-down",a.note="reshaked-up",e=s,t[r]=a,t[r+1]=e,i=!1)}}while(!i)}function o(t,e,i){for(var r,a,n=[],o=t,h=i&&e,l=0;l<o.length;l++)a=o[l],r={lat:+a.lat,lon:+a.lon,title:a.display_name,rank:a.importance||1,country:"",region:"",state:"",cc:"",type:"",bounds:a.boundingbox,polygon:[],bbox:a.boundingbox},h&&(r.distance=s(e,i,r.lon,r.lat)),n.push(r);return n}function h(t,e,i){var o,h,l,u,c,d,p,f=[],g=i&&e,m=t;m.length>1&&(m=r(m));for(var v=0;v<m.length;v++)h=m[v],p=h.boundingbox,l=h.address,d=h.display_name.replace(/,.*/,""),u=l.state&&l.state||l.state_district&&l.state_district||l.county&&l.county||"",c=l.county&&l.county||l.state_district&&l.state_district||u,c===d&&(c=l.state_district&&l.state_district||u),o&&a(o,h)||h.importance<.01&&v>5||(new RegExp(/ - /).test(u)&&(u=u.replace(/ -.*/,"")),"archipelago"===h.type||"administrative"===h.type&&(d===l.country||d===u)?"-180"===p[2]&&(p[2]=p[3]=h.lon):p=null,d===l.house_number&&l.road&&(d=l.road),o={lat:+h.lat,lon:+h.lon,title:d,rank:h.importance,country:"us"===l.country_code?u:l.country&&l.country.replace(/,.*/,""),display:h.display_name,region:c||"",state:u||"",cc:l.country_code,type:h.type,bounds:p,polygon:h.polygonpoints||[],bbox:h.boundingbox},g&&(o.distance=s(e,i,o.lon,o.lat)),f.push(o));return g&&n(f),f}var l=i(3);i.d(e,"a",function(){return h}),i.d(e,"b",function(){return o});var u=l.a},function(t,e,i){"use strict";var r=i(12),s=i(4),a=i(193),n=i(2),o=i(3),h=r.a,l=n.b,u=o.a,c=s.a,d=a.a,p=a.b,f=function(t,e){this.ui=t,this.browser=t.browser;var i=this.browser.config.controlSearchElement;i&&"string"==typeof i&&(i=document.getElementById(i)),this.control=this.ui.addControl("search",'<div class="vts-search"><div class="vts-search-input"><input type="text" id="vts-search-input" autocomplete="off" spellcheck="false" placeholder="Search location..."></div><div id="vts-search-list" class="vts-search-list"></div></div>',e,i),this.input=this.control.getElement("vts-search-input"),this.input.on("input",this.onChange.bind(this)),this.input.on("keydown",this.onKeyUp.bind(this)),this.input.on("focus",this.onFocus.bind(this)),this.input.on("mousedown",this.onDrag2.bind(this)),this.input.on("mousewheel",this.onDrag.bind(this)),this.input.on("dblclick",this.onDoNothing.bind(this)),this.list=this.control.getElement("vts-search-list"),this.list.on("mousedown",this.onDrag2.bind(this)),this.list.on("mousewheel",this.onDrag.bind(this)),this.mapControl=this.ui.getMapControl(),this.mapElement=this.mapControl.getMapElement(),this.mapElement.on("mousedown",this.onDrag.bind(this),window),this.mapElement.on("mousewheel",this.onDrag.bind(this),window),this.ignoreDrag=!1,this.urlTemplate="//eu-n1.windyty.com/search.php?q={value}&format=json&lang=en-US&addressdetails=1&limit=20",this.urlTemplate2=this.urlTemplate,this.data=[],this.lastSearch="",this.itemIndex=-1,this.searchCounter=0,this.coordsSrs="+proj=longlat +datum=WGS84 +nodefs",this.initialValueUsed=!1,this.browser.config.controlSearchValue&&(this.initialValueUsed=!0,this.input.getElement().value=this.browser.config.controlSearchValue,this.onChange())};f.prototype.onDoNothing=function(t){h.preventDefault(t),h.stopPropagation(t)},f.prototype.processTemplate=function(t,e){return t.replace(/\{([$a-zA-Z0-9][$a-zA-Z0-9]*)\}/g,function(t,i){return i in e?e[i]:t})},f.prototype.showList=function(){this.list.setStyle("display","block")},f.prototype.hideList=function(){this.list.setStyle("display","none")},f.prototype.moveSelector=function(t){this.itemIndex+=t,this.itemIndex>=this.data.length&&(this.itemIndex=this.data.length-1),this.itemIndex<0&&(this.itemIndex=0),this.updateList(this.data)},f.prototype.updateList=function(t){if(Array.isArray(t)){var e,i=t,r="";i=i.slice(0,10),this.data=i;for(var s=0,a=i.length;s<a;s++){e=i[s];var n=e.title+"<small>";e.region&&e.title!=e.region&&(n+=", "+e.region),e.country&&e.title!=e.country&&e.region!=e.country&&(n+=(e.region?", ":"")+e.country),n+="</small>",this.itemIndex==s?r+='<div id="vts-search-item'+s+'" class="vts-search-listitem-selected">'+n+"</div>":r+='<div id="vts-search-item'+s+'" class="vts-search-listitem">'+n+"</div>"}for(this.list.setHtml(r),s=0,a=i.length;s<a;s++){var o="vts-search-item"+s;e=this.control.getElement(o),e&&(e.on("click",this.onSelectItem.bind(this,s)),e.on("mouseenter",this.onHoverItem.bind(this,s)))}this.initialValueUsed||this.showList()}else this.hideList()},f.prototype.solveSRS=function(t){return-1==t.indexOf("+proj=")&&(t=map.getSrsInfo(t),t=t&&t.srsDef?t.srsDef:this.coordsSrs),t},f.prototype.onSelectItem=function(t){var e=this.browser.getMap();if(e){var i=e.getPosition(),r=e.getReferenceFrame(),s=r.navigationSrs,a=e.getSrsInfo(s),n=r.physicalSrs,o=e.getSrsInfo(n),h=this.browser.getProj4(),c=this.browser.config.controlSearchSrs||this.coordsSrs;c=this.solveSRS(c);var d=h(a.srsDef,c,i.getCoords());i=e.convertPositionHeightMode(i,"float",!0);var p=this.data[t];if(p){var d=[p.lon,p.lat];d=h(c,a.srsDef,d),d[2]=0,i.setCoords(d);var f=6667;if(p.bbox){var g=parseFloat(p.bbox[0]),m=parseFloat(p.bbox[1]),v=parseFloat(p.bbox[2]),y=parseFloat(p.bbox[3]);p.polygon=[[v,g],[.5*(y+v),g],[y,g],[v,.5*(m+g)],[y,.5*(m+g)],[v,m],[.5*(y+v),m],[y,m]]}if(p.polygon&&"continent"!=p.type){var b=p.polygon,x=h(c,o.srsDef,d),M=[-x[0],-x[1],-x[2]];l.normalize(M);for(var w=0,S=b.length;w<S;w++){d=h(c,o.srsDef,[b[w][0],b[w][1],0]);var A=M,C=[d[0]-x[0],d[1]-x[1],d[2]-x[2]],T=[x[0]+M[0],x[1]+M[1],x[2]+M[2]],P=[d[0]-T[0],d[1]-T[1],d[2]-T[2]],E=[0,0,0];l.cross(A,C,E);var L=l.length(P)/l.length(A)*2;L>f&&(f=L)}"projected"!=a.type&&f>1.4*a.a&&(f=1.4*a.a)}else switch(p.type){case"peak":f=2e4;break;case"city":f=3e4;break;case"street":f=4e3;break;case"residential":f=3e3;break;case"continent":f=855e4}i.setViewExtent(f);var k=[0,-60,0];if("obj"==i.getViewMode()&&a.a){var I=.5*i.getViewExtent()/Math.tan(u.radians(.5*i.getFov())),N=Math.min(I/(.5*a.a),1),F=20+-110*N;k[1]>F&&(k[1]=F),k[1]<-90&&(k[1]=-90)}i.setOrientation(k),e.setPosition(i),this.itemIndex=t,this.lastSearch=p.title;var B=this.input.getElement();B.value=this.lastSearch,B.blur()}this.hideList()}},f.prototype.onHoverItem=function(t){this.itemIndex!=t&&(this.itemIndex=t,this.updateList(this.data))},f.prototype.onListLoaded=function(t,e){var i=this.browser.getMap();if(i&&this.searchCounter==t){var r=i.getPosition(),s=i.getReferenceFrame(),a=s.navigationSrs,n=i.getSrsInfo(a),o=this.browser.getProj4(),h=this.browser.config.controlSearchSrs||this.coordsSrs;h=this.solveSRS(h);var l=o(n.srsDef,h,r.getCoords());e=this.browser.config.controlSearchFilter?d(e,l[0],l[1]):p(e,l[0],l[1]),this.updateList(e)}},f.prototype.onListLoadError=function(){},f.prototype.onFocus=function(){this.lastSearch="",this.input.getElement().value=this.lastSearch,this.hideList()},f.prototype.onKeyPress=function(t){this.onKeyUp(t)},f.prototype.onKeyUp=function(t){switch(t.getKeyCode()){case 38:this.moveSelector(-1),h.preventDefault(t),h.stopPropagation(t);break;case 40:this.moveSelector(1),h.preventDefault(t),h.stopPropagation(t);break;case 9:case 13:this.onSelectItem(Math.max(0,this.itemIndex),null)}},f.prototype.onChange=function(){var t=this.input.getElement().value;if((t=t.trim())!=this.lastSearch){this.lastSearch=t,""==t&&this.hideList();var e=this.processTemplate(this.browser.config.controlSearchUrl||this.urlTemplate,{value:t});this.searchCounter++,this.itemIndex=-1,c.loadJSON(e,this.onListLoaded.bind(this,this.searchCounter),this.onListLoadError.bind(this))}},f.prototype.onDrag2=function(){this.ignoreDrag=!0},f.prototype.onDrag=function(){if(this.ignoreDrag)return void(this.ignoreDrag=!1);var t=this.input.getElement();t.value=this.lastSearch,t.blur(),this.hideList()},f.prototype.update=function(){this.initialValueUsed&&this.browser.mapLoaded&&(this.initialValueUsed=!1,this.onSelectItem(0))},e.a=f},function(t,e,i){"use strict";var r=i(12),s=i(166),a=r.a,n=s.b,o=function(t,e){this.ui=t,this.browser=t.browser,this.control=this.ui.addControl("space",'<div id="vts-space" class="vts-space"><img id="vts-space-2d" class="vts-space-button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAABqElEQVRIx+2UsWoUURSGv3Nn1sIiaKMBSbD0AdRBdmbdB7DMA0gaSSVRbFRYiGAaUWJhEAQVEey10yacO/gAwqZNSKWwhShs4ew9NtewTDI6sRCE/at7h8P/nfnvuRdmmum/lkxvut1u5pwbAOfNrAMMzWy9LMt3v2qKorCaRwC+A9vApqq+bITkeX4Z+CAiab3IzJa9988bIPXaR977G9Pf3NT6joikZvYmSZL5JElOAPcBRORu3UxVRVVlNBodCyEsmtkAMBFZjQ3va79rETluZl+rqrrpvf8c41t3zt0GFpo6Hw6HP4A9YK0oinlgRUSuAVsHIKqaH8hSJIsR7LQ54KqqNtI0XTGzS01xURuCBeBZhD1pAzGz3Vh/+o+QXq93zjnnReSsmb1W1Y0jTm3yW0ie5xdDCB5YNLMX4/H4KmAtzc/EP/py6MHH8bwAvAfmgDXv/eAo7Xc6nSsxro+HQrIsO2Vmb0VkDrilqg9aert+v39yMpksAfciZLPpMj4UkdUmJ1WVNpcReKyq15viWvrLp8mAb8CnEMLTsixfzV7rmf6dfgKmzKAWE7bqxgAAAABJRU5ErkJggg=="><img id="vts-space-3d" class="vts-space-button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAB8klEQVRIx+1Uv4sTQRT+3mRygyDInYXFabaxsRNOIiG7mEPQxsJCLQVF8AeiaCNWigrWiniCVfA/0Eo4ONnZ4P4FURAL9yyCEMQfRMzs7LOZk2HZxNgIQr7qzbw373t838wAc8zxX4P8RbvdPimEuMLM+4loAcAmM3eTJLkHgAEgiiIu9SgAfAfwBsCa1rpbJqltBWEYXhBCdAE0HEENwBIRrQZBQFmWvQKAIAhuVwyqAOwGcLzRaOzIsuylXyB+VxKdc+FTY8yyMWZbURSn3N7l8nRaa9Ja03A4XCiKosHMtwAwEV0Lw/BQJYnW+oAxZu9oNLqUpulASrmdiPa49GCS3v1+3/R6vc0kSe4AeOIGPu/XSH+Rpul7J906ER0GAGYeADgzi8F5nj+QUl5k5tZEEk+6fV6sfO+mgZk/uDO7KuUqYcUYswTgGYBFAPf/8tbW/kiitR6kafqZma+7CVdmbL7s6j9VyhVF0QtmbuV5fnDLm/F4rJRSICKehaFerx9zcr2uJGHmn0S0U0r5uNlsnlVKWQCPXG5jSm/R6XQWrbUnANx1JGuTjL/JzEeJ6IhS6qNH/kUIcaPc2X/51lo/9TCO441KT5IkeWetXQWwDuAHgG/M/BxAK47jt9MuFYCvAHpFUZzWWl+d/9Zz/Dv8ApJPyD0fWCwOAAAAAElFTkSuQmCC"> </div>',e),this.button2D=this.control.getElement("vts-space-2d"),this.button2D.on("click",this.onSwitch.bind(this)),this.button2D.on("dblclick",this.onDoNothing.bind(this)),this.button3D=this.control.getElement("vts-space-3d"),this.button3D.on("click",this.onSwitch.bind(this)),this.button3D.on("dblclick",this.onDoNothing.bind(this)),this.space3D=!0,this.display3D=this.space3D,this.space3D?(this.button2D.setStyle("display","block"),this.button3D.setStyle("display","none")):(this.button2D.setStyle("display","none"),this.button3D.setStyle("display","block"))};o.prototype.onDoNothing=function(t){a.stopPropagation(t)},o.prototype.onSwitch=function(){this.space3D=!this.space3D;var t=this.browser.getMap();if(t){this.browser.autopilot&&(this.browser.autopilot.setAutorotate(0),this.browser.autopilot.setAutopan(0,0));var e=t.getPosition(),i=e.getOrientation();this.space3D?(i[0]=45,i[1]=-60,e.setOrientation(i)):(i[0]=0,i[1]=-90,e.setOrientation(i)),e=n(this.browser,e),t.setPosition(e),this.update()}},o.prototype.update=function(){var t=this.browser.getMap();if(t){var e=t.getPosition(),i=e.getOrientation(),r=Math.abs(i[1]+90)>.1;r!=this.display3D&&(r?(this.button2D.setStyle("display","block"),this.button3D.setStyle("display","none")):(this.button2D.setStyle("display","none"),this.button3D.setStyle("display","block")),this.space3D=r,this.display3D=r)}},e.a=o},function(t,e,i){"use strict";var r=i(12),s=r.a,a=function(t,e){this.ui=t,this.browser=t.browser,this.control=this.ui.addControl("zoom",'<div id="vts-zoom" class="vts-zoom"><div id="vts-zoom-plus" class="vts-zoom-plus"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAASUlEQVRIx+2Tyw0AIAhDq0d2KsMzFFddQBO9+En6rqR5kFBAiBVINpJtJ1NPLCbJe5IyG7j78IMyEwBgZsNcRJQrl6gnkgjxIx12Cg3wDaLBUAAAAABJRU5ErkJggg=="></div><div id="vts-zoom-minus" class="vts-zoom-minus"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAALUlEQVRIx2NgGAWjYBSMAqoCRlwSdnZ2/8kx8NChQxhmMo2G8ygYBaNgFGAHAElYBARpOBYqAAAAAElFTkSuQmCC"></div> </div>',e);var i=this.control.getElement("vts-zoom-plus");i.on("click",this.onZoomIn.bind(this)),i.on("dblclick",this.onDoNothing.bind(this));var r=this.control.getElement("vts-zoom-minus");r.on("click",this.onZoomOut.bind(this)),r.on("dblclick",this.onDoNothing.bind(this))};a.prototype.onDoNothing=function(t){s.preventDefault(t),s.stopPropagation(t)},a.prototype.onZoomIn=function(){this.repeat(7,.96,50)},a.prototype.onZoomOut=function(){this.repeat(7,1.04,50)},a.prototype.repeat=function(t,e,i){if(!(t<=0)){if(this.browser.getMap()){this.browser.autopilot&&(this.browser.autopilot.setAutorotate(0),this.browser.autopilot.setAutopan(0,0));var r=this.browser.controlMode.getCurrentController();r.viewExtentDeltas&&r.viewExtentDeltas.push(e),setTimeout(this.repeat.bind(this,--t,e,i),i)}}},e.a=a},function(t,e,i){"use strict";var r=i(167),s=i(12),a=r.a,n=s.a,o=function(t,e){this.control=t,this.ui=this.control.ui,this.element=e,this.events=[],this.dragBeginCall=this.onDragBegin.bind(this),this.dragMoveCall=this.onDragMove.bind(this),this.dragEndCall=this.onDragEnd.bind(this),this.firstDragDistance=0,this.lastDragDistance=0,this.dragStartPos=[0,0],this.dragCurrentPos=[0,0],this.dragLastPos=[0,0],this.dragAbsMoved=[0,0],this.zoomDrag=!1};o.prototype.setStyle=function(t,e){this.element.style[t]=e},o.prototype.getStyle=function(t){return this.element.style[t]},o.prototype.setClass=function(t){return n.setClass(this.element,t),this},o.prototype.getClass=function(){return n.getClass(this.element),this},o.prototype.hasClass=function(t){return n.hasClass(this.element,t)},o.prototype.addClass=function(t){return n.addClass(this.element,t),this},o.prototype.removeClass=function(t){return n.removeClass(this.element,t),this},o.prototype.getRect=function(){var t=this.element.getBoundingClientRect(),e=this.ui.map.getMapElement().element.getBoundingClientRect(),i=window.pageXOffset||0,r=window.pageYOffset||0;return{left:t.left+i-(e.left+i),top:t.top+r-(e.top+r),fromRight:e.right-(t.left+i-(e.left+i)),fromBottom:e.height-(t.top+r-(e.top+r)),width:t.width,height:t.height}},o.prototype.setHtml=function(t){this.element.innerHTML=t;for(var e=this.element.getElementsByTagName("*"),i=0,r=e.length;i<r;i++){var s=e[i].getAttribute("id");null!==s&&(this.control.elementsById[s]=new o(this,e[i]))}},o.prototype.getHtml=function(){return this.element.innerHTML},o.prototype.getElement=function(){return this.element},o.prototype.on=function(t,e,i){this.addEvent(t,e,i)},o.prototype.once=function(t,e,i){var r=function(){this.removeEvent(t,e,i)}.bind(this),s=function(t){e(t),r()};this.addEvent(t,s,i)},o.prototype.off=function(t,e,i){this.removeEvent(t,e,i)},o.prototype.fire=function(t,e){var i=this.events[t];if(null!=i)for(var r in i)i[r](e)},o.prototype.addEvent=function(t,e,i){var r=t+"-"+n.stamp(e)+(i?"-"+n.stamp(i):""),s=function(i){this.ui.killed||e(new a(t,this,i||window.event))}.bind(this),o=i||this.element;o.addEventListener(this.getEventName(t),s,!1),"mousewheel"==t&&o.addEventListener("DOMMouseScroll",s,!1),this.events[t]=this.events[t]||[],this.events[t][r]=s},o.prototype.removeEvent=function(t,e,i){var r=t+"-"+n.stamp(e)+(i?"-"+n.stamp(i):""),s=this.events[t]&&this.events[t][r];if(null!=s){delete this.events[t][r];(i||this.element).removeEventListener(this.getEventName(t),s,!1)}},o.prototype.getEventName=function(t){return t},o.prototype.setDraggableState=function(t){t?(this.on("mousedown",this.dragBeginCall),this.on("touchstart",this.dragBeginCall)):this.dragable&&(this.off("mousedown",this.dragBeginCall),this.off("mousemove",this.dragMoveCall,document),this.off("mouseup",this.dragEndCall,document),this.off("touchstart",this.dragBeginCall),this.off("touchmove",this.dragMoveCall,document),this.off("touchend",this.dragEndCall,document),this.dragging=!1),this.dragStartPos=[0,0],this.dragCurrentPos=[0,0],this.dragLastPos=[0,0],this.dragAbsMoved=[0,0],this.dragTouchCount=0,this.dragTouches=[],this.dragTouches2=[],this.resetPos=!1,this.dragable=t,this.dragButtons={left:!1,right:!1,middle:!1}},o.prototype.getDraggableState=function(){return this.dragable},o.prototype.getDraggingState=function(){return{dragging:this.dragging,buttonLeft:this.dragButtons.left,buttonRight:this.dragButtons.right,buttonMiddle:this.dragButtons.middle,startPos:this.dragStartPos.slice(),lastPos:this.dragLastPos.slice(),currentPos:this.dragCurrentPos.slice(),absMoved:this.dragAbsMoved.slice()}},o.prototype.onDragBegin=function(t){if(this.dragButtons[t.getMouseButton()]=!0,this.dragTouches=[],this.dragTouches2=[],this.dragTouches.push(t.getTouchCoords(0)),this.dragTouches2.push(t.getTouchCoords(1)),this.resetPos=!0,this.firstDragDistance=0,this.lastDragDistance=0,this.zoomDrag=!1,this.dragging)this.dragLastPos=t.getMouseCoords();else{this.dragging=!0;var e=t.getMouseCoords(!0);this.dragStartPos=[e[0],e[1]],this.dragCurrentPos=[e[0],e[1]],this.dragLastPos=[e[0],e[1]],this.dragAbsMoved=[0,0],this.on("mousemove",this.dragMoveCall,document),this.on("mouseup",this.dragEndCall,document),this.on("touchmove",this.dragMoveCall,document),this.on("touchend",this.dragEndCall,document),n.disableTextSelection(),n.disableImageDrag(),n.preventDefault(t),this.fire("dragstart",{clientX:e[0],clientY:e[1]})}},o.prototype.onDragMove=function(t){var e=t.getMouseCoords();-1!=t.getTouchesCount()&&this.updateDragButtonsState(t,!0),n.preventDefault(t);var i="",r=0,s=[0,0],a=0,o=t.getTouchesCount();if(o!=this.dragTouchCount&&(this.dragLastPos[0]=e[0],this.dragLastPos[1]=e[1],this.dragTouchCount=o),this.resetPos&&(this.dragCurrentPos=[e[0],e[1]],this.dragLastPos[0]=e[0],this.dragLastPos[1]=e[1],this.resetPos=!1),2==o&&(this.dragTouches.push(t.getTouchCoords(0)),this.dragTouches2.push(t.getTouchCoords(1)),this.dragTouches.length>=7&&(this.dragTouches.shift(),this.dragTouches2.shift()),6==this.dragTouches.length)){var h,l,u=this.dragTouches,c=u[5][0]-u[4][0]+(u[4][0]-u[3][0])+(u[3][0]-u[2][0])+(u[2][0]-u[1][0])+(u[1][0]-u[0][0]),d=u[5][1]-u[4][1]+(u[4][1]-u[3][1])+(u[3][1]-u[2][1])+(u[2][1]-u[1][1])+(u[1][1]-u[0][1]),p=this.dragTouches2,f=p[5][0]-p[4][0]+(p[4][0]-p[3][0])+(p[3][0]-p[2][0])+(p[2][0]-p[1][0])+(p[1][0]-p[0][0]),g=p[5][1]-p[4][1]+(p[4][1]-p[3][1])+(p[3][1]-p[2][1])+(p[2][1]-p[1][1])+(p[1][1]-p[0][1]),m=Math.sqrt(c*c+d*d),v=Math.sqrt(f*f+g*g);if(i="pan",m>5*v||v>5*m){var y,b,x;m>5*v?(y=p[0],b=u[0],x=u[5]):(y=u[0],b=p[0],x=p[5]);var M=[b[0]-y[0],b[1]-y[1]],w=[x[0]-y[0],x[1]-y[1]],S=Math.sqrt(M[0]*M[0]+M[1]*M[1]);M[0]/=S,M[1]/=S,S=Math.sqrt(w[0]*w[0]+w[1]*w[1]),w[0]/=S,w[1]/=S,h=M[0]*w[0]+M[1]*w[1],l=-M[1]*w[0]+M[0]*w[1],r=Math.acos(l)*(180/Math.PI)-90,h>.9999?i="zoom":s=[.5*(c+f),.5*(d+g)]}else if(m>1&&v>1){var A=c/m,C=d/m,T=f/v,P=g/v;h=A*T+C*P,h<.2?i="zoom":s=[.5*(c+f),.5*(d+g)]}u=this.dragTouches,p=this.dragTouches2;var E=p[0][0]-u[0][0],L=p[0][1]-u[0][1];m=Math.sqrt(E*E+L*L),E=p[5][0]-u[5][0],L=p[5][1]-u[5][1],v=Math.sqrt(E*E+L*L),a=v-m}this.fire("drag",{clientX:e[0],clientY:e[1],deltaX:e[0]-this.dragLastPos[0],deltaY:e[1]-this.dragLastPos[1],left:this.dragButtons.left,right:this.dragButtons.right,middle:this.dragButtons.middle,zoom:0,touchMode:i,touchPanDelta:s,touchRotateDelta:r,touchDistanceDelta:a,touches:o}),this.dragLastPos=this.dragCurrentPos,this.dragCurrentPos=[e[0],e[1]],this.dragAbsMoved[0]+=Math.abs(e[0]-this.dragLastPos[0]),this.dragAbsMoved[1]+=Math.abs(e[1]-this.dragLastPos[1])},o.prototype.onDragEnd=function(t){var e=this.dragButtons.left,i=this.dragButtons.right,r=this.dragButtons.middle;if(this.updateDragButtonsState(t,!1),this.dragTouches=[],this.dragTouches2=[],this.dragTouches.push(t.getTouchCoords(0)),this.dragTouches2.push(t.getTouchCoords(1)),this.resetPos=!0,this.firstDragDistance=0,this.lastDragDistance=0,this.zoomDrag=!1,this.dragging){var s=t.getMouseCoords();this.dragLastPos=s,this.dragButtons.left||this.dragButtons.right||this.dragButtons.middle||(this.dragging=!1,s=this.dragCurrentPos,this.off("mousemove",this.dragMoveCall,document),this.off("mouseup",this.dragEndCall,document),this.off("touchmove",this.dragMoveCall,document),this.off("touchend",this.dragEndCall,document),n.enableTextSelection(),n.enableImageDrag(),n.preventDefault(t),this.fire("dragend",{clientX:s[0],clientY:s[1],left:e,right:i,middle:r}))}},o.prototype.updateDragButtonsState=function(t,e){switch(t.getTouchesCount()){case-1:this.dragButtons[t.getMouseButton()]=e;break;case 0:this.dragButtons={left:!1,right:!1,middle:!1};break;case 1:this.dragButtons={left:!0,right:!1,middle:!1};break;case 2:this.dragButtons={left:!1,right:!0,middle:!1};break;case 3:this.dragButtons={left:!1,right:!1,middle:!0}}},o.prototype.setDraggableState=function(t){t?(this.on("mousedown",this.dragBeginCall),this.on("touchstart",this.dragBeginCall)):this.dragable&&(this.off("mousedown",this.dragBeginCall),this.off("mousemove",this.dragMoveCall,document),this.off("mouseup",this.dragEndCall,document),this.off("touchstart",this.dragBeginCall),this.off("touchmove",this.dragMoveCall,document),this.off("touchend",this.dragEndCall,document),this.dragging=!1),this.dragable=t,this.dragButtons={left:!1,right:!1,middle:!1}},e.a=o},function(t,e,i){"use strict";var r=i(12),s=i(4),a=i(186),n=i(190),o=i(181),h=i(182),l=i(184),u=i(196),c=i(195),d=i(194),p=i(188),f=i(185),g=i(191),m=i(187),v=i(183),y=i(192),b=i(189),x=r.a,M=s.a,w=a.a,S=n.a,A=o.a,C=h.a,T=l.a,P=u.a,E=c.a,L=d.a,k=p.a,I=f.a,N=g.a,F=m.a,B=v.a,R=y.a,_=b.a,D=function(t,e){this.browser=t,this.config=t.config,this.rootElement=e,this.element=null,this.controls=[],this.killed=!1,this.init(),this.instanceId=M.instanceCounter++,Object.defineProperty(this,"dom",{get:function(){if(!this.killed)return x}})};D.prototype.init=function(){this.element=document.createElement("div"),this.element.className="vts-browser",this.rootElement.appendChild(this.element),this.map=new S(this);var t=this.config.controlLoading;this.compass=new A(this,!t&&this.config.controlCompass),this.credits=new C(this,!t&&this.config.controlCredits),this.fullscreen=new T(this,!t&&this.config.controlFullscreen),this.zoom=new P(this,!t&&this.config.controlZoom),this.space=new E(this,!t&&this.config.controlSpace),this.search=new L(this,!t&&this.config.controlSearch),this.link=new k(this,!t&&this.config.controlLink),this.github=new I(this,!t&&this.config.controlGithub),this.measure=new N(this,!t&&this.config.controlMeasure),this.layers=new F(this,!t&&this.config.controlLayers),this.fallback=new B(this),this.popup=new R(this,!1),this.loading=new _(this,this.config.controlLoading),x.disableContexMenu(this.element)},D.prototype.kill=function(){this.killed=!0;for(var t in this.controls)delete this.controls[t];this.rootElement.removeChild(this.element),delete this.element,this.element=null},D.prototype.addControl=function(t,e,i,r){var s=new w(this,e,i,r);return this.controls[t]=s,s},D.prototype.removeControl=function(t){null!=this.controls[t]&&delete this.controls[t]},D.prototype.setControlHtml=function(t,e){null!=this.controls[t]&&this.controls[t].setHTML(e)},D.prototype.setControlVisible=function(t,e){null!=this.controls[t]&&this.controls[t].setVisible(e)},D.prototype.getControlVisible=function(t){null!=this.controls[t]&&this.controls[t].getVisible()},D.prototype.getControl=function(t){return this.controls[t]},D.prototype.getMapControl=function(){return this.map},D.prototype.getMapElement=function(){return this.map.getMapElement()},D.prototype.setParam=function(t){switch(t){case"controlCompass":this.setControlVisible("comapss",this.config.controlCompass);break;case"controlZoom":this.setControlVisible("zoom",this.config.controlZoom);break;case"controlScale":this.setControlVisible("scale",this.config.controlScale);break;case"controlLayers":this.setControlVisible("layers",this.config.controlLayers);break;case"controlSpace":this.setControlVisible("space",this.config.controlSpace);break;case"controlSearch":this.setControlVisible("search",this.config.controlSearch);break;case"controlLink":this.setControlVisible("link",this.config.controlLink);break;case"controlMeasure":this.setControlVisible("link",this.config.controlMeasure);break;case"controlLogo":this.setControlVisible("logo",this.config.controlLogo);break;case"controlFullscreen":this.setControlVisible("fullscreeen",this.config.controlFullscreen);break;case"controlCredits":this.setControlVisible("credits",this.config.controlCredits)}},D.prototype.tick=function(t){t&&(this.compass.update(),this.space.update(),this.credits.update(),this.link.updateLink(),this.search.update()),this.loading.control.getVisible()&&this.loading.update()},e.a=D}]);
</script>
<script type="text/javascript" src="//cdn.melown.com/libs/vtsjs/builtin/v2/support/start-browser.js"></script>
<script type="text/javascript">
var browser;
function startDemo() {
var params = vtsParseUrlParams();
params['positionInUrl'] = true;
params['jumpAllowed'] = true;
params['inspector'] = true;
params['map'] = 'http://rigel.mlwn.se/mapproxy/melown2015/geodata/topoearth/peaklist-org-ultras/mapConfig.json';
browser = vts.browser('melown-demo', params);
browser.on('map-mapconfig-loaded', (function(data){
data.freeLayers['topoearth-peaklist-org-ultras'] = {
"credits" :
{
"peaklist-org" :
{
"id" : 205,
"notice" : "{copy} 2004-07 [http://www.peaklist.org/ultras.html peaklist.org]"
}
},
"displaySize" : 2048,
"extents" :
{
"ll" : [ -6146974.6674445113, -6376534.537805411, -6346253.6963036619 ],
"ur" : [ 6336642.911661312, 6323494.7158901598, 6314203.0862434926 ]
},
"geodata" : "http://rigel.mlwn.se/mapproxy/melown2015/geodata/topoearth/peaklist-org-ultras/geo?viewspec={viewspec}",
"label" : "Ultra-prominent peaks on earth, compiled by peaklist.org",
"type" : "geodata"
};
data.freeLayers['topoearth-peaklist-org-ultras']['style'] =
{
"constants": {
"@name-solver": {"if":[["has","$name"],"$name","$Name"]},
"@id-solver": {"if":[["has","$name"],"name","Name"]},
"@ele-solver": {"if":[["has","$elevation"],"$elevation","$Elevation"]},
"@prom-solver": {"mul":[-1,{"str2num":"$Prom"}]}
},
"layers": {
"peak-labels": {
"label": true,
"label-size": 15,
"label-source": "{@name-solver}\n{@ele-solver}m, {$Prom}",
"label-stick": [70,5,2,255,255,255,128],
"label-no-overlap": true,
"label-no-overlap-factor": ["div-by-dist","@prom-solver"],
"zbuffer-offset": [-1,0,0],
"culling": 90,
"hysteresis": [2000,5000,"@id-solver"]
}
}
};
}));
}
</script>
</head>
<body style = "padding: 0; margin: 0;" onload="startDemo()">
<div id="melown-demo" style="width:100%; height:100%;"></div>
</body>
</html>