Files
chorus-services/modules/teaser/.next/standalone/.next/server/app/page.js
tony c8fb816775 feat: Add CHORUS teaser website with mobile-responsive design
- Created complete Next.js 15 teaser website with CHORUS brand styling
- Implemented mobile-responsive 3D logo (128px mobile, 512px desktop)
- Added proper Exo font loading via Next.js Google Fonts for iOS/Chrome compatibility
- Built comprehensive early access form with GDPR compliance and rate limiting
- Integrated PostgreSQL database with complete schema for lead capture
- Added scroll indicators that auto-hide when scrolling begins
- Optimized mobile modal forms with proper scrolling and submit button access
- Deployed via Docker Swarm with Traefik SSL termination at chorus.services
- Includes database migrations, consent tracking, and email notifications

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-26 13:57:30 +10:00

2 lines
187 KiB
JavaScript

(()=>{var a={};a.id=974,a.ids=[974],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},2704:()=>{},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4149:(a,b,c)=>{Promise.resolve().then(c.bind(c,7742))},4366:()=>{},4535:(a,b,c)=>{"use strict";let d;c.r(b),c.d(b,{default:()=>b5});var e=c(1124),f=c(8301);function g(){let[a,b]=(0,f.useState)(!1),[c,d]=(0,f.useState)("early_access_waitlist"),[e,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)("idle"),[j,k]=(0,f.useState)(""),l=(0,f.useCallback)(a=>{d(a),b(!0),i("idle"),k("")},[]),m=(0,f.useCallback)(()=>{b(!1),i("idle"),k("")},[]),n=(0,f.useCallback)(async a=>{g(!0),i("idle"),k("");try{let b=await fetch("/api/early-access",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a,countryCode:"AU",customMessage:`Interest Level: ${a.interestLevel}`})}),c=await b.json();if(!b.ok)throw Error(c.error||`HTTP error! status: ${b.status}`);return i("success"),setTimeout(()=>{m()},2e3),{success:!0,message:c.message||"Successfully joined the waitlist!",leadId:c.leadId}}catch(b){let a=b instanceof Error?b.message:"Failed to submit request";return k(a),i("error"),{success:!1,message:"Failed to join waitlist",error:a}}finally{g(!1)}},[m]);return{isModalOpen:a,currentLeadSource:c,isSubmitting:e,submitStatus:h,errorMessage:j,openModal:l,closeModal:m,submitEarlyAccess:n,handleSuccess:(0,f.useCallback)(a=>{console.log("Early access lead captured:",a)},[])}}let h="srgb",i="srgb-linear",j="linear",k="srgb";class l{addEventListener(a,b){void 0===this._listeners&&(this._listeners={});let c=this._listeners;void 0===c[a]&&(c[a]=[]),-1===c[a].indexOf(b)&&c[a].push(b)}hasEventListener(a,b){let c=this._listeners;return void 0!==c&&void 0!==c[a]&&-1!==c[a].indexOf(b)}removeEventListener(a,b){let c=this._listeners;if(void 0===c)return;let d=c[a];if(void 0!==d){let a=d.indexOf(b);-1!==a&&d.splice(a,1)}}dispatchEvent(a){let b=this._listeners;if(void 0===b)return;let c=b[a.type];if(void 0!==c){a.target=this;let b=c.slice(0);for(let c=0,d=b.length;c<d;c++)b[c].call(this,a);a.target=null}}}let m=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function n(){let a=0xffffffff*Math.random()|0,b=0xffffffff*Math.random()|0,c=0xffffffff*Math.random()|0,d=0xffffffff*Math.random()|0;return(m[255&a]+m[a>>8&255]+m[a>>16&255]+m[a>>24&255]+"-"+m[255&b]+m[b>>8&255]+"-"+m[b>>16&15|64]+m[b>>24&255]+"-"+m[63&c|128]+m[c>>8&255]+"-"+m[c>>16&255]+m[c>>24&255]+m[255&d]+m[d>>8&255]+m[d>>16&255]+m[d>>24&255]).toLowerCase()}function o(a,b,c){return Math.max(b,Math.min(c,a))}class p{constructor(a=0,b=0){p.prototype.isVector2=!0,this.x=a,this.y=b}get width(){return this.x}set width(a){this.x=a}get height(){return this.y}set height(a){this.y=a}set(a,b){return this.x=a,this.y=b,this}setScalar(a){return this.x=a,this.y=a,this}setX(a){return this.x=a,this}setY(a){return this.y=a,this}setComponent(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a)}return this}getComponent(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a)}}clone(){return new this.constructor(this.x,this.y)}copy(a){return this.x=a.x,this.y=a.y,this}add(a){return this.x+=a.x,this.y+=a.y,this}addScalar(a){return this.x+=a,this.y+=a,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this}addScaledVector(a,b){return this.x+=a.x*b,this.y+=a.y*b,this}sub(a){return this.x-=a.x,this.y-=a.y,this}subScalar(a){return this.x-=a,this.y-=a,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this}multiply(a){return this.x*=a.x,this.y*=a.y,this}multiplyScalar(a){return this.x*=a,this.y*=a,this}divide(a){return this.x/=a.x,this.y/=a.y,this}divideScalar(a){return this.multiplyScalar(1/a)}applyMatrix3(a){let b=this.x,c=this.y,d=a.elements;return this.x=d[0]*b+d[3]*c+d[6],this.y=d[1]*b+d[4]*c+d[7],this}min(a){return this.x=Math.min(this.x,a.x),this.y=Math.min(this.y,a.y),this}max(a){return this.x=Math.max(this.x,a.x),this.y=Math.max(this.y,a.y),this}clamp(a,b){return this.x=o(this.x,a.x,b.x),this.y=o(this.y,a.y,b.y),this}clampScalar(a,b){return this.x=o(this.x,a,b),this.y=o(this.y,a,b),this}clampLength(a,b){let c=this.length();return this.divideScalar(c||1).multiplyScalar(o(c,a,b))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(a){return this.x*a.x+this.y*a.y}cross(a){return this.x*a.y-this.y*a.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(a){let b=Math.sqrt(this.lengthSq()*a.lengthSq());return 0===b?Math.PI/2:Math.acos(o(this.dot(a)/b,-1,1))}distanceTo(a){return Math.sqrt(this.distanceToSquared(a))}distanceToSquared(a){let b=this.x-a.x,c=this.y-a.y;return b*b+c*c}manhattanDistanceTo(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)}setLength(a){return this.normalize().multiplyScalar(a)}lerp(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this}lerpVectors(a,b,c){return this.x=a.x+(b.x-a.x)*c,this.y=a.y+(b.y-a.y)*c,this}equals(a){return a.x===this.x&&a.y===this.y}fromArray(a,b=0){return this.x=a[b],this.y=a[b+1],this}toArray(a=[],b=0){return a[b]=this.x,a[b+1]=this.y,a}fromBufferAttribute(a,b){return this.x=a.getX(b),this.y=a.getY(b),this}rotateAround(a,b){let c=Math.cos(b),d=Math.sin(b),e=this.x-a.x,f=this.y-a.y;return this.x=e*c-f*d+a.x,this.y=e*d+f*c+a.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class q{constructor(a=0,b=0,c=0,d=1){this.isQuaternion=!0,this._x=a,this._y=b,this._z=c,this._w=d}static slerpFlat(a,b,c,d,e,f,g){let h=c[d+0],i=c[d+1],j=c[d+2],k=c[d+3],l=e[f+0],m=e[f+1],n=e[f+2],o=e[f+3];if(0===g){a[b+0]=h,a[b+1]=i,a[b+2]=j,a[b+3]=k;return}if(1===g){a[b+0]=l,a[b+1]=m,a[b+2]=n,a[b+3]=o;return}if(k!==o||h!==l||i!==m||j!==n){let a=1-g,b=h*l+i*m+j*n+k*o,c=b>=0?1:-1,d=1-b*b;if(d>Number.EPSILON){let e=Math.sqrt(d),f=Math.atan2(e,b*c);a=Math.sin(a*f)/e,g=Math.sin(g*f)/e}let e=g*c;if(h=h*a+l*e,i=i*a+m*e,j=j*a+n*e,k=k*a+o*e,a===1-g){let a=1/Math.sqrt(h*h+i*i+j*j+k*k);h*=a,i*=a,j*=a,k*=a}}a[b]=h,a[b+1]=i,a[b+2]=j,a[b+3]=k}static multiplyQuaternionsFlat(a,b,c,d,e,f){let g=c[d],h=c[d+1],i=c[d+2],j=c[d+3],k=e[f],l=e[f+1],m=e[f+2],n=e[f+3];return a[b]=g*n+j*k+h*m-i*l,a[b+1]=h*n+j*l+i*k-g*m,a[b+2]=i*n+j*m+g*l-h*k,a[b+3]=j*n-g*k-h*l-i*m,a}get x(){return this._x}set x(a){this._x=a,this._onChangeCallback()}get y(){return this._y}set y(a){this._y=a,this._onChangeCallback()}get z(){return this._z}set z(a){this._z=a,this._onChangeCallback()}get w(){return this._w}set w(a){this._w=a,this._onChangeCallback()}set(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._w=d,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(a){return this._x=a.x,this._y=a.y,this._z=a.z,this._w=a.w,this._onChangeCallback(),this}setFromEuler(a,b=!0){let c=a._x,d=a._y,e=a._z,f=a._order,g=Math.cos,h=Math.sin,i=g(c/2),j=g(d/2),k=g(e/2),l=h(c/2),m=h(d/2),n=h(e/2);switch(f){case"XYZ":this._x=l*j*k+i*m*n,this._y=i*m*k-l*j*n,this._z=i*j*n+l*m*k,this._w=i*j*k-l*m*n;break;case"YXZ":this._x=l*j*k+i*m*n,this._y=i*m*k-l*j*n,this._z=i*j*n-l*m*k,this._w=i*j*k+l*m*n;break;case"ZXY":this._x=l*j*k-i*m*n,this._y=i*m*k+l*j*n,this._z=i*j*n+l*m*k,this._w=i*j*k-l*m*n;break;case"ZYX":this._x=l*j*k-i*m*n,this._y=i*m*k+l*j*n,this._z=i*j*n-l*m*k,this._w=i*j*k+l*m*n;break;case"YZX":this._x=l*j*k+i*m*n,this._y=i*m*k+l*j*n,this._z=i*j*n-l*m*k,this._w=i*j*k-l*m*n;break;case"XZY":this._x=l*j*k-i*m*n,this._y=i*m*k-l*j*n,this._z=i*j*n+l*m*k,this._w=i*j*k+l*m*n;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+f)}return!0===b&&this._onChangeCallback(),this}setFromAxisAngle(a,b){let c=b/2,d=Math.sin(c);return this._x=a.x*d,this._y=a.y*d,this._z=a.z*d,this._w=Math.cos(c),this._onChangeCallback(),this}setFromRotationMatrix(a){let b=a.elements,c=b[0],d=b[4],e=b[8],f=b[1],g=b[5],h=b[9],i=b[2],j=b[6],k=b[10],l=c+g+k;if(l>0){let a=.5/Math.sqrt(l+1);this._w=.25/a,this._x=(j-h)*a,this._y=(e-i)*a,this._z=(f-d)*a}else if(c>g&&c>k){let a=2*Math.sqrt(1+c-g-k);this._w=(j-h)/a,this._x=.25*a,this._y=(d+f)/a,this._z=(e+i)/a}else if(g>k){let a=2*Math.sqrt(1+g-c-k);this._w=(e-i)/a,this._x=(d+f)/a,this._y=.25*a,this._z=(h+j)/a}else{let a=2*Math.sqrt(1+k-c-g);this._w=(f-d)/a,this._x=(e+i)/a,this._y=(h+j)/a,this._z=.25*a}return this._onChangeCallback(),this}setFromUnitVectors(a,b){let c=a.dot(b)+1;return c<1e-8?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x=a.y*b.z-a.z*b.y,this._y=a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x),this._w=c,this.normalize()}angleTo(a){return 2*Math.acos(Math.abs(o(this.dot(a),-1,1)))}rotateTowards(a,b){let c=this.angleTo(a);if(0===c)return this;let d=Math.min(1,b/c);return this.slerp(a,d),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let a=this.length();return 0===a?(this._x=0,this._y=0,this._z=0,this._w=1):(a=1/a,this._x=this._x*a,this._y=this._y*a,this._z=this._z*a,this._w=this._w*a),this._onChangeCallback(),this}multiply(a){return this.multiplyQuaternions(this,a)}premultiply(a){return this.multiplyQuaternions(a,this)}multiplyQuaternions(a,b){let c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,i=b._z,j=b._w;return this._x=c*j+f*g+d*i-e*h,this._y=d*j+f*h+e*g-c*i,this._z=e*j+f*i+c*h-d*g,this._w=f*j-c*g-d*h-e*i,this._onChangeCallback(),this}slerp(a,b){if(0===b)return this;if(1===b)return this.copy(a);let c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;if(g<0?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a),g>=1)return this._w=f,this._x=c,this._y=d,this._z=e,this;let h=1-g*g;if(h<=Number.EPSILON){let a=1-b;return this._w=a*f+b*this._w,this._x=a*c+b*this._x,this._y=a*d+b*this._y,this._z=a*e+b*this._z,this.normalize(),this}let i=Math.sqrt(h),j=Math.atan2(i,g),k=Math.sin((1-b)*j)/i,l=Math.sin(b*j)/i;return this._w=f*k+this._w*l,this._x=c*k+this._x*l,this._y=d*k+this._y*l,this._z=e*k+this._z*l,this._onChangeCallback(),this}slerpQuaternions(a,b,c){return this.copy(a).slerp(b,c)}random(){let a=2*Math.PI*Math.random(),b=2*Math.PI*Math.random(),c=Math.random(),d=Math.sqrt(1-c),e=Math.sqrt(c);return this.set(d*Math.sin(a),d*Math.cos(a),e*Math.sin(b),e*Math.cos(b))}equals(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w}fromArray(a,b=0){return this._x=a[b],this._y=a[b+1],this._z=a[b+2],this._w=a[b+3],this._onChangeCallback(),this}toArray(a=[],b=0){return a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._w,a}fromBufferAttribute(a,b){return this._x=a.getX(b),this._y=a.getY(b),this._z=a.getZ(b),this._w=a.getW(b),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(a){return this._onChangeCallback=a,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class r{constructor(a=0,b=0,c=0){r.prototype.isVector3=!0,this.x=a,this.y=b,this.z=c}set(a,b,c){return void 0===c&&(c=this.z),this.x=a,this.y=b,this.z=c,this}setScalar(a){return this.x=a,this.y=a,this.z=a,this}setX(a){return this.x=a,this}setY(a){return this.y=a,this}setZ(a){return this.z=a,this}setComponent(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a)}return this}getComponent(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(a){return this.x=a.x,this.y=a.y,this.z=a.z,this}add(a){return this.x+=a.x,this.y+=a.y,this.z+=a.z,this}addScalar(a){return this.x+=a,this.y+=a,this.z+=a,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this}addScaledVector(a,b){return this.x+=a.x*b,this.y+=a.y*b,this.z+=a.z*b,this}sub(a){return this.x-=a.x,this.y-=a.y,this.z-=a.z,this}subScalar(a){return this.x-=a,this.y-=a,this.z-=a,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this}multiply(a){return this.x*=a.x,this.y*=a.y,this.z*=a.z,this}multiplyScalar(a){return this.x*=a,this.y*=a,this.z*=a,this}multiplyVectors(a,b){return this.x=a.x*b.x,this.y=a.y*b.y,this.z=a.z*b.z,this}applyEuler(a){return this.applyQuaternion(t.setFromEuler(a))}applyAxisAngle(a,b){return this.applyQuaternion(t.setFromAxisAngle(a,b))}applyMatrix3(a){let b=this.x,c=this.y,d=this.z,e=a.elements;return this.x=e[0]*b+e[3]*c+e[6]*d,this.y=e[1]*b+e[4]*c+e[7]*d,this.z=e[2]*b+e[5]*c+e[8]*d,this}applyNormalMatrix(a){return this.applyMatrix3(a).normalize()}applyMatrix4(a){let b=this.x,c=this.y,d=this.z,e=a.elements,f=1/(e[3]*b+e[7]*c+e[11]*d+e[15]);return this.x=(e[0]*b+e[4]*c+e[8]*d+e[12])*f,this.y=(e[1]*b+e[5]*c+e[9]*d+e[13])*f,this.z=(e[2]*b+e[6]*c+e[10]*d+e[14])*f,this}applyQuaternion(a){let b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z,h=a.w,i=2*(f*d-g*c),j=2*(g*b-e*d),k=2*(e*c-f*b);return this.x=b+h*i+f*k-g*j,this.y=c+h*j+g*i-e*k,this.z=d+h*k+e*j-f*i,this}project(a){return this.applyMatrix4(a.matrixWorldInverse).applyMatrix4(a.projectionMatrix)}unproject(a){return this.applyMatrix4(a.projectionMatrixInverse).applyMatrix4(a.matrixWorld)}transformDirection(a){let b=this.x,c=this.y,d=this.z,e=a.elements;return this.x=e[0]*b+e[4]*c+e[8]*d,this.y=e[1]*b+e[5]*c+e[9]*d,this.z=e[2]*b+e[6]*c+e[10]*d,this.normalize()}divide(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z,this}divideScalar(a){return this.multiplyScalar(1/a)}min(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(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(a,b){return this.x=o(this.x,a.x,b.x),this.y=o(this.y,a.y,b.y),this.z=o(this.z,a.z,b.z),this}clampScalar(a,b){return this.x=o(this.x,a,b),this.y=o(this.y,a,b),this.z=o(this.z,a,b),this}clampLength(a,b){let c=this.length();return this.divideScalar(c||1).multiplyScalar(o(c,a,b))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(a){return this.x*a.x+this.y*a.y+this.z*a.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(a){return this.normalize().multiplyScalar(a)}lerp(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this}lerpVectors(a,b,c){return this.x=a.x+(b.x-a.x)*c,this.y=a.y+(b.y-a.y)*c,this.z=a.z+(b.z-a.z)*c,this}cross(a){return this.crossVectors(this,a)}crossVectors(a,b){let c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;return this.x=d*h-e*g,this.y=e*f-c*h,this.z=c*g-d*f,this}projectOnVector(a){let b=a.lengthSq();if(0===b)return this.set(0,0,0);let c=a.dot(this)/b;return this.copy(a).multiplyScalar(c)}projectOnPlane(a){return s.copy(this).projectOnVector(a),this.sub(s)}reflect(a){return this.sub(s.copy(a).multiplyScalar(2*this.dot(a)))}angleTo(a){let b=Math.sqrt(this.lengthSq()*a.lengthSq());return 0===b?Math.PI/2:Math.acos(o(this.dot(a)/b,-1,1))}distanceTo(a){return Math.sqrt(this.distanceToSquared(a))}distanceToSquared(a){let b=this.x-a.x,c=this.y-a.y,d=this.z-a.z;return b*b+c*c+d*d}manhattanDistanceTo(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z-a.z)}setFromSpherical(a){return this.setFromSphericalCoords(a.radius,a.phi,a.theta)}setFromSphericalCoords(a,b,c){let d=Math.sin(b)*a;return this.x=d*Math.sin(c),this.y=Math.cos(b)*a,this.z=d*Math.cos(c),this}setFromCylindrical(a){return this.setFromCylindricalCoords(a.radius,a.theta,a.y)}setFromCylindricalCoords(a,b,c){return this.x=a*Math.sin(b),this.y=c,this.z=a*Math.cos(b),this}setFromMatrixPosition(a){let b=a.elements;return this.x=b[12],this.y=b[13],this.z=b[14],this}setFromMatrixScale(a){let b=this.setFromMatrixColumn(a,0).length(),c=this.setFromMatrixColumn(a,1).length(),d=this.setFromMatrixColumn(a,2).length();return this.x=b,this.y=c,this.z=d,this}setFromMatrixColumn(a,b){return this.fromArray(a.elements,4*b)}setFromMatrix3Column(a,b){return this.fromArray(a.elements,3*b)}setFromEuler(a){return this.x=a._x,this.y=a._y,this.z=a._z,this}setFromColor(a){return this.x=a.r,this.y=a.g,this.z=a.b,this}equals(a){return a.x===this.x&&a.y===this.y&&a.z===this.z}fromArray(a,b=0){return this.x=a[b],this.y=a[b+1],this.z=a[b+2],this}toArray(a=[],b=0){return a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a}fromBufferAttribute(a,b){return this.x=a.getX(b),this.y=a.getY(b),this.z=a.getZ(b),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let a=Math.random()*Math.PI*2,b=2*Math.random()-1,c=Math.sqrt(1-b*b);return this.x=c*Math.cos(a),this.y=b,this.z=c*Math.sin(a),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let s=new r,t=new q;class u{constructor(a,b,c,d,e,f,g,h,i){u.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==a&&this.set(a,b,c,d,e,f,g,h,i)}set(a,b,c,d,e,f,g,h,i){let j=this.elements;return j[0]=a,j[1]=d,j[2]=g,j[3]=b,j[4]=e,j[5]=h,j[6]=c,j[7]=f,j[8]=i,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(a){let b=this.elements,c=a.elements;return b[0]=c[0],b[1]=c[1],b[2]=c[2],b[3]=c[3],b[4]=c[4],b[5]=c[5],b[6]=c[6],b[7]=c[7],b[8]=c[8],this}extractBasis(a,b,c){return a.setFromMatrix3Column(this,0),b.setFromMatrix3Column(this,1),c.setFromMatrix3Column(this,2),this}setFromMatrix4(a){let b=a.elements;return this.set(b[0],b[4],b[8],b[1],b[5],b[9],b[2],b[6],b[10]),this}multiply(a){return this.multiplyMatrices(this,a)}premultiply(a){return this.multiplyMatrices(a,this)}multiplyMatrices(a,b){let c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[3],h=c[6],i=c[1],j=c[4],k=c[7],l=c[2],m=c[5],n=c[8],o=d[0],p=d[3],q=d[6],r=d[1],s=d[4],t=d[7],u=d[2],v=d[5],w=d[8];return e[0]=f*o+g*r+h*u,e[3]=f*p+g*s+h*v,e[6]=f*q+g*t+h*w,e[1]=i*o+j*r+k*u,e[4]=i*p+j*s+k*v,e[7]=i*q+j*t+k*w,e[2]=l*o+m*r+n*u,e[5]=l*p+m*s+n*v,e[8]=l*q+m*t+n*w,this}multiplyScalar(a){let b=this.elements;return b[0]*=a,b[3]*=a,b[6]*=a,b[1]*=a,b[4]*=a,b[7]*=a,b[2]*=a,b[5]*=a,b[8]*=a,this}determinant(){let a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8];return b*f*j-b*g*i-c*e*j+c*g*h+d*e*i-d*f*h}invert(){let a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=j*f-g*i,l=g*h-j*e,m=i*e-f*h,n=b*k+c*l+d*m;if(0===n)return this.set(0,0,0,0,0,0,0,0,0);let o=1/n;return a[0]=k*o,a[1]=(d*i-j*c)*o,a[2]=(g*c-d*f)*o,a[3]=l*o,a[4]=(j*b-d*h)*o,a[5]=(d*e-g*b)*o,a[6]=m*o,a[7]=(c*h-i*b)*o,a[8]=(f*b-c*e)*o,this}transpose(){let a,b=this.elements;return a=b[1],b[1]=b[3],b[3]=a,a=b[2],b[2]=b[6],b[6]=a,a=b[5],b[5]=b[7],b[7]=a,this}getNormalMatrix(a){return this.setFromMatrix4(a).invert().transpose()}transposeIntoArray(a){let b=this.elements;return a[0]=b[0],a[1]=b[3],a[2]=b[6],a[3]=b[1],a[4]=b[4],a[5]=b[7],a[6]=b[2],a[7]=b[5],a[8]=b[8],this}setUvTransform(a,b,c,d,e,f,g){let h=Math.cos(e),i=Math.sin(e);return this.set(c*h,c*i,-c*(h*f+i*g)+f+a,-d*i,d*h,-d*(-i*f+h*g)+g+b,0,0,1),this}scale(a,b){return this.premultiply(v.makeScale(a,b)),this}rotate(a){return this.premultiply(v.makeRotation(-a)),this}translate(a,b){return this.premultiply(v.makeTranslation(a,b)),this}makeTranslation(a,b){return a.isVector2?this.set(1,0,a.x,0,1,a.y,0,0,1):this.set(1,0,a,0,1,b,0,0,1),this}makeRotation(a){let b=Math.cos(a),c=Math.sin(a);return this.set(b,-c,0,c,b,0,0,0,1),this}makeScale(a,b){return this.set(a,0,0,0,b,0,0,0,1),this}equals(a){let b=this.elements,c=a.elements;for(let a=0;a<9;a++)if(b[a]!==c[a])return!1;return!0}fromArray(a,b=0){for(let c=0;c<9;c++)this.elements[c]=a[c+b];return this}toArray(a=[],b=0){let c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a}clone(){return new this.constructor().fromArray(this.elements)}}let v=new u;function w(a){return document.createElementNS("http://www.w3.org/1999/xhtml",a)}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let x={};function y(a){a in x||(x[a]=!0,console.warn(a))}let z=new u().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),A=new u().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),B=function(){let a={enabled:!0,workingColorSpace:i,spaces:{},convert:function(a,b,c){return!1!==this.enabled&&b!==c&&b&&c&&(this.spaces[b].transfer===k&&(a.r=C(a.r),a.g=C(a.g),a.b=C(a.b)),this.spaces[b].primaries!==this.spaces[c].primaries&&(a.applyMatrix3(this.spaces[b].toXYZ),a.applyMatrix3(this.spaces[c].fromXYZ)),this.spaces[c].transfer===k&&(a.r=D(a.r),a.g=D(a.g),a.b=D(a.b))),a},workingToColorSpace:function(a,b){return this.convert(a,this.workingColorSpace,b)},colorSpaceToWorking:function(a,b){return this.convert(a,b,this.workingColorSpace)},getPrimaries:function(a){return this.spaces[a].primaries},getTransfer:function(a){return""===a?j:this.spaces[a].transfer},getLuminanceCoefficients:function(a,b=this.workingColorSpace){return a.fromArray(this.spaces[b].luminanceCoefficients)},define:function(a){Object.assign(this.spaces,a)},_getMatrix:function(a,b,c){return a.copy(this.spaces[b].toXYZ).multiply(this.spaces[c].fromXYZ)},_getDrawingBufferColorSpace:function(a){return this.spaces[a].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(a=this.workingColorSpace){return this.spaces[a].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(b,c){return y("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),a.workingToColorSpace(b,c)},toWorkingColorSpace:function(b,c){return y("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),a.colorSpaceToWorking(b,c)}},b=[.64,.33,.3,.6,.15,.06],c=[.2126,.7152,.0722],d=[.3127,.329];return a.define({[i]:{primaries:b,whitePoint:d,transfer:j,toXYZ:z,fromXYZ:A,luminanceCoefficients:c,workingColorSpaceConfig:{unpackColorSpace:h},outputColorSpaceConfig:{drawingBufferColorSpace:h}},[h]:{primaries:b,whitePoint:d,transfer:k,toXYZ:z,fromXYZ:A,luminanceCoefficients:c,outputColorSpaceConfig:{drawingBufferColorSpace:h}}}),a}();function C(a){return a<.04045?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function D(a){return a<.0031308?12.92*a:1.055*Math.pow(a,.41666)-.055}class E{static getDataURL(a,b="image/png"){let c;if(/^data:/i.test(a.src)||"undefined"==typeof HTMLCanvasElement)return a.src;if(a instanceof HTMLCanvasElement)c=a;else{void 0===d&&(d=w("canvas")),d.width=a.width,d.height=a.height;let b=d.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height),c=d}return c.toDataURL(b)}static sRGBToLinear(a){if("undefined"!=typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&a instanceof ImageBitmap){let b=w("canvas");b.width=a.width,b.height=a.height;let c=b.getContext("2d");c.drawImage(a,0,0,a.width,a.height);let d=c.getImageData(0,0,a.width,a.height),e=d.data;for(let a=0;a<e.length;a++)e[a]=255*C(e[a]/255);return c.putImageData(d,0,0),b}if(!a.data)return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),a;{let b=a.data.slice(0);for(let a=0;a<b.length;a++)b instanceof Uint8Array||b instanceof Uint8ClampedArray?b[a]=Math.floor(255*C(b[a]/255)):b[a]=C(b[a]);return{data:b,width:a.width,height:a.height}}}}let F=0;class G{constructor(a=null){this.isSource=!0,Object.defineProperty(this,"id",{value:F++}),this.uuid=n(),this.data=a,this.dataReady=!0,this.version=0}getSize(a){let b=this.data;return b instanceof HTMLVideoElement?a.set(b.videoWidth,b.videoHeight,0):b instanceof VideoFrame?a.set(b.displayHeight,b.displayWidth,0):null!==b?a.set(b.width,b.height,b.depth||0):a.set(0,0,0),a}set needsUpdate(a){!0===a&&this.version++}toJSON(a){let b=void 0===a||"string"==typeof a;if(!b&&void 0!==a.images[this.uuid])return a.images[this.uuid];let c={uuid:this.uuid,url:""},d=this.data;if(null!==d){let a;if(Array.isArray(d)){a=[];for(let b=0,c=d.length;b<c;b++)d[b].isDataTexture?a.push(H(d[b].image)):a.push(H(d[b]))}else a=H(d);c.url=a}return b||(a.images[this.uuid]=c),c}}function H(a){return"undefined"!=typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&a instanceof ImageBitmap?E.getDataURL(a):a.data?{data:Array.from(a.data),width:a.width,height:a.height,type:a.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let I=0,J=new r;class K extends l{constructor(a=K.DEFAULT_IMAGE,b=K.DEFAULT_MAPPING,c=1001,d=1001,e=1006,f=1008,g=1023,h=1009,i=K.DEFAULT_ANISOTROPY,j=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:I++}),this.uuid=n(),this.name="",this.source=new G(a),this.mipmaps=[],this.mapping=b,this.channel=0,this.wrapS=c,this.wrapT=d,this.magFilter=e,this.minFilter=f,this.anisotropy=i,this.format=g,this.internalFormat=null,this.type=h,this.offset=new p(0,0),this.repeat=new p(1,1),this.center=new p(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new u,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=j,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!a&&!!a.depth&&a.depth>1,this.pmremVersion=0}get width(){return this.source.getSize(J).x}get height(){return this.source.getSize(J).y}get depth(){return this.source.getSize(J).z}get image(){return this.source.data}set image(a=null){this.source.data=a}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(a,b){this.updateRanges.push({start:a,count:b})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(a){return this.name=a.name,this.source=a.source,this.mipmaps=a.mipmaps.slice(0),this.mapping=a.mapping,this.channel=a.channel,this.wrapS=a.wrapS,this.wrapT=a.wrapT,this.magFilter=a.magFilter,this.minFilter=a.minFilter,this.anisotropy=a.anisotropy,this.format=a.format,this.internalFormat=a.internalFormat,this.type=a.type,this.offset.copy(a.offset),this.repeat.copy(a.repeat),this.center.copy(a.center),this.rotation=a.rotation,this.matrixAutoUpdate=a.matrixAutoUpdate,this.matrix.copy(a.matrix),this.generateMipmaps=a.generateMipmaps,this.premultiplyAlpha=a.premultiplyAlpha,this.flipY=a.flipY,this.unpackAlignment=a.unpackAlignment,this.colorSpace=a.colorSpace,this.renderTarget=a.renderTarget,this.isRenderTargetTexture=a.isRenderTargetTexture,this.isArrayTexture=a.isArrayTexture,this.userData=JSON.parse(JSON.stringify(a.userData)),this.needsUpdate=!0,this}setValues(a){for(let b in a){let c=a[b];if(void 0===c){console.warn(`THREE.Texture.setValues(): parameter '${b}' has value of undefined.`);continue}let d=this[b];if(void 0===d){console.warn(`THREE.Texture.setValues(): property '${b}' does not exist.`);continue}d&&c&&d.isVector2&&c.isVector2||d&&c&&d.isVector3&&c.isVector3||d&&c&&d.isMatrix3&&c.isMatrix3?d.copy(c):this[b]=c}}toJSON(a){let b=void 0===a||"string"==typeof a;if(!b&&void 0!==a.textures[this.uuid])return a.textures[this.uuid];let c={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(a).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(c.userData=this.userData),b||(a.textures[this.uuid]=c),c}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(a){if(300!==this.mapping)return a;if(a.applyMatrix3(this.matrix),a.x<0||a.x>1)switch(this.wrapS){case 1e3:a.x=a.x-Math.floor(a.x);break;case 1001:a.x=a.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(a.x)%2)?a.x=Math.ceil(a.x)-a.x:a.x=a.x-Math.floor(a.x)}if(a.y<0||a.y>1)switch(this.wrapT){case 1e3:a.y=a.y-Math.floor(a.y);break;case 1001:a.y=a.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(a.y)%2)?a.y=Math.ceil(a.y)-a.y:a.y=a.y-Math.floor(a.y)}return this.flipY&&(a.y=1-a.y),a}set needsUpdate(a){!0===a&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(a){!0===a&&this.pmremVersion++}}K.DEFAULT_IMAGE=null,K.DEFAULT_MAPPING=300,K.DEFAULT_ANISOTROPY=1;class L{constructor(a=0,b=0,c=0,d=1){L.prototype.isVector4=!0,this.x=a,this.y=b,this.z=c,this.w=d}get width(){return this.z}set width(a){this.z=a}get height(){return this.w}set height(a){this.w=a}set(a,b,c,d){return this.x=a,this.y=b,this.z=c,this.w=d,this}setScalar(a){return this.x=a,this.y=a,this.z=a,this.w=a,this}setX(a){return this.x=a,this}setY(a){return this.y=a,this}setZ(a){return this.z=a,this}setW(a){return this.w=a,this}setComponent(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a)}return this}getComponent(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(a){return this.x=a.x,this.y=a.y,this.z=a.z,this.w=void 0!==a.w?a.w:1,this}add(a){return this.x+=a.x,this.y+=a.y,this.z+=a.z,this.w+=a.w,this}addScalar(a){return this.x+=a,this.y+=a,this.z+=a,this.w+=a,this}addVectors(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this.w=a.w+b.w,this}addScaledVector(a,b){return this.x+=a.x*b,this.y+=a.y*b,this.z+=a.z*b,this.w+=a.w*b,this}sub(a){return this.x-=a.x,this.y-=a.y,this.z-=a.z,this.w-=a.w,this}subScalar(a){return this.x-=a,this.y-=a,this.z-=a,this.w-=a,this}subVectors(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this.w=a.w-b.w,this}multiply(a){return this.x*=a.x,this.y*=a.y,this.z*=a.z,this.w*=a.w,this}multiplyScalar(a){return this.x*=a,this.y*=a,this.z*=a,this.w*=a,this}applyMatrix4(a){let b=this.x,c=this.y,d=this.z,e=this.w,f=a.elements;return this.x=f[0]*b+f[4]*c+f[8]*d+f[12]*e,this.y=f[1]*b+f[5]*c+f[9]*d+f[13]*e,this.z=f[2]*b+f[6]*c+f[10]*d+f[14]*e,this.w=f[3]*b+f[7]*c+f[11]*d+f[15]*e,this}divide(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z,this.w/=a.w,this}divideScalar(a){return this.multiplyScalar(1/a)}setAxisAngleFromQuaternion(a){this.w=2*Math.acos(a.w);let b=Math.sqrt(1-a.w*a.w);return b<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b),this}setAxisAngleFromRotationMatrix(a){let b,c,d,e,f=a.elements,g=f[0],h=f[4],i=f[8],j=f[1],k=f[5],l=f[9],m=f[2],n=f[6],o=f[10];if(.01>Math.abs(h-j)&&.01>Math.abs(i-m)&&.01>Math.abs(l-n)){if(.1>Math.abs(h+j)&&.1>Math.abs(i+m)&&.1>Math.abs(l+n)&&.1>Math.abs(g+k+o-3))return this.set(1,0,0,0),this;b=Math.PI;let a=(g+1)/2,f=(k+1)/2,p=(o+1)/2,q=(h+j)/4,r=(i+m)/4,s=(l+n)/4;return a>f&&a>p?a<.01?(c=0,d=.707106781,e=.707106781):(d=q/(c=Math.sqrt(a)),e=r/c):f>p?f<.01?(c=.707106781,d=0,e=.707106781):(c=q/(d=Math.sqrt(f)),e=s/d):p<.01?(c=.707106781,d=.707106781,e=0):(c=r/(e=Math.sqrt(p)),d=s/e),this.set(c,d,e,b),this}let p=Math.sqrt((n-l)*(n-l)+(i-m)*(i-m)+(j-h)*(j-h));return .001>Math.abs(p)&&(p=1),this.x=(n-l)/p,this.y=(i-m)/p,this.z=(j-h)/p,this.w=Math.acos((g+k+o-1)/2),this}setFromMatrixPosition(a){let b=a.elements;return this.x=b[12],this.y=b[13],this.z=b[14],this.w=b[15],this}min(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.w=Math.min(this.w,a.w),this}max(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.w=Math.max(this.w,a.w),this}clamp(a,b){return this.x=o(this.x,a.x,b.x),this.y=o(this.y,a.y,b.y),this.z=o(this.z,a.z,b.z),this.w=o(this.w,a.w,b.w),this}clampScalar(a,b){return this.x=o(this.x,a,b),this.y=o(this.y,a,b),this.z=o(this.z,a,b),this.w=o(this.w,a,b),this}clampLength(a,b){let c=this.length();return this.divideScalar(c||1).multiplyScalar(o(c,a,b))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(a){return this.normalize().multiplyScalar(a)}lerp(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this.w+=(a.w-this.w)*b,this}lerpVectors(a,b,c){return this.x=a.x+(b.x-a.x)*c,this.y=a.y+(b.y-a.y)*c,this.z=a.z+(b.z-a.z)*c,this.w=a.w+(b.w-a.w)*c,this}equals(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w}fromArray(a,b=0){return this.x=a[b],this.y=a[b+1],this.z=a[b+2],this.w=a[b+3],this}toArray(a=[],b=0){return a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a[b+3]=this.w,a}fromBufferAttribute(a,b){return this.x=a.getX(b),this.y=a.getY(b),this.z=a.getZ(b),this.w=a.getW(b),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class M{constructor(a=new r(Infinity,Infinity,Infinity),b=new r(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=a,this.max=b}set(a,b){return this.min.copy(a),this.max.copy(b),this}setFromArray(a){this.makeEmpty();for(let b=0,c=a.length;b<c;b+=3)this.expandByPoint(O.fromArray(a,b));return this}setFromBufferAttribute(a){this.makeEmpty();for(let b=0,c=a.count;b<c;b++)this.expandByPoint(O.fromBufferAttribute(a,b));return this}setFromPoints(a){this.makeEmpty();for(let b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this}setFromCenterAndSize(a,b){let c=O.copy(b).multiplyScalar(.5);return this.min.copy(a).sub(c),this.max.copy(a).add(c),this}setFromObject(a,b=!1){return this.makeEmpty(),this.expandByObject(a,b)}clone(){return new this.constructor().copy(this)}copy(a){return this.min.copy(a.min),this.max.copy(a.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(a){return this.isEmpty()?a.set(0,0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(a){return this.isEmpty()?a.set(0,0,0):a.subVectors(this.max,this.min)}expandByPoint(a){return this.min.min(a),this.max.max(a),this}expandByVector(a){return this.min.sub(a),this.max.add(a),this}expandByScalar(a){return this.min.addScalar(-a),this.max.addScalar(a),this}expandByObject(a,b=!1){a.updateWorldMatrix(!1,!1);let c=a.geometry;if(void 0!==c){let d=c.getAttribute("position");if(!0===b&&void 0!==d&&!0!==a.isInstancedMesh)for(let b=0,c=d.count;b<c;b++)!0===a.isMesh?a.getVertexPosition(b,O):O.fromBufferAttribute(d,b),O.applyMatrix4(a.matrixWorld),this.expandByPoint(O);else void 0!==a.boundingBox?(null===a.boundingBox&&a.computeBoundingBox(),P.copy(a.boundingBox)):(null===c.boundingBox&&c.computeBoundingBox(),P.copy(c.boundingBox)),P.applyMatrix4(a.matrixWorld),this.union(P)}let d=a.children;for(let a=0,c=d.length;a<c;a++)this.expandByObject(d[a],b);return this}containsPoint(a){return a.x>=this.min.x&&a.x<=this.max.x&&a.y>=this.min.y&&a.y<=this.max.y&&a.z>=this.min.z&&a.z<=this.max.z}containsBox(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z}getParameter(a,b){return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(a){return a.max.x>=this.min.x&&a.min.x<=this.max.x&&a.max.y>=this.min.y&&a.min.y<=this.max.y&&a.max.z>=this.min.z&&a.min.z<=this.max.z}intersectsSphere(a){return this.clampPoint(a.center,O),O.distanceToSquared(a.center)<=a.radius*a.radius}intersectsPlane(a){let b,c;return a.normal.x>0?(b=a.normal.x*this.min.x,c=a.normal.x*this.max.x):(b=a.normal.x*this.max.x,c=a.normal.x*this.min.x),a.normal.y>0?(b+=a.normal.y*this.min.y,c+=a.normal.y*this.max.y):(b+=a.normal.y*this.max.y,c+=a.normal.y*this.min.y),a.normal.z>0?(b+=a.normal.z*this.min.z,c+=a.normal.z*this.max.z):(b+=a.normal.z*this.max.z,c+=a.normal.z*this.min.z),b<=-a.constant&&c>=-a.constant}intersectsTriangle(a){if(this.isEmpty())return!1;this.getCenter(W),X.subVectors(this.max,W),Q.subVectors(a.a,W),R.subVectors(a.b,W),S.subVectors(a.c,W),T.subVectors(R,Q),U.subVectors(S,R),V.subVectors(Q,S);let b=[0,-T.z,T.y,0,-U.z,U.y,0,-V.z,V.y,T.z,0,-T.x,U.z,0,-U.x,V.z,0,-V.x,-T.y,T.x,0,-U.y,U.x,0,-V.y,V.x,0];return!!$(b,Q,R,S,X)&&!!$(b=[1,0,0,0,1,0,0,0,1],Q,R,S,X)&&(Y.crossVectors(T,U),$(b=[Y.x,Y.y,Y.z],Q,R,S,X))}clampPoint(a,b){return b.copy(a).clamp(this.min,this.max)}distanceToPoint(a){return this.clampPoint(a,O).distanceTo(a)}getBoundingSphere(a){return this.isEmpty()?a.makeEmpty():(this.getCenter(a.center),a.radius=.5*this.getSize(O).length()),a}intersect(a){return this.min.max(a.min),this.max.min(a.max),this.isEmpty()&&this.makeEmpty(),this}union(a){return this.min.min(a.min),this.max.max(a.max),this}applyMatrix4(a){return this.isEmpty()||(N[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(a),N[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(a),N[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(a),N[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(a),N[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(a),N[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(a),N[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(a),N[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(a),this.setFromPoints(N)),this}translate(a){return this.min.add(a),this.max.add(a),this}equals(a){return a.min.equals(this.min)&&a.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(a){return this.min.fromArray(a.min),this.max.fromArray(a.max),this}}let N=[new r,new r,new r,new r,new r,new r,new r,new r],O=new r,P=new M,Q=new r,R=new r,S=new r,T=new r,U=new r,V=new r,W=new r,X=new r,Y=new r,Z=new r;function $(a,b,c,d,e){for(let f=0,g=a.length-3;f<=g;f+=3){Z.fromArray(a,f);let g=e.x*Math.abs(Z.x)+e.y*Math.abs(Z.y)+e.z*Math.abs(Z.z),h=b.dot(Z),i=c.dot(Z),j=d.dot(Z);if(Math.max(-Math.max(h,i,j),Math.min(h,i,j))>g)return!1}return!0}let _=new M,aa=new r,ab=new r;class ac{constructor(a=new r,b=-1){this.isSphere=!0,this.center=a,this.radius=b}set(a,b){return this.center.copy(a),this.radius=b,this}setFromPoints(a,b){let c=this.center;void 0!==b?c.copy(b):_.setFromPoints(a).getCenter(c);let d=0;for(let b=0,e=a.length;b<e;b++)d=Math.max(d,c.distanceToSquared(a[b]));return this.radius=Math.sqrt(d),this}copy(a){return this.center.copy(a.center),this.radius=a.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(a){return a.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(a){return a.distanceTo(this.center)-this.radius}intersectsSphere(a){let b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b}intersectsBox(a){return a.intersectsSphere(this)}intersectsPlane(a){return Math.abs(a.distanceToPoint(this.center))<=this.radius}clampPoint(a,b){let c=this.center.distanceToSquared(a);return b.copy(a),c>this.radius*this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center)),b}getBoundingBox(a){return this.isEmpty()?a.makeEmpty():(a.set(this.center,this.center),a.expandByScalar(this.radius)),a}applyMatrix4(a){return this.center.applyMatrix4(a),this.radius=this.radius*a.getMaxScaleOnAxis(),this}translate(a){return this.center.add(a),this}expandByPoint(a){if(this.isEmpty())return this.center.copy(a),this.radius=0,this;aa.subVectors(a,this.center);let b=aa.lengthSq();if(b>this.radius*this.radius){let a=Math.sqrt(b),c=(a-this.radius)*.5;this.center.addScaledVector(aa,c/a),this.radius+=c}return this}union(a){return a.isEmpty()||(this.isEmpty()?this.copy(a):!0===this.center.equals(a.center)?this.radius=Math.max(this.radius,a.radius):(ab.subVectors(a.center,this.center).setLength(a.radius),this.expandByPoint(aa.copy(a.center).add(ab)),this.expandByPoint(aa.copy(a.center).sub(ab)))),this}equals(a){return a.center.equals(this.center)&&a.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(a){return this.radius=a.radius,this.center.fromArray(a.center),this}}let ad=new r,ae=new r,af=new r,ag=new r,ah=new r,ai=new r,aj=new r;class ak{constructor(a=new r,b=new r(0,0,-1)){this.origin=a,this.direction=b}set(a,b){return this.origin.copy(a),this.direction.copy(b),this}copy(a){return this.origin.copy(a.origin),this.direction.copy(a.direction),this}at(a,b){return b.copy(this.origin).addScaledVector(this.direction,a)}lookAt(a){return this.direction.copy(a).sub(this.origin).normalize(),this}recast(a){return this.origin.copy(this.at(a,ad)),this}closestPointToPoint(a,b){b.subVectors(a,this.origin);let c=b.dot(this.direction);return c<0?b.copy(this.origin):b.copy(this.origin).addScaledVector(this.direction,c)}distanceToPoint(a){return Math.sqrt(this.distanceSqToPoint(a))}distanceSqToPoint(a){let b=ad.subVectors(a,this.origin).dot(this.direction);return b<0?this.origin.distanceToSquared(a):(ad.copy(this.origin).addScaledVector(this.direction,b),ad.distanceToSquared(a))}distanceSqToSegment(a,b,c,d){let e,f,g,h;ae.copy(a).add(b).multiplyScalar(.5),af.copy(b).sub(a).normalize(),ag.copy(this.origin).sub(ae);let i=.5*a.distanceTo(b),j=-this.direction.dot(af),k=ag.dot(this.direction),l=-ag.dot(af),m=ag.lengthSq(),n=Math.abs(1-j*j);if(n>0)if(e=j*l-k,f=j*k-l,h=i*n,e>=0)if(f>=-h)if(f<=h){let a=1/n;e*=a,f*=a,g=e*(e+j*f+2*k)+f*(j*e+f+2*l)+m}else g=-(e=Math.max(0,-(j*(f=i)+k)))*e+f*(f+2*l)+m;else g=-(e=Math.max(0,-(j*(f=-i)+k)))*e+f*(f+2*l)+m;else f<=-h?(f=(e=Math.max(0,-(-j*i+k)))>0?-i:Math.min(Math.max(-i,-l),i),g=-e*e+f*(f+2*l)+m):f<=h?(e=0,g=(f=Math.min(Math.max(-i,-l),i))*(f+2*l)+m):(f=(e=Math.max(0,-(j*i+k)))>0?i:Math.min(Math.max(-i,-l),i),g=-e*e+f*(f+2*l)+m);else f=j>0?-i:i,g=-(e=Math.max(0,-(j*f+k)))*e+f*(f+2*l)+m;return c&&c.copy(this.origin).addScaledVector(this.direction,e),d&&d.copy(ae).addScaledVector(af,f),g}intersectSphere(a,b){ad.subVectors(a.center,this.origin);let c=ad.dot(this.direction),d=ad.dot(ad)-c*c,e=a.radius*a.radius;if(d>e)return null;let f=Math.sqrt(e-d),g=c-f,h=c+f;return h<0?null:g<0?this.at(h,b):this.at(g,b)}intersectsSphere(a){return!(a.radius<0)&&this.distanceSqToPoint(a.center)<=a.radius*a.radius}distanceToPlane(a){let b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;let c=-(this.origin.dot(a.normal)+a.constant)/b;return c>=0?c:null}intersectPlane(a,b){let c=this.distanceToPlane(a);return null===c?null:this.at(c,b)}intersectsPlane(a){let b=a.distanceToPoint(this.origin);return!!(0===b||a.normal.dot(this.direction)*b<0)}intersectBox(a,b){let c,d,e,f,g,h,i=1/this.direction.x,j=1/this.direction.y,k=1/this.direction.z,l=this.origin;return(i>=0?(c=(a.min.x-l.x)*i,d=(a.max.x-l.x)*i):(c=(a.max.x-l.x)*i,d=(a.min.x-l.x)*i),j>=0?(e=(a.min.y-l.y)*j,f=(a.max.y-l.y)*j):(e=(a.max.y-l.y)*j,f=(a.min.y-l.y)*j),c>f||e>d||((e>c||isNaN(c))&&(c=e),(f<d||isNaN(d))&&(d=f),k>=0?(g=(a.min.z-l.z)*k,h=(a.max.z-l.z)*k):(g=(a.max.z-l.z)*k,h=(a.min.z-l.z)*k),c>h||g>d||((g>c||c!=c)&&(c=g),(h<d||d!=d)&&(d=h),d<0)))?null:this.at(c>=0?c:d,b)}intersectsBox(a){return null!==this.intersectBox(a,ad)}intersectTriangle(a,b,c,d,e){let f;ah.subVectors(b,a),ai.subVectors(c,a),aj.crossVectors(ah,ai);let g=this.direction.dot(aj);if(g>0){if(d)return null;f=1}else{if(!(g<0))return null;f=-1,g=-g}ag.subVectors(this.origin,a);let h=f*this.direction.dot(ai.crossVectors(ag,ai));if(h<0)return null;let i=f*this.direction.dot(ah.cross(ag));if(i<0||h+i>g)return null;let j=-f*ag.dot(aj);return j<0?null:this.at(j/g,e)}applyMatrix4(a){return this.origin.applyMatrix4(a),this.direction.transformDirection(a),this}equals(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class al{constructor(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){al.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==a&&this.set(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)}set(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){let q=this.elements;return q[0]=a,q[4]=b,q[8]=c,q[12]=d,q[1]=e,q[5]=f,q[9]=g,q[13]=h,q[2]=i,q[6]=j,q[10]=k,q[14]=l,q[3]=m,q[7]=n,q[11]=o,q[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new al().fromArray(this.elements)}copy(a){let b=this.elements,c=a.elements;return b[0]=c[0],b[1]=c[1],b[2]=c[2],b[3]=c[3],b[4]=c[4],b[5]=c[5],b[6]=c[6],b[7]=c[7],b[8]=c[8],b[9]=c[9],b[10]=c[10],b[11]=c[11],b[12]=c[12],b[13]=c[13],b[14]=c[14],b[15]=c[15],this}copyPosition(a){let b=this.elements,c=a.elements;return b[12]=c[12],b[13]=c[13],b[14]=c[14],this}setFromMatrix3(a){let b=a.elements;return this.set(b[0],b[3],b[6],0,b[1],b[4],b[7],0,b[2],b[5],b[8],0,0,0,0,1),this}extractBasis(a,b,c){return a.setFromMatrixColumn(this,0),b.setFromMatrixColumn(this,1),c.setFromMatrixColumn(this,2),this}makeBasis(a,b,c){return this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1),this}extractRotation(a){let b=this.elements,c=a.elements,d=1/am.setFromMatrixColumn(a,0).length(),e=1/am.setFromMatrixColumn(a,1).length(),f=1/am.setFromMatrixColumn(a,2).length();return b[0]=c[0]*d,b[1]=c[1]*d,b[2]=c[2]*d,b[3]=0,b[4]=c[4]*e,b[5]=c[5]*e,b[6]=c[6]*e,b[7]=0,b[8]=c[8]*f,b[9]=c[9]*f,b[10]=c[10]*f,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,this}makeRotationFromEuler(a){let b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),g=Math.sin(c),h=Math.cos(d),i=Math.sin(d),j=Math.cos(e),k=Math.sin(e);if("XYZ"===a.order){let a=f*j,c=f*k,d=g*j,e=g*k;b[0]=h*j,b[4]=-h*k,b[8]=i,b[1]=c+d*i,b[5]=a-e*i,b[9]=-g*h,b[2]=e-a*i,b[6]=d+c*i,b[10]=f*h}else if("YXZ"===a.order){let a=h*j,c=h*k,d=i*j,e=i*k;b[0]=a+e*g,b[4]=d*g-c,b[8]=f*i,b[1]=f*k,b[5]=f*j,b[9]=-g,b[2]=c*g-d,b[6]=e+a*g,b[10]=f*h}else if("ZXY"===a.order){let a=h*j,c=h*k,d=i*j,e=i*k;b[0]=a-e*g,b[4]=-f*k,b[8]=d+c*g,b[1]=c+d*g,b[5]=f*j,b[9]=e-a*g,b[2]=-f*i,b[6]=g,b[10]=f*h}else if("ZYX"===a.order){let a=f*j,c=f*k,d=g*j,e=g*k;b[0]=h*j,b[4]=d*i-c,b[8]=a*i+e,b[1]=h*k,b[5]=e*i+a,b[9]=c*i-d,b[2]=-i,b[6]=g*h,b[10]=f*h}else if("YZX"===a.order){let a=f*h,c=f*i,d=g*h,e=g*i;b[0]=h*j,b[4]=e-a*k,b[8]=d*k+c,b[1]=k,b[5]=f*j,b[9]=-g*j,b[2]=-i*j,b[6]=c*k+d,b[10]=a-e*k}else if("XZY"===a.order){let a=f*h,c=f*i,d=g*h,e=g*i;b[0]=h*j,b[4]=-k,b[8]=i*j,b[1]=a*k+e,b[5]=f*j,b[9]=c*k-d,b[2]=d*k-c,b[6]=g*j,b[10]=e*k+a}return b[3]=0,b[7]=0,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,this}makeRotationFromQuaternion(a){return this.compose(ao,a,ap)}lookAt(a,b,c){let d=this.elements;return as.subVectors(a,b),0===as.lengthSq()&&(as.z=1),as.normalize(),aq.crossVectors(c,as),0===aq.lengthSq()&&(1===Math.abs(c.z)?as.x+=1e-4:as.z+=1e-4,as.normalize(),aq.crossVectors(c,as)),aq.normalize(),ar.crossVectors(as,aq),d[0]=aq.x,d[4]=ar.x,d[8]=as.x,d[1]=aq.y,d[5]=ar.y,d[9]=as.y,d[2]=aq.z,d[6]=ar.z,d[10]=as.z,this}multiply(a){return this.multiplyMatrices(this,a)}premultiply(a){return this.multiplyMatrices(a,this)}multiplyMatrices(a,b){let c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],i=c[12],j=c[1],k=c[5],l=c[9],m=c[13],n=c[2],o=c[6],p=c[10],q=c[14],r=c[3],s=c[7],t=c[11],u=c[15],v=d[0],w=d[4],x=d[8],y=d[12],z=d[1],A=d[5],B=d[9],C=d[13],D=d[2],E=d[6],F=d[10],G=d[14],H=d[3],I=d[7],J=d[11],K=d[15];return e[0]=f*v+g*z+h*D+i*H,e[4]=f*w+g*A+h*E+i*I,e[8]=f*x+g*B+h*F+i*J,e[12]=f*y+g*C+h*G+i*K,e[1]=j*v+k*z+l*D+m*H,e[5]=j*w+k*A+l*E+m*I,e[9]=j*x+k*B+l*F+m*J,e[13]=j*y+k*C+l*G+m*K,e[2]=n*v+o*z+p*D+q*H,e[6]=n*w+o*A+p*E+q*I,e[10]=n*x+o*B+p*F+q*J,e[14]=n*y+o*C+p*G+q*K,e[3]=r*v+s*z+t*D+u*H,e[7]=r*w+s*A+t*E+u*I,e[11]=r*x+s*B+t*F+u*J,e[15]=r*y+s*C+t*G+u*K,this}multiplyScalar(a){let b=this.elements;return b[0]*=a,b[4]*=a,b[8]*=a,b[12]*=a,b[1]*=a,b[5]*=a,b[9]*=a,b[13]*=a,b[2]*=a,b[6]*=a,b[10]*=a,b[14]*=a,b[3]*=a,b[7]*=a,b[11]*=a,b[15]*=a,this}determinant(){let a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],i=a[13],j=a[2],k=a[6],l=a[10],m=a[14],n=a[3],o=a[7];return n*(e*h*k-d*i*k-e*g*l+c*i*l+d*g*m-c*h*m)+o*(b*h*m-b*i*l+e*f*l-d*f*m+d*i*j-e*h*j)+a[11]*(b*i*k-b*g*m-e*f*k+c*f*m+e*g*j-c*i*j)+a[15]*(-d*g*j-b*h*k+b*g*l+d*f*k-c*f*l+c*h*j)}transpose(){let a,b=this.elements;return a=b[1],b[1]=b[4],b[4]=a,a=b[2],b[2]=b[8],b[8]=a,a=b[6],b[6]=b[9],b[9]=a,a=b[3],b[3]=b[12],b[12]=a,a=b[7],b[7]=b[13],b[13]=a,a=b[11],b[11]=b[14],b[14]=a,this}setPosition(a,b,c){let d=this.elements;return a.isVector3?(d[12]=a.x,d[13]=a.y,d[14]=a.z):(d[12]=a,d[13]=b,d[14]=c),this}invert(){let a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=a[9],l=a[10],m=a[11],n=a[12],o=a[13],p=a[14],q=a[15],r=k*p*i-o*l*i+o*h*m-g*p*m-k*h*q+g*l*q,s=n*l*i-j*p*i-n*h*m+f*p*m+j*h*q-f*l*q,t=j*o*i-n*k*i+n*g*m-f*o*m-j*g*q+f*k*q,u=n*k*h-j*o*h-n*g*l+f*o*l+j*g*p-f*k*p,v=b*r+c*s+d*t+e*u;if(0===v)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/v;return a[0]=r*w,a[1]=(o*l*e-k*p*e-o*d*m+c*p*m+k*d*q-c*l*q)*w,a[2]=(g*p*e-o*h*e+o*d*i-c*p*i-g*d*q+c*h*q)*w,a[3]=(k*h*e-g*l*e-k*d*i+c*l*i+g*d*m-c*h*m)*w,a[4]=s*w,a[5]=(j*p*e-n*l*e+n*d*m-b*p*m-j*d*q+b*l*q)*w,a[6]=(n*h*e-f*p*e-n*d*i+b*p*i+f*d*q-b*h*q)*w,a[7]=(f*l*e-j*h*e+j*d*i-b*l*i-f*d*m+b*h*m)*w,a[8]=t*w,a[9]=(n*k*e-j*o*e-n*c*m+b*o*m+j*c*q-b*k*q)*w,a[10]=(f*o*e-n*g*e+n*c*i-b*o*i-f*c*q+b*g*q)*w,a[11]=(j*g*e-f*k*e-j*c*i+b*k*i+f*c*m-b*g*m)*w,a[12]=u*w,a[13]=(j*o*d-n*k*d+n*c*l-b*o*l-j*c*p+b*k*p)*w,a[14]=(n*g*d-f*o*d-n*c*h+b*o*h+f*c*p-b*g*p)*w,a[15]=(f*k*d-j*g*d+j*c*h-b*k*h-f*c*l+b*g*l)*w,this}scale(a){let b=this.elements,c=a.x,d=a.y,e=a.z;return b[0]*=c,b[4]*=d,b[8]*=e,b[1]*=c,b[5]*=d,b[9]*=e,b[2]*=c,b[6]*=d,b[10]*=e,b[3]*=c,b[7]*=d,b[11]*=e,this}getMaxScaleOnAxis(){let a=this.elements,b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];return Math.sqrt(Math.max(b,a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10]))}makeTranslation(a,b,c){return a.isVector3?this.set(1,0,0,a.x,0,1,0,a.y,0,0,1,a.z,0,0,0,1):this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1),this}makeRotationX(a){let b=Math.cos(a),c=Math.sin(a);return this.set(1,0,0,0,0,b,-c,0,0,c,b,0,0,0,0,1),this}makeRotationY(a){let b=Math.cos(a),c=Math.sin(a);return this.set(b,0,c,0,0,1,0,0,-c,0,b,0,0,0,0,1),this}makeRotationZ(a){let b=Math.cos(a),c=Math.sin(a);return this.set(b,-c,0,0,c,b,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(a,b){let c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,i=e*f,j=e*g;return this.set(i*f+c,i*g-d*h,i*h+d*g,0,i*g+d*h,j*g+c,j*h-d*f,0,i*h-d*g,j*h+d*f,e*h*h+c,0,0,0,0,1),this}makeScale(a,b,c){return this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1),this}makeShear(a,b,c,d,e,f){return this.set(1,c,e,0,a,1,f,0,b,d,1,0,0,0,0,1),this}compose(a,b,c){let d=this.elements,e=b._x,f=b._y,g=b._z,h=b._w,i=e+e,j=f+f,k=g+g,l=e*i,m=e*j,n=e*k,o=f*j,p=f*k,q=g*k,r=h*i,s=h*j,t=h*k,u=c.x,v=c.y,w=c.z;return d[0]=(1-(o+q))*u,d[1]=(m+t)*u,d[2]=(n-s)*u,d[3]=0,d[4]=(m-t)*v,d[5]=(1-(l+q))*v,d[6]=(p+r)*v,d[7]=0,d[8]=(n+s)*w,d[9]=(p-r)*w,d[10]=(1-(l+o))*w,d[11]=0,d[12]=a.x,d[13]=a.y,d[14]=a.z,d[15]=1,this}decompose(a,b,c){let d=this.elements,e=am.set(d[0],d[1],d[2]).length(),f=am.set(d[4],d[5],d[6]).length(),g=am.set(d[8],d[9],d[10]).length();0>this.determinant()&&(e=-e),a.x=d[12],a.y=d[13],a.z=d[14],an.copy(this);let h=1/e,i=1/f,j=1/g;return an.elements[0]*=h,an.elements[1]*=h,an.elements[2]*=h,an.elements[4]*=i,an.elements[5]*=i,an.elements[6]*=i,an.elements[8]*=j,an.elements[9]*=j,an.elements[10]*=j,b.setFromRotationMatrix(an),c.x=e,c.y=f,c.z=g,this}makePerspective(a,b,c,d,e,f,g=2e3,h=!1){let i,j,k=this.elements;if(h)i=e/(f-e),j=f*e/(f-e);else if(2e3===g)i=-(f+e)/(f-e),j=-2*f*e/(f-e);else if(2001===g)i=-f/(f-e),j=-f*e/(f-e);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+g);return k[0]=2*e/(b-a),k[4]=0,k[8]=(b+a)/(b-a),k[12]=0,k[1]=0,k[5]=2*e/(c-d),k[9]=(c+d)/(c-d),k[13]=0,k[2]=0,k[6]=0,k[10]=i,k[14]=j,k[3]=0,k[7]=0,k[11]=-1,k[15]=0,this}makeOrthographic(a,b,c,d,e,f,g=2e3,h=!1){let i,j,k=this.elements;if(h)i=1/(f-e),j=f/(f-e);else if(2e3===g)i=-2/(f-e),j=-(f+e)/(f-e);else if(2001===g)i=-1/(f-e),j=-e/(f-e);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+g);return k[0]=2/(b-a),k[4]=0,k[8]=0,k[12]=-(b+a)/(b-a),k[1]=0,k[5]=2/(c-d),k[9]=0,k[13]=-(c+d)/(c-d),k[2]=0,k[6]=0,k[10]=i,k[14]=j,k[3]=0,k[7]=0,k[11]=0,k[15]=1,this}equals(a){let b=this.elements,c=a.elements;for(let a=0;a<16;a++)if(b[a]!==c[a])return!1;return!0}fromArray(a,b=0){for(let c=0;c<16;c++)this.elements[c]=a[c+b];return this}toArray(a=[],b=0){let c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a[b+9]=c[9],a[b+10]=c[10],a[b+11]=c[11],a[b+12]=c[12],a[b+13]=c[13],a[b+14]=c[14],a[b+15]=c[15],a}}let am=new r,an=new al,ao=new r(0,0,0),ap=new r(1,1,1),aq=new r,ar=new r,as=new r,at=new al,au=new q;class av{constructor(a=0,b=0,c=0,d=av.DEFAULT_ORDER){this.isEuler=!0,this._x=a,this._y=b,this._z=c,this._order=d}get x(){return this._x}set x(a){this._x=a,this._onChangeCallback()}get y(){return this._y}set y(a){this._y=a,this._onChangeCallback()}get z(){return this._z}set z(a){this._z=a,this._onChangeCallback()}get order(){return this._order}set order(a){this._order=a,this._onChangeCallback()}set(a,b,c,d=this._order){return this._x=a,this._y=b,this._z=c,this._order=d,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(a){return this._x=a._x,this._y=a._y,this._z=a._z,this._order=a._order,this._onChangeCallback(),this}setFromRotationMatrix(a,b=this._order,c=!0){let d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],i=d[5],j=d[9],k=d[2],l=d[6],m=d[10];switch(b){case"XYZ":this._y=Math.asin(o(g,-1,1)),.9999999>Math.abs(g)?(this._x=Math.atan2(-j,m),this._z=Math.atan2(-f,e)):(this._x=Math.atan2(l,i),this._z=0);break;case"YXZ":this._x=Math.asin(-o(j,-1,1)),.9999999>Math.abs(j)?(this._y=Math.atan2(g,m),this._z=Math.atan2(h,i)):(this._y=Math.atan2(-k,e),this._z=0);break;case"ZXY":this._x=Math.asin(o(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(-k,m),this._z=Math.atan2(-f,i)):(this._y=0,this._z=Math.atan2(h,e));break;case"ZYX":this._y=Math.asin(-o(k,-1,1)),.9999999>Math.abs(k)?(this._x=Math.atan2(l,m),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,i));break;case"YZX":this._z=Math.asin(o(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(-j,i),this._y=Math.atan2(-k,e)):(this._x=0,this._y=Math.atan2(g,m));break;case"XZY":this._z=Math.asin(-o(f,-1,1)),.9999999>Math.abs(f)?(this._x=Math.atan2(l,i),this._y=Math.atan2(g,e)):(this._x=Math.atan2(-j,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+b)}return this._order=b,!0===c&&this._onChangeCallback(),this}setFromQuaternion(a,b,c){return at.makeRotationFromQuaternion(a),this.setFromRotationMatrix(at,b,c)}setFromVector3(a,b=this._order){return this.set(a.x,a.y,a.z,b)}reorder(a){return au.setFromEuler(this),this.setFromQuaternion(au,a)}equals(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order}fromArray(a){return this._x=a[0],this._y=a[1],this._z=a[2],void 0!==a[3]&&(this._order=a[3]),this._onChangeCallback(),this}toArray(a=[],b=0){return a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._order,a}_onChange(a){return this._onChangeCallback=a,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}av.DEFAULT_ORDER="XYZ";class aw{constructor(){this.mask=1}set(a){this.mask=1<<a>>>0}enable(a){this.mask|=1<<a}enableAll(){this.mask=-1}toggle(a){this.mask^=1<<a}disable(a){this.mask&=~(1<<a)}disableAll(){this.mask=0}test(a){return(this.mask&a.mask)!=0}isEnabled(a){return(this.mask&1<<a)!=0}}let ax=0,ay=new r,az=new q,aA=new al,aB=new r,aC=new r,aD=new r,aE=new q,aF=new r(1,0,0),aG=new r(0,1,0),aH=new r(0,0,1),aI={type:"added"},aJ={type:"removed"},aK={type:"childadded",child:null},aL={type:"childremoved",child:null};class aM extends l{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:ax++}),this.uuid=n(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=aM.DEFAULT_UP.clone();let a=new r,b=new av,c=new q,d=new r(1,1,1);b._onChange(function(){c.setFromEuler(b,!1)}),c._onChange(function(){b.setFromQuaternion(c,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:a},rotation:{configurable:!0,enumerable:!0,value:b},quaternion:{configurable:!0,enumerable:!0,value:c},scale:{configurable:!0,enumerable:!0,value:d},modelViewMatrix:{value:new al},normalMatrix:{value:new u}}),this.matrix=new al,this.matrixWorld=new al,this.matrixAutoUpdate=aM.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=aM.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new aw,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(a){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(a),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(a){return this.quaternion.premultiply(a),this}setRotationFromAxisAngle(a,b){this.quaternion.setFromAxisAngle(a,b)}setRotationFromEuler(a){this.quaternion.setFromEuler(a,!0)}setRotationFromMatrix(a){this.quaternion.setFromRotationMatrix(a)}setRotationFromQuaternion(a){this.quaternion.copy(a)}rotateOnAxis(a,b){return az.setFromAxisAngle(a,b),this.quaternion.multiply(az),this}rotateOnWorldAxis(a,b){return az.setFromAxisAngle(a,b),this.quaternion.premultiply(az),this}rotateX(a){return this.rotateOnAxis(aF,a)}rotateY(a){return this.rotateOnAxis(aG,a)}rotateZ(a){return this.rotateOnAxis(aH,a)}translateOnAxis(a,b){return ay.copy(a).applyQuaternion(this.quaternion),this.position.add(ay.multiplyScalar(b)),this}translateX(a){return this.translateOnAxis(aF,a)}translateY(a){return this.translateOnAxis(aG,a)}translateZ(a){return this.translateOnAxis(aH,a)}localToWorld(a){return this.updateWorldMatrix(!0,!1),a.applyMatrix4(this.matrixWorld)}worldToLocal(a){return this.updateWorldMatrix(!0,!1),a.applyMatrix4(aA.copy(this.matrixWorld).invert())}lookAt(a,b,c){a.isVector3?aB.copy(a):aB.set(a,b,c);let d=this.parent;this.updateWorldMatrix(!0,!1),aC.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?aA.lookAt(aC,aB,this.up):aA.lookAt(aB,aC,this.up),this.quaternion.setFromRotationMatrix(aA),d&&(aA.extractRotation(d.matrixWorld),az.setFromRotationMatrix(aA),this.quaternion.premultiply(az.invert()))}add(a){if(arguments.length>1){for(let a=0;a<arguments.length;a++)this.add(arguments[a]);return this}return a===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",a):a&&a.isObject3D?(a.removeFromParent(),a.parent=this,this.children.push(a),a.dispatchEvent(aI),aK.child=a,this.dispatchEvent(aK),aK.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",a),this}remove(a){if(arguments.length>1){for(let a=0;a<arguments.length;a++)this.remove(arguments[a]);return this}let b=this.children.indexOf(a);return -1!==b&&(a.parent=null,this.children.splice(b,1),a.dispatchEvent(aJ),aL.child=a,this.dispatchEvent(aL),aL.child=null),this}removeFromParent(){let a=this.parent;return null!==a&&a.remove(this),this}clear(){return this.remove(...this.children)}attach(a){return this.updateWorldMatrix(!0,!1),aA.copy(this.matrixWorld).invert(),null!==a.parent&&(a.parent.updateWorldMatrix(!0,!1),aA.multiply(a.parent.matrixWorld)),a.applyMatrix4(aA),a.removeFromParent(),a.parent=this,this.children.push(a),a.updateWorldMatrix(!1,!0),a.dispatchEvent(aI),aK.child=a,this.dispatchEvent(aK),aK.child=null,this}getObjectById(a){return this.getObjectByProperty("id",a)}getObjectByName(a){return this.getObjectByProperty("name",a)}getObjectByProperty(a,b){if(this[a]===b)return this;for(let c=0,d=this.children.length;c<d;c++){let d=this.children[c].getObjectByProperty(a,b);if(void 0!==d)return d}}getObjectsByProperty(a,b,c=[]){this[a]===b&&c.push(this);let d=this.children;for(let e=0,f=d.length;e<f;e++)d[e].getObjectsByProperty(a,b,c);return c}getWorldPosition(a){return this.updateWorldMatrix(!0,!1),a.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(a){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(aC,a,aD),a}getWorldScale(a){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(aC,aE,a),a}getWorldDirection(a){this.updateWorldMatrix(!0,!1);let b=this.matrixWorld.elements;return a.set(b[8],b[9],b[10]).normalize()}raycast(){}traverse(a){a(this);let b=this.children;for(let c=0,d=b.length;c<d;c++)b[c].traverse(a)}traverseVisible(a){if(!1===this.visible)return;a(this);let b=this.children;for(let c=0,d=b.length;c<d;c++)b[c].traverseVisible(a)}traverseAncestors(a){let b=this.parent;null!==b&&(a(b),b.traverseAncestors(a))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(a){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||a)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,a=!0);let b=this.children;for(let c=0,d=b.length;c<d;c++)b[c].updateMatrixWorld(a)}updateWorldMatrix(a,b){let c=this.parent;if(!0===a&&null!==c&&c.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===b){let a=this.children;for(let b=0,c=a.length;b<c;b++)a[b].updateWorldMatrix(!1,!0)}}toJSON(a){let b=void 0===a||"string"==typeof a,c={};b&&(a={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},c.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let d={};function e(b,c){return void 0===b[c.uuid]&&(b[c.uuid]=c.toJSON(a)),c.uuid}if(d.uuid=this.uuid,d.type=this.type,""!==this.name&&(d.name=this.name),!0===this.castShadow&&(d.castShadow=!0),!0===this.receiveShadow&&(d.receiveShadow=!0),!1===this.visible&&(d.visible=!1),!1===this.frustumCulled&&(d.frustumCulled=!1),0!==this.renderOrder&&(d.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(d.userData=this.userData),d.layers=this.layers.mask,d.matrix=this.matrix.toArray(),d.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(d.matrixAutoUpdate=!1),this.isInstancedMesh&&(d.type="InstancedMesh",d.count=this.count,d.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(d.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(d.type="BatchedMesh",d.perObjectFrustumCulled=this.perObjectFrustumCulled,d.sortObjects=this.sortObjects,d.drawRanges=this._drawRanges,d.reservedRanges=this._reservedRanges,d.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),d.instanceInfo=this._instanceInfo.map(a=>({...a})),d.availableInstanceIds=this._availableInstanceIds.slice(),d.availableGeometryIds=this._availableGeometryIds.slice(),d.nextIndexStart=this._nextIndexStart,d.nextVertexStart=this._nextVertexStart,d.geometryCount=this._geometryCount,d.maxInstanceCount=this._maxInstanceCount,d.maxVertexCount=this._maxVertexCount,d.maxIndexCount=this._maxIndexCount,d.geometryInitialized=this._geometryInitialized,d.matricesTexture=this._matricesTexture.toJSON(a),d.indirectTexture=this._indirectTexture.toJSON(a),null!==this._colorsTexture&&(d.colorsTexture=this._colorsTexture.toJSON(a)),null!==this.boundingSphere&&(d.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(d.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?d.background=this.background.toJSON():this.background.isTexture&&(d.background=this.background.toJSON(a).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(d.environment=this.environment.toJSON(a).uuid);else if(this.isMesh||this.isLine||this.isPoints){d.geometry=e(a.geometries,this.geometry);let b=this.geometry.parameters;if(void 0!==b&&void 0!==b.shapes){let c=b.shapes;if(Array.isArray(c))for(let b=0,d=c.length;b<d;b++){let d=c[b];e(a.shapes,d)}else e(a.shapes,c)}}if(this.isSkinnedMesh&&(d.bindMode=this.bindMode,d.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(e(a.skeletons,this.skeleton),d.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let b=[];for(let c=0,d=this.material.length;c<d;c++)b.push(e(a.materials,this.material[c]));d.material=b}else d.material=e(a.materials,this.material);if(this.children.length>0){d.children=[];for(let b=0;b<this.children.length;b++)d.children.push(this.children[b].toJSON(a).object)}if(this.animations.length>0){d.animations=[];for(let b=0;b<this.animations.length;b++){let c=this.animations[b];d.animations.push(e(a.animations,c))}}if(b){let b=f(a.geometries),d=f(a.materials),e=f(a.textures),g=f(a.images),h=f(a.shapes),i=f(a.skeletons),j=f(a.animations),k=f(a.nodes);b.length>0&&(c.geometries=b),d.length>0&&(c.materials=d),e.length>0&&(c.textures=e),g.length>0&&(c.images=g),h.length>0&&(c.shapes=h),i.length>0&&(c.skeletons=i),j.length>0&&(c.animations=j),k.length>0&&(c.nodes=k)}return c.object=d,c;function f(a){let b=[];for(let c in a){let d=a[c];delete d.metadata,b.push(d)}return b}}clone(a){return new this.constructor().copy(this,a)}copy(a,b=!0){if(this.name=a.name,this.up.copy(a.up),this.position.copy(a.position),this.rotation.order=a.rotation.order,this.quaternion.copy(a.quaternion),this.scale.copy(a.scale),this.matrix.copy(a.matrix),this.matrixWorld.copy(a.matrixWorld),this.matrixAutoUpdate=a.matrixAutoUpdate,this.matrixWorldAutoUpdate=a.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=a.matrixWorldNeedsUpdate,this.layers.mask=a.layers.mask,this.visible=a.visible,this.castShadow=a.castShadow,this.receiveShadow=a.receiveShadow,this.frustumCulled=a.frustumCulled,this.renderOrder=a.renderOrder,this.animations=a.animations.slice(),this.userData=JSON.parse(JSON.stringify(a.userData)),!0===b)for(let b=0;b<a.children.length;b++){let c=a.children[b];this.add(c.clone())}return this}}aM.DEFAULT_UP=new r(0,1,0),aM.DEFAULT_MATRIX_AUTO_UPDATE=!0,aM.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let aN=new r,aO=new r,aP=new r,aQ=new r,aR=new r,aS=new r,aT=new r,aU=new r,aV=new r,aW=new r,aX=new L,aY=new L,aZ=new L;class a${constructor(a=new r,b=new r,c=new r){this.a=a,this.b=b,this.c=c}static getNormal(a,b,c,d){d.subVectors(c,b),aN.subVectors(a,b),d.cross(aN);let e=d.lengthSq();return e>0?d.multiplyScalar(1/Math.sqrt(e)):d.set(0,0,0)}static getBarycoord(a,b,c,d,e){aN.subVectors(d,b),aO.subVectors(c,b),aP.subVectors(a,b);let f=aN.dot(aN),g=aN.dot(aO),h=aN.dot(aP),i=aO.dot(aO),j=aO.dot(aP),k=f*i-g*g;if(0===k)return e.set(0,0,0),null;let l=1/k,m=(i*h-g*j)*l,n=(f*j-g*h)*l;return e.set(1-m-n,n,m)}static containsPoint(a,b,c,d){return null!==this.getBarycoord(a,b,c,d,aQ)&&aQ.x>=0&&aQ.y>=0&&aQ.x+aQ.y<=1}static getInterpolation(a,b,c,d,e,f,g,h){return null===this.getBarycoord(a,b,c,d,aQ)?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(e,aQ.x),h.addScaledVector(f,aQ.y),h.addScaledVector(g,aQ.z),h)}static getInterpolatedAttribute(a,b,c,d,e,f){return aX.setScalar(0),aY.setScalar(0),aZ.setScalar(0),aX.fromBufferAttribute(a,b),aY.fromBufferAttribute(a,c),aZ.fromBufferAttribute(a,d),f.setScalar(0),f.addScaledVector(aX,e.x),f.addScaledVector(aY,e.y),f.addScaledVector(aZ,e.z),f}static isFrontFacing(a,b,c,d){return aN.subVectors(c,b),aO.subVectors(a,b),0>aN.cross(aO).dot(d)}set(a,b,c){return this.a.copy(a),this.b.copy(b),this.c.copy(c),this}setFromPointsAndIndices(a,b,c,d){return this.a.copy(a[b]),this.b.copy(a[c]),this.c.copy(a[d]),this}setFromAttributeAndIndices(a,b,c,d){return this.a.fromBufferAttribute(a,b),this.b.fromBufferAttribute(a,c),this.c.fromBufferAttribute(a,d),this}clone(){return new this.constructor().copy(this)}copy(a){return this.a.copy(a.a),this.b.copy(a.b),this.c.copy(a.c),this}getArea(){return aN.subVectors(this.c,this.b),aO.subVectors(this.a,this.b),.5*aN.cross(aO).length()}getMidpoint(a){return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(a){return a$.getNormal(this.a,this.b,this.c,a)}getPlane(a){return a.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(a,b){return a$.getBarycoord(a,this.a,this.b,this.c,b)}getInterpolation(a,b,c,d,e){return a$.getInterpolation(a,this.a,this.b,this.c,b,c,d,e)}containsPoint(a){return a$.containsPoint(a,this.a,this.b,this.c)}isFrontFacing(a){return a$.isFrontFacing(this.a,this.b,this.c,a)}intersectsBox(a){return a.intersectsTriangle(this)}closestPointToPoint(a,b){let c,d,e=this.a,f=this.b,g=this.c;aR.subVectors(f,e),aS.subVectors(g,e),aU.subVectors(a,e);let h=aR.dot(aU),i=aS.dot(aU);if(h<=0&&i<=0)return b.copy(e);aV.subVectors(a,f);let j=aR.dot(aV),k=aS.dot(aV);if(j>=0&&k<=j)return b.copy(f);let l=h*k-j*i;if(l<=0&&h>=0&&j<=0)return c=h/(h-j),b.copy(e).addScaledVector(aR,c);aW.subVectors(a,g);let m=aR.dot(aW),n=aS.dot(aW);if(n>=0&&m<=n)return b.copy(g);let o=m*i-h*n;if(o<=0&&i>=0&&n<=0)return d=i/(i-n),b.copy(e).addScaledVector(aS,d);let p=j*n-m*k;if(p<=0&&k-j>=0&&m-n>=0)return aT.subVectors(g,f),d=(k-j)/(k-j+(m-n)),b.copy(f).addScaledVector(aT,d);let q=1/(p+o+l);return c=o*q,d=l*q,b.copy(e).addScaledVector(aR,c).addScaledVector(aS,d)}equals(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}}let a_={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},a0={h:0,s:0,l:0},a1={h:0,s:0,l:0};function a2(a,b,c){return(c<0&&(c+=1),c>1&&(c-=1),c<1/6)?a+(b-a)*6*c:c<.5?b:c<2/3?a+(b-a)*6*(2/3-c):a}class a3{constructor(a,b,c){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(a,b,c)}set(a,b,c){return void 0===b&&void 0===c?a&&a.isColor?this.copy(a):"number"==typeof a?this.setHex(a):"string"==typeof a&&this.setStyle(a):this.setRGB(a,b,c),this}setScalar(a){return this.r=a,this.g=a,this.b=a,this}setHex(a,b=h){return a=Math.floor(a),this.r=(a>>16&255)/255,this.g=(a>>8&255)/255,this.b=(255&a)/255,B.colorSpaceToWorking(this,b),this}setRGB(a,b,c,d=B.workingColorSpace){return this.r=a,this.g=b,this.b=c,B.colorSpaceToWorking(this,d),this}setHSL(a,b,c,d=B.workingColorSpace){if(a=(a%1+1)%1,b=o(b,0,1),c=o(c,0,1),0===b)this.r=this.g=this.b=c;else{let d=c<=.5?c*(1+b):c+b-c*b,e=2*c-d;this.r=a2(e,d,a+1/3),this.g=a2(e,d,a),this.b=a2(e,d,a-1/3)}return B.colorSpaceToWorking(this,d),this}setStyle(a,b=h){let c;function d(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+a+" will be ignored.")}if(c=/^(\w+)\(([^\)]*)\)/.exec(a)){let e,f=c[1],g=c[2];switch(f){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(g))return d(e[4]),this.setRGB(Math.min(255,parseInt(e[1],10))/255,Math.min(255,parseInt(e[2],10))/255,Math.min(255,parseInt(e[3],10))/255,b);if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(g))return d(e[4]),this.setRGB(Math.min(100,parseInt(e[1],10))/100,Math.min(100,parseInt(e[2],10))/100,Math.min(100,parseInt(e[3],10))/100,b);break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(g))return d(e[4]),this.setHSL(parseFloat(e[1])/360,parseFloat(e[2])/100,parseFloat(e[3])/100,b);break;default:console.warn("THREE.Color: Unknown color model "+a)}}else if(c=/^\#([A-Fa-f\d]+)$/.exec(a)){let d=c[1],e=d.length;if(3===e)return this.setRGB(parseInt(d.charAt(0),16)/15,parseInt(d.charAt(1),16)/15,parseInt(d.charAt(2),16)/15,b);if(6===e)return this.setHex(parseInt(d,16),b);console.warn("THREE.Color: Invalid hex color "+a)}else if(a&&a.length>0)return this.setColorName(a,b);return this}setColorName(a,b=h){let c=a_[a.toLowerCase()];return void 0!==c?this.setHex(c,b):console.warn("THREE.Color: Unknown color "+a),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(a){return this.r=a.r,this.g=a.g,this.b=a.b,this}copySRGBToLinear(a){return this.r=C(a.r),this.g=C(a.g),this.b=C(a.b),this}copyLinearToSRGB(a){return this.r=D(a.r),this.g=D(a.g),this.b=D(a.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(a=h){return B.workingToColorSpace(a4.copy(this),a),65536*Math.round(o(255*a4.r,0,255))+256*Math.round(o(255*a4.g,0,255))+Math.round(o(255*a4.b,0,255))}getHexString(a=h){return("000000"+this.getHex(a).toString(16)).slice(-6)}getHSL(a,b=B.workingColorSpace){let c,d;B.workingToColorSpace(a4.copy(this),b);let e=a4.r,f=a4.g,g=a4.b,h=Math.max(e,f,g),i=Math.min(e,f,g),j=(i+h)/2;if(i===h)c=0,d=0;else{let a=h-i;switch(d=j<=.5?a/(h+i):a/(2-h-i),h){case e:c=(f-g)/a+6*(f<g);break;case f:c=(g-e)/a+2;break;case g:c=(e-f)/a+4}c/=6}return a.h=c,a.s=d,a.l=j,a}getRGB(a,b=B.workingColorSpace){return B.workingToColorSpace(a4.copy(this),b),a.r=a4.r,a.g=a4.g,a.b=a4.b,a}getStyle(a=h){B.workingToColorSpace(a4.copy(this),a);let b=a4.r,c=a4.g,d=a4.b;return a!==h?`color(${a} ${b.toFixed(3)} ${c.toFixed(3)} ${d.toFixed(3)})`:`rgb(${Math.round(255*b)},${Math.round(255*c)},${Math.round(255*d)})`}offsetHSL(a,b,c){return this.getHSL(a0),this.setHSL(a0.h+a,a0.s+b,a0.l+c)}add(a){return this.r+=a.r,this.g+=a.g,this.b+=a.b,this}addColors(a,b){return this.r=a.r+b.r,this.g=a.g+b.g,this.b=a.b+b.b,this}addScalar(a){return this.r+=a,this.g+=a,this.b+=a,this}sub(a){return this.r=Math.max(0,this.r-a.r),this.g=Math.max(0,this.g-a.g),this.b=Math.max(0,this.b-a.b),this}multiply(a){return this.r*=a.r,this.g*=a.g,this.b*=a.b,this}multiplyScalar(a){return this.r*=a,this.g*=a,this.b*=a,this}lerp(a,b){return this.r+=(a.r-this.r)*b,this.g+=(a.g-this.g)*b,this.b+=(a.b-this.b)*b,this}lerpColors(a,b,c){return this.r=a.r+(b.r-a.r)*c,this.g=a.g+(b.g-a.g)*c,this.b=a.b+(b.b-a.b)*c,this}lerpHSL(a,b){var c,d,e;this.getHSL(a0),a.getHSL(a1);let f=(c=a0.h,(1-b)*c+b*a1.h),g=(d=a0.s,(1-b)*d+b*a1.s),h=(e=a0.l,(1-b)*e+b*a1.l);return this.setHSL(f,g,h),this}setFromVector3(a){return this.r=a.x,this.g=a.y,this.b=a.z,this}applyMatrix3(a){let b=this.r,c=this.g,d=this.b,e=a.elements;return this.r=e[0]*b+e[3]*c+e[6]*d,this.g=e[1]*b+e[4]*c+e[7]*d,this.b=e[2]*b+e[5]*c+e[8]*d,this}equals(a){return a.r===this.r&&a.g===this.g&&a.b===this.b}fromArray(a,b=0){return this.r=a[b],this.g=a[b+1],this.b=a[b+2],this}toArray(a=[],b=0){return a[b]=this.r,a[b+1]=this.g,a[b+2]=this.b,a}fromBufferAttribute(a,b){return this.r=a.getX(b),this.g=a.getY(b),this.b=a.getZ(b),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let a4=new a3;a3.NAMES=a_;function a5(a){let b={};for(let c in a)for(let d in b[c]={},a[c]){let e=a[c][d];e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)?e.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),b[c][d]=null):b[c][d]=e.clone():Array.isArray(e)?b[c][d]=e.slice():b[c][d]=e}return b}function a6(a){let b={};for(let c=0;c<a.length;c++){let d=a5(a[c]);for(let a in d)b[a]=d[a]}return b}let a7=new r,a8=new r,a9=new u;class ba{constructor(a=new r(1,0,0),b=0){this.isPlane=!0,this.normal=a,this.constant=b}set(a,b){return this.normal.copy(a),this.constant=b,this}setComponents(a,b,c,d){return this.normal.set(a,b,c),this.constant=d,this}setFromNormalAndCoplanarPoint(a,b){return this.normal.copy(a),this.constant=-b.dot(this.normal),this}setFromCoplanarPoints(a,b,c){let d=a7.subVectors(c,b).cross(a8.subVectors(a,b)).normalize();return this.setFromNormalAndCoplanarPoint(d,a),this}copy(a){return this.normal.copy(a.normal),this.constant=a.constant,this}normalize(){let a=1/this.normal.length();return this.normal.multiplyScalar(a),this.constant*=a,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(a){return this.normal.dot(a)+this.constant}distanceToSphere(a){return this.distanceToPoint(a.center)-a.radius}projectPoint(a,b){return b.copy(a).addScaledVector(this.normal,-this.distanceToPoint(a))}intersectLine(a,b){let c=a.delta(a7),d=this.normal.dot(c);if(0===d)return 0===this.distanceToPoint(a.start)?b.copy(a.start):null;let e=-(a.start.dot(this.normal)+this.constant)/d;return e<0||e>1?null:b.copy(a.start).addScaledVector(c,e)}intersectsLine(a){let b=this.distanceToPoint(a.start),c=this.distanceToPoint(a.end);return b<0&&c>0||c<0&&b>0}intersectsBox(a){return a.intersectsPlane(this)}intersectsSphere(a){return a.intersectsPlane(this)}coplanarPoint(a){return a.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(a,b){let c=b||a9.getNormalMatrix(a),d=this.coplanarPoint(a7).applyMatrix4(a),e=this.normal.applyMatrix3(c).normalize();return this.constant=-d.dot(e),this}translate(a){return this.constant-=a.dot(this.normal),this}equals(a){return a.normal.equals(this.normal)&&a.constant===this.constant}clone(){return new this.constructor().copy(this)}}let bb=new ac,bc=new p(.5,.5),bd=new r;class be{constructor(a=new ba,b=new ba,c=new ba,d=new ba,e=new ba,f=new ba){this.planes=[a,b,c,d,e,f]}set(a,b,c,d,e,f){let g=this.planes;return g[0].copy(a),g[1].copy(b),g[2].copy(c),g[3].copy(d),g[4].copy(e),g[5].copy(f),this}copy(a){let b=this.planes;for(let c=0;c<6;c++)b[c].copy(a.planes[c]);return this}setFromProjectionMatrix(a,b=2e3,c=!1){let d=this.planes,e=a.elements,f=e[0],g=e[1],h=e[2],i=e[3],j=e[4],k=e[5],l=e[6],m=e[7],n=e[8],o=e[9],p=e[10],q=e[11],r=e[12],s=e[13],t=e[14],u=e[15];if(d[0].setComponents(i-f,m-j,q-n,u-r).normalize(),d[1].setComponents(i+f,m+j,q+n,u+r).normalize(),d[2].setComponents(i+g,m+k,q+o,u+s).normalize(),d[3].setComponents(i-g,m-k,q-o,u-s).normalize(),c)d[4].setComponents(h,l,p,t).normalize(),d[5].setComponents(i-h,m-l,q-p,u-t).normalize();else if(d[4].setComponents(i-h,m-l,q-p,u-t).normalize(),2e3===b)d[5].setComponents(i+h,m+l,q+p,u+t).normalize();else if(2001===b)d[5].setComponents(h,l,p,t).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+b);return this}intersectsObject(a){if(void 0!==a.boundingSphere)null===a.boundingSphere&&a.computeBoundingSphere(),bb.copy(a.boundingSphere).applyMatrix4(a.matrixWorld);else{let b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere(),bb.copy(b.boundingSphere).applyMatrix4(a.matrixWorld)}return this.intersectsSphere(bb)}intersectsSprite(a){return bb.center.set(0,0,0),bb.radius=.7071067811865476+bc.distanceTo(a.center),bb.applyMatrix4(a.matrixWorld),this.intersectsSphere(bb)}intersectsSphere(a){let b=this.planes,c=a.center,d=-a.radius;for(let a=0;a<6;a++)if(b[a].distanceToPoint(c)<d)return!1;return!0}intersectsBox(a){let b=this.planes;for(let c=0;c<6;c++){let d=b[c];if(bd.x=d.normal.x>0?a.max.x:a.min.x,bd.y=d.normal.y>0?a.max.y:a.min.y,bd.z=d.normal.z>0?a.max.z:a.min.z,0>d.distanceToPoint(bd))return!1}return!0}containsPoint(a){let b=this.planes;for(let c=0;c<6;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}clone(){return new this.constructor().copy(this)}}class bf{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(a,b){let c=this.getUtoTmapping(a);return this.getPoint(c,b)}getPoints(a=5){let b=[];for(let c=0;c<=a;c++)b.push(this.getPoint(c/a));return b}getSpacedPoints(a=5){let b=[];for(let c=0;c<=a;c++)b.push(this.getPointAt(c/a));return b}getLength(){let a=this.getLengths();return a[a.length-1]}getLengths(a=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let b=[],c,d=this.getPoint(0),e=0;b.push(0);for(let f=1;f<=a;f++)b.push(e+=(c=this.getPoint(f/a)).distanceTo(d)),d=c;return this.cacheArcLengths=b,b}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(a,b=null){let c,d=this.getLengths(),e=0,f=d.length;c=b||a*d[f-1];let g=0,h=f-1,i;for(;g<=h;)if((i=d[e=Math.floor(g+(h-g)/2)]-c)<0)g=e+1;else if(i>0)h=e-1;else{h=e;break}if(d[e=h]===c)return e/(f-1);let j=d[e],k=d[e+1];return(e+(c-j)/(k-j))/(f-1)}getTangent(a,b){let c=a-1e-4,d=a+1e-4;c<0&&(c=0),d>1&&(d=1);let e=this.getPoint(c),f=this.getPoint(d),g=b||(e.isVector2?new p:new r);return g.copy(f).sub(e).normalize(),g}getTangentAt(a,b){let c=this.getUtoTmapping(a);return this.getTangent(c,b)}computeFrenetFrames(a,b=!1){let c=new r,d=[],e=[],f=[],g=new r,h=new al;for(let b=0;b<=a;b++){let c=b/a;d[b]=this.getTangentAt(c,new r)}e[0]=new r,f[0]=new r;let i=Number.MAX_VALUE,j=Math.abs(d[0].x),k=Math.abs(d[0].y),l=Math.abs(d[0].z);j<=i&&(i=j,c.set(1,0,0)),k<=i&&(i=k,c.set(0,1,0)),l<=i&&c.set(0,0,1),g.crossVectors(d[0],c).normalize(),e[0].crossVectors(d[0],g),f[0].crossVectors(d[0],e[0]);for(let b=1;b<=a;b++){if(e[b]=e[b-1].clone(),f[b]=f[b-1].clone(),g.crossVectors(d[b-1],d[b]),g.length()>Number.EPSILON){g.normalize();let a=Math.acos(o(d[b-1].dot(d[b]),-1,1));e[b].applyMatrix4(h.makeRotationAxis(g,a))}f[b].crossVectors(d[b],e[b])}if(!0===b){let b=Math.acos(o(e[0].dot(e[a]),-1,1));b/=a,d[0].dot(g.crossVectors(e[0],e[a]))>0&&(b=-b);for(let c=1;c<=a;c++)e[c].applyMatrix4(h.makeRotationAxis(d[c],b*c)),f[c].crossVectors(d[c],e[c])}return{tangents:d,normals:e,binormals:f}}clone(){return new this.constructor().copy(this)}copy(a){return this.arcLengthDivisions=a.arcLengthDivisions,this}toJSON(){let a={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return a.arcLengthDivisions=this.arcLengthDivisions,a.type=this.type,a}fromJSON(a){return this.arcLengthDivisions=a.arcLengthDivisions,this}}class bg extends bf{constructor(a=0,b=0,c=1,d=1,e=0,f=2*Math.PI,g=!1,h=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=a,this.aY=b,this.xRadius=c,this.yRadius=d,this.aStartAngle=e,this.aEndAngle=f,this.aClockwise=g,this.aRotation=h}getPoint(a,b=new p){let c=2*Math.PI,d=this.aEndAngle-this.aStartAngle,e=Math.abs(d)<Number.EPSILON;for(;d<0;)d+=c;for(;d>c;)d-=c;d<Number.EPSILON&&(d=e?0:c),!0!==this.aClockwise||e||(d===c?d=-c:d-=c);let f=this.aStartAngle+a*d,g=this.aX+this.xRadius*Math.cos(f),h=this.aY+this.yRadius*Math.sin(f);if(0!==this.aRotation){let a=Math.cos(this.aRotation),b=Math.sin(this.aRotation),c=g-this.aX,d=h-this.aY;g=c*a-d*b+this.aX,h=c*b+d*a+this.aY}return b.set(g,h)}copy(a){return super.copy(a),this.aX=a.aX,this.aY=a.aY,this.xRadius=a.xRadius,this.yRadius=a.yRadius,this.aStartAngle=a.aStartAngle,this.aEndAngle=a.aEndAngle,this.aClockwise=a.aClockwise,this.aRotation=a.aRotation,this}toJSON(){let a=super.toJSON();return a.aX=this.aX,a.aY=this.aY,a.xRadius=this.xRadius,a.yRadius=this.yRadius,a.aStartAngle=this.aStartAngle,a.aEndAngle=this.aEndAngle,a.aClockwise=this.aClockwise,a.aRotation=this.aRotation,a}fromJSON(a){return super.fromJSON(a),this.aX=a.aX,this.aY=a.aY,this.xRadius=a.xRadius,this.yRadius=a.yRadius,this.aStartAngle=a.aStartAngle,this.aEndAngle=a.aEndAngle,this.aClockwise=a.aClockwise,this.aRotation=a.aRotation,this}}class bh extends bg{constructor(a,b,c,d,e,f){super(a,b,c,c,d,e,f),this.isArcCurve=!0,this.type="ArcCurve"}}function bi(){let a=0,b=0,c=0,d=0;function e(e,f,g,h){a=e,b=g,c=-3*e+3*f-2*g-h,d=2*e-2*f+g+h}return{initCatmullRom:function(a,b,c,d,f){e(b,c,f*(c-a),f*(d-b))},initNonuniformCatmullRom:function(a,b,c,d,f,g,h){let i=(b-a)/f-(c-a)/(f+g)+(c-b)/g,j=(c-b)/g-(d-b)/(g+h)+(d-c)/h;e(b,c,i*=g,j*=g)},calc:function(e){let f=e*e;return a+b*e+c*f+f*e*d}}}let bj=new r,bk=new bi,bl=new bi,bm=new bi;class bn extends bf{constructor(a=[],b=!1,c="centripetal",d=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=a,this.closed=b,this.curveType=c,this.tension=d}getPoint(a,b=new r){let c,d,e=this.points,f=e.length,g=(f-!this.closed)*a,h=Math.floor(g),i=g-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/f)+1)*f:0===i&&h===f-1&&(h=f-2,i=1),this.closed||h>0?c=e[(h-1)%f]:(bj.subVectors(e[0],e[1]).add(e[0]),c=bj);let j=e[h%f],k=e[(h+1)%f];if(this.closed||h+2<f?d=e[(h+2)%f]:(bj.subVectors(e[f-1],e[f-2]).add(e[f-1]),d=bj),"centripetal"===this.curveType||"chordal"===this.curveType){let a="chordal"===this.curveType?.5:.25,b=Math.pow(c.distanceToSquared(j),a),e=Math.pow(j.distanceToSquared(k),a),f=Math.pow(k.distanceToSquared(d),a);e<1e-4&&(e=1),b<1e-4&&(b=e),f<1e-4&&(f=e),bk.initNonuniformCatmullRom(c.x,j.x,k.x,d.x,b,e,f),bl.initNonuniformCatmullRom(c.y,j.y,k.y,d.y,b,e,f),bm.initNonuniformCatmullRom(c.z,j.z,k.z,d.z,b,e,f)}else"catmullrom"===this.curveType&&(bk.initCatmullRom(c.x,j.x,k.x,d.x,this.tension),bl.initCatmullRom(c.y,j.y,k.y,d.y,this.tension),bm.initCatmullRom(c.z,j.z,k.z,d.z,this.tension));return b.set(bk.calc(i),bl.calc(i),bm.calc(i)),b}copy(a){super.copy(a),this.points=[];for(let b=0,c=a.points.length;b<c;b++){let c=a.points[b];this.points.push(c.clone())}return this.closed=a.closed,this.curveType=a.curveType,this.tension=a.tension,this}toJSON(){let a=super.toJSON();a.points=[];for(let b=0,c=this.points.length;b<c;b++){let c=this.points[b];a.points.push(c.toArray())}return a.closed=this.closed,a.curveType=this.curveType,a.tension=this.tension,a}fromJSON(a){super.fromJSON(a),this.points=[];for(let b=0,c=a.points.length;b<c;b++){let c=a.points[b];this.points.push(new r().fromArray(c))}return this.closed=a.closed,this.curveType=a.curveType,this.tension=a.tension,this}}function bo(a,b,c,d,e){let f=(d-b)*.5,g=(e-c)*.5,h=a*a;return a*h*(2*c-2*d+f+g)+(-3*c+3*d-2*f-g)*h+f*a+c}function bp(a,b,c,d){return function(a,b){let c=1-a;return c*c*b}(a,b)+2*(1-a)*a*c+a*a*d}function bq(a,b,c,d,e){return function(a,b){let c=1-a;return c*c*c*b}(a,b)+function(a,b){let c=1-a;return 3*c*c*a*b}(a,c)+3*(1-a)*a*a*d+a*a*a*e}class br extends bf{constructor(a=new p,b=new p,c=new p,d=new p){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=a,this.v1=b,this.v2=c,this.v3=d}getPoint(a,b=new p){let c=this.v0,d=this.v1,e=this.v2,f=this.v3;return b.set(bq(a,c.x,d.x,e.x,f.x),bq(a,c.y,d.y,e.y,f.y)),b}copy(a){return super.copy(a),this.v0.copy(a.v0),this.v1.copy(a.v1),this.v2.copy(a.v2),this.v3.copy(a.v3),this}toJSON(){let a=super.toJSON();return a.v0=this.v0.toArray(),a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a.v3=this.v3.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v0.fromArray(a.v0),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this.v3.fromArray(a.v3),this}}class bs extends bf{constructor(a=new r,b=new r,c=new r,d=new r){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=a,this.v1=b,this.v2=c,this.v3=d}getPoint(a,b=new r){let c=this.v0,d=this.v1,e=this.v2,f=this.v3;return b.set(bq(a,c.x,d.x,e.x,f.x),bq(a,c.y,d.y,e.y,f.y),bq(a,c.z,d.z,e.z,f.z)),b}copy(a){return super.copy(a),this.v0.copy(a.v0),this.v1.copy(a.v1),this.v2.copy(a.v2),this.v3.copy(a.v3),this}toJSON(){let a=super.toJSON();return a.v0=this.v0.toArray(),a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a.v3=this.v3.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v0.fromArray(a.v0),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this.v3.fromArray(a.v3),this}}class bt extends bf{constructor(a=new p,b=new p){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=a,this.v2=b}getPoint(a,b=new p){return 1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(a).add(this.v1)),b}getPointAt(a,b){return this.getPoint(a,b)}getTangent(a,b=new p){return b.subVectors(this.v2,this.v1).normalize()}getTangentAt(a,b){return this.getTangent(a,b)}copy(a){return super.copy(a),this.v1.copy(a.v1),this.v2.copy(a.v2),this}toJSON(){let a=super.toJSON();return a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this}}class bu extends bf{constructor(a=new r,b=new r){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=a,this.v2=b}getPoint(a,b=new r){return 1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(a).add(this.v1)),b}getPointAt(a,b){return this.getPoint(a,b)}getTangent(a,b=new r){return b.subVectors(this.v2,this.v1).normalize()}getTangentAt(a,b){return this.getTangent(a,b)}copy(a){return super.copy(a),this.v1.copy(a.v1),this.v2.copy(a.v2),this}toJSON(){let a=super.toJSON();return a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this}}class bv extends bf{constructor(a=new p,b=new p,c=new p){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=a,this.v1=b,this.v2=c}getPoint(a,b=new p){let c=this.v0,d=this.v1,e=this.v2;return b.set(bp(a,c.x,d.x,e.x),bp(a,c.y,d.y,e.y)),b}copy(a){return super.copy(a),this.v0.copy(a.v0),this.v1.copy(a.v1),this.v2.copy(a.v2),this}toJSON(){let a=super.toJSON();return a.v0=this.v0.toArray(),a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v0.fromArray(a.v0),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this}}class bw extends bf{constructor(a=new r,b=new r,c=new r){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=a,this.v1=b,this.v2=c}getPoint(a,b=new r){let c=this.v0,d=this.v1,e=this.v2;return b.set(bp(a,c.x,d.x,e.x),bp(a,c.y,d.y,e.y),bp(a,c.z,d.z,e.z)),b}copy(a){return super.copy(a),this.v0.copy(a.v0),this.v1.copy(a.v1),this.v2.copy(a.v2),this}toJSON(){let a=super.toJSON();return a.v0=this.v0.toArray(),a.v1=this.v1.toArray(),a.v2=this.v2.toArray(),a}fromJSON(a){return super.fromJSON(a),this.v0.fromArray(a.v0),this.v1.fromArray(a.v1),this.v2.fromArray(a.v2),this}}class bx extends bf{constructor(a=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=a}getPoint(a,b=new p){let c=this.points,d=(c.length-1)*a,e=Math.floor(d),f=d-e,g=c[0===e?e:e-1],h=c[e],i=c[e>c.length-2?c.length-1:e+1],j=c[e>c.length-3?c.length-1:e+2];return b.set(bo(f,g.x,h.x,i.x,j.x),bo(f,g.y,h.y,i.y,j.y)),b}copy(a){super.copy(a),this.points=[];for(let b=0,c=a.points.length;b<c;b++){let c=a.points[b];this.points.push(c.clone())}return this}toJSON(){let a=super.toJSON();a.points=[];for(let b=0,c=this.points.length;b<c;b++){let c=this.points[b];a.points.push(c.toArray())}return a}fromJSON(a){super.fromJSON(a),this.points=[];for(let b=0,c=a.points.length;b<c;b++){let c=a.points[b];this.points.push(new p().fromArray(c))}return this}}function by(a,b){return a&&a.constructor!==b?"number"==typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a):a}class bz{constructor(a,b,c,d){this.parameterPositions=a,this._cachedIndex=0,this.resultBuffer=void 0!==d?d:new b.constructor(c),this.sampleValues=b,this.valueSize=c,this.settings=null,this.DefaultSettings_={}}evaluate(a){let b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];a:{b:{let f;c:{d:if(!(a<d)){for(let f=c+2;;){if(void 0===d){if(a<e)break d;return c=b.length,this._cachedIndex=c,this.copySampleValue_(c-1)}if(c===f)break;if(e=d,a<(d=b[++c]))break b}f=b.length;break c}if(!(a>=e)){let g=b[1];a<g&&(c=2,e=g);for(let f=c-2;;){if(void 0===e)return this._cachedIndex=0,this.copySampleValue_(0);if(c===f)break;if(d=e,a>=(e=b[--c-1]))break b}f=c,c=0;break c}break a}for(;c<f;){let d=c+f>>>1;a<b[d]?f=d:c=d+1}if(d=b[c],void 0===(e=b[c-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===d)return c=b.length,this._cachedIndex=c,this.copySampleValue_(c-1)}this._cachedIndex=c,this.intervalChanged_(c,e,d)}return this.interpolate_(c,e,a,d)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(a){let b=this.resultBuffer,c=this.sampleValues,d=this.valueSize,e=a*d;for(let a=0;a!==d;++a)b[a]=c[e+a];return b}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class bA extends bz{constructor(a,b,c,d){super(a,b,c,d),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(a,b,c){let d=this.parameterPositions,e=a-2,f=a+1,g=d[e],h=d[f];if(void 0===g)switch(this.getSettings_().endingStart){case 2401:e=a,g=2*b-c;break;case 2402:e=d.length-2,g=b+d[e]-d[e+1];break;default:e=a,g=c}if(void 0===h)switch(this.getSettings_().endingEnd){case 2401:f=a,h=2*c-b;break;case 2402:f=1,h=c+d[1]-d[0];break;default:f=a-1,h=b}let i=(c-b)*.5,j=this.valueSize;this._weightPrev=i/(b-g),this._weightNext=i/(h-c),this._offsetPrev=e*j,this._offsetNext=f*j}interpolate_(a,b,c,d){let e=this.resultBuffer,f=this.sampleValues,g=this.valueSize,h=a*g,i=h-g,j=this._offsetPrev,k=this._offsetNext,l=this._weightPrev,m=this._weightNext,n=(c-b)/(d-b),o=n*n,p=o*n,q=-l*p+2*l*o-l*n,r=(1+l)*p+(-1.5-2*l)*o+(-.5+l)*n+1,s=(-1-m)*p+(1.5+m)*o+.5*n,t=m*p-m*o;for(let a=0;a!==g;++a)e[a]=q*f[j+a]+r*f[i+a]+s*f[h+a]+t*f[k+a];return e}}class bB extends bz{constructor(a,b,c,d){super(a,b,c,d)}interpolate_(a,b,c,d){let e=this.resultBuffer,f=this.sampleValues,g=this.valueSize,h=a*g,i=h-g,j=(c-b)/(d-b),k=1-j;for(let a=0;a!==g;++a)e[a]=f[i+a]*k+f[h+a]*j;return e}}class bC extends bz{constructor(a,b,c,d){super(a,b,c,d)}interpolate_(a){return this.copySampleValue_(a-1)}}class bD{constructor(a,b,c,d){if(void 0===a)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===b||0===b.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+a);this.name=a,this.times=by(b,this.TimeBufferType),this.values=by(c,this.ValueBufferType),this.setInterpolation(d||this.DefaultInterpolation)}static toJSON(a){let b,c=a.constructor;if(c.toJSON!==this.toJSON)b=c.toJSON(a);else{b={name:a.name,times:by(a.times,Array),values:by(a.values,Array)};let c=a.getInterpolation();c!==a.DefaultInterpolation&&(b.interpolation=c)}return b.type=a.ValueTypeName,b}InterpolantFactoryMethodDiscrete(a){return new bC(this.times,this.values,this.getValueSize(),a)}InterpolantFactoryMethodLinear(a){return new bB(this.times,this.values,this.getValueSize(),a)}InterpolantFactoryMethodSmooth(a){return new bA(this.times,this.values,this.getValueSize(),a)}setInterpolation(a){let b;switch(a){case 2300:b=this.InterpolantFactoryMethodDiscrete;break;case 2301:b=this.InterpolantFactoryMethodLinear;break;case 2302:b=this.InterpolantFactoryMethodSmooth}if(void 0===b){let b="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(a!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(b);return console.warn("THREE.KeyframeTrack:",b),this}return this.createInterpolant=b,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(a){if(0!==a){let b=this.times;for(let c=0,d=b.length;c!==d;++c)b[c]+=a}return this}scale(a){if(1!==a){let b=this.times;for(let c=0,d=b.length;c!==d;++c)b[c]*=a}return this}trim(a,b){let c=this.times,d=c.length,e=0,f=d-1;for(;e!==d&&c[e]<a;)++e;for(;-1!==f&&c[f]>b;)--f;if(++f,0!==e||f!==d){e>=f&&(e=(f=Math.max(f,1))-1);let a=this.getValueSize();this.times=c.slice(e,f),this.values=this.values.slice(e*a,f*a)}return this}validate(){var a;let b=!0,c=this.getValueSize();c-Math.floor(c)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),b=!1);let d=this.times,e=this.values,f=d.length;0===f&&(console.error("THREE.KeyframeTrack: Track is empty.",this),b=!1);let g=null;for(let a=0;a!==f;a++){let c=d[a];if("number"==typeof c&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),b=!1;break}if(null!==g&&g>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,g),b=!1;break}g=c}if(void 0!==e&&ArrayBuffer.isView(a=e)&&!(a instanceof DataView))for(let a=0,c=e.length;a!==c;++a){let c=e[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),b=!1;break}}return b}optimize(){let a=this.times.slice(),b=this.values.slice(),c=this.getValueSize(),d=2302===this.getInterpolation(),e=a.length-1,f=1;for(let g=1;g<e;++g){let e=!1,h=a[g];if(h!==a[g+1]&&(1!==g||h!==a[0]))if(d)e=!0;else{let a=g*c,d=a-c,f=a+c;for(let g=0;g!==c;++g){let c=b[a+g];if(c!==b[d+g]||c!==b[f+g]){e=!0;break}}}if(e){if(g!==f){a[f]=a[g];let d=g*c,e=f*c;for(let a=0;a!==c;++a)b[e+a]=b[d+a]}++f}}if(e>0){a[f]=a[e];for(let a=e*c,d=f*c,g=0;g!==c;++g)b[d+g]=b[a+g];++f}return f!==a.length?(this.times=a.slice(0,f),this.values=b.slice(0,f*c)):(this.times=a,this.values=b),this}clone(){let a=this.times.slice(),b=this.values.slice(),c=new this.constructor(this.name,a,b);return c.createInterpolant=this.createInterpolant,c}}bD.prototype.ValueTypeName="",bD.prototype.TimeBufferType=Float32Array,bD.prototype.ValueBufferType=Float32Array,bD.prototype.DefaultInterpolation=2301;class bE extends bD{constructor(a,b,c){super(a,b,c)}}bE.prototype.ValueTypeName="bool",bE.prototype.ValueBufferType=Array,bE.prototype.DefaultInterpolation=2300,bE.prototype.InterpolantFactoryMethodLinear=void 0,bE.prototype.InterpolantFactoryMethodSmooth=void 0;class bF extends bD{constructor(a,b,c,d){super(a,b,c,d)}}bF.prototype.ValueTypeName="color";class bG extends bD{constructor(a,b,c,d){super(a,b,c,d)}}bG.prototype.ValueTypeName="number";class bH extends bz{constructor(a,b,c,d){super(a,b,c,d)}interpolate_(a,b,c,d){let e=this.resultBuffer,f=this.sampleValues,g=this.valueSize,h=(c-b)/(d-b),i=a*g;for(let a=i+g;i!==a;i+=4)q.slerpFlat(e,0,f,i-g,f,i,h);return e}}class bI extends bD{constructor(a,b,c,d){super(a,b,c,d)}InterpolantFactoryMethodLinear(a){return new bH(this.times,this.values,this.getValueSize(),a)}}bI.prototype.ValueTypeName="quaternion",bI.prototype.InterpolantFactoryMethodSmooth=void 0;class bJ extends bD{constructor(a,b,c){super(a,b,c)}}bJ.prototype.ValueTypeName="string",bJ.prototype.ValueBufferType=Array,bJ.prototype.DefaultInterpolation=2300,bJ.prototype.InterpolantFactoryMethodLinear=void 0,bJ.prototype.InterpolantFactoryMethodSmooth=void 0;class bK extends bD{constructor(a,b,c,d){super(a,b,c,d)}}bK.prototype.ValueTypeName="vector";class bL{constructor(a,b,c){let d,e=this,f=!1,g=0,h=0,i=[];this.onStart=void 0,this.onLoad=a,this.onProgress=b,this.onError=c,this.abortController=new AbortController,this.itemStart=function(a){h++,!1===f&&void 0!==e.onStart&&e.onStart(a,g,h),f=!0},this.itemEnd=function(a){g++,void 0!==e.onProgress&&e.onProgress(a,g,h),g===h&&(f=!1,void 0!==e.onLoad&&e.onLoad())},this.itemError=function(a){void 0!==e.onError&&e.onError(a)},this.resolveURL=function(a){return d?d(a):a},this.setURLModifier=function(a){return d=a,this},this.addHandler=function(a,b){return i.push(a,b),this},this.removeHandler=function(a){let b=i.indexOf(a);return -1!==b&&i.splice(b,2),this},this.getHandler=function(a){for(let b=0,c=i.length;b<c;b+=2){let c=i[b],d=i[b+1];if(c.global&&(c.lastIndex=0),c.test(a))return d}return null},this.abort=function(){return this.abortController.abort(),this.abortController=new AbortController,this}}}let bM=new bL;class bN{constructor(a){this.manager=void 0!==a?a:bM,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(a,b){let c=this;return new Promise(function(d,e){c.load(a,d,b,e)})}parse(){}setCrossOrigin(a){return this.crossOrigin=a,this}setWithCredentials(a){return this.withCredentials=a,this}setPath(a){return this.path=a,this}setResourcePath(a){return this.resourcePath=a,this}setRequestHeader(a){return this.requestHeader=a,this}abort(){return this}}bN.DEFAULT_MATERIAL_NAME="__DEFAULT",new WeakMap,new WeakMap;let bO="\\[\\]\\.:\\/",bP=RegExp("["+bO+"]","g"),bQ="[^"+bO+"]",bR="[^"+bO.replace("\\.","")+"]",bS=/((?:WC+[\/:])*)/.source.replace("WC",bQ),bT=/(WCOD+)?/.source.replace("WCOD",bR),bU=RegExp("^"+bS+bT+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",bQ)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",bQ)+"$"),bV=["material","materials","bones","map"];class bW{constructor(a,b,c){let d=c||bX.parseTrackName(b);this._targetGroup=a,this._bindings=a.subscribe_(b,d)}getValue(a,b){this.bind();let c=this._targetGroup.nCachedObjects_,d=this._bindings[c];void 0!==d&&d.getValue(a,b)}setValue(a,b){let c=this._bindings;for(let d=this._targetGroup.nCachedObjects_,e=c.length;d!==e;++d)c[d].setValue(a,b)}bind(){let a=this._bindings;for(let b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()}unbind(){let a=this._bindings;for(let b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}}class bX{constructor(a,b,c){this.path=b,this.parsedPath=c||bX.parseTrackName(b),this.node=bX.findNode(a,this.parsedPath.nodeName),this.rootNode=a,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(a,b,c){return a&&a.isAnimationObjectGroup?new bX.Composite(a,b,c):new bX(a,b,c)}static sanitizeNodeName(a){return a.replace(/\s/g,"_").replace(bP,"")}static parseTrackName(a){let b=bU.exec(a);if(null===b)throw Error("PropertyBinding: Cannot parse trackName: "+a);let c={nodeName:b[2],objectName:b[3],objectIndex:b[4],propertyName:b[5],propertyIndex:b[6]},d=c.nodeName&&c.nodeName.lastIndexOf(".");if(void 0!==d&&-1!==d){let a=c.nodeName.substring(d+1);-1!==bV.indexOf(a)&&(c.nodeName=c.nodeName.substring(0,d),c.objectName=a)}if(null===c.propertyName||0===c.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+a);return c}static findNode(a,b){if(void 0===b||""===b||"."===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){let c=a.skeleton.getBoneByName(b);if(void 0!==c)return c}if(a.children){let c=function(a){for(let d=0;d<a.length;d++){let e=a[d];if(e.name===b||e.uuid===b)return e;let f=c(e.children);if(f)return f}return null},d=c(a.children);if(d)return d}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(a,b){a[b]=this.targetObject[this.propertyName]}_getValue_array(a,b){let c=this.resolvedProperty;for(let d=0,e=c.length;d!==e;++d)a[b++]=c[d]}_getValue_arrayElement(a,b){a[b]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(a,b){this.resolvedProperty.toArray(a,b)}_setValue_direct(a,b){this.targetObject[this.propertyName]=a[b]}_setValue_direct_setNeedsUpdate(a,b){this.targetObject[this.propertyName]=a[b],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(a,b){this.targetObject[this.propertyName]=a[b],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(a,b){let c=this.resolvedProperty;for(let d=0,e=c.length;d!==e;++d)c[d]=a[b++]}_setValue_array_setNeedsUpdate(a,b){let c=this.resolvedProperty;for(let d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(a,b){let c=this.resolvedProperty;for(let d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(a,b){this.resolvedProperty[this.propertyIndex]=a[b]}_setValue_arrayElement_setNeedsUpdate(a,b){this.resolvedProperty[this.propertyIndex]=a[b],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(a,b){this.resolvedProperty[this.propertyIndex]=a[b],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(a,b){this.resolvedProperty.fromArray(a,b)}_setValue_fromArray_setNeedsUpdate(a,b){this.resolvedProperty.fromArray(a,b),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(a,b){this.resolvedProperty.fromArray(a,b),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(a,b){this.bind(),this.getValue(a,b)}_setValue_unbound(a,b){this.bind(),this.setValue(a,b)}bind(){let a=this.node,b=this.parsedPath,c=b.objectName,d=b.propertyName,e=b.propertyIndex;if(a||(a=bX.findNode(this.rootNode,b.nodeName),this.node=a),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!a)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(c){let d=b.objectIndex;switch(c){case"materials":if(!a.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!a.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);a=a.material.materials;break;case"bones":if(!a.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);a=a.skeleton.bones;for(let b=0;b<a.length;b++)if(a[b].name===d){d=b;break}break;case"map":if("map"in a){a=a.map;break}if(!a.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!a.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);a=a.material.map;break;default:if(void 0===a[c])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);a=a[c]}if(void 0!==d){if(void 0===a[d])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,a);a=a[d]}}let f=a[d];if(void 0===f)return void console.error("THREE.PropertyBinding: Trying to update property for track: "+b.nodeName+"."+d+" but it wasn't found.",a);let g=this.Versioning.None;this.targetObject=a,!0===a.isMaterial?g=this.Versioning.NeedsUpdate:!0===a.isObject3D&&(g=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(void 0!==e){if("morphTargetInfluences"===d){if(!a.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!a.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==a.morphTargetDictionary[e]&&(e=a.morphTargetDictionary[e])}h=this.BindingType.ArrayElement,this.resolvedProperty=f,this.propertyIndex=e}else void 0!==f.fromArray&&void 0!==f.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=f):Array.isArray(f)?(h=this.BindingType.EntireArray,this.resolvedProperty=f):this.propertyName=d;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][g]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}bX.Composite=bW,bX.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},bX.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},bX.prototype.GetterByBindingType=[bX.prototype._getValue_direct,bX.prototype._getValue_array,bX.prototype._getValue_arrayElement,bX.prototype._getValue_toArray],bX.prototype.SetterByBindingTypeAndVersioning=[[bX.prototype._setValue_direct,bX.prototype._setValue_direct_setNeedsUpdate,bX.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[bX.prototype._setValue_array,bX.prototype._setValue_array_setNeedsUpdate,bX.prototype._setValue_array_setMatrixWorldNeedsUpdate],[bX.prototype._setValue_arrayElement,bX.prototype._setValue_arrayElement_setNeedsUpdate,bX.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[bX.prototype._setValue_fromArray,bX.prototype._setValue_fromArray_setNeedsUpdate,bX.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],new Float32Array(1),"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"179"}}));let bY={background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <logdepthbuf_fragment>\n #ifdef USE_REVERSEDEPTHBUF\n float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n #else\n float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n #endif\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}"},bZ={common:{diffuse:{value:new a3(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new u},alphaMap:{value:null},alphaMapTransform:{value:new u},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new u}},envmap:{envMap:{value:null},envMapRotation:{value:new u},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new u}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new u}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new u},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new u},normalScale:{value:new p(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new u},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new u}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new u}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new u}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new a3(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new a3(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new u},alphaTest:{value:0},uvTransform:{value:new u}},sprite:{diffuse:{value:new a3(0xffffff)},opacity:{value:1},center:{value:new p(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new u},alphaMap:{value:null},alphaMapTransform:{value:new u},alphaTest:{value:0}}},b$={basic:{uniforms:a6([bZ.common,bZ.specularmap,bZ.envmap,bZ.aomap,bZ.lightmap,bZ.fog]),vertexShader:bY.meshbasic_vert,fragmentShader:bY.meshbasic_frag},lambert:{uniforms:a6([bZ.common,bZ.specularmap,bZ.envmap,bZ.aomap,bZ.lightmap,bZ.emissivemap,bZ.bumpmap,bZ.normalmap,bZ.displacementmap,bZ.fog,bZ.lights,{emissive:{value:new a3(0)}}]),vertexShader:bY.meshlambert_vert,fragmentShader:bY.meshlambert_frag},phong:{uniforms:a6([bZ.common,bZ.specularmap,bZ.envmap,bZ.aomap,bZ.lightmap,bZ.emissivemap,bZ.bumpmap,bZ.normalmap,bZ.displacementmap,bZ.fog,bZ.lights,{emissive:{value:new a3(0)},specular:{value:new a3(1118481)},shininess:{value:30}}]),vertexShader:bY.meshphong_vert,fragmentShader:bY.meshphong_frag},standard:{uniforms:a6([bZ.common,bZ.envmap,bZ.aomap,bZ.lightmap,bZ.emissivemap,bZ.bumpmap,bZ.normalmap,bZ.displacementmap,bZ.roughnessmap,bZ.metalnessmap,bZ.fog,bZ.lights,{emissive:{value:new a3(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:bY.meshphysical_vert,fragmentShader:bY.meshphysical_frag},toon:{uniforms:a6([bZ.common,bZ.aomap,bZ.lightmap,bZ.emissivemap,bZ.bumpmap,bZ.normalmap,bZ.displacementmap,bZ.gradientmap,bZ.fog,bZ.lights,{emissive:{value:new a3(0)}}]),vertexShader:bY.meshtoon_vert,fragmentShader:bY.meshtoon_frag},matcap:{uniforms:a6([bZ.common,bZ.bumpmap,bZ.normalmap,bZ.displacementmap,bZ.fog,{matcap:{value:null}}]),vertexShader:bY.meshmatcap_vert,fragmentShader:bY.meshmatcap_frag},points:{uniforms:a6([bZ.points,bZ.fog]),vertexShader:bY.points_vert,fragmentShader:bY.points_frag},dashed:{uniforms:a6([bZ.common,bZ.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:bY.linedashed_vert,fragmentShader:bY.linedashed_frag},depth:{uniforms:a6([bZ.common,bZ.displacementmap]),vertexShader:bY.depth_vert,fragmentShader:bY.depth_frag},normal:{uniforms:a6([bZ.common,bZ.bumpmap,bZ.normalmap,bZ.displacementmap,{opacity:{value:1}}]),vertexShader:bY.meshnormal_vert,fragmentShader:bY.meshnormal_frag},sprite:{uniforms:a6([bZ.sprite,bZ.fog]),vertexShader:bY.sprite_vert,fragmentShader:bY.sprite_frag},background:{uniforms:{uvTransform:{value:new u},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:bY.background_vert,fragmentShader:bY.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new u}},vertexShader:bY.backgroundCube_vert,fragmentShader:bY.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:bY.cube_vert,fragmentShader:bY.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:bY.equirect_vert,fragmentShader:bY.equirect_frag},distanceRGBA:{uniforms:a6([bZ.common,bZ.displacementmap,{referencePosition:{value:new r},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:bY.distanceRGBA_vert,fragmentShader:bY.distanceRGBA_frag},shadow:{uniforms:a6([bZ.lights,bZ.fog,{color:{value:new a3(0)},opacity:{value:1}}]),vertexShader:bY.shadow_vert,fragmentShader:bY.shadow_frag}};b$.physical={uniforms:a6([b$.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new u},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new u},clearcoatNormalScale:{value:new p(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new u},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new u},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new u},sheen:{value:0},sheenColor:{value:new a3(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new u},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new u},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new u},transmissionSamplerSize:{value:new p},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new u},attenuationDistance:{value:0},attenuationColor:{value:new a3(0)},specularColor:{value:new a3(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new u},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new u},anisotropyVector:{value:new p},anisotropyMap:{value:null},anisotropyMapTransform:{value:new u}}]),vertexShader:bY.meshphysical_vert,fragmentShader:bY.meshphysical_frag};function b_({width:a=64,height:b=64,className:c=""}){let d=(0,f.useRef)(null);return(0,e.jsx)("div",{ref:d,className:c,style:{width:`${a}px`,height:`${b}px`,aspectRatio:"1 / 1",display:"flex",alignItems:"center",justifyContent:"center"}})}function b0({onEarlyAccess:a}){return(0,e.jsxs)("section",{className:"min-h-screen flex flex-col items-center justify-center px-chorus-lg py-chorus-xxl bg-gradient-to-b from-white via-sand-100 to-sand-200 dark:from-carbon-950 dark:via-mulberry-950 dark:to-carbon-950 text-center",children:[(0,e.jsx)("div",{className:"animate-fade-in",children:(0,e.jsx)(b_,{width:512,height:512,className:"mx-auto drop-shadow-2xl"})}),(0,e.jsx)("h1",{className:"text-h1 font-logo font-thin text-carbon-950 dark:text-white mb-chorus-md animate-slide-up",style:{animationDelay:"0.3s"},children:"CHORUS"}),(0,e.jsxs)("h2",{className:"text-xl md:text-2xl text-carbon-700 dark:text-mulberry-100 mb-chorus-xxl max-w-2xl font-light leading-relaxed animate-fade-in-up",style:{animationDelay:"0.6s"},children:["The right context,",(0,e.jsx)("br",{}),"to the right agent,",(0,e.jsx)("br",{}),"at the right time."]}),(0,e.jsxs)("div",{className:"flex gap-chorus-md flex-wrap justify-center animate-fade-in-up",style:{animationDelay:"0.9s"},children:[(0,e.jsx)("button",{onClick:()=>a("request_early_access"),className:"btn-primary text-lg px-chorus-xl py-chorus-md",children:"Request Early Access"}),(0,e.jsx)("button",{onClick:()=>a("early_access_waitlist"),className:"btn-secondary text-lg px-chorus-xl py-chorus-md",children:"Join Waitlist"})]}),(0,e.jsx)("div",{className:"absolute bottom-chorus-lg left-1/2 transform -translate-x-1/2 animate-bounce",children:(0,e.jsx)("div",{className:"w-6 h-10 border-2 border-carbon-600 dark:border-mulberry-400 rounded-full flex justify-center",children:(0,e.jsx)("div",{className:"w-1 h-3 bg-carbon-600 dark:bg-mulberry-400 rounded-full mt-2 animate-pulse"})})})]})}function b1({children:a,delay:b=0,duration:c=600,direction:d="up",distance:g=24,className:h=""}){let{elementRef:i,isVisible:j}=function(a={}){let{threshold:b=.1,rootMargin:c="0px 0px -100px 0px",triggerOnce:d=!0}=a,[e,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)(!1);return{elementRef:(0,f.useRef)(null),isVisible:d?h:e}}({threshold:.1,rootMargin:"0px 0px -100px 0px",triggerOnce:!0}),k={opacity:+!!j,transform:(a=>{if(a)return"translate3d(0, 0, 0)";switch(d){case"up":default:return`translate3d(0, ${g}px, 0)`;case"down":return`translate3d(0, -${g}px, 0)`;case"left":return`translate3d(${g}px, 0, 0)`;case"right":return`translate3d(-${g}px, 0, 0)`}})(j),transition:`opacity ${c}ms ease-out ${b}ms, transform ${c}ms ease-out ${b}ms`,willChange:"opacity, transform"};return(0,e.jsx)("div",{ref:i,style:k,className:`scroll-reveal ${h}`,children:a})}function b2(){return(0,e.jsx)("section",{className:"py-chorus-xxl px-chorus-lg bg-gradient-to-b from-sand-200 via-sand-100 to-white dark:from-mulberry-950 dark:via-carbon-950 dark:to-mulberry-950 text-center",children:(0,e.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,e.jsx)(b1,{delay:200,duration:600,direction:"up",children:(0,e.jsx)("h3",{className:"text-h2 font-bold text-carbon-950 dark:text-white mb-chorus-xl",children:"Our Mission"})}),(0,e.jsx)(b1,{delay:300,duration:600,direction:"up",children:(0,e.jsx)("p",{className:"text-xl md:text-2xl leading-relaxed mb-chorus-xl text-carbon-700 dark:text-mulberry-100 font-light",children:"We are creating a distributed, semantic and temporal knowledge fabric, for humans and AI, to share reasoning, context and intent, not just files."})}),(0,e.jsx)(b1,{delay:400,duration:600,direction:"up",children:(0,e.jsx)("div",{className:"w-16 h-px bg-gradient-to-r from-transparent via-carbon-400 dark:via-mulberry-400 to-transparent mx-auto my-chorus-xxl"})}),(0,e.jsx)(b1,{delay:500,duration:600,direction:"up",children:(0,e.jsx)("p",{className:"text-lg md:text-xl leading-relaxed mb-chorus-xxl text-carbon-600 dark:text-mulberry-200 font-light max-w-3xl mx-auto",children:"CHORUS transforms how organizations orchestrate AI agents, ensuring every decision is informed by the right context, delivered to the right agent, at precisely the right moment."})}),(0,e.jsx)(b1,{delay:600,duration:600,direction:"up",children:(0,e.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-chorus-xl mt-chorus-xxl",children:[{title:"Contextual Intelligence",description:"Beyond data sharing—intelligent context that understands meaning, relationships, and temporal significance.",color:"ocean"},{title:"Agent Orchestration",description:"Seamless coordination between human teams and AI agents through sophisticated workflow intelligence.",color:"eucalyptus"},{title:"Temporal Knowledge",description:"Understanding not just what happened, but when it mattered and why it influenced subsequent decisions.",color:"coral"}].map((a,b)=>(0,e.jsxs)("div",{className:"text-center p-chorus-lg rounded-lg bg-sand-50/80 dark:bg-mulberry-900/30 border border-sand-200/60 dark:border-mulberry-800/40 backdrop-blur-sm hover:bg-sand-100/90 dark:hover:bg-mulberry-900/50 transition-all duration-500 ease-out",children:[(0,e.jsxs)("div",{className:`w-20 h-20 mx-auto mb-chorus-md rounded-full bg-gradient-to-br from-${a.color}-500 to-${a.color}-700 flex items-center justify-center`,children:[0===b&&(0,e.jsx)("svg",{className:`w-12 h-12 text-${a.color}-100`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m-6 3l6-3"})}),1===b&&(0,e.jsx)("svg",{className:`w-12 h-12 text-${a.color}-100`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),2===b&&(0,e.jsx)("svg",{className:`w-12 h-12 text-${a.color}-100`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,e.jsx)("h4",{className:"text-lg font-semibold text-carbon-950 dark:text-white mb-chorus-sm",children:a.title}),(0,e.jsx)("p",{className:"text-sm leading-relaxed text-carbon-600 dark:text-mulberry-300 font-light",children:a.description})]},b))})})]})})}function b3({isOpen:a,onClose:b,leadSource:c}){let{submitEarlyAccess:d,isSubmitting:h,submitStatus:i,errorMessage:j}=g(),[k,l]=(0,f.useState)({firstName:"",lastName:"",email:"",companyName:"",companyRole:"",interestLevel:"general_interest",leadSource:c,gdprConsent:!1,marketingConsent:!1}),m=async a=>{if(a.preventDefault(),!k.gdprConsent)return void alert("Please accept the privacy policy to continue.");(await d(k)).success&&l({firstName:"",lastName:"",email:"",companyName:"",companyRole:"",interestLevel:"general_interest",leadSource:c,gdprConsent:!1,marketingConsent:!1})},n=(a,b)=>{l(c=>({...c,[a]:b}))};return a?(0,e.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm",onClick:b,children:(0,e.jsxs)("div",{className:"relative w-full max-w-md bg-gradient-to-b from-mulberry-900 to-carbon-900 text-white p-chorus-xl rounded-lg border border-mulberry-700/50 shadow-2xl",onClick:a=>a.stopPropagation(),children:[(0,e.jsx)("button",{onClick:b,className:"absolute top-4 right-4 text-mulberry-300 hover:text-white text-2xl font-light transition-colors duration-200",children:"\xd7"}),(0,e.jsx)("h3",{className:"text-h3 font-semibold text-white mb-chorus-sm",children:"request_early_access"===c?"Request Early Access to CHORUS":"Join the CHORUS Waitlist"}),(0,e.jsx)("p",{className:"text-sm text-mulberry-200 font-light mb-chorus-xl",children:"request_early_access"===c?"Get priority access to contextual AI orchestration":"Be notified when CHORUS becomes available"}),"success"===i?(0,e.jsxs)("div",{className:"text-center py-chorus-xl",children:[(0,e.jsx)("div",{className:"text-5xl text-eucalyptus-400 mb-chorus-lg animate-bounce",children:"✓"}),(0,e.jsx)("h4",{className:"text-lg font-semibold text-eucalyptus-300 mb-chorus-sm",children:"request_early_access"===c?"Request submitted successfully!":"Welcome to the waitlist!"}),(0,e.jsx)("p",{className:"text-sm text-mulberry-200 font-light",children:"request_early_access"===c?"We'll prioritize your request and contact you soon.":"We'll notify you when CHORUS becomes available."})]}):(0,e.jsxs)("form",{onSubmit:m,children:[(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-chorus-md mb-chorus-md",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"block text-sm font-medium text-mulberry-200 mb-chorus-xs",children:"First Name *"}),(0,e.jsx)("input",{type:"text",required:!0,value:k.firstName,onChange:a=>n("firstName",a.target.value),className:"form-input",placeholder:"John"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"block text-sm font-medium text-mulberry-200 mb-chorus-xs",children:"Last Name *"}),(0,e.jsx)("input",{type:"text",required:!0,value:k.lastName,onChange:a=>n("lastName",a.target.value),className:"form-input",placeholder:"Doe"})]})]}),(0,e.jsxs)("div",{className:"mb-chorus-md",children:[(0,e.jsx)("label",{className:"block text-sm font-medium text-mulberry-200 mb-chorus-xs",children:"Email Address *"}),(0,e.jsx)("input",{type:"email",required:!0,value:k.email,onChange:a=>n("email",a.target.value),className:"form-input",placeholder:"john@company.com"})]}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-chorus-md mb-chorus-md",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"block text-sm font-medium text-mulberry-200 mb-chorus-xs",children:"Company"}),(0,e.jsx)("input",{type:"text",value:k.companyName||"",onChange:a=>n("companyName",a.target.value),className:"form-input",placeholder:"Company Name"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"block text-sm font-medium text-mulberry-200 mb-chorus-xs",children:"Role"}),(0,e.jsx)("input",{type:"text",value:k.companyRole||"",onChange:a=>n("companyRole",a.target.value),className:"form-input",placeholder:"CTO, Director, etc."})]})]}),(0,e.jsxs)("div",{className:"mb-chorus-lg",children:[(0,e.jsx)("label",{className:"block text-sm font-medium text-mulberry-200 mb-chorus-xs",children:"Primary Interest"}),(0,e.jsxs)("select",{value:k.interestLevel,onChange:a=>n("interestLevel",a.target.value),className:"form-input",children:[(0,e.jsx)("option",{value:"general_interest",children:"General Interest"}),(0,e.jsx)("option",{value:"technical_evaluation",children:"Technical Evaluation"}),(0,e.jsx)("option",{value:"strategic_demo",children:"Strategic Demo"})]})]}),(0,e.jsxs)("div",{style:{marginBottom:"1.5rem",fontSize:"0.85rem"},children:[(0,e.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.5rem",marginBottom:"0.75rem"},children:[(0,e.jsx)("input",{type:"checkbox",checked:k.gdprConsent,onChange:a=>n("gdprConsent",a.target.checked),required:!0}),(0,e.jsx)("span",{children:"I agree to the privacy policy and consent to processing my personal data for early access communications. *"})]}),(0,e.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.5rem"},children:[(0,e.jsx)("input",{type:"checkbox",checked:k.marketingConsent,onChange:a=>n("marketingConsent",a.target.checked)}),(0,e.jsx)("span",{children:"I would like to receive updates about CHORUS Services and related products."})]})]}),"error"===i&&j&&(0,e.jsxs)("div",{style:{padding:"0.75rem",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid #dc2626",color:"#fca5a5",fontSize:"0.85rem",marginBottom:"1rem"},children:["⚠ ",j]}),(0,e.jsx)("button",{type:"submit",disabled:h||!k.gdprConsent,className:"btn-primary",style:{width:"100%",opacity:h||!k.gdprConsent?.5:1,cursor:h||!k.gdprConsent?"not-allowed":"pointer"},children:h?"request_early_access"===c?"Submitting Request...":"Joining Waitlist...":"request_early_access"===c?"Submit Request":"Join Waitlist"})]}),(0,e.jsx)("p",{style:{fontSize:"0.75rem",opacity:.6,textAlign:"center",marginTop:"1.5rem",paddingTop:"1.5rem",borderTop:"1px solid #444"},children:"By joining our waitlist, you'll receive exclusive early access and product updates. We respect your privacy and won't spam you."})]})}):null}new Float32Array(16),new Float32Array(9),new Float32Array(4),new q,Int8Array,Uint8Array,Int16Array,Uint16Array,Uint32Array,Float32Array,new al,new WeakMap;var b4=c(6935);function b5(){let{isModalOpen:a,currentLeadSource:b,openModal:c,closeModal:d}=g();return(0,e.jsxs)("main",{className:"min-h-screen bg-white dark:bg-carbon-950 text-carbon-950 dark:text-white overflow-x-hidden font-sans antialiased",children:[(0,e.jsx)(b0,{onEarlyAccess:c}),(0,e.jsx)(b2,{}),(0,e.jsx)("section",{className:"py-chorus-xxl px-chorus-lg border-t border-mulberry-800/30 dark:border-mulberry-800/30 border-sand-300/50 bg-gradient-to-b from-sand-200 to-white dark:from-carbon-950 dark:to-mulberry-950",children:(0,e.jsxs)("div",{className:"max-w-4xl mx-auto text-center",children:[(0,e.jsxs)("p",{className:"text-carbon-700 dark:text-mulberry-200 text-lg font-light mb-chorus-xl leading-relaxed",children:["CHORUS Services is currently in development.",(0,e.jsx)("br",{}),"Join our waitlist to be first to experience the future of contextual AI orchestration."]}),(0,e.jsxs)("div",{className:"flex gap-chorus-md justify-center flex-wrap",children:[(0,e.jsx)("button",{onClick:()=>c("request_early_access"),className:"btn-primary text-lg px-chorus-xl py-chorus-md",children:"Request Early Access"}),(0,e.jsx)("button",{onClick:()=>c("early_access_waitlist"),className:"btn-secondary text-lg px-chorus-xl py-chorus-md",children:"Join Waitlist"})]})]})}),(0,e.jsx)("footer",{className:"py-chorus-xl px-chorus-lg border-t border-sand-300/30 dark:border-mulberry-800/20 bg-sand-100 dark:bg-mulberry-950",children:(0,e.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,e.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0",children:[(0,e.jsx)("div",{className:"text-carbon-600 dark:text-mulberry-300 text-sm font-medium",children:"\xa9 2025 Deep Black Cloud. All rights reserved."}),(0,e.jsxs)("div",{className:"flex space-x-chorus-lg text-sm",children:[(0,e.jsx)("a",{href:"mailto:contact@chorus.services",className:"text-carbon-600 dark:text-mulberry-300 hover:text-carbon-950 dark:hover:text-white transition-colors duration-300 ease-out font-medium",children:"Contact"}),(0,e.jsx)("a",{href:"/privacy",className:"text-carbon-600 dark:text-mulberry-300 hover:text-carbon-950 dark:hover:text-white transition-colors duration-300 ease-out font-medium",children:"Privacy"})]})]}),(0,e.jsx)("div",{className:"mt-chorus-lg pt-chorus-lg border-t border-sand-300/30 dark:border-mulberry-800/30",children:(0,e.jsxs)("div",{className:"text-xs text-carbon-500 dark:text-mulberry-400 space-y-1 leading-relaxed",children:[(0,e.jsx)("p",{className:"font-medium",children:"CHORUS.services - Anthony Lewis Rawlins"}),(0,e.jsx)("p",{children:"ABN: 38558842858 | Lucas, Victoria 3350, Australia"}),(0,e.jsx)("p",{className:"text-carbon-400 dark:text-mulberry-500",children:"AI Development & IT Consultancy"})]})})]})}),(0,e.jsx)(b4.A,{}),(0,e.jsx)(b3,{isOpen:a,onClose:d,leadSource:b})]})}},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6682:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1170,23)),Promise.resolve().then(c.t.bind(c,3597,23)),Promise.resolve().then(c.t.bind(c,6893,23)),Promise.resolve().then(c.t.bind(c,9748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,9576,23)),Promise.resolve().then(c.t.bind(c,3041,23)),Promise.resolve().then(c.t.bind(c,1384,23))},6713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},6935:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});var d=c(1124),e=c(8301);function f(){let[a,b]=(0,e.useState)("dark");return(0,d.jsx)("button",{onClick:()=>{let c="dark"===a?"light":"dark";b(c),"dark"===c?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},className:"fixed top-chorus-lg right-chorus-lg z-50 p-chorus-sm hover:bg-black/10 dark:hover:bg-white/10 transition-colors rounded-lg backdrop-blur-sm bg-white/20 dark:bg-black/20 border border-white/30 dark:border-white/20","aria-label":"Toggle theme",children:"dark"===a?(0,d.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):(0,d.jsx)("svg",{className:"w-6 h-6 text-carbon-950",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})}},6953:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h,metadata:()=>g});var d=c(5338),e=c(7253),f=c.n(e);c(2704);let g={title:"CHORUS Services - Contextual AI Orchestration Platform",description:"Revolutionary AI orchestration platform. The right context, to the right agent, at the right time. Join the waitlist for early access.",keywords:["contextual AI","agent orchestration","enterprise AI","knowledge fabric","AI platform"],authors:[{name:"Anthony Lewis Rawlins",url:"https://deepblack.cloud"}],creator:"Deep Black Cloud",publisher:"CHORUS Services",metadataBase:new URL("https://chorus.services"),alternates:{canonical:"https://chorus.services"},openGraph:{type:"website",locale:"en_US",url:"https://chorus.services",siteName:"CHORUS Services",title:"CHORUS Services - Contextual AI Orchestration Platform",description:"Revolutionary AI orchestration platform. The right context, to the right agent, at the right time.",images:[{url:"/logos/logo-ring-only.png",width:256,height:256,alt:"CHORUS Services Logo"}]},twitter:{card:"summary_large_image",title:"CHORUS Services - Contextual AI Orchestration",description:"The right context, to the right agent, at the right time.",images:["/logos/chorus-landscape-on-blue.png"]},robots:{index:!0,follow:!0,googleBot:{index:!0,follow:!0,"max-video-preview":-1,"max-image-preview":"large","max-snippet":-1}},verification:{}};function h({children:a}){return(0,d.jsx)("html",{lang:"en",className:"dark",children:(0,d.jsx)("body",{className:`${f().variable} font-sans`,children:a})})}},7414:()=>{},7717:(a,b,c)=>{Promise.resolve().then(c.bind(c,4535))},7742:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(7954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/tony/chorus/project-queues/active/chorus.services/modules/teaser/app/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/tony/chorus/project-queues/active/chorus.services/modules/teaser/app/page.tsx","default")},8354:a=>{"use strict";a.exports=require("util")},8552:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>D.a,__next_app__:()=>J,handler:()=>L,pages:()=>I,routeModule:()=>K,tree:()=>H});var d=c(9754),e=c(9117),f=c(6595),g=c(2324),h=c(9326),i=c(8928),j=c(175),k=c(12),l=c(4290),m=c(2696),n=c(2802),o=c(7533),p=c(5229),q=c(2822),r=c(261),s=c(6453),t=c(2474),u=c(6713),v=c(1356),w=c(2685),x=c(6225),y=c(3446),z=c(2762),A=c(5742),B=c(6439),C=c(1170),D=c.n(C),E=c(2506),F=c(1203),G={};for(let a in E)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(G[a]=()=>E[a]);c.d(b,G);let H=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,7742)),"/home/tony/chorus/project-queues/active/chorus.services/modules/teaser/app/page.tsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,6953)),"/home/tony/chorus/project-queues/active/chorus.services/modules/teaser/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,1170,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,7028,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,461,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,2768,23)),"next/dist/client/components/builtin/unauthorized.js"]}],I=["/home/tony/chorus/project-queues/active/chorus.services/modules/teaser/app/page.tsx"],J={require:c,loadChunk:()=>Promise.resolve()},K=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:H},distDir:".next",relativeProjectDir:""});async function L(a,b,d){var C;let G="/page";"/index"===G&&(G="/");let M=(0,h.getRequestMeta)(a,"postponed"),N=(0,h.getRequestMeta)(a,"minimalMode"),O=await K.prepare(a,b,{srcPage:G,multiZoneDraftMode:!1});if(!O)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:P,query:Q,params:R,parsedUrl:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:$,isDraftMode:_,resolvedPathname:aa,revalidateOnlyGenerated:ab,routerServerContext:ac,nextConfig:ad,interceptionRoutePatterns:ae}=O,af=S.pathname||"/",ag=(0,r.normalizeAppPath)(G),{isOnDemandRevalidate:ah}=O,ai=K.match(af,$),aj=!!$.routes[aa],ak=!!(ai||aj||$.routes[ag]),al=a.headers["user-agent"]||"",am=(0,u.getBotType)(al),an=(0,p.isHtmlBotRequest)(a),ao=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],ap=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[t.RSC_HEADER],aq=(0,s.getIsPossibleServerAction)(a),ar=(0,m.checkIsAppPPREnabled)(ad.experimental.ppr)&&(null==(C=$.routes[ag]??$.dynamicRoutes[ag])?void 0:C.renderingMode)==="PARTIALLY_STATIC",as=!1,at=!1,au=ar?M:void 0,av=ar&&ap&&!ao,aw=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ax=!al||(0,p.shouldServeStreamingMetadata)(al,ad.htmlLimitedBots);an&&ar&&(ak=!1,ax=!1);let ay=!0===K.isDev||!ak||"string"==typeof M||av,az=an&&ar,aA=null;_||!ak||ay||aq||au||av||(aA=aa);let aB=aA;!aB&&K.isDev&&(aB=aa),K.isDev||_||!ak||!ap||av||(0,k.d)(a.headers);let aC={...E,tree:H,pages:I,GlobalError:D(),handler:L,routeModule:K,__next_app__:J};X&&Y&&(0,o.setReferenceManifestsSingleton)({page:G,clientReferenceManifest:Y,serverActionsManifest:X,serverModuleMap:(0,q.createServerModuleMap)({serverActionsManifest:X})});let aD=a.method||"GET",aE=(0,g.getTracer)(),aF=aE.getActiveScopeSpan();try{let f=K.getVaryHeader(aa,ae);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return K.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aE.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aD} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aD} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:Q,params:R,page:ag,sharedContext:{buildId:P},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aC,Component:(0,j.T)(aC),params:R,routeModule:K,page:G,postponed:f,shouldWaitOnAllReady:az,serveStreamingMetadata:ax,supportsDynamicResponse:"string"==typeof f||ay,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,serverActionsManifest:X,clientReferenceManifest:Y,setIsrStatus:null==ac?void 0:ac.setIsrStatus,dir:c(9902).join(process.cwd(),K.relativeProjectDir),isDraftMode:_,isRevalidate:ak&&!f&&!av,botType:am,isOnDemandRevalidate:ah,isPossibleServerAction:aq,assetPrefix:ad.assetPrefix,nextConfigOutput:ad.output,crossOrigin:ad.crossOrigin,trailingSlash:ad.trailingSlash,previewProps:$.preview,deploymentId:ad.deploymentId,enableTainting:ad.experimental.taint,htmlLimitedBots:ad.htmlLimitedBots,devtoolSegmentExplorer:ad.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ad.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ad.experimental.cacheLife,basePath:ad.basePath,serverActions:ad.experimental.serverActions,...as?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:as}:{},experimental:{isRoutePPREnabled:ar,expireTime:ad.expireTime,staleTimes:ad.experimental.staleTimes,cacheComponents:!!ad.experimental.cacheComponents,clientSegmentCache:!!ad.experimental.clientSegmentCache,clientParamParsing:!!ad.experimental.clientParamParsing,dynamicOnHover:!!ad.experimental.dynamicOnHover,inlineCss:!!ad.experimental.inlineCss,authInterrupts:!!ad.experimental.authInterrupts,clientTraceMetadata:ad.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>K.onRequestError(a,b,d,ac),err:(0,h.getRequestMeta)(a,"invokeError"),dev:K.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[y.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,ak&&(null==n?void 0:n.revalidate)===0&&!K.isDev&&!ar){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${aa}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:v.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},o=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i})=>{let j,k=!1===K.isDev,l=c||b.writableEnded;if(ah&&ab&&!f&&!N)return(null==ac?void 0:ac.render404)?await ac.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(ai&&(j=(0,w.parseFallbackField)(ai.fallback)),j===w.FallbackMode.PRERENDER&&(0,u.isBot)(al)&&(!ar||an)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ah=!0),ah&&(j!==w.FallbackMode.NOT_FOUND||f)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),!N&&j!==w.FallbackMode.BLOCKING_STATIC_RENDER&&aB&&!l&&!_&&T&&(k||!aj)){let b;if((k||ai)&&j===w.FallbackMode.NOT_FOUND)throw new B.NoFallbackError;if(ar&&!ap){let c="string"==typeof(null==ai?void 0:ai.fallback)?ai.fallback:k?ag:null;if(b=await K.handleResponse({cacheKey:c,req:a,nextConfig:ad,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:$,isRoutePPREnabled:ar,responseGenerator:async()=>m({span:i,postponed:void 0,fallbackRouteParams:k||at?(0,n.u)(ag):null}),waitUntil:d.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let o=ah||g||!au?void 0:au;if(as&&void 0!==o)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:v.CachedRouteKind.PAGES,html:x.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let p=T&&ar&&((0,h.getRequestMeta)(a,"renderFallbackShell")||at)?(0,n.u)(af):null;return m({span:i,postponed:o,fallbackRouteParams:p})},p=async c=>{var f,g,i,j,k;let l,n=await K.handleResponse({cacheKey:aA,responseGenerator:a=>o({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ah,isRoutePPREnabled:ar,req:a,nextConfig:ad,prerenderManifest:$,waitUntil:d.waitUntil});if(_&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),K.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!n){if(aA)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=n.value)?void 0:f.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=n.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof n.value.postponed;ak&&!av&&(!p||ao)&&(N||b.setHeader("x-nextjs-cache",ah?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),b.setHeader(t.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=n;if(au)l={revalidate:0,expire:void 0};else if(N&&ap&&!ao&&ar)l={revalidate:0,expire:void 0};else if(!K.isDev)if(_)l={revalidate:0,expire:void 0};else if(ak){if(n.cacheControl)if("number"==typeof n.cacheControl.revalidate){if(n.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${n.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:n.cacheControl.revalidate,expire:(null==(j=n.cacheControl)?void 0:j.expire)??ad.expireTime}}else l={revalidate:y.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(n.cacheControl=l,"string"==typeof aw&&(null==q?void 0:q.kind)===v.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[y.NEXT_CACHE_TAGS_HEADER];N&&ak&&c&&"string"==typeof c&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(aw);return void 0!==d?(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.fromStatic(d,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl}):(b.statusCode=204,(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl}))}let r=(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...n,value:{...n.value,kind:"PAGE"}},{url:(0,h.getRequestMeta)(a,"initURL")}))return null;if(p&&au)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(N&&ak||delete a[y.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[y.NEXT_CACHE_TAGS_HEADER];if(N&&ak&&s&&"string"==typeof s&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,s),!q.status||ap&&ar||(b.statusCode=q.status),!N&&q.status&&F.RedirectStatusCode[q.status]&&ap&&(b.statusCode=200),p&&b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"1"),ap&&!_){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:q.html,cacheControl:av?{revalidate:0,expire:void 0}:n.cacheControl})}return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.fromStatic(q.rscData,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl})}let u=q.html;if(!p||N||ap)return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:n.cacheControl});if(as)return u.push(new ReadableStream({start(a){a.enqueue(z.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}});let w=new TransformStream;return u.push(w.readable),m({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(w.writable)}).catch(a=>{w.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}})};if(!aF)return await aE.withPropagatedContext(a.headers,()=>aE.trace(i.BaseServerSpan.handleRequest,{spanName:`${aD} ${a.url}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aD,"http.target":a.url}},p));await p(aF)}catch(b){throw aF||b instanceof B.NoFallbackError||await K.onRequestError(a,b,{routerKind:"App Router",routePath:G,routeType:"render",revalidateReason:(0,f.c)({isRevalidate:ak,isOnDemandRevalidate:ah})},ac),b}}},9121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9730:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,4160,23)),Promise.resolve().then(c.t.bind(c,1603,23)),Promise.resolve().then(c.t.bind(c,8495,23)),Promise.resolve().then(c.t.bind(c,5170,23)),Promise.resolve().then(c.t.bind(c,7526,23)),Promise.resolve().then(c.t.bind(c,8922,23)),Promise.resolve().then(c.t.bind(c,9234,23)),Promise.resolve().then(c.t.bind(c,2263,23)),Promise.resolve().then(c.bind(c,2146))},9902:a=>{"use strict";a.exports=require("path")}};var b=require("../webpack-runtime.js");b.C(a);var c=b.X(0,[586,397],()=>b(b.s=8552));module.exports=c})();