PageSourceSearch

https://avic-media.web.app/6217.3f23554a31ffe8f5.js

js avic-media.web.app collected 2026-10-03 12:18:33 UTC 598,353 bytes, 1 lines download raw bytes

1"use strict";var Ox=Object.defineProperty,Fx=Object.defineProperties,Bx=Object.getOwnPropertyDescriptors,Sf=Object.getOwnPropertySymbols,zx=Object.prototype.hasOwnProperty,kx=Object.prototype.propertyIsEnumerable,Ef=Math.pow,wf=(Bn,Wt,zt)=>Wt in Bn?Ox(Bn,Wt,{enumerable:!0,configurable:!0,writable:!0,value:zt}):Bn[Wt]=zt,gt=(Bn,Wt)=>{for(var zt in Wt||(Wt={}))zx.call(Wt,zt)&&wf(Bn,zt,Wt[zt]);if(Sf)for(var zt of Sf(Wt))kx.call(Wt,zt)&&wf(Bn,zt,Wt[zt]);return Bn},ua=(Bn,Wt)=>Fx(Bn,Bx(Wt));(self.webpackChunktonomo=self.webpackChunktonomo||[]).push([[6217],{76217:(Bn,Wt,zt)=>{zt.r(Wt),zt.d(Wt,{AbstractAdapter:()=>Gi,AbstractButton:()=>nn,AbstractComponent:()=>wi,AbstractConfigurablePlugin:()=>cc,AbstractPlugin:()=>Yi,CONSTANTS:()=>oo,Cache:()=>Nn,DEFAULTS:()=>Ei,DualFisheyeAdapter:()=>Co,EquirectangularAdapter:()=>bs,PSVError:()=>tt,SYSTEM:()=>Ze,TypedEvent:()=>Xt,VERSION:()=>yc,Viewer:()=>He,events:()=>Ma,registerButton:()=>La,utils:()=>uo});var Ys=zt(15861),ge=zt(86682),Yh=Object.defineProperty,ao=(o,d)=>{for(var y in d)Yh(o,y,{get:d[y],enumerable:!0})},oo={};ao(oo,{ACTIONS:()=>ho,ANIMATION_MIN_DURATION:()=>vn,CAPTURE_EVENTS_CLASS:()=>as,CTRLZOOM_TIMEOUT:()=>pa,DBLCLICK_DELAY:()=>ui,EASINGS:()=>qs,ICONS:()=>_n,IDS:()=>Nt,KEY_CODES:()=>It,LONGTOUCH_DELAY:()=>da,MOVE_THRESHOLD:()=>kn,SPHERE_RADIUS:()=>di,TWOFINGERSOVERLAY_DELAY:()=>fa,VIEWER_DATA:()=>Kt});var Hi,vn=500,kn=4,ui=300,da=500,fa=100,pa=2e3,di=10,Kt="photoSphereViewer",as="psv--capture-event",ho=(o=>(o.ROTATE_UP="ROTATE_UP",o.ROTATE_DOWN="ROTATE_DOWN",o.ROTATE_RIGHT="ROTATE_RIGHT",o.ROTATE_LEFT="ROTATE_LEFT",o.ZOOM_IN="ZOOM_IN",o.ZOOM_OUT="ZOOM_OUT",o))(ho||{}),Nt={MENU:"menu",TWO_FINGERS:"twoFingers",CTRL_ZOOM:"ctrlZoom",ERROR:"error",DESCRIPTION:"description"},It={Enter:"Enter",Control:"Control",Escape:"Escape",Space:" ",PageUp:"PageUp",PageDown:"PageDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Delete:"Delete",Plus:"+",Minus:"-"},_n={arrow:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="40 40 432 432"><g transform="rotate(0, 256, 256)"><path fill="currentColor" d="M425.23 210.55H227.39a5 5 0 01-3.53-8.53l56.56-56.57a45.5 45.5 0 000-64.28 45.15 45.15 0 00-32.13-13.3 45.15 45.15 0 00-32.14 13.3L41.32 256l174.83 174.83a45.15 45.15 0 0032.14 13.3 45.15 45.15 0 0032.13-13.3 45.5 45.5 0 000-64.28l-56.57-56.57a5 5 0 013.54-8.53h197.84c25.06 0 45.45-20.39 45.45-45.45s-20.4-45.45-45.45-45.45z"/></g>\x3c!-- Created by Flatart from the Noun Project --\x3e</svg>\n',close:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><g fill="currentColor" transform=" translate(50, 50) rotate(45)"><rect x="-5" y="-65" width="10" height="130"/><rect x="-65" y="-5" width="130" height="10"/></g></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M83.3 35.6h-17V3H32.2v32.6H16.6l33.6 32.7 33-32.7z"/><path fill="currentColor" d="M83.3 64.2v16.3H16.6V64.2H-.1v32.6H100V64.2H83.3z"/>\x3c!--Created by Michael Zenaty from the Noun Project--\x3e</svg>\n',fullscreenIn:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M100 40H87.1V18.8h-21V6H100zM100 93.2H66V80.3h21.1v-21H100zM34 93.2H0v-34h12.9v21.1h21zM12.9 40H0V6h34v12.9H12.8z"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>\n',fullscreenOut:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M66 7h13v21h21v13H66zM66 60.3h34v12.9H79v21H66zM0 60.3h34v34H21V73.1H0zM21 7h13v34H0V28h21z"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>\n',info:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="currentColor" d="M28.3 26.1c-1 2.6-1.9 4.8-2.6 7-2.5 7.4-5 14.7-7.2 22-1.3 4.4.5 7.2 4.3 7.8 1.3.2 2.8.2 4.2-.1 8.2-2 11.9-8.6 15.7-15.2l-2.2 2a18.8 18.8 0 0 1-7.4 5.2 2 2 0 0 1-1.6-.2c-.2-.1 0-1 0-1.4l.8-1.8L41.9 28c.5-1.4.9-3 .7-4.4-.2-2.6-3-4.4-6.3-4.4-8.8.2-15 4.5-19.5 11.8-.2.3-.2.6-.3 1.3 3.7-2.8 6.8-6.1 11.8-6.2z"/><circle fill="currentColor" cx="39.3" cy="9.2" r="8.2"/>\x3c!--Created by Arafat Uddin from the Noun Project--\x3e</svg>
1\n',menu:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 10 80 80"><g fill="currentColor"><circle r="10" cx="20" cy="20"/><circle r="10" cx="50" cy="20"/><circle r="10" cx="80" cy="20"/><circle r="10" cx="20" cy="50"/><circle r="10" cx="50" cy="50"/><circle r="10" cx="80" cy="50"/><circle r="10" cx="20" cy="80"/><circle r="10" cx="50" cy="80"/><circle r="10" cx="80" cy="80"/></g>\x3c!-- Created by Richard Kun\xe1k from the Noun Project--\x3e</svg>\n',zoomIn:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path fill="currentColor" d="M8.728 4.009H6.744v2.737H4.006V8.73h2.738v2.736h1.984V8.73h2.737V6.746H8.728z"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>\n',zoomOut:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path fill="currentColor" d="M4.006 6.746h7.459V8.73H4.006z"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>\n'},qs={linear:o=>o,inQuad:o=>o*o,outQuad:o=>o*(2-o),inOutQuad:o=>o<.5?2*o*o:(4-2*o)*o-1,inCubic:o=>o*o*o,outCubic:o=>--o*o*o+1,inOutCubic:o=>o<.5?4*o*o*o:(o-1)*(2*o-2)*(2*o-2)+1,inQuart:o=>o*o*o*o,outQuart:o=>1- --o*o*o*o,inOutQuart:o=>o<.5?8*o*o*o*o:1-8*--o*o*o*o,inQuint:o=>o*o*o*o*o,outQuint:o=>1+--o*o*o*o*o,inOutQuint:o=>o<.5?16*o*o*o*o*o:1+16*--o*o*o*o*o,inSine:o=>1-Math.cos(o*(Math.PI/2)),outSine:o=>Math.sin(o*(Math.PI/2)),inOutSine:o=>.5-.5*Math.cos(Math.PI*o),inExpo:o=>Math.pow(2,10*(o-1)),outExpo:o=>1-Math.pow(2,-10*o),inOutExpo:o=>(o=2*o-1)<0?.5*Math.pow(2,10*o):1-.5*Math.pow(2,-10*o),inCirc:o=>1-Math.sqrt(1-o*o),outCirc:o=>Math.sqrt(1-(o-1)*(o-1)),inOutCirc:o=>(o*=2)<1?.5-.5*Math.sqrt(1-o*o):.5+.5*Math.sqrt(1-(o-=2)*o)},uo={};function os(o,d){let y=o%d;return y<0&&(y+=d),y}function ma(o){return o.reduce((d,y)=>d+y,0)}function Zs(o,d){return Math.sqrt(Math.pow(o.x-d.x,2)+Math.pow(o.y-d.y,2))}function fo(o,d){return Math.atan2(d.y-o.y,d.x-o.x)}function po(o,d){return[0,2*Math.PI,2*-Math.PI].reduce((C,D)=>{const H=d-o+D;return Math.abs(H)<Math.abs(C)?H:C},1/0)}function mo(o,d){return Math.acos(Math.cos(o.pitch)*Math.cos(d.pitch)*Math.cos(o.yaw-d.yaw)+Math.sin(o.pitch)*Math.sin(d.pitch))}function Ql([o,d],[y,C]){o-y>Math.PI?o-=2*Math.PI:o-y<-Math.PI&&(o+=2*Math.PI);const D=(y-o)*Math.cos((d+C)/2),H=C-d;return Math.sqrt(D*D+H*H)}function go(o){return"string"==typeof o?o.match(/^[a-z]/i)?document.getElementById(o):document.querySelector(o):o}function $s(o,d,y){void 0===y?o.classList.toggle(d):y?o.classList.add(d):y||o.classList.remove(d)}function ga(o,d){o.classList.add(...d.split(" ").filter(y=>!!y))}function ec(o,d){o.classList.remove(...d.split(" ").filter(y=>!!y))}function tc(o,d){let y=o;do{if(y===d)return!0;y=y.parentElement}while(y);return!1}function Ks(o,d){if(!(null==o?void 0:o.matches))return null;let y=o;do{if(y.matches(d))return y;y=y.parentElement}while(y);return null}function ki(o){return(null==o?void 0:o.composedPath()[0])||null}function Js(o,d){return o?o.composedPath().find(y=>(y instanceof HTMLElement||y instanceof SVGElement)&&y.matches(d)):null}function fi(o){let d=0,y=0,C=o;for(;C;)d+=C.offsetLeft-C.scrollLeft+C.clientLeft,y+=C.offsetTop-C.scrollTop+C.clientTop,C=C.offsetParent;return d-=window.scrollX,y-=window.scrollY,{x:d,y}}function cn(o,d){return window.getComputedStyle(o).getPropertyValue(d)}function ls(o){if(o.touches.length<2)return null;const d={x:o.touches[0].clientX,y:o.touches[0].clientY},y={x:o.touches[1].clientX,y:o.touches[1].clientY};return{distance:Zs(d,y),angle:fo(d,y),center:{x:(d.x+y.x)/2,y:(d.y+y.y)/2}}}function js(o,d=!1){return d?o===Hi:document.fullscreenElement===o}function cs(o,d=!1){d?(Hi=o,o.classList.add("psv-fullscreen-emulation"),document.dispatchEvent(new Event("fullscreenchange"))):o.requestFullscreen()}function vo(o=!1){o?(Hi.classList.remove("psv-fullscreen-emulation"),Hi=null,document.dispatchEvent(new Event("fullscreenchange"))):document.exitFullscreen()}function nc(o){return o.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(d,y)=>(y>0?"-":"")+d.toLowerCase())}function Cn(o,d){let y=!1;return function(...C){y||(y=!0,setTimeout(()=>{o.apply(this,C),y=!1},d))}}function Qs(o){if("object"!=typeof o||null===o||"[object Object]"!==Object.prototype.toString.call(o))return!1;
vendor: 4,205 bytes, line 1
1if(null===Object.getPrototypeOf(o))return!0;let d=o;for(;null!==Object.getPrototypeOf(d);)d=Object.getPrototypeOf(d);return Object.getPrototypeOf(o)===d}function _o(o,d){const y=d;return function C(D,H){return Array.isArray(H)?(D&&Array.isArray(D)?D.length=0:D=[],H.forEach((z,se)=>{D[se]=C(null,z)})):"object"==typeof H?((!D||Array.isArray(D))&&(D={}),Object.keys(H).forEach(z=>{"object"==typeof H[z]&&H[z]&&Qs(H[z])?H[z]!==y&&(D[z]?C(D[z],H[z]):D[z]=C(null,H[z])):D[z]=H[z]})):D=H,D}(o,d)}function er(o){return _o(null,o)}function xo(o){return!o||0===Object.keys(o).length&&o.constructor===Object}function Pt(o){return null==o}function Rn(...o){for(const d of o)if(!Pt(d))return d;return null}function yo(o,d){if(o===d)return!0;if(va(o)&&va(d)){if(Object.keys(o).length!==Object.keys(d).length)return!1;for(const y of Object.keys(o))if(!yo(o[y],d[y]))return!1;return!0}return!1}function va(o){return"object"==typeof o&&null!==o}ao(uo,{Animation:()=>Jn,Dynamic:()=>gi,MultiDynamic:()=>nr,PressHandler:()=>Gn,Slider:()=>ya,SliderDirection:()=>xa,addClasses:()=>ga,angle:()=>fo,applyEulerInverse:()=>tr,checkClosedShadowDom:()=>Vn,checkStylesheet:()=>Vi,checkVersion:()=>ms,cleanCssPosition:()=>ic,clone:()=>er,createTexture:()=>bo,cssPositionIsOrdered:()=>xt,dasherize:()=>nc,deepEqual:()=>yo,deepmerge:()=>_o,distance:()=>Zs,exitFullscreen:()=>vo,firstNonNull:()=>Rn,getAbortError:()=>Hn,getAngle:()=>mo,getClosest:()=>Ks,getConfigParser:()=>ps,getElement:()=>go,getEventTarget:()=>ki,getMatchingTarget:()=>Js,getPosition:()=>fi,getShortestArc:()=>po,getStyleProperty:()=>cn,getTouchData:()=>ls,getXMPValue:()=>kt,greatArcDistance:()=>Ql,hasParent:()=>tc,invertResolvableBoolean:()=>xn,isAbortError:()=>us,isEmpty:()=>xo,isExtendedPosition:()=>pi,isFullscreenEnabled:()=>js,isNil:()=>Pt,isPlainObject:()=>Qs,logWarn:()=>nt,mergePanoData:()=>Jt,parseAngle:()=>At,parsePoint:()=>ds,parseSpeed:()=>fs,removeClasses:()=>ec,requestFullscreen:()=>cs,resolveBoolean:()=>hs,speedToDuration:()=>Mo,sum:()=>ma,throttle:()=>Cn,toggleClass:()=>$s,wrap:()=>os});var tt=class Tf extends Error{constructor(d,y){var C;super(y&&y instanceof Error?`${d}: ${y.message}`:d),this.name="PSVError",null==(C=Error.captureStackTrace)||C.call(Error,this,Tf)}};function hs(o,d){Qs(o)?(d(o.initial,!0),o.promise.then(y=>d(y,!1))):d(o,!0)}function xn(o){return{initial:!o.initial,promise:o.promise.then(d=>!d)}}function Hn(){const o=new Error("Loading was aborted.");return o.name="AbortError",o}function us(o){return"AbortError"===(null==o?void 0:o.name)}function nt(o){console.warn(`PhotoSphereViewer: ${o}`)}function pi(o){return!(!o||Array.isArray(o))&&[["textureX","textureY"],["yaw","pitch"]].some(([d,y])=>void 0!==o[d]&&void 0!==o[y])}function kt(o,d,y=!0){let C=o.match("<GPano:"+d+">(.*)</GPano:"+d+">");if(null!==C){const D=y?parseInt(C[1],10):parseFloat(C[1]);return isNaN(D)?null:D}if(C=o.match("GPano:"+d+'="(.*?)"'),null!==C){const D=y?parseInt(C[1],10):parseFloat(C[1]);return isNaN(D)?null:D}return null}var hn={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},mi=["left","center","right"],St=["top","center","bottom"],_a=[...mi,...St],yn="center";function ds(o){if(!o)return{x:.5,y:.5};if("object"==typeof o)return o;let d=o.toLocaleLowerCase().split(" ").slice(0,2);1===d.length&&(d=hn[d[0]]?[d[0],yn]:[d[0],d[0]]);const y="left"!==d[1]&&"right"!==d[1]&&"top"!==d[0]&&"bottom"!==d[0];d=d.map(D=>hn[D]||D),y||d.reverse();const C=d.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/);return C?{x:parseFloat(C[1])/100,y:parseFloat(C[2])/100}:{x:.5,y:.5}}function ic(o,{allowCenter:d,cssOrder:y}={allowCenter:!0,cssOrder:!0}){return o?("string"==typeof o&&(o=o.split(" ")),1===o.length&&(o[0]===yn?o=[yn,yn]:-1!==mi.indexOf(o[0])?o=[yn,o[0]]:-1!==St.indexOf(o[0])&&(o=[o[0],yn])),2!==o.length||-1===_a.indexOf(o[0])||-1===_a.indexOf(o[1])?(nt(`Unparsable position ${o}`),null):d||o[0]!==yn||o[1]!==yn?(y&&!xt(o)&&(o=[o[1],o[0]]),o[1]===yn&&-1!==mi.indexOf(o[0])&&(o=[yn,o[0]]),o[0]===yn&&-1!==St.indexOf(o[1])&&(o=[o[1],yn]),o):(nt("Invalid position center center"),null)):null}function xt(o){return-1!==St.indexOf(o[0])&&-1!==mi.indexOf(o[1])}function fs(o){let d;if("string"==typeof o){const y=o.toString().trim();
1let C=parseFloat(y.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1"));const D=y.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(D.match(/(pm|per minute)$/)&&(C/=60),D){case"dpm":case"degrees per minute":case"dps":case"degrees per second":d=ge.M8C.degToRad(C);break;case"rdpm":case"radians per minute":case"rdps":case"radians per second":d=C;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":d=C*Math.PI*2;break;default:throw new tt(`Unknown speed unit "${D}"`)}}else d=o;return d}function Mo(o,d){if("number"!=typeof o){const y=fs(o);return d/Math.abs(y)*1e3}return Math.abs(o)}function At(o,d=!1,y=d){let C;if("string"==typeof o){const D=o.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!D)throw new tt(`Unknown angle "${o}"`);const H=parseFloat(D[1]),z=D[2];if(z)switch(z){case"deg":case"degs":C=ge.M8C.degToRad(H);break;case"rad":case"rads":C=H;break;default:throw new tt(`Unknown angle unit "${z}"`)}else C=H}else{if("number"!=typeof o||isNaN(o))throw new tt(`Unknown angle "${o}"`);C=o}return C=os(d?C+Math.PI:C,2*Math.PI),d?ge.M8C.clamp(C-Math.PI,-Math.PI/(y?2:1),Math.PI/(y?2:1)):C}function bo(o,d=!1){const y=new ge.xEZ(o);return y.needsUpdate=!0,y.minFilter=d?ge.D1R:ge.wem,y.generateMipmaps=d,y.anisotropy=d?2:1,y}var In=new ge._fP;function tr(o,d){In.setFromEuler(d).invert(),o.applyQuaternion(In)}function ps(o,d){const y=function(C){const D=er(gt(gt({},o),C)),H={};for(let[z,se]of Object.entries(D)){if(d&&z in d)se=d[z](se,{rawConfig:D,defValue:o[z]});else if(!(z in o)){nt(`Unknown option ${z}`);continue}H[z]=se}return H};return y.defaults=o,y.parsers=d||{},y}function Vi(o,d){"true"!==cn(o,`--psv-${d}-loaded`)&&console.error(`PhotoSphereViewer: stylesheet "@photo-sphere-viewer/${d}/index.css" is not loaded`)}function ms(o,d,y){d&&d!==y&&console.error(`PhotoSphereViewer: @photo-sphere-viewer/${o} is in version ${d} but @photo-sphere-viewer/core is in version ${y}`)}function Vn(o){do{if(o instanceof ShadowRoot&&"closed"===o.mode)return void console.error("PhotoSphereViewer: closed shadow DOM detected, the viewer might not work as expected");o=o.parentNode}while(o)}function Jt(o,d,y,C){var H,z;if(!y&&!C){const se=Math.max(o,2*d),Be=Math.round(se/2);y={fullWidth:se,fullHeight:Be,croppedWidth:o,croppedHeight:d,croppedX:Math.round((se-o)/2),croppedY:Math.round((Be-d)/2)}}const D={isEquirectangular:!0,fullWidth:Rn(null==y?void 0:y.fullWidth,null==C?void 0:C.fullWidth),fullHeight:Rn(null==y?void 0:y.fullHeight,null==C?void 0:C.fullHeight),croppedWidth:Rn(null==y?void 0:y.croppedWidth,null==C?void 0:C.croppedWidth,o),croppedHeight:Rn(null==y?void 0:y.croppedHeight,null==C?void 0:C.croppedHeight,d),croppedX:Rn(null==y?void 0:y.croppedX,null==C?void 0:C.croppedX,0),croppedY:Rn(null==y?void 0:y.croppedY,null==C?void 0:C.croppedY,0),poseHeading:Rn(null==y?void 0:y.poseHeading,null==C?void 0:C.poseHeading,0),posePitch:Rn(null==y?void 0:y.posePitch,null==C?void 0:C.posePitch,0),poseRoll:Rn(null==y?void 0:y.poseRoll,null==C?void 0:C.poseRoll,0),initialHeading:null==C?void 0:C.initialHeading,initialPitch:null==C?void 0:C.initialPitch,initialFov:null==C?void 0:C.initialFov};return!D.fullWidth&&D.fullHeight?D.fullWidth=2*D.fullHeight:(!D.fullWidth||!D.fullHeight)&&(D.fullWidth=null!=(H=D.fullWidth)?H:o,D.fullHeight=null!=(z=D.fullHeight)?z:d),(D.croppedWidth!==o||D.croppedHeight!==d)&&nt(`Invalid panoData, croppedWidth/croppedHeight is not coherent with the loaded image.\n        panoData: ${D.croppedWidth}x${D.croppedHeight}, image: ${o}x${d}`),Math.abs(D.fullWidth-2*D.fullHeight)>1&&(nt("Invalid panoData, fullWidth should be twice fullHeight"),D.fullHeight=Math.round(D.fullWidth/2)),D.croppedX+D.croppedWidth>D.fullWidth&&(nt("Invalid panoData, croppedX + croppedWidth > fullWidth"),D.croppedX=D.fullWidth-D.croppedWidth),D.croppedY+D.croppedHeight>D.fullHeight&&(nt("Invalid panoData, croppedY + croppedHeight > fullHeight"),D.croppedY=D.fullHeight-D.croppedHeight),D.croppedX<0&&(nt("Invalid panoData, croppedX < 0"),D.croppedX=0),D.croppedY<0&&(nt("Invalid panoData, croppedY < 0"),D.croppedY=0),D}var Jn=class{constructor(o){this.easing=qs.linear,this.callbacks=[],this.resolved=!1,this.cancelled=!1,this.options=o,o?(o.easing&&(this.easing="function"==typeof o.easing?o.easing:qs[o.easing]||qs.linear),this.delayTimeout=setTimeout(()=>{this.delayTimeout=void 0,this.animationFrame=window.requestAnimationFrame(d=>this.__run(d))},o.delay||0)):this.resolved=!0}__run(o){if(this.cancelled)return;this.start||(this.start=o);const d=(o-this.start)/this.options.duration,y={};if(d<1){for(const[C,D]of Object.entries(this.options.properties))if(D){const H=D.start+(D.end-D.start)*this.easing(d);y[C]=H}
vendor: 11,290 bytes, line 1
1this.options.onTick(y,d),this.animationFrame=window.requestAnimationFrame(C=>this.__run(C))}else{for(const[C,D]of Object.entries(this.options.properties))D&&(y[C]=D.end);this.options.onTick(y,1),this.__resolve(!0),this.animationFrame=void 0}}__resolve(o){o?this.resolved=!0:this.cancelled=!0,this.callbacks.forEach(d=>d(o)),this.callbacks.length=0}then(o){return this.resolved||this.cancelled?Promise.resolve(this.resolved).then(o):new Promise(d=>{this.callbacks.push(d)}).then(o)}cancel(){!this.cancelled&&!this.resolved&&(this.__resolve(!1),this.delayTimeout&&(window.clearTimeout(this.delayTimeout),this.delayTimeout=void 0),this.animationFrame&&(window.cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0))}},gi=class{constructor(o,d){if(this.fn=o,this.mode=0,this.speed=0,this.speedMult=0,this.currentSpeed=0,this.target=0,this.__current=0,this.min=d.min,this.max=d.max,this.wrap=d.wrap,this.current=d.defaultValue,this.wrap&&0!==this.min)throw new tt("invalid config");this.fn&&this.fn(this.current)}get current(){return this.__current}set current(o){this.__current=o}setSpeed(o){this.speed=o}goto(o,d=1){this.mode=2,this.target=this.wrap?os(o,this.max):ge.M8C.clamp(o,this.min,this.max),this.speedMult=d}step(o,d=1){0===d?this.setValue(this.current+o):(2!==this.mode&&(this.target=this.current),this.goto(this.target+o,d))}roll(o=!1,d=1){this.mode=1,this.target=o?-1/0:1/0,this.speedMult=d}stop(){this.mode=0}setValue(o){return this.target=this.wrap?os(o,this.max):ge.M8C.clamp(o,this.min,this.max),this.mode=0,this.currentSpeed=0,this.target!==this.current&&(this.current=this.target,this.fn&&this.fn(this.current),!0)}update(o){if(2===this.mode){this.wrap&&Math.abs(this.target-this.current)>this.max/2&&(this.current=this.current<this.target?this.current+this.max:this.current-this.max);const C=this.currentSpeed*this.currentSpeed/(this.speed*this.speedMult*4);Math.abs(this.target-this.current)<=C&&(this.mode=0)}let d=0===this.mode?0:this.speed*this.speedMult;this.target<this.current&&(d=-d),this.currentSpeed<d?this.currentSpeed=Math.min(d,this.currentSpeed+o/1e3*this.speed*this.speedMult*2):this.currentSpeed>d&&(this.currentSpeed=Math.max(d,this.currentSpeed-o/1e3*this.speed*this.speedMult*2));let y=null;return this.current>this.target&&this.currentSpeed?y=Math.max(this.target,this.current+this.currentSpeed*o/1e3):this.current<this.target&&this.currentSpeed&&(y=Math.min(this.target,this.current+this.currentSpeed*o/1e3)),null!==y&&(y=this.wrap?os(y,this.max):ge.M8C.clamp(y,this.min,this.max),y!==this.current)&&(this.current=y,this.fn&&this.fn(this.current),!0)}},nr=class{constructor(o,d){this.fn=o,this.dynamics=d,this.fn&&this.fn(this.current)}get current(){return Object.entries(this.dynamics).reduce((o,[d,y])=>(o[d]=y.current,o),{})}setSpeed(o){for(const d of Object.values(this.dynamics))d.setSpeed(o)}goto(o,d=1){for(const[y,C]of Object.entries(o))this.dynamics[y].goto(C,d)}step(o,d=1){if(0===d)this.setValue(Object.keys(o).reduce((y,C)=>(y[C]=o[C]+this.dynamics[C].current,y),{}));else for(const[y,C]of Object.entries(o))this.dynamics[y].step(C,d)}roll(o,d=1){for(const[y,C]of Object.entries(o))this.dynamics[y].roll(C,d)}stop(){for(const o of Object.values(this.dynamics))o.stop()}setValue(o){let d=!1;for(const[y,C]of Object.entries(o))d=this.dynamics[y].setValue(C)||d;return d&&this.fn&&this.fn(this.current),d}update(o){let d=!1;for(const y of Object.values(this.dynamics))d=y.update(o)||d;return d&&this.fn&&this.fn(this.current),d}},Gn=class{constructor(o=200){this.delay=o,this.time=0,this.delay=o}get pending(){return 0!==this.time}down(o){this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0),this.time=(new Date).getTime(),this.data=o}up(o){this.time&&(Date.now()-this.time<this.delay?this.timeout=setTimeout(()=>{o(this.data),this.timeout=void 0,this.time=0,this.data=void 0},this.delay):(o(this.data),this.time=0,this.data=void 0))}},xa=(o=>(o.VERTICAL="VERTICAL",o.HORIZONTAL="HORIZONTAL",o))(xa||{}),ya=class{constructor(o,d,y){this.container=o,this.direction=d,this.listener=y,this.mousedown=!1,this.mouseover=!1,this.container.addEventListener("click",this),this.container.addEventListener("mousedown",this),this.container.addEventListener("mouseenter",this),this.container.addEventListener("mouseleave",this),this.container.addEventListener("touchstart",this),this.container.addEventListener("mousemove",this,!0),this.container.addEventListener("touchmove",this,!0),window.addEventListener("mouseup",this),window.addEventListener("touchend",this)}get isVertical(){return"VERTICAL"===this.direction}get isHorizontal(){return"HORIZONTAL"===this.direction}destroy(){window.removeEventListener("mouseup",this),window.removeEventListener("touchend",this)}handleEvent(o){switch(o.type){case"click":o.stopPropagation();break;case"mousedown":this.__onMouseDown(o);break;case"mouseenter":this.__onMouseEnter(o);break;case"mouseleave":this.__onMouseLeave(o);break;case"touchstart":this.__onTouchStart(o);break;case"mousemove":this.__onMouseMove(o);break;case"touchmove":this.__onTouchMove(o);break;case"mouseup":this.__onMouseUp(o);break;case"touchend":this.__onTouchEnd(o)}}__onMouseDown(o){this.mousedown=!0,this.__update(o.clientX,o.clientY,!0)}__onMouseEnter(o){this.mouseover=!0,this.__update(o.clientX,o.clientY,!0)}__onTouchStart(o){this.mouseover=!0,this.mousedown=!0;const d=o.changedTouches[0];this.__update(d.clientX,d.clientY,!0)}__onMouseMove(o){(this.mousedown||this.mouseover)&&(o.stopPropagation(),this.__update(o.clientX,o.clientY,!0))}__onTouchMove(o){if(this.mousedown||this.mouseover){o.stopPropagation();const d=o.changedTouches[0];this.__update(d.clientX,d.clientY,!0)}}__onMouseUp(o){this.mousedown&&(this.mousedown=!1,this.__update(o.clientX,o.clientY,!1))}__onMouseLeave(o){this.mouseover&&(this.mouseover=!1,this.__update(o.clientX,o.clientY,!0))}__onTouchEnd(o){if(this.mousedown){this.mouseover=!1,this.mousedown=!1;const d=o.changedTouches[0];this.__update(d.clientX,d.clientY,!1)}}__update(o,d,y){const C=this.container.getBoundingClientRect();let D;D=ge.M8C.clamp(this.isVertical?(C.bottom-d)/C.height:(o-C.left)/C.width,0,1),this.listener({value:D,click:!y,mousedown:this.mousedown,mouseover:this.mouseover,cursor:{clientX:o,clientY:d}})}},Ma={};ao(Ma,{BeforeAnimateEvent:()=>jn,BeforeRenderEvent:()=>Qn,BeforeRotateEvent:()=>sr,ClickEvent:()=>rr,ConfigChangedEvent:()=>Ot,DoubleClickEvent:()=>_s,FullscreenEvent:()=>_i,HideNotificationEvent:()=>xi,HideOverlayEvent:()=>cr,HidePanelEvent:()=>Pn,HideTooltipEvent:()=>dr,KeypressEvent:()=>Ln,LoadProgressEvent:()=>mr,ObjectEnterEvent:()=>ni,ObjectEvent:()=>Ta,ObjectHoverEvent:()=>Dn,ObjectLeaveEvent:()=>Un,PanoramaErrorEvent:()=>yr,PanoramaLoadEvent:()=>vr,PanoramaLoadedEvent:()=>ei,PositionUpdatedEvent:()=>yi,ReadyEvent:()=>bi,RenderEvent:()=>wo,RollUpdatedEvent:()=>Mi,ShowNotificationEvent:()=>ti,ShowOverlayEvent:()=>Er,ShowPanelEvent:()=>tn,ShowTooltipEvent:()=>Tr,SizeUpdatedEvent:()=>Ar,StopAllEvent:()=>Cr,TransitionDoneEvent:()=>xs,ViewerEvent:()=>at,ZoomUpdatedEvent:()=>Wn});var Xt=class extends Event{constructor(o,d=!1){super(o,{cancelable:d})}},ba=class extends EventTarget{dispatchEvent(o){return super.dispatchEvent(o)}addEventListener(o,d,y){super.addEventListener(o,d,y)}removeEventListener(o,d,y){super.removeEventListener(o,d,y)}},at=class extends Xt{},vi=class Af extends at{constructor(d,y){super(Af.type,!0),this.position=d,this.zoomLevel=y}};vi.type="before-animate";var jn=vi,ir=class Cf extends at{constructor(d,y){super(Cf.type),this.timestamp=d,this.elapsed=y}};ir.type="before-render";var Qn=ir,Sa=class Rf extends at{constructor(d){super(Rf.type,!0),this.position=d}};Sa.type="before-rotate";var sr=Sa,sc=class If extends at{constructor(d){super(If.type),this.data=d}};sc.type="click";var rr=sc,gs=class Pf extends at{constructor(d){super(Pf.type),this.options=d}containsOptions(...d){return d.some(y=>this.options.includes(y))}};gs.type="config-changed";var Ot=gs,vs=class Lf extends at{constructor(d){super(Lf.type),this.data=d}};vs.type="dblclick";var _s=vs,ar=class Uf extends at{constructor(d){super(Uf.type),this.fullscreenEnabled=d}};ar.type="fullscreen";var _i=ar,or=class Df extends at{constructor(d){super(Df.type),this.notificationId=d}};or.type="hide-notification";var xi=or,lr=class Nf extends at{constructor(d){super(Nf.type),this.overlayId=d}};lr.type="hide-overlay";var cr=lr,hr=class Of extends at{constructor(d){super(Of.type),this.panelId=d}};hr.type="hide-panel";var Pn=hr,ur=class Ff extends at{constructor(d){super(Ff.type),this.tooltipData=d}};ur.type="hide-tooltip";var dr=ur,fr=class Bf extends at{constructor(d,y){super(Bf.type,!0),this.key=d,this.originalEvent=y}};fr.type="key-press";var Ln=fr,pr=class zf extends at{constructor(d){super(zf.type),this.progress=d}};pr.type="load-progress";var mr=pr,gr=class kf extends at{constructor(d){super(kf.type),this.panorama=d}};gr.type="panorama-load";var vr=gr,_r=class Hf extends at{constructor(d){super(Hf.type),this.data=d}};_r.type="panorama-loaded";var ei=_r,xr=class Vf extends at{constructor(d,y){super(Vf.type),this.panorama=d,this.error=y}};xr.type="panorama-error";var yr=xr,Mr=class Gf extends at{constructor(d){super(Gf.type),this.completed=d}};Mr.type="transition-done";var xs=Mr,br=class Wf extends at{constructor(d){super(Wf.type),this.position=d}};br.type="position-updated";var yi=br,wa=class Xf extends at{constructor(d){super(Xf.type),this.roll=d}};wa.type="roll-updated";var Mi=wa,Sr=class Yf extends at{constructor(){super(Yf.type)}};Sr.type="ready";var bi=Sr,So=class qf extends at{constructor(){super(qf.type)}};So.type="render";var wo=So,Eo=class Zf extends at{constructor(d){super(Zf.type),this.notificationId=d}};Eo.type="show-notification";var ti=Eo,wr=class $f extends at{constructor(d){super($f.type),this.overlayId=d}};wr.type="show-overlay";var Er=wr,Si=class Kf extends at{constructor(d){super(Kf.type),this.panelId=d}};Si.type="show-panel";var tn=Si,ys=class Jf extends at{constructor(d,y){super(Jf.type),this.tooltip=d,this.tooltipData=y}};ys.type="show-tooltip";var Tr=ys,Ea=class jf extends at{constructor(d){super(jf.type),this.size=d}};Ea.type="size-updated";var Ar=Ea,rc=class Qf extends at{constructor(){super(Qf.type)}};rc.type="stop-all";var Cr=rc,To=class ep extends at{constructor(d){super(ep.type),this.zoomLevel=d}};To.type="zoom-updated";var Wn=To,Ta=class extends at{constructor(o,d,y,C,D){super(o),this.originalEvent=d,this.object=y,this.viewerPoint=C,this.userDataKey=D}},ac=class tp extends Ta{constructor(d,y,C,D){super(tp.type,d,y,C,D)}};ac.type="enter-object";var ni=ac,Ao=class np extends Ta{constructor(d,y,C,D){super(np.type,d,y,C,D)}};Ao.type="leave-object";var Un=Ao,un=class ip extends Ta{constructor(d,y,C,D){super(ip.type,d,y,C,D)}};un.type="hover-object";var Dn=un,Gi=class{constructor(o){this.viewer=o}init(){}destroy(){}supportsTransition(o){return!1}supportsPreload(o){return!1}textureCoordsToSphericalCoords(o,d){throw new tt("Current adapter does not support texture coordinates.")}sphericalCoordsToTextureCoords(o,d){throw new tt("Current adapter does not support texture coordinates.")}};function Ms(o){if(o)for(const[,d]of[["_",o],...Object.entries(o)])if(d.prototype instanceof Gi)return ms(d.id,d.VERSION,"5.11.5"),d;return null}Gi.supportsDownload=!1;var ii=`${Kt}
1_touchSupport`,Ze={loaded:!1,pixelRatio:1,isWebGLSupported:!1,maxTextureWidth:0,isTouchEnabled:null,__maxCanvasWidth:null,isIphone:!1,get maxCanvasWidth(){return null===this.__maxCanvasWidth&&(this.__maxCanvasWidth=function $h(o){let d=o,y=!1;const C=document.createElement("canvas"),D=C.getContext("2d");for(C.width=1,C.height=1;d>1024&&!y;){const H=document.createElement("canvas"),z=H.getContext("2d");H.width=d,H.height=d/2;try{z.fillStyle="white",z.fillRect(d-1,d/2-1,1,1),D.drawImage(H,d-1,d/2-1,1,1,0,0,1,1),D.getImageData(0,0,1,1).data[0]>0&&(y=!0)}catch(se){}H.width=0,H.height=0,y||(d/=2)}if(y)return d;throw new tt("Unable to detect system capabilities")}(this.maxTextureWidth)),this.__maxCanvasWidth},load(){if(!this.loaded){const o=function Rr(){try{return document.createElement("canvas").getContext("webgl2")}catch(o){return null}}();this.pixelRatio=window.devicePixelRatio||1,this.isWebGLSupported=!!o,this.maxTextureWidth=o?o.getParameter(o.MAX_TEXTURE_SIZE):0,this.isTouchEnabled=function Ir(){let o="ontouchstart"in window||navigator.maxTouchPoints>0;ii in localStorage&&(o="true"===localStorage[ii]);const d=new Promise(y=>{const C=()=>{window.removeEventListener("mousedown",D),window.removeEventListener("touchstart",H),clearTimeout(se)},D=()=>{C(),localStorage[ii]=!1,y(!1)},H=()=>{C(),localStorage[ii]=!0,y(!0)};window.addEventListener("mousedown",D,!1),window.addEventListener("touchstart",H,!1);const se=setTimeout(()=>{C(),localStorage[ii]=o,y(o)},1e4)});return{initial:o,promise:d}}(),this.isIphone=/iPhone/i.test(navigator.userAgent),this.loaded=!0}if(!Ze.isWebGLSupported)throw new tt("WebGL 2 is not supported.");if(0===Ze.maxTextureWidth)throw new tt("Unable to detect system capabilities")}},Wi=ps({backgroundColor:null,interpolateBackground:!1,resolution:64,useXmpData:!0,blur:!1},{resolution:o=>{if(!o||!ge.M8C.isPowerOfTwo(o))throw new tt("EquirectangularAdapter resolution must be power of two.");return o},backgroundColor:o=>(o&&nt("EquirectangularAdapter.backgroundColor is deprecated, use 'canvasBackground' main option instead."),o),interpolateBackground:o=>(o&&nt("EquirectangularAdapter.interpolateBackground is not supported anymore."),!1)}),bs=class extends Gi{constructor(o,d){super(o),this.config=Wi(d),this.SPHERE_SEGMENTS=this.config.resolution,this.SPHERE_HORIZONTAL_SEGMENTS=this.SPHERE_SEGMENTS/2,this.config.backgroundColor&&(o.config.canvasBackground=d.backgroundColor)}supportsTransition(){return!0}supportsPreload(){return!0}textureCoordsToSphericalCoords(o,d){if(Pt(o.textureX)||Pt(o.textureY))throw new tt("Texture position is missing 'textureX' or 'textureY'");const y=(o.textureX+d.croppedX)/d.fullWidth*Math.PI*2,C=(o.textureY+d.croppedY)/d.fullHeight*Math.PI;return{yaw:y>=Math.PI?y-Math.PI:y+Math.PI,pitch:Math.PI/2-C}}sphericalCoordsToTextureCoords(o,d){const y=o.yaw/Math.PI/2*d.fullWidth,C=o.pitch/Math.PI*d.fullHeight;let D=Math.round(o.yaw<Math.PI?y+d.fullWidth/2:y-d.fullWidth/2)-d.croppedX,H=Math.round(d.fullHeight/2-C)-d.croppedY;return(D<0||D>d.croppedWidth||H<0||H>d.croppedHeight)&&(D=H=void 0),{textureX:D,textureY:H}}loadTexture(o,d=!0,y,C=this.config.useXmpData){var D=this;return(0,Ys.Z)(function*(){if("string"!=typeof o&&("object"!=typeof o||!o.path))return Promise.reject(new tt("Invalid panorama url, are you using the right adapter?"));let H;H="string"==typeof o?{path:o,data:y}:gt({data:y},o);const z=yield D.viewer.textureLoader.loadFile(H.path,d?Et=>D.viewer.loader.setProgress(Et):null,H.path),se=C?yield D.loadXMP(z):null,Be=yield D.viewer.textureLoader.blobToImage(z);"function"==typeof H.data&&(H.data=H.data(Be,se));const Je=Jt(Be.width,Be.height,H.data,se),pt=D.createEquirectangularTexture(Be);return{panorama:o,texture:pt,panoData:Je,cacheKey:H.path}})()}loadXMP(o){var d=this;return(0,Ys.Z)(function*(){const y=yield d.loadBlobAsString(o),C=y.indexOf("<x:xmpmeta");if(-1===C)return null;const D=y.indexOf("</x:xmpmeta>",C);if(-1===D)return null;const H=y.substring(C,D);return H.includes("GPano:")?{fullWidth:kt(H,"FullPanoWidthPixels"),fullHeight:kt(H,"FullPanoHeightPixels"),croppedWidth:kt(H,"CroppedAreaImageWidthPixels"),croppedHeight:kt(H,"CroppedAreaImageHeightPixels"),croppedX:kt(H,"CroppedAreaLeftPixels"),croppedY:kt(H,"CroppedAreaTopPixels"),poseHeading:kt(H,"PoseHeadingDegrees",!1),posePitch:kt(H,"PosePitchDegrees",!1),poseRoll:kt(H,"PoseRollDegrees",!1),initialHeading:kt(H,"InitialViewHeadingDegrees",!1),initialPitch:kt(H,"InitialViewPitchDegrees",!1),initialFov:kt(H,"InitialHorizontalFOVDegrees",!1)}:null})()}loadBlobAsString(o){return new Promise((d,y)=>{const C=new FileReader;C.onload=()=>d(C.result),C.onerror=y,C.readAsText(o)})}createEquirectangularTexture(o){if(this.config.blur||o.width>Ze.maxTextureWidth){const d=Math.min(1,Ze.maxCanvasWidth/o.width),y=new OffscreenCanvas(Math.floor(o.width*d),Math.floor(o.height*d)),C=y.getContext("2d");return this.config.blur&&(C.filter=`blur(${y.width/2048}px)`),C.drawImage(o,0,0,y.width,y.height),bo(y)}return bo(o)}createMesh(o){const d=o.croppedX/o.fullWidth*2*Math.PI,y=o.croppedWidth/o.fullWidth*2*Math.PI,C=o.croppedY/o.fullHeight*Math.PI,D=o.croppedHeight/o.fullHeight*Math.PI,H=new ge.xo$(di,Math.round(this.SPHERE_SEGMENTS/(2*Math.PI)*y),Math.round(this.SPHERE_HORIZONTAL_SEGMENTS/Math.PI*D),-Math.PI/2+d,y,C,D).scale(-1,1,1),z=new ge.vBJ({depthTest:!1,depthWrite:!1});return new ge.Kj0(H,z)}setTexture(o,d){o.material.map=d.texture}setTextureOpacity(o,d){o.material.opacity=d,o.material.transparent=d<1}disposeTexture({texture:o}){o.dispose()}disposeMesh(o){o.geometry.dispose(),o.material.dispose()}};bs.id="equirectangular",bs.VERSION="5.11.5",bs.supportsDownload=!0;var Co=class extends bs{constructor(o,d){var y;super(o,{resolution:null!=(y=null==d?void 0:d.resolution)?y:64,useXmpData:!1})}loadTexture(o,d){var y=()=>super.loadTexture,C=this;return(0,Ys.Z)(function*(){const D=yield y().call(C,o,d,null,!1);return D.panoData=null,D})()}createMesh(){const o=new ge.xo$(di,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS).scale(-1,1,1).toNonIndexed(),d=o.getAttribute("uv"),y=o.getAttribute("normal");for(let D=0;
1D<d.count;D++)for(let H=0;H<3;H++){const z=3*D+H,se=y.getX(z),Be=y.getY(z),Je=y.getZ(z),pt=.947;if(D<d.count/6){const Et=0===se&&0===Je?1:Math.acos(Be)/Math.sqrt(se*se+Je*Je)*(2/Math.PI);d.setXY(z,se*(pt/4)*Et+1/4,Je*(pt/2)*Et+.5)}else{const Et=0===se&&0===Je?1:Math.acos(-Be)/Math.sqrt(se*se+Je*Je)*(2/Math.PI);d.setXY(z,pt/4*-se*Et+3/4,Je*(pt/2)*Et+.5)}}o.rotateX(-Math.PI/2),o.rotateY(Math.PI);const C=new ge.vBJ({depthTest:!1,depthWrite:!1});return new ge.Kj0(o,C)}};Co.id="dual-fisheye",Co.VERSION="5.11.5";var wi=class sp{constructor(d,y){var C;this.parent=d,this.children=[],this.state={visible:!0},this.viewer=d instanceof sp?d.viewer:d,this.container=document.createElement(null!=(C=y.tagName)?C:"div"),this.container.className=y.className||"",this.parent.children.push(this),this.parent.container.appendChild(this.container)}destroy(){this.parent.container.removeChild(this.container);const d=this.parent.children.indexOf(this);-1!==d&&this.parent.children.splice(d,1),this.children.slice().forEach(y=>y.destroy()),this.children.length=0}toggle(d=!this.isVisible()){d?this.show():this.hide()}hide(d){this.container.style.display="none",this.state.visible=!1}show(d){this.container.style.display="",this.state.visible=!0}isVisible(){return this.state.visible}},Kh=ps({id:null,tagName:null,className:null,title:null,hoverScale:!1,collapsable:!1,tabbable:!0,icon:null,iconActive:null}),nn=class extends wi{constructor(o,d){var y;super(o,{tagName:d.tagName,className:`psv-button ${d.hoverScale?"psv-button--hover-scale":""} ${d.className||""}`}),this.state={visible:!0,enabled:!0,supported:!0,collapsed:!1,active:!1,width:0},this.config=Kh(d),d.id||(this.config.id=this.constructor.id),d.icon&&this.__setIcon(d.icon),this.state.width=this.container.offsetWidth,this.config.title?this.container.title=null!=(y=this.viewer.config.lang[this.config.title])?y:this.config.title:this.id&&this.id in this.viewer.config.lang&&(this.container.title=this.viewer.config.lang[this.id]),d.tabbable&&(this.container.tabIndex=0),this.container.addEventListener("click",C=>{this.state.enabled&&this.onClick(),C.stopPropagation()}),this.container.addEventListener("keydown",C=>{C.key===It.Enter&&this.state.enabled&&(this.onClick(),C.stopPropagation())})}get id(){return this.config.id}get title(){return this.container.title}get content(){return this.container.innerHTML}get width(){return this.state.width}get collapsable(){return this.config.collapsable}show(o=!0){this.isVisible()||(this.state.visible=!0,this.state.collapsed||(this.container.style.display=""),o&&this.viewer.navbar.autoSize())}hide(o=!0){this.isVisible()&&(this.state.visible=!1,this.container.style.display="none",o&&this.viewer.navbar.autoSize())}checkSupported(){hs(this.isSupported(),(o,d)=>{!this.state||(this.state.supported=o,d?o||this.hide():this.toggle(o))})}autoSize(){}isSupported(){return!0}toggleActive(o=!this.state.active){o!==this.state.active&&(this.state.active=o,$s(this.container,"psv-button--active",this.state.active),this.config.iconActive&&this.__setIcon(this.state.active?this.config.iconActive:this.config.icon))}disable(){this.container.classList.add("psv-button--disabled"),this.state.enabled=!1}enable(){this.container.classList.remove("psv-button--disabled"),this.state.enabled=!0}collapse(){this.state.collapsed=!0,this.container.style.display="none"}uncollapse(){this.state.collapsed=!1,this.state.visible&&(this.container.style.display="")}__setIcon(o){this.container.innerHTML=o,ga(this.container.querySelector("svg"),"psv-button-svg")}},Jh=class extends nn{constructor(o,d){var y,C,D;super(o,{id:null!=(y=d.id)?y:`psvButton-${Math.random().toString(36).substring(2)}`,className:`psv-custom-button ${d.className||""}`,hoverScale:!1,collapsable:!1!==d.collapsable,tabbable:!1!==d.tabbable,title:d.title}),this.customOnClick=d.onClick,d.content&&("string"==typeof d.content?this.container.innerHTML=d.content:(this.container.classList.add("psv-custom-button--no-padding"),d.content.style.height="100%",null==(D=(C=d.content).attachViewer)||D.call(C,this.viewer),this.container.appendChild(d.content))),this.state.width=this.container.offsetWidth,d.disabled&&this.disable(),!1===d.visible&&this.hide()}onClick(){var o;null==(o=this.customOnClick)||o.call(this,this.viewer)}}
vendor: 2,284 bytes, line 1
1,Pr=class extends nn{constructor(o){super(o,{className:"psv-description-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:_n.info}),this.mode=0,this.viewer.addEventListener(xi.type,this),this.viewer.addEventListener(ti.type,this),this.viewer.addEventListener(Pn.type,this),this.viewer.addEventListener(tn.type,this),this.viewer.addEventListener(Ot.type,this)}destroy(){this.viewer.removeEventListener(xi.type,this),this.viewer.removeEventListener(ti.type,this),this.viewer.removeEventListener(Pn.type,this),this.viewer.removeEventListener(tn.type,this),this.viewer.removeEventListener(Ot.type,this),super.destroy()}handleEvent(o){if(o instanceof Ot)return void(o.containsOptions("description")&&this.autoSize(!0));if(!this.mode)return;let d=!1;o instanceof xi?d=1===this.mode:o instanceof ti?d=1===this.mode&&o.notificationId!==Nt.DESCRIPTION:o instanceof Pn?d=2===this.mode:o instanceof tn&&(d=2===this.mode&&o.panelId!==Nt.DESCRIPTION),d&&(this.toggleActive(!1),this.mode=0)}onClick(){this.mode?this.__close():this.__open()}hide(o){super.hide(o),this.mode&&this.__close()}autoSize(o=!1){if(o){const d=this.viewer.navbar.getButton("caption",!1),y=d&&!d.isVisible(),C=!!this.viewer.config.description;y||C?this.show(!1):this.hide(!1)}}__close(){switch(this.mode){case 1:this.viewer.notification.hide(Nt.DESCRIPTION);break;case 2:this.viewer.panel.hide(Nt.DESCRIPTION)}}__open(){this.toggleActive(!0),this.viewer.config.description?(this.mode=2,this.viewer.panel.show({id:Nt.DESCRIPTION,content:`${this.viewer.config.caption?`<p>${this.viewer.config.caption}</p>`:""}${this.viewer.config.description}`})):(this.mode=1,this.viewer.notification.show({id:Nt.DESCRIPTION,content:this.viewer.config.caption}))}};Pr.id="description";var oc=class extends nn{constructor(o){super(o,{tagName:"a",className:"psv-download-button",hoverScale:!0,collapsable:!0,tabbable:!0,icon:_n.download}),this.viewer.addEventListener(Ot.type,this),this.viewer.addEventListener(ei.type,this)}destroy(){this.viewer.removeEventListener(Ot.type,this),this.viewer.removeEventListener(ei.type,this),super.destroy()}handleEvent(o){o instanceof Ot?(o.containsOptions("downloadUrl")&&this.checkSupported(),o.containsOptions("downloadUrl","downloadName")&&this.__update()):o instanceof ei&&this.__update()}onClick(){}
1checkSupported(){this.viewer.adapter.constructor.supportsDownload||this.viewer.config.downloadUrl?this.show():this.hide()}__update(){const o=this.container;o.href=this.viewer.config.downloadUrl||this.viewer.config.panorama,o.target="_blank",o.download=o.href.startsWith("data:")&&!this.viewer.config.downloadName?"panorama."+o.href.substring(0,o.href.indexOf(";")).split("/").pop():this.viewer.config.downloadName||o.href.split("/").pop()}};oc.id="download";var lc=class extends nn{constructor(o){super(o,{className:"psv-fullscreen-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:_n.fullscreenIn,iconActive:_n.fullscreenOut}),this.viewer.addEventListener(_i.type,this)}destroy(){this.viewer.removeEventListener(_i.type,this),super.destroy()}handleEvent(o){o instanceof _i&&this.toggleActive(o.fullscreenEnabled)}onClick(){this.viewer.toggleFullscreen()}};lc.id="fullscreen";var Aa=class extends nn{constructor(o){super(o,{className:"psv-menu-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:_n.menu}),this.viewer.addEventListener(tn.type,this),this.viewer.addEventListener(Pn.type,this),super.hide()}destroy(){this.viewer.removeEventListener(tn.type,this),this.viewer.removeEventListener(Pn.type,this),super.destroy()}handleEvent(o){o instanceof tn?this.toggleActive(o.panelId===Nt.MENU):o instanceof Pn&&this.toggleActive(!1)}onClick(){this.state.active?this.__hideMenu():this.__showMenu()}hide(o){super.hide(o),this.__hideMenu()}show(o){super.show(o),this.state.active&&this.__showMenu()}__showMenu(){var o,d;this.viewer.panel.show({id:Nt.MENU,content:(o=this.viewer.navbar.collapsed,d=this.viewer.config.lang.menu,`\n<div class="psv-panel-menu psv-panel-menu--stripped">\n  <h1 class="psv-panel-menu-title">${_n.menu} ${d}</h1>\n  <ul class="psv-panel-menu-list">\n    ${o.map(y=>`\n    <li data-psv-button="${y.id}" class="psv-panel-menu-item" tabindex="0">
1\n      <span class="psv-panel-menu-item-icon">${y.content}</span>\n      <span class="psv-panel-menu-item-label">${y.title}</span>\n    </li>\n    `).join("")}\n  </ul>\n</div>\n`),noMargin:!0,clickHandler:o=>{const d=o?Ks(o,".psv-panel-menu-item"):void 0,y=d?d.dataset.psvButton:void 0;y&&(this.viewer.navbar.getButton(y).onClick(),this.__hideMenu())}})}__hideMenu(){this.viewer.panel.hide(Nt.MENU)}};function eu(o){let d=0;switch(o){case 0:d=90;break;case 1:d=-90;break;case 3:d=180;break;default:d=0}return _n.arrow.replace("rotate(0",`rotate(${d}`)}Aa.id="menu";var Xi=class extends nn{constructor(o,d){super(o,{className:"psv-move-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:eu(d)}),this.direction=d,this.handler=new Gn,this.container.addEventListener("mousedown",this),this.container.addEventListener("keydown",this),this.container.addEventListener("keyup",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this)}destroy(){this.__onMouseUp(),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(o){switch(o.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":o.key===It.Enter&&this.__onMouseDown();break;case"keyup":o.key===It.Enter&&this.__onMouseUp()}}onClick(){}isSupported(){return xn(Ze.isTouchEnabled)}__onMouseDown(){if(!this.state.enabled)return;const o={};switch(this.direction){case 0:o.pitch=!1;break;case 1:o.pitch=!0;break;case 3:o.yaw=!1;break;default:o.yaw=!0}this.viewer.stopAll(),this.viewer.dynamics.position.roll(o),this.handler.down()}__onMouseUp(){!this.state.enabled||this.handler.up(()=>{this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer()})}};Xi.groupId="move";var Ro=class extends Xi{constructor(o){super(o,1)}};Ro.id="moveDown";var Io=class extends Xi{constructor(o){super(o,2)}};Io.id="moveLeft";var Po=class extends Xi{constructor(o){super(o,3)}};Po.id="moveRight";var Ca=class extends Xi{constructor(o){super(o,0)}};Ca.id="moveUp";var Ra=class extends nn{constructor(o,d,y){super(o,{className:"psv-zoom-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:d}),this.direction=y,this.handler=new Gn,this.container.addEventListener("mousedown",this),this.container.addEventListener("keydown",this),this.container.addEventListener("keyup",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this)}destroy(){this.__onMouseUp(),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(o){switch(o.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp();break;case"keydown":o.key===It.Enter&&this.__onMouseDown();break;case"keyup":o.key===It.Enter&&this.__onMouseUp()}}onClick(){}isSupported(){return xn(Ze.isTouchEnabled)}__onMouseDown(){!this.state.enabled||(this.viewer.dynamics.zoom.roll(1===this.direction),this.handler.down())}__onMouseUp(){!this.state.enabled||this.handler.up(()=>this.viewer.dynamics.zoom.stop())}};Ra.groupId="zoom";var Lo=class extends Ra{constructor(o){super(o,_n.zoomIn,0)}};Lo.id="zoomIn";var Uo=class extends Ra{constructor(o){super(o,_n.zoomOut,1)}};Uo.id="zoomOut";var Ia=class extends nn{constructor(o){super(o,{className:"psv-zoom-range",hoverScale:!1,collapsable:!1,tabbable:!1}),this.zoomRange=document.createElement("div"),this.zoomRange.className="psv-zoom-range-line",this.container.appendChild(this.zoomRange),this.zoomValue=document.createElement("div"),this.zoomValue.className="psv-zoom-range-handle",this.zoomRange.appendChild(this.zoomValue),this.slider=new ya(this.container,"HORIZONTAL",d=>this.__onSliderUpdate(d)),this.mediaMinWidth=parseInt(cn(this.container,"max-width"),10),this.viewer.addEventListener(Wn.type,this),this.viewer.state.ready?this.__moveZoomValue(this.viewer.getZoomLevel()):this.viewer.addEventListener(bi.type,this)}destroy(){this.slider.destroy(),this.viewer.removeEventListener(Wn.type,this),this.viewer.removeEventListener(bi.type,this),super.destroy()}handleEvent(o){o instanceof Wn?this.__moveZoomValue(o.zoomLevel):o instanceof bi&&this.__moveZoomValue(this.viewer.getZoomLevel())}onClick(){}isSupported(){return xn(Ze.isTouchEnabled)}autoSize(){this.state.supported&&(this.viewer.state.size.width<=this.mediaMinWidth&&this.state.visible?this.hide(!1):this.viewer.state.size.width>this.mediaMinWidth&&!this.state.visible&&this.show(!1))}__moveZoomValue(o){this.zoomValue.style.left=o/100*this.zoomRange.offsetWidth-this.zoomValue.offsetWidth/2+"px"}
1__onSliderUpdate(o){o.mousedown&&this.viewer.zoom(100*o.value)}};Ia.id="zoomRange",Ia.groupId="zoom";var Yi=class extends ba{constructor(o){super(),this.viewer=o}init(){}destroy(){}},cc=class extends Yi{constructor(o,d){super(o),this.config=this.constructor.configParser(d)}setOption(o,d){this.setOptions({[o]:d})}setOptions(o){const d=gt(gt({},this.config),o),y=this.constructor,C=y.configParser,D=y.readonlyOptions,H=y.id;for(let[z,se]of Object.entries(o))z in C.defaults?D.includes(z)?nt(`${H}: Option "${z}" cannot be updated`):(z in C.parsers&&(se=C.parsers[z](se,{rawConfig:d,defValue:C.defaults[z]})),this.config[z]=se):nt(`${H}: Unknown option "${z}"`)}};function Do(o){if(o)for(const[,d]of[["_",o],...Object.entries(o)])if(d.prototype instanceof Yi)return ms(d.id,d.VERSION,"5.11.5"),d;return null}cc.readonlyOptions=[];var Ei={panorama:null,container:null,adapter:[bs,null],plugins:[],caption:null,description:null,downloadUrl:null,downloadName:null,loadingImg:null,loadingTxt:"",size:null,fisheye:0,minFov:30,maxFov:90,defaultZoomLvl:50,defaultYaw:0,defaultPitch:0,sphereCorrection:null,moveSpeed:1,zoomSpeed:1,moveInertia:.8,mousewheel:!0,mousemove:!0,mousewheelCtrlKey:!1,touchmoveTwoFingers:!1,panoData:null,requestHeaders:null,canvasBackground:"#000",defaultTransition:{speed:1500,rotation:!0,effect:"fade"},rendererParameters:{alpha:!0,antialias:!0},withCredentials:!1,navbar:["zoom","move","download","description","caption","fullscreen"],lang:{zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",moveUp:"Move up",moveDown:"Move down",moveLeft:"Move left",moveRight:"Move right",description:"Description",download:"Download",fullscreen:"Fullscreen",loading:"Loading...",menu:"Menu",close:"Close",twoFingers:"Use two fingers to navigate",ctrlZoom:"Use ctrl + scroll to zoom the image",loadError:"The panorama cannot be loaded",webglError:"Your browser does not seem to support WebGL"},keyboard:"fullscreen",keyboardActions:{[It.ArrowUp]:"ROTATE_UP",[It.ArrowDown]:"ROTATE_DOWN",[It.ArrowRight]:"ROTATE_RIGHT",[It.ArrowLeft]:"ROTATE_LEFT",[It.PageUp]:"ZOOM_IN",[It.PageDown]:"ZOOM_OUT",[It.Plus]:"ZOOM_IN",[It.Minus]:"ZOOM_OUT"}},hc={panorama:"Use setPanorama method to change the panorama",panoData:"Use setPanorama method to change the panorama",container:"Cannot change viewer container",adapter:"Cannot change adapter",plugins:"Cannot change plugins"},No={container:o=>{if(!o)throw new tt("No value given for container.");return o},adapter:(o,{defValue:d})=>{if(!(o=o?Array.isArray(o)?[Ms(o[0]),o[1]]:[Ms(o),null]:d)[0])throw new tt("An undefined value was given for adapter.");if(!o[0].id)throw new tt("Adapter has no id.");return"little-planet"===o[0].id&&(nt("LittlePlanetAdapter support has been removed, use `{ fisheye: 2, maxFov: 130 }` to achieve similar effect."),o=d),o},defaultYaw:o=>At(o),defaultPitch:o=>At(o,!0),defaultZoomLvl:o=>ge.M8C.clamp(o,0,100),minFov:(o,{rawConfig:d})=>(d.maxFov<o&&(nt("maxFov cannot be lower than minFov"),o=d.maxFov),ge.M8C.clamp(o,1,179)),maxFov:(o,{rawConfig:d})=>(o<d.minFov&&(o=d.minFov),ge.M8C.clamp(o,1,179)),moveInertia:(o,{defValue:d})=>!0===o?d:!1===o?0:o,lang:o=>gt(gt({},Ei.lang),o),keyboard:o=>!!o&&("object"==typeof o?(nt("Use keyboardActions to configure the keyboard actions, keyboard option must be either true, false, 'fullscreen' or 'always'"),"fullscreen"):"always"===o?"always":"fullscreen"),keyboardActions:(o,{rawConfig:d})=>d.keyboard&&"object"==typeof d.keyboard?d.keyboard:o,fisheye:o=>!0===o?1:!1===o?0:o,requestHeaders:o=>o&&"object"==typeof o?()=>o:"function"==typeof o?o:null,defaultTransition:(o,{defValue:d})=>null===o||0===o.speed?null:gt(gt({},d),o),rendererParameters:(o,{defValue:d})=>gt(gt({},o),d),plugins:o=>o.map((d,y)=>{if(!(d=Array.isArray(d)?[Do(d[0]),d[1]]:[Do(d),null])[0])throw new tt(`An undefined value was given for plugin ${y}.`);if(!d[0].id)throw new tt(`Plugin ${y} has no id.`);return d}),navbar:o=>!1===o?null:!0===o?er(Ei.navbar):"string"==typeof o?o.split(/[ ,]/):o},tu=ps(Ei,No),Ss=class extends nn{constructor(o){super(o,{className:"psv-caption",hoverScale:!1,collapsable:!1,tabbable:!0}),this.contentWidth=0,this.state.width=0,this.contentElt=document.createElement("div"),this.contentElt.className="psv-caption-content",this.container.appendChild(this.contentElt),this.setCaption(this.viewer.config.caption)}hide(){this.contentElt.style.display="none",this.state.visible=!1}show(){this.contentElt.style.display="",this.state.visible=!0}onClick(){}setCaption(o){this.show(),this.contentElt.innerHTML=null!=o?o:"",this.contentWidth=this.contentElt.innerHTML?this.contentElt.offsetWidth:0,this.autoSize()}autoSize(){this.toggle(this.container.offsetWidth>=this.contentWidth),this.__refreshButton()}__refreshButton(){var o;null==(o=this.viewer.navbar.getButton(Pr.id,!1))||o.autoSize(!0)}};Ss.id="caption";var Oo={},Pa={};
vendor: 16,345 bytes, line 1
1function La(o,d){if(!o.id)throw new tt("Button id is required");if(Oo[o.id]=o,o.groupId&&(Pa[o.groupId]=Pa[o.groupId]||[]).push(o),d){const y=Ei.navbar;switch(d){case"start":y.unshift(o.id);break;case"end":y.push(o.id);break;default:{const[C,D]=d.split(":"),H=y.indexOf(C);if(!C||!D||-1===H)throw new tt(`Invalid defaultPosition ${d}`);y.splice(H+("right"===D?1:0),0,o.id)}}}}[Uo,Ia,Lo,Pr,Ss,oc,lc,Io,Po,Ca,Ro].forEach(o=>La(o));var Xn=class extends wi{constructor(o){super(o,{className:`psv-navbar ${as}`}),this.collapsed=[],this.state.visible=!1}show(){this.viewer.container.classList.add("psv--has-navbar"),this.container.classList.add("psv-navbar--open"),this.state.visible=!0}hide(){this.viewer.container.classList.remove("psv--has-navbar"),this.container.classList.remove("psv-navbar--open"),this.state.visible=!1}setButtons(o){this.children.slice().forEach(d=>d.destroy()),this.children.length=0,-1!==o.indexOf(Ss.id)&&-1===o.indexOf(Pr.id)&&o.splice(o.indexOf(Ss.id),0,Pr.id),o.forEach(d=>{"object"==typeof d?new Jh(this,d):Oo[d]?new Oo[d](this):Pa[d]?Pa[d].forEach(y=>{new y(this)}):nt(`Unknown button ${d}`)}),new Aa(this),this.children.forEach(d=>{d instanceof nn&&d.checkSupported()}),this.autoSize()}setCaption(o){this.children.some(d=>d instanceof Ss&&(d.setCaption(o),!0))}getButton(o,d=!0){const y=this.children.find(C=>C instanceof nn&&C.id===o);return!y&&d&&nt(`button "${o}" not found in the navbar`),y}autoSize(){var C;this.children.forEach(D=>{D instanceof nn&&D.autoSize()});const o=this.container.offsetWidth;let d=0;const y=[];this.children.forEach(D=>{D.isVisible()&&D instanceof nn&&(d+=D.width,D.collapsable&&y.push(D))}),0!==d&&(o<d&&y.length>0?(y.forEach(D=>D.collapse()),this.collapsed=y,this.getButton(Aa.id).show(!1)):o>=d&&this.collapsed.length>0&&(this.collapsed.forEach(D=>D.uncollapse()),this.collapsed=[],this.getButton(Aa.id).hide(!1)),null==(C=this.getButton(Ss.id,!1))||C.autoSize())}};ge.CtF.enabled=!1;var Nn={enabled:!0,maxItems:10,ttl:600,items:{},purgeInterval:null,init(){ge.CtF.enabled&&(nt("ThreeJS cache should be disabled"),ge.CtF.enabled=!1),!this.purgeInterval&&this.enabled&&(this.purgeInterval=setInterval(()=>this.purge(),6e4))},add(o,d,y){var C;this.enabled&&d&&(this.items[d]=null!=(C=this.items[d])?C:{files:{},lastAccess:null},this.items[d].files[o]=y,this.items[d].lastAccess=Date.now())},get(o,d){if(this.enabled&&d&&this.items[d])return this.items[d].lastAccess=Date.now(),this.items[d].files[o]},remove(o,d){this.enabled&&d&&this.items[d]&&(delete this.items[d].files[o],0===Object.keys(this.items[d].files).length&&delete this.items[d])},purge(){Object.entries(this.items).sort(([,o],[,d])=>d.lastAccess-o.lastAccess).forEach(([o,{lastAccess:d}],y)=>{y>0&&(Date.now()-d>=1e3*this.ttl||y>=this.maxItems)&&delete this.items[o]})}},qi=class extends wi{constructor(o){super(o,{className:"psv-loader-container"}),this.loader=document.createElement("div"),this.loader.className="psv-loader",this.container.appendChild(this.loader),this.size=this.loader.offsetWidth,this.canvas=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.canvas.setAttribute("class","psv-loader-canvas"),this.canvas.setAttribute("viewBox",`0 0 ${this.size} ${this.size}`),this.loader.appendChild(this.canvas),this.textColor=cn(this.loader,"color"),this.color=cn(this.canvas,"color"),this.border=parseInt(cn(this.loader,"--psv-loader-border"),10),this.thickness=parseInt(cn(this.loader,"--psv-loader-tickness"),10);const d=this.size/2;this.canvas.innerHTML=`\n            <circle cx="${d}" cy="${d}" r="${d}" fill="${this.color}"/>\n            <path d="" fill="none" stroke="${this.textColor}" stroke-width="${this.thickness}" stroke-linecap="round"/>\n        `,this.viewer.addEventListener(Ot.type,this),this.__updateContent(),this.hide()}destroy(){this.viewer.removeEventListener(Ot.type,this),super.destroy()}handleEvent(o){o instanceof Ot&&o.containsOptions("loadingImg","loadingTxt","lang")&&this.__updateContent()}setProgress(o){const d=ge.M8C.clamp(o,0,99.999)/100*Math.PI*2,y=this.size/2,C=y,D=this.thickness/2+this.border,H=(this.size-this.thickness)/2-this.border,z=Math.sin(d)*H+y,se=-Math.cos(d)*H+y,Be=o>50?"1":"0";this.canvas.querySelector("path").setAttributeNS(null,"d",`M ${C} ${D} A ${H} ${H} 0 ${Be} 1 ${z} ${se}`),this.viewer.dispatchEvent(new mr(Math.round(o)))}__updateContent(){const o=this.loader.querySelector(".psv-loader-image, .psv-loader-text");let d;if(o&&this.loader.removeChild(o),this.viewer.config.loadingImg?(d=document.createElement("img"),d.className="psv-loader-image",d.src=this.viewer.config.loadingImg):null!==this.viewer.config.loadingTxt&&(d=document.createElement("div"),d.className="psv-loader-text",d.innerHTML=this.viewer.config.loadingTxt||this.viewer.config.lang.loading),d){const y=Math.round(Math.sqrt(2*Math.pow(this.size/2-this.thickness/2-this.border,2)));d.style.maxWidth=y+"px",d.style.maxHeight=y+"px",this.loader.appendChild(d)}}},Ht=class extends wi{constructor(o){super(o,{className:"psv-notification"}),this.state={visible:!1,contentId:null,timeout:null},this.content=document.createElement("div"),this.content.className="psv-notification-content",this.container.appendChild(this.content),this.content.addEventListener("click",()=>this.hide())}isVisible(o){return this.state.visible&&(!o||!this.state.contentId||this.state.contentId===o)}toggle(){throw new tt("Notification cannot be toggled")}show(o){this.state.timeout&&(clearTimeout(this.state.timeout),this.state.timeout=null),"string"==typeof o&&(o={content:o}),this.state.contentId=o.id||null,this.content.innerHTML=o.content,this.container.classList.add("psv-notification--visible"),this.state.visible=!0,this.viewer.dispatchEvent(new ti(this.state.contentId)),o.timeout&&(this.state.timeout=setTimeout(()=>this.hide(this.state.contentId),o.timeout))}hide(o){if(this.isVisible(o)){const d=this.state.contentId;this.container.classList.remove("psv-notification--visible"),this.state.visible=!1,this.state.contentId=null,this.viewer.dispatchEvent(new xi(d))}}},Fo=class extends wi{constructor(o){super(o,{className:`psv-overlay ${as}`}),this.state={visible:!1,contentId:null,dismissible:!0},this.image=document.createElement("div"),this.image.className="psv-overlay-image",this.container.appendChild(this.image),this.title=document.createElement("div"),this.title.className="psv-overlay-title",this.container.appendChild(this.title),this.text=document.createElement("div"),this.text.className="psv-overlay-text",this.container.appendChild(this.text),this.container.addEventListener("click",this),this.viewer.addEventListener(Ln.type,this),super.hide()}destroy(){this.viewer.removeEventListener(Ln.type,this),super.destroy()}handleEvent(o){"click"===o.type?this.isVisible()&&this.state.dismissible&&(this.hide(),o.stopPropagation()):o instanceof Ln&&this.isVisible()&&this.state.dismissible&&o.key===It.Escape&&(this.hide(),o.preventDefault())}isVisible(o){return this.state.visible&&(!o||!this.state.contentId||this.state.contentId===o)}toggle(){throw new tt("Overlay cannot be toggled")}show(o){"string"==typeof o&&(o={title:o}),"dissmisable"in o&&(nt('Replace "dissmisable" by "dismissible"'),o.dismissible=o.dissmisable),this.state.contentId=o.id||null,this.state.dismissible=!1!==o.dismissible,this.image.innerHTML=o.image||"",this.title.innerHTML=o.title||"",this.text.innerHTML=o.text||"",super.show(),this.viewer.dispatchEvent(new Er(this.state.contentId))}hide(o){if(this.isVisible(o)){const d=this.state.contentId;super.hide(),this.state.contentId=null,this.viewer.dispatchEvent(new cr(d))}}},si="psv-panel-content--no-interaction",sn=class extends wi{constructor(o){super(o,{className:`psv-panel ${as}`}),this.state={visible:!1,contentId:null,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}};const d=document.createElement("div");d.className="psv-panel-resizer",this.container.appendChild(d);const y=document.createElement("div");y.className="psv-panel-close-button",y.innerHTML=_n.close,y.title=o.config.lang.close,this.container.appendChild(y),this.content=document.createElement("div"),this.content.className="psv-panel-content",this.container.appendChild(this.content),y.addEventListener("click",()=>this.hide()),d.addEventListener("mousedown",this),d.addEventListener("touchstart",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this),this.viewer.container.addEventListener("mousemove",this),this.viewer.container.addEventListener("touchmove",this),this.viewer.addEventListener(Ln.type,this)}destroy(){this.viewer.removeEventListener(Ln.type,this),this.viewer.container.removeEventListener("mousemove",this),this.viewer.container.removeEventListener("touchmove",this),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(o){switch(o.type){case"mousedown":this.__onMouseDown(o);break;case"touchstart":this.__onTouchStart(o);break;case"mousemove":this.__onMouseMove(o);break;case"touchmove":this.__onTouchMove(o);break;case"mouseup":this.__onMouseUp(o);break;case"touchend":this.__onTouchEnd(o);break;case Ln.type:this.__onKeyPress(o)}}isVisible(o){return this.state.visible&&(!o||!this.state.contentId||this.state.contentId===o)}toggle(){throw new tt("Panel cannot be toggled")}show(o){"string"==typeof o&&(o={content:o});const d=this.isVisible(o.id);this.state.contentId=o.id||null,this.state.visible=!0,this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),this.container.style.width=o.id&&this.state.width[o.id]?this.state.width[o.id]:o.width?o.width:null,this.content.innerHTML=o.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),$s(this.content,"psv-panel-content--no-margin",!0===o.noMargin),o.clickHandler&&(this.state.clickHandler=y=>{o.clickHandler(ki(y))},this.state.keyHandler=y=>{y.key===It.Enter&&o.clickHandler(ki(y))},this.content.addEventListener("click",this.state.clickHandler),this.content.addEventListener("keydown",this.state.keyHandler),d||setTimeout(()=>{var y;null==(y=this.content.querySelector("a,button,[tabindex]"))||y.focus()},300)),this.viewer.dispatchEvent(new tn(this.state.contentId))}hide(o){if(this.isVisible(o)){const d=this.state.contentId;this.state.visible=!1,this.state.contentId=null,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),this.viewer.dispatchEvent(new Pn(d))}}__onMouseDown(o){o.stopPropagation(),this.__startResize(o.clientX,o.clientY)}__onTouchStart(o){if(o.stopPropagation(),1===o.touches.length){const d=o.touches[0];this.__startResize(d.clientX,d.clientY)}}__onMouseUp(o){this.state.mousedown&&(o.stopPropagation(),this.state.mousedown=!1,this.content.classList.remove(si))}__onTouchEnd(o){this.state.mousedown&&(o.stopPropagation(),0===o.touches.length&&(this.state.mousedown=!1,this.content.classList.remove(si)))}__onMouseMove(o){this.state.mousedown&&(o.stopPropagation(),this.__resize(o.clientX,o.clientY))}__onTouchMove(o){if(this.state.mousedown){const d=o.touches[0];this.__resize(d.clientX,d.clientY)}}__onKeyPress(o){this.isVisible()&&o.key===It.Escape&&(this.hide(),o.preventDefault())}__startResize(o,d){this.state.mouseX=o,this.state.mouseY=d,this.state.mousedown=!0,this.content.classList.add(si)}__resize(o,d){const y=o,C=d,D=Math.max(200,this.container.offsetWidth-(y-this.state.mouseX))+"px";this.state.contentId&&(this.state.width[this.state.contentId]=D),this.container.style.width=D,this.state.mouseX=y,this.state.mouseY=C}},yt=class extends wi{constructor(o,d){super(o,{className:"psv-tooltip"}),this.state={visible:!0,arrow:0,border:0,state:0,width:0,height:0,pos:"",config:null,data:null,hideTimeout:null},this.content=document.createElement("div"),this.content.className="psv-tooltip-content",this.container.appendChild(this.content),this.arrow=document.createElement("div"),this.arrow.className="psv-tooltip-arrow",this.container.appendChild(this.arrow),this.container.addEventListener("transitionend",this),this.container.addEventListener("touchdown",y=>y.stopPropagation()),this.container.addEventListener("mousedown",y=>y.stopPropagation()),this.container.style.top="-1000px",this.container.style.left="-1000px",this.show(d)}handleEvent(o){"transitionend"===o.type&&this.__onTransitionEnd(o)}destroy(){clearTimeout(this.state.hideTimeout),delete this.state.data,super.destroy()}toggle(){throw new tt("Tooltip cannot be toggled")}show(o){if(0!==this.state.state)throw new tt("Initialized tooltip cannot be re-initialized");o.className&&ga(this.container,o.className),o.style&&Object.assign(this.container.style,o.style),this.state.state=3,this.update(o.content,o),this.state.data=o.data,this.state.state=1,this.viewer.dispatchEvent(new Tr(this,this.state.data)),this.__waitImages()}update(o,d){this.content.innerHTML=o;const y=this.container.getBoundingClientRect();this.state.width=y.right-y.left,this.state.height=y.bottom-y.top,this.state.arrow=parseInt(cn(this.arrow,"border-top-width"),10),this.state.border=parseInt(cn(this.container,"border-top-left-radius"),10),this.move(null!=d?d:this.state.config),this.__waitImages()}move(o){var se,Be,Je;if(1!==this.state.state&&3!==this.state.state)throw new tt("Uninitialized tooltip cannot be moved");o.box=null!=(Je=null!=(Be=o.box)?Be:null==(se=this.state.config)?void 0:se.box)?Je:{width:0,height:0},this.state.config=o;const d=this.container,y=this.arrow,C={posClass:ic(o.position,{allowCenter:!1,cssOrder:!1})||["top","center"],width:this.state.width,height:this.state.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(C,o);let D=null,H=null;if(C.top<0?D="bottom":C.top+C.height>this.viewer.state.size.height&&(D="top"),C.left<0?H="right":C.left+C.width>this.viewer.state.size.width&&(H="left"),H||D){const pt=xt(C.posClass);D&&(C.posClass[pt?0:1]=D),H&&(C.posClass[pt?1:0]=H),this.__computeTooltipPosition(C,o)}d.style.top=C.top+"px",d.style.left=C.left+"px",y.style.top=C.arrowTop+"px",y.style.left=C.arrowLeft+"px";const z=C.posClass.join("-");z!==this.state.pos&&(d.classList.remove(`psv-tooltip--${this.state.pos}`),this.state.pos=z,d.classList.add(`psv-tooltip--${this.state.pos}`))}hide(){this.container.classList.remove("psv-tooltip--visible"),this.state.state=2,this.viewer.dispatchEvent(new dr(this.state.data));const o=parseFloat(cn(this.container,"transition-duration"));this.state.hideTimeout=setTimeout(()=>{this.destroy()},2*o)}__onTransitionEnd(o){if("transform"===o.propertyName)switch(this.state.state){case 1:this.container.classList.add("psv-tooltip--visible"),this.state.state=3;break;case 2:this.state.state=0,this.destroy()}}__computeTooltipPosition(o,d){const y=this.state.arrow,C=d.top,D=o.height,H=d.left,z=o.width,se=y+this.state.border,Be=d.box.width/2+2*y,Je=d.box.height/2+2*y;switch(o.posClass.join("-")){case"top-left":o.top=C-Je-D,o.left=H+se-z,o.arrowTop=D,o.arrowLeft=z-se-y;break;case"top-center":o.top=C-Je-D,o.left=H-z/2,o.arrowTop=D,o.arrowLeft=z/2-y;break;case"top-right":o.top=C-Je-D,o.left=H-se,o.arrowTop=D,o.arrowLeft=y;break;case"bottom-left":o.top=C+Je,o.left=H+se-z,o.arrowTop=2*-y,o.arrowLeft=z-se-y;break;case"bottom-center":o.top=C+Je,o.left=H-z/2,o.arrowTop=2*-y,o.arrowLeft=z/2-y;break;case"bottom-right":o.top=C+Je,o.left=H-se,o.arrowTop=2*-y,o.arrowLeft=y;break;case"left-top":o.top=C+se-D,o.left=H-Be-z,o.arrowTop=D-se-y,o.arrowLeft=z;break;case"center-left":o.top=C-D/2,o.left=H-Be-z,o.arrowTop=D/2-y,o.arrowLeft=z;break;case"left-bottom":o.top=C-se,o.left=H-Be-z,o.arrowTop=y,o.arrowLeft=z;break;case"right-top":o.top=C+se-D,o.left=H+Be,o.arrowTop=D-se-y,o.arrowLeft=2*-y;break;case"center-right":o.top=C-D/2,o.left=H+Be,o.arrowTop=D/2-y,o.arrowLeft=2*-y;break;case"right-bottom":o.top=C-se,o.left=H+Be,o.arrowTop=y,o.arrowLeft=2*-y}}__waitImages(){const o=this.content.querySelectorAll("img");if(o.length>0){const d=[];o.forEach(y=>{y.complete||d.push(new Promise(C=>{y.onload=C,y.onerror=C}))}),d.length&&Promise.all(d).then(()=>
1{if(1===this.state.state||3===this.state.state){const y=this.container.getBoundingClientRect();this.state.width=y.right-y.left,this.state.height=y.bottom-y.top,this.move(this.state.config)}})}}},ws=class{constructor(o){this.viewer=o,this.config=o.config,this.state=o.state}destroy(){}},Mn=new ge.Pa4,ri=new ge.USm(0,0,0,"ZXY"),uc=class extends ws{constructor(o){super(o)}fovToZoomLevel(o){const d=Math.round((o-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return ge.M8C.clamp(d-2*(d-50),0,100)}zoomLevelToFov(o){return this.config.maxFov+o/100*(this.config.minFov-this.config.maxFov)}vFovToHFov(o){return ge.M8C.radToDeg(2*Math.atan(Math.tan(ge.M8C.degToRad(o)/2)*this.state.aspect))}hFovToVFov(o){return ge.M8C.radToDeg(2*Math.atan(Math.tan(ge.M8C.degToRad(o)/2)/this.state.aspect))}getAnimationProperties(o,d,y){const C=!Pt(d),D=!Pt(y),H={};let z=null;if(C){const se=this.viewer.getPosition(),Be=po(se.yaw,d.yaw);H.yaw={start:se.yaw,end:se.yaw+Be},H.pitch={start:se.pitch,end:d.pitch},z=Mo(o,mo(se,d))}if(D){const se=this.viewer.getZoomLevel(),Be=Math.abs(y-se);H.zoom={start:se,end:y},null===z&&(z=Mo(o,Math.PI/4*Be/100))}return z=null===z?"number"==typeof o?o:vn:Math.max(vn,z),{duration:z,properties:H}}getTransitionOptions(o){var C;let d;const y=null!=(C=this.config.defaultTransition)?C:Ei.defaultTransition;return!1===o.transition||null===o.transition?d=null:!0===o.transition?d=gt({},y):"fade-only"===o.transition?(nt('PanoramaOptions transition "fade-only" value is deprecated, set transition.rotation=false instead.'),d=ua(gt({},y),{rotation:!1})):d="object"==typeof o.transition?gt(gt({},y),o.transition):this.config.defaultTransition,"speed"in o&&(nt("PanoramaOptions speed is deprecated, set transition.speed instead."),d&&(d.speed=o.speed)),d}textureCoordsToSphericalCoords(o){var y;if(!(null==(y=this.state.textureData)?void 0:y.panoData))throw new tt("Current adapter does not support texture coordinates or no texture has been loaded");const d=this.viewer.adapter.textureCoordsToSphericalCoords(o,this.state.textureData.panoData);return ri.equals(this.viewer.renderer.panoramaPose)&&ri.equals(this.viewer.renderer.sphereCorrection)?d:(this.sphericalCoordsToVector3(d,Mn),Mn.applyEuler(this.viewer.renderer.panoramaPose),Mn.applyEuler(this.viewer.renderer.sphereCorrection),this.vector3ToSphericalCoords(Mn))}sphericalCoordsToTextureCoords(o){var d;if(!(null==(d=this.state.textureData)?void 0:d.panoData))throw new tt("Current adapter does not support texture coordinates or no texture has been loaded");return(!ri.equals(this.viewer.renderer.panoramaPose)||!ri.equals(this.viewer.renderer.sphereCorrection))&&(this.sphericalCoordsToVector3(o,Mn),tr(Mn,this.viewer.renderer.sphereCorrection),tr(Mn,this.viewer.renderer.panoramaPose),o=this.vector3ToSphericalCoords(Mn)),this.viewer.adapter.sphericalCoordsToTextureCoords(o,this.state.textureData.panoData)}sphericalCoordsToVector3(o,d,y=di){return d||(d=new ge.Pa4),d.x=y*-Math.cos(o.pitch)*Math.sin(o.yaw),d.y=y*Math.sin(o.pitch),d.z=y*Math.cos(o.pitch)*Math.cos(o.yaw),d}vector3ToSphericalCoords(o){const d=Math.acos(o.y/Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z)),y=Math.atan2(o.x,o.z);return{yaw:y<0?-y:2*Math.PI-y,pitch:Math.PI/2-d}}viewerCoordsToVector3(o){const d=this.viewer.renderer.getIntersections(o).filter(y=>y.object.userData[Kt]);return d.length?d[0].point:null}viewerCoordsToSphericalCoords(o){const d=this.viewerCoordsToVector3(o);return d?this.vector3ToSphericalCoords(d):null}vector3ToViewerCoords(o){const d=o.clone();return d.project(this.viewer.renderer.camera),{x:Math.round((d.x+1)/2*this.state.size.width),y:Math.round((1-d.y)/2*this.state.size.height)}}sphericalCoordsToViewerCoords(o){return this.sphericalCoordsToVector3(o,Mn),this.vector3ToViewerCoords(Mn)}isPointVisible(o){let d,y;if(o instanceof ge.Pa4)d=o,y=this.vector3ToViewerCoords(o);else{if(!pi(o))return!1;d=this.sphericalCoordsToVector3(o,Mn),y=this.vector3ToViewerCoords(d)}return d.dot(this.viewer.state.direction)>0&&y.x>=0&&y.x<=this.viewer.state.size.width&&y.y>=0&&y.y<=this.viewer.state.size.height}
1cleanPosition(o){if("yaw"in o||"pitch"in o){if(!("yaw"in o)||!("pitch"in o))throw new tt("Position is missing 'yaw' or 'pitch'");return{yaw:At(o.yaw),pitch:At(o.pitch,!0)}}return this.textureCoordsToSphericalCoords(o)}cleanSphereCorrection(o){return{pan:At((null==o?void 0:o.pan)||0),tilt:At((null==o?void 0:o.tilt)||0,!0),roll:At((null==o?void 0:o.roll)||0,!0,!1)}}cleanPanoramaPose(o){return{pan:ge.M8C.degToRad((null==o?void 0:o.poseHeading)||0),tilt:ge.M8C.degToRad((null==o?void 0:o.posePitch)||0),roll:ge.M8C.degToRad((null==o?void 0:o.poseRoll)||0)}}cleanPanoramaOptions(o,d){return(null==d?void 0:d.isEquirectangular)&&(Pt(o.zoom)&&!Pt(d.initialFov)&&(o=ua(gt({},o),{zoom:this.fovToZoomLevel(this.hFovToVFov(d.initialFov))})),Pt(o.position)&&!Pt(d.initialHeading)&&!Pt(d.initialPitch)&&(o=ua(gt({},o),{position:{yaw:At(d.initialHeading),pitch:At(d.initialPitch,!0)}}))),o}},Lr=class rp{constructor(){this.$=rp.IDLE}is(...d){return d.some(y=>this.$&y)}set(d){this.$=d}add(d){this.$|=d}remove(d){this.$&=~d}};Lr.IDLE=0,Lr.CLICK=1,Lr.MOVING=2;var wt=Lr,pc=class extends ws{constructor(o){super(o),this.data={startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,pinchDist:0,moveDelta:{yaw:0,pitch:0,zoom:0},accumulatorFactor:0,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},this.step=new wt,this.keyHandler=new Gn,this.resizeObserver=new ResizeObserver(Cn(()=>this.viewer.autoSize(),50)),this.moveThreshold=kn*Ze.pixelRatio}init(){window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.viewer.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.viewer.container.addEventListener("wheel",this,{passive:!1}),document.addEventListener("fullscreenchange",this),this.resizeObserver.observe(this.viewer.container),this.viewer.addEventListener(Qn.type,this),this.viewer.addEventListener(Cr.type,this)}destroy(){window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.viewer.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.viewer.container.removeEventListener("wheel",this),document.removeEventListener("fullscreenchange",this),this.resizeObserver.disconnect(),this.viewer.removeEventListener(Qn.type,this),this.viewer.removeEventListener(Cr.type,this),clearTimeout(this.data.dblclickTimeout),clearTimeout(this.data.longtouchTimeout),clearTimeout(this.data.twofingersTimeout),clearTimeout(this.data.ctrlZoomTimeout),super.destroy()}handleEvent(o){switch(o.type){case"keydown":this.__onKeyDown(o);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(o);break;case"mouseup":this.__onMouseUp(o);break;case"touchmove":this.__onTouchMove(o);break;case"touchend":this.__onTouchEnd(o);break;case"fullscreenchange":this.__onFullscreenChange();break;case Qn.type:this.__applyMoveDelta();break;case Cr.type:this.__clearMoveDelta()}if(!Js(o,"."+as))switch(o.type){case"mousedown":this.__onMouseDown(o);break;case"touchstart":this.__onTouchStart(o);break;case"wheel":this.__onMouseWheel(o)}}__onKeyDown(o){var y;if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=o.key===It.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Nt.CTRL_ZOOM))),!this.viewer.dispatchEvent(new Ln(o.key,o))||!this.state.keyboardEnabled)return;const d=null==(y=this.config.keyboardActions)?void 0:y[o.key];if("function"==typeof d)return d(this.viewer,o),void o.preventDefault();if(!(o.ctrlKey||o.altKey||o.shiftKey||o.metaKey)&&d&&!this.keyHandler.pending){switch("ZOOM_IN"!==d&&"ZOOM_OUT"!==d&&this.viewer.stopAll(),d){case"ROTATE_UP":this.viewer.dynamics.position.roll({pitch:!1});break;case"ROTATE_DOWN":this.viewer.dynamics.position.roll({pitch:!0});break;case"ROTATE_RIGHT":this.viewer.dynamics.position.roll({yaw:!1});break;case"ROTATE_LEFT":this.viewer.dynamics.position.roll({yaw:!0});break;case"ZOOM_IN":this.viewer.dynamics.zoom.roll(!1);break;case"ZOOM_OUT":this.viewer.dynamics.zoom.roll(!0)}this.keyHandler.down(d),o.preventDefault()}}__onKeyUp(){this.data.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.keyHandler.up(o=>{"ZOOM_IN"===o||"ZOOM_OUT"===o?this.viewer.dynamics.zoom.stop():(this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer())})}__onMouseDown(o){this.step.add(wt.CLICK),this.data.startMouseX=o.clientX,this.data.startMouseY=o.clientY}__onMouseUp(o){this.step.is(wt.CLICK,wt.MOVING)&&this.__stopMove(o.clientX,o.clientY,o,2===o.button)}__onMouseMove(o){this.config.mousemove&&this.step.is(wt.CLICK,wt.MOVING)&&(o.preventDefault(),this.__doMove(o.clientX,o.clientY)),this.__handleObjectsEvents(o)}__onTouchStart(o){1===o.touches.length?(this.step.add(wt.CLICK),this.data.startMouseX=o.touches[0].clientX,this.data.startMouseY=o.touches[0].clientY,this.data.longtouchTimeout||(this.data.longtouchTimeout=setTimeout(()=>{const d=o.touches[0];this.__stopMove(d.clientX,d.clientY,o,!0),this.data.longtouchTimeout=null},da))):2===o.touches.length&&(this.step.set(wt.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(o),o.preventDefault()))}__onTouchEnd(o){if(this.__cancelLongTouch(),this.step.is(wt.CLICK,wt.MOVING))if(o.preventDefault(),this.__cancelTwoFingersOverlay(),1===o.touches.length)this.__stopMove(this.data.mouseX,this.data.mouseY);else if(0===o.touches.length){const d=o.changedTouches[0];this.__stopMove(d.clientX,d.clientY,o)}}__onTouchMove(o){if(this.__cancelLongTouch(),this.config.mousemove)if(1===o.touches.length){if(this.config.touchmoveTwoFingers)this.step.is(wt.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Nt.TWO_FINGERS,image:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
1<path fill="currentColor" d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z"/>\x3c!--Created by AomAm from the Noun Project--\x3e</svg>\n',title:this.config.lang.twoFingers})},fa));else if(this.step.is(wt.CLICK,wt.MOVING)){o.preventDefault();const d=o.touches[0];this.__doMove(d.clientX,d.clientY)}}else this.__doMoveZoom(o),this.__cancelTwoFingersOverlay()}__cancelLongTouch(){this.data.longtouchTimeout&&(clearTimeout(this.data.longtouchTimeout),this.data.longtouchTimeout=null)}__cancelTwoFingersOverlay(){this.config.touchmoveTwoFingers&&(this.data.twofingersTimeout&&(clearTimeout(this.data.twofingersTimeout),this.data.twofingersTimeout=null),this.viewer.overlay.hide(Nt.TWO_FINGERS))}__onMouseWheel(o){if(!this.config.mousewheel||!o.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown)return this.viewer.overlay.show({id:Nt.CTRL_ZOOM,image:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 17 79 79"><path fill="currentColor" d="M38.1 29.27c-.24 0-.44.2-.44.45v10.7a.45.45 0 00.9 0v-10.7c0-.25-.2-.45-.45-.45zm10.2 26.66a11.54 11.54 0 01-8.48-6.14.45.45 0 10-.8.41 12.45 12.45 0 009.22 6.62.45.45 0 00.07-.9zm24.55-13.08a23.04 23.04 0 00-22.56-23v7.07l-.01.05a2.83 2.83 0 012.39 2.78v14.03l.09-.02h8.84v-9.22a.45.45 0 11.9 0v9.22h10.35v-.9zm0 27.33V44.66H62.5c-.02 2.01-.52 4-1.47 5.76a.45.45 0 01-.61.18.45.45 0 01-.19-.61 11.54 11.54 0 001.36-5.33h-8.83l-.1-.01a2.83 2.83 0 01-2.83 2.84h-.04-.04a2.83 2.83 0 01-2.83-2.83v-14.9a2.82 2.82 0 012.47-2.8v-7.11a23.04 23.04 0 00-22.57 23v.91h14.72V29.88a8.2 8.2 0 015.02-7.57c.22-.1.5.01.59.24.1.23-.01.5-.24.6a7.3 7.3 0 00-4.47 6.73v13.88h3.9a.45.45 0 110 .9h-3.9v.15a7.32 7.32 0 0011.23 6.17.45.45 0 01.49.76 8.22 8.22 0 01-12.62-6.93v-.15H26.82v25.52a23.04 23.04 0 0023.01 23.01 23.04 23.04 0 0023.02-23.01zm1.8-27.33v27.33A24.85 24.85 0 0149.84 95a24.85 24.85 0 01-24.82-24.82V42.85a24.85 24.85 0 0124.82-24.82 24.85 24.85 0 0124.83 24.82zM57.98 29.88v9.36a.45.45 0 11-.9 0v-9.36a7.28 7.28 0 00-3.4-6.17.45.45 0 01.49-.76 8.18 8.18 0 013.8 6.93z"/>\x3c!-- Created by Icon Island from the Noun Project --\x3e</svg>\n',title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),void(this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Nt.CTRL_ZOOM),pa));o.preventDefault(),o.stopPropagation();const d=o.deltaY/Math.abs(o.deltaY)*5*this.config.zoomSpeed;0!==d&&this.viewer.dynamics.zoom.step(-d,5)}__onFullscreenChange(){const o=this.viewer.isFullscreenEnabled();"fullscreen"===this.config.keyboard&&(o?this.viewer.startKeyboardControl():this.viewer.stopKeyboardControl()),this.viewer.dispatchEvent(new _i(o))}__resetMove(){this.step.set(wt.IDLE),this.data.mouseX=0,this.data.mouseY=0,this.data.startMouseX=0,this.data.startMouseY=0}__startMoveZoom(o){this.viewer.stopAll(),this.__resetMove();const d=ls(o);this.step.set(wt.MOVING),this.data.accumulatorFactor=this.config.moveInertia,({distance:this.data.pinchDist,center:{x:this.data.mouseX,y:this.data.mouseY}}=d)}__stopMove(o,d,y,C=!1){this.step.is(wt.CLICK)&&!this.__moveThresholdReached(o,d)&&this.__doClick(o,d,y,C),this.config.moveInertia&&(this.data.accumulatorFactor=Math.pow(this.config.moveInertia,.5)),this.__resetMove(),this.viewer.resetIdleTimer()}__doClick(o,d,y,C=!1){const D=this.viewer.container.getBoundingClientRect(),H=o-D.left,z=d-D.top,se=this.viewer.renderer.getIntersections({x:H,y:z}),Be=se.find(Je=>Je.object.userData[Kt]);if(Be){const Je=this.viewer.dataHelper.vector3ToSphericalCoords(Be.point),pt={rightclick:C,originalEvent:y,target:ki(y),clientX:o,clientY:d,viewerX:H,viewerY:z,yaw:Je.yaw,pitch:Je.pitch,objects:se.map(Et=>Et.object).filter(Et=>!Et.userData[Kt])};try{const Et=this.viewer.dataHelper.sphericalCoordsToTextureCoords(pt);Object.assign(pt,Et)}catch(Et){}this.data.dblclickTimeout?(Math.abs(this.data.dblclickData.clientX-pt.clientX)<this.moveThreshold&&Math.abs(this.data.dblclickData.clientY-pt.clientY)<this.moveThreshold&&this.viewer.dispatchEvent(new _s(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new rr(pt)),this.data.dblclickData=er(pt),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},ui))}}__handleObjectsEvents(o){if(!xo(this.state.objectsObservers)&&o.composedPath().includes(this.viewer.container)){const d=fi(this.viewer.container),y={x:o.clientX-d.x,y:o.clientY-d.y},C=this.viewer.renderer.getIntersections(y),D=(H,z,se)=>{this.viewer.dispatchEvent(new se(o,H,y,z))};for(const[H,z]of Object.entries(this.state.objectsObservers)){const se=C.find(Be=>Be.object.userData[H]);
1se?(z&&se.object!==z&&(D(z,H,Un),this.state.objectsObservers[H]=null),z?D(se.object,H,Dn):(this.state.objectsObservers[H]=se.object,D(se.object,H,ni))):z&&(D(z,H,Un),this.state.objectsObservers[H]=null)}}}__doMove(o,d){if(this.step.is(wt.CLICK)&&this.__moveThresholdReached(o,d))this.viewer.stopAll(),this.__resetMove(),this.step.set(wt.MOVING),this.data.mouseX=o,this.data.mouseY=d,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(wt.MOVING)){const y=(o-this.data.mouseX)*Math.cos(this.state.roll)-(d-this.data.mouseY)*Math.sin(this.state.roll),C=(d-this.data.mouseY)*Math.cos(this.state.roll)+(o-this.data.mouseX)*Math.sin(this.state.roll),D={yaw:this.config.moveSpeed*(y/this.state.size.width)*ge.M8C.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(C/this.state.size.height)*ge.M8C.degToRad(this.state.vFov)};this.data.moveDelta.yaw+=D.yaw,this.data.moveDelta.pitch+=D.pitch,this.data.mouseX=o,this.data.mouseY=d}}__moveThresholdReached(o,d){return Math.abs(o-this.data.startMouseX)>=this.moveThreshold||Math.abs(d-this.data.startMouseY)>=this.moveThreshold}__doMoveZoom(o){if(this.step.is(wt.MOVING)){o.preventDefault();const d=ls(o);this.__doMove(d.center.x,d.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((d.distance-this.data.pinchDist)/Ze.pixelRatio),this.data.pinchDist=d.distance}}__applyMoveDelta(){if(Math.abs(this.data.moveDelta.yaw)>0||Math.abs(this.data.moveDelta.pitch)>0){const d=this.viewer.getPosition();this.viewer.rotate({yaw:d.yaw-this.data.moveDelta.yaw*(1-this.config.moveInertia),pitch:d.pitch+this.data.moveDelta.pitch*(1-this.config.moveInertia)}),this.data.moveDelta.yaw*=this.data.accumulatorFactor,this.data.moveDelta.pitch*=this.data.accumulatorFactor,Math.abs(this.data.moveDelta.yaw)<=.001&&(this.data.moveDelta.yaw=0),Math.abs(this.data.moveDelta.pitch)<=.001&&(this.data.moveDelta.pitch=0)}if(Math.abs(this.data.moveDelta.zoom)>0){const d=this.viewer.getZoomLevel();this.viewer.zoom(d+this.data.moveDelta.zoom*(1-this.config.moveInertia)),this.data.moveDelta.zoom*=this.config.moveInertia,Math.abs(this.data.moveDelta.zoom)<=.001&&(this.data.moveDelta.zoom=0)}}__clearMoveDelta(){this.data.moveDelta.yaw=0,this.data.moveDelta.pitch=0,this.data.moveDelta.zoom=0}};ge.epp.enabled=!1;var Ur=new ge.FM8,Bo=new ge.yGw,zo=new ge.ZzF,mc=class extends ws{constructor(o){super(o),this.frustumNeedsUpdate=!0,this.renderer=new ge.CP7(this.config.rendererParameters),this.renderer.setPixelRatio(Ze.pixelRatio),this.renderer.outputColorSpace=ge.GUF,this.renderer.toneMapping=ge.EoG,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new ge.xsS,this.camera=new ge.cPb(50,16/9,.1,2*di),this.camera.matrixAutoUpdate=!1;const d=new ge.Kj0(new ge.xo$(di).scale(-1,1,1),new ge.vBJ({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));d.userData={[Kt]:!0},this.scene.add(d),this.raycaster=new ge.iMs,this.frustum=new ge.iWj,this.container=document.createElement("div"),this.container.className="psv-canvas-container",this.container.appendChild(this.renderer.domElement),this.viewer.container.appendChild(this.container),this.container.addEventListener("contextmenu",y=>y.preventDefault()),this.viewer.addEventListener(Ar.type,this),this.viewer.addEventListener(Wn.type,this),this.viewer.addEventListener(yi.type,this),this.viewer.addEventListener(Mi.type,this),this.viewer.addEventListener(Ot.type,this),this.hide()}get panoramaPose(){return this.mesh.rotation}get sphereCorrection(){return this.meshContainer.rotation}init(){this.show(),this.renderer.setAnimationLoop(o=>this.__renderLoop(o))}destroy(){this.renderer.setAnimationLoop(null),this.cleanScene(this.scene),this.renderer.dispose(),this.viewer.container.removeChild(this.container),this.viewer.removeEventListener(Ar.type,this),this.viewer.removeEventListener(Wn.type,this),this.viewer.removeEventListener(yi.type,this),this.viewer.removeEventListener(Mi.type,this),this.viewer.removeEventListener(Ot.type,this),super.destroy()}handleEvent(o){switch(o.type){case Ar.type:this.__onSizeUpdated();break;
1case Wn.type:this.__onZoomUpdated();break;case yi.type:case Mi.type:this.__onPositionUpdated();break;case Ot.type:o.containsOptions("fisheye")&&this.__onPositionUpdated(),o.containsOptions("canvasBackground")&&(this.renderer.domElement.style.background=this.config.canvasBackground)}}hide(){this.container.style.opacity="0"}show(){this.container.style.opacity="1"}setCustomRenderer(o){this.customRenderer=o?o(this.renderer):null,this.viewer.needsUpdate()}__onSizeUpdated(){this.renderer.setSize(this.state.size.width,this.state.size.height),this.camera.aspect=this.state.aspect,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onZoomUpdated(){this.camera.fov=this.state.vFov,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onPositionUpdated(){this.camera.position.set(0,0,0),this.camera.lookAt(this.state.direction),this.config.fisheye&&this.camera.position.copy(this.state.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.rotateZ(-this.state.roll),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__renderLoop(o){const d=this.timestamp?o-this.timestamp:0;this.timestamp=o,this.viewer.dispatchEvent(new Qn(o,d)),this.viewer.dynamics.update(d),(this.state.needsUpdate||this.state.continuousUpdateCount>0)&&(this.state.needsUpdate=!1,(this.customRenderer||this.renderer).render(this.scene,this.camera),this.viewer.dispatchEvent(new wo))}setTexture(o){this.meshContainer||(this.meshContainer=new ge.ZAu,this.scene.add(this.meshContainer)),this.state.textureData&&this.viewer.adapter.disposeTexture(this.state.textureData),this.mesh&&(this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh)),this.mesh=this.viewer.adapter.createMesh(o.panoData),this.viewer.adapter.setTexture(this.mesh,o,!1),this.meshContainer.add(this.mesh),this.state.textureData=o,this.viewer.needsUpdate()}setPanoramaPose(o,d=this.mesh){const y=this.viewer.dataHelper.cleanPanoramaPose(o);!He.useNewAnglesOrder&&(y.pan?1:0)+(y.tilt?1:0)+(y.roll?1:0)>1&&(nt("'panoData' Euler angles have changed in version 5.11.0."),nt("Remove your 'useNewAnglesOrder' override to remove this warning (you might have to adapt your poseHeading/posePitch/poseRoll parameters).")),He.useNewAnglesOrder?d.rotation.set(y.tilt,y.pan,y.roll,"YXZ"):d.rotation.set(-y.tilt,-y.pan,-y.roll,"ZXY")}setSphereCorrection(o,d=this.meshContainer){const y=this.viewer.dataHelper.cleanSphereCorrection(o);!He.useNewAnglesOrder&&(y.pan?1:0)+(y.tilt?1:0)+(y.roll?1:0)>1&&(nt("'sphereCorrection' Euler angles have changed in version 5.11.0."),nt("Remove your 'useNewAnglesOrder' override to remove this warning (you might have to adapt your poseHeading/posePitch/poseRoll parameters).")),d.rotation.set(y.tilt,y.pan,y.roll,He.useNewAnglesOrder?"YXZ":"ZXY")}transition(o,d,y){const C="fade"===y.effect||y.rotation,D=!Pt(d.position),H=!Pt(d.zoom),z=new jn(D?this.viewer.dataHelper.cleanPosition(d.position):void 0,d.zoom);this.viewer.dispatchEvent(z);const se=new ge.ZAu,Be=this.viewer.adapter.createMesh(o.panoData);if(this.viewer.adapter.setTexture(Be,o,!0),this.viewer.adapter.setTextureOpacity(Be,0),this.setPanoramaPose(o.panoData,Be),this.setSphereCorrection(d.sphereCorrection,se),D&&!y.rotation){const Vt=this.viewer.getPosition(),Es=new ge.Pa4(0,1,0);se.rotateOnWorldAxis(Es,z.position.yaw-Vt.yaw);const Ts=new ge.Pa4(0,1,0).cross(this.camera.getWorldDirection(new ge.Pa4)).normalize();se.rotateOnWorldAxis(Ts,z.position.pitch-Vt.pitch)}se.add(Be),this.scene.add(se),this.renderer.setRenderTarget(new ge.dd2),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:Je,properties:pt}=this.viewer.dataHelper.getAnimationProperties(y.speed,y.rotation?z.position:null,C?z.zoomLevel:null),Et=new Jn({properties:ua(gt({},pt),{opacity:{start:0,end:1}}),duration:Je,easing:"inOutCubic",onTick:Vt=>{switch(y.effect){case"fade":this.viewer.adapter.setTextureOpacity(Be,Vt.opacity);break;case"black":case"white":Vt.opacity<.5?this.renderer.toneMappingExposure=ge.M8C.mapLinear(Vt.opacity,0,.5,1,"black"===y.effect?0:4):(this.renderer.toneMappingExposure=ge.M8C.mapLinear(Vt.opacity,.5,1,"black"===y.effect?0:4,1),this.mesh.visible=!1,this.viewer.adapter.setTextureOpacity(Be,1),H&&!C&&this.viewer.dynamics.zoom.setValue(z.zoomLevel))}D&&y.rotation&&this.viewer.dynamics.position.setValue({yaw:Vt.yaw,pitch:Vt.pitch}),H&&C&&this.viewer.dynamics.zoom.setValue(Vt.zoom),this.viewer.needsUpdate()}});return Et.then(Vt=>{se.remove(Be),this.scene.remove(se),Vt?(this.viewer.adapter.disposeTexture(this.state.textureData),this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh),this.mesh=Be,this.meshContainer.add(Be),this.state.textureData=o,this.setPanoramaPose(o.panoData),this.setSphereCorrection(d.sphereCorrection),D&&!y.rotation&&this.viewer.rotate(d.position)):(this.viewer.adapter.disposeTexture(o),this.viewer.adapter.disposeMesh(Be))}),Et}getIntersections(o){var y;Ur.x=2*o.x/this.state.size.width-1,Ur.y=-2*o.y/this.state.size.height+1,this.raycaster.setFromCamera(Ur,this.camera);const d=this.raycaster.intersectObjects(this.scene.children,!0).filter(C=>C.object.visible).filter(C=>C.object.isMesh&&!!C.object.userData);return(null==(y=this.customRenderer)?void 0:y.getIntersections)&&d.push(...this.customRenderer.getIntersections(this.raycaster,Ur)),d}isObjectVisible(o){if(!o)return!1;if(this.frustumNeedsUpdate&&(Bo.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(Bo),this.frustumNeedsUpdate=!1),o.isVector3)return this.frustum.containsPoint(o);if(o.isMesh&&o.geometry){const d=o;return d.geometry.boundingBox||d.geometry.computeBoundingBox(),zo.copy(d.geometry.boundingBox).applyMatrix4(d.matrixWorld),this.frustum.intersectsBox(zo)}return!!o.isObject3D&&this.frustum.intersectsObject(o)}addObject(o){this.scene.add(o)}removeObject(o){this.scene.remove(o)}cleanScene(o){const d=y=>{var C;null==(C=y.map)||C.dispose(),y.uniforms&&Object.values(y.uniforms).forEac
1h(D=>{var H,z;null==(z=null==(H=D.value)?void 0:H.dispose)||z.call(H)}),y.dispose()};o.traverse(y=>{var C,D;null==(C=y.geometry)||C.dispose(),y.material&&(Array.isArray(y.material)?y.material.forEach(H=>{d(H)}):d(y.material)),y instanceof ge.xsS||null==(D=y.dispose)||D.call(y),y!==o&&this.cleanScene(y)})}},gc=class extends ge.aNw{load(o,d,y,C,D){const H=new Request(o,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"});fetch(H,{signal:D}).then(z=>{if(200===z.status||0===z.status){const se=z.body.getReader(),Be=z.headers.get("Content-Length")||z.headers.get("X-File-Size"),Je=Be?parseInt(Be):0,pt=0!==Je;let Et=0;const Vt=new ReadableStream({start(Es){!function Ts(){se.read().then(({done:Ai,value:ko})=>{if(Ai)Es.close();else{Et+=ko.byteLength;const it=new ProgressEvent("progress",{lengthComputable:pt,loaded:Et,total:Je});y(it),Es.enqueue(ko),Ts()}}).catch(Ai=>{C(Ai)})}()}});return new Response(Vt)}throw new Error(`fetch for "${z.url}" responded with ${z.status}: ${z.statusText}`)}).then(z=>z.blob()).then(z=>{d(z)}).catch(z=>{C(z)})}},vc=class extends ge.aNw{load(o,d,y,C){const D=document.createElement("img");function H(){Be(),d(this)}function z(Je){if(Be(),null==C?void 0:C.aborted){const pt=new Error;pt.name="AbortError",pt.message="The operation was aborted.",y(pt)}else y(Je)}function se(){D.src=""}function Be(){D.removeEventListener("load",H,!1),D.removeEventListener("error",z,!1),null==C||C.removeEventListener("abort",se,!1)}return D.addEventListener("load",H,!1),D.addEventListener("error",z,!1),null==C||C.addEventListener("abort",se,!1),!o.startsWith("data:")&&void 0!==this.crossOrigin&&(D.crossOrigin=this.crossOrigin),D.src=o,D}},_c=class extends ws{constructor(o){super(o),this.abortCtrl={},this.fileLoader=new gc,this.imageLoader=new vc,this.config.withCredentials&&(this.fileLoader.setWithCredentials(!0),this.imageLoader.setCrossOrigin("use-credentials"))}destroy(){this.abortLoading(),super.destroy()}abortLoading(){Object.values(this.abortCtrl).forEach(o=>o.abort()),this.abortCtrl={}}loadFile(o,d,y){const C=Nn.get(o,y);if(C){if(C instanceof Blob)return null==d||d(100),Promise.resolve(C);Nn.remove(o,y)}return this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(o)),new Promise((D,H)=>{let z=0;null==d||d(z),this.fileLoader.load(o,se=>{z=100,null==d||d(z),Nn.add(o,y,se),D(se)},se=>{if(se.lengthComputable){const Be=se.loaded/se.total*100;Be>z&&(z=Be,null==d||d(z))}},se=>{H(se)},this.__getAbortSignal(y))})}loadImage(o,d,y){const C=Nn.get(o,y);return C?(null==d||d(100),C instanceof Blob?this.blobToImage(C):Promise.resolve(C)):d||this.config.requestHeaders?this.loadFile(o,d,y).then(D=>this.blobToImage(D)):new Promise((D,H)=>{this.imageLoader.load(o,z=>{Nn.add(o,y,z),D(z)},z=>{H(z)},this.__getAbortSignal(y))})}blobToImage(o){return new Promise((d,y)=>{const C=document.createElement("img");C.onload=()=>{URL.revokeObjectURL(C.src),d(C)},C.onerror=y,C.src=URL.createObjectURL(o)})}preloadPanorama(o){return this.viewer.adapter.supportsPreload(o)?this.viewer.adapter.loadTexture(o,!1):Promise.reject(new tt("Current adapter does not support preload"))}__getAbortSignal(o){var d;return o?((null==(d=this.abortCtrl[o])?void 0:d.signal.aborted)&&delete this.abortCtrl[o],this.abortCtrl[o]||(this.abortCtrl[o]=new AbortController),this.abortCtrl[o].signal):null}},xc=class extends ws{constructor(o){super(o),this.zoom=new gi(d=>{this.viewer.state.vFov=this.viewer.dataHelper.zoomLevelToFov(d),this.viewer.state.hFov=this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov),this.viewer.dispatchEvent(new Wn(d))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new nr(d=>{this.viewer.dataHelper.sphericalCoordsToVector3(d,this.viewer.state.direction),this.viewer.dispatchEvent(new yi(d))},{yaw:new gi(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new gi(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new gi(d=>{this.viewer.state.roll=d,this.viewer.dispatchEvent(new Mi(d))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(50*this.config.zoomSpeed),this.position.setSpeed(ge.M8C.degToRad(50*this.config.moveSpeed)),this.roll.setSpeed(ge.M8C.degToRad(50*this.config.moveSpeed))}update(o){this.zoom.update(o),this.position.update(o),this.roll.update(o)}},He=class extends ba{constructor(o){var d,y,C;if(super(),this.plugins={},this.children=[],this.onResize=Cn(()=>this.navbar.autoSize(),500),this.parent=go(o.container),!this.parent)throw new tt('"container" element not found.');this.parent[Kt]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Vn(this.parent),Vi(this.container,"core"),this.state=new class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new ge.Pa4(0,0,di),this.roll=0,this.vFov=60,this.hFov=60,this.aspect=1,this.animation=null,this.transitionAnimation=null,this.loadingPromise=null,this.idleTime=-1,this.objectsObservers={}
1,this.size={width:0,height:0}}},this.config=tu(o),this.__setSize(this.config.size),this.overlay=new Fo(this);try{Ze.load()}catch(D){return console.error(D),void this.showError(this.config.lang.webglError)}Nn.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new mc(this),this.textureLoader=new _c(this),this.eventsHandler=new pc(this),this.dataHelper=new uc(this),this.dynamics=new xc(this),null==(y=(d=this.adapter).init)||y.call(d),this.loader=new qi(this),this.navbar=new Xn(this),this.panel=new sn(this),this.notification=new Ht(this),this.autoSize(),this.setCursor(null),hs(Ze.isTouchEnabled,D=>{$s(this.container,"psv--is-touch",D)}),this.config.plugins.forEach(([D,H])=>{this.plugins[D.id]=new D(this,H)});for(const D of Object.values(this.plugins))null==(C=D.init)||C.call(D);this.config.navbar&&this.navbar.setButtons(this.config.navbar),this.state.loadingPromise||(this.config.panorama?this.setPanorama(this.config.panorama,{sphereCorrection:this.config.sphereCorrection,panoData:this.config.panoData}):this.loader.show())}destroy(){var o,d,y,C,D,H;this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[z,se]of Object.entries(this.plugins))se.destroy(),delete this.plugins[z];this.children.slice().forEach(z=>z.destroy()),this.children.length=0,null==(o=this.eventsHandler)||o.destroy(),null==(d=this.renderer)||d.destroy(),null==(y=this.textureLoader)||y.destroy(),null==(C=this.dataHelper)||C.destroy(),null==(D=this.adapter)||D.destroy(),null==(H=this.dynamics)||H.destroy(),this.parent.removeChild(this.container),delete this.parent[Kt]}init(){this.eventsHandler.init(),this.renderer.init(),this.config.navbar&&this.navbar.show(),"always"===this.config.keyboard&&this.startKeyboardControl(),this.resetIdleTimer(),this.state.ready=!0,this.dispatchEvent(new bi)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(o){if("string"==typeof o)return this.plugins[o];{const d=Do(o);return d?this.plugins[d.id]:null}}getPosition(){return this.dataHelper.cleanPosition(this.dynamics.position.current)}getZoomLevel(){return this.dynamics.zoom.current}getSize(){return gt({},this.state.size)}isFullscreenEnabled(){return js(this.parent,Ze.isIphone)}needsUpdate(){this.state.needsUpdate=!0}needsContinuousUpdate(o){o?this.state.continuousUpdateCount++:this.state.continuousUpdateCount>0&&this.state.continuousUpdateCount--}autoSize(){(this.container.clientWidth!==this.state.size.width||this.container.clientHeight!==this.state.size.height)&&(this.state.size.width=Math.round(this.container.clientWidth),this.state.size.height=Math.round(this.container.clientHeight),this.state.aspect=this.state.size.width/this.state.size.height,this.state.hFov=this.dataHelper.vFovToHFov(this.state.vFov),this.dispatchEvent(new Ar(this.getSize())),this.onResize())}setPanorama(o,d={}){var H;this.textureLoader.abortLoading(),null==(H=this.state.transitionAnimation)||H.cancel();const y=this.dataHelper.getTransitionOptions(d);void 0===d.showLoader&&(d.showLoader=!0),void 0===d.caption&&(d.caption=this.config.caption),void 0===d.description&&(d.description=this.config.description),!d.panoData&&"function"==typeof this.config.panoData&&(d.panoData=this.config.panoData),this.hideError(),this.resetIdleTimer(),this.config.panorama=o,this.config.caption=d.caption,this.config.description=d.description,this.config.sphereCorrection=d.sphereCorrection;const C=z=>{if(us(z))return!1;if(this.loader.hide(),this.state.loadingPromise=null,z)throw this.navbar.setCaption(""),this.showError(this.config.lang.loadError),console.error(z),this.dispatchEvent(new yr(o,z)),z;return this.navbar.setCaption(this.config.caption),!0};this.navbar.setCaption(`<em>${this.config.lang.loading}</em>`),(d.showLoader||!this.state.ready)&&this.loader.show(),this.dispatchEvent(new vr(o));const D=this.adapter.loadTexture(this.config.panorama,!0,d.panoData).then(z=>{if(z.panorama!==this.config.panorama)throw this.adapter.disposeTexture(z),Hn();const se=this.dataHelper.cleanPanoramaOptions(d,z.panoData);return(!Pt(se.zoom)||!Pt(se.position))&&this.stopAll(),{textureData:z,cleanOptions:se}});return this.state.loadingPromise=y&&this.state.ready&&this.adapter.supportsTransition(this.config.panorama)?D.then(({textureData:z,cleanOptions:se})=>(this.loader.hide(),this.dispatchEvent(new ei(z)),this.state.transitionAnimation=this.renderer.transition(z,se,y),this.state.transitionAnimation)).then(z=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new xs(z)),!z)throw Hn()}).then(()=>C(),z=>C(z)):D.then(({textureData:z,cleanOptions:se})=>{this.renderer.show(),this.renderer.setTexture(z),this.renderer.setPanoramaPose(z.panoData),this.renderer.setSphereCorrection(d.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new ei(z)),Pt(se.zoom)||this.zoom(se.zoom),Pt(se.position)||this.rotate(se.position)}).then(()=>C(),z=>C(z)),this.state.loadingPromise}setOptions(o){const d=gt(gt({},this.config),o);for(let[y,C]of Object.entries(o))if(y in Ei)if(y in hc)nt(hc[y]);else switch(y in No&&(C=No[y](C,{rawConfig:d,defValue:Ei[y]})),this.config[y]=C,y){case"mousemove":this.state.cursorOverride||this.setCursor(null);break;case"caption":this.navbar.setCaption(this.config.caption);break;case"size":this.resize(this.config.size);break;case"sphereCorrection":this.renderer.setSphereCorrection(this.config.sphereCorrection);break;case"navbar":case"lang":this.navbar.setButtons(this.config.navbar);break;case"moveSpeed":case"zoomSpeed":this.dynamics.updateSpeeds();break;case"minFov":case"maxFov":this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov)),this.dispatchEvent(new Wn(this.getZoomLevel()));break;case"keyboard":"always"===this.config.keyboard?this.startKeyboardControl():this.stopKeyboardControl()}else nt(`Unknown option ${y}`);this.needsUpdate(),this.dispatchEvent(new Ot(Object.keys(o)))}setOption(o,d){this.setOptions({[o]:d})}showError(o){this.overlay.show({id:Nt.ERROR,image:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="15 15 70 70">
1<path fill="currentColor" d="M50,16.2c-18.6,0-33.8,15.1-33.8,33.8S31.4,83.7,50,83.7S83.8,68.6,83.8,50S68.6,16.2,50,16.2z M50,80.2c-16.7,0-30.2-13.6-30.2-30.2S33.3,19.7,50,19.7S80.3,33.3,80.3,50S66.7,80.2,50,80.2z"/><rect fill="currentColor" x="48" y="31.7" width="4" height="28"/><rect fill="currentColor" x="48" y="63.2" width="4" height="5"/>\x3c!--Created by Shastry from the Noun Project--\x3e</svg>\n',title:o,dismissible:!1})}hideError(){this.overlay.hide(Nt.ERROR)}rotate(o){const d=new sr(this.dataHelper.cleanPosition(o));this.dispatchEvent(d),!d.defaultPrevented&&this.dynamics.position.setValue(d.position)}zoom(o){this.dynamics.zoom.setValue(o)}zoomIn(o=1){this.dynamics.zoom.step(o)}zoomOut(o=1){this.dynamics.zoom.step(-o)}animate(o){const d=pi(o),y=!Pt(o.zoom),C=new jn(d?this.dataHelper.cleanPosition(o):void 0,o.zoom);if(this.dispatchEvent(C),C.defaultPrevented)return;this.stopAll();const{duration:D,properties:H}=this.dataHelper.getAnimationProperties(o.speed,C.position,C.zoomLevel);return D?(this.state.animation=new Jn({properties:H,duration:D,easing:o.easing||"inOutSine",onTick:z=>{d&&this.dynamics.position.setValue({yaw:z.yaw,pitch:z.pitch}),y&&this.dynamics.zoom.setValue(z.zoom)}}),this.state.animation.then(()=>{this.state.animation=null,this.resetIdleTimer()}),this.state.animation):(d&&this.rotate(C.position),y&&this.zoom(C.zoomLevel),new Jn(null))}stopAnimation(){return this.state.animation?(this.state.animation.cancel(),this.state.animation):Promise.resolve()}resize(o){this.__setSize(o),this.autoSize()}__setSize(o){const d=o;["width","height"].forEach(y=>{o&&d[y]&&(/^[0-9.]+$/.test(d[y])&&(d[y]+="px"),this.parent.style[y]=d[y])})}enterFullscreen(){this.isFullscreenEnabled()||cs(this.parent,Ze.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&vo(Ze.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(o){return new yt(this,o)}setCursor(o){this.state.cursorOverride=o,this.container.style.cursor=o||(this.config.mousemove?"move":"default")}observeObjects(o){this.state.objectsObservers[o]||(this.state.objectsObservers[o]=null)}unobserveObjects(o){delete this.state.objectsObservers[o]}stopAll(){return this.dispatchEvent(new Cr),this.disableIdleTimer(),this.stopAnimation()}};He.useNewAnglesOrder=!0;var yc="5.11.5"},86682:(Bn,Wt,zt)=>{zt.d(Wt,{CP7:()=>N_,CtF:()=>Fi,D1R:()=>At,EoG:()=>Qs,FM8:()=>o,GUF:()=>Dn,Kj0:()=>Qt,M8C:()=>yc,Pa4:()=>L,Tme:()=>fn,USm:()=>oi,ZAu:()=>Qr,ZzF:()=>rn,_fP:()=>dn,aNw:()=>j0,cPb:()=>qt,dd2:()=>Zi,epp:()=>it,iMs:()=>Ix,iWj:()=>Ha,vBJ:()=>es,wem:()=>xt,xEZ:()=>ai,xo$:()=>so,xsS:()=>ju,yGw:()=>ze});var Ys=zt(15861);const Qs=1,hn=1001,St=1003,xt=1006,At=1008,In=1009,Vi=1012,Vn=1014,Jt=1015,Jn=1016,Gn=1020,Xt=1023,vi=1026,jn=1027,gs=33776,Ot=33777,vs=33778,_s=33779,xs=36492,un="srgb",Dn="srgb-linear",Gi="display-p3",Ms="display-p3-linear",ii="linear",Ze="srgb",Rr="rec709",Wi=7680,Xn=2e3;class qi{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const i=this._listeners[e];if(void 0!==i){const s=i.indexOf(t);-1!==s&&i.splice(s,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const n=this._listeners[e.type];if(void 0!==n){e.target=this;const i=n.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}const Ht=["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","5
15","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"];let Fo=1234567;const Ti=Math.PI/180,si=180/Math.PI;function sn(){const r=4294967295*Math.random()|0,e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Ht[255&r]+Ht[r>>8&255]+Ht[r>>16&255]+Ht[r>>24&255]+"-"+Ht[255&e]+Ht[e>>8&255]+"-"+Ht[e>>16&15|64]+Ht[e>>24&255]+"-"+Ht[63&t|128]+Ht[t>>8&255]+"-"+Ht[t>>16&255]+Ht[t>>24&255]+Ht[255&n]+Ht[n>>8&255]+Ht[n>>16&255]+Ht[n>>24&255]).toLowerCase()}function yt(r,e,t){return Math.max(e,Math.min(t,r))}function Ua(r,e){return(r%e+e)%e}function ri(r,e,t){return(1-t)*r+t*e}function Yt(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function He(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(4294967295*r);case Uint16Array:return Math.round(65535*r);case Uint8Array:return Math.round(255*r);case Int32Array:return Math.round(2147483647*r);case Int16Array:return Math.round(32767*r);case Int8Array:return Math.round(127*r);default:throw new Error("Invalid component type.")}}const yc={DEG2RAD:Ti,RAD2DEG:si,generateUUID:sn,clamp:yt,euclideanModulo:Ua,mapLinear:function ws(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)},inverseLerp:function Mn(r,e,t){return r!==e?(t-r)/(e-r):0},lerp:ri,damp:function uc(r,e,t,n){return ri(r,e,1-Math.exp(-t*n))},pingpong:function dc(r,e=1){return e-Math.abs(Ua(r,2*e)-e)},smoothstep:function fc(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e))*r*(3-2*r)},smootherstep:function Lr(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e))*r*r*(r*(6*r-15)+10)},randInt:function wt(r,e){return r+Math.floor(Math.random()*(e-r+1))},randFloat:function pc(r,e){return r+Math.random()*(e-r)},randFloatSpread:function Ur(r){return r*(.5-Math.random())},seededRandom:function Bo(r){void 0!==r&&(Fo=r);let e=Fo+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function zo(r){return r*Ti},radToDeg:function mc(r){return r*si},isPowerOfTwo:function gc(r){return 0==(r&r-1)&&0!==r},ceilPowerOfTwo:function vc(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))},floorPowerOfTwo:function _c(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))},setQuaternionFromProperEuler:function xc(r,e,t,n,i){const s=Math.cos,a=Math.sin,l=s(t/2),c=a(t/2),h=s((e+n)/2),u=a((e+n)/2),f=s((e-n)/2),p=a((e-n)/2),m=s((n-e)/2),_=a((n-e)/2);switch(i){case"XYX":r.set(l*u,c*f,c*p,l*h);break;case"YZY":r.set(c*p,l*u,c*f,l*h);break;case"ZXZ":r.set(c*f,c*p,l*u,l*h);break;case"XZX":r.set(l*u,c*_,c*m,l*h);break;case"YXY":r.set(c*m,l*u,c*_,l*h);break;case"ZYZ":r.set(c*_,c*m,l*u,l*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:He,denormalize:Yt};class o{constructor(e=0,t=0){o.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 6,611 bytes, line 1
1sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(yt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*i+e.x,this.y=s*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class d{constructor(e,t,n,i,s,a,l,c,h){d.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,s,a,l,c,h)}set(e,t,n,i,s,a,l,c,h){const u=this.elements;return u[0]=e,u[1]=i,u[2]=l,u[3]=t,u[4]=s,u[5]=c,u[6]=n,u[7]=a,u[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,a=n[0],l=n[3],c=n[6],h=n[1],u=n[4],f=n[7],p=n[2],m=n[5],_=n[8],x=i[0],v=i[3],g=i[6],S=i[1],M=i[4],w=i[7],O=i[2],R=i[5],I=i[8];return s[0]=a*x+l*S+c*O,s[3]=a*v+l*M+c*R,s[6]=a*g+l*w+c*I,s[1]=h*x+u*S+f*O,s[4]=h*v+u*M+f*R,s[7]=h*g+u*w+f*I,s[2]=p*x+m*S+_*O,s[5]=p*v+m*M+_*R,s[8]=p*g+m*w+_*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=e[8];return t*a*u-t*l*h-n*s*u+n*l*c+i*s*h-i*a*c}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=e[8],f=u*a-l*h,p=l*c-u*s,m=h*s-a*c,_=t*f+n*p+i*m;if(0===_)return this.set(0,0,0,0,0,0,0,0,0);const x=1/_;return e[0]=f*x,e[1]=(i*h-u*n)*x,e[2]=(l*n-i*a)*x,e[3]=p*x,e[4]=(u*t-i*c)*x,e[5]=(i*s-l*t)*x,e[6]=m*x,e[7]=(n*c-h*t)*x,e[8]=(a*t-n*s)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,a,l){const c=Math.cos(s),h=Math.sin(s);return this.set(n*c,n*h,-n*(c*a+h*l)+a+e,-i*h,i*c,-i*(-h*a+c*l)+l+t,0,0,1),this}scale(e,t){return this.premultiply(y.makeScale(e,t)),this}rotate(e){return this.premultiply(y.makeRotation(-e)),this}translate(e,t){return this.premultiply(y.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const y=new d;function C(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function z(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function se(){const r=z("canvas");return r.style.display="block",r}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;const Be={};function Je(r){r in Be||(Be[r]=!0,console.warn(r))}const Es=(new d).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Ts=(new d).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ai={[Dn]:{transfer:ii,primaries:Rr,luminanceCoefficients:[.2126,.7152,.0722],toReference:r=>r,fromReference:r=>r},[un]:{transfer:Ze,primaries:Rr,luminanceCoefficients:[.2126,.7152,.0722],toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Ms]:{transfer:ii,primaries:"p3",luminanceCoefficients:[.2289,.6917,.0793],toReference:r=>
1r.applyMatrix3(Ts),fromReference:r=>r.applyMatrix3(Es)},[Gi]:{transfer:Ze,primaries:"p3",luminanceCoefficients:[.2289,.6917,.0793],toReference:r=>r.convertSRGBToLinear().applyMatrix3(Ts),fromReference:r=>r.applyMatrix3(Es).convertLinearToSRGB()}},ko=new Set([Dn,Ms]),it={enabled:!0,_workingColorSpace:Dn,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!ko.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){return!1!==this.enabled&&e!==t&&e&&t?Ai[t].fromReference((0,Ai[e].toReference)(r)):r},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return Ai[r].primaries},getTransfer:function(r){return""===r?ii:Ai[r].transfer},getLuminanceCoefficients:function(r,e=this._workingColorSpace){return r.fromArray(Ai[e].luminanceCoefficients)}};function Dr(r){return r<.04045?.0773993808*r:Math.pow(.9478672986*r+.0521327014,2.4)}function Mc(r){return r<.0031308?12.92*r:1.055*Math.pow(r,.41666)-.055}let Nr,op=0;class Or{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:op++}),this.uuid=sn(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let s;if(Array.isArray(i)){s=[];for(let a=0,l=i.length;a<l;a++)s.push(bc(i[a].isDataTexture?i[a].image:i[a]))}else s=bc(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function bc(r){return"undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&r instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&r instanceof ImageBitmap?class ap{static getDataURL(e){if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Nr&&(Nr=z("canvas")),Nr.width=e.width,Nr.height=e.height;const n=Nr.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Nr}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=z("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=255*Dr(s[a]/255);return n.putImageData(i,0,0),t}if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t[n]=t instanceof Uint8Array||t instanceof Uint8ClampedArray?Math.floor(255*Dr(t[n]/255)):Dr(t[n]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let lp=0,ai=(()=>{class r extends qi{constructor(t=r.DEFAULT_IMAGE,n=r.DEFAULT_MAPPING,i=hn,s=hn,a=xt,l=At,c=Xt,h=In,u=r.DEFAULT_ANISOTROPY,f=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:lp++}),this.uuid=sn(),this.name="",this.source=new Or(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=s,this.magFilter=a,this.minFilter=l,this.anisotropy=u,this.format=c,this.internalFormat=null,this.type=h,this.offset=new o(0,0),this.repeat=new o(1,1),this.center=new o(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new d,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=f,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace
1=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const n=void 0===t||"string"==typeof t;if(!n&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).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&&(i.userData=this.userData),n||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case hn:t.x=t.x<0?0:1;break;case 1002:t.x=1===Math.abs(Math.floor(t.x)%2)?Math.ceil(t.x)-t.x:t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case hn:t.y=t.y<0?0:1;break;case 1002:t.y=1===Math.abs(Math.floor(t.y)%2)?Math.ceil(t.y)-t.y:t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}return r.DEFAULT_IMAGE=null,r.DEFAULT_MAPPING=300,r.DEFAULT_ANISOTROPY=1,r})();class lt{constructor(e=0,t=0,n=0,i=1){lt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const c=e.elements,h=c[0],u=c[4],f=c[8],p=c[1],m=c[5],_=c[9],x=c[2],v=c[6],g=c[10];if(Math.abs(u-p)<.01&&Math.abs(f-x)<.01&&Math.abs(_-v)<.01){if(Math.abs(u+p)<.1&&Math.abs(f+x)<.1&&Math.abs(_+v)<.1&&Math.abs(h+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(h+1)/2,w=(m+1)/2,O=(g+1)/2,R=(u+p)/4,I=(f+x)/4,N=(_+v)/4;return M>w&&M>O?M<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(M),i=R/n,s=I/n):w>O?w<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(w),n=R/i,s=N/i):O<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(O),n=I/s,i=N/s),this.set(n,i,s,t),this}let S=Math.sqrt((v-_)*(v-_)+(f-x)*(f-x)+(p-u)*(p-u));return Math.abs(S)<.001&&(S=1),this.x=(v-_)/S,this.y=(f-x)/S,this.z=(p-u)/S,this.w=Math.acos((h+m+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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}
vendor: 14,219 bytes, line 1
1round(){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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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 cp extends qi{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new lt(0,0,e,t),this.scissorTest=!1,this.viewport=new lt(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:xt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const s=new ai(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let l=0;l<a;l++)this.textures[l]=s.clone(),this.textures[l].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Or(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Zi extends cp{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class Sc extends ai{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=St,this.minFilter=St,this.wrapR=hn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class nu extends ai{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=St,this.minFilter=St,this.wrapR=hn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class dn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,a,l){let c=n[i+0],h=n[i+1],u=n[i+2],f=n[i+3];const p=s[a+0],m=s[a+1],_=s[a+2],x=s[a+3];if(0===l)return e[t+0]=c,e[t+1]=h,e[t+2]=u,void(e[t+3]=f);if(1===l)return e[t+0]=p,e[t+1]=m,e[t+2]=_,void(e[t+3]=x);if(f!==x||c!==p||h!==m||u!==_){let v=1-l;const g=c*p+h*m+u*_+f*x,S=g>=0?1:-1,M=1-g*g;if(M>Number.EPSILON){const O=Math.sqrt(M),R=Math.atan2(O,g*S);v=Math.sin(v*R)/O,l=Math.sin(l*R)/O}const w=l*S;if(c=c*v+p*w,h=h*v+m*w,u=u*v+_*w,f=f*v+x*w,v===1-l){const O=1/Math.sqrt(c*c+h*h+u*u+f*f);c*=O,h*=O,u*=O,f*=O}}e[t]=c,e[t+1]=h,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,n,i,s,a){const l=n[i],c=n[i+1],h=n[i+2],u=n[i+3],f=s[a],p=s[a+1],m=s[a+2],_=s[a+3];return e[t]=l*_+u*f+c*m-h*p,e[t+1]=c*_+u*p+h*f-l*m,e[t+2]=h*_+u*m+l*p-c*f,e[t+3]=u*_-l*f-c*p-h*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,s=e._z,a=e._order,l=Math.cos,c=Math.sin,h=l(n/2),u=l(i/2),f=l(s/2),p=c(n/2),m=c(i/2),_=c(s/2);switch(a){case"XYZ":this._x=p*u*f+h*m*_,this._y=h*m*f-p*u*_,this._z=h*u*_+p*m*f,this._w=h*u*f-p*m*_;break;case"YXZ":this._x=p*u*f+h*m*_,this._y=h*m*f-p*u*_,this._z=h*u*_-p*m*f,this._w=h*u*f+p*m*_;break;case"ZXY":this._x=p*u*f-h*m*_,this._y=h*m*f+p*u*_,this._z=h*u*_+p*m*f,this._w=h*u*f-p*m*_;break;case"ZYX":this._x=p*u*f-h*m*_,this._y=h*m*f+p*u*_,this._z=h*u*_-p*m*f,this._w=h*u*f+p*m*_;break;case"YZX":this._x=p*u*f+h*m*_,this._y=h*m*f+p*u*_,this._z=h*u*_-p*m*f,this._w=h*u*f-p*m*_;break;case"XZY":this._x=p*u*f-h*m*_,this._y=h*m*f-p*u*_,this._z=h*u*_+p*m*f,this._w=h*u*f+p*m*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],a=t[1],l=t[5],c=t[9],h=t[2],u=t[6],f=t[10],p=n+l+f;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(u-c)*m,this._y=(s-h)*m,this._z=(a-i)*m}else if(n>l&&n>f){const m=2*Math.sqrt(1+n-l-f);this._w=(u-c)/m,this._x=.25*m,this._y=(i+a)/m,this._z=(s+h)/m}else if(l>f){const m=2*Math.sqrt(1+l-n-f);this._w=(s-h)/m,this._x=(i+a)/m,this._y=.25*m,this._z=(c+u)/m}else{const m=2*Math.sqrt(1+f-n-l);this._w=(a-i)/m,this._x=(s+h)/m,this._y=(c+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(yt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,a=e._w,l=t._x,c=t._y,h=t._z,u=t._w;return this._x=n*u+a*l+i*h-s*c,this._y=i*u+a*c+s*l-n*h,this._z=s*u+a*h+n*c-i*l,this._w=a*u-n*l-i*c-s*h,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,s=this._z,a=this._w;let l=a*e._w+n*e._x+i*e._y+s*e._z;if(l<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),l>=1)return this._w=a,this._x=n,this._y=i,this._z=s,this;const c=1-l*l;if(c<=Number.EPSILON){const m=1-t;return this._w=m*a+t*this._w,this._x=m*n+t*this._x,this._y=m*i+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const h=Math.sqrt(c),u=Math.atan2(h,l),f=Math.sin((1-t)*u)/h,p=Math.sin(t*u)/h;return this._w=a*f+this._w*p,this._x=n*f+this._x*p,this._y=i*f+this._y*p,this._z=s*f+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class L{constructor(e=0,t=0,n=0){L.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(iu.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(iu.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,a=e.y,l=e.z,c=e.w,h=2*(a*i-l*n),u=2*(l*t-s*i),f=2*(s*n-a*t);return this.x=t+c*h+a*f-l*u,this.y=n+c*u+l*h-s*f,this.z=i+c*f+s*u-a*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}
vendor: 5,100 bytes, line 1
1lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,a=t.x,l=t.y,c=t.z;return this.x=i*c-s*l,this.y=s*a-n*c,this.z=n*l-i*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return wc.copy(this).projectOnVector(e),this.sub(wc)}reflect(e){return this.sub(wc.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(yt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const wc=new L,iu=new dn;class rn{constructor(e=new L(1/0,1/0,1/0),t=new L(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Yn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Yn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Yn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const s=n.getAttribute("position");if(!0===t&&void 0!==s&&!0!==e.isInstancedMesh)for(let a=0,l=s.count;a<l;a++)!0===e.isMesh?e.getVertexPosition(a,Yn):Yn.fromBufferAttribute(s,a),Yn.applyMatrix4(e.matrixWorld),this.expandByPoint(Yn);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),Ho.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),Ho.copy(n.boundingBox)),Ho.applyMatrix4(e.matrixWorld),this.union(Ho)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Yn),Yn.distanceToSquared(e.center)<=e.radius*e.radiu
vendor: 6,346 bytes, line 1
1s}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Da),Vo.subVectors(this.max,Da),Fr.subVectors(e.a,Da),Br.subVectors(e.b,Da),zr.subVectors(e.c,Da),$i.subVectors(Br,Fr),Ki.subVectors(zr,Br),As.subVectors(Fr,zr);let t=[0,-$i.z,$i.y,0,-Ki.z,Ki.y,0,-As.z,As.y,$i.z,0,-$i.x,Ki.z,0,-Ki.x,As.z,0,-As.x,-$i.y,$i.x,0,-Ki.y,Ki.x,0,-As.y,As.x,0];return!(!Ec(t,Fr,Br,zr,Vo)||(t=[1,0,0,0,1,0,0,0,1],!Ec(t,Fr,Br,zr,Vo)))&&(Go.crossVectors($i,Ki),t=[Go.x,Go.y,Go.z],Ec(t,Fr,Br,zr,Vo))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Yn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(Yn).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Ci[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ci[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ci[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ci[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ci[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ci[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ci[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ci[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ci)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Ci=[new L,new L,new L,new L,new L,new L,new L,new L],Yn=new L,Ho=new rn,Fr=new L,Br=new L,zr=new L,$i=new L,Ki=new L,As=new L,Da=new L,Vo=new L,Go=new L,Cs=new L;function Ec(r,e,t,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Cs.fromArray(r,s);const l=i.x*Math.abs(Cs.x)+i.y*Math.abs(Cs.y)+i.z*Math.abs(Cs.z),c=e.dot(Cs),h=t.dot(Cs),u=n.dot(Cs);if(Math.max(-Math.max(c,h,u),Math.min(c,h,u))>l)return!1}return!0}const hp=new rn,Na=new L,Tc=new L;class an{constructor(e=new L,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):hp.setFromPoints(e).getCenter(n);let i=0;for(let s=0,a=e.length;s<a;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Na.subVectors(e,this.center);const t=Na.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=.5*(n-this.radius);this.center.addScaledVector(Na,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(Tc.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Na.copy(e.center).add(Tc)),this.expandByPoint(Na.copy(e.center).sub(Tc))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Ri=new L,Ac=new L,Wo=new L,Ji=new L,Cc=new L,Xo=new L,Rc=new L;class Oa{constructor(e=new L,t=new L(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ri)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ri.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ri.copy(this.origin).addScaledVector(this.direction,t),Ri.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ac.copy(e).add(t).multiplyScalar(.5),Wo.copy(t).sub(e).normalize(),Ji.copy(this.origin).sub(Ac);const s=.5*e.distanceTo(t),a=-this.direction.dot(Wo),l=Ji.dot(this.direction),c=-Ji.dot(Wo),h=Ji.lengthSq(),u=Math.abs(1-a*a);let f,p,m,_;if(u>0)if(f=a*c-l,p=a*l-c,_=s*u,f>=0)if(p>=-_)if(p<=_){const x=1/u;f*=x,p*=x,m=f*(f+a*p+2*l)+p*(a*f+p+2*c)+h}else p=s,f=Math.max(0,-(a*p+l)),m=-f*f+p*(p+2*c)+h;else p=-s,f=Math.max(0,-(a*p+l)),m=-f*f+p*(p+2*c)+h;else p<=-_?(f=Math.max(0,-(-a*s+l)),p=f>0?-s:Math.min(Math.max(-s,-c),s),m=-f*f+p*(p+2*c)+h):p<=_?(f=0,p=Math.min(Math.max(-s,-c),s),m=p*(p+2*c)+h):(f=Math.max(0,-(a*s+l)),p=f>0?s:Math.min(Math.max(-s,-c),s),m=-f*f+p*(p+2*c)+h);else p=a>0?-s:s,f=Math.max(0,-(a*p+l)),m=-f*f+p*(p+2*c)+h;return n&&n.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(Ac).addScaledVector(Wo,p),m}intersectSphere(e,t){Ri.subVectors(e.center,this.origin);const n=Ri.dot(this.direction),i=Ri.dot(Ri)-n*n,s=e.radius*e.radiu
vendor: 4,096 bytes, line 1
1s;if(i>s)return null;const a=Math.sqrt(s-i),l=n-a,c=n+a;return c<0?null:this.at(l<0?c:l,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,a,l,c;const h=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,p=this.origin;return h>=0?(n=(e.min.x-p.x)*h,i=(e.max.x-p.x)*h):(n=(e.max.x-p.x)*h,i=(e.min.x-p.x)*h),u>=0?(s=(e.min.y-p.y)*u,a=(e.max.y-p.y)*u):(s=(e.max.y-p.y)*u,a=(e.min.y-p.y)*u),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a<i||isNaN(i))&&(i=a),f>=0?(l=(e.min.z-p.z)*f,c=(e.max.z-p.z)*f):(l=(e.max.z-p.z)*f,c=(e.min.z-p.z)*f),n>c||l>i)||((l>n||n!=n)&&(n=l),(c<i||i!=i)&&(i=c),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return null!==this.intersectBox(e,Ri)}intersectTriangle(e,t,n,i,s){Cc.subVectors(t,e),Xo.subVectors(n,e),Rc.crossVectors(Cc,Xo);let l,a=this.direction.dot(Rc);if(a>0){if(i)return null;l=1}else{if(!(a<0))return null;l=-1,a=-a}Ji.subVectors(this.origin,e);const c=l*this.direction.dot(Xo.crossVectors(Ji,Xo));if(c<0)return null;const h=l*this.direction.dot(Cc.cross(Ji));if(h<0||c+h>a)return null;const u=-l*Ji.dot(Rc);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class ze{constructor(e,t,n,i,s,a,l,c,h,u,f,p,m,_,x,v){ze.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,i,s,a,l,c,h,u,f,p,m,_,x,v)}set(e,t,n,i,s,a,l,c,h,u,f,p,m,_,x,v){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=a,g[9]=l,g[13]=c,g[2]=h,g[6]=u,g[10]=f,g[14]=p,g[3]=m,g[7]=_,g[11]=x,g[15]=v,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 ze).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/kr.setFromMatrixColumn(e,0).length(),s=1/kr.setFromMatrixColumn(e,1).length(),a=1/kr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,a=Math.cos(n),l=Math.sin(n),c=Math.cos(i),h=Math.sin(i),u=Math.cos(s),f=Math.sin(s);if("XYZ"===e.order){const p=a*u,m=a*f,_=l*u,x=l*f;t[0]=c*u,t[4]=-c*f,t[8]=h,t[1]=m+_*h,t[5]=p-x*h,t[9]=-l*c,t[2]=x-p*h,t[6]=_+m*h,t[10]=a*c}else if("YXZ"===e.order){const p=c*u,m=c*f,_=h*u,x=h*f;t[0]=p+x*l,t[4]=_*l-m,t[8]=a*h,t[1]=a*f,t[5]=a*u,t[9]=-l,t[2]=m*l-_,t[6]=x+p*l,t[10]=a*c}else if("ZXY"===e.order){const p=c*u,m=c*f,_=h*u,x=h*f;t[0]=p-x*l,t[4]=-a*f,t[8]=_+m*l,t[1]=m+_*l,t[5]=a*u,t[9]=x-p*l,t[2]=-a*h,t[6]=l,t[10]=a*c}else if("ZYX"===e.order){const p=a*u,m=a*f,_=l*u,x=l*f;t[0]=c*u,t[4]=_*h-m,t[8]=p*h+x,t[1]=c*f,t[5]=x*h+p,t[9]=m*h-_,t[2]=-h,t[6]=l*c,t[10]=a*c}else if("YZX"===e.order){const p=a*c,m=a*h,_=l*c,x=l*h;t[0]=c*u,t[4]=x-p*f,t[8]=_*f+m,t[1]=f,t[5]=a*u,t[9]=-l*u,t[2]=-h*u,t[6]=m*f+_,t[10]=p-x*f}
vendor: 5,445 bytes, line 1
1else if("XZY"===e.order){const p=a*c,m=a*h,_=l*c,x=l*h;t[0]=c*u,t[4]=-f,t[8]=h*u,t[1]=p*f+x,t[5]=a*u,t[9]=m*f-_,t[2]=_*f-m,t[6]=l*u,t[10]=x*f+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(up,e,dp)}lookAt(e,t,n){const i=this.elements;return bn.subVectors(e,t),0===bn.lengthSq()&&(bn.z=1),bn.normalize(),ji.crossVectors(n,bn),0===ji.lengthSq()&&(1===Math.abs(n.z)?bn.x+=1e-4:bn.z+=1e-4,bn.normalize(),ji.crossVectors(n,bn)),ji.normalize(),Yo.crossVectors(bn,ji),i[0]=ji.x,i[4]=Yo.x,i[8]=bn.x,i[1]=ji.y,i[5]=Yo.y,i[9]=bn.y,i[2]=ji.z,i[6]=Yo.z,i[10]=bn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,a=n[0],l=n[4],c=n[8],h=n[12],u=n[1],f=n[5],p=n[9],m=n[13],_=n[2],x=n[6],v=n[10],g=n[14],S=n[3],M=n[7],w=n[11],O=n[15],R=i[0],I=i[4],N=i[8],Z=i[12],b=i[1],T=i[5],q=i[9],Y=i[13],$=i[2],re=i[6],X=i[10],oe=i[14],J=i[3],xe=i[7],be=i[11],Se=i[15];return s[0]=a*R+l*b+c*$+h*J,s[4]=a*I+l*T+c*re+h*xe,s[8]=a*N+l*q+c*X+h*be,s[12]=a*Z+l*Y+c*oe+h*Se,s[1]=u*R+f*b+p*$+m*J,s[5]=u*I+f*T+p*re+m*xe,s[9]=u*N+f*q+p*X+m*be,s[13]=u*Z+f*Y+p*oe+m*Se,s[2]=_*R+x*b+v*$+g*J,s[6]=_*I+x*T+v*re+g*xe,s[10]=_*N+x*q+v*X+g*be,s[14]=_*Z+x*Y+v*oe+g*Se,s[3]=S*R+M*b+w*$+O*J,s[7]=S*I+M*T+w*re+O*xe,s[11]=S*N+M*q+w*X+O*be,s[15]=S*Z+M*Y+w*oe+O*Se,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],a=e[1],l=e[5],c=e[9],h=e[13],u=e[2],f=e[6],p=e[10],m=e[14];return e[3]*(+s*c*f-i*h*f-s*l*p+n*h*p+i*l*m-n*c*m)+e[7]*(+t*c*m-t*h*p+s*a*p-i*a*m+i*h*u-s*c*u)+e[11]*(+t*h*f-t*l*m-s*a*f+n*a*m+s*l*u-n*h*u)+e[15]*(-i*l*u-t*c*f+t*l*p+i*a*f-n*a*p+n*c*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=e[8],f=e[9],p=e[10],m=e[11],_=e[12],x=e[13],v=e[14],g=e[15],S=f*v*h-x*p*h+x*c*m-l*v*m-f*c*g+l*p*g,M=_*p*h-u*v*h-_*c*m+a*v*m+u*c*g-a*p*g,w=u*x*h-_*f*h+_*l*m-a*x*m-u*l*g+a*f*g,O=_*f*c-u*x*c-_*l*p+a*x*p+u*l*v-a*f*v,R=t*S+n*M+i*w+s*O;if(0===R)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/R;return e[0]=S*I,e[1]=(x*p*s-f*v*s-x*i*m+n*v*m+f*i*g-n*p*g)*I,e[2]=(l*v*s-x*c*s+x*i*h-n*v*h-l*i*g+n*c*g)*I,e[3]=(f*c*s-l*p*s-f*i*h+n*p*h+l*i*m-n*c*m)*I,e[4]=M*I,e[5]=(u*v*s-_*p*s+_*i*m-t*v*m-u*i*g+t*p*g)*I,e[6]=(_*c*s-a*v*s-_*i*h+t*v*h+a*i*g-t*c*g)*I,e[7]=(a*p*s-u*c*s+u*i*h-t*p*h-a*i*m+t*c*m)*I,e[8]=w*I,e[9]=(_*f*s-u*x*s-_*n*m+t*x*m+u*n*g-t*f*g)*I,e[10]=(a*x*s-_*l*s+_*n*h-t*x*h-a*n*g+t*l*g)*I,e[11]=(u*l*s-a*f*s-u*n*h+t*f*h+a*n*m-t*l*m)*I,e[12]=O*I,e[13]=(u*x*i-_*f*i+_*n*p-t*x*p-u*n*v+t*f*v)*I,e[14]=(_*l*i-a*x*i-_*n*c+t*x*c+a*n*v-t*l*v)*I,e[15]=(a*f*i-u*l*i+u*n*c-t*f*c-a*n*p+t*l*p)*I,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,a=e.x,l=e.y,c=e.z,h=s*a,u=s*l;return this.set(h*a+n,h*l-i*c,h*c+i*l,0,h*l+i*c,u*l+n,u*c-i*a,0,h*c-i*l,u*c+i*a,s*c*c+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,a){return this.set(1,n,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,a=t._y,l=t._z,c=t._w,h=s+s,u=a+a,f=l+l,p=s*h,m=s*u,_=s*f,x=a*u,v=a*f,g=l*f,S=c*h,M=c*u,w=c*f,O=n.x,R=n.y,I=n.z;return i[0]=(1-(x+g))*O,i[1]=(m+w)*O,i[2]=(_-M)*O,i[3]=0,i[4]=(m-w)*R,i[5]=(1-(p+g))*R,i[6]=(v+S)*R,i[7]=0,i[8]=(_+M)*I,i[9]=(v-S)*I,i[10]=(1-(p+x))*I,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=kr.set(i[0],i[1],i[2]).length();const a=kr.set(i[4],i[5],i[6]).length(),l=kr.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],qn.copy(this);const h=1/s,u=1/a,f=1/l;return qn.elements[0]*=h,qn.elements[1]*=h,qn.elements[2]*=h,qn.elements[4]*=u,qn.elements[5]*=u,qn.elements[6]*=u,qn.elements[8]*=f,qn.elements[9]*=f,qn.elements[10]*=f,t.setFromRotationMatrix(qn),n.x=s,n.y=a,n.z=l,this}makePerspective(e,t,n,i,s,a,l=Xn){const c=this.elements,h=2*s/(t-e),u=2*s/(n-i),f=(t+e)/(t-e),p=(n+i)/(n-i);let m,_;if(l===Xn)m=-(a+s)/(a-s),_=-2*a*s/(a-s);else{if(2001!==l)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);m=-a/(a-s),_=-a*s/(a-s)}
vendor: 4,438 bytes, line 1
1return c[0]=h,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=u,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=m,c[14]=_,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,i,s,a,l=Xn){const c=this.elements,h=1/(t-e),u=1/(n-i),f=1/(a-s),p=(t+e)*h,m=(n+i)*u;let _,x;if(l===Xn)_=(a+s)*f,x=-2*f;else{if(2001!==l)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);_=s*f,x=-1*f}return c[0]=2*h,c[4]=0,c[8]=0,c[12]=-p,c[1]=0,c[5]=2*u,c[9]=0,c[13]=-m,c[2]=0,c[6]=0,c[10]=x,c[14]=-_,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const kr=new L,qn=new ze,up=new L(0,0,0),dp=new L(1,1,1),ji=new L,Yo=new L,bn=new L,su=new ze,ru=new dn;let oi=(()=>{class r{constructor(t=0,n=0,i=0,s=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,n,i,s=this._order){return this._x=t,this._y=n,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,n=this._order,i=!0){const s=t.elements,a=s[0],l=s[4],c=s[8],h=s[1],u=s[5],f=s[9],p=s[2],m=s[6],_=s[10];switch(n){case"XYZ":this._y=Math.asin(yt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-f,_),this._z=Math.atan2(-l,a)):(this._x=Math.atan2(m,u),this._z=0);break;case"YXZ":this._x=Math.asin(-yt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(c,_),this._z=Math.atan2(h,u)):(this._y=Math.atan2(-p,a),this._z=0);break;case"ZXY":this._x=Math.asin(yt(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,_),this._z=Math.atan2(-l,u)):(this._y=0,this._z=Math.atan2(h,a));break;case"ZYX":this._y=Math.asin(-yt(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,_),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-l,u));break;case"YZX":this._z=Math.asin(yt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-f,u),this._y=Math.atan2(-p,a)):(this._x=0,this._y=Math.atan2(c,_));break;case"XZY":this._z=Math.asin(-yt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(m,u),this._y=Math.atan2(c,a)):(this._x=Math.atan2(-f,_),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,n,i){return su.makeRotationFromQuaternion(t),this.setFromRotationMatrix(su,n,i)}setFromVector3(t,n=this._order){return this.set(t.x,t.y,t.z,n)}reorder(t){return ru.setFromEuler(this),this.setFromQuaternion(ru,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return r.DEFAULT_ORDER="XYZ",r})();class Ic{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let fp=0;const au=new L,Hr=new dn,Ii=new ze,qo=new L,Fa=new L,pp=new L,mp=new dn,ou=new L(1,0,0),lu=new L(0,1,0),cu=new L(0,0,1),hu={type:"added"},gp={type:"removed"},Vr={type:"childadded",child:null},Pc={type:"childremoved",child:null};let fn=(()=>{class r extends qi{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:fp++}),this.uuid=sn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();
vendor: 3,010 bytes, line 1
1const t=new L,n=new oi,i=new dn,s=new L(1,1,1);n._onChange(function a(){i.setFromEuler(n,!1)}),i._onChange(function l(){n.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new ze},normalMatrix:{value:new d}}),this.matrix=new ze,this.matrixWorld=new ze,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Ic,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,n){this.quaternion.setFromAxisAngle(t,n)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,n){return Hr.setFromAxisAngle(t,n),this.quaternion.multiply(Hr),this}rotateOnWorldAxis(t,n){return Hr.setFromAxisAngle(t,n),this.quaternion.premultiply(Hr),this}rotateX(t){return this.rotateOnAxis(ou,t)}rotateY(t){return this.rotateOnAxis(lu,t)}rotateZ(t){return this.rotateOnAxis(cu,t)}translateOnAxis(t,n){return au.copy(t).applyQuaternion(this.quaternion),this.position.add(au.multiplyScalar(n)),this}translateX(t){return this.translateOnAxis(ou,t)}translateY(t){return this.translateOnAxis(lu,t)}translateZ(t){return this.translateOnAxis(cu,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ii.copy(this.matrixWorld).invert())}lookAt(t,n,i){t.isVector3?qo.copy(t):qo.set(t,n,i);const s=this.parent;this.updateWorldMatrix(!0,!1),Fa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ii.lookAt(Fa,qo,this.up):Ii.lookAt(qo,Fa,this.up),this.quaternion.setFromRotationMatrix(Ii),s&&(Ii.extractRotation(s.matrixWorld),Hr.setFromRotationMatrix(Ii),this.quaternion.premultiply(Hr.invert()))}add(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(hu),Vr.child=t,this.dispatchEvent(Vr),Vr.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const n=this.children.indexOf(t);
vendor: 17,419 bytes, line 1
1return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(gp),Pc.child=t,this.dispatchEvent(Pc),Pc.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ii.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Ii.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ii),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(hu),Vr.child=t,this.dispatchEvent(Vr),Vr.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,n){if(this[t]===n)return this;for(let i=0,s=this.children.length;i<s;i++){const l=this.children[i].getObjectByProperty(t,n);if(void 0!==l)return l}}getObjectsByProperty(t,n,i=[]){this[t]===n&&i.push(this);const s=this.children;for(let a=0,l=s.length;a<l;a++)s[a].getObjectsByProperty(t,n,i);return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fa,t,pp),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fa,mp,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return t.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(t){t(this);const n=this.children;for(let i=0,s=n.length;i<s;i++)n[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const n=this.children;for(let i=0,s=n.length;i<s;i++)n[i].traverseVisible(t)}traverseAncestors(t){const n=this.parent;null!==n&&(t(n),n.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const n=this.children;for(let i=0,s=n.length;i<s;i++)n[i].updateMatrixWorld(t)}updateWorldMatrix(t,n){const i=this.parent;if(!0===t&&null!==i&&i.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===n){const s=this.children;for(let a=0,l=s.length;a<l;a++)s[a].updateWorldMatrix(!1,!0)}}toJSON(t){const n=void 0===t||"string"==typeof t,i={};n&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const s={};function a(c,h){return void 0===c[h.uuid]&&(c[h.uuid]=h.toJSON(t)),h.uuid}if(s.uuid=this.uuid,s.type=this.type,""!==this.name&&(s.name=this.name),!0===this.castShadow&&(s.castShadow=!0),!0===this.receiveShadow&&(s.receiveShadow=!0),!1===this.visible&&(s.visible=!1),!1===this.frustumCulled&&(s.frustumCulled=!1),0!==this.renderOrder&&(s.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),null!==this._colorsTexture&&(s.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),null!==this.boundingBox&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=a(t.geometries,this.geometry);const c=this.geometry.parameters;if(void 0!==c&&void 0!==c.shapes){const h=c.shapes;if(Array.isArray(h))for(let u=0,f=h.length;u<f;u++)a(t.shapes,h[u]);else a(t.shapes,h)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(t.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const c=[];for(let h=0,u=this.material.length;h<u;h++)c.push(a(t.materials,this.material[h]));s.material=c}else s.material=a(t.materials,this.material);if(this.children.length>0){s.children=[];for(let c=0;c<this.children.length;c++)s.children.push(this.children[c].toJSON(t).object)}if(this.animations.length>0){s.animations=[];for(let c=0;c<this.animations.length;c++)s.animations.push(a(t.animations,this.animations[c]))}if(n){const c=l(t.geometries),h=l(t.materials),u=l(t.textures),f=l(t.images),p=l(t.shapes),m=l(t.skeletons),_=l(t.animations),x=l(t.nodes);c.length>0&&(i.geometries=c),h.length>0&&(i.materials=h),u.length>0&&(i.textures=u),f.length>0&&(i.images=f),p.length>0&&(i.shapes=p),m.length>0&&(i.skeletons=m),_.length>0&&(i.animations=_),x.length>0&&(i.nodes=x)}return i.object=s,i;function l(c){const h=[];for(const u in c){const f=c[u];delete f.metadata,h.push(f)}return h}}clone(t){return(new this.constructor).copy(this,t)}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===n)for(let i=0;i<t.children.length;i++)this.add(t.children[i].clone());return this}}return r.DEFAULT_UP=new L(0,1,0),r.DEFAULT_MATRIX_AUTO_UPDATE=!0,r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,r})();const Zn=new L,Pi=new L,Lc=new L,Li=new L,Gr=new L,Wr=new L,uu=new L,Uc=new L,Dc=new L,Nc=new L,Oc=new lt,Fc=new lt,Bc=new lt;class Sn{constructor(e=new L,t=new L,n=new L){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Zn.subVectors(e,t),i.cross(Zn);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Zn.subVectors(i,t),Pi.subVectors(n,t),Lc.subVectors(e,t);const a=Zn.dot(Zn),l=Zn.dot(Pi),c=Zn.dot(Lc),h=Pi.dot(Pi),u=Pi.dot(Lc),f=a*h-l*l;if(0===f)return s.set(0,0,0),null;const p=1/f,m=(h*c-l*u)*p,_=(a*u-l*c)*p;return s.set(1-m-_,_,m)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,Li)&&Li.x>=0&&Li.y>=0&&Li.x+Li.y<=1}static getInterpolation(e,t,n,i,s,a,l,c){return null===this.getBarycoord(e,t,n,i,Li)?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(s,Li.x),c.addScaledVector(a,Li.y),c.addScaledVector(l,Li.z),c)}static getInterpolatedAttribute(e,t,n,i,s,a){return Oc.setScalar(0),Fc.setScalar(0),Bc.setScalar(0),Oc.fromBufferAttribute(e,t),Fc.fromBufferAttribute(e,n),Bc.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(Oc,s.x),a.addScaledVector(Fc,s.y),a.addScaledVector(Bc,s.z),a}static isFrontFacing(e,t,n,i){return Zn.subVectors(n,t),Pi.subVectors(e,t),Zn.cross(Pi).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Zn.subVectors(this.c,this.b),Pi.subVectors(this.a,this.b),.5*Zn.cross(Pi).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Sn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Sn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return Sn.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return Sn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Sn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let a,l;Gr.subVectors(i,n),Wr.subVectors(s,n),Uc.subVectors(e,n);const c=Gr.dot(Uc),h=Wr.dot(Uc);if(c<=0&&h<=0)return t.copy(n);Dc.subVectors(e,i);const u=Gr.dot(Dc),f=Wr.dot(Dc);if(u>=0&&f<=u)return t.copy(i);const p=c*f-u*h;if(p<=0&&c>=0&&u<=0)return a=c/(c-u),t.copy(n).addScaledVector(Gr,a);Nc.subVectors(e,s);const m=Gr.dot(Nc),_=Wr.dot(Nc);if(_>=0&&m<=_)return t.copy(s);const x=m*h-c*_;if(x<=0&&h>=0&&_<=0)return l=h/(h-_),t.copy(n).addScaledVector(Wr,l);const v=u*_-m*f;if(v<=0&&f-u>=0&&m-_>=0)return uu.subVectors(s,i),l=(f-u)/(f-u+(m-_)),t.copy(i).addScaledVector(uu,l);const g=1/(v+x+p);return a=x*g,l=p*g,t.copy(n).addScaledVector(Gr,a).addScaledVector(Wr,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const du={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Qi={h:0,s:0,l:0},Zo={h:0,s:0,l:0};function zc(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+6*(e-r)*t:t<.5?e:t<2/3?r+6*(e-r)*(2/3-t):r}class Me{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const i=e;i&&i.isColor?this.copy(i):"number"==typeof i?this.setHex(i):"string"==typeof i&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=un){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,it.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=it.workingColorSpace){return this.r=e,this.g=t,this.b=n,it.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=it.workingColorSpace){if(e=Ua(e,1),t=yt(t,0,1),n=yt(n,0,1),0===t)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=zc(a,s,e+1/3),this.g=zc(a,s,e),this.b=zc(a,s,e-1/3)}return it.toWorkingColorSpace(this,i),this}setStyle(e,t=un){function n(s){void 0!==s&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const l=i[2];switch(i[1]){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],a=s.length;if(3===a)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(6===a)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=un){const n=du[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Dr(e.r),this.g=Dr(e.g),this.b=Dr(e.b),this}copyLinearToSRGB(e){return this.r=Mc(e.r),this.g=Mc(e.g),this.b=Mc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=un){return it.fromWorkingColorSpace(jt.copy(this),e),65536*Math.round(yt(255*jt.r,0,255))+256*Math.round(yt(255*jt.g,0,255))+Math.round(yt(255*jt.b,0,255))}getHexString(e=un){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=it.workingColorSpace){it.fromWorkingColorSpace(jt.copy(this),t);const n=jt.r,i=jt.g,s=jt.b,a=Math.max(n,i,s),l=Math.min(n,i,s);let c,h;const u=(l+a)/2;if(l===a)c=0,h=0;else{const f=a-l;switch(h=u<=.5?f/(a+l):f/(2-a-l),a){case n:c=(i-s)/f+(i<s?6:0);break;case i:c=(s-n)/f+2;break;case s:c=(n-i)/f+4}c/=6}return e.h=c,e.s=h,e.l=u,e}getRGB(e,t=it.workingColorSpace){return it.fromWorkingColorSpace(jt.copy(this),t),e.r=jt.r,e.g=jt.g,e.b=jt.b,e}getStyle(e=un){it.fromWorkingColorSpace(jt.copy(this),e);const t=jt.r,n=jt.g,i=jt.b;return e!==un?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(e,t,n){return this.getHSL(Qi),this.setHSL(Qi.h+e,Qi.s+t,Qi.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}
vendor: 2,714 bytes, line 1
1lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Qi),e.getHSL(Zo);const n=ri(Qi.h,Zo.h,t),i=ri(Qi.s,Zo.s,t),s=ri(Qi.l,Zo.l,t);return this.setHSL(n,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const jt=new Me;Me.NAMES=du;let vp=0;class Ba extends qi{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:vp++}),this.uuid=sn(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Me(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Wi,this.stencilZFail=Wi,this.stencilZPass=Wi,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(s){const a=[];for(const l in s){const c=s[l];delete c.metadata,a.push(c)}return a}
vendor: 5,428 bytes, line 1
1if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),100!==this.blendEquation&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&
vendor: 5,878 bytes, line 1
1(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Wi&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Wi&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Wi&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const s=i(e.textures),a=i(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class es extends Ba{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Me(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new oi,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Lt=new L,$o=new o;class Ut{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this.updateRanges=[],this.gpuType=Jt,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;
vendor: 4,744 bytes, line 1
1for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)$o.fromBufferAttribute(this,t),$o.applyMatrix3(e),this.setXY(t,$o.x,$o.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Lt.fromBufferAttribute(this,t),Lt.applyMatrix3(e),this.setXYZ(t,Lt.x,Lt.y,Lt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Lt.fromBufferAttribute(this,t),Lt.applyMatrix4(e),this.setXYZ(t,Lt.x,Lt.y,Lt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Lt.fromBufferAttribute(this,t),Lt.applyNormalMatrix(e),this.setXYZ(t,Lt.x,Lt.y,Lt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Lt.fromBufferAttribute(this,t),Lt.transformDirection(e),this.setXYZ(t,Lt.x,Lt.y,Lt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Yt(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=He(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Yt(t,this.array)),t}setX(e,t){return this.normalized&&(t=He(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Yt(t,this.array)),t}setY(e,t){return this.normalized&&(t=He(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Yt(t,this.array)),t}setZ(e,t){return this.normalized&&(t=He(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Yt(t,this.array)),t}setW(e,t){return this.normalized&&(t=He(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=He(t,this.array),n=He(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=He(t,this.array),n=He(n,this.array),i=He(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=He(t,this.array),n=He(n,this.array),i=He(i,this.array),s=He(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),e}}class fu extends Ut{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class pu extends Ut{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Le extends Ut{constructor(e,t,n){super(new Float32Array(e),t,n)}}let xp=0;const On=new ze,kc=new fn,Xr=new L,wn=new rn,ka=new rn,Gt=new L;class je extends qi{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:xp++}),this.uuid=sn(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return this.index=Array.isArray(e)?new(C(e)?pu:fu)(e,1):e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const s=(new d).getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return On.makeRotationFromQuaternion(e),this.applyMatrix4(On),this}rotateX(e){return On.makeRotationX(e),this.applyMatrix4(On),this}rotateY(e){return On.makeRotationY(e),this.applyMatrix4(On),this}rotateZ(e){return On.makeRotationZ(e),this.applyMatrix4(On),this}translate(e,t,n){return On.makeTranslation(e,t,n),this.applyMatrix4(On),this}scale(e,t,n){return On.makeScale(e,t,n),this.applyMatrix4(On),this}lookAt(e){return kc.lookAt(e),kc.updateMatrix(),this.applyMatrix4(kc.matrix
vendor: 4,324 bytes, line 1
1),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Xr).negate(),this.translate(Xr.x,Xr.y,Xr.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Le(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new rn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new L(-1/0,-1/0,-1/0),new L(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++)wn.setFromBufferAttribute(t[n]),this.morphTargetsRelative?(Gt.addVectors(this.boundingBox.min,wn.min),this.boundingBox.expandByPoint(Gt),Gt.addVectors(this.boundingBox.max,wn.max),this.boundingBox.expandByPoint(Gt)):(this.boundingBox.expandByPoint(wn.min),this.boundingBox.expandByPoint(wn.max))}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new an);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new L,1/0);if(e){const n=this.boundingSphere.center;if(wn.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++)ka.setFromBufferAttribute(t[s]),this.morphTargetsRelative?(Gt.addVectors(wn.min,ka.min),wn.expandByPoint(Gt),Gt.addVectors(wn.max,ka.max),wn.expandByPoint(Gt)):(wn.expandByPoint(ka.min),wn.expandByPoint(ka.max));wn.getCenter(n);let i=0;for(let s=0,a=e.count;s<a;s++)Gt.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Gt));if(t)for(let s=0,a=t.length;s<a;s++){const l=t[s],c=this.morphTargetsRelative;for(let h=0,u=l.count;h<u;h++)Gt.fromBufferAttribute(l,h),c&&(Xr.fromBufferAttribute(e,h),Gt.add(Xr)),i=Math.max(i,n.distanceToSquared(Gt))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.position,i=t.normal,s=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Ut(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),l=[],c=[];for(let N=0;N<n.count;N++)l[N]=new L,c[N]=new L;const h=new L,u=new L,f=new L,p=new o,m=new o,_=new o,x=new L,v=new L;function g(N,Z,b){h.fromBufferAttribute(n,N),u.fromBufferAttribute(n,Z),f.fromBufferAttribute(n,b),p.fromBufferAttribute(s,N),m.fromBufferAttribute(s,Z),_.fromBufferAttribute(s,b),u.sub(h),f.sub(h),m.sub(p),_.sub(p);const T=1/(m.x*_.y-_.x*m.y);!isFinite(T)||(x.copy(u).multiplyScalar(_.y).addScaledVector(f,-m.y).multiplyScalar(T),v.copy(f).multiplyScalar(m.x).addScaledVector(u,-_.x).multiplyScalar(T),l[N].add(x),l[Z].add(x),l[b].add(x),c[N].add(v),c[Z].add(v),c[b].add(v))}let S=this.groups;0===S.length&&(S=[{start:0,count:e.count}]);for(let N=0,Z=S.length;N<Z;++N){const b=S[N],T=b.start;for(let Y=T,$=T+b.count;Y<$;Y+=3)g(e.getX(Y+0),e.getX(Y+1),e.getX(Y+2))}const M=new L,w=new L,O=new L,R=new L;function I(N){O.fromBufferAttribute(i,N),R.copy(O);const Z=l[N];M.copy(Z),M.sub(O.multiplyScalar(O.dot(Z))).normalize(),w.crossVectors(R,Z);const T=w.dot(c[N])<0?-1:1;a.setXYZW(N,M.x,M.y,M.z,T)}for(let N=0,Z=S.length;N<Z;++N){const b=S[N],T=b.start;for(let Y=T,$=T+b.count;Y<$;Y+=3)I(e.getX(Y+0)),I(e.getX(Y+1)),I(e.getX(Y+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new Ut(new Float32Array(3*t.count),3),this.setAttribute("normal",n
vendor: 8,321 bytes, line 1
1);else for(let p=0,m=n.count;p<m;p++)n.setXYZ(p,0,0,0);const i=new L,s=new L,a=new L,l=new L,c=new L,h=new L,u=new L,f=new L;if(e)for(let p=0,m=e.count;p<m;p+=3){const _=e.getX(p+0),x=e.getX(p+1),v=e.getX(p+2);i.fromBufferAttribute(t,_),s.fromBufferAttribute(t,x),a.fromBufferAttribute(t,v),u.subVectors(a,s),f.subVectors(i,s),u.cross(f),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,x),h.fromBufferAttribute(n,v),l.add(u),c.add(u),h.add(u),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(x,c.x,c.y,c.z),n.setXYZ(v,h.x,h.y,h.z)}else for(let p=0,m=t.count;p<m;p+=3)i.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),a.fromBufferAttribute(t,p+2),u.subVectors(a,s),f.subVectors(i,s),u.cross(f),n.setXYZ(p+0,u.x,u.y,u.z),n.setXYZ(p+1,u.x,u.y,u.z),n.setXYZ(p+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Gt.fromBufferAttribute(e,t),Gt.normalize(),e.setXYZ(t,Gt.x,Gt.y,Gt.z)}toNonIndexed(){function e(l,c){const h=l.array,u=l.itemSize,f=l.normalized,p=new h.constructor(c.length*u);let m=0,_=0;for(let x=0,v=c.length;x<v;x++){m=l.isInterleavedBufferAttribute?c[x]*l.data.stride+l.offset:c[x]*u;for(let g=0;g<u;g++)p[_++]=h[m++]}return new Ut(p,u,f)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new je,n=this.index.array,i=this.attributes;for(const l in i){const h=e(i[l],n);t.setAttribute(l,h)}const s=this.morphAttributes;for(const l in s){const c=[],h=s[l];for(let u=0,f=h.length;u<f;u++){const m=e(h[u],n);c.push(m)}t.morphAttributes[l]=c}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let l=0,c=a.length;l<c;l++){const h=a[l];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const c=this.parameters;for(const h in c)void 0!==c[h]&&(e[h]=c[h]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const c in n)e.data.attributes[c]=n[c].toJSON(e.data);const i={};let s=!1;for(const c in this.morphAttributes){const h=this.morphAttributes[c],u=[];for(let f=0,p=h.length;f<p;f++)u.push(h[f].toJSON(e.data));u.length>0&&(i[c]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const l=this.boundingSphere;return null!==l&&(e.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const i=e.attributes;for(const h in i)this.setAttribute(h,i[h].clone(t));const s=e.morphAttributes;for(const h in s){const u=[],f=s[h];for(let p=0,m=f.length;p<m;p++)u.push(f[p].clone(t));this.morphAttributes[h]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let h=0,u=a.length;h<u;h++){const f=a[h];this.addGroup(f.start,f.count,f.materialIndex)}const l=e.boundingBox;null!==l&&(this.boundingBox=l.clone());const c=e.boundingSphere;return null!==c&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const mu=new ze,Rs=new Oa,Ko=new an,gu=new L,Jo=new L,jo=new L,Qo=new L,Hc=new L,el=new L,vu=new L,tl=new L;class Qt extends fn{constructor(e=new je,t=new es){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const l=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}getVertexPosition(e,t){const n=this.geometry,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(n.attributes.position,e);const l=this.morphTargetInfluences;if(s&&l){el.set(0,0,0);for(let c=0,h=s.length;c<h;c++){const u=l[c],f=s[c];0!==u&&(Hc.fromBufferAttribute(f,e),el.addScaledVector(a?Hc:Hc.sub(t),u))}t.add(el)}return t}raycast(e,t){const n=this.geometry,s=this.matrixWorld;void 0!==this.material&&(null===n.boundingSphere&&n.computeBoundingSphere(),Ko.copy(n.boundingSphere),Ko.applyMatrix4(s),Rs.copy(e.ray).recast(e.near),(!1!==Ko.containsPoint(Rs.origin)||!(null===Rs.intersectSphere(Ko,gu)||Rs.origin.distanceToSquared(gu)>Ef(e.far-e.near,2)))&&(mu.copy(s).invert(),Rs.copy(e.ray).applyMatrix4(mu),(null===n.boundingBox||!1!==Rs.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,Rs)))}_computeIntersections(e,t,n){let i;const s=this.geometry,a=this.material,l=s.index,c=s.attributes.position,h=s.attributes.uv,u=s.attributes.uv1,f=s.attributes.normal,p=s.groups,m=s.drawRange;if(null!==l)if(Array.isArray(a))for(let _=0,x=p.length;_<x;_++){const v=p[_],g=a[v.materialIndex];for(let w=Math.max(v.start,m.start),O=Math.min(l.count,Math.min(v.start+v.count,m.start+m.count));w<O;w+=3)i=nl(this,g,e,n,h,u,f,l.getX(w),l.getX(w+1),l.getX(w+2)),i&&(i.faceIndex=Math.floor(w/3),i.face.materialIndex=v.materialIndex,t.push(i))}else for(let v=Math.max(0,m.start),g=Math.min(l.count,m.start+m.count);v<g;v+=3)i=nl(this,a,e,n,h,u,f,l.getX(v),l.getX(v+1),l.getX(v+2)),i&&(i.faceIndex=Math.floor(v/3),t.push(i));else if(void 0!==c)if(Array.isArray(a))for(let _=0,x=p.length;_<x;_++){const v=p[_],g=a[v.materialIndex];for(let w=Math.max(v.start,m.start),O=Math.min(c.count,Math.min(v.start+v.count,m.start+m.count));w<O;w+=3)i=nl(this,g,e,n,h,u,f,w,w+1,w+2),i&&(i.faceIndex=Math.floor(w/3),i.face.materialIndex=v.materialIndex,t.push(i))}else for(let v=Math.max(0,m.start),g=Math.min(c.count,m.start+m.count);v<g;v+=3)i=nl(this,a,e,n,h,u,f,v,v+1,v+2),i&&(i.faceIndex=Math.floor(v/3),t.push(i))}}function nl(r,e,t,n,i,s,a,l,c,h){r.getVertexPosition(l,Jo),r.getVertexPosition(c,jo),r.getVertexPosition(h,Qo);const u=function yp(r,e,t,n,i,s,a,l){let c;if(c=1===e.side?n.intersectTriangle(a,s,i,!0,l):n.intersectTriangle(i,s,a,0===e.side,l),null===c)return null;tl.copy(l),tl.applyMatrix4(r.matrixWorld);const h=t.ray.origin.distanceTo(tl);return h<t.near||h>t.far?null:{distance:h,point:tl.clone(),object:r}}(r,e,t,n,Jo,jo,Qo,vu);if(u){const f=new L;Sn.getBarycoord(vu,Jo,jo,Qo,f),i&&(u.uv=Sn.getInterpolatedAttribute(i,l,c,h,f,new o)),s&&(u.uv1=Sn.getInterpolatedAttribute(s,l,c,h,f,new o)),a&&(u.normal=Sn.getInterpolatedAttribute(a,l,c,h,f,new L),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const p={a:l,b:c,c:h,normal:new L,materialIndex:0};Sn.getNormal(Jo,jo,Qo,p.normal),u.face=p,u.barycoord=f}return u}class Yr extends je{constructor(e=1,t=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};const l=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const c=[],h=[],u=[],f=[];let p=0,m=0;function _(x,v,g,S,M,w,O,R,I,N,Z){const b=w/I,T=O/N,q=w/2,Y=O/2,$=R/2,re=I+1,X=N+1;let oe=0,J=0;const xe=new L;for(let be=0;be<X;be++){const Se=be*T-Y;for(let et=0;et<re;et++)xe[x]=(et*b-q)*S,xe[v]=Se*M,xe[g]=$,h.push(xe.x,xe.y,xe.z),xe[x]=0,xe[v]=0,xe[g]=R>0?1:-1,u.push(xe.x,xe.y,xe.z),f.push(et/I),f.push(1-be/N),oe+=1}for(let be=0;be<N;be++)for(let Se=0;Se<I;Se++){const ct=p+Se+re*(be+1),j=p+(Se+1)+re*(be+1),ce=p+(Se+1)+re*be;c.push(p+Se+re*be,ct,ce),c.push(ct,j,ce),J+=6}l.addGroup(m,J,Z),m+=J,p+=oe}_("z","y","x",-1,-1,n,t,e,a,s,0),_("z","y","x",1,-1,n,t,-e,a,s,1
vendor: 4,662 bytes, line 1
1),_("x","z","y",1,1,e,n,t,i,a,2),_("x","z","y",1,-1,e,n,-t,i,a,3),_("x","y","z",1,-1,e,t,n,i,s,4),_("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(c),this.setAttribute("position",new Le(h,3)),this.setAttribute("normal",new Le(u,3)),this.setAttribute("uv",new Le(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Yr(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function qr(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():e[t][n]=Array.isArray(i)?i.slice():i}}return e}function on(r){const e={};for(let t=0;t<r.length;t++){const n=qr(r[t]);for(const i in n)e[i]=n[i]}return e}function _u(r){const e=r.getRenderTarget();return null===e?r.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:it.workingColorSpace}const bp={clone:qr,merge:on};class Di extends Ba{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=qr(e.uniforms),this.uniformsGroups=function Mp(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;t.uniforms[i]=a&&a.isTexture?{type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?{type:"c",value:a.getHex()}:a&&a.isVector2?{type:"v2",value:a.toArray()}:a&&a.isVector3?{type:"v3",value:a.toArray()}:a&&a.isVector4?{type:"v4",value:a.toArray()}:a&&a.isMatrix3?{type:"m3",value:a.toArray()}:a&&a.isMatrix4?{type:"m4",value:a.toArray()}:{value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)!0===this.extensions[i]&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Vc extends fn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ze,this.projectionMatrix=new ze,this.projectionMatrixInverse=new ze,this.coordinateSystem=Xn}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const ts=new L,xu=new o,yu=new o;class qt extends Vc{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*si*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Ti*this.fov);return.5*this.getFilmHeight()/e}
vendor: 4,357 bytes, line 1
1getEffectiveFOV(){return 2*si*Math.atan(Math.tan(.5*Ti*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){ts.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ts.x,ts.y).multiplyScalar(-e/ts.z),ts.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ts.x,ts.y).multiplyScalar(-e/ts.z)}getViewSize(e,t){return this.getViewBounds(e,xu,yu),t.subVectors(yu,xu)}setViewOffset(e,t,n,i,s,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Ti*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const a=this.view;if(null!==this.view&&this.view.enabled){const c=a.fullWidth,h=a.fullHeight;s+=a.offsetX*i/c,t-=a.offsetY*n/h,i*=a.width/c,n*=a.height/h}const l=this.filmOffset;0!==l&&(s+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class Ep extends fn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new qt(-90,1,e,t);i.layers=this.layers,this.add(i);const s=new qt(-90,1,e,t);s.layers=this.layers,this.add(s);const a=new qt(-90,1,e,t);a.layers=this.layers,this.add(a);const l=new qt(-90,1,e,t);l.layers=this.layers,this.add(l);const c=new qt(-90,1,e,t);c.layers=this.layers,this.add(c);const h=new qt(-90,1,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,a,l,c]=t;for(const h of t)this.remove(h);if(e===Xn)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else{if(2001!==e)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1)}for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,l,c,h,u]=this.children,f=e.getRenderTarget(),p=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),_=e.xr.enabled;e.xr.enabled=!1;const x=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,s),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,l),e.setRenderTarget(n,3,i),e.render(t,c),e.setRenderTarget(n,4,i),e.render(t,h),n.texture.generateMipmaps=x,e.setRenderTarget(n,5,i),e.render(t,u),e.setRenderTarget(f,p,m),e.xr.enabled=_,n.texture.needsPMREMUpdate=!0}}class il extends ai{constructor(e,t,n,i,s,a,l,c,h,u){super(e=void 0!==e?e:[],t=void 0!==t?t:301,n,i,s,a,l,c,h,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Tp extends Zi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1};this.texture=new il([n,n,n,n,n,n],t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:xt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace
vendor: 5,690 bytes, line 1
1=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n_uniforms={tEquirect:{value:null}},n_vertexShader="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",n_fragmentShader="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",i=new Yr(5,5,5),s=new Di({name:"CubemapFromEquirect",uniforms:qr(n_uniforms),vertexShader:n_vertexShader,fragmentShader:n_fragmentShader,side:1,blending:0});s.uniforms.tEquirect.value=t;const a=new Qt(i,s),l=t.minFilter;return t.minFilter===At&&(t.minFilter=xt),new Ep(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(s)}}const Gc=new L,Ap=new L,Cp=new d;class Is{constructor(e=new L(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Gc.subVectors(n,t).cross(Ap.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Gc),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Cp.getNormalMatrix(e),i=this.coplanarPoint(Gc).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Ps=new an,sl=new L;class Ha{constructor(e=new Is,t=new Is,n=new Is,i=new Is,s=new Is,a=new Is){this.planes=[e,t,n,i,s,a]}set(e,t,n,i,s,a){const l=this.planes;return l[0].copy(e),l[1].copy(t),l[2].copy(n),l[3].copy(i),l[4].copy(s),l[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Xn){const n=this.planes,i=e.elements,s=i[0],a=i[1],l=i[2],c=i[3],h=i[4],u=i[5],f=i[6],p=i[7],m=i[8],_=i[9],x=i[10],v=i[11],g=i[12],S=i[13],M=i[14],w=i[15];if(n[0].setComponents(c-s,p-h,v-m,w-g).normalize(),n[1].setComponents(c+s,p+h,v+m,w+g).normalize(),n[2].setComponents(c+a,p+u,v+_,w+S).normalize(),n[3].setComponents(c-a,p-u,v-_,w-S).normalize(),n[4].setComponents(c-l,p-f,v-x,w-M).normalize(),t===Xn)n[5].setComponents(c+l,p+f,v+x,w+M).normalize();else{if(2001!==t)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(l,f,x,M).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Ps.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Ps.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ps)}intersectsSprite(e){return Ps.center.set(0,0,0),Ps.radius=.7071067811865476,Ps.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ps)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(sl.x=i.normal.x>0?e.max.x:e.min.x,sl.y=i.normal.y>0?e.max.y:e.min.y,sl.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(sl)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Mu(){let r=null,e=!1,t=null,n=null;function i(s,a){t(s,a),n=r.requestAnimationFrame(i)}return{start:function(){!0!==e&&null!==t&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function Rp(r){const e=new WeakMap;return{get:function i(l){return l.isInterleavedBufferAttribute&&(l=l.data),e.get(l)},remove:function s(l){l.isInterleavedBufferAttribute&&(l=l.data);const c=e.get(l);c&&(r.deleteBuffer(c.buffer),e.delete(l))}
1,update:function a(l,c){if(l.isInterleavedBufferAttribute&&(l=l.data),l.isGLBufferAttribute){const u=e.get(l);return void((!u||u.version<l.version)&&e.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version}))}const h=e.get(l);if(void 0===h)e.set(l,function t(l,c){const h=l.array,u=l.usage,f=h.byteLength,p=r.createBuffer();let m;if(r.bindBuffer(c,p),r.bufferData(c,h,u),l.onUploadCallback(),h instanceof Float32Array)m=r.FLOAT;else if(h instanceof Uint16Array)m=l.isFloat16BufferAttribute?r.HALF_FLOAT:r.UNSIGNED_SHORT;else if(h instanceof Int16Array)m=r.SHORT;else if(h instanceof Uint32Array)m=r.UNSIGNED_INT;else if(h instanceof Int32Array)m=r.INT;else if(h instanceof Int8Array)m=r.BYTE;else if(h instanceof Uint8Array)m=r.UNSIGNED_BYTE;else{if(!(h instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);m=r.UNSIGNED_BYTE}return{buffer:p,type:m,bytesPerElement:h.BYTES_PER_ELEMENT,version:l.version,size:f}}(l,c));else if(h.version<l.version){if(h.size!==l.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");(function n(l,c,h){const u=c.array,f=c.updateRanges;if(r.bindBuffer(h,l),0===f.length)r.bufferSubData(h,0,u);else{f.sort((m,_)=>m.start-_.start);let p=0;for(let m=1;m<f.length;m++){const _=f[p],x=f[m];x.start<=_.start+_.count+1?_.count=Math.max(_.count,x.start+x.count-_.start):(++p,f[p]=x)}f.length=p+1;for(let m=0,_=f.length;m<_;m++){const x=f[m];r.bufferSubData(h,x.start*u.BYTES_PER_ELEMENT,u,x.start,x.count)}c.clearUpdateRanges()}c.onUploadCallback()})(h.buffer,l,c),h.version=l.version}}}}class Va extends je{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,a=t/2,l=Math.floor(n),c=Math.floor(i),h=l+1,u=c+1,f=e/l,p=t/c,m=[],_=[],x=[],v=[];for(let g=0;g<u;g++){const S=g*p-a;for(let M=0;M<h;M++)_.push(M*f-s,-S,0),x.push(0,0,1),v.push(M/l),v.push(1-g/c)}for(let g=0;g<c;g++)for(let S=0;S<l;S++){const w=S+h*(g+1),O=S+1+h*(g+1),R=S+1+h*g;m.push(S+h*g,w,R),m.push(w,O,R)}this.setIndex(m),this.setAttribute("position",new Le(_,3)),this.setAttribute("normal",new Le(x,3)),this.setAttribute("uv",new Le(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Va(e.width,e.height,e.widthSegments,e.heightSegments)}}const Ke
vendor: 20,004 bytes, line 1
1={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,  0.0556434,\n\t\t-1.5371385,  1.8760108, -0.2040259,\n\t\t-0.4985314,  0.0415560,  1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t
1totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness
vendor: 6,840 bytes, line 1
1) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}
vendor: 5,966 bytes, line 1
1\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;
vendor: 4,695 bytes, line 1
1\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n    float x2 = x * x;\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alph
vendor: 11,921 bytes, line 1
1aB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
vendor: 4,541 bytes, line 1
1\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_L
vendor: 9,905 bytes, line 1
1IGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );
vendor: 4,597 bytes, line 1
1\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 25
vendor: 18,431 bytes, line 1
15.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;
vendor: 2,005 bytes, line 1
1\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);
vendor: 9,135 bytes, line 1
1\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;
vendor: 5,728 bytes, line 1
1\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
vendor: 37,112 bytes, line 1
1\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = 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\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform 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\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#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\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform 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\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#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\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = 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\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#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\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#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\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying 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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#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\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#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\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - 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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying 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\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - 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\tvarying 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\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#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\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying 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\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#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\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#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\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#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\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#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\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#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\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},p
vendor: 756 bytes, line 1
1e={common:{diffuse:{value:new Me(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new d},alphaMap:{value:null},alphaMapTransform:{value:new d},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new d}},envmap:{envMap:{value:null},envMapRotation:{value:new d},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new d}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new d}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new d},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new d},normalScale:{value:new o(1,1)}}
vendor: 7,745 bytes, line 1
1,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new d},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new d}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new d}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new d}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Me(16777215)}},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 Me(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new d},alphaTest:{value:0},uvTransform:{value:new d}},sprite:{diffuse:{value:new Me(16777215)},opacity:{value:1},center:{value:new o(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new d},alphaMap:{value:null},alphaMapTransform:{value:new d},alphaTest:{value:0}}},li={basic:{uniforms:on([pe.common,pe.specularmap,pe.envmap,pe.aomap,pe.lightmap,pe.fog]),vertexShader:Ke.meshbasic_vert,fragmentShader:Ke.meshbasic_frag},lambert:{uniforms:on([pe.common,pe.specularmap,pe.envmap,pe.aomap,pe.lightmap,pe.emissivemap,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.fog,pe.lights,{emissive:{value:new Me(0)}}]),vertexShader:Ke.meshlambert_vert,fragmentShader:Ke.meshlambert_frag},phong:{uniforms:on([pe.common,pe.specularmap,pe.envmap,pe.aomap,pe.lightmap,pe.emissivemap,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.fog,pe.lights,{emissive:{value:new Me(0)},specular:{value:new Me(1118481)},shininess:{value:30}}]),vertexShader:Ke.meshphong_vert,fragmentShader:Ke.meshphong_frag},standard:{uniforms:on([pe.common,pe.envmap,pe.aomap,pe.lightmap,pe.emissivemap,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.roughnessmap,pe.metalnessmap,pe.fog,pe.lights,{emissive:{value:new Me(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ke.meshphysical_vert,fragmentShader:Ke.meshphysical_frag},toon:{uniforms:on([pe.common,pe.aomap,pe.lightmap,pe.emissivemap,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.gradientmap,pe.fog,pe.lights,{emissive:{value:new Me(0)}}]),vertexShader:Ke.meshtoon_vert,fragmentShader:Ke.meshtoon_frag},matcap:{uniforms:on([pe.common,pe.bumpmap,pe.normalmap,pe.displacementmap,pe.fog,{matcap:{value:null}}]),vertexShader:Ke.meshmatcap_vert,fragmentShader:Ke.meshmatcap_frag},points:{uniforms:on([pe.points,pe.fog]),vertexShader:Ke.points_vert,fragmentShader:Ke.points_frag},dashed:{uniforms:on([pe.common,pe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ke.linedashed_vert,fragmentShader:Ke.linedashed_frag},depth:{uniforms:on([pe.common,pe.displacementmap]),vertexShader:Ke.depth_vert,fragmentShader:Ke.depth_frag},normal:{uniforms:on([pe.common,pe.bumpmap,pe.normalmap,pe.displacementmap,{opacity:{value:1}}]),vertexShader:Ke.meshnormal_vert,fragmentShader:Ke.meshnormal_frag},sprite:{uniforms:on([pe.sprite,pe.fog]),vertexShader:Ke.sprite_vert,fragmentShader:Ke.sprite_frag},background:{uniforms:{uvTransform:{value:new d},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ke.background_vert,fragmentShader:Ke.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new d}},vertexShader:Ke.backgroundCube_vert,fragmentShader:Ke.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ke.cube_vert,fragmentShader:Ke.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ke.equirect_vert,fragmentShader:Ke.equirect_frag},distanceRGBA:{uniforms:on([pe.common,pe.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ke.distanceRGBA_vert,fragmentShader:Ke.distanceRGBA_frag},shadow:{uniforms:on([pe.lights,pe.fog,{color:{value:new Me(0)},opacity:{value:1}}]),vertexShader:Ke.shadow_vert,fragmentShader:Ke.shadow_frag}};li.physical={uniforms:on([li.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new d},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new d},clearcoatNormalScale:{value:new o(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new d},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new d},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new d},sheen:{value:0},sheenColor:{value:new Me(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new d},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new d},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new d},transmissionSamplerSize:{value:new o},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new d},attenuationDistance:{value:0},attenuationColor:{value:new Me(0)},specularColor:{value:new Me(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new d},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new d},anisotropyVector:{value:new o},anisotropyMap:{value:null},anisotropyMapTransform:{value:new d}}]),vertexShader:Ke.meshphysical_vert,fragmentShader:Ke.meshphysical_frag};const rl={r:0,b:0,g:0},Ls=new oi,Rg=new ze;function Ig(r,e,t,n,i,s,a){const l=new Me(0);let h,u,c=!0===s?0:1,f=null,p=0,m=null;function _(S){let M=!0===S.isScene?S.background:null;return M&&M.isTexture&&(M=(S.backgroundBlurriness>0?t:e).get(M)),M}function g(S,M){S.getRGB(rl,_u(r)),n.buffers.color.setClear(rl.r,rl.g,rl.b,M,a)}return{getClearColor:function(){return l},setClearColor:function(S,M=1){l.set(S),c=M,g(l,c)},getClearAlpha:function(){return c},setClearAlpha:function(S){c=S,g(l,c)},render:function x(S){let M=!1;const w=_(S);null===w?g(l,c):w&&w.isColor&&(g(w,1),M=!0);const O=r.xr.getEnvironmentBlendMode();"additive"===O?n.buffers.color.setClear(0,0,0,1,a):"alpha-blend"===O&&n.buffers.color.setClear(0,0,0,0,a),(r.autoClear||M)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))},addToRenderList:function v(S,M){const w=_(M);w&&(w.isCubeTexture||306===w.mapping)?(void 0===u&&(u=new Qt(new Yr(1,1,1),new Di({name:"Backgroun
1dCubeMaterial",uniforms:qr(li.backgroundCube.uniforms),vertexShader:li.backgroundCube.vertexShader,fragmentShader:li.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(O,R,I){this.matrixWorld.copyPosition(I.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),Ls.copy(M.backgroundRotation),Ls.x*=-1,Ls.y*=-1,Ls.z*=-1,w.isCubeTexture&&!1===w.isRenderTargetTexture&&(Ls.y*=-1,Ls.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&!1===w.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Rg.makeRotationFromEuler(Ls)),u.material.toneMapped=it.getTransfer(w.colorSpace)!==Ze,(f!==w||p!==w.version||m!==r.toneMapping)&&(u.material.needsUpdate=!0,f=w,p=w.version,m=r.toneMapping),u.layers.enableAll(),S.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(void 0===h&&(h=new Qt(new Va(2,2),new Di({name:"BackgroundMaterial",uniforms:qr(li.background.uniforms),vertexShader:li.background.vertexShader,fragmentShader:li.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(h)),h.material.uniforms.t2D.value=w,h.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,h.material.toneMapped=it.getTransfer(w.colorSpace)!==Ze,!0===w.matrixAutoUpdate&&w.updateMatrix(),h.material.uniforms.uvTransform.value.copy(w.matrix),(f!==w||p!==w.version||m!==r.toneMapping)&&(h.material.needsUpdate=!0,f=w,p=w.version,m=r.toneMapping),h.layers.enableAll(),S.unshift(h,h.geometry,h.material,0,0,null))}}}function Pg(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=p(null);let s=i,a=!1;function h(b){return r.bindVertexArray(b)}function u(b){return r.deleteVertexArray(b)}function p(b){const T=[],q=[],Y=[];for(let $=0;$<t;$++)T[$]=0,q[$]=0,Y[$]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:T,enabledAttributes:q,attributeDivisors:Y,object:b,attributes:{},index:null}}function x(){const b=s.newAttributes;for(let T=0,q=b.length;T<q;T++)b[T]=0}function v(b){g(b,0)}function g(b,T){const Y=s.enabledAttributes,$=s.attributeDivisors;s.newAttributes[b]=1,0===Y[b]&&(r.enableVertexAttribArray(b),Y[b]=1),$[b]!==T&&(r.vertexAttribDivisor(b,T),$[b]=T)}function S(){const b=s.newAttributes,T=s.enabledAttributes;for(let q=0,Y=T.length;q<Y;q++)T[q]!==b[q]&&(r.disableVertexAttribArray(q),T[q]=0)}function M(b,T,q,Y,$,re,X){!0===X?r.vertexAttribIPointer(b,T,q,$,re):r.vertexAttribPointer(b,T,q,Y,$,re)}function N(){Z(),a=!0,s!==i&&(s=i,h(s.object))}function Z(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:function l(b,T,q,Y,$){let re=!1;const X=function f(b,T,q){const Y=!0===q.wireframe;let $=n[b.id];void 0===$&&($={},n[b.id]=$);let re=$[T.id];void 0===re&&(re={},$[T.id]=re);let X=re[Y];return void 0===X&&(X=p(function c(){return r.createVertexArray()}()),re[Y]=X),X}(Y,q,T);s!==X&&(s=X,h(s.object)),re=function m(b,T,q,Y){const $=s.attributes,re=T.attributes;let X=0;const oe=q.getAttributes();for(const J in oe)if(oe[J].location>=0){const be=$[J];let Se=re[J];if(void 0===Se&&("instanceMatrix"===J&&b.instanceMatrix&&(Se=b.instanceMatrix),"instanceColor"===J&&b.instanceColor&&(Se=b.instanceColor)),void 0===be||be.attribute!==Se||Se&&be.data!==Se.data)return!0;X++}return s.attributesNum!==X||s.index!==Y}(b,Y,q,$),re&&function _(b,T,q,Y){const $={},re=T.attributes;let X=0;const oe=q.getAttributes();for(const J in oe)if(oe[J].location>=0){let be=re[J];void 0===be&&("instanceMatrix"===J&&b.instanceMatrix&&(be=b.instanceMatrix),"instanceColor"===J&&b.instanceColor&&(be=b.instanceColor));const Se={};Se.attribute=be,be&&be.data&&(Se.data=be.data),$[J]=Se,X++}s.attributes=$,s.attributesNum=X,s.index=Y}(b,Y,q,$),null!==$&&e.update($,r.ELEMENT_ARRAY_BUFFER),(re||a)&&(a=!1,function w(b,T,q,Y){x();const $=Y.attributes,re=q.getAttributes(),X=T.defaultAttributeValues;for(const oe in re){const J=re[oe];if(J.location>=0){let xe=$[oe];if(void 0===xe&&("instanceMatrix"===oe&&b.instanceMatrix&&(xe=b.instanceMatrix),"instanceColor"===oe&&b.instanceColor&&(xe=b.instanceColor)),void 0!==xe){const be=xe.normalized,Se=xe.itemSize,et=e.get(xe);
vendor: 2,519 bytes, line 1
1if(void 0===et)continue;const ct=et.buffer,j=et.type,ce=et.bytesPerElement,Re=j===r.INT||j===r.UNSIGNED_INT||1013===xe.gpuType;if(xe.isInterleavedBufferAttribute){const ve=xe.data,Ve=ve.stride,ke=xe.offset;if(ve.isInstancedInterleavedBuffer){for(let qe=0;qe<J.locationSize;qe++)g(J.location+qe,ve.meshPerAttribute);!0!==b.isInstancedMesh&&void 0===Y._maxInstanceCount&&(Y._maxInstanceCount=ve.meshPerAttribute*ve.count)}else for(let qe=0;qe<J.locationSize;qe++)v(J.location+qe);r.bindBuffer(r.ARRAY_BUFFER,ct);for(let qe=0;qe<J.locationSize;qe++)M(J.location+qe,Se/J.locationSize,j,be,Ve*ce,(ke+Se/J.locationSize*qe)*ce,Re)}else{if(xe.isInstancedBufferAttribute){for(let ve=0;ve<J.locationSize;ve++)g(J.location+ve,xe.meshPerAttribute);!0!==b.isInstancedMesh&&void 0===Y._maxInstanceCount&&(Y._maxInstanceCount=xe.meshPerAttribute*xe.count)}else for(let ve=0;ve<J.locationSize;ve++)v(J.location+ve);r.bindBuffer(r.ARRAY_BUFFER,ct);for(let ve=0;ve<J.locationSize;ve++)M(J.location+ve,Se/J.locationSize,j,be,Se*ce,Se/J.locationSize*ve*ce,Re)}}else if(void 0!==X){const be=X[oe];if(void 0!==be)switch(be.length){case 2:r.vertexAttrib2fv(J.location,be);break;case 3:r.vertexAttrib3fv(J.location,be);break;case 4:r.vertexAttrib4fv(J.location,be);break;default:r.vertexAttrib1fv(J.location,be)}}}}S()}(b,T,q,Y),null!==$&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get($).buffer))},reset:N,resetDefaultState:Z,dispose:function O(){N();for(const b in n){const T=n[b];for(const q in T){const Y=T[q];for(const $ in Y)u(Y[$].object),delete Y[$];delete T[q]}delete n[b]}},releaseStatesOfGeometry:function R(b){if(void 0===n[b.id])return;const T=n[b.id];for(const q in T){const Y=T[q];for(const $ in Y)u(Y[$].object),delete Y[$];delete T[q]}delete n[b.id]},releaseStatesOfProgram:function I(b){for(const T in n){const q=n[T];if(void 0===q[b.id])continue;const Y=q[b.id];for(const $ in Y)u(Y[$].object),delete Y[$];delete q[b.id]}},initAttributes:x,enableAttribute:v,disableUnusedAttributes:S}}function Lg(r,e,t){let n;function a(h,u,f){0!==f&&(r.drawArraysInstanced(n,h,u,f),t.update(u,n,f))}this.setMode=function i(h){n=h},this.render=function s(h,u){r.drawArrays(n,h,u),t.update(u,n,1)},this.renderInstances=a,this.renderMultiDraw=function l(h,u,f){if(0===f)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,h,0,u,0,f);let m=0;for(let _=0;_<f;_++)m+=u[_];t.update(m,n,1)},this.renderMultiDrawInstances=function c(h,u,f,p){if(0===f)return;const m=e.get("WEBGL_multi_draw");if(null===m)for(let _=0;_<h.length;_++)a(h[_],u[_],p[_]);
1else{m.multiDrawArraysInstancedWEBGL(n,h,0,u,0,p,0,f);let _=0;for(let x=0;x<f;x++)_+=u[x];for(let x=0;x<p.length;x++)t.update(_,n,p[x])}}}function Ug(r,e,t,n){let i;function c(I){if("highp"===I){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";I="mediump"}return"mediump"===I&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let h=void 0!==t.precision?t.precision:"highp";const u=c(h);u!==h&&(console.warn("THREE.WebGLRenderer:",h,"not supported, using",u,"instead."),h=u);const f=!0===t.logarithmicDepthBuffer,p=!0===t.reverseDepthBuffer&&e.has("EXT_clip_control");if(!0===p){const I=e.get("EXT_clip_control");I.clipControlEXT(I.LOWER_LEFT_EXT,I.ZERO_TO_ONE_EXT)}const m=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function s(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const I=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(I.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:c,textureFormatReadable:function a(I){return!(I!==Xt&&n.convert(I)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))},textureTypeReadable:function l(I){const N=I===Jn&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(I!==In&&n.convert(I)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&I!==Jt&&!N)},precision:h,logarithmicDepthBuffer:f,reverseDepthBuffer:p,maxTextures:m,maxVertexTextures:_,maxTextureSize:r.getParameter(r.MAX_TEXTURE_SIZE),maxCubemapSize:r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:r.getParameter(r.MAX_VERTEX_ATTRIBS),maxVertexUniforms:r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:r.getParameter(r.MAX_VARYING_VECTORS),maxFragmentUniforms:r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:_>0,maxSamples:r.getParameter(r.MAX_SAMPLES)}}function Dg(r){const e=this;let t=null,n=0,i=!1,s=!1;const a=new Is,l=new d,c={value:null,needsUpdate:!1};function u(f,p,m,_){const x=null!==f?f.length:0;let v=null;if(0!==x){if(v=c.value,!0!==_||null===v){const g=m+4*x,S=p.matrixWorldInverse;l.getNormalMatrix(S),(null===v||v.length<g)&&(v=new Float32Array(g));for(let M=0,w=m;M!==x;++M,w+=4)a.copy(f[M]).applyMatrix4(S,l),a.normal.toArray(v,w),v[w+3]=a.constant}c.value=v,c.needsUpdate=!0}return e.numPlanes=x,e.numIntersection=0,v}this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(f,p){const m=0!==f.length||p||0!==n||i;return i=p,n=f.length,m},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,p){t=u(f,p,0)},this.setState=function(f,p,m){const _=f.clippingPlanes,x=f.clipIntersection,v=f.clipShadows,g=r.get(f);if(!i||null===_||0===_.length||s&&!v)s?u(null):function h(){c.value!==t&&(c.value=t,c.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}();else{const S=s?0:n,M=4*S;let w=g.clippingState||null;c.value=w,w=u(_,p,M,m);for(let O=0;O!==M;++O)w[O]=t[O];g.clippingState=w,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=S}}}function Ng(r){let e=new WeakMap;function t(a,l){return 303===l?a.mapping=301:304===l&&(a.mapping=302),a}function i(a){const l=a.target;l.removeEventListener("dispose",i);const c=e.get(l);void 0!==c&&(e.delete(l),c.dispose())}return{get:function n(a){if(a&&a.isTexture){const l=a.mapping;if(303===l||304===l){if(e.has(a))return t(e.get(a).texture,a.mapping);{const c=a.image;if(c&&c.height>0){const h=new Tp(c.height);return h.fromEquirectangularTexture(r,a),e.set(a,h),a.addEventListener("dispose",i),t(h.texture,a.mapping)}return null}}}return a},dispose:function s(){e=new WeakMap}}}class Wc extends Vc{constructor(e=-1,t=1,n=1,i=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,a=n+e,l=i+t,c=i-t;if(null!==this.view&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,a=s+h*this.view.width,l-=u*this.view.offsetY,c=l-u*this.view.height}
vendor: 11,454 bytes, line 1
1this.projectionMatrix.makeOrthographic(s,a,l,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const bu=[.125,.215,.35,.446,.526,.582],Xc=new Wc,Su=new Me;let Yc=null,qc=0,Zc=0,$c=!1;const Ds=(1+Math.sqrt(5))/2,Jr=1/Ds,wu=[new L(-Ds,Jr,0),new L(Ds,Jr,0),new L(-Jr,0,Ds),new L(Jr,0,Ds),new L(0,Ds,-Jr),new L(0,Ds,Jr),new L(-1,1,-1),new L(1,1,-1),new L(-1,1,1),new L(1,1,1)];class Eu{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Yc=this._renderer.getRenderTarget(),qc=this._renderer.getActiveCubeFace(),Zc=this._renderer.getActiveMipmapLevel(),$c=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Cu(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Au(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Yc,qc,Zc),this._renderer.xr.enabled=$c,e.scissorTest=!1,al(e,0,0,e.width,e.height)}_fromTexture(e,t){this._setSize(301===e.mapping||302===e.mapping?0===e.image.length?16:e.image[0].width||e.image[0].image.width:e.image.width/4),Yc=this._renderer.getRenderTarget(),qc=this._renderer.getActiveCubeFace(),Zc=this._renderer.getActiveMipmapLevel(),$c=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:xt,minFilter:xt,generateMipmaps:!1,type:Jn,format:Xt,colorSpace:Dn,depthBuffer:!1},i=Tu(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Tu(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function Og(r){const e=[],t=[],n=[];let i=r;const s=r-4+1+bu.length;for(let a=0;a<s;a++){const l=Math.pow(2,i);t.push(l);let c=1/l;a>r-4?c=bu[a-r+4-1]:0===a&&(c=0),n.push(c);const h=1/(l-2),u=-h,f=1+h,p=[u,u,f,u,f,f,u,u,f,f,u,f],m=6,_=6,x=3,v=2,g=1,S=new Float32Array(x*_*m),M=new Float32Array(v*_*m),w=new Float32Array(g*_*m);for(let R=0;R<m;R++){const I=R%3*2/3-1,N=R>2?0:-1;S.set([I,N,0,I+2/3,N,0,I+2/3,N+1,0,I,N,0,I+2/3,N+1,0,I,N+1,0],x*_*R),M.set(p,v*_*R),w.set([R,R,R,R,R,R],g*_*R)}const O=new je;O.setAttribute("position",new Ut(S,x)),O.setAttribute("uv",new Ut(M,v)),O.setAttribute("faceIndex",new Ut(w,g)),e.push(O),i>4&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}(s)),this._blurMaterial=function Fg(r,e,t){const n=new Float32Array(20),i=new L(0,1,0);return new Di({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}(s,e,t)}return i}_compileMaterial(e){const t=new Qt(this._lodPlanes[0],e);this._renderer.compile(t,Xc)}_sceneToCubeUV(e,t,n,i){const l=new qt(90,1,t,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,f=u.autoClear,p=u.toneMapping;u.getClearColor(Su),u.toneMapping=0,u.autoClear=!1;const m=new es({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),_=new Qt(new Yr,m);let x=!1;const v=e.background;v?v.isColor&&(m.color.copy(v),e.background=null,x=!0):(m.color.copy(Su),x=!0);for(let g=0;g<6;g++){const S=g%3;0===S?(l.up.set(0,c[g],0),l.lookAt(h[g],0,0)):1===S?(l.up.set(0,0,c[g]),l.lookAt(0,h[g],0)):(l.up.set(0,c[g],0),l.lookAt(0,0,h[g]));const M=this._cubeSize;al(i,S*M,g>2?M:0,M,M),u.setRenderTarget(i),x&&u.render(_,l),u.render(e,l)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=p,u.autoClear=f,e.background=v}_textureToCubeUV(e,t){const n=this._renderer,i=301===e.mapping||302===e.mapping;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Cu()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Au());const s=i?this._cubemapMaterial:this._equirectMaterial,a=new Qt(this._lodPlanes[0],s);s.uniforms.envMap.value=e;const c=this._cubeSize;al(t,0,0,3*c,2*c),n.setRenderTarget(t),n.render(a,Xc)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]);this._blur(e,s-1,s,a,wu[(i-s-1)%wu.length])}t.autoClear=n}_blur(e,t,n,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",s),this._halfBlur(a,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,a,l){const c=this._renderer,h=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const f=new Qt(this._lodPlanes[i],h),p=h.uniforms,m=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*m):2*Math.PI/39,x=s/_,v=isFinite(s)?1+Math.floor(3*x):20;v>20&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to 20`);const g=[];let S=0;for(let I=0;I<20;++I){const N=I/x,Z=Math.exp(-N*N/2);g.push(Z),0===I?S+=Z:I<v&&(S+=2*Z)}for(let I=0;I<g.length;I++)g[I]=g[I]/S;p.envMap.value=e.texture,p.samples.value=v,p.weights.value=g,p.latitudinal.value="latitudinal"===a,l&&(p.poleAxis.value=l);const{_lodMax:M}=this;p.dTheta.value=_,p.mipInt.value=M-n;const w=this._sizeLods[i];al(t,3*w*(i>M-4?i-M+4:0),4*(this._cubeSize-w),3*w,2*w),c.setRenderTarget(t),c.render(f,Xc)}}function Tu(r,e,t){const n=new Zi(r,e,t);return n.texture.mapping=306,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function al(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function Au(){return new Di({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );
1\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Cu(){return new Di({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Bg(r){let e=new WeakMap,t=null;function s(l){const c=l.target;c.removeEventListener("dispose",s);const h=e.get(c);void 0!==h&&(e.delete(c),h.dispose())}return{get:function n(l){if(l&&l.isTexture){const c=l.mapping,h=303===c||304===c,u=301===c||302===c;if(h||u){let f=e.get(l);const p=void 0!==f?f.texture.pmremVersion:0;if(l.isRenderTargetTexture&&l.pmremVersion!==p)return null===t&&(t=new Eu(r)),f=h?t.fromEquirectangular(l,f):t.fromCubemap(l,f),f.texture.pmremVersion=l.pmremVersion,e.set(l,f),f.texture;if(void 0!==f)return f.texture;{const m=l.image;return h&&m&&m.height>0||u&&m&&function i(l){let c=0;for(let u=0;u<6;u++)void 0!==l[u]&&c++;return 6===c}(m)?(null===t&&(t=new Eu(r)),f=h?t.fromEquirectangular(l):t.fromCubemap(l),f.texture.pmremVersion=l.pmremVersion,e.set(l,f),l.addEventListener("dispose",s),f.texture):null}}}return l},dispose:function a(){e=new WeakMap,null!==t&&(t.dispose(),t=null)}}}function zg(r){const e={};function t(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return null!==t(n)},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return null===i&&Je("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function kg(r,e,t,n){const i={},s=new WeakMap;function a(f){const p=f.target;null!==p.index&&e.remove(p.index);for(const _ in p.attributes)e.remove(p.attributes[_]);for(const _ in p.morphAttributes){const x=p.morphAttributes[_];for(let v=0,g=x.length;v<g;v++)e.remove(x[v])}p.removeEventListener("dispose",a),delete i[p.id];const m=s.get(p);m&&(e.remove(m),s.delete(p)),n.releaseStatesOfGeometry(p),!0===p.isInstancedBufferGeometry&&delete p._maxInstanceCount,t.memory.geometries--}function h(f){const p=[],m=f.index,_=f.attributes.position;let x=0;if(null!==m){const S=m.array;x=m.version;for(let M=0,w=S.length;M<w;M+=3){const O=S[M+0],R=S[M+1],I=S[M+2];p.push(O,R,R,I,I,O)}}else{if(void 0===_)return;x=_.version;for(let M=0,w=_.array.length/3-1;M<w;M+=3){const O=M+0,R=M+1,I=M+2;p.push(O,R,R,I,I,O)}}
1const v=new(C(p)?pu:fu)(p,1);v.version=x;const g=s.get(f);g&&e.remove(g),s.set(f,v)}return{get:function l(f,p){return!0===i[p.id]||(p.addEventListener("dispose",a),i[p.id]=!0,t.memory.geometries++),p},update:function c(f){const p=f.attributes;for(const _ in p)e.update(p[_],r.ARRAY_BUFFER);const m=f.morphAttributes;for(const _ in m){const x=m[_];for(let v=0,g=x.length;v<g;v++)e.update(x[v],r.ARRAY_BUFFER)}},getWireframeAttribute:function u(f){const p=s.get(f);if(p){const m=f.index;null!==m&&p.version<m.version&&h(f)}else h(f);return s.get(f)}}}function Hg(r,e,t){let n,s,a;function h(p,m,_){0!==_&&(r.drawElementsInstanced(n,m,s,p*a,_),t.update(m,n,_))}this.setMode=function i(p){n=p},this.setIndex=function l(p){s=p.type,a=p.bytesPerElement},this.render=function c(p,m){r.drawElements(n,m,s,p*a),t.update(m,n,1)},this.renderInstances=h,this.renderMultiDraw=function u(p,m,_){if(0===_)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,m,0,s,p,0,_);let v=0;for(let g=0;g<_;g++)v+=m[g];t.update(v,n,1)},this.renderMultiDrawInstances=function f(p,m,_,x){if(0===_)return;const v=e.get("WEBGL_multi_draw");if(null===v)for(let g=0;g<p.length;g++)h(p[g]/a,m[g],x[g]);else{v.multiDrawElementsInstancedWEBGL(n,m,0,s,p,0,x,0,_);let g=0;for(let S=0;S<_;S++)g+=m[S];for(let S=0;S<x.length;S++)t.update(g,n,x[S])}}}function Vg(r){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function n(s,a,l){switch(t.calls++,a){case r.TRIANGLES:t.triangles+=l*(s/3);break;case r.LINES:t.lines+=l*(s/2);break;case r.LINE_STRIP:t.lines+=l*(s-1);break;case r.LINE_LOOP:t.lines+=l*s;break;case r.POINTS:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a)}}}}function Gg(r,e,t){const n=new WeakMap,i=new lt;return{update:function s(a,l,c){const h=a.morphTargetInfluences,u=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,f=void 0!==u?u.length:0;let p=n.get(l);if(void 0===p||p.count!==f){let Z=function(){I.dispose(),n.delete(l),l.removeEventListener("dispose",Z)};void 0!==p&&p.texture.dispose();const m=void 0!==l.morphAttributes.position,_=void 0!==l.morphAttributes.normal,x=void 0!==l.morphAttributes.color,v=l.morphAttributes.position||[],g=l.morphAttributes.normal||[],S=l.morphAttributes.color||[];let M=0;!0===m&&(M=1),!0===_&&(M=2),!0===x&&(M=3);let w=l.attributes.position.count*M,O=1;w>e.maxTextureSize&&(O=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const R=new Float32Array(w*O*4*f),I=new Sc(R,w,O,f);I.type=Jt,I.needsUpdate=!0;const N=4*M;for(let b=0;b<f;b++){const T=v[b],q=g[b],Y=S[b],$=w*O*4*b;for(let re=0;re<T.count;re++){const X=re*N;!0===m&&(i.fromBufferAttribute(T,re),R[$+X+0]=i.x,R[$+X+1]=i.y,R[$+X+2]=i.z,R[$+X+3]=0),!0===_&&(i.fromBufferAttribute(q,re),R[$+X+4]=i.x,R[$+X+5]=i.y,R[$+X+6]=i.z,R[$+X+7]=0),!0===x&&(i.fromBufferAttribute(Y,re),R[$+X+8]=i.x,R[$+X+9]=i.y,R[$+X+10]=i.z,R[$+X+11]=4===Y.itemSize?i.w:1)}}p={count:f,texture:I,size:new o(w,O)},n.set(l,p),l.addEventListener("dispose",Z)}if(!0===a.isInstancedMesh&&null!==a.morphTexture)c.getUniforms().setValue(r,"morphTexture",a.morphTexture,t);else{let m=0;for(let x=0;x<h.length;x++)m+=h[x];const _=l.morphTargetsRelative?1:1-m;c.getUniforms().setValue(r,"morphTargetBaseInfluence",_),c.getUniforms().setValue(r,"morphTargetInfluences",h)}c.getUniforms().setValue(r,"morphTargetsTexture",p.texture,t),c.getUniforms().setValue(r,"morphTargetsTextureSize",p.size)}}}function Wg(r,e,t,n){let i=new WeakMap;function l(c){const h=c.target;h.removeEventListener("dispose",l),t.remove(h.instanceMatrix),null!==h.instanceColor&&t.remove(h.instanceColor)}return{update:function s(c){const h=n.render.frame,f=e.get(c,c.geometry);if(i.get(f)!==h&&(e.update(f),i.set(f,h)),c.isInstancedMesh&&(!1===c.hasEventListener("dispose",l)&&c.addEventListener("dispose",l),i.get(c)!==h&&(t.update(c.instanceMatrix,r.ARRAY_BUFFER),null!==c.instanceColor&&t.update(c.instanceColor,r.ARRAY_BUFFER),i.set(c,h))),c.isSkinnedMesh){const p=c.skeleton;i.get(p)!==h&&(p.update(),i.set(p,h))}return f},dispose:function a(){i=new WeakMap}}}class Ru extends ai{constructor(e,t,n,i,s,a,l,c,h,u=vi){if(u!==vi&&u!==jn)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");
vendor: 4,920 bytes, line 1
1void 0===n&&u===vi&&(n=Vn),void 0===n&&u===jn&&(n=Gn),super(null,i,s,a,l,c,u,n,h),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==l?l:St,this.minFilter=void 0!==c?c:St,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}const Iu=new ai,Pu=new Ru(1,1),Lu=new Sc,Uu=new nu,Du=new il,Nu=[],Ou=[],Fu=new Float32Array(16),Bu=new Float32Array(9),zu=new Float32Array(4);function jr(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=Nu[i];if(void 0===s&&(s=new Float32Array(i),Nu[i]=s),0!==e){n.toArray(s,0);for(let a=1,l=0;a!==e;++a)l+=t,r[a].toArray(s,l)}return s}function Ft(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function Bt(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function ol(r,e){let t=Ou[e];void 0===t&&(t=new Int32Array(e),Ou[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function Xg(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function Yg(r,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Ft(t,e))return;r.uniform2fv(this.addr,e),Bt(t,e)}}function qg(r,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(void 0!==e.r)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Ft(t,e))return;r.uniform3fv(this.addr,e),Bt(t,e)}}function Zg(r,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Ft(t,e))return;r.uniform4fv(this.addr,e),Bt(t,e)}}function $g(r,e){const t=this.cache,n=e.elements;if(void 0===n){if(Ft(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),Bt(t,e)}else{if(Ft(t,n))return;zu.set(n),r.uniformMatrix2fv(this.addr,!1,zu),Bt(t,n)}}function Kg(r,e){const t=this.cache,n=e.elements;if(void 0===n){if(Ft(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),Bt(t,e)}else{if(Ft(t,n))return;Bu.set(n),r.uniformMatrix3fv(this.addr,!1,Bu),Bt(t,n)}}function Jg(r,e){const t=this.cache,n=e.elements;if(void 0===n){if(Ft(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),Bt(t,e)}else{if(Ft(t,n))return;Fu.set(n),r.uniformMatrix4fv(this.addr,!1,Fu),Bt(t,n)}}function jg(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function Qg(r,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Ft(t,e))return;r.uniform2iv(this.addr,e),Bt(t,e)}}function ev(r,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Ft(t,e))return;r.uniform3iv(this.addr,e),Bt(t,e)}}function tv(r,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Ft(t,e))return;r.uniform4iv(this.addr,e),Bt(t,e)}}function nv(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function iv(r,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Ft(t,e))return;r.uniform2uiv(this.addr,e),Bt(t,e)}}function sv(r,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Ft(t,e))return;r.uniform3uiv(this.addr,e),Bt(t,e)}}function rv(r,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Ft(t,e))return;r.uniform4uiv(this.addr,e),Bt(t,e)}}function av(r,e,t){const n=this.cache,i=t.allocateTextureUnit();let s;n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),this.type===r.SAMPLER_2D_SHADOW?(Pu.compareFunction=515,s=Pu):s=Iu,t.setTexture2D(e||s,i)}function ov(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Uu,i)}function lv(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Du,i)}function cv(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||Lu,i)}function uv(r,e){r.uniform1fv(this.addr,e)}function dv(r,e){const t=jr(e,this.size,2);r.uniform2fv(this.addr,t)}function fv(r,e){const t=jr(e,this.size,3);r.uniform3fv(this.addr,t)}function pv(r,e){const t=jr(e,this.size,4);r.uniform4fv(this.addr,t)}function mv(r,e){const t=jr(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}
1function gv(r,e){const t=jr(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function vv(r,e){const t=jr(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function _v(r,e){r.uniform1iv(this.addr,e)}function xv(r,e){r.uniform2iv(this.addr,e)}function yv(r,e){r.uniform3iv(this.addr,e)}function Mv(r,e){r.uniform4iv(this.addr,e)}function bv(r,e){r.uniform1uiv(this.addr,e)}function Sv(r,e){r.uniform2uiv(this.addr,e)}function wv(r,e){r.uniform3uiv(this.addr,e)}function Ev(r,e){r.uniform4uiv(this.addr,e)}function Tv(r,e,t){const n=this.cache,i=e.length,s=ol(t,i);Ft(n,s)||(r.uniform1iv(this.addr,s),Bt(n,s));for(let a=0;a!==i;++a)t.setTexture2D(e[a]||Iu,s[a])}function Av(r,e,t){const n=this.cache,i=e.length,s=ol(t,i);Ft(n,s)||(r.uniform1iv(this.addr,s),Bt(n,s));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||Uu,s[a])}function Cv(r,e,t){const n=this.cache,i=e.length,s=ol(t,i);Ft(n,s)||(r.uniform1iv(this.addr,s),Bt(n,s));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Du,s[a])}function Rv(r,e,t){const n=this.cache,i=e.length,s=ol(t,i);Ft(n,s)||(r.uniform1iv(this.addr,s),Bt(n,s));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||Lu,s[a])}class Pv{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function hv(r){switch(r){case 5126:return Xg;case 35664:return Yg;case 35665:return qg;case 35666:return Zg;case 35674:return $g;case 35675:return Kg;case 35676:return Jg;case 5124:case 35670:return jg;case 35667:case 35671:return Qg;case 35668:case 35672:return ev;case 35669:case 35673:return tv;case 5125:return nv;case 36294:return iv;case 36295:return sv;case 36296:return rv;case 35678:case 36198:case 36298:case 36306:case 35682:return av;case 35679:case 36299:case 36307:return ov;case 35680:case 36300:case 36308:case 36293:return lv;case 36289:case 36303:case 36311:case 36292:return cv}}(t.type)}}class Lv{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function Iv(r){switch(r){case 5126:return uv;case 35664:return dv;case 35665:return fv;case 35666:return pv;case 35674:return mv;case 35675:return gv;case 35676:return vv;case 5124:case 35670:return _v;case 35667:case 35671:return xv;case 35668:case 35672:return yv;case 35669:case 35673:return Mv;case 5125:return bv;case 36294:return Sv;case 36295:return wv;case 36296:return Ev;case 35678:case 36198:case 36298:case 36306:case 35682:return Tv;case 35679:case 36299:case 36307:return Av;case 35680:case 36300:case 36308:case 36293:return Cv;case 36289:case 36303:case 36311:case 36292:return Rv}}(t.type)}}class Uv{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,a=i.length;s!==a;++s){const l=i[s];l.setValue(e,t[l.id],n)}}}const Jc=/(\w+)(\])?(\[|\.)?/g;function ku(r,e){r.seq.push(e),r.map[e.id]=e}function Dv(r,e,t){const n=r.name,i=n.length;for(Jc.lastIndex=0;;){const s=Jc.exec(n),a=Jc.lastIndex;let l=s[1];const h=s[3];if("]"===s[2]&&(l|=0),void 0===h||"["===h&&a+2===i){ku(t,void 0===h?new Pv(l,r,e):new Lv(l,r,e));break}{let f=t.map[l];void 0===f&&(f=new Uv(l),ku(t,f)),t=f}}}class ll{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const s=e.getActiveUniform(t,i);Dv(s,e.getUniformLocation(t,s.name),this)}}setValue(e,t,n,i){const s=this.map[t];void 0!==s&&s.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let s=0,a=t.length;s!==a;++s){const l=t[s],c=n[l.id];!1!==c.needsUpdate&&l.setValue(e,c.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function Hu(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}let Ov=0;function Vu(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&""===i)return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const a=parseInt(s[1]);return t.toUpperCase()+"\n\n"+i+"\n\n"+function Fv(r,e){const t=r.split("\n"),n=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let a=i;a<s;a++){const l=a+1;n.push(`${l===e?">":" "} ${l}: ${t[a]}`)}return n.join("\n")}(r.getShaderSource(e),a)}return i}function zv(r,e){const t=function Bv(r){const e=it.getPrimaries(it.workingColorSpace),t=it.getPrimaries(r);let n;switch(e===t?n="":"p3"===e&&t===Rr?n="LinearDisplayP3ToLinearSRGB":e===Rr&&"p3"===t&&(n="LinearSRGBToLinearDisplayP3"),r){case Dn:case Ms:return[n,"LinearTransferOETF"];case un:case Gi:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function kv(r,e){let t;switch(e){case Qs:t="Linear";break;case 2:t="Reinhard";break;case 3:t="Cineon";break;case 4:t="ACESFilmic";break;case 6:t="AgX";break;case 7:t="Neutral";break;case 5:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const cl=new L;function Ga(r){return""!==r}function Gu(r,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_L
1IGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Wu(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Xv=/^[ \t]*#include +<([\w\d./]+)>/gm;function jc(r){return r.replace(Xv,qv)}const Yv=new Map;function qv(r,e){let t=Ke[e];if(void 0===t){const n=Yv.get(e);if(void 0===n)throw new Error("Can not resolve #include <"+e+">");t=Ke[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n)}return jc(t)}const Zv=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Xu(r){return r.replace(Zv,$v)}function $v(r,e,t,n){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function Yu(r){let e=`precision ${r.precision} float;\n\tprecision ${r.precision} int;\n\tprecision ${r.precision} sampler2D;\n\tprecision ${r.precision} samplerCube;\n\tprecision ${r.precision} sampler3D;\n\tprecision ${r.precision} sampler2DArray;\n\tprecision ${r.precision} sampler2DShadow;\n\tprecision ${r.precision} samplerCubeShadow;\n\tprecision ${r.precision} sampler2DArrayShadow;\n\tprecision ${r.precision} isampler2D;\n\tprecision ${r.precision} isampler3D;\n\tprecision ${r.precision} isamplerCube;\n\tprecision ${r.precision} isampler2DArray;\n\tprecision ${r.precision} usampler2D;\n\tprecision ${r.precision} usampler3D;\n\tprecision ${r.precision} usamplerCube;\n\tprecision ${r.precision} usampler2DArray;\n\t`;return"highp"===r.precision?e+="\n#define HIGH_PRECISION":"mediump"===r.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===r.precision&&(e+="\n#define LOW_PRECISION"),e}function t_(r,e,t,n){const i=r.getContext(),s=t.defines;let a=t.vertexShader,l=t.fragmentShader;const c=function Kv(r){let e="SHADOWMAP_TYPE_BASIC";return 1===r.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===r.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===r.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(t),h=function Jv(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case 301:case 302:e="ENVMAP_TYPE_CUBE";break;case 306:e="ENVMAP_TYPE_CUBE_UV"}return e}(t),u=function jv(r){let e="ENVMAP_MODE_REFLECTION";return r.envMap&&302===r.envMapMode&&(e="ENVMAP_MODE_REFRACTION"),e}(t),f=function Qv(r){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(t),p=function e_(r){const e=r.envMapCubeUVHeight;if(null===e)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}(t),m=function Vv(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ga).join("\n")}(t),_=function Gv(r){const e=[];for(const t in r){const n=r[t];!1!==n&&e.push("#define "+t+" "+n)}return e.join("\n")}(s),x=i.createProgram();let v,g,S=t.glslVersion?"#version "+t.glslVersion+"\n":"";t.isRawShaderMaterial?(v=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,_].filter(Ga).join("\n"),v.length>0&&(v+="\n"),g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,_].filter(Ga).join("\n"),g.length>0&&(g+="\n")):(v=[Yu(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,_,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IR
1IDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&!1===t.flatShading?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&!1===t.flatShading?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Ga).join("\n"),g=[Yu(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,_,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
1IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&!1===t.flatShading?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==t.toneMapping?"#define TONE_MAPPING":"",0!==t.toneMapping?Ke.tonemapping_pars_fragment:"",0!==t.toneMapping?kv("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Ke.colorspace_pars_fragment,zv("linearToOutputTexel",t.outputColorSpace),(it.getLuminanceCoefficients(cl),["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${cl.x.toFixed(4)}, ${cl.y.toFixed(4)}, ${cl.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"","\n"].filter(Ga).join("\n")),a=jc(a),a=Gu(a,t),a=Wu(a,t),l=jc(l),l=Gu(l,t),l=Wu(l,t),a=Xu(a),l=Xu(l),!0!==t.isRawShaderMaterial&&(S="#version 300 es\n",v=[m,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,g=["#define varying in","300 es"===t.glslVersion?"":"layout(location = 0) out highp vec4 pc_fragColor;","300 es"===t.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+g);const w=S+g+l,O=Hu(i,i.VERTEX_SHADER,S+v+a),R=Hu(i,i.FRAGMENT_SHADER,w);function I(T){if(r.debug.checkShaderErrors){const q=i.getProgramInfoLog(x).trim(),Y=i.getShaderInfoLog(O).trim(),$=i.getShaderInfoLog(R).trim();let re=!0,X=!0;if(!1===i.getProgramParameter(x,i.LINK_STATUS))if(re=!1,"function"==typeof r.debug.onShaderError)r.debug.onShaderError(i,x,O,R);else{const oe=Vu(i,O,"vertex"),J=Vu(i,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(x,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+T.name+"\nMaterial Type: "+T.type+"\n\nProgram Info Log: "+q+"\n"+oe+"\n"+J)}else""!==q?console.warn("THREE.WebGLProgram: Program Info Log:",q):(""===Y||""===$)&&(X=!1);X&&(T.diagnostics={runnable:re,programLog:q,vertexShader:{log:Y,prefix:v},fragmentShader:{log:$,prefix:g}})}i.deleteShader(O),i.deleteShader(R),N=new ll(i,x),Z=function Wv(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),a=s.name;let l=1;s.type===r.FLOAT_MAT2&&(l=2),s.type===r.FLOAT_MAT3&&(l=3),s.type===r.FLOAT_MAT4&&(l=4),t[a]={type:s.type,location:r.getAttribLocation(e,a),locationSize:l}}return t}(i,x)}let N,Z;i.attachShader(x,O),i.attachShader(x,R),void 0!==t.index0AttributeName?i.bindAttribLocation(x,0,t.index0AttributeName):!0===t.morphTargets&&i.bindAttribLocation(x,0,"position"),i.linkProgram(x),this.getUniforms=function(){return void 0===N&&I(this),N},this.getAttributes=function(){return void 0===Z&&I(this),Z};let b=!1===t.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===b&&(b=i.getProgramParameter(x,37297)),b},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(x),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Ov++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=O,this.fragmentShader=R,this}let n_=0;class i_{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.fragmentShader,i=this._getShaderStage(e.vertexShader),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(i)&&(a.add(i),i.usedTimes++),!1===a.has(s)&&(a.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,0===n.usedTimes&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new s_(e),t.set(e,n)),n}}class s_{constructor(e){this.id=n_++,this.code=e,this.usedTimes=0}}function r_(r,e,t,n,i,s,a){const l=new Ic,c=new i_,h=new Set,u=[],f=i.logarithmicDepthBuffer,p=i.reverseDepthBuffer,m=i.vertexTextures;let _=i.precision;const x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(b){return h.add(b),0===b?"uv":`uv${b}`}return{getParameters:function g(b,T,q,Y,$){const re=Y.fog,X=$.geometry,J=(b.isMeshStandardMaterial?t:e).get(b.envMap||(b.isMeshStandardMaterial?Y.environment:null)),xe=J&&306===J.mapping?J.image.height:null,be=x[b.type];null!==b.precision&&(_=i.getMaxPrecision(b.precision),_!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",_,"instead."));const Se=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,et=void 0!==Se?Se.length:0;let j,ce,Re,ve,ct=0;if(void 0!==X.morphAttributes.position&&(ct=1),void 0!==X.morphAttributes.normal&&(ct=2),void 0!==X.morphAttributes.color&&(ct=3),be){const gn=li[be];j=gn.vertexShader,ce=gn.fragmentShader}else j=b.vertexShader,ce=b.fragmentShader,c.update(b),Re=c.getVertexShaderID(b),ve=c.getFragmentShaderID(b);const Ve=r.getRenderTarget(),ke=!0===$.isInstancedMesh,qe=!0===$.isBatchedMesh,Qe=!!b.map,U=!!J,de=!!b.aoMap,ue=!!b.lightMap,ae=!!b.bumpMap,fe=!!b.normalMap,Ne=!!b.displacementMap,we=!!b.emissiveMap,P=!!b.metalnessMap,E=!!b.roughnessMap,V=b.anisotropy>0,Q=b.clearcoat>0,ee=b.iridescence>0,De=b.sheen>0,me=b.transmission>0,Ae=V&&!!b.anisotropyMap,st=Q&&!!b.clearcoatMap,le=Q&&!!b.clearcoatNormalMap,Ce=Q&&!!b.clearcoatRoughnessMap,Xe=ee&&!!b.iridescenceMap,Ye=ee&&!!b.iridescenceThicknessMap,Ie=De&&!!b.sheenColorMap,rt=De&&!!b.sheenRoughnessMap,$e=!!b.specularMap,mt=!!b.specularColorMap,F=!!b.specularIntensityMap,Ee=me&&!!b.transmissionMap,K=me&&!!b.thicknessMap,ye=!!b.alphaMap,Dt=!!b.extensions;let mn=0;b.toneMapped&&(null===Ve||!0===Ve.isXRRenderTarget)&&(mn=r.toneMapping);const ht={shaderID:be,shaderType:b.type,shaderName:b.name,vertexShader:j,fragmentShader:ce,defines:b.defines,customVertexShaderID:Re,customFragmentShaderID:ve,isRawShaderMaterial:!0===b.isRawShaderMaterial,glslVersion:b.glslVersion,precision:_,batching:qe,batchingColor:qe&&null!==$._colorsTexture,instancing:ke,instancingColor:ke&&null!==$.instanceColor,
1instancingMorph:ke&&null!==$.morphTexture,supportsVertexTextures:m,outputColorSpace:null===Ve?r.outputColorSpace:!0===Ve.isXRRenderTarget?Ve.texture.colorSpace:Dn,alphaToCoverage:!!b.alphaToCoverage,map:Qe,matcap:!!b.matcap,envMap:U,envMapMode:U&&J.mapping,envMapCubeUVHeight:xe,aoMap:de,lightMap:ue,bumpMap:ae,normalMap:fe,displacementMap:m&&Ne,emissiveMap:we,normalMapObjectSpace:fe&&1===b.normalMapType,normalMapTangentSpace:fe&&0===b.normalMapType,metalnessMap:P,roughnessMap:E,anisotropy:V,anisotropyMap:Ae,clearcoat:Q,clearcoatMap:st,clearcoatNormalMap:le,clearcoatRoughnessMap:Ce,dispersion:b.dispersion>0,iridescence:ee,iridescenceMap:Xe,iridescenceThicknessMap:Ye,sheen:De,sheenColorMap:Ie,sheenRoughnessMap:rt,specularMap:$e,specularColorMap:mt,specularIntensityMap:F,transmission:me,transmissionMap:Ee,thicknessMap:K,gradientMap:!!b.gradientMap,opaque:!1===b.transparent&&1===b.blending&&!1===b.alphaToCoverage,alphaMap:ye,alphaTest:b.alphaTest>0,alphaHash:!!b.alphaHash,combine:b.combine,mapUv:Qe&&v(b.map.channel),aoMapUv:de&&v(b.aoMap.channel),lightMapUv:ue&&v(b.lightMap.channel),bumpMapUv:ae&&v(b.bumpMap.channel),normalMapUv:fe&&v(b.normalMap.channel),displacementMapUv:Ne&&v(b.displacementMap.channel),emissiveMapUv:we&&v(b.emissiveMap.channel),metalnessMapUv:P&&v(b.metalnessMap.channel),roughnessMapUv:E&&v(b.roughnessMap.channel),anisotropyMapUv:Ae&&v(b.anisotropyMap.channel),clearcoatMapUv:st&&v(b.clearcoatMap.channel),clearcoatNormalMapUv:le&&v(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ce&&v(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Xe&&v(b.iridescenceMap.channel),iridescenceThicknessMapUv:Ye&&v(b.iridescenceThicknessMap.channel),sheenColorMapUv:Ie&&v(b.sheenColorMap.channel),sheenRoughnessMapUv:rt&&v(b.sheenRoughnessMap.channel),specularMapUv:$e&&v(b.specularMap.channel),specularColorMapUv:mt&&v(b.specularColorMap.channel),specularIntensityMapUv:F&&v(b.specularIntensityMap.channel),transmissionMapUv:Ee&&v(b.transmissionMap.channel),thicknessMapUv:K&&v(b.thicknessMap.channel),alphaMapUv:ye&&v(b.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(fe||V),vertexColors:b.vertexColors,vertexAlphas:!0===b.vertexColors&&!!X.attributes.color&&4===X.attributes.color.itemSize,pointsUvs:!0===$.isPoints&&!!X.attributes.uv&&(Qe||ye),fog:!!re,useFog:!0===b.fog,fogExp2:!!re&&re.isFogExp2,flatShading:!0===b.flatShading,sizeAttenuation:!0===b.sizeAttenuation,logarithmicDepthBuffer:f,reverseDepthBuffer:p,skinning:!0===$.isSkinnedMesh,morphTargets:void 0!==X.morphAttributes.position,morphNormals:void 0!==X.morphAttributes.normal,morphColors:void 0!==X.morphAttributes.color,morphTargetsCount:et,morphTextureStride:ct,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numSpotLightMaps:T.spotLightMap.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numSpotLightShadowsWithMaps:T.numSpotLightShadowsWithMaps,numLightProbes:T.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&q.length>0,shadowMapType:r.shadowMap.type,toneMapping:mn,decodeVideoTexture:Qe&&!0===b.map.isVideoTexture&&it.getTransfer(b.map.colorSpace)===Ze,premultipliedAlpha:b.premultipliedAlpha,doubleSided:2===b.side,flipSided:1===b.side,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Dt&&!0===b.extensions.clipCullDistance&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Dt&&!0===b.extensions.multiDraw||qe)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return ht.vertexUv1s=h.has(1),ht.vertexUv2s=h.has(2),ht.vertexUv3s=h.has(3),h.clear(),ht},getProgramCacheKey:function S(b){const T=[];if(b.shaderID?T.push(b.shaderID):(T.push(b.customVertexShaderID),T.push(b.customFragmentShaderID)),void 0!==b.defines)for(const q in b.defines)T.pu
1sh(q),T.push(b.defines[q]);return!1===b.isRawShaderMaterial&&(function M(b,T){b.push(T.precision),b.push(T.outputColorSpace),b.push(T.envMapMode),b.push(T.envMapCubeUVHeight),b.push(T.mapUv),b.push(T.alphaMapUv),b.push(T.lightMapUv),b.push(T.aoMapUv),b.push(T.bumpMapUv),b.push(T.normalMapUv),b.push(T.displacementMapUv),b.push(T.emissiveMapUv),b.push(T.metalnessMapUv),b.push(T.roughnessMapUv),b.push(T.anisotropyMapUv),b.push(T.clearcoatMapUv),b.push(T.clearcoatNormalMapUv),b.push(T.clearcoatRoughnessMapUv),b.push(T.iridescenceMapUv),b.push(T.iridescenceThicknessMapUv),b.push(T.sheenColorMapUv),b.push(T.sheenRoughnessMapUv),b.push(T.specularMapUv),b.push(T.specularColorMapUv),b.push(T.specularIntensityMapUv),b.push(T.transmissionMapUv),b.push(T.thicknessMapUv),b.push(T.combine),b.push(T.fogExp2),b.push(T.sizeAttenuation),b.push(T.morphTargetsCount),b.push(T.morphAttributeCount),b.push(T.numDirLights),b.push(T.numPointLights),b.push(T.numSpotLights),b.push(T.numSpotLightMaps),b.push(T.numHemiLights),b.push(T.numRectAreaLights),b.push(T.numDirLightShadows),b.push(T.numPointLightShadows),b.push(T.numSpotLightShadows),b.push(T.numSpotLightShadowsWithMaps),b.push(T.numLightProbes),b.push(T.shadowMapType),b.push(T.toneMapping),b.push(T.numClippingPlanes),b.push(T.numClipIntersection),b.push(T.depthPacking)}(T,b),function w(b,T){l.disableAll(),T.supportsVertexTextures&&l.enable(0),T.instancing&&l.enable(1),T.instancingColor&&l.enable(2),T.instancingMorph&&l.enable(3),T.matcap&&l.enable(4),T.envMap&&l.enable(5),T.normalMapObjectSpace&&l.enable(6),T.normalMapTangentSpace&&l.enable(7),T.clearcoat&&l.enable(8),T.iridescence&&l.enable(9),T.alphaTest&&l.enable(10),T.vertexColors&&l.enable(11),T.vertexAlphas&&l.enable(12),T.vertexUv1s&&l.enable(13),T.vertexUv2s&&l.enable(14),T.vertexUv3s&&l.enable(15),T.vertexTangents&&l.enable(16),T.anisotropy&&l.enable(17),T.alphaHash&&l.enable(18),T.batching&&l.enable(19),T.dispersion&&l.enable(20),T.batchingColor&&l.enable(21),b.push(l.mask),l.disableAll(),T.fog&&l.enable(0),T.useFog&&l.enable(1),T.flatShading&&l.enable(2),T.logarithmicDepthBuffer&&l.enable(3),T.reverseDepthBuffer&&l.enable(4),T.skinning&&l.enable(5),T.morphTargets&&l.enable(6),T.morphNormals&&l.enable(7),T.morphColors&&l.enable(8),T.premultipliedAlpha&&l.enable(9),T.shadowMapEnabled&&l.enable(10),T.doubleSided&&l.enable(11),T.flipSided&&l.enable(12),T.useDepthPacking&&l.enable(13),T.dithering&&l.enable(14),T.transmission&&l.enable(15),T.sheen&&l.enable(16),T.opaque&&l.enable(17),T.pointsUvs&&l.enable(18),T.decodeVideoTexture&&l.enable(19),T.alphaToCoverage&&l.enable(20),b.push(l.mask)}(T,b),T.push(r.outputColorSpace)),T.push(b.customProgramCacheKey),T.join()},getUniforms:function O(b){const T=x[b.type];let q;return q=T?bp.clone(li[T].uniforms):b.uniforms,q},acquireProgram:function R(b,T){let q;for(let Y=0,$=u.length;Y<$;Y++){const re=u[Y];if(re.cacheKey===T){q=re,++q.usedTimes;break}}return void 0===q&&(q=new t_(r,T,b,s),u.push(q)),q},releaseProgram:function I(b){if(0==--b.usedTimes){const T=u.indexOf(b);u[T]=u[u.length-1],u.pop(),b.destroy()}},releaseShaderCache:function N(b){c.remove(b)},programs:u,dispose:function Z(){c.dispose()}}}function a_(){let r=new WeakMap;return{has:function e(a){return r.has(a)},get:function t(a){let l=r.get(a);return void 0===l&&(l={},r.set(a,l)),l},remove:function n(a){r.delete(a)},update:function i(a,l,c){r.get(a)[l]=c},dispose:function s(){r=new WeakMap}}}function o_(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function qu(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Zu(){const r=[];let e=0;const t=[],n=[],i=[];function a(f,p,m,_,x,v){let g=r[e];return void 0===g?(g={id:f.id,object:f,geometry:p,material:m,groupOrder:_,renderOrder:f.renderOrder,z:x,group:v},r[e]=g):(g.id=f.id,g.object=f,g.geometry=p,g.material=m,g.groupOrder=_,g.renderOrder=f.renderOrder,g.z=x,g.group=v),e++,g}return{opaque:t,transmissive:n,transparent:i,init:function s(){e=0,t.length=0,n.length=0,i.length=0},push:function l(f,p,m,_,x,v){const g=a(f,p,m,_,x,v);m.transmission>0?n.push(g):!0===m.transparent?i.push(g):t.push(g)},unshift:function c(f,p,m,_,x,v){const g=a(f,p,m,_,x,v);m.transmission>0?n.unshift(g):!0===m.transparent?i.unshift(g):t.unshift(g)},finish:function u(){for(let f=e,p=r.length;f<p;f++){const m=r[f];if(null===m.id)break;m.id=null,m.object=null,m.geometry=null,m.material=null,m.group=null}},sort:function h(f,p){t.length>1&&t.sort(f||o_),n.length>1&&n.sort(p||qu),i.length>1&&i.sort(p||qu)}}}function l_(){let r=new WeakMap;return{get:function e(n,i){const s=r.get(n);let a;return void 0===s?(a=new Zu,r.set(n,[a])):i>=s.length?(a=new Zu,s.push(a)):a=s[i],a},dispose:function t(){r=new WeakMap}}}function c_(){const r={};return{get:function(e){if(void 0!==r[e.id])return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new L,color:new Me};break;case"SpotLight":t={position:new L,direction:new L,color:new Me,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new L,color:new Me,distance:0,decay:0};break;case"HemisphereLight":t={direction:new L,skyColor:new Me,groundColor:new Me};break;case"RectAreaLight":t={color:new Me,position:new L,halfWidth:new L,halfHeight:new L}}return r[e.id]=t,t}}}let u_=0;function d_(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function f_(r){const e=new c_,t=function h_(){const r={};return{get:function(e){if(void 0!==r[e.id])return r[e.id];let t;switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new o};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new o,shadowCameraNear:1,shadowCameraFar:1e3}}return r[e.id]=t,t}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)n.probe.push(new L);const i=new L,s=new ze,a=new ze;return{setup:function l(h){let u=0,f=0,p=0;for(let Z=0;Z<9;Z++)n.probe[Z].set(0,0,0);let m=0,_=0,x=0,v=0,g=0,S=0,M=0,w=0,O=0,R=0,I=0;h.sort(d_);for(let Z=0,b=h.length;Z<b;Z++){const T=h[Z],q=T.color,Y=T.intensity,$=T.distance,re=T.shadow&&T.shadow.map?T.shadow.map.texture:null;if(T.isAmbientLight)u+=q.r*Y,f+=q.g*Y,p+=q.b*Y;else if(T.isLightProbe){for(let X=0;X<9;X++)n.probe[X].addScaledVector(T.sh.coefficients[X],Y);I++}else if(T.isDirectionalLight){const X=e.get(T);if(X.color.copy(T.color).multiplyScalar(T.intensity),T.castShadow){const oe=T.shadow,J=t.get(T);J.shadowIntensity=oe.intensity,J.shadowBias=oe.bias,J.shadowNormalBias=oe.normalBias,J.shadowRadius=oe.radiu
vendor: 4,321 bytes, line 1
1s,J.shadowMapSize=oe.mapSize,n.directionalShadow[m]=J,n.directionalShadowMap[m]=re,n.directionalShadowMatrix[m]=T.shadow.matrix,S++}n.directional[m]=X,m++}else if(T.isSpotLight){const X=e.get(T);X.position.setFromMatrixPosition(T.matrixWorld),X.color.copy(q).multiplyScalar(Y),X.distance=$,X.coneCos=Math.cos(T.angle),X.penumbraCos=Math.cos(T.angle*(1-T.penumbra)),X.decay=T.decay,n.spot[x]=X;const oe=T.shadow;if(T.map&&(n.spotLightMap[O]=T.map,O++,oe.updateMatrices(T),T.castShadow&&R++),n.spotLightMatrix[x]=oe.matrix,T.castShadow){const J=t.get(T);J.shadowIntensity=oe.intensity,J.shadowBias=oe.bias,J.shadowNormalBias=oe.normalBias,J.shadowRadius=oe.radius,J.shadowMapSize=oe.mapSize,n.spotShadow[x]=J,n.spotShadowMap[x]=re,w++}x++}else if(T.isRectAreaLight){const X=e.get(T);X.color.copy(q).multiplyScalar(Y),X.halfWidth.set(.5*T.width,0,0),X.halfHeight.set(0,.5*T.height,0),n.rectArea[v]=X,v++}else if(T.isPointLight){const X=e.get(T);if(X.color.copy(T.color).multiplyScalar(T.intensity),X.distance=T.distance,X.decay=T.decay,T.castShadow){const oe=T.shadow,J=t.get(T);J.shadowIntensity=oe.intensity,J.shadowBias=oe.bias,J.shadowNormalBias=oe.normalBias,J.shadowRadius=oe.radius,J.shadowMapSize=oe.mapSize,J.shadowCameraNear=oe.camera.near,J.shadowCameraFar=oe.camera.far,n.pointShadow[_]=J,n.pointShadowMap[_]=re,n.pointShadowMatrix[_]=T.shadow.matrix,M++}n.point[_]=X,_++}else if(T.isHemisphereLight){const X=e.get(T);X.skyColor.copy(T.color).multiplyScalar(Y),X.groundColor.copy(T.groundColor).multiplyScalar(Y),n.hemi[g]=X,g++}}v>0&&(!0===r.has("OES_texture_float_linear")?(n.rectAreaLTC1=pe.LTC_FLOAT_1,n.rectAreaLTC2=pe.LTC_FLOAT_2):(n.rectAreaLTC1=pe.LTC_HALF_1,n.rectAreaLTC2=pe.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=f,n.ambient[2]=p;const N=n.hash;(N.directionalLength!==m||N.pointLength!==_||N.spotLength!==x||N.rectAreaLength!==v||N.hemiLength!==g||N.numDirectionalShadows!==S||N.numPointShadows!==M||N.numSpotShadows!==w||N.numSpotMaps!==O||N.numLightProbes!==I)&&(n.directional.length=m,n.spot.length=x,n.rectArea.length=v,n.point.length=_,n.hemi.length=g,n.directionalShadow.length=S,n.directionalShadowMap.length=S,n.pointShadow.length=M,n.pointShadowMap.length=M,n.spotShadow.length=w,n.spotShadowMap.length=w,n.directionalShadowMatrix.length=S,n.pointShadowMatrix.length=M,n.spotLightMatrix.length=w+O-R,n.spotLightMap.length=O,n.numSpotLightShadowsWithMaps=R,n.numLightProbes=I,N.directionalLength=m,N.pointLength=_,N.spotLength=x,N.rectAreaLength=v,N.hemiLength=g,N.numDirectionalShadows=S,N.numPointShadows=M,N.numSpotShadows=w,N.numSpotMaps=O,N.numLightProbes=I,n.version=u_++)},setupView:function c(h,u){let f=0,p=0,m=0,_=0,x=0;const v=u.matrixWorldInverse;for(let g=0,S=h.length;g<S;g++){const M=h[g];if(M.isDirectionalLight){const w=n.directional[f];w.direction.setFromMatrixPosition(M.matrixWorld),i.setFromMatrixPosition(M.target.matrixWorld),w.direction.sub(i),w.direction.transformDirection(v),f++}else if(M.isSpotLight){const w=n.spot[m];w.position.setFromMatrixPosition(M.matrixWorld),w.position.applyMatrix4(v),w.direction.setFromMatrixPosition(M.matrixWorld),i.setFromMatrixPosition(M.target.matrixWorld),w.direction.sub(i),w.direction.transformDirection(v),m++}else if(M.isRectAreaLight){const w=n.rectArea[_];w.position.setFromMatrixPosition(M.matrixWorld),w.position.applyMatrix4(v),a.identity(),s.copy(M.matrixWorld),s.premultiply(v),a.extractRotation(s),w.halfWidth.set(.5*M.width,0,0),w.halfHeight.set(0,.5*M.height,0),w.halfWidth.applyMatrix4(a),w.halfHeight.applyMatrix4(a),_++}else if(M.isPointLight){const w=n.point[p];w.position.setFromMatrixPosition(M.matrixWorld),w.position.applyMatrix4(v),p++}else if(M.isHemisphereLight){const w=n.hemi[x];w.direction.setFromMatrixPosition(M.matrixWorld),w.direction.transformDirection(v),x++}}},state:n}}function $u(r){const e=new f_(r),t=[],n=[],h={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:function i(u){h.camera=u,t.length=0,n.length=0},state:h,setupLights:function l(){e.setup(t)},setupLightsView:function c(u){e.setupView(t,u)},pushLight:function s(u){t.push(u)},pushShadow:function a(u){n.push(u)}}}function p_(r){let e=new WeakMap;return{get:function t(i,s=0){const a=e.get(i);let l;return void 0===a?(l=new $u(r),e.set(i,[l])):s>=a.length?(l=new $u(r),a.push(l)):l=a[s],l}
vendor: 4,109 bytes, line 1
1,dispose:function n(){e=new WeakMap}}}class Ku extends Ba{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Ju extends Ba{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function v_(r,e,t){let n=new Ha;const i=new o,s=new o,a=new lt,l=new Ku({depthPacking:3201}),c=new Ju,h={},u=t.maxTextureSize,f={0:1,1:0,2:2},p=new Di({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new o},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const _=new je;_.setAttribute("position",new Ut(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new Qt(_,p),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let g=this.type;function S(R,I){const N=e.update(x);p.defines.VSM_SAMPLES!==R.blurSamples&&(p.defines.VSM_SAMPLES=R.blurSamples,m.defines.VSM_SAMPLES=R.blurSamples,p.needsUpdate=!0,m.needsUpdate=!0),null===R.mapPass&&(R.mapPass=new Zi(i.x,i.y)),p.uniforms.shadow_pass.value=R.map.texture,p.uniforms.resolution.value=R.mapSize,p.uniforms.radius.value=R.radius,r.setRenderTarget(R.mapPass),r.clear(),r.renderBufferDirect(I,null,N,p,x,null),m.uniforms.shadow_pass.value=R.mapPass.texture,m.uniforms.resolution.value=R.mapSize,m.uniforms.radius.value=R.radius,r.setRenderTarget(R.map),r.clear(),r.renderBufferDirect(I,null,N,m,x,null)}function M(R,I,N,Z){let b=null;const T=!0===N.isPointLight?R.customDistanceMaterial:R.customDepthMaterial;if(void 0!==T)b=T;else if(b=!0===N.isPointLight?c:l,r.localClippingEnabled&&!0===I.clipShadows&&Array.isArray(I.clippingPlanes)&&0!==I.clippingPlanes.length||I.displacementMap&&0!==I.displacementScale||I.alphaMap&&I.alphaTest>0||I.map&&I.alphaTest>0){const q=b.uuid,Y=I.uuid;let $=h[q];void 0===$&&($={},h[q]=$);let re=$[Y];void 0===re&&(re=b.clone(),$[Y]=re,I.addEventListener("dispose",O)),b=re}return b.visible=I.visible,b.wireframe=I.wireframe,b.side=3===Z?null!==I.shadowSide?I.shadowSide:I.side:null!==I.shadowSide?I.shadowSide:f[I.side],b.alphaMap=I.alphaMap,b.alphaTest=I.alphaTest,b.map=I.map,b.clipSh
1adows=I.clipShadows,b.clippingPlanes=I.clippingPlanes,b.clipIntersection=I.clipIntersection,b.displacementMap=I.displacementMap,b.displacementScale=I.displacementScale,b.displacementBias=I.displacementBias,b.wireframeLinewidth=I.wireframeLinewidth,b.linewidth=I.linewidth,!0===N.isPointLight&&!0===b.isMeshDistanceMaterial&&(r.properties.get(b).light=N),b}function w(R,I,N,Z,b){if(!1===R.visible)return;if(R.layers.test(I.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&3===b)&&(!R.frustumCulled||n.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,R.matrixWorld);const Y=e.update(R),$=R.material;if(Array.isArray($)){const re=Y.groups;for(let X=0,oe=re.length;X<oe;X++){const J=re[X],xe=$[J.materialIndex];if(xe&&xe.visible){const be=M(R,xe,Z,b);R.onBeforeShadow(r,R,I,N,Y,be,J),r.renderBufferDirect(N,null,Y,be,R,J),R.onAfterShadow(r,R,I,N,Y,be,J)}}}else if($.visible){const re=M(R,$,Z,b);R.onBeforeShadow(r,R,I,N,Y,re,null),r.renderBufferDirect(N,null,Y,re,R,null),R.onAfterShadow(r,R,I,N,Y,re,null)}}const q=R.children;for(let Y=0,$=q.length;Y<$;Y++)w(q[Y],I,N,Z,b)}function O(R){R.target.removeEventListener("dispose",O);for(const N in h){const Z=h[N],b=R.target.uuid;b in Z&&(Z[b].dispose(),delete Z[b])}}this.render=function(R,I,N){if(!1===v.enabled||!1===v.autoUpdate&&!1===v.needsUpdate||0===R.length)return;const Z=r.getRenderTarget(),b=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),q=r.state;q.setBlending(0),q.buffers.color.setClear(1,1,1,1),q.buffers.depth.setTest(!0),q.setScissorTest(!1);const Y=3!==g&&3===this.type,$=3===g&&3!==this.type;for(let re=0,X=R.length;re<X;re++){const oe=R[re],J=oe.shadow;if(void 0===J){console.warn("THREE.WebGLShadowMap:",oe,"has no shadow.");continue}if(!1===J.autoUpdate&&!1===J.needsUpdate)continue;i.copy(J.mapSize);const xe=J.getFrameExtents();if(i.multiply(xe),s.copy(J.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/xe.x),i.x=s.x*xe.x,J.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/xe.y),i.y=s.y*xe.y,J.mapSize.y=s.y)),null===J.map||!0===Y||!0===$){const Se=3!==this.type?{minFilter:St,magFilter:St}:{};null!==J.map&&J.map.dispose(),J.map=new Zi(i.x,i.y,Se),J.map.texture.name=oe.name+".shadowMap",J.camera.updateProjectionMatrix()}r.setRenderTarget(J.map),r.clear();const be=J.getViewportCount();for(let Se=0;Se<be;Se++){const et=J.getViewport(Se);a.set(s.x*et.x,s.y*et.y,s.x*et.z,s.y*et.w),q.viewport(a),J.updateMatrices(oe,Se),n=J.getFrustum(),w(I,N,J.camera,oe,this.type)}!0!==J.isPointLightShadow&&3===this.type&&S(J,N),J.needsUpdate=!1}g=this.type,v.needsUpdate=!1,r.setRenderTarget(Z,b,T)}}const __={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};function x_(r){const i=new function e(){let F=!1;const Ee=new lt;let K=null;const ie=new lt(0,0,0,0);return{setMask:function(ye){K!==ye&&!F&&(r.colorMask(ye,ye,ye,ye),K=ye)},setLocked:function(ye){F=ye},setClear:function(ye,Te,ot,Dt,mn){!0===mn&&(ye*=Dt,Te*=Dt,ot*=Dt),Ee.set(ye,Te,ot,Dt),!1===ie.equals(Ee)&&(r.clearColor(ye,Te,ot,Dt),ie.copy(Ee))},reset:function(){F=!1,K=null,ie.set(-1,0,0,0)}}},s=new function t(){let F=!1,Ee=!1,K=null,ie=null,ye=null;return{setReversed:function(Te){Ee=Te},setTest:function(Te){Te?Re(r.DEPTH_TEST):ve(r.DEPTH_TEST)},setMask:function(Te){K!==Te&&!F&&(r.depthMask(Te),K=Te)},setFunc:function(Te){if(Ee&&(Te=__[Te]),ie!==Te){switch(Te){case 0:r.depthFunc(r.NEVER);break;case 1:r.depthFunc(r.ALWAYS);break;case 2:r.depthFunc(r.LESS);break;case 3:default:r.depthFunc(r.LEQUAL);break;case 4:r.depthFunc(r.EQUAL);break;case 5:r.depthFunc(r.GEQUAL);break;case 6:r.depthFunc(r.GREATER);break;case 7:r.depthFunc(r.NOTEQUAL)}ie=Te}},setLocked:function(Te){F=Te},setClear:function(Te){ye!==Te&&(r.clearDepth(Te),ye=Te)}
1,reset:function(){F=!1,K=null,ie=null,ye=null}}},a=new function n(){let F=!1,Ee=null,K=null,ie=null,ye=null,Te=null,ot=null,Dt=null,mn=null;return{setTest:function(ht){F||(ht?Re(r.STENCIL_TEST):ve(r.STENCIL_TEST))},setMask:function(ht){Ee!==ht&&!F&&(r.stencilMask(ht),Ee=ht)},setFunc:function(ht,gn,zi){(K!==ht||ie!==gn||ye!==zi)&&(r.stencilFunc(ht,gn,zi),K=ht,ie=gn,ye=zi)},setOp:function(ht,gn,zi){(Te!==ht||ot!==gn||Dt!==zi)&&(r.stencilOp(ht,gn,zi),Te=ht,ot=gn,Dt=zi)},setLocked:function(ht){F=ht},setClear:function(ht){mn!==ht&&(r.clearStencil(ht),mn=ht)},reset:function(){F=!1,Ee=null,K=null,ie=null,ye=null,Te=null,ot=null,Dt=null,mn=null}}},l=new WeakMap,c=new WeakMap;let h={},u={},f=new WeakMap,p=[],m=null,_=!1,x=null,v=null,g=null,S=null,M=null,w=null,O=null,R=new Me(0,0,0),I=0,N=!1,Z=null,b=null,T=null,q=null,Y=null;const $=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let re=!1,X=0;const oe=r.getParameter(r.VERSION);-1!==oe.indexOf("WebGL")?(X=parseFloat(/^WebGL (\d)/.exec(oe)[1]),re=X>=1):-1!==oe.indexOf("OpenGL ES")&&(X=parseFloat(/^OpenGL ES (\d)/.exec(oe)[1]),re=X>=2);let J=null,xe={};const be=r.getParameter(r.SCISSOR_BOX),Se=r.getParameter(r.VIEWPORT),et=(new lt).fromArray(be),ct=(new lt).fromArray(Se);function j(F,Ee,K,ie){const ye=new Uint8Array(4),Te=r.createTexture();r.bindTexture(F,Te),r.texParameteri(F,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(F,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let ot=0;ot<K;ot++)F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY?r.texImage3D(Ee,0,r.RGBA,1,1,ie,0,r.RGBA,r.UNSIGNED_BYTE,ye):r.texImage2D(Ee+ot,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,ye);return Te}const ce={};function Re(F){!0!==h[F]&&(r.enable(F),h[F]=!0)}function ve(F){!1!==h[F]&&(r.disable(F),h[F]=!1)}ce[r.TEXTURE_2D]=j(r.TEXTURE_2D,r.TEXTURE_2D,1),ce[r.TEXTURE_CUBE_MAP]=j(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ce[r.TEXTURE_2D_ARRAY]=j(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ce[r.TEXTURE_3D]=j(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),a.setClear(0),Re(r.DEPTH_TEST),s.setFunc(3),ue(!1),ae(1),Re(r.CULL_FACE),U(0);const Qe={100:r.FUNC_ADD,101:r.FUNC_SUBTRACT,102:r.FUNC_REVERSE_SUBTRACT};Qe[103]=r.MIN,Qe[104]=r.MAX;const te={200:r.ZERO,201:r.ONE,202:r.SRC_COLOR,204:r.SRC_ALPHA,210:r.SRC_ALPHA_SATURATE,208:r.DST_COLOR,206:r.DST_ALPHA,203:r.ONE_MINUS_SRC_COLOR,205:r.ONE_MINUS_SRC_ALPHA,209:r.ONE_MINUS_DST_COLOR,207:r.ONE_MINUS_DST_ALPHA,211:r.CONSTANT_COLOR,212:r.ONE_MINUS_CONSTANT_COLOR,213:r.CONSTANT_ALPHA,214:r.ONE_MINUS_CONSTANT_ALPHA};function U(F,Ee,K,ie,ye,Te,ot,Dt,mn,ht){if(0!==F){if(!1===_&&(Re(r.BLEND),_=!0),5===F)ye=ye||Ee,Te=Te||K,ot=ot||ie,(Ee!==v||ye!==M)&&(r.blendEquationSeparate(Qe[Ee],Qe[ye]),v=Ee,M=ye),(K!==g||ie!==S||Te!==w||ot!==O)&&(r.blendFuncSeparate(te[K],te[ie],te[Te],te[ot]),g=K,S=ie,w=Te,O=ot),(!1===Dt.equals(R)||mn!==I)&&(r.blendColor(Dt.r,Dt.g,Dt.b,mn),R.copy(Dt),I=mn),x=F,N=!1;else if(F!==x||ht!==N){if((100!==v||100!==M)&&(r.blendEquation(r.FUNC_ADD),v=100,M=100),ht)switch(F){case 1:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case 2:r.blendFunc(r.ONE,r.ONE);break;case 3:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case 4:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",F)}else switch(F){case 1:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case 2:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case 3:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case 4:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",F)}g=null,S=null,w=null,O=null,R.set(0,0,0),I=0,x=F,N=ht}}else!0===_&&(ve(r.BLEND),_=!1)}function ue(F){Z!==F&&(r.frontFace(F?r.CW:r.CCW),Z=F)}function ae(F){0!==F?(Re(r.CULL_FACE),F!==b&&r.cullFace(1===F?r.BACK:2===F?r.FRONT:r.FRONT_AND_BACK)):ve(r.CULL_FACE),b=F}function Ne(F,Ee,K){F?(Re(r.POLYGON_OFFSET_FILL),(q!==Ee||Y!==K)&&(r.polygonOffset(Ee,K),q=Ee,Y=K)):ve(r.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:s,stencil:a},enable:Re,disable:ve,bindFramebuffer:function Ve(F,Ee){return u[F]!==Ee&&(r.bindFramebuffer(F,Ee),u[F]=Ee,F===r.DRAW_FRAMEBUFFER&&(u[r.FRAMEBUFFER]=Ee),F===r.FRAMEBUFFER&&(u[r.DRAW_FRAMEBUFFER]=Ee),!0)},drawBuffers:function ke(F,Ee){let K=p,ie=!1;if(F){K=f.get(Ee),void 0===K&&(K=[],f.set(Ee,K));const ye=F.textures;if(K.length!==ye.length||K[0]!==r.COLOR_ATTACHMENT0){for(let Te=0,ot=ye.length;Te<ot;Te++)K[Te]=r.COLOR_ATTACHMENT0+Te;K.length=ye.length,ie=!0}}else K[0]!==r.BACK&&(K[0]=r.BACK,ie=!0);ie&&r.drawBuffers(K)},useProgram:function qe(F){return m!==F&&(r.useProgram(F),m=F,!0)},setBlending:U,setMaterial:function de(F,Ee){2===F.side?ve(r.CULL_FACE):Re(r.CULL_FACE);let K=1===F.side;Ee&&(K=!K),ue(K),1===F.blending&&!1===F.transparent?U(0):U(F.blending,F.blendEquation,F.blendSrc,F.blendDst,F.blendEquationAlpha,F.blendSrcAlpha,F.blendDstAlpha,F.blendColor,F.blendAlpha,F.premultipliedAlpha),s.setFunc(F.depthFunc),s.setTest(F.depthTest),s.setMask(F.depthWrite),i.setMask(F.colorWrite);const ie=F.stencilWrite;a.setTest(ie),ie&&(a.setMask(F.stencilWriteMask),a.setFunc(F.stencilFunc,F.stencilRef,F.stencilFuncMask),a.setOp(F.stencilFail,F.stencilZFail,F.stencilZPass)),Ne(F.polygonOffset,F.polygonOffsetFactor,F.polygonOffsetUnits),!0===F.alph
1aToCoverage?Re(r.SAMPLE_ALPHA_TO_COVERAGE):ve(r.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:ue,setCullFace:ae,setLineWidth:function fe(F){F!==T&&(re&&r.lineWidth(F),T=F)},setPolygonOffset:Ne,setScissorTest:function we(F){F?Re(r.SCISSOR_TEST):ve(r.SCISSOR_TEST)},activeTexture:function P(F){void 0===F&&(F=r.TEXTURE0+$-1),J!==F&&(r.activeTexture(F),J=F)},bindTexture:function E(F,Ee,K){void 0===K&&(K=null===J?r.TEXTURE0+$-1:J);let ie=xe[K];void 0===ie&&(ie={type:void 0,texture:void 0},xe[K]=ie),(ie.type!==F||ie.texture!==Ee)&&(J!==K&&(r.activeTexture(K),J=K),r.bindTexture(F,Ee||ce[F]),ie.type=F,ie.texture=Ee)},unbindTexture:function V(){const F=xe[J];void 0!==F&&void 0!==F.type&&(r.bindTexture(F.type,null),F.type=void 0,F.texture=void 0)},compressedTexImage2D:function Q(){try{r.compressedTexImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},compressedTexImage3D:function ne(){try{r.compressedTexImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},texImage2D:function Ce(){try{r.texImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},texImage3D:function Xe(){try{r.texImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},updateUBOMapping:function rt(F,Ee){let K=c.get(Ee);void 0===K&&(K=new WeakMap,c.set(Ee,K));let ie=K.get(F);void 0===ie&&(ie=r.getUniformBlockIndex(Ee,F.name),K.set(F,ie))},uniformBlockBinding:function $e(F,Ee){const ie=c.get(Ee).get(F);l.get(Ee)!==ie&&(r.uniformBlockBinding(Ee,ie,F.__bindingPointIndex),l.set(Ee,ie))},texStorage2D:function st(){try{r.texStorage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},texStorage3D:function le(){try{r.texStorage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},texSubImage2D:function ee(){try{r.texSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},texSubImage3D:function De(){try{r.texSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},compressedTexSubImage2D:function me(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},compressedTexSubImage3D:function Ae(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}},scissor:function Ye(F){!1===et.equals(F)&&(r.scissor(F.x,F.y,F.z,F.w),et.copy(F))},viewport:function Ie(F){!1===ct.equals(F)&&(r.viewport(F.x,F.y,F.z,F.w),ct.copy(F))},reset:function mt(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),h={},J=null,xe={},u={},f=new WeakMap,p=[],m=null,_=!1,x=null,v=null,g=null,S=null,M=null,w=null,O=null,R=new Me(0,0,0),I=0,N=!1,Z=null,b=null,T=null,q=null,Y=null,et.set(0,0,r.canvas.width,r.canvas.height),ct.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),a.reset()}}}function Qc(r,e,t,n){const i=function S_(r){switch(r){case In:case 1010:return{byteLength:1,components:1};case Vi:case 1011:case Jn:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case Vn:case 1013:case Jt:return{byteLength:4,components:1};case 35902:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${r}.`)}(n);switch(t){case 1021:case 1024:return r*e;case 1025:return r*e*2;case 1028:case 1029:return r*e/i.components*i.byteLength;case 1030:case 1031:return r*e*2/i.components*i.byteLength;case 1022:return r*e*3/i.components*i.byteLength;case Xt:case 1033:return r*e*4/i.components*i.byteLength;case gs:case Ot:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case vs:case _s:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case 35841:case 35843:return Math.max(r,16)*Math.max(e,8)/4;case 35840:case 35842:return Math.max(r,8)*Math.max(e,8)/2;case 36196:case 37492:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case 37496:case 37808:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;
vendor: 5,051 bytes, line 1
1case 37809:return Math.floor((r+4)/5)*Math.floor((e+3)/4)*16;case 37810:return Math.floor((r+4)/5)*Math.floor((e+4)/5)*16;case 37811:return Math.floor((r+5)/6)*Math.floor((e+4)/5)*16;case 37812:return Math.floor((r+5)/6)*Math.floor((e+5)/6)*16;case 37813:return Math.floor((r+7)/8)*Math.floor((e+4)/5)*16;case 37814:return Math.floor((r+7)/8)*Math.floor((e+5)/6)*16;case 37815:return Math.floor((r+7)/8)*Math.floor((e+7)/8)*16;case 37816:return Math.floor((r+9)/10)*Math.floor((e+4)/5)*16;case 37817:return Math.floor((r+9)/10)*Math.floor((e+5)/6)*16;case 37818:return Math.floor((r+9)/10)*Math.floor((e+7)/8)*16;case 37819:return Math.floor((r+9)/10)*Math.floor((e+9)/10)*16;case 37820:return Math.floor((r+11)/12)*Math.floor((e+9)/10)*16;case 37821:return Math.floor((r+11)/12)*Math.floor((e+11)/12)*16;case xs:case 36494:case 36495:return Math.ceil(r/4)*Math.ceil(e/4)*16;case 36283:case 36284:return Math.ceil(r/4)*Math.ceil(e/4)*8;case 36285:case 36286:return Math.ceil(r/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function w_(r,e,t,n,i,s,a){const l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),h=new o,u=new WeakMap;let f;const p=new WeakMap;let m=!1;try{m="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(P){}function _(P,E){return m?new OffscreenCanvas(P,E):z("canvas")}function x(P,E,V){let Q=1;const ne=we(P);if((ne.width>V||ne.height>V)&&(Q=V/Math.max(ne.width,ne.height)),Q<1){if("undefined"!=typeof HTMLImageElement&&P instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&P instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&P instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&P instanceof VideoFrame){const ee=Math.floor(Q*ne.width),De=Math.floor(Q*ne.height);void 0===f&&(f=_(ee,De));const me=E?_(ee,De):f;return me.width=ee,me.height=De,me.getContext("2d").drawImage(P,0,0,ee,De),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ne.width+"x"+ne.height+") to ("+ee+"x"+De+")."),me}return"data"in P&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ne.width+"x"+ne.height+")."),P}return P}function v(P){return P.generateMipmaps&&P.minFilter!==St&&P.minFilter!==xt}function g(P){r.generateMipmap(P)}function S(P,E,V,Q,ne=!1){if(null!==P){if(void 0!==r[P])return r[P];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+P+"'")}let ee=E;if(E===r.RED&&(V===r.FLOAT&&(ee=r.R32F),V===r.HALF_FLOAT&&(ee=r.R16F),V===r.UNSIGNED_BYTE&&(ee=r.R8)),E===r.RED_INTEGER&&(V===r.UNSIGNED_BYTE&&(ee=r.R8UI),V===r.UNSIGNED_SHORT&&(ee=r.R16UI),V===r.UNSIGNED_INT&&(ee=r.R32UI),V===r.BYTE&&(ee=r.R8I),V===r.SHORT&&(ee=r.R16I),V===r.INT&&(ee=r.R32I)),E===r.RG&&(V===r.FLOAT&&(ee=r.RG32F),V===r.HALF_FLOAT&&(ee=r.RG16F),V===r.UNSIGNED_BYTE&&(ee=r.RG8)),E===r.RG_INTEGER&&(V===r.UNSIGNED_BYTE&&(ee=r.RG8UI),V===r.UNSIGNED_SHORT&&(ee=r.RG16UI),V===r.UNSIGNED_INT&&(ee=r.RG32UI),V===r.BYTE&&(ee=r.RG8I),V===r.SHORT&&(ee=r.RG16I),V===r.INT&&(ee=r.RG32I)),E===r.RGB_INTEGER&&(V===r.UNSIGNED_BYTE&&(ee=r.RGB8UI),V===r.UNSIGNED_SHORT&&(ee=r.RGB16UI),V===r.UNSIGNED_INT&&(ee=r.RGB32UI),V===r.BYTE&&(ee=r.RGB8I),V===r.SHORT&&(ee=r.RGB16I),V===r.INT&&(ee=r.RGB32I)),E===r.RGBA_INTEGER&&(V===r.UNSIGNED_BYTE&&(ee=r.RGBA8UI),V===r.UNSIGNED_SHORT&&(ee=r.RGBA16UI),V===r.UNSIGNED_INT&&(ee=r.RGBA32UI),V===r.BYTE&&(ee=r.RGBA8I),V===r.SHORT&&(ee=r.RGBA16I),V===r.INT&&(ee=r.RGBA32I)),E===r.RGB&&V===r.UNSIGNED_INT_5_9_9_9_REV&&(ee=r.RGB9_E5),E===r.RGBA){const De=ne?ii:it.getTransfer(Q);V===r.FLOAT&&(ee=r.RGBA32F),V===r.HALF_FLOAT&&(ee=r.RGBA16F),V===r.UNSIGNED_BYTE&&(ee=De===Ze?r.SRGB8_ALPHA8:r.RGBA8),V===r.UNSIGNED_SHORT_4_4_4_4&&(ee=r.RGBA4),V===r.UNSIGNED_SHORT_5_5_5_1&&(ee=r.RGB5_A1)}return(ee===r.R16F||ee===r.R32F||ee===r.RG16F||ee===r.RG32F||ee===r.RGBA16F||ee===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ee}function M(P,E){let V;return P?null===E||E===Vn||E===Gn?V=r.DEPTH24_STENCIL8:E===Jt?V=r.DEPTH32F_STENCIL8:E===Vi&&(V=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===E||E===Vn||E===Gn?V=r.DEPTH_COMPONENT24:E===Jt?V=r.DEPTH_COMPONENT32F:E===Vi&&(V=r.DEPTH_COMPONENT16),V}function w(P,E){return!0===v(P)||P.isFramebufferTexture&&P.minFilter!==St&&P.minFilter!==xt?Math.log2(Math.max(E.width,E.height))+1:void 0!==P.mipmaps&&P.mipmaps.length>0?P.mipmaps.length:P.isCompressedTexture&&Array.isArray(P.image)?E.mipmaps.length:1}function O(P){const E=P.target;E.removeEventListener("dispose",O),function I(P){const E=n.get(P);if(void 0===E.__webglInit)return;const V=P.source,Q=p.get(V);if(Q){const ne=Q[E.__cacheKey];ne.usedTimes--,0===ne.usedTimes&&N(P),0===Object.keys(Q).length&&p.delete(V)}n.remove(P)}(E),E.isVideoTexture&&u.delete(E)}function R(P){const E=P.target;E.removeEventListener("dispose",R),function Z(P){const E=n.get(P);
1if(P.depthTexture&&P.depthTexture.dispose(),P.isWebGLCubeRenderTarget)for(let Q=0;Q<6;Q++){if(Array.isArray(E.__webglFramebuffer[Q]))for(let ne=0;ne<E.__webglFramebuffer[Q].length;ne++)r.deleteFramebuffer(E.__webglFramebuffer[Q][ne]);else r.deleteFramebuffer(E.__webglFramebuffer[Q]);E.__webglDepthbuffer&&r.deleteRenderbuffer(E.__webglDepthbuffer[Q])}else{if(Array.isArray(E.__webglFramebuffer))for(let Q=0;Q<E.__webglFramebuffer.length;Q++)r.deleteFramebuffer(E.__webglFramebuffer[Q]);else r.deleteFramebuffer(E.__webglFramebuffer);if(E.__webglDepthbuffer&&r.deleteRenderbuffer(E.__webglDepthbuffer),E.__webglMultisampledFramebuffer&&r.deleteFramebuffer(E.__webglMultisampledFramebuffer),E.__webglColorRenderbuffer)for(let Q=0;Q<E.__webglColorRenderbuffer.length;Q++)E.__webglColorRenderbuffer[Q]&&r.deleteRenderbuffer(E.__webglColorRenderbuffer[Q]);E.__webglDepthRenderbuffer&&r.deleteRenderbuffer(E.__webglDepthRenderbuffer)}const V=P.textures;for(let Q=0,ne=V.length;Q<ne;Q++){const ee=n.get(V[Q]);ee.__webglTexture&&(r.deleteTexture(ee.__webglTexture),a.memory.textures--),n.remove(V[Q])}n.remove(P)}(E)}function N(P){const E=n.get(P);r.deleteTexture(E.__webglTexture),delete p.get(P.source)[E.__cacheKey],a.memory.textures--}let b=0;function $(P,E){const V=n.get(P);if(P.isVideoTexture&&function fe(P){const E=a.render.frame;u.get(P)!==E&&(u.set(P,E),P.update())}(P),!1===P.isRenderTargetTexture&&P.version>0&&V.__version!==P.version){const Q=P.image;if(null===Q)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==Q.complete)return void ct(V,P,E);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}t.bindTexture(r.TEXTURE_2D,V.__webglTexture,r.TEXTURE0+E)}const J={1e3:r.REPEAT,[hn]:r.CLAMP_TO_EDGE,1002:r.MIRRORED_REPEAT},xe={[St]:r.NEAREST,1004:r.NEAREST_MIPMAP_NEAREST,1005:r.NEAREST_MIPMAP_LINEAR,[xt]:r.LINEAR,1007:r.LINEAR_MIPMAP_NEAREST,[At]:r.LINEAR_MIPMAP_LINEAR},be={512:r.NEVER,519:r.ALWAYS,513:r.LESS,515:r.LEQUAL,514:r.EQUAL,518:r.GEQUAL,516:r.GREATER,517:r.NOTEQUAL};function Se(P,E){if(E.type===Jt&&!1===e.has("OES_texture_float_linear")&&(E.magFilter===xt||1007===E.magFilter||1005===E.magFilter||E.magFilter===At||E.minFilter===xt||1007===E.minFilter||1005===E.minFilter||E.minFilter===At)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(P,r.TEXTURE_WRAP_S,J[E.wrapS]),r.texParameteri(P,r.TEXTURE_WRAP_T,J[E.wrapT]),(P===r.TEXTURE_3D||P===r.TEXTURE_2D_ARRAY)&&r.texParameteri(P,r.TEXTURE_WRAP_R,J[E.wrapR]),r.texParameteri(P,r.TEXTURE_MAG_FILTER,xe[E.magFilter]),r.texParameteri(P,r.TEXTURE_MIN_FILTER,xe[E.minFilter]),E.compareFunction&&(r.texParameteri(P,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(P,r.TEXTURE_COMPARE_FUNC,be[E.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){if(E.magFilter===St||1005!==E.minFilter&&E.minFilter!==At||E.type===Jt&&!1===e.has("OES_texture_float_linear"))return;if(E.anisotropy>1||n.get(E).__currentAnisotropy){const V=e.get("EXT_texture_filter_anisotropic");r.texParameterf(P,V.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy}}}function et(P,E){let V=!1;void 0===P.__webglInit&&(P.__webglInit=!0,E.addEventListener("dispose",O));const Q=E.source;let ne=p.get(Q);void 0===ne&&(ne={},p.set(Q,ne));const ee=function Y(P){const E=[];return E.push(P.wrapS),E.push(P.wrapT),E.push(P.wrapR||0),E.push(P.magFilter),E.push(P.minFilter),E.push(P.anisotropy),E.push(P.internalFormat),E.push(P.format),E.push(P.type),E.push(P.generateMipmaps),E.push(P.premultiplyAlpha),E.push(P.flipY),E.push(P.unpackAlignment),E.push(P.colorSpace),E.join()}(E);if(ee!==P.__cacheKey){void 0===ne[ee]&&(ne[ee]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,V=!0),ne[ee].usedTimes++;const De=ne[P.__cacheKey];void 0!==De&&(ne[P.__cacheKey].usedTimes--,0===De.usedTimes&&N(E)),P.__cacheKey=ee,P.__webglTexture=ne[ee].texture}return V}function ct(P,E,V){let Q=r.TEXTURE_2D;(E.isDataArrayTexture||E.isCompressedArrayTexture)&&(Q=r.TEXTURE_2D_ARRAY),E.isData3DTexture&&(Q=r.TEXTURE_3D);const ne=et(P,E),ee=E.source;t.bindTexture(Q,P.__webglTexture,r.TEXTURE0+V);const De=n.get(ee);if(ee.version!==De.__version||!0===ne){t.activeTexture(r.TEXTURE0+V);const me=it.getPrimaries(it.workingColorSpace),Ae=""===E.colorSpace?null:it.getPrimaries(E.colorSpace),st=""===E.colorSpace||me===Ae?r.NONE:r.BROW
vendor: 4,300 bytes, line 1
1SER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,E.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,E.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);let le=x(E.image,!1,i.maxTextureSize);le=Ne(E,le);const Ce=s.convert(E.format,E.colorSpace),Xe=s.convert(E.type);let Ie,Ye=S(E.internalFormat,Ce,Xe,E.colorSpace,E.isVideoTexture);Se(Q,E);const rt=E.mipmaps,$e=!0!==E.isVideoTexture,mt=void 0===De.__version||!0===ne,F=ee.dataReady,Ee=w(E,le);if(E.isDepthTexture)Ye=M(E.format===jn,E.type),mt&&($e?t.texStorage2D(r.TEXTURE_2D,1,Ye,le.width,le.height):t.texImage2D(r.TEXTURE_2D,0,Ye,le.width,le.height,0,Ce,Xe,null));else if(E.isDataTexture)if(rt.length>0){$e&&mt&&t.texStorage2D(r.TEXTURE_2D,Ee,Ye,rt[0].width,rt[0].height);for(let K=0,ie=rt.length;K<ie;K++)Ie=rt[K],$e?F&&t.texSubImage2D(r.TEXTURE_2D,K,0,0,Ie.width,Ie.height,Ce,Xe,Ie.data):t.texImage2D(r.TEXTURE_2D,K,Ye,Ie.width,Ie.height,0,Ce,Xe,Ie.data);E.generateMipmaps=!1}else $e?(mt&&t.texStorage2D(r.TEXTURE_2D,Ee,Ye,le.width,le.height),F&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,le.width,le.height,Ce,Xe,le.data)):t.texImage2D(r.TEXTURE_2D,0,Ye,le.width,le.height,0,Ce,Xe,le.data);else if(E.isCompressedTexture)if(E.isCompressedArrayTexture){$e&&mt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Ee,Ye,rt[0].width,rt[0].height,le.depth);for(let K=0,ie=rt.length;K<ie;K++)if(Ie=rt[K],E.format!==Xt)if(null!==Ce)if($e){if(F)if(E.layerUpdates.size>0){const ye=Qc(Ie.width,Ie.height,E.format,E.type);for(const Te of E.layerUpdates){const ot=Ie.data.subarray(Te*ye/Ie.data.BYTES_PER_ELEMENT,(Te+1)*ye/Ie.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,K,0,0,Te,Ie.width,Ie.height,1,Ce,ot,0,0)}E.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,K,0,0,0,Ie.width,Ie.height,le.depth,Ce,Ie.data,0,0)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,K,Ye,Ie.width,Ie.height,le.depth,0,Ie.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else $e?F&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,K,0,0,0,Ie.width,Ie.height,le.depth,Ce,Xe,Ie.data):t.texImage3D(r.TEXTURE_2D_ARRAY,K,Ye,Ie.width,Ie.height,le.depth,0,Ce,Xe,Ie.data)}else{$e&&mt&&t.texStorage2D(r.TEXTURE_2D,Ee,Ye,rt[0].width,rt[0].height);for(let K=0,ie=rt.length;K<ie;K++)Ie=rt[K],E.format!==Xt?null!==Ce?$e?F&&t.compressedTexSubImage2D(r.TEXTURE_2D,K,0,0,Ie.width,Ie.height,Ce,Ie.data):t.compressedTexImage2D(r.TEXTURE_2D,K,Ye,Ie.width,Ie.height,0,Ie.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):$e?F&&t.texSubImage2D(r.TEXTURE_2D,K,0,0,Ie.width,Ie.height,Ce,Xe,Ie.data):t.texImage2D(r.TEXTURE_2D,K,Ye,Ie.width,Ie.height,0,Ce,Xe,Ie.data)}else if(E.isDataArrayTexture)if($e){if(mt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Ee,Ye,le.width,le.height,le.depth),F)if(E.layerUpdates.size>0){const K=Qc(le.width,le.height,E.format,E.type);for(const ie of E.layerUpdates){const ye=le.data.subarray(ie*K/le.data.BYTES_PER_ELEMENT,(ie+1)*K/le.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,ie,le.width,le.height,1,Ce,Xe,ye)}E.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,le.width,le.height,le.depth,Ce,Xe,le.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,Ye,le.width,le.height,le.depth,0,Ce,Xe,le.data);else if(E.isData3DTexture)$e?(mt&&t.texStorage3D(r.TEXTURE_3D,Ee,Ye,le.width,le.height,le.depth),F&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,le.width,le.height,le.depth,Ce,Xe,le.data)):t.texImage3D(r.TEXTURE_3D,0,Ye,le.width,le.height,le.depth,0,Ce,Xe,le.data);else if(E.isFramebufferTexture){if(mt)if($e)t.texStorage2D(r.TEXTURE_2D,Ee,Ye,le.width,le.height);else{let K=le.width,ie=le.height;for(let ye=0;ye<Ee;ye++)t.texImage2D(r.TEXTURE_2D,ye,Ye,K,ie,0,Ce,Xe,null),K>>=1,ie>>=1}}else if(rt.length>0){if($e&&mt){const K=we(rt[0]);t.texStorage2D(r.TEXTURE_2D,Ee,Ye,K.width,K.height)}for(let K=0,ie=rt.length;K<ie;K++)Ie=rt[K],$e?F&&t.texSubImage2D(r.TEXTURE_2D,K,0,0,Ce,Xe,Ie):t.texImage2D(r.TEXTURE_2D,K,Ye,Ce,Xe,Ie);E.generateMipmaps=!1}else if($e){if(mt){const K=we(le);t.texStorage2D(r.TEXTURE_2D,Ee,Ye,K.width,K.height)}F&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Ce,Xe,le)}else t.texImage2D(r.TEXTURE_2D,0,Ye,Ce,Xe,le);
1v(E)&&g(Q),De.__version=ee.version,E.onUpdate&&E.onUpdate(E)}P.__version=E.version}function ce(P,E,V,Q,ne,ee){const De=s.convert(V.format,V.colorSpace),me=s.convert(V.type),Ae=S(V.internalFormat,De,me,V.colorSpace);if(!n.get(E).__hasExternalTextures){const le=Math.max(1,E.width>>ee),Ce=Math.max(1,E.height>>ee);ne===r.TEXTURE_3D||ne===r.TEXTURE_2D_ARRAY?t.texImage3D(ne,ee,Ae,le,Ce,E.depth,0,De,me,null):t.texImage2D(ne,ee,Ae,le,Ce,0,De,me,null)}t.bindFramebuffer(r.FRAMEBUFFER,P),ae(E)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Q,ne,n.get(V).__webglTexture,0,ue(E)):(ne===r.TEXTURE_2D||ne>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&ne<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,Q,ne,n.get(V).__webglTexture,ee),t.bindFramebuffer(r.FRAMEBUFFER,null)}function Re(P,E,V){if(r.bindRenderbuffer(r.RENDERBUFFER,P),E.depthBuffer){const Q=E.depthTexture,ee=M(E.stencilBuffer,Q&&Q.isDepthTexture?Q.type:null),De=E.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,me=ue(E);ae(E)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,me,ee,E.width,E.height):V?r.renderbufferStorageMultisample(r.RENDERBUFFER,me,ee,E.width,E.height):r.renderbufferStorage(r.RENDERBUFFER,ee,E.width,E.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,De,r.RENDERBUFFER,P)}else{const Q=E.textures;for(let ne=0;ne<Q.length;ne++){const ee=Q[ne],De=s.convert(ee.format,ee.colorSpace),me=s.convert(ee.type),Ae=S(ee.internalFormat,De,me,ee.colorSpace),st=ue(E);V&&!1===ae(E)?r.renderbufferStorageMultisample(r.RENDERBUFFER,st,Ae,E.width,E.height):ae(E)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,st,Ae,E.width,E.height):r.renderbufferStorage(r.RENDERBUFFER,Ae,E.width,E.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ve(P){const E=n.get(P),V=!0===P.isWebGLCubeRenderTarget;if(E.__boundDepthTexture!==P.depthTexture){const Q=P.depthTexture;if(E.__depthDisposeCallback&&E.__depthDisposeCallback(),Q){const ne=()=>{delete E.__boundDepthTexture,delete E.__depthDisposeCallback,Q.removeEventListener("dispose",ne)};Q.addEventListener("dispose",ne),E.__depthDisposeCallback=ne}E.__boundDepthTexture=Q}if(P.depthTexture&&!E.__autoAllocateDepthBuffer){if(V)throw new Error("target.depthTexture not supported in Cube render targets");!function ve(P,E){if(E&&E.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,P),!E.depthTexture||!E.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(E.depthTexture).__webglTexture||E.depthTexture.image.width!==E.width||E.depthTexture.image.height!==E.height)&&(E.depthTexture.image.width=E.width,E.depthTexture.image.height=E.height,E.depthTexture.needsUpdate=!0),$(E.depthTexture,0);const Q=n.get(E.depthTexture).__webglTexture,ne=ue(E);if(E.depthTexture.format===vi)ae(E)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Q,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Q,0);else{if(E.depthTexture.format!==jn)throw new Error("Unknown depthTexture format");ae(E)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Q,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Q,0)}}(E.__webglFramebuffer,P)}else if(V){E.__webglDepthbuffer=[];for(let Q=0;Q<6;Q++)if(t.bindFramebuffer(r.FRAMEBUFFER,E.__webglFramebuffer[Q]),void 0===E.__webglDepthbuffer[Q])E.__webglDepthbuffer[Q]=r.createRenderbuffer(),Re(E.__webglDepthbuffer[Q],P,!1);else{const ne=P.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ee=E.__webglDepthbuffer[Q];r.bindRenderbuffer(r.RENDERBUFFER,ee),r.framebufferRenderbuffer(r.FRAMEBUFFER,ne,r.RENDERBUFFER,ee)}}else if(t.bindFramebuffer(r.FRAMEBUFFER,E.__webglFramebuffer),void 0===E.__webglDepthbuffer)E.__webglDepthbuffer=r.createRenderbuffer(),Re(E.__webglDepthbuffer,P,!1);else{const Q=P.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ne=E.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,ne),r.framebufferRenderbuffer(r.FRAMEBUFFER,Q,r.RENDERBUFFER,ne)}t.bindFramebuffer(r.FRAMEBUFFER,null)}const te=[],U=[];function ue(P){return Math.min(i.maxSamples,P.samples)}function ae(P){const E=n.get(P);return P.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==E.__useRenderToTexture}function Ne(P,E){const V=P.colorSpace,Q=P.format,ne=P.type;return!0===P.isCompressedTexture||!0===P.isVideoTexture||V!==Dn&&""!==V&&(it.getTransfer(V)===Ze?(Q!==Xt||ne!==In)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",V)),E}function we(P){return"undefined"!=typeof HTMLImageElement&&P instanceof HTMLImageElement?(h.width=P.naturalWi
vendor: 4,909 bytes, line 1
1dth||P.width,h.height=P.naturalHeight||P.height):"undefined"!=typeof VideoFrame&&P instanceof VideoFrame?(h.width=P.displayWidth,h.height=P.displayHeight):(h.width=P.width,h.height=P.height),h}this.allocateTextureUnit=function q(){const P=b;return P>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+P+" texture units while this GPU supports only "+i.maxTextures),b+=1,P},this.resetTextureUnits=function T(){b=0},this.setTexture2D=$,this.setTexture2DArray=function re(P,E){const V=n.get(P);P.version>0&&V.__version!==P.version?ct(V,P,E):t.bindTexture(r.TEXTURE_2D_ARRAY,V.__webglTexture,r.TEXTURE0+E)},this.setTexture3D=function X(P,E){const V=n.get(P);P.version>0&&V.__version!==P.version?ct(V,P,E):t.bindTexture(r.TEXTURE_3D,V.__webglTexture,r.TEXTURE0+E)},this.setTextureCube=function oe(P,E){const V=n.get(P);P.version>0&&V.__version!==P.version?function j(P,E,V){if(6!==E.image.length)return;const Q=et(P,E),ne=E.source;t.bindTexture(r.TEXTURE_CUBE_MAP,P.__webglTexture,r.TEXTURE0+V);const ee=n.get(ne);if(ne.version!==ee.__version||!0===Q){t.activeTexture(r.TEXTURE0+V);const De=it.getPrimaries(it.workingColorSpace),me=""===E.colorSpace?null:it.getPrimaries(E.colorSpace),Ae=""===E.colorSpace||De===me?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,E.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,E.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ae);const st=E.isCompressedTexture||E.image[0].isCompressedTexture,le=E.image[0]&&E.image[0].isDataTexture,Ce=[];for(let ie=0;ie<6;ie++)Ce[ie]=st||le?le?E.image[ie].image:E.image[ie]:x(E.image[ie],!0,i.maxCubemapSize),Ce[ie]=Ne(E,Ce[ie]);const Xe=Ce[0],Ye=s.convert(E.format,E.colorSpace),Ie=s.convert(E.type),rt=S(E.internalFormat,Ye,Ie,E.colorSpace),$e=!0!==E.isVideoTexture,mt=void 0===ee.__version||!0===Q,F=ne.dataReady;let K,Ee=w(E,Xe);if(Se(r.TEXTURE_CUBE_MAP,E),st){$e&&mt&&t.texStorage2D(r.TEXTURE_CUBE_MAP,Ee,rt,Xe.width,Xe.height);for(let ie=0;ie<6;ie++){K=Ce[ie].mipmaps;for(let ye=0;ye<K.length;ye++){const Te=K[ye];E.format!==Xt?null!==Ye?$e?F&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ye,0,0,Te.width,Te.height,Ye,Te.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ye,rt,Te.width,Te.height,0,Te.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):$e?F&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ye,0,0,Te.width,Te.height,Ye,Ie,Te.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ye,rt,Te.width,Te.height,0,Ye,Ie,Te.data)}}}else{if(K=E.mipmaps,$e&&mt){K.length>0&&Ee++;const ie=we(Ce[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,Ee,rt,ie.width,ie.height)}for(let ie=0;ie<6;ie++)if(le){$e?F&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,Ce[ie].width,Ce[ie].height,Ye,Ie,Ce[ie].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,rt,Ce[ie].width,Ce[ie].height,0,Ye,Ie,Ce[ie].data);for(let ye=0;ye<K.length;ye++){const ot=K[ye].image[ie].image;$e?F&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ye+1,0,0,ot.width,ot.height,Ye,Ie,ot.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ye+1,rt,ot.width,ot.height,0,Ye,Ie,ot.data)}}else{$e?F&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,Ye,Ie,Ce[ie]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,rt,Ye,Ie,Ce[ie]);for(let ye=0;ye<K.length;ye++){const Te=K[ye];$e?F&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ye+1,0,0,Ye,Ie,Te.image[ie]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ye+1,rt,Ye,Ie,Te.image[ie])}}}v(E)&&g(r.TEXTURE_CUBE_MAP),ee.__version=ne.version,E.onUpdate&&E.onUpdate(E)}P.__version=E.version}(V,P,E):t.bindTexture(r.TEXTURE_CUBE_MAP,V.__webglTexture,r.TEXTURE0+E)},this.rebindTextures=function ke(P,E,V){const Q=n.get(P);void 0!==E&&ce(Q.__webglFramebuffer,P,P.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),void 0!==V&&Ve(P)},this.setupRenderTarget=function qe(P){const E=P.texture,V=n.get(P),Q=n.get(E);P.addEventListener("dispose",R);const ne=P.textures,ee=!0===P.isWebGLCubeRenderTarget,De=ne.length>1;if(De||(void 0===Q.__webglTexture&&(Q.__webglTexture=r.createTexture()),Q.__version=E.version,a.memory.textures++),ee){V.__webglFramebuffer=[];for(let me=0;me<6;me++)if(E.mipmaps&&E.mipmaps.length>0){V.__webglFramebuffer[me]=[];for(let Ae=0;Ae<E.mipmaps.length;Ae++)V.__webglFramebuffer[me][Ae]=r.createFramebuffer()}else V.__webglFramebuffer[me]=r.createFramebuffer()}else{if(E.mipmaps&&E.mipmaps.length>0){V.__webglFramebuffer=[];for(let me=0;me<E.mipmaps.length;me++)V.__webglFramebuffer[me]=r.createFramebuffer()}else V.__webglFramebuffer=r.createFramebuffer();if(De)for(let me=0,Ae=ne.length;me<Ae;me++){const st=n.get(ne[me]);void 0===st.__webglTexture&&(st.__webglTexture=r.createTexture(),a.memory.textures++)}if(P.samples>0&&!1===ae(P)){V.__webglMultisampledFramebuffer=r.createFramebuffer(),V.__webglColorRen
vendor: 14,612 bytes, line 1
1derbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,V.__webglMultisampledFramebuffer);for(let me=0;me<ne.length;me++){const Ae=ne[me];V.__webglColorRenderbuffer[me]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,V.__webglColorRenderbuffer[me]);const st=s.convert(Ae.format,Ae.colorSpace),le=s.convert(Ae.type),Ce=S(Ae.internalFormat,st,le,Ae.colorSpace,!0===P.isXRRenderTarget),Xe=ue(P);r.renderbufferStorageMultisample(r.RENDERBUFFER,Xe,Ce,P.width,P.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+me,r.RENDERBUFFER,V.__webglColorRenderbuffer[me])}r.bindRenderbuffer(r.RENDERBUFFER,null),P.depthBuffer&&(V.__webglDepthRenderbuffer=r.createRenderbuffer(),Re(V.__webglDepthRenderbuffer,P,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ee){t.bindTexture(r.TEXTURE_CUBE_MAP,Q.__webglTexture),Se(r.TEXTURE_CUBE_MAP,E);for(let me=0;me<6;me++)if(E.mipmaps&&E.mipmaps.length>0)for(let Ae=0;Ae<E.mipmaps.length;Ae++)ce(V.__webglFramebuffer[me][Ae],P,E,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+me,Ae);else ce(V.__webglFramebuffer[me],P,E,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+me,0);v(E)&&g(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(De){for(let me=0,Ae=ne.length;me<Ae;me++){const st=ne[me],le=n.get(st);t.bindTexture(r.TEXTURE_2D,le.__webglTexture),Se(r.TEXTURE_2D,st),ce(V.__webglFramebuffer,P,st,r.COLOR_ATTACHMENT0+me,r.TEXTURE_2D,0),v(st)&&g(r.TEXTURE_2D)}t.unbindTexture()}else{let me=r.TEXTURE_2D;if((P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(me=P.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(me,Q.__webglTexture),Se(me,E),E.mipmaps&&E.mipmaps.length>0)for(let Ae=0;Ae<E.mipmaps.length;Ae++)ce(V.__webglFramebuffer[Ae],P,E,r.COLOR_ATTACHMENT0,me,Ae);else ce(V.__webglFramebuffer,P,E,r.COLOR_ATTACHMENT0,me,0);v(E)&&g(me),t.unbindTexture()}P.depthBuffer&&Ve(P)},this.updateRenderTargetMipmap=function Qe(P){const E=P.textures;for(let V=0,Q=E.length;V<Q;V++){const ne=E[V];if(v(ne)){const ee=P.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,De=n.get(ne).__webglTexture;t.bindTexture(ee,De),g(ee),t.unbindTexture()}}},this.updateMultisampleRenderTarget=function de(P){if(P.samples>0)if(!1===ae(P)){const E=P.textures,V=P.width,Q=P.height;let ne=r.COLOR_BUFFER_BIT;const ee=P.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,De=n.get(P),me=E.length>1;if(me)for(let Ae=0;Ae<E.length;Ae++)t.bindFramebuffer(r.FRAMEBUFFER,De.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,De.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,De.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,De.__webglFramebuffer);for(let Ae=0;Ae<E.length;Ae++){if(P.resolveDepthBuffer&&(P.depthBuffer&&(ne|=r.DEPTH_BUFFER_BIT),P.stencilBuffer&&P.resolveStencilBuffer&&(ne|=r.STENCIL_BUFFER_BIT)),me){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,De.__webglColorRenderbuffer[Ae]);const st=n.get(E[Ae]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,st,0)}r.blitFramebuffer(0,0,V,Q,0,0,V,Q,ne,r.NEAREST),!0===c&&(te.length=0,U.length=0,te.push(r.COLOR_ATTACHMENT0+Ae),P.depthBuffer&&!1===P.resolveDepthBuffer&&(te.push(ee),U.push(ee),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,U)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,te))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),me)for(let Ae=0;Ae<E.length;Ae++){t.bindFramebuffer(r.FRAMEBUFFER,De.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.RENDERBUFFER,De.__webglColorRenderbuffer[Ae]);const st=n.get(E[Ae]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,De.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.TEXTURE_2D,st,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,De.__webglMultisampledFramebuffer)}else P.depthBuffer&&!1===P.resolveDepthBuffer&&c&&r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[P.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT])},this.setupDepthRenderbuffer=Ve,this.setupFrameBufferTexture=ce,this.useMultisampledRTT=ae}function E_(r,e){return{convert:function t(n,i=""){let s;const a=it.getTransfer(i);if(n===In)return r.UNSIGNED_BYTE;if(1017===n)return r.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return r.UNSIGNED_SHORT_5_5_5_1;if(35902===n)return r.UNSIGNED_INT_5_9_9_9_REV;if(1010===n)return r.BYTE;if(1011===n)return r.SHORT;if(n===Vi)return r.UNSIGNED_SHORT;if(1013===n)return r.INT;if(n===Vn)return r.UNSIGNED_INT;if(n===Jt)return r.FLOAT;if(n===Jn)return r.HALF_FLOAT;if(1021===n)return r.ALPHA;if(1022===n)return r.RGB;if(n===Xt)return r.RGBA;if(1024===n)return r.LUMINANCE;if(1025===n)return r.LUMINANCE_ALPHA;if(n===vi)return r.DEPTH_COMPONENT;if(n===jn)return r.DEPTH_STENCIL;if(1028===n)return r.RED;if(1029===n)return r.RED_INTEGER;if(1030===n)return r.RG;if(1031===n)return r.RG_INTEGER;if(1033===n)return r.RGBA_INTEGER;if(n===gs||n===Ot||n===vs||n===_s)if(a===Ze){if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(n===gs)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ot)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===vs)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===_s)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=e.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(n===gs)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ot)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===vs)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===_s)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(s=e.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(35840===n)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n||37492===n||37496===n){if(s=e.get("WEBGL_compressed_texture_etc"),null===s)return null;if(36196===n||37492===n)return a===Ze?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(37496===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(s=e.get("WEBGL_compressed_texture_astc"),null===s)return null;if(37808===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return a===Ze?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===xs||36494===n||36495===n){if(s=e.get("EXT_texture_compression_bptc"),null===s)return null;if(n===xs)return a===Ze?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(s=e.get("EXT_texture_compression_rgtc"),null===s)return null;if(n===xs)return s.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===Gn?r.UNSIGNED_INT_24_8:void 0!==r[n]?r[n]:null}}}class T_ extends qt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Qr extends fn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const A_={type:"move"};class eh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Qr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Qr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Qr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,a=null;const l=this._targetRay,c=this._grip,h=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(h&&e.hand){a=!0;for(const x of e.hand.values()){const v=t.getJointPose(x,n),g=this._getHandJoint(h,x);null!==v&&(g.matrix.fromArray(v.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=v.radius),g.visible=null!==v}const p=h.joints["index-finger-tip"].position.distanceTo(h.joints["thumb-tip"].position),m=.02,_=.005;h.inputState.pinching&&p>m+_?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&p<=m-_&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==c&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),null!==s&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));null!==l&&(i=t.getPose(e.targetRaySpace,n),null===i&&null!==s&&(i=s),null!==i&&(l.matrix.fromArray(i.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,i.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(i.linearVelocity)):l.hasLinearVelocity=!1,i.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(i.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(A_)))}return null!==l&&(l.visible=null!==i),null!==c&&(c.visible=null!==s),null!==h&&(h.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new Qr;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class I_{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){const i=new ai;e.properties.get(i).__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,n=new Di({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Qt(new Va(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class P_ extends qi{constructor(e,t){super();const n=this;let i=null,s=1,a=null,l="local-floor",c=1,h=null,u=null,f=null,p=null,m=null,_=null;const x=new I_,v=t.getContextAttributes();let g=null,S=null;const M=[],w=[],O=new o;let R=null;const I=new qt;I.layers.enable(1),I.viewport=new lt;const N=new qt;N.layers.enable(2),N.viewport=new lt;const Z=[I,N],b=new T_;b.layers.enable(1),b.layers.enable(2);let T=null,q=null;function Y(j){const ce=w.indexOf(j.inputSource);if(-1===ce)return;const Re=M[ce];void 0!==Re&&(Re.update(j.inputSource,j.frame,h||a),Re.dispatchEvent({type:j.type,data:j.inputSource}))}function $(){i.removeEventListener("select",Y),i.removeEventListener("selectstart",Y),i.removeEventListener("selectend",Y),i.removeEventListener("squeeze",Y),i.removeEventListener("squeezestart",Y),i.removeEventListener("squeezeend",Y),i.removeEventListener("end",$),i.removeEventListener("inputsourceschange",re);for(let j=0;j<M.length;j++){const ce=w[j];null!==ce&&(w[j]=null,M[j].disconnect(ce))}T=null,q=null,x.reset(),e.setRenderTarget(g),m=null,p=null,f=null,i=null,S=null,ct.stop(),n.isPresenting=!1,e.setPixelRatio(R),e.setSize(O.width,O.height,!1),n.dispatchEvent({type:"sessionend"})}function re(j){for(let ce=0;ce<j.removed.length;ce++){const Re=j.removed[ce],ve=w.indexOf(Re);ve>=0&&(w[ve]=null,M[ve].disconnect(Re))}for(let ce=0;ce<j.added.length;ce++){const Re=j.added[ce];let ve=w.indexOf(Re);if(-1===ve){for(let ke=0;ke<M.length;
vendor: 11,753 bytes, line 1
1ke++){if(ke>=w.length){w.push(Re),ve=ke;break}if(null===w[ke]){w[ke]=Re,ve=ke;break}}if(-1===ve)break}const Ve=M[ve];Ve&&Ve.connect(Re)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(j){let ce=M[j];return void 0===ce&&(ce=new eh,M[j]=ce),ce.getTargetRaySpace()},this.getControllerGrip=function(j){let ce=M[j];return void 0===ce&&(ce=new eh,M[j]=ce),ce.getGripSpace()},this.getHand=function(j){let ce=M[j];return void 0===ce&&(ce=new eh,M[j]=ce),ce.getHandSpace()},this.setFramebufferScaleFactor=function(j){s=j,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(j){l=j,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||a},this.setReferenceSpace=function(j){h=j},this.getBaseLayer=function(){return null!==p?p:m},this.getBinding=function(){return f},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=function(){var j=(0,Ys.Z)(function*(ce){if(i=ce,null!==i){if(g=e.getRenderTarget(),i.addEventListener("select",Y),i.addEventListener("selectstart",Y),i.addEventListener("selectend",Y),i.addEventListener("squeeze",Y),i.addEventListener("squeezestart",Y),i.addEventListener("squeezeend",Y),i.addEventListener("end",$),i.addEventListener("inputsourceschange",re),!0!==v.xrCompatible&&(yield t.makeXRCompatible()),R=e.getPixelRatio(),e.getSize(O),void 0===i.renderState.layers)m=new XRWebGLLayer(i,t,{antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:s}),i.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),S=new Zi(m.framebufferWidth,m.framebufferHeight,{format:Xt,type:In,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil});else{let Re=null,ve=null,Ve=null;v.depth&&(Ve=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Re=v.stencil?jn:vi,ve=v.stencil?Gn:Vn);const ke={colorFormat:t.RGBA8,depthFormat:Ve,scaleFactor:s};f=new XRWebGLBinding(i,t),p=f.createProjectionLayer(ke),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),S=new Zi(p.textureWidth,p.textureHeight,{format:Xt,type:In,depthTexture:new Ru(p.textureWidth,p.textureHeight,ve,void 0,void 0,void 0,void 0,void 0,void 0,Re),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:v.antialias?4:0,resolveDepthBuffer:!1===p.ignoreDepthValues})}S.isXRRenderTarget=!0,this.setFoveation(c),h=null,a=yield i.requestReferenceSpace(l),ct.setContext(i),ct.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}});return function(ce){return j.apply(this,arguments)}}(),this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode},this.getDepthTexture=function(){return x.getDepthTexture()};const X=new L,oe=new L;function xe(j,ce){null===ce?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(ce.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(null===i)return;let ce=j.near,Re=j.far;null!==x.texture&&(x.depthNear>0&&(ce=x.depthNear),x.depthFar>0&&(Re=x.depthFar)),b.near=N.near=I.near=ce,b.far=N.far=I.far=Re,(T!==b.near||q!==b.far)&&(i.updateRenderState({depthNear:b.near,depthFar:b.far}),T=b.near,q=b.far);const ve=j.parent,Ve=b.cameras;xe(b,ve);for(let ke=0;ke<Ve.length;ke++)xe(Ve[ke],ve);2===Ve.length?function J(j,ce,Re){X.setFromMatrixPosition(ce.matrixWorld),oe.setFromMatrixPosition(Re.matrixWorld);const ve=X.distanceTo(oe),Ve=ce.projectionMatrix.elements,ke=Re.projectionMatrix.elements,qe=Ve[14]/(Ve[10]-1),Qe=Ve[14]/(Ve[10]+1),te=(Ve[9]+1)/Ve[5],U=(Ve[9]-1)/Ve[5],de=(Ve[8]-1)/Ve[0],ue=(ke[8]+1)/ke[0],ae=qe*de,fe=qe*ue,Ne=ve/(-de+ue),we=Ne*-de;if(ce.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(we),j.translateZ(Ne),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert(),-1===Ve[10])j.projectionMatrix.copy(ce.projectionMatrix),j.projectionMatrixInverse.copy(ce.projectionMatrixInverse);else{const P=qe+Ne,E=Qe+Ne;j.projectionMatrix.makePerspective(ae-we,fe+(ve-we),te*Qe/E*P,U*Qe/E*P,P,E),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}}(b,I,N):b.projectionMatrix.copy(I.projectionMatrix),function be(j,ce,Re){null===Re?j.matrix.copy(ce.matrixWorld):(j.matrix.copy(Re.matrixWorld),j.matrix.invert(),j.matrix.multiply(ce.matrixWorld)),j.matrix.decompose(j.position,j.quaternion,j.scale),j.updateMatrixWorld(!0),j.projectionMatrix.copy(ce.projectionMatrix),j.projectionMatrixInverse.copy(ce.projectionMatrixInverse),j.isPerspectiveCamera&&(j.fov=2*si*Math.atan(1/j.projectionMatrix.elements[5]),j.zoom=1)}(j,b,ve)},this.getCamera=function(){return b},this.getFoveation=function(){if(null!==p||null!==m)return c},this.setFoveation=function(j){c=j,null!==p&&(p.fixedFoveation=j),null!==m&&void 0!==m.fixedFoveation&&(m.fixedFoveation=j)},this.hasDepthSensing=function(){return null!==x.texture},this.getDepthSensingMesh=function(){return x.getMesh(b)};let Se=null;const ct=new Mu;ct.setAnimationLoop(function et(j,ce){if(u=ce.getViewerPose(h||a),_=ce,null!==u){const Re=u.views;null!==m&&(e.setRenderTargetFramebuffer(S,m.framebuffer),e.setRenderTarget(S));let ve=!1;Re.length!==b.cameras.length&&(b.cameras.length=0,ve=!0);for(let ke=0;ke<Re.length;ke++){const qe=Re[ke];let Qe=null;if(null!==m)Qe=m.getViewport(qe);else{const U=f.getViewSubImage(p,qe);Qe=U.viewport,0===ke&&(e.setRenderTargetTextures(S,U.colorTexture,p.ignoreDepthValues?void 0:U.depthStencilTexture),e.setRenderTarget(S))}let te=Z[ke];void 0===te&&(te=new qt,te.layers.enable(ke),te.viewport=new lt,Z[ke]=te),te.matrix.fromArray(qe.transform.matrix),te.matrix.decompose(te.position,te.quaternion,te.scale),te.projectionMatrix.fromArray(qe.projectionMatrix),te.projectionMatrixInverse.copy(te.projectionMatrix).invert(),te.viewport.set(Qe.x,Qe.y,Qe.width,Qe.height),0===ke&&(b.matrix.copy(te.matrix),b.matrix.decompose(b.position,b.quaternion,b.scale)),!0===ve&&b.cameras.push(te)}const Ve=i.enabledFeatures;if(Ve&&Ve.includes("depth-sensing")){const ke=f.getDepthInformation(Re[0]);ke&&ke.isValid&&ke.texture&&x.init(e,ke,i.renderState)}}for(let Re=0;Re<M.length;Re++){const ve=w[Re],Ve=M[Re];null!==ve&&void 0!==Ve&&Ve.update(ve,ce,h||a)}Se&&Se(j,ce),ce.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ce}),_=null}),this.setAnimationLoop=function(j){Se=j},this.dispose=function(){}}}const Ns=new oi,L_=new ze;function U_(r,e){function t(v,g){!0===v.matrixAutoUpdate&&v.updateMatrix(),g.value.copy(v.matrix)}function s(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map,t(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,t(g.alphaMap,v.alphaMapTransform)),g.bumpMap&&(v.bumpMap.value=g.bumpMap,t(g.bumpMap,v.bumpMapTransform),v.bumpScale.value=g.bumpScale,1===g.side&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,t(g.normalMap,v.normalMapTransform),v.normalScale.value.copy(g.normalScale),1===g.side&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,t(g.displacementMap,v.displacementMapTransform),v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap,t(g.emissiveMap,v.emissiveMapTransform)),g.specularMap&&(v.specularMap.value=g.specularMap,t(g.specularMap,v.specularMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest);const S=e.get(g),M=S.envMap,w=S.envMapRotation;M&&(v.envMap.value=M,Ns.copy(w),Ns.x*=-1,Ns.y*=-1,Ns.z*=-1,M.isCubeTexture&&!1===M.isRenderTargetTexture&&(Ns.y*=-1,Ns.z*=-1),v.envMapRotation.value.setFromMatrix4(L_.makeRotationFromEuler(Ns)),v.flipEnvMap.value=M.isCubeTexture&&!1===M.isRenderTargetTexture?-1:1,v.reflectivity.value=g.reflectivity,v.ior.value=g.ior,v.refractionRatio.value=g.refractionRatio),g.lightMap&&(v.lightMap.value=g.lightMap,v.lightMapIntensity.value=g.lightMapIntensity,t(g.lightMap,v.lightMapTransform)),g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,v.aoMapTransform))}return{refreshFogUniforms:function n(v,g){g.color.getRGB(v.fogColor.value,_u(r)),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)},refreshMaterialUniforms:function i(v,g,S,M,w){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(v,g):g.isMeshToonMaterial?(s(v,g),function f(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap)}(v,g)):g.isMeshPhongMaterial?(s(v,g),function u(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4)}(v,g)):g.isMeshStandardMaterial?(s(v,g),function p(v,g){v.metalness.value=g.metalness,g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,v.metalnessMapTransform)),v.roughness.value=g.roughness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,v.roughnessMapTransform)),g.envMap&&(v.envMapIntensity.value=g.envMapIntensity)}(v,g),g.isMeshPhysicalMaterial&&function m(v,g,S){v.ior.value=g.ior,g.sheen>0&&(v.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),v.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(v.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,v.sheenColorMapTransform)),g.sheenRoughnessMap&&(v.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,v.sheenRoughnessMapTransform))),g.clearcoat>0&&(v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,v.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(v.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),1===g.side&&v.clearcoatNormalScale.value.negate())),g.dispersion>0&&(v.dispersion.value=g.dispersion),g.iridescence>0&&(v.iridescence.value=g.iridescence,v.iridescenceIOR.value=g.iridescenceIOR,v.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(v.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,v.iridescenceMapTransform)),g.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),g.transmission>0&&(v.transmission.value=g.transmission,v.transmissionSamplerMap.value=S.texture,v.transmissionSamplerSize.value.set(S.width,S.height),g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,v.transmissionMapTransform)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(v.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(v.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=g.specularIntensity,v.specularColor.value.copy(g.specularColor),g.specularColorMap&&(v.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,v.specularColorMapTransform)),g.specularIntensityMap&&(v.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,v.specularIntensityMapTransform))}
1(v,g,w)):g.isMeshMatcapMaterial?(s(v,g),function _(v,g){g.matcap&&(v.matcap.value=g.matcap)}(v,g)):g.isMeshDepthMaterial?s(v,g):g.isMeshDistanceMaterial?(s(v,g),function x(v,g){const S=e.get(g).light;v.referencePosition.value.setFromMatrixPosition(S.matrixWorld),v.nearDistance.value=S.shadow.camera.near,v.farDistance.value=S.shadow.camera.far}(v,g)):g.isMeshNormalMaterial?s(v,g):g.isLineBasicMaterial?(function a(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,g.map&&(v.map.value=g.map,t(g.map,v.mapTransform))}(v,g),g.isLineDashedMaterial&&function l(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}(v,g)):g.isPointsMaterial?function c(v,g,S,M){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*S,v.scale.value=.5*M,g.map&&(v.map.value=g.map,t(g.map,v.uvTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,t(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}(v,g,S,M):g.isSpriteMaterial?function h(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map,t(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,t(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}}}function D_(r,e,t,n){let i={},s={},a=[];const l=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function m(S,M,w,O){const R=S.value,I=M+"_"+w;if(void 0===O[I])return O[I]="number"==typeof R||"boolean"==typeof R?R:R.clone(),!0;{const N=O[I];if("number"==typeof R||"boolean"==typeof R){if(N!==R)return O[I]=R,!0}else if(!1===N.equals(R))return N.copy(R),!0}return!1}function x(S){const M={boundary:0,storage:0};return"number"==typeof S||"boolean"==typeof S?(M.boundary=4,M.storage=4):S.isVector2?(M.boundary=8,M.storage=8):S.isVector3||S.isColor?(M.boundary=16,M.storage=12):S.isVector4?(M.boundary=16,M.storage=16):S.isMatrix3?(M.boundary=48,M.storage=48):S.isMatrix4?(M.boundary=64,M.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),M}function v(S){const M=S.target;M.removeEventListener("dispose",v);const w=a.indexOf(M.__bindingPointIndex);a.splice(w,1),r.deleteBuffer(i[M.id]),delete i[M.id],delete s[M.id]}return{bind:function c(S,M){n.uniformBlockBinding(S,M.program)},update:function h(S,M){let w=i[S.id];void 0===w&&(function _(S){const M=S.uniforms;let w=0;for(let I=0,N=M.length;I<N;I++){const Z=Array.isArray(M[I])?M[I]:[M[I]];for(let b=0,T=Z.length;b<T;b++){const q=Z[b],Y=Array.isArray(q.value)?q.value:[q.value];for(let $=0,re=Y.length;$<re;$++){const oe=x(Y[$]),J=w%16,xe=J%oe.boundary,be=J+xe;w+=xe,0!==be&&16-be<oe.storage&&(w+=16-be),q.__data=new Float32Array(oe.storage/Float32Array.BYTES_PER_ELEMENT),q.__offset=w,w+=oe.storage}}}const R=w%16;R>0&&(w+=16-R),S.__size=w,S.__cache={}}(S),w=function u(S){const M=function f(){for(let S=0;S<l;S++)if(-1===a.indexOf(S))return a.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();S.__bindingPointIndex=M;const w=r.createBuffer(),O=S.__size,R=S.usage;return r.bindBuffer(r.UNIFORM_BUFFER,w),r.bufferData(r.UNIFORM_BUFFER,O,R),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,M,w),w}(S),i[S.id]=w,S.addEventListener("dispose",v)),n.updateUBOMapping(S,M.program);const R=e.render.frame;s[S.id]!==R&&(function p(S){const w=S.uniforms,O=S.__cache;r.bindBuffer(r.UNIFORM_BUFFER,i[S.id]);for(let R=0,I=w.length;R<I;R++){const N=Array.isArray(w[R])?w[R]:[w[R]];for(let Z=0,b=N.length;Z<b;Z++){const T=N[Z];if(!0===m(T,R,Z,O)){const q=T.__offset,Y=Array.isArray(T.value)?T.value:[T.value];let $=0;for(let re=0;re<Y.length;re++){const X=Y[re],oe=x(X);"number"==typeof X||"boolean"==typeof X?(T.__data[0]=X,r.bufferSubData(r.UNIFORM_BUFFER,q+$,T.__data)):X.isMatrix3?(T.__data[0]=X.elements[0],T.__data[1]=X.elements[1],T.__data[2]=X.elements[2],T.__data[3]=0,T.__data[4]=X.elements[3],T.__data[5]=X.elements[4],T.__data[6]=X.elements[5],T.__data[7]=0,T.__data[8]=X.elements[6],T.__data[9]=X.elements[7],T.__data[10]=X.elements[8],T.__data[11]=0):(X.toArray(T.__data,$),$+=oe.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,q,T.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}(S),s[S.id]=R)},dispose:function g(){for(const S in i)r.deleteBuffer(i[S]);a=[],i={},s={}}}}
vendor: 4,223 bytes, line 1
1class N_{constructor(e={}){const{canvas:t=se(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:l=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:h=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1}=e;let p;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=a;const m=new Uint32Array(4),_=new Int32Array(4);let x=null,v=null;const g=[],S=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=un,this.toneMapping=0,this.toneMappingExposure=1;const M=this;let w=!1,O=0,R=0,I=null,N=-1,Z=null;const b=new lt,T=new lt;let q=null;const Y=new Me(0);let $=0,re=t.width,X=t.height,oe=1,J=null,xe=null;const be=new lt(0,0,re,X),Se=new lt(0,0,re,X);let et=!1;const ct=new Ha;let j=!1,ce=!1;const Re=new ze,ve=new ze,Ve=new L,ke=new lt,qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Qe=!1;function te(){return null===I?oe:1}let ue,ae,fe,Ne,we,P,E,V,Q,ne,ee,De,me,Ae,st,le,Ce,Xe,Ye,Ie,rt,$e,mt,F,U=n;function de(A,B){return t.getContext(A,B)}try{const A={alpha:!0,depth:i,stencil:s,antialias:l,premultipliedAlpha:c,preserveDrawingBuffer:h,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r169"),t.addEventListener("webglcontextlost",ie,!1),t.addEventListener("webglcontextrestored",ye,!1),t.addEventListener("webglcontextcreationerror",Te,!1),null===U){const B="webgl2";if(U=de(B,A),null===U)throw de(B)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(A){throw console.error("THREE.WebGLRenderer: "+A.message),A}function Ee(){ue=new zg(U),ue.init(),$e=new E_(U,ue),ae=new Ug(U,ue,e,$e),fe=new x_(U),ae.reverseDepthBuffer&&fe.buffers.depth.setReversed(!0),Ne=new Vg(U),we=new a_,P=new w_(U,ue,fe,we,ae,$e,Ne),E=new Ng(M),V=new Bg(M),Q=new Rp(U),mt=new Pg(U,Q),ne=new kg(U,Q,Ne,mt),ee=new Wg(U,ne,Q,Ne),Ye=new Gg(U,ae,P),le=new Dg(we),De=new r_(M,E,V,ue,ae,mt,le),me=new U_(M,we),Ae=new l_,st=new p_(ue),Xe=new Ig(M,E,V,fe,ee,p,c),Ce=new v_(M,ee,ae),F=new D_(U,Ne,ae,fe),Ie=new Lg(U,ue,Ne),rt=new Hg(U,ue,Ne),Ne.programs=De.programs,M.capabilities=ae,M.extensions=ue,M.properties=we,M.renderLists=Ae,M.shadowMap=Ce,M.state=fe,M.info=Ne}Ee();const K=new P_(M,U);function ie(A){A.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function ye(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const A=Ne.autoReset,B=Ce.enabled,G=Ce.autoUpdate,W=Ce.needsUpdate,k=Ce.type;Ee(),Ne.autoReset=A,Ce.enabled=B,Ce.autoUpdate=G,Ce.needsUpdate=W,Ce.type=k}function Te(A){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",A.statusMessage)}function ot(A){const B=A.target;B.removeEventListener("dispose",ot),function Dt(A){(function mn(A){const B=we.get(A).programs;void 0!==B&&(B.forEach(function(G){De.releaseProgram(G)}),A.isShaderMaterial&&De.releaseShaderCache(A))})(A),we.remove(A)}(B)}function ht(A,B,G){!0===A.transparent&&2===A.side&&!1===A.forceSinglePass?(A.side=1,A.needsUpdate=!0,Kl(A,B,G),A.side=0,A.needsUpdate=!0,Kl(A,B,G),A.side=2):Kl(A,B,G)}this.xr=K,this.getContext=function(){return U},this.getContextAttributes=function(){return U.getContextAttributes()},this.forceContextLoss=function(){const A=ue.get("WEBGL_lose_context");A&&A.loseContext()},this.forceContextRestore=function(){const A=ue.get("WEBGL_lose_context");A&&A.restoreContext()},this.getPixelRatio=function(){return oe},this.setPixelRatio=function(A){void 0!==A&&(oe=A,this.setSize(re,X,!1))},this.getSize=function(A){return A.set(re,X)},this.setSize=function(A,B,G=!0){K.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(re=A,X=B,t.width=Math.floor(A*oe),t.height=Math.floor(B*oe),!0===G&&(t.style.width=A+"px",t.style.height=B+"px"),this.setViewport(0,0,A,B))}
1,this.getDrawingBufferSize=function(A){return A.set(re*oe,X*oe).floor()},this.setDrawingBufferSize=function(A,B,G){re=A,X=B,oe=G,t.width=Math.floor(A*G),t.height=Math.floor(B*G),this.setViewport(0,0,A,B)},this.getCurrentViewport=function(A){return A.copy(b)},this.getViewport=function(A){return A.copy(be)},this.setViewport=function(A,B,G,W){A.isVector4?be.set(A.x,A.y,A.z,A.w):be.set(A,B,G,W),fe.viewport(b.copy(be).multiplyScalar(oe).round())},this.getScissor=function(A){return A.copy(Se)},this.setScissor=function(A,B,G,W){A.isVector4?Se.set(A.x,A.y,A.z,A.w):Se.set(A,B,G,W),fe.scissor(T.copy(Se).multiplyScalar(oe).round())},this.getScissorTest=function(){return et},this.setScissorTest=function(A){fe.setScissorTest(et=A)},this.setOpaqueSort=function(A){J=A},this.setTransparentSort=function(A){xe=A},this.getClearColor=function(A){return A.copy(Xe.getClearColor())},this.setClearColor=function(){Xe.setClearColor.apply(Xe,arguments)},this.getClearAlpha=function(){return Xe.getClearAlpha()},this.setClearAlpha=function(){Xe.setClearAlpha.apply(Xe,arguments)},this.clear=function(A=!0,B=!0,G=!0){let W=0;if(A){let k=!1;if(null!==I){const he=I.texture.format;k=1033===he||1031===he||1029===he}if(k){const he=I.texture.type,_e=he===In||he===Vn||he===Vi||he===Gn||1017===he||1018===he,Ue=Xe.getClearColor(),Pe=Xe.getClearAlpha(),Ge=Ue.r,We=Ue.g,Oe=Ue.b;_e?(m[0]=Ge,m[1]=We,m[2]=Oe,m[3]=Pe,U.clearBufferuiv(U.COLOR,0,m)):(_[0]=Ge,_[1]=We,_[2]=Oe,_[3]=Pe,U.clearBufferiv(U.COLOR,0,_))}else W|=U.COLOR_BUFFER_BIT}B&&(W|=U.DEPTH_BUFFER_BIT,U.clearDepth(this.capabilities.reverseDepthBuffer?0:1)),G&&(W|=U.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),U.clear(W)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",ie,!1),t.removeEventListener("webglcontextrestored",ye,!1),t.removeEventListener("webglcontextcreationerror",Te,!1),Ae.dispose(),st.dispose(),we.dispose(),E.dispose(),V.dispose(),ee.dispose(),mt.dispose(),F.dispose(),De.dispose(),K.dispose(),K.removeEventListener("sessionstart",mf),K.removeEventListener("sessionend",gf),Xs.stop()},this.renderBufferDirect=function(A,B,G,W,k,he){null===B&&(B=qe);const _e=k.isMesh&&k.matrixWorld.determinant()<0,Ue=function Lx(A,B,G,W,k){!0!==B.isScene&&(B=qe),P.resetTextureUnits();const he=B.fog,Ue=null===I?M.outputColorSpace:!0===I.isXRRenderTarget?I.texture.colorSpace:Dn,Pe=(W.isMeshStandardMaterial?V:E).get(W.envMap||(W.isMeshStandardMaterial?B.environment:null)),Ge=!0===W.vertexColors&&!!G.attributes.color&&4===G.attributes.color.itemSize,We=!!G.attributes.tangent&&(!!W.normalMap||W.anisotropy>0),Oe=!!G.morphAttributes.position,ut=!!G.morphAttributes.normal,Mt=!!G.morphAttributes.color;let _t=0;W.toneMapped&&(null===I||!0===I.isXRRenderTarget)&&(_t=M.toneMapping);const Tn=G.morphAttributes.position||G.morphAttributes.normal||G.morphAttributes.color,dt=void 0!==Tn?Tn.length:0,Fe=we.get(W),Zt=v.state.lights;!0!==j||!0!==ce&&A===Z||le.setState(W,A,A===Z&&W.id===N);let ft=!1;W.version===Fe.__version?(Fe.needsLights&&Fe.lightsStateVersion!==Zt.state.version||Fe.outputColorSpace!==Ue||k.isBatchedMesh&&!1===Fe.batching||!k.isBatchedMesh&&!0===Fe.batching||k.isBatchedMesh&&!0===Fe.batchingColor&&null===k.colorTexture||k.isBatchedMesh&&!1===Fe.batchingColor&&null!==k.colorTexture||k.isInstancedMesh&&!1===Fe.instancing||!k.isInstancedMesh&&!0===Fe.instancing||k.isSkinnedMesh&&
1!1===Fe.skinning||!k.isSkinnedMesh&&!0===Fe.skinning||k.isInstancedMesh&&!0===Fe.instancingColor&&null===k.instanceColor||k.isInstancedMesh&&!1===Fe.instancingColor&&null!==k.instanceColor||k.isInstancedMesh&&!0===Fe.instancingMorph&&null===k.morphTexture||k.isInstancedMesh&&!1===Fe.instancingMorph&&null!==k.morphTexture||Fe.envMap!==Pe||!0===W.fog&&Fe.fog!==he||void 0!==Fe.numClippingPlanes&&(Fe.numClippingPlanes!==le.numPlanes||Fe.numIntersection!==le.numIntersection)||Fe.vertexAlphas!==Ge||Fe.vertexTangents!==We||Fe.morphTargets!==Oe||Fe.morphNormals!==ut||Fe.morphColors!==Mt||Fe.toneMapping!==_t||Fe.morphTargetsCount!==dt)&&(ft=!0):(ft=!0,Fe.__version=W.version);let $n=Fe.currentProgram;!0===ft&&($n=Kl(W,B,k));let ha=!1,An=!1,Gh=!1;const Rt=$n.getUniforms(),rs=Fe.uniforms;if(fe.useProgram($n.program)&&(ha=!0,An=!0,Gh=!0),W.id!==N&&(N=W.id,An=!0),ha||Z!==A){ae.reverseDepthBuffer?(Re.copy(A.projectionMatrix),function Et(r){const e=r.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}(Re),function Vt(r){const e=r.elements;-1===e[11]?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=1-e[14])}(Re),Rt.setValue(U,"projectionMatrix",Re)):Rt.setValue(U,"projectionMatrix",A.projectionMatrix),Rt.setValue(U,"viewMatrix",A.matrixWorldInverse);const Fn=Rt.map.cameraPosition;void 0!==Fn&&Fn.setValue(U,Ve.setFromMatrixPosition(A.matrixWorld)),ae.logarithmicDepthBuffer&&Rt.setValue(U,"logDepthBufFC",2/(Math.log(A.far+1)/Math.LN2)),(W.isMeshPhongMaterial||W.isMeshToonMaterial||W.isMeshLambertMaterial||W.isMeshBasicMaterial||W.isMeshStandardMaterial||W.isShaderMaterial)&&Rt.setValue(U,"isOrthographic",!0===A.isOrthographicCamera),Z!==A&&(Z=A,An=!0,Gh=!0)}if(k.isSkinnedMesh){Rt.setOptional(U,k,"bindMatrix"),Rt.setOptional(U,k,"bindMatrixInverse");const Fn=k.skeleton;Fn&&(null===Fn.boneTexture&&Fn.computeBoneTexture(),Rt.setValue(U,"boneTexture",Fn.boneTexture,P))}k.isBatchedMesh&&(Rt.setOptional(U,k,"batchingTexture"),Rt.setValue(U,"batchingTexture",k._matricesTexture,P),Rt.setOptional(U,k,"batchingIdTexture"),Rt.setValue(U,"batchingIdTexture",k._indirectTexture,P),Rt.setOptional(U,k,"batchingColorTexture"),null!==k._colorsTexture&&Rt.setValue(U,"batchingColorTexture",k._colorsTexture,P));const Wh=G.morphAttributes;if((void 0!==Wh.position||void 0!==Wh.normal||void 0!==Wh.color)&&Ye.update(k,G,$n),(An||Fe.receiveShadow!==k.receiveShadow)&&(Fe.receiveShadow=k.receiveShadow,Rt.setValue(U,"receiveShadow",k.receiveShadow)),W.isMeshGouraudMaterial&&null!==W.envMap&&(rs.envMap.value=Pe,rs.flipEnvMap.value=Pe.isCubeTexture&&!1===Pe.isRenderTargetTexture?-1:1),W.isMeshStandardMaterial&&null===W.envMap&&null!==B.environment&&(rs.envMapIntensity.value=B.environmentIntensity),An&&(Rt.setValue(U,"toneMappingExposure",M.toneMappingExposure),Fe.needsLights&&function Ux(A,B){A.ambientLightColor.needsUpdate=B,A.lightProbe.needsUpdate=B,A.directionalLights.needsUpdate=B,A.directionalLightShadows.needsUpdate=B,A.pointLights.needsUpdate=B,A.pointLightShadows.needsUpdate=B,A.spotLights.needsUpdate=B,A.spotLightShadows.needsUpdate=B,A.rectAreaLights.needsUpdate=B,A.hemisphereLights.needsUpdate=B}(rs,Gh),he&&!0===W.fog&&me.refreshFogUniforms(rs,he),me.refreshMaterialUniforms(rs,W,oe,X,v.state.transmissionRenderTarget[A.id]),ll.upload(U,yf(Fe),rs,P)),W.isShaderMaterial&&!0===W.uniformsNeedUpdate&&(ll.upload(U,yf(Fe),rs,P),W.uniformsNeedUpdate=!1),W.isSpriteMaterial&&Rt.setValue(U,"center",k.center),Rt.setValue(U,"modelViewMatrix",k.modelViewMatrix),Rt.setValue(U,"normalMatrix",k.normalMatrix),Rt.setValue(U,"modelMatrix",k.matrixWorld),W.isShaderMaterial||W.isRawShaderMaterial){const Fn=W.uniformsGroups;for(let Xh=0,Nx=Fn.length;Xh<Nx;Xh++){const bf=Fn[Xh];F.update(bf,$n),F.bind(bf,$n)}}return $n}(A,B,G,W,k);fe.setMaterial(W,_e);let Pe=G.index,Ge=1;if(!0===W.wireframe){if(Pe=ne.getWireframeAttribute(G),void 0===Pe)return;Ge=2}const We=G.drawRange,Oe=G.attributes.position;let ut=We.start*Ge,Mt=(We.start+We.count)*Ge;null!==he&&(ut=Math.max(ut,he.start*Ge),Mt=Math.min(Mt,(he.start+he.count)*Ge)),null!==Pe?(ut=Math.max(ut,0),Mt=Math.min(Mt,Pe.count)):null!=Oe&&(ut
vendor: 10,597 bytes, line 1
1=Math.max(ut,0),Mt=Math.min(Mt,Oe.count));const _t=Mt-ut;if(_t<0||_t===1/0)return;mt.setup(k,W,Ue,G,Pe);let Tn,dt=Ie;if(null!==Pe&&(Tn=Q.get(Pe),dt=rt,dt.setIndex(Tn)),k.isMesh)!0===W.wireframe?(fe.setLineWidth(W.wireframeLinewidth*te()),dt.setMode(U.LINES)):dt.setMode(U.TRIANGLES);else if(k.isLine){let Fe=W.linewidth;void 0===Fe&&(Fe=1),fe.setLineWidth(Fe*te()),dt.setMode(k.isLineSegments?U.LINES:k.isLineLoop?U.LINE_LOOP:U.LINE_STRIP)}else k.isPoints?dt.setMode(U.POINTS):k.isSprite&&dt.setMode(U.TRIANGLES);if(k.isBatchedMesh)if(null!==k._multiDrawInstances)dt.renderMultiDrawInstances(k._multiDrawStarts,k._multiDrawCounts,k._multiDrawCount,k._multiDrawInstances);else if(ue.get("WEBGL_multi_draw"))dt.renderMultiDraw(k._multiDrawStarts,k._multiDrawCounts,k._multiDrawCount);else{const Fe=k._multiDrawStarts,Zt=k._multiDrawCounts,ft=k._multiDrawCount,$n=Pe?Q.get(Pe).bytesPerElement:1,ha=we.get(W).currentProgram.getUniforms();for(let An=0;An<ft;An++)ha.setValue(U,"_gl_DrawID",An),dt.render(Fe[An]/$n,Zt[An])}else if(k.isInstancedMesh)dt.renderInstances(ut,_t,k.count);else if(G.isInstancedBufferGeometry){const Zt=Math.min(G.instanceCount,void 0!==G._maxInstanceCount?G._maxInstanceCount:1/0);dt.renderInstances(ut,_t,Zt)}else dt.render(ut,_t)},this.compile=function(A,B,G=null){null===G&&(G=A),v=st.get(G),v.init(B),S.push(v),G.traverseVisible(function(k){k.isLight&&k.layers.test(B.layers)&&(v.pushLight(k),k.castShadow&&v.pushShadow(k))}),A!==G&&A.traverseVisible(function(k){k.isLight&&k.layers.test(B.layers)&&(v.pushLight(k),k.castShadow&&v.pushShadow(k))}),v.setupLights();const W=new Set;return A.traverse(function(k){if(!(k.isMesh||k.isPoints||k.isLine||k.isSprite))return;const he=k.material;if(he)if(Array.isArray(he))for(let _e=0;_e<he.length;_e++){const Ue=he[_e];ht(Ue,G,k),W.add(Ue)}else ht(he,G,k),W.add(he)}),S.pop(),v=null,W},this.compileAsync=function(A,B,G=null){const W=this.compile(A,B,G);return new Promise(k=>{function he(){W.forEach(function(_e){we.get(_e).currentProgram.isReady()&&W.delete(_e)}),0!==W.size?setTimeout(he,10):k(A)}null!==ue.get("KHR_parallel_shader_compile")?he():setTimeout(he,10)})};let gn=null;function mf(){Xs.stop()}function gf(){Xs.start()}const Xs=new Mu;function Vh(A,B,G,W){if(!1===A.visible)return;if(A.layers.test(B.layers))if(A.isGroup)G=A.renderOrder;else if(A.isLOD)!0===A.autoUpdate&&A.update(B);else if(A.isLight)v.pushLight(A),A.castShadow&&v.pushShadow(A);else if(A.isSprite){if(!A.frustumCulled||ct.intersectsSprite(A)){W&&ke.setFromMatrixPosition(A.matrixWorld).applyMatrix4(ve);const _e=ee.update(A),Ue=A.material;Ue.visible&&x.push(A,_e,Ue,G,ke.z,null)}}else if((A.isMesh||A.isLine||A.isPoints)&&(!A.frustumCulled||ct.intersectsObject(A))){const _e=ee.update(A),Ue=A.material;if(W&&(void 0!==A.boundingSphere?(null===A.boundingSphere&&A.computeBoundingSphere(),ke.copy(A.boundingSphere.center)):(null===_e.boundingSphere&&_e.computeBoundingSphere(),ke.copy(_e.boundingSphere.center)),ke.applyMatrix4(A.matrixWorld).applyMatrix4(ve)),Array.isArray(Ue)){const Pe=_e.groups;for(let Ge=0,We=Pe.length;Ge<We;Ge++){const Oe=Pe[Ge],ut=Ue[Oe.materialIndex];ut&&ut.visible&&x.push(A,_e,ut,G,ke.z,Oe)}}else Ue.visible&&x.push(A,_e,Ue,G,ke.z,null)}const he=A.children;for(let _e=0,Ue=he.length;_e<Ue;_e++)Vh(he[_e],B,G,W)}function vf(A,B,G,W){const k=A.opaque,he=A.transmissive,_e=A.transparent;v.setupLightsView(G),!0===j&&le.setGlobalState(M.clippingPlanes,G),W&&fe.viewport(b.copy(W)),k.length>0&&$l(k,B,G),he.length>0&&$l(he,B,G),_e.length>0&&$l(_e,B,G),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function _f(A,B,G,W){if(null!==(!0===G.isScene?G.overrideMaterial:null))return;void 0===v.state.transmissionRenderTarget[W.id]&&(v.state.transmissionRenderTarget[W.id]=new Zi(1,1,{generateMipmaps:!0,type:ue.has("EXT_color_buffer_half_float")||ue.has("EXT_color_buffer_float")?Jn:In,minFilter:At,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:it.workingColorSpace}));const he=v.state.transmissionRenderTarget[W.id],_e=W.viewport||b;he.setSize(_e.z,_e.w);const Ue=M.getRenderTarget();M.setRenderTarget(he),M.getClearColor(Y),$=M.getClearAlpha(),$<1&&M.setClearColor(16777215,.5),M.clear(),Qe&&Xe.render(G);const Pe=M.toneMapping;M.toneMapping=0;const Ge=W.viewport;if(void 0!==W.viewport&&(W.viewport=void 0),v.setupLightsView(W),!0===j&&le.setGlobalState(M.clippingPlanes,W),$l(A,G,W),P.updateMultisampleRenderTarget(he),P.updateRenderTargetMipmap(he),!1===ue.has("WEBGL_multisampled_render_to_texture")){let We=!1;for(let Oe=0,ut=B.length;Oe<ut;Oe++){const Mt=B[Oe],_t=Mt.object,Tn=Mt.geometry,dt=Mt.material,Fe=Mt.group;if(2===dt.side&&_t.layers.test(W.layers)){const Zt=dt.side;dt.side=1,dt.needsUpdate=!0,xf(_t,G,W,Tn,dt,Fe),dt.side=Zt,dt.needsUpdate=!0,We=!0}}!0===We&&(P.updateMultisampleRenderTarget(he),P.updateRenderTargetMipmap(he))}M.setRenderTarget(Ue),M.setClearColor(Y,$),void 0!==Ge&&(W.viewport=Ge),M.toneMapping=Pe}function $l(A,B,G){const W=!0===B.isScene?B.overrideMaterial:null;for(let k=0,he=A.length;k<he;k++){const _e=A[k],Ue=_e.object,Pe=_e.geometry,Ge=null===W?_e.material:W,We=_e.group;Ue.layers.test(G.layers)&&xf(Ue,B,G,Pe,Ge,We)}}function xf(A,B,G,W,k,he){A.onBeforeRender(M,B,G,W,k,he),A.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,A.matrixWorld),A.normalMatrix.getNormalMatrix(A.modelViewMatrix),k.onBeforeRender(M,B,G,W,A,he),!0===k.transparent&&2===k.side&&!1===k.forceSinglePass?(k.side=1,k.needsUpdate=!0,M.renderBufferDirect(G,B,W,k,A,he),k.side=0,k.needsUpdate=!0,M.renderBufferDirect(G,B,W,k,A,he),k.side=2):M.renderBufferDirect(G,B,W,k,A,he),A.onAfterRender(M,B,G,W,k,he)}function Kl(A,B,G){!0!==B.isScene&&(B=qe);const W=we.get(A),k=v.state.lights,_e=k.state.version,Ue=De.getParameters(A,k.state,v.state.shadowsArray,B,G),Pe=De.getProgramCacheKey(Ue);let Ge=W.programs;W.environment=A.isMeshStandardMaterial?B.environment:null,W.fog=B.fog,W.envMap=(A.isMeshStandardMaterial?V:E).get(A.envMap||W.environment),W.envMapRotation=null!==W.environment&&null===A.envMap?B.environmentRotation:A.envMapRotation,void 0===Ge&&(A.addEventListener("dispose",ot),Ge=new Map,W.programs=Ge);let We=Ge.get(Pe);if(void 0!==We){if(W.currentProgram===We&&W.lightsStateVersion===_e)return Mf(A,Ue),We}else Ue.uniforms=De.getUniforms(A),A.onBeforeCompile(Ue,M),We=De.acquireProgram(Ue,Pe),Ge.set(Pe,We),W.uniforms=Ue.uniforms;const Oe=W.uniforms;return(!A.isShaderMaterial&&!A.isRawShaderMaterial||!0===A.clipping)&&(Oe.clippingPlanes=le.uniform),Mf(A,Ue),W.needsLights=function Dx(A){return A.isMeshLambertMaterial||A.isMeshToonMaterial||A.isMeshPhongMaterial||A.isMeshStandardMaterial||A.isShadowMaterial||A.isShaderMaterial&&!0===A.lights}(A),W.lightsStateVersion=_e,W.needsLights&&(Oe.ambientLightColor.value=k.state.ambient,Oe.lightProbe.value=k.state.probe,Oe.directionalLights.value=k.state.directional,Oe.directionalLightShadows.value=k.state.directionalShadow,Oe.spotLights.value=k.state.spot,Oe.spotLightShadows.value=k.state.spotShadow,Oe.rectAreaLights.value=k.state.rectArea,Oe.ltc_1.value=k.state.rectAreaLTC1,Oe.ltc_2.value=k.state.rectAreaLTC2,Oe.pointLights.value=k.state.point,Oe.pointLightShadows.value=k.state.pointShadow,Oe.hemisphereLights.value=k.state.hemi,Oe.directionalShadowMap.value=k.state.directionalShadowMap,Oe.directionalShadowMatrix.value=k.state.directionalShadowMatrix,Oe.spotShadowMap.value=k.state.spotShadowMap,Oe.spotLightMatrix.value=k.state.spotLightMatrix,Oe.spotLightMap.value=k.state.spotLightMap,Oe.pointShadowMap.value=k.state.pointShadowMap,Oe.pointShadowMatrix.value=k.state.pointShadowMatrix),W.currentProgram=We,W.uniformsList=null,We}function yf(A){if(null===A.uniformsList){const B=A.currentProgram.getUniforms();A.uniformsList=ll.seqWithValue(B.seq,A.uniforms)}return A.uniformsList}function Mf(A,B){const G=we.get(A);G.outputColorSpace=B.outputColorSpace,G.batching=B.batching,G.batchingColor=B.batchingColor,G.instancing=B.instancing,G.instancingColor=B.instancingColor,G.instancingMorph=B.instancingMorph,G.skinning=B.skinning,G.morphTargets=B.morphTargets,G.morphNormals=B.morphNormals,G.morphColors=B.morphColors,G.morphTargetsCount=B.morphTargetsCount,G.numClippingPlanes=B.numClippingPlanes,G.numIntersection=B.numClipIntersection,G.vertexAlphas=B.vertexAlphas,G.vertexTangents=B.vertexTangents,G.toneMapping=B.toneMapping}Xs.setAnimationLoop(function zi(A){gn&&gn(A)}),"undefined"!=typeof self&&Xs.setContext(self),this.setAnimationLoop=function(A){gn=A,K.setAnimationLoop(A),null===A?Xs.stop():Xs.start()},K.addEventListener("sessionstart",mf),K.addEventListener("sessionend",gf),this.render=function(A,B){if(void 0!==B&&!0!==B.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===w)return;if(!0===A.matrixWorldAutoUpdate&&A.updateMatrixWorld(),null===B.parent&&!0===B.matrixWorldAutoUpdate&&B.updateMatrixWorld(),!0===K.enabled&&!0===K.isPresenting&&(!0===K.cameraAutoUpdate&&K.updateCamera(B),B=K.getCamera()),!0===A.isScene&&A.onBeforeRender(M,A,B,I),v=st.get(A,S.length),v.init(B),S.push(v),ve.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),ct.setFromProjectionMatrix(ve),ce=this.localClippingEnabled,j=le.init(this.clippingPlanes,ce),x=Ae.get(A,g.length),x.init(),g.push(x),!0===K.enabled&&!0===K.isPresenting){const he=M.xr.getDepthSensingMesh();null!==he&&Vh(he,B,-1/0,M.sortObjects)}Vh(A,B,0,M.sortObjects),x.finish(),!0===M.sortObjects&&x.sort(J,xe),Qe=!1===K.enabled||!1===K.isPresenting||!1===K.hasDepthSensing(),Qe&&Xe.addToRenderList(x,A),this.info.render.frame++,!0===j&&le.beginShadows(),Ce.render(v.state.shadowsArray,A,B),!0===j&&le.endShadows(),!0===this.info.autoReset&&this.info.reset();const W=x.opaque,k=x.transmissive;if(v.setupLights(),B.isArrayCamera){const he=B.cameras;if(k.length>0)for(let _e=0,Ue=he.length;_e<Ue;_e++)_f(W,k,A,he[_e]);Qe&&Xe.render(A);for(let _e=0,Ue=he.length;_e<Ue;_e++){const Pe=he[_e];vf(x,A,Pe,Pe.viewport)}}else k.length>0&&_f(W,k,A,B),Qe&&Xe.render(A),vf(x,A,B);null!==I&&(P.updateMultisampleRenderTarget(I),P.updateRenderTargetMipmap(I)),!0===A.isScene&&A.onAfterRender(M,A,B),mt.resetDefaultState(),N=-1,Z=null,S.pop(),S.length>0?(v=S[S.length-1],!0===j&&le.setGlobalState(M.clippingPlanes,v.state.camera)):v=null,g.pop(),x=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return O},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return I},this.setRenderTargetTextures=function(A,B,G){we.get(A.texture).__webglTexture=B,we.get(A.depthTexture).__webglTexture=G;
1const W=we.get(A);W.__hasExternalTextures=!0,W.__autoAllocateDepthBuffer=void 0===G,W.__autoAllocateDepthBuffer||!0===ue.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),W.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(A,B){const G=we.get(A);G.__webglFramebuffer=B,G.__useDefaultFramebuffer=void 0===B},this.setRenderTarget=function(A,B=0,G=0){I=A,O=B,R=G;let W=!0,k=null,he=!1,_e=!1;if(A){const Pe=we.get(A);if(void 0!==Pe.__useDefaultFramebuffer)fe.bindFramebuffer(U.FRAMEBUFFER,null),W=!1;else if(void 0===Pe.__webglFramebuffer)P.setupRenderTarget(A);else if(Pe.__hasExternalTextures)P.rebindTextures(A,we.get(A.texture).__webglTexture,we.get(A.depthTexture).__webglTexture);else if(A.depthBuffer){const Oe=A.depthTexture;if(Pe.__boundDepthTexture!==Oe){if(null!==Oe&&we.has(Oe)&&(A.width!==Oe.image.width||A.height!==Oe.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");P.setupDepthRenderbuffer(A)}}const Ge=A.texture;(Ge.isData3DTexture||Ge.isDataArrayTexture||Ge.isCompressedArrayTexture)&&(_e=!0);const We=we.get(A).__webglFramebuffer;A.isWebGLCubeRenderTarget?(k=Array.isArray(We[B])?We[B][G]:We[B],he=!0):k=A.samples>0&&!1===P.useMultisampledRTT(A)?we.get(A).__webglMultisampledFramebuffer:Array.isArray(We)?We[G]:We,b.copy(A.viewport),T.copy(A.scissor),q=A.scissorTest}else b.copy(be).multiplyScalar(oe).floor(),T.copy(Se).multiplyScalar(oe).floor(),q=et;if(fe.bindFramebuffer(U.FRAMEBUFFER,k)&&W&&fe.drawBuffers(A,k),fe.viewport(b),fe.scissor(T),fe.setScissorTest(q),he){const Pe=we.get(A.texture);U.framebufferTexture2D(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_CUBE_MAP_POSITIVE_X+B,Pe.__webglTexture,G)}else if(_e){const Pe=we.get(A.texture);U.framebufferTextureLayer(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,Pe.__webglTexture,G||0,B||0)}N=-1},this.readRenderTargetPixels=function(A,B,G,W,k,he,_e){if(!A||!A.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ue=we.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&void 0!==_e&&(Ue=Ue[_e]),Ue){fe.bindFramebuffer(U.FRAMEBUFFER,Ue);try{const Pe=A.texture,Ge=Pe.format,We=Pe.type;if(!ae.textureFormatReadable(Ge))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!ae.textureTypeReadable(We))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");B>=0&&B<=A.width-W&&G>=0&&G<=A.height-k&&U.readPixels(B,G,W,k,$e.convert(Ge),$e.convert(We),he)}finally{const Pe=null!==I?we.get(I).__webglFramebuffer:null;fe.bindFramebuffer(U.FRAMEBUFFER,Pe)}}},this.readRenderTargetPixelsAsync=function(){var A=(0,Ys.Z)(function*(B,G,W,k,he,_e,Ue){if(!B||!B.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Pe=we.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&&void 0!==Ue&&(Pe=Pe[Ue]),Pe){const Ge=B.texture,We=Ge.format,Oe=Ge.type;if(!ae.textureFormatReadable(We))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ae.textureTypeReadable(Oe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(G>=0&&G<=B.width-k&&W>=0&&W<=B.height-he){fe.bindFramebuffer(U.FRAMEBUFFER,Pe);const ut=U.createBuffer();U.bindBuffer(U.PIXEL_PACK_BUFFER,ut),U.bufferData(U.PIXEL_PACK_BUFFER,_e.byteLength,U.STREAM_READ),U.readPixels(G,W,k,he,$e.convert(We),$e.convert(Oe),0);const Mt=null!==I?we.get(I).__webglFramebuffer:null;fe.bindFramebuffer(U.FRAMEBUFFER,Mt);const _t=U.fenceSync(U.SYNC_GPU_COMMANDS_COMPLETE,0);return U.flush(),yield function pt(r,e,t){return new Promise(function(n,i){setTimeout(function s(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}},t)})}(U,_t,4),U.bindBuffer(U.PIXEL_PACK_BUFFER,ut),U.getBufferSubData(U.PIXEL_PACK_BUFFER,0,_e),U.deleteBuffer(ut),U.deleteSync(_t),_e}throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}});return function(B,G,W,k,he,_e,Ue){return A.apply(this,arguments)}}(),this.copyFramebufferToTexture=function(A,B=null,G=0){!0!==A.isTexture&&(Je("WebGLRenderer: copyFramebufferToTexture function signature has changed."),B=arguments[0]||null,A=arguments[1]);const W=Math.pow(2,-G),k=Math.floor(A.image.width*W),he=Math.floor(A.image.height*W),_e=null!==B?B.x:0,Ue=null!==B?B.y:0;P.setTexture2D(A,0),U.copyTexSubImage2D(U.TEXTURE_2D,G,0,0,_e,Ue,k,he),fe.unbindTexture()},this.copyTextureToTexture=function(A,B,G=null,W=null,k=0){let he,_e,Ue,Pe,Ge,We;!0!==A.isTexture&&(Je("WebGLRenderer: copyTextureToTexture function signature has changed."),W=arguments[0]||null,A=arguments[1],B=arguments[2],k=arguments[3]||0,G=null),null!==G?(he=G.max.x-G.min.x,_e=G.max.y-G.min.y,Ue=G.min.x,Pe=G.min.y):(he=A.image.width,_e=A.image.height,Ue=0,Pe=0),null!==W?(Ge=W.x,We=W.y
vendor: 5,496 bytes, line 1
1):(Ge=0,We=0);const Oe=$e.convert(B.format),ut=$e.convert(B.type);P.setTexture2D(B,0),U.pixelStorei(U.UNPACK_FLIP_Y_WEBGL,B.flipY),U.pixelStorei(U.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),U.pixelStorei(U.UNPACK_ALIGNMENT,B.unpackAlignment);const Mt=U.getParameter(U.UNPACK_ROW_LENGTH),_t=U.getParameter(U.UNPACK_IMAGE_HEIGHT),Tn=U.getParameter(U.UNPACK_SKIP_PIXELS),dt=U.getParameter(U.UNPACK_SKIP_ROWS),Fe=U.getParameter(U.UNPACK_SKIP_IMAGES),Zt=A.isCompressedTexture?A.mipmaps[k]:A.image;U.pixelStorei(U.UNPACK_ROW_LENGTH,Zt.width),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,Zt.height),U.pixelStorei(U.UNPACK_SKIP_PIXELS,Ue),U.pixelStorei(U.UNPACK_SKIP_ROWS,Pe),A.isDataTexture?U.texSubImage2D(U.TEXTURE_2D,k,Ge,We,he,_e,Oe,ut,Zt.data):A.isCompressedTexture?U.compressedTexSubImage2D(U.TEXTURE_2D,k,Ge,We,Zt.width,Zt.height,Oe,Zt.data):U.texSubImage2D(U.TEXTURE_2D,k,Ge,We,he,_e,Oe,ut,Zt),U.pixelStorei(U.UNPACK_ROW_LENGTH,Mt),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,_t),U.pixelStorei(U.UNPACK_SKIP_PIXELS,Tn),U.pixelStorei(U.UNPACK_SKIP_ROWS,dt),U.pixelStorei(U.UNPACK_SKIP_IMAGES,Fe),0===k&&B.generateMipmaps&&U.generateMipmap(U.TEXTURE_2D),fe.unbindTexture()},this.copyTextureToTexture3D=function(A,B,G=null,W=null,k=0){let he,_e,Ue,Pe,Ge,We,Oe,ut,Mt;!0!==A.isTexture&&(Je("WebGLRenderer: copyTextureToTexture3D function signature has changed."),G=arguments[0]||null,W=arguments[1]||null,A=arguments[2],B=arguments[3],k=arguments[4]||0);const _t=A.isCompressedTexture?A.mipmaps[k]:A.image;null!==G?(he=G.max.x-G.min.x,_e=G.max.y-G.min.y,Ue=G.max.z-G.min.z,Pe=G.min.x,Ge=G.min.y,We=G.min.z):(he=_t.width,_e=_t.height,Ue=_t.depth,Pe=0,Ge=0,We=0),null!==W?(Oe=W.x,ut=W.y,Mt=W.z):(Oe=0,ut=0,Mt=0);const Tn=$e.convert(B.format),dt=$e.convert(B.type);let Fe;if(B.isData3DTexture)P.setTexture3D(B,0),Fe=U.TEXTURE_3D;else{if(!B.isDataArrayTexture&&!B.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");P.setTexture2DArray(B,0),Fe=U.TEXTURE_2D_ARRAY}U.pixelStorei(U.UNPACK_FLIP_Y_WEBGL,B.flipY),U.pixelStorei(U.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),U.pixelStorei(U.UNPACK_ALIGNMENT,B.unpackAlignment);const Zt=U.getParameter(U.UNPACK_ROW_LENGTH),ft=U.getParameter(U.UNPACK_IMAGE_HEIGHT),$n=U.getParameter(U.UNPACK_SKIP_PIXELS),ha=U.getParameter(U.UNPACK_SKIP_ROWS),An=U.getParameter(U.UNPACK_SKIP_IMAGES);U.pixelStorei(U.UNPACK_ROW_LENGTH,_t.width),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,_t.height),U.pixelStorei(U.UNPACK_SKIP_PIXELS,Pe),U.pixelStorei(U.UNPACK_SKIP_ROWS,Ge),U.pixelStorei(U.UNPACK_SKIP_IMAGES,We),A.isDataTexture||A.isData3DTexture?U.texSubImage3D(Fe,k,Oe,ut,Mt,he,_e,Ue,Tn,dt,_t.data):B.isCompressedArrayTexture?U.compressedTexSubImage3D(Fe,k,Oe,ut,Mt,he,_e,Ue,Tn,_t.data):U.texSubImage3D(Fe,k,Oe,ut,Mt,he,_e,Ue,Tn,dt,_t),U.pixelStorei(U.UNPACK_ROW_LENGTH,Zt),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,ft),U.pixelStorei(U.UNPACK_SKIP_PIXELS,$n),U.pixelStorei(U.UNPACK_SKIP_ROWS,ha),U.pixelStorei(U.UNPACK_SKIP_IMAGES,An),0===k&&B.generateMipmaps&&U.generateMipmap(Fe),fe.unbindTexture()},this.initRenderTarget=function(A){void 0===we.get(A).__webglFramebuffer&&P.setupRenderTarget(A)},this.initTexture=function(A){A.isCubeTexture?P.setTextureCube(A,0):A.isData3DTexture?P.setTexture3D(A,0):A.isDataArrayTexture||A.isCompressedArrayTexture?P.setTexture2DArray(A,0):P.setTexture2D(A,0),fe.unbindTexture()},this.resetState=function(){O=0,R=0,I=null,fe.reset(),mt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Xn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Gi?"display-p3":"srgb",t.unpackColorSpace=it.workingColorSpace===Ms?"display-p3":"srgb"}}class ju extends fn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new oi,this.environmentIntensity=1,this.environmentRotation=new oi,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class so extends je{constructor(e=1,t=32,n=16,i=0,s=2*Math.PI,a=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radiu
vendor: 6,891 bytes, line 1
1s:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:s,thetaStart:a,thetaLength:l},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const c=Math.min(a+l,Math.PI);let h=0;const u=[],f=new L,p=new L,m=[],_=[],x=[],v=[];for(let g=0;g<=n;g++){const S=[],M=g/n;let w=0;0===g&&0===a?w=.5/t:g===n&&c===Math.PI&&(w=-.5/t);for(let O=0;O<=t;O++){const R=O/t;f.x=-e*Math.cos(i+R*s)*Math.sin(a+M*l),f.y=e*Math.cos(a+M*l),f.z=e*Math.sin(i+R*s)*Math.sin(a+M*l),_.push(f.x,f.y,f.z),p.copy(f).normalize(),x.push(p.x,p.y,p.z),v.push(R+w,1-M),S.push(h++)}u.push(S)}for(let g=0;g<n;g++)for(let S=0;S<t;S++){const M=u[g][S+1],w=u[g][S],O=u[g+1][S],R=u[g+1][S+1];(0!==g||a>0)&&m.push(M,w,R),(g!==n-1||c<Math.PI)&&m.push(w,O,R)}this.setIndex(m),this.setAttribute("position",new Le(_,3)),this.setAttribute("normal",new Le(x,3)),this.setAttribute("uv",new Le(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new so(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}function zs(r,e,t){return!r||!t&&r.constructor===e?r:"number"==typeof e.BYTES_PER_ELEMENT?new e(r):Array.prototype.slice.call(r)}class Ol{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],s=t[n-1];e:{t:{let a;n:{i:if(!(e<i)){for(let l=n+2;;){if(void 0===i){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===l)break;if(s=i,i=t[++n],e<i)break t}a=t.length;break n}if(e>=s)break e;{const l=t[1];e<l&&(n=2,s=l);for(let c=n-2;;){if(void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(n===c)break;if(i=s,s=t[--n-1],e>=s)break t}a=n,n=0}}for(;n<a;){const l=n+a>>>1;e<t[l]?a=l:n=l+1}if(i=t[n],s=t[n-1],void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let a=0;a!==i;++a)t[a]=n[s+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Y0 extends Ol{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,a=e+1,l=i[s],c=i[a];if(void 0===l)switch(this.getSettings_().endingStart){case 2401:s=e,l=2*t-n;break;case 2402:s=i.length-2,l=t+i[s]-i[s+1];break;default:s=e,l=n}if(void 0===c)switch(this.getSettings_().endingEnd){case 2401:a=e,c=2*n-t;break;case 2402:a=1,c=n+i[1]-i[0];break;default:a=e-1,c=t}const h=.5*(n-t),u=this.valueSize;this._weightPrev=h/(t-l),this._weightNext=h/(c-n),this._offsetPrev=s*u,this._offsetNext=a*u}interpolate_(e,t,n,i){const s=this.resultBuffer,a=this.sampleValues,l=this.valueSize,c=e*l,h=c-l,u=this._offsetPrev,f=this._offsetNext,p=this._weightPrev,m=this._weightNext,_=(n-t)/(i-t),x=_*_,v=x*_,g=-p*v+2*p*x-p*_,S=(1+p)*v+(-1.5-2*p)*x+(-.5+p)*_+1,M=(-1-m)*v+(1.5+m)*x+.5*_,w=m*v-m*x;for(let O=0;O!==l;++O)s[O]=g*a[u+O]+S*a[h+O]+M*a[c+O]+w*a[f+O];return s}}class kd extends Ol{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,a=this.sampleValues,l=this.valueSize,c=e*l,h=c-l,u=(n-t)/(i-t),f=1-u;for(let p=0;p!==l;++p)s[p]=a[h+p]*f+a[c+p]*u;return s}}class q0 extends Ol{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class hi{constructor(e,t,n,i){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=zs(t,this.TimeBufferType),this.values=zs(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:zs(e.times,Array),values:zs(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new q0(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new kd(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Y0(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,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(e){if(0!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let s=0,a=i-1;for(;s!==i&&n[s]<e;)++s;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==s||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);const l=this.getValueSize();this.times=n.slice(s,a),this.values=this.values.slice(s*l,a*l)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;0===s&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let l=0;l!==s;l++){const c=n[l];if("number"==typeof c&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,c),e=!1;break}if(null!==a&&a>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,c,a),e=!1;break}a=c}if(void 0!==i&&function Bd(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}(i))for(let l=0,c=i.length;l!==c;++l){const h=i[l];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=2302===this.getInterpolation(),s=e.length-1;let a=1;for(let l=1;l<s;++l){let c=!1;const h=e[l];
1if(h!==e[l+1]&&(1!==l||h!==e[0]))if(i)c=!0;else{const f=l*n,p=f-n,m=f+n;for(let _=0;_!==n;++_){const x=t[f+_];if(x!==t[p+_]||x!==t[m+_]){c=!0;break}}}if(c){if(l!==a){e[a]=e[l];const f=l*n,p=a*n;for(let m=0;m!==n;++m)t[p+m]=t[f+m]}++a}}if(s>0){e[a]=e[s];for(let l=s*n,c=a*n,h=0;h!==n;++h)t[c+h]=t[l+h];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=new(0,this.constructor)(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}hi.prototype.TimeBufferType=Float32Array,hi.prototype.ValueBufferType=Float32Array,hi.prototype.DefaultInterpolation=2301;class la extends hi{constructor(e,t,n){super(e,t,n)}}la.prototype.ValueTypeName="bool",la.prototype.ValueBufferType=Array,la.prototype.DefaultInterpolation=2300,la.prototype.InterpolantFactoryMethodLinear=void 0,la.prototype.InterpolantFactoryMethodSmooth=void 0;(class Hd extends hi{}).prototype.ValueTypeName="color";(class Fl extends hi{}).prototype.ValueTypeName="number";class Z0 extends Ol{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,a=this.sampleValues,l=this.valueSize,c=(n-t)/(i-t);let h=e*l;for(let u=h+l;h!==u;h+=4)dn.slerpFlat(s,0,a,h-l,a,h,c);return s}}class Bl extends hi{InterpolantFactoryMethodLinear(e){return new Z0(this.times,this.values,this.getValueSize(),e)}}Bl.prototype.ValueTypeName="quaternion",Bl.prototype.InterpolantFactoryMethodSmooth=void 0;class ca extends hi{constructor(e,t,n){super(e,t,n)}}ca.prototype.ValueTypeName="string",ca.prototype.ValueBufferType=Array,ca.prototype.DefaultInterpolation=2300,ca.prototype.InterpolantFactoryMethodLinear=void 0,ca.prototype.InterpolantFactoryMethodSmooth=void 0;(class zl extends hi{}).prototype.ValueTypeName="vector";const Fi={enabled:!1,files:{},add:function(r,e){!1!==this.enabled&&(this.files[r]=e)},get:function(r){if(!1!==this.enabled)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class Vd{constructor(e,t,n){const i=this;let c,s=!1,a=0,l=0;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(u){l++,!1===s&&void 0!==i.onStart&&i.onStart(u,a,l),s=!0},this.itemEnd=function(u){a++,void 0!==i.onProgress&&i.onProgress(u,a,l),a===l&&(s=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(u){void 0!==i.onError&&i.onError(u)},this.resolveURL=function(u){return c?c(u):u},this.setURLModifier=function(u){return c=u,this},this.addHandler=function(u,f){return h.push(u,f),this},this.removeHandler=function(u){const f=h.indexOf(u);return-1!==f&&h.splice(f,2),this},this.getHandler=function(u){for(let f=0,p=h.length;f<p;f+=2){const m=h[f],_=h[f+1];if(m.global&&(m.lastIndex=0),m.test(u))return _}return null}}}const J0=new Vd;let j0=(()=>{class r{constructor(t){this.manager=void 0!==t?t:J0,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,n){const i=this;return new Promise(function(s,a){i.load(t,s,n,a)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}return r.DEFAULT_MATERIAL_NAME="__DEFAULT",r})();Error;const Fh="\\[\\]\\.:\\/",_x=new RegExp("["+Fh+"]","g"),Bh="[^"+Fh+"]",xx="[^"+Fh.replace("\\.","")+"]",wx=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",Bh)+/(WCOD+)?/.source.replace("WCOD",xx)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Bh)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Bh)+"$"),Ex=["material","materials","bones","map"];class Tx{constructor(e,t,n){const i=n||vt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const i=this._bindings[this._targetGroup.nCachedObjects_];void 0!==i&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}let vt=(()=>
vendor: 4,167 bytes, line 1
1{class r{constructor(t,n,i){this.path=n,this.parsedPath=i||r.parseTrackName(n),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,i){return t&&t.isAnimationObjectGroup?new r.Composite(t,n,i):new r(t,n,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(_x,"")}static parseTrackName(t){const n=wx.exec(t);if(null===n)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==s&&-1!==s){const a=i.nodeName.substring(s+1);-1!==Ex.indexOf(a)&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=a)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,n){if(void 0===n||""===n||"."===n||-1===n||n===t.name||n===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(n);if(void 0!==i)return i}if(t.children){const i=function(a){for(let l=0;l<a.length;l++){const c=a[l];if(c.name===n||c.uuid===n)return c;const h=i(c.children);if(h)return h}return null},s=i(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,n){t[n]=this.targetObject[this.propertyName]}_getValue_array(t,n){const i=this.resolvedProperty;for(let s=0,a=i.length;s!==a;++s)t[n++]=i[s]}_getValue_arrayElement(t,n){t[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,n){this.resolvedProperty.toArray(t,n)}_setValue_direct(t,n){this.targetObject[this.propertyName]=t[n]}_setValue_direct_setNeedsUpdate(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,n){const i=this.resolvedProperty;for(let s=0,a=i.length;s!==a;++s)i[s]=t[n++]}_setValue_array_setNeedsUpdate(t,n){const i=this.resolvedProperty;for(let s=0,a=i.length;s!==a;++s)i[s]=t[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,n){const i=this.resolvedProperty;for(let s=0,a=i.length;s!==a;++s)i[s]=t[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,n){this.resolvedProperty[this.propertyIndex]=t[n]}_setValue_arrayElement_setNeedsUpdate(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,n){this.resolvedProperty.fromArray(t,n)}_setValue_fromArray_setNeedsUpdate(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,n){this.bind(),this.getValue(t,n)}_setValue_unbound(t,n){this.bind(),this.setValue(t,n)}bind(){let t=this.node;const n=this.parsedPath,i=n.objectName,s=n.propertyName;let a=n.propertyIndex;if(t||(t=r.findNode(this.rootNode,n.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(i){let u=n.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let f=0;f<t.length;f++)if(t[f].name===u){u=f;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as no
1de does not have a material.",this);if(!t.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==u){if(void 0===t[u])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[u]}}const l=t[s];if(void 0===l)return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n.nodeName+"."+s+" but it wasn't found.",t);let c=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(void 0!==a){if("morphTargetInfluences"===s){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[a]&&(a=t.morphTargetDictionary[a])}h=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=a}else void 0!==l.fromArray&&void 0!==l.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(h=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=s;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}return r.Composite=Tx,r})();vt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},vt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},vt.prototype.GetterByBindingType=[vt.prototype._getValue_direct,vt.prototype._getValue_array,vt.prototype._getValue_arrayElement,vt.prototype._getValue_toArray],vt.prototype.SetterByBindingTypeAndVersioning=[[vt.prototype._setValue_direct,vt.prototype._setValue_direct_setNeedsUpdate,vt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[vt.prototype._setValue_array,vt.prototype._setValue_array_setNeedsUpdate,vt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[vt.prototype._setValue_arrayElement,vt.prototype._setValue_arrayElement_setNeedsUpdate,vt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[vt.prototype._setValue_fromArray,vt.prototype._setValue_fromArray_setNeedsUpdate,vt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],new Float32Array(1);const nf=new ze;class Ix{constructor(e,t,n=0,i=1/0){this.ray=new Oa(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Ic,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return nf.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(nf),this}intersectObject(e,t=!0,n=[]){return zh(e,this,n,t),n.sort(sf),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i<s;i++)zh(e[i],this,n,t);return n.sort(sf),n}}function sf(r,e){return r.distance-e.distance}function zh(r,e,t,n){let i=!0;if(r.layers.test(e.layers)&&!1===r.raycast(e,t)&&(i=!1),!0===i&&!0===n){const s=r.children;for(let a=0,l=s.length;a<l;a++)zh(s[a],e,t,!0)}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"169"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="
1169")}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.