(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3c229bbc"],{4721:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var n=i("5a89"),r=function(t,e){void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.enabled=!0,this.target=new n["y"],this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:n["m"].ROTATE,MIDDLE:n["m"].DOLLY,RIGHT:n["m"].PAN},this.touches={ONE:n["w"].ROTATE,TWO:n["w"].DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return h.phi},this.getAzimuthalAngle=function(){return h.theta},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=function(){var e=new n["y"],o=(new n["t"]).setFromUnitVectors(t.up,new n["y"](0,1,0)),s=o.clone().inverse(),m=new n["y"],g=new n["t"],y=2*Math.PI;return function(){var t=i.object.position;e.copy(t).sub(i.target),e.applyQuaternion(o),h.setFromVector3(e),i.autoRotate&&l===a.NONE&&E(S()),i.enableDamping?(h.theta+=u.theta*i.dampingFactor,h.phi+=u.phi*i.dampingFactor):(h.theta+=u.theta,h.phi+=u.phi);var n=i.minAzimuthAngle,v=i.maxAzimuthAngle;return isFinite(n)&&isFinite(v)&&(n<-Math.PI?n+=y:n>Math.PI&&(n-=y),v<-Math.PI?v+=y:v>Math.PI&&(v-=y),h.theta=n(n+v)/2?Math.max(n,h.theta):Math.min(v,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),h.radius*=d,h.radius=Math.max(i.minDistance,Math.min(i.maxDistance,h.radius)),!0===i.enableDamping?i.target.addScaledVector(p,i.dampingFactor):i.target.add(p),e.setFromSpherical(h),e.applyQuaternion(s),t.copy(i.target).add(e),i.object.lookAt(i.target),!0===i.enableDamping?(u.theta*=1-i.dampingFactor,u.phi*=1-i.dampingFactor,p.multiplyScalar(1-i.dampingFactor)):(u.set(0,0,0),p.set(0,0,0)),d=1,!!(f||m.distanceToSquared(i.object.position)>c||8*(1-g.dot(i.object.quaternion))>c)&&(i.dispatchEvent(r),m.copy(i.object.position),g.copy(i.object.quaternion),f=!1,!0)}}(),this.dispose=function(){i.domElement.removeEventListener("contextmenu",at,!1),i.domElement.removeEventListener("mousedown",$,!1),i.domElement.removeEventListener("wheel",it,!1),i.domElement.removeEventListener("touchstart",rt,!1),i.domElement.removeEventListener("touchend",st,!1),i.domElement.removeEventListener("touchmove",ot,!1),i.domElement.ownerDocument.removeEventListener("mousemove",tt,!1),i.domElement.ownerDocument.removeEventListener("mouseup",et,!1),i.domElement.removeEventListener("keydown",nt,!1)};var i=this,r={type:"change"},o={type:"start"},s={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},l=a.NONE,c=1e-6,h=new n["v"],u=new n["v"],d=1,p=new n["y"],f=!1,m=new n["x"],g=new n["x"],y=new n["x"],v=new n["x"],x=new n["x"],b=new n["x"],w=new n["x"],M=new n["x"],_=new n["x"];function S(){return 2*Math.PI/60/60*i.autoRotateSpeed}function T(){return Math.pow(.95,i.zoomSpeed)}function E(t){u.theta-=t}function A(t){u.phi-=t}var L=function(){var t=new n["y"];return function(e,i){t.setFromMatrixColumn(i,0),t.multiplyScalar(-e),p.add(t)}}(),C=function(){var t=new n["y"];return function(e,n){!0===i.screenSpacePanning?t.setFromMatrixColumn(n,1):(t.setFromMatrixColumn(n,0),t.crossVectors(i.object.up,t)),t.multiplyScalar(e),p.add(t)}}(),P=function(){var t=new n["y"];return function(e,n){var r=i.domElement;if(i.object.isPerspectiveCamera){var o=i.object.position;t.copy(o).sub(i.target);var s=t.length();s*=Math.tan(i.object.fov/2*Math.PI/180),L(2*e*s/r.clientHeight,i.object.matrix),C(2*n*s/r.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(L(e*(i.object.right-i.object.left)/i.object.zoom/r.clientWidth,i.object.matrix),C(n*(i.object.top-i.object.bottom)/i.object.zoom/r.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function O(t){i.object.isPerspectiveCamera?d/=t:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*t)),i.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function R(t){i.object.isPerspectiveCamera?d*=t:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/t)),i.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function k(t){m.set(t.clientX,t.clientY)}function D(t){w.set(t.clientX,t.clientY)}function I(t){v.set(t.clientX,t.clientY)}function N(t){g.set(t.clientX,t.clientY),y.subVectors(g,m).multiplyScalar(i.rotateSpeed);var e=i.domElement;E(2*Math.PI*y.x/e.clientHeight),A(2*Math.PI*y.y/e.clientHeight),m.copy(g),i.update()}function z(t){M.set(t.clientX,t.clientY),_.subVectors(M,w),_.y>0?O(T()):_.y<0&&R(T()),w.copy(M),i.update()}function B(t){x.set(t.clientX,t.clientY),b.subVectors(x,v).multiplyScalar(i.panSpeed),P(b.x,b.y),v.copy(x),i.update()}function G(){}function F(t){t.deltaY<0?R(T()):t.deltaY>0&&O(T()),i.update()}function H(t){var e=!1;switch(t.keyCode){case i.keys.UP:P(0,i.keyPanSpeed),e=!0;break;case i.keys.BOTTOM:P(0,-i.keyPanSpeed),e=!0;break;case i.keys.LEFT:P(i.keyPanSpeed,0),e=!0;break;case i.keys.RIGHT:P(-i.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),i.update())}function U(t){if(1==t.touches.length)m.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);m.set(e,i)}}function j(t){if(1==t.touches.length)v.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);v.set(e,i)}}function W(t){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);w.set(0,n)}function V(t){i.enableZoom&&W(t),i.enablePan&&j(t)}function X(t){i.enableZoom&&W(t),i.enableRotate&&U(t)}function Y(t){if(1==t.touches.length)g.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);g.set(e,n)}y.subVectors(g,m).multiplyScalar(i.rotateSpeed);var r=i.domElement;E(2*Math.PI*y.x/r.clientHeight),A(2*Math.PI*y.y/r.clientHeight),m.copy(g)}function q(t){if(1==t.touches.length)x.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);x.set(e,n)}b.subVectors(x,v).multiplyScalar(i.panSpeed),P(b.x,b.y),v.copy(x)}function Z(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);M.set(0,r),_.set(0,Math.pow(M.y/w.y,i.zoomSpeed)),O(_.y),w.copy(M)}function J(t){i.enableZoom&&Z(t),i.enablePan&&q(t)}function K(t){i.enableZoom&&Z(t),i.enableRotate&&Y(t)}function Q(){}function $(t){if(!1!==i.enabled){var e;switch(t.preventDefault(),i.domElement.focus?i.domElement.focus():window.focus(),t.button){case 0:e=i.mouseButtons.LEFT;break;case 1:e=i.mouseButtons.MIDDLE;break;case 2:e=i.mouseButtons.RIGHT;break;default:e=-1}switch(e){case n["m"].DOLLY:if(!1===i.enableZoom)return;D(t),l=a.DOLLY;break;case n["m"].ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===i.enablePan)return;I(t),l=a.PAN}else{if(!1===i.enableRotate)return;k(t),l=a.ROTATE}break;case n["m"].PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===i.enableRotate)return;k(t),l=a.ROTATE}else{if(!1===i.enablePan)return;I(t),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&(i.domElement.ownerDocument.addEventListener("mousemove",tt,!1),i.domElement.ownerDocument.addEventListener("mouseup",et,!1),i.dispatchEvent(o))}}function tt(t){if(!1!==i.enabled)switch(t.preventDefault(),l){case a.ROTATE:if(!1===i.enableRotate)return;N(t);break;case a.DOLLY:if(!1===i.enableZoom)return;z(t);break;case a.PAN:if(!1===i.enablePan)return;B(t);break}}function et(t){!1!==i.enabled&&(G(t),i.domElement.ownerDocument.removeEventListener("mousemove",tt,!1),i.domElement.ownerDocument.removeEventListener("mouseup",et,!1),i.dispatchEvent(s),l=a.NONE)}function it(t){!1===i.enabled||!1===i.enableZoom||l!==a.NONE&&l!==a.ROTATE||(t.preventDefault(),t.stopPropagation(),i.dispatchEvent(o),F(t),i.dispatchEvent(s))}function nt(t){!1!==i.enabled&&!1!==i.enableKeys&&!1!==i.enablePan&&H(t)}function rt(t){if(!1!==i.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(i.touches.ONE){case n["w"].ROTATE:if(!1===i.enableRotate)return;U(t),l=a.TOUCH_ROTATE;break;case n["w"].PAN:if(!1===i.enablePan)return;j(t),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case n["w"].DOLLY_PAN:if(!1===i.enableZoom&&!1===i.enablePan)return;V(t),l=a.TOUCH_DOLLY_PAN;break;case n["w"].DOLLY_ROTATE:if(!1===i.enableZoom&&!1===i.enableRotate)return;X(t),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(o)}}function ot(t){if(!1!==i.enabled)switch(t.preventDefault(),t.stopPropagation(),l){case a.TOUCH_ROTATE:if(!1===i.enableRotate)return;Y(t),i.update();break;case a.TOUCH_PAN:if(!1===i.enablePan)return;q(t),i.update();break;case a.TOUCH_DOLLY_PAN:if(!1===i.enableZoom&&!1===i.enablePan)return;J(t),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(!1===i.enableZoom&&!1===i.enableRotate)return;K(t),i.update();break;default:l=a.NONE}}function st(t){!1!==i.enabled&&(Q(t),i.dispatchEvent(s),l=a.NONE)}function at(t){!1!==i.enabled&&t.preventDefault()}i.domElement.addEventListener("contextmenu",at,!1),i.domElement.addEventListener("mousedown",$,!1),i.domElement.addEventListener("wheel",it,!1),i.domElement.addEventListener("touchstart",rt,!1),i.domElement.addEventListener("touchend",st,!1),i.domElement.addEventListener("touchmove",ot,!1),i.domElement.addEventListener("keydown",nt,!1),-1===i.domElement.tabIndex&&(i.domElement.tabIndex=0),this.update()};r.prototype=Object.create(n["e"].prototype),r.prototype.constructor=r;var o=function(t,e){r.call(this,t,e),this.screenSpacePanning=!1,this.mouseButtons.LEFT=n["m"].PAN,this.mouseButtons.RIGHT=n["m"].ROTATE,this.touches.ONE=n["w"].PAN,this.touches.TWO=n["w"].DOLLY_ROTATE};o.prototype=Object.create(n["e"].prototype),o.prototype.constructor=o},"5a89":function(t,e,i){"use strict";i.d(e,"a",(function(){return sn})),i.d(e,"b",(function(){return ur})),i.d(e,"c",(function(){return Nn})),i.d(e,"d",(function(){return f})),i.d(e,"e",(function(){return ni})),i.d(e,"f",(function(){return Fn})),i.d(e,"g",(function(){return Xd})),i.d(e,"h",(function(){return tr})),i.d(e,"i",(function(){return Nr})),i.d(e,"j",(function(){return tm})),i.d(e,"k",(function(){return _h})),i.d(e,"l",(function(){return Rh})),i.d(e,"m",(function(){return r})),i.d(e,"n",(function(){return Cr})),i.d(e,"o",(function(){return jn})),i.d(e,"p",(function(){return Xr})),i.d(e,"q",(function(){return wn})),i.d(e,"r",(function(){return Gh})),i.d(e,"s",(function(){return Dh})),i.d(e,"t",(function(){return mi})),i.d(e,"u",(function(){return Vi})),i.d(e,"v",(function(){return qf})),i.d(e,"w",(function(){return o})),i.d(e,"x",(function(){return si})),i.d(e,"y",(function(){return vi})),i.d(e,"z",(function(){return rg})),i.d(e,"A",(function(){return Hc})),i.d(e,"B",(function(){return Vh})),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype===!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");const e=Object(t);for(let i=1;i>8&255]+ri[t>>16&255]+ri[t>>24&255]+"-"+ri[255&e]+ri[e>>8&255]+"-"+ri[e>>16&15|64]+ri[e>>24&255]+"-"+ri[63&i|128]+ri[i>>8&255]+"-"+ri[i>>16&255]+ri[i>>24&255]+ri[255&n]+ri[n>>8&255]+ri[n>>16&255]+ri[n>>24&255];return r.toUpperCase()},clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*(3-2*t))},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*t*(t*(6*t-15)+10))},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*oi.DEG2RAD},radToDeg:function(t){return t*oi.RAD2DEG},isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,n,r){const o=Math.cos,s=Math.sin,a=o(i/2),l=s(i/2),c=o((e+n)/2),h=s((e+n)/2),u=o((e-n)/2),d=s((e-n)/2),p=o((n-e)/2),f=s((n-e)/2);switch(r){case"XYX":t.set(a*h,l*u,l*d,a*c);break;case"YZY":t.set(l*d,a*h,l*u,a*c);break;case"ZXZ":t.set(l*u,l*d,a*h,a*c);break;case"XZX":t.set(a*h,l*f,l*p,a*c);break;case"YXY":t.set(l*p,a*h,l*f,a*c);break;case"ZYZ":t.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};function si(t=0,e=0){this.x=t,this.y=e}function ai(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}let li;Object.defineProperties(si.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(si.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){const t=Math.atan2(-this.y,-this.x)+Math.PI;return t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*n+t.x,this.y=r*n+o*i+t.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(ai.prototype,{isMatrix3:!0,set:function(t,e,i,n,r,o,s,a,l){const c=this.elements;return c[0]=t,c[1]=n,c[2]=s,c[3]=e,c[4]=r,c[5]=a,c[6]=i,c[7]=o,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},extractBasis:function(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],c=i[4],h=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],y=n[1],v=n[4],x=n[7],b=n[2],w=n[5],M=n[8];return r[0]=o*f+s*y+a*b,r[3]=o*m+s*v+a*w,r[6]=o*g+s*x+a*M,r[1]=l*f+c*y+h*b,r[4]=l*m+c*v+h*w,r[7]=l*g+c*x+h*M,r[2]=u*f+d*y+p*b,r[5]=u*m+d*v+p*w,r[8]=u*g+d*x+p*M,this},multiplyScalar:function(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*o*c-e*s*l-i*r*c+i*s*a+n*r*l-n*o*a},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");const i=t.elements,n=this.elements,r=i[0],o=i[1],s=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=d*l-c*u,f=c*h-d*a,m=u*a-l*h,g=r*p+o*f+s*m;if(0===g)return this.set(0,0,0,0,0,0,0,0,0);const y=1/g;return n[0]=p*y,n[1]=(s*u-d*o)*y,n[2]=(c*o-s*l)*y,n[3]=f*y,n[4]=(d*r-s*h)*y,n[5]=(s*a-c*r)*y,n[6]=m*y,n[7]=(o*h-u*r)*y,n[8]=(l*r-o*a)*y,this},transpose:function(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,i,n,r,o,s){const a=Math.cos(r),l=Math.sin(r);this.set(i*a,i*l,-i*(a*o+l*s)+o+t,-n*l,n*a,-n*(-l*o+a*s)+s+e,0,0,1)},scale:function(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},rotate:function(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],o=n[3],s=n[6],a=n[1],l=n[4],c=n[7];return n[0]=e*r+i*a,n[3]=e*o+i*l,n[6]=e*s+i*c,n[1]=-i*r+e*a,n[4]=-i*o+e*l,n[7]=-i*s+e*c,this},translate:function(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this},equals:function(t){const e=this.elements,i=t.elements;for(let n=0;n<9;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}});const ci={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===li&&(li=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),li.width=t.width,li.height=t.height;const i=li.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=li}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};let hi=0;function ui(t,e,i,n,r,o,s,a,l,c){Object.defineProperty(this,"id",{value:hi++}),this.uuid=oi.generateUUID(),this.name="",this.image=void 0!==t?t:ui.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:ui.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:ct,this.wrapT=void 0!==n?n:ct,this.magFilter=void 0!==r?r:ft,this.minFilter=void 0!==o?o:gt,this.anisotropy=void 0!==l?l:1,this.format=void 0!==s?s:Ot,this.internalFormat=null,this.type=void 0!==a?a:yt,this.offset=new si(0,0),this.repeat=new si(1,1),this.center=new si(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ai,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:He,this.version=0,this.onUpdate=null}function di(t=0,e=0,i=0,n=1){this.x=t,this.y=e,this.z=i,this.w=n}function pi(t,e,i){this.width=t,this.height=e,this.scissor=new di(0,0,t,e),this.scissorTest=!1,this.viewport=new di(0,0,t,e),i=i||{},this.texture=new ui(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:ft,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function fi(t,e,i){pi.call(this,t,e,i),this.samples=4}function mi(t=0,e=0,i=0,n=1){this._x=t,this._y=e,this._z=i,this._w=n}ui.DEFAULT_IMAGE=void 0,ui.DEFAULT_MAPPING=et,ui.prototype=Object.assign(Object.create(ni.prototype),{constructor:ui,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){const e=void 0===t||"string"===typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const n=this.image;if(void 0===n.uuid&&(n.uuid=oi.generateUUID()),!e&&void 0===t.images[n.uuid]){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t1)switch(this.wrapS){case lt:t.x=t.x-Math.floor(t.x);break;case ct:t.x=t.x<0?0:1;break;case ht:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case lt:t.y=t.y-Math.floor(t.y);break;case ct:t.y=t.y<0?0:1;break;case ht:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(ui.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(di.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(di.prototype,{isVector4:!0,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){const e=this.x,i=this.y,n=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*n+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*n+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*n+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){let e,i,n,r;const o=.01,s=.1,a=t.elements,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)a&&t>y?ty?a=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),o=Math.atan2(r,e*i);t=Math.sin(t*o)/r,s=Math.sin(s*o)/r}const r=s*i;if(a=a*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+f*r,t===1-s){const t=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=t,l*=t,c*=t,h*=t}}t[e]=a,t[e+1]=l,t[e+2]=c,t[e+3]=h},multiplyQuaternionsFlat:function(t,e,i,n,r,o){const s=i[n],a=i[n+1],l=i[n+2],c=i[n+3],h=r[o],u=r[o+1],d=r[o+2],p=r[o+3];return t[e]=s*p+c*h+a*d-l*u,t[e+1]=a*p+c*u+l*h-s*d,t[e+2]=l*p+c*d+s*u-a*h,t[e+3]=c*p-s*h-a*u-l*d,t}}),Object.defineProperties(mi.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(mi.prototype,{isQuaternion:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=t._x,n=t._y,r=t._z,o=t.order,s=Math.cos,a=Math.sin,l=s(i/2),c=s(n/2),h=s(r/2),u=a(i/2),d=a(n/2),p=a(r/2);switch(o){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this},setFromRotationMatrix:function(t){const e=t.elements,i=e[0],n=e[4],r=e[8],o=e[1],s=e[5],a=e[9],l=e[2],c=e[6],h=e[10],u=i+s+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-a)*t,this._y=(r-l)*t,this._z=(o-n)*t}else if(i>s&&i>h){const t=2*Math.sqrt(1+i-s-h);this._w=(c-a)/t,this._x=.25*t,this._y=(n+o)/t,this._z=(r+l)/t}else if(s>h){const t=2*Math.sqrt(1+s-i-h);this._w=(r-l)/t,this._x=(n+o)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+h-i-s);this._w=(o-n)/t,this._x=(r+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this},setFromUnitVectors:function(t,e){const i=1e-6;let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(oi.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){const i=t._x,n=t._y,r=t._z,o=t._w,s=e._x,a=e._y,l=e._z,c=e._w;return this._x=i*c+o*s+n*l-r*a,this._y=n*c+o*a+r*s-i*l,this._z=r*c+o*l+i*a-n*s,this._w=o*c-i*s-n*a-r*l,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,o=this._w;let s=o*t._w+i*t._x+n*t._y+r*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=i,this._y=n,this._z=r,this;const a=1-s*s;if(a<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=o*h+this._w*u,this._x=i*h+this._x*u,this._y=n*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},fromBufferAttribute:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});const gi=new vi,yi=new mi;function vi(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}Object.assign(vi.prototype,{isVector3:!0,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(yi.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(yi.setFromAxisAngle(t,e))},applyMatrix3:function(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){const e=this.x,i=this.y,n=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*o,this},applyQuaternion:function(t){const e=this.x,i=this.y,n=this.z,r=t.x,o=t.y,s=t.z,a=t.w,l=a*e+o*n-s*i,c=a*i+s*e-r*n,h=a*n+r*i-o*e,u=-r*e-o*i-s*n;return this.x=l*a+u*-r+c*-s-h*-o,this.y=c*a+u*-o+h*-r-l*-s,this.z=h*a+u*-s+l*-o-c*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){const i=t.x,n=t.y,r=t.z,o=e.x,s=e.y,a=e.z;return this.x=n*a-r*s,this.y=r*o-i*a,this.z=i*s-n*o,this},projectOnVector:function(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)},projectOnPlane:function(t){return gi.copy(this).projectOnVector(t),this.sub(gi)},reflect:function(t){return this.sub(gi.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(oi.clamp(i,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});const xi=new vi,bi=new Ei,wi=new vi(0,0,0),Mi=new vi(1,1,1),_i=new vi,Si=new vi,Ti=new vi;function Ei(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Ei.prototype,{isMatrix4:!0,set:function(t,e,i,n,r,o,s,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Ei).fromArray(this.elements)},copy:function(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},copyPosition:function(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:function(t){const e=this.elements,i=t.elements,n=1/xi.setFromMatrixColumn(t,0).length(),r=1/xi.setFromMatrixColumn(t,1).length(),o=1/xi.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*o,e[9]=i[9]*o,e[10]=i[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,i=t.x,n=t.y,r=t.z,o=Math.cos(i),s=Math.sin(i),a=Math.cos(n),l=Math.sin(n),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=o*c,i=o*h,n=s*c,r=s*h;e[0]=a*c,e[4]=-a*h,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-s*a,e[2]=r-t*l,e[6]=n+i*l,e[10]=o*a}else if("YXZ"===t.order){const t=a*c,i=a*h,n=l*c,r=l*h;e[0]=t+r*s,e[4]=n*s-i,e[8]=o*l,e[1]=o*h,e[5]=o*c,e[9]=-s,e[2]=i*s-n,e[6]=r+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*c,i=a*h,n=l*c,r=l*h;e[0]=t-r*s,e[4]=-o*h,e[8]=n+i*s,e[1]=i+n*s,e[5]=o*c,e[9]=r-t*s,e[2]=-o*l,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*c,i=o*h,n=s*c,r=s*h;e[0]=a*c,e[4]=n*l-i,e[8]=t*l+r,e[1]=a*h,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,i=o*l,n=s*a,r=s*l;e[0]=a*c,e[4]=r-t*h,e[8]=n*h+i,e[1]=h,e[5]=o*c,e[9]=-s*c,e[2]=-l*c,e[6]=i*h+n,e[10]=t-r*h}else if("XZY"===t.order){const t=o*a,i=o*l,n=s*a,r=s*l;e[0]=a*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=o*c,e[9]=i*h-n,e[2]=n*h-i,e[6]=s*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(wi,t,Mi)},lookAt:function(t,e,i){const n=this.elements;return Ti.subVectors(t,e),0===Ti.lengthSq()&&(Ti.z=1),Ti.normalize(),_i.crossVectors(i,Ti),0===_i.lengthSq()&&(1===Math.abs(i.z)?Ti.x+=1e-4:Ti.z+=1e-4,Ti.normalize(),_i.crossVectors(i,Ti)),_i.normalize(),Si.crossVectors(Ti,_i),n[0]=_i.x,n[4]=Si.x,n[8]=Ti.x,n[1]=_i.y,n[5]=Si.y,n[9]=Ti.y,n[2]=_i.z,n[6]=Si.z,n[10]=Ti.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[4],a=i[8],l=i[12],c=i[1],h=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],y=i[3],v=i[7],x=i[11],b=i[15],w=n[0],M=n[4],_=n[8],S=n[12],T=n[1],E=n[5],A=n[9],L=n[13],C=n[2],P=n[6],O=n[10],R=n[14],k=n[3],D=n[7],I=n[11],N=n[15];return r[0]=o*w+s*T+a*C+l*k,r[4]=o*M+s*E+a*P+l*D,r[8]=o*_+s*A+a*O+l*I,r[12]=o*S+s*L+a*R+l*N,r[1]=c*w+h*T+u*C+d*k,r[5]=c*M+h*E+u*P+d*D,r[9]=c*_+h*A+u*O+d*I,r[13]=c*S+h*L+u*R+d*N,r[2]=p*w+f*T+m*C+g*k,r[6]=p*M+f*E+m*P+g*D,r[10]=p*_+f*A+m*O+g*I,r[14]=p*S+f*L+m*R+g*N,r[3]=y*w+v*T+x*C+b*k,r[7]=y*M+v*E+x*P+b*D,r[11]=y*_+v*A+x*O+b*I,r[15]=y*S+v*L+x*R+b*N,this},multiplyScalar:function(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],o=t[1],s=t[5],a=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14],p=t[3],f=t[7],m=t[11],g=t[15];return p*(+r*a*h-n*l*h-r*s*u+i*l*u+n*s*d-i*a*d)+f*(+e*a*d-e*l*u+r*o*u-n*o*d+n*l*c-r*a*c)+m*(+e*l*h-e*s*d-r*o*h+i*o*d+r*s*c-i*l*c)+g*(-n*s*c-e*a*h+e*s*u+n*o*h-i*o*u+i*a*c)},transpose:function(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");const i=this.elements,n=t.elements,r=n[0],o=n[1],s=n[2],a=n[3],l=n[4],c=n[5],h=n[6],u=n[7],d=n[8],p=n[9],f=n[10],m=n[11],g=n[12],y=n[13],v=n[14],x=n[15],b=p*v*u-y*f*u+y*h*m-c*v*m-p*h*x+c*f*x,w=g*f*u-d*v*u-g*h*m+l*v*m+d*h*x-l*f*x,M=d*y*u-g*p*u+g*c*m-l*y*m-d*c*x+l*p*x,_=g*p*h-d*y*h-g*c*f+l*y*f+d*c*v-l*p*v,S=r*b+o*w+s*M+a*_;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/S;return i[0]=b*T,i[1]=(y*f*a-p*v*a-y*s*m+o*v*m+p*s*x-o*f*x)*T,i[2]=(c*v*a-y*h*a+y*s*u-o*v*u-c*s*x+o*h*x)*T,i[3]=(p*h*a-c*f*a-p*s*u+o*f*u+c*s*m-o*h*m)*T,i[4]=w*T,i[5]=(d*v*a-g*f*a+g*s*m-r*v*m-d*s*x+r*f*x)*T,i[6]=(g*h*a-l*v*a-g*s*u+r*v*u+l*s*x-r*h*x)*T,i[7]=(l*f*a-d*h*a+d*s*u-r*f*u-l*s*m+r*h*m)*T,i[8]=M*T,i[9]=(g*p*a-d*y*a-g*o*m+r*y*m+d*o*x-r*p*x)*T,i[10]=(l*y*a-g*c*a+g*o*u-r*y*u-l*o*x+r*c*x)*T,i[11]=(d*c*a-l*p*a-d*o*u+r*p*u+l*o*m-r*c*m)*T,i[12]=_*T,i[13]=(d*y*s-g*p*s+g*o*f-r*y*f-d*o*v+r*p*v)*T,i[14]=(g*c*s-l*y*s-g*o*h+r*y*h+l*o*v-r*c*v)*T,i[15]=(l*p*s-d*c*s+d*o*h-r*p*h-l*o*f+r*c*f)*T,this},scale:function(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this},getMaxScaleOnAxis:function(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))},makeTranslation:function(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},makeRotationX:function(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this},makeRotationY:function(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this},makeRotationZ:function(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,o=t.x,s=t.y,a=t.z,l=r*o,c=r*s;return this.set(l*o+i,l*s-n*a,l*a+n*s,0,l*s+n*a,c*s+i,c*a-n*o,0,l*a-n*s,c*a+n*o,r*a*a+i,0,0,0,0,1),this},makeScale:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,i){const n=this.elements,r=e._x,o=e._y,s=e._z,a=e._w,l=r+r,c=o+o,h=s+s,u=r*l,d=r*c,p=r*h,f=o*c,m=o*h,g=s*h,y=a*l,v=a*c,x=a*h,b=i.x,w=i.y,M=i.z;return n[0]=(1-(f+g))*b,n[1]=(d+x)*b,n[2]=(p-v)*b,n[3]=0,n[4]=(d-x)*w,n[5]=(1-(u+g))*w,n[6]=(m+y)*w,n[7]=0,n[8]=(p+v)*M,n[9]=(m-y)*M,n[10]=(1-(u+f))*M,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},decompose:function(t,e,i){const n=this.elements;let r=xi.set(n[0],n[1],n[2]).length(),o=xi.set(n[4],n[5],n[6]).length(),s=xi.set(n[8],n[9],n[10]).length();const a=this.determinant();a<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],bi.copy(this);const l=1/r,c=1/o,h=1/s;return bi.elements[0]*=l,bi.elements[1]*=l,bi.elements[2]*=l,bi.elements[4]*=c,bi.elements[5]*=c,bi.elements[6]*=c,bi.elements[8]*=h,bi.elements[9]*=h,bi.elements[10]*=h,e.setFromRotationMatrix(bi),i.x=r,i.y=o,i.z=s,this},makePerspective:function(t,e,i,n,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const s=this.elements,a=2*r/(e-t),l=2*r/(i-n),c=(e+t)/(e-t),h=(i+n)/(i-n),u=-(o+r)/(o-r),d=-2*o*r/(o-r);return s[0]=a,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=h,s[13]=0,s[2]=0,s[6]=0,s[10]=u,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this},makeOrthographic:function(t,e,i,n,r,o){const s=this.elements,a=1/(e-t),l=1/(i-n),c=1/(o-r),h=(e+t)*a,u=(i+n)*l,d=(o+r)*c;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-h,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-u,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals:function(t){const e=this.elements,i=t.elements;for(let n=0;n<16;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}});const Ai=new Ei,Li=new mi;function Ci(t=0,e=0,i=0,n=Ci.DefaultOrder){this._x=t,this._y=e,this._z=i,this._order=n}function Pi(){this.mask=1}Ci.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Ci.DefaultOrder="XYZ",Object.defineProperties(Ci.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(Ci.prototype,{isEuler:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._order=n||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){const n=oi.clamp,r=t.elements,o=r[0],s=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];switch(e=e||this._order,e){case"XYZ":this._y=Math.asin(n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-n(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(n(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-n(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==i&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,i){return Ai.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Ai,e,i)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return Li.setFromEuler(this),this.setFromQuaternion(Li,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new vi(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(Pi.prototype,{set:function(t){this.mask=1<1){for(let t=0;t1){for(let t=0;t0){n.children=[];for(let e=0;e0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),s.length>0&&(i.images=s),a.length>0&&(i.shapes=a)}return i.object=n,i;function o(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let i=0;is)return!1}return!0}Object.assign(sn.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){let e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,l=t.length;ar&&(r=l),c>o&&(o=c),h>s&&(s=h)}return this.min.set(e,i,n),this.max.set(r,o,s),this},setFromBufferAttribute:function(t){let e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,l=t.count;ar&&(r=l),c>o&&(o=c),h>s&&(s=h)}return this.min.set(e,i,n),this.max.set(r,o,s),this},setFromPoints:function(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new vi),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,Yi),Yi.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(en),nn.subVectors(this.max,en),Zi.subVectors(t.a,en),Ji.subVectors(t.b,en),Ki.subVectors(t.c,en),Qi.subVectors(Ji,Zi),$i.subVectors(Ki,Ji),tn.subVectors(Zi,Ki);let e=[0,-Qi.z,Qi.y,0,-$i.z,$i.y,0,-tn.z,tn.y,Qi.z,0,-Qi.x,$i.z,0,-$i.x,tn.z,0,-tn.x,-Qi.y,Qi.x,0,-$i.y,$i.x,0,-tn.y,tn.x,0];return!!an(e,Zi,Ji,Ki,nn)&&(e=[1,0,0,0,1,0,0,0,1],!!an(e,Zi,Ji,Ki,nn)&&(rn.crossVectors(Qi,$i),e=[rn.x,rn.y,rn.z],an(e,Zi,Ji,Ki,nn)))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new vi),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){const e=Yi.copy(t).clamp(this.min,this.max);return e.sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(Yi).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(Xi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Xi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Xi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Xi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Xi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Xi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Xi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Xi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Xi)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});const ln=new sn;function cn(t,e){this.center=void 0!==t?t:new vi,this.radius=void 0!==e?e:-1}Object.assign(cn.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){const i=this.center;void 0!==e?i.copy(e):ln.setFromPoints(t).getCenter(i);let n=0;for(let r=0,o=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new sn),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});const hn=new vi,un=new vi,dn=new vi,pn=new vi,fn=new vi,mn=new vi,gn=new vi;function yn(t,e){this.origin=void 0!==t?t:new vi,this.direction=void 0!==e?e:new vi(0,0,-1)}Object.assign(yn.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new vi),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,hn)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new vi),e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){const e=hn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(hn.copy(this.direction).multiplyScalar(e).add(this.origin),hn.distanceToSquared(t))},distanceSqToSegment:function(t,e,i,n){un.copy(t).add(e).multiplyScalar(.5),dn.copy(e).sub(t).normalize(),pn.copy(this.origin).sub(un);const r=.5*t.distanceTo(e),o=-this.direction.dot(dn),s=pn.dot(this.direction),a=-pn.dot(dn),l=pn.lengthSq(),c=Math.abs(1-o*o);let h,u,d,p;if(c>0)if(h=o*a-s,u=o*s-a,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+o*u+2*s)+u*(o*h+u+2*a)+l}else u=r,h=Math.max(0,-(o*u+s)),d=-h*h+u*(u+2*a)+l;else u=-r,h=Math.max(0,-(o*u+s)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-o*r+s)),u=h>0?-r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(h=Math.max(0,-(o*r+s)),u=h>0?r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l);else u=o>0?-r:r,h=Math.max(0,-(o*u+s)),d=-h*h+u*(u+2*a)+l;return i&&i.copy(this.direction).multiplyScalar(h).add(this.origin),n&&n.copy(dn).multiplyScalar(u).add(un),d},intersectSphere:function(t,e){hn.subVectors(t.center,this.origin);const i=hn.dot(this.direction),n=hn.dot(hn)-i*i,r=t.radius*t.radius;if(n>r)return null;const o=Math.sqrt(r-n),s=i-o,a=i+o;return s<0&&a<0?null:s<0?this.at(a,e):this.at(s,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null},intersectPlane:function(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},intersectsPlane:function(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;const i=t.normal.dot(this.direction);return i*e<0},intersectBox:function(t,e){let i,n,r,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(i=(t.min.x-u.x)*l,n=(t.max.x-u.x)*l):(i=(t.max.x-u.x)*l,n=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,o=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,o=(t.min.y-u.y)*c),i>o||r>n?null:((r>i||i!==i)&&(i=r),(o=0?(s=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(s=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),i>a||s>n?null:((s>i||i!==i)&&(i=s),(a=0?i:n,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,hn)},intersectTriangle:function(t,e,i,n,r){fn.subVectors(e,t),mn.subVectors(i,t),gn.crossVectors(fn,mn);let o,s=this.direction.dot(gn);if(s>0){if(n)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}pn.subVectors(this.origin,t);const a=o*this.direction.dot(mn.crossVectors(pn,mn));if(a<0)return null;const l=o*this.direction.dot(fn.cross(pn));if(l<0)return null;if(a+l>s)return null;const c=-o*pn.dot(gn);return c<0?null:this.at(c/s,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});const vn=new vi,xn=new vi,bn=new ai;function wn(t,e){this.normal=void 0!==t?t:new vi(1,0,0),this.constant=void 0!==e?e:0}Object.assign(wn.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,i){const n=vn.subVectors(i,e).cross(xn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new vi),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new vi);const i=t.delta(vn),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?void 0:e.copy(i).multiplyScalar(r).add(t.start)},intersectsLine:function(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new vi),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){const i=e||bn.getNormalMatrix(t),n=this.coplanarPoint(vn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});const Mn=new vi,_n=new vi,Sn=new vi,Tn=new vi,En=new vi,An=new vi,Ln=new vi,Cn=new vi,Pn=new vi,On=new vi;function Rn(t,e,i){this.a=void 0!==t?t:new vi,this.b=void 0!==e?e:new vi,this.c=void 0!==i?i:new vi}Object.assign(Rn,{getNormal:function(t,e,i,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new vi),n.subVectors(i,e),Mn.subVectors(t,e),n.cross(Mn);const r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)},getBarycoord:function(t,e,i,n,r){Mn.subVectors(n,e),_n.subVectors(i,e),Sn.subVectors(t,e);const o=Mn.dot(Mn),s=Mn.dot(_n),a=Mn.dot(Sn),l=_n.dot(_n),c=_n.dot(Sn),h=o*l-s*s;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new vi),0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*a-s*c)*u,p=(o*c-s*a)*u;return r.set(1-d-p,p,d)},containsPoint:function(t,e,i,n){return Rn.getBarycoord(t,e,i,n,Tn),Tn.x>=0&&Tn.y>=0&&Tn.x+Tn.y<=1},getUV:function(t,e,i,n,r,o,s,a){return this.getBarycoord(t,e,i,n,Tn),a.set(0,0),a.addScaledVector(r,Tn.x),a.addScaledVector(o,Tn.y),a.addScaledVector(s,Tn.z),a},isFrontFacing:function(t,e,i,n){return Mn.subVectors(i,e),_n.subVectors(t,e),Mn.cross(_n).dot(n)<0}}),Object.assign(Rn.prototype,{set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Mn.subVectors(this.c,this.b),_n.subVectors(this.a,this.b),.5*Mn.cross(_n).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new vi),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Rn.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new wn),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Rn.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,i,n,r){return Rn.getUV(t,this.a,this.b,this.c,e,i,n,r)},containsPoint:function(t){return Rn.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return Rn.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new vi);const i=this.a,n=this.b,r=this.c;let o,s;En.subVectors(n,i),An.subVectors(r,i),Cn.subVectors(t,i);const a=En.dot(Cn),l=An.dot(Cn);if(a<=0&&l<=0)return e.copy(i);Pn.subVectors(t,n);const c=En.dot(Pn),h=An.dot(Pn);if(c>=0&&h<=c)return e.copy(n);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return o=a/(a-c),e.copy(i).addScaledVector(En,o);On.subVectors(t,r);const d=En.dot(On),p=An.dot(On);if(p>=0&&d<=p)return e.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),e.copy(i).addScaledVector(An,s);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return Ln.subVectors(r,n),s=(h-c)/(h-c+(d-p)),e.copy(n).addScaledVector(Ln,s);const g=1/(m+f+u);return o=f*g,s=u*g,e.copy(i).addScaledVector(En,o).addScaledVector(An,s)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});const kn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Dn={h:0,s:0,l:0},In={h:0,s:0,l:0};function Nn(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}function zn(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function Bn(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Gn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Fn(t,e,i,n,r,o){this.a=t,this.b=e,this.c=i,this.normal=n&&n.isVector3?n:new vi,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new Nn,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Object.assign(Nn.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"===typeof t?this.setHex(t):"string"===typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(t,e,i){if(t=oi.euclideanModulo(t,1),e=oi.clamp(e,0,1),i=oi.clamp(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=zn(r,n,t+1/3),this.g=zn(r,n,t),this.b=zn(r,n,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){let t;const n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(t=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[5]),this;if(t=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[5]),this;break;case"hsl":case"hsla":if(t=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){const i=parseFloat(t[1])/360,n=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[5]),this.setHSL(i,n,r)}break}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(t)){const t=i[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){const e=kn[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);const i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=Bn(t.r),this.g=Bn(t.g),this.b=Bn(t.b),this},copyLinearToSRGB:function(t){return this.r=Gn(t.r),this.g=Gn(t.g),this.b=Gn(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,i=this.g,n=this.b,r=Math.max(e,i,n),o=Math.min(e,i,n);let s,a;const l=(o+r)/2;if(o===r)s=0,a=0;else{const t=r-o;switch(a=l<=.5?t/(r+o):t/(2-r-o),r){case e:s=(i-n)/t+(i0&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.morphNormals&&(i.morphNormals=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Un.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),jn.prototype=Object.create(Un.prototype),jn.prototype.constructor=jn,jn.prototype.isMeshBasicMaterial=!0,jn.prototype.copy=function(t){return Un.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};const Wn=new vi,Vn=new si;function Xn(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=ei,this.updateRange={offset:0,count:-1},this.version=0}function Yn(t,e,i){Xn.call(this,new Int8Array(t),e,i)}function qn(t,e,i){Xn.call(this,new Uint8Array(t),e,i)}function Zn(t,e,i){Xn.call(this,new Uint8ClampedArray(t),e,i)}function Jn(t,e,i){Xn.call(this,new Int16Array(t),e,i)}function Kn(t,e,i){Xn.call(this,new Uint16Array(t),e,i)}function Qn(t,e,i){Xn.call(this,new Int32Array(t),e,i)}function $n(t,e,i){Xn.call(this,new Uint32Array(t),e,i)}function tr(t,e,i){Xn.call(this,new Float32Array(t),e,i)}function er(t,e,i){Xn.call(this,new Float64Array(t),e,i)}function ir(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function nr(t){if(0===t.length)return-1/0;let e=t[0];for(let i=1,n=t.length;ie&&(e=t[i]);return e}Object.defineProperty(Xn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Xn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n0,o=n[1]&&n[1].length>0,s=t.morphTargets,a=s.length;let l;if(a>0){l=[];for(let t=0;t0){u=[];for(let t=0;t0&&0===e.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g65535?$n:Kn)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,i){this.groups.push({start:t,count:e,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new ai).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return or.makeRotationX(t),this.applyMatrix4(or),this},rotateY:function(t){return or.makeRotationY(t),this.applyMatrix4(or),this},rotateZ:function(t){return or.makeRotationZ(t),this.applyMatrix4(or),this},translate:function(t,e,i){return or.makeTranslation(t,e,i),this.applyMatrix4(or),this},scale:function(t,e,i){return or.makeScale(t,e,i),this.applyMatrix4(or),this},lookAt:function(t){return sr.lookAt(t),sr.updateMatrix(),this.applyMatrix4(sr.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ar).negate(),this.translate(ar.x,ar.y,ar.z),this},setFromObject:function(t){const e=t.geometry;if(t.isPoints||t.isLine){const t=new tr(3*e.vertices.length,3),i=new tr(3*e.colors.length,3);if(this.setAttribute("position",t.copyVector3sArray(e.vertices)),this.setAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){const t=new tr(e.lineDistances.length,1);this.setAttribute("lineDistance",t.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){const e=[];for(let i=0,n=t.length;i0){const e=new Float32Array(3*t.normals.length);this.setAttribute("normal",new Xn(e,3).copyVector3sArray(t.normals))}if(t.colors.length>0){const e=new Float32Array(3*t.colors.length);this.setAttribute("color",new Xn(e,3).copyColorsArray(t.colors))}if(t.uvs.length>0){const e=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new Xn(e,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){const e=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new Xn(e,2).copyVector2sArray(t.uvs2))}this.groups=t.groups;for(const i in t.morphTargets){const e=[],n=t.morphTargets[i];for(let t=0,i=n.length;t0){const e=new tr(4*t.skinIndices.length,4);this.setAttribute("skinIndex",e.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){const e=new tr(4*t.skinWeights.length,4);this.setAttribute("skinWeight",e.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new sn);const t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,n=e.length;i0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const a in i){const e=i[a],n=e.toJSON(t.data);""!==e.name&&(n.name=e.name),t.data.attributes[a]=n}const n={};let r=!1;for(const a in this.morphAttributes){const e=this.morphAttributes[a],i=[];for(let n=0,r=e.length;n0&&(n[a]=i,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t},clone:function(){return(new ur).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const l in n){const t=n[l];this.setAttribute(l,t.clone(e))}const r=t.morphAttributes;for(const l in r){const t=[],i=r[l];for(let n=0,r=i.length;ni.far?null:{distance:c,point:Lr.clone(),object:t}}function Or(t,e,i,n,r,o,s,a,l,c,h,u){mr.fromBufferAttribute(r,c),gr.fromBufferAttribute(r,h),yr.fromBufferAttribute(r,u);const d=t.morphTargetInfluences;if(e.morphTargets&&o&&d){wr.set(0,0,0),Mr.set(0,0,0),_r.set(0,0,0);for(let t=0,e=o.length;t0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),fr.copy(i.boundingSphere),fr.applyMatrix4(r),!1===t.ray.intersectsSphere(fr))return;if(dr.getInverse(r),pr.copy(t.ray).applyMatrix4(dr),null!==i.boundingBox&&!1===pr.intersectsBox(i.boundingBox))return;let o;if(i.isBufferGeometry){const r=i.index,s=i.attributes.position,a=i.morphAttributes.position,l=i.morphTargetsRelative,c=i.attributes.uv,h=i.attributes.uv2,u=i.groups,d=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,p=u.length;i0&&(l=c);for(let i=0,h=a.length;i0)for(let u=0;u0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(let t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(let e=0,i=this.faces.length;e=0;a--){const t=o[a];this.faces.splice(t,1);for(let e=0,i=this.faceVertexUvs.length;e0,s=t.vertexNormals.length>0,a=1!==t.color.r||1!==t.color.g||1!==t.color.b,l=t.vertexColors.length>0;let f=0;if(f=c(f,0,0),f=c(f,1,e),f=c(f,2,n),f=c(f,3,r),f=c(f,4,o),f=c(f,5,s),f=c(f,6,a),f=c(f,7,l),i.push(f),i.push(t.a,t.b,t.c),i.push(t.materialIndex),r){const t=this.faceVertexUvs[0][p];i.push(d(t[0]),d(t[1]),d(t[2]))}if(o&&i.push(h(t.normal)),s){const e=t.vertexNormals;i.push(h(e[0]),h(e[1]),h(e[2]))}if(a&&i.push(u(t.color)),l){const e=t.vertexColors;i.push(u(e[0]),u(e[1]),u(e[2]))}}function c(t,e,i){return i?t|1<0&&(t.data.colors=o),a.length>0&&(t.data.uvs=[a]),t.data.faces=i,t},clone:function(){return(new Nr).copy(this)},copy:function(t){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;const e=t.vertices;for(let u=0,d=e.length;u0?1:-1,c.push(A.x,A.y,A.z),h.push(a/m),h.push(1-s/g),T+=1}}for(let s=0;s0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const n in this.extensions)!0===this.extensions[n]&&(i[n]=!0);return Object.keys(i).length>0&&(e.extensions=i),e},Vr.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Vr,isCamera:!0,copy:function(t,e){return Wi.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new vi),this.updateMatrixWorld(!0);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Wi.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){Wi.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Xr.prototype=Object.assign(Object.create(Vr.prototype),{constructor:Xr,isPerspectiveCamera:!0,copy:function(t,e){return Vr.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){const e=.5*this.getFilmHeight()/t;this.fov=2*oi.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*oi.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*oi.RAD2DEG*Math.atan(Math.tan(.5*oi.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,i,n,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){let t=this.near,e=t*Math.tan(.5*oi.DEG2RAD*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n,o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,s=o.fullHeight;r+=o.offsetX*n/t,e-=o.offsetY*i/s,n*=o.width/t,i*=o.height/s}const s=this.filmOffset;0!==s&&(r+=t*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){const e=Wi.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});const Yr=90,qr=1;function Zr(t,e,i){if(Wi.call(this),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const n=new Xr(Yr,qr,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new vi(1,0,0)),this.add(n);const r=new Xr(Yr,qr,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new vi(-1,0,0)),this.add(r);const o=new Xr(Yr,qr,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new vi(0,1,0)),this.add(o);const s=new Xr(Yr,qr,t,e);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new vi(0,-1,0)),this.add(s);const a=new Xr(Yr,qr,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new vi(0,0,1)),this.add(a);const l=new Xr(Yr,qr,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new vi(0,0,-1)),this.add(l),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();const c=t.xr.enabled,h=t.getRenderTarget();t.xr.enabled=!1;const u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,o),t.setRenderTarget(i,3),t.render(e,s),t.setRenderTarget(i,4),t.render(e,a),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(h),t.xr.enabled=c},this.clear=function(t,e,n,r){const o=t.getRenderTarget();for(let s=0;s<6;s++)t.setRenderTarget(i,s),t.clear(e,n,r);t.setRenderTarget(o)}}function Jr(t,e,i){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=i),pi.call(this,t,t,e)}function Kr(t,e,i,n,r,o,s,a,l,c,h,u){ui.call(this,null,o,s,a,l,c,n,r,h,u),this.image={data:t||null,width:e||1,height:i||1},this.magFilter=void 0!==l?l:ut,this.minFilter=void 0!==c?c:ut,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Zr.prototype=Object.create(Wi.prototype),Zr.prototype.constructor=Zr,Jr.prototype=Object.create(pi.prototype),Jr.prototype.constructor=Jr,Jr.prototype.isWebGLCubeRenderTarget=!0,Jr.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;const i=new Vi,n={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include ","\t#include ","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#include ","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV = equirectUv( direction );","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},r=new Wr({name:"CubemapFromEquirect",uniforms:Gr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:p,blending:g});r.uniforms.tEquirect.value=e;const o=new Cr(new Br(5,5,5),r);i.add(o);const s=new Zr(1,10,this);return s.update(t,i),o.geometry.dispose(),o.material.dispose(),this},Kr.prototype=Object.create(ui.prototype),Kr.prototype.constructor=Kr,Kr.prototype.isDataTexture=!0;const Qr=new cn,$r=new vi;function to(t,e,i,n,r,o){this.planes=[void 0!==t?t:new wn,void 0!==e?e:new wn,void 0!==i?i:new wn,void 0!==n?n:new wn,void 0!==r?r:new wn,void 0!==o?o:new wn]}Object.assign(to.prototype,{set:function(t,e,i,n,r,o){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(i),s[3].copy(n),s[4].copy(r),s[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromProjectionMatrix:function(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],y=i[14],v=i[15];return e[0].setComponents(s-n,h-a,f-u,v-m).normalize(),e[1].setComponents(s+n,h+a,f+u,v+m).normalize(),e[2].setComponents(s+r,h+l,f+d,v+g).normalize(),e[3].setComponents(s-r,h-l,f-d,v-g).normalize(),e[4].setComponents(s-o,h-c,f-p,v-y).normalize(),e[5].setComponents(s+o,h+c,f+p,v+y).normalize(),this},intersectsObject:function(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Qr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Qr)},intersectsSprite:function(t){return Qr.center.set(0,0,0),Qr.radius=.7071067811865476,Qr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Qr)},intersectsSphere:function(t){const e=this.planes,i=t.center,n=-t.radius;for(let r=0;r<6;r++){const t=e[r].distanceToPoint(i);if(t0?t.max.x:t.min.x,$r.y=n.normal.y>0?t.max.y:t.min.y,$r.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint($r)<0)return!1}return!0},containsPoint:function(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}});const eo={common:{diffuse:{value:new Nn(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ai},uv2Transform:{value:new ai},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new si(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Nn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Nn(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ai}},sprite:{diffuse:{value:new Nn(15658734)},opacity:{value:1},center:{value:new si(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ai}}};function io(){let t=null,e=!1,i=null,n=null;function r(e,o){i(e,o),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function no(t,e){const i=e.isWebGL2,n=new WeakMap;function r(e,i){const n=e.array,r=e.usage,o=t.createBuffer();t.bindBuffer(i,o),t.bufferData(i,n,r),e.onUploadCallback();let s=5126;return n instanceof Float32Array?s=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?s=5123:n instanceof Int16Array?s=5122:n instanceof Uint32Array?s=5125:n instanceof Int32Array?s=5124:n instanceof Int8Array?s=5120:n instanceof Uint8Array&&(s=5121),{buffer:o,type:s,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}function o(e,n,r){const o=n.array,s=n.updateRange;t.bindBuffer(r,e),-1===s.count?t.bufferSubData(r,0,o):(i?t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o,s.offset,s.count):t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o.subarray(s.offset,s.offset+s.count)),s.count=-1)}function s(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)}function a(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))}function l(t,e){t.isInterleavedBufferAttribute&&(t=t.data);const i=n.get(t);void 0===i?n.set(t,r(t,e)):i.version=0){const o=l[e];if(void 0!==o){const e=o.normalized,r=o.itemSize,s=i.get(o);if(void 0===s)continue;const l=s.buffer,c=s.type,h=s.bytesPerElement;if(o.isInterleavedBufferAttribute){const i=o.data,s=i.stride,u=o.offset;i&&i.isInstancedInterleavedBuffer?(b(n,i.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)):x(n),t.bindBuffer(34962,l),M(n,r,c,e,s*h,u*h)}else o.isInstancedBufferAttribute?(b(n,o.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)):x(n),t.bindBuffer(34962,l),M(n,r,c,e,0,0)}else if("instanceMatrix"===e){const e=i.get(r.instanceMatrix);if(void 0===e)continue;const o=e.buffer,s=e.type;b(n+0,1),b(n+1,1),b(n+2,1),b(n+3,1),t.bindBuffer(34962,o),t.vertexAttribPointer(n+0,4,s,!1,64,0),t.vertexAttribPointer(n+1,4,s,!1,64,16),t.vertexAttribPointer(n+2,4,s,!1,64,32),t.vertexAttribPointer(n+3,4,s,!1,64,48)}else if(void 0!==h){const i=h[e];if(void 0!==i)switch(i.length){case 2:t.vertexAttrib2fv(n,i);break;case 3:t.vertexAttrib3fv(n,i);break;case 4:t.vertexAttrib4fv(n,i);break;default:t.vertexAttrib1fv(n,i)}}}}w()}function S(){A();for(const t in a){const e=a[t];for(const t in e){const i=e[t];for(const t in i)p(i[t].object),delete i[t];delete e[t]}delete a[t]}}function T(t){if(void 0===a[t.id])return;const e=a[t.id];for(const i in e){const t=e[i];for(const e in t)p(t[e].object),delete t[e];delete e[i]}delete a[t.id]}function E(t){for(const e in a){const i=a[e];if(void 0===i[t.id])continue;const n=i[t.id];for(const t in n)p(n[t].object),delete n[t];delete i[t.id]}}function A(){L(),c!==l&&(c=l,d(c.object))}function L(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:h,reset:A,resetDefaultState:L,dispose:S,releaseStatesOfGeometry:T,releaseStatesOfProgram:E,initAttributes:v,enableAttribute:x,disableUnusedAttributes:w}}function Pa(t,e,i,n){const r=n.isWebGL2;let o;function s(t){o=t}function a(e,n){t.drawArrays(o,e,n),i.update(n,o)}function l(n,s,a,l){if(0===l)return;let c,h;if(r)c=t,h="drawArraysInstanced";else if(c=e.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",null===c)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[h](o,s,a,l),i.update(a,o,l)}this.setMode=s,this.render=a,this.renderInstances=l}function Oa(t,e,i){let n;function r(){if(void 0!==n)return n;const i=e.get("EXT_texture_filter_anisotropic");return n=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,n}function o(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let a=void 0!==i.precision?i.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=!0===i.logarithmicDepthBuffer,h=t.getParameter(34930),u=t.getParameter(35660),d=t.getParameter(3379),p=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),y=t.getParameter(36349),v=u>0,x=s||!!e.get("OES_texture_float"),b=v&&x,w=s?t.getParameter(36183):0;return{isWebGL2:s,getMaxAnisotropy:r,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:v,floatFragmentTextures:x,floatVertexTextures:b,maxSamples:w}}function Ra(){const t=this;let e=null,i=0,n=!1,r=!1;const o=new wn,s=new ai,a={value:null,needsUpdate:!1};function l(){a.value!==e&&(a.value=e,a.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function c(e,i,n,r){let l=null!==e?e.length:0,c=null;if(0!==l){if(c=a.value,!0!==r||null===c){const t=n+4*l,r=i.matrixWorldInverse;s.getNormalMatrix(r),(null===c||c.length65535?$n:Kn)(i,1);a.version=s;const l=o.get(t);l&&e.remove(l),o.set(t,a)}function h(t){const e=o.get(t);if(e){const i=t.index;null!==i&&e.version0)return t;let r=e*i,o=qa[r];if(void 0===o&&(o=new Float32Array(r),qa[r]=o),0!==e){n.toArray(o,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(o,r)}return o}function tl(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i/gm;function ic(t){return t.replace(ec,nc)}function nc(t,e){const i=Ea[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return ic(i)}const rc=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,oc=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function sc(t){return t.replace(oc,lc).replace(rc,ac)}function ac(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),lc(t,e,i,n)}function lc(t,e,i,n){let r="";for(let o=parseInt(e);o0?t.gammaFactor:1,p=i.isWebGL2?"":Zl(i),f=Jl(o),m=r.createProgram();let g,y;if(i.isRawShaderMaterial?(g=[f].filter(Ql).join("\n"),g.length>0&&(g+="\n"),y=[p,f].filter(Ql).join("\n"),y.length>0&&(y+="\n")):(g=[cc(i),"#define SHADER_NAME "+i.shaderName,f,i.instancing?"#define USE_INSTANCING":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Ql).join("\n"),y=[p,cc(i),"#define SHADER_NAME "+i.shaderName,f,i.alphaTest?"#define ALPHATEST "+i.alphaTest+(i.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+h:"",i.envMap?"#define "+u:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.sheen?"#define USE_SHEEN":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==Z?"#define TONE_MAPPING":"",i.toneMapping!==Z?Ea["tonemapping_pars_fragment"]:"",i.toneMapping!==Z?ql("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",Ea["encodings_pars_fragment"],i.map?Xl("mapTexelToLinear",i.mapEncoding):"",i.matcap?Xl("matcapTexelToLinear",i.matcapEncoding):"",i.envMap?Xl("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMap?Xl("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.lightMap?Xl("lightMapTexelToLinear",i.lightMapEncoding):"",Yl("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Ql).join("\n")),s=ic(s),s=$l(s,i),s=tc(s,i),a=ic(a),a=$l(a,i),a=tc(a,i),s=sc(s),a=sc(a),i.isWebGL2&&!i.isRawShaderMaterial){let t=!1;const e=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==s.match(e)&&null!==a.match(e)&&(t=!0,s=s.replace(e,""),a=a.replace(e,"")),g=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,y=["#version 300 es\n","#define varying in",t?"":"out highp vec4 pc_fragColor;",t?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+y}const v=g+s,x=y+a,b=Hl(r,35633,v),w=Hl(r,35632,x);if(r.attachShader(m,b),r.attachShader(m,w),void 0!==i.index0AttributeName?r.bindAttribLocation(m,0,i.index0AttributeName):!0===i.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(m).trim(),e=r.getShaderInfoLog(b).trim(),i=r.getShaderInfoLog(w).trim();let n=!0,o=!0;if(!1===r.getProgramParameter(m,35714)){n=!1;const e=Vl(r,b,"vertex"),i=Vl(r,w,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(m,35715),"gl.getProgramInfoLog",t,e,i)}else""!==t?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",t):""!==e&&""!==i||(o=!1);o&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:i,prefix:y}})}let M,_;return r.deleteShader(b),r.deleteShader(w),this.getUniforms=function(){return void 0===M&&(M=new Fl(r,m)),M},this.getAttributes=function(){return void 0===_&&(_=Kl(r,m)),_},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.name=i.shaderName,this.id=Ul++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=w,this}function mc(t,e,i,n){const r=[],o=i.isWebGL2,s=i.logarithmicDepthBuffer,a=i.floatVertexTextures,l=i.maxVertexUniforms,c=i.vertexTextures;let h=i.precision;const u={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},d=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function m(t,e){let i;if(e){const n=Aa[e];i={name:t.name||t.type,uniforms:Hr.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else i={name:t.name||t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return i}function g(t){const e=t.skeleton,i=e.bones;if(a)return 1024;{const t=l,e=Math.floor((t-20)/4),n=Math.min(e,i.length);return n0,maxBones:T,useVertexTexture:a,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numDirLightShadows:r.directionalShadowMap.length,numPointLightShadows:r.pointShadowMap.length,numSpotLightShadows:r.spotShadowMap.length,numClippingPlanes:v,numClipIntersection:x,dithering:n.dithering,shadowMapEnabled:t.shadowMap.enabled&&l.length>0,shadowMapType:t.shadowMap.type,toneMapping:n.toneMapped?t.toneMapping:Z,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:n.side===f,flipSided:n.side===p,depthPacking:void 0!==n.depthPacking&&n.depthPacking,index0AttributeName:n.index0AttributeName,extensionDerivatives:n.extensions&&n.extensions.derivatives,extensionFragDepth:n.extensions&&n.extensions.fragDepth,extensionDrawBuffers:n.extensions&&n.extensions.drawBuffers,extensionShaderTextureLOD:n.extensions&&n.extensions.shaderTextureLOD,rendererExtensionFragDepth:o||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:o||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:o||null!==e.get("EXT_shader_texture_lod"),customProgramCacheKey:n.customProgramCacheKey()};return L}function x(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);if(void 0===e.isRawShaderMaterial){for(let t=0;t1&&i.sort(t||yc),n.length>1&&n.sort(e||vc)}function h(){for(let i=e,n=t.length;i0);let r=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?r=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));const o=!0===e.isInstancedMesh;l=c(t,r,o)}else l=d;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){const t=l.uuid,e=n.uuid;let i=h[t];void 0===i&&(i={},h[t]=i);let r=i[e];void 0===r&&(r=l.clone(),i[e]=r),l=r}return l.visible=n.visible,l.wireframe=n.wireframe,l.side=a===u?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:m[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=o,l.farDistance=s),l}function E(i,r,o,s,a){if(!1===i.visible)return;const l=i.layers.test(r.layers);if(l&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&a===u)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let l=0,c=e.length;li||r.y>i)&&(r.x>i&&(o.x=Math.floor(i/d.x),r.x=o.x*d.x,h.mapSize.x=o.x),r.y>i&&(o.y=Math.floor(i/d.y),r.y=o.y*d.y,h.mapSize.y=o.y)),null===h.map&&!h.isPointLightShadow&&this.type===u){const t={minFilter:ft,magFilter:ft,format:Ot};h.map=new pi(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.mapPass=new pi(r.x,r.y,t),h.camera.updateProjectionMatrix()}if(null===h.map){const t={minFilter:ut,magFilter:ut,format:Ot};h.map=new pi(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map),t.clear();const m=h.getViewportCount();for(let t=0;t=1):-1!==ht.indexOf("OpenGL ES")&&(ct=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(ht)[1]),lt=ct>=2);let ut=null,dt={};const pt=new di,ft=new di;function mt(e,i,n){const r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let s=0;sn||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?oi.floorPowerOfTwo:Math.floor,o=n(r*t.width),s=n(r*t.height);void 0===p&&(p=m(o,s));const a=i?m(o,s):p;a.width=o,a.height=s;const l=a.getContext("2d");return l.drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+s+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return oi.isPowerOfTwo(t.width)&&oi.isPowerOfTwo(t.height)}function v(t){return!a&&(t.wrapS!==ct||t.wrapT!==ct||t.minFilter!==ut&&t.minFilter!==ft)}function x(t,e){return t.generateMipmaps&&e&&t.minFilter!==ut&&t.minFilter!==ft}function b(e,i,r,o){t.generateMipmap(e);const s=n.get(i);s.__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function w(i,n,r){if(!1===a)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let o=n;return 6403===n&&(5126===r&&(o=33326),5131===r&&(o=33325),5121===r&&(o=33321)),6407===n&&(5126===r&&(o=34837),5131===r&&(o=34843),5121===r&&(o=32849)),6408===n&&(5126===r&&(o=34836),5131===r&&(o=34842),5121===r&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function M(t){return t===ut||t===dt||t===pt?9728:9729}function _(t){const e=t.target;e.removeEventListener("dispose",_),T(e),e.isVideoTexture&&d.delete(e),s.memory.textures--}function S(t){const e=t.target;e.removeEventListener("dispose",S),E(e),s.memory.textures--}function T(e){const i=n.get(e);void 0!==i.__webglInit&&(t.deleteTexture(i.__webglTexture),n.remove(e))}function E(e){const i=n.get(e),r=n.get(e.texture);if(e){if(void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(i.__webglFramebuffer[e]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[e]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&t.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&t.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&t.deleteRenderbuffer(i.__webglDepthRenderbuffer);n.remove(e.texture),n.remove(e)}}let A=0;function L(){A=0}function C(){const t=A;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),A+=1,t}function P(t,e){const r=n.get(t);if(t.isVideoTexture&&q(t),t.version>0&&r.__version!==t.version){const i=t.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void G(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function O(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?G(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))}function R(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?G(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))}function k(e,r){if(6!==e.image.length)return;const s=n.get(e);if(e.version>0&&s.__version!==e.version){B(s,e),i.activeTexture(33984+r),i.bindTexture(34067,s.__webglTexture),t.pixelStorei(37440,e.flipY);const n=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),l=e.image[0]&&e.image[0].isDataTexture,h=[];for(let t=0;t<6;t++)h[t]=n||l?l?e.image[t].image:e.image[t]:g(e.image[t],!1,!0,c);const u=h[0],d=y(u)||a,p=o.convert(e.format),f=o.convert(e.type),m=w(e.internalFormat,p,f);let v;if(z(34067,e,d),n){for(let t=0;t<6;t++){v=h[t].mipmaps;for(let n=0;n1||n.get(o).__currentAnisotropy)&&(t.texParameterf(i,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function B(e,i){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",_),e.__webglTexture=t.createTexture(),s.memory.textures++)}function G(e,n,r){let s=3553;n.isDataTexture2DArray&&(s=35866),n.isDataTexture3D&&(s=32879),B(e,n),i.activeTexture(33984+r),i.bindTexture(s,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);const l=v(n)&&!1===y(n.image),c=g(n.image,l,!1,h),u=y(c)||a,d=o.convert(n.format);let p,f=o.convert(n.type),m=w(n.internalFormat,d,f);z(s,n,u);const M=n.mipmaps;if(n.isDepthTexture)m=6402,a?m=n.type===_t?36012:n.type===Mt?33190:n.type===Lt?35056:33189:n.type===_t&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===It&&6402===m&&n.type!==bt&&n.type!==Mt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=bt,f=o.convert(n.type)),n.format===Nt&&6402===m&&(m=34041,n.type!==Lt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Lt,f=o.convert(n.type))),i.texImage2D(3553,0,m,c.width,c.height,0,d,f,null);else if(n.isDataTexture)if(M.length>0&&u){for(let t=0,e=M.length;t0&&u){for(let t=0,e=M.length;t=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(let e=0;e=0&&t.numSupportedMorphNormals++}const f=n.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=I.numPlanes,n.numIntersection=I.numIntersection,f.clippingPlanes=I.uniform),n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.needsLights=Rt(t),n.lightsStateVersion=s,n.needsLights&&(f.ambientLightColor.value=r.state.ambient,f.lightProbe.value=r.state.probe,f.directionalLights.value=r.state.directional,f.directionalLightShadows.value=r.state.directionalShadow,f.spotLights.value=r.state.spot,f.spotLightShadows.value=r.state.spotShadow,f.rectAreaLights.value=r.state.rectArea,f.pointLights.value=r.state.point,f.pointLightShadows.value=r.state.pointShadow,f.hemisphereLights.value=r.state.hemi,f.directionalShadowMap.value=r.state.directionalShadowMap,f.directionalShadowMatrix.value=r.state.directionalShadowMatrix,f.spotShadowMap.value=r.state.spotShadowMap,f.spotShadowMatrix.value=r.state.spotShadowMatrix,f.pointShadowMap.value=r.state.pointShadowMap,f.pointShadowMatrix.value=r.state.pointShadowMatrix);const m=n.program.getUniforms(),g=Fl.seqWithValue(m.seq,f);n.uniformsList=g}function Ct(t,e,i,n){!0!==e.isScene&&(e=F),Y.resetTextureUnits();const r=e.fog,o=i.isMeshStandardMaterial?e.environment:null,s=null===v?p.outputEncoding:v.texture.encoding,a=X.get(i),l=d.state.lights;if(!0===N&&(!0===z||t!==w)){const e=t===w&&i.id===b;I.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,t,a,e)}i.version===a.__version?void 0===a.program||i.fog&&a.fog!==r||a.environment!==o||a.needsLights&&a.lightsStateVersion!==l.state.version?Lt(i,e,n):void 0===a.numClippingPlanes||a.numClippingPlanes===I.numPlanes&&a.numIntersection===I.numIntersection?a.outputEncoding!==s&&Lt(i,e,n):Lt(i,e,n):(Lt(i,e,n),a.__version=i.version);let c=!1,h=!1,u=!1;const f=a.program,m=f.getUniforms(),g=a.uniforms;if(W.useProgram(f.program)&&(c=!0,h=!0,u=!0),i.id!==b&&(b=i.id,h=!0),c||w!==t){if(m.setValue(lt,"projectionMatrix",t.projectionMatrix),j.logarithmicDepthBuffer&&m.setValue(lt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),w!==t&&(w=t,h=!0,u=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=m.map.cameraPosition;void 0!==e&&e.setValue(lt,G.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&m.setValue(lt,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||i.skinning)&&m.setValue(lt,"viewMatrix",t.matrixWorldInverse)}if(i.skinning){m.setOptional(lt,n,"bindMatrix"),m.setOptional(lt,n,"bindMatrixInverse");const t=n.skeleton;if(t){const e=t.bones;if(j.floatVertexTextures){if(void 0===t.boneTexture){let i=Math.sqrt(4*e.length);i=oi.ceilPowerOfTwo(i),i=Math.max(i,4);const n=new Float32Array(i*i*4);n.set(t.boneMatrices);const r=new Kr(n,i,i,Ot,_t);t.boneMatrices=n,t.boneTexture=r,t.boneTextureSize=i}m.setValue(lt,"boneTexture",t.boneTexture,Y),m.setValue(lt,"boneTextureSize",t.boneTextureSize)}else m.setOptional(lt,t,"boneMatrices")}}return(h||a.receiveShadow!==n.receiveShadow)&&(a.receiveShadow=n.receiveShadow,m.setValue(lt,"receiveShadow",n.receiveShadow)),h&&(m.setValue(lt,"toneMappingExposure",p.toneMappingExposure),a.needsLights&&Pt(g,u),r&&i.fog&&$.refreshFogUniforms(g,r),$.refreshMaterialUniforms(g,i,o,L,A),void 0!==g.ltc_1&&(g.ltc_1.value=eo.LTC_1),void 0!==g.ltc_2&&(g.ltc_2.value=eo.LTC_2),Fl.upload(lt,a.uniformsList,g,Y)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Fl.upload(lt,a.uniformsList,g,Y),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&m.setValue(lt,"center",n.center),m.setValue(lt,"modelViewMatrix",n.modelViewMatrix),m.setValue(lt,"normalMatrix",n.normalMatrix),m.setValue(lt,"modelMatrix",n.matrixWorld),f}function Pt(t,e){t.ambientLightColor.needsUpdate=e,t.lightProbe.needsUpdate=e,t.directionalLights.needsUpdate=e,t.directionalLightShadows.needsUpdate=e,t.pointLights.needsUpdate=e,t.pointLightShadows.needsUpdate=e,t.spotLights.needsUpdate=e,t.spotLightShadows.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function Rt(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}Mt.setAnimationLoop(wt),"undefined"!==typeof window&&Mt.setContext(window),this.setAnimationLoop=function(t){bt=t,ut.setAnimationLoop(t),null===t?Mt.stop():Mt.start()},this.render=function(t,e){let i,n;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),n=arguments[3]),void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===f)return;at.resetDefaultState(),b=-1,w=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===ut.enabled&&!0===ut.isPresenting&&(e=ut.getCamera(e)),!0===t.isScene&&t.onBeforeRender(p,t,e,i||v),d=et.get(t,e),d.init(),B.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),D.setFromProjectionMatrix(B),z=this.localClippingEnabled,N=I.init(this.clippingPlanes,z,e),u=tt.get(t,e),u.init(),Tt(t,e,0,p.sortObjects),u.finish(),!0===p.sortObjects&&u.sort(C,P),!0===N&&I.beginShadows();const r=d.state.shadowsArray;dt.render(r,t,e),d.setupLights(e),!0===N&&I.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),it.render(u,t,e,n);const o=u.opaque,s=u.transparent;o.length>0&&Et(o,t,e),s.length>0&&Et(s,t,e),!0===t.isScene&&t.onAfterRender(p,t,e),null!==v&&(Y.updateRenderTargetMipmap(v),Y.updateMultisampleRenderTarget(v)),W.buffers.depth.setTest(!0),W.buffers.depth.setMask(!0),W.buffers.color.setMask(!0),W.setPolygonOffset(!1),u=null,d=null},this.setFramebuffer=function(t){m!==t&&null===v&<.bindFramebuffer(36160,t),m=t},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return v},this.setRenderTarget=function(t,e,i){v=t,g=e,y=i,t&&void 0===X.get(t).__webglFramebuffer&&Y.setupRenderTarget(t);let n=m,r=!1;if(t){const i=X.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=i[e||0],r=!0):n=t.isWebGLMultisampleRenderTarget?X.get(t).__webglMultisampledFramebuffer:i,_.copy(t.viewport),S.copy(t.scissor),T=t.scissorTest}else _.copy(O).multiplyScalar(L).floor(),S.copy(R).multiplyScalar(L).floor(),T=k;if(x!==n&&(lt.bindFramebuffer(36160,n),x=n),W.viewport(_),W.scissor(S),W.setScissorTest(T),r){const n=X.get(t.texture);lt.framebufferTexture2D(36160,36064,34069+(e||0),n.__webglTexture,i||0)}},this.readRenderTargetPixels=function(t,e,i,n,r,o,s){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=X.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){let s=!1;a!==x&&(lt.bindFramebuffer(36160,a),s=!0);try{const a=t.texture,l=a.format,c=a.type;if(l!==Ot&&st.convert(l)!==lt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(c!==yt&&st.convert(c)!==lt.getParameter(35738)&&(c!==_t||!(j.isWebGL2||U.get("OES_texture_float")||U.get("WEBGL_color_buffer_float")))&&(c!==St||!(j.isWebGL2?U.get("EXT_color_buffer_float"):U.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===lt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&<.readPixels(e,i,n,r,st.convert(l),st.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&<.bindFramebuffer(36160,x)}}},this.copyFramebufferToTexture=function(t,e,i){void 0===i&&(i=0);const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),o=Math.floor(e.image.height*n),s=st.convert(e.format);Y.setTexture2D(e,0),lt.copyTexImage2D(3553,i,s,t.x,t.y,r,o,0),W.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n){void 0===n&&(n=0);const r=e.image.width,o=e.image.height,s=st.convert(i.format),a=st.convert(i.type);Y.setTexture2D(i,0),lt.pixelStorei(37440,i.flipY),lt.pixelStorei(37441,i.premultiplyAlpha),lt.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?lt.texSubImage2D(3553,n,t.x,t.y,r,o,s,a,e.image.data):e.isCompressedTexture?lt.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,s,e.mipmaps[0].data):lt.texSubImage2D(3553,n,t.x,t.y,s,a,e.image),0===n&&i.generateMipmaps&<.generateMipmap(3553),W.unbindTexture()},this.initTexture=function(t){Y.setTexture2D(t,0),W.unbindTexture()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Uc(t){Hc.call(this,t)}function jc(t,e){this.name="",this.color=new Nn(t),this.density=void 0!==e?e:25e-5}function Wc(t,e,i){this.name="",this.color=new Nn(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}function Vc(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ei,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=oi.generateUUID()}Nc.prototype=Object.assign(Object.create(Xr.prototype),{constructor:Nc,isArrayCamera:!0}),zc.prototype=Object.assign(Object.create(Wi.prototype),{constructor:zc,isGroup:!0}),Object.assign(Bc.prototype,{constructor:Bc,getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new zc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new zc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),this},update:function(t,e,i){let n=null,r=null;const o=this._targetRay,s=this._grip;return t&&(null!==o&&(n=e.getPose(t.targetRaySpace,i),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==s&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale)))),null!==o&&(o.visible=null!==n),null!==s&&(s.visible=null!==r),this}}),Object.assign(Gc.prototype,ni.prototype),Uc.prototype=Object.assign(Object.create(Hc.prototype),{constructor:Uc,isWebGL1Renderer:!0}),Object.assign(jc.prototype,{isFogExp2:!0,clone:function(){return new jc(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Wc.prototype,{isFog:!0,clone:function(){return new Wc(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Vc.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Vc.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;nt.far||e.push({distance:a,point:Jc.clone(),uv:Rn.getUV(Jc,ih,nh,rh,oh,sh,ah,new si),face:null,object:this})},copy:function(t){return Wi.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});const hh=new vi,uh=new vi;function dh(){Wi.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function ph(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Cr.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ei,this.bindMatrixInverse=new Ei}dh.prototype=Object.assign(Object.create(Wi.prototype),{constructor:dh,isLOD:!0,copy:function(t){Wi.prototype.copy.call(this,t,!1);const e=t.levels;for(let i=0,n=e.length;i0){let i,n;for(i=1,n=e.length;i0){hh.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(hh);this.getObjectForDistance(i).raycast(t,e)}},update:function(t){const e=this.levels;if(e.length>1){hh.setFromMatrixPosition(t.matrixWorld),uh.setFromMatrixPosition(this.matrixWorld);const i=hh.distanceTo(uh)/t.zoom;let n,r;for(e[0].object.visible=!0,n=1,r=e.length;n=e[n].distance))break;e[n-1].object.visible=!1,e[n].object.visible=!0}for(this._currentLevel=n-1;ns)continue;h.applyMatrix4(this.matrixWorld);const p=t.ray.origin.distanceTo(h);pt.far||e.push({distance:p,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else for(let i=0,d=o.length/3-1;is)continue;h.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(h);rt.far||e.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else if(i.isGeometry){const n=i.vertices,r=n.length;for(let i=0;is)continue;h.applyMatrix4(this.matrixWorld);const o=t.ray.origin.distanceTo(h);ot.far||e.push({distance:o,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Ph=new vi,Oh=new vi;function Rh(t,e){Ch.call(this,t,e),this.type="LineSegments"}function kh(t,e){Ch.call(this,t,e),this.type="LineLoop"}function Dh(t){Un.call(this),this.type="PointsMaterial",this.color=new Nn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Rh.prototype=Object.assign(Object.create(Ch.prototype),{constructor:Rh,isLineSegments:!0,computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;tr.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:s})}}function Hh(t,e,i,n,r,o,s,a,l){ui.call(this,t,e,i,n,r,o,s,a,l),this.format=void 0!==s?s:Pt,this.minFilter=void 0!==o?o:ft,this.magFilter=void 0!==r?r:ft,this.generateMipmaps=!1}function Uh(t,e,i,n,r,o,s,a,l,c,h,u){ui.call(this,null,o,s,a,l,c,n,r,h,u),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function jh(t,e,i,n,r,o,s,a,l){ui.call(this,t,e,i,n,r,o,s,a,l),this.needsUpdate=!0}function Wh(t,e,i,n,r,o,s,a,l,c){if(c=void 0!==c?c:It,c!==It&&c!==Nt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&c===It&&(i=bt),void 0===i&&c===Nt&&(i=Lt),ui.call(this,null,n,r,o,s,a,c,i,l),this.image={width:t,height:e},this.magFilter=void 0!==s?s:ut,this.minFilter=void 0!==a?a:ut,this.flipY=!1,this.generateMipmaps=!1}function Vh(t){ur.call(this),this.type="WireframeGeometry";const e=[],i=[0,0],n={},r=["a","b","c"];if(t&&t.isGeometry){const o=t.faces;for(let t=0,e=o.length;t=0?(t(p-a,n,h),u.subVectors(c,h)):(t(p+a,n,h),u.subVectors(h,c)),n-a>=0?(t(p,n-a,h),d.subVectors(c,h)):(t(p,n+a,h),d.subVectors(h,c)),l.crossVectors(u,d).normalize(),o.push(l.x,l.y,l.z),s.push(p,n)}}for(let f=0;f.9&&s<.1&&(e<.2&&(o[t+0]+=1),i<.2&&(o[t+2]+=1),n<.2&&(o[t+4]+=1))}}function u(t){r.push(t.x,t.y,t.z)}function d(e,i){const n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function p(){const t=new vi,e=new vi,i=new vi,n=new vi,s=new si,a=new si,l=new si;for(let c=0,h=0;c0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),Hh.prototype=Object.assign(Object.create(ui.prototype),{constructor:Hh,isVideoTexture:!0,update:function(){const t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Uh.prototype=Object.create(ui.prototype),Uh.prototype.constructor=Uh,Uh.prototype.isCompressedTexture=!0,jh.prototype=Object.create(ui.prototype),jh.prototype.constructor=jh,jh.prototype.isCanvasTexture=!0,Wh.prototype=Object.create(ui.prototype),Wh.prototype.constructor=Wh,Wh.prototype.isDepthTexture=!0,Vh.prototype=Object.create(ur.prototype),Vh.prototype.constructor=Vh,Xh.prototype=Object.create(Nr.prototype),Xh.prototype.constructor=Xh,Yh.prototype=Object.create(ur.prototype),Yh.prototype.constructor=Yh,qh.prototype=Object.create(Nr.prototype),qh.prototype.constructor=qh,Zh.prototype=Object.create(ur.prototype),Zh.prototype.constructor=Zh,Jh.prototype=Object.create(Nr.prototype),Jh.prototype.constructor=Jh,Kh.prototype=Object.create(Zh.prototype),Kh.prototype.constructor=Kh,Qh.prototype=Object.create(Nr.prototype),Qh.prototype.constructor=Qh,$h.prototype=Object.create(Zh.prototype),$h.prototype.constructor=$h,tu.prototype=Object.create(Nr.prototype),tu.prototype.constructor=tu,eu.prototype=Object.create(Zh.prototype),eu.prototype.constructor=eu,iu.prototype=Object.create(Nr.prototype),iu.prototype.constructor=iu,nu.prototype=Object.create(Zh.prototype),nu.prototype.constructor=nu,ru.prototype=Object.create(Nr.prototype),ru.prototype.constructor=ru,ou.prototype=Object.create(ur.prototype),ou.prototype.constructor=ou,ou.prototype.toJSON=function(){const t=ur.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},su.prototype=Object.create(Nr.prototype),su.prototype.constructor=su,au.prototype=Object.create(ur.prototype),au.prototype.constructor=au,lu.prototype=Object.create(Nr.prototype),lu.prototype.constructor=lu,cu.prototype=Object.create(ur.prototype),cu.prototype.constructor=cu;const hu={triangulate:function(t,e,i){i=i||2;let n,r,o,s,a,l,c,h=e&&e.length,u=h?e[0]*i:t.length,d=uu(t,0,u,i,!0),p=[];if(!d||d.next===d.prev)return p;if(h&&(d=vu(t,e,d,i)),t.length>80*i){n=o=t[0],r=s=t[1];for(let e=i;eo&&(o=a),l>s&&(s=l);c=Math.max(o-n,s-r),c=0!==c?1/c:0}return pu(d,p,i,n,r,c),p}};function uu(t,e,i,n,r){let o,s;if(r===Hu(t,e,i,n)>0)for(o=e;o=e;o-=n)s=Bu(o,t[o],t[o+1],s);return s&&Pu(s,s.next)&&(Gu(s),s=s.next),s}function du(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!Pu(n,n.next)&&0!==Cu(n.prev,n,n.next))n=n.next;else{if(Gu(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function pu(t,e,i,n,r,o,s){if(!t)return;!s&&o&&_u(t,n,r,o);let a,l,c=t;while(t.prev!==t.next)if(a=t.prev,l=t.next,o?mu(t,n,r,o):fu(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),Gu(t),t=l.next,c=l.next;else if(t=l,t===c){s?1===s?(t=gu(du(t),e,i),pu(t,e,i,n,r,o,2)):2===s&&yu(t,e,i,n,r,o):pu(du(t),e,i,n,r,o,1);break}}function fu(t){let e=t.prev,i=t,n=t.next;if(Cu(e,i,n)>=0)return!1;let r=t.next.next;while(r!==t.prev){if(Au(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Cu(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function mu(t,e,i,n){let r=t.prev,o=t,s=t.next;if(Cu(r,o,s)>=0)return!1;let a=r.xo.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,h=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,u=Tu(a,l,e,i,n),d=Tu(c,h,e,i,n),p=t.prevZ,f=t.nextZ;while(p&&p.z>=u&&f&&f.z<=d){if(p!==t.prev&&p!==t.next&&Au(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Cu(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&Au(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Cu(f.prev,f,f.next)>=0)return!1;f=f.nextZ}while(p&&p.z>=u){if(p!==t.prev&&p!==t.next&&Au(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Cu(p.prev,p,p.next)>=0)return!1;p=p.prevZ}while(f&&f.z<=d){if(f!==t.prev&&f!==t.next&&Au(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Cu(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function gu(t,e,i){let n=t;do{let r=n.prev,o=n.next.next;!Pu(r,o)&&Ou(r,n,n.next,o)&&Iu(r,o)&&Iu(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),Gu(n),Gu(n.next),n=t=o),n=n.next}while(n!==t);return du(n)}function yu(t,e,i,n,r,o){let s=t;do{let t=s.next.next;while(t!==s.prev){if(s.i!==t.i&&Lu(s,t)){let a=zu(s,t);return s=du(s,s.next),a=du(a,a.next),pu(s,e,i,n,r,o),void pu(a,e,i,n,r,o)}t=t.next}s=s.next}while(s!==t)}function vu(t,e,i,n){let r,o,s,a,l,c=[];for(r=0,o=e.length;r=n.next.y&&n.next.y!==n.y){let t=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>s){if(s=t,t===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x=n.x&&n.x>=c&&r!==n.x&&Au(oi.x||n.x===i.x&&Mu(i,n)))&&(i=n,u=a)),n=n.next}while(n!==l);return i}function Mu(t,e){return Cu(t.prev,t,e.prev)<0&&Cu(e.next,t,t.next)<0}function _u(t,e,i,n){let r=t;do{null===r.z&&(r.z=Tu(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,Su(r)}function Su(t){let e,i,n,r,o,s,a,l,c=1;do{i=t,t=null,o=null,s=0;while(i){for(s++,n=i,a=0,e=0;e0||l>0&&n)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,c*=2}while(s>1);return t}function Tu(t,e,i,n,r){return t=32767*(t-i)*r,e=32767*(e-n)*r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function Eu(t){let e=t,i=t;do{(e.x=0&&(t-s)*(n-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(r-s)*(n-a)>=0}function Lu(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Du(t,e)&&(Iu(t,e)&&Iu(e,t)&&Nu(t,e)&&(Cu(t.prev,t,e.prev)||Cu(t,e.prev,e))||Pu(t,e)&&Cu(t.prev,t,t.next)>0&&Cu(e.prev,e,e.next)>0)}function Cu(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Pu(t,e){return t.x===e.x&&t.y===e.y}function Ou(t,e,i,n){const r=ku(Cu(t,e,i)),o=ku(Cu(t,e,n)),s=ku(Cu(i,n,t)),a=ku(Cu(i,n,e));return r!==o&&s!==a||(!(0!==r||!Ru(t,i,e))||(!(0!==o||!Ru(t,n,e))||(!(0!==s||!Ru(i,t,n))||!(0!==a||!Ru(i,e,n)))))}function Ru(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function ku(t){return t>0?1:t<0?-1:0}function Du(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Ou(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function Iu(t,e){return Cu(t.prev,t,t.next)<0?Cu(t,e,t.next)>=0&&Cu(t,t.prev,e)>=0:Cu(t,e,t.prev)<0||Cu(t,t.next,e)<0}function Nu(t,e){let i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!==i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}function zu(t,e){let i=new Fu(t.i,t.x,t.y),n=new Fu(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function Bu(t,e,i,n){const r=new Fu(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Gu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Fu(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Hu(t,e,i,n){let r=0;for(let o=e,s=i-n;o2&&t[e-1].equals(t[0])&&t.pop()}function Wu(t,e){for(let i=0;iNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-a/u,f=e.y+s/u,m=i.x-c/d,g=i.y+l/d,y=((m-p)*c-(g-f)*l)/(s*c-a*l);n=p+s*y-t.x,r=f+a*y-t.y;const v=n*n+r*r;if(v<=2)return new si(n,r);o=Math.sqrt(v/2)}else{let t=!1;s>Number.EPSILON?l>Number.EPSILON&&(t=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(n=-a,r=s,o=Math.sqrt(h)):(n=s,r=a,o=Math.sqrt(h/2))}return new si(n/o,r/o)}const R=[];for(let e=0,i=A.length,n=i-1,r=e+1;e=0;e--){const t=e/p,i=h*Math.cos(t*Math.PI/2),n=u*Math.sin(t*Math.PI/2)+d;for(let e=0,r=A.length;e=0){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*p;t0)&&d.push(e,n,s),(g!==i-1||a0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new tr(h,3)),this.setAttribute("normal",new tr(u,3)),this.setAttribute("uv",new tr(d,2))}function cd(t,e,i,n,r,o,s){ad.call(this,0,t,e,i,n,r,o,s),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:s}}function hd(t,e,i,n,r,o,s){ld.call(this,0,t,e,i,n,r,o,s),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:s}}function ud(t,e,i,n){Nr.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new dd(t,e,i,n)),this.mergeVertices()}function dd(t,e,i,n){ur.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},t=t||1,e=void 0!==e?Math.max(3,e):8,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;const r=[],o=[],s=[],a=[],l=new vi,c=new si;o.push(0,0,0),s.push(0,0,1),a.push(.5,.5);for(let h=0,u=3;h<=e;h++,u+=3){const r=i+h/e*n;l.x=t*Math.cos(r),l.y=t*Math.sin(r),o.push(l.x,l.y,l.z),s.push(0,0,1),c.x=(o[u]/t+1)/2,c.y=(o[u+1]/t+1)/2,a.push(c.x,c.y)}for(let h=1;h<=e;h++)r.push(h,h+1,0);this.setIndex(r),this.setAttribute("position",new tr(o,3)),this.setAttribute("normal",new tr(s,3)),this.setAttribute("uv",new tr(a,2))}Zu.prototype=Object.create(Nr.prototype),Zu.prototype.constructor=Zu,Ju.prototype=Object.create(Xu.prototype),Ju.prototype.constructor=Ju,Ku.prototype=Object.create(Nr.prototype),Ku.prototype.constructor=Ku,Qu.prototype=Object.create(ur.prototype),Qu.prototype.constructor=Qu,$u.prototype=Object.create(Nr.prototype),$u.prototype.constructor=$u,td.prototype=Object.create(ur.prototype),td.prototype.constructor=td,ed.prototype=Object.create(Nr.prototype),ed.prototype.constructor=ed,id.prototype=Object.create(ur.prototype),id.prototype.constructor=id,nd.prototype=Object.create(Nr.prototype),nd.prototype.constructor=nd,nd.prototype.toJSON=function(){const t=Nr.prototype.toJSON.call(this),e=this.parameters.shapes;return od(e,t)},rd.prototype=Object.create(ur.prototype),rd.prototype.constructor=rd,rd.prototype.toJSON=function(){const t=ur.prototype.toJSON.call(this),e=this.parameters.shapes;return od(e,t)},sd.prototype=Object.create(ur.prototype),sd.prototype.constructor=sd,ad.prototype=Object.create(Nr.prototype),ad.prototype.constructor=ad,ld.prototype=Object.create(ur.prototype),ld.prototype.constructor=ld,cd.prototype=Object.create(ad.prototype),cd.prototype.constructor=cd,hd.prototype=Object.create(ld.prototype),hd.prototype.constructor=hd,ud.prototype=Object.create(Nr.prototype),ud.prototype.constructor=ud,dd.prototype=Object.create(ur.prototype),dd.prototype.constructor=dd;var pd=Object.freeze({__proto__:null,WireframeGeometry:Vh,ParametricGeometry:Xh,ParametricBufferGeometry:Yh,TetrahedronGeometry:Jh,TetrahedronBufferGeometry:Kh,OctahedronGeometry:Qh,OctahedronBufferGeometry:$h,IcosahedronGeometry:tu,IcosahedronBufferGeometry:eu,DodecahedronGeometry:iu,DodecahedronBufferGeometry:nu,PolyhedronGeometry:qh,PolyhedronBufferGeometry:Zh,TubeGeometry:ru,TubeBufferGeometry:ou,TorusKnotGeometry:su,TorusKnotBufferGeometry:au,TorusGeometry:lu,TorusBufferGeometry:cu,TextGeometry:Zu,TextBufferGeometry:Ju,SphereGeometry:Ku,SphereBufferGeometry:Qu,RingGeometry:$u,RingBufferGeometry:td,PlaneGeometry:ro,PlaneBufferGeometry:oo,LatheGeometry:ed,LatheBufferGeometry:id,ShapeGeometry:nd,ShapeBufferGeometry:rd,ExtrudeGeometry:Vu,ExtrudeBufferGeometry:Xu,EdgesGeometry:sd,ConeGeometry:cd,ConeBufferGeometry:hd,CylinderGeometry:ad,CylinderBufferGeometry:ld,CircleGeometry:ud,CircleBufferGeometry:dd,BoxGeometry:zr,BoxBufferGeometry:Br});function fd(t){Un.call(this),this.type="ShadowMaterial",this.color=new Nn(0),this.transparent=!0,this.setValues(t)}function md(t){Wr.call(this,t),this.type="RawShaderMaterial"}function gd(t){Un.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Nn(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function yd(t){gd.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new si(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function vd(t){Un.call(this),this.type="MeshPhongMaterial",this.color=new Nn(16777215),this.specular=new Nn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function xd(t){Un.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Nn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function bd(t){Un.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function wd(t){Un.call(this),this.type="MeshLambertMaterial",this.color=new Nn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Md(t){Un.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Nn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function _d(t){_h.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}fd.prototype=Object.create(Un.prototype),fd.prototype.constructor=fd,fd.prototype.isShadowMaterial=!0,fd.prototype.copy=function(t){return Un.prototype.copy.call(this,t),this.color.copy(t.color),this},md.prototype=Object.create(Wr.prototype),md.prototype.constructor=md,md.prototype.isRawShaderMaterial=!0,gd.prototype=Object.create(Un.prototype),gd.prototype.constructor=gd,gd.prototype.isMeshStandardMaterial=!0,gd.prototype.copy=function(t){return Un.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},yd.prototype=Object.create(gd.prototype),yd.prototype.constructor=yd,yd.prototype.isMeshPhysicalMaterial=!0,yd.prototype.copy=function(t){return gd.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new Nn).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},vd.prototype=Object.create(Un.prototype),vd.prototype.constructor=vd,vd.prototype.isMeshPhongMaterial=!0,vd.prototype.copy=function(t){return Un.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},xd.prototype=Object.create(Un.prototype),xd.prototype.constructor=xd,xd.prototype.isMeshToonMaterial=!0,xd.prototype.copy=function(t){return Un.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},bd.prototype=Object.create(Un.prototype),bd.prototype.constructor=bd,bd.prototype.isMeshNormalMaterial=!0,bd.prototype.copy=function(t){return Un.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},wd.prototype=Object.create(Un.prototype),wd.prototype.constructor=wd,wd.prototype.isMeshLambertMaterial=!0,wd.prototype.copy=function(t){return Un.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Md.prototype=Object.create(Un.prototype),Md.prototype.constructor=Md,Md.prototype.isMeshMatcapMaterial=!0,Md.prototype.copy=function(t){return Un.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},_d.prototype=Object.create(_h.prototype),_d.prototype.constructor=_d,_d.prototype.isLineDashedMaterial=!0,_d.prototype.copy=function(t){return _h.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Sd=Object.freeze({__proto__:null,ShadowMaterial:fd,SpriteMaterial:qc,RawShaderMaterial:md,ShaderMaterial:Wr,PointsMaterial:Dh,MeshPhysicalMaterial:yd,MeshStandardMaterial:gd,MeshPhongMaterial:vd,MeshToonMaterial:xd,MeshNormalMaterial:bd,MeshLambertMaterial:wd,MeshDepthMaterial:Lc,MeshDistanceMaterial:Cc,MeshBasicMaterial:jn,MeshMatcapMaterial:Md,LineDashedMaterial:_d,LineBasicMaterial:_h,Material:Un});const Td={arraySlice:function(t,e,i){return Td.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"===typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,i){return t[e]-t[i]}const i=t.length,n=new Array(i);for(let r=0;r!==i;++r)n[r]=r;return n.sort(e),n},sortedArray:function(t,e,i){const n=t.length,r=new t.constructor(n);for(let o=0,s=0;s!==n;++o){const n=i[o]*e;for(let i=0;i!==e;++i)r[s++]=t[n+i]}return r},flattenJSON:function(t,e,i,n){let r=1,o=t[0];while(void 0!==o&&void 0===o[n])o=t[r++];if(void 0===o)return;let s=o[n];if(void 0!==s)if(Array.isArray(s))do{s=o[n],void 0!==s&&(e.push(o.time),i.push.apply(i,s)),o=t[r++]}while(void 0!==o);else if(void 0!==s.toArray)do{s=o[n],void 0!==s&&(e.push(o.time),s.toArray(i,i.length)),o=t[r++]}while(void 0!==o);else do{s=o[n],void 0!==s&&(e.push(o.time),i.push(s)),o=t[r++]}while(void 0!==o)},subclip:function(t,e,i,n,r){r=r||30;const o=t.clone();o.name=e;const s=[];for(let l=0;l=n)){a.push(t.times[o]);for(let i=0;io.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l=e.times[l]){const t=l*a;c=Td.arraySlice(e.values,t)}else{const t=e.createInterpolant();t.evaluate(o),c=t.resultBuffer}if("quaternion"===n){const t=new mi(c[0],c[1],c[2],c[3]).normalize().conjugate();t.toArray(c)}const h=r.times.length;for(let t=0;t=r)break t;{const s=e[1];t=r)break e}o=i,i=0}}while(i>>1;te)--o;if(++o,0!==r||o!==n){r>=o&&(o=Math.max(o,1),r=o-1);const t=this.getValueSize();this.times=Td.arraySlice(i,r,o),this.values=Td.arraySlice(this.values,r*t,o*t)}return this},validate:function(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let s=0;s!==r;s++){const e=i[s];if("number"===typeof e&&isNaN(e)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,e),t=!1;break}if(null!==o&&o>e){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,e,o),t=!1;break}o=e}if(void 0!==n&&Td.isTypedArray(n))for(let s=0,a=n.length;s!==a;++s){const e=n[s];if(isNaN(e)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,e),t=!1;break}}return t},optimize:function(){const t=Td.arraySlice(this.times),e=Td.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===De,r=t.length-1;let o=1;for(let s=1;s0){t[o]=t[r];for(let t=r*i,n=o*i,s=0;s!==i;++s)e[n+s]=e[t+s];++o}return o!==t.length?(this.times=Td.arraySlice(t,0,o),this.values=Td.arraySlice(e,0,o*i)):(this.times=t,this.values=e),this},clone:function(){const t=Td.arraySlice(this.times,0),e=Td.arraySlice(this.values,0),i=this.constructor,n=new i(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Od.prototype=Object.assign(Object.create(Pd.prototype),{constructor:Od,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Re,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Rd.prototype=Object.assign(Object.create(Pd.prototype),{constructor:Rd,ValueTypeName:"color"}),kd.prototype=Object.assign(Object.create(Pd.prototype),{constructor:kd,ValueTypeName:"number"}),Dd.prototype=Object.assign(Object.create(Ed.prototype),{constructor:Dd,interpolate_:function(t,e,i,n){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(i-e)/(n-e);let l=t*s;for(let c=l+s;l!==c;l+=4)mi.slerpFlat(r,0,o,l-s,o,l,a);return r}}),Id.prototype=Object.assign(Object.create(Pd.prototype),{constructor:Id,ValueTypeName:"quaternion",DefaultInterpolation:ke,InterpolantFactoryMethodLinear:function(t){return new Dd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Nd.prototype=Object.assign(Object.create(Pd.prototype),{constructor:Nd,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Re,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),zd.prototype=Object.assign(Object.create(Pd.prototype),{constructor:zd,ValueTypeName:"vector"}),Object.assign(Bd,{parse:function(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let r=0,o=i.length;r!==o;++r)e.push(Fd(i[r]).scale(n));return new Bd(t.name,t.duration,e,t.blendMode)},toJSON:function(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let r=0,o=i.length;r!==o;++r)e.push(Pd.toJSON(i[r]));return n},CreateFromMorphTargetSequence:function(t,e,i,n){const r=e.length,o=[];for(let s=0;s1){const t=i[1];let r=n[t];r||(n[t]=r=[]),r.push(e)}}const o=[];for(const s in n)o.push(Bd.CreateFromMorphTargetSequence(s,n[s],e,i));return o},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const o=[],s=[];Td.flattenJSON(i,o,s,n),0!==o.length&&r.push(new t(e,o,s))}},n=[],r=t.name||"default",o=t.fps||30,s=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let h=0;h0||0===t.search(/^data\:image\/jpeg/);r.format=n?Pt:Ot,r.needsUpdate=!0,void 0!==e&&e(r)}),i,n),r}}),Object.assign($d.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=5);const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},getLength:function(){const t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let o=1;o<=t;o++)i=this.getPoint(o/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){const i=this.getLengths();let n,r=0,o=i.length;n=e||t*i[o-1];let s,a=0,l=o-1;while(a<=l)if(r=Math.floor(a+(l-a)/2),s=i[r]-n,s<0)a=r+1;else{if(!(s>0)){l=r;break}l=r-1}if(r=l,i[r]===n)return r/(o-1);const c=i[r],h=i[r+1],u=h-c,d=(n-c)/u,p=(r+d)/(o-1);return p},getTangent:function(t,e){const i=1e-4;let n=t-i,r=t+i;n<0&&(n=0),r>1&&(r=1);const o=this.getPoint(n),s=this.getPoint(r),a=e||(o.isVector2?new si:new vi);return a.copy(s).sub(o).normalize(),a},getTangentAt:function(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)},computeFrenetFrames:function(t,e){const i=new vi,n=[],r=[],o=[],s=new vi,a=new Ei;for(let d=0;d<=t;d++){const e=d/t;n[d]=this.getTangentAt(e,new vi),n[d].normalize()}r[0]=new vi,o[0]=new vi;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),h=Math.abs(n[0].y),u=Math.abs(n[0].z);c<=l&&(l=c,i.set(1,0,0)),h<=l&&(l=h,i.set(0,1,0)),u<=l&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],s),o[0].crossVectors(n[0],r[0]);for(let d=1;d<=t;d++){if(r[d]=r[d-1].clone(),o[d]=o[d-1].clone(),s.crossVectors(n[d-1],n[d]),s.length()>Number.EPSILON){s.normalize();const t=Math.acos(oi.clamp(n[d-1].dot(n[d]),-1,1));r[d].applyMatrix4(a.makeRotationAxis(s,t))}o[d].crossVectors(n[d],r[d])}if(!0===e){let e=Math.acos(oi.clamp(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(s.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],e*i)),o[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),tp.prototype=Object.create($d.prototype),tp.prototype.constructor=tp,tp.prototype.isEllipseCurve=!0,tp.prototype.getPoint=function(t,e){const i=e||new si,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)n)r-=n;r0?0:(Math.floor(Math.abs(h)/r)+1)*r:0===u&&h===r-1&&(h=r-2,u=1),this.closed||h>0?s=n[(h-1)%r]:(np.subVectors(n[0],n[1]).add(n[0]),s=np),a=n[h%r],l=n[(h+1)%r],this.closed||h+2n.length-2?n.length-1:o+1],h=n[o>n.length-3?n.length-1:o+2];return i.set(lp(s,a.x,l.x,c.x,h.x),lp(s,a.y,l.y,c.y,h.y)),i},Sp.prototype.copy=function(t){$d.prototype.copy.call(this,t),this.points=[];for(let e=0,i=t.points.length;e=e){const t=i[n]-e,r=this.curves[n],o=r.getLength(),s=0===o?0:1-t/o;return r.getPointAt(s)}n++}return null},getLength:function(){const t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,n=this.curves.length;i1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){$d.prototype.copy.call(this,t),this.curves=[];for(let e=0,i=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(t){return Ep.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){const t=Ep.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Ep.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Lp.prototype=Object.assign(Object.create(Ap.prototype),{constructor:Lp,getPointsHoles:function(t){const e=[];for(let i=0,n=this.holes.length;i0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const r in t.uniforms){const e=t.uniforms[r];switch(n.uniforms[r]={},e.type){case"t":n.uniforms[r].value=i(e.value);break;case"c":n.uniforms[r].value=(new Nn).setHex(e.value);break;case"v2":n.uniforms[r].value=(new si).fromArray(e.value);break;case"v3":n.uniforms[r].value=(new vi).fromArray(e.value);break;case"v4":n.uniforms[r].value=(new di).fromArray(e.value);break;case"m3":n.uniforms[r].value=(new ai).fromArray(e.value);case"m4":n.uniforms[r].value=(new Ei).fromArray(e.value);break;default:n.uniforms[r].value=e.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const r in t.extensions)n.extensions[r]=t.extensions[r];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=i(t.map)),void 0!==t.matcap&&(n.matcap=i(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),n.normalScale=(new si).fromArray(e)}return void 0!==t.displacementMap&&(n.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=i(t.specularMap)),void 0!==t.envMap&&(n.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new si).fromArray(t.clearcoatNormalScale)),n},setTextures:function(t){return this.textures=t,this}});const Wp={decodeText:function(t){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,r=t.length;n0){const s=new Ud(e);r=new Jd(s),r.setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;eNumber.EPSILON){if(l<0&&(i=e[o],a=-a,s=e[r],l=-l),t.ys.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{const e=l*(t.x-i.x)-a*(t.y-i.y);if(0===e)return!0;if(e<0)continue;n=!n}}else{if(t.y!==i.y)continue;if(s.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=s.x)return!0}}return n}const r=Uu.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return i(o);let s,a,l,c=[];if(1===o.length)return a=o[0],l=new Lp,l.curves=a.curves,c.push(l),c;let h=!r(o[0].getPoints());h=t?!h:h;const u=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let y=0,v=o.length;y1){let t=!1;const e=[];for(let i=0,n=d.length;i0&&(t||(m=u))}for(let y=0,v=d.length;y0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let a=e,l=e+e;a!==l;++a)if(i[a]!==i[a+e]){s.setValue(i,n);break}},saveOriginalState:function(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let r=i,o=n;r!==o;++r)e[r]=e[n+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let o=0;o!==r;++o)t[e+o]=t[i+o]},_slerp:function(t,e,i,n){mi.slerpFlat(t,e,t,e,t,i,n)},_slerpAdditive:function(t,e,i,n,r){const o=this._workIndex*r;mi.multiplyQuaternionsFlat(t,o,t,e,t,i),mi.slerpFlat(t,e,t,e,t,o,n)},_lerp:function(t,e,i,n,r){const o=1-n;for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]*o+t[i+s]*n}},_lerpAdditive:function(t,e,i,n,r){for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]+t[i+o]*n}}});const Lf="\\[\\]\\.:\\/",Cf=new RegExp("["+Lf+"]","g"),Pf="[^"+Lf+"]",Of="[^"+Lf.replace("\\.","")+"]",Rf=/((?:WC+[\/:])*)/.source.replace("WC",Pf),kf=/(WCOD+)?/.source.replace("WCOD",Of),Df=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Pf),If=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Pf),Nf=new RegExp("^"+Rf+kf+Df+If+"$"),zf=["material","materials","bones"];function Bf(t,e,i){const n=i||Gf.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function Gf(t,e,i){this.path=e,this.parsedPath=i||Gf.parseTrackName(e),this.node=Gf.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Ff(){this.uuid=oi.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let i=0,n=arguments.length;i!==n;++i)t[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}function Hf(t,e,i,n){this._mixer=t,this._clip=e,this._localRoot=i||null,this.blendMode=n||e.blendMode;const r=e.tracks,o=r.length,s=new Array(o),a={endingStart:Ie,endingEnd:Ie};for(let l=0;l!==o;++l){const t=r[l].createInterpolant(null);s[l]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Pe,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Uf(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function jf(t){"string"===typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Wf(t,e,i){Vc.call(this,t,e),this.meshPerAttribute=i||1}function Vf(t,e,i,n){this.ray=new yn(t,e),this.near=i||0,this.far=n||1/0,this.camera=null,this.layers=new Pi,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Xf(t,e){return t.distance-e.distance}function Yf(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n){const n=t.children;for(let t=0,r=n.length;t=r){const o=r++,c=t[o];e[c.uuid]=l,t[l]=c,e[a]=o,t[o]=s;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[o],r=e[l];e[l]=n,e[o]=r}}}this.nCachedObjects_=r},uncache:function(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,o=t.length;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s],l=a.uuid,c=e[l];if(void 0!==c)if(delete e[l],c0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case Ge:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(o),e[i].accumulateAdditive(s);break;case Be:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(o),e[i].accumulate(n,s)}}},_updateWeight:function(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const o=i===Oe;if(0===t)return-1===r?n:o&&1===(1&r)?e-n:n;if(i===Ce){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){const e=t<0;this._setEndings(e,!e,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(o&&1===(1&r))return e-n}return n},_setEndings:function(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=Ne,n.endingEnd=Ne):(n.endingStart=t?this.zeroSlopeAtStart?Ne:Ie:ze,n.endingEnd=e?this.zeroSlopeAtEnd?Ne:Ie:ze)},_scheduleFading:function(t,e,i){const n=this._mixer,r=n.time;let o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=r,a[0]=e,s[1]=r+t,a[1]=i,this}}),Uf.prototype=Object.assign(Object.create(ni.prototype),{constructor:Uf,_bindAction:function(t,e){const i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,o=t._propertyBindings,s=t._interpolants,a=i.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let h=0;h!==r;++h){const t=n[h],r=t.name;let l=c[r];if(void 0!==l)o[h]=l;else{if(l=o[h],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,a,r));continue}const n=e&&e._propertyBindings[h].binding.parsedPath;l=new Af(Gf.create(i,r,n),t.ValueTypeName,t.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,a,r),o[h]=l}s[h].resultBuffer=l.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0===i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){const e=t._cacheIndex;return null!==e&&e=0;--i)t[i].stop();return this},update:function(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1;for(let l=0;l!==i;++l){const i=e[l];i._update(n,t,r,o)}const s=this._bindings,a=this._nActiveBindings;for(let l=0;l!==a;++l)s[l].apply(o);return this},setTime:function(t){this.time=0;for(let e=0;ethis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new si),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new si),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){const e=Jf.copy(t).clamp(this.min,this.max);return e.sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});const Qf=new vi,$f=new vi;function tm(t,e){this.start=void 0!==t?t:new vi,this.end=void 0!==e?e:new vi}function em(t){Wi.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Object.assign(tm.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new vi),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new vi),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new vi),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){Qf.subVectors(t,this.start),$f.subVectors(this.end,this.start);const i=$f.dot($f),n=$f.dot(Qf);let r=n/i;return e&&(r=oi.clamp(r,0,1)),r},closestPointToPoint:function(t,e,i){const n=this.closestPointToPointParameter(t,e);return void 0===i&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),i=new vi),this.delta(i).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),em.prototype=Object.create(Wi.prototype),em.prototype.constructor=em,em.prototype.isImmediateRenderObject=!0;const im=new vi;function nm(t,e){Wi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;const i=new ur,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,s=1,a=32;o.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Lm.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Lm,e)}},Om.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},Om.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Om.prototype.copy=function(t){return Wi.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Om.prototype.clone=function(){return(new this.constructor).copy(this)},Rm.prototype=Object.create(Rh.prototype),Rm.prototype.constructor=Rm;const km=4,Dm=8,Im=Math.pow(2,Dm),Nm=[.125,.215,.35,.446,.526,.582],zm=Dm-km+1+Nm.length,Bm=20,Gm={[He]:0,[Ue]:1,[We]:2,[Xe]:3,[Ye]:4,[qe]:5,[je]:6},Fm=new Np,{_lodPlanes:Hm,_sizeLods:Um,_sigmas:jm}=Jm();let Wm=null;const Vm=(1+Math.sqrt(5))/2,Xm=1/Vm,Ym=[new vi(1,1,1),new vi(-1,1,1),new vi(1,1,-1),new vi(-1,1,-1),new vi(0,Vm,Xm),new vi(0,Vm,-Xm),new vi(Xm,0,Vm),new vi(-Xm,0,Vm),new vi(Vm,Xm,0),new vi(-Vm,Xm,0)];function qm(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=$m(Bm),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Zm(t){return void 0!==t&&t.type===yt&&(t.encoding===He||t.encoding===Ue||t.encoding===je)}function Jm(){const t=[],e=[],i=[];let n=Dm;for(let r=0;rDm-km?s=Nm[r-Dm+km-1]:0==r&&(s=0),i.push(s);const a=1/(o-1),l=-a/2,c=1+a/2,h=[l,l,c,l,c,c,l,l,c,c,l,c],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),y=new Float32Array(f*d*u),v=new Float32Array(m*d*u);for(let t=0;t2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];g.set(n,p*d*t),y.set(h,f*d*t);const r=[t,t,t,t,t,t];v.set(r,m*d*t)}const x=new ur;x.setAttribute("position",new Xn(g,p)),x.setAttribute("uv",new Xn(y,f)),x.setAttribute("faceIndex",new Xn(v,m)),t.push(x),n>km&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:i}}function Km(t){const e=new pi(3*Im,3*Im,t);return e.texture.mapping=st,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Qm(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function $m(t){const e=new Float32Array(t),i=new vi(0,1,0),n=new md({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i},inputEncoding:{value:Gm[He]},outputEncoding:{value:Gm[He]}},vertexShader:ig(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${ng()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include \n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:g,depthTest:!1,depthWrite:!1});return n}function tg(){const t=new si(1,1),e=new md({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:t},inputEncoding:{value:Gm[He]},outputEncoding:{value:Gm[He]}},vertexShader:ig(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n${ng()}\n\n#include \n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv = equirectUv( outputDirection );\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:g,depthTest:!1,depthWrite:!1});return e}function eg(){const t=new md({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Gm[He]},outputEncoding:{value:Gm[He]}},vertexShader:ig(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n${ng()}\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:g,depthTest:!1,depthWrite:!1});return t}function ig(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function ng(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}qm.prototype={constructor:qm,fromScene:function(t,e=0,i=.1,n=100){Wm=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r},fromEquirectangular:function(t){return this._fromTexture(t)},fromCubemap:function(t){return this._fromTexture(t)},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=eg(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=tg(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t2?Im:0,Im,Im),c.setRenderTarget(n),c.render(t,s)}c.toneMapping=u,c.outputEncoding=h,c.setClearColor(d,p)},_textureToCubeUV:function(t,e){const i=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=eg()):null==this._equirectShader&&(this._equirectShader=tg());const n=t.isCubeTexture?this._cubemapShader:this._equirectShader,r=new Cr(Hm[0],n),o=n.uniforms;o["envMap"].value=t,t.isCubeTexture||o["texelSize"].value.set(1/t.image.width,1/t.image.height),o["inputEncoding"].value=Gm[t.encoding],o["outputEncoding"].value=Gm[e.texture.encoding],Qm(e,0,0,3*Im,2*Im),i.setRenderTarget(e),i.render(r,Fm)},_applyPMREM:function(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let n=1;nBm&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Bm}`);const g=[];let y=0;for(let w=0;wDm-km?n-Dm+km:0);Qm(e,x,b,3*v,2*v),a.setRenderTarget(e),a.render(h,Fm)}};const rg=2;function og(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ap.call(this,t),this.type="catmullrom",this.closed=!0}function sg(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ap.call(this,t),this.type="catmullrom"}function ag(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),ap.call(this,t),this.type="catmullrom"}$d.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create($d.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Ep.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const e=new Nr;for(let i=0,n=t.length;i2){e=v?e.trim():d(e,3);var i,n,r,o=e.charCodeAt(0);if(43===o||45===o){if(i=e.charCodeAt(2),88===i||120===i)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+e}for(var s,l=e.slice(2),c=0,h=l.length;cr)return NaN;return parseInt(l,n)}}return+e};if(!f(" 0o1")||!f("0b1")||f("+0x1")){f=function(t){var e=arguments.length<1?0:t,i=this;return i instanceof f&&(y?l((function(){g.valueOf.call(i)})):o(i)!=p)?s(new m(x(e)),i,f):x(e)};for(var b,w=i("9e1e")?c(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),M=0;w.length>M;M++)r(m,b=w[M])&&!r(f,b)&&u(f,b,h(m,b));f.prototype=g,g.constructor=f,i("2aba")(n,p,f)}},ea7f:function(t,e,i){var n;(function(r,o){t.exports?(o["default"]=o,t.exports=r.document?o(r):o):(n=function(){return o(r)}.call(e,i,e,t),void 0===n||(t.exports=n))})("undefined"!==typeof window?window:this,(function(t){function e(t,e,i,n){t.hasOwnProperty(e)||(t[e]=n.apply(null,i))}var i={};return e(i,"Core/Globals.js",[],(function(){var e="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},i=e.document,n=e.navigator&&e.navigator.userAgent||"",r=i&&i.createElementNS&&!!i.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,o=/(edge|msie|trident)/i.test(n)&&!e.opera,s=-1!==n.indexOf("Firefox"),a=-1!==n.indexOf("Chrome"),l=s&&4>parseInt(n.split("Firefox/")[1],10);return{product:"Highcharts",version:"8.2.2",deg2rad:2*Math.PI/360,doc:i,hasBidiBug:l,hasTouch:!!e.TouchEvent,isMS:o,isWebKit:-1!==n.indexOf("AppleWebKit"),isFirefox:s,isChrome:a,isSafari:!a&&-1!==n.indexOf("Safari"),isTouchDevice:/(Mobile|Android|Windows Phone)/.test(n),SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:r,win:e,marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){},charts:[],dateFormats:{}}})),e(i,"Core/Utilities.js",[i["Core/Globals.js"]],(function(t){function e(t,i,n,r){var o=i?"Highcharts error":"Highcharts warning";32===t&&(t=o+": Deprecated member");var s=m(t),a=s?o+" #"+t+": www.highcharts.com/errors/"+t+"/":t.toString();if(o=function(){if(i)throw Error(a);c.console&&-1===e.messages.indexOf(a)&&console.log(a)},"undefined"!==typeof r){var l="";s&&(a+="?"),j(r,(function(t,e){l+="\n - "+e+": "+t,s&&(a+=encodeURI(e)+"="+encodeURI(t))})),a+=l}n?Y(n,"displayError",{code:t,message:a,params:r},o):o(),e.messages.push(a)}function i(){var t,e=arguments,i={},r=function(t,e){return"object"!==typeof t&&(t={}),j(e,(function(i,o){!n(i,!0)||f(i)||p(i)?t[o]=e[o]:t[o]=r(t[o]||{},i)})),t};!0===e[0]&&(i=e[1],e=Array.prototype.slice.call(e,2));var o=e.length;for(t=0;tt&&-1/0=i&&(e=[1/i]))),n=0;n=t||!r&&a<=(e[n]+(e[n+1]||e[n]))/2));n++);return N(s*i,-Math.round(Math.log(.001)/Math.LN10))},O=t.stableSort=function(t,e){var i,n,r=t.length;for(n=0;ni&&(i=t[e]);return i},D=t.destroyObjectProperties=function(t,e){j(t,(function(i,n){i&&i!==e&&i.destroy&&i.destroy(),delete t[n]}))},I=t.discardElement=function(e){var i=t.garbageBin;i||(i=_("div")),e&&i.appendChild(e),i.innerHTML=""},N=t.correctFloat=function(t,e){return parseFloat(t.toPrecision(e||14))},z=t.timeUnits={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},B=t.numberFormat=function(e,i,n,r){e=+e||0,i=+i;var s=t.defaultOptions.lang,a=(e.toString().split(".")[1]||"").split("e")[0].length,l=e.toString().split("e");if(-1===i)i=Math.min(a,20);else if(m(i)){if(i&&l[1]&&0>l[1]){var c=i+ +l[1];0<=c?(l[0]=(+l[0]).toExponential(c).split("e")[0],i=c):(l[0]=l[0].split(".")[0]||0,e=20>i?(l[0]*Math.pow(10,l[1])).toFixed(i):0,l[1]=0)}}else i=2;var u=(Math.abs(l[1]?l[0]:e)+Math.pow(10,-Math.max(i,a)-1)).toFixed(i);return a=String(h(u)),c=3e?"-":"")+(c?a.substr(0,c)+r:""),e+=a.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+r),i&&(e+=n+u.slice(-i)),l[1]&&0!==+e&&(e+="e"+l[1]),e};Math.easeInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)};var G=t.getStyle=function(i,n,r){return"width"===n?(n=Math.min(i.offsetWidth,i.scrollWidth),r=i.getBoundingClientRect&&i.getBoundingClientRect().width,r=n-1&&(n=Math.floor(r)),Math.max(0,n-t.getStyle(i,"padding-left")-t.getStyle(i,"padding-right"))):"height"===n?Math.max(0,Math.min(i.offsetHeight,i.scrollHeight)-t.getStyle(i,"padding-top")-t.getStyle(i,"padding-bottom")):(c.getComputedStyle||e(27,!0),(i=c.getComputedStyle(i,void 0))&&(i=i.getPropertyValue(n),o(r,"opacity"!==n)&&(i=h(i))),i)},F=t.inArray=function(t,i,n){return e(32,!1,void 0,{"Highcharts.inArray":"use Array.indexOf"}),i.indexOf(t,n)},H=t.find=Array.prototype.find?function(t,e){return t.find(e)}:function(t,e){var i,n=t.length;for(i=0;ie?t>16,(65280&t)>>8,255&t,1]:4===r&&(i=[(3840&t)>>4|(3840&t)>>8,(240&t)>>4|240&t,(15&t)<<4|15&t,1])}if(!i)for(n=this.parsers.length;n--&&!i;){var o=this.parsers[n];(r=o.regex.exec(t))&&(i=o.parse(r))}}this.rgba=i||[]},e.prototype.get=function(t){var e=this.input,r=this.rgba;if("undefined"!==typeof this.stops){var o=n(e);o.stops=[].concat(o.stops),this.stops.forEach((function(e,i){o.stops[i]=[o.stops[i][0],e.get(t)]}))}else o=r&&i(r[0])?"rgb"===t||!t&&1===r[3]?"rgb("+r[0]+","+r[1]+","+r[2]+")":"a"===t?r[3]:"rgba("+r.join(",")+")":e;return o},e.prototype.brighten=function(t){var e,n=this.rgba;if(this.stops)this.stops.forEach((function(e){e.brighten(t)}));else if(i(t)&&0!==t)for(e=0;3>e;e++)n[e]+=r(255*t),0>n[e]&&(n[e]=0),255n)for(var r=0;r=s+this.startTime){this.now=this.end,this.pos=1,this.update();var l=a[this.prop]=!0;r(a,(function(t){!0!==t&&(l=!1)})),l&&o&&o.call(n),t=!1}else this.pos=i.easing((e-this.startTime)/s),this.now=this.start+(this.end-this.start)*this.pos,this.update(),t=!0;return t},e.prototype.initPath=function(t,e,i){function r(t,e){for(;t.lengthn.width)&&(n={width:0,height:0})}else n=this.htmlGetBBox();if(r.isSVG&&(e=n.width,r=n.height,u&&(n.height=r={"11px,17":14,"13px,20":16}[s&&s.fontSize+","+Math.round(r)]||r),i&&(s=i*a,n.width=Math.abs(r*Math.sin(s))+Math.abs(e*Math.cos(s)),n.height=Math.abs(r*Math.cos(s))+Math.abs(e*Math.sin(s)))),p&&0]*>/g,"").replace(/</g,"<").replace(/>/g,">")))},t.prototype.toFront=function(){var t=this.element;return t.parentNode.appendChild(t),this},t.prototype.translate=function(t,e){return this.attr({translateX:t,translateY:e})},t.prototype.updateShadows=function(t,e,i){var n=this.shadows;if(n)for(var r=n.length;r--;)i.call(n[r],"height"===t?Math.max(e-(n[r].cutHeight||0),0):"d"===t?this.d:e,t,n[r])},t.prototype.updateTransform=function(){var t=this.translateX||0,e=this.translateY||0,i=this.scaleX,n=this.scaleY,r=this.inverted,o=this.rotation,s=this.matrix,a=this.element;r&&(t+=this.width,e+=this.height),t=["translate("+t+","+e+")"],v(s)&&t.push("matrix("+s.join(",")+")"),r?t.push("rotate(90) scale(-1,1)"):o&&t.push("rotate("+o+" "+L(this.rotationOriginX,a.getAttribute("x"),0)+" "+L(this.rotationOriginY,a.getAttribute("y")||0)+")"),(v(i)||v(n))&&t.push("scale("+L(i,1)+" "+L(n,1)+")"),t.length&&a.setAttribute("transform",t.join(" "))},t.prototype.visibilitySetter=function(t,e,i){"inherit"===t?i.removeAttribute(e):this[e]!==t&&i.setAttribute(e,t),this[e]=t},t.prototype.xGetter=function(t){return"circle"===this.element.nodeName&&("x"===t?t="cx":"y"===t&&(t="cy")),this._defaultGetter(t)},t.prototype.zIndexSetter=function(t,e){var i=this.renderer,n=this.parentGroup,r=(n||i).element||i.box,o=this.element,s=!1;i=r===i.box;var a,l=this.added;if(v(t)?(o.setAttribute("data-z-index",t),t=+t,this[e]===t&&(l=!1)):v(this[e])&&o.removeAttribute("data-z-index"),this[e]=t,l){for((t=this.zIndex)&&n&&(n.handleZ=!0),e=r.childNodes,a=e.length-1;0<=a&&!s;a--){n=e[a],l=n.getAttribute("data-z-index");var c=!v(l);n!==o&&(0>t&&c&&!i&&!a?(r.insertBefore(o,e[a]),s=!0):(C(l)<=t||c&&(!v(t)||0<=t))&&(r.insertBefore(o,e[a+1]||null),s=!0))}s||(r.insertBefore(o,e[i?3:0]||null),s=!0)}return s},t}(),t.prototype["stroke-widthSetter"]=t.prototype.strokeSetter,t.prototype.yGetter=t.prototype.xGetter,t.prototype.matrixSetter=t.prototype.rotationOriginXSetter=t.prototype.rotationOriginYSetter=t.prototype.rotationSetter=t.prototype.scaleXSetter=t.prototype.scaleYSetter=t.prototype.translateXSetter=t.prototype.translateYSetter=t.prototype.verticalAlignSetter=function(t,e){this[e]=t,this.doTransform=!0},i.SVGElement=t,i.SVGElement})),e(i,"Core/Renderer/SVG/SVGLabel.js",[i["Core/Renderer/SVG/SVGElement.js"],i["Core/Utilities.js"]],(function(t,e){var i=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},t(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),n=e.defined,r=e.extend,o=e.isNumber,s=e.merge,a=e.removeEvent;return function(e){function l(t,i,n,r,o,s,a,c,h,u){var d=e.call(this)||this;if(d.init(t,"g"),d.textStr=i,d.x=n,d.y=r,d.anchorX=s,d.anchorY=a,d.baseline=h,d.className=u,"button"!==u&&d.addClass("highcharts-label"),u&&d.addClass("highcharts-"+u),d.text=t.text("",0,0,c).attr({zIndex:1}),"string"===typeof o){var p=/^url\((.*?)\)$/.test(o);(d.renderer.symbols[o]||p)&&(d.symbolKey=o)}return d.bBox=l.emptyBBox,d.padding=3,d.paddingLeft=0,d.baselineOffset=0,d.needsBox=t.styledMode||p,d.deferredAttr={},d.alignFactor=0,d}return i(l,e),l.prototype.alignSetter=function(t){t={left:0,center:.5,right:1}[t],t!==this.alignFactor&&(this.alignFactor=t,this.bBox&&o(this.xSetting)&&this.attr({x:this.xSetting}))},l.prototype.anchorXSetter=function(t,e){this.anchorX=t,this.boxAttr(e,Math.round(t)-this.getCrispAdjust()-this.xSetting)},l.prototype.anchorYSetter=function(t,e){this.anchorY=t,this.boxAttr(e,t-this.ySetting)},l.prototype.boxAttr=function(t,e){this.box?this.box.attr(t,e):this.deferredAttr[t]=e},l.prototype.css=function(e){if(e){var i={};e=s(e),l.textProps.forEach((function(t){"undefined"!==typeof e[t]&&(i[t]=e[t],delete e[t])})),this.text.css(i);var n="fontSize"in i||"fontWeight"in i;("width"in i||n)&&(this.updateBoxSize(),n&&this.updateTextPadding())}return t.prototype.css.call(this,e)},l.prototype.destroy=function(){a(this.element,"mouseenter"),a(this.element,"mouseleave"),this.text&&this.text.destroy(),this.box&&(this.box=this.box.destroy()),t.prototype.destroy.call(this)},l.prototype.fillSetter=function(t,e){t&&(this.needsBox=!0),this.fill=t,this.boxAttr(e,t)},l.prototype.getBBox=function(){var t=this.bBox,e=this.padding;return{width:t.width+2*e,height:t.height+2*e,x:t.x-e,y:t.y-e}},l.prototype.getCrispAdjust=function(){return this.renderer.styledMode&&this.box?this.box.strokeWidth()%2/2:(this["stroke-width"]?parseInt(this["stroke-width"],10):0)%2/2},l.prototype.heightSetter=function(t){this.heightSetting=t},l.prototype.on=function(e,i){var n=this,r=n.text,o=r&&"SPAN"===r.element.tagName?r:void 0;if(o){var s=function(t){("mouseenter"===e||"mouseleave"===e)&&t.relatedTarget instanceof Element&&(n.element.contains(t.relatedTarget)||o.element.contains(t.relatedTarget))||i.call(n.element,t)};o.on(e,s)}return t.prototype.on.call(n,e,s||i),n},l.prototype.onAdd=function(){var t=this.textStr;this.text.add(this),this.attr({text:n(t)?t:"",x:this.x,y:this.y}),this.box&&n(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})},l.prototype.paddingSetter=function(t){n(t)&&t!==this.padding&&(this.padding=t,this.updateTextPadding())},l.prototype.paddingLeftSetter=function(t){n(t)&&t!==this.paddingLeft&&(this.paddingLeft=t,this.updateTextPadding())},l.prototype.rSetter=function(t,e){this.boxAttr(e,t)},l.prototype.shadow=function(t){return t&&!this.renderer.styledMode&&(this.updateBoxSize(),this.box&&this.box.shadow(t)),this},l.prototype.strokeSetter=function(t,e){this.stroke=t,this.boxAttr(e,t)},l.prototype["stroke-widthSetter"]=function(t,e){t&&(this.needsBox=!0),this["stroke-width"]=t,this.boxAttr(e,t)},l.prototype["text-alignSetter"]=function(t){this.textAlign=t},l.prototype.textSetter=function(t){"undefined"!==typeof t&&this.text.attr({text:t}),this.updateBoxSize(),this.updateTextPadding()},l.prototype.updateBoxSize=function(){var t=this.text.element.style,e={},i=this.padding,s=this.paddingLeft,a=o(this.widthSetting)&&o(this.heightSetting)&&!this.textAlign||!n(this.text.textStr)?l.emptyBBox:this.text.getBBox();this.width=(this.widthSetting||a.width||0)+2*i+s,this.height=(this.heightSetting||a.height||0)+2*i,this.baselineOffset=i+Math.min(this.renderer.fontMetrics(t&&t.fontSize,this.text).b,a.height||1/0),this.needsBox&&(this.box||(t=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect(),t.addClass(("button"===this.className?"":"highcharts-label-box")+(this.className?" highcharts-"+this.className+"-box":"")),t.add(this),t=this.getCrispAdjust(),e.x=t,e.y=(this.baseline?-this.baselineOffset:0)+t),e.width=Math.round(this.width),e.height=Math.round(this.height),this.box.attr(r(e,this.deferredAttr)),this.deferredAttr={}),this.bBox=a},l.prototype.updateTextPadding=function(){var t=this.text,e=this.baseline?0:this.baselineOffset,i=this.paddingLeft+this.padding;n(this.widthSetting)&&this.bBox&&("center"===this.textAlign||"right"===this.textAlign)&&(i+={center:.5,right:1}[this.textAlign]*(this.widthSetting-this.bBox.width)),i===t.x&&e===t.y||(t.attr("x",i),t.hasBoxWidthChanged&&(this.bBox=t.getBBox(!0),this.updateBoxSize()),"undefined"!==typeof e&&t.attr("y",e)),t.x=i,t.y=e},l.prototype.widthSetter=function(t){this.widthSetting=o(t)?t:void 0},l.prototype.xSetter=function(t){this.x=t,this.alignFactor&&(t-=this.alignFactor*((this.widthSetting||this.bBox.width)+2*this.padding),this["forceAnimate:x"]=!0),this.xSetting=Math.round(t),this.attr("translateX",this.xSetting)},l.prototype.ySetter=function(t){this.ySetting=this.y=Math.round(t),this.attr("translateY",this.ySetting)},l.emptyBBox={width:0,height:0,x:0,y:0},l.textProps="color cursor direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow width".split(" "),l}(t)})),e(i,"Core/Renderer/SVG/SVGRenderer.js",[i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Renderer/SVG/SVGLabel.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r){var o=r.addEvent,s=r.attr,a=r.createElement,l=r.css,c=r.defined,h=r.destroyObjectProperties,u=r.extend,d=r.isArray,p=r.isNumber,f=r.isObject,m=r.isString,g=r.merge,y=r.objectEach,v=r.pick,x=r.pInt,b=r.splat,w=r.uniqueKey,M=e.charts,_=e.deg2rad,S=e.doc,T=e.isFirefox,E=e.isMS,A=e.isWebKit;r=e.noop;var L=e.svg,C=e.SVG_NS,P=e.symbolSizes,O=e.win,R=function(){function e(t,e,i,n,r,o,s){this.width=this.url=this.style=this.isSVG=this.imgCount=this.height=this.gradients=this.globalAnimation=this.defs=this.chartIndex=this.cacheKeys=this.cache=this.boxWrapper=this.box=this.alignedObjects=void 0,this.init(t,e,i,n,r,o,s)}return e.prototype.init=function(t,e,i,n,r,a,c){var h,u=this.createElement("svg").attr({version:"1.1",class:"highcharts-root"});c||u.css(this.getStyle(n)),n=u.element,t.appendChild(n),s(t,"dir","ltr"),-1===t.innerHTML.indexOf("xmlns")&&s(n,"xmlns",this.SVG_NS),this.isSVG=!0,this.box=n,this.boxWrapper=u,this.alignedObjects=[],this.url=(T||A)&&S.getElementsByTagName("base").length?O.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"",this.createElement("desc").add().element.appendChild(S.createTextNode("Created with Highcharts 8.2.2")),this.defs=this.createElement("defs").add(),this.allowHTML=a,this.forExport=r,this.styledMode=c,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.setSize(e,i,!1),T&&t.getBoundingClientRect&&(e=function(){l(t,{left:0,top:0}),h=t.getBoundingClientRect(),l(t,{left:Math.ceil(h.left)-h.left+"px",top:Math.ceil(h.top)-h.top+"px"})},e(),this.unSubPixelFix=o(O,"resize",e))},e.prototype.definition=function(t){function e(t,n){var r;return b(t).forEach((function(t){var o=i.createElement(t.tagName),s={};y(t,(function(t,e){"tagName"!==e&&"children"!==e&&"textContent"!==e&&(s[e]=t)})),o.attr(s),o.add(n||i.defs),t.textContent&&o.element.appendChild(S.createTextNode(t.textContent)),e(t.children||[],o),r=o})),r}var i=this;return e(t)},e.prototype.getStyle=function(t){return this.style=u({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},t)},e.prototype.setStyle=function(t){this.boxWrapper.css(this.getStyle(t))},e.prototype.isHidden=function(){return!this.boxWrapper.getBBox().width},e.prototype.destroy=function(){var t=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),h(this.gradients||{}),this.gradients=null,t&&(this.defs=t.destroy()),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null},e.prototype.createElement=function(t){var e=new this.Element;return e.init(this,t),e},e.prototype.getRadialAttr=function(t,e){return{cx:t[0]-t[2]/2+e.cx*t[2],cy:t[1]-t[2]/2+e.cy*t[2],r:e.r*t[2]}},e.prototype.truncate=function(t,e,i,n,r,o,s){var a,l,c=this,h=t.rotation,u=n?1:0,d=(i||n).length,p=d,f=[],m=function(t){e.firstChild&&e.removeChild(e.firstChild),t&&e.appendChild(S.createTextNode(t))},g=function(o,a){if(a=a||o,"undefined"===typeof f[a])if(e.getSubStringLength)try{f[a]=r+e.getSubStringLength(0,n?a+1:a)}catch(l){}else c.getSpanWidth&&(m(s(i||n,o)),f[a]=r+c.getSpanWidth(t,e));return f[a]};t.rotation=0;var y=g(e.textContent.length);if(l=r+y>o){for(;u<=d;)p=Math.ceil((u+d)/2),n&&(a=s(n,p)),y=g(p,a&&a.length-1),u===d?u=d+1:y>o?d=p-1:u=p;0===d?m(""):i&&d===i.length-1||m(a||s(i||n,p))}return n&&n.splice(0,p),t.actualWidth=y,t.rotation=h,l},e.prototype.buildText=function(t){var e,i,n=t.element,r=this,o=r.forExport,a=v(t.textStr,"").toString(),c=-1!==a.indexOf("<"),h=n.childNodes,u=s(n,"x"),d=t.styles,p=t.textWidth,f=d&&d.lineHeight,g=d&&d.textOutline,b=d&&"ellipsis"===d.textOverflow,w=d&&"nowrap"===d.whiteSpace,M=d&&d.fontSize,_=h.length;d=p&&!t.added&&this.box;var T=function(t){var e;return r.styledMode||(e=/(px|em)$/.test(t&&t.style.fontSize)?t.style.fontSize:M||r.style.fontSize||12),f?x(f):r.fontMetrics(e,t.getAttribute("style")?t:n).h},E=function(t,e){return y(r.escapes,(function(i,n){e&&-1!==e.indexOf(i)||(t=t.toString().replace(new RegExp(i,"g"),n))})),t},A=function(t,e){var i=t.indexOf("<");if(t=t.substring(i,t.indexOf(">")-i),i=t.indexOf(e+"="),-1!==i&&(i=i+e.length+1,e=t.charAt(i),'"'===e||"'"===e))return t=t.substring(i+1),t.substring(0,t.indexOf(e))},P=//g,O=[a,b,w,f,g,M,p].join();if(O!==t.textCache){for(t.textCache=O;_--;)n.removeChild(h[_]);c||g||b||p||-1!==a.indexOf(" ")&&(!w||P.test(a))?(d&&d.appendChild(n),c?(a=r.styledMode?a.replace(/<(b|strong)>/g,'').replace(/<(i|em)>/g,''):a.replace(/<(b|strong)>/g,'').replace(/<(i|em)>/g,''),a=a.replace(//g,"").split(P)):a=[a],a=a.filter((function(t){return""!==t})),a.forEach((function(a,c){var h=0,d=0;a=a.replace(/^\s+|\s+$/g,"").replace(//g,"|||");var f=a.split("|||");f.forEach((function(a){if(""!==a||1===f.length){var m,g,y={},v=S.createElementNS(r.SVG_NS,"tspan");if((m=A(a,"class"))&&s(v,"class",m),(m=A(a,"style"))&&(m=m.replace(/(;| |^)color([ :])/,"$1fill$2"),s(v,"style",m)),(g=A(a,"href"))&&!o&&-1===g.split(":")[0].toLowerCase().indexOf("javascript")){var x=S.createElementNS(r.SVG_NS,"a");s(x,"href",g),s(v,"class","highcharts-anchor"),x.appendChild(v),r.styledMode||l(v,{cursor:"pointer"})}if(a=E(a.replace(/<[a-zA-Z\/](.|\n)*?>/g,"")||" ")," "!==a){if(v.appendChild(S.createTextNode(a)),h?y.dx=0:c&&null!==u&&(y.x=u),s(v,y),n.appendChild(x||v),!h&&i&&(!L&&o&&l(v,{display:"block"}),s(v,"dy",T(v))),p){var _=a.replace(/([^\^])-/g,"$1- ").split(" ");if(y=!w&&(1t?t+3:Math.round(1.2*t),{h:e,b:Math.round(.8*e),f:t}},e.prototype.rotCorr=function(t,e,i){var n=t;return e&&i&&(n=Math.max(n*Math.cos(e*_),4)),{x:-t/3*Math.sin(e*_),y:n}},e.prototype.pathToSegments=function(t){for(var e=[],i=[],n={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2},r=0;r":">","'":"'",'"':"""},R.prototype.symbols={circle:function(t,e,i,n){return this.arc(t+i/2,e+n/2,i/2,n/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},square:function(t,e,i,n){return[["M",t,e],["L",t+i,e],["L",t+i,e+n],["L",t,e+n],["Z"]]},triangle:function(t,e,i,n){return[["M",t+i/2,e],["L",t+i,e+n],["L",t,e+n],["Z"]]},"triangle-down":function(t,e,i,n){return[["M",t,e],["L",t+i,e],["L",t+i/2,e+n],["Z"]]},diamond:function(t,e,i,n){return[["M",t+i/2,e],["L",t+i,e+n/2],["L",t+i/2,e+n],["L",t,e+n/2],["Z"]]},arc:function(t,e,i,n,r){var o=[];if(r){var s=r.start||0,a=r.end||0,l=r.r||i;i=r.r||n||i;var h=.001>Math.abs(a-s-2*Math.PI);a-=.001,n=r.innerR,h=v(r.open,h);var u=Math.cos(s),d=Math.sin(s),p=Math.cos(a),f=Math.sin(a);s=v(r.longArc,.001>a-s-Math.PI?0:1),o.push(["M",t+l*u,e+i*d],["A",l,i,0,s,v(r.clockwise,1),t+l*p,e+i*f]),c(n)&&o.push(h?["M",t+n*p,e+n*f]:["L",t+n*p,e+n*f],["A",n,n,0,s,c(r.clockwise)?1-r.clockwise:0,t+n*u,e+n*d]),h||o.push(["Z"])}return o},callout:function(t,e,i,n,r){var o=Math.min(r&&r.r||0,i,n),s=o+6,a=r&&r.anchorX||0;r=r&&r.anchorY||0;var l=[["M",t+o,e],["L",t+i-o,e],["C",t+i,e,t+i,e,t+i,e+o],["L",t+i,e+n-o],["C",t+i,e+n,t+i,e+n,t+i-o,e+n],["L",t+o,e+n],["C",t,e+n,t,e+n,t,e+n-o],["L",t,e+o],["C",t,e,t,e,t+o,e]];return a&&a>i?r>e+s&&ra?r>e+s&&rn&&a>t+s&&ar&&a>t+s&&athis.oldTextWidth)&&((p=this.textPxLength)||(n(e,{width:"",whiteSpace:d||"nowrap"}),p=e.offsetWidth),p=p>f),p&&(/[ \-]/.test(e.textContent||e.innerText)||"ellipsis"===e.style.textOverflow)?(n(e,{width:f+"px",display:"block",whiteSpace:d||"normal"}),this.oldTextWidth=f,this.hasBoxWidthChanged=!0):this.hasBoxWidthChanged=!1,m!==this.cTT&&(d=t.fontMetrics(e.style.fontSize,e).b,!r(u)||u===(this.oldRotation||0)&&c===this.oldAlign||this.setSpanRotation(u,h,d),this.getSpanCorrection(!r(u)&&this.textPxLength||e.offsetWidth,d,h,u,c)),n(e,{left:s+(this.xCorr||0)+"px",top:l+(this.yCorr||0)+"px"}),this.cTT=m,this.oldRotation=u,this.oldAlign=c}}else this.alignOnAdd=!0},setSpanRotation:function(t,e,i){var r={},o=this.renderer.getTransformKey();r[o]=r.transform="rotate("+t+"deg)",r[o+(l?"Origin":"-origin")]=r.transformOrigin=100*e+"% "+i+"px",n(this.element,r)},getSpanCorrection:function(t,e,i){this.xCorr=-t*i,this.yCorr=-e}}),e})),e(i,"Core/Renderer/HTML/HTMLRenderer.js",[i["Core/Globals.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Renderer/SVG/SVGRenderer.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.isFirefox,o=t.isMS,s=t.isWebKit,a=t.win,l=n.attr,c=n.createElement,h=n.extend,u=n.pick;return h(i.prototype,{getTransformKey:function(){return o&&!/Edge/.test(a.navigator.userAgent)?"-ms-transform":s?"-webkit-transform":r?"MozTransform":a.opera?"-o-transform":""},html:function(t,i,n){var r=this.createElement("span"),o=r.element,s=r.renderer,a=s.isSVG,d=function(t,i){["opacity","visibility"].forEach((function(n){t[n+"Setter"]=function(r,o,s){var a=t.div?t.div.style:i;e.prototype[n+"Setter"].call(this,r,o,s),a&&(a[o]=r)}})),t.addedSetters=!0};return r.textSetter=function(t){t!==o.innerHTML&&(delete this.bBox,delete this.oldTextWidth),this.textStr=t,o.innerHTML=u(t,""),r.doTransform=!0},a&&d(r,r.element.style),r.xSetter=r.ySetter=r.alignSetter=r.rotationSetter=function(t,e){"align"===e?r.alignValue=r.textAlign=t:r[e]=t,r.doTransform=!0},r.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)},r.attr({text:t,x:Math.round(i),y:Math.round(n)}).css({position:"absolute"}),s.styledMode||r.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),o.style.whiteSpace="nowrap",r.css=r.htmlCss,a&&(r.add=function(t){var e=s.box.parentNode,i=[];if(this.parentGroup=t){var n=t.div;if(!n){for(;t;)i.push(t),t=t.parentGroup;i.reverse().forEach((function(t){function o(e,i){t[i]=e,"translateX"===i?a.left=e+"px":a.top=e+"px",t.doTransform=!0}var s=l(t.element,"class");n=t.div=t.div||c("div",s?{className:s}:void 0,{position:"absolute",left:(t.translateX||0)+"px",top:(t.translateY||0)+"px",display:t.display,opacity:t.opacity,pointerEvents:t.styles&&t.styles.pointerEvents},n||e);var a=n.style;h(t,{classSetter:function(t){return function(e){this.element.setAttribute("class",e),t.className=e}}(n),on:function(){return i[0].div&&r.on.apply({element:i[0].div},arguments),t},translateXSetter:o,translateYSetter:o}),t.addedSetters||d(t)}))}}else n=e;return n.appendChild(o),r.added=!0,r.alignOnAdd&&r.htmlUpdateTransform(),r}),r}}),i})),e(i,"Core/Axis/Tick.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.clamp,n=e.correctFloat,r=e.defined,o=e.destroyObjectProperties,s=e.extend,a=e.fireEvent,l=e.isNumber,c=e.merge,h=e.objectEach,u=e.pick,d=t.deg2rad;return e=function(){function t(t,e,i,n,r){this.isNewLabel=this.isNew=!0,this.axis=t,this.pos=e,this.type=i||"",this.parameters=r||{},this.tickmarkOffset=this.parameters.tickmarkOffset,this.options=this.parameters.options,a(this,"init"),i||n||this.addLabel()}return t.prototype.addLabel=function(){var t=this,e=t.axis,i=e.options,o=e.chart,a=e.categories,l=e.logarithmic,c=e.names,h=t.pos,d=u(t.options&&t.options.labels,i.labels),p=e.tickPositions,f=h===p[0],m=h===p[p.length-1];c=this.parameters.category||(a?u(a[h],c[h],h):h);var g,y,v=t.label;if(a=(!d.step||1===d.step)&&1===e.tickInterval,p=p.info,e.dateTime&&p)var x=o.time.resolveDTLFormat(i.dateTimeLabelFormats[!i.grid&&p.higherRanks[h]||p.unitName]),b=x.main;t.isFirst=f,t.isLast=m,t.formatCtx={axis:e,chart:o,isFirst:f,isLast:m,dateTimeLabelFormat:b,tickPositionInfo:p,value:l?n(l.lin2log(c)):c,pos:h},i=e.labelFormatter.call(t.formatCtx,this.formatCtx),(y=x&&x.list)&&(t.shortenLabel=function(){for(g=0;gc&&n-h*po&&(a=Math.round((r-n)/Math.cos(c*d))):(r=n+(1-h)*p,n-h*po&&(m=o-t.x+m*h,g=-1),m=Math.min(f,m),mm||e.autoRotation&&(l.styles||{}).width)&&(a=m)),a&&(this.shortenLabel?this.shortenLabel():(y.width=Math.floor(a)+"px",(i.style||{}).textOverflow||(y.textOverflow="ellipsis"),l.css(y)))},t.prototype.moveLabel=function(t,e){var i=this,n=i.label,r=!1,o=i.axis,s=o.reversed;if(n&&n.textStr===t?(i.movedLabel=n,r=!0,delete i.label):h(o.ticks,(function(e){r||e.isNew||e===i||!e.label||e.label.textStr!==t||(i.movedLabel=e.label,r=!0,e.labelPos=i.movedLabel.xy,delete e.label)})),!r&&(i.labelPos||n)){var a=i.labelPos||n.xy;n=o.horiz?s?0:o.width+o.left:a.x,o=o.horiz?a.y:s?o.width+o.left:0,i.movedLabel=i.createLabel({x:n,y:o},t,e),i.movedLabel&&i.movedLabel.attr({opacity:0})}},t.prototype.render=function(t,e,i){var n=this.axis,r=n.horiz,o=this.pos,s=u(this.tickmarkOffset,n.tickmarkOffset);o=this.getPosition(r,o,s,e),s=o.x;var l=o.y;n=r&&s===n.pos+n.len||!r&&l===n.pos?-1:1,i=u(i,1),this.isActive=!0,this.renderGridLine(e,i,n),this.renderMark(o,i,n),this.renderLabel(o,e,i,t),this.isNew=!1,a(this,"afterRender")},t.prototype.renderGridLine=function(t,e,i){var n=this.axis,r=n.options,o=this.gridLine,s={},a=this.pos,l=this.type,c=u(this.tickmarkOffset,n.tickmarkOffset),h=n.chart.renderer,d=l?l+"Grid":"grid",p=r[d+"LineWidth"],f=r[d+"LineColor"];r=r[d+"LineDashStyle"],o||(n.chart.styledMode||(s.stroke=f,s["stroke-width"]=p,r&&(s.dashstyle=r)),l||(s.zIndex=1),t&&(e=0),this.gridLine=o=h.path().attr(s).addClass("highcharts-"+(l?l+"-":"")+"grid-line").add(n.gridGroup)),o&&(i=n.getPlotLinePath({value:a+c,lineWidth:o.strokeWidth()*i,force:"pass",old:t}))&&o[t||this.isNew?"attr":"animate"]({d:i,opacity:e})},t.prototype.renderMark=function(t,e,i){var n=this.axis,r=n.options,o=n.chart.renderer,s=this.type,a=s?s+"Tick":"tick",l=n.tickSize(a),c=this.mark,h=!c,d=t.x;t=t.y;var p=u(r[a+"Width"],!s&&n.isXAxis?1:0);r=r[a+"Color"],l&&(n.opposite&&(l[0]=-l[0]),h&&(this.mark=c=o.path().addClass("highcharts-"+(s?s+"-":"")+"tick").add(n.axisGroup),n.chart.styledMode||c.attr({stroke:r,"stroke-width":p})),c[h?"attr":"animate"]({d:this.getMarkPath(d,t,l[0],c.strokeWidth()*i,n.horiz,o),opacity:e}))},t.prototype.renderLabel=function(t,e,i,n){var r=this.axis,o=r.horiz,s=r.options,a=this.label,c=s.labels,h=c.step;r=u(this.tickmarkOffset,r.tickmarkOffset);var d=!0,p=t.x;t=t.y,a&&l(p)&&(a.xy=t=this.getLabelPosition(p,t,a,o,c,r,n,h),this.isFirst&&!this.isLast&&!u(s.showFirstLabel,1)||this.isLast&&!this.isFirst&&!u(s.showLastLabel,1)?d=!1:!o||c.step||c.rotation||e||0===i||this.handleOverflow(t),h&&n%h&&(d=!1),d&&l(t.y)?(t.opacity=i,a[this.isNewLabel?"attr":"animate"](t),this.isNewLabel=!1):(a.attr("y",-9999),this.isNewLabel=!0))},t.prototype.replaceMovedLabel=function(){var t=this.label,e=this.axis,i=e.reversed;if(t&&!this.isNew){var n=e.horiz?i?e.left:e.width+e.left:t.xy.x;i=e.horiz?t.xy.y:i?e.width+e.top:e.top,t.animate({x:n,y:i,opacity:0},void 0,t.destroy),delete this.label}e.isDirty=!0,this.label=this.movedLabel,delete this.movedLabel},t}(),t.Tick=e,t.Tick})),e(i,"Core/Time.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.defined,n=e.error,r=e.extend,o=e.isObject,s=e.merge,a=e.objectEach,l=e.pad,c=e.pick,h=e.splat,u=e.timeUnits,d=t.win;return e=function(){function e(t){this.options={},this.variableTimezone=this.useUTC=!1,this.Date=d.Date,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.update(t)}return e.prototype.get=function(t,e){if(this.variableTimezone||this.timezoneOffset){var i=e.getTime(),n=i-this.getTimezoneOffset(e);return e.setTime(n),t=e["getUTC"+t](),e.setTime(i),t}return this.useUTC?e["getUTC"+t]():e["get"+t]()},e.prototype.set=function(t,e,i){if(this.variableTimezone||this.timezoneOffset){if("Milliseconds"===t||"Seconds"===t||"Minutes"===t)return e["setUTC"+t](i);var n=this.getTimezoneOffset(e);return n=e.getTime()-n,e.setTime(n),e["setUTC"+t](i),t=this.getTimezoneOffset(e),n=e.getTime()+t,e.setTime(n)}return this.useUTC?e["setUTC"+t](i):e["set"+t](i)},e.prototype.update=function(t){var e=c(t&&t.useUTC,!0);this.options=t=s(!0,this.options||{},t),this.Date=t.Date||d.Date||Date,this.timezoneOffset=(this.useUTC=e)&&t.timezoneOffset,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.variableTimezone=!(e&&!t.getTimezoneOffset&&!t.timezone)},e.prototype.makeTime=function(e,i,n,r,o,s){if(this.useUTC){var a=this.Date.UTC.apply(0,arguments),l=this.getTimezoneOffset(a);a+=l;var h=this.getTimezoneOffset(a);l!==h?a+=h-l:l-36e5!==this.getTimezoneOffset(a-36e5)||t.isSafari||(a-=36e5)}else a=new this.Date(e,i,c(n,1),c(r,0),c(o,0),c(s,0)).getTime();return a},e.prototype.timezoneOffsetFunction=function(){var t=this,e=this.options,i=e.moment||d.moment;if(!this.useUTC)return function(t){return 6e4*new Date(t.toString()).getTimezoneOffset()};if(e.timezone){if(i)return function(t){return 6e4*-i.tz(t,e.timezone).utcOffset()};n(25)}return this.useUTC&&e.getTimezoneOffset?function(t){return 6e4*e.getTimezoneOffset(t.valueOf())}:function(){return 6e4*(t.timezoneOffset||0)}},e.prototype.dateFormat=function(e,n,o){var s;if(!i(n)||isNaN(n))return(null===(s=t.defaultOptions.lang)||void 0===s?void 0:s.invalidDate)||"";e=c(e,"%Y-%m-%d %H:%M:%S");var h=this;s=new this.Date(n);var u=this.get("Hours",s),d=this.get("Day",s),p=this.get("Date",s),f=this.get("Month",s),m=this.get("FullYear",s),g=t.defaultOptions.lang,y=null===g||void 0===g?void 0:g.weekdays,v=null===g||void 0===g?void 0:g.shortWeekdays;return s=r({a:v?v[d]:y[d].substr(0,3),A:y[d],d:l(p),e:l(p,2," "),w:d,b:g.shortMonths[f],B:g.months[f],m:l(f+1),o:f+1,y:m.toString().substr(2,2),Y:m,H:l(u),k:u,I:l(u%12||12),l:u%12||12,M:l(this.get("Minutes",s)),p:12>u?"AM":"PM",P:12>u?"am":"pm",S:l(s.getSeconds()),L:l(Math.floor(n%1e3),3)},t.dateFormats),a(s,(function(t,i){for(;-1!==e.indexOf("%"+i);)e=e.replace("%"+i,"function"===typeof t?t.call(h,n):t)})),o?e.substr(0,1).toUpperCase()+e.substr(1):e},e.prototype.resolveDTLFormat=function(t){return o(t,!0)?t:(t=h(t),{main:t[0],from:t[1],to:t[2]})},e.prototype.getTimeTicks=function(t,e,n,o){var s,a=this,l=[],h={},d=new a.Date(e),p=t.unitRange,f=t.count||1;if(o=c(o,1),i(e)){if(a.set("Milliseconds",d,p>=u.second?0:f*Math.floor(a.get("Milliseconds",d)/f)),p>=u.second&&a.set("Seconds",d,p>=u.minute?0:f*Math.floor(a.get("Seconds",d)/f)),p>=u.minute&&a.set("Minutes",d,p>=u.hour?0:f*Math.floor(a.get("Minutes",d)/f)),p>=u.hour&&a.set("Hours",d,p>=u.day?0:f*Math.floor(a.get("Hours",d)/f)),p>=u.day&&a.set("Date",d,p>=u.month?1:Math.max(1,f*Math.floor(a.get("Date",d)/f))),p>=u.month){a.set("Month",d,p>=u.year?0:f*Math.floor(a.get("Month",d)/f));var m=a.get("FullYear",d)}p>=u.year&&a.set("FullYear",d,m-m%f),p===u.week&&(m=a.get("Day",d),a.set("Date",d,a.get("Date",d)-m+o+(m4*u.month||a.getTimezoneOffset(e)!==a.getTimezoneOffset(n)),e=d.getTime(),d=1;el.length&&l.forEach((function(t){0===t%18e5&&"000000000"===a.dateFormat("%H%M%S%L",t)&&(h[t]="day")}))}return l.info=r(t,{higherRanks:h,totalRange:p*f}),l},e}(),t.Time=e,t.Time})),e(i,"Core/Options.js",[i["Core/Globals.js"],i["Core/Color/Color.js"],i["Core/Time.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.isTouchDevice,o=t.svg;return e=e.parse,n=n.merge,t.defaultOptions={colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:{styledMode:!1,borderRadius:0,colorCount:10,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}},width:null,height:null,borderColor:"#335cad",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"},title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:o,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",padding:8,snap:r?25:10,headerFormat:'{point.key}
',pointFormat:' {series.name}: {point.y}
',backgroundColor:e("#f7f7f7").setOpacity(.85).get(),borderWidth:1,shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}},t.time=new i(n(t.defaultOptions.global,t.defaultOptions.time)),t.dateFormat=function(e,i,n){return t.time.dateFormat(e,i,n)},{dateFormat:t.dateFormat,defaultOptions:t.defaultOptions,time:t.time}})),e(i,"Core/Axis/Axis.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Axis/Tick.js"],i["Core/Utilities.js"],i["Core/Options.js"]],(function(t,e,i,n,r,o){var s=t.animObject,a=r.addEvent,l=r.arrayMax,c=r.arrayMin,h=r.clamp,u=r.correctFloat,d=r.defined,p=r.destroyObjectProperties,f=r.error,m=r.extend,g=r.fireEvent,y=r.format,v=r.getMagnitude,x=r.isArray,b=r.isFunction,w=r.isNumber,M=r.isString,_=r.merge,S=r.normalizeTickInterval,T=r.objectEach,E=r.pick,A=r.relativeLength,L=r.removeEvent,C=r.splat,P=r.syncTimeout,O=o.defaultOptions,R=i.deg2rad;return t=function(){function t(t,e){this.zoomEnabled=this.width=this.visible=this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups=this.plotLinesAndBands=this.paddedTicks=this.overlap=this.options=this.oldMin=this.oldMax=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len=this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.height=this.hasVisibleSeries=this.hasNames=this.coll=this.closestPointRange=this.chart=this.categories=this.bottom=this.alternateBands=void 0,this.init(t,e)}return t.prototype.init=function(t,e){var i=e.isX,n=this;n.chart=t,n.horiz=t.inverted&&!n.isZAxis?!i:i,n.isXAxis=i,n.coll=n.coll||(i?"xAxis":"yAxis"),g(this,"init",{userOptions:e}),n.opposite=e.opposite,n.side=e.side||(n.horiz?n.opposite?0:2:n.opposite?1:3),n.setOptions(e);var r=this.options,o=r.type;n.labelFormatter=r.labels.formatter||n.defaultLabelFormatter,n.userOptions=e,n.minPixelPadding=0,n.reversed=r.reversed,n.visible=!1!==r.visible,n.zoomEnabled=!1!==r.zoomEnabled,n.hasNames="category"===o||!0===r.categories,n.categories=r.categories||n.hasNames,n.names||(n.names=[],n.names.keys={}),n.plotLinesAndBandsGroups={},n.positiveValuesOnly=!!n.logarithmic,n.isLinked=d(r.linkedTo),n.ticks={},n.labelEdge=[],n.minorTicks={},n.plotLinesAndBands=[],n.alternateBands={},n.len=0,n.minRange=n.userMinRange=r.minRange||r.maxZoom,n.range=r.range,n.offset=r.offset||0,n.max=null,n.min=null,n.crosshair=E(r.crosshair,C(t.options.tooltip.crosshairs)[i?0:1],!1),e=n.options.events,-1===t.axes.indexOf(n)&&(i?t.axes.splice(t.xAxis.length,0,n):t.axes.push(n),t[n.coll].push(n)),n.series=n.series||[],t.inverted&&!n.isZAxis&&i&&"undefined"===typeof n.reversed&&(n.reversed=!0),n.labelRotation=n.options.labels.rotation,T(e,(function(t,e){b(t)&&a(n,e,t)})),g(this,"afterInit")},t.prototype.setOptions=function(e){this.options=_(t.defaultOptions,"yAxis"===this.coll&&t.defaultYAxisOptions,[t.defaultTopAxisOptions,t.defaultRightAxisOptions,t.defaultBottomAxisOptions,t.defaultLeftAxisOptions][this.side],_(O[this.coll],e)),g(this,"afterSetOptions",{userOptions:e})},t.prototype.defaultLabelFormatter=function(){var t=this.axis,e=w(this.value)?this.value:NaN,i=t.chart.time,n=t.categories,r=this.dateTimeLabelFormat,o=O.lang,s=o.numericSymbols;o=o.numericSymbolMagnitude||1e3;var a=s&&s.length,l=t.options.labels.format;t=t.logarithmic?Math.abs(e):t.tickInterval;var c=this.chart,h=c.numberFormatter;if(l)var u=y(l,this,c);else if(n)u=""+this.value;else if(r)u=i.dateFormat(r,e);else if(a&&1e3<=t)for(;a--&&"undefined"===typeof u;)i=Math.pow(o,a+1),t>=i&&0===10*e%i&&null!==s[a]&&0!==e&&(u=h(e/i,-1)+s[a]);return"undefined"===typeof u&&(u=1e4<=Math.abs(e)?h(e,-1):h(e,-1,void 0,"")),u},t.prototype.getSeriesExtremes=function(){var t,e=this,i=e.chart;g(this,"getSeriesExtremes",null,(function(){e.hasVisibleSeries=!1,e.dataMin=e.dataMax=e.threshold=null,e.softThreshold=!e.isXAxis,e.stacking&&e.stacking.buildStacks(),e.series.forEach((function(n){if(n.visible||!i.options.chart.ignoreHiddenSeries){var r=n.options,o=r.threshold;if(e.hasVisibleSeries=!0,e.positiveValuesOnly&&0>=o&&(o=null),e.isXAxis){if(r=n.xData,r.length){r=e.logarithmic?r.filter(e.validatePositiveValue):r,t=n.getXExtremes(r);var s=t.min,a=t.max;w(s)||s instanceof Date||(r=r.filter(w),t=n.getXExtremes(r),s=t.min,a=t.max),r.length&&(e.dataMin=Math.min(E(e.dataMin,s),s),e.dataMax=Math.max(E(e.dataMax,a),a))}}else n=n.applyExtremes(),w(n.dataMin)&&(s=n.dataMin,e.dataMin=Math.min(E(e.dataMin,s),s)),w(n.dataMax)&&(a=n.dataMax,e.dataMax=Math.max(E(e.dataMax,a),a)),d(o)&&(e.threshold=o),(!r.softThreshold||e.positiveValuesOnly)&&(e.softThreshold=!1)}}))})),g(this,"afterGetSeriesExtremes")},t.prototype.translate=function(t,e,i,n,r,o){var s=this.linkedParent||this,a=1,l=0,c=n?s.oldTransA:s.transA;n=n?s.oldMin:s.min;var h=s.minPixelPadding;return r=(s.isOrdinal||s.brokenAxis&&s.brokenAxis.hasBreaks||s.logarithmic&&r)&&s.lin2val,c||(c=s.transA),i&&(a*=-1,l=s.len),s.reversed&&(a*=-1,l-=a*(s.sector||s.len)),e?(t=(t*a+l-h)/c+n,r&&(t=s.lin2val(t))):(r&&(t=s.val2lin(t)),t=w(n)?a*(t-n)*c+l+a*h+(w(o)?c*o:0):void 0),t},t.prototype.toPixels=function(t,e){return this.translate(t,!1,!this.horiz,null,!0)+(e?0:this.pos)},t.prototype.toValue=function(t,e){return this.translate(t-(e?0:this.pos),!0,!this.horiz,null,!0)},t.prototype.getPlotLinePath=function(t){function e(t,e,i){return("pass"!==y&&ti)&&(y?t=h(t,e,i):s=!0),t}var i,n,r,o,s,a=this,l=a.chart,c=a.left,u=a.top,d=t.old,p=t.value,f=t.translatedValue,m=t.lineWidth,y=t.force,v=d&&l.oldChartHeight||l.chartHeight,x=d&&l.oldChartWidth||l.chartWidth,b=a.transB;return t={value:p,lineWidth:m,old:d,force:y,acrossPanes:t.acrossPanes,translatedValue:f},g(this,"getPlotLinePath",t,(function(t){f=E(f,a.translate(p,null,null,d)),f=h(f,-1e5,1e5),i=r=Math.round(f+b),n=o=Math.round(v-f-b),w(f)?a.horiz?(n=u,o=v-a.bottom,i=r=e(i,c,c+a.width)):(i=c,r=x-a.right,n=o=e(n,u,u+a.height)):(s=!0,y=!1),t.path=s&&!y?null:l.renderer.crispLine([["M",i,n],["L",r,o]],m||1)})),t.path},t.prototype.getLinearTickPositions=function(t,e,i){var n=u(Math.floor(e/t)*t);i=u(Math.ceil(i/t)*t);var r,o=[];if(u(n+t)===n&&(r=20),this.single)return[e];for(e=n;e<=i;){if(o.push(e),e=u(e+t,r),e===s)break;var s=e}return o},t.prototype.getMinorTickInterval=function(){var t=this.options;return!0===t.minorTicks?E(t.minorTickInterval,"auto"):!1===t.minorTicks?null:t.minorTickInterval},t.prototype.getMinorTickPositions=function(){var t=this.options,e=this.tickPositions,i=this.minorTickInterval,n=[],r=this.pointRangePadding||0,o=this.min-r;r=this.max+r;var s=r-o;if(s&&s/i=this.minRange,u=this.minRange,p=(u-s+o)/2;p=[o-p,E(r.min,o-p)],h&&(p[2]=this.logarithmic?this.logarithmic.log2lin(this.dataMin):this.dataMin),o=l(p),s=[o+u,E(r.max,o+u)],h&&(s[2]=a?a.log2lin(this.dataMax):this.dataMax),s=c(s),s-o=m)M=m,l=0;else if(e.dataMax<=m){var _=m;a=0}e.min=E(x,M,e.dataMin),e.max=E(b,_,e.dataMax)}n&&(e.positiveValuesOnly&&!t&&0>=Math.min(e.min,E(e.dataMin,e.min))&&f(10,1,i),e.min=u(n.log2lin(e.min),16),e.max=u(n.log2lin(e.max),16)),e.range&&d(e.max)&&(e.userMin=e.min=x=Math.max(e.dataMin,e.minFromRange()),e.userMax=b=e.max,e.range=null),g(e,"foundExtremes"),e.beforePadding&&e.beforePadding(),e.adjustForMinRange(),!(p||e.axisPointRange||e.stacking&&e.stacking.usePercentage||s)&&d(e.min)&&d(e.max)&&(i=e.max-e.min)&&(!d(x)&&l&&(e.min-=i*l),!d(b)&&a&&(e.max+=i*a)),w(e.userMin)||(w(r.softMin)&&r.softMine.max&&(e.max=b=r.softMax),w(r.ceiling)&&(e.max=Math.min(e.max,r.ceiling))),y&&d(e.dataMin)&&(m=m||0,!d(x)&&e.min=m?e.min=e.options.minRange?Math.min(m,e.max-e.minRange):m:!d(b)&&e.max>m&&e.dataMax<=m&&(e.max=e.options.minRange?Math.max(m,e.min+e.minRange):m)),e.tickInterval=e.min===e.max||"undefined"===typeof e.min||"undefined"===typeof e.max?1:s&&!c&&h===e.linkedParent.options.tickPixelInterval?c=e.linkedParent.tickInterval:E(c,this.tickAmount?(e.max-e.min)/Math.max(this.tickAmount-1,1):void 0,p?1:(e.max-e.min)*h/Math.max(e.len,h)),o&&!t&&e.series.forEach((function(t){t.processData(e.min!==e.oldMin||e.max!==e.oldMax)})),e.setAxisTranslation(!0),g(this,"initialAxisTranslation"),e.pointRange&&!c&&(e.tickInterval=Math.max(e.pointRange,e.tickInterval)),t=E(r.minTickInterval,e.dateTime&&!e.series.some((function(t){return t.noSharedTooltip}))?e.closestPointRange:0),!c&&e.tickIntervale.tickInterval||void 0!==this.tickAmount),!!this.tickAmount)),this.tickAmount||(e.tickInterval=e.unsquish()),this.setTickPositions()},t.prototype.setTickPositions=function(){var t=this.options,e=t.tickPositions,i=this.getMinorTickInterval(),n=t.tickPositioner,r=this.hasVerticalPanning(),o="colorAxis"===this.coll,s=(o||!r)&&t.startOnTick;r=(o||!r)&&t.endOnTick,this.tickmarkOffset=this.categories&&"between"===t.tickmarkPlacement&&1===this.tickInterval?.5:0,this.minorTickInterval="auto"===i&&this.tickInterval?this.tickInterval/5:i,this.single=this.min===this.max&&d(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||!1!==t.allowDecimals),this.tickPositions=i=e&&e.slice(),!i&&(this.ordinal&&this.ordinal.positions||!((this.max-this.min)/this.tickInterval>Math.max(2*this.len,200))?i=this.dateTime?this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,t.units),this.min,this.max,t.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0):this.logarithmic?this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max):(i=[this.min,this.max],f(19,!1,this.chart)),i.length>this.len&&(i=[i[0],i.pop()],i[0]===i[1]&&(i.length=1)),this.tickPositions=i,n&&(n=n.apply(this,[this.min,this.max])))&&(this.tickPositions=i=n),this.paddedTicks=i.slice(0),this.trimTicks(i,s,r),this.isLinked||(this.single&&2>i.length&&!this.categories&&!this.series.some((function(t){return t.is("heatmap")&&"between"===t.options.pointPlacement}))&&(this.min-=.5,this.max+=.5),e||n||this.adjustTickAmount()),g(this,"afterSetTickPositions")},t.prototype.trimTicks=function(t,e,i){var n=t[0],r=t[t.length-1],o=!this.isOrdinal&&this.minPointOffset||0;if(g(this,"trimTicks"),!this.isLinked){if(e&&-1/0!==n)this.min=n;else for(;this.min-o>t[0];)t.shift();if(i)this.max=r;else for(;this.max+oe&&(this.finalTickAmt=e,e=5),this.tickAmount=e},t.prototype.adjustTickAmount=function(){var t,e=this.options,i=this.tickInterval,n=this.tickPositions,r=this.tickAmount,o=this.finalTickAmt,s=n&&n.length,a=E(this.threshold,this.softThreshold?0:null);if(this.hasData()){if(sr&&(this.tickInterval*=2,this.setTickPositions());if(d(o)){for(i=e=n.length;i--;)(3===o&&1===i%2||2>=o&&0a&&(e=a)),d(r)&&(oa&&(o=a))),i.displayBtn="undefined"!==typeof e||"undefined"!==typeof o,i.setExtremes(e,o,!1,void 0,{trigger:"zoom"})),t.zoomed=!0})),t.zoomed},t.prototype.setAxisSize=function(){var t=this.chart,e=this.options,i=e.offsets||[0,0,0,0],n=this.horiz,r=this.width=Math.round(A(E(e.width,t.plotWidth-i[3]+i[1]),t.plotWidth)),o=this.height=Math.round(A(E(e.height,t.plotHeight-i[0]+i[2]),t.plotHeight)),s=this.top=Math.round(A(E(e.top,t.plotTop+i[0]),t.plotHeight,t.plotTop));e=this.left=Math.round(A(E(e.left,t.plotLeft+i[3]),t.plotWidth,t.plotLeft)),this.bottom=t.chartHeight-o-s,this.right=t.chartWidth-r-e,this.len=Math.max(n?r:o,0),this.pos=n?e:s},t.prototype.getExtremes=function(){var t=this.logarithmic;return{min:t?u(t.lin2log(this.min)):this.min,max:t?u(t.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},t.prototype.getThreshold=function(t){var e=this.logarithmic,i=e?e.lin2log(this.min):this.min;return e=e?e.lin2log(this.max):this.max,null===t||-1/0===t?t=i:1/0===t?t=e:i>t?t=i:ee?t.align="right":195e&&(t.align="left")})),t.align},t.prototype.tickSize=function(t){var e=this.options,i=e["tick"===t?"tickLength":"minorTickLength"],n=E(e["tick"===t?"tickWidth":"minorTickWidth"],"tick"===t&&this.isXAxis&&!this.categories?1:0);if(n&&i){"inside"===e[t+"Position"]&&(i=-i);var r=[i,n]}return t={tickSize:r},g(this,"afterTickSize",t),t.tickSize},t.prototype.labelMetrics=function(){var t=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[t]&&this.ticks[t].label)},t.prototype.unsquish=function(){var t,e,i,n=this.options.labels,r=this.horiz,o=this.tickInterval,s=o,a=this.len/(((this.categories?1:0)+this.max-this.min)/o),l=n.rotation,c=this.labelMetrics(),h=Number.MAX_VALUE,p=this.max-this.min,f=function(t){var e=t/(a||1);return e=1p&&1/0!==t&&1/0!==a&&p&&(e=Math.ceil(p/o)),u(e*o)};return r?(i=!n.staggerLines&&!n.step&&(d(l)?[l]:a=i){e=f(Math.abs(c.h/Math.sin(R*i)));var n=e+Math.abs(i/360);n(r.step||0))return r.rotation?0:(this.staggerLines||1)*this.len/o;if(!n){if(t=null===(e=null===r||void 0===r?void 0:r.style)||void 0===e?void 0:e.width,void 0!==t)return parseInt(t,10);if(s)return s-i.spacing[3]}return.33*i.chartWidth},t.prototype.renderUnsquish=function(){var t=this.chart,e=t.renderer,i=this.tickPositions,n=this.ticks,r=this.options.labels,o=r&&r.style||{},s=this.horiz,a=this.getSlotWidth(),l=Math.max(1,Math.round(a-2*(r.padding||5))),c={},h=this.labelMetrics(),u=r.style&&r.style.textOverflow,d=0;if(M(r.rotation)||(c.rotation=r.rotation||0),i.forEach((function(t){t=n[t],t.movedLabel&&t.replaceMovedLabel(),t&&t.label&&t.label.textPxLength>d&&(d=t.label.textPxLength)})),this.maxLabelLength=d,this.autoRotation)d>l&&d>h.h?c.rotation=this.labelRotation:this.labelRotation=0;else if(a){var p=l;if(!u){var f="clip";for(l=i.length;!s&&l--;){var m=i[l];(m=n[m].label)&&(m.styles&&"ellipsis"===m.styles.textOverflow?m.css({textOverflow:"clip"}):m.textPxLength>a&&m.css({width:a+"px"}),m.getBBox().height>this.len/i.length-(h.h-h.f)&&(m.specificTextOverflow="ellipsis"))}}}c.rotation&&(p=d>.5*t.chartHeight?.33*t.chartHeight:d,u||(f="ellipsis")),(this.labelAlign=r.align||this.autoLabelAlign(this.labelRotation))&&(c.align=this.labelAlign),i.forEach((function(t){var e=(t=n[t])&&t.label,i=o.width,r={};e&&(e.attr(c),t.shortenLabel?t.shortenLabel():p&&!i&&"nowrap"!==o.whiteSpace&&(p=this.min&&t<=this.max||null!==(i=this.grid)&&void 0!==i&&i.isColumn)&&(o[t]||(o[t]=new n(this,t)),s&&o[t].isNew&&o[t].render(e,!0,-1),o[t].render(e))},t.prototype.render=function(){var t,e,r=this,o=r.chart,a=r.logarithmic,l=r.options,c=r.isLinked,h=r.tickPositions,u=r.axisTitle,d=r.ticks,p=r.minorTicks,f=r.alternateBands,m=l.stackLabels,y=l.alternateGridColor,v=r.tickmarkOffset,x=r.axisLine,b=r.showAxis,M=s(o.renderer.globalAnimation);r.labelEdge.length=0,r.overlap=!1,[d,p,f].forEach((function(t){T(t,(function(t){t.isActive=!1}))})),(r.hasData()||c)&&(r.minorTickInterval&&!r.categories&&r.getMinorTickPositions().forEach((function(t){r.renderMinorTick(t)})),h.length&&(h.forEach((function(t,e){r.renderTick(t,e)})),v&&(0===r.min||r.single)&&(d[-1]||(d[-1]=new n(r,-1,null,!0)),d[-1].render(-1))),y&&h.forEach((function(n,s){e="undefined"!==typeof h[s+1]?h[s+1]+v:r.max-v,0===s%2&&ne&&(!s||m<=i)&&"undefined"!==typeof m&&h.push(m),m>i&&(d=!0);var m=f}}}else e=this.lin2log(e),i=this.lin2log(i),t=s?a.getMinorTickInterval():c.tickInterval,t=o("auto"===t?null:t,this.minorAutoInterval,c.tickPixelInterval/(s?5:1)*(i-e)/((s?l/a.tickPositions.length:l)||1)),t=r(t,void 0,n(t)),h=a.getLinearTickPositions(t,e,i).map(this.log2lin),s||(this.minorAutoInterval=t/5);return s||(a.tickInterval=t),h},t.prototype.lin2log=function(t){return Math.pow(10,t)},t.prototype.log2lin=function(t){return Math.log(t)/Math.LN10},t}();return e=function(){function t(){}return t.compose=function(t){t.keepProps.push("logarithmic");var e=t.prototype,n=s.prototype;e.log2lin=n.log2lin,e.lin2log=n.lin2log,i(t,"init",(function(t){var e=this.logarithmic;"logarithmic"!==t.userOptions.type?this.logarithmic=void 0:(e||(e=this.logarithmic=new s(this)),this.log2lin!==e.log2lin&&(e.log2lin=this.log2lin.bind(this)),this.lin2log!==e.lin2log&&(e.lin2log=this.lin2log.bind(this)))})),i(t,"afterInit",(function(){var t=this.logarithmic;t&&(this.lin2val=function(e){return t.lin2log(e)},this.val2lin=function(e){return t.log2lin(e)})}))},t}(),e.compose(t),e})),e(i,"Core/Axis/PlotLineOrBand.js",[i["Core/Axis/Axis.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i){var n=i.arrayMax,r=i.arrayMin,o=i.defined,s=i.destroyObjectProperties,a=i.erase,l=i.extend,c=i.merge,h=i.objectEach,u=i.pick;return i=function(){function t(t,e){this.axis=t,e&&(this.options=e,this.id=e.id)}return t.prototype.render=function(){e.fireEvent(this,"render");var t=this,i=t.axis,n=i.horiz,r=i.logarithmic,s=t.options,a=s.label,l=t.label,d=s.to,p=s.from,f=s.value,m=o(p)&&o(d),g=o(f),y=t.svgElem,v=!y,x=[],b=s.color,w=u(s.zIndex,0),M=s.events;x={class:"highcharts-plot-"+(m?"band ":"line ")+(s.className||"")};var _={},S=i.chart.renderer,T=m?"bands":"lines";if(r&&(p=r.log2lin(p),d=r.log2lin(d),f=r.log2lin(f)),i.chart.styledMode||(g?(x.stroke=b||"#999999",x["stroke-width"]=u(s.width,1),s.dashStyle&&(x.dashstyle=s.dashStyle)):m&&(x.fill=b||"#e6ebf5",s.borderWidth&&(x.stroke=s.borderColor,x["stroke-width"]=s.borderWidth))),_.zIndex=w,T+="-"+w,(r=i.plotLinesAndBandsGroups[T])||(i.plotLinesAndBandsGroups[T]=r=S.g("plot-"+T).attr(_).add()),v&&(t.svgElem=y=S.path().attr(x).add(r)),g)x=i.getPlotLinePath({value:f,lineWidth:y.strokeWidth(),acrossPanes:s.acrossPanes});else{if(!m)return;x=i.getPlotBandPath(p,d,s)}return!t.eventsAdded&&M&&(h(M,(function(e,i){y.on(i,(function(e){M[i].apply(t,[e])}))})),t.eventsAdded=!0),(v||!y.d)&&x&&x.length?y.attr({d:x}):y&&(x?(y.show(!0),y.animate({d:x})):y.d&&(y.hide(),l&&(t.label=l=l.destroy()))),a&&(o(a.text)||o(a.formatter))&&x&&x.length&&0this.max&&e>this.max,i&&n){if(t){var a=i.toString()===n.toString();s=0}for(t=0;tt){l=a;break}if(s[l]&&o.substr(s[l])!=="01-01 00:00:00.000".substr(s[l]))break;"week"!==l&&(a=l)}if(l)var c=r.resolveDTLFormat(n[l]).main;return c},y.prototype.getLabel=function(){var e,i,n,s=this,a=this.chart.renderer,l=this.chart.styledMode,c=this.options,h="tooltip"+(o(c.className)?" "+c.className:""),u=(null===(e=c.style)||void 0===e?void 0:e.pointerEvents)||(!this.followPointer&&c.stickOnContact?"auto":"none");e=function(){s.inContact=!0};var d=function(){var t=s.chart.hoverSeries;s.inContact=!1,t&&t.onMouseOut&&t.onMouseOut()};if(!this.label){if(this.outside&&(this.container=n=t.doc.createElement("div"),n.className="highcharts-tooltip-container",r(n,{position:"absolute",top:"1px",pointerEvents:u,zIndex:3}),t.doc.body.appendChild(n),this.renderer=a=new t.Renderer(n,0,0,null===(i=this.chart.options.chart)||void 0===i?void 0:i.style,void 0,void 0,a.styledMode)),this.split?this.label=a.g(h):(this.label=a.label("",0,0,c.shape||"callout",null,null,c.useHTML,null,h).attr({padding:c.padding,r:c.borderRadius}),l||this.label.attr({fill:c.backgroundColor,"stroke-width":c.borderWidth}).css(c.style).css({pointerEvents:u}).shadow(c.shadow)),l&&(this.applyFilter(),this.label.addClass("highcharts-tooltip-"+this.chart.index)),s.outside&&!s.split){var p=this.label,f=p.xSetter,m=p.ySetter;p.xSetter=function(t){f.call(p,s.distance),n.style.left=t+"px"},p.ySetter=function(t){m.call(p,s.distance),n.style.top=t+"px"}}this.label.on("mouseenter",e).on("mouseleave",d).attr({zIndex:8}).add()}return this.label},y.prototype.getPosition=function(t,e,n){var r,o=this.chart,s=this.distance,a={},l=o.inverted&&n.h||0,c=this.outside,h=c?i.documentElement.clientWidth-2*s:o.chartWidth,u=c?Math.max(i.body.scrollHeight,i.documentElement.scrollHeight,i.body.offsetHeight,i.documentElement.offsetHeight,i.documentElement.clientHeight):o.chartHeight,d=o.pointer.getChartPosition(),f=o.containerScaling,m=function(t){return f?t*f.scaleX:t},g=function(t){return f?t*f.scaleY:t},y=function(i){var r="x"===i;return[i,r?h:u,r?t:e].concat(c?[r?m(t):g(e),r?d.left-s+m(n.plotX+o.plotLeft):d.top-s+g(n.plotY+o.plotTop),0,r?h:u]:[r?t:e,r?n.plotX+o.plotLeft:n.plotY+o.plotTop,r?o.plotLeft:o.plotTop,r?o.plotLeft+o.plotWidth:o.plotTop+o.plotHeight])},v=y("y"),x=y("x"),b=!this.followPointer&&p(n.ttBelow,!o.inverted===!!n.negative),w=function(t,e,i,n,r,o,c){var h="y"===t?g(s):m(s),u=(i-n)/2,d=nf-l?f:f-l);else{if(!p)return!1;a[t]=Math.max(o,r+l+i>e?r:r+l)}},M=function(t,e,i,n,r){var o;return re-s?o=!1:a[t]=re-n/2?e-n-2:r-i/2,o},_=function(t){var e=v;v=x,x=e,r=t},S=function(){!1!==w.apply(0,v)?!1!==M.apply(0,x)||r||(_(!0),S()):r?a.x=a.y=0:(_(!0),S())};return(o.inverted||1=x+d&&P.pos+v<=x+d+c-y&&(O=P.pos+v);g=n(g,S.left-w,S.right+w),"number"===typeof O?(f=f.height+1,v=_?_.call(o,l,f,s):r(g,O,a,l),t.push({align:_?0:void 0,anchorX:g,anchorY:O,boxWidth:l,point:s,rank:p(v.rank,a?1:0),size:f,target:v.y,tt:e,x:v.x})):e.isActive=!1}return t}),[]),!_&&e.some((function(t){return t.xi[0]?Math.max(Math.abs(i[0]),r.width-i[0]):Math.max(Math.abs(i[0]),r.width),n.height=0>i[1]?Math.max(Math.abs(i[1]),r.height-Math.abs(i[1])):Math.max(Math.abs(i[1]),r.height),this.tracker?this.tracker.attr(n):(this.tracker=e.renderer.rect(n).addClass("highcharts-tracker").add(e),t.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}},y.prototype.styledModeFormat=function(t){return t.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')},y.prototype.tooltipFooterHeaderFormatter=function(t,e){var i=e?"footer":"header",n=t.series,r=n.tooltipOptions,o=r.xDateFormat,s=n.xAxis,a=s&&"datetime"===s.options.type&&h(t.key),u=r[i+"Format"];return e={isFooter:e,labelConfig:t},l(this,"headerFormatter",e,(function(e){a&&!o&&(o=this.getXDateFormat(t,r,s)),a&&o&&(t.point&&t.point.tooltipDateKeys||["key"]).forEach((function(t){u=u.replace("{point."+t+"}","{point."+t+":"+o+"}")})),n.chart.styledMode&&(u=this.styledModeFormat(u)),e.text=c(u,{point:t,series:n},this.chart)})),e.text},y.prototype.update=function(t){this.destroy(),d(!0,this.chart.options.tooltip.userOptions,t),this.init(this.chart,d(!0,this.options,t))},y.prototype.updatePosition=function(t){var e=this.chart,i=e.pointer,n=this.getLabel(),o=t.plotX+e.plotLeft,s=t.plotY+e.plotTop;if(i=i.getChartPosition(),t=(this.options.positioner||this.getPosition).call(this,n.width,n.height,t),this.outside){var a=(this.options.borderWidth||0)+2*this.distance;this.renderer.setSize(n.width+a,n.height+a,!1),(e=e.containerScaling)&&(r(this.container,{transform:"scale("+e.scaleX+", "+e.scaleY+")"}),o*=e.scaleX,s*=e.scaleY),o+=i.left-t.x,s+=i.top-t.y}this.move(Math.round(t.x),Math.round(t.y||0),o,s)},y}();return t.Tooltip=y,t.Tooltip})),e(i,"Core/Pointer.js",[i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Tooltip.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.parse,o=e.charts,s=e.noop,a=n.addEvent,l=n.attr,c=n.css,h=n.defined,u=n.extend,d=n.find,p=n.fireEvent,f=n.isNumber,m=n.isObject,g=n.objectEach,y=n.offset,v=n.pick,x=n.splat;return t=function(){function t(t,e){this.lastValidTouch={},this.pinchDown=[],this.runChartClick=!1,this.chart=t,this.hasDragged=!1,this.options=e,this.unbindContainerMouseLeave=function(){},this.unbindContainerMouseEnter=function(){},this.init(t,e)}return t.prototype.applyInactiveState=function(t){var e,i=[];(t||[]).forEach((function(t){e=t.series,i.push(e),e.linkedParent&&i.push(e.linkedParent),e.linkedSeries&&(i=i.concat(e.linkedSeries)),e.navigatorSeries&&i.push(e.navigatorSeries)})),this.chart.series.forEach((function(t){-1===i.indexOf(t)?t.setState("inactive",!0):t.options.inactiveOtherPoints&&t.setAllPointsToState("inactive")}))},t.prototype.destroy=function(){var t=this;"undefined"!==typeof t.unDocMouseMove&&t.unDocMouseMove(),this.unbindContainerMouseLeave(),e.chartCount||(e.unbindDocumentMouseUp&&(e.unbindDocumentMouseUp=e.unbindDocumentMouseUp()),e.unbindDocumentTouchEnd&&(e.unbindDocumentTouchEnd=e.unbindDocumentTouchEnd())),clearInterval(t.tooltipTimeout),g(t,(function(e,i){t[i]=void 0}))},t.prototype.drag=function(t){var e=this.chart,i=e.options.chart,n=t.chartX,o=t.chartY,s=this.zoomHor,a=this.zoomVert,l=e.plotLeft,c=e.plotTop,h=e.plotWidth,u=e.plotHeight,d=this.selectionMarker,p=this.mouseDownX||0,f=this.mouseDownY||0,g=m(i.panning)?i.panning&&i.panning.enabled:i.panning,y=i.panKey&&t[i.panKey+"Key"];if((!d||!d.touch)&&(nl+h&&(n=l+h),oc+u&&(o=c+u),this.hasDragged=Math.sqrt(Math.pow(p-n,2)+Math.pow(f-o,2)),10t.options.findNearestPointBy.indexOf("y");if(t=t.searchPoint(i,r),(r=m(t,!0))&&!(r=!m(n,!0))){r=n.distX-t.distX;var o=n.dist-t.dist,s=(t.series.group&&t.series.group.zIndex)-(n.series.group&&n.series.group.zIndex);r=0<(0!==r&&e?r:0!==o?o:0!==s?s:n.series.index>t.series.index?-1:1)}r&&(n=t)})),n)},t.prototype.getChartCoordinatesFromPoint=function(t,e){var i=t.series,n=i.xAxis;i=i.yAxis;var r=v(t.clientX,t.plotX),o=t.shapeArgs;return n&&i?e?{chartX:n.len+n.pos-r,chartY:i.len+i.pos-t.plotY}:{chartX:r+n.pos,chartY:t.plotY+i.pos}:o&&o.x&&o.y?{chartX:o.x,chartY:o.y}:void 0},t.prototype.getChartPosition=function(){return this.chartPosition||(this.chartPosition=y(this.chart.container))},t.prototype.getCoordinates=function(t){var e={xAxis:[],yAxis:[]};return this.chart.axes.forEach((function(i){e[i.isXAxis?"xAxis":"yAxis"].push({axis:i,value:i.toValue(t[i.horiz?"chartX":"chartY"])})})),e},t.prototype.getHoverData=function(t,e,i,n,r,o){var s,a=[];n=!(!n||!t);var l=e&&!e.stickyTracking,c={chartX:o?o.chartX:void 0,chartY:o?o.chartY:void 0,shared:r};return p(this,"beforeGetHoverData",c),l=l?[e]:i.filter((function(t){return c.filter?c.filter(t):t.visible&&!(!r&&t.directTouch)&&v(t.options.enableMouseTracking,!0)&&t.stickyTracking})),e=(s=n||!o?t:this.findNearestKDPoint(l,r,o))&&s.series,s&&(r&&!e.noSharedTooltip?(l=i.filter((function(t){return c.filter?c.filter(t):t.visible&&!(!r&&t.directTouch)&&v(t.options.enableMouseTracking,!0)&&!t.noSharedTooltip})),l.forEach((function(t){var e=d(t.points,(function(t){return t.x===s.x&&!t.isNull}));m(e)&&(t.chart.isBoosting&&(e=t.getPoint(e)),a.push(e))}))):a.push(s)),c={hoverPoint:s},p(this,"afterGetHoverData",c),{hoverPoint:c.hoverPoint,hoverSeries:e,hoverPoints:a}},t.prototype.getPointFromEvent=function(t){t=t.target;for(var e;t&&!e;)e=t.point,t=t.parentNode;return e},t.prototype.onTrackerMouseOut=function(t){t=t.relatedTarget||t.toElement;var e=this.chart.hoverSeries;this.isDirectTouch=!1,!e||!t||e.stickyTracking||this.inClass(t,"highcharts-tooltip")||this.inClass(t,"highcharts-series-"+e.index)&&this.inClass(t,"highcharts-tracker")||e.onMouseOut()},t.prototype.inClass=function(t,e){for(var i;t;){if(i=l(t,"class")){if(-1!==i.indexOf(e))return!0;if(-1!==i.indexOf("highcharts-container"))return!1}t=t.parentNode}},t.prototype.init=function(t,e){this.options=e,this.chart=t,this.runChartClick=e.chart.events&&!!e.chart.events.click,this.pinchDown=[],this.lastValidTouch={},i&&(t.tooltip=new i(t,e.tooltip),this.followTouchMove=v(e.tooltip.followTouchMove,!0)),this.setDOMEvents()},t.prototype.normalize=function(t,e){var i=t.touches,n=i?i.length?i.item(0):v(i.changedTouches,t.changedTouches)[0]:t;return e||(e=this.getChartPosition()),i=n.pageX-e.left,e=n.pageY-e.top,(n=this.chart.containerScaling)&&(i/=n.scaleX,e/=n.scaleY),u(t,{chartX:Math.round(i),chartY:Math.round(e)})},t.prototype.onContainerClick=function(t){var e=this.chart,i=e.hoverPoint;t=this.normalize(t);var n=e.plotLeft,r=e.plotTop;e.cancelClick||(i&&this.inClass(t.target,"highcharts-tracker")?(p(i.series,"click",u(t,{point:i})),e.hoverPoint&&i.firePointEvent("click",t)):(u(t,this.getCoordinates(t)),e.isInsidePlot(t.chartX-n,t.chartY-r)&&p(e,"click",t)))},t.prototype.onContainerMouseDown=function(t){var i=1===(1&(t.buttons||t.button));t=this.normalize(t),e.isFirefox&&0!==t.button&&this.onContainerMouseMove(t),("undefined"===typeof t.button||i)&&(this.zoomOption(t),i&&t.preventDefault&&t.preventDefault(),this.dragStart(t))},t.prototype.onContainerMouseLeave=function(t){var i=o[v(e.hoverChartIndex,-1)],n=this.chart.tooltip;t=this.normalize(t),i&&(t.relatedTarget||t.toElement)&&(i.pointer.reset(),i.pointer.chartPosition=void 0),n&&!n.isHidden&&this.reset()},t.prototype.onContainerMouseEnter=function(t){delete this.chartPosition},t.prototype.onContainerMouseMove=function(t){var e=this.chart;t=this.normalize(t),this.setHoverChartIndex(),t.preventDefault||(t.returnValue=!1),"mousedown"===e.mouseIsDown&&this.drag(t),e.openMenu||!this.inClass(t.target,"highcharts-tracker")&&!e.isInsidePlot(t.chartX-e.plotLeft,t.chartY-e.plotTop)||this.runPointActions(t)},t.prototype.onDocumentTouchEnd=function(t){o[e.hoverChartIndex]&&o[e.hoverChartIndex].pointer.drop(t)},t.prototype.onContainerTouchMove=function(t){this.touch(t)},t.prototype.onContainerTouchStart=function(t){this.zoomOption(t),this.touch(t,!0)},t.prototype.onDocumentMouseMove=function(t){var e=this.chart,i=this.chartPosition;t=this.normalize(t,i);var n=e.tooltip;!i||n&&n.isStickyOnContact()||e.isInsidePlot(t.chartX-e.plotLeft,t.chartY-e.plotTop)||this.inClass(t.target,"highcharts-tracker")||this.reset()},t.prototype.onDocumentMouseUp=function(t){var i=o[v(e.hoverChartIndex,-1)];i&&i.pointer.drop(t)},t.prototype.pinch=function(t){var e=this,i=e.chart,n=e.pinchDown,r=t.touches||[],o=r.length,a=e.lastValidTouch,l=e.hasZoom,c=e.selectionMarker,h={},d=1===o&&(e.inClass(t.target,"highcharts-tracker")&&i.runTrackerClick||e.runChartClick),p={};1v.max&&(e=v.max-l,S=!0);S?(w-=.8*(w-s[u][0]),"number"===typeof _&&(_-=.8*(_-s[u][1])),i()):s[u]=[w,_],y||(o[u]=c-m,o[f]=l),o=y?1/g:g,r[f]=l,r[u]=e,n[y?t?"scaleY":"scaleX":"scale"+d]=g,n["translate"+d]=o*m+(w-o*b)},t.prototype.reset=function(t,e){var i=this.chart,n=i.hoverSeries,r=i.hoverPoint,o=i.hoverPoints,s=i.tooltip,a=s&&s.shared?o:r;t&&a&&x(a).forEach((function(e){e.series.isCartesian&&"undefined"===typeof e.plotX&&(t=!1)})),t?s&&a&&x(a).length&&(s.refresh(a),s.shared&&o?o.forEach((function(t){t.setState(t.state,!0),t.series.isCartesian&&(t.series.xAxis.crosshair&&t.series.xAxis.drawCrosshair(null,t),t.series.yAxis.crosshair&&t.series.yAxis.drawCrosshair(null,t))})):r&&(r.setState(r.state,!0),i.axes.forEach((function(t){t.crosshair&&r.series[t.coll]===t&&t.drawCrosshair(null,r)})))):(r&&r.onMouseOut(),o&&o.forEach((function(t){t.setState()})),n&&n.onMouseOut(),s&&s.hide(e),this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove()),i.axes.forEach((function(t){t.hideCrosshair()})),this.hoverX=i.hoverPoints=i.hoverPoint=null)},t.prototype.runPointActions=function(t,i){var n=this.chart,r=n.tooltip&&n.tooltip.options.enabled?n.tooltip:void 0,s=!!r&&r.shared,l=i||n.hoverPoint,c=l&&l.series||n.hoverSeries;c=this.getHoverData(l,c,n.series,(!t||"touchmove"!==t.type)&&(!!i||c&&c.directTouch&&this.isDirectTouch),s,t),l=c.hoverPoint;var h=c.hoverPoints;if(i=(c=c.hoverSeries)&&c.tooltipOptions.followPointer,s=s&&c&&!c.noSharedTooltip,l&&(l!==n.hoverPoint||r&&r.isHidden)){if((n.hoverPoints||[]).forEach((function(t){-1===h.indexOf(t)&&t.setState()})),n.hoverSeries!==c&&c.onMouseOver(),this.applyInactiveState(h),(h||[]).forEach((function(t){t.setState("hover")})),n.hoverPoint&&n.hoverPoint.firePointEvent("mouseOut"),!l.series)return;n.hoverPoints=h,n.hoverPoint=l,l.firePointEvent("mouseOver"),r&&r.refresh(s?h:l,t)}else i&&r&&!r.isHidden&&(l=r.getAnchor([{}],t),r.updatePosition({plotX:l[0],plotY:l[1]}));this.unDocMouseMove||(this.unDocMouseMove=a(n.container.ownerDocument,"mousemove",(function(t){var i=o[e.hoverChartIndex];i&&i.pointer.onDocumentMouseMove(t)}))),n.axes.forEach((function(e){var i,r=v((e.crosshair||{}).snap,!0);r&&((i=n.hoverPoint)&&i.series[e.coll]===e||(i=d(h,(function(t){return t.series[e.coll]===e})))),i||!r?e.drawCrosshair(t,i):e.hideCrosshair()}))},t.prototype.scaleGroups=function(t,e){var i,n=this.chart;n.series.forEach((function(r){i=t||r.getPlotBox(),r.xAxis&&r.xAxis.zoomEnabled&&r.group&&(r.group.attr(i),r.markerGroup&&(r.markerGroup.attr(i),r.markerGroup.clip(e?n.clipRect:null)),r.dataLabelsGroup&&r.dataLabelsGroup.attr(i))})),n.clipRect.attr(e||n.clipBox)},t.prototype.setDOMEvents=function(){var t=this.chart.container,i=t.ownerDocument;t.onmousedown=this.onContainerMouseDown.bind(this),t.onmousemove=this.onContainerMouseMove.bind(this),t.onclick=this.onContainerClick.bind(this),this.unbindContainerMouseEnter=a(t,"mouseenter",this.onContainerMouseEnter.bind(this)),this.unbindContainerMouseLeave=a(t,"mouseleave",this.onContainerMouseLeave.bind(this)),e.unbindDocumentMouseUp||(e.unbindDocumentMouseUp=a(i,"mouseup",this.onDocumentMouseUp.bind(this))),e.hasTouch&&(a(t,"touchstart",this.onContainerTouchStart.bind(this)),a(t,"touchmove",this.onContainerTouchMove.bind(this)),e.unbindDocumentTouchEnd||(e.unbindDocumentTouchEnd=a(i,"touchend",this.onDocumentTouchEnd.bind(this))))},t.prototype.setHoverChartIndex=function(){var t=this.chart,i=e.charts[v(e.hoverChartIndex,-1)];i&&i!==t&&i.pointer.onContainerMouseLeave({relatedTarget:!0}),i&&i.mouseIsDown||(e.hoverChartIndex=t.index)},t.prototype.touch=function(t,e){var i=this.chart;if(this.setHoverChartIndex(),1===t.touches.length)if(t=this.normalize(t),i.isInsidePlot(t.chartX-i.plotLeft,t.chartY-i.plotTop)&&!i.openMenu){if(e&&this.runPointActions(t),"touchmove"===t.type){e=this.pinchDown;var n=!!e[0]&&4<=Math.sqrt(Math.pow(e[0].chartX-t.chartX,2)+Math.pow(e[0].chartY-t.chartY,2))}v(n,!0)&&this.pinch(t)}else e&&this.reset();else 2===t.touches.length&&this.pinch(t)},t.prototype.zoomOption=function(t){var e=this.chart,i=e.options.chart,n=i.zoomType||"";e=e.inverted,/touch/.test(t.type)&&(n=v(i.pinchType,n)),this.zoomX=t=/x/.test(n),this.zoomY=n=/y/.test(n),this.zoomHor=t&&!e||n&&e,this.zoomVert=n&&!e||t&&e,this.hasZoom=t||n},t}(),e.Pointer=t})),e(i,"Core/MSPointer.js",[i["Core/Globals.js"],i["Core/Pointer.js"],i["Core/Utilities.js"]],(function(t,e,i){function n(){var t=[];return t.item=function(t){return this[t]},u(p,(function(e){t.push({pageX:e.pageX,pageY:e.pageY,target:e.target})})),t}function r(e,i,r,o){"touch"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_TOUCH||!s[t.hoverChartIndex]||(o(e),o=s[t.hoverChartIndex].pointer,o[i]({type:r,target:e.currentTarget,preventDefault:l,touches:n()}))}var o=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},t(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),s=t.charts,a=t.doc,l=t.noop,c=i.addEvent,h=i.css,u=i.objectEach,d=i.removeEvent,p={},f=!!t.win.PointerEvent;return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.batchMSEvents=function(t){t(this.chart.container,f?"pointerdown":"MSPointerDown",this.onContainerPointerDown),t(this.chart.container,f?"pointermove":"MSPointerMove",this.onContainerPointerMove),t(a,f?"pointerup":"MSPointerUp",this.onDocumentPointerUp)},e.prototype.destroy=function(){this.batchMSEvents(d),t.prototype.destroy.call(this)},e.prototype.init=function(e,i){t.prototype.init.call(this,e,i),this.hasZoom&&h(e.container,{"-ms-touch-action":"none","touch-action":"none"})},e.prototype.onContainerPointerDown=function(t){r(t,"onContainerTouchStart","touchstart",(function(t){p[t.pointerId]={pageX:t.pageX,pageY:t.pageY,target:t.currentTarget}}))},e.prototype.onContainerPointerMove=function(t){r(t,"onContainerTouchMove","touchmove",(function(t){p[t.pointerId]={pageX:t.pageX,pageY:t.pageY},p[t.pointerId].target||(p[t.pointerId].target=t.currentTarget)}))},e.prototype.onDocumentPointerUp=function(t){r(t,"onDocumentTouchEnd","touchend",(function(t){delete p[t.pointerId]}))},e.prototype.setDOMEvents=function(){t.prototype.setDOMEvents.call(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(c)},e}(e)})),e(i,"Core/Legend.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i){var n=t.animObject,r=t.setAnimation,o=i.addEvent,s=i.css,a=i.defined,l=i.discardElement,c=i.find,h=i.fireEvent,u=i.format,d=i.isNumber,p=i.merge,f=i.pick,m=i.relativeLength,g=i.stableSort,y=i.syncTimeout;t=i.wrap,i=e.isFirefox;var v=e.marginNames,x=e.win,b=function(){function t(t,e){this.allItems=[],this.contentGroup=this.box=void 0,this.display=!1,this.group=void 0,this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom=this.itemHeight=this.initialItemY=0,this.options={},this.padding=0,this.pages=[],this.proximate=!1,this.scrollGroup=void 0,this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0,this.chart=t,this.init(t,e)}return t.prototype.init=function(t,e){this.chart=t,this.setOptions(e),e.enabled&&(this.render(),o(this.chart,"endResize",(function(){this.legend.positionCheckboxes()})),this.proximate?this.unchartrender=o(this.chart,"render",(function(){this.legend.proximatePositions(),this.legend.positionItems()})):this.unchartrender&&this.unchartrender())},t.prototype.setOptions=function(t){var e=f(t.padding,8);this.options=t,this.chart.styledMode||(this.itemStyle=t.itemStyle,this.itemHiddenStyle=p(this.itemStyle,t.itemHiddenStyle)),this.itemMarginTop=t.itemMarginTop||0,this.itemMarginBottom=t.itemMarginBottom||0,this.padding=e,this.initialItemY=e-5,this.symbolWidth=f(t.symbolWidth,16),this.pages=[],this.proximate="proximate"===t.layout&&!this.chart.inverted,this.baseline=void 0},t.prototype.update=function(t,e){var i=this.chart;this.setOptions(p(!0,this.options,t)),this.destroy(),i.isDirtyLegend=i.isDirtyBox=!0,f(e,!0)&&i.redraw(),h(this,"afterUpdate")},t.prototype.colorizeItem=function(t,e){if(t.legendGroup[e?"removeClass":"addClass"]("highcharts-legend-item-hidden"),!this.chart.styledMode){var i=this.options,n=t.legendItem,r=t.legendLine,o=t.legendSymbol,s=this.itemHiddenStyle.color;i=e?i.itemStyle.color:s;var a=e&&t.color||s,l=t.options&&t.options.marker,c={fill:a};n&&n.css({fill:i,color:i}),r&&r.attr({stroke:a}),o&&(l&&o.isMarker&&(c=t.pointAttribs(),e||(c.stroke=c.fill=s)),o.attr(c))}h(this,"afterColorizeItem",{item:t,visible:e})},t.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this),this.chart.isResizing||this.positionCheckboxes()},t.prototype.positionItem=function(t){var e=this,i=this.options,n=i.symbolPadding,r=!i.rtl,o=t._legendItemPos;i=o[0],o=o[1];var s=t.checkbox,l=t.legendGroup;l&&l.element&&(n={translateX:r?i:this.legendWidth-i-2*n-4,translateY:o},r=function(){h(e,"afterPositionItem",{item:t})},a(l.translateY)?l.animate(n,void 0,r):(l.attr(n),r())),s&&(s.x=i,s.y=o)},t.prototype.destroyItem=function(t){var e=t.checkbox;["legendItem","legendLine","legendSymbol","legendGroup"].forEach((function(e){t[e]&&(t[e]=t[e].destroy())})),e&&l(t.checkbox)},t.prototype.destroy=function(){function t(t){this[t]&&(this[t]=this[t].destroy())}this.getAllItems().forEach((function(e){["legendItem","legendGroup"].forEach(t,e)})),"clipRect up down pager nav box title group".split(" ").forEach(t,this),this.display=null},t.prototype.positionCheckboxes=function(){var t=this.group&&this.group.alignAttr,e=this.clipHeight||this.legendHeight,i=this.titleHeight;if(t){var n=t.translateY;this.allItems.forEach((function(r){var o=r.checkbox;if(o){var a=n+i+o.y+(this.scrollOffset||0)+3;s(o,{left:t.translateX+r.checkboxOffset+o.x-20+"px",top:a+"px",display:this.proximate||a>n-6&&al?this.maxItemWidth:t.itemWidth,n&&this.itemX-i+e>l&&(this.itemX=i,this.lastLineHeight&&(this.itemY+=s+this.lastLineHeight+o),this.lastLineHeight=0),this.lastItemY=s+this.itemY+o,this.lastLineHeight=Math.max(r,this.lastLineHeight),t._legendItemPos=[this.itemX,this.itemY],n?this.itemX+=e:(this.itemY+=s+r+o,this.lastLineHeight=r),this.offsetWidth=this.widthOption||Math.max((n?this.itemX-i-(t.checkbox?0:a):e)+i,this.offsetWidth)},t.prototype.getAllItems=function(){var t=[];return this.chart.series.forEach((function(e){var i=e&&e.options;e&&f(i.showInLegend,!a(i.linkedTo)&&void 0,!0)&&(t=t.concat(e.legendItems||("point"===i.legendType?e.data:e)))})),h(this,"afterGetAllItems",{allItems:t}),t},t.prototype.getAlignment=function(){var t=this.options;return this.proximate?t.align.charAt(0)+"tv":t.floating?"":t.align.charAt(0)+t.verticalAlign.charAt(0)+t.layout.charAt(0)},t.prototype.adjustMargins=function(t,e){var i=this.chart,n=this.options,r=this.getAlignment();r&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach((function(o,s){o.test(r)&&!a(t[s])&&(i[v[s]]=Math.max(i[v[s]],i.legend[(s+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][s]*n[s%2?"x":"y"]+f(n.margin,12)+e[s]+(i.titleOffset[s]||0)))}))},t.prototype.proximatePositions=function(){var t=this.chart,i=[],n="left"===this.options.align;this.allItems.forEach((function(e){var r,o=n;if(e.yAxis){e.xAxis.options.reversed&&(o=!o),e.points&&(r=c(o?e.points:e.points.slice(0).reverse(),(function(t){return d(t.plotY)}))),o=this.itemMarginTop+e.legendItem.getBBox().height+this.itemMarginBottom;var s=e.yAxis.top-t.plotTop;e.visible?(r=r?r.plotY:e.yAxis.height,r+=s-.3*o):r=s+e.yAxis.height,i.push({target:r,size:o,item:e})}}),this),e.distribute(i,t.plotHeight),i.forEach((function(e){e.item._legendItemPos[1]=t.plotTop-t.spacing[0]+e.pos}))},t.prototype.render=function(){var t=this.chart,e=t.renderer,i=this.group,n=this.box,r=this.options,o=this.padding;this.itemX=o,this.itemY=this.initialItemY,this.lastItemY=this.offsetWidth=0,this.widthOption=m(r.width,t.spacingBox.width-o);var s=t.spacingBox.width-2*o-r.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(s/=2),this.maxLegendWidth=this.widthOption||s,i||(this.group=i=e.g("legend").attr({zIndex:7}).add(),this.contentGroup=e.g().attr({zIndex:1}).add(i),this.scrollGroup=e.g().add(this.contentGroup)),this.renderTitle();var a=this.getAllItems();g(a,(function(t,e){return(t.options&&t.options.legendIndex||0)-(e.options&&e.options.legendIndex||0)})),r.reversed&&a.reverse(),this.allItems=a,this.display=s=!!a.length,this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0,a.forEach(this.renderItem,this),a.forEach(this.layoutItem,this),a=(this.widthOption||this.offsetWidth)+o;var l=this.lastItemY+this.lastLineHeight+this.titleHeight;l=this.handleOverflow(l),l+=o,n||(this.box=n=e.rect().addClass("highcharts-legend-box").attr({r:r.borderRadius}).add(i),n.isNew=!0),t.styledMode||n.attr({stroke:r.borderColor,"stroke-width":r.borderWidth||0,fill:r.backgroundColor||"none"}).shadow(r.shadow),0o&&!1!==u.enabled?(this.clipHeight=a=Math.max(o-20-this.titleHeight-s,0),this.currentPage=f(this.currentPage,1),this.fullHeight=t,y.forEach((function(t,e){var i=t._legendItemPos[1],n=Math.round(t.legendItem.getBBox().height),r=g.length;(!r||i-g[r-1]>a&&(l||i)!==g[r-1])&&(g.push(l||i),r++),t.pageIx=r-1,l&&(y[e-1].pageIx=r-1),e===y.length-1&&i+n-g[r-1]>a&&i!==l&&(g.push(i),t.pageIx=r),i!==l&&(l=i)})),h||(h=e.clipRect=n.clipRect(0,s,9999,0),e.contentGroup.clip(h)),v(a),m||(this.nav=m=n.g().attr({zIndex:1}).add(this.group),this.up=n.symbol("triangle",0,0,p,p).add(m),x("upTracker").on("click",(function(){e.scroll(-1,d)})),this.pager=n.text("",15,10).addClass("highcharts-legend-navigation"),i.styledMode||this.pager.css(u.style),this.pager.add(m),this.down=n.symbol("triangle-down",0,0,p,p).add(m),x("downTracker").on("click",(function(){e.scroll(1,d)}))),e.scroll(0),t=o):m&&(v(),this.nav=m.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),t},t.prototype.scroll=function(t,e){var i=this,o=this.chart,s=this.pages,a=s.length,l=this.currentPage+t;t=this.clipHeight;var c=this.options.navigation,u=this.pager,d=this.padding;l>a&&(l=a),0=i.value;)i=e[++n];return this.nonZonedColor||(this.nonZonedColor=this.color),this.color=i&&i.color&&!this.options.color?i.color:this.nonZonedColor,i},t.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType},t.prototype.init=function(t,e,i){return this.series=t,this.applyOptions(e,i),this.id=r(this.id)?this.id:g(),this.resolveColor(),t.chart.pointCount++,a(this,"afterInit"),this},t.prototype.optionsToObject=function(e){var i={},n=this.series,r=n.options.keys,o=r||n.pointArrayMap||["y"],s=o.length,a=0,l=0;if(u(e)||null===e)i[o[0]]=e;else if(h(e))for(!r&&e.length>s&&(n=typeof e[0],"string"===n?i.name=e[0]:"number"===n&&(i.x=e[0]),a++);l=L(t[e].options.index,t[e]._i)){t.splice(e+1,0,this);break}-1===e&&t.unshift(this),e+=1}else t.push(this);return L(e,t.length-1)},bindAxes:function(){var t,e=this,i=e.options,n=e.chart;b(this,"bindAxes",null,(function(){(e.axisTypes||[]).forEach((function(r){n[r].forEach((function(n){t=n.options,(i[r]===t.index||"undefined"!==typeof i[r]&&i[r]===t.id||"undefined"===typeof i[r]&&0===t.index)&&(e.insert(n.series),e[r]=n,n.isDirty=!0)})),e[r]||e.optionalAxis===r||y(18,!0,n)}))})),b(this,"afterBindAxes")},updateParallelArrays:function(t,e){var i=t.series,n=arguments,r=S(e)?function(n){var r="y"===n&&i.toYData?i.toYData(t):t[n];i[n+"Data"][e]=r}:function(t){Array.prototype[e].apply(i[t+"Data"],Array.prototype.slice.call(n,2))};i.parallelArrays.forEach(r)},hasData:function(){return this.visible&&"undefined"!==typeof this.dataMax&&"undefined"!==typeof this.dataMin||this.visible&&this.yData&&0=this.cropStart?c-this.cropStart:c),!i&&o[c]&&o[c].touched&&(c=void 0),c},drawLegendSymbol:n.drawLineMarker,updateData:function(t,e){var i,n,r,o=this.options,s=o.dataSorting,a=this.points,l=[],c=this.requireSorting,h=t.length===a.length,d=!0;if(this.xIncrement=null,t.forEach((function(t,e){var n=m(t)&&this.pointClass.prototype.optionsToObject.call({series:this},t)||{},u=n.x;n.id||S(u)?(u=this.findPointIndex(n,r),-1===u||"undefined"===typeof u?l.push(t):a[u]&&t!==o.data[u]?(a[u].update(t,!1,null,!1),a[u].touched=!0,c&&(r=u+1)):a[u]&&(a[u].touched=!0),(!h||e!==u||s&&s.enabled||this.hasDerivedData)&&(i=!0)):l.push(t)}),this),i)for(t=a.length;t--;)(n=a[t])&&!n.touched&&n.remove&&n.remove(!1,e);else!h||s&&s.enabled?d=!1:(t.forEach((function(t,e){a[e].update&&t!==a[e].y&&a[e].update(t,!1,null,!1)})),l.length=0);return a.forEach((function(t){t&&(t.touched=!1)})),!!d&&(l.forEach((function(t){this.addPoint(t,!1,null,null,!1)}),this),null===this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement=u(this.xData),this.autoIncrement()),!0)},setData:function(t,e,i,n){var r,o=this,s=o.points,a=s&&s.length||0,l=o.options,c=o.chart,h=l.dataSorting,u=null,d=o.xAxis;u=l.turboThreshold;var p,f=this.xData,m=this.yData,g=(r=o.pointArrayMap)&&r.length,v=l.keys,x=0,b=1;if(t=t||[],r=t.length,e=L(e,!0),h&&h.enabled&&(t=this.sortData(t)),!1!==n&&r&&a&&!o.cropped&&!o.hasGroupedData&&o.visible&&!o.isSeriesBoosting&&(p=this.updateData(t,i)),!p){if(o.xIncrement=null,o.colorCounter=0,this.parallelArrays.forEach((function(t){o[t+"Data"].length=0})),u&&r>u)if(u=o.getFirstValidPoint(t),S(u))for(i=0;it?1:0})).forEach((function(t,e){t.x=e}),this),e.linkedSeries&&e.linkedSeries.forEach((function(e){var i=e.options,r=i.data;i.dataSorting&&i.dataSorting.enabled||!r||(r.forEach((function(i,o){r[o]=n(e,i),t[o]&&(r[o].x=t[o].x,r[o].index=o)})),e.setData(r,!1))})),t},getProcessedData:function(t){var e=this.xData,i=this.yData,n=e.length,r=0,o=this.xAxis,s=this.options,a=s.cropThreshold,l=t||this.getExtremesFromAll||s.getExtremesFromAll,c=this.isCartesian;t=o&&o.val2lin,s=!(!o||!o.logarithmic);var h=this.requireSorting;if(o){o=o.getExtremes();var u=o.min,d=o.max}if(c&&this.sorted&&!l&&(!a||n>a||this.forceCrop))if(e[n-1]d)e=[],i=[];else if(this.yData&&(e[0]d)){r=this.cropData(this.xData,this.yData,u,d),e=r.xData,i=r.yData,r=r.start;var p=!0}for(a=e.length||1;--a;)if(n=s?t(e[a])-t(e[a-1]):e[a]-e[a-1],0n&&h&&(y(15,!1,this.chart),h=!1);return{xData:e,yData:i,cropped:p,cropStart:r,closestPointRange:f}},processData:function(t){var e=this.xAxis;if(this.isCartesian&&!this.isDirty&&!e.isDirty&&!this.yAxis.isDirty&&!t)return!1;t=this.getProcessedData(),this.cropped=t.cropped,this.cropStart=t.cropStart,this.processedXData=t.xData,this.processedYData=t.yData,this.closestPointRange=this.basePointRange=t.closestPointRange},cropData:function(t,e,i,n,r){var o,s=t.length,a=0,l=s;for(r=L(r,this.cropShoulder),o=0;o=i){a=Math.max(0,o-r);break}for(i=o;in){l=i+r;break}return{xData:t.slice(a,l),yData:e.slice(a,l),start:a,end:l}},generatePoints:function(){var t,e=this.options,i=e.data,n=this.data,r=this.processedXData,o=this.processedYData,s=this.pointClass,a=r.length,l=this.cropStart||0,c=this.hasGroupedData;e=e.keys;var h,u=[];for(n||c||(n=[],n.length=i.length,n=this.data=n),e&&c&&(this.options.keys=!1),h=0;h=l&&(o[i-h]||f)<=c,g&&f)if(g=m.length)for(;g--;)S(m[g])&&(s[a++]=m[g]);else s[a++]=m}return t={dataMin:d(s),dataMax:u(s)},b(this,"afterGetExtremes",{dataExtremes:t}),t},applyExtremes:function(){var t=this.getExtremes();return this.dataMin=t.dataMin,this.dataMax=t.dataMax,t},getFirstValidPoint:function(t){for(var e=null,i=t.length,n=0;null===e&&n=E&&(E=null),w.total=w.stackTotal=P.total,w.percentage=P.total&&w.y/P.total*100,w.stackY=T,this.irregularWidths||P.setOffset(this.pointXOffset||0,this.barW||0)),w.yBottom=m(E)?p(a.translate(E,0,1,0,1),-1e5,1e5):null,h&&(T=this.modifyValue(T,w)),w.plotY="number"===typeof T&&1/0!==T?p(a.translate(T,0,1,0,1),-1e5,1e5):void 0,w.isInside=this.isPointInside(w),w.clientX=d?f(r.translate(_,0,0,0,1,u)):e,w.negative=w[v]<(i[v+"Threshold"]||g||0),w.category=o&&"undefined"!==typeof o[w.x]?o[w.x]:w.x,!w.isNull&&!1!==w.visible){"undefined"!==typeof R&&(x=Math.min(x,Math.abs(e-R)));var R=e}w.zone=this.zones.length&&w.getZone(),!w.graphic&&this.group&&s&&(w.isNew=!0)}this.closestPointRangePx=x,b(this,"afterTranslate")},getValidPoints:function(t,e,i){var n=this.chart;return(t||this.points||[]).filter((function(t){return!(e&&!n.isInsidePlot(t.plotX,t.plotY,n.inverted))&&(!1!==t.visible&&(i||!t.isNull))}))},getClipBox:function(t,e){var i=this.options,n=this.chart,r=n.inverted,o=this.xAxis,s=o&&this.yAxis,a=n.options.chart.scrollablePlotArea||{};return t&&!1===i.clip&&s?t=r?{y:-n.chartWidth+s.len+s.pos,height:n.chartWidth,width:n.chartHeight,x:-n.chartHeight+o.len+o.pos}:{y:-s.pos,height:n.chartHeight,width:n.chartWidth,x:-o.pos}:(t=this.clipBox||n.clipBox,e&&(t.width=n.plotSizeX,t.x=(n.scrollablePixelsX||0)*(a.scrollPositionX||0))),e?{width:t.width,x:t.x}:t},setClip:function(t){var e=this.chart,i=this.options,n=e.renderer,r=e.inverted,o=this.clipBox,s=this.getClipBox(t),a=this.sharedClipKey||["_sharedClip",t&&t.duration,t&&t.easing,s.height,i.xAxis,i.yAxis].join(),l=e[a],c=e[a+"m"];t&&(s.width=0,r&&(s.x=e.plotHeight+(!1!==i.clip?0:e.plotTop))),l?e.hasLoaded||l.attr(s):(t&&(e[a+"m"]=c=n.clipRect(r?e.plotSizeX+99:-99,r?-e.plotLeft:-e.plotTop,99,r?e.chartWidth:e.chartHeight)),e[a]=l=n.clipRect(s),l.count={length:0}),t&&!l.count[this.index]&&(l.count[this.index]=!0,l.count.length+=1),(!1!==i.clip||t)&&(this.group.clip(t||o?l:e.clipRect),this.markerGroup.clip(c),this.sharedClipKey=a),t||(l.count[this.index]&&(delete l.count[this.index],--l.count.length),0===l.count.length&&a&&e[a]&&(o||(e[a]=e[a].destroy()),e[a+"m"]&&(e[a+"m"]=e[a+"m"].destroy())))},animate:function(t){var e=this.chart,i=l(this.options.animation);if(!e.hasRendered)if(t)this.setClip(i);else{var n=this.sharedClipKey;t=e[n];var r=this.getClipBox(i,!0);t&&t.animate(r,i),e[n+"m"]&&e[n+"m"].animate({width:r.width+99,x:r.x-(e.inverted?0:99)},i)}},afterAnimate:function(){this.setClip(),b(this,"afterAnimate"),this.finishedAnimating=!0},drawPoints:function(){var t,e,i=this.points,n=this.chart,r=this.options.marker,o=this[this.specialGroup]||this.markerGroup,s=this.xAxis,a=L(r.enabled,!(s&&!s.isRadial)||null,this.closestPointRangePx>=r.enabledThreshold*r.radius);if(!1!==r.enabled||this._hasPointMarkers)for(t=0;to&&e.shadow)),a&&(a.startX=i.xMap,a.isArea=i.isArea)}))},getZonesGraphs:function(t){return this.zones.forEach((function(e,i){i=["zone-graph-"+i,"highcharts-graph highcharts-zone-graph-"+i+" "+(e.className||"")],this.chart.styledMode||i.push(e.color||this.color,e.dashStyle||this.options.dashStyle),t.push(i)}),this),t},applyZones:function(){var t,e,i,n,r,o,s,a,l=this,c=this.chart,h=c.renderer,u=this.zones,d=this.clips||[],f=this.graph,m=this.area,g=Math.max(c.chartWidth,c.chartHeight),y=this[(this.zoneAxis||"y")+"Axis"],v=c.inverted,x=!1;if(u.length&&(f||m)&&y&&"undefined"!==typeof y.min){var b=y.reversed,w=y.horiz;f&&!this.showLine&&f.hide(),m&&m.hide();var M=y.getExtremes();u.forEach((function(u,_){t=b?w?c.plotWidth:0:w?0:y.toPixels(M.min)||0,t=p(L(e,t),0,g),e=p(Math.round(y.toPixels(L(u.value,M.max),!0)||0),0,g),x&&(t=e=y.toPixels(M.max)),n=Math.abs(t-e),r=Math.min(t,e),o=Math.max(t,e),y.isXAxis?(i={x:v?o:r,y:0,width:n,height:g},w||(i.x=c.plotHeight-i.x)):(i={x:0,y:v?o:r,width:g,height:n},w&&(i.y=c.plotWidth-i.y)),v&&h.isVML&&(i=y.isXAxis?{x:0,y:b?r:o,height:i.width,width:c.chartWidth}:{x:i.y-c.plotLeft-c.spacingBox.x,y:0,width:i.height,height:c.chartHeight}),d[_]?d[_].animate(i):d[_]=h.clipRect(i),s=l["zone-area-"+_],a=l["zone-graph-"+_],f&&a&&a.clip(d[_]),m&&s&&s.clip(d[_]),x=u.value>M.max,l.resetZones&&0===e&&(e=void 0)})),this.clips=d}else l.visible&&(f&&f.show(!0),m&&m.show(!0))},invertGroups:function(t){function e(){["group","markerGroup"].forEach((function(e){i[e]&&(n.renderer.isVML&&i[e].attr({width:i.yAxis.len,height:i.xAxis.len}),i[e].width=i.yAxis.len,i[e].height=i.xAxis.len,i[e].invert(!i.isRadialSeries&&t))}))}var i=this,n=i.chart;i.xAxis&&(i.eventsToUnbind.push(h(n,"resize",e)),e(),i.invertGroups=e)},plotGroup:function(t,e,i,n,r){var o=this[t],s=!o;return i={visibility:i,zIndex:n||.1},"undefined"===typeof this.opacity||this.chart.styledMode||"inactive"===this.state||(i.opacity=this.opacity),s&&(this[t]=o=this.chart.renderer.g().add(r)),o.addClass("highcharts-"+e+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(m(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(o.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0),o.attr(i)[s?"attr":"animate"](this.getPlotBox()),o},getPlotBox:function(){var t=this.chart,e=this.xAxis,i=this.yAxis;return t.inverted&&(e=i,i=this.xAxis),{translateX:e?e.left:t.plotLeft,translateY:i?i.top:t.plotTop,scaleX:1,scaleY:1}},removeEvents:function(t){t?this.eventsToUnbind.length&&(this.eventsToUnbind.forEach((function(t){t()})),this.eventsToUnbind.length=0):C(this)},render:function(){var t=this,e=t.chart,i=t.options,n=l(i.animation),r=!t.finishedAnimating&&e.renderer.isSVG&&n.duration,o=t.visible?"inherit":"hidden",s=i.zIndex,a=t.hasRendered,c=e.seriesGroup,h=e.inverted;b(this,"render");var u=t.plotGroup("group","series",o,s,c);t.markerGroup=t.plotGroup("markerGroup","markers",o,s,c),r&&t.animate&&t.animate(!0),u.inverted=!(!t.isCartesian&&!t.invertable)&&h,t.drawGraph&&(t.drawGraph(),t.applyZones()),t.visible&&t.drawPoints(),t.drawDataLabels&&t.drawDataLabels(),t.redrawPoints&&t.redrawPoints(),t.drawTracker&&!1!==t.options.enableMouseTracking&&t.drawTracker(),t.invertGroups(h),!1===i.clip||t.sharedClipKey||a||u.clip(e.clipRect),r&&t.animate&&t.animate(),a||(r&&n.defer&&(r+=n.defer),t.animationTimeout=O((function(){t.afterAnimate()}),r||0)),t.isDirty=!1,t.hasRendered=!0,b(t,"afterRender")},redraw:function(){var t=this.chart,e=this.isDirty||this.isDirtyData,i=this.group,n=this.xAxis,r=this.yAxis;i&&(t.inverted&&i.attr({width:t.plotWidth,height:t.plotHeight}),i.animate({translateX:L(n&&n.left,t.plotLeft),translateY:L(r&&r.top,t.plotTop)})),this.translate(),this.render(),e&&delete this.kdTree},kdAxisArray:["clientX","plotY"],searchPoint:function(t,e){var i=this.xAxis,n=this.yAxis,r=this.chart.inverted;return this.searchKDTree({clientX:r?i.len-t.chartY+i.pos:t.chartX-i.pos,plotY:r?n.len-t.chartX+n.pos:t.chartY-n.pos},e,t)},buildKDTree:function(t){function e(t,n,r){var o;if(o=t&&t.length){var s=i.kdAxisArray[n%r];return t.sort((function(t,e){return t[s]-e[s]})),o=Math.floor(o/2),{point:t[o],left:e(t.slice(0,o),n+1,r),right:e(t.slice(o+1),n+1,r)}}}this.buildingKdTree=!0;var i=this,n=-1h?"left":"right",d=0>h?"right":"left",e[p]&&(p=n(t,e[p],i+1,l),u=p[a]p;)f--;this.updateParallelArrays(d,"splice",f,0,0),this.updateParallelArrays(d,f),l&&d.name&&(l[p]=d.name),h.splice(f,0,t),c&&(this.data.splice(f,0,null),this.processData()),"point"===o.legendType&&this.generatePoints(),i&&(s[0]&&s[0].remove?s[0].remove(!1):(s.shift(),this.updateParallelArrays(d,"shift"),h.shift())),!1!==r&&w(this,"addPoint",{point:d}),this.isDirtyData=this.isDirty=!0,e&&a.redraw(n)},removePoint:function(t,e,i){var n=this,r=n.data,o=r[t],s=n.points,a=n.chart,l=function(){s&&s.length===r.length&&s.splice(t,1),r.splice(t,1),n.options.data.splice(t,1),n.updateParallelArrays(o||{series:n},"splice",t,1),o&&o.destroy(),n.isDirty=!0,n.isDirtyData=!0,e&&a.redraw()};u(i,a),e=L(e,!0),o?o.firePointEvent("remove",null,l):l()},remove:function(t,e,i,n){function r(){o.destroy(n),o.remove=null,s.isDirtyLegend=s.isDirtyBox=!0,s.linkSeries(),L(t,!0)&&s.redraw(e)}var o=this,s=o.chart;!1!==i?w(o,"remove",null,r):r()},update:function(t,e){t=r.cleanRecursively(t,this.userOptions),w(this,"update",{options:t});var i,n=this,o=n.chart,s=n.userOptions,a=n.initialType||n.type,l=o.options.plotOptions,c=t.type||s.type||o.options.chart.type,h=!(this.hasDerivedData||c&&c!==this.type||"undefined"!==typeof t.pointStart||"undefined"!==typeof t.pointInterval||n.hasOptionChanged("dataGrouping")||n.hasOptionChanged("pointStart")||n.hasOptionChanged("pointInterval")||n.hasOptionChanged("pointIntervalUnit")||n.hasOptionChanged("keys")),u=d[a].prototype,p=["eventOptions","navigatorSeries","baseSeries"],f=n.finishedAnimating&&{animation:!1},m={};for(i in h&&(p.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","cropped","_hasPointMarkers","_hasPointLabels","mapMap","mapData","minY","maxY","minX","maxX"),!1!==t.visible&&p.push("area","graph"),n.parallelArrays.forEach((function(t){p.push(t+"Data")})),t.data&&(t.dataSorting&&b(n.options.dataSorting,t.dataSorting),this.setData(t.data,!1))),t=E(s,f,{index:"undefined"===typeof s.index?n.index:s.index,pointStart:L(l&&l.series&&l.series.pointStart,s.pointStart,n.xData[0])},!h&&{data:n.options.data},t),h&&t.data&&(t.data=n.options.data),p=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(p),p.forEach((function(t){p[t]=n[t],delete n[t]})),n.remove(!1,null,!1,!0),u)n[i]=void 0;if(d[c||a]?b(n,d[c||a].prototype):x(17,!0,o,{missingModuleFor:c||a}),p.forEach((function(t){n[t]=p[t]})),n.init(o,t),h&&this.points){var g=n.options;!1===g.visible?(m.graphic=1,m.dataLabel=1):n._hasPointLabels||(t=g.marker,s=g.dataLabels,t&&(!1===t.enabled||"symbol"in t)&&(m.graphic=1),s&&!1===s.enabled&&(m.dataLabel=1)),this.points.forEach((function(t){t&&t.series&&(t.resolveColor(),Object.keys(m).length&&t.destroyElements(m),!1===g.showInLegend&&t.legendItem&&o.legend.destroyItem(t))}),this)}n.initialType=a,o.linkSeries(),w(this,"afterUpdate"),L(e,!0)&&o.redraw(!!h&&void 0)},setName:function(t){this.name=this.options.name=this.userOptions.name=t,this.chart.isDirtyLegend=!0},hasOptionChanged:function(t){var e=this.options[t],i=this.chart.options.plotOptions,n=this.userOptions[t];return n?e!==n:e!==L(i&&i[this.type]&&i[this.type][t],i&&i.series&&i.series[t],e)}}),b(e.prototype,{update:function(t,e){var i=this.chart,n=t&&t.events||{};t=E(this.userOptions,t),i.options[this.coll].indexOf&&(i.options[this.coll][i.options[this.coll].indexOf(this.userOptions)]=t),A(i.options[this.coll].events,(function(t,e){"undefined"===typeof n[e]&&(n[e]=void 0)})),this.destroy(!0),this.init(i,b(t,{events:n})),i.isDirtyBox=!0,L(e,!0)&&i.redraw()},remove:function(t){for(var e=this.chart,i=this.coll,n=this.series,r=n.length;r--;)n[r]&&n[r].remove(!1);v(e.axes,this),v(e[i],this),M(e.options[i])?e.options[i].splice(this.options.index,1):delete e.options[i],e[i].forEach((function(t,e){t.options.index=t.userOptions.index=e})),this.destroy(),e.isDirtyBox=!0,L(t,!0)&&e.redraw()},setTitle:function(t,e){this.update({title:t},e)},setCategories:function(t,e){this.update({categories:t},e)}})})),e(i,"Series/AreaSeries.js",[i["Core/Series/Series.js"],i["Core/Color/Color.js"],i["Core/Globals.js"],i["Mixins/LegendSymbol.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r){var o=e.parse,s=r.objectEach,a=r.pick,l=i.Series;t.seriesType("area","line",{threshold:0},{singleStacks:!1,getStackPoints:function(t){var e,i=[],n=[],r=this.xAxis,o=this.yAxis,l=o.stacking.stacks[this.stackKey],c={},h=this.index,u=o.series,d=u.length,p=a(o.options.reversedStacks,!0)?1:-1;if(t=t||this.points,this.options.stacking){for(e=0;et&&h>o?(h=Math.max(t,o),u=2*o-h):hn&&u>o?(u=Math.max(n,o),h=2*o-u):u=Math.abs(e)&&.5t.closestPointRange*t.xAxis.transA;n=t.borderWidth=m(i.borderWidth,n?0:1);var r=t.xAxis,s=t.yAxis,a=i.threshold,l=t.translatedThreshold=s.getThreshold(a),u=m(i.minPointLength,5),d=t.getColumnMetrics(),f=d.width,g=t.barW=Math.max(f,1+2*n),y=t.pointXOffset=d.offset,v=t.dataMin,x=t.dataMax;e.inverted&&(l-=.5),i.pointPadding&&(g=Math.ceil(g)),o.prototype.translate.apply(t),t.points.forEach((function(n){var o=m(n.yBottom,l),b=999+Math.abs(o),w=f,M=n.plotX||0;b=c(n.plotY,-b,s.len+b);var _=M+y,S=g,T=Math.min(b,o),E=Math.max(b,o)-T;if(u&&Math.abs(E)u?o-u:l-(A?u:0)}h(n.options.pointWidth)&&(w=S=Math.ceil(n.options.pointWidth),_-=Math.round((w-f)/2)),i.centerInCategory&&(_=t.adjustForMissingColumns(_,w,n,d)),n.barX=_,n.pointWidth=w,n.tooltipPos=e.inverted?[s.len+s.pos-e.plotLeft-b,r.len+r.pos-e.plotTop-(M||0)-y-S/2,E]:[_+S/2,b+s.pos-e.plotTop,E],n.shapeType=t.pointClass.prototype.shapeType||"rect",n.shapeArgs=t.crispCol.apply(t,n.isNull?[_,l,S,0]:[_,T,S,E])}))},getSymbol:t,drawLegendSymbol:r.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(t,e){var i=this.options,n=this.pointAttrToOptions||{},r=n.stroke||"borderColor",o=n["stroke-width"]||"borderWidth",s=t&&t.color||this.color,a=t&&t[r]||i[r]||this.color||s,c=t&&t[o]||i[o]||this[o]||0;n=t&&t.options.dashStyle||i.dashStyle;var h=m(t&&t.opacity,i.opacity,1);if(t&&this.zones.length){var u=t.getZone();s=t.options.color||u&&(u.color||t.nonZonedColor)||this.color,u&&(a=u.borderColor||a,n=u.dashStyle||n,c=u.borderWidth||c)}return e&&t&&(t=f(i.states[e],t.options.states&&t.options.states[e]||{}),e=t.brightness,s=t.color||"undefined"!==typeof e&&l(s).brighten(t.brightness).get()||s,a=t[r]||a,c=t[o]||c,n=t.dashStyle||n,h=m(t.opacity,h)),r={fill:s,stroke:a,"stroke-width":c,opacity:h},n&&(r.dashstyle=n),r},drawPoints:function(){var t,e=this,i=this.chart,n=e.options,r=i.renderer,o=n.animationLimit||250;e.points.forEach((function(s){var a=s.graphic,l=!!a,c=a&&i.pointCount
{series.name}
',pointFormat:"x: {point.x}
y: {point.y}
"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,drawGraph:function(){(this.options.lineWidth||0===this.options.lineWidth&&this.graph&&this.graph.strokeWidth())&&n.prototype.drawGraph.call(this)},applyJitter:function(){var t=this,e=this.options.jitter,i=this.points.length;e&&this.points.forEach((function(n,r){["x","y"].forEach((function(o,s){var a="plot"+o.toUpperCase();if(e[o]&&!n.isNull){var l=t[o+"Axis"],c=e[o]*l.transA;if(l&&!l.isLog){var h=Math.max(0,n[a]-c);l=Math.min(l.len,n[a]+c),s=1e4*Math.sin(r+s*i),n[a]=h+(l-h)*(s-Math.floor(s)),"x"===o&&(n.clientX=n.plotX)}}}))}))}}),i(n,"afterTranslate",(function(){this.applyJitter&&this.applyJitter()}))})),e(i,"Mixins/CenteredSeries.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.isNumber,n=e.pick,r=e.relativeLength,o=t.deg2rad;return t.CenteredSeriesMixin={getCenter:function(){var e=this.options,i=this.chart,o=2*(e.slicedOffset||0),s=i.plotWidth-2*o,a=i.plotHeight-2*o,l=e.center,c=Math.min(s,a),h=e.size,u=e.innerSize||0;for("string"===typeof h&&(h=parseFloat(h)),"string"===typeof u&&(u=parseFloat(u)),e=[n(l[0],"50%"),n(l[1],"50%"),n(h&&0>h?void 0:e.size,"100%"),n(u&&0>u?void 0:e.innerSize||0,"0%")],!i.angular||this instanceof t.Series||(e[3]=0),l=0;4>l;++l)h=e[l],i=2>l||2===l&&/%$/.test(h),e[l]=r(h,[s,a,c,e[2]][l])+(i?o:0);return e[3]>e[2]&&(e[3]=e[2]),e},getStartAndEndRadians:function(t,e){return t=i(t)?t:0,e=i(e)&&e>t&&360>e-t?e:t+360,{start:o*(t+-90),end:o*(e+-90)}}}})),e(i,"Series/PieSeries.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Series/Series.js"],i["Mixins/CenteredSeries.js"],i["Core/Globals.js"],i["Mixins/LegendSymbol.js"],i["Series/LineSeries.js"],i["Core/Series/Point.js"],i["Core/Renderer/SVG/SVGRenderer.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r,o,s,a,l){var c=t.setAnimation,h=i.getStartAndEndRadians;t=n.noop;var u=l.addEvent,d=l.clamp,p=l.defined,f=l.fireEvent,m=l.isNumber,g=l.merge,y=l.pick,v=l.relativeLength;e.seriesType("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{allowOverlap:!0,connectorPadding:5,connectorShape:"fixedOffset",crookDistance:"70%",distance:30,enabled:!0,formatter:function(){return this.point.isNull?void 0:this.point.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0,inactiveOtherPoints:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:e.seriesTypes.column.prototype.pointAttribs,animate:function(t){var e=this,i=e.points,n=e.startAngleRad;t||i.forEach((function(t){var i=t.graphic,r=t.shapeArgs;i&&r&&(i.attr({r:y(t.startR,e.center&&e.center[3]/2),start:n,end:n}),i.animate({r:r.r,start:r.start,end:r.end},e.options.animation))}))},hasData:function(){return!!this.processedXData.length},updateTotals:function(){var t,e=0,i=this.points,n=i.length,r=this.options.ignoreHiddenPoint;for(t=0;t1.5*Math.PI?m-=2*Math.PI:m<-Math.PI/2&&(m+=2*Math.PI),d.slicedTranslation={translateX:Math.round(Math.cos(m)*n),translateY:Math.round(Math.sin(m)*n)};var g=Math.cos(m)*t[2]/2,x=Math.sin(m)*t[2]/2;d.tooltipPos=[t[0]+.7*g,t[1]+.7*x],d.half=m<-Math.PI/2||m>Math.PI/2?1:0,d.angle=m,p=Math.min(r,d.labelDistance/5),d.labelPosition={natural:{x:t[0]+g+Math.cos(m)*d.labelDistance,y:t[1]+x+Math.sin(m)*d.labelDistance},final:{},alignment:0>d.labelDistance?"center":d.half?"right":"left",connectorPosition:{breakAt:{x:t[0]+g+Math.cos(m)*p,y:t[1]+x+Math.sin(m)*p},touchingSliceAt:{x:t[0]+g,y:t[1]+x}}}}f(this,"afterTranslate")},drawEmpty:function(){var t=this.startAngleRad,e=this.endAngleRad,i=this.options;if(0===this.total&&this.center){var n=this.center[0],r=this.center[1];this.graph||(this.graph=this.chart.renderer.arc(n,r,this.center[1]/2,0,t,e).addClass("highcharts-empty-series").add(this.group)),this.graph.attr({d:a.prototype.symbols.arc(n,r,this.center[2]/2,0,{start:t,end:e,innerR:this.center[3]/2})}),this.chart.styledMode||this.graph.attr({"stroke-width":i.borderWidth,fill:i.fillColor||"none",stroke:i.color||"#cccccc"})}else this.graph&&(this.graph=this.graph.destroy())},redrawPoints:function(){var t,e,i,n,r=this,o=r.chart,s=o.renderer,a=r.options.shadow;this.drawEmpty(),!a||r.shadowGroup||o.styledMode||(r.shadowGroup=s.g("shadow").attr({zIndex:-1}).add(r.group)),r.points.forEach((function(l){var c={};if(e=l.graphic,!l.isNull&&e){if(n=l.shapeArgs,t=l.getTranslate(),!o.styledMode){var h=l.shadowGroup;a&&!h&&(h=l.shadowGroup=s.g("shadow").add(r.shadowGroup)),h&&h.attr(t),i=r.pointAttribs(l,l.selected&&"select")}l.delayedRendering?(e.setRadialReference(r.center).attr(n).attr(t),o.styledMode||e.attr(i).attr({"stroke-linejoin":"round"}).shadow(a,h),l.delayedRendering=!1):(e.setRadialReference(r.center),o.styledMode||g(!0,c,i),g(!0,c,n,t),e.animate(c)),e.attr({visibility:l.visible?"inherit":"hidden"}),e.addClass(l.getClassName())}else e&&(l.graphic=e.destroy())}))},drawPoints:function(){var t=this.chart.renderer;this.points.forEach((function(e){e.graphic&&e.hasNewShapeType()&&(e.graphic=e.graphic.destroy()),e.graphic||(e.graphic=t[e.shapeType](e.shapeArgs).add(e.series.group),e.delayedRendering=!0)}))},searchPoint:t,sortByAngle:function(t,e){t.sort((function(t,i){return"undefined"!==typeof t.angle&&(i.angle-t.angle)*e}))},drawLegendSymbol:r.drawRectangle,getCenter:i.getCenter,getSymbol:t,drawGraph:null},{init:function(){s.prototype.init.apply(this,arguments);var t=this;t.name=y(t.name,"Slice");var e=function(e){t.slice("select"===e.type)};return u(t,"select",e),u(t,"unselect",e),t},isValid:function(){return m(this.y)&&0<=this.y},setVisible:function(t,e){var i=this,n=i.series,r=n.chart,o=n.options.ignoreHiddenPoint;e=y(e,o),t!==i.visible&&(i.visible=i.options.visible=t="undefined"===typeof t?!i.visible:t,n.options.data[n.data.indexOf(i)]=i.options,["graphic","dataLabel","connector","shadowGroup"].forEach((function(e){i[e]&&i[e][t?"show":"hide"](!0)})),i.legendItem&&r.legend.colorizeItem(i,t),t||"hover"!==i.state||i.setState(""),o&&(n.isDirty=!0),e&&r.redraw())},slice:function(t,e,i){var n=this.series;c(i,n.chart),y(e,!0),this.sliced=this.options.sliced=p(t)?t:!this.sliced,n.options.data[n.data.indexOf(this)]=this.options,this.graphic&&this.graphic.animate(this.getTranslate()),this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},getTranslate:function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},haloPath:function(t){var e=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(e.x,e.y,e.r+t,e.r+t,{innerR:e.r-1,start:e.start,end:e.end})},connectorShapes:{fixedOffset:function(t,e,i){var n=e.breakAt;return e=e.touchingSliceAt,[["M",t.x,t.y],i.softConnector?["C",t.x+("left"===t.alignment?-5:5),t.y,2*n.x-e.x,2*n.y-e.y,n.x,n.y]:["L",n.x,n.y],["L",e.x,e.y]]},straight:function(t,e){return e=e.touchingSliceAt,[["M",t.x,t.y],["L",e.x,e.y]]},crookedLine:function(t,e,i){e=e.touchingSliceAt;var n=this.series,r=n.center[0],o=n.chart.plotWidth,s=n.chart.plotLeft;n=t.alignment;var a=this.shapeArgs.r;return i=v(i.crookDistance,1),o="left"===n?r+a+(o+s-r-a)*(1-i):s+(r-a)*i,i=["L",o,t.y],r=!0,("left"===n?o>t.x||oe.x)&&(r=!1),t=[["M",t.x,t.y]],r&&t.push(i),t.push(["L",e.x,e.y]),t}},getConnectorPath:function(){var t=this.labelPosition,e=this.series.options.dataLabels,i=e.connectorShape,n=this.connectorShapes;return n[i]&&(i=n[i]),i.call(this,{x:t.final.x,y:t.final.y,alignment:t.alignment},t.connectorPosition,e)}})})),e(i,"Core/Series/DataLabels.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Globals.js"],i["Core/Series/CartesianSeries.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.getDeferredAnimation;t=e.noop;var o=e.seriesTypes,s=n.arrayMax,a=n.clamp,l=n.defined,c=n.extend,h=n.fireEvent,u=n.format,d=n.isArray,p=n.merge,f=n.objectEach,m=n.pick,g=n.relativeLength,y=n.splat,v=n.stableSort;e.distribute=function(t,i,n){function r(t,e){return t.target-e.target}var o,s=!0,l=t,c=[],h=0,u=l.reducedLen||i;for(o=t.length;o--;)h+=t[o].size;if(h>u){for(v(t,(function(t,e){return(e.rank||0)-(t.rank||0)})),h=o=0;h<=u;)h+=t[o].size,o++;c=t.splice(o-1,t.length)}for(v(t,r),t=t.map((function(t){return{size:t.size,targets:[t.target],align:m(t.align,.5)}}));s;){for(o=t.length;o--;)s=t[o],h=(Math.min.apply(0,s.targets)+Math.max.apply(0,s.targets))/2,s.pos=a(h-s.size*s.align,0,i-s.size);for(o=t.length,s=!1;o--;)0t[o].pos&&(t[o-1].size+=t[o].size,t[o-1].targets=t[o-1].targets.concat(t[o].targets),t[o-1].align=.5,t[o-1].pos+t[o-1].size>i&&(t[o-1].pos=i-t[o-1].size),t.splice(o,1),s=!0)}l.push.apply(l,c),o=0,t.some((function(t){var r=0;if(t.targets.some((function(){if(l[o].pos=t.pos+r,"undefined"!==typeof n&&Math.abs(l[o].pos-l[o].target)>n)return l.slice(0,o+1).forEach((function(t){delete t.pos})),l.reducedLen=(l.reducedLen||i)-.1*i,l.reducedLen>.1*i&&e.distribute(l,i,n),!0;r+=l[o].size,o++})))return!0})),v(l,r)},i.prototype.drawDataLabels=function(){function t(t,e){var i=e.filter;return!i||(e=i.operator,t=t[i.property],i=i.value,">"===e&&t>i||"<"===e&&t="===e&&t>=i||"<="===e&&t<=i||"=="===e&&t==i||"==="===e&&t===i)}function e(t,e){var i,n=[];if(d(t)&&!d(e))n=t.map((function(t){return p(t,e)}));else if(d(e)&&!d(t))n=e.map((function(e){return p(t,e)}));else if(d(t)||d(e))for(i=Math.max(t.length,e.length);i--;)n[i]=p(t[i],e[i]);else n=p(t,e);return n}var i,n=this,o=n.chart,s=n.options,a=s.dataLabels,c=n.points,g=n.hasRendered||0,v=a.animation;v=a.defer?r(o,v,n):{defer:0,duration:0};var x=o.renderer;if(a=e(e(o.options.plotOptions&&o.options.plotOptions.series&&o.options.plotOptions.series.dataLabels,o.options.plotOptions&&o.options.plotOptions[n.type]&&o.options.plotOptions[n.type].dataLabels),a),h(this,"drawDataLabels"),d(a)||a.enabled||n._hasPointLabels){var b=n.plotGroup("dataLabelsGroup","data-labels",g?"inherit":"hidden",a.zIndex||6);b.attr({opacity:+g}),!g&&(g=n.dataLabelsGroup)&&(n.visible&&b.show(!0),g[s.animation?"animate":"attr"]({opacity:1},v)),c.forEach((function(r){i=y(e(a,r.dlOptions||r.options&&r.options.dataLabels)),i.forEach((function(e,i){var a=e.enabled&&(!r.isNull||r.dataLabelOnNull)&&t(r,e),c=r.dataLabels?r.dataLabels[i]:r.dataLabel,h=r.connectors?r.connectors[i]:r.connector,d=m(e.distance,r.labelDistance),p=!c;if(a){var g=r.getLabelConfig(),y=m(e[r.formatPrefix+"Format"],e.format);g=l(y)?u(y,g,o):(e[r.formatPrefix+"Formatter"]||e.formatter).call(g,e),y=e.style;var v=e.rotation;o.styledMode||(y.color=m(e.color,y.color,n.color,"#000000"),"contrast"===y.color?(r.contrastColor=x.getContrast(r.color||n.color),y.color=!l(d)&&e.inside||0>d||s.stacking?r.contrastColor:"#000000"):delete r.contrastColor,s.cursor&&(y.cursor=s.cursor));var w={r:e.borderRadius||0,rotation:v,padding:e.padding,zIndex:1};o.styledMode||(w.fill=e.backgroundColor,w.stroke=e.borderColor,w["stroke-width"]=e.borderWidth),f(w,(function(t,e){"undefined"===typeof t&&delete w[e]}))}!c||a&&l(g)?a&&l(g)&&(c?w.text=g:(r.dataLabels=r.dataLabels||[],c=r.dataLabels[i]=v?x.text(g,0,-9999,e.useHTML).addClass("highcharts-data-label"):x.label(g,0,-9999,e.shape,null,null,e.useHTML,null,"data-label"),i||(r.dataLabel=c),c.addClass(" highcharts-data-label-color-"+r.colorIndex+" "+(e.className||"")+(e.useHTML?" highcharts-tracker":""))),c.options=e,c.attr(w),o.styledMode||c.css(y).shadow(e.shadow),c.added||c.add(b),e.textPath&&!e.useHTML&&(c.setTextPath(r.getDataLabelPath&&r.getDataLabelPath(c)||r.graphic,e.textPath),r.dataLabelPath&&!e.textPath.enabled&&(r.dataLabelPath=r.dataLabelPath.destroy())),n.alignDataLabel(r,c,e,null,p)):(r.dataLabel=r.dataLabel&&r.dataLabel.destroy(),r.dataLabels&&(1===r.dataLabels.length?delete r.dataLabels:delete r.dataLabels[i]),i||delete r.dataLabel,h&&(r.connector=r.connector.destroy(),r.connectors&&(1===r.connectors.length?delete r.connectors:delete r.connectors[i])))}))}))}h(this,"afterDrawDataLabels")},i.prototype.alignDataLabel=function(t,e,i,n,r){var o=this,s=this.chart,a=this.isCartesian&&s.inverted,l=this.enabledDataSorting,h=m(t.dlBox&&t.dlBox.centerX,t.plotX,-9999),u=m(t.plotY,-9999),d=e.getBBox(),p=i.rotation,f=i.align,g=s.isInsidePlot(h,Math.round(u),a),y="justify"===m(i.overflow,l?"none":"justify"),v=this.visible&&!1!==t.visible&&(t.series.forceDL||l&&!y||g||i.inside&&n&&s.isInsidePlot(h,a?n.x+1:n.y+n.height-1,a)),x=function(i){l&&o.xAxis&&!y&&o.setDataLabelStartPos(t,e,r,g,i)};if(v){var b=s.renderer.fontMetrics(s.styledMode?void 0:i.style.fontSize,e).b;n=c({x:a?this.yAxis.len-u:h,y:Math.round(a?this.xAxis.len-h:u),width:0,height:0},n),c(i,{width:d.width,height:d.height}),p?(y=!1,h=s.renderer.rotCorr(b,p),h={x:n.x+(i.x||0)+n.width/2+h.x,y:n.y+(i.y||0)+{top:0,middle:.5,bottom:1}[i.verticalAlign]*n.height},x(h),e[r?"attr":"animate"](h).attr({align:f}),x=(p+720)%360,x=180x,"left"===f?h.y-=x?d.height:0:"center"===f?(h.x-=d.width/2,h.y-=d.height/2):"right"===f&&(h.x-=d.width,h.y-=x?0:d.height),e.placed=!0,e.alignAttr=h):(x(n),e.align(i,null,n),h=e.alignAttr),y&&0<=n.height?this.justifyDataLabel(e,i,h,d,n,r):m(i.crop,!0)&&(v=s.isInsidePlot(h.x,h.y)&&s.isInsidePlot(h.x+d.width,h.y+d.height)),i.shape&&!p&&e[r?"attr":"animate"]({anchorX:a?s.plotWidth-t.plotY:t.plotX,anchorY:a?s.plotHeight-t.plotX:t.plotY})}r&&l&&(e.placed=!1),v||l&&!y||(e.hide(!0),e.placed=!1)},i.prototype.setDataLabelStartPos=function(t,e,i,n,r){var o=this.chart,s=o.inverted,a=this.xAxis,l=a.reversed,c=s?e.height/2:e.width/2;t=(t=t.pointWidth)?t/2:0,a=s?r.x:l?-c-t:a.width-c+t,r=s?l?this.yAxis.height-c+t:-c-t:r.y,e.startXPos=a,e.startYPos=r,n?"hidden"===e.visibility&&(e.show(),e.attr({opacity:0}).animate({opacity:1})):e.attr({opacity:1}).animate({opacity:0},void 0,e.hide),o.hasRendered&&(i&&e.attr({x:e.startXPos,y:e.startYPos}),e.placed=!0)},i.prototype.justifyDataLabel=function(t,e,i,n,r,o){var s=this.chart,a=e.align,l=e.verticalAlign,c=t.box?0:t.padding||0,h=e.x;h=void 0===h?0:h;var u=e.y,d=void 0===u?0:u;if(u=i.x+c,0>u){"right"===a&&0<=h?(e.align="left",e.inside=!0):h-=u;var p=!0}return u=i.x+n.width-c,u>s.plotWidth&&("left"===a&&0>=h?(e.align="right",e.inside=!0):h+=s.plotWidth-u,p=!0),u=i.y+c,0>u&&("bottom"===l&&0<=d?(e.verticalAlign="top",e.inside=!0):d-=u,p=!0),u=i.y+n.height-c,u>s.plotHeight&&("top"===l&&0>=d?(e.verticalAlign="bottom",e.inside=!0):d+=s.plotHeight-u,p=!0),p&&(e.x=h,e.y=d,t.placed=!o,t.align(e,void 0,r)),p},o.pie&&(o.pie.prototype.dataLabelPositioners={radialDistributionY:function(t){return t.top+t.distributeBox.pos},radialDistributionX:function(t,e,i,n){return t.getX(ie.bottom-2?n:i,e.half,e)},justify:function(t,e,i){return i[0]+(t.half?-1:1)*(e+t.labelDistance)},alignToPlotEdges:function(t,e,i,n){return t=t.getBBox().width,e?t+n:i-t-n},alignToConnectors:function(t,e,i,n){var r,o=0;return t.forEach((function(t){r=t.dataLabel.getBBox().width,r>o&&(o=r)})),e?o+n:i-o-n}},o.pie.prototype.drawDataLabels=function(){var t,n,r,o,a,c,h,u,d,f,g,y,v=this,x=v.data,b=v.chart,w=v.options.dataLabels||{},M=w.connectorPadding,_=b.plotWidth,S=b.plotHeight,T=b.plotLeft,E=Math.round(b.chartWidth/3),A=v.center,L=A[2]/2,C=A[1],P=[[],[]],O=[0,0,0,0],R=v.dataLabelPositioners;v.visible&&(w.enabled||v._hasPointLabels)&&(x.forEach((function(t){t.dataLabel&&t.visible&&t.dataLabel.shortened&&(t.dataLabel.attr({width:"auto"}).css({width:"auto",textOverflow:"clip"}),t.dataLabel.shortened=!1)})),i.prototype.drawDataLabels.apply(v),x.forEach((function(t){t.dataLabel&&(t.visible?(P[t.half].push(t),t.dataLabel._pos=null,!l(w.style.width)&&!l(t.options.dataLabels&&t.options.dataLabels.style&&t.options.dataLabels.style.width)&&t.dataLabel.getBBox().width>E&&(t.dataLabel.css({width:Math.round(.7*E)+"px"}),t.dataLabel.shortened=!0)):(t.dataLabel=t.dataLabel.destroy(),t.dataLabels&&1===t.dataLabels.length&&delete t.dataLabels))})),P.forEach((function(i,n){var r,s=i.length,p=[];if(s){if(v.sortByAngle(i,n-.5),0_-M&&0===n&&(x=Math.round(u+a-_+M),O[1]=Math.max(x,O[1])),0>d-h/2?O[0]=Math.max(Math.round(h/2-d),O[0]):d+h/2>S&&(O[2]=Math.max(Math.round(d+h/2-S),O[2])),o.sideOverflow=x)}}})),0===s(O)||this.verifyDataLabelOverflow(O))&&(this.placeDataLabels(),this.points.forEach((function(t){var e;(y=p(w,t.options.dataLabels),n=m(y.connectorWidth,1))&&(r=t.connector,(o=t.dataLabel)&&o._pos&&t.visible&&0m(this.translatedThreshold,a.yAxis.len)),h=m(n.inside,!!this.options.stacking);l&&(r=p(l),0>r.y&&(r.height+=r.y,r.y=0),l=r.y+r.height-a.yAxis.len,0=u.x+u.width||d.x+d.width<=u.x||d.y>=u.y+u.height||d.y+d.height<=u.y||((h.labelrank=a&&o<=l||c||!f(o))&&(h=!0),n[c?"zoomX":"zoomY"]&&h&&(e=s.zoom(t.min,t.max),s.displayBtn&&(r=!0))}));var s=i.resetZoomButton;r&&!s?i.showResetZoom():!r&&b(s)&&(i.resetZoomButton=s.destroy()),e&&i.redraw(_(i.options.chart.animation,t&&t.animation,100>i.pointCount))},pan:function(t,e){var i,n=this,r=n.hoverPoints,o=n.options.chart,s=n.options.mapNavigation&&n.options.mapNavigation.enabled;e="object"===typeof e?e:{enabled:e,type:"x"},o&&o.panning&&(o.panning=e);var a=e.type;g(this,"pan",{originalEvent:t},(function(){r&&r.forEach((function(t){t.setState()}));var e=[1];"xy"===a?e=[1,0]:"y"===a&&(e=[0]),e.forEach((function(e){var r=n[e?"xAxis":"yAxis"][0],o=r.horiz,l=t[o?"chartX":"chartY"];o=o?"mouseDownX":"mouseDownY";var c=n[o],h=(r.pointRange||0)/2,u=r.reversed&&!n.inverted||!r.reversed&&n.inverted?-1:1,d=r.getExtremes(),p=r.toValue(c-l,!0)+h*u;u=r.toValue(c+r.len-l,!0)-h*u;var f=u=u&&p<=h&&(r.setExtremes(c,p,!1,!1,{trigger:"pan"}),n.resetZoomButton||s||c===u||p===h||!a.match("y")||(n.showResetZoom(),r.displayBtn=!1),i=!0),n[o]=l)})),i&&n.redraw(!1),p(n.container,{cursor:"move"})}))}}),m(s.prototype,{select:function(t,e){var i=this,n=i.series,r=n.chart;this.selectedStaging=t=_(t,!i.selected),i.firePointEvent(t?"select":"unselect",{accumulate:e},(function(){i.selected=i.options.selected=t,n.options.data[n.data.indexOf(i)]=i.options,i.setState(t&&"select"),e||r.getSelectedPoints().forEach((function(t){var e=t.series;t.selected&&t!==i&&(t.selected=t.options.selected=!1,e.options.data[e.data.indexOf(t)]=t.options,t.setState(r.hoverPoints&&e.options.inactiveOtherPoints?"inactive":""),t.firePointEvent("unselect"))}))})),delete this.selectedStaging},onMouseOver:function(t){var e=this.series.chart,i=e.pointer;t=t?i.normalize(t):i.getChartCoordinatesFromPoint(this,e.inverted),i.runPointActions(t,this)},onMouseOut:function(){var t=this.series.chart;this.firePointEvent("mouseOut"),this.series.options.inactiveOtherPoints||(t.hoverPoints||[]).forEach((function(t){t.setState()})),t.hoverPoints=t.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var t=this,e=w(t.series.options.point,t.options).events;t.events=e,M(e,(function(e,i){v(e)&&u(t,i,e)})),this.hasImportedEvents=!0}},setState:function(t,e){var i,n=this.series,r=this.state,o=n.options.states[t||"normal"]||{},s=h.plotOptions[n.type].marker&&n.options.marker,a=s&&!1===s.enabled,l=s&&s.states&&s.states[t||"normal"]||{},c=!1===l.enabled,u=n.stateMarkerGraphic,d=this.marker||{},p=n.chart,f=n.halo,y=s&&n.markerAttribs;if(t=t||"",!(t===this.state&&!e||this.selected&&"select"!==t||!1===o.enabled||t&&(c||a&&!1===l.enabled)||t&&d.states&&d.states[t]&&!1===d.states[t].enabled)){if(this.state=t,y&&(i=n.markerAttribs(this,t)),this.graphic){if(r&&this.graphic.removeClass("highcharts-point-"+r),t&&this.graphic.addClass("highcharts-point-"+t),!p.styledMode){var v=n.pointAttribs(this,t),x=_(p.options.chart.animation,o.animation);n.options.inactiveOtherPoints&&v.opacity&&((this.dataLabels||[]).forEach((function(t){t&&t.animate({opacity:v.opacity},x)})),this.connector&&this.connector.animate({opacity:v.opacity},x)),this.graphic.animate(v,x)}i&&this.graphic.animate(i,_(p.options.chart.animation,l.animation,s.animation)),u&&u.hide()}else t&&l&&(r=d.symbol||n.symbol,u&&u.currentSymbol!==r&&(u=u.destroy()),i&&(u?u[e?"animate":"attr"]({x:i.x,y:i.y}):r&&(n.stateMarkerGraphic=u=p.renderer.symbol(r,i.x,i.y,i.width,i.height).add(n.markerGroup),u.currentSymbol=r)),!p.styledMode&&u&&u.attr(n.pointAttribs(this,t))),u&&(u[t&&this.isInside?"show":"hide"](),u.element.point=this);t=o.halo,o=(u=this.graphic||u)&&u.visibility||"inherit",t&&t.size&&u&&"hidden"!==o&&!this.isCluster?(f||(n.halo=f=p.renderer.path().add(u.parentGroup)),f.show()[e?"animate":"attr"]({d:this.haloPath(t.size)}),f.attr({class:"highcharts-halo highcharts-color-"+_(this.colorIndex,n.colorIndex)+(this.className?" "+this.className:""),visibility:o,zIndex:-1}),f.point=this,p.styledMode||f.attr(m({fill:this.color||n.color,"fill-opacity":t.opacity},t.attributes))):f&&f.point&&f.point.haloPath&&f.animate({d:f.point.haloPath(0)},null,f.hide),g(this,"afterSetState")}},haloPath:function(t){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-t,this.plotY-t,2*t,2*t)}}),m(r.prototype,{onMouseOver:function(){var t=this.chart,e=t.hoverSeries;t.pointer.setHoverChartIndex(),e&&e!==this&&e.onMouseOut(),this.options.events.mouseOver&&g(this,"mouseOver"),this.setState("hover"),t.hoverSeries=this},onMouseOut:function(){var t=this.options,e=this.chart,i=e.tooltip,n=e.hoverPoint;e.hoverSeries=null,n&&n.onMouseOut(),this&&t.events.mouseOut&&g(this,"mouseOut"),!i||this.stickyTracking||i.shared&&!this.noSharedTooltip||i.hide(),e.series.forEach((function(t){t.setState("",!0)}))},setState:function(t,e){var i=this,n=i.options,r=i.graph,o=n.inactiveOtherPoints,s=n.states,a=n.lineWidth,l=n.opacity,c=_(s[t||"normal"]&&s[t||"normal"].animation,i.chart.options.chart.animation);if(n=0,t=t||"",i.state!==t&&([i.group,i.markerGroup,i.dataLabelsGroup].forEach((function(e){e&&(i.state&&e.removeClass("highcharts-series-"+i.state),t&&e.addClass("highcharts-series-"+t))})),i.state=t,!i.chart.styledMode)){if(s[t]&&!1===s[t].enabled)return;if(t&&(a=s[t].lineWidth||a+(s[t].lineWidthPlus||0),l=_(s[t].opacity,l)),r&&!r.dashstyle)for(s={"stroke-width":a},r.animate(s,c);i["zone-graph-"+n];)i["zone-graph-"+n].attr(s),n+=1;o||[i.group,i.markerGroup,i.dataLabelsGroup,i.labelBySeries].forEach((function(t){t&&t.animate({opacity:l},c)}))}e&&o&&i.points&&i.setAllPointsToState(t)},setAllPointsToState:function(t){this.points.forEach((function(e){e.setState&&e.setState(t)}))},setVisible:function(t,e){var i=this,n=i.chart,r=i.legendItem,o=n.options.chart.ignoreHiddenSeries,s=i.visible,a=(i.visible=t=i.options.visible=i.userOptions.visible="undefined"===typeof t?!s:t)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach((function(t){i[t]&&i[t][a]()})),n.hoverSeries!==i&&(n.hoverPoint&&n.hoverPoint.series)!==i||i.onMouseOut(),r&&n.legend.colorizeItem(i,t),i.isDirty=!0,i.options.stacking&&n.series.forEach((function(t){t.options.stacking&&t.visible&&(t.isDirty=!0)})),i.linkedSeries.forEach((function(e){e.setVisible(t,!1)})),o&&(n.isDirtyBox=!0),g(i,a),!1!==e&&n.redraw()},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(t){this.selected=t=this.options.selected="undefined"===typeof t?!this.selected:t,this.checkbox&&(this.checkbox.checked=t),g(this,t?"select":"unselect")},drawTracker:i.drawTrackerGraph})})),e(i,"Core/Responsive.js",[i["Core/Chart/Chart.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.find,n=e.isArray,r=e.isObject,o=e.merge,s=e.objectEach,a=e.pick,l=e.splat,c=e.uniqueKey;t.prototype.setResponsive=function(t,e){var n=this.options.responsive,r=[],s=this.currentResponsive;!e&&n&&n.rules&&n.rules.forEach((function(t){"undefined"===typeof t._id&&(t._id=c()),this.matchResponsiveRule(t,r)}),this),e=o.apply(0,r.map((function(t){return i(n.rules,(function(e){return e._id===t})).chartOptions}))),e.isResponsiveOptions=!0,r=r.toString()||void 0,r!==(s&&s.ruleIds)&&(s&&this.update(s.undoOptions,t,!0),r?(s=this.currentOptions(e),s.isResponsiveOptions=!0,this.currentResponsive={ruleIds:r,mergedOptions:e,undoOptions:s},this.update(e,t,!0)):this.currentResponsive=void 0)},t.prototype.matchResponsiveRule=function(t,e){var i=t.condition;(i.callback||function(){return this.chartWidth<=a(i.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=a(i.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=a(i.minWidth,0)&&this.chartHeight>=a(i.minHeight,0)}).call(this)&&e.push(t._id)},t.prototype.currentOptions=function(t){function e(t,o,a,c){var h;s(t,(function(t,s){if(!c&&-1