You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
113 KiB

/**/_jsload2 && _jsload2('panorama', 'Nf.prototype.hD=ja(2,function(){this.Nb.style[qf]="";this.Hi=this.si=q;this.hw("h");this.hw("v");this.ae(Cf,window);this.ae(Df);this.ae(Ef,window);this.ae(Ff,window);this.ae(Gf,window);this.options.Ik||(this.ae("DOMMouseScroll"),this.ae("mousewheel"));this.options.Gi&&this.ae(Hf);this.options.fx&&clearInterval(this.kW);this.options.MN&&this.options.MN.call(this)});var Ij=1; function Jj(a,b){var c=a.width,d=a.height,e=180/Math.pow(2,b),f=1;J()&&(f=2);c=e/(1<c/d?d:c);f=Math.floor(b)+f;for(d=360/(2*Math.pow(2,f-2)*c);512<d;)f++,d=360/(2*Math.pow(2,f-2)*c);f>Bj&&(d*=Math.pow(2,f-Bj),f=Bj);f<Ij&&(f=Ij);d=Math.round(d);return{GM:f,jL:d}}var Kj=5063,Lj=5062,Mj=5061,Nj=5060,Bj=5,Ij=1; x.extend(Qa.prototype,{Ab:function(){this.DR();for(var a=0;a<B.Tr.length;a++)B.Tr[a](this);this.Ya!=p?"inter"===this.Le?this.ZF(this.Ya):this.dispatchEvent(new N("onid_changed")):this.Kb!=p&&(this.dispatchEvent(new N("onposition_changed")),this.dispatchEvent(new N("onposition_changed_inner")));this.k.visible?this.show():this.U();this.Nf!=p&&this.dispatchEvent(new N("onvisible_poi_type_changed"),{visiblePOIType:this.Nf});var a=p,b;for(b in this.Ke)a=this.Ke[b],delete this.Ke[b],this.Ka(a);this.U()}, ru:function(a){this.Nf=a||"none";this.dispatchEvent(new N("onvisible_poi_type_changed"),{visiblePOIType:this.Nf})},Ka:function(a){this.Ke[a.kd]=a;this.dispatchEvent(new N("onadd_overlay"),{overlay:a})},Ub:function(a){delete this.Ke[a.kd];this.dispatchEvent(new N("onremove_overlay"),{overlay:a})},O1:function(a,b){var c=H("div"),d=c.style;c.className="pano_m_indoor_exit";c.title=a;c.onclick=b;d.display="none";d.zIndex=1201;c.innerHTML=\'<span style="float:right;margin-right:12px;">\\u51fa\\u53e3</span>\'; return c},N1:function(a,b){var c=H("div"),d=c.style;d.position="absolute";d.zIndex=1201;d.right=d.top="10px";d.width="17px";d.height="16px";d.background=\'url("\'+I.pa+\'st-close.png") no-repeat 50% 50%\';J()&&(d.right=d.top="0px",d.width="42.5px",d.height="40px",d.backgroundSize="25.5px 24px");d.cursor="pointer";c.title=a;c.onclick=b;d.display="none";return c},rc:function(a,b,c){"object"===typeof b&&(c=b,b=k);a!=this.Ya&&(this.Dl=this.Ya,this.El=this._position,this.Ya=a,this.XA=p,this.Le=b||"street", c=c||{rk:q},this.aK=c.rk,"inter"===b?this.ZF(a):this.dispatchEvent(new N("onid_changed")),this.R_(c))},R_:function(a){this.Wv={id:this.Yb(),pov:a.pov}},fY:function(a,b){var c,d;if(this.Wv&&a===this.Wv.id){c={};for(var e=0;e<b.length;e++)d=b[e],c[d]=this.Wv[d];this.Wv=p}return c},ta:function(a,b){a.ab(this.Kb)||(this.Dl=this.Ya,this.El=this._position,this.Kb=a,this.Ya=p,b=b||{rk:q},this.aK=b.rk,this.dispatchEvent(new N("onposition_changed_inner")))},Nc:function(a){var b={heading:this.Ea.heading,pitch:this.Ea.pitch}; this.Ea=a;a=a=this.Ea.pitch;a>this.dk?a=this.dk:a<this.fk&&(a=this.fk);this.Ea.pitch=a;if(b.heading!=this.Ea.heading||b.pitch!=this.Ea.pitch)this.$r=o,this.dispatchEvent(new N("onpov_changed"))},dz:function(a){var b=this.Ea,c=a.heading-b.heading,d=a.pitch-b.pitch,e=this;new wb({Hc:30,duration:200,hc:xb.wL,va:function(a){e.Nc({heading:b.heading+a*c,pitch:b.pitch+a*d})},finish:function(){e.Nc(a)}})},Oc:function(a,b){if(a!=this.Kc){a>Qe&&(a=Qe);a<Re&&(a=Re);if(a!=this.Kc){this.Kc=a;var c=new N("onzoom_changed_inner"), b=b||{};c.Up=b.Up||q;this.dispatchEvent(c);(!Pa()||c.Up)&&this.dispatchEvent(new N("onzoom_changed"))}"cssRender"===this.Ar()&&this.Nc(this.Ea)}},$B:function(){if(this.D){for(var a=this.D.Yx(),b=0;b<a.length;b++)(a[b]instanceof W||a[b]instanceof ud)&&a[b].point&&this.wa.push(a[b]);this.dispatchEvent(new N("onoverlay_changed"))}},Jk:function(){this.Nl.style.visibility="hidden"},kz:function(){this.dispatchEvent(new N("onoverlay_show"));this.Nl.style.visibility="visible"},show:function(){this.k.visible= o;this.Ed&&x.K.show(this.Ed);this.Ed&&(this.k.closeControl&&this.Af&&this.D&&this.D.Ga()===this.C)&&x.K.show(this.Af);this.AB&&this.AB.show();this.$B();this.dispatchEvent(new N("onvisible_changed"))},U:function(){this.k.visible=q;this.Ed&&x.K.U(this.Ed);this.k.closeControl&&this.Af&&x.K.U(this.Af);this.AB&&this.AB.U();this.dispatchEvent(new N("onvisible_changed"))},cz:function(a){this.D=a;this.$B()},DR:function(){var a=H("div"),b=a.style;b.overflow="hidden";b.position="absolute";b.zIndex=1200;b.top= b.left="0px";b.height=b.width="100%";b.backgroundColor="#e5e3df";this.Ed=a;this.ci=this.Uj("1");this.ck=this.Uj("4");this.Nl=this.Uj("5");a.appendChild(this.ci);a.appendChild(this.ck);a.appendChild(this.Nl);Pa()||(this.Nr=this.Uj("3"),this.Nr.style.width=this.C.clientWidth+"px",this.Nr.style.height=this.C.clientHeight+"px",this.Nr.style.overflow="hidden",this.Nr.style.WebkitUserSelect="none",a.appendChild(this.Nr),$e()&&(this.ww=this.MH(),this.ci.appendChild(this.ww),this.xw=this.MH(),this.ci.appendChild(this.xw))); this.C.appendChild(a);"absolute"!=Ya(this.C).position&&(this.C.style.position="relative")},Uj:function(a){var b=H("div"),c=b.style;c.position="absolute";c.top=c.left="0";c.zIndex=a||"0";c.WebkitUserSelect="none";return b},MH:function(){var a=H("img");thumbStyle=a.style;thumbStyle.position="absolute";thumbStyle.top=thumbStyle.left="0";thumbStyle.zIndex="1";thumbStyle.opacity="0";thumbStyle.hc=thumbStyle.WebkitTransition="opacity 300ms ease-out";a.onload=function(){this.style.visibility="";this.style.opacity= "1"};return a},Ga:v("C"),jh:function(){return new M(this.C.clientWidth,this.C.clientHeight)},V3:v("kk"),DY:v("zw"),LO:da("zw"),ZF:function(a){a!=this.XA&&(this.XA=a,this.Ya=p,this.dispatchEvent(new N("oniid_changed")),this.dispatchEvent(new N("onid_changed")),Ta(5045,{type:this.k.panoramaRenderer}))},clear:function(){this.Kb=this.Ya=this.ea=p;this.uo=[];this.dispatchEvent(new N("onclear"))},mp:function(){var a=this.ea.pm;this.nS=this.ea.bW;this.clear();this.UH=o;this.rc(a)}});var Oj=Qa.prototype; U(Oj,{setId:Oj.rc,setPosition:Oj.ta,setPov:Oj.Nc,setZoom:Oj.Oc,show:Oj.show,hide:Oj.U,setPanoramaPOIType:Oj.ru,addOverlay:Oj.Ka,removeOverlay:Oj.Ub,exitInter:Oj.mp});function Pj(a){a.lg=this;var b=x.platform.Ym?"android":"ios";Pa()?(this.Bd=new Qj(a),this.md=new Rj(a,this.Bd.Xa),this.Bd.BV(this.md),"android"===b?Ta(Nj):Ta(Mj)):(this.Bd=new Sj(a),this.md=new Tj(a),"android"===b?Ta(Lj):Ta(Kj));a.k.linksControl?this.md.show():this.md.U();a.k.clickOnRoad?this.md.JD():this.md.mD();this.P=a;this.ca();this.dU=new Uj(a,this)}B.kn(function(a){a.lg=new Pj(a)});x.lang.ua(Pj,x.lang.Da,"PanoramaRenderer"); x.extend(Pj.prototype,{ca:function(){var a=this.P,b=this;a.addEventListener("links_visible_changed",function(){a.k.linksControl===o?b.md.show():b.md.U()});a.addEventListener("clickonroad_changed",function(){a.k.clickOnRoad===o?b.md.JD():b.md.mD()});a.addEventListener("dataload",function(c){b.ea=c.data;b.nv();b.FJ(c.data);b.va(a.Fa(),b.ef,b.$g)});a.addEventListener("pov_changed",function(){b.ea&&b.va(a.Fa(),b.ef,b.$g)});a.addEventListener("clear",function(){b.ea=p;b.FJ(p);b.Bd.va();b.md&&b.md.va()}); a.addEventListener("zoom_changed_inner",function(c){b.ea&&(b.nv(),b.UU(a.Fa(),b.ef,b.$g,c.Up))});a.addEventListener("size_changed",function(a){b.TB(a)});a.addEventListener("dblclick",function(){var b=a.ga();4===b?a.Oc(1):a.Oc(b+1);a.dispatchEvent(new N("ondblclickzoomend"))});a.ql=a.jh();setInterval(function(){if(a.Yb()){var c=a.jh();if(!c.ab(a.ql)){a.ql=c;var d=new N("onsize_changed");d.Z4=a.ql;d.size=c;a.dispatchEvent(d);c=b.ef;b.nv();c!=b.ef&&b.Bd.Np&&b.Bd.Np();b.va(a.Fa(),b.ef,b.$g)}}},80);Pa()&& a.addEventListener("refresh",function(){b.Bd.os()})},TB:function(){var a=this.ef;this.nv();a!=this.ef&&this.Bd.Np&&this.Bd.Np();this.Bd.Sk&&this.Bd.Sk();this.md.Sk&&this.md.Sk();a=this.P;this.va(a.Fa(),this.ef,this.$g);"cssRender"===a.Ar()&&a.Nc(a.Fa())},FJ:function(a){a&&("number"===typeof a.heading&&this.P.$r===q)&&(this.P.Ea.heading=a.heading,this.P.Ea.pitch=a.pitch);var b=this.P.fY(a&&a.id,["pov"]);b&&b.pov&&(this.P.Ea.heading=b.pov.heading,this.P.Ea.pitch=b.pov.pitch);if(this.P.UH&&a.indoorPois){for(var b= p,c=this.P.nS,d=0,e=a.indoorPois.length;d<e;d++)c==a.indoorPois[d].panoIId&&(b=a.indoorPois[d]);b&&(this.P.Ea.heading=Ve(b.pointX-a.wh,b.pointY-a.xh),this.P.Ea.pitch=0);this.P.UH=q;this.P.U1=p}this.P.$r&&(this.P.$r=q);this.P.Bt();a&&a.pm?this.P.fz("inter"):this.P.fz("street");this.Bd.setData(a,this.xE(),this.ef);this.md.setData(a)},UU:function(a,b,c,d){var e=this;this.Bd.Oc(e.xE(),e.ef,{Up:d,h_:function(a){e.dU.bs(a)}});"cvsRender"!=this.P.kk&&this.Bd.va(a,b,c);this.md.va(a,b,c)},va:function(a,b, c){this.Bd.va(a,b,c);this.md.va(a,b,c)},L3:v("ef"),xE:function(){return this.P.ga()},C3:v("$g"),nv:function(){var a=Jj(this.P.jh(),this.P.ga());this.$g=a.jL;this.ef=a.GM}});function Vj(a){this.P=a}B.kn(function(a){var b=new Vj(a);a.addEventListener("dataload",function(a){b.ea=a.data;b.Vi()});a.addEventListener("zoom_changed_inner",function(){b.nb&&(b.nb.stop(),b.nb=p)})}); Vj.prototype.Vi=function(){function a(a,b){z.lg.Bd.Ug||(g=o,P.nb&&P.nb.stop(),i=a,j=b,C=z.Fa().heading,F=z.Fa().pitch,z.dispatchEvent(new N("ontouchstart")))}function b(a,b){g&&!z.Zl&&(y=o,P.jB||(P.jB=o,P.S1=db()),e(a,b),n=l-a,s=m-b,l=a,m=b,P.LI=db())}function c(a){g&&(g=q,!y&&(!D&&S)&&P.IH&&(P.IH=q,P.no?(P.Si&&(clearTimeout(P.Si),P.Si=p),10>i-P.no.x&&10>j-P.no.y&&z.dispatchEvent(new N("ondblclick")),P.no=p):(P.no={x:i,y:j},P.Si=setTimeout(function(){var a,b,c=z.oB;a=z.Ed;var d=0;for(b=0;a.offsetParent;)d+= a.offsetLeft,b+=a.offsetTop,a=a.offsetParent;a=i-d;b=j-b;Pa()&&(a*=2,b*=2);0===c.tM(a,b)&&z.dispatchEvent(new N("onclick"));P.no=p},400))),P.jB=q,d(a),D=y=q)}function d(a){if(a){var b=db()-P.LI;if(!(100<b||10<b&&10>Math.abs(n)&&10>Math.abs(s))){var c;J()?(b=a.changedTouches[0].clientX,c=a.changedTouches[0].clientY):(b=a.clientX,c=a.clientY);a=new R(i,j);c=new R(b,c);var b=[0<c.x-a.x?1:-1,0<c.y-a.y?1:-1],d=Math.abs(a.x-c.x),f=0,g=0;0==Math.abs(a.y-c.y)?f=d:(a=Math.abs(a.x-c.x)/Math.abs(a.y-c.y),g= Math.round(Math.sqrt(24336/(1+a*a))),f=Math.round(a*g));-1==b[0]&&(f=-f);-1==b[1]&&(g=-g);P.nb&&P.nb.stop();C=z.Fa().heading;F=z.Fa().pitch;P.nb=new wb({duration:625,Hc:60,hc:function(a){return a*0.3125-0.15625*a*a},va:function(a){a=a*6.4;e(a*f,a*g)},finish:function(){P.nb=p},au:function(){P.nb=p}})}}}function e(a,b){u=-a*P.iv;w=b*P.iv;var c=C+u,d=F+w;d>z.dk&&(d=z.dk);d<z.fk&&(d=z.fk);z.Nc({heading:c,pitch:d})}function f(a){if(z.k.enableScrollWheelZoom){var a=window.event||a,b=new N("onmousewheel"); b.wq=0<=a.wheelDelta||0>a.detail;var c=new Date;if(!(220>c-aa)&&(aa=c,"path"!=(a.srcElement||a.target).tagName)){var c=na(b,a),d=a.srcElement||a.target,e=a.offsetX||a.layerX||0,f=a.offsetY||a.layerY||0;1!=d.nodeType&&(d=d.parentNode);for(;d&&d!=z.Ga();){d.ba&&(x.lang.Lc(d.ba)instanceof kb&&(overlay=x.lang.Lc(d.ba)),x.lang.Lc(d.ba)instanceof td&&(infoWindow=x.lang.Lc(d.ba)));if(!(0==d.clientWidth&&0==d.clientHeight&&d.offsetParent&&"TD"==d.offsetParent.nodeName)&&"http://www.w3.org/2000/svg"!=d.namespaceURI)e+= d.offsetLeft||0,f+=d.offsetTop||0;else if("http://www.w3.org/2000/svg"==d.namespaceURI){var g=z.lg.md&&z.lg.md.hf||p;if(-1<navigator.userAgent.indexOf("Opera")&&"svg"!=d.tagName){if(d=x.lang.Lc(d.ba))d=d.Kd(),e+=P.Cc(d.xe()).x,f+=P.Cc(d.pf()).y;break}if(g&&(!x.da.ma||9<=x.da.ma&&"svg"==d.nodeName.toLowerCase()))e+=parseInt(g.style.left),f+=parseInt(g.style.top)}d=d.offsetParent}c.x=e;c.y=f;z.ga();z.Fa();z.Fa();var i;if(b.wq==o){if(z.ga()==Qe){Gb(a);return}i=z.ga()+2/3}else if(b.wq==q){if(z.ga()== Re){Gb(a);return}i=z.ga()-2/3}z.Oc(i)}Gb(a)}}if(!this.wT){this.wT=o;var g=q,i,j,l=0,m=0,n,s,u=0,w=0,y=q,D=q,C,F,A,z=this.P,E=q,G=0;this.iv=Wj(this);this.LI=0;this.jB=q;this.no=p;this.ng=1;var P=this,S=q;J()?(x.M(z.Ed,"touchstart",function(b){S=o;for(var c=b.target;c&&c!=z.Ed;){if(c===z.Nl){S=q;break}c=c.offsetParent}P.IH=o;var c=b.touches[0].clientX,d=b.touches[0].clientY,e=z.oB;if(Pa())e&&e.kI(b.touches[0].pageX*e.kg,b.touches[0].pageY*e.kg)!=p&&(S=q);else if(!Pb()&&e){var f=Fb(z.Ed);-1!=e.cM(c- f.left,d-f.top)&&(S=q)}a(c,d);(!x.platform.Ym||-1==navigator.userAgent.indexOf("QQBrowser"))&&b.preventDefault();b.stopPropagation()}),x.M(z.Ed,"touchmove",function(a){if(!E){b(a.touches[0].clientX-i,a.touches[0].clientY-j);var c=new N("ontouchmove");c.G5=new R(a.touches[0].pageX,a.touches[0].pageY);z.dispatchEvent(c)}a.preventDefault();a.stopPropagation()}),x.M(document,"touchend",function(a){c(a);S=q}),z.Ed.addEventListener("gesturestart",function(){G=z.ga()},q),z.Ed.addEventListener("gesturechange", function(a){P.ng=a.scale;D=E=o;a=P.ng*G;4<a?a=4:1>a&&(a=1);a=Math.round(100*a)/100;z.Oc(a,{Up:o})},q),z.Ed.addEventListener("gestureend",function(){E=q;z.ga()!=G&&z.dispatchEvent(new N("onpinchtozoomend"))},q)):(x.M(z.Ed,"mousedown",function(b){a(b.clientX||b.pageX||0,b.clientY||b.pageY||0);A=b.target||b.srcElement;x.da.ma&&A.setCapture&&A.setCapture();P.rU=z.Ed.style.cursor;z.Ed.style.cursor=I.Id;x.da.ma||Gb(b)}),x.M(document,"mousemove",function(a){b((a.clientX||a.pageX||0)-i,(a.clientY||a.pageY|| 0)-j);pa(a)}),x.M(document,"mouseup",function(a){oa(a);c(a);x.da.ma&&(A&&A.releaseCapture)&&A.releaseCapture();z.Ed.style.cursor=P.rU||I.Xb}));z.addEventListener("zoom_changed_inner",function(){P.iv=Wj(P)});z.addEventListener("size_changed",function(){P.iv=Wj(P)});var aa=new Date;x.M(z.Ga(),"mousewheel",f);window.addEventListener&&z.Ga().addEventListener("DOMMouseScroll",f,q)}}; function Wj(a){if(!a.ea)return p;var b=a.P,c=Jj(b.jh(),b.ga()),d=c.GM,c=c.jL;if("cssRender"===b.Ar()&&!Pa())return 360/(a.ea.tiles.Bp(d)*c);b=a.P.ga();return 180/Math.pow(2,b)/a.P.jh().height};function Uj(a,b){x.lang.Da.call(this);this.P=a;this.Ba=b;this.Vh=[];this.Xh={};this.GB=q;this.cA()}x.lang.ua(Uj,x.lang.Da,"PanoramaOverlayMgr"); x.extend(Uj.prototype,{cA:function(){var a=this,b=this.P;b.addEventListener("add_overlay",function(c){c=c.overlay;c.ra(b);a.Vh.push(c);a.ds()});b.addEventListener("dataload",function(){a.GB=o;a.ds()});b.addEventListener("remove_overlay",function(b){for(var b=b.overlay,d=0,e=a.Vh.length;d<e;d++)b==a.Vh[d]&&a.Vh.splice(d,1);b.remove();a.ds()});b.addEventListener("clear",function(){a.GB=q});b.addEventListener("zoom_changed",function(){a.bs()});b.addEventListener("dataload",function(){a.ds()});b.addEventListener("pov_changed", function(){a.bs()});b.addEventListener("size_changed",function(){a.bs()});b.addEventListener("onoverlay_property_changed",function(){a.ds()})},ds:function(){this.xU();if(0!=this.Vh.length&&this.GB){for(var a,b,c,d=this.Vh.length-1;0<=d;d--)if(b=this.Vh[d],ovarlayDom=b.Ld(),c=b.Fa())a=c.heading,b.uP(),b=b.kd,this.Xh[a]||(this.Xh[a]={}),this.Xh[a][b]={dom:ovarlayDom,pov:c},this.P.Nl.appendChild(ovarlayDom);this.bs()}},bs:function(a){this.P.Fa();var a=a||this.Ba.ef,b=this.Ba.$g,c=function(){function a(c){var d= b[c.top];if(!d)return q;for(var e=d.length-1;0<=e;e--)if(c.left>=d[e].left&&c.left<=d[e].right||c.right>=d[e].left&&c.right<=d[e].right)return o;return q}var b={};return function(c){for(;a(c);)c.top+=-36;b[c.top]?b[c.top].push(c):b[c.top]=[c];return c}}(),d;for(d in this.Xh)for(var e in this.Xh[d]){var f=this.Xh[d][e],g=this.iU(d,f.pov.pitch,a,b),f=f.dom,g=c({top:g[1],left:g[0],right:g[0]+f.offsetWidth});f.style.left=g.left-f.offsetWidth/2+"px";f.style.top=g.top+f.offsetHeight/2+"px"}},iU:function(a, b,c,d){if(Pa())return this.jU(a,b);var e=this.P;for(svHeading=e.Fa().heading%360;0>svHeading;)svHeading=(svHeading+360)%360;var f=(a-svHeading)%360,a=e.jh(),c=360/(2*Math.pow(2,c-2)*d);180<f?f-=360:-180>f&&(f+=360);d=Math.round(a.width/2+f/c);b=Math.round(a.height/2-(b-e.Fa().pitch)/c);return[d,b]},jU:function(a,b){var c=500*Math.cos(Tb(b)),c=Math.round(100*c)/100;"string"==typeof a&&(a=parseFloat(a));var d;d=a+this.P.ea.tiles.dirNorth;d%=360;var e=this.P.lg.Bd;d=Xj.tg(Math.cos(Tb(d))*c,500*Math.sin(Tb(b)), Math.sin(Tb(d))*c,1);var c=Xj.create(),f=e.Wh;Yj.multiply(c,e.If[0],d);Yj.multiply(c,f,c);if(0>c[3])return[-1E3,-1E3];e=this.P.ql;return[(c[0]/c[3]+1)/2*e.width,(1-c[1]/c[3])/2*e.height]},xU:function(){for(var a in this.Xh)for(var b in this.Xh[a]){var c=this.Xh[a][b].dom;c.parentNode.removeChild(c)}this.Xh={}}});x.extend(Ue.prototype,{ra:function(a){this.P=a;this.ia()||this.ta(this.P.ia());this.tA();this.aA()},Ld:v("ed"),hide:function(){this.Oa=q;this.ed&&(this.ed.style.display="none")},show:function(){this.Oa=o;this.ed&&(this.ed.style.display="block")},isVisible:v("Oa"),uP:function(){var a=this.oo();100<a?(a/=1E3,a=100>a?a.toFixed(2):a.toFixed(0),a+="\\u516c\\u91cc"):(a=100>a?a.toFixed(2):a.toFixed(0),a+="\\u7c73");this.kr.innerHTML=a},tA:function(){var a=this.Dk(),b=H("div"),c=b.style;c.position="absolute"; c.backgroundColor="rgba(29, 29, 29, 0.8)";c.padding="7px 0";c.height="19px";c.font="16px arial";c.color="white";c.whiteSpace="nowrap";c.borderRadius="4px";c.left="-1000px";c.top="-1000px";c=H("div");c.style["float"]="left";c.style.lineHeight="19px";b.appendChild(c);var d=H("span");d.style.margin="0 14px";d.innerHTML=a;c.appendChild(d);a=H("span");a.style.color="color:rgba(255,255,255,0.3)";a.innerHTML="|";c.appendChild(a);var e=H("span");e.style.margin="0 8px";e.style.color="#60c7fa";e.style.fontSize= "12px";e.innerHTML="0\\u7c73";c.appendChild(e);this.TR===q&&(e.style.display="none",a.style.display="none");this.ed=b;this.kr=e;this.xs=d},aA:function(){var a=this;this.uR(this.ed,function(b){a.dispatchEvent(new N("onclick"),{type:"click",target:a});Gb(b)});x.M(this.ed,"mouseenter",function(){a.dispatchEvent(new N("onmouseover"),{type:"mouseover",target:a})});x.M(this.ed,"mouseleave",function(){a.dispatchEvent(new N("onmouseout"),{type:"mouseout",target:a})})},uR:function(a,b){if(J()){var c=0,d=0, e=0;a.addEventListener("touchstart",function(a){c=(new Date).getTime();d=a.touches[0].pageX;e=a.touches[0].pageY},q);a.addEventListener("touchend",function(a){200<=(new Date).getTime()-c||(5<=Math.abs(a.changedTouches[0].pageX-d)||5<=Math.abs(a.changedTouches[0].pageY-e))||b.call(this,a)},q)}else x.M(this.ed,"click",b)},Mf:function(a,b){this.ed&&("content"===a&&(this.xs.innerHTML=b),this.P.dispatchEvent(new N("onoverlay_property_changed")))},remove:function(){this.ed=this.kr=this.xs=p;this.dispatchEvent(new N("onremove"), {type:"remove",target:this})}});x.extend(Xe.prototype,{ra:function(a){this.P=a;this.tA();(a=this.vE())&&(a.panoId||a.panoIId)&&this.aA(a)},Ld:v("ed"),hide:function(){this.Oa=q;this.ed.style.display="none"},show:function(){this.Oa=o;this.ed.style.display="block"},isVisible:v("Oa"),uP:function(){var a=this.P.ia(),b=this.ia(),a=T.rp(a,b);100<a?(a/=1E3,a=100>a?a.toFixed(2):a.toFixed(0),a+="\\u516c\\u91cc"):(a=100>a?a.toFixed(2):a.toFixed(0),a+="\\u7c73");this.kr.innerHTML=a},aA:function(a){var b=this;if(a.panoIId){var c=function(c){b.P.ZF(a.panoIId); c.stopPropagation();c.preventDefault()};J()?x.M(this.Br,"touchend",function(a){c(a)}):(this.Br.style.cursor="pointer",x.M(this.Br,"click",function(a){c(a)}))}if(a.panoId){var d=function(c){function d(){b.P.Nc(b.Fa());b.P.removeEventListener("dataload",d)}var g=a.panoId;b.P.Yb()!=g&&(b.P.rc(g),b.P.addEventListener("dataload",d));c.stopPropagation();c.preventDefault()};x.M(this.ed,"touchend",function(a){d(a)});this.ed.style.cursor="pointer";x.M(this.ed,"click",function(a){d(a)})}},tA:function(){var a= this.Ap(),b=H("div"),c=b.style;c.position="absolute";c.backgroundColor="rgba(29, 29, 29, 0.8)";c.padding="7px 0";c.height="19px";c.font="16px arial";c.color="white";c.whiteSpace="nowrap";c.borderRadius="4px";c.left="-1000px";c.top="-1000px";var d=H("img");d.src=this.sp();d.style.width="24px";d.style.height="24px";d.style.position="absolute";d.style.left="5px";d.style.top="5px";c.paddingLeft="40px";b.appendChild(d);c=H("div");c.style["float"]="left";c.style.lineHeight="19px";b.appendChild(c);var e= H("span");e.style.margin="0 14px";e.innerHTML=a;c.appendChild(e);a=H("span");a.style.color="color:rgba(255,255,255,0.3)";a.innerHTML="|";c.appendChild(a);a=H("span");a.style.margin="0 8px";a.style.color="#60c7fa";a.style.fontSize="12px";a.innerHTML="0\\u7c73";c.appendChild(a);this.ed=b;this.Br=d;this.kr=a;this.xs=e},Mf:function(a,b){switch(a){case "title":this.xs.innerHTML=b;break;case "altitude":this.P.dispatchEvent(new N("onoverlay_position_changed"));break;case "position":this.P.dispatchEvent(new N("onoverlay_position_changed"))}}, remove:function(){this.xs=this.kr=this.Br=this.ed=p;this.dispatchEvent(new N("onremove"),{type:"remove",target:this})}});x.extend(function(a){this.Vi(a)}.prototype,{Vi:function(a){this.P=a;this.Po=this.Oo=o;this.Ba();this.ca()},Ba:function(){this.C=H("div");var a=this.C.style;a.position="absolute";a.left="10px";a.top="10px";a.zIndex=1201;a=this.C;a.innerHTML=this.tr();Xa()?(this.ld=x.$(a.children[2]),this.zo=[x.$(this.ld.children[0]),x.$(this.ld.children[1]),x.$(this.ld.children[2]),x.$(this.ld.children[3])],Pb()?this.SJ=x.$(a.children[1].childNodes[0]):Ob()&&(this.cK=x.$(a.children[1].childNodes[0])),this.ce=x.$(a.children[3])): J()&&(this.ce=x.$(a.children[0]));this.Hh=x.$(this.ce.children[0]);this.cg=x.$(this.ce.children[1]);x.da.ma&&(this.ld.style.background=\'url("\'+I.pa+\'blank.gif") repeat\');6==x.da.ma&&this.IU();J()&&(this.ce.style.left=this.ce.style.top="0",this.ce.style.width="36px",this.ce.style.height="78px",this.Hh.style.width=this.cg.style.width="33px",this.Hh.style.height=this.cg.style.height="36px",this.cg.style.top="37.5px");this.P.ga()==Qe&&this.Fo("zoomIn",q);this.P.ga()==Re&&this.Fo("zoomOut",q);this.P.Ga().appendChild(a)}, tr:function(){var a=[];Xa()&&(a.push(this.GA()),a.push(this.yS()),a.push(this.AS()));a.push(this.HA());return a.join("")},yS:function(){if(Pb())return\'<svg version="1.1" overflow="hidden" width="82px" height="82px" viewBox="0 0 82 82" style="position: absolute; top: 0px; left: 0px;"><g transform="rotate(0, 41, 41)"><rect x="33" y="1" width="14" height="12" rx="4" ry="4" stroke="#868685" stroke-width="1" fill="#f8f8f8"></rect><polyline points="37.5,9.5 37.5,3.5 42.5,9.5 42.5,3.5" stroke-linejoin="bevel" stroke-width="1.5" fill="#f2f4f6" stroke="#868685"></polyline></g></svg>\'; if(Ob())return\'<div style="position:absolute;top:0;left:0;z-index:0"><v:group style="position:absolute;width:82px;height:82px; behavior:url(#default#VML);rotation:0" unselectable="on" coordsize="82,82" coordorigin="-41,-41"><v:roundrect style="width:14px;height:12px;top:-40px; behavior:url(#default#VML);left:-7px;z-index:2" fillcolor="#f8f8f8" arcsize ="19661f" coordsize="21600,21600" strokecolor="#868685" strokeweight="1pt"></v:roundrect><v:polyline style="behavior: url(#default#VML);z-index:3" fillcolor="#f2f4f6" points="-3,-31,-3,-37,3,-31,3,-37" strokeweight="1.2pt"><v:stroke style="behavior:url(#default#VML)" color="#868685" joinstyle="bevel"></v:stroke></v:polyline></v:group></div>\'}, GA:function(){return\'<div style="position:absolute;top:4px;left:4px;width:74px;height:74px;background:url(\'+I.pa+\'st-navictrl.png) no-repeat;-webkit-user-select:none;overflow:hidden"><div></div></div>\'},AS:function(){return\'<div style="position:absolute;top:0px;left:0;width:82px;height:82px;-webkit-user-select:none;cursor:\'+I.Xb+\'"><div style="position:absolute;left:32px;top:13px;cursor:pointer;width:17px;height:17px;" title="\\u5411\\u4e0a\\u5e73\\u79fb"></div><div style="position:absolute;left:14px;top:32px;cursor:pointer;width:17px;height:17px;" title="\\u5411\\u5de6\\u5e73\\u79fb"></div><div style="position:absolute;left:51px;top:32px;cursor:pointer;width:17px;height:17px;" title="\\u5411\\u53f3\\u5e73\\u79fb"></div><div style="position:absolute;left:33px;top:51px;cursor:pointer;width:17px;height:17px;" title="\\u5411\\u4e0b\\u5e73\\u79fb"></div></div>\'}, HA:function(){var a="background-image:url(\'"+I.pa+"st-navictrl.png\');background-repeat:no-repeat;background-position:-74px 0;";J()&&(a="background-image:url(\'"+I.pa+"st-navictrl-hd.png\');background-repeat:no-repeat;background-position:0 0;background-size:180px 78px;");return\'<div style="position:absolute;top:84px;left:30px;width:24px;height:52px;\'+a+\'-webkit-user-select:none;overflow:hidden"><div style="position:absolute;cursor:pointer;width:22px;height:24px;top:0;left:0;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)" title="\\u653e\\u5927\\u4e00\\u7ea7"></div><div style="position:absolute;cursor:pointer;width:22px;height:24px;top:25px;left:0;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)" title="\\u7f29\\u5c0f\\u4e00\\u7ea7"></div><div></div></div>\'}, ca:function(){var a=this.P,b=this;if(Xa()){x.M(this.zo[0],"click",function(){var b=a.Fa();a.dz({heading:b.heading,pitch:b.pitch+30})});x.M(this.zo[1],"click",function(){var b=a.Fa();a.dz({heading:b.heading-45,pitch:b.pitch})});x.M(this.zo[2],"click",function(){var b=a.Fa();a.dz({heading:b.heading+45,pitch:b.pitch})});x.M(this.zo[3],"click",function(){var b=a.Fa();a.dz({heading:b.heading,pitch:b.pitch-30})});for(var c=0;c<this.zo.length;c++)x.M(this.zo[c],"mousedown",oa);b.Vv=q;x.M(this.ld,"mousedown", function(c){b.Vv=o;b.ld.style.cursor=I.Id;x.da.ma&&b.ld.setCapture&&b.ld.setCapture();b.QJ=b.zH(c);b.OR=a.Fa().heading;x.da.ma||Gb(c)});x.M(document,"mousemove",function(c){b.Vv&&a.Nc({heading:b.OR+360-(b.zH(c)-b.QJ),pitch:a.Fa().pitch})});x.M(document,"mouseup",function(){b.Vv&&(b.Vv=q,b.ld.style.cursor=I.Xb,x.da.ma&&b.ld.releaseCapture&&b.ld.releaseCapture(),b.QJ=p)});a.addEventListener("position_changed",function(){var c=360-this.Fa().heading;Pb()?b.SJ.setAttribute("transform","rotate("+c+", 41, 41)"): Ob()&&(b.cK.style.rotation=c);a.removeEventListener("position_changed",arguments.callee)});a.addEventListener("pov_changed",function(){var a=360-this.Fa().heading;Pb()?b.SJ.setAttribute("transform","rotate("+a+", 41, 41)"):Ob()&&(b.cK.style.rotation=a)})}x.M(this.C,"mousemove",function(){a.dispatchEvent(new N("hide_ellipse"))});x.M(this.C,"mouseout",function(){a.dispatchEvent(new N("show_ellipse"))});x.M(this.Hh,"click",function(){a.Oc(a.ga()+1)});x.M(this.cg,"click",function(){a.Oc(a.ga()-1)});Xa()? (x.M(this.Hh,"mousedown",function(){b.jk(b.Oo,-98)}),x.M(this.cg,"mousedown",function(){b.jk(b.Po,-122)}),x.M(this.Hh,"mouseup",function(){b.jk(b.Oo,-74)}),x.M(this.cg,"mouseup",function(){b.jk(b.Po,-74)})):J()&&(x.M(this.Hh,"touchstart",function(){b.jk(b.Oo,-98)}),x.M(this.cg,"touchstart",function(){b.jk(b.Po,-122)}),x.M(this.Hh,"touchend",function(){b.jk(b.Oo,-74)}),x.M(this.cg,"touchend",function(){b.jk(b.Po,-74)}));this.P.addEventListener("zoom_changed_inner",function(){if(this.ga()==Qe)b.Fo("zoomIn", q);else if(this.ga()==Re)b.Fo("zoomOut",q);else{b.Fo("zoomIn",o);b.Fo("zoomOut",o)}})},jk:function(a,b){a&&(6==x.da.ma?this.ce.children[2].style.left=b+"px":(J()&&(b=36*((b+74)/24)),this.ce.style.backgroundPosition=b+"px 0"))},IU:function(){var a=this.C.children[0];a.style.background="";a.children[0].style.cssText+="position:absolute;left:0;top:0;width:98px;height:74px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'"+I.pa+"st-navictrl.png\')";this.ce.style.background="";this.ce.children[2].style.cssText+= "position:absolute;z-index:-1;left:-74px;top:0;width:98px;height:74px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'"+I.pa+"st-navictrl.png\')"},show:function(){this.C.style.display=""},U:function(){this.C.style.display="none"},zH:function(a){var a=window.event||a,b=a.pageX||a.clientX,a=a.pageY||a.clientY,c=Fb(this.P.Ga()),b=b-c.left-50,a=-(a-c.top-50),b=180*(Math.atan2(a,b)/Math.PI);return 90>b?90-b:450-b},Fo:function(a,b){var c=this.ce.children[2];if("zoomIn"==a)if(b)if(this.Oo= o,this.Hh.style.cursor="pointer",6==x.da.ma)c.style.left="-74px";else{var d=-74;J()&&(d=0);this.ce.style.backgroundPosition=d+"px 0"}else this.Oo=q,this.Hh.style.cursor="",6==x.da.ma?c.style.left="-170px":(d=-170,J()&&(d=-144),this.ce.style.backgroundPosition=d+"px 0");"zoomOut"==a&&(b?(this.Po=o,this.cg.style.cursor="pointer",6==x.da.ma?c.style.left="-74px":(d=-74,J()&&(d=0),this.ce.style.backgroundPosition=d+"px 0")):(this.Po=q,this.cg.style.cursor="",6==x.da.ma?c.style.left="-146px":(d=-146,J()&& (d=-108),this.ce.style.backgroundPosition=d+"px 0")))}});function Zj(a,b){this.dC=a;this.$e=[];this.oc={ap:p};var b=b||{},c;for(c in b)this.oc[c]=b[c]}Zj.prototype.setData=function(a,b){if(0!==this.dC){if(this.$e.length>this.dC){for(var c=Math.round(0.6*this.dC),d=0;d<c;d++){var e=this.$e[d].KI;this.oc.ap&&this.oc.ap(this.$e[e]);delete this.$e[e]}this.$e.splice(0,c)}this.$e[a]||this.$e.push(b);this.$e[a]=b;b.KI=a}};Zj.prototype.getData=function(a){return this.$e[a]}; Zj.prototype.clear=function(){for(var a=0;a<this.$e.length;a++){var b=this.$e[a].KI;this.oc.ap&&this.oc.ap(this.$e[b]);delete this.$e[b]}this.$e=[]};function $j(){this.qA=0;this.Qg={}}$j.prototype.Px=function(){var a=p,b;for(b in this.Qg)if(this.Qg[b]&&this.Qg[b].FA===o)return this.Qg[b].FA=q,this.Qg[b];a=new Image;this.qA++;b="img_"+this.qA;return this.Qg[b]=a};$j.prototype.clear=function(){for(var a in this.Qg)this.Qg[a]&&(this.Qg[a].onload=this.Qg[a].onerror=p);this.Qg={};this.qA=0};function Sj(a){this.P=a;return"cvsRender"==a.kk?new ak(a):new bk(a)};function ak(a){this.P=a;this.ci=a.ci;this.Uj();this.P.sa=this;this.ca()} x.extend(ak.prototype,{ca:function(){var a=this,b=a.P;b.addEventListener("size_changed",function(c){a.Ce(b.lg.ef,b.lg.xE(),c.size)})},setData:function(a,b,c){a&&(this.ea=a,this.GT(b,c))},Uj:function(){var a=H("canvas");a.width=this.P.Ga().clientWidth;a.height=this.P.Ga().clientHeight;var b=a.style;b.position="absolute";b.left=b.top="0";this.ci.appendChild(a);this.hW=a.getContext("2d");this.Bi=[];this.yK=[];this.Vc=new ck(this.hW,this.Bi,0,a.width,a.height,this.P);for(a=b=a=0;16>a;a++){this.Bi[a]= [];for(b=0;8>b;b++){var c=new dk(this.P);c.lN=a;c.mN=b;c.canvas=this.Vc;this.Bi[a][b]=c}}this.P.I2=this.Vc},va:function(a,b){if(a&&b){var c=a.heading%360,d=a.pitch;this.RA({heading:c,pitch:d},b);this.Vc.ni({heading:c,pitch:d},b)}},GT:function(a,b){this.Vc.PW();this.BS(this.ea);this.Vc.JY(this.ea);this.xJ(a,b);this.PA(b,o)},Oc:function(a,b){var c=this,d=o;b==this.Vc.sa.zoom&&(d=q);this.xJ(a,b);d&&this.PA(b,o);setTimeout(function(){c.RA()},1E3)},BS:function(a){var b=this,c=a.tiles,d={ye:[]};d.ye[0]= new Image;d.ye[0].src=c.getTilesUrl(a.id,{x:0,y:0},2);d.ye[1]=new Image;d.ye[1].src=c.getTilesUrl(a.id,{x:1,y:0},2);b.GP=0;d.ye[0].onload=function(){b.Ay()};d.ye[1].onload=function(){b.Ay()};this.yK[0]=d},Ay:function(){this.GP++;2==this.GP&&(this.Vc.X_(this.yK[0].ye),this.Vc.Ay())},RA:function(a,b){if(this.ea&&this.ea.tiles)for(var c=this.ea.tiles,d=[],b=b||this.Vc.sa.zoom,d=this.Bi,e=this.Vc.gE(a),f=e.Pu,g=e.Ys,i=e.Tt,e=e.ju,e=e>i?e-i:64+e-i,j=0,l=0,m=0;m<e+Math.pow(2,7-b);){for(var n=f;n<g+Math.pow(2, 7-b);){j=m+i;63<j?j%=64:0>j&&(j+=64);j=Math.floor(j*Math.pow(2,b-7));l=Math.floor(n*Math.pow(2,b-7));if(j<Math.pow(2,b-1)&&l<Math.pow(2,b-2)&&0==d[j][l].Am){var s=c.getTilesUrl(this.ea.id,{x:j,y:l},b);d[j][l].MO(s)}n+=Math.pow(2,7-b)}m+=Math.pow(2,7-b)}},PA:function(a,b){var c=q;b&&(c=o);if(!c)if(this.Cz)this.Cz=q;else return;if(this.ea&&this.ea.tiles){for(var c=this.ea.tiles,d=[],e=Math.pow(2,a-1),f=Math.pow(2,a-2),d=this.Bi,g=0;g<e;g++)for(var i=0;i<f;i++)d[g][i].l_();for(var g=this.Vc.gE(),e=g.Pu, f=g.Ys,j=g.Tt,g=g.ju,l=g>j?g-j:64+g-j,m=0,n=0,g=0;g<l+Math.pow(2,7-a);){for(i=e;i<f+Math.pow(2,7-a);){m=g+j;63<m?m%=64:0>m&&(m+=64);m=Math.floor(m*Math.pow(2,a-7));n=Math.floor(i*Math.pow(2,a-7));if(m<Math.pow(2,a-1)&&n<Math.pow(2,a-2)){var s=c.getTilesUrl(this.ea.id,{x:m,y:n},a);d[m][n].MO(s)}i+=Math.pow(2,7-a)}g+=Math.pow(2,7-a)}}},Ce:function(a,b,c){a!=this.Vc.sa.zoom&&(this.Cz=o);this.Vc.Sk(a,b,c);this.PA(a);this.RA();this.Vc.refresh()},xJ:function(a,b){var c=q;b==this.Vc.sa.zoom?this.Cz=q:(this.Cz= o,b<this.Vc.sa.zoom&&(c=o));this.Vc.m_(a,b);return c},kY:function(a){return this.Vc.mY(a)},jE:function(a,b){return this.Vc.jE(a,b)},Y3:function(){return this.Vc.sa.Ca}}); function dk(a){this.ye=new Image;this.src="";this.canvas=p;this.mN=this.lN=this.Am=0;this.P=a;var b=this;this.FM=function(){-1!=b.src.indexOf("pos=0_0&z=1")&&b.P.dispatchEvent(new N("onthumbnail_complete"));b.Am=2;b.canvas.hX(b.lN,b.mN)};this.ye.onload=this.FM;this.MO=function(a){this.src==a?0==this.Am&&b.FM():(this.src=this.ye.src=a,this.Am=1)};this.l_=function(){this.src=this.ye.src="";this.Am=0}} function ck(a,b,c,d,e,f){this.heading=this.pitch=0;this.zoom=2;this.Bi=b;this.Rk=[];this.rg=a;this.jm=q;this.sa={a:d,bb:e,Pf:0,Es:0,Ca:0,A1:512,heading:0,pitch:0,dd:32,zoom:0,gq:0,Xo:0,xq:0,D2:0,jn:0,E2:0,uq:0,fu:0};this.P=f;this.Kt=q;this.GQ()} x.extend(ck.prototype,{GQ:function(){if(x.da.gx){var a=navigator.userAgent.substr(navigator.userAgent.indexOf("Chrome"),12);27<Number(/[1-9][0-9]*/.exec(a+"1")[0])?(this.sa.Xo=0.0078125,this.sa.fu=2):(this.sa.Xo=0.015625,this.sa.fu=4);this.sa.jn=0;this.sa.uq=0}else x.da.ma?(this.sa.Xo=0.0078125,this.sa.jn=0,this.sa.uq=6):(this.sa.Xo=0.0078125,this.sa.jn=0,this.sa.uq=4),this.sa.fu=2},X_:da("Rk"),Nx:function(){var a=this.sa,b=Math.PI/Math.pow(2,this.sa.gq);b>Math.PI/2+0.1&&(b=2*Math.PI/3);return a.a/ 2/Math.tan(b/2)},Sk:function(a,b,c){var d=this.sa;d.a=c.width;d.bb=c.height;this.rg.canvas.width=c.width;this.rg.canvas.height=c.height;d.zoom=a;d.gq=b;d.Ca=this.Nx();d.dd=16*Math.pow(2,a-2);d.gu=Math.pow(2,a-1);d.nn=Math.pow(2,a-2);d.$p=Math.pow(2,7-a)},m_:function(a,b){var c=this.sa;if(0==this.sa.Ca)c.zoom=b,c.gq=a,c.Ca=this.Nx(),c.dd=16*Math.pow(2,b-2),c.gu=Math.pow(2,b-1),c.nn=Math.pow(2,b-2),c.$p=Math.pow(2,7-b),c.xq=c.Xo*Math.pow(2,-a);else if(!(a==c.gq&&b==c.zoom)){this.jm=o;var d=this.sa.Ca; c.dd=16*Math.pow(2,b-2);c.zoom=b;c.gq=a;c.gu=Math.pow(2,b-1);c.nn=Math.pow(2,b-2);c.$p=Math.pow(2,7-b);d=(this.Nx()-d)/32;this.P.Jk();this.iK(0,d);c.xq=c.Xo*Math.pow(2,-a)}},JY:function(a){this.sa.heading-=this.sa.Pf/180*Math.PI;this.sa.Pf=a.tiles.dirNorth;this.sa.heading+=a.tiles.dirNorth/180*Math.PI;this.sa.Es=a.tiles.pitch||0},iK:function(a,b){var c=this;if(5>a)this.sa.Ca+=b*Math.pow(2,a),this.jS(),setTimeout(function(){c.iK(a+1,b)},0);else if(5==a){this.jm=q;var d=this.sa.zoom;this.sa.Ca=this.Nx(); this.sa.dd=16*Math.pow(2,d-2);this.sa.gu=Math.pow(2,d-1);this.sa.nn=Math.pow(2,d-2);this.sa.$p=Math.pow(2,7-d);this.P.kz();this.refresh()}},V4:function(a,b){this.jm=o;var c=this.sa;this.tF={data:a,NV:b};this.tF.od=0;var d=Math.cos((a.dir+c.Pf)/180*Math.PI),c=-Math.sin((a.dir+c.Pf)/180*Math.PI),c=d=0;this.P.Jk();this.eS({index:1,U2:d,V2:c})},hX:function(a,b){if(!this.jm&&this.Kt)if(1<this.sa.gq)this.refresh();else{var c=this.sa,d=c.dd,e=512/d,f=c.$p,g=Math.cos(c.pitch),i=Math.cos(c.heading),j=Math.sin(c.heading), l=c.Ca*Math.sin(c.pitch),m=c.Ca*g*j;c.Kq=-c.Ca*g*i;c.Lq=l;c.Mq=m;c.Gs=i;c.yu=j;for(g=0;g<e;g++)for(i=0;i<e;i++){j={pb:{x:g*d,y:i*d-1},qb:{x:g*d-1,y:i*d+d+1},rb:{x:g*d+d+1,y:i*d+d}};l={pb:{x:g*d-1,y:i*d},qb:{x:g*d+d+1,y:i*d-1},rb:{x:g*d+d,y:i*d+d+1}};if(0==g)var n=-1;else g==f-1&&(n=1);if(0==i)var s=-1;else i==f-1&&(s=1);this.CD(j,a,b,c.zoom,n,s);this.DD(l,a,b,c.zoom,n,s)}}},eS:function(){var a=this.sa;this.rg.clearRect(0,0,a.a,a.bb);a.heading-=a.Pf/180*Math.PI;a.Pf=this.tF.NV.a5;a.heading+=a.Pf/180* Math.PI;this.Rk=this.tF.data.ye;this.jm=q;this.P.kz();this.refresh()},Wn:function(a,b,c,d,e){var c=this.sa,b=2*(0.5*a.x/512+b/2)*Math.PI,f=(0.5-a.y/512)*Math.PI,g=c.Ca,a=Math.cos(f),i=Math.sin(Math.abs(f));0.4>i?i=0.4:0.98<i&&(i=c.fu);var b=b+d*i,j=-a*Math.cos(b),i=Math.sin(f+e*i),l=a*Math.sin(b),e=c.Gs,d=c.yu,b=c.Kq,a=c.Lq,f=c.Mq,m=b*j+i*a+l*f;0>m&&(m=q);m=g*g/m;g=m*j-b;j=m*i-a;l=m*l-f;m=Math.pow(g,2)+Math.pow(j,2)+Math.pow(l,2);i=Math.sqrt(m);0==m?d=e=0:(m=(g*d+l*e)/i,1<m?m=1:-1>m&&(m=-1),m=Math.acos(m), 0>g*e*a+j*d*f-j*e*b-l*a*d&&(m=2*Math.PI-m),e=i*Math.cos(m),d=i*Math.sin(m));return{x:c.a/2+e,y:c.bb/2-d}},rL:function(a,b,c,d,e,f){var g=this.rg,i=0,j=0,l=0,m=0,n=this.sa.xq;d&&(1==d?j=n:-1==d&&(i=n));e&&(-1==e?l=n:1==e&&(m=n));d=this.sa.jn;i=this.Wn(a.pb,b,c,-d-i,l,f);if(!i)return q;l=this.Wn(a.qb,b,c,d+j,d+l,f);if(!l)return q;c=this.Wn(a.rb,b,c,j,-d-m,f);if(!c)return q;c={pb:i,qb:l,rb:c};f=c.pb;j=c.qb;m=c.rb;g.save();g.beginPath();g.moveTo(f.x,f.y);g.lineTo(j.x,j.y);g.lineTo(m.x,m.y);g.closePath(); g.clip();a=this.Hk(a,c);g.transform(a[0],a[1],a[2],a[3],a[4],a[5]);g.drawImage(this.Rk[b],0,0);g.restore()},qL:function(a,b,c,d,e,f){var g=this.rg,i=0,j=0,l=0,m=0,n=this.sa.xq;d&&(1==d?j=n:-1==d&&(i=n));e&&(-1==e?l=n:1==e&&(m=n));d=this.sa.jn;l=this.Wn(a.pb,b,c,-i,d+l,f);if(!l)return q;i=this.Wn(a.qb,b,c,-d-i,-d-m,f);if(!i)return q;c=this.Wn(a.rb,b,c,d+j,-m,f);if(!c)return q;c={pb:l,qb:i,rb:c};f=c.pb;j=c.qb;m=c.rb;g.save();g.beginPath();g.moveTo(f.x,f.y);g.lineTo(j.x,j.y);g.lineTo(m.x,m.y);g.closePath(); g.clip();a=this.Hk(a,c);g.transform(a[0],a[1],a[2],a[3],a[4],a[5]);g.drawImage(this.Rk[b],0,0);g.restore()},PW:function(){this.Kt=q;this.P.Jk()},Ay:function(){this.Kt=o;this.refresh();this.P.kz()},ni:function(a){if(this.Kt&&!this.jm){var b=this.sa;b.pitch=a.pitch/180*Math.PI-b.Es/180*Math.PI;b.heading=(a.heading+b.Pf)/180*Math.PI;b.heading>2*Math.PI?b.heading-=2*Math.PI:0>b.heading&&(b.heading+=2*Math.PI);a=b.dd;this.rg.clearRect(0,0,b.a,b.bb);var c=b.bound,d=c.Pu,e=c.Ys,f=c.Tt,c=c.ju,c=c>f?c-f:64+ c-f,g=b.$p,i=b.uq,j=Math.cos(b.pitch),l=Math.cos(b.heading),m=Math.sin(b.heading),n=b.Ca*Math.sin(b.pitch),s=b.Ca*j*m;b.Kq=-b.Ca*j*l;b.Lq=n;b.Mq=s;b.Gs=l;b.yu=m;for(j=0;j<c;j++)for(l=d;l<e;l++){s=j+f;63<s?s%=64:0>s&&(s+=64);var m=Math.floor(s/g),n=Math.floor(l/g),s=s%g,u=l%g,w={pb:{x:s*a,y:u*a-i},qb:{x:s*a-i,y:u*a+a+i},rb:{x:s*a+a+i,y:u*a+a}},y={pb:{x:s*a-i,y:u*a},qb:{x:s*a+a+i,y:u*a-i},rb:{x:s*a+a,y:u*a+a+i}};if(0==s)var D=-1;else s==g-1&&(D=1);if(0==u)var C=-1;else u==g-1&&(C=1);this.CD(w,m,n,b.zoom, D,C);this.DD(y,m,n,b.zoom,D,C)}}},refresh:function(){if(this.Kt&&!this.jm){var a=this.sa,b=a.dd;this.rg.clearRect(0,0,a.a,a.bb);var c=this.gE(),d=c.Pu,e=c.Ys,f=c.Tt,c=c.ju,c=c>f?c-f:64+c-f,g=a.$p,i=Math.cos(a.pitch),j=Math.cos(a.heading),l=Math.sin(a.heading),m=a.Ca*Math.sin(a.pitch),n=a.Ca*i*l;a.Kq=-a.Ca*i*j;a.Lq=m;a.Mq=n;a.Gs=j;a.yu=l;i=a.uq;for(j=0;j<c;j++)for(l=d;l<e;l++){var s=j+f;63<s?s%=64:0>s&&(s+=64);var m=Math.floor(s/g),n=Math.floor(l/g),s=s%g,u=l%g,w={pb:{x:s*b,y:u*b-i},qb:{x:s*b-i,y:u* b+b+i},rb:{x:s*b+b+i,y:u*b+b}},y={pb:{x:s*b-i,y:u*b},qb:{x:s*b+b+i,y:u*b-i},rb:{x:s*b+b,y:u*b+b+i}};if(0==s)var D=-1;else s==g-1&&(D=1);if(0==u)var C=-1;else u==g-1&&(C=1);this.CD(w,m,n,a.zoom,D,C);this.DD(y,m,n,a.zoom,D,C)}}},jS:function(){var a=this.sa;this.rg.clearRect(0,0,a.a,a.bb);var b=a.uq,c=Math.cos(a.pitch),d=Math.cos(a.heading),e=Math.sin(a.heading),f=a.Ca*Math.sin(a.pitch),g=a.Ca*c*e;a.Kq=-a.Ca*c*d;a.Lq=f;a.Mq=g;a.Gs=d;a.yu=e;for(a=0;16>a;a++)for(c=0;16>c;c++){d={pb:{x:32*a,y:32*c-b},qb:{x:32* a-b,y:32*c+32+b},rb:{x:32*a+32+b,y:32*c+32}};e={pb:{x:32*a-b,y:32*c},qb:{x:32*a+32+b,y:32*c-b},rb:{x:32*a+32,y:32*c+32+b}};if(0==a)var i=-1;else 15==a&&(i=1);if(0==c)var j=-1;else 15==c&&(j=1);this.qL(d,0,2,i,j);this.rL(e,0,2,i,j);this.qL(d,1,2,i,j);this.rL(e,1,2,i,j)}},jE:function(a,b){var c=this.sa,d=a-c.a/2,e=c.bb/2-b,f=c.pitch+c.Es/180*Math.PI,g=c.heading-c.Pf/180*Math.PI,i=-c.Ca*Math.cos(f)*Math.cos(g),j=c.Ca*Math.sin(f),l=c.Ca*Math.cos(f)*Math.sin(g),m=d*Math.sin(g),d=d*Math.cos(g),n=e*Math.sin(f)* Math.cos(g),e=e*Math.cos(f),i=i+m+n,j=j+e,e=l+d+-e*Math.sin(f)*Math.sin(g),f=this.Fa(i,j,e);if(2<j)return q;g=2.08/(2.08-j);i*=g;e*=g;return{hH:i,iH:e,Ca:Math.sqrt(Math.pow(i,2)+Math.pow(e,2)),RF:c.Ca,heading:f.heading}},gE:function(a){var b=this.sa;a&&(b.heading=(a.heading+b.Pf)/180*Math.PI,b.heading>2*Math.PI?b.heading-=2*Math.PI:0>b.heading&&(b.heading+=2*Math.PI),b.pitch=a.pitch/180*Math.PI-b.Es/180*Math.PI);var c=Math.cos(b.pitch),d=Math.sin(b.pitch),e=Math.cos(b.heading),f=Math.sin(b.heading), a=-b.Ca*c*e,g=b.Ca*d,i=b.Ca*c*f,j=b.bb/2*d*e,l=b.bb/2*c,m=-b.bb/2*d*f,n=-b.bb/2*d*e,c=-b.bb/2*c,d=b.bb/2*d*f,s=-b.a/2*f,u=-b.a/2*e,f=b.a/2*f,e=b.a/2*e;if(0<b.pitch)var w=this.Fa(a+j+s,g+l+0,i+m+u),y=this.Fa(a+n,g+c,i+d),D=this.Fa(a+n+f,g+c+0,i+d+e);else var C=a+j,F=g+l,m=i+m,A=this.Fa(C,F,m),F=this.Fa(C+s,F+0,m+u),C=this.Fa(a+n+f,g+c+0,i+d+e);a=Math.atan(b.bb/2/b.Ca);b.pitch+a>Math.PI/2?(A=0,y=y.pitch<D.pitch?y.pitch:D.pitch,y=Math.ceil(32*(Math.PI/2-y)/Math.PI)):b.pitch-a<-Math.PI/2?(y=A.pitch>F.pitch? A.pitch:F.pitch,A=Math.floor(32*(Math.PI/2-y)/Math.PI),y=32):0<b.pitch?(A=Math.floor(32*(Math.PI/2-b.pitch-a)/Math.PI),y=y.pitch>D.pitch?D.pitch:y.pitch,y=Math.ceil(32*(Math.PI/2-y)/Math.PI)):(y=A.pitch>F.pitch?A.pitch:F.pitch,A=Math.floor(32*(Math.PI/2-y)/Math.PI),y=Math.ceil(32*(Math.PI/2-b.pitch+a)/Math.PI));Math.abs(b.pitch)>=Math.PI/2-a?(C=0,w=64):0<b.pitch?(C=Math.floor(32*w.heading/Math.PI),w=b.heading>w.heading?Math.ceil(32*(2*b.heading-w.heading)/Math.PI):Math.ceil(32*(2*b.heading+2*Math.PI- w.heading)/Math.PI)):(w=Math.ceil(32*C.heading/Math.PI),C=b.heading>C.heading?Math.floor(32*(2*b.heading-2*Math.PI-C.heading)/Math.PI):Math.floor(32*(2*b.heading-C.heading)/Math.PI));0>C&&(C+=64);64<w&&(w-=64);32<y&&(y=32);0>A&&(A=0);b.bound={Pu:A,Ys:y,Tt:C,ju:w};return{Pu:A,Ys:y,Tt:C,ju:w}},CD:function(a,b,c,d,e,f){if(2==this.Bi[b][c].Am){var g=this.rg,i=0,j=0,l=0,m=0,n=this.sa.xq;e&&(1==e?j=n:-1==e&&(i=n));f&&(-1==f?l=n:1==f&&(m=n));e=this.sa.jn;l=this.jg(a.pb,b,c,d,0,-i,e,l);if(!l)return q;i=this.jg(a.qb, b,c,d,-e,-i,-e,-m);if(!i)return q;d=this.jg(a.rb,b,c,d,e,j,0,-m);if(!d)return q;d={pb:l,qb:i,rb:d};j=d.pb;m=d.qb;i=d.rb;g.save();g.beginPath();g.moveTo(j.x,j.y);g.lineTo(m.x,m.y);g.lineTo(i.x,i.y);g.closePath();g.clip();a=this.Hk(a,d);g.transform(a[0],a[1],a[2],a[3],a[4],a[5]);g.drawImage(this.Bi[b][c].ye,0,0)}else{g=this.rg;m=l=j=i=0;n=0.0078125;e&&(1==e?j=n:-1==e&&(i=n));f&&(-1==f?l=n:1==f&&(m=n));e=0.0078125;l=this.jg(a.pb,b,c,d,0,-i,e,l);if(!l)return q;i=this.jg(a.qb,b,c,d,-e,-i,-e,-m);if(!i)return q; d=this.jg(a.rb,b,c,d,e,j,0,-m);if(!d)return q;d={pb:l,qb:i,rb:d};j=d.pb;m=d.qb;i=d.rb;g.save();g.beginPath();g.moveTo(j.x,j.y);g.lineTo(m.x,m.y);g.lineTo(i.x,i.y);g.closePath();g.clip();j=a.pb;m=a.qb;i=a.rb;l=this.sa.nn;e=512*b;c*=512;b>=l?(a.pb={x:(e+j.x)/l-512,y:(c+j.y)/l},a.qb={x:(e+m.x)/l-512,y:(c+m.y)/l},a.rb={x:(e+i.x)/l-512,y:(c+i.y)/l},a=this.Hk(a,d),g.transform(a[0],a[1],a[2],a[3],a[4],a[5]),g.drawImage(this.Rk[1],0,0)):(a.pb={x:(e+j.x)/l,y:(c+j.y)/l},a.qb={x:(e+m.x)/l,y:(c+m.y)/l},a.rb= {x:(e+i.x)/l,y:(c+i.y)/l},a=this.Hk(a,d),g.transform(a[0],a[1],a[2],a[3],a[4],a[5]),g.drawImage(this.Rk[0],0,0))}g.restore()},DD:function(a,b,c,d,e,f){if(2==this.Bi[b][c].Am){var g=this.rg,i=0,j=0,l=0,m=0,n=this.sa.xq;e&&(1==e?j=n:-1==e&&(i=n));f&&(-1==f?l=n:1==f&&(m=n));e=this.sa.jn;i=this.jg(a.pb,b,c,d,-e,-i,0,l);if(!i)return q;l=this.jg(a.qb,b,c,d,e,j,e,l);if(!l)return q;d=this.jg(a.rb,b,c,d,0,j,-e,-m);if(!d)return q;d={pb:i,qb:l,rb:d};j=d.pb;m=d.qb;l=d.rb;g.save();g.beginPath();g.moveTo(j.x,j.y); g.lineTo(m.x,m.y);g.lineTo(l.x,l.y);g.closePath();g.clip();a=this.Hk(a,d);g.transform(a[0],a[1],a[2],a[3],a[4],a[5]);g.drawImage(this.Bi[b][c].ye,0,0)}else{g=this.rg;m=l=j=i=0;n=0.0078125;e&&(1==e?j=n:-1==e&&(i=n));f&&(-1==f?l=n:1==f&&(m=n));e=0.0078125;i=this.jg(a.pb,b,c,d,-e,-i,0,l);if(!i)return q;l=this.jg(a.qb,b,c,d,e,j,e,l);if(!l)return q;d=this.jg(a.rb,b,c,d,0,j,-e,-m);if(!d)return q;d={pb:i,qb:l,rb:d};j=d.pb;m=d.qb;l=d.rb;g.save();g.beginPath();g.moveTo(j.x,j.y);g.lineTo(m.x,m.y);g.lineTo(l.x, l.y);g.closePath();g.clip();j=a.pb;m=a.qb;l=a.rb;i=this.sa.nn;e=512*b;c*=512;b>=i?(a.pb={x:(e+j.x)/i-512,y:(c+j.y)/i},a.qb={x:(e+m.x)/i-512,y:(c+m.y)/i},a.rb={x:(e+l.x)/i-512,y:(c+l.y)/i},a=this.Hk(a,d),g.transform(a[0],a[1],a[2],a[3],a[4],a[5]),g.drawImage(this.Rk[1],0,0)):(a.pb={x:(e+j.x)/i,y:(c+j.y)/i},a.qb={x:(e+m.x)/i,y:(c+m.y)/i},a.rb={x:(e+l.x)/i,y:(c+l.y)/i},a=this.Hk(a,d),g.transform(a[0],a[1],a[2],a[3],a[4],a[5]),g.drawImage(this.Rk[0],0,0))}g.restore()},jg:function(a,b,c,d,e,f,g,i){d=this.sa; b=2*(1/d.gu*a.x/512+b/d.gu)*Math.PI;c=(0.5-1/d.nn*a.y/512-c/d.nn)*Math.PI;a=Math.sin(Math.abs(c));0.4>a?a=0.4:0.98<a&&(a=d.fu);var b=b+(e+f)*a,c=c+(g+i)*a,j=d.Ca,e=Math.cos(c),a=-e*Math.cos(b),c=Math.sin(c),l=e*Math.sin(b),b=d.Gs,e=d.yu,f=d.Kq,g=d.Lq,i=d.Mq,m=f*a+c*g+l*i;if(0>m)return q;j=j*j/m;a=j*a-f;c=j*c-g;l=j*l-i;m=Math.pow(a,2)+Math.pow(c,2)+Math.pow(l,2);j=Math.sqrt(m);0==m?e=b=0:(m=(a*e+l*b)/j,1<m?m=1:-1>m&&(m=-1),m=Math.acos(m),0>a*b*g+c*e*i-c*b*f-l*g*e&&(m=2*Math.PI-m),b=j*Math.cos(m),e= j*Math.sin(m));return{x:d.a/2+b,y:d.bb/2-e}},mY:function(a){var b=this.P.ia();if(b){var c=this.sa,d=c.heading,e=c.Ca,f=c.pitch+c.Es/180*Math.PI,d=d-c.Pf/180*Math.PI,g=6378137*-(a.lat-b.lat)/180*Math.PI,i=6378137*(a.lng-b.lng)/180*Math.PI,a=Math.sqrt(Math.pow(g,2)+Math.pow(i,2)),j=Math.cos(f),b=Math.cos(d),d=Math.sin(d),l=-e*j*b,f=e*Math.sin(f),j=e*j*d,m=l*g+-2.08*f+i*j;if(0>m)return q;var m=e*e/m,g=m*g-l,e=-2.08*m-f,m=m*i-j,n=Math.pow(g,2)+Math.pow(e,2)+Math.pow(m,2),i=Math.sqrt(n);0==n?d=b=0:(n= (g*d+m*b)/i,1<n?n=1:-1>n&&(n=-1),n=Math.acos(n),0>g*b*f+e*d*j-e*b*l-m*f*d&&(n=2*Math.PI-n),b=i*Math.cos(n),d=i*Math.sin(n));return{x:c.a/2+b,y:c.bb/2-d,Ca:a}}return q},Fa:function(a,b,c){var d=Math.pow(a,2),e=Math.pow(c,2);return{heading:0<c?Math.PI-Math.acos(a/Math.sqrt(d+e)):Math.PI+Math.acos(a/Math.sqrt(d+e)),pitch:Math.asin(b/Math.sqrt(d+Math.pow(b,2)+e))}},Hk:function(a,b){var c=a.pb.x,d=a.pb.y,e=a.qb.y,f=a.rb.y,g=b.pb.x,i=b.pb.y,j=b.qb.x,l=b.qb.y,m=b.rb.x,n=b.rb.y,s=e-d,u=f-d,w=a.qb.x-c,y=a.rb.x- c,s=e-d,u=f-d,e=m-g,l=l-i,j=j-g,n=n-i,f=y*s-w*u,s=[(e*s-j*u)/f,(n*s-l*u)/f,(e*w-j*y)/-f,(l*y-n*w)/f];s[4]=g-s[0]*c-s[2]*d;s[5]=i-s[3]*d-s[1]*c;return s}});function bk(a){this.P=a;this.Ya=this.ea=p;this.Xv=0;this.ci=a.ci;this.YA=new $j;this.Zg={};this.Go={};this.cp={gi:0.0010,width:0,height:0,heading:0,pitch:0};this.P.sa=this;this.NH=0;this.Ud={};this.ca()} x.extend(bk.prototype,{ca:function(){var a=this,b=a.P;b.addEventListener("size_changed",function(){a.Ud={}});b.addEventListener("zoom_changed_inner",function(){a.Ud={}})},setData:function(a){if(!this.ea||!(a&&a.id==this.ea.id))a?(this.Np(),this.Rl=this.ea?this.ea.id:p,this.LB=this.ea?this.ea.tiles.dirNorth:p,this.lJ=this.UA||p):this.LB=this.Rl=p,this.VJ=q,this.Ud={},this.ea=a,this.UA=this.P.Fa().heading},Np:function(){if($e()){var a=this.P.ww.style,b=this.P.xw.style;a.hc=a.WebkitTransition="";b.hc= b.WebkitTransition="";a.visibility=b.visibility="hidden";a.opacity=b.opacity="0"}for(var c in this.Zg)this.Go[c]=this.Zg[c],this.Go[c].style.zIndex="0"},va:function(a,b,c){if(this.ea){var d=a.heading,e=a.pitch,f=this.P,g,i,j,l,m,n;this.Ud[this.ea.id]?(f=this.Ud[this.ea.id],i=f.Pf,j=f.kP,l=f.mP,m=f.iL,g=f.gi,n=f.UC,f=f.TC):(g=this.ea.tiles,i=g.dirNorth,n=f.Ga().clientWidth,f=f.Ga().clientHeight,j=g.Bp(b),l=g.dy(b),m=360/j,g=360/(j*c),this.Ud[this.ea.id]={Pf:i,kP:j,mP:l,iL:m,gi:g,UC:n,TC:f},this.eR()); this.lJ=this.UA||p;this.UA=d;$e()&&this.dV(d,e,b,c,g,n,f,i,j,l);this.$g=c;i+=d;j=90-e;var e=Math.floor(i/m),d=Math.floor(j/m),s=n/2;i=Math.round(s-i%m/g);0>e&&(i-=c);j=Math.round(f/2-j%m/g);var u,w;this.LB&&(u=this.LB+this.lJ,w=Math.round(s-u%m/g),u=Math.floor(u/m));u&&0>u&&(w-=c);m=d-Math.ceil(j/c);s=d+Math.ceil((f-j-c)/c);m=0>m?0:m;var s=s>l-1?l-1:s,y=e+Math.ceil((n-i-c)/c);l=[];for(var D={},c=e-Math.ceil(i/c);c<=y;c++)for(var C=m;C<=s;C++)l.push([c,C]),D[this.$q(this.ea.id,c,C,b)]=o;for(F in this.Zg)if(!D[F]&& !this.Go[F]&&(c=this.Zg[F]))c.style.display="none";this.Xv+=l.length;l.sort(function(a){return function(b,c){return 0.4*Math.abs(b[0]-a[0])+0.6*Math.abs(b[1]-a[1])-(0.4*Math.abs(c[0]-a[0])+0.6*Math.abs(c[1]-a[1]))}}([e,d]));for(c=0;c<l.length;c++)this.eV(l[c][0],l[c][1],b,e,d,i,j,u,w);this.cp.gi=g;this.cp.width=n;this.cp.height=f;this.cp.heading=a.heading;this.cp.pitch=a.pitch}else{for(var F in this.Zg)(c=this.Zg[F])&&c.parentNode&&c.parentNode.removeChild(c),delete this.Zg[F];$e()&&(a=this.P.ww, b=this.P.xw,a&&(a.src=b.src="",a.style.visibility=b.style.visibility="hidden"))}},dV:function(a,b,c,d,e,f,g,i,j,l){var c=this.P.ww,m=this.P.xw,n=this,d=[j*d,l*d];if(!this.VJ||d!==this.NH)this.VJ=o,c.style.hc=c.style.WebkitTransition=m.style.hc=m.style.WebkitTransition="opacity 300ms ease-out",c.style.width=m.style.width=d[0]+"px",c.style.height=m.style.height=d[1]+"px",c.style.RV=m.style.RV=d[0]+"px, "+d[1]+"px",c.style.left=Math.round((0-i-a)/e+f/2)+"px",m.style.left=parseInt(c.style.left)+d[0]+ "px",c.onload=function(){-1!=this.src.indexOf("pos=0_0&z=1")&&n.P.dispatchEvent(new N("onthumbnail_complete"))},j="//mapsv0.bdimg.com/scape/?qt=pdata&sid="+this.ea.id+"&pos=0_0&z=1&from=JSAPI",c.src!=j&&(c.src=m.src=j);this.NH=d;a=Math.round((0-i-a)%360/e+f/2);c.style.top=m.style.top=Math.round(-(90-b)/e+g/2)+"px";0<a&&0>a-d[0]?(c.style.left=a+"px",m.style.left=parseInt(c.style.left)-d[0]+"px"):0<=a-d[0]?(m.style.left=a-d[0]+"px",c.style.left=parseInt(m.style.left)-d[0]+"px"):a+d[0]<f&&0<=a+d[0]? (c.style.left=a+"px",m.style.left=parseInt(c.style.left)+d[0]+"px"):0>a+d[0]?(m.style.left=a+d[0]+"px",c.style.left=parseInt(m.style.left)+d[0]+"px"):(c.style.left=a+"px",m.style.left=a+d[0]+"px")},eV:function(a,b,c,d,e,f,g,i,j){var l=this.ea.tiles,m=this.$g,n=l.Bp(c),s=this.Go[this.$q(this.Rl,a,b,c)];s&&(s=s.style,s.top=Math.round((b-e)*m+g)+"px",s.left=Math.round((a-(i||d))*m+(j||f))+"px",s.width=s.height=Math.ceil(m)+"px");var i=this.$q(this.ea.id,a,b,c),u=this.Zg[i];if(u)l=u.style,l.top=Math.round((b- e)*m+g)+"px",l.left=Math.round((a-d)*m+f)+"px",l.width=l.height=Math.ceil(m)+"px",l.zIndex="2",l.display="",this.zf(),u.jC.x=a,u.jC.y=b;else{u=this.YA.Px();u.setAttribute("errorCount",0);for(j=a;0>j;)j=n+j;var w=l.getTilesUrl(this.ea.id,new R((j+n)%n,b),c),y=this;u.onload=function(){y.zf();y.ci.appendChild(this);u.style.opacity="1"};u.onerror=function(){var a=this,b=a.getAttribute("errorCount");if(b<3){b++;setTimeout(function(){a.src=w},100);a.setAttribute("errorCount",b)}else y.zf()};l=u.style;l.position= "absolute";l.zIndex="2";l.border="none";l.display="";l.WebkitUserSelect="none";l.WebkitUserDrag="none";l.width=l.height=Math.ceil(m)+"px";l.top=Math.round((b-e)*m+g)+"px";l.left=Math.round((a-d)*m+f)+"px";l.opacity="0";l.hc=l.WebkitTransition="opacity 300ms ease-out";u.src=w;0<u.width&&(l.opacity="1");u.jC={id:this.ea.id,zoom:c,x:a,y:b};u.ontouchstart=function(a){a.preventDefault()};this.Zg[i]=u}},nT:function(a){var b=this.Zg[a];b&&(delete b.jC,b.onerror=b.onload=b.ontouchstart=p,b.style.display= "none");delete this.Zg[a];delete this.Go[a];b&&(b.FA=o,b.src="")},Oc:function(a,b){var c=this.cf;this.cf=b;c!=this.cf&&this.Np()},Sk:function(){this.Ud={}},zf:function(){var a=this;this.Xv--;if(0==this.Xv){for(var b in this.Go)(function(){var c=b;setTimeout(function(){a.nT(c)},300)})();this.P.dispatchEvent(new N("ontilesloaded"))}},$q:function(a,b,c,d){var e=this.ea.tiles.Bp(d),f=(b+e)%e;0==d&&(f=(b+2*e)%(2*e));return a+"_"+f+"_"+c+"_"+d},kY:function(a){var b=this.cp,c=this.P.ia();if(c){var d=6378137* -(a.lat-c.lat)/180*Math.PI,e=6378137*(a.lng-c.lng)/180*Math.PI,a=Math.sqrt(Math.pow(d,2)+Math.pow(e,2)),c=b.heading%360-b.gi*b.width/2,f=b.pitch+b.gi*b.height/2,d=this.Fa(d,-2.08,e);return{x:(180*(d.heading%360/Math.PI)-c)/b.gi,y:(f-180*(d.pitch/Math.PI))/b.gi,Ca:a}}return q},Fa:function(a,b,c){var d=Math.pow(a,2),e=Math.pow(c,2);return{heading:0<c?Math.PI-Math.acos(a/Math.sqrt(d+e)):Math.PI+Math.acos(a/Math.sqrt(d+e)),pitch:Math.asin(b/Math.sqrt(d+Math.pow(b,2)+e))}},eR:function(){var a=this.P,b= a.jh().height/2*this.Ud[this.ea.id].gi;a.V_(-90+b,90-b)}});function Tj(a){this.P=a;a.oB=this;this.ag=[];this.yH=[];this.Uq=[];this.xH=[];this.yl=[];this.zI=[];this.vw=[];this.sF=this.eJ=this.dJ=this.vv=this.uv=0;this.ZK={};this.Xt=this.zy=q;Pb()?this.hf=this.uA():Qb()?(this.Xa=this.rA(),this.Mh=this.Xa.getContext("2d"),this.PQ(),this.ro=[]):Ob()&&(this.Gw=this.LR());this.Ya=p;this.Dz="#549eef";this.Ud={};this.mo=this.bk=o;this.ca()} var ek=[[0,-11],[4,-6.5],[2,-6.5],[2,-3],[-2,-3],[-2,-6.5],[-4,-6.5]],fk=[[5,-2],[5,-12],[-5,-12],[-5,-2]],gk=[[0,-110],[40,-65],[20,-65],[20,-30],[-20,-30],[-20,-65],[-40,-65]],hk=[[45,-20],[45,-120],[-45,-120],[-45,-20]],ik="\\u5317 \\u4e1c\\u5317 \\u4e1c \\u4e1c\\u5357 \\u5357 \\u897f\\u5357 \\u897f \\u897f\\u5317 \\u5317".split(" "); x.extend(Tj.prototype,{uA:function(){var a=H("svg",{version:"1.1",overflow:"hidden"},"http://www.w3.org/2000/svg"),b=this.P,c=b.Ga().clientWidth,d=b.Ga().clientHeight;this.hf=a;this.uv=c;this.vv=d;this.dJ=b.Ga().offsetLeft||0;this.eJ=b.Ga().offsetTop||0;this.IJ(c,d);a.style.position="absolute";a.style.left="0";a.style.top="0";a.style.WebkitUserSelect=a.style.iQ=a.style.MozUserSelect="none";b.ck.appendChild(a);Pb()&&"cvsRender"==this.P.kk&&this.P_(a);return a},P_:function(a){var b=this,c=H("ellipse", {fill:"white","fill-rule":"evenodd","fill-opacity":"0.4",cx:"100",cy:"100",rx:"20",ry:"20"},"http://www.w3.org/2000/svg");c.setAttribute("visibility","hidden");this.GD=c;a.appendChild(c);a=this.P.Ga();x.M(a,"mousedown",function(a){b.sF=(new Date).valueOf();b.u_(a.offsetX||a.layerX||0,a.offsetY||a.layerY||0)});x.M(a,"mouseup",function(){200>(new Date).valueOf()-b.sF&&(b.zy&&b.P.k.visible)&&b.click();b.sF=0});x.M(a,"mousemove",function(a){b.v_(a.offsetX||a.layerX||0,a.offsetY||a.layerY||0);b.J_(a.offsetX|| a.layerX||0,a.offsetY||a.layerY||0)});x.da.Te?x.M(a,"mouseout",function(a){var c=a.clientX||a.pageX||0,a=a.clientY||a.pageY||0,c=c-b.dJ,a=a-b.eJ;(40>Math.abs(Math.abs(c-b.uv/2)-b.uv/2)||40>Math.abs(Math.abs(a-b.vv/2)-b.vv/2))&&b.GD.setAttribute("visibility","hidden")}):x.M(a,"mouseout",function(){b.GD.setAttribute("visibility","hidden")});b.P.addEventListener("hide_ellipse",function(){b.Xt=o});b.P.addEventListener("show_ellipse",function(){b.Xt=q})},rA:function(){var a=H("canvas"),b=this.P,c=b.Ga().clientWidth, d=b.Ga().clientHeight;this.Xa=a;a.width=c;a.height=d;var e=a.style;e.position="absolute";e.top=e.left="0";e.width=c+"px";e.height=d+"px";e.F1="rgba(0, 0, 0, 0)";b.ck.appendChild(a);return a},LR:function(){var a=this.P.Ga(),b=a.clientWidth,a=a.clientHeight;return Db(this.P.ck,[\'<v:group style="behavior:url(#default#VML);z-index:1;width:\',b+"px;height:"+a+\'px;position:absolute;left:0;top:0;"\',\'coordsize="\'+b+","+a+\'" \',\'coordorigin="-\'+b/2+",-"+0.75*a+\'">\',"</v:group>"].join(""))},ca:function(){var a= this,b=a.P;b.addEventListener("size_changed",function(b){b=b.size;a.Ce(b.width,b.height);a.Ud={}});b.addEventListener("zoom_changed_inner",function(){a.Ud={}})},Ce:function(a,b){if(Pb())this.IJ(a,b);else if(Qb()){var c=this.Xa;c.width=a;c.height=b;c.style.width=a+"px";c.style.height=b+"px"}},IJ:function(a,b){this.hf&&(this.hf.setAttribute("width",a+"px"),this.hf.setAttribute("height",b+"px"),this.hf.setAttribute("viewBox","0 0 "+a+" "+b),this.uv=a,this.vv=b)},setData:da("ea"),va:function(a,b,c,d){if(this.ea){this.Ea= a;this.Kc=b;this.$g=c;var e=(a.heading+360)%360,a=a.pitch,f=this.P,g=this.ea.tiles,i,j,l;this.Ud[this.ea.id]?(c=this.Ud[this.ea.id],i=c.UC,j=c.TC,c=c.gi):(i=f.Ga().clientWidth,j=f.Ga().clientHeight,l=g.Bp(b),b=g.dy(b),c=360/(l*c),this.Ud[this.ea.id]={UC:i,TC:j,kP:l,mP:b,iL:360/l,gi:c});f=f.ga()+1;f=0.75*j+1*(a/c)/f;f<j/2&&(f=j/2);j=(90-a)/200;c=10;Pb()?this.nJ(this.ea.id,this.ea.links):Qb()?(this.Mh.clearRect(0,0,this.Xa.width,this.Xa.height),this.ea.id!=this.Ya&&(this.ro.length=0)):Ob()&&(c=36,this.qU(this.ea.id, this.ea.links));for(l=0;l<this.ea.links.length;l++){var b=this.ea.links[l].dir-e,b=(360+b)%360,g=i/2+50*Math.sin(Tb(b)),m=f-60*Math.cos(Tb(b))*j;if(Pb())this.WR(l,[i/2,f],[c,c*j],b),this.gS(l,[g,m]);else if(Qb()){var n="#444";d==l&&(n=this.Dz);this.RH([i/2,f+3],[c,c*j],b,"#000",0.4);this.RH([i/2,f],[c,c*j],b,"#fff",0.95,n);this.hS(l,[g,m],n);b=[i/2+60*Math.sin(Tb(b)),f-50*Math.cos(Tb(b))*j];this.ro[l]=[Math.round(b[0]),Math.round(b[1])]}else Ob()&&(g=1,-30<a&&(g=80>a- -30?g+Math.tan(Tb(a- -30)):g+ 6),g=-Math.sin(Tb(Math.min(a,-30)))/g,this.Gw.coordorigin=Math.round(-i/2)+","+Math.round(-f+40),this.XR(l,b,g))}}else Pb()?this.nJ(p,[]):(this.Mh.clearRect(0,0,this.Xa.width,this.Xa.height),this.ro.length=0)},nJ:function(a,b){if(a!=this.Ya){this.Ya=a;linksCount=b.length;if(linksCount>this.ag.length){for(var c=linksCount-this.ag.length,d=this.hf,e=0;e<c;e++){var f=H("path",{fill:"black","fill-rule":"evenodd","fill-opacity":"0.4",stroke:"none"},"http://www.w3.org/2000/svg"),g=H("path",{fill:"white", "fill-rule":"evenodd","fill-opacity":"0.9",stroke:"#444","stroke-width":"0.2","stroke-linecap":"round"},"http://www.w3.org/2000/svg"),i=["M"],j=ek;i.push(j[0][0]);i.push(j[0][1]);for(var l=1;l<j.length;l++)i.push("L"),i.push(j[l][0]),i.push(j[l][1]);i.push(j[0][0]);i.push(j[0][1]);f.setAttribute("d",i.join(" "));this.Uq.push(f);d.appendChild(f);g.setAttribute("d",i.join(" "));this.ag.push(g);d.appendChild(g);l=H("text",{fill:"#444","fill-rule":"evenodd",stroke:"none","font-size":"16px","font-family":"arial", "text-anchor":"middle","alignment-baseline":"middle"},"http://www.w3.org/2000/svg");l.style.WebkitUserSelect=l.style.iQ=l.style.MozUserSelect="none";this.vw.push(l);d.appendChild(l);var f=H("path",{fill:"white","fill-rule":"evenodd","fill-opacity":"0",stroke:"none",cursor:"pointer"},"http://www.w3.org/2000/svg"),m=this;f.vH=g;f.UJ=l;f.style.MozUserSelect="none";g=["M"];i=fk;g.push(i[0][0]);g.push(i[0][1]);for(l=1;l<i.length;l++)g.push("L"),g.push(i[l][0]),g.push(i[l][1]);f.setAttribute("d",g.join(" ")); x.M(f,J()?"touchstart":"mousedown",function(a){m.Jo={heading:m.Ea.heading,pitch:m.Ea.pitch};m.hr=this;this.vH.setAttribute("stroke",m.Dz);this.UJ.setAttribute("fill",m.Dz);Gb(a)});this.yl.push(f);d.appendChild(f);x.M(f,"mousemove",function(){m.Xt=o});x.M(f,"mouseout",function(){m.Xt=q})}x.M(this.P.C,J()?"touchend":"mouseup",function(a){if(m.hr){if(m.Ea.heading==m.Jo.heading&&m.Ea.pitch==m.Jo.pitch){var b=m.hr.getAttribute("sid");b&&(m.P.dispatchEvent(new N("onlinkclick")),m.P.rc(b));m.q2=m.r2=p}m.hr.vH.setAttribute("stroke", "#444");m.hr.UJ.setAttribute("fill","#444");m.Jo=p;m.hr=p;a.stopPropagation()}})}for(e=0;e<this.ag.length;e++)c="",e<linksCount?(d=this.vw[e],0<d.childNodes.length&&d.removeChild(d.childNodes[0]),l=this.iI(b[e].dir),d.appendChild(document.createTextNode(l)),this.yl[e].setAttribute("sid",b[e].id)):c="none",this.ag[e].style.display=c,this.Uq[e].style.display=c,this.vw[e].style.display=c,this.yl[e].style.display=c}},PQ:function(){var a=this,b=a.P;x.M(this.Xa,"touchstart",function(b){a.Jo={heading:a.Ea.heading, pitch:a.Ea.pitch};var d=Fb(a.Xa);a.Lv=a.cM(b.touches[0].clientX-d.left,b.touches[0].clientY-d.top);a.va(a.Ea,a.Kc,a.$g,a.Lv)});x.M(this.Xa,"touchend",function(){a.Ea.heading==a.Jo.heading&&a.Ea.pitch==a.Jo.pitch&&a.ea.links[a.Lv]&&(b.dispatchEvent(new N("onlinkclick")),b.rc(a.ea.links[a.Lv].id));a.Lv=p})},cM:function(a,b){for(var c=0;c<this.ro.length;c++)if(30>Math.abs(a-this.ro[c][0])&&30>Math.abs(b-this.ro[c][1]))return c;return-1},qU:function(a,b){if(a!=this.Ya){this.Ya=a;linksCount=b.length;if(linksCount> this.ag.length)for(var c=linksCount-this.ag.length,d=0;d<c;d++){for(var e=[],f=gk,g=0;g<f.length;g++)e.push(f[g][0]),e.push(f[g][1]);e.push(f[0][0]);e.push(f[0][1]);g=Db(this.Gw,["<v:polyline ",\'points="\'+e.join(" ")+\'"\',\' style="behavior:url(#default#VML);z-index:1;left:0;top:0;" stroked="false"><v:fill style="behavior:url(#default#VML)" color="black" opacity="0.5"></v:fill><v:skew style="behavior:url(#default#VML)" on="true" origin="0,1.5" matrix="1,0,0,1,0,0" offset="0,0.05"></v:skew></v:polyline>\'].join("")); this.Uq.push(g);this.xH.push(g.getElementsByTagName("skew")[0]);g=Db(this.Gw,["<v:polyline ",\'points="\'+e.join(" ")+\'"\',\'fillcolor="white" stroked="true" strokecolor="#444" strokeweight="1" style="behavior:url(#default#VML);z-index:2;left:0;top:0;"><v:fill style="behavior:url(#default#VML)" color="white" opacity="1"></v:fill><v:skew style="behavior:url(#default#VML)" on="true" origin="0,1.5" matrix="1,0,0,1,0,0" offset="0,0"></v:skew></v:polyline>\'].join(""));this.ag.push(g);this.yH.push(g.getElementsByTagName("skew")[0]); e=[];f=hk;for(g=0;g<f.length;g++)e.push(f[g][0]),e.push(f[g][1]);var g=Db(this.Gw,[\'<v:polyline style="cursor:pointer;z-index:3;behavior:url(#default#VML);"\',\' points="\'+e.join(" ")+\'" stroked="false">\',\'<v:fill style="behavior:url(#default#VML);" color="white" opacity="0"></v:fill><v:skew style="behavior:url(#default#VML);" on="true" origin="0,1.2" matrix="1,0,0,1,0,0"></v:skew></v:polyline>\'].join("")),i=this;x.M(g,"click",function(a){(a=a.srcElement.sid)&&i.P.rc(a)});this.yl.push(g);this.zI.push(g.getElementsByTagName("skew")[0])}for(d= 0;d<this.ag.length;d++)c="",d<linksCount?this.yl[d].sid=b[d].id:c="none",this.ag[d].style.display=c,this.Uq[d].style.display=c,this.yl[d].style.display=c}},WR:function(a,b,c,d){this.ag[a]&&(this.ag[a].setAttribute("transform","translate("+b[0]+" "+b[1]+")scale("+c[0]+" "+c[1]+")rotate("+d+")"),this.Uq[a].setAttribute("transform","translate("+b[0]+" "+(b[1]+4)+")scale("+c[0]+" "+c[1]+")rotate("+d+")"),this.yl[a].setAttribute("transform","translate("+b[0]+" "+b[1]+")scale("+c[0]+" "+c[1]+")rotate("+ d+")"))},gS:function(a,b){this.vw[a].setAttribute("transform","translate("+b[0]+" "+b[1]+")")},XR:function(a,b,c){this.Xz(this.yH[a],b,0,c);this.Xz(this.xH[a],b,0.6,c);this.Xz(this.zI[a],b,0,c)},Xz:function(a,b,c,d){var e=Tb(b),b=Math.cos(e),e=Math.sin(e);a.matrix=[Number(b).toFixed(4),Number(-e).toFixed(4),Number(e*d).toFixed(4),Number(b*d).toFixed(4),0,0].join();a.offset="0,"+Math.round(50*c)/1E3},RH:function(a,b,c,d,e,f){var g=this.Mh;g.save();g.fillStyle=d;g.globalAlpha=e;g.translate(a[0],a[1]); g.scale(b[0],b[1]);g.rotate(Tb(c));g.beginPath();g.moveTo(ek[0][0],ek[0][1]);for(a=1;a<ek.length;a++)g.lineTo(ek[a][0],ek[a][1]);g.closePath();g.fill();f&&(g.lineWidth="0.2",g.lineCap="round",g.lineJoin="round",g.strokeStyle=f,g.stroke());g.restore()},hS:function(a,b,c){var d=this.Mh;d.save();a=this.iI(this.ea.links[a].dir);d.font="16px sans-serif";d.textAlign="center";d.textBaseline="middle";d.fillStyle=c;d.fillText(a,b[0],b[1]);d.restore()},iI:function(a){return ik[Math.ceil(Math.floor((a+360)% 360/22.5)/2)]},tM:ea(0),click:function(){if(!(2<Math.abs(this.fX-this.BZ)||2<Math.abs(this.oL-this.oL))){var a=this.ZK;if(a){for(var b=this.ea.links,c=this.XX(a.hH,a.iH),d=30,e=0,f=0;f<b.length;f++)e=b[f].dir-c,e=180<Math.abs(e)?b[f].dir>c?360+c-b[f].dir:360-c+b[f].dir:Math.abs(e),e<d&&(d=e);29>d&&(b=this.P.ia(),this.P.ta(new O(b.lng+180*a.iH/Math.PI/6378137,b.lat-180*a.hH/Math.PI/6378137)))}}},u_:function(a,b){this.fX=a;this.oL=b},v_:da("BZ"),J_:function(a,b){this.ZK=coord=this.P.sa.jE(a,b);var c= this.GD;if(coord&&!this.Xt&&this.P.k.visible){c.setAttribute("cx",a);c.setAttribute("cy",b);var d=Math.abs(2*coord.RF/(coord.Ca-2)-2*coord.RF/(coord.Ca+2))/2,e=2*coord.RF/coord.Ca;if(4<coord.Ca){if(100<e){var f=e/100,e=100,d=d/f;d>e&&(d=e)}c.setAttribute("rx",e);c.setAttribute("ry",d);c.setAttribute("visibility","visible");this.zy=o}else this.zy=q,c.setAttribute("visibility","hidden")}else this.zy=q,c.setAttribute("visibility","hidden")},XX:function(a,b){var c=0;0<a?c=180*(Math.atan(b/a)/Math.PI): 0>a?c=180*(Math.atan(b/a)/Math.PI)+180:0==a&&(c=0<b?90:-90);heading=180-c;360<heading?heading-=360:0>heading&&(heading+=360);return heading},U:function(){this.bk=q;this.P.ck&&(this.P.ck.style.visibility="hidden")},show:function(){this.bk=o;this.P.ck&&(this.P.ck.style.visibility="visible")},JD:function(){this.mo=o},mD:function(){this.mo=q}});var jk={get:function(a,b){var c="inst_"+b;jk[c]||(jk[c]=new kk(a));return jk[c]}};function kk(a){this.ib=a;this.jv=new Uint8Array(16);this.qr=new Uint8Array(16)}x.extend(kk.prototype,{NE:function(){for(var a=0,b=this.jv.length;a<b;a++)this.jv[a]=0},jp:function(a){this.jv[a]=1;0===this.qr[a]&&(this.ib.enableVertexAttribArray(a),this.qr[a]=1)},pD:function(){for(var a=0,b=this.qr.length;a<b;a++)this.qr[a]!==this.jv[a]&&(this.ib.disableVertexAttribArray(a),this.qr[a]=0)}});if(!lk)var lk=1.0E-6;if(!mk)var mk="undefined"!==typeof Float32Array?Float32Array:Array;if(!nk)var nk=Math.random;var ok={t5:function(a){mk=a}};"undefined"!==typeof exports&&(exports.d4=ok);var pk=Math.PI/180;ok.D5=function(a){return a*pk}; var qk={create:function(){var a=new mk(2);a[0]=0;a[1]=0;return a},ji:function(a){var b=new mk(2);b[0]=a[0];b[1]=a[1];return b},tg:function(a,b){var c=new mk(2);c[0]=a;c[1]=b;return c},copy:function(a,b){a[0]=b[0];a[1]=b[1];return a},set:function(a,b,c){a[0]=b;a[1]=c;return a},add:function(a,b,c){a[0]=b[0]+c[0];a[1]=b[1]+c[1];return a},Gu:function(a,b,c){a[0]=b[0]-c[0];a[1]=b[1]-c[1];return a}};qk.sub=qk.Gu;qk.multiply=function(a,b,c){a[0]=b[0]*c[0];a[1]=b[1]*c[1];return a};qk.gn=qk.multiply; qk.Us=function(a,b,c){a[0]=b[0]/c[0];a[1]=b[1]/c[1];return a};qk.mL=qk.Us;qk.min=function(a,b,c){a[0]=Math.min(b[0],c[0]);a[1]=Math.min(b[1],c[1]);return a};qk.max=function(a,b,c){a[0]=Math.max(b[0],c[0]);a[1]=Math.max(b[1],c[1]);return a};qk.scale=function(a,b,c){a[0]=b[0]*c;a[1]=b[1]*c;return a};qk.xO=function(a,b,c,d){a[0]=b[0]+c[0]*d;a[1]=b[1]+c[1]*d;return a};qk.od=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)};qk.Ca=qk.od; qk.Du=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d};qk.TO=qk.Du;qk.length=function(a){var b=a[0],a=a[1];return Math.sqrt(b*b+a*a)};qk.hF=qk.length;qk.Zk=function(a){var b=a[0],a=a[1];return b*b+a*a};qk.lG=qk.Zk;qk.FN=function(a,b){a[0]=-b[0];a[1]=-b[1];return a};qk.normalize=function(a,b){var c=b[0],d=b[1],c=c*c+d*d;if(c>0){c=1/Math.sqrt(c);a[0]=b[0]*c;a[1]=b[1]*c}return a};qk.Xs=function(a,b){return a[0]*b[0]+a[1]*b[1]};qk.sx=function(a,b,c){b=b[0]*c[1]-b[1]*c[0];a[0]=a[1]=0;a[2]=b;return a}; qk.vy=function(a,b,c,d){var e=b[0],b=b[1];a[0]=e+d*(c[0]-e);a[1]=b+d*(c[1]-b);return a};qk.random=function(a,b){var b=b||1,c=nk()*2*Math.PI;a[0]=Math.cos(c)*b;a[1]=Math.sin(c)*b;return a};qk.J5=function(a,b,c){var d=b[0],b=b[1];a[0]=c[0]*d+c[2]*b;a[1]=c[1]*d+c[3]*b;return a};qk.K5=function(a,b,c){var d=b[0],b=b[1];a[0]=c[0]*d+c[2]*b+c[4];a[1]=c[1]*d+c[3]*b+c[5];return a};qk.H0=function(a,b,c){var d=b[0],b=b[1];a[0]=c[0]*d+c[3]*b+c[6];a[1]=c[1]*d+c[4]*b+c[7];return a}; qk.oP=function(a,b,c){var d=b[0],b=b[1];a[0]=c[0]*d+c[4]*b+c[12];a[1]=c[1]*d+c[5]*b+c[13];return a};qk.forEach=function(){var a=qk.create();return function(b,c,d,e,f,g){c||(c=2);d||(d=0);for(e=e?Math.min(e*c+d,b.length):b.length;d<e;d=d+c){a[0]=b[d];a[1]=b[d+1];f(a,a,g);b[d]=a[0];b[d+1]=a[1]}return b}}();qk.Dn=function(a){return"vec2("+a[0]+", "+a[1]+")"};"undefined"!==typeof exports&&(exports.P5=qk); var rk={create:function(){var a=new mk(3);a[0]=0;a[1]=0;a[2]=0;return a},ji:function(a){var b=new mk(3);b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},tg:function(a,b,c){var d=new mk(3);d[0]=a;d[1]=b;d[2]=c;return d},copy:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];return a},set:function(a,b,c,d){a[0]=b;a[1]=c;a[2]=d;return a},add:function(a,b,c){a[0]=b[0]+c[0];a[1]=b[1]+c[1];a[2]=b[2]+c[2];return a},Gu:function(a,b,c){a[0]=b[0]-c[0];a[1]=b[1]-c[1];a[2]=b[2]-c[2];return a}};rk.sub=rk.Gu; rk.multiply=function(a,b,c){a[0]=b[0]*c[0];a[1]=b[1]*c[1];a[2]=b[2]*c[2];return a};rk.gn=rk.multiply;rk.Us=function(a,b,c){a[0]=b[0]/c[0];a[1]=b[1]/c[1];a[2]=b[2]/c[2];return a};rk.mL=rk.Us;rk.min=function(a,b,c){a[0]=Math.min(b[0],c[0]);a[1]=Math.min(b[1],c[1]);a[2]=Math.min(b[2],c[2]);return a};rk.max=function(a,b,c){a[0]=Math.max(b[0],c[0]);a[1]=Math.max(b[1],c[1]);a[2]=Math.max(b[2],c[2]);return a};rk.scale=function(a,b,c){a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;return a}; rk.xO=function(a,b,c,d){a[0]=b[0]+c[0]*d;a[1]=b[1]+c[1]*d;a[2]=b[2]+c[2]*d;return a};rk.od=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return Math.sqrt(c*c+d*d+e*e)};rk.Ca=rk.od;rk.Du=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return c*c+d*d+e*e};rk.TO=rk.Du;rk.length=function(a){var b=a[0],c=a[1],a=a[2];return Math.sqrt(b*b+c*c+a*a)};rk.hF=rk.length;rk.Zk=function(a){var b=a[0],c=a[1],a=a[2];return b*b+c*c+a*a};rk.lG=rk.Zk; rk.FN=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];return a};rk.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],c=c*c+d*d+e*e;if(c>0){c=1/Math.sqrt(c);a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c}return a};rk.Xs=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]};rk.sx=function(a,b,c){var d=b[0],e=b[1],b=b[2],f=c[0],g=c[1],c=c[2];a[0]=e*c-b*g;a[1]=b*f-d*c;a[2]=d*g-e*f;return a};rk.vy=function(a,b,c,d){var e=b[0],f=b[1],b=b[2];a[0]=e+d*(c[0]-e);a[1]=f+d*(c[1]-f);a[2]=b+d*(c[2]-b);return a}; rk.random=function(a,b){var b=b||1,c=nk()*2*Math.PI,d=nk()*2-1,e=Math.sqrt(1-d*d)*b;a[0]=Math.cos(c)*e;a[1]=Math.sin(c)*e;a[2]=d*b;return a};rk.oP=function(a,b,c){var d=b[0],e=b[1],b=b[2];a[0]=c[0]*d+c[4]*e+c[8]*b+c[12];a[1]=c[1]*d+c[5]*e+c[9]*b+c[13];a[2]=c[2]*d+c[6]*e+c[10]*b+c[14];return a};rk.H0=function(a,b,c){var d=b[0],e=b[1],b=b[2];a[0]=d*c[0]+e*c[3]+b*c[6];a[1]=d*c[1]+e*c[4]+b*c[7];a[2]=d*c[2]+e*c[5]+b*c[8];return a}; rk.J0=function(a,b,c){var d=b[0],e=b[1],f=b[2],b=c[0],g=c[1],i=c[2],c=c[3],j=c*d+g*f-i*e,l=c*e+i*d-b*f,m=c*f+b*e-g*d,d=-b*d-g*e-i*f;a[0]=j*c+d*-b+l*-i-m*-g;a[1]=l*c+d*-g+m*-b-j*-i;a[2]=m*c+d*-i+j*-g-l*-b;return a};rk.sO=function(a,b,c,d){var e=[],f=[];e[0]=b[0]-c[0];e[1]=b[1]-c[1];e[2]=b[2]-c[2];f[0]=e[0];f[1]=e[1]*Math.cos(d)-e[2]*Math.sin(d);f[2]=e[1]*Math.sin(d)+e[2]*Math.cos(d);a[0]=f[0]+c[0];a[1]=f[1]+c[1];a[2]=f[2]+c[2];return a}; rk.tO=function(a,b,c,d){var e=[],f=[];e[0]=b[0]-c[0];e[1]=b[1]-c[1];e[2]=b[2]-c[2];f[0]=e[2]*Math.sin(d)+e[0]*Math.cos(d);f[1]=e[1];f[2]=e[2]*Math.cos(d)-e[0]*Math.sin(d);a[0]=f[0]+c[0];a[1]=f[1]+c[1];a[2]=f[2]+c[2];return a};rk.uO=function(a,b,c,d){var e=[],f=[];e[0]=b[0]-c[0];e[1]=b[1]-c[1];e[2]=b[2]-c[2];f[0]=e[0]*Math.cos(d)-e[1]*Math.sin(d);f[1]=e[0]*Math.sin(d)+e[1]*Math.cos(d);f[2]=e[2];a[0]=f[0]+c[0];a[1]=f[1]+c[1];a[2]=f[2]+c[2];return a}; rk.forEach=function(){var a=rk.create();return function(b,c,d,e,f,g){c||(c=3);d||(d=0);for(e=e?Math.min(e*c+d,b.length):b.length;d<e;d=d+c){a[0]=b[d];a[1]=b[d+1];a[2]=b[d+2];f(a,a,g);b[d]=a[0];b[d+1]=a[1];b[d+2]=a[2]}return b}}();rk.Dn=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"};"undefined"!==typeof exports&&(exports.Q5=rk); var Xj={create:function(){var a=new mk(4);a[0]=0;a[1]=0;a[2]=0;a[3]=0;return a},ji:function(a){var b=new mk(4);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},tg:function(a,b,c,d){var e=new mk(4);e[0]=a;e[1]=b;e[2]=c;e[3]=d;return e},copy:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];return a},set:function(a,b,c,d,e){a[0]=b;a[1]=c;a[2]=d;a[3]=e;return a},add:function(a,b,c){a[0]=b[0]+c[0];a[1]=b[1]+c[1];a[2]=b[2]+c[2];a[3]=b[3]+c[3];return a},Gu:function(a,b,c){a[0]=b[0]-c[0];a[1]=b[1]- c[1];a[2]=b[2]-c[2];a[3]=b[3]-c[3];return a}};Xj.sub=Xj.Gu;Xj.multiply=function(a,b,c){a[0]=b[0]*c[0];a[1]=b[1]*c[1];a[2]=b[2]*c[2];a[3]=b[3]*c[3];return a};Xj.gn=Xj.multiply;Xj.Us=function(a,b,c){a[0]=b[0]/c[0];a[1]=b[1]/c[1];a[2]=b[2]/c[2];a[3]=b[3]/c[3];return a};Xj.mL=Xj.Us;Xj.min=function(a,b,c){a[0]=Math.min(b[0],c[0]);a[1]=Math.min(b[1],c[1]);a[2]=Math.min(b[2],c[2]);a[3]=Math.min(b[3],c[3]);return a}; Xj.max=function(a,b,c){a[0]=Math.max(b[0],c[0]);a[1]=Math.max(b[1],c[1]);a[2]=Math.max(b[2],c[2]);a[3]=Math.max(b[3],c[3]);return a};Xj.scale=function(a,b,c){a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;a[3]=b[3]*c;return a};Xj.xO=function(a,b,c,d){a[0]=b[0]+c[0]*d;a[1]=b[1]+c[1]*d;a[2]=b[2]+c[2]*d;a[3]=b[3]+c[3]*d;return a};Xj.od=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return Math.sqrt(c*c+d*d+e*e+f*f)};Xj.Ca=Xj.od; Xj.Du=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return c*c+d*d+e*e+f*f};Xj.TO=Xj.Du;Xj.length=function(a){var b=a[0],c=a[1],d=a[2],a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)};Xj.hF=Xj.length;Xj.Zk=function(a){var b=a[0],c=a[1],d=a[2],a=a[3];return b*b+c*c+d*d+a*a};Xj.lG=Xj.Zk;Xj.FN=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];a[3]=-b[3];return a}; Xj.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],c=c*c+d*d+e*e+f*f;if(c>0){c=1/Math.sqrt(c);a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;a[3]=b[3]*c}return a};Xj.Xs=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};Xj.vy=function(a,b,c,d){var e=b[0],f=b[1],g=b[2],b=b[3];a[0]=e+d*(c[0]-e);a[1]=f+d*(c[1]-f);a[2]=g+d*(c[2]-g);a[3]=b+d*(c[3]-b);return a};Xj.random=function(a,b){b=b||1;a[0]=nk();a[1]=nk();a[2]=nk();a[3]=nk();Xj.normalize(a,a);Xj.scale(a,a,b);return a}; Xj.oP=function(a,b,c){var d=b[0],e=b[1],f=b[2],b=b[3];a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*b;a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*b;a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*b;a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*b;return a};Xj.J0=function(a,b,c){var d=b[0],e=b[1],f=b[2],b=c[0],g=c[1],i=c[2],c=c[3],j=c*d+g*f-i*e,l=c*e+i*d-b*f,m=c*f+b*e-g*d,d=-b*d-g*e-i*f;a[0]=j*c+d*-b+l*-i-m*-g;a[1]=l*c+d*-g+m*-b-j*-i;a[2]=m*c+d*-i+j*-g-l*-b;return a}; Xj.forEach=function(){var a=Xj.create();return function(b,c,d,e,f,g){c||(c=4);d||(d=0);for(e=e?Math.min(e*c+d,b.length):b.length;d<e;d=d+c){a[0]=b[d];a[1]=b[d+1];a[2]=b[d+2];a[3]=b[d+3];f(a,a,g);b[d]=a[0];b[d+1]=a[1];b[d+2]=a[2];b[d+3]=a[3]}return b}}();Xj.Dn=function(a){return"vec4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"};"undefined"!==typeof exports&&(exports.R5=Xj); var sk={create:function(){var a=new mk(4);a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},ji:function(a){var b=new mk(4);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},copy:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];return a},Wm:function(a){a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},qP:function(a,b){if(a===b){var c=b[1];a[1]=b[2];a[2]=c}else{a[0]=b[0];a[1]=b[2];a[2]=b[1];a[3]=b[3]}return a},Jp:function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*f-e*d;if(!g)return p;g=1/g;a[0]=f*g;a[1]=-d*g;a[2]=-e*g; a[3]=c*g;return a},vK:function(a,b){var c=b[0];a[0]=b[3];a[1]=-b[1];a[2]=-b[2];a[3]=c;return a},jD:function(a){return a[0]*a[3]-a[2]*a[1]},multiply:function(a,b,c){var d=b[0],e=b[1],f=b[2],b=b[3],g=c[0],i=c[1],j=c[2],c=c[3];a[0]=d*g+f*i;a[1]=e*g+b*i;a[2]=d*j+f*c;a[3]=e*j+b*c;return a}};sk.gn=sk.multiply;sk.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],b=b[3],g=Math.sin(c),c=Math.cos(c);a[0]=d*c+f*g;a[1]=e*c+b*g;a[2]=d*-g+f*c;a[3]=e*-g+b*c;return a}; sk.scale=function(a,b,c){var d=b[1],e=b[2],f=b[3],g=c[0],c=c[1];a[0]=b[0]*g;a[1]=d*g;a[2]=e*c;a[3]=f*c;return a};sk.Dn=function(a){return"mat2("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"};sk.ZD=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)+Math.pow(a[3],2))};sk.u1=function(a,b,c,d){a[2]=d[2]/d[0];c[0]=d[0];c[1]=d[1];c[3]=d[3]-a[2]*c[1];return[a,b,c]};"undefined"!==typeof exports&&(exports.C4=sk); var tk={create:function(){var a=new mk(6);a[0]=1;a[1]=0;a[2]=0;a[3]=1;a[4]=0;a[5]=0;return a},ji:function(a){var b=new mk(6);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];return b},copy:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];return a},Wm:function(a){a[0]=1;a[1]=0;a[2]=0;a[3]=1;a[4]=0;a[5]=0;return a},Jp:function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],i=b[5],j=c*f-d*e;if(!j)return p;j=1/j;a[0]=f*j;a[1]=-d*j;a[2]=-e*j;a[3]=c*j;a[4]=(e*i-f*g)*j;a[5]= (d*g-c*i)*j;return a},jD:function(a){return a[0]*a[3]-a[1]*a[2]},multiply:function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],i=b[4],b=b[5],j=c[0],l=c[1],m=c[2],n=c[3],s=c[4],c=c[5];a[0]=d*j+f*l;a[1]=e*j+g*l;a[2]=d*m+f*n;a[3]=e*m+g*n;a[4]=d*s+f*c+i;a[5]=e*s+g*c+b;return a}};tk.gn=tk.multiply;tk.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],i=b[4],b=b[5],j=Math.sin(c),c=Math.cos(c);a[0]=d*c+f*j;a[1]=e*c+g*j;a[2]=d*-j+f*c;a[3]=e*-j+g*c;a[4]=i;a[5]=b;return a}; tk.scale=function(a,b,c){var d=b[1],e=b[2],f=b[3],g=b[4],i=b[5],j=c[0],c=c[1];a[0]=b[0]*j;a[1]=d*j;a[2]=e*c;a[3]=f*c;a[4]=g;a[5]=i;return a};tk.translate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],i=b[4],b=b[5],j=c[0],c=c[1];a[0]=d;a[1]=e;a[2]=f;a[3]=g;a[4]=d*j+f*c+i;a[5]=e*j+g*c+b;return a};tk.Dn=function(a){return"mat2d("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}; tk.ZD=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)+Math.pow(a[3],2)+Math.pow(a[4],2)+Math.pow(a[5],2)+1)};"undefined"!==typeof exports&&(exports.D4=tk); var uk={create:function(){var a=new mk(9);a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},n3:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[4];a[4]=b[5];a[5]=b[6];a[6]=b[8];a[7]=b[9];a[8]=b[10];return a},ji:function(a){var b=new mk(9);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},copy:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];return a},Wm:function(a){a[0]= 1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},qP:function(a,b){if(a===b){var c=b[1],d=b[2],e=b[5];a[1]=b[3];a[2]=b[6];a[3]=c;a[5]=b[7];a[6]=d;a[7]=e}else{a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8]}return a},Jp:function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],i=b[5],j=b[6],l=b[7],m=b[8],n=m*g-i*l,s=-m*f+i*j,u=l*f-g*j,w=c*n+d*s+e*u;if(!w)return p;w=1/w;a[0]=n*w;a[1]=(-m*d+e*l)*w;a[2]=(i*d-e*g)*w;a[3]=s*w;a[4]=(m*c-e*j)*w;a[5]= (-i*c+e*f)*w;a[6]=u*w;a[7]=(-l*c+d*j)*w;a[8]=(g*c-d*f)*w;return a},vK:function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],i=b[5],j=b[6],l=b[7],m=b[8];a[0]=g*m-i*l;a[1]=e*l-d*m;a[2]=d*i-e*g;a[3]=i*j-f*m;a[4]=c*m-e*j;a[5]=e*f-c*i;a[6]=f*l-g*j;a[7]=d*j-c*l;a[8]=c*g-d*f;return a},jD:function(a){var b=a[3],c=a[4],d=a[5],e=a[6],f=a[7],g=a[8];return a[0]*(g*c-d*f)+a[1]*(-g*b+d*e)+a[2]*(f*b-c*e)},multiply:function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],i=b[4],j=b[5],l=b[6],m=b[7],b=b[8],n=c[0],s=c[1],u= c[2],w=c[3],y=c[4],D=c[5],C=c[6],F=c[7],c=c[8];a[0]=n*d+s*g+u*l;a[1]=n*e+s*i+u*m;a[2]=n*f+s*j+u*b;a[3]=w*d+y*g+D*l;a[4]=w*e+y*i+D*m;a[5]=w*f+y*j+D*b;a[6]=C*d+F*g+c*l;a[7]=C*e+F*i+c*m;a[8]=C*f+F*j+c*b;return a}};uk.gn=uk.multiply;uk.translate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],i=b[4],j=b[5],l=b[6],m=b[7],b=b[8],n=c[0],c=c[1];a[0]=d;a[1]=e;a[2]=f;a[3]=g;a[4]=i;a[5]=j;a[6]=n*d+c*g+l;a[7]=n*e+c*i+m;a[8]=n*f+c*j+b;return a}; uk.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],i=b[4],j=b[5],l=b[6],m=b[7],b=b[8],n=Math.sin(c),c=Math.cos(c);a[0]=c*d+n*g;a[1]=c*e+n*i;a[2]=c*f+n*j;a[3]=c*g-n*d;a[4]=c*i-n*e;a[5]=c*j-n*f;a[6]=l;a[7]=m;a[8]=b;return a};uk.scale=function(a,b,c){var d=c[0],c=c[1];a[0]=d*b[0];a[1]=d*b[1];a[2]=d*b[2];a[3]=c*b[3];a[4]=c*b[4];a[5]=c*b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];return a};uk.m3=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=0;a[3]=b[2];a[4]=b[3];a[5]=0;a[6]=b[4];a[7]=b[5];a[8]=1;return a}; uk.BX=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c+c,i=d+d,j=e+e,c=c*g,l=d*g,d=d*i,m=e*g,n=e*i,e=e*j,g=f*g,i=f*i,f=f*j;a[0]=1-d-e;a[3]=l-f;a[6]=m+i;a[1]=l+f;a[4]=1-c-e;a[7]=n-g;a[2]=m-i;a[5]=n+g;a[8]=1-c-d;return a}; uk.G4=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],i=b[5],j=b[6],l=b[7],m=b[8],n=b[9],s=b[10],u=b[11],w=b[12],y=b[13],D=b[14],C=b[15],F=c*i-d*g,A=c*j-e*g,z=c*l-f*g,E=d*j-e*i,G=d*l-f*i,P=e*l-f*j,S=m*y-n*w,aa=m*D-s*w,m=m*C-u*w,ba=n*D-s*y,n=n*C-u*y,s=s*C-u*D,u=F*s-A*n+z*ba+E*m-G*aa+P*S;if(!u)return p;u=1/u;a[0]=(i*s-j*n+l*ba)*u;a[1]=(j*m-g*s-l*aa)*u;a[2]=(g*n-i*m+l*S)*u;a[3]=(e*n-d*s-f*ba)*u;a[4]=(c*s-e*m+f*aa)*u;a[5]=(d*m-c*n-f*S)*u;a[6]=(y*P-D*G+C*E)*u;a[7]=(D*z-w*P-C*A)*u;a[8]=(w*G-y*z+C* F)*u;return a};uk.Dn=function(a){return"mat3("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+")"};uk.ZD=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)+Math.pow(a[3],2)+Math.pow(a[4],2)+Math.pow(a[5],2)+Math.pow(a[6],2)+Math.pow(a[7],2)+Math.pow(a[8],2))};"undefined"!==typeof exports&&(exports.E4=uk); var Yj={create:function(){var a=new mk(16);a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},ji:function(a){var b=new mk(16);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},copy:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9]; a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a},Wm:function(a){a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},qP:function(a,b){if(a===b){var c=b[1],d=b[2],e=b[3],f=b[6],g=b[7],i=b[11];a[1]=b[4];a[2]=b[8];a[3]=b[12];a[4]=c;a[6]=b[9];a[7]=b[13];a[8]=d;a[9]=f;a[11]=b[14];a[12]=e;a[13]=g;a[14]=i}else{a[0]=b[0];a[1]=b[4];a[2]=b[8];a[3]=b[12];a[4]=b[1];a[5]=b[5];a[6]=b[9];a[7]=b[13];a[8]=b[2]; a[9]=b[6];a[10]=b[10];a[11]=b[14];a[12]=b[3];a[13]=b[7];a[14]=b[11];a[15]=b[15]}return a},Jp:function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],i=b[5],j=b[6],l=b[7],m=b[8],n=b[9],s=b[10],u=b[11],w=b[12],y=b[13],D=b[14],C=b[15],F=c*i-d*g,A=c*j-e*g,z=c*l-f*g,E=d*j-e*i,G=d*l-f*i,P=e*l-f*j,S=m*y-n*w,aa=m*D-s*w,ba=m*C-u*w,ia=n*D-s*y,Sa=n*C-u*y,Wa=s*C-u*D,Ga=F*Wa-A*Sa+z*ia+E*ba-G*aa+P*S;if(!Ga)return p;Ga=1/Ga;a[0]=(i*Wa-j*Sa+l*ia)*Ga;a[1]=(e*Sa-d*Wa-f*ia)*Ga;a[2]=(y*P-D*G+C*E)*Ga;a[3]=(s*G-n*P-u*E)* Ga;a[4]=(j*ba-g*Wa-l*aa)*Ga;a[5]=(c*Wa-e*ba+f*aa)*Ga;a[6]=(D*z-w*P-C*A)*Ga;a[7]=(m*P-s*z+u*A)*Ga;a[8]=(g*Sa-i*ba+l*S)*Ga;a[9]=(d*ba-c*Sa-f*S)*Ga;a[10]=(w*G-y*z+C*F)*Ga;a[11]=(n*z-m*G-u*F)*Ga;a[12]=(i*aa-g*ia-j*S)*Ga;a[13]=(c*ia-d*aa+e*S)*Ga;a[14]=(y*A-w*E-D*F)*Ga;a[15]=(m*E-n*A+s*F)*Ga;return a},vK:function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],i=b[5],j=b[6],l=b[7],m=b[8],n=b[9],s=b[10],u=b[11],w=b[12],y=b[13],D=b[14],C=b[15];a[0]=i*(s*C-u*D)-n*(j*C-l*D)+y*(j*u-l*s);a[1]=-(d*(s*C-u*D)-n*(e* C-f*D)+y*(e*u-f*s));a[2]=d*(j*C-l*D)-i*(e*C-f*D)+y*(e*l-f*j);a[3]=-(d*(j*u-l*s)-i*(e*u-f*s)+n*(e*l-f*j));a[4]=-(g*(s*C-u*D)-m*(j*C-l*D)+w*(j*u-l*s));a[5]=c*(s*C-u*D)-m*(e*C-f*D)+w*(e*u-f*s);a[6]=-(c*(j*C-l*D)-g*(e*C-f*D)+w*(e*l-f*j));a[7]=c*(j*u-l*s)-g*(e*u-f*s)+m*(e*l-f*j);a[8]=g*(n*C-u*y)-m*(i*C-l*y)+w*(i*u-l*n);a[9]=-(c*(n*C-u*y)-m*(d*C-f*y)+w*(d*u-f*n));a[10]=c*(i*C-l*y)-g*(d*C-f*y)+w*(d*l-f*i);a[11]=-(c*(i*u-l*n)-g*(d*u-f*n)+m*(d*l-f*i));a[12]=-(g*(n*D-s*y)-m*(i*D-j*y)+w*(i*s-j*n));a[13]=c*(n* D-s*y)-m*(d*D-e*y)+w*(d*s-e*n);a[14]=-(c*(i*D-j*y)-g*(d*D-e*y)+w*(d*j-e*i));a[15]=c*(i*s-j*n)-g*(d*s-e*n)+m*(d*j-e*i);return a},jD:function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],i=a[6],j=a[7],l=a[8],m=a[9],n=a[10],s=a[11],u=a[12],w=a[13],y=a[14],a=a[15];return(b*g-c*f)*(n*a-s*y)-(b*i-d*f)*(m*a-s*w)+(b*j-e*f)*(m*y-n*w)+(c*i-d*g)*(l*a-s*u)-(c*j-e*g)*(l*y-n*u)+(d*j-e*i)*(l*w-m*u)},multiply:function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],i=b[4],j=b[5],l=b[6],m=b[7],n=b[8],s=b[9],u=b[10],w= b[11],y=b[12],D=b[13],C=b[14],b=b[15],F=c[0],A=c[1],z=c[2],E=c[3];a[0]=F*d+A*i+z*n+E*y;a[1]=F*e+A*j+z*s+E*D;a[2]=F*f+A*l+z*u+E*C;a[3]=F*g+A*m+z*w+E*b;F=c[4];A=c[5];z=c[6];E=c[7];a[4]=F*d+A*i+z*n+E*y;a[5]=F*e+A*j+z*s+E*D;a[6]=F*f+A*l+z*u+E*C;a[7]=F*g+A*m+z*w+E*b;F=c[8];A=c[9];z=c[10];E=c[11];a[8]=F*d+A*i+z*n+E*y;a[9]=F*e+A*j+z*s+E*D;a[10]=F*f+A*l+z*u+E*C;a[11]=F*g+A*m+z*w+E*b;F=c[12];A=c[13];z=c[14];E=c[15];a[12]=F*d+A*i+z*n+E*y;a[13]=F*e+A*j+z*s+E*D;a[14]=F*f+A*l+z*u+E*C;a[15]=F*g+A*m+z*w+E*b;return a}}; Yj.gn=Yj.multiply; Yj.translate=function(a,b,c){var d=c[0],e=c[1],c=c[2],f,g,i,j,l,m,n,s,u,w,y,D;if(b===a){a[12]=b[0]*d+b[4]*e+b[8]*c+b[12];a[13]=b[1]*d+b[5]*e+b[9]*c+b[13];a[14]=b[2]*d+b[6]*e+b[10]*c+b[14];a[15]=b[3]*d+b[7]*e+b[11]*c+b[15]}else{f=b[0];g=b[1];i=b[2];j=b[3];l=b[4];m=b[5];n=b[6];s=b[7];u=b[8];w=b[9];y=b[10];D=b[11];a[0]=f;a[1]=g;a[2]=i;a[3]=j;a[4]=l;a[5]=m;a[6]=n;a[7]=s;a[8]=u;a[9]=w;a[10]=y;a[11]=D;a[12]=f*d+l*e+u*c+b[12];a[13]=g*d+m*e+w*c+b[13];a[14]=i*d+n*e+y*c+b[14];a[15]=j*d+s*e+D*c+b[15]}return a}; Yj.scale=function(a,b,c){var d=c[0],e=c[1],c=c[2];a[0]=b[0]*d;a[1]=b[1]*d;a[2]=b[2]*d;a[3]=b[3]*d;a[4]=b[4]*e;a[5]=b[5]*e;a[6]=b[6]*e;a[7]=b[7]*e;a[8]=b[8]*c;a[9]=b[9]*c;a[10]=b[10]*c;a[11]=b[11]*c;a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a}; Yj.rotate=function(a,b,c,d){var e=d[0],f=d[1],d=d[2],g=Math.sqrt(e*e+f*f+d*d),i,j,l,m,n,s,u,w,y,D,C,F,A,z,E,G,P,S,aa,ba;if(Math.abs(g)<lk)return p;g=1/g;e=e*g;f=f*g;d=d*g;i=Math.sin(c);j=Math.cos(c);l=1-j;c=b[0];g=b[1];m=b[2];n=b[3];s=b[4];u=b[5];w=b[6];y=b[7];D=b[8];C=b[9];F=b[10];A=b[11];z=e*e*l+j;E=f*e*l+d*i;G=d*e*l-f*i;P=e*f*l-d*i;S=f*f*l+j;aa=d*f*l+e*i;ba=e*d*l+f*i;e=f*d*l-e*i;f=d*d*l+j;a[0]=c*z+s*E+D*G;a[1]=g*z+u*E+C*G;a[2]=m*z+w*E+F*G;a[3]=n*z+y*E+A*G;a[4]=c*P+s*S+D*aa;a[5]=g*P+u*S+C*aa;a[6]= m*P+w*S+F*aa;a[7]=n*P+y*S+A*aa;a[8]=c*ba+s*e+D*f;a[9]=g*ba+u*e+C*f;a[10]=m*ba+w*e+F*f;a[11]=n*ba+y*e+A*f;if(b!==a){a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15]}return a};Yj.sO=function(a,b,c){var d=Math.sin(c),c=Math.cos(c),e=b[4],f=b[5],g=b[6],i=b[7],j=b[8],l=b[9],m=b[10],n=b[11];if(b!==a){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15]}a[4]=e*c+j*d;a[5]=f*c+l*d;a[6]=g*c+m*d;a[7]=i*c+n*d;a[8]=j*c-e*d;a[9]=l*c-f*d;a[10]=m*c-g*d;a[11]=n*c-i*d;return a}; Yj.tO=function(a,b,c){var d=Math.sin(c),c=Math.cos(c),e=b[0],f=b[1],g=b[2],i=b[3],j=b[8],l=b[9],m=b[10],n=b[11];if(b!==a){a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15]}a[0]=e*c-j*d;a[1]=f*c-l*d;a[2]=g*c-m*d;a[3]=i*c-n*d;a[8]=e*d+j*c;a[9]=f*d+l*c;a[10]=g*d+m*c;a[11]=i*d+n*c;return a}; Yj.uO=function(a,b,c){var d=Math.sin(c),c=Math.cos(c),e=b[0],f=b[1],g=b[2],i=b[3],j=b[4],l=b[5],m=b[6],n=b[7];if(b!==a){a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15]}a[0]=e*c+j*d;a[1]=f*c+l*d;a[2]=g*c+m*d;a[3]=i*c+n*d;a[4]=j*c-e*d;a[5]=l*c-f*d;a[6]=m*c-g*d;a[7]=n*c-i*d;return a}; Yj.o3=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],i=d+d,j=e+e,l=f+f,b=d*i,m=d*j,d=d*l,n=e*j,e=e*l,f=f*l,i=g*i,j=g*j,g=g*l;a[0]=1-(n+f);a[1]=m+g;a[2]=d-j;a[3]=0;a[4]=m-g;a[5]=1-(b+f);a[6]=e+i;a[7]=0;a[8]=d+j;a[9]=e-i;a[10]=1-(b+n);a[11]=0;a[12]=c[0];a[13]=c[1];a[14]=c[2];a[15]=1;return a}; Yj.BX=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c+c,i=d+d,j=e+e,c=c*g,l=d*g,d=d*i,m=e*g,n=e*i,e=e*j,g=f*g,i=f*i,f=f*j;a[0]=1-d-e;a[1]=l+f;a[2]=m-i;a[3]=0;a[4]=l-f;a[5]=1-c-e;a[6]=n+g;a[7]=0;a[8]=m+i;a[9]=n-g;a[10]=1-c-d;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};Yj.q3=function(a,b,c,d,e,f,g){var i=1/(c-b),j=1/(e-d),l=1/(f-g);a[0]=f*2*i;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=f*2*j;a[6]=0;a[7]=0;a[8]=(c+b)*i;a[9]=(e+d)*j;a[10]=(g+f)*l;a[11]=-1;a[12]=0;a[13]=0;a[14]=g*f*2*l;a[15]=0;return a}; Yj.XZ=function(a,b,c){var b=1/Math.tan(b/2),d=1/-999.99;a[0]=b/c;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=b;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1000.01*d;a[11]=-1;a[12]=0;a[13]=0;a[14]=20*d;a[15]=0};Yj.P4=function(a,b,c,d,e,f,g){var i=1/(b-c),j=1/(d-e),l=1/(f-g);a[0]=-2*i;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=-2*j;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=2*l;a[11]=0;a[12]=(b+c)*i;a[13]=(e+d)*j;a[14]=(g+f)*l;a[15]=1;return a}; Yj.y4=function(a,b,c,d){var e,f,g,i,j,l,m,n,s=b[0],u=b[1],b=b[2];g=d[0];i=d[1];f=d[2];m=c[0];d=c[1];e=c[2];if(Math.abs(s-m)<lk&&Math.abs(u-d)<lk&&Math.abs(b-e)<lk)return Yj.Wm(a);c=s-m;d=u-d;m=b-e;n=1/Math.sqrt(c*c+d*d+m*m);c=c*n;d=d*n;m=m*n;e=i*m-f*d;f=f*c-g*m;g=g*d-i*c;if(n=Math.sqrt(e*e+f*f+g*g)){n=1/n;e=e*n;f=f*n;g=g*n}else g=f=e=0;i=d*g-m*f;j=m*e-c*g;l=c*f-d*e;if(n=Math.sqrt(i*i+j*j+l*l)){n=1/n;i=i*n;j=j*n;l=l*n}else l=j=i=0;a[0]=e;a[1]=i;a[2]=c;a[3]=0;a[4]=f;a[5]=j;a[6]=d;a[7]=0;a[8]=g;a[9]= l;a[10]=m;a[11]=0;a[12]=-(e*s+f*u+g*b);a[13]=-(i*s+j*u+l*b);a[14]=-(c*s+d*u+m*b);a[15]=1;return a};Yj.Dn=function(a){return"mat4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+")"}; Yj.ZD=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)+Math.pow(a[3],2)+Math.pow(a[4],2)+Math.pow(a[5],2)+Math.pow(a[6],2)+Math.pow(a[6],2)+Math.pow(a[7],2)+Math.pow(a[8],2)+Math.pow(a[9],2)+Math.pow(a[10],2)+Math.pow(a[11],2)+Math.pow(a[12],2)+Math.pow(a[13],2)+Math.pow(a[14],2)+Math.pow(a[15],2))};"undefined"!==typeof exports&&(exports.F4=Yj);var vk={create:function(){var a=new mk(4);a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}}; vk.j5=function(){var a=rk.create(),b=rk.tg(1,0,0),c=rk.tg(0,1,0);return function(d,e,f){var g=rk.Xs(e,f);if(g<-0.999999){rk.sx(a,b,e);rk.length(a)<1.0E-6&&rk.sx(a,c,e);rk.normalize(a,a);vk.D_(d,a);return d}if(g>0.999999){d[0]=0;d[1]=0;d[2]=0;d[3]=1;return d}rk.sx(a,e,f);d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=1+g;return vk.normalize(d,d)}}(); vk.m5=function(){var a=uk.create();return function(b,c,d,e){a[0]=d[0];a[3]=d[1];a[6]=d[2];a[1]=e[0];a[4]=e[1];a[7]=e[2];a[2]=-c[0];a[5]=-c[1];a[8]=-c[2];return vk.normalize(b,vk.AX(b,a))}}();vk.ji=Xj.ji;vk.tg=Xj.tg;vk.copy=Xj.copy;vk.set=Xj.set;vk.Wm=function(a){a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};vk.D_=function(a,b){var c=Math.PI,c=c*0.5,d=Math.sin(c);a[0]=d*b[0];a[1]=d*b[1];a[2]=d*b[2];a[3]=Math.cos(c)};vk.add=Xj.add; vk.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],b=b[3],g=c[0],i=c[1],j=c[2],c=c[3];a[0]=d*c+b*g+e*j-f*i;a[1]=e*c+b*i+f*g-d*j;a[2]=f*c+b*j+d*i-e*g;a[3]=b*c-d*g-e*i-f*j;return a};vk.gn=vk.multiply;vk.scale=Xj.scale;vk.sO=function(a,b,c){var c=c*0.5,d=b[0],e=b[1],f=b[2],b=b[3],g=Math.sin(c),c=Math.cos(c);a[0]=d*c+b*g;a[1]=e*c+f*g;a[2]=f*c-e*g;a[3]=b*c-d*g;return a}; vk.tO=function(a,b,c){var c=c*0.5,d=b[0],e=b[1],f=b[2],b=b[3],g=Math.sin(c),c=Math.cos(c);a[0]=d*c-f*g;a[1]=e*c+b*g;a[2]=f*c+d*g;a[3]=b*c-e*g;return a};vk.uO=function(a,b,c){var c=c*0.5,d=b[0],e=b[1],f=b[2],b=b[3],g=Math.sin(c),c=Math.cos(c);a[0]=d*c+e*g;a[1]=e*c-d*g;a[2]=f*c+b*g;a[3]=b*c-f*g;return a};vk.H2=function(a,b){var c=b[0],d=b[1],e=b[2];a[0]=c;a[1]=d;a[2]=e;a[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e));return a};vk.Xs=Xj.Xs;vk.vy=Xj.vy; vk.v5=function(a,b,c,d){var e=b[0],f=b[1],g=b[2],b=b[3],i=c[0],j=c[1],l=c[2],c=c[3],m,n,s;n=e*i+f*j+g*l+b*c;if(n<0){n=-n;i=-i;j=-j;l=-l;c=-c}if(1-n>1.0E-6){m=Math.acos(n);s=Math.sin(m);n=Math.sin((1-d)*m)/s;d=Math.sin(d*m)/s}else n=1-d;a[0]=n*e+d*i;a[1]=n*f+d*j;a[2]=n*g+d*l;a[3]=n*b+d*c;return a};vk.Jp=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*c+d*d+e*e+f*f,g=g?1/g:0;a[0]=-c*g;a[1]=-d*g;a[2]=-e*g;a[3]=f*g;return a};vk.N2=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];a[3]=b[3];return a}; vk.length=Xj.length;vk.hF=vk.length;vk.Zk=Xj.Zk;vk.lG=vk.Zk;vk.normalize=Xj.normalize;vk.AX=function(a,b){var c=b[0]+b[4]+b[8];if(c>0){c=Math.sqrt(c+1);a[3]=0.5*c;c=0.5/c;a[0]=(b[7]-b[5])*c;a[1]=(b[2]-b[6])*c;a[2]=(b[3]-b[1])*c}else{var d=0;b[4]>b[0]&&(d=1);b[8]>b[d*3+d]&&(d=2);var e=(d+1)%3,f=(d+2)%3,c=Math.sqrt(b[d*3+d]-b[e*3+e]-b[f*3+f]+1);a[d]=0.5*c;c=0.5/c;a[3]=(b[f*3+e]-b[e*3+f])*c;a[e]=(b[e*3+d]+b[d*3+e])*c;a[f]=(b[f*3+d]+b[d*3+f])*c}return a}; vk.Dn=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"};"undefined"!==typeof exports&&(exports.c5=vk);function wk(a,b){this.Kf=a;this.Vq=b||2;this.fB=a-this.Vq;this.vc=[];this.Ng=[];this.PE()}x.extend(wk.prototype,{PE:function(){var a,b;this.vc.push(0,-20,0);for(ih=0;360>ih;ih+=6)a=Math.cos(Tb(ih))*this.Kf,b=Math.sin(Tb(ih))*this.Kf,this.vc.push(a,-20,b)},OE:function(){for(var a=(this.vc.length-3)/3,b=1;b<a;b++)this.Ng.push(0,b,b+1);this.Ng.push(0,b,1)},mE:function(){0==this.Ng.length&&this.OE();return this.Ng}});function xk(a,b){this.Kf=a;this.Vq=b||2;this.fB=a-this.Vq;this.vc=[];this.Ng=[];this.PE()} x.extend(xk.prototype,{PE:function(){for(var a,b,c=0;360>c;c+=6)a=Math.cos(Tb(c))*this.fB,b=Math.sin(Tb(c))*this.fB,this.vc.push(a,-20,b);for(c=0;360>c;c+=6)a=Math.cos(Tb(c))*this.Kf,b=Math.sin(Tb(c))*this.Kf,this.vc.push(a,-20,b)},OE:function(){var a=this.vc.length/3/2;for(ih=0;ih<a-1;ih++)this.Ng.push(ih,ih+a+1,ih+a),this.Ng.push(ih,ih+1,ih+a+1);this.Ng.push(ih,a,ih+a);this.Ng.push(ih,0,a)},mE:function(){0==this.Ng.length&&this.OE();return this.Ng}});function yk(a){this.Kf=a;this.Vd=Math.pow(2,4);this.fs=this.Vd/2;this.vc=[];this.EA=[];a=360/this.Vd;this.fK=Math.cos(Tb(3*a))*this.Kf;this.gK=Math.cos(Tb(2*a))*this.Kf;this.hK=Math.cos(Tb(1*a))*this.Kf;this.$Y()} x.extend(yk.prototype,{$Y:function(){if(!(0<this.vc.length))for(var a=this.Kf,b=[],c=64/this.Vd,d=64/c,e=[],f=0,g=0,i,j=0;33>j;j++)for(var l=Math.cos(Tb(5.625*j-90))*a,l=Math.round(100*l)/100,m=Math.sin(Tb(5.625*j-90))*a,m=Math.round(100*m)/100,f=Math.floor(j/c),n=0;64>n;n++){var s=Math.cos(Tb(5.625*n))*l,u=Math.sin(Tb(5.625*n))*l,s=Math.round(100*s)/100,u=Math.round(100*u)/100;b.push(s,m,u);g=Math.floor(n/c);i=g+f*d;f<this.fs&&(this.vc[i]||(this.vc[i]=[]),this.vc[i].push(s,m,u));if(0<f&&0==j%c){var w= g+(f-1)*d;this.vc[w].push(s,m,u);0<n&&0==n%c&&this.vc[w-1]&&this.vc[w-1].push(s,m,u);63==n&&this.vc[w].push(e[0],e[1],e[2])}0==g&&0==n&&(e=[s,m,u]);0<n&&0==n%c&&this.vc[i-1]&&this.vc[i-1].push(s,m,u);f<this.fs&&63==n&&this.vc[i].push(e[0],e[1],e[2])}},ZY:function(){for(var a=64/this.Vd,b=a+1,c=0;c<a;c++)for(var d=0;d<a;d++){var e=c*b,f=e+d+1;this.EA.push(e+d,f,e+d+1+b);f=e+d+1+b;this.EA.push(e+d,f,e+b+d)}return this.EA},FX:function(a,b,c){var d=this.vc[Math.round(this.vc.length/2)];if(d){for(var e= [],f=Math.pow(2,5-a),b=b%f,c=c%f,g=64/this.Vd,i=1/g,j=1/(32/this.fs),l=0;l<d.length/3;l++){var m=l%(g+1)*i,n=Math.floor(l/(g+1))*j,m=m/f+1*b/f,n=n/f+1*c/f;1===a&&(n*=2);e.push(m,n)}return e}},SX:function(a){var b=0,c=0,c=a[0],b=a[1],d=a[2],a=Math.round(180*Math.atan(Math.abs(d)/Math.abs(c))/Math.PI);0<c?0>d&&(a=360-a):a=0<d?180-a:180+a;c=b>this.hK?7:b>this.gK?6:b>this.fK?5:0<b?4:b>-this.fK?3:b>-this.gK?2:b>-this.hK?1:0;b=Math.floor(a/22.5);return[b,c,b+c*(64/(64/this.Vd))]}});function Qj(a){this.P=a;this.oe=this.ib=this.Xa=this.cj=p;var b=this;this.vs=new Zj(6,{ap:function(a){for(var d=0;d<a.length;d++)if(a[d])for(var e=0;e<a[d].length;e++)a[d][e]&&(b.ib.deleteTexture(a[d][e].vz),a[d][e].Ws=q)}});this.WJ=new Zj(32,{ap:function(a){a&&(a.FA=o,a.src="")}});this.YA=new $j;this.Vd=16;this.fs=8;this.Kf=500;this.Zj=this.dj=0;this.If=[Yj.create(),Yj.create()];this.Wh=Yj.create();this.zB=[Yj.create(),Yj.create()];this.Rr=Yj.create();this.xB=[];this.dm=this.Ko=this.Aw=p;this.ns= {};this.uS();this.kC=0;this.Cv=[p,p];this.ZA=[p,p];this.lg=[];this.kg=J()?2:1;this.Ui()} x.extend(Qj.prototype,{uS:function(){this.zl=[];for(var a=2;5>=a;a++)this.zl[a]={cols:Math.pow(2,a-1),rows:Math.pow(2,a-1)/2};this.zl[1]={cols:1,rows:1}},Ui:function(){this.rA();this.ib=this.Xa.getContext("webgl",{alpha:q});this.Iw=jk.get(this.ib,this.P.ba);this.cB();this.XU();this.IA();this.JA();this.oU();this.Iw.NE()},rA:function(){var a=this.Xa=H("canvas"),b=this.Xa.style,c=this.P.C,d=c.clientWidth,c=c.clientHeight;b.width=d+"px";b.height=c+"px";this.dj=a.width=d*this.kg;this.Zj=a.height=c*this.kg; this.P.ci.appendChild(this.Xa)},XU:function(){var a=this.ib,b=this.Xa;a.clearColor(0,0,0,1);a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);a.disable(a.DEPTH_TEST);a.enable(a.BLEND);a.depthMask(o);a.viewport(0,0,b.width,b.height)},Sk:function(){var a=this.P.C,b=a.clientWidth,a=a.clientHeight;this.Xa.style.width=b+"px";this.Xa.style.height=a+"px";this.dj=this.Xa.width=b*this.kg;this.Zj=this.Xa.height=a*this.kg;this.rr=p;b=this.Xa;this.ib.viewport(0,0,b.width,b.height)},cB:function(){var a=this.ib,b= this.oe=a.createProgram(),c=this.Gl("attribute vec3 aVertexPosition;\\nattribute vec2 aVertexTextureCoordBack;\\nattribute vec2 aVertexTextureCoord;\\nvarying mediump vec2 vTextureCoordBack;\\nvarying mediump vec2 vTextureCoord;\\nuniform mat4 uMVMatrix;\\nuniform mat4 uPMatrix;\\nvoid main(void) {\\n gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\\n vTextureCoordBack = aVertexTextureCoordBack;\\n vTextureCoord = aVertexTextureCoord;\\n}",a.VERTEX_SHADER),d=this.Gl("precision mediump float;\\nvarying vec2 vTextureCoordBack;\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSamplerBack;\\nuniform sampler2D uSampler;\\nuniform bool uDrawThumb;\\nuniform bool uDrawBack;\\nuniform float uAlpha;\\nvoid main(void) {\\n if (uDrawThumb) {\\n gl_FragColor = texture2D(uSamplerBack, vTextureCoordBack);\\n return;\\n }\\n if (uAlpha == 1.0) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n if (uDrawBack) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha + texture2D(uSamplerBack, vTextureCoordBack) * (1.0 - uAlpha);\\n } else {\\n vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\\n gl_FragColor = vec4(textureColor.rgb, textureColor.a * uAlpha);\\n }\\n}", a.FRAGMENT_SHADER);a.attachShader(b,c);a.attachShader(b,d);a.bindAttribLocation(b,0,"aVertexPosition");a.linkProgram(b)},Gl:function(a,b){var c=this.ib,d=c.createShader(b);c.shaderSource(d,a);c.compileShader(d);return d},oU:function(){var a=new yk(this.Kf),b=a.ZY();this.ns={SO:a,vX:b,uX:a.vc}},setData:function(a){a!==p&&(this.Rl=this.ea?this.ea.id:p,this.KB=this.ea||p);(this.ea=a)&&this.vs.setData(a.id,[])},va:function(a,b){if(this.ea){this.Ea=a;this.cf=b;var c=this.Xa;this.cj||(this.cj=this.P.ga()); this.rr||(this.rr=180/Math.pow(2,this.cj),this.vV=c.width/c.height,Yj.XZ(this.Wh,Tb(this.rr),this.vV),Yj.Jp(this.Rr,this.Wh));this.eA(0);c=this.KA(0);this.Cv[0]=c[0];this.ZA[0]=c[1];this.IT();this.os()}},eA:function(a){Yj.Wm(this.If[a]);Yj.rotate(this.If[a],this.If[a],Tb(this.Ea.pitch),[-1,0,0]);var b=this.ea.tiles.dirNorth;1==a&&this.KB&&(b=this.KB.tiles.dirNorth);Yj.rotate(this.If[a],this.If[a],Tb(b+this.Ea.heading+90),[0,1,0]);Yj.Jp(this.zB[a],this.If[a])},Yj:function(a,b,c){var d=this.dj,e=this.Zj, f=Xj.create(),g=this.Rr,c=this.zB[c],a=Xj.tg(2*a/d-1,1-2*b/e,-1,1);Yj.multiply(f,g,a);Yj.multiply(f,c,f);b=this.Kf;g=200*f[0];a=200*f[1];f=200*f[2];b=Math.sqrt(-(-b*b)/(g*g+a*a+f*f));return this.ns.SO.SX([g*b,a*b,f*b])},BI:function(a,b,c,d){var e=this.Zj,b=Xj.tg(a,b,c,1),a=Xj.create();Yj.multiply(a,this.If[d],b);b=Xj.tg(a[0],a[1],a[2],a[3]);Yj.multiply(a,this.Wh,b);if(0!==a[3])return d=(1-rk.tg(a[0]/a[3],a[1]/a[3],a[2]/a[3])[1])*e/2,0<a[3]&&0<d&&d<e?o:q},Oc:function(a,b,c){var c=c||{},d=c.Up||q,e= c.h_||p;this.Bo=this.cf;this.cf=b;this.rr=p;var f=this,g=this.cj,i=a-g;f.Cr&&(f.Cr.stop(),f.Cr=p);d?(f.cj=a,f.xV=q,f.va(f.Ea,b)):f.Cr=new wb({duration:600,Hc:60,hc:xb.xL,va:function(a){if(a!=0){f.rr=p;f.cj=g+i*a;a<0.5?f.va(f.Ea,f.Bo):f.va(f.Ea,b);e&&e(f.cj)}},finish:function(){f.Cr=p;f.cj=a;f.xV=q;f.P.dispatchEvent(new N("onzoom_changed"))},au:function(){f.P.dispatchEvent(new N("onzoom_changed"));f.Cr=p}})},IT:function(){var a=this;this.oJ(0,0,1,function(){a.Ug||a.QI()})},QI:function(){for(var a= this.ZA[0],b=a[0],c=a[1],d=a[3],a=a[2];a<=d;a++){var e=b,f=c;"number"===typeof this.$A&&(a>=this.$A&&a<=this.CI)&&(e=0,f=this.zl[this.cf].cols-1);for(;e<=f;e++)this.oJ(e,a)}},oJ:function(a,b,c,d){var c=c||this.cf,e=this.zl[c].cols,f=this.zl[c].rows,g=this,a=g.NB(a,c);0>b&&(a=g.NB(e-1-a,c),b=0);b>f-1&&(a=g.NB(e-1-a,c),b=f-1);var i=a+b*e,j=g.vs.getData(g.ea.id);j[c]||(j[c]=[]);j[c][i]||(j[c][i]={});var l=j[c][i];l.loaded?(g.LJ(c)&&g.RJ(),d&&d()):(l.index=i,l.loaded=q,l.RZ=g.ea.id,g.HT(a,b,c,function(a){if(l.RZ== g.ea.id){l.loaded=o;var b=j[c][i];if(!b.Ws){g.WU(b,a,c);if(c>1)b.im={duration:300,startTime:Date.now(),ZC:0,fp:1};b.Ws=o}g.LJ(c)&&g.RJ();d&&d();g.os()}}))},LJ:function(a){return 1===a&&this.Rl&&this.P.aK?o:q},FO:da("RT"),NB:function(a,b){for(var c=a,d=this.zl[b||this.cf].cols;0>c;)c+=d;return c%d},zf:function(){this.kC--;0===this.kC&&this.P.dispatchEvent(new N("ontilesloaded"))},os:function(){this.pv&&(clearTimeout(this.pv),this.pv=p);var a=this;this.pv=setTimeout(function(){cancelAnimationFrame(a.gw); a.gw=p;a.pv=p},300);this.gw||this.fw()},fw:function(){var a=this;a.gw=requestAnimationFrame(function(){a.fw()});var b=this.oe;this.ib.useProgram(b);var c=this.Iw;c.jp(b.Kn);c.jp(b.FP);c.jp(b.Ru);c.pD();b=q;this.Ug?this.tU():b=this.SB(0);if(b&&!this.Ug)for(b=0;b<this.lg.length;b++)this.lg[b].fw(this.Wh,this.If[0],this.Rr,this.zB[0])},SB:function(a,b){if(!this.ea)return q;var c=this.Cv[a];if(!c)return q;var d=0==a?this.ea.id:this.Rl;if(!d)return q;b&&Yj.translate(this.If[a],this.xB[a],b);var e=c[0], f=c[1],g=c[2],c=c[3];this.Ug&&0==a&&(e-=2,f+=2,g-=2,c+=2,g=0>g?0:g);d=this.vs.getData(d);if(!d)return q;for(;g<=c;g++){var i=e,j=f;"number"===typeof this.qk&&(g>=this.qk&&g<=this.em)&&(i=0,j=this.Vd-1);for(;i<=j;i++){for(var l=i;0>l;)l+=this.Vd;var l=l%this.Vd,m=this.wl(l,g)[2],n=this.wl(l,g,this.Bo)[2],s=this.wl(l,g,1)[2],u=p,w=p,y=1;d[this.cf]&&(d[this.cf][m]&&d[this.cf][m].Ws)&&(u=m);d[this.Bo]&&d[this.Bo][n]&&d[this.Bo][n].Ws?(w=n,y=this.Bo):d[1][s]&&d[1][s].Ws&&(w=s);if(u===p&&w===p)return q; m=this.ib;n=this.oe;s=this.cf;this.Ug&&1==a?(m.uniform1i(n.tL,q),u===p&&(u=w,s=1),w=p):m.uniform1i(n.tL,o);this.AT(u,s,w,y,a);this.VU(l,g,s,y);this.YB(a);this.fS()}}return o},wl:function(a,b,c){var c=c||this.cf,d=Math.pow(2,5-c),a=Math.floor(a/d),b=Math.floor(b/d),b=this.zl[c].rows-b-1;return[a,b,a+b*this.Vd/d]},WU:function(a,b,c){if(a){var d=this.ib;1===c?d.activeTexture(d.TEXTURE0):d.activeTexture(d.TEXTURE1);a.vz=d.createTexture();d.bindTexture(d.TEXTURE_2D,a.vz);d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL, o);d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,b);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR)}},AT:function(a,b,c,d,e){var f=0==e?this.ea.id:this.Rl;if(f){var g=this.vs.getData(f),f=this.ib,i=this.oe;a===p?f.uniform1i(i.uL,o):f.uniform1i(i.uL,q);var j=p;g[d]&&g[d][c]&&(f.activeTexture(f.TEXTURE0), j=g[d][c].vz,f.bindTexture(f.TEXTURE_2D,j),f.uniform1i(i.s_,0));if("number"===typeof a){f.activeTexture(f.TEXTURE1);f.bindTexture(f.TEXTURE_2D,g[b][a].vz);f.uniform1i(i.t_,1);a=g[b][a];"number"!=typeof a.fp&&(a.fp=1);if(1==e&&(!a.im||0!=a.im.fp))a.im={duration:400,startTime:this.tw,ZC:1,fp:0},a.fp=0;a.im?(e=a.im,b=(Date.now()-e.startTime)/e.duration,0==e.ZC?(e=b,1<e&&(e=1,a.im=p)):(e=e.ZC*(1-b),0>e&&(e=0,a.im=p)),f.uniform1f(i.alpha,e)):f.uniform1f(i.alpha,a.fp)}}},VU:function(a,b,c,d){var e=this.jT(a, b),f=this.ns.vX,c=this.uI(a,b,c),a=this.uI(a,b,d),b=this.ib;this.Aw||(this.Aw=b.createBuffer());b.bindBuffer(b.ARRAY_BUFFER,this.Aw);b.bufferData(b.ARRAY_BUFFER,new Float32Array(e),b.STATIC_DRAW);this.Ko||(this.Ko=b.createBuffer(),this.Ko.BG=f.length,b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.Ko),b.bufferData(b.ELEMENT_ARRAY_BUFFER,new Uint16Array(f),b.STATIC_DRAW));this.oC||(this.oC=b.createBuffer());b.bindBuffer(b.ARRAY_BUFFER,this.oC);b.bufferData(b.ARRAY_BUFFER,new Float32Array(a),b.STATIC_DRAW); c&&(this.dm||(this.dm=b.createBuffer()),b.bindBuffer(b.ARRAY_BUFFER,this.dm),b.bufferData(b.ARRAY_BUFFER,new Float32Array(c),b.STATIC_DRAW))},fS:function(){var a=this.ib,b=this.oe;a.bindBuffer(a.ARRAY_BUFFER,this.Aw);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.Ko);a.vertexAttribPointer(b.Kn,3,a.FLOAT,q,0,0);a.bindBuffer(a.ARRAY_BUFFER,this.oC);a.vertexAttribPointer(b.FP,2,a.FLOAT,q,0,0);a.bindBuffer(a.ARRAY_BUFFER,this.dm);a.vertexAttribPointer(b.Ru,2,a.FLOAT,q,0,0);a.drawElements(a.TRIANGLES,this.Ko.BG, a.UNSIGNED_SHORT,0)},jT:function(a,b){return this.ns.uX[a+b*(64/(64/this.Vd))]},uI:function(a,b,c){return this.ns.SO.FX(c||this.cf,a,b)},IA:function(){var a=this.oe,b=this.ib;a.bu=b.getUniformLocation(a,"uPMatrix");a.Zt=b.getUniformLocation(a,"uMVMatrix");a.uL=b.getUniformLocation(a,"uDrawThumb");a.tL=b.getUniformLocation(a,"uDrawBack");a.alpha=b.getUniformLocation(a,"uAlpha");a.s_=b.getUniformLocation(a,"uSamplerBack");a.t_=b.getUniformLocation(a,"uSampler")},JA:function(){var a=this.oe,b=this.ib; a.Kn=b.getAttribLocation(a,"aVertexPosition");a.FP=b.getAttribLocation(a,"aVertexTextureCoordBack");a.Ru=b.getAttribLocation(a,"aVertexTextureCoord")},YB:function(a){var b=this.oe,c=this.ib;c.uniformMatrix4fv(b.bu,q,this.Wh);c.uniformMatrix4fv(b.Zt,q,this.If[a])},$q:function(a,b,c,d){return a+"_"+b+"_"+c+"_"+d},HT:function(a,b,c,d){var e=this.$q(this.ea.id,a,b,c),f=this.WJ.getData(e);this.kC++;if(f)f.Mr&&(d(f),this.zf());else{f=this.YA.Px();f.crossOrigin="anonymous";f.Mr=q;var g=this;f.onload=function(){-1!= this.src.indexOf("pos=0_0&z=1")&&g.P.dispatchEvent(new N("onthumbnail_complete"));d(this);g.zf();this.Mr=o};f.src=this.ea.tiles.getTilesUrl(this.ea.id,new R(a,b),c);this.WJ.setData(e,f)}},KA:function(a){var b=this.dj,c=this.Zj,d,e,f,g,i,j=this.Yj(0,0,a);d=j[0];g=j[1];j=this.Yj(b/2,0,a);j[1]>g&&(g=j[1]);j=this.Yj(b,0,a);e=j[0];e<d&&(e+=this.Vd);i=j[1];j=this.Yj(0,c/2,a);j[0]>e&&(j[0]-=this.Vd);j[0]<d&&(d=j[0]);j=this.Yj(b,c/2,a);j[0]<d&&(j[0]+=this.Vd);j[0]>e&&(e=j[0]);j=this.Yj(0,c,a);j[0]>e&&(j[0]-= this.Vd);j[0]<d&&(d=j[0]);f=j[1];j=this.Yj(b/2,c,a);j[1]<f&&(f=j[1]);j=this.Yj(b,c,a);j[0]<d&&(j[0]+=this.Vd);j[0]>e&&(e=j[0]);b=j[1];this.BI(0,100,0,a)?(this.em=this.fs-1,this.qk=i):this.BI(0,-100,0,a)?(this.qk=0,this.em=b):this.CI=this.$A=this.em=this.qk=p;this.em!=p&&g<this.em&&(g=this.em);this.qk!=p&&f>this.qk&&(f=this.qk);b=this.wl(d,g);c=this.wl(e,f);a=b[0];i=c[0];b=b[1];c=c[1];this.$A=this.wl(0,this.qk)[1];this.CI=this.wl(0,this.em)[1];return[[d,e,f,g],[a,i,b,c]]},BV:function(a){this.lg.push(a)}, RJ:function(){if(!this.Ug&&(this.eA(1),this.xB[0]=Yj.ji(this.If[0]),this.xB[1]=Yj.ji(this.If[1]),this.Cv[1]=this.KA(1)[0],this.Ug=o,this.xA=160,this.yA=120,"number"==typeof this.P.PH)){var a=Math.pow(this.P.PH,0.25);this.xA*=a;this.yA*=a}},hJ:function(){this.Ug=q;this.tw=this.Rl=p;this.eA(0);var a=this.KA(0);this.Cv[0]=a[0];this.ZA[0]=a[1];this.QI();this.os()},tU:function(){this.tw||(this.tw=Date.now());this.os();this.MR=Date.now();var a=this.MR-this.tw;if(400<a)this.hJ();else{var a=a/400,a=-a*(a- 2),b=this.KB.links[this.RT];if(b){var c=b.dir+this.ea.tiles.dirNorth;360<c&&(c%=360);var d=this.xA*(1-a),e=Math.cos(Tb(c))*d,c=Math.sin(Tb(c))*d;try{this.SB(0,[e,0,c])}catch(f){}d=this.yA*a;e=Math.cos(Tb(b.zh))*d;c=Math.sin(Tb(b.zh))*d;try{this.SB(1,[-e,0,-c])}catch(g){}}else this.hJ()}},hD:function(){cancelAnimationFrame(this.gw);this.vs.clear()}});function Rj(a,b){this.P=a;this.Xa=b;this.dj=b.width;this.Zj=b.height;this.ib=b.getContext("webgl",{alpha:q});this.Iw=jk.get(this.ib,this.P.ba);this.ea=this.oe=p;this.Oa=q;this.Ui();this.mo=this.bk=o;this.eo=[0,-20,0];this.kg=J()?2:1;this.Zn=this.$n=this.Yn=p;this.Ud={};a.oB=this;this.Ho=a.lg.Bd;this.Xd=new T}var zk=[10,-20,30,10,-20,10,-10,-20,10,-10,-20,30],Ak=[0,0,0,1,1,1,1,0],Bk=[2.2,-20,22.3,2.2,-20,13.7,-2.2,-20,13.7,-2.2,-20,22.3],Ck=[0,0,0,0.5,0.25,0.5,0.25,0]; x.extend(Rj.prototype,{Ui:function(){this.EH=new wk(8.5);this.yJ=new xk(10,1.5);this.JT();this.cB();this.vT();this.ca();this.IA();this.JA()},JT:function(){var a=new Image,b=this;a.crossOrigin="anonymous";a.onload=function(){this.Mr=o;b.Yn=b.ib.createTexture();b.dB(b.Yn,this)};a.src="http://map.baidu.com/res_mobile2/images/link-arrow-shadow.png";a=new Image;a.crossOrigin="anonymous";a.onload=function(){this.Mr=o;b.$n=b.ib.createTexture();b.dB(b.$n,this)};a.src="http://map.baidu.com/res_mobile2/images/link-arrow.png"; a=new Image;a.crossOrigin="anonymous";a.onload=function(){this.Mr=o;b.Zn=b.ib.createTexture();b.dB(b.Zn,this)};a.src="http://map.baidu.com/res_mobile2/images/dir-texture.png"},cB:function(){var a=this.ib,b=this.oe=a.createProgram(),c=this.Gl("attribute vec3 aVertexPosition;\\nuniform mat4 uMVMatrix;\\nuniform mat4 uPMatrix;\\nvoid main(void) {\\n gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\\n}",a.VERTEX_SHADER),d=this.Gl("precision mediump float;\\nuniform float uColor;\\nuniform float uAlpha;\\nvoid main(void) {\\n gl_FragColor = vec4(uColor, uColor, uColor, 1.0) * uAlpha;\\n}", a.FRAGMENT_SHADER);a.attachShader(b,c);a.attachShader(b,d);a.linkProgram(b);a.useProgram(b)},vT:function(){var a=this.ib,b=this.Iv=a.createProgram(),c=this.Gl("attribute vec3 aVertexPosition;\\nattribute vec2 aVertexTextureCoord;\\nvarying highp vec2 vTextureCoord;\\nuniform mat4 uMVMatrix;\\nuniform mat4 uPMatrix;\\nvoid main(void) {\\n gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\\n vTextureCoord = aVertexTextureCoord;\\n}",a.VERTEX_SHADER),d=this.Gl("precision mediump float;\\nuniform sampler2D uSampler;\\nvarying highp vec2 vTextureCoord;\\nvoid main(void) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n}", a.FRAGMENT_SHADER);a.attachShader(b,c);a.attachShader(b,d);a.linkProgram(b);a.useProgram(b)},Gl:function(a,b){var c=this.ib,d=c.createShader(b);c.shaderSource(d,a);c.compileShader(d);return d},dB:function(a,b){var c=this.ib;c.activeTexture(c.TEXTURE2);c.bindTexture(c.TEXTURE_2D,a);c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,q);c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,b);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR);c.bindTexture(c.TEXTURE_2D,p)},ca:function(){var a=this;x.M(this.Xa,"touchstart",function(b){if(!a.Ho.Ug){a.ZI=[a.P.Fa().heading,a.P.Fa().pitch];var c=b.changedTouches[0].pageX*a.kg,d=b.changedTouches[0].pageY*a.kg,e=p;a.bk&&(e=a.kI(c,d));a.p2=[c,d];a.yI=e;e!==p&&(a.P.dispatchEvent(new N("onlinktouchstart")),a.aV=setTimeout(function(){for(var d= a.ea.links,g=0;g<d.length;g++)if(d[g].id===e){a.NR=d[g].dir;a.lb=g;break}a.xI=o;a.Zl=o;a.P.Zl=o;d=[c,(b.changedTouches[0].pageY-60)*a.kg];a.eo=a.wr(d);a.KH=a.dA(d);a.P.dispatchEvent(new N("onrefresh"));a.P.dispatchEvent(new N("onlongjumpstart"))},300))}});x.M(this.Xa,"touchend",function(){clearTimeout(a.aV);if(!a.Ho.Ug)if(a.Ho.FO(a.lb),a.Zl){a.Zl=q;a.P.Zl=q;a.xI=q;var b=a.NR,c=a.dA();if(5>c)a.P.dispatchEvent(new N("onrefresh")),a.P.dispatchEvent(new N("onlongjumpcancel"));else{var d=a.ea.wh+Math.sin(Tb(b))* c,b=a.ea.xh+Math.cos(Tb(b))*c;a.P.dispatchEvent(new N("onrefresh"));a.P.dispatchEvent(new N("onlongjumpend"));d=new O(d,b);a.P.ta(a.Xd.rh(d),{rk:o})}}else d=a.P.Fa(),a.sV=1<Math.abs(Math.round(a.ZI[0])-Math.round(d.heading))||1<Math.abs(Math.round(a.ZI[1])-Math.round(d.pitch))?q:o,a.sV&&a.ea&&a.yI&&(a.P.dispatchEvent(new N("onlinkclick")),a.P.rc(a.yI,{rk:o}),a.P.dispatchEvent(new N("onlinktouchend")))});x.M(this.Xa,"touchmove",function(b){!a.Ho.Ug&&a.Zl&&(a.KH=a.dA([b.changedTouches[0].pageX*a.kg, (b.changedTouches[0].pageY-60)*a.kg]),a.P.dispatchEvent(new N("onrefresh")))})},oT:function(a,b){var c=a[2],d=[(b[0]+b[3]+b[6]+b[9])/4,(b[2]+b[5]+b[8]+b[11])/4];return 12>Math.abs(a[0]-d[0])&&12>Math.abs(c-d[1])?o:q},kI:function(a,b){if(!this.bk)return p;var c=this.ET[1],d=this.wr([a,b],c[1]);if(!d)return p;for(var e=0,f=this.ea.links.length;e<f;e++){var g=c.slice(12*e,12*e+12);if(this.oT(d,g)){this.lb=e;break}}return this.ea.links[e]?this.ea.links[e].id:p},tM:function(a,b){if(0===this.ea.links.length|| this.mo===q)return 0;var c=this.wr([a,b]),d=q;if(!c){d=this.P.ga();c=this.wr([a,b+50*Math.pow(2,d-2)]);if(!c)return 0;d=o}for(var e=this.P.Fa().heading;0>e;)e+=360;var e=this.pS(e%360),f=this.ea.links[e].zh,g=Math.sin(Tb(f)),f=Math.cos(Tb(f)),i=-g*c[0]+f*c[2];if(100<i||-100>i)return 0;c=(f*c[0]+g*c[2])/9;if(3.6>c)return 0;g=this.ea.links[e];f=this.fR([this.ea.wh,0,this.ea.xh],[g.x,0,g.y]);this.Ho.FO(e);if(c<f)return this.P.rc(g.id,{rk:o}),this.P.dispatchEvent(new N("onclickonroad")),c;300<c&&(c=300); d&&(c=300);e=this.ea.links[e].dir;d=this.ea.wh+Math.sin(Tb(e))*c;e=this.ea.xh+Math.cos(Tb(e))*c;this.P.dispatchEvent(new N("onclickonroad"));this.P.ta(this.Xd.rh(new O(d,e)),{rk:o});return c},dA:function(a){var b=this.eo;a&&(b=this.wr(a));if(!b)return 300;var c=this.ea.links[this.lb].zh,d=Math.sin(Tb(c)),e=Math.cos(Tb(c)),a=Math.sin(Tb(-c)),c=Math.cos(Tb(-c)),f=e*b[0]+d*b[2],d=-d*b[0]+e*b[2];70<d&&(d=70);-70>d&&(d=-70);b[0]=c*f+a*d;b[2]=-a*f+c*d;this.eo[0]=b[0];this.eo[2]=b[2];b=f/9;return 300<b? 300:b},pS:function(a){for(var b=360,c=-1,d=0;d<this.ea.links.length;d++){var e=Math.abs(a-this.ea.links[d].dir);e<b&&(b=e,c=d)}d=c==this.ea.links.length-1?0:c+1;e=this.ea.links[d].dir;if(e<this.ea.links[c].dir&&(e=Math.abs(a-(e+360)),e<b))return d;d=0==c?this.ea.links.length-1:c-1;e=this.ea.links[d].dir;return e>this.ea.links[c].dir&&(e=Math.abs(360+a-e),e<b)?d:c},fR:function(a,b){return Math.sqrt(Math.pow(a[0]-b[0],2)+Math.pow(a[2]-b[2],2))},IA:function(){var a=this.oe,b=this.ib;a.bu=b.getUniformLocation(a, "uPMatrix");a.Zt=b.getUniformLocation(a,"uMVMatrix");a.alpha=b.getUniformLocation(a,"uAlpha");a.color=b.getUniformLocation(a,"uColor");a=this.Iv;a.bu=b.getUniformLocation(a,"uPMatrix");a.Zt=b.getUniformLocation(a,"uMVMatrix");a.r_=b.getUniformLocation(a,"uSampler")},JA:function(){var a=this.oe,b=this.ib;a.Kn=b.getAttribLocation(a,"aVertexPosition");a=this.Iv;a.Kn=b.getAttribLocation(a,"aVertexPosition");a.Ru=b.getAttribLocation(a,"aVertexTextureCoord")},YB:function(){var a=this.oe,b=this.ib;b.uniformMatrix4fv(a.bu, q,this.Wh);b.uniformMatrix4fv(a.Zt,q,this.yB)},va:t(),setData:function(a){if(this.ea=a)this.Ud={},this.SR=this.ea.tiles.dirNorth,this.Oa=o},fw:function(a,b,c,d){this.ib&&(this.Oa&&this.ea)&&(this.ib.useProgram(this.oe),this.Wh=a,this.yB=b,this.Rr=c,this.UT=d,this.YB(),this.Ab())},Ab:function(){if(this.Wh&&this.yB){var a=this.pU(),b=this.ib,c=this.oe,d=this.Iv;b.depthMask(q);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);var e=this.Iw;e.NE();e.jp(c.Kn);e.pD();this.Zl&&(c=0.6,5>this.KH&&(c=0.2),this.or(this.EH.vc, this.EH.mE(),this.eo,1,c,q),this.or(this.yJ.vc,this.yJ.mE(),this.eo,1,c+0.3,q));if(!(this.xI||this.bk===q)){var c=a[0],f=a[1],g=a[2],i=a[3],j=a[4],l=a[5],a=a[6];b.blendFuncSeparate(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA,b.ONE,b.ONE_MINUS_SRC_ALPHA);b.activeTexture(b.TEXTURE2);b.useProgram(d);e.NE();e.jp(d.Kn);e.jp(d.Ru);e.pD();b.uniformMatrix4fv(d.bu,q,this.Wh);b.uniformMatrix4fv(d.Zt,q,this.yB);b.uniform1i(d.r_,2);this.Yn&&(b.bindTexture(b.TEXTURE_2D,this.Yn),this.or(c,i,p,1,1,o,j));this.$n&&(b.bindTexture(b.TEXTURE_2D, this.$n),this.or(f,i,p,1,1,o,j));this.Zn&&(b.bindTexture(b.TEXTURE_2D,this.Zn),this.or(g,l,p,1,1,o,a));b.depthMask(o)}}},pU:function(){for(var a=[],b=[],c=[],d=[],e=[],f=zk.length/3,g=this.P.Fa().heading+this.SR;0>g;)g+=360;var i=this.P.Fa().pitch,g=20,j=-30,l=this.Ho.cj||this.P.ga(),g=g+20*l;0>i&&(i=Math.abs(i),g*=(90-i)/90,j-=20*i/90);for(i=0;i<this.ea.links.length;i++){var m=this.ea.links[i],n=Math.cos(Tb(m.zh))*g,s=Math.sin(Tb(m.zh))*g,l=Yj.create();Yj.Wm(l);Yj.rotate(l,l,Tb(m.zh-90),[0,1,0]); for(var m=[n,j,s],n=zk,s=Bk,u=0;u<f;u++){var w=this.AH(l,n,3*u);a.push(w[0]+m[0],m[1]-1,w[2]+m[2]);b.push(w[0]+m[0],m[1],w[2]+m[2]);w=this.AH(l,s,3*u);c.push(w[0]+m[0],m[1],w[2]+m[2])}}f=this.dR(d,[],e,[]);return this.ET=a=[a,b,c,d,f[0],e,f[1]]},dR:function(a,b,c,d){for(var e=0;e<this.ea.links.length;e++){var f=4*e;a.push(f,f+1,f+2);a.push(f,f+2,f+3);c.push(f,f+1,f+3);c.push(f+2,f+3,f+1);b=b.concat(Ak);d=d.concat(this.HS(this.ea.links[e].dir))}return[b,d]},AH:function(a,b,c){return[a[0]*b[c]+a[1]* b[c+1]+a[2]*b[c+2],0,a[8]*b[c]+a[9]*b[c+1]+a[10]*b[c+2]]},or:function(a,b,c,d,e,f,g){var i=this.ib,j=this.oe;f&&(j=this.Iv);var l=[0,0,0],m=[];if(c){l[0]=c[0];l[2]=c[2];for(var n=0;n<a.length/3;n++){var s=3*n;m.push(a[s]+l[0],c[1],a[s+2]+l[2])}}else m=a;f?(this.dm||(this.dm=i.createBuffer()),i.bindBuffer(i.ARRAY_BUFFER,this.dm),i.bufferData(i.ARRAY_BUFFER,new Float32Array(g),i.STATIC_DRAW),i.vertexAttribPointer(j.Ru,2,i.FLOAT,q,0,0)):(i.uniform1f(j.color,d),i.uniform1f(j.alpha,e));this.NI||(this.NI= i.createBuffer());i.bindBuffer(i.ARRAY_BUFFER,this.NI);i.bufferData(i.ARRAY_BUFFER,new Float32Array(m),i.STATIC_DRAW);this.Qv||(this.Qv=i.createBuffer());i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this.Qv);i.bufferData(i.ELEMENT_ARRAY_BUFFER,new Uint16Array(b),i.STATIC_DRAW);this.Qv.BG=b.length;i.vertexAttribPointer(j.Kn,3,i.FLOAT,q,0,0);i.drawElements(i.TRIANGLES,this.Qv.BG,i.UNSIGNED_SHORT,0)},wr:function(a,b){var c=this.Rr,d=this.UT;if(c){var e=a[0],f=a[1],g=this.dj,i=this.Zj,j=Xj.create(),e=Xj.tg(2* e/g-1,1-2*f/i,-1,1);Yj.multiply(j,c,e);Yj.multiply(j,d,j);c=200*j[0];d=200*j[1];j=200*j[2];e=(b||-20)/d;if(!(0>e))return[c*e,d*e,j*e]}},Sk:function(){this.dj=this.Xa.width;this.Zj=this.Xa.height},HS:function(a){var b=Math.ceil(Math.floor((a+360)%360/22.5)/2);8===b&&(b=0);for(var a=Ck.slice(0),c=Math.floor(b/2),b=b%2,d=0;d<a.length;d++)a[d]=0==d%2?a[d]+0.25*c:a[d]+0.5*b;return a},pW:function(){this.Ud={}},show:function(){this.bk=o},U:function(){this.bk=q},JD:function(){this.mo=o},mD:function(){this.mo= q},hD:function(){this.pW();var a=this.ib;a.deleteTexture(this.Yn);a.deleteTexture(this.$n);a.deleteTexture(this.Zn);this.Zn=this.$n=this.Yn=p}}); ');