/*
	krpano 1.23.3 Radar Plugin (build 2025-11-15)
	https://krpano.com/plugins/radar/
*/
var krpanoplugin=function(){function K(f,c){function b(a){return"rgb("+(a>>16&255)+","+(a>>8&255)+","+(a&255)+")"}var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("width",f);a.setAttribute("height",c);a.style.position="absolute";a.style.left="0px";a.style.top="0px";var g=document.createElementNS("http://www.w3.org/2000/svg","path");a.appendChild(g);var d={};d.svg=a;d.path=g;d.setstyle=function(a,c,f,d,e){g.setAttribute("stroke",b(a));g.setAttribute("stroke-width",
c);g.setAttribute("stroke-opacity",f);g.setAttribute("fill",b(d));g.setAttribute("fill-opacity",e)};d.drawpie=function(a,c,f,b,d){var k,e;b>d&&(k=d,d=b,b=k);b=b*Math.PI/180;d=d*Math.PI/180;e=d-b;k=(b+d)/2;var h=e>Math.PI?1:0;e>=2*Math.PI&&(e=2*Math.PI-.01);b=k-e/2;d=k+e/2;k=a+f*Math.sin(b);b=c-f*Math.cos(b);e=a+f*Math.sin(d);d=c-f*Math.cos(d);g.setAttribute("d","M "+a+","+c+" L "+k+","+b+" A "+f+","+f+" 0 "+h+" 1 "+e+","+d+" Z")};return d}function C(b){u=!0;p(b);e.mouse&&(window.addEventListener("mousemove",
p,!0),window.addEventListener("mouseup",m,!0));e.touch&&(window.addEventListener(e.touchmove,p,!0),window.addEventListener(e.touchcancel,m,!0),window.addEventListener(e.touchend,m,!0))}function m(b){e.mouse&&(window.removeEventListener("mousemove",p,!0),window.removeEventListener("mouseup",m,!0));e.touch&&(window.removeEventListener(e.touchmove,p,!0),window.removeEventListener(e.touchcancel,m,!0),window.removeEventListener(e.touchend,m,!0))}function p(f){if(null==g)m(f);else if(null!=h){f&&(f.preventDefault(),
f.stopImmediatePropagation(),f.stopPropagation());var c,k=c=0,a=h.svg.parentNode.getBoundingClientRect();e.touch?(f=f.changedTouches?f.changedTouches:[f],0<f.length&&(k=f[0],c=Math.round(k.clientX-a.left),k=Math.round(k.clientY-a.top))):(c=Math.round(f.clientX-a.left),k=Math.round(f.clientY-a.top));c=180*Math.atan2(k-.5*D*g.stagescale,c-.5*E*g.stagescale)/Math.PI;c-=q;if(1==u)F=c-(isNaN(parseFloat(l))?g.view.hlookat:1*l-90),u=!1;else if(c-=F,isNaN(parseFloat(l))){for(;180<c;)c-=360;for(;-180>c;)c+=
360;g.view.hlookat=c}else{for(l=c+90;180<l;)l-=360;for(;-180>l;)l+=360;b.triggerevent("oncustomchange")}d=!0}}function G(){if(!b)return!1;var f=n/2*g.stagescale;2E3<f&&(f=2E3);var c=Math.ceil(2*f),e=2+2*r+c;if(e!=H){H=e;var a=h.svg;a.setAttribute("width",e);a.setAttribute("height",e);a.style.left=(c-e>>1)+"px";a.style.top=(c-e>>1)+"px";d=!0}c=q+v-0+(isNaN(parseFloat(l))?g.view.hlookat:1*l-90);a=isNaN(parseFloat(t))?g.view.hfov:1*t;w&&(a=-a);b&&b.sprite&&(b.sprite.style.pointerEvents="none");var m=
h.path.style;m.pointerEvents=b.enabled?"visiblePainted":"none";m.cursor=b.handcursor?"pointer":"default";if(.01<Math.abs(c-I)||.02<Math.abs(a-J))I=c,J=a,d=!0;d&&(d=!1,h.setstyle(x,r,y,z,A),h.drawpie(e/2-.5,e/2-.5,f,c-.5*a,c+.5*a));return!0}this.name="Radar";this.version="__BUILD_VERSION__";this.build="__BUILD_DATE__";var g=null,b=null,B=null,e=null,h=null,n=256,E=256,D=256,q=0,v=90,w=!1,z=16777215,x=16777215,A=.5,y=.3,r=0,u=!1,F=null,d=!0,H=-1,I=0,J=0,l=null,t=null;this.registerplugin=function(f,
c,k){g=f;b=k;"1.21">g.version||"2023-03-01">g.build?(g.trace(3,"Radar Plugin - too old krpano version (min. 1.21)"),b=g=null):(B=g.device,e=B.browser.events,b.registerattribute("heading",0,function(a){q=Number(a);d=!0},function(){return q}),b.registerattribute("headingoffset",90,function(a){v=Number(a);d=!0},function(){return v}),b.registerattribute("invert",!1,function(a){w="true"==String(a).toLowerCase();d=!0},function(){return w}),b.registerattribute("fillcolor",16777215,function(a){z=parseInt(a);
d=!0},function(){return z}),b.registerattribute("linecolor",16777215,function(a){x=parseInt(a);d=!0},function(){return x}),b.registerattribute("fillalpha",.5,function(a){A=Number(a);d=!0},function(){return A}),b.registerattribute("linealpha",.3,function(a){y=Number(a);d=!0},function(){return y}),b.registerattribute("linewidth",0,function(a){r=Number(a);d=!0},function(){return r}),b.registerattribute("customhlookat",null,function(a){l=a;d=!0},function(){return l}),b.registerattribute("customhfov",
null,function(a){t=a;d=!0},function(){return t}),b.registercontentsize(n,n),h=K(n,n),b._assignEvents(h.path),h.path.kobject=b,b.sprite.style.pointerEvents="none",b.sprite.appendChild(h.svg),e.mouse&&h.path.addEventListener("mousedown",C,!0),e.touch&&h.path.addEventListener(e.touchstart,C,!0),g.actions.asyncloop(G))};this.unloadplugin=function(){if(g&&b){try{h.path.kobject=null,b.sprite.removeChild(h.svg)}catch(d){}g=b=null}};this.onresize=function(b,c){E=b;D=c;n=Math.max(b,c);d=!0;G();h.path.style[B.browser.css.transform]=
"scale("+(b/n).toFixed(6)+","+(c/n).toFixed(6)+")";return!1}};
