0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Kn.copy(n.boundingSphere),Kn.applyMatrix4(s),!1===e.ray.intersectsSphere(Kn))return;if(Xn.copy(s).invert(),Yn.copy(e.ray).applyMatrix4(Xn),null!==n.boundingBox&&!1===Yn.intersectsBox(n.boundingBox))return;let r;if(n.isBufferGeometry){const s=n.index,o=n.attributes.position,a=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,h=n.attributes.uv2,u=n.groups,d=n.drawRange;if(null!==s)if(Array.isArray(i))for(let n=0,p=u.length;nn.far?null:{distance:c,point:hi.clone(),object:e}}(e,t,n,i,Jn,Zn,Qn,ci);if(p){a&&(oi.fromBufferAttribute(a,c),ai.fromBufferAttribute(a,h),li.fromBufferAttribute(a,u),p.uv=xn.getUV(ci,Jn,Zn,Qn,oi,ai,li,new sn)),l&&(oi.fromBufferAttribute(l,c),ai.fromBufferAttribute(l,h),li.fromBufferAttribute(l,u),p.uv2=xn.getUV(ci,Jn,Zn,Qn,oi,ai,li,new sn));const e={a:c,b:h,c:u,normal:new Ve,materialIndex:0};xn.getNormal(Jn,Zn,Qn,e.normal),p.face=e}return p}ui.prototype.isMesh=!0;class pi extends qn{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,r=t/2,o=Math.floor(n),a=Math.floor(i),l=o+1,c=a+1,h=e/o,u=t/a,d=[],p=[],m=[],f=[];for(let e=0;e0)){l=i;break}l=i-1}if(i=l,n[i]===r)return i/(s-1);const c=n[i];return(i+(r-c)/(n[i+1]-c))/(s-1)}getTangent(e,t){const n=1e-4;let i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);const r=this.getPoint(i),o=this.getPoint(s),a=t||(r.isVector2?new sn:new Ve);return a.copy(o).sub(r).normalize(),a}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new Ve,i=[],s=[],r=[],o=new Ve,a=new je;for(let t=0;t<=e;t++){const n=t/e;i[t]=this.getTangentAt(n,new Ve)}s[0]=new Ve,r[0]=new Ve;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],o),r[0].crossVectors(i[0],s[0]);for(let t=1;t<=e;t++){if(s[t]=s[t-1].clone(),r[t]=r[t-1].clone(),o.crossVectors(i[t-1],i[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(De(i[t-1].dot(i[t]),-1,1));s[t].applyMatrix4(a.makeRotationAxis(o,e))}r[t].crossVectors(i[t],s[t])}if(!0===t){let t=Math.acos(De(s[0].dot(s[e]),-1,1));t/=e,i[0].dot(o.crossVectors(s[0],s[e]))>0&&(t=-t);for(let n=1;n<=e;n++)s[n].applyMatrix4(a.makeRotationAxis(i[n],t*n)),r[n].crossVectors(i[n],s[n])}return{tangents:i,normals:s,binormals:r}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class fi extends mi{constructor(e=0,t=0,n=1,i=1,s=0,r=2*Math.PI,o=!1,a=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=r,this.aClockwise=o,this.aRotation=a}getPoint(e,t){const n=t||new sn,i=2*Math.PI;let s=this.aEndAngle-this.aStartAngle;const r=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(l)/s)+1)*s:0===c&&l===s-1&&(l=s-2,c=1),this.closed||l>0?o=i[(l-1)%s]:(yi.subVectors(i[0],i[1]).add(i[0]),o=yi);const h=i[l%s],u=i[(l+1)%s];if(this.closed||l+2i.length-2?i.length-1:r+1],h=i[r>i.length-3?i.length-1:r+2];return n.set(Si(o,a.x,l.x,c.x,h.x),Si(o,a.y,l.y,c.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const e=i[s]-n,r=this.curves[s],o=r.getLength(),a=0===o?0:1-e/o;return r.getPointAt(a,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Ii extends Oi{constructor(e){super(e),this.uuid=Ne(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n80*n){a=c=e[0],l=h=e[1];for(let t=n;tc&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?1/p:0}return Vi(r,o,n,a,l,p),o};function zi(e,t,n,i,s){let r,o;if(s===function(e,t,n,i){let s=0;for(let r=t,o=n-i;r0)for(r=t;r=t;r-=i)o=ss(r,e[r],e[r+1],o);return o&&Zi(o,o.next)&&(rs(o),o=o.next),o}function Ui(e,t){if(!e)return e;t||(t=e);let n,i=e;do{if(n=!1,i.steiner||!Zi(i,i.next)&&0!==Ji(i.prev,i,i.next))i=i.next;else{if(rs(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function Vi(e,t,n,i,s,r,o){if(!e)return;!o&&r&&function(e,t,n,i){let s=e;do{null===s.z&&(s.z=qi(s.x,s.y,t,n,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==e);s.prevZ.nextZ=null,s.prevZ=null,function(e){let t,n,i,s,r,o,a,l,c=1;do{for(n=e,e=null,r=null,o=0;n;){for(o++,i=n,a=0,t=0;t0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(s=n,n=n.nextZ,a--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:e=s,s.prevZ=r,r=s;n=i}r.nextZ=null,c*=2}while(o>1)}(s)}(e,i,s,r);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,r?Bi(e,i,s,r):Fi(e))t.push(a.i/n),t.push(e.i/n),t.push(l.i/n),rs(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Vi(e=ji(Ui(e),t,n),t,n,i,s,r,2):2===o&&$i(e,t,n,i,s,r):Vi(Ui(e),t,n,i,s,r,1);break}}function Fi(e){const t=e.prev,n=e,i=e.next;if(Ji(t,n,i)>=0)return!1;let s=e.next.next;for(;s!==e.prev;){if(Yi(t.x,t.y,n.x,n.y,i.x,i.y,s.x,s.y)&&Ji(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function Bi(e,t,n,i){const s=e.prev,r=e,o=e.next;if(Ji(s,r,o)>=0)return!1;const a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,h=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,u=qi(a,l,t,n,i),d=qi(c,h,t,n,i);let p=e.prevZ,m=e.nextZ;for(;p&&p.z>=u&&m&&m.z<=d;){if(p!==e.prev&&p!==e.next&&Yi(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&Ji(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,m!==e.prev&&m!==e.next&&Yi(s.x,s.y,r.x,r.y,o.x,o.y,m.x,m.y)&&Ji(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&Yi(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&Ji(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==e.prev&&m!==e.next&&Yi(s.x,s.y,r.x,r.y,o.x,o.y,m.x,m.y)&&Ji(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function ji(e,t,n){let i=e;do{const s=i.prev,r=i.next.next;!Zi(s,r)&&Qi(s,i,i.next,r)&&ns(s,r)&&ns(r,s)&&(t.push(s.i/n),t.push(i.i/n),t.push(r.i/n),rs(i),rs(i.next),i=e=r),i=i.next}while(i!==e);return Ui(i)}function $i(e,t,n,i,s,r){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Ki(o,e)){let a=is(o,e);return o=Ui(o,o.next),a=Ui(a,a.next),Vi(o,t,n,i,s,r),void Vi(a,t,n,i,s,r)}e=e.next}o=o.next}while(o!==e)}function Hi(e,t){return e.x-t.x}function Gi(e,t){if(t=function(e,t){let n=t;const i=e.x,s=e.y;let r,o=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){const e=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=i&&e>o){if(o=e,e===i){if(s===n.y)return n;if(s===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&&Yi(sr.x||n.x===r.x&&Wi(r,n)))&&(r=n,u=h)),n=n.next}while(n!==a);return r}(e,t),t){const n=is(t,e);Ui(t,t.next),Ui(n,n.next)}}function Wi(e,t){return Ji(e.prev,e,t.prev)<0&&Ji(t.next,e,e.next)<0}function qi(e,t,n,i,s){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Xi(e){let t=e,n=e;do{(t.x=0&&(e-o)*(i-a)-(n-o)*(t-a)>=0&&(n-o)*(r-a)-(s-o)*(i-a)>=0}function Ki(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Qi(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(ns(e,t)&&ns(t,e)&&function(e,t){let n=e,i=!1;const s=(e.x+t.x)/2,r=(e.y+t.y)/2;do{n.y>r!=n.next.y>r&&n.next.y!==n.y&&s<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(Ji(e.prev,e,t.prev)||Ji(e,t.prev,t))||Zi(e,t)&&Ji(e.prev,e,e.next)>0&&Ji(t.prev,t,t.next)>0)}function Ji(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Zi(e,t){return e.x===t.x&&e.y===t.y}function Qi(e,t,n,i){const s=ts(Ji(e,t,n)),r=ts(Ji(e,t,i)),o=ts(Ji(n,i,e)),a=ts(Ji(n,i,t));return s!==r&&o!==a||(!(0!==s||!es(e,n,t))||(!(0!==r||!es(e,i,t))||(!(0!==o||!es(n,e,i))||!(0!==a||!es(n,t,i)))))}function es(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function ts(e){return e>0?1:e<0?-1:0}function ns(e,t){return Ji(e.prev,e,e.next)<0?Ji(e,t,e.next)>=0&&Ji(e,e.prev,t)>=0:Ji(e,t,e.prev)<0||Ji(e,e.next,t)<0}function is(e,t){const n=new os(e.i,e.x,e.y),i=new os(t.i,t.x,t.y),s=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=s,s.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function ss(e,t,n,i){const s=new os(e,t,n);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function rs(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function os(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class as{static area(e){const t=e.length;let n=0;for(let i=t-1,s=0;s2&&e[t-1].equals(e[0])&&e.pop()}function cs(e,t){for(let n=0;n{const e=navigator.userAgent||navigator.vendor||self.opera;let t=!1;return(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t})(),ps=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,ms=(()=>{const e=document.createElement("a");return Boolean(e.relList&&e.relList.supports&&e.relList.supports("ar"))})(),fs=(/\bCrOS\b/.test(navigator.userAgent),/android/i.test(navigator.userAgent));var gs,vs,ys;!function(e){e[e.mm=0]="mm",e[e.cm=1]="cm",e[e.m=2]="m",e[e.km=3]="km",e[e.in=4]="in",e[e.ft=5]="ft",e[e.yd=6]="yd",e[e.mi=7]="mi"}(gs||(gs={})),function(e){e[e.EN=0]="EN",e[e.ES=1]="ES",e[e.DE=2]="DE"}(vs||(vs={})),function(e){e.EN="English",e.ES="Spanish (Español)",e.DE="German (Deutsche)"}(ys||(ys={}));const bs=new Ve,xs=new Ve,_s=new je,ws=new Ue,Ss=new Ze;class Ms extends Rt{get settingProperties(){return[this.ins.position,this.ins.rotation,this.ins.scale]}get snapshotProperties(){return[this.ins.position,this.ins.rotation,this.ins.scale]}fromData(e){const{position:t,rotation:n,order:i,scale:s}=this.ins,r=Pt[i.getValidatedValue()];e.matrix?(_s.fromArray(e.matrix),_s.decompose(bs,ws,xs),bs.toArray(t.value),Ss.setFromQuaternion(ws,r),Ss.toVector3(bs).multiplyScalar(Le).toArray(n.value),xs.toArray(s.value),t.set(),n.set(),s.set()):(e.translation&&t.setValue(e.translation.slice()),e.rotation&&(ws.fromArray(e.rotation),Ss.setFromQuaternion(ws,r),Ss.toVector3(bs).multiplyScalar(Le).toArray(n.value),n.set()),e.scale&&s.setValue(e.scale.slice()),this.transform.changed=!0)}toData(){this.object3D.matrix.decompose(bs,ws,xs);const e={};return 0===bs.x&&0===bs.y&&0===bs.z||(e.translation=bs.toArray()),0===ws.x&&0===ws.y&&0===ws.z&&1===ws.w||(e.rotation=ws.toArray()),1===xs.x&&1===xs.y&&1===xs.z||(e.scale=xs.toArray()),e}}Ms.typeName="CVNode",Ms.text="Transform",Ms.icon="";class Es extends ft{constructor(){super(),this.type="Group"}}Es.prototype.isGroup=!0;class Ts extends wn{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Pn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}Ts.prototype.isLineBasicMaterial=!0;const Cs=new Ve,As=new Ve,Ps=new je,Rs=new Qt,Ls=new cn;class Ns extends ft{constructor(e=new qn,t=new Ts){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,i=t.count;ea)continue;u.applyMatrix4(this.matrixWorld);const d=e.ray.origin.distanceTo(u);de.far||t.push({distance:d,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,r.start),i=Math.min(s.count,r.start+r.count)-1;na)continue;u.applyMatrix4(this.matrixWorld);const i=e.ray.origin.distanceTo(u);i