!function(A,g){"object"==typeof exports&&"object"==typeof module?module.exports=g():"function"==typeof define&&define.amd?define([],g):"object"==typeof exports?exports.fengmap=g():A.fengmap=g()}(this,function(){return I={},t.m=C=[function(A,g,C){"use strict";C.r(g);var t={LEFT_TOP:1,LEFT_BOTTOM:2,RIGHT_TOP:3,RIGHT_BOTTOM:4};function i(A,g){for(var C=0;CA);C++);}}],(C=null)&&s(g.prototype,C),I&&s(g,I),A}(),e={FMMap_CONTROL_SMALL:"small",FMMap_CONTROL_NORMAL:"normal"};var r=function A(g){!function(A,g){if(!(A instanceof g))throw new TypeError("Cannot call a class as a function")}(this,A),this.size=e.FMMap_CONTROL_NORMAL,this.position=null,this.offset={x:10,y:10},this.imgURL="resource/style/wedgets/img/",Object.assign(this,g)};function o(A,g){for(var C=0;C\n \n \n
\n
\n \n
\n ')}},{key:"checkPosition",value:function(A,g,C){switch(C.style.left="",C.style.right="",C.style.top="",C.style.bottom="",A){case t.LEFT_TOP:C.style.left=g.x+"px",C.style.top=g.y+"px";break;case t.RIGHT_TOP:C.style.right=-g.x+"px",C.style.top=g.y+"px";break;case t.LEFT_BOTTOM:C.style.left=g.x+"px",C.style.bottom=-g.y+"px";break;case t.RIGHT_BOTTOM:C.style.right=-g.x+"px",C.style.bottom=-g.y+"px"}}}])&&o(A.prototype,C),I&&o(A,I),g}(),u={MODE_3D:2,MODE_2D:4};Object.freeze(u);var c,l=u;function f(A){return function(A){if(Array.isArray(A))return v(A)}(A)||function(A){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(A))return Array.from(A)}(A)||function(A,g){if(A){if("string"==typeof A)return v(A,g);var C=Object.prototype.toString.call(A).slice(8,-1);return"Map"===(C="Object"===C&&A.constructor?A.constructor.name:C)||"Set"===C?Array.from(A):"Arguments"===C||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(C)?v(A,g):void 0}}(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(A,g){(null==g||g>A.length)&&(g=A.length);for(var C=0,I=new Array(g);Cg[g.length-1]||(e.scrollTop=C.getCenterScrolltopById(A.level,g.length),C.setFocusStaus(A.level))},o=function(A){1A[A.length-1]||(C.scrollTop=t.getCenterScrolltopById(parseInt(this.dataset.gid),A.length),t.setFocusStaus(this.dataset.gid)))});function A(A){t.changeScrollBtnPic();var g=0;A.wheelDelta?g+=-A.wheelDelta:A.detail&&(g+=A.detail),I.scrollTopAn_({el:C,to:C.scrollTop,form:C.scrollTop+g}),A.stopPropagation()}C.addEventListener("mousewheel",A,{passive:!0}),C.addEventListener("MozMousePixelScroll",A,!1),C.addEventListener("touchstart",this.touchstart.bind(this),!1),C.addEventListener("touchmove",this.touchmove.bind(this),!1),C.addEventListener("touchend",this.touchend.bind(this),!0)}},{key:"touchstart",value:function(A){A.preventDefault(),this.touchStartPointY=A.touches[0].pageY,this.touchPointX=A.touches[0].pageX,this.touchPointY=A.touches[0].pageY,A.stopPropagation()}},{key:"touchmove",value:function(A){A.preventDefault(),this.touchEndPointX=A.touches[0].pageX,this.touchEndPointY=A.touches[0].pageY,this.handleTouchEnd(A),A.stopPropagation()}},{key:"handleTouchEnd",value:function(A){var g,C=this,I=0;0<(A=A||window.event).changedTouches.length&&(C.touchEndPointX=A.changedTouches[0].pageX,C.touchEndPointY=A.changedTouches[0].pageY),(g=A.target)instanceof HTMLSpanElement==!0&&g.parentElement,0!=(I=-(C.touchEndPointY-C.touchPointY))&&(C.touchPointX=C.touchEndPointX,C.touchPointY=C.touchEndPointY,C=C.H(".fm-layer-list"),this.scrollTopAn_({el:C,to:C.scrollTop,form:C.scrollTop+I}))}},{key:"touchend",value:function(A){var g=this,C=null;0<(A=A||window.event).changedTouches.length&&(g.touchEndPointX=A.changedTouches[0].pageX,g.touchEndPointY=A.changedTouches[0].pageY),(C=A.target)instanceof HTMLSpanElement==!0&&(C=C.parentElement);var I=Math.abs(g.touchEndPointY-g.touchStartPointY);I<5&&0<=I&&C&&(C=parseInt(C.dataset.gid),isNaN(C)||(g.foucusId=C,g.setFocusStaus(C))),A.stopPropagation()}},{key:"eventPanelInit",value:function(A,n,s){var e=this;A.onselectstart=function(){return!1},A.style.MozUserSelect="none",h.bindEvent(A,".scroll","click",function(A){var g=s.length-Math.floor(n.scrollTop/44)-(e.T-1),C=n.scrollTop%44,I=g+e.T-1+(0');return g.innerHTML=A.trim(),g.firstChild}},{key:"createPanel",value:function(A){var g=document.createElement("div");return g.innerHTML='\n
\n '.trim(),g.firstChild}},{key:"createLevelBtnPanel",value:function(A){var g=document.createElement("div"),A='\n
\n \n
\n ');return g.innerHTML=A.trim(),g.firstChild}},{key:"createHr",value:function(){var A=document.createElement("div");return A.innerHTML='\n
\n '.trim(),A.firstChild}},{key:"createScrollButton",value:function(A,g){var C=document.createElement("div"),A='\n
\n ');return C.innerHTML=A.trim(),C.firstChild}},{key:"createLevelButton",value:function(A,g){var C=document.createElement("div"),A="");return C.innerHTML=A.trim(),C.firstChild}},{key:"changeScrollBtnPic",value:function(){var A=this.O,g=this.A.getLevels(),C=document.getElementById("scroll_buttom"+this.uuid),I=document.getElementById("scroll_top"+this.uuid);A==g[0]?C&&(C.style.backgroundImage="url("+this.X+")"):C&&(C.style.backgroundImage="url("+this.L+")"),A==g[g.length-1]?I&&(I.style.backgroundImage="url("+this.Q+")"):I&&(I.style.backgroundImage="url("+this.U+")")}},{key:"changeFocusLevel",value:function(A){this.foucusId=A}},{key:"changeLevelsSelect",value:function(A){this.setLayerStatus(A),this.allLayer=A}},{key:"setLayerStatus",value:function(A){this.Y=A,this.Y?this.K.firstElementChild.src=this.W+"":this.K.firstElementChild.src=this.V+""}},{key:"checkPosition",value:function(A,g,C){switch(C.style.left="",C.style.right="",C.style.top="",C.style.bottom="",A){case t.LEFT_TOP:C.style.left=g.x+"px",C.style.top=g.y+"px";break;case t.RIGHT_TOP:C.style.right=-g.x+"px",C.style.top=g.y+"px";break;case t.LEFT_BOTTOM:C.style.left=g.x+"px",C.style.bottom=-g.y+"px";break;case t.RIGHT_BOTTOM:C.style.right=-g.x+"px",C.style.bottom=-g.y+"px";break;default:C.style.left=g.x+"px",C.style.top=g.y+"px"}}},{key:"onChange",value:function(A){c=A}},{key:"foucusId",get:function(){return this.O},set:function(g){var C=this;this.A.loadFloor(this.A.getMapOptions().mapID,g,function(){var A=[];A.push.apply(A,f(C.A.getVisibleLevels())),1==A.length?C.A.setVisibleLevels([g]):C.A.getVisibleLevels().indexOf(g)<=-1&&(A.push(g),C.A.setVisibleLevels(A)),C.A.setLevel({level:g}),C.setFocusStaus(g),C.O=g,c&&c([g])})}},{key:"setFocusStaus",value:function(A){document.getElementById("gid_"+this.O+this.uuid).style.color="rgb(102, 102, 102)",this.O=parseInt(A),document.getElementById("gid_"+this.O+this.uuid).style.color="rgb(30, 130, 250)",this.changeScrollBtnPic()}},{key:"allLayer",get:function(){return this.Y},set:function(A){var g=this;(this.Y=A)?this.A.setVisibleLevels(this.N.J,function(){return g.A.setFloorMode(4)}):this.A.setVisibleLevels([this.A.getLevel()],function(){return g.A.setFloorMode(2)})}}])&&d(A.prototype,C),I&&d(A,I),g}(),p={MODULE_SHORTEST:1,MODULE_BEST:2},m={PRIORITY_DEFAULT:1,PRIORITY_LIFTFIRST:2,PRIORITY_ESCALATORFIRST:3,PRIORITY_STAIRFIRST:4,PRIORITY_LIFTONLY:5,PRIORITY_ESCALATORONLY:6,PRIORITY_STAIRONLY:7,PRIORITY_ACCESSIBLEONLY:8,PRIORITY_LIFTFIRST1:9,PRIORITY_ESCALATORFIRST1:10,PRIORITY_STAIRFIRST1:11},C={ZH:"zh",EN:"en"};I=function A(){!function(A,g){if(!(A instanceof g))throw new TypeError("Cannot call a class as a function")}(this,A)};Object.assign(I.prototype,{q:function(A,g){void 0===this._&&(this._={});var C=this._;void 0===C[A]&&(C[A]=[]),-1===C[A].indexOf(g)&&C[A].push(g)},$:function(A,g){if(void 0===this._)return!1;var C=this._;return void 0!==C[A]&&-1!==C[A].indexOf(g)},AA:function(A,g){void 0!==this._&&(void 0===(A=this._[A])||-1!==(g=A.indexOf(g))&&A.splice(g,1))},gA:function(A){if(void 0!==this._){var g=this._[A.type];if(void 0!==g)for(var C=g.slice(0),I=0,t=C.length;I>8&255]+k[A>>16&255]+k[A>>24&255]+"-"+k[255&g]+k[g>>8&255]+"-"+k[g>>16&15|64]+k[g>>24&255]+"-"+k[63&C|128]+k[C>>8&255]+"-"+k[C>>16&255]+k[C>>24&255]+k[255&I]+k[I>>8&255]+k[I>>16&255]+k[I>>24&255]).toUpperCase()},clamp:function(A,g,C){return Math.max(g,Math.min(C,A))},euclideanModulo:function(A,g){return(A%g+g)%g},mapLinear:function(A,g,C,I,t){return I+(A-g)*(t-I)/(C-g)},lerp:function(A,g,C){return(1-C)*A+C*g},smoothstep:function(A,g,C){return A<=g?0:C<=A?1:(A=(A-g)/(C-g))*A*(3-2*A)},smootherstep:function(A,g,C){return A<=g?0:C<=A?1:(A=(A-g)/(C-g))*A*A*(A*(6*A-15)+10)},randInt:function(A,g){return A+Math.floor(Math.random()*(g-A+1))},randFloat:function(A,g){return A+Math.random()*(g-A)},randFloatSpread:function(A){return A*(.5-Math.random())},seededRandom:function(A){return((T=16807*(T=void 0!==A?A%2147483647:T)%2147483647)-1)/2147483646},degToRad:function(A){return A*x.DEG2RAD},radToDeg:function(A){return A*x.RAD2DEG},isPowerOfTwo:function(A){return 0==(A&A-1)&&0!==A},ceilPowerOfTwo:function(A){return Math.pow(2,Math.ceil(Math.log(A)/Math.LN2))},floorPowerOfTwo:function(A){return Math.pow(2,Math.floor(Math.log(A)/Math.LN2))},setQuaternionFromProperEuler:function(A,g,C,I,t){var i=Math.cos,n=Math.sin,s=i(C/2),e=n(C/2),h=i((g+I)/2),r=n((g+I)/2),o=i((g-I)/2),a=n((g-I)/2),u=i((I-g)/2),c=n((I-g)/2);switch(t){case"XYX":A.set(s*r,e*o,e*a,s*h);break;case"YZY":A.set(e*a,s*r,e*o,s*h);break;case"ZXZ":A.set(e*o,e*a,s*r,s*h);break;case"XZX":A.set(s*r,e*c,e*u,s*h);break;case"YXY":A.set(e*u,s*r,e*c,s*h);break;case"ZYZ":A.set(e*c,e*u,s*r,s*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+t)}}};function O(A,g){for(var C=0;CNumber.EPSILON&&(i=Math.sqrt(i),I=Math.atan2(i,I*t),C=Math.sin(C*I)/i,n=Math.sin(n*I)/i),s=s*C+o*(t=n*t),e=e*C+a*t,h=h*C+u*t,r=r*C+c*t,C===1-n&&(s*=n=1/Math.sqrt(s*s+e*e+h*h+r*r),e*=n,h*=n,r*=n)),A[g]=s,A[g+1]=e,A[g+2]=h,A[g+3]=r}},{key:"multiplyQuaternionsFlat",value:function(A,g,C,I,t,i){var n=C[I],s=C[I+1],e=C[I+2],h=C[I+3],r=t[i],C=t[i+1],I=t[i+2],i=t[i+3];return A[g]=n*i+h*r+s*I-e*C,A[g+1]=s*i+h*C+e*r-n*I,A[g+2]=e*i+h*I+n*C-s*r,A[g+3]=h*i-n*r-s*C-e*I,A}}],(g=[{key:"x",get:function(){return this.CA},set:function(A){this.CA=A,this.nA()}},{key:"y",get:function(){return this.IA},set:function(A){this.IA=A,this.nA()}},{key:"z",get:function(){return this.tA},set:function(A){this.tA=A,this.nA()}},{key:"w",get:function(){return this.iA},set:function(A){this.iA=A,this.nA()}},{key:"set",value:function(A,g,C,I){return this.CA=A,this.IA=g,this.tA=C,this.iA=I,this.nA(),this}},{key:"clone",value:function(){return new this.constructor(this.CA,this.IA,this.tA,this.iA)}},{key:"copy",value:function(A){return this.CA=A.x,this.IA=A.y,this.tA=A.z,this.iA=A.w,this.nA(),this}},{key:"setFromEuler",value:function(A,g){if(!A||!A.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var C=A.CA,I=A.IA,t=A.tA,i=A.sA,n=Math.cos,A=Math.sin,s=n(C/2),e=n(I/2),h=n(t/2),r=A(C/2),o=A(I/2),a=A(t/2);switch(i){case"XYZ":this.CA=r*e*h+s*o*a,this.IA=s*o*h-r*e*a,this.tA=s*e*a+r*o*h,this.iA=s*e*h-r*o*a;break;case"YXZ":this.CA=r*e*h+s*o*a,this.IA=s*o*h-r*e*a,this.tA=s*e*a-r*o*h,this.iA=s*e*h+r*o*a;break;case"ZXY":this.CA=r*e*h-s*o*a,this.IA=s*o*h+r*e*a,this.tA=s*e*a+r*o*h,this.iA=s*e*h-r*o*a;break;case"ZYX":this.CA=r*e*h-s*o*a,this.IA=s*o*h+r*e*a,this.tA=s*e*a-r*o*h,this.iA=s*e*h+r*o*a;break;case"YZX":this.CA=r*e*h+s*o*a,this.IA=s*o*h+r*e*a,this.tA=s*e*a-r*o*h,this.iA=s*e*h-r*o*a;break;case"XZY":this.CA=r*e*h-s*o*a,this.IA=s*o*h-r*e*a,this.tA=s*e*a+r*o*h,this.iA=s*e*h+r*o*a;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+i)}return!1!==g&&this.nA(),this}},{key:"setFromAxisAngle",value:function(A,g){var C=g/2,g=Math.sin(C);return this.CA=A.x*g,this.IA=A.y*g,this.tA=A.z*g,this.iA=Math.cos(C),this.nA(),this}},{key:"setFromRotationMatrix",value:function(A){var g,C=A.elements,I=C[0],t=C[4],i=C[8],n=C[1],s=C[5],e=C[9],h=C[2],r=C[6],A=C[10],C=I+s+A;return 0Math.abs(A.z)?(this.CA=-A.y,this.IA=A.x,this.tA=0):(this.CA=0,this.IA=-A.z,this.tA=A.y)):(this.CA=A.y*g.z-A.z*g.y,this.IA=A.z*g.x-A.x*g.z,this.tA=A.x*g.y-A.y*g.x),this.iA=C,this.normalize()}},{key:"angleTo",value:function(A){return 2*Math.acos(Math.abs(x.clamp(this.dot(A),-1,1)))}},{key:"rotateTowards",value:function(A,g){var C=this.angleTo(A);if(0===C)return this;C=Math.min(1,g/C);return this.slerp(A,C),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this.CA*=-1,this.IA*=-1,this.tA*=-1,this.nA(),this}},{key:"dot",value:function(A){return this.CA*A.CA+this.IA*A.IA+this.tA*A.tA+this.iA*A.iA}},{key:"lengthSq",value:function(){return this.CA*this.CA+this.IA*this.IA+this.tA*this.tA+this.iA*this.iA}},{key:"length",value:function(){return Math.sqrt(this.CA*this.CA+this.IA*this.IA+this.tA*this.tA+this.iA*this.iA)}},{key:"normalize",value:function(){var A=this.length();return 0===A?(this.CA=0,this.IA=0,this.tA=0,this.iA=1):(this.CA=this.CA*(A=1/A),this.IA=this.IA*A,this.tA=this.tA*A,this.iA=this.iA*A),this.nA(),this}},{key:"multiply",value:function(A,g){return void 0!==g?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(A,g)):this.multiplyQuaternions(this,A)}},{key:"premultiply",value:function(A){return this.multiplyQuaternions(A,this)}},{key:"multiplyQuaternions",value:function(A,g){var C=A.CA,I=A.IA,t=A.tA,i=A.iA,n=g.CA,s=g.IA,A=g.tA,g=g.iA;return this.CA=C*g+i*n+I*A-t*s,this.IA=I*g+i*s+t*n-C*A,this.tA=t*g+i*A+C*s-I*n,this.iA=i*g-C*n-I*s-t*A,this.nA(),this}},{key:"slerp",value:function(A,g){if(0===g)return this;if(1===g)return this.copy(A);var C=this.CA,I=this.IA,t=this.tA,i=this.iA,n=i*A.iA+C*A.CA+I*A.IA+t*A.tA;if(n<0?(this.iA=-A.iA,this.CA=-A.CA,this.IA=-A.IA,this.tA=-A.tA,n=-n):this.copy(A),1<=n)return this.iA=i,this.CA=C,this.IA=I,this.tA=t,this;A=1-n*n;if(A<=Number.EPSILON){var s=1-g;return this.iA=s*i+g*this.iA,this.CA=s*C+g*this.CA,this.IA=s*I+g*this.IA,this.tA=s*t+g*this.tA,this.normalize(),this.nA(),this}s=Math.sqrt(A),A=Math.atan2(s,n),n=Math.sin((1-g)*A)/s,s=Math.sin(g*A)/s;return this.iA=i*n+this.iA*s,this.CA=C*n+this.CA*s,this.IA=I*n+this.IA*s,this.tA=t*n+this.tA*s,this.nA(),this}},{key:"equals",value:function(A){return A.CA===this.CA&&A.IA===this.IA&&A.tA===this.tA&&A.iA===this.iA}},{key:"fromArray",value:function(A){var g=1this.hA.x||this.eA.y>this.hA.y)},oA:function(A){A&&A.rA()&&(A.eA.xthis.hA.x&&(this.hA.x=A.hA.x),A.hA.y>this.hA.y&&(this.hA.y=A.hA.y))},aA:function(A){var g=this;A&&0!=A.length&&A.forEach(function(A){A.xg.hA.x&&(g.hA.x=A.x),A.y>g.hA.y&&(g.hA.y=A.y)})}});var D=I,Y=function(A,g,C){C=C||2;var I,t,i,n,s,e=g&&g.length,h=e?g[0]*C:A.length,r=P(A,0,h,C,!0),o=[];if(!r||r.next===r.prev)return o;if(e&&(r=function(A,g,C,I){var t,i,n,s,e=[];for(t=0,i=g.length;t=I.next.y&&I.next.y!==I.y){var s=I.x+(i-I.y)*(I.next.x-I.x)/(I.next.y-I.y);if(s<=t&&n=I.x&&I.x>=r&&t!==I.x&&Q(iC.x||I.x===C.x&&function(A,g){return X(A.prev,A,g.prev)<0&&X(g.next,A,A.next)<0}(C,I)))&&(C=I,a=e)),I=I.next,I!==h;);return C}(A,g))&&(A=J(g,A),B(g,g.next),B(A,A.next))}(e[t],C),C=B(C,C.next);return C}(A,g,r,C)),A.length>80*C){for(var a=I=A[0],u=t=A[1],c=C;ci.x?t.x>n.x?t:n:i.x>n.x?i:n).x,r=(t.y>i.y?t.y>n.y?t:n:i.y>n.y?i:n).y,o=L(s,e,g,C,I),a=L(h,r,g,C,I),u=A.prevZ,c=A.nextZ;for(;u&&u.z>=o&&c&&c.z<=a;){if(u!==A.prev&&u!==A.next&&Q(t.x,t.y,i.x,i.y,n.x,n.y,u.x,u.y)&&0<=X(u.prev,u,u.next))return!1;if(u=u.prevZ,c!==A.prev&&c!==A.next&&Q(t.x,t.y,i.x,i.y,n.x,n.y,c.x,c.y)&&0<=X(c.prev,c,c.next))return!1;c=c.nextZ}for(;u&&u.z>=o;){if(u!==A.prev&&u!==A.next&&Q(t.x,t.y,i.x,i.y,n.x,n.y,u.x,u.y)&&0<=X(u.prev,u,u.next))return!1;u=u.prevZ}for(;c&&c.z<=a;){if(c!==A.prev&&c!==A.next&&Q(t.x,t.y,i.x,i.y,n.x,n.y,c.x,c.y)&&0<=X(c.prev,c,c.next))return!1;c=c.nextZ}return!0}(A,I,t,i):function(A){var g=A.prev,C=A,I=A.next;if(0<=X(g,C,I))return!1;var t=A.next.next;for(;t!==A.prev;){if(Q(g.x,g.y,C.x,C.y,I.x,I.y,t.x,t.y)&&0<=X(t.prev,t,t.next))return!1;t=t.next}return!0}(A))g.push(s.i/C),g.push(A.i/C),g.push(e.i/C),_(A),A=e.next,h=e.next;else if((A=e)===h){n?1===n?F(A=function(A,g,C){var I=A;do{var t=I.prev,i=I.next.next}while(!V(t,i)&&W(t,I,I.next,i)&&H(t,i)&&H(i,t)&&(g.push(t.i/C),g.push(I.i/C),g.push(i.i/C),_(I),_(I.next),I=A=i),I=I.next,I!==A);return B(I)}(B(A),g,C),g,C,I,t,i,2):2===n&&function(A,g,C,I,t,i){var n=A;do{for(var s=n.next.next;s!==n.prev;){if(n.i!==s.i&&function(A,g){return A.next.i!==g.i&&A.prev.i!==g.i&&!function(A,g){var C=A;do{if(C.i!==A.i&&C.next.i!==A.i&&C.i!==g.i&&C.next.i!==g.i&&W(C,C.next,A,g))return!0}while(C=C.next,C!==A);return!1}(A,g)&&(H(A,g)&&H(g,A)&&function(A,g){var C=A,I=!1,t=(A.x+g.x)/2,i=(A.y+g.y)/2;for(;C.y>i!=C.next.y>i&&C.next.y!==C.y&&t<(C.next.x-C.x)*(i-C.y)/(C.next.y-C.y)+C.x&&(I=!I),C=C.next,C!==A;);return I}(A,g)&&(X(A.prev,A,g.prev)||X(A,g.prev,g))||V(A,g)&&0=Math.min(A.x,C.x)&&g.y<=Math.max(A.y,C.y)&&g.y>=Math.min(A.y,C.y)}function z(A){return 0A.length)&&(g=A.length);for(var C=0,I=new Array(g);C=Math.min(t,n)&&e>g.x&&e!==t&&(e===n&&0<(i-g.y)*(s-g.y)?C+=2:C++):e<=Math.max(t,n)&&e>=Math.min(t,n)&&e>g.x&&(e===n&&0<(i-g.y)*(s-g.y)?C+=2:C++)}}return 0C.x)&&!(A.y>C.y)))},yA:function(A,g,C){var I=Math.min(C.x,g.x),t=Math.max(C.x,g.x),i=Math.min(C.y,g.y),g=Math.max(C.y,g.y);return!(A.xt||A.yg)},bA:function(A,g,C){for(var I,t,i=!1,n=0;n=A.y||t.y=A.y)&&(I.x<=A.x||t.x<=A.x)&&I.x+(A.y-I.y)/(t.y-I.y)*(t.x-I.x)n)return!1;var l=(c-a)/(u-o)*(h-o)+a;return t.y=l,t.x=h,ln)return!1;A=(c-a)/(u-o)*(h-o)+a;return t.y=A,t.x=h,rA.length)&&(g=A.length);for(var C=0,I=new Array(g);Cg.index;M--)M-1>g.index&&(f=I[M],v=I[M-1],f.level==v.level&&(d+=eA.EA(f,v)));I[g.index+1]&&I[g.index+1].level==g.coords.level&&(d+=eA.EA(I[g.index+1],g.coords)),g.remain=d}return g}}},{key:"pathConstraint",value:function(A,g){return this.QA?this.QA.pathConstraint(A,g):null}},{key:"locate",value:function(A,g){this.jg&&this.stop(),A.level!=this.Gg&&(this.Gg=A.level),this.Ng(A,g)}},{key:"locateNoConstraint",value:function(A,g){this.jg&&this.stop(),A.level!==this.Gg&&(this.Gg=A.level),this.Dg(A,g)}},{key:"clearLocationMarker",value:function(){this.Mg&&(this.Mg.remove(),this.Mg=null)}},{key:"clearMarkers",value:function(){this.Yg&&(this.Yg.remove(),this.Yg=null,this.yg=null),this.Pg&&(this.Pg.remove(),this.Pg=null,this.wg=null)}},{key:"drawNaviLine",value:function(A){if(this.yg&&this.wg)return this.Bg=this.Fg(this.Ug,A),this.Bg}},{key:"clearNaviLine",value:function(){this.Bg&&(this.Bg.remove(),this.Bg=null)}},{key:"clearAll",value:function(){this.clearMarkers(),this.clearNaviLine(),this.clearLocationMarker()}},{key:"overview",value:function(A,g){var C,I;0!=this.Ug.length&&(C=new D,I=[Number.MAX_VALUE,-Number.MAX_VALUE],this.Ug.forEach(function(A){A.levelI[1]&&(I[1]=A.level),C.aA(A.pointList)}),this.Lg(A,C,I,g))}},{key:"focusNaviLineSegment",value:function(A,g,C){var I;0==this.Zg.length||(I=this.Zg[A])&&((A=new D).aA([I.startPoint,I.endPoint]),I=[Math.min(I.startLevel,I.endLevel),Math.max(I.startLevel,I.endLevel)],this.Lg(Object.assign({center:A.center},g),A,I,C))}},{key:"simulate",value:function(A){var g,C,I=this;this.yg&&this.wg&&0!=this.Ug.length&&(this.dg(A),this.Qg=!(g={}),this.Xg=this.A.getRotation(),C=g.qA||this.qA,g.Ag=g.Ag||this.Ag||0,this.Mg||this.Vg(),this.Mg.rotateTo({heading:-this.Xg}),this.KA?this.Wg=this.Kg(this.yg.level,C,function(){I.zg=I.Hg(I.yg,C,function(){var A=g.Ag>I.Cg?I.Cg:g.Ag;I.gg?I.Jg=I.qg(I._A,C,function(){I._g=I.$g(A,C,function(){I.AC()})}):I._g=I.$g(A,C,function(){I.AC()})})}):this.AC())}},{key:"pause",value:function(){this.Jg&&this.Jg.pause(),this._g&&this._g.pause(),this.zg&&this.zg.pause(),this.Wg&&this.Wg.pause(),this.gC=!0}},{key:"resume",value:function(){this.Jg&&this.Jg.resume(),this._g&&this._g.resume(),this.zg&&this.zg.resume(),this.Wg&&this.Wg.resume(),this.gC=!1}},{key:"stop",value:function(){this.CC=!0,this.IC.stop(),this.Jg&&(this.A.removeAnimater(this.Jg),this.Jg=null),this._g&&(this.A.removeAnimater(this._g),this._g=null),this.zg&&(this.A.removeAnimater(this.zg),this.zg=null),this.Wg&&(this.A.removeAnimater(this.Wg),this.Wg=null),this.tC&&this.A.off("update",this.tC),this.gC=!1,this.iC=null,this.nC=null,this.sC=0,this.Qg=!1,this.eC=0,this.hC=!1,this.tC=null,this.jg=!1,this.rC=!1,this.oC=0,this.aC=null}}])&&oA(A.prototype,C),I&&oA(A,I),g}();Object.assign(I.prototype,{dg:function(A){A&&(void 0!==A.map&&(this.A=A.map),void 0!==A.analyser&&(this.QA=A.analyser),void 0!==A.speed&&(this.VA=A.speed),void 0!==A.followSpeed&&(this.WA=A.followSpeed),void 0!==A.followPosition&&(this.KA=A.followPosition),void 0!==A.followAngle&&(this.zA=A.followAngle),void 0!==A.locationMarkerFollowAngle&&(this.HA=A.locationMarkerFollowAngle),void 0!==A.isMultiLevels&&(this.JA=A.isMultiLevels),void 0!==A.inTime&&(this.qA=A.inTime),void 0!==A.tiltAngle&&(this._A=A.tiltAngle),void 0!==A.changeFloorTiltAngle&&(this.$A=A.changeFloorTiltAngle),void 0!==A.changeTiltAngle&&(this.gg=A.changeTiltAngle),void 0!==A.zoom&&(this.Ag=A.zoom),void 0!==A.maxZoom&&(this.Cg=A.maxZoom),void 0!==A.extendScale&&(this.Ig=A.extendScale),void 0!==A.locationMarkerUrl&&(this.tg=A.locationMarkerUrl),void 0!==A.locationMarkerSize&&(this.ig=A.locationMarkerSize),void 0!==A.locationMarkerHeight&&(this.ng=A.locationMarkerHeight),void 0!==A.lineMarkerHeight&&(this.sg=A.lineMarkerHeight),void 0!==A.imageMarkerHeight&&(this.eg=A.imageMarkerHeight),void 0!==A.directionAssert&&(this.hg=A.directionAssert),void 0!==A.combineAsset&&(this.rg=A.combineAsset),void 0!==A.completeDistance&&(this.og=A.completeDistance),void 0!==A.ag&&(this.hg=A.directionAssert),void 0!==A.mode&&(this.ug=A.mode),void 0!==A.priority&&(this.cg=A.priority),void 0!==A.toDoors&&(this.lg=A.toDoors),void 0!==A.lineStyle&&Object.assign(this.fg,A.lineStyle),void 0!==A.linePassed&&(this.vg=A.linePassed))},a:function(){this.XA=new y,this.Og=void 0!==fengmap.FMNaviAnalyser&&this.QA instanceof fengmap.FMNaviAnalyser,this.yg=null,this.wg=null,this.Yg=null,this.Pg=null,this.Mg=null,this.pg=null,this.Ug=[],this.uC=[],this.Zg=[],this.kg=0,this.cC=[],this.lC=0,this.IC=new w,this.gC=!1,this.iC=null,this.nC=null,this.Xg=null,this.sC=0,this.Qg=!1,this.eC=0,this.Gg=null,this.hC=!1,this.tC=null,this.jg=!1,this.rC=!1,this.oC=0,this.aC=null,this.Jg=null,this._g=null,this.zg=null,this.Wg=null},Vg:function(){this.Mg||(this.Mg=new fengmap.FMLocationMarker({id:"location",level:this.yg.level,x:this.yg.x,y:this.yg.y,url:this.tg||"",size:this.ig}),this.Mg.addTo(this.A))},fC:function(A){for(var g,C=arguments.length<=1?0:arguments.length-1,I=0;Ithis.Cg?this.Cg:I.Ag;this.JA||(I={x:this.Mg.x,y:this.Mg.y,height:this.Mg.height,level:A.level},(A=this.pC[this.oC])&&A.pointList&&0e.x/e.y?e.y/h:e.x/r},SC:function(A){var g,C,I,t,i,n,s=this;this.CC||requestAnimationFrame(this.SC.bind(this,A)),this.rC||(A.cnt++,A.cnt==A.step&&(A.cnt=0,I=this.IC.getDelta(),this.hC||this.gC||(this.sC+=this.VA*I,this.sC<=0||(g=Object.assign({},this.RC(A.ps,this.sC)),C=this.kg-this.sC,I=g.y,g.y=g.z,g.z=I,this.aC={distance:0,remain:Cthis.Cg?this.Cg:A.Ag,this.hC=!0,this.gg&&(this.Jg=this.qg(this.$A,i,null)),this.JA||(this.Mg.visible=!1),this.Wg=this.Kg(t.level,i,function(){s._g=s.$g(n,i,function(){s.locationMarker.moveTo({x:t.x,y:t.y,height:s.ng,level:t.level}),s.Hg(t,i,function(){s.gg?s.Jg=s.qg(s._A,i,function(){s.TC(g,t)}):s.TC(g,t)})})})),this.XA.gA({type:"transit",level:g.level})))))))},jC:function(){this.CC=!1;var A=this.xg(this.Rg());this.IC.start(),this.jg=!0,this.rC=!1,this.oC=0,this.SC({step:2,cnt:0,ps:A})},GC:function(){if(!this.hC&&!this.gC){if(this.iC){var A=new S(this.Mg.x,this.Mg.y,0).lerp(this.iC,this.Qg?1:this.WA);A.level=this.iC.level,this.Mg.moveTo({x:A.x,y:A.y,height:this.ng,level:A.level});var g=this.naviConstraint(A);if(this.Bg&&(this.Bg.passed?this.Bg.moveProportion(1-g.remain/this.kg):this.Bg.moveProportion(0)),this.XA.gA(Object.assign({},this.aC,{type:"walking",distance:g.distance,remain:g.remain,walk:this.kg-g.remain,distanceToNext:g.distanceToNext,angle:g.angle,point:g.coords,level:A.level,index:g.index,isReal:!1})),this.KA?this.zg=this.Hg(A):this.A.updateCountDown_=0,this.rC)return this.stop(),void this.XA.gA({type:"complete"})}null!=this.nC&&(A=this.xC(this.Xg,this.nC,this.WA),this.Xg=A,this.Mg.rotateTo({heading:-A}),this.zA&&this.EC(A))}},AC:function(){this.jC(),this.tC=this.GC.bind(this),this.A.on("update",this.tC)},Ng:function(A,g){var C=this.naviConstraint(A);C&&(this.Bg&&(this.Bg.passed?this.Bg.moveProportion(1-C.remain/this.kg):this.Bg.moveProportion(0)),A={type:"walking",distance:C.distance,remain:C.remain,walk:this.kg-C.remain,distanceToNext:C.distanceToNext,angle:C.angle,point:C.coords,level:A.level,index:C.index,isReal:!0},this.XA.gA(A),this.Mg&&(C.coords.height=this.ng,this.Mg.moveTo(C.coords),g?this.Mg.rotateTo({heading:g}):this.Mg.rotateTo({heading:C.angle})))},Dg:function(A,g){var C=this.naviConstraint(A);C&&(this.XA.gA({type:"walking",distance:C.distance,remain:C.remain,walk:this.kg-C.remain,distanceToNext:C.distanceToNext,angle:C.angle,point:C.coords,level:A.level,index:C.index,isReal:!0}),this.Mg&&(A.height=this.ng,this.Mg.moveTo(A),g&&this.Mg.rotateTo({heading:g})))},Lg:function(A,g,C,I){for(var t=this,i=A&&void 0!==A.ratio?A.ratio:1,n=!A||void 0===A.animate||A.animate,s=A&&void 0!==A.rotation?A.rotation:0,e=A&&void 0!==A.tilt?A.tilt:30,A=A&&void 0!==A.center?A.center:{x:this.A.getX(),y:this.A.getY()},h=[],r=C[0];r<=C[1];)h.push(r),r++;var o=h[Math.floor((h.length-1)/2)];this.A.setCenter({x:A.x,y:A.y,animate:n,finish:function(){t.A.setVisibleLevels(h),t.A.getInteracations().getControls().panAdd({x:0,y:h.length%2==0?t.A.getFloorSpace()/2:0,z:0}),t.A.setLevel({level:o,animate:n,finish:function(){t.A.setTilt({tilt:e,animate:n,finish:function(){t.A.setRotation({rotation:s,animate:n,finish:function(){var A=[];A.push({x:g.eA.x,y:g.eA.y}),A.push({x:g.eA.x,y:g.hA.y}),A.push({x:g.hA.x,y:g.eA.y}),A.push({x:g.hA.x,y:g.hA.y});A=t.ZC(t.A,A,C),A=t.OC(t.A,t.A.getZoom(),A*(i||1));t.A.setZoom({zoom:A,animate:n,finish:function(){I&&I()}})}})}})}})}})}});for(var u=I,aA=[],uA=0;uA<256;uA++)aA[uA]=(uA<16?"0":"")+uA.toString(16);var cA={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var A=4294967295*Math.random()|0,g=4294967295*Math.random()|0,C=4294967295*Math.random()|0,I=4294967295*Math.random()|0;return(aA[255&A]+aA[A>>8&255]+aA[A>>16&255]+aA[A>>24&255]+"-"+aA[255&g]+aA[g>>8&255]+"-"+aA[g>>16&15|64]+aA[g>>24&255]+"-"+aA[63&C|128]+aA[C>>8&255]+"-"+aA[C>>16&255]+aA[C>>24&255]+aA[255&I]+aA[I>>8&255]+aA[I>>16&255]+aA[I>>24&255]).toUpperCase()},clamp:function(A,g,C){return Math.max(g,Math.min(C,A))},euclideanModulo:function(A,g){return(A%g+g)%g},mapLinear:function(A,g,C,I,t){return I+(A-g)*(t-I)/(C-g)},lerp:function(A,g,C){return(1-C)*A+C*g},smoothstep:function(A,g,C){return A<=g?0:C<=A?1:(A=(A-g)/(C-g))*A*(3-2*A)},smootherstep:function(A,g,C){return A<=g?0:C<=A?1:(A=(A-g)/(C-g))*A*A*(A*(6*A-15)+10)},randInt:function(A,g){return A+Math.floor(Math.random()*(g-A+1))},randFloat:function(A,g){return A+Math.random()*(g-A)},randFloatSpread:function(A){return A*(.5-Math.random())},degToRad:function(A){return A*cA.DEG2RAD},radToDeg:function(A){return A*cA.RAD2DEG},isPowerOfTwo:function(A){return 0==(A&A-1)&&0!==A},ceilPowerOfTwo:function(A){return Math.pow(2,Math.ceil(Math.log(A)/Math.LN2))},floorPowerOfTwo:function(A){return Math.pow(2,Math.floor(Math.log(A)/Math.LN2))},setQuaternionFromProperEuler:function(A,g,C,I,t){var i=Math.cos,n=Math.sin,s=i(C/2),e=n(C/2),h=i((g+I)/2),r=n((g+I)/2),o=i((g-I)/2),C=n((g-I)/2),i=i((I-g)/2),g=n((I-g)/2);"XYX"===t?A.set(s*r,e*o,e*C,s*h):"YZY"===t?A.set(e*C,s*r,e*o,s*h):"ZXZ"===t?A.set(e*o,e*C,s*r,s*h):"XZX"===t?A.set(s*r,e*g,e*i,s*h):"YXY"===t?A.set(e*i,s*r,e*g,s*h):"ZYZ"===t?A.set(e*g,e*i,s*r,s*h):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function lA(A,g,C,I){this.CA=A||0,this.IA=g||0,this.tA=C||0,this.iA=void 0!==I?I:1}Object.assign(lA,{slerp:function(A,g,C,I){return C.copy(A).slerp(g,I)},slerpFlat:function(A,g,C,I,t,i,n){var s=C[I+0],e=C[I+1],h=C[I+2],r=C[I+3],o=t[i+0],a=t[i+1],u=t[i+2],c=t[i+3];r===c&&s===o&&e===a&&h===u||(C=1-n,t=0<=(I=s*o+e*a+h*u+r*c)?1:-1,(i=1-I*I)>Number.EPSILON&&(i=Math.sqrt(i),I=Math.atan2(i,I*t),C=Math.sin(C*I)/i,n=Math.sin(n*I)/i),s=s*C+o*(t=n*t),e=e*C+a*t,h=h*C+u*t,r=r*C+c*t,C===1-n&&(s*=n=1/Math.sqrt(s*s+e*e+h*h+r*r),e*=n,h*=n,r*=n)),A[g]=s,A[g+1]=e,A[g+2]=h,A[g+3]=r}}),Object.defineProperties(lA.prototype,{x:{get:function(){return this.CA},set:function(A){this.CA=A,this.nA()}},y:{get:function(){return this.IA},set:function(A){this.IA=A,this.nA()}},z:{get:function(){return this.tA},set:function(A){this.tA=A,this.nA()}},w:{get:function(){return this.iA},set:function(A){this.iA=A,this.nA()}}}),Object.assign(lA.prototype,{isQuaternion:!0,set:function(A,g,C,I){return this.CA=A,this.IA=g,this.tA=C,this.iA=I,this.nA(),this},clone:function(){return new this.constructor(this.CA,this.IA,this.tA,this.iA)},copy:function(A){return this.CA=A.x,this.IA=A.y,this.tA=A.z,this.iA=A.w,this.nA(),this},setFromEuler:function(A,g){if(!A||!A.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var C=A.CA,I=A.IA,t=A.tA,i=A.order,n=Math.cos,s=Math.sin,e=n(C/2),A=n(I/2),n=n(t/2),C=s(C/2),I=s(I/2),t=s(t/2);return"XYZ"===i?(this.CA=C*A*n+e*I*t,this.IA=e*I*n-C*A*t,this.tA=e*A*t+C*I*n,this.iA=e*A*n-C*I*t):"YXZ"===i?(this.CA=C*A*n+e*I*t,this.IA=e*I*n-C*A*t,this.tA=e*A*t-C*I*n,this.iA=e*A*n+C*I*t):"ZXY"===i?(this.CA=C*A*n-e*I*t,this.IA=e*I*n+C*A*t,this.tA=e*A*t+C*I*n,this.iA=e*A*n-C*I*t):"ZYX"===i?(this.CA=C*A*n-e*I*t,this.IA=e*I*n+C*A*t,this.tA=e*A*t-C*I*n,this.iA=e*A*n+C*I*t):"YZX"===i?(this.CA=C*A*n+e*I*t,this.IA=e*I*n+C*A*t,this.tA=e*A*t-C*I*n,this.iA=e*A*n-C*I*t):"XZY"===i&&(this.CA=C*A*n-e*I*t,this.IA=e*I*n-C*A*t,this.tA=e*A*t+C*I*n,this.iA=e*A*n+C*I*t),!1!==g&&this.nA(),this},setFromAxisAngle:function(A,g){var C=g/2,g=Math.sin(C);return this.CA=A.x*g,this.IA=A.y*g,this.tA=A.z*g,this.iA=Math.cos(C),this.nA(),this},setFromRotationMatrix:function(A){var g,C=A.elements,I=C[0],t=C[4],i=C[8],n=C[1],s=C[5],e=C[9],h=C[2],r=C[6],A=C[10],C=I+s+A;return 0Math.abs(A.z)?(this.CA=-A.y,this.IA=A.x,this.tA=0):(this.CA=0,this.IA=-A.z,this.tA=A.y)):(this.CA=A.y*g.z-A.z*g.y,this.IA=A.z*g.x-A.x*g.z,this.tA=A.x*g.y-A.y*g.x),this.iA=C,this.normalize()},angleTo:function(A){return 2*Math.acos(Math.abs(cA.clamp(this.dot(A),-1,1)))},rotateTowards:function(A,g){var C=this.angleTo(A);if(0===C)return this;C=Math.min(1,g/C);return this.slerp(A,C),this},inverse:function(){return this.conjugate()},conjugate:function(){return this.CA*=-1,this.IA*=-1,this.tA*=-1,this.nA(),this},dot:function(A){return this.CA*A.CA+this.IA*A.IA+this.tA*A.tA+this.iA*A.iA},lengthSq:function(){return this.CA*this.CA+this.IA*this.IA+this.tA*this.tA+this.iA*this.iA},length:function(){return Math.sqrt(this.CA*this.CA+this.IA*this.IA+this.tA*this.tA+this.iA*this.iA)},normalize:function(){var A=this.length();return 0===A?(this.CA=0,this.IA=0,this.tA=0,this.iA=1):(this.CA=this.CA*(A=1/A),this.IA=this.IA*A,this.tA=this.tA*A,this.iA=this.iA*A),this.nA(),this},multiply:function(A,g){return void 0!==g?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(A,g)):this.multiplyQuaternions(this,A)},premultiply:function(A){return this.multiplyQuaternions(A,this)},multiplyQuaternions:function(A,g){var C=A.CA,I=A.IA,t=A.tA,i=A.iA,n=g.CA,s=g.IA,A=g.tA,g=g.iA;return this.CA=C*g+i*n+I*A-t*s,this.IA=I*g+i*s+t*n-C*A,this.tA=t*g+i*A+C*s-I*n,this.iA=i*g-C*n-I*s-t*A,this.nA(),this},slerp:function(A,g){if(0===g)return this;if(1===g)return this.copy(A);var C=this.CA,I=this.IA,t=this.tA,i=this.iA,n=i*A.iA+C*A.CA+I*A.IA+t*A.tA;if(n<0?(this.iA=-A.iA,this.CA=-A.CA,this.IA=-A.IA,this.tA=-A.tA,n=-n):this.copy(A),1<=n)return this.iA=i,this.CA=C,this.IA=I,this.tA=t,this;A=1-n*n;if(A<=Number.EPSILON){var s=1-g;return this.iA=s*i+g*this.iA,this.CA=s*C+g*this.CA,this.IA=s*I+g*this.IA,this.tA=s*t+g*this.tA,this.normalize(),this.nA(),this}s=Math.sqrt(A),A=Math.atan2(s,n),n=Math.sin((1-g)*A)/s,s=Math.sin(g*A)/s;return this.iA=i*n+this.iA*s,this.CA=C*n+this.CA*s,this.IA=I*n+this.IA*s,this.tA=t*n+this.tA*s,this.nA(),this},equals:function(A){return A.CA===this.CA&&A.IA===this.IA&&A.tA===this.tA&&A.iA===this.iA},fromArray:function(A,g){return this.CA=A[g=void 0===g?0:g],this.IA=A[g+1],this.tA=A[g+2],this.iA=A[g+3],this.nA(),this},toArray:function(A,g){return(A=void 0===A?[]:A)[g=void 0===g?0:g]=this.CA,A[g+1]=this.IA,A[g+2]=this.tA,A[g+3]=this.iA,A},fromBufferAttribute:function(A,g){return this.CA=A.getX(g),this.IA=A.getY(g),this.tA=A.getZ(g),this.iA=A.getW(g),this},NC:function(A){return this.nA=A,this},nA:function(){}});var fA=new dA,vA=new lA;function dA(A,g,C){this.x=A||0,this.y=g||0,this.z=C||0}Object.assign(dA.prototype,{isVector3:!0,set:function(A,g,C){return this.x=A,this.y=g,this.z=C,this},setScalar:function(A){return this.x=A,this.y=A,this.z=A,this},setX:function(A){return this.x=A,this},setY:function(A){return this.y=A,this},setZ:function(A){return this.z=A,this},setComponent:function(A,g){switch(A){case 0:this.x=g;break;case 1:this.y=g;break;case 2:this.z=g;break;default:throw new Error("index is out of range: "+A)}return this},getComponent:function(A){switch(A){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+A)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(A){return this.x=A.x,this.y=A.y,this.z=A.z,this},add:function(A,g){return void 0!==g?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(A,g)):(this.x+=A.x,this.y+=A.y,this.z+=A.z,this)},addScalar:function(A){return this.x+=A,this.y+=A,this.z+=A,this},addVectors:function(A,g){return this.x=A.x+g.x,this.y=A.y+g.y,this.z=A.z+g.z,this},addScaledVector:function(A,g){return this.x+=A.x*g,this.y+=A.y*g,this.z+=A.z*g,this},sub:function(A,g){return void 0!==g?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(A,g)):(this.x-=A.x,this.y-=A.y,this.z-=A.z,this)},subScalar:function(A){return this.x-=A,this.y-=A,this.z-=A,this},subVectors:function(A,g){return this.x=A.x-g.x,this.y=A.y-g.y,this.z=A.z-g.z,this},multiply:function(A,g){return void 0!==g?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(A,g)):(this.x*=A.x,this.y*=A.y,this.z*=A.z,this)},multiplyScalar:function(A){return this.x*=A,this.y*=A,this.z*=A,this},multiplyVectors:function(A,g){return this.x=A.x*g.x,this.y=A.y*g.y,this.z=A.z*g.z,this},applyEuler:function(A){return A&&A.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(vA.setFromEuler(A))},applyAxisAngle:function(A,g){return this.applyQuaternion(vA.setFromAxisAngle(A,g))},applyMatrix3:function(A){var g=this.x,C=this.y,I=this.z,A=A.elements;return this.x=A[0]*g+A[3]*C+A[6]*I,this.y=A[1]*g+A[4]*C+A[7]*I,this.z=A[2]*g+A[5]*C+A[8]*I,this},applyNormalMatrix:function(A){return this.applyMatrix3(A).normalize()},applyMatrix4:function(A){var g=this.x,C=this.y,I=this.z,t=A.elements,A=1/(t[3]*g+t[7]*C+t[11]*I+t[15]);return this.x=(t[0]*g+t[4]*C+t[8]*I+t[12])*A,this.y=(t[1]*g+t[5]*C+t[9]*I+t[13])*A,this.z=(t[2]*g+t[6]*C+t[10]*I+t[14])*A,this},applyQuaternion:function(A){var g=this.x,C=this.y,I=this.z,t=A.x,i=A.y,n=A.z,s=A.w,e=s*g+i*I-n*C,h=s*C+n*g-t*I,A=s*I+t*C-i*g,I=-t*g-i*C-n*I;return this.x=e*s+I*-t+h*-n-A*-i,this.y=h*s+I*-i+A*-t-e*-n,this.z=A*s+I*-n+e*-i-h*-t,this},project:function(A){return this.applyMatrix4(A.matrixWorldInverse).applyMatrix4(A.projectionMatrix)},unproject:function(A){return this.applyMatrix4(A.projectionMatrixInverse).applyMatrix4(A.matrixWorld)},transformDirection:function(A){var g=this.x,C=this.y,I=this.z,A=A.elements;return this.x=A[0]*g+A[4]*C+A[8]*I,this.y=A[1]*g+A[5]*C+A[9]*I,this.z=A[2]*g+A[6]*C+A[10]*I,this.normalize()},divide:function(A){return this.x/=A.x,this.y/=A.y,this.z/=A.z,this},divideScalar:function(A){return this.multiplyScalar(1/A)},min:function(A){return this.x=Math.min(this.x,A.x),this.y=Math.min(this.y,A.y),this.z=Math.min(this.z,A.z),this},max:function(A){return this.x=Math.max(this.x,A.x),this.y=Math.max(this.y,A.y),this.z=Math.max(this.z,A.z),this},clamp:function(A,g){return this.x=Math.max(A.x,Math.min(g.x,this.x)),this.y=Math.max(A.y,Math.min(g.y,this.y)),this.z=Math.max(A.z,Math.min(g.z,this.z)),this},clampScalar:function(A,g){return this.x=Math.max(A,Math.min(g,this.x)),this.y=Math.max(A,Math.min(g,this.y)),this.z=Math.max(A,Math.min(g,this.z)),this},clampLength:function(A,g){var C=this.length();return this.divideScalar(C||1).multiplyScalar(Math.max(A,Math.min(g,C)))},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(A){return this.x*A.x+this.y*A.y+this.z*A.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(A){return this.normalize().multiplyScalar(A)},lerp:function(A,g){return this.x+=(A.x-this.x)*g,this.y+=(A.y-this.y)*g,this.z+=(A.z-this.z)*g,this},lerpVectors:function(A,g,C){return this.subVectors(g,A).multiplyScalar(C).add(A)},cross:function(A,g){return void 0!==g?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(A,g)):this.crossVectors(this,A)},crossVectors:function(A,g){var C=A.x,I=A.y,t=A.z,i=g.x,A=g.y,g=g.z;return this.x=I*g-t*A,this.y=t*i-C*g,this.z=C*A-I*i,this},projectOnVector:function(A){var g=A.lengthSq();if(0===g)return this.set(0,0,0);g=A.dot(this)/g;return this.copy(A).multiplyScalar(g)},projectOnPlane:function(A){return fA.copy(this).projectOnVector(A),this.sub(fA)},reflect:function(A){return this.sub(fA.copy(A).multiplyScalar(2*this.dot(A)))},angleTo:function(A){var g=Math.sqrt(this.lengthSq()*A.lengthSq());if(0===g)return Math.PI/2;g=this.dot(A)/g;return Math.acos(cA.clamp(g,-1,1))},distanceTo:function(A){return Math.sqrt(this.distanceToSquared(A))},distanceToSquared:function(A){var g=this.x-A.x,C=this.y-A.y,A=this.z-A.z;return g*g+C*C+A*A},manhattanDistanceTo:function(A){return Math.abs(this.x-A.x)+Math.abs(this.y-A.y)+Math.abs(this.z-A.z)},setFromSpherical:function(A){return this.setFromSphericalCoords(A.radius,A.phi,A.theta)},setFromSphericalCoords:function(A,g,C){var I=Math.sin(g)*A;return this.x=I*Math.sin(C),this.y=Math.cos(g)*A,this.z=I*Math.cos(C),this},setFromCylindrical:function(A){return this.setFromCylindricalCoords(A.radius,A.theta,A.y)},setFromCylindricalCoords:function(A,g,C){return this.x=A*Math.sin(g),this.y=C,this.z=A*Math.cos(g),this},setFromMatrixPosition:function(A){A=A.elements;return this.x=A[12],this.y=A[13],this.z=A[14],this},setFromMatrixScale:function(A){var g=this.setFromMatrixColumn(A,0).length(),C=this.setFromMatrixColumn(A,1).length(),A=this.setFromMatrixColumn(A,2).length();return this.x=g,this.y=C,this.z=A,this},setFromMatrixColumn:function(A,g){return this.fromArray(A.elements,4*g)},setFromMatrix3Column:function(A,g){return this.fromArray(A.elements,3*g)},equals:function(A){return A.x===this.x&&A.y===this.y&&A.z===this.z},fromArray:function(A,g){return this.x=A[g=void 0===g?0:g],this.y=A[g+1],this.z=A[g+2],this},toArray:function(A,g){return(A=void 0===A?[]:A)[g=void 0===g?0:g]=this.x,A[g+1]=this.y,A[g+2]=this.z,A},fromBufferAttribute:function(A,g,C){return void 0!==C&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=A.getX(g),this.y=A.getY(g),this.z=A.getZ(g),this}});var MA=new dA,pA=new kA,mA=new dA(0,0,0),yA=new dA(1,1,1),bA=new dA,wA=new dA,EA=new dA;function kA(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0