strarsis преди 6 години
родител
ревизия
9c157ff121
променени са 3 файла, в които са добавени 206 реда и са изтрити 200 реда
  1. +1
    -1
      build/pannellum.css
  2. +104
    -101
      build/pannellum.htm
  3. +101
    -98
      build/pannellum.js

+ 1
- 1
build/pannellum.css
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 104
- 101
build/pannellum.htm
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 101
- 98
build/pannellum.js Целия файл

@@ -1,98 +1,101 @@
// Pannellum 5fd59e2, https://github.com/mpetroff/pannellum
window.libpannellum=function(E,f,n){function wa(T){function ab(a,e){return 1==a.level&&1!=e.level?-1:1==e.level&&1!=a.level?1:e.timestamp-a.timestamp}function U(a,e){return a.level!=e.level?a.level-e.level:a.diff-e.diff}function V(a,e,d,f,p,b){this.vertices=a;this.side=e;this.level=d;this.x=f;this.y=p;this.path=b.replace("%s",e).replace("%l",d).replace("%x",f).replace("%y",p)}function W(a,e,f,n,p){var b;var h=e.vertices;b=aa(a,h.slice(0,3));var g=aa(a,h.slice(3,6)),z=aa(a,h.slice(6,9)),h=aa(a,h.slice(9,
12)),l=b[0]+g[0]+z[0]+h[0];-4==l||4==l?b=!1:(l=b[1]+g[1]+z[1]+h[1],b=-4==l||4==l?!1:4!=b[2]+g[2]+z[2]+h[2]);if(b){b=e.vertices;g=b[0]+b[3]+b[6]+b[9];z=b[1]+b[4]+b[7]+b[10];h=b[2]+b[5]+b[8]+b[11];l=Math.sqrt(g*g+z*z+h*h);h=Math.asin(h/l);g=Math.atan2(z,g)-n;g+=g>Math.PI?-2*Math.PI:g<-Math.PI?2*Math.PI:0;g=Math.abs(g);e.diff=Math.acos(Math.sin(f)*Math.sin(h)+Math.cos(f)*Math.cos(h)*Math.cos(g));g=!1;for(z=0;z<d.nodeCache.length;z++)if(d.nodeCache[z].path==e.path){g=!0;d.nodeCache[z].timestamp=d.nodeCacheTimestamp++;
d.nodeCache[z].diff=e.diff;d.currentNodes.push(d.nodeCache[z]);break}g||(e.timestamp=d.nodeCacheTimestamp++,d.currentNodes.push(e),d.nodeCache.push(e));if(e.level<d.level){var h=s.cubeResolution*Math.pow(2,e.level-s.maxLevel),g=Math.ceil(h*s.invTileResolution)-1,z=h%s.tileResolution*2,A=2*h%s.tileResolution;0===A&&(A=s.tileResolution);0===z&&(z=2*s.tileResolution);l=0.5;if(e.x==g||e.y==g)l=1-s.tileResolution/(s.tileResolution+A);var w=1-l,h=[],x=l,K=l,G=l,L=w,B=w,y=w;if(A<s.tileResolution)if(e.x==
g&&e.y!=g){if(B=K=0.5,"d"==e.side||"u"==e.side)y=G=0.5}else e.x!=g&&e.y==g&&(L=x=0.5,"l"==e.side||"r"==e.side)&&(y=G=0.5);z<=s.tileResolution&&(e.x==g&&(x=0,L=1,"l"==e.side||"r"==e.side)&&(G=0,y=1),e.y==g&&(K=0,B=1,"d"==e.side||"u"==e.side)&&(G=0,y=1));A=[b[0],b[1],b[2],b[0]*x+b[3]*L,b[1]*l+b[4]*w,b[2]*G+b[5]*y,b[0]*x+b[6]*L,b[1]*K+b[7]*B,b[2]*G+b[8]*y,b[0]*l+b[9]*w,b[1]*K+b[10]*B,b[2]*G+b[11]*y];A=new V(A,e.side,e.level+1,2*e.x,2*e.y,s.fullpath);h.push(A);e.x==g&&z<=s.tileResolution||(A=[b[0]*x+
b[3]*L,b[1]*l+b[4]*w,b[2]*G+b[5]*y,b[3],b[4],b[5],b[3]*l+b[6]*w,b[4]*K+b[7]*B,b[5]*G+b[8]*y,b[0]*x+b[6]*L,b[1]*K+b[7]*B,b[2]*G+b[8]*y],A=new V(A,e.side,e.level+1,2*e.x+1,2*e.y,s.fullpath),h.push(A));e.x==g&&z<=s.tileResolution||e.y==g&&z<=s.tileResolution||(A=[b[0]*x+b[6]*L,b[1]*K+b[7]*B,b[2]*G+b[8]*y,b[3]*l+b[6]*w,b[4]*K+b[7]*B,b[5]*G+b[8]*y,b[6],b[7],b[8],b[9]*x+b[6]*L,b[10]*l+b[7]*w,b[11]*G+b[8]*y],A=new V(A,e.side,e.level+1,2*e.x+1,2*e.y+1,s.fullpath),h.push(A));e.y==g&&z<=s.tileResolution||(A=
[b[0]*l+b[9]*w,b[1]*K+b[10]*B,b[2]*G+b[11]*y,b[0]*x+b[6]*L,b[1]*K+b[7]*B,b[2]*G+b[8]*y,b[9]*x+b[6]*L,b[10]*l+b[7]*w,b[11]*G+b[8]*y,b[9],b[10],b[11]],A=new V(A,e.side,e.level+1,2*e.x,2*e.y+1,s.fullpath),h.push(A));for(e=0;e<h.length;e++)W(a,h[e],f,n,p)}}}function xa(){return[-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,1,-1,1,1,-1,-1]}function ma(a,e,d){var f=Math.sin(e);e=Math.cos(e);
if("x"==d)return[a[0],e*a[1]+f*a[2],e*a[2]-f*a[1],a[3],e*a[4]+f*a[5],e*a[5]-f*a[4],a[6],e*a[7]+f*a[8],e*a[8]-f*a[7]];if("y"==d)return[e*a[0]-f*a[2],a[1],e*a[2]+f*a[0],e*a[3]-f*a[5],a[4],e*a[5]+f*a[3],e*a[6]-f*a[8],a[7],e*a[8]+f*a[6]];if("z"==d)return[e*a[0]+f*a[1],e*a[1]-f*a[0],a[2],e*a[3]+f*a[4],e*a[4]-f*a[3],a[5],e*a[6]+f*a[7],e*a[7]-f*a[6],a[8]]}function na(a){return[a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15]]}function Ga(a){a.textureLoad||(a.textureLoad=
!0,fa(encodeURI(a.path+"."+s.extension),function(e){a.texture=e;a.textureLoaded=!0}))}function aa(a,e){var d=[a[0]*e[0]+a[1]*e[1]+a[2]*e[2],a[4]*e[0]+a[5]*e[1]+a[6]*e[2],a[11]+a[8]*e[0]+a[9]*e[1]+a[10]*e[2],1/(a[12]*e[0]+a[13]*e[1]+a[14]*e[2])],f=d[0]*d[3],p=d[1]*d[3],d=d[2]*d[3],b=[0,0,0];-1>f&&(b[0]=-1);1<f&&(b[0]=1);-1>p&&(b[1]=-1);1<p&&(b[1]=1);if(-1>d||1<d)b[2]=1;return b}function oa(){console.log("Reducing canvas size due to error 1286!");w.width=Math.round(w.width/2);w.height=Math.round(w.height/
2)}var w=f.createElement("canvas");w.style.width=w.style.height="100%";T.appendChild(w);var d,a,R,M,ja,S,pa,ba,s,y,qa,ga,B,Y,ya;this.init=function(k,e,Na,$,p,b,h,g){typeof e===n&&(e="equirectangular");if("equirectangular"!=e&&"cubemap"!=e&&"multires"!=e)throw console.log("Error: invalid image type specified!"),{type:"config error"};y=e;s=k;qa=Na;if(d){R&&(a.detachShader(d,R),a.deleteShader(R));M&&(a.detachShader(d,M),a.deleteShader(M));a.bindBuffer(a.ARRAY_BUFFER,null);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
null);d.texture&&a.deleteTexture(d.texture);if(d.nodeCache)for(k=0;k<d.nodeCache.length;k++)a.deleteTexture(d.nodeCache[k].texture);a.deleteProgram(d);d=n}ba=n;"cubemap"==y&&0!==(s[0].width&s[0].width-1)&&(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/)||navigator.userAgent.match(/Trident.*rv[ :]*11\./))||(a||(a=w.getContext("experimental-webgl",
{alpha:!1,depth:!1})),a&&1286==a.getError()&&oa());if(!a&&("multires"==y&&s.hasOwnProperty("fallbackPath")||"cubemap"==y)&&("WebkitAppearance"in f.documentElement.style||navigator.userAgent.match(/Trident.*rv[ :]*11\./)||-1!==navigator.appVersion.indexOf("MSIE 10"))){S&&T.removeChild(S);S=f.createElement("div");S.className="pnlm-world";$=s.basePath?s.basePath+s.fallbackPath:s.fallbackPath;var z="frblud".split(""),E=0;p=function(){var a=f.createElement("canvas");a.className="pnlm-face pnlm-"+z[this.side]+
"face";S.appendChild(a);var b=a.getContext("2d");a.style.width=this.width+4+"px";a.style.height=this.height+4+"px";a.width=this.width+4;a.height=this.height+4;b.drawImage(this,2,2);var e=b.getImageData(0,0,a.width,a.height),d=e.data,k,g;for(k=2;k<a.width-2;k++)for(g=0;4>g;g++)d[4*(k+a.width)+g]=d[4*(k+2*a.width)+g],d[4*(k+a.width*(a.height-2))+g]=d[4*(k+a.width*(a.height-3))+g];for(k=2;k<a.height-2;k++)for(g=0;4>g;g++)d[4*(k*a.width+1)+g]=d[4*(k*a.width+2)+g],d[4*((k+1)*a.width-2)+g]=d[4*((k+1)*a.width-
3)+g];for(g=0;4>g;g++)d[4*(a.width+1)+g]=d[4*(2*a.width+2)+g],d[4*(2*a.width-2)+g]=d[4*(3*a.width-3)+g],d[4*(a.width*(a.height-2)+1)+g]=d[4*(a.width*(a.height-3)+2)+g],d[4*(a.width*(a.height-1)-2)+g]=d[4*(a.width*(a.height-2)-3)+g];for(k=1;k<a.width-1;k++)for(g=0;4>g;g++)d[4*k+g]=d[4*(k+a.width)+g],d[4*(k+a.width*(a.height-1))+g]=d[4*(k+a.width*(a.height-2))+g];for(k=1;k<a.height-1;k++)for(g=0;4>g;g++)d[k*a.width*4+g]=d[4*(k*a.width+1)+g],d[4*((k+1)*a.width-1)+g]=d[4*((k+1)*a.width-2)+g];for(g=0;4>
g;g++)d[g]=d[4*(a.width+1)+g],d[4*(a.width-1)+g]=d[4*(2*a.width-2)+g],d[a.width*(a.height-1)*4+g]=d[4*(a.width*(a.height-2)+1)+g],d[4*(a.width*a.height-1)+g]=d[4*(a.width*(a.height-1)-2)+g];b.putImageData(e,0,0);E++;6==E&&(ja=this.width,T.appendChild(S),h())};for(k=0;6>k;k++)b=new Image,b.crossOrigin="anonymous",b.side=k,b.onload=p,b.src="multires"==y?encodeURI($.replace("%s",z[k])+"."+s.extension):encodeURI(s[k].src)}else{if(!a)throw console.log("Error: no WebGL support detected!"),{type:"no webgl"};
s.fullpath=s.basePath?s.basePath+s.path:s.path;s.invTileResolution=1/s.tileResolution;e=xa();pa=[];for(k=0;6>k;k++)pa[k]=e.slice(12*k,12*k+12),e=xa();if("equirectangular"==y){if(k=Math.max(s.width,s.height),e=a.getParameter(a.MAX_TEXTURE_SIZE),k>e)throw console.log("Error: The image is too big; it's "+k+"px wide, but this device's maximum supported width is "+e+"px."),{type:"webgl size error",width:k,maxWidth:e};}else if("cubemap"==y&&(k=s[0].width,e=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),k>
e))throw console.log("Error: The cube face image is too big; it's "+k+"px wide, but this device's maximum supported width is "+e+"px."),{type:"webgl size error",width:k,maxWidth:e};g===n||g.horizonPitch===n&&g.horizonRoll===n||(ba=[g.horizonPitch==n?0:g.horizonPitch,g.horizonRoll==n?0:g.horizonRoll]);k=a.TEXTURE_2D;a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight);R=a.createShader(a.VERTEX_SHADER);e=l;"multires"==y&&(e=x);a.shaderSource(R,e);a.compileShader(R);M=a.createShader(a.FRAGMENT_SHADER);
e=Ha;"cubemap"==y?(k=a.TEXTURE_CUBE_MAP,e=Ia):"multires"==y&&(e=ka);a.shaderSource(M,e);a.compileShader(M);d=a.createProgram();a.attachShader(d,R);a.attachShader(d,M);a.linkProgram(d);a.getShaderParameter(R,a.COMPILE_STATUS)||console.log(a.getShaderInfoLog(R));a.getShaderParameter(M,a.COMPILE_STATUS)||console.log(a.getShaderInfoLog(M));a.getProgramParameter(d,a.LINK_STATUS)||console.log(a.getProgramInfoLog(d));a.useProgram(d);d.drawInProgress=!1;d.texCoordLocation=a.getAttribLocation(d,"a_texCoord");
a.enableVertexAttribArray(d.texCoordLocation);"multires"!=y?(ga||(ga=a.createBuffer()),a.bindBuffer(a.ARRAY_BUFFER,ga),a.bufferData(a.ARRAY_BUFFER,new Float32Array([-1,1,1,1,1,-1,-1,1,1,-1,-1,-1]),a.STATIC_DRAW),a.vertexAttribPointer(d.texCoordLocation,2,a.FLOAT,!1,0,0),d.aspectRatio=a.getUniformLocation(d,"u_aspectRatio"),a.uniform1f(d.aspectRatio,w.clientWidth/w.clientHeight),d.psi=a.getUniformLocation(d,"u_psi"),d.theta=a.getUniformLocation(d,"u_theta"),d.f=a.getUniformLocation(d,"u_f"),d.h=a.getUniformLocation(d,
"u_h"),d.v=a.getUniformLocation(d,"u_v"),d.vo=a.getUniformLocation(d,"u_vo"),d.rot=a.getUniformLocation(d,"u_rot"),a.uniform1f(d.h,$/(2*Math.PI)),a.uniform1f(d.v,p/Math.PI),a.uniform1f(d.vo,b/Math.PI*2),"equirectangular"==y&&(d.backgroundColor=a.getUniformLocation(d,"u_backgroundColor"),a.uniform4fv(d.backgroundColor,(g.backgroundColor?g.backgroundColor:[0,0,0]).concat([1]))),d.texture=a.createTexture(),a.bindTexture(k,d.texture),"cubemap"==y?(a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X,0,a.RGB,a.RGB,
a.UNSIGNED_BYTE,s[1]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_X,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[3]),a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[4]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[5]),a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[0]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[2])):a.texImage2D(k,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s),a.texParameteri(k,a.TEXTURE_WRAP_S,
a.CLAMP_TO_EDGE),a.texParameteri(k,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(k,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(k,a.TEXTURE_MAG_FILTER,a.LINEAR)):(d.vertPosLocation=a.getAttribLocation(d,"a_vertCoord"),a.enableVertexAttribArray(d.vertPosLocation),B||(B=a.createBuffer()),Y||(Y=a.createBuffer()),ya||(ya=a.createBuffer()),a.bindBuffer(a.ARRAY_BUFFER,Y),a.bufferData(a.ARRAY_BUFFER,new Float32Array([0,0,1,0,1,1,0,1]),a.STATIC_DRAW),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,ya),a.bufferData(a.ELEMENT_ARRAY_BUFFER,
new Uint16Array([0,1,2,0,2,3]),a.STATIC_DRAW),d.perspUniform=a.getUniformLocation(d,"u_perspMatrix"),d.cubeUniform=a.getUniformLocation(d,"u_cubeMatrix"),d.level=-1,d.currentNodes=[],d.nodeCache=[],d.nodeCacheTimestamp=0);$=a.getError();if(0!==$)throw console.log("Error: Something went wrong with WebGL!",$),{type:"webgl error"};h()}};this.destroy=function(){T!==n&&(w!==n&&T.removeChild(w),S!==n&&T.removeChild(S));if(a){var d=a.getExtension("WEBGL_lose_context");d&&d.loseContext()}};this.resize=function(){var k=
E.devicePixelRatio||1;w.width=w.clientWidth*k;w.height=w.clientHeight*k;a&&(1286==a.getError()&&oa(),a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight),"multires"!=y&&a.uniform1f(d.aspectRatio,w.clientWidth/w.clientHeight))};this.resize();this.setPose=function(a,d){ba=[a,d]};this.render=function(k,e,f,l){var p;p=0;l===n&&(l={});l.roll&&(p=l.roll);if(ba!==n){var b=ba[0],h=ba[1],g=k,z=e,x=Math.cos(h)*Math.sin(k)*Math.sin(b)+Math.cos(k)*(Math.cos(b)*Math.cos(e)+Math.sin(h)*Math.sin(b)*Math.sin(e)),
A=-Math.sin(k)*Math.sin(h)+Math.cos(k)*Math.cos(h)*Math.sin(e);k=Math.cos(h)*Math.cos(b)*Math.sin(k)+Math.cos(k)*(-Math.cos(e)*Math.sin(b)+Math.cos(b)*Math.sin(h)*Math.sin(e));k=Math.asin(Math.max(Math.min(k,1),-1));e=Math.atan2(A,x);b=[Math.cos(g)*(Math.sin(h)*Math.sin(b)*Math.cos(z)-Math.cos(b)*Math.sin(z)),Math.cos(g)*Math.cos(h)*Math.cos(z),Math.cos(g)*(Math.cos(b)*Math.sin(h)*Math.cos(z)+Math.sin(z)*Math.sin(b))];h=[-Math.cos(k)*Math.sin(e),Math.cos(k)*Math.cos(e)];h=Math.acos(Math.max(Math.min((b[0]*
h[0]+b[1]*h[1])/(Math.sqrt(b[0]*b[0]+b[1]*b[1]+b[2]*b[2])*Math.sqrt(h[0]*h[0]+h[1]*h[1])),1),-1));0>b[2]&&(h=2*Math.PI-h);p+=h}if(a||"multires"!=y&&"cubemap"!=y){if("multires"!=y)f=2*Math.atan(Math.tan(0.5*f)/(w.clientWidth/w.clientHeight)),f=1/Math.tan(0.5*f),a.uniform1f(d.psi,e),a.uniform1f(d.theta,k),a.uniform1f(d.rot,p),a.uniform1f(d.f,f),!0===qa&&"equirectangular"==y&&(a.bindTexture(a.TEXTURE_2D,d.texture),a.texImage2D(a.TEXTURE_2D,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s)),a.drawArrays(a.TRIANGLES,0,
6);else{b=w.clientWidth/w.clientHeight;h=2*Math.atan(Math.tan(f/2)*w.clientHeight/w.clientWidth);h=1/Math.tan(h/2);b=[h/b,0,0,0,0,h,0,0,0,0,100.1/-99.9,20/-99.9,0,0,-1,0];for(h=1;h<s.maxLevel&&w.width>s.tileResolution*Math.pow(2,h-1)*Math.tan(f/2)*0.707;)h++;d.level=h;h=[1,0,0,0,1,0,0,0,1];h=ma(h,-p,"z");h=ma(h,-k,"x");h=ma(h,e,"y");h=[h[0],h[1],h[2],0,h[3],h[4],h[5],0,h[6],h[7],h[8],0,0,0,0,1];a.uniformMatrix4fv(d.perspUniform,!1,new Float32Array(na(b)));a.uniformMatrix4fv(d.cubeUniform,!1,new Float32Array(na(h)));
b=[b[0]*h[0],b[0]*h[1],b[0]*h[2],0,b[5]*h[4],b[5]*h[5],b[5]*h[6],0,b[10]*h[8],b[10]*h[9],b[10]*h[10],b[11],-h[8],-h[9],-h[10],0];d.nodeCache.sort(ab);if(200<d.nodeCache.length&&d.nodeCache.length>d.currentNodes.length+50)for(h=d.nodeCache.splice(200,d.nodeCache.length-200),p=0;p<h.length;p++)a.deleteTexture(h[p].texture);d.currentNodes=[];h="fbudlr".split("");for(p=0;6>p;p++)g=new V(pa[p],h[p],1,0,0,s.fullpath),W(b,g,k,e,f);d.currentNodes.sort(U);for(p=0;p<d.currentNodes.length;p++)if(!d.currentNodes[p].texture){setTimeout(Ga,
0,d.currentNodes[p]);break}if(!d.drawInProgress){d.drawInProgress=!0;for(k=0;k<d.currentNodes.length;k++)d.currentNodes[k].textureLoaded&&(a.bindBuffer(a.ARRAY_BUFFER,B),a.bufferData(a.ARRAY_BUFFER,new Float32Array(d.currentNodes[k].vertices),a.STATIC_DRAW),a.vertexAttribPointer(d.vertPosLocation,3,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,Y),a.vertexAttribPointer(d.texCoordLocation,2,a.FLOAT,!1,0,0),a.bindTexture(a.TEXTURE_2D,d.currentNodes[k].texture),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,
0));d.drawInProgress=!1}}if(l.returnImage!==n)return w.toDataURL("image/png")}else for(p=ja/2,l={f:"translate3d(-"+(p+2)+"px, -"+(p+2)+"px, -"+p+"px)",b:"translate3d("+(p+2)+"px, -"+(p+2)+"px, "+p+"px) rotateX(180deg) rotateZ(180deg)",u:"translate3d(-"+(p+2)+"px, -"+p+"px, "+(p+2)+"px) rotateX(270deg)",d:"translate3d(-"+(p+2)+"px, "+p+"px, -"+(p+2)+"px) rotateX(90deg)",l:"translate3d(-"+p+"px, -"+(p+2)+"px, "+(p+2)+"px) rotateX(180deg) rotateY(90deg) rotateZ(180deg)",r:"translate3d("+p+"px, -"+(p+
2)+"px, -"+(p+2)+"px) rotateY(270deg)"},f=1/Math.tan(f/2),f=f*w.clientWidth/2+"px",k="perspective("+f+") translateZ("+f+") rotateX("+k+"rad) rotateY("+e+"rad) ",e=Object.keys(l),p=0;6>p;p++)f=S.querySelector(".pnlm-"+e[p]+"face").style,f.webkitTransform=k+l[e[p]],f.transform=k+l[e[p]]};this.isLoading=function(){if(a&&"multires"==y)for(var f=0;f<d.currentNodes.length;f++)if(!d.currentNodes[f].textureLoaded)return!0;return!1};this.getCanvas=function(){return w};var fa=function(){function d(){var b=
this;this.texture=this.callback=null;this.image=new Image;this.image.crossOrigin="anonymous";this.image.addEventListener("load",function(){var d=b.image;a.bindTexture(a.TEXTURE_2D,b.texture);a.texImage2D(a.TEXTURE_2D,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,d);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.bindTexture(a.TEXTURE_2D,
null);b.callback(b.texture);p.length?(d=p.shift(),b.loadTexture(d.src,d.texture,d.callback)):l[f++]=b})}function e(a,b,d){this.src=a;this.texture=b;this.callback=d}var f=4,l={},p=[];d.prototype.loadTexture=function(a,b,d){this.texture=b;this.callback=d;this.image.src=a};for(var b=0;b<f;b++)l[b]=new d;return function(b,d){var k=a.createTexture();f?l[--f].loadTexture(b,k,d):p.push(new e(b,k,d));return k}}()}var l="attribute vec2 a_texCoord;varying vec2 v_texCoord;void main() {gl_Position = vec4(a_texCoord, 0.0, 1.0);v_texCoord = a_texCoord;}",
x="attribute vec3 a_vertCoord;attribute vec2 a_texCoord;uniform mat4 u_cubeMatrix;uniform mat4 u_perspMatrix;varying mediump vec2 v_texCoord;void main(void) {gl_Position = u_perspMatrix * u_cubeMatrix * vec4(a_vertCoord, 1.0);v_texCoord = a_texCoord;}",Ia="precision mediump float;\nuniform float u_aspectRatio;\nuniform float u_psi;\nuniform float u_theta;\nuniform float u_f;\nuniform float u_h;\nuniform float u_v;\nuniform float u_vo;\nuniform float u_rot;\nconst float PI = 3.14159265358979323846264;\nuniform sampler2D u_image;\nuniform samplerCube u_imageCube;\nvarying vec2 v_texCoord;\nuniform vec4 u_backgroundColor;\nvoid main() {\nfloat x = v_texCoord.x * u_aspectRatio;\nfloat y = v_texCoord.y;\nfloat sinrot = sin(u_rot);\nfloat cosrot = cos(u_rot);\nfloat rot_x = x * cosrot - y * sinrot;\nfloat rot_y = x * sinrot + y * cosrot;\nfloat sintheta = sin(u_theta);\nfloat costheta = cos(u_theta);\nfloat a = u_f * costheta - rot_y * sintheta;\nfloat root = sqrt(rot_x * rot_x + a * a);\nfloat lambda = atan(rot_x / root, a / root) + u_psi;\nfloat phi = atan((rot_y * costheta + u_f * sintheta) / root);float cosphi = cos(phi);\ngl_FragColor = textureCube(u_imageCube, vec3(cosphi*sin(lambda), sin(phi), cosphi*cos(lambda)));\n}",
Ha="precision mediump float;\nuniform float u_aspectRatio;\nuniform float u_psi;\nuniform float u_theta;\nuniform float u_f;\nuniform float u_h;\nuniform float u_v;\nuniform float u_vo;\nuniform float u_rot;\nconst float PI = 3.14159265358979323846264;\nuniform sampler2D u_image;\nuniform samplerCube u_imageCube;\nvarying vec2 v_texCoord;\nuniform vec4 u_backgroundColor;\nvoid main() {\nfloat x = v_texCoord.x * u_aspectRatio;\nfloat y = v_texCoord.y;\nfloat sinrot = sin(u_rot);\nfloat cosrot = cos(u_rot);\nfloat rot_x = x * cosrot - y * sinrot;\nfloat rot_y = x * sinrot + y * cosrot;\nfloat sintheta = sin(u_theta);\nfloat costheta = cos(u_theta);\nfloat a = u_f * costheta - rot_y * sintheta;\nfloat root = sqrt(rot_x * rot_x + a * a);\nfloat lambda = atan(rot_x / root, a / root) + u_psi;\nfloat phi = atan((rot_y * costheta + u_f * sintheta) / root);lambda = mod(lambda + PI, PI * 2.0) - PI;\nvec2 coord = vec2(lambda / PI, phi / (PI / 2.0));\nif(coord.x < -u_h || coord.x > u_h || coord.y < -u_v + u_vo || coord.y > u_v + u_vo)\ngl_FragColor = u_backgroundColor;\nelse\ngl_FragColor = texture2D(u_image, vec2((coord.x + u_h) / (u_h * 2.0), (-coord.y + u_v + u_vo) / (u_v * 2.0)));\n}",
ka="varying mediump vec2 v_texCoord;uniform sampler2D u_sampler;void main(void) {gl_FragColor = texture2D(u_sampler, v_texCoord);}";return{renderer:function(f,l,n,x){return new wa(f,l,n,x)}}}(window,document);window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(E,f){window.setTimeout(E,1E3/60)}}());
window.pannellum=function(E,f,n){function wa(l,x){function Ia(t){E.removeEventListener("deviceorientation",Ia);t&&null!==t.alpha&&null!==t.beta&&null!==t.gamma?(u.container.appendChild(u.orientation),za=!0,Xa&&Pa()):za=!1}function Ha(){var t=f.createElement("div");t.innerHTML="\x3c!--[if lte IE 9]><i></i><![endif]--\x3e";if(1==t.getElementsByTagName("i").length)U();else{ra=c.hfov;Aa=c.pitch;var a;if("cubemap"==c.type){N=[];for(t=0;6>t;t++)N.push(new Image),N[t].crossOrigin="anonymous";r.load.lbox.style.display=
"block";r.load.lbar.style.display="none"}else if("multires"==c.type)t=JSON.parse(JSON.stringify(c.multiRes)),c.basePath&&c.multiRes.basePath&&!/^(?:[a-z]+:)?\/\//i.test(c.multiRes.basePath)?t.basePath=c.basePath+c.multiRes.basePath:c.multiRes.basePath?t.basePath=c.multiRes.basePath:c.basePath&&(t.basePath=c.basePath),N=t;else if(!0===c.dynamic)N=c.panorama;else{if(c.panorama===n){U("No panorama image was specified.");return}N=new Image}if("cubemap"==c.type)for(var b=6,d=function(){b--;0===b&&T()},
e=function(a){var t=f.createElement("a");t.href=a.target.src;t.innerHTML=t.href;U("The file "+t.outerHTML+" could not be accessed.")},t=0;t<N.length;t++)N[t].onload=d,N[t].onerror=e,a=c.cubeMap[t],c.basePath&&!ka(a)&&(a=c.basePath+a),N[t].src=encodeURI(a);else if("multires"==c.type)T();else if(a="",c.basePath&&(a=c.basePath),!0!==c.dynamic){a=ka(c.panorama)?c.panorama:a+c.panorama;N.onload=function(){E.URL.revokeObjectURL(this.src);T()};var g=new XMLHttpRequest;g.onloadend=function(){if(200!=g.status){var t=
f.createElement("a");t.href=encodeURI(a);t.innerHTML=t.href;U("The file "+t.outerHTML+" could not be accessed.")}wa(this.response);r.load.msg.innerHTML=""};g.onprogress=function(a){if(a.lengthComputable){r.load.lbarFill.style.width=a.loaded/a.total*100+"%";var t,c;1E6<a.total?(t="MB",c=(a.loaded/1E6).toFixed(2),a=(a.total/1E6).toFixed(2)):1E3<a.total?(t="kB",c=(a.loaded/1E3).toFixed(1),a=(a.total/1E3).toFixed(1)):(t="B",c=a.loaded,a=a.total);r.load.msg.innerHTML=c+" / "+a+" "+t}else r.load.lbox.style.display=
"block",r.load.lbar.style.display="none"};try{g.open("GET",a,!0)}catch(h){U("There is something wrong with the panorama URL.")}g.responseType="blob";g.setRequestHeader("Accept","image/*,*/*;q=0.9");g.send()}C.classList.add("pnlm-grab");C.classList.remove("pnlm-grabbing")}}function ka(a){return/^(?:[a-z]+:)?\/\//i.test(a)||"/"==a[0]||"blob:"==a.slice(0,5)}function T(){D||(D=new libpannellum.renderer(J));Qa||(Qa=!0,F.addEventListener("mousedown",xa,!1),f.addEventListener("mousemove",Ga,!1),f.addEventListener("mouseup",
aa,!1),c.mouseZoom&&(C.addEventListener("mousewheel",ja,!1),C.addEventListener("DOMMouseScroll",ja,!1)),c.doubleClickZoom&&F.addEventListener("dblclick",ma,!1),C.addEventListener("mozfullscreenchange",A,!1),C.addEventListener("webkitfullscreenchange",A,!1),C.addEventListener("msfullscreenchange",A,!1),C.addEventListener("fullscreenchange",A,!1),E.addEventListener("resize",ga,!1),E.addEventListener("orientationchange",ga,!1),C.addEventListener("keydown",S,!1),C.addEventListener("keyup",ba,!1),C.addEventListener("blur",
pa,!1),f.addEventListener("mouseleave",aa,!1),F.addEventListener("touchstart",oa,!1),F.addEventListener("touchmove",w,!1),F.addEventListener("touchend",d,!1),F.addEventListener("pointerdown",a,!1),F.addEventListener("pointermove",R,!1),F.addEventListener("pointerup",M,!1),F.addEventListener("pointerleave",M,!1),E.navigator.pointerEnabled&&(l.style.touchAction="none"));e();setTimeout(function(){},500)}function wa(a){var m=new FileReader;m.addEventListener("loadend",function(){var b=m.result;if(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)){var d=
b.indexOf("\u00ff\u00c2");(0>d||65536<d)&&U("Due to iOS 8's broken WebGL implementation, only progressive encoded JPEGs work for your device (this panorama uses standard encoding).")}d=b.indexOf("<x:xmpmeta");if(-1<d&&!0!==c.ignoreGPanoXMP){var e=b.substring(d,b.indexOf("</x:xmpmeta>")+12),f=function(a){var t;0<=e.indexOf(a+'="')?(t=e.substring(e.indexOf(a+'="')+a.length+2),t=t.substring(0,t.indexOf('"'))):0<=e.indexOf(a+">")&&(t=e.substring(e.indexOf(a+">")+a.length+1),t=t.substring(0,t.indexOf("<")));
return t!==n?Number(t):null},b=f("GPano:FullPanoWidthPixels"),d=f("GPano:CroppedAreaImageWidthPixels"),g=f("GPano:FullPanoHeightPixels"),h=f("GPano:CroppedAreaImageHeightPixels"),k=f("GPano:CroppedAreaTopPixels"),l=f("GPano:PoseHeadingDegrees"),p=f("GPano:PosePitchDegrees"),f=f("GPano:PoseRollDegrees");null!==b&&null!==d&&null!==g&&null!==h&&null!==k&&(0>Z.indexOf("haov")&&(c.haov=d/b*360),0>Z.indexOf("vaov")&&(c.vaov=h/g*180),0>Z.indexOf("vOffset")&&(c.vOffset=-180*((k+h/2)/g-0.5)),null!==l&&0>Z.indexOf("northOffset")&&
(c.northOffset=l,!1!==c.compass&&(c.compass=!0)),null!==p&&null!==f&&(0>Z.indexOf("horizonPitch")&&(c.horizonPitch=p),0>Z.indexOf("horizonRoll")&&(c.horizonRoll=f)))}N.src=E.URL.createObjectURL(a)});m.readAsBinaryString!==n?m.readAsBinaryString(a):m.readAsText(a)}function U(a){a===n&&(a="Your browser does not have the necessary WebGL support to display this panorama.");r.errorMsg.innerHTML="<p>"+a+"</p>";u.load.style.display="none";r.load.box.style.display="none";r.errorMsg.style.display="table";
Ja=!0;J.style.display="none";ca("error",a)}function V(a){var c=W(a);da.style.left=c.x+"px";da.style.top=c.y+"px";clearTimeout(V.t1);clearTimeout(V.t2);da.style.display="block";da.style.opacity=1;V.t1=setTimeout(function(){da.style.opacity=0},2E3);V.t2=setTimeout(function(){da.style.display="none"},2500);a.preventDefault()}function W(a){var c=l.getBoundingClientRect(),b={};b.x=a.clientX-c.left;b.y=a.clientY-c.top;return b}function xa(a){a.preventDefault();l.focus();if(I&&c.draggable){var m=W(a);if(c.hotSpotDebug){var b=
na(a);console.log("Pitch: "+b[0]+", Yaw: "+b[1]+", Center Pitch: "+c.pitch+", Center Yaw: "+c.yaw+", HFOV: "+c.hfov)}K();Fa();c.roll=0;v.hfov=0;ha=!0;O=Date.now();sa=m.x;ta=m.y;Ka=c.yaw;La=c.pitch;C.classList.add("pnlm-grabbing");C.classList.remove("pnlm-grab");ca("mousedown",a);B()}}function ma(a){c.minHfov===c.hfov?ua.setHfov(ra,1E3):(a=na(a),ua.lookAt(a[0],a[1],c.minHfov,1E3))}function na(a){var m=W(a);a=D.getCanvas();var b=a.clientWidth,d=a.clientHeight;a=m.x/b*2-1;var d=(1-m.y/d*2)*d/b,e=1/Math.tan(c.hfov*
Math.PI/360),f=Math.sin(c.pitch*Math.PI/180),g=Math.cos(c.pitch*Math.PI/180),m=e*g-d*f,b=Math.sqrt(a*a+m*m),d=180*Math.atan((d*g+e*f)/b)/Math.PI;a=180*Math.atan2(a/b,m/b)/Math.PI+c.yaw;-180>a&&(a+=360);180<a&&(a-=360);return[d,a]}function Ga(a){if(ha&&I){O=Date.now();var m=D.getCanvas(),b=m.clientWidth,m=m.clientHeight;a=W(a);var d=180*(Math.atan(sa/b*2-1)-Math.atan(a.x/b*2-1))/Math.PI*c.hfov/90+Ka;v.yaw=(d-c.yaw)%360*0.2;c.yaw=d;b=360*Math.atan(Math.tan(c.hfov/360*Math.PI)*m/b)/Math.PI;b=180*(Math.atan(a.y/
m*2-1)-Math.atan(ta/m*2-1))/Math.PI*b/90+La;v.pitch=0.2*(b-c.pitch);c.pitch=b}}function aa(a){ha&&(ha=!1,15<Date.now()-O&&(v.pitch=v.yaw=0),C.classList.add("pnlm-grab"),C.classList.remove("pnlm-grabbing"),O=Date.now(),ca("mouseup",a))}function oa(a){if(I&&c.draggable){K();Fa();c.roll=0;v.hfov=0;var m=W(a.targetTouches[0]);sa=m.x;ta=m.y;if(2==a.targetTouches.length){var b=W(a.targetTouches[1]);sa+=0.5*(b.x-m.x);ta+=0.5*(b.y-m.y);Ba=Math.sqrt((m.x-b.x)*(m.x-b.x)+(m.y-b.y)*(m.y-b.y))}ha=!0;O=Date.now();
Ka=c.yaw;La=c.pitch;ca("touchstart",a);B()}}function w(a){if(c.draggable&&(a.preventDefault(),I&&(O=Date.now()),ha&&I)){var m=W(a.targetTouches[0]),b=m.x,d=m.y;2==a.targetTouches.length&&-1!=Ba&&(a=W(a.targetTouches[1]),b+=0.5*(a.x-m.x),d+=0.5*(a.y-m.y),m=Math.sqrt((m.x-a.x)*(m.x-a.x)+(m.y-a.y)*(m.y-a.y)),Q(c.hfov+0.1*(Ba-m)),Ba=m);m=c.hfov/360;b=(sa-b)*m+Ka;v.yaw=(b-c.yaw)%360*0.2;c.yaw=b;d=(d-ta)*m+La;v.pitch=0.2*(d-c.pitch);c.pitch=d}}function d(){ha=!1;150<Date.now()-O&&(v.pitch=v.yaw=0);Ba=-1;
O=Date.now();ca("touchend",event)}function a(a){"touch"==a.pointerType&&(ia.push(a.pointerId),va.push({clientX:a.clientX,clientY:a.clientY}),a.targetTouches=va,oa(a),a.preventDefault())}function R(a){if("touch"==a.pointerType)for(var c=0;c<ia.length;c++)if(a.pointerId==ia[c]){va[c].clientX=a.clientX;va[c].clientY=a.clientY;a.targetTouches=va;w(a);break}}function M(a){if("touch"==a.pointerType){for(var c=!1,b=0;b<ia.length;b++)a.pointerId==ia[b]&&(ia[b]=n),ia[b]&&(c=!0);c||(ia=[],va=[],d());a.preventDefault()}}
function ja(a){I&&("fullscreenonly"!=c.mouseZoom||Ca)&&(a.preventDefault(),K(),O=Date.now(),a.wheelDeltaY?(Q(c.hfov-0.05*a.wheelDeltaY),v.hfov=0>a.wheelDelta?1:-1):a.wheelDelta?(Q(c.hfov-0.05*a.wheelDelta),v.hfov=0>a.wheelDelta?1:-1):a.detail&&(Q(c.hfov+1.5*a.detail),v.hfov=0<a.detail?1:-1),B())}function S(a){K();O=Date.now();Fa();c.roll=0;var m=a.which||a.keycode;0>Ya.indexOf(m)||(a.preventDefault(),27==m?Ca&&Oa():s(m,!0))}function pa(){for(var a=0;10>a;a++)q[a]=!1}function ba(a){var c=a.which||
a.keycode;0>Ya.indexOf(c)||(a.preventDefault(),s(c,!1))}function s(a,c){var b=!1;switch(a){case 109:case 189:case 17:case 173:q[0]!=c&&(b=!0);q[0]=c;break;case 107:case 187:case 16:case 61:q[1]!=c&&(b=!0);q[1]=c;break;case 38:q[2]!=c&&(b=!0);q[2]=c;break;case 87:q[6]!=c&&(b=!0);q[6]=c;break;case 40:q[3]!=c&&(b=!0);q[3]=c;break;case 83:q[7]!=c&&(b=!0);q[7]=c;break;case 37:q[4]!=c&&(b=!0);q[4]=c;break;case 65:q[8]!=c&&(b=!0);q[8]=c;break;case 39:q[5]!=c&&(b=!0);q[5]=c;break;case 68:q[9]!=c&&(b=!0),
q[9]=c}b&&c&&(ea="undefined"!==typeof performance&&performance.now()?performance.now():Date.now(),B())}function y(){if(I){var a=!1,m=c.pitch,b=c.yaw,d=c.hfov,e;e="undefined"!==typeof performance&&performance.now()?performance.now():Date.now();ea===n&&(ea=e);var f=(e-ea)*c.hfov/1700,f=Math.min(f,1);q[0]&&!0===c.keyboardZoom&&(Q(c.hfov+(0.8*v.hfov+0.5)*f),a=!0);q[1]&&!0===c.keyboardZoom&&(Q(c.hfov+(0.8*v.hfov-0.2)*f),a=!0);if(q[2]||q[6])c.pitch+=(0.8*v.pitch+0.2)*f,a=!0;if(q[3]||q[7])c.pitch+=(0.8*
v.pitch-0.2)*f,a=!0;if(q[4]||q[8])c.yaw+=(0.8*v.yaw-0.2)*f,a=!0;if(q[5]||q[9])c.yaw+=(0.8*v.yaw+0.2)*f,a=!0;a&&(O=Date.now());Date.now();if(c.autoRotate){if(0.001<e-ea){var a=(e-ea)/1E3,g=(v.yaw/a*f-0.2*c.autoRotate)*a,g=(0<-c.autoRotate?1:-1)*Math.min(Math.abs(c.autoRotate*a),Math.abs(g));c.yaw+=g}c.autoRotateStopDelay&&(c.autoRotateStopDelay-=e-ea,0>=c.autoRotateStopDelay&&(c.autoRotateStopDelay=!1,X=c.autoRotate,c.autoRotate=0))}H.pitch&&(qa("pitch"),m=c.pitch);H.yaw&&(qa("yaw"),b=c.yaw);H.hfov&&
(qa("hfov"),d=c.hfov);0<f&&!c.autoRotate&&(q[4]||q[5]||q[8]||q[9]||H.yaw||(c.yaw+=v.yaw*f*0.85),q[2]||q[3]||q[6]||q[7]||H.pitch||(c.pitch+=v.pitch*f*0.85),q[0]||q[1]||H.hfov||Q(c.hfov+v.hfov*f*0.85));ea=e;0<f&&(v.yaw=0.8*v.yaw+(c.yaw-b)/f*0.2,v.pitch=0.8*v.pitch+(c.pitch-m)/f*0.2,v.hfov=0.8*v.hfov+(c.hfov-d)/f*0.2,m=c.autoRotate?Math.abs(c.autoRotate):5,v.yaw=Math.min(m,Math.max(v.yaw,-m)),v.pitch=Math.min(m,Math.max(v.pitch,-m)),v.hfov=Math.min(m,Math.max(v.hfov,-m)));q[0]&&q[0]&&(v.hfov=0);(q[2]||
q[6])&&(q[3]||q[7])&&(v.pitch=0);(q[4]||q[8])&&(q[5]||q[9])&&(v.yaw=0)}}function qa(a){var m=H[a],b=Math.min(1,Math.max((Date.now()-m.startTime)/1E3/(m.duration/1E3),0)),b=m.startPosition+c.animationTimingFunction(b)*(m.endPosition-m.startPosition);if(m.endPosition>m.startPosition&&b>=m.endPosition||m.endPosition<m.startPosition&&b<=m.endPosition||m.endPosition===m.startPosition){b=m.endPosition;v[a]=0;var m=H[a].callback,d=H[a].callbackArgs;delete H[a];"function"==typeof m&&m(d)}c[a]=b}function ga(){A()}
function B(){Ra||(Ra=!0,Y())}function Y(){ya();Sa&&clearTimeout(Sa);if(ha||Ma)requestAnimationFrame(Y);else if(q[0]||q[1]||q[2]||q[3]||q[4]||q[5]||q[6]||q[7]||q[8]||q[9]||c.autoRotate||H.pitch||H.yaw||H.hfov||0.01<Math.abs(v.yaw)||0.01<Math.abs(v.pitch)||0.01<Math.abs(v.hfov))y(),0<=c.autoRotateInactivityDelay&&X&&Date.now()-O>c.autoRotateInactivityDelay&&!c.autoRotate&&(c.autoRotate=X,ua.lookAt(Aa,n,ra,3E3)),requestAnimationFrame(Y);else if(D&&(D.isLoading()||!0===c.dynamic&&Za))requestAnimationFrame(Y);
else{Ra=!1;ea=n;var a=c.autoRotateInactivityDelay-(Date.now()-O);0<a?Sa=setTimeout(function(){c.autoRotate=X;ua.lookAt(Aa,n,ra,3E3);B()},a):0<=c.autoRotateInactivityDelay&&X&&(c.autoRotate=X,ua.lookAt(Aa,n,ra,3E3),B())}}function ya(){var a;if(I){180<c.yaw?c.yaw-=360:-180>c.yaw&&(c.yaw+=360);a=c.yaw;var b=c.maxYaw-c.minYaw,d=-180,e=180;360>b&&(d=c.minYaw+c.hfov/2,e=c.maxYaw-c.hfov/2,b<c.hfov&&(d=e=(d+e)/2));c.yaw=Math.max(d,Math.min(e,c.yaw));!1!==c.autoRotate&&a!=c.yaw&&(c.autoRotate*=-1);a=D.getCanvas();
a=2*Math.atan(Math.tan(c.hfov/180*Math.PI*0.5)/(a.width/a.height))/Math.PI*180;b=c.minPitch+a/2;d=c.maxPitch-a/2;c.maxPitch-c.minPitch<a&&(b=d=(b+d)/2);isNaN(b)&&(b=-90);isNaN(d)&&(d=90);c.pitch=Math.max(b,Math.min(d,c.pitch));D.render(c.pitch*Math.PI/180,c.yaw*Math.PI/180,c.hfov*Math.PI/180,{roll:c.roll*Math.PI/180});c.hotSpots.forEach(h);c.compass&&(Da.style.transform="rotate("+(-c.yaw-c.northOffset)+"deg)",Da.style.webkitTransform="rotate("+(-c.yaw-c.northOffset)+"deg)")}}function fa(a,c,b,d){this.w=
a;this.x=c;this.y=b;this.z=d}function k(a){var b;b=a.alpha;var d=a.beta;a=a.gamma;d=[d?d*Math.PI/180/2:0,a?a*Math.PI/180/2:0,b?b*Math.PI/180/2:0];b=[Math.cos(d[0]),Math.cos(d[1]),Math.cos(d[2])];d=[Math.sin(d[0]),Math.sin(d[1]),Math.sin(d[2])];b=new fa(b[0]*b[1]*b[2]-d[0]*d[1]*d[2],d[0]*b[1]*b[2]-b[0]*d[1]*d[2],b[0]*d[1]*b[2]+d[0]*b[1]*d[2],b[0]*b[1]*d[2]+d[0]*d[1]*b[2]);b=b.multiply(new fa(Math.sqrt(0.5),-Math.sqrt(0.5),0,0));d=E.orientation?-E.orientation*Math.PI/180/2:0;b=b.multiply(new fa(Math.cos(d),
0,-Math.sin(d),0)).toEulerAngles();c.pitch=b[0]/Math.PI*180;c.roll=-b[1]/Math.PI*180;c.yaw=-b[2]/Math.PI*180+c.northOffset+$a}function e(){try{var a={};c.horizonPitch!==n&&(a.horizonPitch=c.horizonPitch*Math.PI/180);c.horizonRoll!==n&&(a.horizonRoll=c.horizonRoll*Math.PI/180);c.backgroundColor!==n&&(a.backgroundColor=c.backgroundColor);D.init(N,c.type,c.dynamic,c.haov*Math.PI/180,c.vaov*Math.PI/180,c.vOffset*Math.PI/180,Na,a);!0!==c.dynamic&&(N=n)}catch(b){if("webgl error"==b.type||"no webgl"==b.type)U();
else if("webgl size error"==b.type)U("This panorama is too big for your device! It's "+b.width+"px wide, but your device only supports images up to "+b.maxWidth+"px wide. Try another device. (If you're the author, try scaling down the image.)");else throw U("Unknown error. Check developer console."),b;}}function Na(){if(c.sceneFadeDuration&&D.fadeImg!==n){D.fadeImg.style.opacity=0;var a=D.fadeImg;delete D.fadeImg;setTimeout(function(){J.removeChild(a);ca("scenechangefadedone")},c.sceneFadeDuration)}Da.style.display=
c.compass?"inline":"none";p();r.load.box.style.display="none";la!==n&&(J.removeChild(la),la=n);I=!0;ca("load");B()}function $(a){a.pitch=Number(a.pitch)||0;a.yaw=Number(a.yaw)||0;var b=f.createElement("div");b.className="pnlm-hotspot-base";b.className=a.cssClass?b.className+(" "+a.cssClass):b.className+(" pnlm-hotspot pnlm-sprite pnlm-"+Ea(a.type));var d=f.createElement("span");a.text&&(d.innerHTML=Ea(a.text));var e;if(a.video){e=f.createElement("video");var g=a.video;c.basePath&&!ka(g)&&(g=c.basePath+
g);e.src=encodeURI(g);e.controls=!0;e.style.width=a.width+"px";J.appendChild(b);d.appendChild(e)}else if(a.image){g=a.image;c.basePath&&!ka(g)&&(g=c.basePath+g);e=f.createElement("a");e.href=encodeURI(a.URL?a.URL:g);e.target="_blank";d.appendChild(e);var h=f.createElement("img");h.src=encodeURI(g);h.style.width=a.width+"px";h.style.paddingTop="5px";J.appendChild(b);e.appendChild(h);d.style.maxWidth="initial"}else a.URL?(e=f.createElement("a"),e.href=encodeURI(a.URL),e.target="_blank",J.appendChild(e),
b.style.cursor="pointer",d.style.cursor="pointer",e.appendChild(b)):(a.sceneId&&(b.onclick=b.ontouchend=function(){b.clicked||(b.clicked=!0,L(a.sceneId,a.targetPitch,a.targetYaw,a.targetHfov));return!1},b.style.cursor="pointer",d.style.cursor="pointer"),J.appendChild(b));if(a.createTooltipFunc)a.createTooltipFunc(b,a.createTooltipArgs);else if(a.text||a.video||a.image)b.classList.add("pnlm-tooltip"),b.appendChild(d),d.style.width=d.scrollWidth-20+"px",d.style.marginLeft=-(d.scrollWidth-b.offsetWidth)/
2+"px",d.style.marginTop=-d.scrollHeight-12+"px";a.clickHandlerFunc&&(b.addEventListener("click",function(c){a.clickHandlerFunc(c,a.clickHandlerArgs)},"false"),b.style.cursor="pointer",d.style.cursor="pointer");a.div=b}function p(){Ta||(c.hotSpots?(c.hotSpots=c.hotSpots.sort(function(a,c){return a.pitch<c.pitch}),c.hotSpots.forEach($)):c.hotSpots=[],Ta=!0,c.hotSpots.forEach(h))}function b(){var a=c.hotSpots;Ta=!1;delete c.hotSpots;if(a)for(var b=0;b<a.length;b++){for(var d=a[b].div;d.parentNode!=
J;)d=d.parentNode;J.removeChild(d);delete a.div}}function h(a){var b=Math.sin(a.pitch*Math.PI/180),d=Math.cos(a.pitch*Math.PI/180),e=Math.sin(c.pitch*Math.PI/180),f=Math.cos(c.pitch*Math.PI/180),g=Math.cos((-a.yaw+c.yaw)*Math.PI/180),h=b*e+d*g*f;if(90>=a.yaw&&-90<a.yaw&&0>=h||(90<a.yaw||-90>=a.yaw)&&0>=h)a.div.style.visibility="hidden";else{var k=Math.sin((-a.yaw+c.yaw)*Math.PI/180),l=Math.tan(c.hfov*Math.PI/360);a.div.style.visibility="visible";var p=D.getCanvas(),n=p.clientWidth,p=p.clientHeight,
b=[-n/l*k*d/h/2,-n/l*(b*f-d*g*e)/h/2],d=Math.sin(c.roll*Math.PI/180),e=Math.cos(c.roll*Math.PI/180),b=[b[0]*e-b[1]*d,b[0]*d+b[1]*e];b[0]+=(n-a.div.offsetWidth)/2;b[1]+=(p-a.div.offsetHeight)/2;n="translate("+b[0]+"px, "+b[1]+"px) translateZ(9999px) rotate("+c.roll+"deg)";a.div.style.webkitTransform=n;a.div.style.MozTransform=n;a.div.style.transform=n}}function g(a){c={};var b,d="haov vaov vOffset northOffset horizonPitch horizonRoll".split(" ");Z=[];for(b in Ua)Ua.hasOwnProperty(b)&&(c[b]=Ua[b]);
for(b in x.default)x.default.hasOwnProperty(b)&&(c[b]=x.default[b],0<=d.indexOf(b)&&Z.push(b));if(null!==a&&""!==a&&x.scenes&&x.scenes[a]){var e=x.scenes[a];for(b in e)e.hasOwnProperty(b)&&(c[b]=e[b],0<=d.indexOf(b)&&Z.push(b));c.scene=a}for(b in x)x.hasOwnProperty(b)&&(c[b]=x[b],0<=d.indexOf(b)&&Z.push(b))}function z(a){if((a=a?a:!1)&&"preview"in c){var b=c.preview;c.basePath&&!ka(b)&&(b=c.basePath+b);la=f.createElement("div");la.className="pnlm-preview-img";la.style.backgroundImage="url('"+encodeURI(b)+
"')";J.appendChild(la)}var b=c.title,d=c.author;a&&("previewTitle"in c&&(c.title=c.previewTitle),"previewAuthor"in c&&(c.author=c.previewAuthor));c.hasOwnProperty("title")||(r.title.innerHTML="");c.hasOwnProperty("author")||(r.author.innerHTML="");c.hasOwnProperty("title")||c.hasOwnProperty("author")||(r.container.style.display="none");for(var e in c)if(c.hasOwnProperty(e))switch(e){case "title":r.title.innerHTML=Ea(c[e]);r.container.style.display="inline";break;case "author":r.author.innerHTML="by "+
Ea(c[e]);r.container.style.display="inline";break;case "fallback":r.errorMsg.innerHTML='<p>Your browser does not support WebGL.<br><a href="'+encodeURI(c[e])+'" target="_blank">Click here to view this panorama in an alternative viewer.</a></p>';break;case "hfov":Q(Number(c[e]));break;case "autoLoad":!0===c[e]&&D===n&&(r.load.box.style.display="inline",u.load.style.display="none",Ha());break;case "showZoomCtrl":u.zoom.style.display=c[e]&&!1!=c.showControls?"block":"none";break;case "showFullscreenCtrl":u.fullscreen.style.display=
c[e]&&!1!=c.showControls&&("fullscreen"in f||"mozFullScreen"in f||"webkitIsFullScreen"in f||"msFullscreenElement"in f)?"block":"none";break;case "hotSpotDebug":Va.style.display=c[e]?"block":"none";break;case "showControls":c[e]||(u.orientation.style.display="none",u.zoom.style.display="none",u.fullscreen.style.display="none");break;case "orientationOnByDefault":c[e]&&(za===n?Xa=!0:!0===za&&Pa());break;case "loadButtonLabel":u.load.innerHTML="<p>"+Ea(c[e])+"</p>"}a&&(b?c.title=b:delete c.title,d?c.author=
d:delete c.author)}function Oa(){if(I&&!Ja)if(Ca)f.exitFullscreen?f.exitFullscreen():f.mozCancelFullScreen?f.mozCancelFullScreen():f.webkitCancelFullScreen?f.webkitCancelFullScreen():f.msExitFullscreen&&f.msExitFullscreen();else try{l.requestFullscreen?l.requestFullscreen():l.mozRequestFullScreen?l.mozRequestFullScreen():l.msRequestFullscreen?l.msRequestFullscreen():l.webkitRequestFullScreen()}catch(a){}}function A(){f.fullscreen||f.mozFullScreen||f.webkitIsFullScreen||f.msFullscreenElement?(u.fullscreen.classList.add("pnlm-fullscreen-toggle-button-active"),
Ca=!0):(u.fullscreen.classList.remove("pnlm-fullscreen-toggle-button-active"),Ca=!1);D.resize();Q(c.hfov);B()}function Wa(a){var b=c.minHfov;"multires"==c.type&&D&&(b=Math.min(b,D.getCanvas().width/(c.multiRes.cubeResolution/90*0.9)));return b>c.maxHfov?(console.log("HFOV bounds do not make sense (minHfov > maxHfov)."),c.hfov):a<b?b:a>c.maxHfov?c.maxHfov:a}function Q(a){c.hfov=Wa(a)}function K(){H={};X=c.autoRotate?c.autoRotate:X;c.autoRotate=!1}function G(){Ja&&(r.load.box.style.display="none",r.errorMsg.style.display=
"none",Ja=!1,ca("errorcleared"));u.load.style.display="none";r.load.box.style.display="inline";Ha()}function L(a,d,e,f,h){I=!1;H={};var k,l;if(c.sceneFadeDuration&&!h&&(k=D.render(c.pitch*Math.PI/180,c.yaw*Math.PI/180,c.hfov*Math.PI/180,{returnImage:!0}),k!==n)){h=new Image;h.className="pnlm-fade-img";h.style.transition="opacity "+c.sceneFadeDuration/1E3+"s";h.style.width="100%";h.style.height="100%";h.onload=function(){L(a,d,e,f,!0)};h.src=k;J.appendChild(h);D.fadeImg=h;return}h="same"===d?c.pitch:
d;k="same"===e?c.yaw:"sameAzimuth"===e?c.yaw+(c.northOffset||0)-(x.scenes[a].northOffset||0):e;l="same"===f?c.hfov:f;b();g(a);v.yaw=v.pitch=v.hfov=0;z();h!==n&&(c.pitch=h);k!==n&&(c.yaw=k);l!==n&&(c.hfov=l);ca("scenechange",a);G()}function Fa(){E.removeEventListener("deviceorientation",k);u.orientation.classList.remove("pnlm-orientation-button-active");Ma=!1}function Pa(){Ma=!0;$a=c.yaw;E.addEventListener("deviceorientation",k);u.orientation.classList.add("pnlm-orientation-button-active");requestAnimationFrame(Y)}
function Ea(a){return x.escapeHTML?String(a).split(/&/g).join("&amp;").split('"').join("&quot;").split("'").join("&#39;").split("<").join("&lt;").split(">").join("&gt;").split("/").join("&#x2f;").split("\n").join("<br>"):String(a).split("\n").join("<br>")}function ca(a){if(a in P)for(var b=P[a].length;0<b;b--)P[a][P[a].length-b].apply(null,[].slice.call(arguments,1))}var ua=this,c,D,la,ha=!1,O=Date.now(),sa=0,ta=0,Ba=-1,Ka=0,La=0,q=Array(10),Ca=!1,I=!1,Ja=!1,Qa=!1,N,ea,v={yaw:0,pitch:0,hfov:0},Ra=
!1,Ma=!1,$a=0,Sa,X=0,ra,Aa,H={},P={},Z=[],Za=!1,Ta=!1,Ua={hfov:100,minHfov:50,maxHfov:120,pitch:0,minPitch:n,maxPitch:n,yaw:0,minYaw:-180,maxYaw:180,roll:0,haov:360,vaov:180,vOffset:0,autoRotate:!1,autoRotateInactivityDelay:-1,autoRotateStopDelay:n,type:"equirectangular",northOffset:0,showFullscreenCtrl:!0,dynamic:!1,doubleClickZoom:!0,keyboardZoom:!0,mouseZoom:!0,showZoomCtrl:!0,autoLoad:!1,showControls:!0,orientationOnByDefault:!1,hotSpotDebug:!1,backgroundColor:[0,0,0],animationTimingFunction:function(a){return 0.5>
a?2*a*a:-1+(4-2*a)*a},loadButtonLabel:"Click to\nLoad\nPanorama",draggable:!0},Ya=[16,17,27,37,38,39,40,61,65,68,83,87,107,109,173,187,189];l="string"===typeof l?f.getElementById(l):l;l.classList.add("pnlm-container");l.tabIndex=0;var C=f.createElement("div");C.className="pnlm-ui";l.appendChild(C);var J=f.createElement("div");J.className="pnlm-render-container";l.appendChild(J);var F=f.createElement("div");F.className="pnlm-dragfix";C.appendChild(F);var da=f.createElement("span");da.className="pnlm-about-msg";
da.innerHTML='<a href="https://pannellum.org/" target="_blank">Pannellum</a> 5fd59e2';C.appendChild(da);F.addEventListener("contextmenu",V);var r={},Va=f.createElement("div");Va.className="pnlm-sprite pnlm-hot-spot-debug-indicator";C.appendChild(Va);r.container=f.createElement("div");r.container.className="pnlm-panorama-info";r.title=f.createElement("div");r.title.className="pnlm-title-box";r.container.appendChild(r.title);r.author=f.createElement("div");r.author.className="pnlm-author-box";r.container.appendChild(r.author);
C.appendChild(r.container);r.load={};r.load.box=f.createElement("div");r.load.box.className="pnlm-load-box";r.load.box.innerHTML="<p>Loading...</p>";r.load.lbox=f.createElement("div");r.load.lbox.className="pnlm-lbox";r.load.lbox.innerHTML='<div class="pnlm-loading"></div>';r.load.box.appendChild(r.load.lbox);r.load.lbar=f.createElement("div");r.load.lbar.className="pnlm-lbar";r.load.lbarFill=f.createElement("div");r.load.lbarFill.className="pnlm-lbar-fill";r.load.lbar.appendChild(r.load.lbarFill);
r.load.box.appendChild(r.load.lbar);r.load.msg=f.createElement("p");r.load.msg.className="pnlm-lmsg";r.load.box.appendChild(r.load.msg);C.appendChild(r.load.box);r.errorMsg=f.createElement("div");r.errorMsg.className="pnlm-error-msg pnlm-info-box";C.appendChild(r.errorMsg);var u={};u.container=f.createElement("div");u.container.className="pnlm-controls-container";C.appendChild(u.container);u.load=f.createElement("div");u.load.className="pnlm-load-button";u.load.addEventListener("click",function(){z();
G()});C.appendChild(u.load);u.zoom=f.createElement("div");u.zoom.className="pnlm-zoom-controls pnlm-controls";u.zoomIn=f.createElement("div");u.zoomIn.className="pnlm-zoom-in pnlm-sprite pnlm-control";u.zoomIn.addEventListener("click",function(){I&&(Q(c.hfov-5),B())});u.zoom.appendChild(u.zoomIn);u.zoomOut=f.createElement("div");u.zoomOut.className="pnlm-zoom-out pnlm-sprite pnlm-control";u.zoomOut.addEventListener("click",function(){I&&(Q(c.hfov+5),B())});u.zoom.appendChild(u.zoomOut);u.container.appendChild(u.zoom);
u.fullscreen=f.createElement("div");u.fullscreen.addEventListener("click",Oa);u.fullscreen.className="pnlm-fullscreen-toggle-button pnlm-sprite pnlm-fullscreen-toggle-button-inactive pnlm-controls pnlm-control";(f.fullscreenEnabled||f.mozFullScreenEnabled||f.webkitFullscreenEnabled||f.msFullscreenEnabled)&&u.container.appendChild(u.fullscreen);u.orientation=f.createElement("div");u.orientation.addEventListener("click",function(a){Ma?Fa():Pa()});u.orientation.addEventListener("mousedown",function(a){a.stopPropagation()});
u.orientation.addEventListener("touchstart",function(a){a.stopPropagation()});u.orientation.addEventListener("pointerdown",function(a){a.stopPropagation()});u.orientation.className="pnlm-orientation-button pnlm-orientation-button-inactive pnlm-sprite pnlm-controls pnlm-control";var za,Xa=!1;E.DeviceOrientationEvent?E.addEventListener("deviceorientation",Ia):za=!1;var Da=f.createElement("div");Da.className="pnlm-compass pnlm-controls pnlm-control";C.appendChild(Da);x.firstScene?g(x.firstScene):x.default&&
x.default.firstScene?g(x.default.firstScene):g(null);z(!0);var ia=[],va=[];fa.prototype.multiply=function(a){return new fa(this.w*a.w-this.x*a.x-this.y*a.y-this.z*a.z,this.x*a.w+this.w*a.x+this.y*a.z-this.z*a.y,this.y*a.w+this.w*a.y+this.z*a.x-this.x*a.z,this.z*a.w+this.w*a.z+this.x*a.y-this.y*a.x)};fa.prototype.toEulerAngles=function(){var a=Math.atan2(2*(this.w*this.x+this.y*this.z),1-2*(this.x*this.x+this.y*this.y)),b=Math.asin(2*(this.w*this.y-this.z*this.x)),c=Math.atan2(2*(this.w*this.z+this.x*
this.y),1-2*(this.y*this.y+this.z*this.z));return[a,b,c]};this.isLoaded=function(){return I};this.getPitch=function(){return c.pitch};this.setPitch=function(a,b,d,e){(b=b==n?1E3:Number(b))?H.pitch={startTime:Date.now(),startPosition:c.pitch,endPosition:a,duration:b,callback:d,callbackArgs:e}:c.pitch=a;B();return this};this.getPitchBounds=function(){return[c.minPitch,c.maxPitch]};this.setPitchBounds=function(a){c.minPitch=Math.max(-90,Math.min(a[0],90));c.maxPitch=Math.max(-90,Math.min(a[1],90));return this};
this.getYaw=function(){return c.yaw};this.setYaw=function(a,b,d,e){(b=b==n?1E3:Number(b))?H.yaw={startTime:Date.now(),startPosition:c.yaw,endPosition:a,duration:b,callback:d,callbackArgs:e}:c.yaw=a;B();return this};this.getYawBounds=function(){return[c.minYaw,c.maxYaw]};this.setYawBounds=function(a){c.minYaw=Math.max(-180,Math.min(a[0],180));c.maxYaw=Math.max(-180,Math.min(a[1],180));return this};this.getHfov=function(){return c.hfov};this.setHfov=function(a,b,d,e){(b=b==n?1E3:Number(b))?H.hfov={startTime:Date.now(),
startPosition:c.hfov,endPosition:Wa(a),duration:b,callback:d,callbackArgs:e}:Q(a);B();return this};this.getHfovBounds=function(){return[c.minHfov,c.maxHfov]};this.setHfovBounds=function(a){c.minHfov=Math.max(0,a[0]);c.maxHfov=Math.max(0,a[1]);return this};this.lookAt=function(a,b,c,d,e,f){d=d==n?1E3:Number(d);a!==n&&(this.setPitch(a,d,e,f),e=n);b!==n&&(this.setYaw(b,d,e,f),e=n);c!==n&&this.setHfov(c,d,e,f);return this};this.getNorthOffset=function(){return c.northOffset};this.setNorthOffset=function(a){c.northOffset=
Math.min(360,Math.max(0,a));B();return this};this.getHorizonRoll=function(){return c.horizonRoll};this.setHorizonRoll=function(a){c.horizonRoll=Math.min(90,Math.max(-90,a));D.setPose(c.horizonPitch*Math.PI/180,c.horizonRoll*Math.PI/180);B();return this};this.getHorizonPitch=function(){return c.horizonPitch};this.setHorizonPitch=function(a){c.horizonPitch=Math.min(90,Math.max(-90,a));D.setPose(c.horizonPitch*Math.PI/180,c.horizonRoll*Math.PI/180);B();return this};this.startAutoRotate=function(a){a=
a||X||1;c.autoRotate=a;ua.lookAt(Aa,n,ra,3E3);B();return this};this.stopAutoRotate=function(){X=c.autoRotate?c.autoRotate:X;c.autoRotate=!1;c.autoRotateInactivityDelay=-1;return this};this.getRenderer=function(){return D};this.setUpdate=function(a){Za=!0===a;D===n?T():B();return this};this.mouseEventToCoords=function(a){return na(a)};this.loadScene=function(a,b,c,d){I&&L(a,b,c,d);return this};this.getScene=function(){return c.scene};this.addScene=function(a,b){x.scenes[a]=b;return this};this.removeScene=
function(a){if(c.scene===a||!x.scenes.hasOwnProperty(a))return!1;delete x.scenes[a];return!0};this.toggleFullscreen=function(){Oa();return this};this.getConfig=function(){return c};this.addHotSpot=function(a,b){if(b===n&&c.scene===n)c.hotSpots.push(a);else{var d=b!==n?b:c.scene;if(x.scenes.hasOwnProperty(d))x.scenes[d].hasOwnProperty("hotSpots")||(x.scenes[d].hotSpots=[],d==c.scene&&(c.hotSpots=x.scenes[d].hotSpots)),x.scenes[d].hotSpots.push(a);else throw"Invalid scene ID!";}if(b===n||c.scene==b)$(a),
I&&h(a);return this};this.removeHotSpot=function(a){if(!c.hotSpots)return!1;for(var b=0;b<c.hotSpots.length;b++)if(c.hotSpots[b].hasOwnProperty("id")&&c.hotSpots[b].id===a){for(a=c.hotSpots[b].div;a.parentNode!=J;)a=a.parentNode;J.removeChild(a);delete c.hotSpots[b].div;c.hotSpots.splice(b,1);return!0}return!1};this.resize=function(){A()};this.isLoaded=function(){return I};this.on=function(a,b){P[a]=P[a]||[];P[a].push(b);return this};this.off=function(a,b){if(!a)return P={},this;if(b){var c=P[a].indexOf(b);
0<=c&&P[a].splice(c,1);0==P[a].length&&delete P[a]}else delete P[a];return this};this.destroy=function(){D&&D.destroy();Qa&&(F.removeEventListener("mousedown",xa,!1),F.removeEventListener("dblclick",ma,!1),f.removeEventListener("mousemove",Ga,!1),f.removeEventListener("mouseup",aa,!1),l.removeEventListener("mousewheel",ja,!1),l.removeEventListener("DOMMouseScroll",ja,!1),l.removeEventListener("mozfullscreenchange",A,!1),l.removeEventListener("webkitfullscreenchange",A,!1),l.removeEventListener("msfullscreenchange",
A,!1),l.removeEventListener("fullscreenchange",A,!1),E.removeEventListener("resize",ga,!1),E.removeEventListener("orientationchange",ga,!1),l.removeEventListener("keydown",S,!1),l.removeEventListener("keyup",ba,!1),l.removeEventListener("blur",pa,!1),f.removeEventListener("mouseleave",aa,!1),F.removeEventListener("touchstart",oa,!1),F.removeEventListener("touchmove",w,!1),F.removeEventListener("touchend",d,!1),F.removeEventListener("pointerdown",a,!1),F.removeEventListener("pointermove",R,!1),F.removeEventListener("pointerup",
M,!1),F.removeEventListener("pointerleave",M,!1));l.innerHTML="";l.classList.remove("pnlm-container");C.classList.remove("pnlm-grab");C.classList.remove("pnlm-grabbing")}}return{viewer:function(f,n){return new wa(f,n)}}}(window,document);
// Pannellum 05837fd, https://github.com/mpetroff/pannellum
window.libpannellum=function(J,f,m){function Ba(P){function bb(a,e){return 1==a.level&&1!=e.level?-1:1==e.level&&1!=a.level?1:e.timestamp-a.timestamp}function W(a,e){return a.level!=e.level?a.level-e.level:a.diff-e.diff}function X(a,e,d,f,p,c){this.vertices=a;this.side=e;this.level=d;this.x=f;this.y=p;this.path=c.replace("%s",e).replace("%l",d).replace("%x",f).replace("%y",p)}function Y(a,e,f,m,p){var c;var g=e.vertices;c=ea(a,g.slice(0,3));var t=ea(a,g.slice(3,6)),z=ea(a,g.slice(6,9)),g=ea(a,g.slice(9,
12)),y=c[0]+t[0]+z[0]+g[0];-4==y||4==y?c=!1:(y=c[1]+t[1]+z[1]+g[1],c=-4==y||4==y?!1:4!=c[2]+t[2]+z[2]+g[2]);if(c){c=e.vertices;t=c[0]+c[3]+c[6]+c[9];z=c[1]+c[4]+c[7]+c[10];g=c[2]+c[5]+c[8]+c[11];y=Math.sqrt(t*t+z*z+g*g);g=Math.asin(g/y);t=Math.atan2(z,t)-m;t+=t>Math.PI?-2*Math.PI:t<-Math.PI?2*Math.PI:0;t=Math.abs(t);e.diff=Math.acos(Math.sin(f)*Math.sin(g)+Math.cos(f)*Math.cos(g)*Math.cos(t));t=!1;for(z=0;z<d.nodeCache.length;z++)if(d.nodeCache[z].path==e.path){t=!0;d.nodeCache[z].timestamp=d.nodeCacheTimestamp++;
d.nodeCache[z].diff=e.diff;d.currentNodes.push(d.nodeCache[z]);break}t||(e.timestamp=d.nodeCacheTimestamp++,d.currentNodes.push(e),d.nodeCache.push(e));if(e.level<d.level){var g=s.cubeResolution*Math.pow(2,e.level-s.maxLevel),t=Math.ceil(g*s.invTileResolution)-1,z=g%s.tileResolution*2,E=2*g%s.tileResolution;0===E&&(E=s.tileResolution);0===z&&(z=2*s.tileResolution);y=0.5;if(e.x==t||e.y==t)y=1-s.tileResolution/(s.tileResolution+E);var r=1-y,g=[],v=y,Q=y,I=y,l=r,A=r,D=r;if(E<s.tileResolution)if(e.x==
t&&e.y!=t){if(A=Q=0.5,"d"==e.side||"u"==e.side)D=I=0.5}else e.x!=t&&e.y==t&&(l=v=0.5,"l"==e.side||"r"==e.side)&&(D=I=0.5);z<=s.tileResolution&&(e.x==t&&(v=0,l=1,"l"==e.side||"r"==e.side)&&(I=0,D=1),e.y==t&&(Q=0,A=1,"d"==e.side||"u"==e.side)&&(I=0,D=1));E=[c[0],c[1],c[2],c[0]*v+c[3]*l,c[1]*y+c[4]*r,c[2]*I+c[5]*D,c[0]*v+c[6]*l,c[1]*Q+c[7]*A,c[2]*I+c[8]*D,c[0]*y+c[9]*r,c[1]*Q+c[10]*A,c[2]*I+c[11]*D];E=new X(E,e.side,e.level+1,2*e.x,2*e.y,s.fullpath);g.push(E);e.x==t&&z<=s.tileResolution||(E=[c[0]*v+
c[3]*l,c[1]*y+c[4]*r,c[2]*I+c[5]*D,c[3],c[4],c[5],c[3]*y+c[6]*r,c[4]*Q+c[7]*A,c[5]*I+c[8]*D,c[0]*v+c[6]*l,c[1]*Q+c[7]*A,c[2]*I+c[8]*D],E=new X(E,e.side,e.level+1,2*e.x+1,2*e.y,s.fullpath),g.push(E));e.x==t&&z<=s.tileResolution||e.y==t&&z<=s.tileResolution||(E=[c[0]*v+c[6]*l,c[1]*Q+c[7]*A,c[2]*I+c[8]*D,c[3]*y+c[6]*r,c[4]*Q+c[7]*A,c[5]*I+c[8]*D,c[6],c[7],c[8],c[9]*v+c[6]*l,c[10]*y+c[7]*r,c[11]*I+c[8]*D],E=new X(E,e.side,e.level+1,2*e.x+1,2*e.y+1,s.fullpath),g.push(E));e.y==t&&z<=s.tileResolution||(E=
[c[0]*y+c[9]*r,c[1]*Q+c[10]*A,c[2]*I+c[11]*D,c[0]*v+c[6]*l,c[1]*Q+c[7]*A,c[2]*I+c[8]*D,c[9]*v+c[6]*l,c[10]*y+c[7]*r,c[11]*I+c[8]*D,c[9],c[10],c[11]],E=new X(E,e.side,e.level+1,2*e.x,2*e.y+1,s.fullpath),g.push(E));for(e=0;e<g.length;e++)Y(a,g[e],f,m,p)}}}function Ca(){return[-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,1,-1,1,1,-1,-1]}function ra(a,e,d){var f=Math.sin(e);e=Math.cos(e);
if("x"==d)return[a[0],e*a[1]+f*a[2],e*a[2]-f*a[1],a[3],e*a[4]+f*a[5],e*a[5]-f*a[4],a[6],e*a[7]+f*a[8],e*a[8]-f*a[7]];if("y"==d)return[e*a[0]-f*a[2],a[1],e*a[2]+f*a[0],e*a[3]-f*a[5],a[4],e*a[5]+f*a[3],e*a[6]-f*a[8],a[7],e*a[8]+f*a[6]];if("z"==d)return[e*a[0]+f*a[1],e*a[1]-f*a[0],a[2],e*a[3]+f*a[4],e*a[4]-f*a[3],a[5],e*a[6]+f*a[7],e*a[7]-f*a[6],a[8]]}function sa(a){return[a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15]]}function La(a){a.textureLoad||(a.textureLoad=
!0,Ma(encodeURI(a.path+"."+s.extension),function(e){a.texture=e;a.textureLoaded=!0},Z.crossOrigin))}function ea(a,e){var d=[a[0]*e[0]+a[1]*e[1]+a[2]*e[2],a[4]*e[0]+a[5]*e[1]+a[6]*e[2],a[11]+a[8]*e[0]+a[9]*e[1]+a[10]*e[2],1/(a[12]*e[0]+a[13]*e[1]+a[14]*e[2])],f=d[0]*d[3],p=d[1]*d[3],d=d[2]*d[3],c=[0,0,0];-1>f&&(c[0]=-1);1<f&&(c[0]=1);-1>p&&(c[1]=-1);1<p&&(c[1]=1);if(-1>d||1<d)c[2]=1;return c}function ta(){console.log("Reducing canvas size due to error 1286!");A.width=Math.round(A.width/2);A.height=
Math.round(A.height/2)}var A=f.createElement("canvas");A.style.width=A.style.height="100%";P.appendChild(A);var d,a,V,N,na,R,ua,fa,s,G,va,ka,F,ba,Da,Z;this.init=function(h,e,Ia,ja,p,c,g,t){e===m&&(e="equirectangular");if("equirectangular"!=e&&"cubemap"!=e&&"multires"!=e)throw console.log("Error: invalid image type specified!"),{type:"config error"};G=e;s=h;va=Ia;Z=t||{};if(d){V&&(a.detachShader(d,V),a.deleteShader(V));N&&(a.detachShader(d,N),a.deleteShader(N));a.bindBuffer(a.ARRAY_BUFFER,null);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
null);d.texture&&a.deleteTexture(d.texture);if(d.nodeCache)for(h=0;h<d.nodeCache.length;h++)a.deleteTexture(d.nodeCache[h].texture);a.deleteProgram(d);d=m}fa=m;"cubemap"==G&&0!==(s[0].width&s[0].width-1)&&(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/)||navigator.userAgent.match(/Trident.*rv[ :]*11\./))||(a||(a=A.getContext("experimental-webgl",
{alpha:!1,depth:!1})),a&&1286==a.getError()&&ta());if(!a&&("multires"==G&&s.hasOwnProperty("fallbackPath")||"cubemap"==G)&&("WebkitAppearance"in f.documentElement.style||navigator.userAgent.match(/Trident.*rv[ :]*11\./)||-1!==navigator.appVersion.indexOf("MSIE 10"))){R&&P.removeChild(R);R=f.createElement("div");R.className="pnlm-world";ja=s.basePath?s.basePath+s.fallbackPath:s.fallbackPath;var z="frblud".split(""),y=0;p=function(){var a=f.createElement("canvas");a.className="pnlm-face pnlm-"+z[this.side]+
"face";R.appendChild(a);var c=a.getContext("2d");a.style.width=this.width+4+"px";a.style.height=this.height+4+"px";a.width=this.width+4;a.height=this.height+4;c.drawImage(this,2,2);var e=c.getImageData(0,0,a.width,a.height),d=e.data,h,l;for(h=2;h<a.width-2;h++)for(l=0;4>l;l++)d[4*(h+a.width)+l]=d[4*(h+2*a.width)+l],d[4*(h+a.width*(a.height-2))+l]=d[4*(h+a.width*(a.height-3))+l];for(h=2;h<a.height-2;h++)for(l=0;4>l;l++)d[4*(h*a.width+1)+l]=d[4*(h*a.width+2)+l],d[4*((h+1)*a.width-2)+l]=d[4*((h+1)*a.width-
3)+l];for(l=0;4>l;l++)d[4*(a.width+1)+l]=d[4*(2*a.width+2)+l],d[4*(2*a.width-2)+l]=d[4*(3*a.width-3)+l],d[4*(a.width*(a.height-2)+1)+l]=d[4*(a.width*(a.height-3)+2)+l],d[4*(a.width*(a.height-1)-2)+l]=d[4*(a.width*(a.height-2)-3)+l];for(h=1;h<a.width-1;h++)for(l=0;4>l;l++)d[4*h+l]=d[4*(h+a.width)+l],d[4*(h+a.width*(a.height-1))+l]=d[4*(h+a.width*(a.height-2))+l];for(h=1;h<a.height-1;h++)for(l=0;4>l;l++)d[h*a.width*4+l]=d[4*(h*a.width+1)+l],d[4*((h+1)*a.width-1)+l]=d[4*((h+1)*a.width-2)+l];for(l=0;4>
l;l++)d[l]=d[4*(a.width+1)+l],d[4*(a.width-1)+l]=d[4*(2*a.width-2)+l],d[a.width*(a.height-1)*4+l]=d[4*(a.width*(a.height-2)+1)+l],d[4*(a.width*a.height-1)+l]=d[4*(a.width*(a.height-1)-2)+l];c.putImageData(e,0,0);y++;6==y&&(na=this.width,P.appendChild(R),g())};for(h=0;6>h;h++)c=new Image,c.crossOrigin=Z.crossOrigin?Z.crossOrigin:"anonymous",c.side=h,c.onload=p,c.src="multires"==G?encodeURI(ja.replace("%s",z[h])+"."+s.extension):encodeURI(s[h].src)}else{if(!a)throw console.log("Error: no WebGL support detected!"),
{type:"no webgl"};s.fullpath=s.basePath?s.basePath+s.path:s.path;s.invTileResolution=1/s.tileResolution;e=Ca();ua=[];for(h=0;6>h;h++)ua[h]=e.slice(12*h,12*h+12),e=Ca();if("equirectangular"==G){if(h=Math.max(s.width,s.height),e=a.getParameter(a.MAX_TEXTURE_SIZE),h>e)throw console.log("Error: The image is too big; it's "+h+"px wide, but this device's maximum supported width is "+e+"px."),{type:"webgl size error",width:h,maxWidth:e};}else if("cubemap"==G&&(h=s[0].width,e=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),
h>e))throw console.log("Error: The cube face image is too big; it's "+h+"px wide, but this device's maximum supported width is "+e+"px."),{type:"webgl size error",width:h,maxWidth:e};t===m||t.horizonPitch===m&&t.horizonRoll===m||(fa=[t.horizonPitch==m?0:t.horizonPitch,t.horizonRoll==m?0:t.horizonRoll]);h=a.TEXTURE_2D;a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight);V=a.createShader(a.VERTEX_SHADER);e=r;"multires"==G&&(e=v);a.shaderSource(V,e);a.compileShader(V);N=a.createShader(a.FRAGMENT_SHADER);
e=Na;"cubemap"==G?(h=a.TEXTURE_CUBE_MAP,e=Oa):"multires"==G&&(e=oa);a.shaderSource(N,e);a.compileShader(N);d=a.createProgram();a.attachShader(d,V);a.attachShader(d,N);a.linkProgram(d);a.getShaderParameter(V,a.COMPILE_STATUS)||console.log(a.getShaderInfoLog(V));a.getShaderParameter(N,a.COMPILE_STATUS)||console.log(a.getShaderInfoLog(N));a.getProgramParameter(d,a.LINK_STATUS)||console.log(a.getProgramInfoLog(d));a.useProgram(d);d.drawInProgress=!1;d.texCoordLocation=a.getAttribLocation(d,"a_texCoord");
a.enableVertexAttribArray(d.texCoordLocation);"multires"!=G?(ka||(ka=a.createBuffer()),a.bindBuffer(a.ARRAY_BUFFER,ka),a.bufferData(a.ARRAY_BUFFER,new Float32Array([-1,1,1,1,1,-1,-1,1,1,-1,-1,-1]),a.STATIC_DRAW),a.vertexAttribPointer(d.texCoordLocation,2,a.FLOAT,!1,0,0),d.aspectRatio=a.getUniformLocation(d,"u_aspectRatio"),a.uniform1f(d.aspectRatio,a.drawingBufferWidth/a.drawingBufferHeight),d.psi=a.getUniformLocation(d,"u_psi"),d.theta=a.getUniformLocation(d,"u_theta"),d.f=a.getUniformLocation(d,
"u_f"),d.h=a.getUniformLocation(d,"u_h"),d.v=a.getUniformLocation(d,"u_v"),d.vo=a.getUniformLocation(d,"u_vo"),d.rot=a.getUniformLocation(d,"u_rot"),a.uniform1f(d.h,ja/(2*Math.PI)),a.uniform1f(d.v,p/Math.PI),a.uniform1f(d.vo,c/Math.PI*2),"equirectangular"==G&&(d.backgroundColor=a.getUniformLocation(d,"u_backgroundColor"),a.uniform4fv(d.backgroundColor,(t.backgroundColor?t.backgroundColor:[0,0,0]).concat([1]))),d.texture=a.createTexture(),a.bindTexture(h,d.texture),"cubemap"==G?(a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X,
0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[1]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_X,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[3]),a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[4]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[5]),a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[0]),a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s[2])):a.texImage2D(h,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s),a.texParameteri(h,a.TEXTURE_WRAP_S,
a.CLAMP_TO_EDGE),a.texParameteri(h,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(h,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(h,a.TEXTURE_MAG_FILTER,a.LINEAR)):(d.vertPosLocation=a.getAttribLocation(d,"a_vertCoord"),a.enableVertexAttribArray(d.vertPosLocation),F||(F=a.createBuffer()),ba||(ba=a.createBuffer()),Da||(Da=a.createBuffer()),a.bindBuffer(a.ARRAY_BUFFER,ba),a.bufferData(a.ARRAY_BUFFER,new Float32Array([0,0,1,0,1,1,0,1]),a.STATIC_DRAW),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,Da),a.bufferData(a.ELEMENT_ARRAY_BUFFER,
new Uint16Array([0,1,2,0,2,3]),a.STATIC_DRAW),d.perspUniform=a.getUniformLocation(d,"u_perspMatrix"),d.cubeUniform=a.getUniformLocation(d,"u_cubeMatrix"),d.level=-1,d.currentNodes=[],d.nodeCache=[],d.nodeCacheTimestamp=0);ja=a.getError();if(0!==ja)throw console.log("Error: Something went wrong with WebGL!",ja),{type:"webgl error"};g()}};this.destroy=function(){P!==m&&(A!==m&&P.contains(A)&&P.removeChild(A),R!==m&&P.contains(R)&&P.removeChild(R));if(a){var d=a.getExtension("WEBGL_lose_context");d&&
d.loseContext()}};this.resize=function(){var h=J.devicePixelRatio||1;A.width=A.clientWidth*h;A.height=A.clientHeight*h;a&&(1286==a.getError()&&ta(),a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight),"multires"!=G&&a.uniform1f(d.aspectRatio,A.clientWidth/A.clientHeight))};this.resize();this.setPose=function(a,d){fa=[a,d]};this.render=function(h,e,f,r){var p;p=0;r===m&&(r={});r.roll&&(p=r.roll);if(fa!==m){var c=fa[0],g=fa[1],t=h,z=e,y=Math.cos(g)*Math.sin(h)*Math.sin(c)+Math.cos(h)*(Math.cos(c)*
Math.cos(e)+Math.sin(g)*Math.sin(c)*Math.sin(e)),v=-Math.sin(h)*Math.sin(g)+Math.cos(h)*Math.cos(g)*Math.sin(e);h=Math.cos(g)*Math.cos(c)*Math.sin(h)+Math.cos(h)*(-Math.cos(e)*Math.sin(c)+Math.cos(c)*Math.sin(g)*Math.sin(e));h=Math.asin(Math.max(Math.min(h,1),-1));e=Math.atan2(v,y);c=[Math.cos(t)*(Math.sin(g)*Math.sin(c)*Math.cos(z)-Math.cos(c)*Math.sin(z)),Math.cos(t)*Math.cos(g)*Math.cos(z),Math.cos(t)*(Math.cos(c)*Math.sin(g)*Math.cos(z)+Math.sin(z)*Math.sin(c))];g=[-Math.cos(h)*Math.sin(e),Math.cos(h)*
Math.cos(e)];g=Math.acos(Math.max(Math.min((c[0]*g[0]+c[1]*g[1])/(Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2])*Math.sqrt(g[0]*g[0]+g[1]*g[1])),1),-1));0>c[2]&&(g=2*Math.PI-g);p+=g}if(a||"multires"!=G&&"cubemap"!=G){if("multires"!=G)f=2*Math.atan(Math.tan(0.5*f)/(a.drawingBufferWidth/a.drawingBufferHeight)),f=1/Math.tan(0.5*f),a.uniform1f(d.psi,e),a.uniform1f(d.theta,h),a.uniform1f(d.rot,p),a.uniform1f(d.f,f),!0===va&&"equirectangular"==G&&(a.bindTexture(a.TEXTURE_2D,d.texture),a.texImage2D(a.TEXTURE_2D,
0,a.RGB,a.RGB,a.UNSIGNED_BYTE,s)),a.drawArrays(a.TRIANGLES,0,6);else{c=a.drawingBufferWidth/a.drawingBufferHeight;g=2*Math.atan(Math.tan(f/2)*a.drawingBufferHeight/a.drawingBufferWidth);g=1/Math.tan(g/2);c=[g/c,0,0,0,0,g,0,0,0,0,100.1/-99.9,20/-99.9,0,0,-1,0];for(g=1;g<s.maxLevel&&a.drawingBufferWidth>s.tileResolution*Math.pow(2,g-1)*Math.tan(f/2)*0.707;)g++;d.level=g;g=[1,0,0,0,1,0,0,0,1];g=ra(g,-p,"z");g=ra(g,-h,"x");g=ra(g,e,"y");g=[g[0],g[1],g[2],0,g[3],g[4],g[5],0,g[6],g[7],g[8],0,0,0,0,1];a.uniformMatrix4fv(d.perspUniform,
!1,new Float32Array(sa(c)));a.uniformMatrix4fv(d.cubeUniform,!1,new Float32Array(sa(g)));c=[c[0]*g[0],c[0]*g[1],c[0]*g[2],0,c[5]*g[4],c[5]*g[5],c[5]*g[6],0,c[10]*g[8],c[10]*g[9],c[10]*g[10],c[11],-g[8],-g[9],-g[10],0];d.nodeCache.sort(bb);if(200<d.nodeCache.length&&d.nodeCache.length>d.currentNodes.length+50)for(g=d.nodeCache.splice(200,d.nodeCache.length-200),p=0;p<g.length;p++)a.deleteTexture(g[p].texture);d.currentNodes=[];g="fbudlr".split("");for(p=0;6>p;p++)t=new X(ua[p],g[p],1,0,0,s.fullpath),
Y(c,t,h,e,f);d.currentNodes.sort(W);for(p=0;p<d.currentNodes.length;p++)if(!d.currentNodes[p].texture){setTimeout(La,0,d.currentNodes[p]);break}if(!d.drawInProgress){d.drawInProgress=!0;for(h=0;h<d.currentNodes.length;h++)d.currentNodes[h].textureLoaded&&(a.bindBuffer(a.ARRAY_BUFFER,F),a.bufferData(a.ARRAY_BUFFER,new Float32Array(d.currentNodes[h].vertices),a.STATIC_DRAW),a.vertexAttribPointer(d.vertPosLocation,3,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,ba),a.vertexAttribPointer(d.texCoordLocation,
2,a.FLOAT,!1,0,0),a.bindTexture(a.TEXTURE_2D,d.currentNodes[h].texture),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0));d.drawInProgress=!1}}if(r.returnImage!==m)return A.toDataURL("image/png")}else for(p=na/2,r={f:"translate3d(-"+(p+2)+"px, -"+(p+2)+"px, -"+p+"px)",b:"translate3d("+(p+2)+"px, -"+(p+2)+"px, "+p+"px) rotateX(180deg) rotateZ(180deg)",u:"translate3d(-"+(p+2)+"px, -"+p+"px, "+(p+2)+"px) rotateX(270deg)",d:"translate3d(-"+(p+2)+"px, "+p+"px, -"+(p+2)+"px) rotateX(90deg)",l:"translate3d(-"+
p+"px, -"+(p+2)+"px, "+(p+2)+"px) rotateX(180deg) rotateY(90deg) rotateZ(180deg)",r:"translate3d("+p+"px, -"+(p+2)+"px, -"+(p+2)+"px) rotateY(270deg)"},f=1/Math.tan(f/2),f=f*a.drawingBufferWidth/2+"px",h="perspective("+f+") translateZ("+f+") rotateX("+h+"rad) rotateY("+e+"rad) ",e=Object.keys(r),p=0;6>p;p++)f=R.querySelector(".pnlm-"+e[p]+"face").style,f.webkitTransform=h+r[e[p]],f.transform=h+r[e[p]]};this.isLoading=function(){if(a&&"multires"==G)for(var f=0;f<d.currentNodes.length;f++)if(!d.currentNodes[f].textureLoaded)return!0;
return!1};this.getCanvas=function(){return A};var Ma=function(){function d(){var e=this;this.texture=this.callback=null;this.image=new Image;this.image.crossOrigin=c?c:"anonymous";this.image.addEventListener("load",function(){var c=e.image;a.bindTexture(a.TEXTURE_2D,e.texture);a.texImage2D(a.TEXTURE_2D,0,a.RGB,a.RGB,a.UNSIGNED_BYTE,c);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,
a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.bindTexture(a.TEXTURE_2D,null);e.callback(e.texture);p.length?(c=p.shift(),e.loadTexture(c.src,c.texture,c.callback)):m[f++]=e})}function e(a,c,d){this.src=a;this.texture=c;this.callback=d}var f=4,m={},p=[],c;d.prototype.loadTexture=function(a,c,d){this.texture=c;this.callback=d;this.image.src=a};for(var g=0;g<f;g++)m[g]=new d;return function(d,g,h){c=h;h=a.createTexture();f?m[--f].loadTexture(d,h,g):p.push(new e(d,
h,g));return h}}()}var r="attribute vec2 a_texCoord;varying vec2 v_texCoord;void main() {gl_Position = vec4(a_texCoord, 0.0, 1.0);v_texCoord = a_texCoord;}",v="attribute vec3 a_vertCoord;attribute vec2 a_texCoord;uniform mat4 u_cubeMatrix;uniform mat4 u_perspMatrix;varying mediump vec2 v_texCoord;void main(void) {gl_Position = u_perspMatrix * u_cubeMatrix * vec4(a_vertCoord, 1.0);v_texCoord = a_texCoord;}",Oa="precision mediump float;\nuniform float u_aspectRatio;\nuniform float u_psi;\nuniform float u_theta;\nuniform float u_f;\nuniform float u_h;\nuniform float u_v;\nuniform float u_vo;\nuniform float u_rot;\nconst float PI = 3.14159265358979323846264;\nuniform sampler2D u_image;\nuniform samplerCube u_imageCube;\nvarying vec2 v_texCoord;\nuniform vec4 u_backgroundColor;\nvoid main() {\nfloat x = v_texCoord.x * u_aspectRatio;\nfloat y = v_texCoord.y;\nfloat sinrot = sin(u_rot);\nfloat cosrot = cos(u_rot);\nfloat rot_x = x * cosrot - y * sinrot;\nfloat rot_y = x * sinrot + y * cosrot;\nfloat sintheta = sin(u_theta);\nfloat costheta = cos(u_theta);\nfloat a = u_f * costheta - rot_y * sintheta;\nfloat root = sqrt(rot_x * rot_x + a * a);\nfloat lambda = atan(rot_x / root, a / root) + u_psi;\nfloat phi = atan((rot_y * costheta + u_f * sintheta) / root);float cosphi = cos(phi);\ngl_FragColor = textureCube(u_imageCube, vec3(cosphi*sin(lambda), sin(phi), cosphi*cos(lambda)));\n}",
Na="precision mediump float;\nuniform float u_aspectRatio;\nuniform float u_psi;\nuniform float u_theta;\nuniform float u_f;\nuniform float u_h;\nuniform float u_v;\nuniform float u_vo;\nuniform float u_rot;\nconst float PI = 3.14159265358979323846264;\nuniform sampler2D u_image;\nuniform samplerCube u_imageCube;\nvarying vec2 v_texCoord;\nuniform vec4 u_backgroundColor;\nvoid main() {\nfloat x = v_texCoord.x * u_aspectRatio;\nfloat y = v_texCoord.y;\nfloat sinrot = sin(u_rot);\nfloat cosrot = cos(u_rot);\nfloat rot_x = x * cosrot - y * sinrot;\nfloat rot_y = x * sinrot + y * cosrot;\nfloat sintheta = sin(u_theta);\nfloat costheta = cos(u_theta);\nfloat a = u_f * costheta - rot_y * sintheta;\nfloat root = sqrt(rot_x * rot_x + a * a);\nfloat lambda = atan(rot_x / root, a / root) + u_psi;\nfloat phi = atan((rot_y * costheta + u_f * sintheta) / root);lambda = mod(lambda + PI, PI * 2.0) - PI;\nvec2 coord = vec2(lambda / PI, phi / (PI / 2.0));\nif(coord.x < -u_h || coord.x > u_h || coord.y < -u_v + u_vo || coord.y > u_v + u_vo)\ngl_FragColor = u_backgroundColor;\nelse\ngl_FragColor = texture2D(u_image, vec2((coord.x + u_h) / (u_h * 2.0), (-coord.y + u_v + u_vo) / (u_v * 2.0)));\n}",
oa="varying mediump vec2 v_texCoord;uniform sampler2D u_sampler;void main(void) {gl_FragColor = texture2D(u_sampler, v_texCoord);}";return{renderer:function(f,m,r,v){return new Ba(f,m,r,v)}}}(window,document);window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(J,f){window.setTimeout(J,1E3/60)}}());
window.pannellum=function(J,f,m){function Ba(r,v){function Oa(u){J.removeEventListener("deviceorientation",Oa);u&&null!==u.alpha&&null!==u.beta&&null!==u.gamma?(w.container.appendChild(w.orientation),pa=!0,Ya&&Ka()):pa=!1}function Na(){var u=f.createElement("div");u.innerHTML="\x3c!--[if lte IE 9]><i></i><![endif]--\x3e";if(1==u.getElementsByTagName("i").length)W();else{wa=b.hfov;Ea=b.pitch;var a;if("cubemap"==b.type){O=[];for(u=0;6>u;u++)O.push(new Image),O[u].crossOrigin=b.crossOrigin;n.load.lbox.style.display=
"block";n.load.lbar.style.display="none"}else if("multires"==b.type)u=JSON.parse(JSON.stringify(b.multiRes)),b.basePath&&b.multiRes.basePath&&!/^(?:[a-z]+:)?\/\//i.test(b.multiRes.basePath)?u.basePath=b.basePath+b.multiRes.basePath:b.multiRes.basePath?u.basePath=b.multiRes.basePath:b.basePath&&(u.basePath=b.basePath),O=u;else if(!0===b.dynamic)O=b.panorama;else{if(b.panorama===m){W(b.strings.noPanoramaError);return}O=new Image}if("cubemap"==b.type)for(var ca=6,c=function(){ca--;0===ca&&P()},d=function(a){var u=
f.createElement("a");u.href=a.target.src;u.innerHTML=u.href;W(b.strings.fileAccessError.replace("%s",u.outerHTML))},u=0;u<O.length;u++)O[u].onload=c,O[u].onerror=d,a=b.cubeMap[u],b.basePath&&!oa(a)&&(a=b.basePath+a),O[u].src=encodeURI(a);else if("multires"==b.type)P();else if(a="",b.basePath&&(a=b.basePath),!0!==b.dynamic){a=oa(b.panorama)?b.panorama:a+b.panorama;O.onload=function(){J.URL.revokeObjectURL(this.src);P()};var e=new XMLHttpRequest;e.onloadend=function(){if(200!=e.status){var u=f.createElement("a");
u.href=encodeURI(a);u.innerHTML=u.href;W(b.strings.fileAccessError.replace("%s",u.outerHTML))}Ba(this.response);n.load.msg.innerHTML=""};e.onprogress=function(a){if(a.lengthComputable){n.load.lbarFill.style.width=a.loaded/a.total*100+"%";var u,b;1E6<a.total?(u="MB",b=(a.loaded/1E6).toFixed(2),a=(a.total/1E6).toFixed(2)):1E3<a.total?(u="kB",b=(a.loaded/1E3).toFixed(1),a=(a.total/1E3).toFixed(1)):(u="B",b=a.loaded,a=a.total);n.load.msg.innerHTML=b+" / "+a+" "+u}else n.load.lbox.style.display="block",
n.load.lbar.style.display="none"};try{e.open("GET",a,!0)}catch(g){W(b.strings.malformedURLError)}e.responseType="blob";e.setRequestHeader("Accept","image/*,*/*;q=0.9");e.withCredentials="use-credentials"===b.crossOrigin;e.send()}b.draggable&&C.classList.add("pnlm-grab");C.classList.remove("pnlm-grabbing")}}function oa(a){return/^(?:[a-z]+:)?\/\//i.test(a)||"/"==a[0]||"blob:"==a.slice(0,5)}function P(){B||(B=new libpannellum.renderer(M));Sa||(Sa=!0,H.addEventListener("mousedown",Ca,!1),f.addEventListener("mousemove",
La,!1),f.addEventListener("mouseup",ea,!1),b.mouseZoom&&(C.addEventListener("mousewheel",na,!1),C.addEventListener("DOMMouseScroll",na,!1)),b.doubleClickZoom&&H.addEventListener("dblclick",ra,!1),C.addEventListener("mozfullscreenchange",y,!1),C.addEventListener("webkitfullscreenchange",y,!1),C.addEventListener("msfullscreenchange",y,!1),C.addEventListener("fullscreenchange",y,!1),J.addEventListener("resize",ka,!1),J.addEventListener("orientationchange",ka,!1),b.disableKeyboardCtrl||(r.addEventListener("keydown",
R,!1),r.addEventListener("keyup",fa,!1),r.addEventListener("blur",ua,!1)),f.addEventListener("mouseleave",ea,!1),H.addEventListener("touchstart",ta,!1),H.addEventListener("touchmove",A,!1),H.addEventListener("touchend",d,!1),H.addEventListener("pointerdown",a,!1),H.addEventListener("pointermove",V,!1),H.addEventListener("pointerup",N,!1),H.addEventListener("pointerleave",N,!1),J.navigator.pointerEnabled&&(r.style.touchAction="none"));h();setTimeout(function(){},500)}function Ba(a){var k=new FileReader;
k.addEventListener("loadend",function(){var ca=k.result;if(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)){var c=ca.indexOf("\u00ff\u00c2");(0>c||65536<c)&&W(b.strings.iOS8WebGLError)}c=ca.indexOf("<x:xmpmeta");if(-1<c&&!0!==b.ignoreGPanoXMP){var d=ca.substring(c,ca.indexOf("</x:xmpmeta>")+12),e=function(a){var u;0<=d.indexOf(a+'="')?(u=d.substring(d.indexOf(a+'="')+a.length+2),u=u.substring(0,u.indexOf('"'))):0<=d.indexOf(a+">")&&(u=d.substring(d.indexOf(a+">")+a.length+1),
u=u.substring(0,u.indexOf("<")));return u!==m?Number(u):null},ca=e("GPano:FullPanoWidthPixels"),c=e("GPano:CroppedAreaImageWidthPixels"),f=e("GPano:FullPanoHeightPixels"),g=e("GPano:CroppedAreaImageHeightPixels"),h=e("GPano:CroppedAreaTopPixels"),l=e("GPano:PoseHeadingDegrees"),p=e("GPano:PosePitchDegrees"),e=e("GPano:PoseRollDegrees");null!==ca&&null!==c&&null!==f&&null!==g&&null!==h&&(0>da.indexOf("haov")&&(b.haov=c/ca*360),0>da.indexOf("vaov")&&(b.vaov=g/f*180),0>da.indexOf("vOffset")&&(b.vOffset=
-180*((h+g/2)/f-0.5)),null!==l&&0>da.indexOf("northOffset")&&(b.northOffset=l,!1!==b.compass&&(b.compass=!0)),null!==p&&null!==e&&(0>da.indexOf("horizonPitch")&&(b.horizonPitch=p),0>da.indexOf("horizonRoll")&&(b.horizonRoll=e)))}O.src=J.URL.createObjectURL(a)});k.readAsBinaryString!==m?k.readAsBinaryString(a):k.readAsText(a)}function W(a){a===m&&(a=b.strings.genericWebGLError);n.errorMsg.innerHTML="<p>"+a+"</p>";w.load.style.display="none";n.load.box.style.display="none";n.errorMsg.style.display=
"table";Pa=!0;M.style.display="none";ga("error",a)}function X(a){var b=Y(a);ha.style.left=b.x+"px";ha.style.top=b.y+"px";clearTimeout(X.t1);clearTimeout(X.t2);ha.style.display="block";ha.style.opacity=1;X.t1=setTimeout(function(){ha.style.opacity=0},2E3);X.t2=setTimeout(function(){ha.style.display="none"},2500);a.preventDefault()}function Y(a){var b=r.getBoundingClientRect(),c={};c.x=a.clientX-b.left;c.y=a.clientY-b.top;return c}function Ca(a){a.preventDefault();r.focus();if(L&&b.draggable){var k=
Y(a);if(b.hotSpotDebug){var c=sa(a);console.log("Pitch: "+c[0]+", Yaw: "+c[1]+", Center Pitch: "+b.pitch+", Center Yaw: "+b.yaw+", HFOV: "+b.hfov)}Ja();l();b.roll=0;x.hfov=0;la=!0;S=Date.now();xa=k.x;ya=k.y;Qa=b.yaw;Ra=b.pitch;C.classList.add("pnlm-grabbing");C.classList.remove("pnlm-grab");ga("mousedown",a);F()}}function ra(a){b.minHfov===b.hfov?za.setHfov(wa,1E3):(a=sa(a),za.lookAt(a[0],a[1],b.minHfov,1E3))}function sa(a){var k=Y(a);a=B.getCanvas();var c=a.clientWidth,d=a.clientHeight;a=k.x/c*2-
1;var d=(1-k.y/d*2)*d/c,e=1/Math.tan(b.hfov*Math.PI/360),f=Math.sin(b.pitch*Math.PI/180),g=Math.cos(b.pitch*Math.PI/180),k=e*g-d*f,c=Math.sqrt(a*a+k*k),d=180*Math.atan((d*g+e*f)/c)/Math.PI;a=180*Math.atan2(a/c,k/c)/Math.PI+b.yaw;-180>a&&(a+=360);180<a&&(a-=360);return[d,a]}function La(a){if(la&&L){S=Date.now();var k=B.getCanvas(),c=k.clientWidth,k=k.clientHeight;a=Y(a);var d=180*(Math.atan(xa/c*2-1)-Math.atan(a.x/c*2-1))/Math.PI*b.hfov/90+Qa;x.yaw=(d-b.yaw)%360*0.2;b.yaw=d;c=360*Math.atan(Math.tan(b.hfov/
360*Math.PI)*k/c)/Math.PI;c=180*(Math.atan(a.y/k*2-1)-Math.atan(ya/k*2-1))/Math.PI*c/90+Ra;x.pitch=0.2*(c-b.pitch);b.pitch=c}}function ea(a){la&&(la=!1,15<Date.now()-S&&(x.pitch=x.yaw=0),C.classList.add("pnlm-grab"),C.classList.remove("pnlm-grabbing"),S=Date.now(),ga("mouseup",a))}function ta(a){if(L&&b.draggable){Ja();l();b.roll=0;x.hfov=0;var k=Y(a.targetTouches[0]);xa=k.x;ya=k.y;if(2==a.targetTouches.length){var c=Y(a.targetTouches[1]);xa+=0.5*(c.x-k.x);ya+=0.5*(c.y-k.y);Fa=Math.sqrt((k.x-c.x)*
(k.x-c.x)+(k.y-c.y)*(k.y-c.y))}la=!0;S=Date.now();Qa=b.yaw;Ra=b.pitch;ga("touchstart",a);F()}}function A(a){if(b.draggable&&(a.preventDefault(),L&&(S=Date.now()),la&&L)){var k=Y(a.targetTouches[0]),c=k.x,d=k.y;2==a.targetTouches.length&&-1!=Fa&&(a=Y(a.targetTouches[1]),c+=0.5*(a.x-k.x),d+=0.5*(a.y-k.y),k=Math.sqrt((k.x-a.x)*(k.x-a.x)+(k.y-a.y)*(k.y-a.y)),U(b.hfov+0.1*(Fa-k)),Fa=k);k=b.hfov/360;c=(xa-c)*k+Qa;x.yaw=(c-b.yaw)%360*0.2;b.yaw=c;d=(d-ya)*k+Ra;x.pitch=0.2*(d-b.pitch);b.pitch=d}}function d(){la=
!1;150<Date.now()-S&&(x.pitch=x.yaw=0);Fa=-1;S=Date.now();ga("touchend",event)}function a(a){"touch"==a.pointerType&&(ma.push(a.pointerId),Aa.push({clientX:a.clientX,clientY:a.clientY}),a.targetTouches=Aa,ta(a),a.preventDefault())}function V(a){if("touch"==a.pointerType)for(var b=0;b<ma.length;b++)if(a.pointerId==ma[b]){Aa[b].clientX=a.clientX;Aa[b].clientY=a.clientY;a.targetTouches=Aa;A(a);break}}function N(a){if("touch"==a.pointerType){for(var b=!1,c=0;c<ma.length;c++)a.pointerId==ma[c]&&(ma[c]=
m),ma[c]&&(b=!0);b||(ma=[],Aa=[],d());a.preventDefault()}}function na(a){L&&("fullscreenonly"!=b.mouseZoom||Ga)&&(a.preventDefault(),Ja(),S=Date.now(),a.wheelDeltaY?(U(b.hfov-0.05*a.wheelDeltaY),x.hfov=0>a.wheelDelta?1:-1):a.wheelDelta?(U(b.hfov-0.05*a.wheelDelta),x.hfov=0>a.wheelDelta?1:-1):a.detail&&(U(b.hfov+1.5*a.detail),x.hfov=0<a.detail?1:-1),F())}function R(a){Ja();S=Date.now();l();b.roll=0;var k=a.which||a.keycode;0>Za.indexOf(k)||(a.preventDefault(),27==k?Ga&&z():s(k,!0))}function ua(){for(var a=
0;10>a;a++)q[a]=!1}function fa(a){var b=a.which||a.keycode;0>Za.indexOf(b)||(a.preventDefault(),s(b,!1))}function s(a,b){var c=!1;switch(a){case 109:case 189:case 17:case 173:q[0]!=b&&(c=!0);q[0]=b;break;case 107:case 187:case 16:case 61:q[1]!=b&&(c=!0);q[1]=b;break;case 38:q[2]!=b&&(c=!0);q[2]=b;break;case 87:q[6]!=b&&(c=!0);q[6]=b;break;case 40:q[3]!=b&&(c=!0);q[3]=b;break;case 83:q[7]!=b&&(c=!0);q[7]=b;break;case 37:q[4]!=b&&(c=!0);q[4]=b;break;case 65:q[8]!=b&&(c=!0);q[8]=b;break;case 39:q[5]!=
b&&(c=!0);q[5]=b;break;case 68:q[9]!=b&&(c=!0),q[9]=b}c&&b&&(ia="undefined"!==typeof performance&&performance.now()?performance.now():Date.now(),F())}function G(){if(L){var a=!1,k=b.pitch,c=b.yaw,d=b.hfov,e;e="undefined"!==typeof performance&&performance.now()?performance.now():Date.now();ia===m&&(ia=e);var f=(e-ia)*b.hfov/1700,f=Math.min(f,1);q[0]&&!0===b.keyboardZoom&&(U(b.hfov+(0.8*x.hfov+0.5)*f),a=!0);q[1]&&!0===b.keyboardZoom&&(U(b.hfov+(0.8*x.hfov-0.2)*f),a=!0);if(q[2]||q[6])b.pitch+=(0.8*x.pitch+
0.2)*f,a=!0;if(q[3]||q[7])b.pitch+=(0.8*x.pitch-0.2)*f,a=!0;if(q[4]||q[8])b.yaw+=(0.8*x.yaw-0.2)*f,a=!0;if(q[5]||q[9])b.yaw+=(0.8*x.yaw+0.2)*f,a=!0;a&&(S=Date.now());Date.now();if(b.autoRotate){if(0.001<e-ia){var a=(e-ia)/1E3,g=(x.yaw/a*f-0.2*b.autoRotate)*a,g=(0<-b.autoRotate?1:-1)*Math.min(Math.abs(b.autoRotate*a),Math.abs(g));b.yaw+=g}b.autoRotateStopDelay&&(b.autoRotateStopDelay-=e-ia,0>=b.autoRotateStopDelay&&(b.autoRotateStopDelay=!1,$=b.autoRotate,b.autoRotate=0))}K.pitch&&(va("pitch"),k=b.pitch);
K.yaw&&(va("yaw"),c=b.yaw);K.hfov&&(va("hfov"),d=b.hfov);0<f&&!b.autoRotate&&(q[4]||q[5]||q[8]||q[9]||K.yaw||(b.yaw+=x.yaw*f*0.85),q[2]||q[3]||q[6]||q[7]||K.pitch||(b.pitch+=x.pitch*f*0.85),q[0]||q[1]||K.hfov||U(b.hfov+x.hfov*f*0.85));ia=e;0<f&&(x.yaw=0.8*x.yaw+(b.yaw-c)/f*0.2,x.pitch=0.8*x.pitch+(b.pitch-k)/f*0.2,x.hfov=0.8*x.hfov+(b.hfov-d)/f*0.2,k=b.autoRotate?Math.abs(b.autoRotate):5,x.yaw=Math.min(k,Math.max(x.yaw,-k)),x.pitch=Math.min(k,Math.max(x.pitch,-k)),x.hfov=Math.min(k,Math.max(x.hfov,
-k)));q[0]&&q[0]&&(x.hfov=0);(q[2]||q[6])&&(q[3]||q[7])&&(x.pitch=0);(q[4]||q[8])&&(q[5]||q[9])&&(x.yaw=0)}}function va(a){var k=K[a],c=Math.min(1,Math.max((Date.now()-k.startTime)/1E3/(k.duration/1E3),0)),c=k.startPosition+b.animationTimingFunction(c)*(k.endPosition-k.startPosition);if(k.endPosition>k.startPosition&&c>=k.endPosition||k.endPosition<k.startPosition&&c<=k.endPosition||k.endPosition===k.startPosition){c=k.endPosition;x[a]=0;var k=K[a].callback,d=K[a].callbackArgs;delete K[a];"function"==
typeof k&&k(d)}b[a]=c}function ka(){y()}function F(){Ta||(Ta=!0,ba())}function ba(){Da();Ua&&clearTimeout(Ua);if(la||!0===aa)requestAnimationFrame(ba);else if(q[0]||q[1]||q[2]||q[3]||q[4]||q[5]||q[6]||q[7]||q[8]||q[9]||b.autoRotate||K.pitch||K.yaw||K.hfov||0.01<Math.abs(x.yaw)||0.01<Math.abs(x.pitch)||0.01<Math.abs(x.hfov))G(),0<=b.autoRotateInactivityDelay&&$&&Date.now()-S>b.autoRotateInactivityDelay&&!b.autoRotate&&(b.autoRotate=$,za.lookAt(Ea,m,wa,3E3)),requestAnimationFrame(ba);else if(B&&(B.isLoading()||
!0===b.dynamic&&$a))requestAnimationFrame(ba);else{Ta=!1;ia=m;var a=b.autoRotateInactivityDelay-(Date.now()-S);0<a?Ua=setTimeout(function(){b.autoRotate=$;za.lookAt(Ea,m,wa,3E3);F()},a):0<=b.autoRotateInactivityDelay&&$&&(b.autoRotate=$,za.lookAt(Ea,m,wa,3E3),F())}}function Da(){var a;if(L){180<b.yaw?b.yaw-=360:-180>b.yaw&&(b.yaw+=360);a=b.yaw;var k=b.maxYaw-b.minYaw,d=-180,e=180;360>k&&(d=b.minYaw+b.hfov/2,e=b.maxYaw-b.hfov/2,k<b.hfov&&(d=e=(d+e)/2));b.yaw=Math.max(d,Math.min(e,b.yaw));!1!==b.autoRotate&&
a!=b.yaw&&(b.autoRotate*=-1);a=B.getCanvas();a=2*Math.atan(Math.tan(b.hfov/180*Math.PI*0.5)/(a.width/a.height))/Math.PI*180;k=b.minPitch+a/2;d=b.maxPitch-a/2;b.maxPitch-b.minPitch<a&&(k=d=(k+d)/2);isNaN(k)&&(k=-90);isNaN(d)&&(d=90);b.pitch=Math.max(k,Math.min(d,b.pitch));B.render(b.pitch*Math.PI/180,b.yaw*Math.PI/180,b.hfov*Math.PI/180,{roll:b.roll*Math.PI/180});b.hotSpots.forEach(c);b.compass&&(Ha.style.transform="rotate("+(-b.yaw-b.northOffset)+"deg)",Ha.style.webkitTransform="rotate("+(-b.yaw-
b.northOffset)+"deg)")}}function Z(a,b,c,d){this.w=a;this.x=b;this.y=c;this.z=d}function Ma(a){var c;c=a.alpha;var d=a.beta;a=a.gamma;d=[d?d*Math.PI/180/2:0,a?a*Math.PI/180/2:0,c?c*Math.PI/180/2:0];c=[Math.cos(d[0]),Math.cos(d[1]),Math.cos(d[2])];d=[Math.sin(d[0]),Math.sin(d[1]),Math.sin(d[2])];c=new Z(c[0]*c[1]*c[2]-d[0]*d[1]*d[2],d[0]*c[1]*c[2]-c[0]*d[1]*d[2],c[0]*d[1]*c[2]+d[0]*c[1]*d[2],c[0]*c[1]*d[2]+d[0]*d[1]*c[2]);c=c.multiply(new Z(Math.sqrt(0.5),-Math.sqrt(0.5),0,0));d=J.orientation?-J.orientation*
Math.PI/180/2:0;c=c.multiply(new Z(Math.cos(d),0,-Math.sin(d),0)).toEulerAngles();"number"==typeof aa&&10>aa?aa+=1:10===aa?(ab=c[2]/Math.PI*180+b.yaw,aa=!0,requestAnimationFrame(ba)):(b.pitch=c[0]/Math.PI*180,b.roll=-c[1]/Math.PI*180,b.yaw=-c[2]/Math.PI*180+ab)}function h(){try{var a={};b.horizonPitch!==m&&(a.horizonPitch=b.horizonPitch*Math.PI/180);b.horizonRoll!==m&&(a.horizonRoll=b.horizonRoll*Math.PI/180);b.backgroundColor!==m&&(a.backgroundColor=b.backgroundColor);B.init(O,b.type,b.dynamic,b.haov*
Math.PI/180,b.vaov*Math.PI/180,b.vOffset*Math.PI/180,e,a);!0!==b.dynamic&&(O=m)}catch(c){if("webgl error"==c.type||"no webgl"==c.type)W();else if("webgl size error"==c.type)W(b.strings.textureSizeError.replace("%s",c.width).replace("%s",c.maxWidth));else throw W(b.strings.unknownError),c;}}function e(){if(b.sceneFadeDuration&&B.fadeImg!==m){B.fadeImg.style.opacity=0;var a=B.fadeImg;delete B.fadeImg;setTimeout(function(){M.removeChild(a);ga("scenechangefadedone")},b.sceneFadeDuration)}Ha.style.display=
b.compass?"inline":"none";ja();n.load.box.style.display="none";qa!==m&&(M.removeChild(qa),qa=m);L=!0;ga("load");F()}function Ia(a){a.pitch=Number(a.pitch)||0;a.yaw=Number(a.yaw)||0;var c=f.createElement("div");c.className="pnlm-hotspot-base";c.className=a.cssClass?c.className+(" "+a.cssClass):c.className+(" pnlm-hotspot pnlm-sprite pnlm-"+D(a.type));var d=f.createElement("span");a.text&&(d.innerHTML=D(a.text));var e;if(a.video){e=f.createElement("video");var g=a.video;b.basePath&&!oa(g)&&(g=b.basePath+
g);e.src=encodeURI(g);e.controls=!0;e.style.width=a.width+"px";M.appendChild(c);d.appendChild(e)}else if(a.image){g=a.image;b.basePath&&!oa(g)&&(g=b.basePath+g);e=f.createElement("a");e.href=encodeURI(a.URL?a.URL:g);e.target="_blank";d.appendChild(e);var h=f.createElement("img");h.src=encodeURI(g);h.style.width=a.width+"px";h.style.paddingTop="5px";M.appendChild(c);e.appendChild(h);d.style.maxWidth="initial"}else a.URL?(e=f.createElement("a"),e.href=encodeURI(a.URL),e.target="_blank",M.appendChild(e),
c.style.cursor="pointer",d.style.cursor="pointer",e.appendChild(c)):(a.sceneId&&(c.onclick=c.ontouchend=function(){c.clicked||(c.clicked=!0,I(a.sceneId,a.targetPitch,a.targetYaw,a.targetHfov));return!1},c.style.cursor="pointer",d.style.cursor="pointer"),M.appendChild(c));if(a.createTooltipFunc)a.createTooltipFunc(c,a.createTooltipArgs);else if(a.text||a.video||a.image)c.classList.add("pnlm-tooltip"),c.appendChild(d),d.style.width=d.scrollWidth-20+"px",d.style.marginLeft=-(d.scrollWidth-c.offsetWidth)/
2+"px",d.style.marginTop=-d.scrollHeight-12+"px";a.clickHandlerFunc&&(c.addEventListener("click",function(b){a.clickHandlerFunc(b,a.clickHandlerArgs)},"false"),c.style.cursor="pointer",d.style.cursor="pointer");a.div=c}function ja(){Va||(b.hotSpots?(b.hotSpots=b.hotSpots.sort(function(a,b){return a.pitch<b.pitch}),b.hotSpots.forEach(Ia)):b.hotSpots=[],Va=!0,b.hotSpots.forEach(c))}function p(){var a=b.hotSpots;Va=!1;delete b.hotSpots;if(a)for(var c=0;c<a.length;c++){for(var d=a[c].div;d.parentNode!=
M;)d=d.parentNode;M.removeChild(d);delete a[c].div}}function c(a){var c=Math.sin(a.pitch*Math.PI/180),d=Math.cos(a.pitch*Math.PI/180),e=Math.sin(b.pitch*Math.PI/180),f=Math.cos(b.pitch*Math.PI/180),g=Math.cos((-a.yaw+b.yaw)*Math.PI/180),h=c*e+d*g*f;if(90>=a.yaw&&-90<a.yaw&&0>=h||(90<a.yaw||-90>=a.yaw)&&0>=h)a.div.style.visibility="hidden";else{var l=Math.sin((-a.yaw+b.yaw)*Math.PI/180),p=Math.tan(b.hfov*Math.PI/360);a.div.style.visibility="visible";var m=B.getCanvas(),n=m.clientWidth,m=m.clientHeight,
c=[-n/p*l*d/h/2,-n/p*(c*f-d*g*e)/h/2],d=Math.sin(b.roll*Math.PI/180),e=Math.cos(b.roll*Math.PI/180),c=[c[0]*e-c[1]*d,c[0]*d+c[1]*e];c[0]+=(n-a.div.offsetWidth)/2;c[1]+=(m-a.div.offsetHeight)/2;n="translate("+c[0]+"px, "+c[1]+"px) translateZ(9999px) rotate("+b.roll+"deg)";a.div.style.webkitTransform=n;a.div.style.MozTransform=n;a.div.style.transform=n}}function g(a){b={};var c,d,e="haov vaov vOffset northOffset horizonPitch horizonRoll".split(" ");da=[];for(c in Wa)Wa.hasOwnProperty(c)&&(b[c]=Wa[c]);
for(c in v.default)if(v.default.hasOwnProperty(c))if("strings"==c)for(d in v.default.strings)v.default.strings.hasOwnProperty(d)&&(b.strings[d]=D(v.default.strings[d]));else b[c]=v.default[c],0<=e.indexOf(c)&&da.push(c);if(null!==a&&""!==a&&v.scenes&&v.scenes[a]){var f=v.scenes[a];for(c in f)if(f.hasOwnProperty(c))if("strings"==c)for(d in f.strings)f.strings.hasOwnProperty(d)&&(b.strings[d]=D(f.strings[d]));else b[c]=f[c],0<=e.indexOf(c)&&da.push(c);b.scene=a}for(c in v)if(v.hasOwnProperty(c))if("strings"==
c)for(d in v.strings)v.strings.hasOwnProperty(d)&&(b.strings[d]=D(v.strings[d]));else b[c]=v[c],0<=e.indexOf(c)&&da.push(c)}function t(a){if((a=a?a:!1)&&"preview"in b){var c=b.preview;b.basePath&&!oa(c)&&(c=b.basePath+c);qa=f.createElement("div");qa.className="pnlm-preview-img";qa.style.backgroundImage="url('"+encodeURI(c)+"')";M.appendChild(qa)}var c=b.title,d=b.author;a&&("previewTitle"in b&&(b.title=b.previewTitle),"previewAuthor"in b&&(b.author=b.previewAuthor));b.hasOwnProperty("title")||(n.title.innerHTML=
"");b.hasOwnProperty("author")||(n.author.innerHTML="");b.hasOwnProperty("title")||b.hasOwnProperty("author")||(n.container.style.display="none");w.load.innerHTML="<p>"+b.strings.loadButtonLabel+"</p>";n.load.boxp.innerHTML=b.strings.loadingLabel;for(var e in b)if(b.hasOwnProperty(e))switch(e){case "title":n.title.innerHTML=D(b[e]);n.container.style.display="inline";break;case "author":n.author.innerHTML=b.strings.bylineLabel.replace("%s",D(b[e]));n.container.style.display="inline";break;case "fallback":n.errorMsg.innerHTML=
'<p>Your browser does not support WebGL.<br><a href="'+encodeURI(b[e])+'" target="_blank">Click here to view this panorama in an alternative viewer.</a></p>';break;case "hfov":U(Number(b[e]));break;case "autoLoad":!0===b[e]&&B===m&&(n.load.box.style.display="inline",w.load.style.display="none",Na());break;case "showZoomCtrl":w.zoom.style.display=b[e]&&!1!=b.showControls?"block":"none";break;case "showFullscreenCtrl":w.fullscreen.style.display=b[e]&&!1!=b.showControls&&("fullscreen"in f||"mozFullScreen"in
f||"webkitIsFullScreen"in f||"msFullscreenElement"in f)?"block":"none";break;case "hotSpotDebug":Xa.style.display=b[e]?"block":"none";break;case "showControls":b[e]||(w.orientation.style.display="none",w.zoom.style.display="none",w.fullscreen.style.display="none");break;case "orientationOnByDefault":b[e]&&(pa===m?Ya=!0:!0===pa&&Ka())}a&&(c?b.title=c:delete b.title,d?b.author=d:delete b.author)}function z(){if(L&&!Pa)if(Ga)f.exitFullscreen?f.exitFullscreen():f.mozCancelFullScreen?f.mozCancelFullScreen():
f.webkitCancelFullScreen?f.webkitCancelFullScreen():f.msExitFullscreen&&f.msExitFullscreen();else try{r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.msRequestFullscreen?r.msRequestFullscreen():r.webkitRequestFullScreen()}catch(a){}}function y(){f.fullscreen||f.mozFullScreen||f.webkitIsFullScreen||f.msFullscreenElement?(w.fullscreen.classList.add("pnlm-fullscreen-toggle-button-active"),Ga=!0):(w.fullscreen.classList.remove("pnlm-fullscreen-toggle-button-active"),
Ga=!1);B.resize();U(b.hfov);F()}function E(a){var c=b.minHfov;"multires"==b.type&&B&&(c=Math.min(c,B.getCanvas().width/(b.multiRes.cubeResolution/90*0.9)));return c>b.maxHfov?(console.log("HFOV bounds do not make sense (minHfov > maxHfov)."),b.hfov):a<c?c:a>b.maxHfov?b.maxHfov:a}function U(a){b.hfov=E(a)}function Ja(){K={};$=b.autoRotate?b.autoRotate:$;b.autoRotate=!1}function Q(){Pa&&(n.load.box.style.display="none",n.errorMsg.style.display="none",Pa=!1,ga("errorcleared"));w.load.style.display="none";
n.load.box.style.display="inline";Na()}function I(a,c,d,e,f){L=!1;K={};var h,l;if(b.sceneFadeDuration&&!f&&(h=B.render(b.pitch*Math.PI/180,b.yaw*Math.PI/180,b.hfov*Math.PI/180,{returnImage:!0}),h!==m)){f=new Image;f.className="pnlm-fade-img";f.style.transition="opacity "+b.sceneFadeDuration/1E3+"s";f.style.width="100%";f.style.height="100%";f.onload=function(){I(a,c,d,e,!0)};f.src=h;M.appendChild(f);B.fadeImg=f;return}f="same"===c?b.pitch:c;h="same"===d?b.yaw:"sameAzimuth"===d?b.yaw+(b.northOffset||
0)-(v.scenes[a].northOffset||0):d;l="same"===e?b.hfov:e;p();g(a);x.yaw=x.pitch=x.hfov=0;t();f!==m&&(b.pitch=f);h!==m&&(b.yaw=h);l!==m&&(b.hfov=l);ga("scenechange",a);Q()}function l(){J.removeEventListener("deviceorientation",Ma);w.orientation.classList.remove("pnlm-orientation-button-active");aa=!1}function Ka(){aa=1;J.addEventListener("deviceorientation",Ma);w.orientation.classList.add("pnlm-orientation-button-active")}function D(a){return v.escapeHTML?String(a).split(/&/g).join("&amp;").split('"').join("&quot;").split("'").join("&#39;").split("<").join("&lt;").split(">").join("&gt;").split("/").join("&#x2f;").split("\n").join("<br>"):
String(a).split("\n").join("<br>")}function ga(a){if(a in T)for(var b=T[a].length;0<b;b--)T[a][T[a].length-b].apply(null,[].slice.call(arguments,1))}var za=this,b,B,qa,la=!1,S=Date.now(),xa=0,ya=0,Fa=-1,Qa=0,Ra=0,q=Array(10),Ga=!1,L=!1,Pa=!1,Sa=!1,O,ia,x={yaw:0,pitch:0,hfov:0},Ta=!1,aa=!1,ab=0,Ua,$=0,wa,Ea,K={},T={},da=[],$a=!1,Va=!1,Wa={hfov:100,minHfov:50,maxHfov:120,pitch:0,minPitch:m,maxPitch:m,yaw:0,minYaw:-180,maxYaw:180,roll:0,haov:360,vaov:180,vOffset:0,autoRotate:!1,autoRotateInactivityDelay:-1,
autoRotateStopDelay:m,type:"equirectangular",northOffset:0,showFullscreenCtrl:!0,dynamic:!1,doubleClickZoom:!0,keyboardZoom:!0,mouseZoom:!0,showZoomCtrl:!0,autoLoad:!1,showControls:!0,orientationOnByDefault:!1,hotSpotDebug:!1,backgroundColor:[0,0,0],animationTimingFunction:function(a){return 0.5>a?2*a*a:-1+(4-2*a)*a},draggable:!0,disableKeyboardCtrl:!1,crossOrigin:"anonymous",strings:{loadButtonLabel:"Click to<br>Load<br>Panorama",loadingLabel:"Loading...",bylineLabel:"by %s",noPanoramaError:"No panorama image was specified.",
fileAccessError:"The file %s could not be accessed.",malformedURLError:"There is something wrong with the panorama URL.",iOS8WebGLError:"Due to iOS 8's broken WebGL implementation, only progressive encoded JPEGs work for your device (this panorama uses standard encoding).",genericWebGLError:"Your browser does not have the necessary WebGL support to display this panorama.",textureSizeError:"This panorama is too big for your device! It's %spx wide, but your device only supports images up to %spx wide. Try another device. (If you're the author, try scaling down the image.)",
unknownError:"Unknown error. Check developer console."}},Za=[16,17,27,37,38,39,40,61,65,68,83,87,107,109,173,187,189];r="string"===typeof r?f.getElementById(r):r;r.classList.add("pnlm-container");r.tabIndex=0;var C=f.createElement("div");C.className="pnlm-ui";r.appendChild(C);var M=f.createElement("div");M.className="pnlm-render-container";r.appendChild(M);var H=f.createElement("div");H.className="pnlm-dragfix";C.appendChild(H);var ha=f.createElement("span");ha.className="pnlm-about-msg";ha.innerHTML=
'<a href="https://pannellum.org/" target="_blank">Pannellum</a> 05837fd';C.appendChild(ha);H.addEventListener("contextmenu",X);var n={},Xa=f.createElement("div");Xa.className="pnlm-sprite pnlm-hot-spot-debug-indicator";C.appendChild(Xa);n.container=f.createElement("div");n.container.className="pnlm-panorama-info";n.title=f.createElement("div");n.title.className="pnlm-title-box";n.container.appendChild(n.title);n.author=f.createElement("div");n.author.className="pnlm-author-box";n.container.appendChild(n.author);
C.appendChild(n.container);n.load={};n.load.box=f.createElement("div");n.load.box.className="pnlm-load-box";n.load.boxp=f.createElement("p");n.load.box.appendChild(n.load.boxp);n.load.lbox=f.createElement("div");n.load.lbox.className="pnlm-lbox";n.load.lbox.innerHTML='<div class="pnlm-loading"></div>';n.load.box.appendChild(n.load.lbox);n.load.lbar=f.createElement("div");n.load.lbar.className="pnlm-lbar";n.load.lbarFill=f.createElement("div");n.load.lbarFill.className="pnlm-lbar-fill";n.load.lbar.appendChild(n.load.lbarFill);
n.load.box.appendChild(n.load.lbar);n.load.msg=f.createElement("p");n.load.msg.className="pnlm-lmsg";n.load.box.appendChild(n.load.msg);C.appendChild(n.load.box);n.errorMsg=f.createElement("div");n.errorMsg.className="pnlm-error-msg pnlm-info-box";C.appendChild(n.errorMsg);var w={};w.container=f.createElement("div");w.container.className="pnlm-controls-container";C.appendChild(w.container);w.load=f.createElement("div");w.load.className="pnlm-load-button";w.load.addEventListener("click",function(){t();
Q()});C.appendChild(w.load);w.zoom=f.createElement("div");w.zoom.className="pnlm-zoom-controls pnlm-controls";w.zoomIn=f.createElement("div");w.zoomIn.className="pnlm-zoom-in pnlm-sprite pnlm-control";w.zoomIn.addEventListener("click",function(){L&&(U(b.hfov-5),F())});w.zoom.appendChild(w.zoomIn);w.zoomOut=f.createElement("div");w.zoomOut.className="pnlm-zoom-out pnlm-sprite pnlm-control";w.zoomOut.addEventListener("click",function(){L&&(U(b.hfov+5),F())});w.zoom.appendChild(w.zoomOut);w.container.appendChild(w.zoom);
w.fullscreen=f.createElement("div");w.fullscreen.addEventListener("click",z);w.fullscreen.className="pnlm-fullscreen-toggle-button pnlm-sprite pnlm-fullscreen-toggle-button-inactive pnlm-controls pnlm-control";(f.fullscreenEnabled||f.mozFullScreenEnabled||f.webkitFullscreenEnabled||f.msFullscreenEnabled)&&w.container.appendChild(w.fullscreen);w.orientation=f.createElement("div");w.orientation.addEventListener("click",function(a){aa?l():Ka()});w.orientation.addEventListener("mousedown",function(a){a.stopPropagation()});
w.orientation.addEventListener("touchstart",function(a){a.stopPropagation()});w.orientation.addEventListener("pointerdown",function(a){a.stopPropagation()});w.orientation.className="pnlm-orientation-button pnlm-orientation-button-inactive pnlm-sprite pnlm-controls pnlm-control";var pa,Ya=!1;J.DeviceOrientationEvent?J.addEventListener("deviceorientation",Oa):pa=!1;var Ha=f.createElement("div");Ha.className="pnlm-compass pnlm-controls pnlm-control";C.appendChild(Ha);v.firstScene?g(v.firstScene):v.default&&
v.default.firstScene?g(v.default.firstScene):g(null);t(!0);var ma=[],Aa=[];Z.prototype.multiply=function(a){return new Z(this.w*a.w-this.x*a.x-this.y*a.y-this.z*a.z,this.x*a.w+this.w*a.x+this.y*a.z-this.z*a.y,this.y*a.w+this.w*a.y+this.z*a.x-this.x*a.z,this.z*a.w+this.w*a.z+this.x*a.y-this.y*a.x)};Z.prototype.toEulerAngles=function(){var a=Math.atan2(2*(this.w*this.x+this.y*this.z),1-2*(this.x*this.x+this.y*this.y)),b=Math.asin(2*(this.w*this.y-this.z*this.x)),c=Math.atan2(2*(this.w*this.z+this.x*
this.y),1-2*(this.y*this.y+this.z*this.z));return[a,b,c]};this.isLoaded=function(){return L};this.getPitch=function(){return b.pitch};this.setPitch=function(a,c,d,e){(c=c==m?1E3:Number(c))?K.pitch={startTime:Date.now(),startPosition:b.pitch,endPosition:a,duration:c,callback:d,callbackArgs:e}:b.pitch=a;F();return this};this.getPitchBounds=function(){return[b.minPitch,b.maxPitch]};this.setPitchBounds=function(a){b.minPitch=Math.max(-90,Math.min(a[0],90));b.maxPitch=Math.max(-90,Math.min(a[1],90));return this};
this.getYaw=function(){return b.yaw};this.setYaw=function(a,c,d,e){c=c==m?1E3:Number(c);a=(a+180)%360-180;c?(180<b.yaw-a?a+=360:180<a-b.yaw&&(a-=360),K.yaw={startTime:Date.now(),startPosition:b.yaw,endPosition:a,duration:c,callback:d,callbackArgs:e}):b.yaw=a;F();return this};this.getYawBounds=function(){return[b.minYaw,b.maxYaw]};this.setYawBounds=function(a){b.minYaw=Math.max(-180,Math.min(a[0],180));b.maxYaw=Math.max(-180,Math.min(a[1],180));return this};this.getHfov=function(){return b.hfov};this.setHfov=
function(a,c,d,e){(c=c==m?1E3:Number(c))?K.hfov={startTime:Date.now(),startPosition:b.hfov,endPosition:E(a),duration:c,callback:d,callbackArgs:e}:U(a);F();return this};this.getHfovBounds=function(){return[b.minHfov,b.maxHfov]};this.setHfovBounds=function(a){b.minHfov=Math.max(0,a[0]);b.maxHfov=Math.max(0,a[1]);return this};this.lookAt=function(a,b,c,d,e,f){d=d==m?1E3:Number(d);a!==m&&(this.setPitch(a,d,e,f),e=m);b!==m&&(this.setYaw(b,d,e,f),e=m);c!==m&&this.setHfov(c,d,e,f);return this};this.getNorthOffset=
function(){return b.northOffset};this.setNorthOffset=function(a){b.northOffset=Math.min(360,Math.max(0,a));F();return this};this.getHorizonRoll=function(){return b.horizonRoll};this.setHorizonRoll=function(a){b.horizonRoll=Math.min(90,Math.max(-90,a));B.setPose(b.horizonPitch*Math.PI/180,b.horizonRoll*Math.PI/180);F();return this};this.getHorizonPitch=function(){return b.horizonPitch};this.setHorizonPitch=function(a){b.horizonPitch=Math.min(90,Math.max(-90,a));B.setPose(b.horizonPitch*Math.PI/180,
b.horizonRoll*Math.PI/180);F();return this};this.startAutoRotate=function(a){a=a||$||1;b.autoRotate=a;za.lookAt(Ea,m,wa,3E3);F();return this};this.stopAutoRotate=function(){$=b.autoRotate?b.autoRotate:$;b.autoRotate=!1;b.autoRotateInactivityDelay=-1;return this};this.getRenderer=function(){return B};this.setUpdate=function(a){$a=!0===a;B===m?P():F();return this};this.mouseEventToCoords=function(a){return sa(a)};this.loadScene=function(a,b,c,d){L&&I(a,b,c,d);return this};this.getScene=function(){return b.scene};
this.addScene=function(a,b){v.scenes[a]=b;return this};this.removeScene=function(a){if(b.scene===a||!v.scenes.hasOwnProperty(a))return!1;delete v.scenes[a];return!0};this.toggleFullscreen=function(){z();return this};this.getConfig=function(){return b};this.getContainer=function(){return r};this.addHotSpot=function(a,d){if(d===m&&b.scene===m)b.hotSpots.push(a);else{var e=d!==m?d:b.scene;if(v.scenes.hasOwnProperty(e))v.scenes[e].hasOwnProperty("hotSpots")||(v.scenes[e].hotSpots=[],e==b.scene&&(b.hotSpots=
v.scenes[e].hotSpots)),v.scenes[e].hotSpots.push(a);else throw"Invalid scene ID!";}if(d===m||b.scene==d)Ia(a),L&&c(a);return this};this.removeHotSpot=function(a){if(!b.hotSpots)return!1;for(var c=0;c<b.hotSpots.length;c++)if(b.hotSpots[c].hasOwnProperty("id")&&b.hotSpots[c].id===a){for(a=b.hotSpots[c].div;a.parentNode!=M;)a=a.parentNode;M.removeChild(a);delete b.hotSpots[c].div;b.hotSpots.splice(c,1);return!0}return!1};this.resize=function(){y()};this.isLoaded=function(){return L};this.isOrientationSupported=
function(){return pa||!1};this.stopOrientation=function(){l()};this.startOrientation=function(){pa&&Ka()};this.isOrientationActive=function(){return Boolean(aa)};this.on=function(a,b){T[a]=T[a]||[];T[a].push(b);return this};this.off=function(a,b){if(!a)return T={},this;if(b){var c=T[a].indexOf(b);0<=c&&T[a].splice(c,1);0==T[a].length&&delete T[a]}else delete T[a];return this};this.destroy=function(){B&&B.destroy();Sa&&(H.removeEventListener("mousedown",Ca,!1),H.removeEventListener("dblclick",ra,!1),
f.removeEventListener("mousemove",La,!1),f.removeEventListener("mouseup",ea,!1),r.removeEventListener("mousewheel",na,!1),r.removeEventListener("DOMMouseScroll",na,!1),r.removeEventListener("mozfullscreenchange",y,!1),r.removeEventListener("webkitfullscreenchange",y,!1),r.removeEventListener("msfullscreenchange",y,!1),r.removeEventListener("fullscreenchange",y,!1),J.removeEventListener("resize",ka,!1),J.removeEventListener("orientationchange",ka,!1),r.removeEventListener("keydown",R,!1),r.removeEventListener("keyup",
fa,!1),r.removeEventListener("blur",ua,!1),f.removeEventListener("mouseleave",ea,!1),H.removeEventListener("touchstart",ta,!1),H.removeEventListener("touchmove",A,!1),H.removeEventListener("touchend",d,!1),H.removeEventListener("pointerdown",a,!1),H.removeEventListener("pointermove",V,!1),H.removeEventListener("pointerup",N,!1),H.removeEventListener("pointerleave",N,!1));r.innerHTML="";r.classList.remove("pnlm-container");C.classList.remove("pnlm-grab");C.classList.remove("pnlm-grabbing")}}return{viewer:function(f,
m){return new Ba(f,m)}}}(window,document);

Зареждане…
Отказ
Запис