PageSourceSearch

https://poltava-pc-servis.netlify.app/assets/script-ZxOh_0fC.js

js poltava-pc-servis.netlify.app collected 2026-10-03 11:16:50 UTC 854,957 bytes, 4,109 lines download raw bytes

1var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},a=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),o=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},s=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},c=t=>r.call(t,`module.exports`)?t[`module.exports`]:s(e({},`__esModule`,{value:!0}),t);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function l(e,t,n){return Math.max(e,Math.min(t,n))}function u(e,t,n){return(1-n)*e+n*t}function d(e,t,n,r){return u(e,t,1-Math.exp(-n*r))}function f(e,t){return(e%t+t)%t}function p(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{n=void 0,e.apply(this,r)},t)}}function m(e,t){return e===1?y:e===2?t:1}var h,g,_,v,y,b,x,S,C,w=i((()=>{h=`1.3.25`,g=class{isRunning=!1;value=0;from=0;to=0;currentTime=0;lerp;duration;easing;onUpdate;advance(e){if(!this.isRunning)return;let t=!1;if(this.duration&&this.easing){this.currentTime+=e;let n=l(0,this.currentTime/this.duration,1);t=n>=1;let r=t?1:this.easing(n);this.value=this.from+(this.to-this.from)*r}else this.lerp?(this.value=d(this.value,this.to,this.lerp*60,e),Math.round(this.value)===Math.round(this.to)&&(this.value=this.to,t=!0)):(this.value=this.to,t=!0);t&&this.stop(),this.onUpdate?.(this.value,t)}stop(){this.isRunning=!1}fromTo(e,t,{lerp:n,duration:r,easing:i,onStart:a,onUpdate:o}){this.from=this.value=e,this.to=t,this.lerp=n,this.duration=r,this.easing=i,this.currentTime=0,this.isRunning=!0,a?.(),this.onUpdate=o}},_=class{width=0;height=0;scrollHeight=0;scrollWidth=0;debouncedResize;wrapperResizeObserver;contentResizeObserver;constructor(e,t,{autoResize:n=!0,debounce:r=250}={}){this.wrapper=e,this.content=t,n&&(this.debouncedResize=p(this.resize,r),this.wrapper instanceof Window?window.addEventListener(`resize`,this.debouncedResize):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener(`resize`,this.debouncedResize)}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)};onContentResize=()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},v=class{events={};emit(e,...t){let n=this.events[e]||[];for(let e=0,r=n.length;e<r;e++)n[e]?.(...t)}on(e,t){return this.events[e]?this.events[e].push(t):this.events[e]=[t],()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}off(e,t){this.events[e]=this.events[e]?.filter(e=>t!==e)}destroy(){this.events={}}},y=100/6,b={passive:!1},x=class{touchStart={x:0,y:0};lastDelta={x:0,y:0};window={width:0,height:0};emitter=new v;constructor(e,t={wheelMultiplier:1,touchMultiplier:1}){this.element=e,this.options=t,window.addEventListener(`resize`,this.onWindowResize),this.onWindowResize(),this.element.addEventListener(`wheel`,this.onWheel,b),this.element.addEventListener(`touchstart`,this.onTouchStart,b),this.element.addEventListener(`touchmove`,this.onTouchMove,b),this.element.addEventListener(`touchend`,this.onTouchEnd,b)}on(e,t){return this.emitter.on(e,t)}destroy(){this.emitter.destroy(),window.removeEventListener(`resize`,this.onWindowResize),this.element.removeEventListener(`wheel`,this.onWheel,b),this.element.removeEventListener(`touchstart`,this.onTouchStart,b),this.element.removeEventListener(`touchmove`,this.onTouchMove,b),this.element.removeEventListener(`touchend`,this.onTouchEnd,b)}onTouchStart=e=>{let{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:0,y:0},this.emitter.emit(`scroll`,{deltaX:0,deltaY:0,event:e})};onTouchMove=e=>{let{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e,r=-(t-this.touchStart.x)*this.options.touchMultiplier,i=-(n-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:r,y:i},this.emitter.emit(`scroll`,{deltaX:r,deltaY:i,event:e})};onTouchEnd=e=>{this.emitter.emit(`scroll`,{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:e})};onWheel=e=>{let{deltaX:t,deltaY:n,deltaMode:r}=e,i=m(r,this.window.width),a=m(r,this.window.height);t*=i,n*=a,t*=this.options.wheelMultiplier,n*=this.options.wheelMultiplier,this.emitter.emit(`scroll`,{deltaX:t,deltaY:n,event:e})};onWindowResize=()=>{this.window={width:window.innerWidth,height:window.innerHeight}}},S=e=>Math.min(1,1.001-2**(-10*e)),C=class{_isScrolling=!1;_isStopped=!1;_isLocked=!1;_preventNextNativeScrollEvent=!1;_resetVelocityTimeout=null;_rafId=null;_isDraggingSelection=!1;isTouching;isIos;time=0;userData={};lastVelocity=0;velocity=0;direction=0;options;targetScroll;animatedScroll;animate=new g;emitter=new v;dimensions;virtualScroll;constructor({wrapper:e=window,content:t=document.documentElement,eventsTarget:n=e,smoothWheel:r=!0,syncTouch:i=!1,syncTouchLerp:a=.075,touchInertiaExponent:o=1.7,duration:s,easing:c,lerp:l=.1,infinite:u=!1,orientation:d=`vertical`,gestureOrientation:f=d===`horizontal`?`both`:`vertical`,touchMultiplier:p=1,wheelMultiplier:m=1,autoResize:g=!0,prevent:v,virtualScroll:y,overscroll:b=!0,autoRaf:C=!1,anchors:w=!1,autoToggle:T=!1,allowNestedScroll:E=!1,__experimental__naiveDimensions:D=!1,naiveDimensions:O=D,stopInertiaOnNavigate:k=!1}
vendor: 10,282 bytes, line 1
1={}){window.lenisVersion=h,window.lenis||(window.lenis={}),window.lenis.version=h,d===`horizontal`&&(window.lenis.horizontal=!0),i===!0&&(window.lenis.touch=!0),this.isIos=/(iPad|iPhone|iPod)/g.test(navigator.userAgent),(!e||e===document.documentElement)&&(e=window),typeof s==`number`&&typeof c!=`function`?c=S:typeof c==`function`&&typeof s!=`number`&&(s=1),this.options={wrapper:e,content:t,eventsTarget:n,smoothWheel:r,syncTouch:i,syncTouchLerp:a,touchInertiaExponent:o,duration:s,easing:c,lerp:l,infinite:u,gestureOrientation:f,orientation:d,touchMultiplier:p,wheelMultiplier:m,autoResize:g,prevent:v,virtualScroll:y,overscroll:b,autoRaf:C,anchors:w,autoToggle:T,allowNestedScroll:E,naiveDimensions:O,stopInertiaOnNavigate:k},this.dimensions=new _(e,t,{autoResize:g}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener(`scroll`,this.onNativeScroll),this.options.wrapper.addEventListener(`scrollend`,this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener(`click`,this.onClick),this.options.wrapper.addEventListener(`pointerdown`,this.onPointerDown),this.virtualScroll=new x(n,{touchMultiplier:p,wheelMultiplier:m}),this.virtualScroll.on(`scroll`,this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener(`transitionend`,this.onTransitionEnd)),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener(`scroll`,this.onNativeScroll),this.options.wrapper.removeEventListener(`scrollend`,this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener(`pointerdown`,this.onPointerDown),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener(`click`,this.onClick),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(e,t){return this.emitter.on(e,t)}off(e,t){return this.emitter.off(e,t)}onScrollEnd=e=>{e instanceof CustomEvent||(this.isScrolling===`smooth`||this.isScrolling===!1)&&e.stopPropagation()};dispatchScrollendEvent=()=>{this.options.wrapper.dispatchEvent(new CustomEvent(`scrollend`,{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))};get overflow(){let e=this.isHorizontal?`overflow-x`:`overflow-y`;return getComputedStyle(this.rootElement)[e]}checkOverflow(){[`hidden`,`clip`].includes(this.overflow)?this.internalStop():this.internalStart()}onTransitionEnd=e=>{e.propertyName?.includes(`overflow`)&&e.target===this.rootElement&&this.checkOverflow()};setScroll(e){this.isHorizontal?this.options.wrapper.scrollTo({left:e,behavior:`instant`}):this.options.wrapper.scrollTo({top:e,behavior:`instant`})}onClick=e=>{let t=e.composedPath().filter(e=>e instanceof HTMLAnchorElement&&e.href).map(e=>new URL(e.href)),n=new URL(window.location.href);if(this.options.anchors){let e=t.find(e=>n.host===e.host&&n.pathname===e.pathname&&e.hash);if(e){let t=typeof this.options.anchors==`object`&&this.options.anchors?this.options.anchors:void 0,n=decodeURIComponent(e.hash);this.scrollTo(n,t);return}}if(this.options.stopInertiaOnNavigate&&t.some(e=>n.host===e.host&&n.pathname!==e.pathname)){this.reset();return}};onPointerDown=e=>{e.button===1&&this.reset()};isTouchOnSelectionHandle(e){let t=window.getSelection();if(!t||t.isCollapsed||t.rangeCount===0)return!1;let n=e.targetTouches[0]??e.changedTouches[0];if(!n)return!1;let r=t.getRangeAt(0).getClientRects();if(r.length===0)return!1;let i=r[0],a=r[r.length-1],o=Math.hypot(n.clientX-i.left,n.clientY-i.top)<=40,s=Math.hypot(n.clientX-a.right,n.clientY-a.bottom)<=40;return o||s}onVirtualScroll=e=>{if(typeof this.options.virtualScroll==`function`&&this.options.virtualScroll(e)===!1)return;let{deltaX:t,deltaY:n,event:r}=e;if(this.emitter.emit(`virtual-scroll`,{deltaX:t,deltaY:n,event:r}),r.ctrlKey||r.lenisStopPropagation)return;let i=r.type.includes(`touch`),a=r.type.includes(`wheel`);if(i&&this.isIos&&(r.type===`touchstart`&&(this._isDraggingSelection=this.isTouchOnSelectionHandle(r)),this._isDraggingSelection)){r.type===`touchend`&&(this._isDraggingSelection=!1);return}this.isTouching=r.type===`touchstart`||r.type===`touchmove`;let o=t===0&&n===0;if(this.options.syncTouch&&i&&r.type===`touchstart`&&o&&!this.isStopped&&!this.isLocked){this.reset();return}let s=this.options.gestureOrientation===`vertical`&&n===0||this.options.gestureOrientation===`horizontal`&&t===0;if(o||s)return;let c=r.composedPath();c=c.slice(0,c.indexOf(this.rootElement));let l=this.options.prevent,u=Math.abs(t)>=Math.abs(n)?`horizontal`:`vertical`;if(c.find(e=>e instanceof HTMLElement&&(typeof l==`function`&&l?.(e)||e.hasAttribute?.(`data-lenis-prevent`)||u===`vertical`&&e.hasAttribute?.(`data-lenis-prevent-vertical`)||u===`horizontal`&&e.hasAttribute?.(`data-lenis-prevent-horizontal`)||i&&e.hasAttribute?.(`data-lenis-prevent-touch`)||a&&e.hasAttribute?.(`data-lenis-prevent-wheel`)||this.options.allowNestedScroll&&this.hasNestedScroll(e,{deltaX:t,deltaY:n}))))return;if(this.isStopped||this.isLocked){r.cancelable&&r.preventDefault();return}if(!(this.options.syncTouch&&i||this.options.smoothWheel&&a)){this.isScrolling=`native`,this.animate.stop(),r.lenisStopPropagation=!0;return}let d=n;this.options.gestureOrientation===`both`?d=Math.abs(n)>Math.abs(t)?n:t:this.options.gestureOrientation===`horizontal`&&(d=t),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&n>0||this.animatedScroll===this.limit&&n<0))&&(r.lenisStopPropagation=!0),r.cancelable&&r.preventDefault();let f=i&&this.options.syncTouch,p=i&&r.type===`touchend`;p&&(d=Math.sign(d)*Math.abs(this.velocity)**this.options.touchInertiaExponent),this.scrollTo(this.targetScroll+d,{programmatic:!1,...f?{lerp:p?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})};resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit(`scroll`,this)}onNativeScroll=()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling===`native`){let e=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-e,this.direction=Math.sign(this.animatedScroll-e),this.isStopped||(this.isScrolling=`native`),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}};reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty(`overflow`);return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty(`overflow`,`clip`);return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}raf=e=>{let t=e-(this.time||e);this.time=e,this.animate.advance(t*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))};scrollTo(e,{offset:t=0,immediate:n=!1,lock:r=!1,programmatic:i=!0,lerp:a=i?this.options.lerp:void 0,duration:o=i?this.options.duration:void 0,easing:s=i?this.options.easing:void 0,onStart:c,onComplete:u,force:d=!1,userData:f}={}){if((this.isStopped||this.isLocked)&&!d)return;let p=e,m=t;if(typeof p==`string`&&[`top`,`left`,`start`,`#`].includes(p))p=0;else if(typeof p==`string`&&[`bottom`,`right`,`end`].includes(p))p=this.limit;else{let e=null;if(typeof p==`string`?(e=p.startsWith(`#`)?document.getElementById(p.slice(1)):document.querySelector(p),e||(p===`#top`?p=0:console.warn(`Lenis: Target not found`,p))):p instanceof HTMLElement&&p?.nodeType&&(e=p),e){if(this.options.wrapper!==window){let e=this.rootElement.getBoundingClientRect();m-=this.isHorizontal?e.left:e.top}let t=e.getBoundingClientRect(),n=getComputedStyle(e),r=this.isHorizontal?Number.parseFloat(n.scrollMarginLeft):Number.parseFloat(n.scrollMarginTop),i=getComputedStyle(this.rootElement),a=this.isHorizontal?Number.parseFloat(i.scrollPaddingLeft):Number.parseFloat(i.scrollPaddingTop);p=(this.isHorizontal?t.left:t.top)+this.animatedScroll-(Number.isNaN(r)?0:r)-(Number.isNaN(a)?0:a)}}if(typeof p==`number`){if(p+=m,this.options.infinite){if(i){this.targetScroll=this.animatedScroll=this.scroll;let e=p-this.animatedScroll;e>this.limit/2?p-=this.limit:e<-this.limit/2&&(p+=this.limit)}}else p=l(0,p,this.limit);if(p===this.targetScroll){c?.(this),u?.(this);return}if(this.userData=f??{},n){this.animatedScroll=this.targetScroll=p,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),u?.(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}i||(this.targetScroll=p),typeof o==`number`&&typeof s!=`function`?s=S:typeof s==`function`&&typeof o!=`number`&&(o=1),this.animate.fromTo(this.animatedScroll,p,{duration:o,easing:s,lerp:a,onStart:()=>{r&&(this.isLocked=!0),this.isScrolling=`smooth`,c?.(this)},onUpdate:(e,t)=>{this.isScrolling=`smooth`,this.lastVelocity=this.velocity,this.velocity=e-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=e,this.setScroll(this.scroll),i&&(this.targetScroll=e),t||this.emit(),t&&(this.reset(),this.emit(),u?.(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}hasNestedScroll(e,{deltaX:t,deltaY:n}){let r=Date.now();e._lenis||={};let i=e._lenis,a,o,s,c,l,u,d,f,p,m;if(r-(i.time??0)>2e3){i.time=Date.now();let t=window.getComputedStyle(e);
1if(i.computedStyle=t,a=[`auto`,`overlay`,`scroll`].includes(t.overflowX),o=[`auto`,`overlay`,`scroll`].includes(t.overflowY),l=[`auto`].includes(t.overscrollBehaviorX),u=[`auto`].includes(t.overscrollBehaviorY),i.hasOverflowX=a,i.hasOverflowY=o,!(a||o))return!1;d=e.scrollWidth,f=e.scrollHeight,p=e.clientWidth,m=e.clientHeight,s=d>p,c=f>m,i.isScrollableX=s,i.isScrollableY=c,i.scrollWidth=d,i.scrollHeight=f,i.clientWidth=p,i.clientHeight=m,i.hasOverscrollBehaviorX=l,i.hasOverscrollBehaviorY=u}else s=i.isScrollableX,c=i.isScrollableY,a=i.hasOverflowX,o=i.hasOverflowY,d=i.scrollWidth,f=i.scrollHeight,p=i.clientWidth,m=i.clientHeight,l=i.hasOverscrollBehaviorX,u=i.hasOverscrollBehaviorY;if(!(a&&s||o&&c))return!1;let h=Math.abs(t)>=Math.abs(n)?`horizontal`:`vertical`,g,_,v,y,b,x;if(h===`horizontal`)g=Math.round(e.scrollLeft),_=d-p,v=t,y=a,b=s,x=l;else if(h===`vertical`)g=Math.round(e.scrollTop),_=f-m,v=n,y=o,b=c,x=u;else return!1;return!x&&(g>=_||g<=0)||(v>0?g<_:g>0)&&y&&b}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?`x`:`y`]}get isHorizontal(){return this.options.orientation===`horizontal`}get actualScroll(){let e=this.options.wrapper;return this.isHorizontal?e.scrollX??e.scrollLeft:e.scrollY??e.scrollTop}get scroll(){return this.options.infinite?f(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(e){this._isStopped!==e&&(this._isStopped=e,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this.updateClassName())}get isSmooth(){return this.isScrolling===`smooth`}get className(){let e=`lenis`;return this.options.autoToggle&&(e+=` lenis-autoToggle`),this.isStopped&&(e+=` lenis-stopped`),this.isLocked&&(e+=` lenis-locked`),this.isScrolling&&(e+=` lenis-scrolling`),this.isScrolling===`smooth`&&(e+=` lenis-smooth`),e}updateClassName(){this.cleanUpClassName(),this.className.split(` `).forEach(e=>{this.rootElement.classList.add(e)})}cleanUpClassName(){for(let e of Array.from(this.rootElement.classList))(e===`lenis`||e.startsWith(`lenis-`))&&this.rootElement.classList.remove(e)}}})),T=a((()=>{w();var e=new C({});function t(n){e.raf(n),requestAnimationFrame(t)}requestAnimationFrame(t)})),E,D,O,k,A,j,M,N,P,F,ee,te,ne,re,ie,I,ae,L,oe,se,ce,R,le=i((()=>{E=`bottom`,D=`right`,O=`left`,k=`auto`,A=[`top`,E,D,O],j=`start`,M=`clippingParents`,N=`viewport`,P=`popper`,F=`reference`,ee=A.reduce(function(e,t){return e.concat([t+`-`+j,t+`-end`])},[]),te=[].concat(A,[k]).reduce(function(e,t){return e.concat([t,t+`-`+j,t+`-end`])},[]),ne=`beforeRead`,re=`read`,ie=`afterRead`,I=`beforeMain`,ae=`main`,L=`afterMain`,oe=`beforeWrite`,se=`write`,ce=`afterWrite`,R=[ne,re,ie,I,ae,L,oe,se,ce]}));function z(e){return e?(e.nodeName||``).toLowerCase():null}var B=i((()=>{}));function V(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}var ue=i((()=>{}));function de(e){return e instanceof V(e).Element||e instanceof Element}function fe(e){return e instanceof V(e).HTMLElement||e instanceof HTMLElement}function pe(e){return typeof ShadowRoot>`u`?!1:e instanceof V(e).ShadowRoot||e instanceof ShadowRoot}var me=i((()=>{ue()}));function he(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!fe(i)||!z(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function H(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEac
vendor: 21,157 bytes, line 1
1h(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!fe(r)||!z(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var U,W=i((()=>{B(),me(),U={name:`applyStyles`,enabled:!0,phase:`write`,fn:he,effect:H,requires:[`computeStyles`]}}));function ge(e){return e.split(`-`)[0]}var G=i((()=>{})),_e,K,q,ve=i((()=>{_e=Math.max,K=Math.min,q=Math.round}));function ye(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}var be=i((()=>{}));function xe(){return!/^((?!chrome|android).)*safari/i.test(ye())}var Se=i((()=>{be()}));function Ce(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&fe(e)&&(i=e.offsetWidth>0&&q(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&q(r.height)/e.offsetHeight||1);var o=(de(e)?V(e):window).visualViewport,s=!xe()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}var we=i((()=>{me(),ve(),ue(),Se()}));function J(e){var t=Ce(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}var Te=i((()=>{we()}));function Ee(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&pe(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}var De=i((()=>{me()}));function Oe(e){return V(e).getComputedStyle(e)}var ke=i((()=>{ue()}));function Ae(e){return[`table`,`td`,`th`].indexOf(z(e))>=0}var je=i((()=>{B()}));function Me(e){return((de(e)?e.ownerDocument:e.document)||window.document).documentElement}var Ne=i((()=>{me()}));function Pe(e){return z(e)===`html`?e:e.assignedSlot||e.parentNode||(pe(e)?e.host:null)||Me(e)}var Fe=i((()=>{B(),Ne(),me()}));function Ie(e){return!fe(e)||Oe(e).position===`fixed`?null:e.offsetParent}function Le(e){var t=/firefox/i.test(ye());if(/Trident/i.test(ye())&&fe(e)&&Oe(e).position===`fixed`)return null;var n=Pe(e);for(pe(n)&&(n=n.host);fe(n)&&[`html`,`body`].indexOf(z(n))<0;){var r=Oe(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function Re(e){for(var t=V(e),n=Ie(e);n&&Ae(n)&&Oe(n).position===`static`;)n=Ie(n);return n&&(z(n)===`html`||z(n)===`body`&&Oe(n).position===`static`)?t:n||Le(e)||t}var ze=i((()=>{ue(),B(),ke(),me(),je(),Fe(),be()}));function Be(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}var Ve=i((()=>{}));function He(e,t,n){return _e(e,K(t,n))}function Ue(e,t,n){var r=He(e,t,n);return r>n?n:r}var We=i((()=>{ve()}));function Ge(){return{top:0,right:0,bottom:0,left:0}}var Ke=i((()=>{}));function qe(e){return Object.assign({},Ge(),e)}var Je=i((()=>{Ke()}));function Ye(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var Xe=i((()=>{}));function Ze(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=ge(n.placement),c=Be(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=$e(i.padding,n),d=J(a),f=c===`y`?`top`:O,p=c===`y`?E:D,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=Re(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=He(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function Qe(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||Ee(t.elements.popper,r)&&(t.elements.arrow=r))}var $e,et,tt=i((()=>{G(),Te(),De(),ze(),Ve(),We(),Je(),Xe(),le(),$e=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,qe(typeof e==`number`?Ye(e,A):e)},et={name:`arrow`,enabled:!0,phase:`main`,fn:Ze,effect:Qe,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]}}));function nt(e){return e.split(`-`)[1]}var rt=i((()=>{}));function it(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:q(n*i)/i||0,y:q(r*i)/i||0}}function at(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=O,b=`top`,x=window;if(l){var S=Re(n),C=`clientHeight`,w=`clientWidth`;if(S===V(n)&&(S=Me(n),Oe(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=E;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=D;var k=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=k-r.width,p*=c?1:-1}}var A=Object.assign({position:s},l&&st),j=u===!0?it({x:p,y:h},V(n)):{x:p,y:h};if(p=j.x,h=j.y,c){var M;return Object.assign({},A,(M={},M[b]=v?`0`:``,M[y]=_?`0`:``,M.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,M))}return Object.assign({},A,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function ot(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:ge(t.placement),variation:nt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,at(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,at(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var st,ct,lt=i((()=>{le(),ze(),ue(),Ne(),ke(),G(),rt(),ve(),st={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`},ct={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:ot,data:{}}}));function ut(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=V(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,dt)}),s&&c.addEventListener(`resize`,n.update,dt),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,dt)}),s&&c.removeEventListener(`resize`,n.update,dt)}}var dt,ft,pt=i((()=>{ue(),dt={passive:!0},ft={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:ut,data:{}}}));function mt(e){return e.replace(/left|right|bottom|top/g,function(e){return ht[e]})}var ht,gt=i((()=>{ht={left:`right`,right:`left`,bottom:`top`,top:`bottom`}}));function _t(e){return e.replace(/start|end/g,function(e){return vt[e]})}var vt,yt=i((()=>{vt={start:`end`,end:`start`}}));function bt(e){var t=V(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}var xt=i((()=>{ue()}));function St(e){return Ce(Me(e)).left+bt(e).scrollLeft}var Ct=i((()=>{we(),Ne(),xt()}));function wt(e,t){var n=V(e),r=Me(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=xe();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+St(e),y:c}}var Tt=i((()=>{ue(),Ne(),Ct(),Se()}));function Et(e){var t=Me(e),n=bt(e),r=e.ownerDocument?.body,i=_e(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=_e(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+St(e),s=-n.scrollTop;return Oe(r||t).direction===`rtl`&&(o+=_e(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}var Dt=i((()=>{Ne(),ke(),Ct(),xt(),ve()}));function Ot(e){var t=Oe(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}var kt=i((()=>{ke()}));function At(e){return[`html`,`body`,`#document`].indexOf(z(e))>=0?e.ownerDocument.body:fe(e)&&Ot(e)?e:At(Pe(e))}var jt=i((()=>{Fe(),kt(),B(),me()}));function Mt(e,t){t===void 0&&(t=[]);var n=At(e),r=n===e.ownerDocument?.body,i=V(n),a=r?[i].concat(i.visualViewport||[],Ot(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(Mt(Pe(a)))}var Nt=i((()=>{jt(),Fe(),ue(),kt()}));function Pt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}var Ft=i((()=>{}));function It(e,t){var n=Ce(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Lt(e,t,n){return t===`viewport`?Pt(wt(e,n)):de(t)?It(t,n):Pt(Et(Me(e)))}function Rt(e){var t=Mt(Pe(e)),n=[`absolute`,`fixed`].indexOf(Oe(e).position)>=0&&fe(e)?Re(e):e;return de(n)?t.filter(function(e){return de(e)&&Ee(e,n)&&z(e)!==`body`}):[]}function zt(e,t,n,r){var i=t===`clippingParents`?Rt(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=Lt(e,n,r);return t.top=_e(i.top,t.top),t.right=K(i.right,t.right),t.bottom=K(i.bottom,t.bottom),t.left=_e(i.left,t.left),t},Lt(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}var Bt=i((()=>{le(),Tt(),Dt(),Nt(),ze(),Ne(),ke(),me(),we(),Fe(),De(),B(),Ft(),ve()}));function Vt(e){var t=e.reference,n=e.element,r=e.placement,i=r?ge(r):null,a=r?nt(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case E:c={x:o,y:t.y+t.height};break;case D:c={x:t.x+t.width,y:s};break;case O:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?Be(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case j:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2)}}return c}var Ht=i((()=>{G(),rt(),Ve(),le()}));function Ut(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?M:s,l=n.rootBoundary,u=l===void 0?N:l,d=n.elementContext,f=d===void 0?P:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=qe(typeof g==`number`?Ye(g,A):g),v=f===`popper`?F:P,y=e.rects.popper,b=e.elements[m?v:f],x=zt(de(b)?b:b.contextElement||Me(e.elements.popper),c,u,o),S=Ce(e.elements.reference),C=Vt({reference:S,element:y,strategy:`absolute`,placement:i}),w=Pt(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}var Wt=i((()=>{Bt(),Ne(),we(),Ht(),Ft(),le(),me(),Je(),Xe()}));function Gt(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?te:c,u=nt(r),d=u?s?ee:ee.filter(function(e){return nt(e)===u}):A,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=Ut(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[ge(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}var Kt=i((()=>{rt(),le(),Wt(),G()}));function qt(e){if(ge(e)===`auto`)return[];var t=mt(e);return[_t(e),t,_t(t)]}function Jt(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=ge(g)===g,v=c||(_||!m?[mt(g)]:qt(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(ge(n)===`auto`?Gt(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var k=y[T],A=ge(k),M=nt(k)===j,N=[`top`,E].indexOf(A)>=0,P=N?`width`:`height`,F=Ut(t,{placement:k,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),ee=N?M?D:O:M?E:`top`;b[P]>x[P]&&(ee=mt(ee));var te=mt(ee),ne=[];if(a&&ne.push(F[A]<=0),s&&ne.push(F[ee]<=0,F[te]<=0),ne.every(function(e){return e})){w=k,C=!1;break}S.set(k,ne)}if(C)for(var re=m?3:1,ie=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},I=re;I>0&&ie(I)!==`break`;I--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var Yt,Xt=i((()=>{gt(),G(),yt(),Wt(),Kt(),le(),rt(),Yt={name:`flip`,enabled:!0,phase:`main`,fn:Jt,requiresIfExists:[`offset`],data:{_skip:!1}}}));function Zt(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Qt(e){return[`top`,D,E,O].some(function(t){return e[t]>=0})}function $t(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=Ut(t,{elementContext:`reference`}),s=Ut(t,{altBoundary:!0}),c=Zt(o,r),l=Zt(s,i,a),u=Qt(c),d=Qt(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var en,tn=i((()=>{le(),Wt(),en={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:$t}}));function nn(e,t,n){var r=ge(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function rn(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=te.reduce(function(e,n){return e[n]=nn(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var an,on=i((()=>{G(),le(),an={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:rn}}));function sn(e){var t=e.state,n=e.name;t.modifiersData[n]=Vt({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var cn,ln=i((()=>{Ht(),cn={name:`popperOffsets`,enabled:!0,phase:`read`,fn:sn,data:{}}}));function un(e){return e===`x`?`y`:`x`}var dn=i((()=>{}));function fn(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=Ut(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=ge(t.placement),v=nt(t.placement),y=!v,b=Be(_),x=un(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,k=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(S){if(a){var M=b===`y`?`top`:O,N=b===`y`?E:D,P=b===`y`?`height`:`width`,F=S[b],ee=F+g[M],te=F-g[N],ne=p?-w[P]/2:0,re=v===`start`?C[P]:w[P],ie=v===`start`?-w[P]:-C[P],I=t.elements.arrow,ae=p&&I?J(I):{width:0,height:0},L=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:Ge(),oe=L[M],se=L[N],ce=He(0,C[P],ae[P]),R=y?C[P]/2-ne-ce-oe-k.mainAxis:re-ce-oe-k.mainAxis,le=y?-C[P]/2+ne+ce+se+k.mainAxis:ie+ce+se+k.mainAxis,z=t.elements.arrow&&Re(t.elements.arrow),B=z?b===`y`?z.clientTop||0:z.clientLeft||0:0,V=A?.[b]??0,ue=F+R-V-B,de=F+le-V,fe=He(p?K(ee,ue):ee,F,p?_e(te,de):te);S[b]=fe,j[b]=fe-F}if(s){var pe=b===`x`?`top`:O,me=b===`x`?E:D,he=S[x],H=x===`y`?`height`:`width`,U=he+g[pe],W=he-g[me],G=[`top`,O].indexOf(_)!==-1,q=A?.[x]??0,ve=G?U:he-C[H]-w[H]-q+k.altAxis,ye=G?he+C[H]+w[H]-q-k.altAxis:W,be=p&&G?Ue(ve,he,ye):He(p?ve:U,he,p?ye:W);S[x]=be,j[x]=be-he}t.modifiersData[r]=j}}var pn,mn=i((()=>{le(),G(),Ve(),dn(),We(),Te(),ze(),Wt(),rt(),Ke(),ve(),pn={name:`preventOverflow`,enabled:!0,phase:`main`,fn,requiresIfExists:[`offset`]}})),hn=i((()=>{W(),tt(),lt(),pt(),Xt(),tn(),on(),ln(),mn()}));function gn(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}var _n=i((()=>{}));function vn(e){return e===V(e)||!fe(e)?bt(e):gn(e)}var yn=i((()=>{xt(),ue(),me(),_n()}));function bn(e){var t=e.getBoundingClientRect(),n=q(t.width)/e.offsetWidth||1,r=q(t.height)/e.offsetHeight||1;return n!==1||r!==1}function xn(e,t,n){n===void 0&&(n=!1);var r=fe(t),i=fe(t)&&bn(t),a=Me(t),o=Ce(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((z(t)!==`body`||Ot(a))&&(s=vn(t)),fe(t)?(c=Ce(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=St(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}var Sn=i((()=>{we(),yn(),B(),me(),Ct(),Ne(),kt(),ve()}));function Cn(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function wn(e){var t=Cn(e);return R.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}var Tn=i((()=>{le()}));function En(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}var Dn=i((()=>{}));function On(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var kn=i((()=>{}));function An(){return![...arguments].some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function jn(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?Mn:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},Mn,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:de(e)?Mt(e):e.contextElement?Mt(e.contextElement):[],popper:Mt(t)};var s=wn(On([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(An(t,n)){i.rects={reference:xn(t,Re(n),i.options.strategy===`fixed`),popper:J(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:En(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!An(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var Mn,Nn,Pn=i((()=>{Sn(),Te(),Nt(),ze(),Tn(),Dn(),kn(),Wt(),me(),Mn={placement:`bottom`,modifiers:[],strategy:`absolute`},Nn=jn()})),Fn,In,Ln=i((()=>{Pn(),pt(),ln(),lt(),W(),Fn=[ft,cn,ct,U],In=jn({defaultModifiers:Fn})})),Rn,zn,Bn=i((()=>{Pn(),pt(),ln(),lt(),W(),on(),Xt(),mn(),tt(),tn(),Ln(),hn(),Rn=[ft,cn,ct,U,an,Yt,pn,et,en],zn=jn({defaultModifiers:Rn})})),Vn=o({afterMain:()=>L,afterRead:()=>ie,afterWrite:()=>ce,applyStyles:()=>U,arrow:()=>et,auto:()=>k,basePlacements:()=>A,beforeMain:()=>I,beforeRead:()=>ne,beforeWrite:()=>oe,bottom:()=>E,clippingParents:()=>M,computeStyles:()=>ct,createPopper:()=>zn,createPopperBase:()=>Nn,createPopperLite:()=>In,detectOverflow:()=>Ut,end:()=>`end`,eventListeners:()=>ft,flip:()=>Yt,hide:()=>en,left:()=>O,main:()=>ae,modifierPhases:()=>R,offset:()=>an,placements:()=>te,popper:()=>P,popperGenerator:()=>jn,popperOffsets:()=>cn,preventOverflow:()=>pn,read:()=>re,reference:()=>F,right:()=>D,start:()=>j,top:()=>`top`,variationPlacements:()=>ee,viewport:()=>N,write:()=>se}),Hn=i((()=>{le(),hn(),Pn(),Bn(),Ln()})),Un=a(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r((Hn(),c(Vn))):typeof define==`function`&&define.amd?define([`@popperjs/core`],r):(n=typeof globalThis<`u`?globalThis:n||self,n.bootstrap=r(n.Popper))}
1)(e,(function(e){function t(e){if(e&&e.__esModule)return e;let t=Object.create(null,{[Symbol.toStringTag]:{value:`Module`}});if(e){for(let n in e)if(n!=="default"){let r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}let n=t(e),r=`transitionend`,i=e=>e==null?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),a=e=>{do e+=Math.floor(Math.random()*1e6);while(document.getElementById(e));return e},o=e=>{let t=e.getAttribute(`data-bs-target`);if(!t||t===`#`){let n=e.getAttribute(`href`);if(!n||!n.includes(`#`)&&!n.startsWith(`.`))return null;n.includes(`#`)&&!n.startsWith(`#`)&&(n=`#${n.split(`#`)[1]}`),t=n&&n!==`#`?n.trim():null}return t},s=e=>{let t=o(e);return t&&document.querySelector(t)?t:null},c=e=>{let t=o(e);return t?document.querySelector(t):null},l=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);return!Number.parseFloat(t)&&!Number.parseFloat(n)?0:(t=t.split(`,`)[0],n=n.split(`,`)[0],(Number.parseFloat(t)+Number.parseFloat(n))*1e3)},u=e=>{e.dispatchEvent(new Event(r))},d=e=>!e||typeof e!=`object`?!1:(e.jquery!==void 0&&(e=e[0]),e.nodeType!==void 0),f=e=>d(e)?e.jquery?e[0]:e:typeof e==`string`&&e.length>0?document.querySelector(e):null,p=e=>{if(!d(e)||e.getClientRects().length===0)return!1;let t=getComputedStyle(e).getPropertyValue(`visibility`)===`visible`,n=e.closest(`details:not([open])`);if(!n)return t;if(n!==e){let t=e.closest(`summary`);if(t&&t.parentNode!==n||t===null)return!1}return t},m=e=>!e||e.nodeType!==Node.ELEMENT_NODE||e.classList.contains(`disabled`)?!0:e.disabled===void 0?e.hasAttribute(`disabled`)&&e.getAttribute(`disabled`)!==`false`:e.disabled,h=e=>{if(!document.documentElement.attachShadow)return null;if(typeof e.getRootNode==`function`){let t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?h(e.parentNode):null},g=()=>{},_=e=>{e.offsetHeight},v=()=>window.jQuery&&!document.body.hasAttribute(`data-bs-no-jquery`)?window.jQuery:null,y=[],b=e=>{document.readyState===`loading`?(y.length||document.addEventListener(`DOMContentLoaded`,()=>{for(let e of y)e()}),y.push(e)):e()},x=()=>document.documentElement.dir===`rtl`,S=e=>{b(()=>{let t=v();if(t){let n=e.NAME,r=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=r,e.jQueryInterface)}})},C=e=>{typeof e==`function`&&e()},w=(e,t,n=!0)=>{if(!n){C(e);return}let i=l(t)+5,a=!1,o=({target:n})=>{n===t&&(a=!0,t.removeEventListener(r,o),C(e))};t.addEventListener(r,o),setTimeout(()=>{a||u(t)},i)},T=(e,t,n,r)=>{let i=e.length,a=e.indexOf(t);return a===-1?!n&&r?e[i-1]:e[0]:(a+=n?1:-1,r&&(a=(a+i)%i),e[Math.max(0,Math.min(a,i-1))])},E=/[^.]*(?=\..*)\.|.*/,D=/\..*/,O=/::\d+$/,k={},A=1,j={mouseenter:`mouseover`,mouseleave:`mouseout`},M=new Set(`click.dblclick.mouseup.mousedown.contextmenu.mousewheel.DOMMouseScroll.mouseover.mouseout.mousemove.selectstart.selectend.keydown.keypress.keyup.orientationchange.touchstart.touchmove.touchend.touchcancel.pointerdown.pointermove.pointerup.pointerleave.pointercancel.gesturestart.gesturechange.gestureend.focus.blur.change.reset.select.submit.focusin.focusout.load.unload.beforeunload.resize.move.DOMContentLoaded.readystatechange.error.abort.scroll`.split(`.`));function N(e,t){return t&&`${t}::${A++}`||e.uidEvent||A++}function P(e){let t=N(e);return e.uidEvent=t,k[t]=k[t]||{},k[t]}function F(e,t){return function n(r){return oe(r,{delegateTarget:e}),n.oneOff&&L.off(e,r.type,t),t.apply(e,[r])}}function ee(e,t,n){return function r(i){let a=e.querySelectorAll(t);for(let{target:o}=i;o&&o!==this;o=o.parentNode)for(let s of a)if(s===o)return oe(i,{delegateTarget:o}),r.oneOff&&L.off(e,i.type,t,n),n.apply(o,[i])}}function te(e,t,n=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===n)}function ne(e,t,n){let r=typeof t==`string`,i=r?n:t||n,a=ae(e);return M.has(a)||(a=e),[r,i,a]}function re(e,t,n,r,i){if(typeof t!=`string`||!e)return;let[a,o,s]=ne(t,n,r);t in j&&(o=(e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)})(o));let c=P(e),l=c[s]||(c[s]={}),u=te(l,o,a?n:null);if(u){u.oneOff=u.oneOff&&i;return}let d=N(o,t.replace(E,``)),f=a?ee(e,n,o):F(e,o);f.delegationSelector=a?n:null,f.callable=o,f.oneOff=i,f.uidEvent=d,l[d]=f,e.addEventListener(s,f,a)}function ie(e,t,n,r,i){let a=te(t[n],r,i);a&&(e.removeEventListener(n,a,!!i),delete t[n][a.uidEvent])}function I(e,t,n,r){let i=t[n]||{};for(let a of Object.keys(i))if(a.includes(r)){let r=i[a];ie(e,t,n,r.callable,r.delegationSelector)}}function ae(e){return e=e.replace(D,``),j[e]||e}let L={on(e,t,n,r){re(e,t,n,r,!1)},one(e,t,n,r){re(e,t,n,r,!0)},off(e,t,n,r){if(typeof t!=`string`||!e)return;let[i,a,o]=ne(t,n,r),s=o!==t,c=P(e),l=c[o]||{},u=t.startsWith(`.`);if(a!==void 0){if(!Object.keys(l).length)return;ie(e,c,o,a,i?n:null);return}if(u)for(let n of Object.keys(c))I(e,c,n,t.slice(1));for(let n of Object.keys(l)){let r=n.replace(O,``);
1if(!s||t.includes(r)){let t=l[n];ie(e,c,o,t.callable,t.delegationSelector)}}},trigger(e,t,n){if(typeof t!=`string`||!e)return null;let r=v(),i=t!==ae(t),a=null,o=!0,s=!0,c=!1;i&&r&&(a=r.Event(t,n),r(e).trigger(a),o=!a.isPropagationStopped(),s=!a.isImmediatePropagationStopped(),c=a.isDefaultPrevented());let l=new Event(t,{bubbles:o,cancelable:!0});return l=oe(l,n),c&&l.preventDefault(),s&&e.dispatchEvent(l),l.defaultPrevented&&a&&a.preventDefault(),l}};function oe(e,t){for(let[n,r]of Object.entries(t||{}))try{e[n]=r}catch{Object.defineProperty(e,n,{configurable:!0,get(){return r}})}return e}let se=new Map,ce={set(e,t,n){se.has(e)||se.set(e,new Map);let r=se.get(e);if(!r.has(t)&&r.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(r.keys())[0]}.`);return}r.set(t,n)},get(e,t){return se.has(e)&&se.get(e).get(t)||null},remove(e,t){if(!se.has(e))return;let n=se.get(e);n.delete(t),n.size===0&&se.delete(e)}};function R(e){if(e===`true`)return!0;if(e===`false`)return!1;if(e===Number(e).toString())return Number(e);if(e===``||e===`null`)return null;if(typeof e!=`string`)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function le(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}let z={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${le(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${le(t)}`)},getDataAttributes(e){if(!e)return{};let t={},n=Object.keys(e.dataset).filter(e=>e.startsWith(`bs`)&&!e.startsWith(`bsConfig`));for(let r of n){let n=r.replace(/^bs/,``);n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=R(e.dataset[r])}return t},getDataAttribute(e,t){return R(e.getAttribute(`data-bs-${le(t)}`))}};class B{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw Error(`You have to implement the static method "NAME", for each component!`)}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){let n=d(t)?z.getDataAttribute(t,`config`):{};return{...this.constructor.Default,...typeof n==`object`?n:{},...d(t)?z.getDataAttributes(t):{},...typeof e==`object`?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(let n of Object.keys(t)){let r=t[n],a=e[n],o=d(a)?`element`:i(a);if(!new RegExp(r).test(o))throw TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${o}" but expected type "${r}".`)}}}class V extends B{constructor(e,t){super(),e=f(e),e&&(this._element=e,this._config=this._getConfig(t),ce.set(this._element,this.constructor.DATA_KEY,this))}dispose(){ce.remove(this._element,this.constructor.DATA_KEY),L.off(this._element,this.constructor.EVENT_KEY);for(let e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){w(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return ce.get(f(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t==`object`?t:null)}static get VERSION(){return`5.2.2`}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}let ue=(e,t=`hide`)=>{let n=`click.dismiss${e.EVENT_KEY}`,r=e.NAME;L.on(document,n,`[data-bs-dismiss="${r}"]`,function(n){if([`A`,`AREA`].includes(this.tagName)&&n.preventDefault(),m(this))return;let i=c(this)||this.closest(`.${r}`);e.getOrCreateInstance(i)[t]()})},de=`.bs.alert`,fe=`close${de}`,pe=`closed${de}`;class me extends V{static get NAME(){return`alert`}close(){if(L.trigger(this._element,fe).defaultPrevented)return;this._element.classList.remove(`show`);let e=this._element.classList.contains(`fade`);this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),L.trigger(this._element,pe),this.dispose()}static jQueryInterface(e){return this.each(function(){let t=me.getOrCreateInstance(this);if(typeof e==`string`){if(t[e]===void 0||e.startsWith(`_`)||e===`constructor`)throw TypeError(`No method n
1amed "${e}"`);t[e](this)}})}}ue(me,`close`),S(me);let he=`[data-bs-toggle="button"]`;class H extends V{static get NAME(){return`button`}toggle(){this._element.setAttribute(`aria-pressed`,this._element.classList.toggle(`active`))}static jQueryInterface(e){return this.each(function(){let t=H.getOrCreateInstance(this);e===`toggle`&&t[e]()})}}L.on(document,`click.bs.button.data-api`,he,e=>{e.preventDefault();let t=e.target.closest(he);H.getOrCreateInstance(t).toggle()}),S(H);let U={find(e,t=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(t,e))},findOne(e,t=document.documentElement){return Element.prototype.querySelector.call(t,e)},children(e,t){return[].concat(...e.children).filter(e=>e.matches(t))},parents(e,t){let n=[],r=e.parentNode.closest(t);for(;r;)n.push(r),r=r.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){let t=[`a`,`button`,`input`,`textarea`,`select`,`details`,`[tabindex]`,`[contenteditable="true"]`].map(e=>`${e}:not([tabindex^="-"])`).join(`,`);return this.find(t,e).filter(e=>!m(e)&&p(e))}},W=`.bs.swipe`,ge=`touchstart${W}`,G=`touchmove${W}`,_e=`touchend${W}`,K=`pointerdown${W}`,q=`pointerup${W}`,ve={endCallback:null,leftCallback:null,rightCallback:null},ye={endCallback:`(function|null)`,leftCallback:`(function|null)`,rightCallback:`(function|null)`};class be extends B{constructor(e,t){super(),this._element=e,!(!e||!be.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return ve}static get DefaultType(){return ye}static get NAME(){return`swipe`}dispose(){L.off(this._element,W)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),C(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){let e=Math.abs(this._deltaX);if(e<=40)return;let t=e/this._deltaX;this._deltaX=0,t&&C(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(L.on(this._element,K,e=>this._start(e)),L.on(this._element,q,e=>this._end(e)),this._element.classList.add(`pointer-event`)):(L.on(this._element,ge,e=>this._start(e)),L.on(this._element,G,e=>this._move(e)),L.on(this._element,_e,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===`pen`||e.pointerType===`touch`)}static isSupported(){return`ontouchstart`in document.documentElement||navigator.maxTouchPoints>0}}let xe=`.bs.carousel`,Se=`.data-api`,Ce=`next`,we=`prev`,J=`left`,Te=`right`,Ee=`slide${xe}`,De=`slid${xe}`,Oe=`keydown${xe}`,ke=`mouseenter${xe}`,Ae=`mouseleave${xe}`,je=`dragstart${xe}`,Me=`load${xe}${Se}`,Ne=`click${xe}${Se}`,Pe=`carousel`,Fe=`active`,Ie={ArrowLeft:Te,ArrowRight:J},Le={interval:5e3,keyboard:!0,pause:`hover`,ride:!1,touch:!0,wrap:!0},Re={interval:`(number|boolean)`,keyboard:`boolean`,pause:`(string|boolean)`,ride:`(boolean|string)`,touch:`boolean`,wrap:`boolean`};class ze extends V{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=U.findOne(`.carousel-indicators`,this._element),this._addEventListeners(),this._config.ride===Pe&&this.cycle()}static get Default(){return Le}static get DefaultType(){return Re}static get NAME(){return`carousel`}next(){this._slide(Ce)}nextWhenVisible(){!document.hidden&&p(this._element)&&this.next()}prev(){this._slide(we)}pause(){this._isSliding&&u(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){L.one(this._element,De,()=>this.cycle());return}this.cycle()}}to(e){let t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){L.one(this._element,De,()=>this.to(e));return}let n=this._getItemIndex(this._getActive());if(n===e)return;let r=e>n?Ce:we;this._slide(r,t[e])}
1dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&L.on(this._element,Oe,e=>this._keydown(e)),this._config.pause===`hover`&&(L.on(this._element,ke,()=>this.pause()),L.on(this._element,Ae,()=>this._maybeEnableCycle())),this._config.touch&&be.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(let e of U.find(`.carousel-item img`,this._element))L.on(e,je,e=>e.preventDefault());let e={leftCallback:()=>this._slide(this._directionToOrder(J)),rightCallback:()=>this._slide(this._directionToOrder(Te)),endCallback:()=>{this._config.pause===`hover`&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new be(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;let t=Ie[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;let t=U.findOne(`.active`,this._indicatorsElement);t.classList.remove(Fe),t.removeAttribute(`aria-current`);let n=U.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add(Fe),n.setAttribute(`aria-current`,`true`))}_updateInterval(){let e=this._activeElement||this._getActive();if(!e)return;let t=Number.parseInt(e.getAttribute(`data-bs-interval`),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;let n=this._getActive(),r=e===Ce,i=t||T(this._getItems(),n,r,this._config.wrap);if(i===n)return;let a=this._getItemIndex(i),o=t=>L.trigger(this._element,t,{relatedTarget:i,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:a});if(o(Ee).defaultPrevented||!n||!i)return;let s=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=i;let c=r?`carousel-item-start`:`carousel-item-end`,l=r?`carousel-item-next`:`carousel-item-prev`;i.classList.add(l),_(i),n.classList.add(c),i.classList.add(c),this._queueCallback(()=>{i.classList.remove(c,l),i.classList.add(Fe),n.classList.remove(Fe,l,c),this._isSliding=!1,o(De)},n,this._isAnimated()),s&&this.cycle()}_isAnimated(){return this._element.classList.contains(`slide`)}_getActive(){return U.findOne(`.active.carousel-item`,this._element)}_getItems(){return U.find(`.carousel-item`,this._element)}_clearInterval(){this._interval&&=(clearInterval(this._interval),null)}_directionToOrder(e){return x()?e===J?we:Ce:e===J?Ce:we}_orderToDirection(e){return x()?e===we?J:Te:e===we?Te:J}static jQueryInterface(e){return this.each(function(){let t=ze.getOrCreateInstance(this,e);if(typeof e==`number`){t.to(e);return}if(typeof e==`string`){if(t[e]===void 0||e.startsWith(`_`)||e===`constructor`)throw TypeError(`No method named "${e}"`);t[e]()}})}}L.on(document,Ne,`[data-bs-slide], [data-bs-slide-to]`,function(e){let t=c(this);if(!t||!t.classList.contains(Pe))return;e.preventDefault();let n=ze.getOrCreateInstance(t),r=this.getAttribute(`data-bs-slide-to`);if(r){n.to(r),n._maybeEnableCycle();return}if(z.getDataAttribute(this,`slide`)===`next`){n.next(),n._maybeEnableCycle();return}n.prev(),n._maybeEnableCycle()}),L.on(window,Me,()=>{let e=U.find(`[data-bs-ride="carousel"]`);for(let t of e)ze.getOrCreateInstance(t)}),S(ze);let Be=`.bs.collapse`,Ve=`show${Be}`,He=`shown${Be}`,Ue=`hide${Be}`,We=`hidden${Be}`,Ge=`click${Be}.data-api`,Ke=`show`,qe=`collapse`,Je=`collapsing`,Ye=`:scope .${qe} .${qe}`,Xe=`[data-bs-toggle="collapse"]`,Ze={parent:null,toggle:!0},Qe={parent:`(null|element)`,toggle:`boolean`};class $e extends V{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];let n=U.find(Xe);for(let e of n){let t=s(e),n=U.find(t).filter(e=>e===this._element);t!==null&&n.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Ze}static get DefaultType(){return Qe}static get NAME(){return`collapse`}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];
vendor: 1,600 bytes, line 1
1if(this._config.parent&&(e=this._getFirstLevelChildren(`.collapse.show, .collapse.collapsing`).filter(e=>e!==this._element).map(e=>$e.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning||L.trigger(this._element,Ve).defaultPrevented)return;for(let t of e)t.hide();let t=this._getDimension();this._element.classList.remove(qe),this._element.classList.add(Je),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;let n=()=>{this._isTransitioning=!1,this._element.classList.remove(Je),this._element.classList.add(qe,Ke),this._element.style[t]=``,L.trigger(this._element,He)},r=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(n,this._element,!0),this._element.style[t]=`${this._element[r]}px`}hide(){if(this._isTransitioning||!this._isShown()||L.trigger(this._element,Ue).defaultPrevented)return;let e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,_(this._element),this._element.classList.add(Je),this._element.classList.remove(qe,Ke);for(let e of this._triggerArray){let t=c(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;let t=()=>{this._isTransitioning=!1,this._element.classList.remove(Je),this._element.classList.add(qe),L.trigger(this._element,We)};this._element.style[e]=``,this._queueCallback(t,this._element,!0)}_isShown(e=this._element){return e.classList.contains(Ke)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=f(e.parent),e}_getDimension(){return this._element.classList.contains(`collapse-horizontal`)?`width`
1:`height`}_initializeChildren(){if(!this._config.parent)return;let e=this._getFirstLevelChildren(Xe);for(let t of e){let e=c(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){let t=U.find(Ye,this._config.parent);return U.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(let n of e)n.classList.toggle(`collapsed`,!t),n.setAttribute(`aria-expanded`,t)}static jQueryInterface(e){let t={};return typeof e==`string`&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){let n=$e.getOrCreateInstance(this,t);if(typeof e==`string`){if(n[e]===void 0)throw TypeError(`No method named "${e}"`);n[e]()}})}}L.on(document,Ge,Xe,function(e){(e.target.tagName===`A`||e.delegateTarget&&e.delegateTarget.tagName===`A`)&&e.preventDefault();let t=s(this),n=U.find(t);for(let e of n)$e.getOrCreateInstance(e,{toggle:!1}).toggle()}),S($e);let et=`.bs.dropdown`,tt=`.data-api`,nt=`ArrowDown`,rt=`hide${et}`,it=`hidden${et}`,at=`show${et}`,ot=`shown${et}`,st=`click${et}${tt}`,ct=`keydown${et}${tt}`,lt=`keyup${et}${tt}`,ut=`show`,dt=`[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)`,ft=`${dt}.${ut}`,pt=`.dropdown-menu`,mt=x()?`top-end`:`top-start`,ht=x()?`top-start`:`top-end`,gt=x()?`bottom-end`:`bottom-start`,_t=x()?`bottom-start`:`bottom-end`,vt=x()?`left-start`:`right-start`,yt=x()?`right-start`:`left-start`,bt={autoClose:!0,boundary:`clippingParents`,display:`dynamic`,offset:[0,2],popperConfig:null,reference:`toggle`},xt={autoClose:`(boolean|string)`,boundary:`(string|element)`,display:`string`,offset:`(array|string|function)`,popperConfig:`(null|object|function)`,reference:`(string|element|object)`};class St extends V{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=U.next(this._element,pt)[0]||U.prev(this._element,pt)[0]||U.findOne(pt,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return bt}static get DefaultType(){return xt}static get NAME(){return`dropdown`}toggle(){return this._isShown()?this.hide():this.show()}show(){if(m(this._element)||this._isShown())return;let e={relatedTarget:this._element};if(!L.trigger(this._element,at,e).defaultPrevented){if(this._createPopper(),`ontouchstart`in document.documentElement&&!this._parent.closest(`.navbar-nav`))for(let e of[].concat(...document.body.children))L.on(e,`mouseover`,g);this._element.focus(),this._element.setAttribute(`aria-expanded`,!0),this._menu.classList.add(ut),this._element.classList.add(ut),L.trigger(this._element,ot,e)}}hide(){if(m(this._element)||!this._isShown())return;let e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!L.trigger(this._element,rt,e).defaultPrevented){if(`ontouchstart`in document.documentElement)for(let e of[].concat(...document.body.children))L.off(e,`mouseover`,g);this._popper&&this._popper.destroy(),this._menu.classList.remove(ut),this._element.classList.remove(ut),this._element.setAttribute(`aria-expanded`,`false`),z.removeDataAttribute(this._menu,`popper`),L.trigger(this._element,it,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference==`object`&&!d(e.reference)&&typeof e.reference.getBoundingClientRect!=`function`)throw TypeError(`DROPDOWN: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(n===void 0)throw TypeError(`Bootstrap's dropdowns require Popper (https://popper.js.org)`);let e=this._element;this._config.reference===`parent`?e=this._parent:d(this._config.reference)?e=f(this._config.reference):typeof this._config.reference==`object`&&(e=this._config.reference);let t=this._getPopperConfig();this._popper=n.createPopper(e,this._menu,t)}_isShown(){return this._menu.classList.contains(ut)}_getPlacement(){let e=this._parent;if(e.classList.contains(`dropend`))return vt;if(e.classList.contains(`dropstart`))return yt;if(e.classList.contains(`dropup-center`))return`top`;if(e.classList.contains(`dropdown-center`))return`bottom`;let t=getComputedStyle(this._menu).getPropertyValue(`--bs-position`).trim()===`end`;return e.classList.contains(`dropup`)?t?ht:mt:t?_t:gt}_detectNavbar(){return this._element.closest(`.navbar`)!==null}_getOffset(){let{offset:e}=this._config;return typeof e==`string`?e.split(`,`).map(e=>Number.parseInt(e,10)):typeof e==`function`?t=>e(t,this._element):e}_getPopperConfig(){let e={placement:this._getPlacement(),modifiers:[{name:`preventOverflow`,options:{boundary:this._config.boun
1dary}},{name:`offset`,options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display===`static`)&&(z.setDataAttribute(this._menu,`popper`,`static`),e.modifiers=[{name:`applyStyles`,enabled:!1}]),{...e,...typeof this._config.popperConfig==`function`?this._config.popperConfig(e):this._config.popperConfig}}_selectMenuItem({key:e,target:t}){let n=U.find(`.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)`,this._menu).filter(e=>p(e));n.length&&T(n,t,e===nt,!n.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){let t=St.getOrCreateInstance(this,e);if(typeof e==`string`){if(t[e]===void 0)throw TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===2||e.type===`keyup`&&e.key!==`Tab`)return;let t=U.find(ft);for(let n of t){let t=St.getInstance(n);if(!t||t._config.autoClose===!1)continue;let r=e.composedPath(),i=r.includes(t._menu);if(r.includes(t._element)||t._config.autoClose===`inside`&&!i||t._config.autoClose===`outside`&&i||t._menu.contains(e.target)&&(e.type===`keyup`&&e.key===`Tab`||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;let a={relatedTarget:t._element};e.type===`click`&&(a.clickEvent=e),t._completeHide(a)}}static dataApiKeydownHandler(e){let t=/input|textarea/i.test(e.target.tagName),n=e.key===`Escape`,r=[`ArrowUp`,nt].includes(e.key);if(!r&&!n||t&&!n)return;e.preventDefault();let i=this.matches(dt)?this:U.prev(this,dt)[0]||U.next(this,dt)[0]||U.findOne(dt,e.delegateTarget.parentNode),a=St.getOrCreateInstance(i);if(r){e.stopPropagation(),a.show(),a._selectMenuItem(e);return}a._isShown()&&(e.stopPropagation(),a.hide(),i.focus())}}L.on(document,ct,dt,St.dataApiKeydownHandler),L.on(document,ct,pt,St.dataApiKeydownHandler),L.on(document,st,St.clearMenus),L.on(document,lt,St.clearMenus),L.on(document,st,dt,function(e){e.preventDefault(),St.getOrCreateInstance(this).toggle()}),S(St);let Ct=`.fixed-top, .fixed-bottom, .is-fixed, .sticky-top`,wt=`.sticky-top`,Tt=`padding-right`,Et=`margin-right`;class Dt{constructor(){this._element=document.body}getWidth(){let e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){let e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Tt,t=>t+e),this._setElementAttributes(Ct,Tt,t=>t+e),this._setElementAttributes(wt,Et,t=>t-e)}reset(){this._resetElementAttributes(this._element,`overflow`),this._resetElementAttributes(this._element,Tt),this._resetElementAttributes(Ct,Tt),this._resetElementAttributes(wt,Et)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,`overflow`),this._element.style.overflow=`hidden`}_setElementAttributes(e,t,n){let r=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+r)return;this._saveInitialAttribute(e,t);let i=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${n(Number.parseFloat(i))}px`)})}_saveInitialAttribute(e,t){let n=e.style.getPropertyValue(t);n&&z.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{let n=z.getDataAttribute(e,t);if(n===null){e.style.removeProperty(t);return}z.removeDataAttribute(e,t),e.style.setProperty(t,n)})}_applyManipulationCallback(e,t){if(d(e)){t(e);return}for(let n of U.find(e,this._element))t(n)}}let Ot=`backdrop`,kt=`show`,At=`mousedown.bs.${Ot}`,jt={className:`modal-backdrop`,clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:`body`},Mt={className:`string`,clickCallback:`(function|null)`,isAnimated:`boolean`,isVisible:`boolean`,rootElement:`(element|string)`};class Nt extends B{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return jt}static get DefaultType(){return Mt}static get NAME(){return Ot}show(e){if(!this._config.isVisible){C(e);return}this._append();let t=this._getElement();this._config.isAnimated&&_(t),t.classList.add(kt),this._emulateAnimation(()=>{C(e)})}hide(e){if(!this._config.isVisible){C(e);return}this._getElement().classList.remove(kt),this._emulateAnimation(()=>{this.dispose(),C(e)})}dispose(){this._isAppended&&=(L.off(this._element,At),this._element.remove(),!1)}_getElement(){if(!this._element){let e=document.createElement(`div`);e.className=this._config.className,this._config.isAnimated&&e.classList.add(`fade`),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=f(e.rootElement),e}_append(){if(this._isAppended)return;let e=this._getElement();this._config.rootElement.append(e),L.on(e,At,()=>{C(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){w(e,this._getElement(),this._config.isAnimated)}}let Pt=`.bs.focustrap`,Ft=`focusin${Pt}`,It=`keydown.tab${Pt}`,Lt=`backward`,Rt={autofocus:!0,trapElement:null},zt={autofocus:`boolean`,trapElement:`element`};class Bt extends B{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Rt}static get DefaultType(){return zt}
1static get NAME(){return`focustrap`}activate(){this._isActive||=(this._config.autofocus&&this._config.trapElement.focus(),L.off(document,Pt),L.on(document,Ft,e=>this._handleFocusin(e)),L.on(document,It,e=>this._handleKeydown(e)),!0)}deactivate(){this._isActive&&(this._isActive=!1,L.off(document,Pt))}_handleFocusin(e){let{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;let n=U.focusableChildren(t);n.length===0?t.focus():this._lastTabNavDirection===Lt?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){e.key===`Tab`&&(this._lastTabNavDirection=e.shiftKey?Lt:`forward`)}}let Vt=`.bs.modal`,Ht=`hide${Vt}`,Ut=`hidePrevented${Vt}`,Wt=`hidden${Vt}`,Gt=`show${Vt}`,Kt=`shown${Vt}`,qt=`resize${Vt}`,Jt=`click.dismiss${Vt}`,Yt=`mousedown.dismiss${Vt}`,Xt=`keydown.dismiss${Vt}`,Zt=`click${Vt}.data-api`,Qt=`modal-open`,$t=`show`,en=`modal-static`,tn={backdrop:!0,focus:!0,keyboard:!0},nn={backdrop:`(boolean|string)`,focus:`boolean`,keyboard:`boolean`};class rn extends V{constructor(e,t){super(e,t),this._dialog=U.findOne(`.modal-dialog`,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Dt,this._addEventListeners()}static get Default(){return tn}static get DefaultType(){return nn}static get NAME(){return`modal`}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||L.trigger(this._element,Gt,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Qt),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||L.trigger(this._element,Ht).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove($t),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){for(let e of[window,this._dialog])L.off(e,Vt);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Nt({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Bt({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display=`block`,this._element.removeAttribute(`aria-hidden`),this._element.setAttribute(`aria-modal`,!0),this._element.setAttribute(`role`,`dialog`),this._element.scrollTop=0;let t=U.findOne(`.modal-body`,this._dialog);t&&(t.scrollTop=0),_(this._element),this._element.classList.add($t),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,L.trigger(this._element,Kt,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){L.on(this._element,Xt,e=>{if(e.key===`Escape`){if(this._config.keyboard){e.preventDefault(),this.hide();return}this._triggerBackdropTransition()}}),L.on(window,qt,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),L.on(this._element,Yt,e=>{L.one(this._element,Jt,t=>{if(this._element===e.target&&this._element===t.target){if(this._config.backdrop===`static`){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display=`none`,this._element.setAttribute(`aria-hidden`,!0),this._element.removeAttribute(`aria-modal`),this._element.removeAttribute(`role`),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Qt),this._resetAdjustments(),this._scrollBar.reset(),L.trigger(this._element,Wt)})}_isAnimated(){return this._element.classList.contains(`fade`)}_triggerBackdropTransition(){if(L.trigger(this._element,Ut).defaultPrevented)return;let e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;t===`hidden`||this._element.classList.contains(en)||(e||(this._element.style.overflowY=`hidden`),this._element.classList.add(en),this._queueCallback(()=>{this._element.classList.remove(en),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){let e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;
1if(n&&!e){let e=x()?`paddingLeft`:`paddingRight`;this._element.style[e]=`${t}px`}if(!n&&e){let e=x()?`paddingRight`:`paddingLeft`;this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft=``,this._element.style.paddingRight=``}static jQueryInterface(e,t){return this.each(function(){let n=rn.getOrCreateInstance(this,e);if(typeof e==`string`){if(n[e]===void 0)throw TypeError(`No method named "${e}"`);n[e](t)}})}}L.on(document,Zt,`[data-bs-toggle="modal"]`,function(e){let t=c(this);[`A`,`AREA`].includes(this.tagName)&&e.preventDefault(),L.one(t,Gt,e=>{e.defaultPrevented||L.one(t,Wt,()=>{p(this)&&this.focus()})});let n=U.findOne(`.modal.show`);n&&rn.getInstance(n).hide(),rn.getOrCreateInstance(t).toggle(this)}),ue(rn),S(rn);let an=`.bs.offcanvas`,on=`.data-api`,sn=`load${an}${on}`,cn=`show`,ln=`showing`,un=`hiding`,dn=`.offcanvas.show`,fn=`show${an}`,pn=`shown${an}`,mn=`hide${an}`,hn=`hidePrevented${an}`,gn=`hidden${an}`,_n=`resize${an}`,vn=`click${an}${on}`,yn=`keydown.dismiss${an}`,bn={backdrop:!0,keyboard:!0,scroll:!1},xn={backdrop:`(boolean|string)`,keyboard:`boolean`,scroll:`boolean`};class Sn extends V{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return bn}static get DefaultType(){return xn}static get NAME(){return`offcanvas`}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||L.trigger(this._element,fn,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||new Dt().hide(),this._element.setAttribute(`aria-modal`,!0),this._element.setAttribute(`role`,`dialog`),this._element.classList.add(ln),this._queueCallback(()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(cn),this._element.classList.remove(ln),L.trigger(this._element,pn,{relatedTarget:e})},this._element,!0))}hide(){!this._isShown||L.trigger(this._element,mn).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(un),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(cn,un),this._element.removeAttribute(`aria-modal`),this._element.removeAttribute(`role`),this._config.scroll||new Dt().reset(),L.trigger(this._element,gn)},this._element,!0))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){let e=()=>{if(this._config.backdrop===`static`){L.trigger(this._element,hn);return}this.hide()},t=!!this._config.backdrop;return new Nt({className:`offcanvas-backdrop`,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new Bt({trapElement:this._element})}_addEventListeners(){L.on(this._element,yn,e=>{if(e.key===`Escape`){if(!this._config.keyboard){L.trigger(this._element,hn);return}this.hide()}})}static jQueryInterface(e){return this.each(function(){let t=Sn.getOrCreateInstance(this,e);if(typeof e==`string`){if(t[e]===void 0||e.startsWith(`_`)||e===`constructor`)throw TypeError(`No method named "${e}"`);t[e](this)}})}}L.on(document,vn,`[data-bs-toggle="offcanvas"]`,function(e){let t=c(this);if([`A`,`AREA`].includes(this.tagName)&&e.preventDefault(),m(this))return;L.one(t,gn,()=>{p(this)&&this.focus()});let n=U.findOne(dn);n&&n!==t&&Sn.getInstance(n).hide(),Sn.getOrCreateInstance(t).toggle(this)}),L.on(window,sn,()=>{for(let e of U.find(dn))Sn.getOrCreateInstance(e).show()}),L.on(window,_n,()=>{for(let e of U.find(`[aria-modal][class*=show][class*=offcanvas-]`))getComputedStyle(e).position!==`fixed`&&Sn.getOrCreateInstance(e).hide()}),ue(Sn),S(Sn);let Cn=new Set([`background`,`cite`,`href`,`itemtype`,`longdesc`,`poster`,`src`,`xlink:href`]),wn=/^aria-[\w-]*$/i,Tn=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i,En=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i,Dn=(e,t)=>{let n=e.nodeName.toLowerCase();return t.includes(n)?!Cn.has(n)||!!(Tn.test(e.nodeValue)||En.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))},On={"*":[`class`,`dir`,`id`,`lang`,`role`,wn],a:[`target`,`href`,`title`,`rel`],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:[`src`,`srcset`,`alt`,`title`,`width`,`height`],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]};function kn(e,t,n){if(!e.length)return e;if(n&&typeof n==`function`)return n(e);let r=new window.DOMParser().parseFromString(e,`text/html`),i=[].concat(...r.body.querySelectorAll(`*`));for(let e of i){let n=e.nodeName.toLowerCase();if(!Object.keys(t).includes(n)){e.remove();continue}let r=[].concat(...e.attributes),i=[].concat(t[`*`]||[],t[n]||[]);for(let t of r)Dn(t,i)||e.removeAttribute(t.nodeName)}return r.body.innerHTML}let An={allowList:On,content:{},extraClass:``,html:!1,sanitize:!0,sanitizeFn:null,template:`<div></div>`},jn={allowList:`object`,content:`object`,extraClass:`(string|function)`,html:`boolean`,sanitize:`boolean`,sanitizeFn:`(null|function)`,template:`string`},Mn={entry:`(string|element|function|null)`,selector:`(string|element)`};class Nn extends B{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return An}static get DefaultType(){return jn}static get NAME(){return`TemplateFactory`}getContent(){return Object.values(this._config.content).map(e=>
1this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){let e=document.createElement(`div`);e.innerHTML=this._maybeSanitize(this._config.template);for(let[t,n]of Object.entries(this._config.content))this._setContent(e,n,t);let t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(` `)),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(let[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},Mn)}_setContent(e,t,n){let r=U.findOne(n,e);if(r){if(t=this._resolvePossibleFunction(t),!t){r.remove();return}if(d(t)){this._putElementInTemplate(f(t),r);return}if(this._config.html){r.innerHTML=this._maybeSanitize(t);return}r.textContent=t}}_maybeSanitize(e){return this._config.sanitize?kn(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return typeof e==`function`?e(this):e}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML=``,t.append(e);return}t.textContent=e.textContent}}let Pn=new Set([`sanitize`,`allowList`,`sanitizeFn`]),Fn=`fade`,In=`show`,Ln=`.modal`,Rn=`hide.bs.modal`,zn=`hover`,Bn=`focus`,Vn={AUTO:`auto`,TOP:`top`,RIGHT:x()?`left`:`right`,BOTTOM:`bottom`,LEFT:x()?`right`:`left`},Hn={allowList:On,animation:!0,boundary:`clippingParents`,container:!1,customClass:``,delay:0,fallbackPlacements:[`top`,`right`,`bottom`,`left`],html:!1,offset:[0,0],placement:`top`,popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:`<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>`,title:``,trigger:`hover focus`},Un={allowList:`object`,animation:`boolean`,boundary:`(string|element)`,container:`(string|element|boolean)`,customClass:`(string|function)`,delay:`(number|object)`,fallbackPlacements:`array`,html:`boolean`,offset:`(array|string|function)`,placement:`(string|function)`,popperConfig:`(null|object|function)`,sanitize:`boolean`,sanitizeFn:`(null|function)`,selector:`(string|boolean)`,template:`string`,title:`(string|element|function)`,trigger:`string`};class Wn extends V{constructor(e,t){if(n===void 0)throw TypeError(`Bootstrap's tooltips require Popper (https://popper.js.org)`);super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Hn}static get DefaultType(){return Un}static get NAME(){return`tooltip`}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),L.off(this._element.closest(Ln),Rn,this._hideModalHandler),this.tip&&this.tip.remove(),this._element.getAttribute(`data-bs-original-title`)&&this._element.setAttribute(`title`,this._element.getAttribute(`data-bs-original-title`)),this._disposePopper(),super.dispose()}show(){if(this._element.style.display===`none`)throw Error(`Please use show on visible elements`);if(!(this._isWithContent()&&this._isEnabled))return;let e=L.trigger(this._element,this.constructor.eventName(`show`)),t=(h(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this.tip&&=(this.tip.remove(),null);let n=this._getTipElement();this._element.setAttribute(`aria-describedby`,n.getAttribute(`id`));let{container:r}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(n),L.trigger(this._element,this.constructor.eventName(`inserted`))),this._popper?this._popper.update():this._popper=this._createPopper(n),n.classList.add(In),`ontouchstart`in document.documentElement)for(let e of[].concat(...document.body.children))L.on(e,`mouseover`,g);this._queueCallback(()=>{L.trigger(this._element,this.constructor.eventName(`shown`)),this._isHovered===!1&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}
1hide(){if(!this._isShown()||L.trigger(this._element,this.constructor.eventName(`hide`)).defaultPrevented)return;let e=this._getTipElement();if(e.classList.remove(In),`ontouchstart`in document.documentElement)for(let e of[].concat(...document.body.children))L.off(e,`mouseover`,g);this._activeTrigger.click=!1,this._activeTrigger[Bn]=!1,this._activeTrigger[zn]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||e.remove(),this._element.removeAttribute(`aria-describedby`),L.trigger(this._element,this.constructor.eventName(`hidden`)),this._disposePopper())},this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||=this._createTipElement(this._newContent||this._getContentForTemplate()),this.tip}_createTipElement(e){let t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Fn,In),t.classList.add(`bs-${this.constructor.NAME}-auto`);let n=a(this.constructor.NAME).toString();return t.setAttribute(`id`,n),this._isAnimated()&&t.classList.add(Fn),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Nn({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute(`data-bs-original-title`)}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Fn)}_isShown(){return this.tip&&this.tip.classList.contains(In)}_createPopper(e){let t=typeof this._config.placement==`function`?this._config.placement.call(this,e,this._element):this._config.placement,r=Vn[t.toUpperCase()];return n.createPopper(this._element,e,this._getPopperConfig(r))}_getOffset(){let{offset:e}=this._config;return typeof e==`string`?e.split(`,`).map(e=>Number.parseInt(e,10)):typeof e==`function`?t=>e(t,this._element):e}_resolvePossibleFunction(e){return typeof e==`function`?e.call(this._element):e}_getPopperConfig(e){let t={placement:e,modifiers:[{name:`flip`,options:{fallbackPlacements:this._config.fallbackPlacements}},{name:`offset`,options:{offset:this._getOffset()}},{name:`preventOverflow`,options:{boundary:this._config.boundary}},{name:`arrow`,options:{element:`.${this.constructor.NAME}-arrow`}},{name:`preSetPlacement`,enabled:!0,phase:`beforeMain`,fn:e=>{this._getTipElement().setAttribute(`data-popper-placement`,e.state.placement)}}]};return{...t,...typeof this._config.popperConfig==`function`?this._config.popperConfig(t):this._config.popperConfig}}_setListeners(){let e=this._config.trigger.split(` `);for(let t of e)if(t===`click`)L.on(this._element,this.constructor.eventName(`click`),this._config.selector,e=>{this._initializeOnDelegatedTarget(e).toggle()});else if(t!==`manual`){let e=t===zn?this.constructor.eventName(`mouseenter`):this.constructor.eventName(`focusin`),n=t===zn?this.constructor.eventName(`mouseleave`):this.constructor.eventName(`focusout`);L.on(this._element,e,this._config.selector,e=>{let t=this._initializeOnDelegatedTarget(e);t._activeTrigger[e.type===`focusin`?Bn:zn]=!0,t._enter()}),L.on(this._element,n,this._config.selector,e=>{let t=this._initializeOnDelegatedTarget(e);t._activeTrigger[e.type===`focusout`?Bn:zn]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},L.on(this._element.closest(Ln),Rn,this._hideModalHandler)}_fixTitle(){let e=this._element.getAttribute(`title`);e&&(!this._element.getAttribute(`aria-label`)&&!this._element.textContent.trim()&&this._element.setAttribute(`aria-label`,e),this._element.setAttribute(`data-bs-original-title`,e),this._element.removeAttribute(`title`))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){let t=z.getDataAttributes(this._element);for(let e of Object.keys(t))Pn.has(e)&&delete t[e];return e={...t,...typeof e==`object`&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:f(e.container),typeof e.delay==`number`&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title==`number`&&(e.title=e.title.toString()),typeof e.content==`number`&&(e.content=e.content.toString()),e}_getDelegateConfig(){let e={};for(let t in this._config)this.constructor.Default[t]!==this._config[t]&&(e[t]=this._config[t]);return e.selector=!1,e.trigger=`manual`,e}_disposePopper(){this._popper&&=(this._popper.destroy(),null)}static jQueryInterface(e){return this.each(function(){let t=Wn.getOrCreateInstance(this,e);if(typeof e==`string`){if(t[e]===void 0)throw TypeError(`No method n
1amed "${e}"`);t[e]()}})}}S(Wn);let Gn={...Wn.Default,content:``,offset:[0,8],placement:`right`,template:`<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>`,trigger:`click`},Kn={...Wn.DefaultType,content:`(null|string|element|function)`};class qn extends Wn{static get Default(){return Gn}static get DefaultType(){return Kn}static get NAME(){return`popover`}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){let t=qn.getOrCreateInstance(this,e);if(typeof e==`string`){if(t[e]===void 0)throw TypeError(`No method named "${e}"`);t[e]()}})}}S(qn);let Jn=`.bs.scrollspy`,Yn=`activate${Jn}`,Xn=`click${Jn}`,Zn=`load${Jn}.data-api`,Qn=`active`,$n=`[href]`,er=`.nav-link`,tr=`${er}, .nav-item > ${er}, .list-group-item`,nr={offset:null,rootMargin:`0px 0px -25%`,smoothScroll:!1,target:null,threshold:[.1,.5,1]},rr={offset:`(number|null)`,rootMargin:`string`,smoothScroll:`boolean`,target:`element`,threshold:`array`};class ir extends V{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY===`visible`?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return nr}static get DefaultType(){return rr}static get NAME(){return`scrollspy`}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(let e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=f(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold==`string`&&(e.threshold=e.threshold.split(`,`).map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(L.off(this._config.target,Xn),L.on(this._config.target,Xn,$n,e=>{let t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();let n=this._rootElement||window,r=t.offsetTop-this._element.offsetTop;if(n.scrollTo){n.scrollTo({top:r,behavior:`smooth`});return}n.scrollTop=r}}))}_getNewObserver(){let e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){let t=e=>this._targetLinks.get(`#${e.target.id}`),n=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},r=(this._rootElement||document.documentElement).scrollTop,i=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;for(let a of e){if(!a.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(a));continue}let e=a.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(i&&e){if(n(a),!r)return;continue}!i&&!e&&n(a)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;let e=U.find($n,this._config.target);for(let t of e){if(!t.hash||m(t))continue;let e=U.findOne(t.hash,this._element);p(e)&&(this._targetLinks.set(t.hash,t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Qn),this._activateParents(e),L.trigger(this._element,Yn,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(`dropdown-item`)){U.findOne(`.dropdown-toggle`,e.closest(`.dropdown`)).classList.add(Qn);return}for(let t of U.parents(e,`.nav, .list-group`))for(let e of U.prev(t,tr))e.classList.add(Qn)}_clearActiveClass(e){e.classList.remove(Qn);let t=U.find(`${$n}.${Qn}`,e);for(let e of t)e.classList.remove(Qn)}static jQueryInterface(e){return this.each(function(){let t=ir.getOrCreateInstance(this,e);if(typeof e==`string`){if(t[e]===void 0||e.startsWith(`_`)||e===`constructor`)throw TypeError(`No method n
1amed "${e}"`);t[e]()}})}}L.on(window,Zn,()=>{for(let e of U.find(`[data-bs-spy="scroll"]`))ir.getOrCreateInstance(e)}),S(ir);let ar=`.bs.tab`,or=`hide${ar}`,sr=`hidden${ar}`,cr=`show${ar}`,lr=`shown${ar}`,ur=`click${ar}`,dr=`keydown${ar}`,fr=`load${ar}`,pr=`ArrowRight`,mr=`ArrowDown`,hr=`active`,gr=`fade`,_r=`show`,vr=`:not(.dropdown-toggle)`,yr=`.nav-link${vr}, .list-group-item${vr}, [role="tab"]${vr}`,br=`[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]`,xr=`${yr}, ${br}`,Sr=`.${hr}[data-bs-toggle="tab"], .${hr}[data-bs-toggle="pill"], .${hr}[data-bs-toggle="list"]`;class Cr extends V{constructor(e){super(e),this._parent=this._element.closest(`.list-group, .nav, [role="tablist"]`),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),L.on(this._element,dr,e=>this._keydown(e)))}static get NAME(){return`tab`}show(){let e=this._element;if(this._elemIsActive(e))return;let t=this._getActiveElem(),n=t?L.trigger(t,or,{relatedTarget:e}):null;L.trigger(e,cr,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){e&&(e.classList.add(hr),this._activate(c(e)),this._queueCallback(()=>{if(e.getAttribute(`role`)!==`tab`){e.classList.add(_r);return}e.removeAttribute(`tabindex`),e.setAttribute(`aria-selected`,!0),this._toggleDropDown(e,!0),L.trigger(e,lr,{relatedTarget:t})},e,e.classList.contains(gr)))}_deactivate(e,t){e&&(e.classList.remove(hr),e.blur(),this._deactivate(c(e)),this._queueCallback(()=>{if(e.getAttribute(`role`)!==`tab`){e.classList.remove(_r);return}e.setAttribute(`aria-selected`,!1),e.setAttribute(`tabindex`,`-1`),this._toggleDropDown(e,!1),L.trigger(e,sr,{relatedTarget:t})},e,e.classList.contains(gr)))}_keydown(e){if(![`ArrowLeft`,pr,`ArrowUp`,mr].includes(e.key))return;e.stopPropagation(),e.preventDefault();let t=[pr,mr].includes(e.key),n=T(this._getChildren().filter(e=>!m(e)),e.target,t,!0);n&&(n.focus({preventScroll:!0}),Cr.getOrCreateInstance(n).show())}_getChildren(){return U.find(xr,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,`role`,`tablist`);for(let e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);let t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute(`aria-selected`,t),n!==e&&this._setAttributeIfNotExists(n,`role`,`presentation`),t||e.setAttribute(`tabindex`,`-1`),this._setAttributeIfNotExists(e,`role`,`tab`),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){let t=c(e);t&&(this._setAttributeIfNotExists(t,`role`,`tabpanel`),e.id&&this._setAttributeIfNotExists(t,`aria-labelledby`,`#${e.id}`))}_toggleDropDown(e,t){let n=this._getOuterElement(e);if(!n.classList.contains(`dropdown`))return;let r=(e,r)=>{let i=U.findOne(e,n);i&&i.classList.toggle(r,t)};r(`.dropdown-toggle`,hr),r(`.dropdown-menu`,_r),n.setAttribute(`aria-expanded`,t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(hr)}_getInnerElement(e){return e.matches(xr)?e:U.findOne(xr,e)}_getOuterElement(e){return e.closest(`.nav-item, .list-group-item`)||e}static jQueryInterface(e){return this.each(function(){let t=Cr.getOrCreateInstance(this);if(typeof e==`string`){if(t[e]===void 0||e.startsWith(`_`)||e===`constructor`)throw TypeError(`No method named "${e}"`);t[e]()}})}}L.on(document,ur,br,function(e){[`A`,`AREA`].includes(this.tagName)&&e.preventDefault(),!m(this)&&Cr.getOrCreateInstance(this).show()}),L.on(window,fr,()=>{for(let e of U.find(Sr))Cr.getOrCreateInstance(e)}),S(Cr);let wr=`.bs.toast`,Tr=`mouseover${wr}`,Er=`mouseout${wr}`,Dr=`focusin${wr}`,Or=`focusout${wr}`,kr=`hide${wr}`,Ar=`hidden${wr}`,jr=`show${wr}`,Mr=`shown${wr}`,Nr=`hide`,Pr=`show`,Fr=`showing`,Ir={animation:`boolean`,autohide:`boolean`,delay:`number`},Lr={animation:!0,autohide:!0,delay:5e3};class Rr extends V{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Lr}static get DefaultType(){return Ir}static get NAME(){return`toast`}show(){L.trigger(this._element,jr).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add(`fade`),this._element.classList.remove(Nr),_(this._element),this._element.classList.add(Pr,Fr),this._queueCallback(()=>{this._element.classList.remove(Fr),L.trigger(this._element,Mr),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){!this.isShown()||L.trigger(this._element,kr).defaultPrevented||(this._element.classList.add(Fr),this._queueCallback(()=>{this._element.classList.add(Nr),this._element.classList.remove(Fr,Pr),L.trigger(this._element,Ar)},this._element,this._config.animation))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Pr),super.dispose()}isShown(){return this._element.classList.contains(Pr)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case`mouseover`:case`mouseout`:this._hasMouseInteraction=t;break;case`focusin`:case`focusout`:this._hasKeyboardInteraction=t}if(t){this._clearTimeout();return}let n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){L.on(this._element,Tr,e=>this._onInteraction(e,!0)),L.on(this._element,Er,e=>this._onInteraction(e,!1)),L.on(this._element,Dr,e=>this._onInteraction(e,!0)),L.on(this._element,Or,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){let t=Rr.getOrCreateInstance(this,e);if(typeof e==`string`){if(t[e]===void 0)throw TypeError(`No method n
1amed "${e}"`);t[e](this)}})}}return ue(Rr),S(Rr),{Alert:me,Button:H,Carousel:ze,Collapse:$e,Dropdown:St,Modal:rn,Offcanvas:Sn,Popover:qn,ScrollSpy:ir,Tab:Cr,Toast:Rr,Tooltip:Wn}}))})),Wn,Gn=i((()=>{Wn={temp:{ua:`температура`,en:`temperature`,ru:`температура`},wind:{ua:`швидкість вітру`,en:`speed of wind`,ru:`скорость ветра`},"main-page":{ua:`Головна`,en:`Main`,ru:`Главная`},"my-services":{ua:`Мої послуги`,en:`My services`,ru:`Мои услуги`},prices:{ua:`Ціни`,en:`Prices`,ru:`Цены`},"how-get":{ua:`Як пройти`,en:`How to get`,ru:`Как пройти`},portfolio:{ua:`Портфоліо`,en:`Portfolio`,ru:`Портфолио`},"comp-services-title":{ua:`Компьютерні послуги в місті Полтава`,en:`Computers services in Poltava city`,ru:`Компьютерные услуги в городе Полтава`},"main-info":{ua:`Потрібна компьютерна допомога? Можу Вам допомогти з заміною комплектуючих до вашого ПК, ремонтом та встановленням програм. Перед початком роботи зроблю діагностування та скажу приблизну вартість робіт.`,en:`Need computer help? I can help You with the replacement of components for your PC, repair and installation of programs. Repair without deception, I will tell you the approximate cost of the work before starting work.`,ru:`Нужна компьютерная помощь? Могу Вам помочь с заменой комплектующих к вашему ПК, ремонтом и установкой программ. Перед началом работы диагностирую неисправность и скажу приблизительную стоимость работ.`},"services-title":{ua:`«Мої послуги»`,en:`«My Services»`,ru:`«Мои Услуги»`},"clean-dust":{ua:`Чистка від пилу`,en:`Dust cleaning`,ru:`Чистка от пыли`},"list1-item1":{ua:`Зменшуе нагрівання компонентів`,en:`Reduces heating of components`,ru:`Уменьшает нагрев компонентов`},"list1-item2":{ua:`Збільшуе довговічнсть компонентів`,en:`Increases the durability of components`,ru:`Увеличивает долговечность компонентов`},"list1-item3":{ua:`Змазка кулерів`,en:`Lubrication of coolers`,ru:`Смазка кулеров`},"list2-title":{ua:`Встановлення програм`,en:`Installing programs`,ru:`Установка программ`},"list2-item1":{ua:`Програмне налаштування`,en:`Software setting`,ru:`Программная настройка`}
1,"list2-item2":{ua:`Чистка системного сміття`,en:`Cleaning system garbage`,ru:`Чистка системного мусора`},"list2-item3":{ua:`Встановлення Віндовс та інших програм`,en:`Installing Windows and other programs`,ru:`Установка Виндовс и других программ`},"list2-item4":{ua:`Встановлення драйверів`,en:`Installing drivers`,ru:`Установка драйверов`},"list3-title":{ua:`Заміна деталей ПК`,en:`Replacement of PC parts`,ru:`Замена деталей ПК`},"list3-item1":{ua:`Консультую при придбанні ПК`,en:`I advise when purchasing a PC`,ru:`Консультирую при приобретении ПК`},"list3-item2":{ua:`Підбір комплектуючих`,en:`Selection of components`,ru:`Подбор комплектующих`},"list3-item3":{ua:`Тюнінг ПК`,en:`PC tuning`,ru:`Тюнинг ПК`},"list3-item4":{ua:`Встановлення мережевих плат`,en:`Installation of network cards`,ru:`Установка сетевых плат`},"list3-item5":{ua:`Налаштування роутера`,en:`Router settings`,ru:`Настройка роутера`},"main-portfolio-title":{ua:`«Також надаю послуги з розробки сайтів»`,en:`«I also provide website development services»`,ru:`«Также предоставляю услуги по разработке сайтов»`},"portfolio-card-title":{ua:`Розробка сайтів та Веб додатків`,en:`Website and Web Application Development`,ru:`Создание сайтов и Веб приложений`},"card-description":{ua:`Використовую Html, Css, Wordpress, React, Cordova`,en:`I use Html, Css, Wordpress, React, Cordova`,ru:`Использую Html, Css, Wordpress, React, Cordova`},"portfolio-card-link":{ua:`Дивитись Портфоліо`,en:`View Portfolio`,ru:`Смотреть Портфолио`},"price-title":{ua:`«Ціни»`,en:`«Prices»`,ru:`«Цены»`},"price-description":{ua:`Ціни на свої послуги повідомлю вам після діагностування проблеми з вашим обладнанням`,en:`I will inform you of the prices for my services after diagnosing the problem with your equipment`,ru:`Цены на свои услуги сообщу вам после диагностики проблемы с вашим оборудованием`},"how-to-get":{ua:`«Як добратися»`,en:`«How to get»`,ru:`«Как добраться»`},adress:{ua:`пров.Паскаля б.10`,en:`10 Paskalya ave`,ru:`пер.Паскаля б.10`},"footer-slogan1":{ua:`Завжди`,en:`Always`,ru:`Всегда`},"footer-slogan2":{ua:`радий`,en:`glad`,ru:`рад`},"footer-slogan3":{ua:`Вас бачити`,en:`To see you`,ru:`Вас видеть`},copyright:{ua:`Сайт зроблено в 2022`,en:`The site was created in 2022`,ru:`Сайт сделан в 2022`},"portflio-title":{ua:`МОЇ РОБОТИ`,en:`MY WORKS`,ru:`МОИ РАБОТЫ`}
1,"portfolio-subtitle":{ua:`Сайти та проєкти або програми створенні мною`,en:`Sites and projects or programs created by me`,ru:`Сайты и проекты или программы, созданные мной`},"button-title":{ua:`ПОДИВИТИСЬ`,en:`LOOK`,ru:`ПОСМОТРЕТЬ`},"card-title":{ua:[`Сайт майстрів з будівництва покрівель та дахів`,`Додаток "Список Завдань"`,`Мобільний додаток КріптоІнфо`,`Веб-додаток ТаймерБокс`,`Сайт Компьютерного Майстра`,`Веб додаток "Піцца"`,`Веб додаток "Бургери"`],en:[`Site of roofing and roof construction masters`,`App "List of Tasks"`,`"CryptoInfo" mobile application`,`"TimerBox" web application`,`The site of the Computer Master`,'"Pizza`s" web application',`"Burgers" web application`],ru:[`Сайт мастеров по строительству кровель и крыш`,`Приложение "Список задач"`,`Мобильное приложение КриптоИнфо`,`Веб-додаток ТаймерБокс`,`Сайт Компьютерного Мастера`,`Веб приложение Пицца`,`Веб приложение Бургеры`]},"roof-title":{ua:`Сайт майстрів з будівництва та ремонту покрівель та стель`,en:`Site of masters in construction and repair of roofs and ceilings`,ru:`Сайт мастеров по строительству и ремонту кровель и потолков`},"lng-roof-one":{ua:`Сайт зроблено на CMS WordPress, плата за хостинг в місяць 140 грн, доменне ім'я на рік 200грн з автопродовженням по 200 грн на рік.`,en:`The site is made on CMS WordPress, the monthly hosting fee is 140 UAH, domain name per year UAH 200 with automatic renewal for UAH 200 per year.`,ru:`Сайт сделан на CMS WordPress, плата за хостинг в месяц 140 грн, доменное имя в год 200грн с автопродолжением по 200 грн на год.`},"lng-roof-two":{ua:`Всі тексти та зображення на сайті замовник може міняти сам.`,en:`All texts and images on the site can be changed by the customer himself.`,ru:`Все тексты и изображения на сайте клиент может менять сам.`},"lng-roof-three":{ua:`Всі тексти та зображення на сайті замовник може міняти сам.`,en:`The site is responsive and displays on tablets and smartphones.`,ru:`Сайт адаптивен и отображается на планшетах и смартфонах.`},"lng-roof-four":{ua:`На сайті є галерея виконаних робіт та відгуки замовників.`,en:`The site has a gallery of completed works and customer reviews.`,ru:`На сайте есть галерея выполненных работ и отзывы заказчиков.`},"lng-roof-five":{ua:`Є форма зворотнього зв’язку,де користувач сайту може надіслати своє питання натиснувши на кнопку “ЗАДАТИ ПИТАННЯ” і воно з електронною поштою користувача надсилаєтся на пошту власника сайту чи адміністратора. `,en:`There is a feedback form, where the site user can send his question by clicking on the "ASK A QUESTION" button, and it is sent to the site owner's or administrator's mail with the user's e-mail.`,ru:`Есть форма обратной связи, где пользователь сайта может отправить свой вопрос нажав кнопку “ЗАДАТЬ ВОПРОС” и он с электронной почтой пользователя отправляется на почту владельца сайта или администратора.`},"return-to-portfolio":{ua:`Повернутися до Портфоліо`,en:`Return to Portfolio`,ru:`Вернуться в Портфолио`},"timerbox-title":{ua:`Вєб додаток ТаймерБокс`,en:`Timer Box web application`,ru:`Веб приложение Таймер Бокс`},"lng-timerbox-one":{ua:`Вєб додаток зроблено з використанням Html,Css та React.`,en:`The web application is made using Html, CSS and React.`,ru:`Веб-приложение сделано с использованием Html,Css и React.`},"lng-timerbox-two":{ua:`Додаток має годинник,Таймер та Секундомір,кнопку перемикання теми, погода на разі не активна`,en:`The application has a clock, a t
1imer and a stopwatch, a button to switch the theme, the weather is not currently active`,ru:`Приложение имеет часы, Таймер и Секундомер, кнопку переключения темы, погода на данный момент не активна`},"lng-timerbox-three":{ua:`Темна тема з горизонтальним оріентуванням`,en:`Dark theme with horizontal orientation`,ru:`Темная тема с горизонтальным ориентированием`},"lng-timerbox-four":{ua:`Світла тема для мобільних та планшетних пристроїв`,en:`Light theme for mobile and tablet devices`,ru:`Светлая тема для мобильных и планшетных устройств`},"lng-timerbox-five":{ua:`Темна тема для мобільних та планшетних пристроїв`,en:`Dark theme for mobile and tablet devices`,ru:`Темная тема для мобильных и планшетных устройств`},"lng-timerbox-six":{ua:`Е звуки натискання кнопок та програется мєлодія по закінченню таймера.`,en:`There are sounds of pressing buttons and a melody is played after the timer expires.`,ru:`Есть звуки нажатия кнопок и проигрывается мелодия по окончании таймера.`},"todo-title":{ua:`Додаток Список Завдань`,en:`Task List application`,ru:`Приложение Список задач`},"lng-todo-list-one":{ua:`Вєб додаток зроблено з використанням Html,Css та Javascript.`,en:`The web application is made using Html, CSS and Javascript.`,ru:`Веб-приложение сделано с использованием Html,Css и Javascript.`},"lng-todo-list-two":{ua:`Програма дозволяє користувачеві створювати повсякденні завдання та справи.`,en:`The application allows the user to create daily tasks and tasks.`,ru:`Приложение позволяет пользователю создавать повседневные задачи и дела.`},"lng-todo-list-three":{ua:`Створенні задачі не зникають при закритті додатку,зберігаются у кєші браузера та займають мало місця `,en:`Task creations do not disappear when the application is closed, are stored in the browser cache and take up little space`,ru:`Созданные задачи не исчезают при закрытии приложения, сохраняется в кеше браузера и занимают мало места`},"lng-todo-list-four":{ua:`Єкран опцій додатку `,en:`Application options screen`,ru:`Экран опций приложения`}
1,"crypto-title":{ua:`Додаток Кріпто Інфо`,en:`App Crypto Info`,ru:`Приложение Список задач`},"crypto-one":{ua:`Мобільний додаток зроблено з використанням Html,Css,React та Cordova.`,en:`The mobile application is made using Html, Css, React and Cordova.`,ru:`Мобильное приложение сделано с использованием Html, CSs, React и Cordova.`},"crypto-two":{ua:`Додаток виводить на єкран курс Біткоїна,Єфіру, Гривні до Доллару`,en:`The application displays the rate of Bitcoin, Ether, Hryvnia to the Dollar on the screen`,ru:`Приложение выводит на экран курс Биткоина,Ефира, Гривны к Доллару.`},"crypto-three":{ua:`Додаток при запуску відсилає запит до кріптобіржі та отримує і виводить на єкран курс Біткоїну та Єфіру,і ще один запит до Українського банку де отримує курс Гривні до Доллару`,en:`When the application is launched, it sends a request to the crypto exchange and receives and displays the rate of Bitcoin and Ether on the screen, and another request to the Ukrainian Bank, which receives the rate of the hryvnia to the dollar`,ru:`Приложение при запуске отсылает запрос текущего курса валюті на криптобиржу, получает ответ и выводит его на экран, И еще один запрос в Украинский банк, где получает курс Гривны к Доллару.`},"crypto-four":{ua:`Тема для мобільних та планшетних пристроїв`,en:`Theme for mobile and tablet devices`,ru:`Тема для мобильных и планшетных устройств`},"crypto-five":{ua:`Інші кнопки та опції поки неактивні.`,en:`Other buttons and options are not active yet.`,ru:`Другие кнопки и настройки пока неактивны.`},"portfolio-button":{ua:`Повернутися до Портфоліо`,en:`Return to Portfolio`,ru:`Вернуться в Портфолио`},"pcmaster-title":{ua:`Сайт Компьютерного Майстра`,en:`The site of the Computer Master`,ru:`Сайт Компьютерного Мастера`},"pcmaster-one":{ua:`Сайт зроблено з використанням Html,Css,Javascript. Але є варіант з використанням фреймворку WordPress та його плагіну Elementor, у другому випадку замовник може змінювати текст та зображенняна сайті сам.`,en:`The site is made using Html, CSS, Javascript. But there is an option using the WordPress framework and its Elementor plugin, in the second case, the customer can change the text and images on the site himself.`,ru:`Сайт сделан с использованием Html, CSS, Javascript. Но есть вариант с использованием фреймворка WordPress и его плагина Elementor, во втором случае заказчик может изменять текст и изображение на сайте сам.`},"pcmaster-two":{ua:`Сайт багатосторінковий та має динамічну погоду для Полтави,меню навігації та кнопку перемикання тем.`,en:`The site is multi-page and has dynamic weather for Poltava, a navigation menu and a button to switch topics.`,ru:`Сайт многостраничный и имеет динамическую погоду для Полтавы, меню навигации и кнопку переключения тем.`},"pcmaster-three":{ua:`Є розділ корисних порад для Wordpress версії,І Портфоліо для обох версій сайту`,en:`The site is multi-page and has dynamic weather for Poltava, a navigation menu and a button to switch topics.`,ru:`Сайт многостраничный и имеет динамическую погоду для Полтавы, меню навигации и кнопку переключения тем.`},"pcmaster-four":{ua:` Темна тема.`,en:`Dark theme.`,ru:`Темная тема.`},"pcmaster-five":{ua:`Також для Wordpress версії у адмінці є можливість бєкапу сайту.`,en:`Also, for the Wordpress ver
1sion, the admin has the option of backing up the site.`,ru:`Также для Wordpress версии в админке есть возможность бекапа сайта.`},"pizza-title":{ua:`Вєб додаток Піцца`,en:`Pizza web application`,ru:`Веб приложение Пицца`},"pizza-one":{ua:`Вєб додаток зроблено з використанням Html,Css та React. `,en:`The web application is made using Html, CSS and React.`,ru:`Веб-приложение сделано с использованием Html,Css и React.`},"pizza-two":{ua:`Можна сортувати піци за популярністю,ціною та алфавитом.`,en:`You can sort pizzas by popularity, price and alphabet.`,ru:`Можно сортировать пиццы по популярности, цене и алфавиту.`},"pizza-three":{ua:`Також можна вибирати параметри замовлення,такі як товщина тіста та діаметр піци.`,en:`You can also choose the parameters of the order, such as the thickness of the dough and the diameter of the pizza.`,ru:`Можно также выбрать параметры заказа, такие как толщина теста и диаметр пиццы.`},"pizza-four":{ua:`Зверху є пошук піц за введеним текстом та працює категорія видів піцци. `,en:`At the top, there is a search for pizzas based on the entered text, and the category of types of pizza works.`,ru:`Сверху есть поиск пиццы по введенному тексту и работает категория видов пиццы.`},"pizza-five":{ua:`Є корзина покупок де підраховуєтся загальна ціна піц та видно їхню кількість. `,en:`There is a shopping basket where the total price of pizzas is calculated and their quantity is visible.`,ru:`Есть корзина покупок, где подсчитывается общая цена пицц и видно их количество.`},"burgers-title":{ua:`Вєб додаток "Бургери"`,en:`Burgers web application`,ru:`Веб приложение Бургеры`},"burger-one":{ua:`Вєб додаток зроблено з використанням Html,Css та React. `,en:`The web application is made using Html, CSS and React.`,ru:`Веб-приложение сделано с использованием Html,Css и React.`},"burger-two":{ua:`У додатку є кабінет користувача з авторизацією. `,en:`The application has a user account with authorization.`,ru:`В приложении есть пользовательский кабинет с авторизацией.`},"burger-three":{ua:`Є корзина покупця. `,en:`There is a shopping cart.`,ru:`Есть корзина покупателя.`},"burger-four":{ua:`Сторінка адресної доставки.`,en:`Address delivery page.`,ru:`Страница адресной доставки.`}}}));function Kn(){let e=Jn.value;location.href=window.location.pathname+`#`+e,location.reload()}function qn(){let e=window.location.hash;e=e.substring(1),Yn.includes(e)||(location.href=window.location.pathname+`#ua`,location.reload()),Jn.value=e;for(let t in Wn){let n=document.querySelector(`.lng-`+t);n&&(n.innerHTML=Wn[t][e])}for(let t in Wn){let n=document.querySelector(`.navbar-nav .lng-`+t);n&&(n.innerHTML=Wn[t][e])}for(let e=0;e<Xn.length;e++)Xn[e].textContent=Wn[Xn[e].classList[1]][Jn.value];let t=document.querySelectorAll(`.card-link`),n=document.querySelectorAll(`.card-title`);(()=>{switch(Jn.value){case`ua`:for(let e=0;e<t.length;e++)t[e].textContent=Wn[`button-title`].ua;break;case`en`:for(let e=0;e<t.length;e++)t[e].textContent=Wn[`button-title`].en;break;case`ru`:for(let e=0;e<t.length;e++)t[e].textContent=Wn[`button-title`].ru}})(),(()=>{switch(Jn.value){case`ua`:for(let e=0;e<n.length;e++)n[e].textContent=Wn[`card-title`].ua[e];break;case`en`:for(let e=0;e<n.length;e++)n[e].textContent=Wn[`card-title`].en[e];break;case`ru`:for(let e=0;e<n.length;e++)n[e].textContent=Wn[`card-title`].ru[e]}})()}var Jn,Yn,Xn,Zn=i((()=>{Gn(),Jn=document.getElementById(`lang-select`),Yn=[`ua`,`en`,`ru`],Xn=document.querySelectorAll(`.card-info`),Jn.addEventListener(`change`,Kn),qn()}));function Qn(e){switch(Jn.value){case`ua`:return sr[e][0];case`en`:return sr[e][1];case`ru`:return sr[e][2]}}var $n=i((()=>{lr(),Zn()})),er,tr,nr,rr,ir,ar,or,sr,cr,lr=i((()=>{$n(),er=fetch(`https://api.open-meteo.com/v1/forecast?latitude=49.59&longitude=34.55&current_weather=true&`),tr=document.querySelector(`.weather-temperature`),nr=document.querySelector(`.wind-speed`),rr=document.querySelector(`.weather-meta`),ir=document.querySelector(`.mobile-weather-temperature`),ar=document.querySelector(`.mobile-wind-speed`),or=document.querySelector(`.mobile-weather-meta`),sr={0:[`Чисте Небо`,`Clear Sky`,`Чистое небо`],1:[`Переважно ясно`,`Mostly clear`,`Преимущественно ясно`],2:[`Мінлива хмарність`,`Partly cloudy`,`Облачно с прояснениями`],3:[`Похмуро`,`Darkly`,`Мрачно`],45:`Туман`,48:`Щільний туман`,51:`Легка мряка`,53:`Помірна мряка`,55:`Щільна мряка`,56:`Легкий рижаний дощ`,57:`Щільний крижаний дощ`,61:[`Слабкий дощ`,`Rain slight`,`Дождь слабый`],63:`Помірний дощ`,65:`Сильний дощ`,66:`Крижаний дощ легкої інтенсивності`,67:`Крижаний дощ сильної інтенсивності`,71:[`Снігопад слабка інтенсивність`,`Snowfall of weak intensity`,`Снегопад слабая интенсивность`],73:[`Снігопад помірна інтенсивність`,`Snowfall moderate intensity`,`Снегопад умеренная интенсивность`],75:`Снігопад сильна інтенсивність`,77:`Снігові крупинки`,80:[`Дощ легкий`,`The rain is light`,`Дождь легкий`],81:[`Дощ помірний`,`The rain is moderate`,`Дождь умеренный`],82:[`Дощ сильний`,`The rain is heavy`,`Дождь сильный`]},cr={0:`<i class="bi bi-brightness-high"></i>`,1:`Переважно ясно`,2:`<i class="bi bi-cloud-sun"></i>`,3:`<i class="bi bi-cloud"></i>`,45:`<i class="bi bi-cloud-fog"></i>`,48:`Щільний туман`,51:`Легка мряка`,53:`Помірна мряка`,55:`Щільна мряка`,56:`Легкий рижаний дощ`,57:`Щільний крижаний дощ`,61:`<i class="bi bi-cloud-drizzle"></i>`,63:`<i class="bi bi-cloud-rain"></i>`,65:`<i class="bi bi-cloud-rain-heavy"></i>`,66:`Крижаний дощ легкої інтенсивності`,67:`Крижаний дощ сильної інтенсивності`,71:`<i class="bi bi-snow"></i>`,73:`<i class="bi bi-snow"></i><i class="bi bi-snow"></i>`,75:`<i class="bi bi-snow"></i><i class="bi bi-snow"></i><i class="bi bi-snow"></i>`,77:`Снігові крупинки`,80:`Дощ легкий`,81:`Дощ помірний`,82:`Дощ сильний`},er.then(e=>{e.json().then(e=>{tr.innerHTML=`${e.current_weather.temperature} ℃ `,nr.innerHTML=`${e.current_weather.windspeed} м/сек`,rr.innerHTML=` ${Qn(e.current_weather.weathercode)}`,console.log(e.current_weather.weathercode),ir.innerHTML=`<i class="bi bi-thermometer-half"></i> ${e.current_weather.temperature} ℃ `,ar.innerHTML=`<i class="bi bi-wind"></i> ${e.current_weather.windspeed} м/сек`,or.innerHTML=`${cr[e.current_weather.weathercode]}`})})})),ur=a((()=>{window.webkitAudioContext=void 0;var e=new(window.AudioContext||window.webkitAudioContext),t=null;fetch(`/assets/sounds/click2.mp3`).then(e=>e.arrayBuffer()).then(t=>e.decodeAudioData(t)).then(e=>{t=e});function n(){if(!t)return;e.state===`suspended`&&e.resume();let n=e.createBufferSource();n.buffer=t,n.connect(e.destination),n.start(0)}
1document.querySelectorAll(`.navbar-nav .nav-link`).forEach(e=>{e.addEventListener(`mousedown`,n)})})),dr=a((()=>{var e=`Полтава`,t=6e5,n=document.querySelector(`.magnet-index`),r=document.querySelector(`.top-magnetic-storm__inner`),i=document.querySelector(`.mobile-magnet-storm`);function a(e){if(!e)return null;let t=String(e).replace(/\.\\d+$/,``).replace(` `,`T`)+`Z`,n=new Date(t);return Number.isNaN(n.getTime())?null:n}function o(e){let t=Number.parseFloat(String(e).replace(`,`,`.`));return Number.isFinite(t)?t:null}function s(e){if(!Array.isArray(e))return[];if(e.length>1&&Array.isArray(e[0])){let t=e[0].map(e=>String(e).toLowerCase());return e.slice(1).map(e=>{let n={};for(let r=0;r<t.length;r+=1)n[t[r]]=e[r];return n})}return e.length>0&&e.every(e=>e&&typeof e==`object`)?e.map(e=>{let t={};for(let[n,r]of Object.entries(e))t[String(n).toLowerCase()]=r;return t}):[]}function c(e){return e?new Intl.DateTimeFormat(`uk-UA`,{hour:`2-digit`,minute:`2-digit`,timeZone:`Europe/Kyiv`}).format(e):``}function l(){n&&(n.style.fontWeight=`700`,n.style.color=`#000`)}function u(t,n){if(!r)return;r.innerHTML=``;let i=document.createElement(`div`);i.classList.add(`timeUnit`),i.textContent=`Індекс магнітної бурі (Kp) — ${e} (24 год)`,r.appendChild(i);let s=Math.max(n,0),l=t.slice(s,s+9);for(let e of l){let t=a(e.time_tag),n=o(e.kp),i=c(t),s=document.createElement(`div`);s.classList.add(`timeUnit`),s.textContent=i?`${i} - ${n??`—`}`:`${n??`—`}`,r.appendChild(s)}}function d(){return fetch(`https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json`,{cache:`no-store`}).then(e=>e.json()).then(e=>{let t=s(e);if(!t.length)throw Error(`Empty Kp rows`);let c=t.length-1;for(;c>=0&&String(t[c].observed)===`predicted`;)--c;c<0&&(c=t.length-1);let d=t[c],f=o(d.kp),p=a(d.time_tag),m=`${f??`—`}`;n&&(n.textContent=`${f??`—`}`),i&&(i.textContent=`${m} Kp `),l(),u(t,c),r&&p&&(r.title=`Оновлено (UTC): ${p.toISOString()}`)}).catch(t=>{console.warn(`Kp fetch failed:`,t),i&&(i.textContent=`— Kp`),n&&(n.textContent=`—`),r&&(r.textContent=`${e}: Kp недоступний`)})}(n||r||i)&&(d(),setInterval(()=>{document.visibilityState===`visible`&&d()},t))}));function fr(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function pr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so,co,lo,uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo,So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo=i((()=>{mr={autoSleep:120,force3D:`auto`,nullTargetWarn:1,units:{lineHeight:``}},hr={duration:.5,overwrite:!1,delay:0},yr=1e8,br=1/yr,xr=Math.PI*2,Sr=xr/4,Cr=0,wr=Math.sqrt,Tr=Math.cos,Er=Math.sin,Dr=function(e){return typeof e==`string`},Or=function(e){return typeof e==`function`},kr=function(e){return typeof e==`number`},Ar=function(e){return e===void 0},jr=function(e){return typeof e==`object`},Mr=function(e){return e!==!1},Nr=function(){return typeof window<`u`},Pr=function(e){return Or(e)||Dr(e)},Fr=typeof ArrayBuffer==`function`&&ArrayBuffer.isView||function(){},Ir=Array.isArray,Lr=/random\([^)]+\)/g,Rr=/,\s*/g,zr=/(?:-?\.?\d|\.)+/gi,Br=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Vr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Hr=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ur=/[+-]=-?[.\d]+/,Wr=/[^,'"\[\]\s]+/gi,Gr=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Xr={},Zr={},$r=function(e){return(Zr=ji(e,Xr))&&Zo},ei=function(e,t){return console.warn(`Invalid property`,e,`set to`,t,`Missing plugin? gsap.registerPlugin()`)},ti=function(e,t){return!t&&console.warn(e)},ni=function(e,t){return e&&(Xr[e]=t)&&Zr&&(Zr[e]=t)||Xr},ri=function(){return 0},ii={suppressEvents:!0,isStart:!0,kill:!1},ai={suppressEvents:!0,kill:!1},oi={suppressEvents:!0},si={},ci=[],li={},di={},fi={},pi=30,mi=[],hi=``,gi=function(e){var t=e[0],n,r;if(jr(t)||Or(t)||(e=[e]),!(n=(t._gsap||{}).harness)){for(r=mi.length;r--&&!mi[r].targetTest(t););n=mi[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new oo(e[r],n)))||e.splice(r,1);return e},_i=function(e){return e._gsap||gi(ma(e))[0]._gsap},vi=function(e,t,n){return(n=e[t])&&Or(n)?e[t]():Ar(n)&&e.getAttribute&&e.getAttribute(t)||n}
vendor: 4,184 bytes, line 1
1,yi=function(e,t){return(e=e.split(`,`)).forEach(t)||e},bi=function(e){return Math.round(e*1e5)/1e5||0},xi=function(e){return Math.round(e*1e7)/1e7||0},Si=function(e,t){var n=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),n===`+`?e+r:n===`-`?e-r:n===`*`?e*r:e/r},Ci=function(e,t){for(var n=t.length,r=0;e.indexOf(t[r])<0&&++r<n;);return r<n},wi=function(){var e=ci.length,t=ci.slice(0),n,r;for(li={},ci.length=0,n=0;n<e;n++)r=t[n],r&&r._lazy&&(r.render(r._lazy[0],r._lazy[1],!0)._lazy=0)},Ti=function(e){return!!(e._initted||e._startAt||e.add)},Ei=function(e,t,n,r){ci.length&&!_r&&wi(),e.render(t,n,r||!!(_r&&t<0&&Ti(e))),ci.length&&!_r&&wi()},Di=function(e){var t=parseFloat(e);return(t||t===0)&&(e+``).match(Wr).length<2?t:Dr(e)?e.trim():e},Oi=function(e){return e},ki=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},Ai=function(e){return function(t,n){for(var r in n)r in t||r===`duration`&&e||r===`ease`||(t[r]=n[r])}},ji=function(e,t){for(var n in t)e[n]=t[n];return e},Mi=function e(t,n){for(var r in n)r!==`__proto__`&&r!==`constructor`&&r!==`prototype`&&(t[r]=jr(n[r])?e(t[r]||(t[r]={}),n[r]):n[r]);return t},Ni=function(e,t){var n={},r;for(r in e)r in t||(n[r]=e[r]);return n},Pi=function(e){var t=e.parent||Kr,n=e.keyframes?Ai(Ir(e.keyframes)):ki;if(Mr(e.inherit))for(;t;)n(e,t.vars.defaults),t=t.parent||t._dp;return e},Fi=function(e,t){for(var n=e.length,r=n===t.length;r&&n--&&e[n]===t[n];);return n<0},Ii=function(e,t,n,r,i){n===void 0&&(n=`_first`),r===void 0&&(r=`_last`);var a=e[r],o;if(i)for(o=t[i];a&&a[i]>o;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[r]=t,t._prev=a,t.parent=t._dp=e,t},Li=function(e,t,n,r){n===void 0&&(n=`_first`),r===void 0&&(r=`_last`);var i=t._prev,a=t._next;i?i._next=a:e[n]===t&&(e[n]=a),a?a._prev=i:e[r]===t&&(e[r]=i),t._next=t._prev=t.parent=null},Ri=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},zi=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},Bi=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Vi=function(e,t,n,r){return e._startAt&&(_r?e._startAt.revert(ai):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},Hi=function e(t){return!t||t._ts&&e(t.parent)},Ui=function(e){return e._repeat?Wi(e._tTime,e=e.duration()+e._rDelay)*e:0},Wi=function(e,t){var n=Math.floor(e=xi(e/t));return e&&n===e?n-1:n},Gi=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Ki=function(e){return e._end=xi(e._start+(e._tDur/Math.abs(e._ts||e._rts||br)||0))},qi=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=xi(n._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Ki(e),n._dirty||zi(n,e)),e},Ji=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(n=Gi(e.rawTime(),t),(!t._dur||ca(0,t.totalDuration(),n)-t._tTime>br)&&t.render(n,!0)),zi(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(n=e;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-br}},Yi=function(e,t,n,r){return t.parent&&Ri(t),t._start=xi((kr(n)?n:n||e!==Kr?aa(e,n,t):e._time)+t._delay),t._end=xi(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Ii(e,t,`_first`,`_last`,e._sort?`_start`:0),$i(t)||(e._recent=t),r||Ji(e,t),e._ts<0&&qi(e,e._tTime),e},Xi=function(e,t){return(Xr.ScrollTrigger||ei(`scrollTrigger`,t))&&Xr.ScrollTrigger.create(t,e)},Zi=function(e,t,n,r,i){if(go(e,t,i),!e._initted)return 1;if(!n&&e._pt&&!_r&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&ui!==Ka.frame)return ci.push(e),e._lazy=[i,r],1},Qi=function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||e(n))},$i=function(e){var t=e.data;return t===`isFromStart`||t===`isStart`},ea=function(e,t,n,r){var i=e.ratio,a=t<0||!t&&(!e._start&&Qi(e)&&!(!e._initted&&$i(e))||(e._ts<0||e._dp._ts<0)&&!$i(e))?0:1,o=e._rDelay,s=0,c,l,u;if(o&&e._repeat&&(s=ca(0,e._tDur,t),l=Wi(s,o),e._yoyo&&l&1&&(a=1-a),l!==Wi(e._tTime,o)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invali
vendor: 34,789 bytes, line 1
1date())),a!==i||_r||r||e._zTime===br||!t&&e._zTime){if(!e._initted&&Zi(e,t,r,n,s))return;for(u=e._zTime,e._zTime=t||(n?br:0),n||=t&&!u,e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=s,c=e._pt;c;)c.r(a,c.d),c=c._next;t<0&&Vi(e,t,n,!0),e._onUpdate&&!n&&ja(e,`onUpdate`),s&&e._repeat&&!n&&e.parent&&ja(e,`onRepeat`),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&Ri(e,1),!n&&!_r&&(ja(e,a?`onComplete`:`onReverseComplete`,!0),e._prom&&e._prom()))}else e._zTime||=t},ta=function(e,t,n){var r;if(n>t)for(r=e._first;r&&r._start<=n;){if(r.data===`isPause`&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=n;){if(r.data===`isPause`&&r._start<t)return r;r=r._prev}},na=function(e,t,n,r){var i=e._repeat,a=xi(t)||0,o=e._tTime/e._tDur;return o&&!r&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:xi(a*(i+1)+e._rDelay*i):a,o>0&&!r&&qi(e,e._tTime=e._tDur*o),e.parent&&Ki(e),n||zi(e.parent,e),e},ra=function(e){return e instanceof co?zi(e):na(e,e._dur)},ia={_start:0,endTime:ri,totalDuration:ri},aa=function e(t,n,r){var i=t.labels,a=t._recent||ia,o=t.duration()>=yr?a.endTime(!1):t._dur,s,c,l;return Dr(n)&&(isNaN(n)||n in i)?(c=n.charAt(0),l=n.substr(-1)===`%`,s=n.indexOf(`=`),c===`<`||c===`>`?(s>=0&&(n=n.replace(/=/,``)),(c===`<`?a._start:a.endTime(a._repeat>=0))+(parseFloat(n.substr(1))||0)*(l?(s<0?a:r).totalDuration()/100:1)):s<0?(n in i||(i[n]=o),i[n]):(c=parseFloat(n.charAt(s-1)+n.substr(s+1)),l&&r&&(c=c/100*(Ir(r)?r[0]:r).totalDuration()),s>1?e(t,n.substr(0,s-1),r)+c:o+c)):n==null?o:+n},oa=function(e,t,n){var r=kr(t[1]),i=(r?2:1)+(e<2?0:1),a=t[i],o,s;if(r&&(a.duration=t[1]),a.parent=n,e){for(o=a,s=n;s&&!(`immediateRender`in o);)o=s.vars.defaults||{},s=Mr(s.vars.inherit)&&s.parent;a.immediateRender=Mr(o.immediateRender),e<2?a.runBackwards=1:a.startAt=t[i-1]}return new Co(t[0],a,t[i+1])},sa=function(e,t){return e||e===0?t(e):t},ca=function(e,t,n){return n<e?e:n>t?t:n},la=function(e,t){return!Dr(e)||!(t=Gr.exec(e))?``:t[1]},ua=function(e,t,n){return sa(n,function(n){return ca(e,t,n)})},da=[].slice,fa=function(e,t){return e&&jr(e)&&`length`in e&&(!t&&!e.length||e.length-1 in e&&jr(e[0]))&&!e.nodeType&&e!==qr},pa=function(e,t,n){return n===void 0&&(n=[]),e.forEach(function(e){var r;return Dr(e)&&!t||fa(e,1)?(r=n).push.apply(r,ma(e)):n.push(e)})||n},ma=function(e,t,n){return vr&&!t&&vr.selector?vr.selector(e):Dr(e)&&!n&&(Jr||!qa())?da.call((t||Yr).querySelectorAll(e),0):Ir(e)?pa(e,n):fa(e)?da.call(e,0):e?[e]:[]},ha=function(e){return e=ma(e)[0]||ti(`Invalid scope`)||{},function(t){var n=e.current||e.nativeElement||e;return ma(t,n.querySelectorAll?n:n===e?ti(`Invalid scope`)||Yr.createElement(`div`):e)}},ga=function(e){return e.sort(function(){return .5-Math.random()})},_a=function(e){if(Or(e))return e;var t=jr(e)?e:{each:e},n=to(t.ease),r=t.from||0,i=parseFloat(t.base)||0,a={},o=r>0&&r<1,s=isNaN(r)||o,c=t.axis,l=r,u=r;return Dr(r)?l=u={center:.5,edges:.5,end:1}[r]||0:!o&&s&&(l=r[0],u=r[1]),function(e,o,d){var f=(d||t).length,p=a[f],m,h,g,_,v,y,b,x,S;if(!p){if(S=t.grid===`auto`?0:(t.grid||[1,yr])[1],!S){for(b=-yr;b<(b=d[S++].getBoundingClientRect().left)&&S<f;);S<f&&S--}for(p=a[f]=[],m=s?Math.min(S,f)*l-.5:r%S,h=S===yr?0:s?f*u/S-.5:r/S|0,b=0,x=yr,y=0;y<f;y++)g=y%S-m,_=h-(y/S|0),p[y]=v=c?Math.abs(c===`y`?_:g):wr(g*g+_*_),v>b&&(b=v),v<x&&(x=v);r===`random`&&ga(p),p.max=b-x,p.min=x,p.v=f=(parseFloat(t.amount)||parseFloat(t.each)*(S>f?f-1:c?c===`y`?f/S:S:Math.max(S,f/S))||0)*(r===`edges`?-1:1),p.b=f<0?i-f:i,p.u=la(t.amount||t.each)||0,n=n&&f<0?eo(n):n}return f=(p[e]-p.min)/p.max||0,xi(p.b+(n?n(f):f)*p.v)+p.u}},va=function(e){var t=10**((e+``).split(`.`)[1]||``).length;return function(n){var r=xi(Math.round(parseFloat(n)/e)*e*t);return(r-r%1)/t+(kr(n)?0:la(n))}},ya=function(e,t){var n=Ir(e),r,i;return!n&&jr(e)&&(r=n=e.radius||yr,e.values?(e=ma(e.values),(i=!kr(e[0]))&&(r*=r)):e=va(e.increment)),sa(t,n?Or(e)?function(t){return i=e(t),Math.abs(i-t)<=r?i:t}:function(t){for(var n=parseFloat(i?t.x:t),a=parseFloat(i?t.y:0),o=yr,s=0,c=e.length,l,u;c--;)i?(l=e[c].x-n,u=e[c].y-a,l=l*l+u*u):l=Math.abs(e[c]-n),l<o&&(o=l,s=c);return s=!r||o<=r?e[s]:t,i||s===t||kr(t)?s:s+la(t)}:va(e))},ba=function(e,t,n,r){return sa(Ir(e)?!t:n===!0?!!(n=0):!r,function(){return Ir(e)?e[~~(Math.random()*e.length)]:(n||=1e-5)&&(r=n<1?10**((n+``).length-2):1)&&Math.floor(Math.round((e-n/2+Math.random()*(t-e+n*.99))/n)*n*r)/r})},xa=function(){var e=[...arguments];return function(t){return e.reduce(function(e,t){return t(e)},t)}},Sa=function(e,t){return function(n){return e(parseFloat(n))+(t||la(n))}},Ca=function(e,t,n){return Oa(e,t,0,1,n)},wa=function(e,t,n){return sa(n,function(n){return e[~~t(n)]})},Ta=function e(t,n,r){var i=n-t;return Ir(t)?wa(t,e(0,t.length),n):sa(r,function(e){return(i+(e-t)%i)%i+t})},Ea=function e(t,n,r){var i=n-t,a=i*2;return Ir(t)?wa(t,e(0,t.length-1),n):sa(r,function(e){return e=(a+(e-t)%a)%a||0,t+(e>i?a-e:e)})},Da=function(e){return e.replace(Lr,function(e){var t=e.indexOf(`[`)+1,n=e.substring(t||7,t?e.indexOf(`]`):e.length-1).split(Rr);return ba(t?n:+n[0],t?0:+n[1],+n[2]||1e-5)})},Oa=function(e,t,n,r,i){var a=t-e,o=r-n;return sa(i,function(t){return n+((t-e)/a*o||0)})},ka=function e(t,n,r,i){var a=isNaN(t+n)?0:function(e){return(1-e)*t+e*n};if(!a){var o=Dr(t),s={},c,l,u,d,f;if(r===!0&&(i=1)&&(r=null),o)t={p:t},n={p:n};else if(Ir(t)&&!Ir(n)){for(u=[],d=t.length,f=d-2,l=1;l<d;l++)u.push(e(t[l-1],t[l]));d--,a=function(e){e*=d;var t=Math.min(f,~~e);return u[t](e-t)},r=n}else i||(t=ji(Ir(t)?[]:{},t));if(!u){for(c in n)uo.call(s,t,c,`get`,n[c]);a=function(e){return Mo(e,s)||(o?t.p:t)}}}return sa(r,a)},Aa=function(e,t,n){var r=e.labels,i=yr,a,o,s;for(a in r)o=r[a]-t,o<0==!!n&&o&&i>(o=Math.abs(o))&&(s=a,i=o);return s},ja=function(e,t,n){var r=e.vars,i=r[t],a=vr,o=e._ctx,s,c,l;if(i)return s=r[t+`Params`],c=r.callbackScope||e,n&&ci.length&&wi(),o&&(vr=o),l=s?i.apply(c,s):i.call(c),vr=a,l},Ma=function(e){return Ri(e),e.scrollTrigger&&e.scrollTrigger.kill(!!_r),e.progress()<1&&ja(e,`onInterrupt`),e},Pa=[],Fa=function(e){if(e){if(e=!e.name&&e.default||e,Nr()||e.headless){var t=e.name,n=Or(e),r=t&&!n&&e.init?function(){this._props=[]}:e,i={init:ri,render:Mo,add:uo,kill:Po,modifier:No,rawVars:0},a={targetTest:0,get:0,getSetter:Oo,aliases:{},register:0};if(qa(),e!==r){if(di[t])return;ki(r,ki(Ni(e,i),a)),ji(r.prototype,ji(i,Ni(e,a))),di[r.prop=t]=r,e.targetTest&&(mi.push(r),si[t]=1),t=(t===`css`?`CSS`:t.charAt(0).toUpperCase()+t.substr(1))+`Plugin`}ni(t,r),e.register&&e.register(Zo,r,Lo)}else Pa.push(e)}},Ia=255,La={aqua:[0,Ia,Ia],lime:[0,Ia,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ia],navy:[0,0,128],white:[Ia,Ia,Ia],olive:[128,128,0],yellow:[Ia,Ia,0],orange:[Ia,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ia,0,0],pink:[Ia,192,203],cyan:[0,Ia,Ia],transparent:[Ia,Ia,Ia,0]},Ra=function(e,t,n){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(n-t)*e*6:e<.5?n:e*3<2?t+(n-t)*(2/3-e)*6:t)*Ia+.5|0},za=function(e,t,n){var r=e?kr(e)?[e>>16,e>>8&Ia,e&Ia]:0:La.black,i,a,o,s,c,l,u,d,f,p;if(!r){if(e.substr(-1)===`,`&&(e=e.substr(0,e.length-1)),La[e])r=La[e];else if(e.charAt(0)===`#`){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),o=e.charAt(3),e=`#`+i+i+a+a+o+o+(e.length===5?e.charAt(4)+e.charAt(4):``)),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&Ia,r&Ia,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&Ia,e&Ia]}else if(e.substr(0,3)===`hsl`){if(r=p=e.match(zr),!t)s=r[0]%360/360,c=r[1]/100,l=r[2]/100,a=l<=.5?l*(c+1):l+c-l*c,i=l*2-a,r.length>3&&(r[3]*=1),r[0]=Ra(s+1/3,i,a),r[1]=Ra(s,i,a),r[2]=Ra(s-1/3,i,a);else if(~e.indexOf(`=`))return r=e.match(Br),n&&r.length<4&&(r[3]=1),r}else r=e.match(zr)||La.transparent;r=r.map(Number)}return t&&!p&&(i=r[0]/Ia,a=r[1]/Ia,o=r[2]/Ia,u=Math.max(i,a,o),d=Math.min(i,a,o),l=(u+d)/2,u===d?s=c=0:(f=u-d,c=l>.5?f/(2-u-d):f/(u+d),s=u===i?(a-o)/f+(a<o?6:0):u===a?(o-i)/f+2:(i-a)/f+4,s*=60),r[0]=~~(s+.5),r[1]=~~(c*100+.5),r[2]=~~(l*100+.5)),n&&r.length<4&&(r[3]=1),r},Ba=function(e){var t=[],n=[],r=-1;return e.split(Ha).forEach(function(e){var i=e.match(Vr)||[];t.push.apply(t,i),n.push(r+=i.length+1)}),t.c=n,t},Va=function(e,t,n){var r=``,i=(e+r).match(Ha),a=t?`hsla(`:`rgba(`,o=0,s,c,l,u;if(!i)return e;if(i=i.map(function(e){return(e=za(e,t,1))&&a+(t?e[0]+`,`+e[1]+`%,`+e[2]+`%,`+e[3]:e.join(`,`))+`)`}),n&&(l=Ba(e),s=n.c,s.join(r)!==l.c.join(r)))for(c=e.replace(Ha,`1`).split(Vr),u=c.length-1;o<u;o++)r+=c[o]+(~s.indexOf(o)?i.shift()||a+`0,0,0,0)`:(l.length?l:i.length?i:n).shift());if(!c)for(c=e.split(Ha),u=c.length-1;o<u;o++)r+=c[o]+i[o];return r+c[u]},Ha=function(){var e=`(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b`,t;for(t in La)e+=`|`+t+`\\b`;return RegExp(e+`)`,`gi`)}(),Ua=/hsl[a]?\(/,Wa=function(e){var t=e.join(` `),n;if(Ha.lastIndex=0,Ha.test(t))return n=Ua.test(t),e[1]=Va(e[1],n),e[0]=Va(e[0],n,Ba(e[1])),!0},Ka=function(){var e=Date.now,t=500,n=33,r=e(),i=r,a=1e3/240,o=a,s=[],c,l,u,d,f,p,m=function u(m){var h=e()-i,g=m===!0,_,v,y,b;if((h>t||h<0)&&(r+=h-n),i+=h,y=i-r,_=y-o,(_>0||g)&&(b=++d.frame,f=y-d.time*1e3,d.time=y/=1e3,o+=_+(_>=a?4:a-_),v=1),g||(c=l(u)),v)for(p=0;p<s.length;p++)s[p](y,f,b,m)};return d={time:0,frame:0,tick:function(){m(!0)},deltaRatio:function(e){return f/(1e3/(e||60))},wake:function(){Qr&&(!Jr&&Nr()&&(qr=Jr=window,Yr=qr.document||{},Xr.gsap=Zo,(qr.gsapVersions||(qr.gsapVersions=[])).push(Zo.version),$r(Zr||qr.GreenSockGlobals||!qr.gsap&&qr||{}),Pa.forEach(Fa)),u=typeof requestAnimationFrame<`u`&&requestAnimationFrame,c&&d.sleep(),l=u||function(e){return setTimeout(e,o-d.time*1e3+1|0)},Ga=1,m(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(c),Ga=0,l=ri},lagSmoothing:function(e,r){t=e||1/0,n=Math.min(r||33,t)},fps:function(e){a=1e3/(e||240),o=d.time*1e3+a},add:function(e,t,n){var r=t?function(t,n,i,a){e(t,n,i,a),d.remove(r)}:e;return d.remove(e),s[n?`unshift`:`push`](r),qa(),r},remove:function(e,t){~(t=s.indexOf(e))&&s.splice(t,1)&&p>=t&&p--},_listeners:s},d}(),qa=function(){return!Ga&&Ka.wake()},Ja={},Ya=/^[\d.\-M][\d.\-,\s]/,Xa=/["']/g,Za=function(e){for(var t={},n=e.substr(1,e.length-3).split(`:`),r=n[0],i=1,a=n.length,o,s,c;i<a;i++)s=n[i],o=i===a-1?s.length:s.lastIndexOf(`,`),c=s.substr(0,o),t[r]=isNaN(c)?c.replace(Xa,``).trim():+c,r=s.substr(o+1).trim();return t},Qa=function(e){var t=e.indexOf(`(`)+1,n=e.indexOf(`)`),r=e.indexOf(`(`,t);return e.substring(t,~r&&r<n?e.indexOf(`)`,n+1):n)},$a=function(e){var t=(e+``).split(`(`),n=Ja[t[0]];return n&&t.length>1&&n.config?n.config.apply(null,~e.indexOf(`{`)?[Za(t[1])]:Qa(e).split(`,`).map(Di)):Ja._CE&&Ya.test(e)?Ja._CE(``,e):n},eo=function(e){return function(t){return 1-e(1-t)}},to=function(e,t){return e&&(Or(e)?e:Ja[e]||$a(e))||t},no=function(e,t,n,r){n===void 0&&(n=function(e){return 1-t(1-e)}),r===void 0&&(r=function(e){return e<.5?t(e*2)/2:1-t((1-e)*2)/2});var i={easeIn:t,easeOut:n,easeInOut:r},a;return yi(e,function(e){for(var t in Ja[e]=Xr[e]=i,Ja[a=e.toLowerCase()]=n,i)Ja[a+(t===`easeIn`?`.in`:t===`easeOut`?`.out`:`.inOut`)]=Ja[e+`.`+t]=i[t]}),i},ro=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},io=function e(t,n,r){var i=n>=1?n:1,a=(r||(t?.3:.45))/(n<1?n:1),o=a/xr*(Math.asin(1/i)||0),s=function(e){return e===1?1:i*2**(-10*e)*Er((e-o)*a)+1},c=t===`out`?s:t===`in`?function(e){return 1-s(1-e)}:ro(s);return a=xr/a,c.config=function(n,r){return e(t,n,r)},c},ao=function e(t,n){n===void 0&&(n=1.70158);var r=function(e){return e?--e*e*((n+1)*e+n)+1:0},i=t===`out`?r:t===`in`?function(e){return 1-r(1-e)}:ro(r);return i.config=function(n){return e(t,n)},i},yi(`Linear,Quad,Cubic,Quart,Quint,Strong`,function(e,t){var n=t<5?t+1:t;no(e+`,Power`+(n-1),t?function(e){return e**+n}:function(e){return e},function(e){return 1-(1-e)**n},function(e){return e<.5?(e*2)**n/2:1-((1-e)*2)**n/2})}),Ja.Linear.easeNone=Ja.none=Ja.Linear.easeIn,no(`Elastic`,io(`in`),io(`out`),io()),(function(e,t){var n=1/t,r=2*n,i=2.5*n,a=function(a){return a<n?e*a*a:a<r?e*(a-1.5/t)**2+.75:a<i?e*(a-=2.25/t)*a+.9375:e*(a-2.625/t)**2+.984375};no(`Bounce`,function(e){return 1-a(1-e)},a)})(7.5625,2.75),no(`Expo`,function(e){return 2**(10*(e-1))*e+e*e*e*e*e*e*(1-e)}),no(`Circ`,function(e){return-(wr(1-e*e)-1)}),no(`Sine`,function(e){return e===1?1:-Tr(e*Sr)+1}),no(`Back`,ao(`in`),ao(`out`),ao()),Ja.SteppedEase=Ja.steps=Xr.SteppedEase={config:function(e,t){e===void 0&&(e=1);var n=1/e,r=e+ +!t,i=+!!t,a=1-br;return function(e){return((r*ca(0,a,e)|0)+i)*n}}},hr.ease=Ja[`quad.out`],yi(`onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt`,function(e){return hi+=e+`,`+e+`Params,`}),oo=function(e,t){this.id=Cr++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:vi,this.set=t?t.getSetter:Oo},so=function(){function e(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,na(this,+e.duration,1,1),this.data=e.data,vr&&(this._ctx=vr,vr.data.push(this)),Ga||Ka.wake()}var t=e.prototype;return t.delay=function(e){return e||e===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+e-this._delay),this._delay=e,this):this._delay},t.duration=function(e){return arguments.length?this.totalDuration(this._repeat>0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,na(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(qa(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(qi(this,e),!n._dp||n.parent||Ji(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e<this._tDur||this._ts<0&&e>0||!this._tDur&&!e)&&Yi(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&Math.abs(this._zTime)===br||!this._initted&&this._dur&&e||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),Ei(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+Ui(this))%(this._dur+this._rDelay)||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-e:e)+Ui(this),t):this.duration()?Math.min(1,this._time/this._dur):+(this.rawTime()>0)},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?Wi(this._tTime,n)+1:1},t.timeScale=function(e,t){if(!arguments.length)return this._rts===-br?0:this._rts;if(this._rts===e)return this;var n=this.parent&&this._ts?Gi(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||e===-br?0:this._rts,this.totalTime(ca(-Math.abs(this._delay),this.totalDuration(),n),t!==!1),Ki(this),Bi(this)},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(qa(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==br&&(this._tTime-=br)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=xi(e);var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&Yi(t,this,this._start-this._delay),this}return this._start},t.endTime=function(e){return this._start+(Mr(e)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Gi(t.rawTime(e),this):this._tTime:this._tTime},t.revert=function(e){e===void 0&&(e=oi);var t=_r;return _r=e,Ti(this)&&(this.timeline&&this.timeline.revert(e),this.totalTime(-.01,e.suppressEvents)),this.data!==`nested`&&e.kill!==!1&&this.kill(),_r=t,this},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(Math.abs(t._ts)||1),t=t._dp;return!this.parent&&this._sat?this._sat.globalTime(e):n},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,ra(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(e){if(arguments.length){var t=this._time;return this._rDelay=e,ra(this),t?this.time(t):this}return this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(aa(this,e),Mr(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,Mr(t)),this._dur||(this._zTime=-br),this},t.play=function(e,t){return e!=null&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return e!=null&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return e!=null&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-br:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-br,this},t.isActive=function(){var e=this.parent||this._dp,t=this._start,n;return!!(!e||this._ts&&this._initted&&e.isActive()&&(n=e.rawTime(!0))>=t&&n<this.endTime(!0)-br)},t.eventCallback=function(e,t,n){var r=this.vars;return arguments.length>1?(t?(r[e]=t,n&&(r[e+`Params`]=n),e===`onUpdate`&&(this._onUpdate=t)):delete r[e],this):r[e]},t.then=function(e){var t=this,n=t._prom;return new Promise(function(r){var i=Or(e)?e:Oi,a=function(){var e=t.then;t.then=null,n&&n(),Or(i)&&(i=i(t))&&(i.then||i===t)&&(t.then=e),r(i),t.then=e};t._initted&&t.totalProgress()===1&&t._ts>=0||!t._tTime&&t._ts<0?a():t._prom=a})},t.kill=function(){Ma(this)},e}(),ki(so.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-br,_prom:0,_ps:!1,_rts:1}),co=function(e){pr(t,e);function t(t,n){var r;return t===void 0&&(t={}),r=e.call(this,t)||this,r.labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=Mr(t.sortChildren),Kr&&Yi(t.parent||Kr,fr(r),n),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&Xi(fr(r),t.scrollTrigger),r}var n=t.prototype;return n.to=function(e,t,n){return oa(0,arguments,this),this},n.from=function(e,t,n){return oa(1,arguments,this),this},n.fromTo=function(e,t,n,r){return oa(2,arguments,this),this},n.set=function(e,t,n){return t.duration=0,t.parent=this,Pi(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new Co(e,t,aa(this,n),1),this},n.call=function(e,t,n){return Yi(this,Co.delayedCall(0,e,t),n)},n.staggerTo=function(e,t,n,r,i,a,o){return n.duration=t,n.stagger=n.stagger||r,n.onComplete=a,n.onCompleteParams=o,n.parent=this,new Co(e,n,aa(this,i)),this},n.staggerFrom=function(e,t,n,r,i,a,o){return n.runBackwards=1,Pi(n).immediateRender=Mr(n.immediateRender),this.staggerTo(e,t,n,r,i,a,o)},n.staggerFromTo=function(e,t,n,r,i,a,o,s){return r.startAt=n,Pi(r).immediateRender=Mr(r.immediateRender),this.staggerTo(e,t,r,i,a,o,s)},n.render=function(e,t,n){var r=this._time,i=this._dirty?this.totalDuration():this._tDur,a=this._dur,o=e<=0?0:xi(e),s=this._zTime<0!=e<0&&(this._initted||!a),c,l,u,d,f,p,m,h,g,_,v,y;if(this!==Kr&&o>i&&e>=0&&(o=i),o!==this._tTime||n||s){if(r!==this._time&&a&&(o+=this._time-r,e+=this._time-r),c=o,g=this._start,h=this._ts,p=!h,s&&(a||(r=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(v=this._yoyo,f=a+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(f*100+e,t,n);if(c=xi(o%f),o===i?(d=this._repeat,c=a):(_=xi(o/f),d=~~_,d&&d===_&&(c=a,d--),c>a&&(c=a)),_=Wi(this._tTime,f),!r&&this._tTime&&_!==d&&this._tTime-_*f-this._dur<=0&&(_=d),v&&d&1&&(c=a-c,y=1),d!==_&&!this._lock){var b=v&&_&1,x=b===(v&&d&1);if(d<_&&(b=!b),r=b?0:o%a?a:o,this._lock=1,this.render(r||(y?0:xi(d*f)),t,!a)._lock=0,this._tTime=o,!t&&this.parent&&ja(this,`onRepeat`),this.vars.repeatRefresh&&!y&&(this.invalidate()._lock=1,_=d),r&&r!==this._time||p!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act||(a=this._dur,i=this._tDur,x&&(this._lock=2,r=b?a:-1e-4,this.render(r,!0),this.vars.repeatRefresh&&!y&&this.invalidate()),this._lock=0,!this._ts&&!p))return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(m=ta(this,xi(r),xi(c)),m&&(o-=c-(c=m._start))),this._tTime=o,this._time=c,this._act=!!h,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=e,r=0),!r&&o&&a&&!t&&!_&&(ja(this,`onStart`),this._tTime!==o))return this;if(c>=r&&e>=0)for(l=this._first;l;){if(u=l._next,(l._act||c>=l._start)&&l._ts&&m!==l){if(l.parent!==this)return this.render(e,t,n);if(l.render(l._ts>0?(c-l._start)*l._ts:(l._dirty?l.totalDuration():l._tDur)+(c-l._start)*l._ts,t,n),c!==this._time||!this._ts&&!p){m=0,u&&(o+=this._zTime=-br);break}}l=u}else{l=this._last;for(var S=e<0?e:c;l;){if(u=l._prev,(l._act||S<=l._end)&&l._ts&&m!==l){if(l.parent!==this)return this.render(e,t,n);if(l.render(l._ts>0?(S-l._start)*l._ts:(l._dirty?l.totalDuration():l._tDur)+(S-l._start)*l._ts,t,n||_r&&Ti(l)),c!==this._time||!this._ts&&!p){m=0,u&&(o+=this._zTime=S?-br:br);break}}l=u}}if(m&&!t&&(this.pause(),m.render(c>=r?0:-br)._zTime=c>=r?1:-1,this._ts))return this._start=g,Ki(this),this.render(e,t,n);this._onUpdate&&!t&&ja(this,`onUpdate`,!0),(o===i&&this._tTime>=this.totalDuration()||!o&&r)&&(g===this._start||Math.abs(h)!==Math.abs(this._ts))&&(this._lock||((e||!a)&&(o===i&&this._ts>0||!o&&this._ts<0)&&Ri(this,1),!t&&!(e<0&&!r)&&(o||r||!i)&&(ja(this,o===i&&e>=0?`onComplete`:`onReverseComplete`,!0),this._prom&&!(o<i&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(e,t){var n=this;if(kr(t)||(t=aa(this,t,e)),!(e instanceof so)){if(Ir(e))return e.forEach(function(e){return n.add(e,t)}),this;if(Dr(e))return this.addLabel(e,t);if(Or(e))e=Co.delayedCall(0,e);else return this}return this===e?this:Yi(this,e,t)},n.getChildren=function(e,t,n,r){e===void 0&&(e=!0),t===void 0&&(t=!0),n===void 0&&(n=!0),r===void 0&&(r=-yr);for(var i=[],a=this._first;a;)a._start>=r&&(a instanceof Co?t&&i.push(a):(n&&i.push(a),e&&i.push.apply(i,a.getChildren(!0,t,n)))),a=a._next;return i},n.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},n.remove=function(e){return Dr(e)?this.removeLabel(e):Or(e)?this.killTweensOf(e):(e.parent===this&&Li(this,e),e===this._recent&&(this._recent=this._last),zi(this))},n.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=xi(Ka.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},n.addLabel=function(e,t){return this.labels[e]=aa(this,t),this},n.removeLabel=function(e){return delete this.labels[e],this},n.addPause=function(e,t,n){var r=Co.delayedCall(0,t||ri,n);return r.data=`isPause`,this._hasPause=1,Yi(this,r,aa(this,e))},n.removePause=function(e){var t=this._first;for(e=aa(this,e);t;)t._start===e&&t.data===`isPause`&&Ri(t),t=t._next},n.killTweensOf=function(e,t,n){for(var r=this.getTweensOf(e,n),i=r.length;i--;)mo!==r[i]&&r[i].kill(e,t);return this},n.getTweensOf=function(e,t){for(var n=[],r=ma(e),i=this._first,a=kr(t),o;i;)i instanceof Co?Ci(i._targets,r)&&(a?(!mo||i._initted&&i._ts)&&i.globalTime(0)<=t&&i.globalTime(i.totalDuration())>t:!t||i.isActive())&&n.push(i):(o=i.getTweensOf(r,t)).length&&n.push.apply(n,o),i=i._next;return n},n.tweenTo=function(e,t){t||={};var n=this,r=aa(n,e),i=t,a=i.startAt,o=i.onStart,s=i.onStartParams,c=i.immediateRender,l,u=Co.to(n,ki({ease:t.ease||`none`,lazy:!1,immediateRender:!1,time:r,overwrite:`auto`,duration:t.duration||Math.abs((r-(a&&`time`in a?a.time:n._time))/n.timeScale())||br,onStart:function(){if(n.pause(),!l){var e=t.duration||Math.abs((r-(a&&`time`in a?a.time:n._time))/n.timeScale());u._dur!==e&&na(u,e,0,1).render(u._time,!0,!0),l=1}o&&o.apply(u,s||[])}},t));return c?u.render(0):u},n.tweenFromTo=function(e,t,n){return this.tweenTo(t,ki({startAt:{time:aa(this,e)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(e){return e===void 0&&(e=this._time),Aa(this,aa(this,e))},n.previousLabel=function(e){return e===void 0&&(e=this._time),Aa(this,aa(this,e),1)},n.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+br)},n.shiftChildren=function(e,t,n){n===void 0&&(n=0);var r=this._first,i=this.labels,a;for(e=xi(e);r;)r._start>=n&&(r._start+=e,r._end+=e),r=r._next;if(t)for(a in i)i[a]>=n&&(i[a]+=e);return zi(this)},n.invalidate=function(t){var n=this._first;for(this._lock=0;n;)n.invalidate(t),n=n._next;return e.prototype.invalidate.call(this,t)},n.clear=function(e){e===void 0&&(e=!0);for(var t=this._first,n;t;)n=t._next,this.remove(t),t=n;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),zi(this)},n.totalDuration=function(e){var t=0,n=this,r=n._last,i=yr,a,o,s;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-e:e));if(n._dirty){for(s=n.parent;r;)a=r._prev,r._dirty&&r.totalDuration(),o=r._start,o>i&&n._sort&&r._ts&&!n._lock?(n._lock=1,Yi(n,r,o-r._delay,1)._lock=0):i=o,o<0&&r._ts&&(t-=o,(!s&&!n._dp||s&&s.smoothChildTiming)&&(n._start+=xi(o/n._ts),n._time-=o,n._tTime-=o),n.shiftChildren(-o,!1,-1/0),i=0),r._end>t&&r._ts&&(t=r._end),r=a;na(n,n===Kr&&n._time>t?n._time:t,1,1),n._dirty=0}return n._tDur},t.updateRoot=function(e){if(Kr._ts&&(Ei(Kr,Gi(e,Kr)),ui=Ka.frame),Ka.frame>=pi){pi+=mr.autoSleep||120;var t=Kr._first;if((!t||!t._ts)&&mr.autoSleep&&Ka._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||Ka.sleep()}}},t}(so),ki(co.prototype,{_lock:0,_hasPause:0,_forcing:0}),lo=function(e,t,n,r,i,a,o){var s=new Lo(this._pt,e,t,0,1,jo,null,i),c=0,l=0,u,d,f,p,m,h,g,_;for(s.b=n,s.e=r,n+=``,r+=``,(g=~r.indexOf(`random(`))&&(r=Da(r)),a&&(_=[n,r],a(_,e,t),n=_[0],r=_[1]),d=n.match(Hr)||[];u=Hr.exec(r);)p=u[0],m=r.substring(c,u.index),f?f=(f+1)%5:m.substr(-5)===`rgba(`&&(f=1),p!==d[l++]&&(h=parseFloat(d[l-1])||0,s._pt={_next:s._pt,p:m||l===1?m:`,`,s:h,c:p.charAt(1)===`=`?Si(h,p)-h:parseFloat(p)-h,m:f&&f<4?Math.round:0},c=Hr.lastIndex);return s.c=c<r.length?r.substring(c,r.length):``,s.fp=o,(Ur.test(r)||g)&&(s.e=0),this._pt=s,s},uo=function(e,t,n,r,i,a,o,s,c,l){Or(r)&&(r=r(i||0,e,a));var u=e[t],d=n===`get`?Or(u)?c?e[t.indexOf(`set`)||!Or(e[`get`+t.substr(3)])?t:`get`+t.substr(3)](c):e[t]():u:n,f=Or(u)?c?Eo:To:wo,p;if(Dr(r)&&(~r.indexOf(`random(`)&&(r=Da(r)),r.charAt(1)===`=`&&(p=Si(d,r)+(la(d)||0),(p||p===0)&&(r=p))),!l||d!==r||ho)return!isNaN(d*r)&&r!==``?(p=new Lo(this._pt,e,t,+d||0,r-(d||0),typeof u==`boolean`?Ao:ko,0,f),c&&(p.fp=c),o&&p.modifier(o,this,e),this._pt=p):(!u&&!(t in e)&&ei(t,r),lo.call(this,e,t,d,r,f,s||mr.stringFilter,c))},fo=function(e,t,n,r,i){if(Or(e)&&(e=bo(e,i,t,n,r)),!jr(e)||e.style&&e.nodeType||Ir(e)||Fr(e))return Dr(e)?bo(e,i,t,n,r):e;var a={},o;for(o in e)a[o]=bo(e[o],i,t,n,r);return a},po=function(e,t,n,r,i,a){var o,s,c,l;if(di[e]&&(o=new di[e]).init(i,o.rawVars?t[e]:fo(t[e],r,i,a,n),n,r,a)!==!1&&(n._pt=s=new Lo(n._pt,i,e,0,1,o.render,o,0,o.priority),n!==Na))for(c=n._ptLookup[n._targets.indexOf(i)],l=o._props.length;l--;)c[o._props[l]]=s;return o},go=function e(t,n,r){var i=t.vars,a=i.ease,o=i.startAt,s=i.immediateRender,c=i.lazy,l=i.onUpdate,u=i.runBackwards,d=i.yoyoEase,f=i.keyframes,p=i.autoRevert,m=t._dur,h=t._startAt,g=t._targets,_=t.parent,v=_&&_.data===`nested`?_.vars.targets:g,y=t._overwrite===`auto`&&!gr,b=t.timeline,x=i.easeReverse||d,S,C,w,T,E,D,O,k,A,j,M,N,P;if(b&&(!f||!a)&&(a=`none`),t._ease=to(a,hr.ease),t._rEase=x&&(to(x)||t._ease),t._from=!b&&!!i.runBackwards,t._from&&(t.ratio=1),!b||f&&!i.stagger){if(k=g[0]?_i(g[0]).harness:0,N=k&&i[k.prop],S=Ni(i,si),h&&(h._zTime<0&&h.progress(1),n<0&&u&&s&&!p?h.render(-1,!0):h.revert(u&&m?ai:ii),h._lazy=0),o){if(Ri(t._startAt=Co.set(g,ki({data:`isStart`,overwrite:!1,parent:_,immediateRender:!0,lazy:!h&&Mr(c),startAt:null,delay:0,onUpdate:l&&function(){return ja(t,`onUpdate`)},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,n<0&&(_r||!s&&!p)&&t._startAt.revert(ai),s&&m&&n<=0&&r<=0){n&&(t._zTime=n);return}}else if(u&&m&&!h){if(n&&(s=!1),w=ki({overwrite:!1,data:`isFromStart`,lazy:s&&!h&&Mr(c),immediateRender:s,stagger:0,parent:_},S),N&&(w[k.prop]=N),Ri(t._startAt=Co.set(g,w)),t._startAt._dp=0,t._startAt._sat=t,n<0&&(_r?t._startAt.revert(ai):t._startAt.render(-1,!0)),t._zTime=n,!s)e(t._startAt,br,br);else if(!n)return}for(t._pt=t._ptCache=0,c=m&&Mr(c)||c&&!m,C=0;C<g.length;C++){if(E=g[C],O=E._gsap||gi(g)[C]._gsap,t._ptLookup[C]=j={},li[O.id]&&ci.length&&wi(),M=v===g?C:v.indexOf(E),k&&(A=new k).init(E,N||S,t,M,v)!==!1&&(t._pt=T=new Lo(t._pt,E,A.name,0,1,A.render,A,0,A.priority),A._props.forEach(function(e){j[e]=T}),A.priority&&(D=1)),!k||N)for(w in S)di[w]&&(A=po(w,S,t,M,E,v))?A.priority&&(D=1):j[w]=T=uo.call(t,E,w,`get`,S[w],M,v,0,i.stringFilter);t._op&&t._op[C]&&t.kill(E,t._op[C]),y&&t._pt&&(mo=t,Kr.killTweensOf(E,j,t.globalTime(n)),P=!t.parent,mo=0),t._pt&&c&&(li[O.id]=1)}D&&Io(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!P,f&&n<=0&&b.render(yr,!0,!0)},_o=function(e,t,n,r,i,a,o,s){var c=(e._pt&&e._ptCache||(e._ptCache={}))[t],l,u,d,f;if(!c)for(c=e._ptCache[t]=[],d=e._ptLookup,f=e._targets.length;f--;){if(l=d[f][t],l&&l.d&&l.d._pt)for(l=l.d._pt;l&&l.p!==t&&l.fp!==t;)l=l._next;if(!l)return ho=1,e.vars[t]=`+=0`,go(e,o),ho=0,s?ti(t+` not eligible for reset. Try splitting into individual properties`):1;c.push(l)}for(f=c.length;f--;)u=c[f],l=u._pt||u,l.s=(r||r===0)&&!i?r:l.s+(r||0)+a*l.c,l.c=n-l.s,u.e&&(u.e=bi(n)+la(u.e)),u.b&&(u.b=l.s+la(u.b))},vo=function(e,t){var n=e[0]?_i(e[0]).harness:0,r=n&&n.aliases,i,a,o,s;if(!r)return t;for(a in i=ji({},t),r)if(a in i)for(s=r[a].split(`,`),o=s.length;o--;)i[s[o]]=i[a];return i},yo=function(e,t,n,r){var i=t.ease||r||`power1.inOut`,a,o;if(Ir(t))o=n[e]||(n[e]=[]),t.forEach(function(e,n){return o.push({t:n/(t.length-1)*100,v:e,e:i})});else for(a in t)o=n[a]||(n[a]=[]),a===`ease`||o.push({t:parseFloat(e),v:t[a],e:i})},bo=function(e,t,n,r,i){return Or(e)?e.call(t,n,r,i):Dr(e)&&~e.indexOf(`random(`)?Da(e):e},xo=hi+`repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert`,So={},yi(xo+`,id,stagger,delay,duration,paused,scrollTrigger`,function(e){return So[e]=1}),Co=function(e){pr(t,e);function t(t,n,r,i){var a;typeof n==`number`&&(r.duration=n,n=r,r=null),a=e.call(this,i?n:Pi(n))||this;var o=a.vars,s=o.duration,c=o.delay,l=o.immediateRender,u=o.stagger,d=o.overwrite,f=o.keyframes,p=o.defaults,m=o.scrollTrigger,h=n.parent||Kr,g=(Ir(t)||Fr(t)?kr(t[0]):`length`in n)?[t]:ma(t),_,v,y,b,x,S,C,w;if(a._targets=g.length?gi(g):ti(`GSAP target `+t+` not found. https://gsap.com`,!mr.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=d,f||u||Pr(s)||Pr(c)){n=a.vars;var T=n.easeReverse||n.yoyoEase;if(_=a.timeline=new co({data:`nested`,defaults:p||{},targets:h&&h.data===`nested`?h.vars.targets:g}),_.kill(),_.parent=_._dp=fr(a),_._start=0,u||Pr(s)||Pr(c)){if(b=g.length,C=u&&_a(u),jr(u))for(x in u)~xo.indexOf(x)&&(w||={},w[x]=u[x]);for(v=0;v<b;v++)y=Ni(n,So),y.stagger=0,T&&(y.easeReverse=T),w&&ji(y,w),S=g[v],y.duration=+bo(s,fr(a),v,S,g),y.delay=(+bo(c,fr(a),v,S,g)||0)-a._delay,!u&&b===1&&y.delay&&(a._delay=c=y.delay,a._start+=c,y.delay=0),_.to(S,y,C?C(v,S,g):0),_._ease=Ja.none;_.duration()?s=c=0:a.timeline=0}else if(f){Pi(ki(_.vars.defaults,{ease:`none`})),_._ease=to(f.ease||n.ease||`none`);var E=0,D,O,k;if(Ir(f))f.forEach(function(e){return _.to(g,e,`>`)}),_.duration();else{for(x in y={},f)x===`ease`||x===`easeEach`||yo(x,f[x],y,f.easeEach);for(x in y)for(D=y[x].sort(function(e,t){return e.t-t.t}),E=0,v=0;v<D.length;v++)O=D[v],k={ease:O.e,duration:(O.t-(v?D[v-1].t:0))/100*s},k[x]=O.v,_.to(g,k,E),E+=k.duration;_.duration()<s&&_.to({},{duration:s-_.duration()})}}s||a.duration(s=_.duration())}else a.timeline=0;return d===!0&&!gr&&(mo=fr(a),Kr.killTweensOf(g),mo=0),Yi(h,fr(a),r),n.reversed&&a.reverse(),n.paused&&a.paused(!0),(l||!s&&!f&&a._start===xi(h._time)&&Mr(l)&&Hi(fr(a))&&h.data!==`nested`)&&(a._tTime=-br,a.render(Math.max(0,-c)||0)),m&&Xi(fr(a),m),a}var n=t.prototype;return n.render=function(e,t,n){var r=this._time,i=this._tDur,a=this._dur,o=e<0,s=e>i-br&&!o?i:e<br?0:e,c,l,u,d,f,p,m,h;if(!a)ea(this,e,t,n);else if(s!==this._tTime||!e||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==o||this._lazy){if(c=s,h=this.timeline,this._repeat){if(d=a+this._rDelay,this._repeat<-1&&o)return this.totalTime(d*100+e,t,n);if(c=xi(s%d),s===i?(u=this._repeat,c=a):(f=xi(s/d),u=~~f,u&&u===f?(c=a,u--):c>a&&(c=a)),p=this._yoyo&&u&1,p&&(c=a-c),f=Wi(this._tTime,d),c===r&&!n&&this._initted&&u===f)return this._tTime=s,this;u!==f&&this.vars.repeatRefresh&&!p&&!this._lock&&c!==d&&this._initted&&(this._lock=n=1,this.render(xi(d*u),!0).invalidate()._lock=0)}if(!this._initted){if(Zi(this,o?e:c,n,t,s))return this._tTime=0,this;if(r!==this._time&&!(n&&this.vars.repeatRefresh&&u!==f))return this;if(a!==this._dur)return this.render(e,t,n)}if(this._rEase){var g=c<r;if(g!==this._inv){var _=g?r:a-r;this._inv=g,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=r,this._invRecip=_?(g?-1:1)/_:0,this._invScale=g?-this.ratio:1-this.ratio,this._invEase=g?this._rEase:this._ease}this.ratio=m=this._invRatio+this._invScale*this._invEase((c-this._invTime)*this._invRecip)}else this.ratio=m=this._ease(c/a);if(this._from&&(this.ratio=m=1-m),this._tTime=s,this._time=c,!this._act&&this._ts&&(this._act=1,this._lazy=0),!r&&s&&!t&&!f&&(ja(this,`onStart`),this._tTime!==s))return this;for(l=this._pt;l;)l.r(m,l.d),l=l._next;h&&h.render(e<0?e:h._dur*h._ease(c/this._dur),t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(o&&Vi(this,e,t,n),ja(this,`onUpdate`)),this._repeat&&u!==f&&this.vars.onRepeat&&!t&&this.parent&&ja(this,`onRepeat`),(s===this._tDur||!s)&&this._tTime===s&&(o&&!this._onUpdate&&Vi(this,e,!0,!0),(e||!a)&&(s===this._tDur&&this._ts>0||!s&&this._ts<0)&&Ri(this,1),!t&&!(o&&!r)&&(s||r||p)&&(ja(this,s===i?`onComplete`:`onReverseComplete`,!0),this._prom&&!(s<i&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(t){return(!t||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),e.prototype.invalidate.call(this,t)},n.resetTo=function(e,t,n,r,i){Ga||Ka.wake(),this._ts||this.play();
vendor: 5,061 bytes, line 1
1var a=Math.min(this._dur,(this._dp._time-this._start)*this._ts),o;return this._initted||go(this,a),o=this._ease(a/this._dur),_o(this,e,t,n,r,o,a,i)?this.resetTo(e,t,n,r,1):(qi(this,0),this.parent||Ii(this._dp,this,`_first`,`_last`,this._dp._sort?`_start`:0),this.render(0))},n.kill=function(e,t){if(t===void 0&&(t=`all`),!e&&(!t||t===`all`))return this._lazy=this._pt=0,this.parent?Ma(this):this.scrollTrigger&&this.scrollTrigger.kill(!!_r),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,mo&&mo.vars.overwrite!==!0)._first||Ma(this),this.parent&&n!==this.timeline.totalDuration()&&na(this,this._dur*this.timeline._tDur/n,0,1),this}var r=this._targets,i=e?ma(e):r,a=this._ptLookup,o=this._pt,s,c,l,u,d,f,p;if((!t||t===`all`)&&Fi(r,i))return t===`all`&&(this._pt=0),Ma(this);for(s=this._op=this._op||[],t!==`all`&&(Dr(t)&&(d={},yi(t,function(e){return d[e]=1}),t=d),t=vo(r,t)),p=r.length;p--;)if(~i.indexOf(r[p]))for(d in c=a[p],t===`all`?(s[p]=t,u=c,l={}):(l=s[p]=s[p]||{},u=t),u)f=c&&c[d],f&&((!(`kill`in f.d)||f.d.kill(d)===!0)&&Li(this,f,`_pt`),delete c[d]),l!==`all`&&(l[d]=1);return this._initted&&!this._pt&&o&&Ma(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,t){return oa(1,arguments)},t.delayedCall=function(e,n,r,i){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},t.fromTo=function(e,t,n){return oa(2,arguments)},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return Kr.killTweensOf(e,t,n)},t}(so),ki(Co.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),yi(`staggerTo,staggerFrom,staggerFromTo`,function(e){Co[e]=function(){var t=new co,n=da.call(arguments,0);return n.splice(e===`staggerFromTo`?5:4,0,0),t[e].apply(t,n)}}),wo=function(e,t,n){return e[t]=n},To=function(e,t,n){return e[t](n)},Eo=function(e,t,n,r){return e[t](r.fp,n)},Do=function(e,t,n){return e.setAttribute(t,n)},Oo=function(e,t){return Or(e[t])?To:Ar(e[t])&&e.setAttribute?Do:wo},ko=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Ao=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},jo=function(e,t){var n=t._pt,r=``;if(!e&&t.b)r=t.b;else if(e===1&&t.e)r=t.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+r,n=n._next;r+=t.c}t.set(t.t,t.p,r,t)},Mo=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},No=function(e,t,n,r){for(var i=this._pt,a;i;)a=i._next,i.p===r&&i.modifier(e,t,n),i=a},Po=function(e){for(var t=this._pt,n,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?Li(this,t,`_pt`):t.dep||(n=1),t=r;return!n},Fo=function(e,t,n,r){r.mSet(e,t,r.m.call(r.tween,n,r.mt),r)},Io=function(e){for(var t=e._pt,n,r,i,a;t;){for(n=t._next,r=i;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:a)?t._prev._next=t:i=t,(t._next=r)?r._prev=t:a=t,t=n}e._pt=i},Lo=function(){function e(e,t,n,r,i,a,o,s,c){this.t=t,this.s=r,this.c=i,this.p=n,this.r=a||ko,this.d=o||this,this.set=s||wo,this.pr=c||0,this._next=e,e&&(e._prev=this)}var t=e.prototype;return t.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=Fo,this.m=e,this.mt=n,this.tween=t},e}(),yi(hi+`parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse`,function(e){return si[e]=1}),Xr.TweenMax=Xr.TweenLite=Co,Xr.TimelineLite=Xr.TimelineMax=co,Kr=new co({sortChildren:!1,defaults:hr,autoRemoveChildren:!0,id:`root`,smoothChildTiming:!0}),mr.stringFilter=Wa,Ro=[],zo={},Bo=[],Vo=0,Ho=0,Uo=function(e){return(zo[e]||Bo).map(function(e){return e()})},Wo=function(){var e=Date.now(),t=[];e-Vo>2&&(Uo(`matchMediaInit`),Ro.forEach(function(e){var n=e.queries,r=e.conditions,i,a,o,s;for(a in n)i=qr.matchMedia(n[a]).matches,i&&(o=1),i!==r[a]&&(r[a]=i,s=1);s&&(e.revert(),o&&t.push(e))}),Uo(`matchMediaRevert`),t.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),Vo=e,Uo(`matchMedia`))},Go=function(){function e(e,t){this.selector=t&&ha(t),this.data=[],this._r=[],this.isReverted=!1,this.id=Ho++,e&&this.add(e)}var t=e.prototype;return t.add=function(e,t,n){Or(e)&&(n=t,t=e,e=Or);var r=this,i=function(){var e=vr,i=r.selector,a;return e&&e!==r&&e.data.push(r),n&&(r.selector=ha(n)),vr=r,a=t.apply(r,arguments),Or(a)&&r._r.push(a),vr=e,r.selector=i,r.isReverted=!1,a};return r.last=i,e===Or?i(r,function(e){return r.add(null,e)}):e?r[e]=i:i},t.ignore=function(e){var t=vr;vr=null,e(this),vr=t},t.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof e?t.push.apply(t,n.getTweens()):n instanceof Co&&!(n.parent&&n.parent.data===`nested`)&&t.push(n)}),t},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(e,t){var n=this;if(e?(function(){for(var t=n.getTweens(),r=n.data.length,i;r--;)i=n.data[r],i.data===`isFlip`&&(i.revert(),i.getChildren(!0,!0,!1).forEac
1h(function(e){return t.splice(t.indexOf(e),1)}));for(t.map(function(e){return{g:e._dur||e._delay||e._sat&&!e._sat.vars.immediateRender?e.globalTime(0):-1/0,t:e}}).sort(function(e,t){return t.g-e.g||-1/0}).forEach(function(t){return t.t.revert(e)}),r=n.data.length;r--;)i=n.data[r],i instanceof co?i.data!==`nested`&&(i.scrollTrigger&&i.scrollTrigger.revert(),i.kill()):!(i instanceof Co)&&i.revert&&i.revert(e);n._r.forEach(function(t){return t(e,n)}),n.isReverted=!0})():this.data.forEach(function(e){return e.kill&&e.kill()}),this.clear(),t)for(var r=Ro.length;r--;)Ro[r].id===this.id&&Ro.splice(r,1)},t.revert=function(e){this.kill(e||{})},e}(),Ko=function(){function e(e){this.contexts=[],this.scope=e,vr&&vr.data.push(this)}var t=e.prototype;return t.add=function(e,t,n){jr(e)||(e={matches:e});var r=new Go(0,n||this.scope),i=r.conditions={},a,o,s;for(o in vr&&!r.selector&&(r.selector=vr.selector),this.contexts.push(r),t=r.add(`onMatch`,t),r.queries=e,e)o===`all`?s=1:(a=qr.matchMedia(e[o]),a&&(Ro.indexOf(r)<0&&Ro.push(r),(i[o]=a.matches)&&(s=1),a.addListener?a.addListener(Wo):a.addEventListener(`change`,Wo)));return s&&t(r,function(e){return r.add(null,e)}),this},t.revert=function(e){this.kill(e||{})}
vendor: 2,079 bytes, line 1
1,t.kill=function(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},e}(),qo={registerPlugin:function(){[...arguments].forEach(function(e){return Fa(e)})},timeline:function(e){return new co(e)},getTweensOf:function(e,t){return Kr.getTweensOf(e,t)},getProperty:function(e,t,n,r){Dr(e)&&(e=ma(e)[0]);var i=_i(e||{}).get,a=n?Oi:Di;return n===`native`&&(n=``),e&&(t?a((di[t]&&di[t].get||i)(e,t,n,r)):function(t,n,r){return a((di[t]&&di[t].get||i)(e,t,n,r))})},quickSetter:function(e,t,n){if(e=ma(e),e.length>1){var r=e.map(function(e){return Zo.quickSetter(e,t,n)}),i=r.length;return function(e){for(var t=i;t--;)r[t](e)}}e=e[0]||{};var a=di[t],o=_i(e),s=o.harness&&(o.harness.aliases||{})[t]||t,c=a?function(t){var r=new a;Na._pt=0,r.init(e,n?t+n:t,Na,0,[e]),r.render(1,r),Na._pt&&Mo(1,Na)}:o.set(e,s);return a?c:function(t){return c(e,s,n?t+n:t,o,1)}},quickTo:function(e,t,n){var r,i=Zo.to(e,ki((r={},r[t]=`+=0.1`,r.paused=!0,r.stagger=0,r),n||{})),a=function(e,n,r){return i.resetTo(t,e,n,r)};return a.tween=i,a},isTweening:function(e){return Kr.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=to(e.ease,hr.ease)),Mi(hr,e||{})},config:function(e){return Mi(mr,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,r=e.plugins,i=e.defaults,a=e.extendTimeline;(r||``).split(`,`).forEach(function(e){return e&&!di[e]&&!Xr[e]&&ti(t+` effect requires `+e+` plugin.`)}),fi[t]=function(e,t,r){return n(ma(e),ki(t||{},i),r)},a&&(co.prototype[t]=function(e,n,r){return this.add(fi[t](e,jr(n)?n:(r=n)&&{},this),r)})},registerEase:function(e,t){Ja[e]=to(t)},parseEase:function(e,t){return arguments.length?to(e,t):Ja},getById:function(e){return Kr.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var n=new co(e),r,i;for(n.smoothChildTiming=Mr(e.smoothChildTiming),Kr.remove(n),n._dp=0,n._time=n._tTime=Kr._time,r=Kr._first;r;)i=r._next,(t||!(!r._dur&&r instanceof Co&&r.vars.onComplete===r._targets[0]))&&Yi(n,r,r._start-r._delay),r=i;return Yi(Kr,n,0),n},context:function(e,t){return e?new Go(e,t):vr},matchMedia:function(e){return new Ko(e)}
vendor: 6,290 bytes, line 1
1,matchMediaRefresh:function(){return Ro.forEach(function(e){var t=e.conditions,n,r;for(r in t)t[r]&&(t[r]=!1,n=1);n&&e.revert()})||Wo()},addEventListener:function(e,t){var n=zo[e]||(zo[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=zo[e],r=n&&n.indexOf(t);r>=0&&n.splice(r,1)},utils:{wrap:Ta,wrapYoyo:Ea,distribute:_a,random:ba,snap:ya,normalize:Ca,getUnit:la,clamp:ua,splitColor:za,toArray:ma,selector:ha,mapRange:Oa,pipe:xa,unitize:Sa,interpolate:ka,shuffle:ga},install:$r,effects:fi,ticker:Ka,updateRoot:co.updateRoot,plugins:di,globalTimeline:Kr,core:{PropTween:Lo,globals:ni,Tween:Co,Timeline:co,Animation:so,getCache:_i,_removeLinkedListItem:Li,reverting:function(){return _r},context:function(e){return e&&vr&&(vr.data.push(e),e._ctx=vr),vr},suppressOverwrites:function(e){return gr=e}}},yi(`to,from,fromTo,delayedCall,set,killTweensOf`,function(e){return qo[e]=Co[e]}),Ka.add(co.updateRoot),Na=qo.to({},{duration:0}),Jo=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},Yo=function(e,t){var n=e._targets,r,i,a;for(r in t)for(i=n.length;i--;)a=e._ptLookup[i][r],(a&&=a.d)&&(a._pt&&(a=Jo(a,r)),a&&a.modifier&&a.modifier(t[r],e,n[i],r))},Xo=function(e,t){return{name:e,headless:1,rawVars:1,init:function(e,n,r){r._onInit=function(e){var r,i;if(Dr(n)&&(r={},yi(n,function(e){return r[e]=1}),n=r),t){for(i in r={},n)r[i]=t(n[i]);n=r}Yo(e,n)}}}},Zo=qo.registerPlugin({name:`attr`,init:function(e,t,n,r,i){var a,o,s;for(a in this.tween=n,t)s=e.getAttribute(a)||``,o=this.add(e,`setAttribute`,(s||0)+``,t[a],r,i,0,0,a),o.op=a,o.b=s,this._props.push(a)},render:function(e,t){for(var n=t._pt;n;)_r?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:`endArray`,headless:1,init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}},Xo(`roundProps`,va),Xo(`modifiers`),Xo(`snap`,ya))||qo,Co.version=co.version=Zo.version=`3.15.0`,Qr=1,Nr()&&qa(),Ja.Power0,Ja.Power1,Ja.Power2,Ja.Power3,Ja.Power4,Ja.Linear,Ja.Quad,Ja.Cubic,Ja.Quart,Ja.Quint,Ja.Strong,Ja.Elastic,Ja.Back,Ja.SteppedEase,Ja.Bounce,Ja.Sine,Ja.Expo,Ja.Circ})),$o,es,ts,ns,rs,is,as,os,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc=i((()=>{Qo(),os=function(){return typeof window<`u`},ss={},cs=180/Math.PI,ls=Math.PI/180,us=Math.atan2,ds=1e8,fs=/([A-Z])/g,ps=/(left|right|width|margin|padding|x)/i,ms=/[\s,\(]\S/,hs={autoAlpha:`opacity,visibility`,scale:`scaleX,scaleY`,alpha:`opacity`},gs=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},_s=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},vs=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},ys=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},bs=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},xs=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Ss=function(e,t){return t.set(t.t,t.p,e===1?t.e:t.b,t)},Cs=function(e,t,n){return e.style[t]=n},ws=function(e,t,n){return e.style.setProperty(t,n)},Ts=function(e,t,n){return e._gsap[t]=n},Es=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},Ds=function(e,t,n,r,i){var a=e._gsap;a.scaleX=a.scaleY=n,a.renderTransform(i,a)},Os=function(e,t,n,r,i){var a=e._gsap;a[t]=n,a.renderTransform(i,a)},ks=`transform`,As=ks+`Origin`,js=function e(t,n){var r=this,i=this.target,a=i.style,o=i._gsap;if(t in ss&&a){if(this.tfm=this.tfm||{},t!==`transform`)t=hs[t]||t,~t.indexOf(`,`)?t.split(`,`).forEach(function(e){return r.tfm[e]=Xs(i,e)}):this.tfm[t]=o.x?o[t]:Xs(i,t),t===As&&(this.tfm.zOrigin=o.zOrigin);else return hs.transform.split(`,`).forEach(function(t){return e.call(r,t,n)});if(this.props.indexOf(ks)>=0)return;o.svg&&(this.svgo=i.getAttribute(`data-svg-origin`),this.props.push(As,n,``)),t=ks}(a||n)&&this.props.push(t,n,a[t])},Ms=function(e){e.translate&&(e.removeProperty(`translate`),e.removeProperty(`scale`),e.removeProperty(`rotate`))},Ns=function(){var e=this.props,t=this.target,n=t.style,r=t._gsap,i,a;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?t[e[i]](e[i+2]):t[e[i]]=e[i+2]:e[i+2]?n[e[i]]=e[i+2]:n.removeProperty(e[i].substr(0,2)===`--`?e[i]:e[i].replace(fs,`-$1`).toLowerCase());if(this.tfm){for(a in this.tfm)r[a]=this.tfm[a];r.svg&&(r.renderTransform(),t.setAttribute(`data-svg-origin`,this.svgo||``)),i=as(),(!i||!i.isStart)&&!n[ks]&&(Ms(n),r.zOrigin&&n[As]&&(n[As]+=` `+r.zOrigin+`px`,r.zOrigin=0,r.renderTransform()),r.uncache=1)}},Ps=function(e,t){var n={target:e,props:[],revert:Ns,save:js};return e._gsap||Zo.core.getCache(e),t&&e.style&&e.nodeType&&t.split(`,`).forEach(function(e){return n.save(e)}),n},Is=function(e,t){var n=es.createElementNS?es.createElementNS((t||`http://www.w3.org/1999/xhtml`).replace(/^https/,`http`),e):es.createElement(e);return n&&n.style?n:es.createElement(e)},Ls=function e(t,n,r){var i=getComputedStyle(t);return i[n]||i.getPropertyValue(n.replace(fs,`-$1`).toLowerCase())||i.getPropertyValue(n)||!r&&e(t,zs(n)||n,1)||``},Rs=`O,Moz,ms,Ms,Webkit`.split(`,`),zs=function(e,t,n){var r=(t||rs).style,i=5;if(e in r&&!n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);i--&&!(Rs[i]+e in r););return i<0?null:(i===3?`ms`:i>=0?Rs[i]:``)+e},Bs=function(){os()&&window.document&&($o=window,es=$o.document,ts=es.documentElement,rs=Is(`div`)||{style:{}},Is(`div`),ks=zs(ks),As=ks+`Origin`,rs.style.cssText=`border-width:0;line-height:0;position:absolute;padding:0`,Fs=!!zs(`perspective`),as=Zo.core.reverting,ns=1)},Vs=function(e){var t=e.ownerSVGElement,n=Is(`svg`,t&&t.getAttribute(`xmlns`)||`http://www.w3.org/2000/svg`),r=e.cloneNode(!0),i;r.style.display=`block`,n.appendChild(r),ts.appendChild(n);try{i=r.getBBox()}catch{}return n.removeChild(r),ts.removeChild(n),i},Hs=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},Us=function(e){var t,n;try{t=e.getBBox()}catch{t=Vs(e),n=1}return t&&(t.width||t.height)||n||(t=Vs(e)),t&&!t.width&&!t.x&&!t.y?{x:+Hs(e,[`x`,`cx`,`x1`])||0,y:+Hs(e,[`y`,`cy`,`y1`])||0,width:0,height:0}:t},Ws=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Us(e))},Gs=function(e,t){if(t){var n=e.style,r;
vendor: 5,529 bytes, line 1
1t in ss&&t!==As&&(t=ks),n.removeProperty?(r=t.substr(0,2),(r===`ms`||t.substr(0,6)===`webkit`)&&(t=`-`+t),n.removeProperty(r===`--`?t:t.replace(fs,`-$1`).toLowerCase())):n.removeAttribute(t)}},Ks=function(e,t,n,r,i,a){var o=new Lo(e._pt,t,n,0,1,a?Ss:xs);return e._pt=o,o.b=r,o.e=i,e._props.push(n),o},qs={deg:1,rad:1,turn:1},Js={grid:1,flex:1},Ys=function e(t,n,r,i){var a=parseFloat(r)||0,o=(r+``).trim().substr((a+``).length)||`px`,s=rs.style,c=ps.test(n),l=t.tagName.toLowerCase()===`svg`,u=(l?`client`:`offset`)+(c?`Width`:`Height`),d=100,f=i===`px`,p=i===`%`,m,h,g,_;if(i===o||!a||qs[i]||qs[o])return a;if(o!==`px`&&!f&&(a=e(t,n,r,`px`)),_=t.getCTM&&Ws(t),(p||o===`%`)&&(ss[n]||~n.indexOf(`adius`)))return m=_?t.getBBox()[c?`width`:`height`]:t[u],bi(p?a/m*d:a/100*m);if(s[c?`width`:`height`]=d+(f?o:i),h=i!==`rem`&&~n.indexOf(`adius`)||i===`em`&&t.appendChild&&!l?t:t.parentNode,_&&(h=(t.ownerSVGElement||{}).parentNode),(!h||h===es||!h.appendChild)&&(h=es.body),g=h._gsap,g&&p&&g.width&&c&&g.time===Ka.time&&!g.uncache)return bi(a/g.width*d);if(p&&(n===`height`||n===`width`)){var v=t.style[n];t.style[n]=d+i,m=t[u],v?t.style[n]=v:Gs(t,n)}else(p||o===`%`)&&!Js[Ls(h,`display`)]&&(s.position=Ls(t,`position`)),h===t&&(s.position=`static`),h.appendChild(rs),m=rs[u],h.removeChild(rs),s.position=`absolute`;return c&&p&&(g=_i(h),g.time=Ka.time,g.width=h[u]),bi(f?m*a/d:m&&a?d/m*a:0)},Xs=function(e,t,n,r){var i;return ns||Bs(),t in hs&&t!==`transform`&&(t=hs[t],~t.indexOf(`,`)&&(t=t.split(`,`)[0])),ss[t]&&t!==`transform`?(i=cc(e,r),i=t===`transformOrigin`?i.svg?i.origin:lc(Ls(e,As))+` `+i.zOrigin+`px`:i[t]):(i=e.style[t],(!i||i===`auto`||r||~(i+``).indexOf(`calc(`))&&(i=tc[t]&&tc[t](e,t,n)||Ls(e,t)||vi(e,t)||+(t===`opacity`))),n&&!~(i+``).trim().indexOf(` `)?Ys(e,t,i,n)+n:i},Zs=function(e,t,n,r){if(!n||n===`none`){var i=zs(t,e,1),a=i&&Ls(e,i,1);a&&a!==n?(t=i,n=a):t===`borderColor`&&(n=Ls(e,`borderTopColor`))}var o=new Lo(this._pt,e.style,t,0,1,jo),s=0,c=0,l,u,d,f,p,m,h,g,_,v,y,b;if(o.b=n,o.e=r,n+=``,r+=``,r.substring(0,6)===`var(--`&&(r=Ls(e,r.substring(4,r.indexOf(`)`)))),r===`auto`&&(m=e.style[t],e.style[t]=r,r=Ls(e,t)||r,m?e.style[t]=m:Gs(e,t)),l=[n,r],Wa(l),n=l[0],r=l[1],d=n.match(Vr)||[],b=r.match(Vr)||[],b.length){for(;u=Vr.exec(r);)h=u[0],_=r.substring(s,u.index),p?p=(p+1)%5:(_.substr(-5)===`rgba(`||_.substr(-5)===`hsla(`)&&(p=1),h!==(m=d[c++]||``)&&(f=parseFloat(m)||0,y=m.substr((f+``).length),h.charAt(1)===`=`&&(h=Si(f,h)+y),g=parseFloat(h),v=h.substr((g+``).length),s=Vr.lastIndex-v.length,v||(v=v||mr.units[t]||y,s===r.length&&(r+=v,o.e+=v)),y!==v&&(f=Ys(e,t,m,v)||0),o._pt={_next:o._pt,p:_||c===1?_:`,`,s:f,c:g-f,m:p&&p<4||t===`zIndex`?Math.round:0});o.c=s<r.length?r.substring(s,r.length):``}else o.r=t===`display`&&r===`none`?Ss:xs;return Ur.test(r)&&(o.e=0),this._pt=o,o},Qs={top:`0%`,bottom:`100%`,left:`0%`,right:`100%`,center:`50%`},$s=function(e){var t=e.split(` `),n=t[0],r=t[1]||`50%`;return(n===`top`||n===`bottom`||r===`left`||r===`right`)&&(e=n,n=r,r=e),t[0]=Qs[n]||n,t[1]=Qs[r]||r,t.join(` `)},ec=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var n=t.t,r=n.style,i=t.u,a=n._gsap,o,s,c;if(i===`all`||i===!0)r.cssText=``,s=1;else for(i=i.split(`,`),c=i.length;--c>-1;)o=i[c],ss[o]&&(s=1,o=o===`transformOrigin`?As:ks),Gs(n,o);s&&(Gs(n,ks),a&&(a.svg&&n.removeAttribute(`transform`),r.scale=r.rotate=r.translate=`none`,cc(n,1),a.uncache=1,Ms(r)))}},tc={clearProps:function(e,t,n,r,i){if(i.data!==`isFromStart`){var a=e._pt=new Lo(e._pt,t,n,0,0,ec);return a.u=r,a.pr=-10,a.tween=i,e._props.push(n),1}}},nc=[1,0,0,1,0,0],rc={},ic=function(e){return e===`matrix(1, 0, 0, 1, 0, 0)`||e===`none`||!e},ac=function(e){var t=Ls(e,ks);return ic(t)?nc:t.substr(7).match(Br).map(bi)},oc=function(e,t){var n=e._gsap||_i(e),r=e.style,i=ac(e),a,o,s,c;return n.svg&&e.getAttribute(`transform`)?(s=e.transform.baseVal.consolidate().matrix,i=[s.a,s.b,s.c,s.d,s.e,s.f],i.join(`,`)===`1,0,0,1,0,0`?nc:i):(i===nc&&!e.offsetParent&&e!==ts&&!n.svg&&(s=r.display,r.display=`block`,a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(c=1,o=e.nextElementSibling,ts.appendChild(e)),i=ac(e),s?r.display=s:Gs(e,`display`),c&&(o?a.insertBefore(e,o):a?a.appendChild(e):ts.removeChild(e))),t&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},sc=function(e,t,n,r,i,a){var o=e._gsap,s=i||oc(e,!0),c=o.xOrigin||0,l=o.yOrigin||0,u=o.xOffset||0,d=o.yOffset||0,f=s[0],p=s[1],m=s[2],h=s[3],g=s[4],_=s[5],v=t.split(` `),y=parseFloat(v[0])||0,b=parseFloat(v[1])||0,x,S,C,w;n?s!==nc&&(S=f*h-p*m)&&(C=h/S*y+b*(-m/S)+(m*_-h*g)/S,w=y*(-p/S)+f/S*b-(f*_-p*g)/S,y=C,b=w):(x=Us(e),y=x.x+(~v[0].indexOf(`%`)?y/100*x.width:y),b=x.y+(~(v[1]||v[0]).indexOf(`%`)?b/100*x.height:b)),r||r!==!1&&o.smooth?(g=y-c,_=b-l,o.xOffset=u+(g*f+_*m)-g,o.yOffset=d+(g*p+_*h)-_):o.xOffset=o.yOffset=0,o.xOrigin=y,o.yOrigin=b,o.smooth=!!r,o.origin=t,o.originIsAbsolute=!!n,e.style[As]=`0px 0px`,a&&(Ks(a,o,`xOrigin`,c,y),Ks(a,o,`yOrigin`,l,b),Ks(a,o,`xOffset`,u,o.xOffset),Ks(a,o,`yOffset`,d,o.yOffset)),e.setAttribute(`data-svg-origin`,y+` `+b)},cc=function(e,t){var n=e._gsap||new oo(e);if(`x`in n&&!t&&!n.uncache)return n;var r=e.style,i=n.scaleX<0,a=`px`,o=`deg`,s=getComputedStyle(e),c=Ls(e,As)||`0`,l=u=d=m=h=g=_=v=y=0,u,d,f=p=1,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,ee,te,ne,re,ie;return n.svg=!!(e.getCTM&&Ws(e)),s.translate&&((s.translate!==`none`||s.scale!==`none`||s.rotate!==`none`)&&(r[ks]=(s.translate===`none`?``:`translate3d(`+(s.translate+` 0 0`).split(` `).slice(0,3).join(`, `)+`) `)+(s.rotate===`
1none`?``:`rotate(`+s.rotate+`) `)+(s.scale===`none`?``:`scale(`+s.scale.split(` `).join(`,`)+`) `)+(s[ks]===`none`?``:s[ks])),r.scale=r.rotate=r.translate=`none`),S=oc(e,n.svg),n.svg&&(n.uncache?(N=e.getBBox(),c=n.xOrigin-N.x+`px `+(n.yOrigin-N.y)+`px`,M=``):M=!t&&e.getAttribute(`data-svg-origin`),sc(e,M||c,!!M||n.originIsAbsolute,n.smooth!==!1,S)),b=n.xOrigin||0,x=n.yOrigin||0,S!==nc&&(E=S[0],D=S[1],O=S[2],k=S[3],l=A=S[4],u=j=S[5],S.length===6?(f=Math.sqrt(E*E+D*D),p=Math.sqrt(k*k+O*O),m=E||D?us(D,E)*cs:0,_=O||k?us(O,k)*cs+m:0,_&&(p*=Math.abs(Math.cos(_*ls))),n.svg&&(l-=b-(b*E+x*O),u-=x-(b*D+x*k))):(ie=S[6],ne=S[7],F=S[8],ee=S[9],te=S[10],re=S[11],l=S[12],u=S[13],d=S[14],C=us(ie,te),h=C*cs,C&&(w=Math.cos(-C),T=Math.sin(-C),M=A*w+F*T,N=j*w+ee*T,P=ie*w+te*T,F=A*-T+F*w,ee=j*-T+ee*w,te=ie*-T+te*w,re=ne*-T+re*w,A=M,j=N,ie=P),C=us(-O,te),g=C*cs,C&&(w=Math.cos(-C),T=Math.sin(-C),M=E*w-F*T,N=D*w-ee*T,P=O*w-te*T,re=k*T+re*w,E=M,D=N,O=P),C=us(D,E),m=C*cs,C&&(w=Math.cos(C),T=Math.sin(C),M=E*w+D*T,N=A*w+j*T,D=D*w-E*T,j=j*w-A*T,E=M,A=N),h&&Math.abs(h)+Math.abs(m)>359.9&&(h=m=0,g=180-g),f=bi(Math.sqrt(E*E+D*D+O*O)),p=bi(Math.sqrt(j*j+ie*ie)),C=us(A,j),_=Math.abs(C)>2e-4?C*cs:0,y=re?1/(re<0?-re:re):0),n.svg&&(M=e.getAttribute(`transform`),n.forceCSS=e.setAttribute(`transform`,``)||!ic(Ls(e,ks)),M&&e.setAttribute(`transform`,M))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(f*=-1,_+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,_+=_<=0?180:-180)),t||=n.uncache,n.x=l-((n.xPercent=l&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-l)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+a,n.y=u-((n.yPercent=u&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-u)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+a,n.z=d+a,n.scaleX=bi(f),n.scaleY=bi(p),n.rotation=bi(m)+o,n.rotationX=bi(h)+o,n.rotationY=bi(g)+o,n.skewX=_+o,n.skewY=v+o,n.transformPerspective=y+a,(n.zOrigin=parseFloat(c.split(` `)[2])||!t&&n.zOrigin||0)&&(r[As]=lc(c)),n.xOffset=n.yOffset=0,n.force3D=mr.force3D,n.renderTransform=n.svg?gc:Fs?hc:dc,n.uncache=0,n},lc=function(e){return(e=e.split(` `))[0]+` `+e[1]},uc=function(e,t,n){var r=la(t);return bi(parseFloat(t)+parseFloat(Ys(e,`x`,n+`px`,r)))+r},dc=function(e,t){t.z=`0px`,t.rotationY=t.rotationX=`0deg`,t.force3D=0,hc(e,t)},fc=`0deg`,pc=`0px`,mc=`) `,hc=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,a=n.x,o=n.y,s=n.z,c=n.rotation,l=n.rotationY,u=n.rotationX,d=n.skewX,f=n.skewY,p=n.scaleX,m=n.scaleY,h=n.transformPerspective,g=n.force3D,_=n.target,v=n.zOrigin,y=``,b=g===`auto`&&e&&e!==1||g===!0;if(v&&(u!==fc||l!==fc)){var x=parseFloat(l)*ls,S=Math.sin(x),C=Math.cos(x),w;x=parseFloat(u)*ls,w=Math.cos(x),a=uc(_,a,S*w*-v),o=uc(_,o,-Math.sin(x)*-v),s=uc(_,s,C*w*-v+v)}h!==pc&&(y+=`perspective(`+h+mc),(r||i)&&(y+=`translate(`+r+`%, `+i+`%) `),(b||a!==pc||o!==pc||s!==pc)&&(y+=s!==pc||b?`translate3d(`+a+`, `+o+`, `+s+`) `:`translate(`+a+`, `+o+mc),c!==fc&&(y+=`rotate(`+c+mc),l!==fc&&(y+=`rotateY(`+l+mc),u!==fc&&(y+=`rotateX(`+u+mc),(d!==fc||f!==fc)&&(y+=`skew(`+d+`, `+f+mc),(p!==1||m!==1)&&(y+=`scale(`+p+`, `+m+mc),_.style[ks]=y||`translate(0, 0)`},gc=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,a=n.x,o=n.y,s=n.rotation,c=n.skewX,l=n.skewY,u=n.scaleX,d=n.scaleY,f=n.target,p=n.xOrigin,m=n.yOrigin,h=n.xOffset,g=n.yOffset,_=n.forceCSS,v=parseFloat(a),y=parseFloat(o),b,x,S,C,w;
vendor: 4,323 bytes, line 1
1s=parseFloat(s),c=parseFloat(c),l=parseFloat(l),l&&(l=parseFloat(l),c+=l,s+=l),s||c?(s*=ls,c*=ls,b=Math.cos(s)*u,x=Math.sin(s)*u,S=Math.sin(s-c)*-d,C=Math.cos(s-c)*d,c&&(l*=ls,w=Math.tan(c-l),w=Math.sqrt(1+w*w),S*=w,C*=w,l&&(w=Math.tan(l),w=Math.sqrt(1+w*w),b*=w,x*=w)),b=bi(b),x=bi(x),S=bi(S),C=bi(C)):(b=u,C=d,x=S=0),(v&&!~(a+``).indexOf(`px`)||y&&!~(o+``).indexOf(`px`))&&(v=Ys(f,`x`,a,`px`),y=Ys(f,`y`,o,`px`)),(p||m||h||g)&&(v=bi(v+p-(p*b+m*S)+h),y=bi(y+m-(p*x+m*C)+g)),(r||i)&&(w=f.getBBox(),v=bi(v+r/100*w.width),y=bi(y+i/100*w.height)),w=`matrix(`+b+`,`+x+`,`+S+`,`+C+`,`+v+`,`+y+`)`,f.setAttribute(`transform`,w),_&&(f.style[ks]=w)},_c=function(e,t,n,r,i){var a=360,o=Dr(i),s=parseFloat(i)*(o&&~i.indexOf(`rad`)?cs:1)-r,c=r+s+`deg`,l,u;return o&&(l=i.split(`_`)[1],l===`short`&&(s%=a,s!==s%(a/2)&&(s+=s<0?a:-a)),l===`cw`&&s<0?s=(s+a*ds)%a-~~(s/a)*a:l===`ccw`&&s>0&&(s=(s-a*ds)%a-~~(s/a)*a)),e._pt=u=new Lo(e._pt,t,n,r,s,_s),u.e=c,u.u=`deg`,e._props.push(n),u},vc=function(e,t){for(var n in t)e[n]=t[n];return e},yc=function(e,t,n){var r=vc({},n._gsap),i=`perspective,force3D,transformOrigin,svgOrigin`,a=n.style,o,s,c,l,u,d,f,p;for(s in r.svg?(c=n.getAttribute(`transform`),n.setAttribute(`transform`,``),a[ks]=t,o=cc(n,1),Gs(n,ks),n.setAttribute(`transform`,c)):(c=getComputedStyle(n)[ks],a[ks]=t,o=cc(n,1),a[ks]=c),ss)c=r[s],l=o[s],c!==l&&i.indexOf(s)<0&&(f=la(c),p=la(l),u=f===p?parseFloat(c):Ys(n,s,c,p),d=parseFloat(l),e._pt=new Lo(e._pt,o,s,u,d-u,gs),e._pt.u=p||0,e._props.push(s));vc(o,r)},yi(`padding,margin,Width,Radius`,function(e,t){var n=`Top`,r=`Right`,i=`Bottom`,a=`Left`,o=(t<3?[n,r,i,a]:[n+a,n+r,i+r,i+a]).map(function(n){return t<2?e+n:`border`+n+e});tc[t>1?`border`+e:e]=function(e,t,n,r,i){var a,s;if(arguments.length<4)return a=o.map(function(t){return Xs(e,t,n)}),s=a.join(` `),s.split(a[0]).length===5?a[0]:s;a=(r+``).split(` `),s={},o.forEach(function(e,t){return s[e]=a[t]=a[t]||a[(t-1)/2|0]}),e.init(t,s,i)}}),bc={name:`css`,register:Bs,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,r,i){var a=this._props,o=e.style,s=n.vars.startAt,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w;for(m in ns||Bs(),this.styles=this.styles||Ps(e),C=this.styles.props,this.tween=n,t)if(m!==`autoRound`&&(l=t[m],!(di[m]&&po(m,t,n,r,e,i)))){if(f=typeof l,p=tc[m],f===`function`&&(l=l.call(n,r,e,i),f=typeof l),f===`string`&&~l.indexOf(`random(`)&&(l=Da(l)),p)p(this,e,m,l,n)&&(S=1);else if(m.substr(0,2)===`--`)c=(getComputedStyle(e).getPropertyValue(m)+``).trim(),l+=``,Ha.lastIndex=0,Ha.test(c)||(h=la(c),g=la(l),g?h!==g&&(c=Ys(e,m,c,g)+g):h&&(l+=h)),this.add(o,`setProperty`,c,l,r,i,0,0,m),a.push(m),C.push(m,0,o[m]);else if(f!==`undefined`){if(s&&m in s?(c=typeof s[m]==`function`?s[m].call(n,r,e,i):s[m],Dr(c)&&~c.indexOf(`random(`)&&(c=Da(c)),la(c+``)||c===`auto`||(c+=mr.units[m]||la(Xs(e,m))||``),(c+``).charAt(1)===`=`&&(c=Xs(e,m))):c=Xs(e,m),d=parseFloat(c),_=f===`string`&&l.charAt(1)===`=`&&l.substr(0,2),_&&(l=l.substr(2)),u=parseFloat(l),m in hs&&(m===`autoAlpha`&&(d===1&&Xs(e,`visibility`)===`hidden`&&u&&(d=0),C.push(`visibility`,0,o.visibility),Ks(this,o,`visibility`,d?`inherit`:`hidden`,u?`inherit`:`hidden`,!u)),m!==`scale`&&m!==`transform`&&(m=hs[m],~m.indexOf(`,`)&&(m=m.split(`,`)[0]))),v=m in ss,v){if(this.styles.save(m),w=l,f===`string`&&l.substring(0,6)===`var(--`){if(l=Ls(e,l.substring(4,l.indexOf(`)`))),l.substring(0,5)===`calc(`){var T=e.style.perspective;e.style.perspective=l,l=Ls(e,`perspective`),T?e.style.perspective=T:Gs(e,`perspective`)}u=parseFloat(l)}if(y||(b=e._gsap,b.renderTransform&&!t.parseTransform||cc(e,t.parseTransform),x=t.smoothOrigin!==!1&&b.smooth,y=this._pt=new Lo(this._pt,o,ks,0,1,b.renderTransform,b,0,-1),y.dep=1),m===`scale`)this._pt=new Lo(this._pt,b,`scaleY`,b.scaleY,(_?Si(b.scaleY,_+u):u)-b.scaleY||0,gs),this._pt.u=0,a.push(`scaleY`,m),m+=`X`;else if(m===`transformOrigin`){C.push(As,0,o[As]),l=$s(l),b.svg?sc(e,l,0,x,0,this):(g=parseFloat(l.split(` `)[2])||0,g!==b.zOrigin&&Ks(this,b,`zOrigin`,b.zOrigin,g),Ks(this,o,m,lc(c),lc(l)));continue}else if(m===`svgOrigin`){sc(e,l,1,x,0,this);continue}else if(m in rc){_c(this,b,m,d,_?Si(d,_+l):l);continue}else if(m===`smoothOrigin`){Ks(this,b,`smooth`,b.smooth,l);continue}else if(m===`force3D`){b[m]=l;continue}else if(m===`transform`){yc(this,l,e);continue}}else m in o||(m=zs(m)||m);
1if(v||(u||u===0)&&(d||d===0)&&!ms.test(l)&&m in o)h=(c+``).substr((d+``).length),u||=0,g=la(l)||(m in mr.units?mr.units[m]:h),h!==g&&(d=Ys(e,m,c,g)),this._pt=new Lo(this._pt,v?b:o,m,d,(_?Si(d,_+u):u)-d,!v&&(g===`px`||m===`zIndex`)&&t.autoRound!==!1?bs:gs),this._pt.u=g||0,v&&w!==l?(this._pt.b=c,this._pt.e=w,this._pt.r=ys):h!==g&&g!==`%`&&(this._pt.b=c,this._pt.r=vs);else if(m in o)Zs.call(this,e,m,c,_?_+l:l);else if(m in e)this.add(e,m,c||e[m],_?_+l:l,r,i);else if(m!==`parseTransform`){ei(m,l);continue}v||(m in o?C.push(m,0,o[m]):typeof e[m]==`function`?C.push(m,2,e[m]()):C.push(m,1,c||e[m])),a.push(m)}}S&&Io(this)},render:function(e,t){if(t.tween._time||!as())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:Xs,aliases:hs,getSetter:function(e,t,n){var r=hs[t];return r&&r.indexOf(`,`)<0&&(t=r),t in ss&&t!==As&&(e._gsap.x||Xs(e,`x`))?n&&is===n?t===`scale`?Es:Ts:(is=n||{})&&(t===`scale`?Ds:Os):e.style&&!Ar(e.style[t])?Cs:~t.indexOf(`-`)?ws:Oo(e,t)},core:{_removeProperty:Gs,_getMatrix:oc}},Zo.utils.checkPrefix=zs,Zo.core.getStyleSaver=Ps,(function(e,t,n,r){var i=yi(e+`,`+t+`,`+n,function(e){ss[e]=1});yi(t,function(e){mr.units[e]=`deg`,rc[e]=1}),hs[i[13]]=e+`,`+t,yi(r,function(e){var t=e.split(`:`);hs[t[1]]=i[t[0]]})})(`x,y,z,scale,scaleX,scaleY,xPercent,yPercent`,`rotation,rotationX,rotationY,skewX,skewY`,`transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective`,`0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY`),yi(`x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective`,function(e){mr.units[e]=`px`}),Zo.registerPlugin(bc)})),Sc,Cc=i((()=>{Qo(),xc(),Sc=Zo.registerPlugin(bc)||Zo,Sc.core.Tween}));function wc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tc(e,t,n){return t&&wc(e.prototype,t),n&&wc(e,n),e}var Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl=i((()=>{zc=function(){return Ec||typeof window<`u`&&(Ec=window.gsap)&&Ec.registerPlugin&&Ec},Bc=1,Vc=[],Hc=[],Uc=[],Wc=Date.now,Gc=function(e,t){return t},Kc=function(){var e=Pc.core,t=e.bridge||{},n=e._scrollers,r=e._proxies;n.push.apply(n,Hc),r.push.apply(r,Uc),Hc=n,Uc=r,Gc=function(e,n){return t[e](n)}},qc=function(e,t){return~Uc.indexOf(e)&&Uc[Uc.indexOf(e)+1][t]},Jc=function(e){return!!~Fc.indexOf(e)},Yc=function(e,t,n,r,i){return e.addEventListener(t,n,{passive:r!==!1,capture:!!i})},Xc=function(e,t,n,r){return e.removeEventListener(t,n,!!r)},Zc=`scrollLeft`,Qc=`scrollTop`,$c=function(){return Ic&&Ic.isPressed||Hc.cache++},el=function(e,t){var n=function n(r){if(r||r===0){Bc&&(Oc.history.scrollRestoration=`manual`);var i=Ic&&Ic.isPressed;r=n.v=Math.round(r)||(Ic&&Ic.iOS?1:0),e(r),n.cacheID=Hc.cache,i&&Gc(`ss`,r)}else(t||Hc.cache!==n.cacheID||Gc(`ref`))&&(n.cacheID=Hc.cache,n.v=e());return n.v+n.offset};return n.offset=0,e&&n},tl={s:Zc,p:`left`,p2:`Left`,os:`right`,os2:`Right`,d:`width`,d2:`Width`,a:`x`,sc:el(function(e){return arguments.length?Oc.scrollTo(e,nl.sc()):Oc.pageXOffset||kc[Zc]||Ac[Zc]||jc[Zc]||0})},nl={s:Qc,p:`top`,p2:`Top`,os:`bottom`,os2:`Bottom`,d:`height`,d2:`Height`,a:`y`,op:tl,sc:el(function(e){return arguments.length?Oc.scrollTo(tl.sc(),e):Oc.pageYOffset||kc[Qc]||Ac[Qc]||jc[Qc]||0})},rl=function(e,t){return(t&&t._ctx&&t._ctx.selector||Ec.utils.toArray)(e)[0]||(typeof e==`string`&&Ec.config().nullTargetWarn!==!1?console.warn(`Element not found:`,e):null)},il=function(e,t){for(var n=t.length;n--;)if(t[n]===e||t[n].contains(e))return!0;return!1},al=function(e,t){var n=t.s,r=t.sc;Jc(e)&&(e=kc.scrollingElement||Ac);var i=Hc.indexOf(e),a=r===nl.sc?1:2;!~i&&(i=Hc.push(e)-1),Hc[i+a]||Yc(e,`scroll`,$c);var o=Hc[i+a],s=o||(Hc[i+a]=el(qc(e,n),!0)||(Jc(e)?r:el(function(t){return arguments.length?e[n]=t:e[n]})));return s.target=e,o||(s.smooth=Ec.getProperty(e,`scrollBehavior`)===`smooth`),s},ol=function(e,t,n){var r=e,i=e,a=Wc(),o=a,s=t||50,c=Math.max(500,s*3),l=function(e,t){var c=Wc();t||c-a>s?(i=r,r=e,o=a,a=c):n?r+=e:r=i+(e-i)/(c-o)*(a-o)};return{update:l,reset:function(){i=r=n?0:r,o=a=0},getVelocity:function(e){var t=o,s=i,u=Wc();return(e||e===0)&&e!==r&&l(e),a===o||u-o>c?0:(r+(n?s:-s))/((n?u:a)-t)*1e3}}},sl=function(e,t){return t&&!e._gsapAllow&&e.cancelable!==!1&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},cl=function(e){var t=Math.max.apply(Math,e),n=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(n)?t:n},ll=function(){Pc=Ec.core.globals().ScrollTrigger,Pc&&Pc.core&&Kc()},ul=function(e){return Ec=e||zc(),!Dc&&Ec&&typeof document<`u`&&document.body&&(Oc=window,kc=document,Ac=kc.documentElement,jc=kc.body,Fc=[Oc,kc,Ac,jc],Ec.utils.clamp,Rc=Ec.core.context||function(){},Nc=`onpointerenter`in jc?`pointer`:`mouse`,Mc=dl.isTouch=Oc.matchMedia&&Oc.matchMedia(`(hover: none), (pointer: coarse)`).matches?1:`ontouchstart`in Oc||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,Lc=dl.eventTypes=(`ontouchstart`in Ac?`touchstart,touchmove,touchcancel,touchend`:`onpointerdown`in Ac?`pointerdown,pointermove,pointercancel,pointerup`:`mousedown,mousemove,mouseup,mouseup`).split(`,`),setTimeout(function(){return Bc=0},500),Dc=1),Pc||ll(),Dc},tl.op=nl,Hc.cache=0,dl=function(){function e(e){this.init(e)}var t=e.prototype;return t.init=function(e){Dc||ul(Ec)||console.warn(`Please gsap.registerPlugin(Observer)`),Pc||ll();var t=e.tolerance,n=e.dragMinimum,r=e.type,i=e.target,a=e.lineHeight,o=e.debounce,s=e.preventDefault,c=e.onStop,l=e.onStopDelay,u=e.ignore,d=e.wheelSpeed,f=e.event,p=e.onDragStart,m=e.onDragEnd,h=e.onDrag,g=e.onPress,_=e.onRelease,v=e.onRight,y=e.onLeft,b=e.onUp,x=e.onDown,S=e.onCh
vendor: 5,635 bytes, line 1
1angeX,C=e.onChangeY,w=e.onChange,T=e.onToggleX,E=e.onToggleY,D=e.onHover,O=e.onHoverEnd,k=e.onMove,A=e.ignoreCheck,j=e.isNormalizer,M=e.onGestureStart,N=e.onGestureEnd,P=e.onWheel,F=e.onEnable,ee=e.onDisable,te=e.onClick,ne=e.scrollSpeed,re=e.capture,ie=e.allowClicks,I=e.lockAxis,ae=e.onLockAxis;this.target=i=rl(i)||Ac,this.vars=e,u&&=Ec.utils.toArray(u),t||=1e-9,n||=0,d||=1,ne||=1,r||=`wheel,touch,pointer`,o=o!==!1,a||=parseFloat(Oc.getComputedStyle(jc).lineHeight)||22;var L,oe,se,ce,R,le,z,B=this,V=0,ue=0,de=e.passive||!s&&e.passive!==!1,fe=al(i,tl),pe=al(i,nl),me=fe(),he=pe(),H=~r.indexOf(`touch`)&&!~r.indexOf(`pointer`)&&Lc[0]===`pointerdown`,U=Jc(i),W=i.ownerDocument||kc,ge=[0,0,0],G=[0,0,0],_e=0,K=function(){return _e=Wc()},q=function(e,t){return(B.event=e)&&u&&il(e.target,u)||t&&H&&e.pointerType!==`touch`||A&&A(e,t)},ve=function(){B._vx.reset(),B._vy.reset(),oe.pause(),c&&c(B)},ye=function(){var e=B.deltaX=cl(ge),n=B.deltaY=cl(G),r=Math.abs(e)>=t,i=Math.abs(n)>=t;w&&(r||i)&&w(B,e,n,ge,G),r&&(v&&B.deltaX>0&&v(B),y&&B.deltaX<0&&y(B),S&&S(B),T&&B.deltaX<0!=V<0&&T(B),V=B.deltaX,ge[0]=ge[1]=ge[2]=0),i&&(x&&B.deltaY>0&&x(B),b&&B.deltaY<0&&b(B),C&&C(B),E&&B.deltaY<0!=ue<0&&E(B),ue=B.deltaY,G[0]=G[1]=G[2]=0),(ce||se)&&(k&&k(B),se&&=(p&&se===1&&p(B),h&&h(B),0),ce=!1),le&&!(le=!1)&&ae&&ae(B),R&&=(P(B),!1),L=0},be=function(e,t,n){ge[n]+=e,G[n]+=t,B._vx.update(e),B._vy.update(t),o?L||=requestAnimationFrame(ye):ye()},xe=function(e,t){I&&!z&&(B.axis=z=Math.abs(e)>Math.abs(t)?`x`:`y`,le=!0),z!==`y`&&(ge[2]+=e,B._vx.update(e,!0)),z!==`x`&&(G[2]+=t,B._vy.update(t,!0)),o?L||=requestAnimationFrame(ye):ye()},Se=function(e){if(!q(e,1)){e=sl(e,s);var t=e.clientX,r=e.clientY,i=t-B.x,a=r-B.y,o=B.isDragging;B.x=t,B.y=r,(o||(i||a)&&(Math.abs(B.startX-t)>=n||Math.abs(B.startY-r)>=n))&&(se||=o?2:1,o||(B.isDragging=!0),xe(i,a))}},Ce=B.onPress=function(e){q(e,1)||e&&e.button||(B.axis=z=null,oe.pause(),B.isPressed=!0,e=sl(e),V=ue=0,B.startX=B.x=e.clientX,B.startY=B.y=e.clientY,B._vx.reset(),B._vy.reset(),Yc(j?i:W,Lc[1],Se,de,!0),B.deltaX=B.deltaY=0,g&&g(B))},we=B.onRelease=function(e){if(!q(e,1)){Xc(j?i:W,Lc[1],Se,!0);var t=!isNaN(B.y-B.startY),n=B.isDragging,r=n&&(Math.abs(B.x-B.startX)>3||Math.abs(B.y-B.startY)>3),a=sl(e);!r&&t&&(B._vx.reset(),B._vy.reset(),s&&ie&&Ec.delayedCall(.08,function(){if(Wc()-_e>300&&!e.defaultPrevented){if(e.target.click)e.target.click();else if(W.createEvent){var t=W.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,Oc,1,a.screenX,a.screenY,a.clientX,a.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(t)}}})),B.isDragging=B.isGesturing=B.isPressed=!1,c&&n&&!j&&oe.restart(!0),se&&ye(),m&&n&&m(B),_&&_(B,r)}},J=function(e){return e.touches&&e.touches.length>1&&(B.isGesturing=!0)&&M(e,B.isDragging)},Te=function(){return(B.isGesturing=!1)||N(B)},Ee=function(e){if(!q(e)){var t=fe(),n=pe();be((t-me)*ne,(n-he)*ne,1),me=t,he=n,c&&oe.restart(!0)}},De=function(e){if(!q(e)){e=sl(e,s),P&&(R=!0);var t=(e.deltaMode===1?a:e.deltaMode===2?Oc.innerHeight:1)*d;be(e.deltaX*t,e.deltaY*t,0),c&&!j&&oe.restart(!0)}},Oe=function(e){if(!q(e)){var t=e.clientX,n=e.clientY,r=t-B.x,i=n-B.y;B.x=t,B.y=n,ce=!0,c&&oe.restart(!0),(r||i)&&xe(r,i)}},ke=function(e){B.event=e,D(B)},Ae=function(e){B.event=e,O(B)},je=function(e){return q(e)||sl(e,s)&&te(B)};oe=B._dc=Ec.delayedCall(l||.25,ve).pause(),B.deltaX=B.deltaY=0,B._vx=ol(0,50,!0),B._vy=ol(0,50,!0),B.scrollX=fe,B.scrollY=pe,B.isDragging=B.isGesturing=B.isPressed=!1,Rc(this),B.enable=function(e){return B.isEnabled||(Yc(U?W:i,`scroll`,$c),r.indexOf(`scroll`)>=0&&Yc(U?W:i,`scroll`,Ee,de,re),r.indexOf(`wheel`)>=0&&Yc(i,`wheel`,De,de,re),(r.indexOf(`touch`)>=0&&Mc||r.indexOf(`pointer`)>=0)&&(Yc(i,Lc[0],Ce,de,re),Yc(W,Lc[2],we),Yc(W,Lc[3],we),ie&&Yc(i,`click`,K,!0,!0),te&&Yc(i,`click`,je),M&&Yc(W,`gesturestart`,J),N&&Yc(W,`gestureend`,Te),D&&Yc(i,Nc+`enter`,ke),O&&Yc(i,Nc+`leave`,Ae),k&&Yc(i,Nc+`move`,Oe)),B.isEnabled=!0,B.isDragging=B.isGesturing=B.isPressed=ce=se=!1,B._vx.reset(),B._vy.reset(),me=fe(),he=pe(),e&&e.type&&Ce(e),F&&F(B)),B},B.disable=function(){B.isEnabled&&(Vc.filter(function(e){return e!==B&&Jc(e.target)}).length||Xc(U?W:i,`scroll`,$c),B.isPressed&&(B._vx.reset(),B._vy.reset(),Xc(j?i:W,Lc[1],Se,!0)),Xc(U?W:i,`scroll`,Ee,re),Xc(i,`wheel`,De,re),Xc(i,Lc[0],Ce,re),Xc(W,Lc[2],we),Xc(W,Lc[3],we),Xc(i,`click`,K,!0),Xc(i,`click`,je),Xc(W,`gesturestart`,J),Xc(W,`gestureend`,Te),Xc(i,Nc+`enter`,ke),Xc(i,Nc+`leave`,Ae),Xc(i,Nc+`move`,Oe),B.isEnabled=B.isPressed=B.isDragging=!1,ee&&ee(B))},B.kill=B.revert=function(){B.disable();var e=Vc.indexOf(B);e>=0&&Vc.splice(e,1),Ic===B&&(Ic=0)},Vc.push(B),j&&Jc(i)&&(Ic=B),B.enable(f)},Tc(e,[{key:`velocityX`,get:function(){return this._vx.getVelocity()}},{key:`velocityY`,get:function(){return this._vy.getVelocity()}}]),e}(),dl.version=`3.15.0`,dl.create=function(e){return new dl(e)},dl.register=ul,dl.getAll=function(){return Vc.slice()},dl.getById=function(e){return Vc.filter(function(t){return t.vars.id===e})[0]},zc()&&Ec.registerPlugin(dl)})),Y,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd=i((()=>{fl(),Kl=1,ql=Date.now,Jl=ql(),Yl=0,Xl=0,Zl=function(e,t,n){var r=pu(e)&&(e.substr(0,6)===`clamp(`||e.indexOf(`max`)>-1);return n[`_`+t+`Clamp`]=r,r?e.substr(6,e.length-7):e}
vendor: 4,691 bytes, line 1
1,Ql=function(e,t){return t&&(!pu(e)||e.substr(0,6)!==`clamp(`)?`clamp(`+e+`)`:e},$l=function e(){return Xl&&requestAnimationFrame(e)},eu=function(){return Tl=1},tu=function(){return Tl=0},nu=function(e){return e},ru=function(e){return Math.round(e*1e5)/1e5||0},iu=function(){return typeof window<`u`},au=function(){return Y||iu()&&(Y=window.gsap)&&Y.registerPlugin&&Y},ou=function(e){return!!~vl.indexOf(e)},su=function(e){return(e===`Height`?Hl:ml[`inner`+e])||gl[`client`+e]||_l[`client`+e]},cu=function(e){return qc(e,`getBoundingClientRect`)||(ou(e)?function(){return Fd.width=ml.innerWidth,Fd.height=Hl,Fd}:function(){return Ru(e)})},lu=function(e,t,n){var r=n.d,i=n.d2,a=n.a;return(a=qc(e,`getBoundingClientRect`))?function(){return a()[r]}:function(){return(t?su(i):e[`client`+i])||0}},uu=function(e,t){return!t||~Uc.indexOf(e)?cu(e):function(){return Fd}},du=function(e,t){var n=t.s,r=t.d2,i=t.d,a=t.a;return Math.max(0,(n=`scroll`+r)&&(a=qc(e,n))?a()-cu(e)()[i]:ou(e)?(gl[n]||_l[n])-su(r):e[n]-e[`offset`+r])},fu=function(e,t){for(var n=0;n<Al.length;n+=3)(!t||~t.indexOf(Al[n+1]))&&e(Al[n],Al[n+1],Al[n+2])},pu=function(e){return typeof e==`string`},mu=function(e){return typeof e==`function`},hu=function(e){return typeof e==`number`},gu=function(e){return typeof e==`object`},_u=function(e,t,n){return e&&e.progress(+!t)&&n&&e.pause()},vu=function(e,t,n){if(e.enabled){var r=e._ctx?e._ctx.add(function(){return t(e,n)}):t(e,n);r&&r.totalTime&&(e.callbackAnimation=r)}},yu=Math.abs,bu=`left`,xu=`top`,Su=`right`,Cu=`bottom`,wu=`width`,Tu=`height`,Eu=`Right`,Du=`Left`,Ou=`Top`,ku=`Bottom`,Au=`padding`,ju=`margin`,Mu=`Width`,Nu=`Height`,Pu=`px`,Fu=function(e){return ml.getComputedStyle(e.nodeType===Node.DOCUMENT_NODE?e.scrollingElement:e)},Iu=function(e){var t=Fu(e).position;e.style.position=t===`absolute`||t===`fixed`?t:`relative`},Lu=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},Ru=function(e,t){var n=t&&Fu(e)[El]!==`matrix(1, 0, 0, 1, 0, 0)`&&Y.to(e,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),r=e.getBoundingClientRect?e.getBoundingClientRect():e.scrollingElement.getBoundingClientRect();return n&&n.progress(0).kill(),r},zu=function(e,t){var n=t.d2;return e[`offset`+n]||e[`client`+n]||0},Bu=function(e){var t=[],n=e.labels,r=e.duration(),i;for(i in n)t.push(n[i]/r);return t},Vu=function(e){return function(t){return Y.utils.snap(Bu(e),t)}},Hu=function(e){var t=Y.utils.snap(e),n=Array.isArray(e)&&e.slice(0).sort(function(e,t){return e-t});return n?function(e,r,i){i===void 0&&(i=.001);var a;if(!r)return t(e);if(r>0){for(e-=i,a=0;a<n.length;a++)if(n[a]>=e)return n[a];return n[a-1]}for(a=n.length,e+=i;a--;)if(n[a]<=e)return n[a];return n[0]}:function(n,r,i){i===void 0&&(i=.001);var a=t(n);return!r||Math.abs(a-n)<i||a-n<0==r<0?a:t(r<0?n-e:n+e)}},Uu=function(e){return function(t,n){return Hu(Bu(e))(t,n.direction)}},Wu=function(e,t,n,r){return n.split(`,`).forEach(function(n){return e(t,n,r)})},Gu=function(e,t,n,r,i){return e.addEventListener(t,n,{passive:!r,capture:!!i})},Ku=function(e,t,n,r){return e.removeEventListener(t,n,!!r)},qu=function(e,t,n){n&&=n.wheelHandler,n&&(e(t,`wheel`,n),e(t,`touchmove`,n))},Ju={startColor:`green`,endColor:`red`,indent:0,fontSize:`16px`,fontWeight:`normal`},Yu={toggleActions:`play`,anticipatePin:0},Xu={top:0,left:0,center:.5,bottom:1,right:1},Zu=function(e,t){if(pu(e)){var n=e.indexOf(`=`),r=~n?+(e.charAt(n-1)+1)*parseFloat(e.substr(n+1)):0;~n&&(e.indexOf(`%`)>n&&(r*=t/100),e=e.substr(0,n-1)),e=r+(e in Xu?Xu[e]*t:~e.indexOf(`%`)?parseFloat(e)*t/100:parseFloat(e)||0)}return e},Qu=function(e,t,n,r,i,a,o,s){var c=i.startColor,l=i.endColor,u=i.fontSize,d=i.indent,f=i.fontWeight,p=hl.createElement(`div`),m=ou(n)||qc(n,`pinType`)===`fixed`,h=e.indexOf(`scroller`)!==-1,g=m?_l:n.tagName===`IFRAME`?n.contentDocument.body:n,_=e.indexOf(`start`)!==-1,v=_?c:l,y=`border-color:`+v+`;font-size:`+u+`;color:`+v+`;font-weight:`+f+`;pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;`;return y+=`position:`+((h||s)&&m?`fixed;`:`absolute;`),(h||s||!m)&&(y+=(r===nl?Su:Cu)+`:`+(a+parseFloat(d))+`px;`),o&&(y+=`box-sizing:border-box;text-align:left;width:`+o.offsetWidth+`px;`),p._isStart=_,p.setAttribute(`class`,`gsap-marker-`+e+(t?` marker-`+t:``)),p.style.cssText=y,p.innerText=t||t===0?e+`-`+t:e,g.children[0]?g.insertBefore(p,g.children[0]):g.appendChild(p),p._offset=p[`offset`+r.op.d2],$u(p,0,r,_),p},$u=function(e,t,n,r){var i={display:`block`},a=n[r?`os2`:`p2`],o=n[r?`p2`:`os2`];e._isFlipped=r,i[n.a+`Percent`]=r?-100:0,i[n.a]=r?`1px`:0,i[`border`+a+Mu]=1,i[`border`+
vendor: 6,981 bytes, line 1
1o+Mu]=0,i[n.p]=t+`px`,Y.set(e,i)},ed=[],td={},rd=function(){return ql()-Yl>34&&(nd||=requestAnimationFrame(Ed))},id=function(){(!Pl||!Pl.isPressed||Pl.startX>_l.clientWidth)&&(Hc.cache++,Pl?nd||=requestAnimationFrame(Ed):Ed(),Yl||ud(`scrollStart`),Yl=ql())},ad=function(){Ll=ml.innerWidth,Il=ml.innerHeight},od=function(e){Hc.cache++,(e===!0||!wl&&!Nl&&!hl.fullscreenElement&&!hl.webkitFullscreenElement&&(!Fl||Ll!==ml.innerWidth||Math.abs(ml.innerHeight-Il)>ml.innerHeight*.25))&&yl.restart(!0)},sd={},cd=[],ld=function e(){return Ku(Hd,`scrollEnd`,e)||Sd(!0)},ud=function(e){return sd[e]&&sd[e].map(function(e){return e()})||cd},dd=[],fd=function(e){for(var t=0;t<dd.length;t+=5)(!e||dd[t+4]&&dd[t+4].query===e)&&(dd[t].style.cssText=dd[t+1],dd[t].getBBox&&dd[t].setAttribute(`transform`,dd[t+2]||``),dd[t+3].uncache=1)},pd=function(){return Hc.forEach(function(e){return mu(e)&&++e.cacheID&&(e.rec=e())})},md=function(e,t){var n;for(Dl=0;Dl<ed.length;Dl++)n=ed[Dl],n&&(!t||n._ctx===t)&&(e?n.kill(1):n.revert(!0,!0));Ul=!0,t&&fd(t),t||ud(`revert`)},hd=function(e,t){Hc.cache++,(t||!gd)&&Hc.forEach(function(e){return mu(e)&&e.cacheID++&&(e.rec=0)}),pu(e)&&(ml.history.scrollRestoration=Bl=e)},_d=0,yd=function(){if(vd!==_d){var e=vd=_d;requestAnimationFrame(function(){return e===_d&&Sd(!0)})}},bd=function(){_l.appendChild(Vl),Hl=!Pl&&Vl.offsetHeight||ml.innerHeight,_l.removeChild(Vl)},xd=function(e){return bl(`.gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end`).forEach(function(t){return t.style.display=e?`none`:`block`})},Sd=function(e,t){if(gl=hl.documentElement,_l=hl.body,vl=[ml,hl,gl,_l],Yl&&!e&&!Ul){Gu(Hd,`scrollEnd`,ld);return}bd(),gd=Hd.isRefreshing=!0,Ul||pd();var n=ud(`refreshInit`);jl&&Hd.sort(),t||md(),Hc.forEach(function(e){mu(e)&&(e.smooth&&(e.target.style.scrollBehavior=`auto`),e(0))}),ed.slice(0).forEach(function(e){return e.refresh()}),Ul=!1,ed.forEach(function(e){if(e._subPinOffset&&e.pin){var t=e.vars.horizontal?`offsetWidth`:`offsetHeight`,n=e.pin[t];e.revert(!0,1),e.adjustPinSpacing(e.pin[t]-n),e.refresh()}}),Wl=1,xd(!0),ed.forEach(function(e){var t=du(e.scroller,e._dir),n=e.vars.end===`max`||e._endClamp&&e.end>t,r=e._startClamp&&e.start>=t;(n||r)&&e.setPositions(r?t-1:e.start,n?Math.max(r?t:e.start+1,t):e.end,!0)}),xd(!1),Wl=0,n.forEach(function(e){return e&&e.render&&e.render(-1)}),Hc.forEach(function(e){mu(e)&&(e.smooth&&requestAnimationFrame(function(){return e.target.style.scrollBehavior=`smooth`}),e.rec&&e(e.rec))}),hd(Bl,1),yl.pause(),_d++,gd=2,Ed(2),ed.forEach(function(e){return mu(e.vars.onRefresh)&&e.vars.onRefresh(e)}),gd=Hd.isRefreshing=!1,ud(`refresh`)},Cd=0,wd=1,Ed=function(e){if(e===2||!gd&&!Ul){Hd.isUpdating=!0,Td&&Td.update(0);var t=ed.length,n=ql(),r=n-Jl>=50,i=t&&ed[0].scroll();if(wd=Cd>i?-1:1,gd||(Cd=i),r&&(Yl&&!Tl&&n-Yl>200&&(Yl=0,ud(`scrollEnd`)),Sl=Jl,Jl=n),wd<0){for(Dl=t;Dl-->0;)ed[Dl]&&ed[Dl].update(0,r);wd=1}else for(Dl=0;Dl<t;Dl++)ed[Dl]&&ed[Dl].update(0,r);Hd.isUpdating=!1}nd=0},Dd=[bu,xu,Cu,Su,ju+ku,ju+Eu,ju+Ou,ju+Du,`display`,`flexShrink`,`float`,`zIndex`,`gridColumnStart`,`gridColumnEnd`,`gridRowStart`,`gridRowEnd`,`gridArea`,`justifySelf`,`alignSelf`,`placeSelf`,`order`],Od=Dd.concat([wu,Tu,`boxSizing`,`max`+Mu,`max`+Nu,`position`,ju,Au,Au+Ou,Au+Eu,Au+ku,Au+Du]),kd=function(e,t,n){Md(n);var r=e._gsap;if(r.spacerIsNative)Md(r.spacerState);else if(e._gsap.swappedIn){var i=t.parentNode;i&&(i.insertBefore(e,t),i.removeChild(t))}e._gsap.swappedIn=!1},Ad=function(e,t,n,r){if(!e._gsap.swappedIn){for(var i=Dd.length,a=t.style,o=e.style,s;i--;)s=Dd[i],a[s]=n[s];a.position=n.position===`absolute`?`absolute`:`relative`,n.display===`inline`&&(a.display=`inline-block`),o[Cu]=o[Su]=`auto`,a.flexBasis=n.flexBasis||`auto`,a.overflow=`visible`,a.boxSizing=`border-box`,a[wu]=zu(e,tl)+Pu,a[Tu]=zu(e,nl)+Pu,a[Au]=o[ju]=o[xu]=o[bu]=`0`,Md(r),o[wu]=o[`max`+Mu]=n[wu],o[Tu]=o[`max`+Nu]=n[Tu],o[Au]=n[Au],e.parentNode!==t&&(e.parentNode.insertBefore(t,e),t.appendChild(e)),e._gsap.swappedIn=!0}},jd=/([A-Z])/g,Md=function(e){if(e){var t=e.t.style,n=e.length,r=0,i,a;for((e.t._gsap||Y.core.getCache(e.t)).uncache=1;r<n;r+=2)a=e[r+1],i=e[r],a?t[i]=a:t[i]&&t.removeProperty(i.replace(jd,`-$1`).toLowerCase())}},Nd=function(e){for(var t=Od.length,n=e.style,r=[],i=0;i<t;i++)r.push(Od[i],n[Od[i]]);return r.t=e,r},Pd=function(e,t,n){for(var r=[],i=e.length,a=n?8:0,o;a<i;a+=2)o=e[a],r.push(o,o in t?t[o]:e[a+1]);return r.t=e.t,r},Fd={left:0,top:0},Id=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p){mu(e)&&(e=e(s)),pu(e)&&e.substr(0,3)===`max`&&(e=d+(e.charAt(4)===`=`?Zu(`0`+e.substr(3),n):0));var m=f?f.time():0,h,g,_;if(f&&f.seek(0),isNaN(e)||(e=+e),hu(e))f&&(e=Y.utils.mapRange(f.scrollTrigger.start,f.scrollTrigger.end,0,d,e)),o&&$u(o,n,r,!0);else{mu(t)&&(t=t(s));var v=(e||`0`).split(` `),y,b,x,S;_=rl(t,s)||_l,y=Ru(_)||{},(!y||!y.left&&!y.top)&&Fu(_).display===`none`&&(S=_.style.display,_.style.display=`block`,y=Ru(_),S?_.style.display=S:_.style.removeProperty(`display`)),b=Zu(v[0],y[r.d]),x=Zu(v[1]||`0`,n),e=y[r.p]-c[r.p]-l+b+i-x,o&&$u(o,x,r,n-x<20||o._isStart&&x>20),n-=n-x}if(p&&(s[p]=e||-.001,e<0&&(e=0)),a){var C=e+n,w=a._isStart;h=`scroll`+r.d2,$u(a,C,r,w&&C>20||!w&&(u?Math.max(_l[h],gl[h]):a.parentNode[h])<=C+1),u&&(c=Ru(o),u&&(a.style[r.op.p]=c[r.op.p]-r.op.m-a._offset+Pu))}return f&&_&&(h=Ru(_),f.seek(d),g=Ru(_),f._caScrollDist=h[r.p]-g[r.p],e=e/f._caScrollDist*d),f&&f.seek(m),f?e:Math.round(e)},Ld=/(webkit|moz|length|cssText|inset)/i,Rd=function(e,t,n,r){if(e.parentNode!==t){var i=e.style,a,o;if(t===_l){for(a in e._stOrig=i.cssText,o=Fu(e),o)!+a&&!Ld.test(a)&&o[a]&&typeof i[a]==`string`&&a!==`0`&&(i[a]=o[a]);i.top=n,i.left=r}else i.cssText=e._stOrig;Y.core.getCache(e).uncache=1,t.appendChild(e)}},zd=function(e,t,n){var r=t,i=r;return function(t){var a=Math.round(e());return a!==r&&a!==i&&Math.abs(a-r)>3&&Math.abs(a-i)>3&&(t=a,n&&n()),i=r,r=Math.round(t),r}},Bd=function(e,t,n){var r={};r[t.p]=`+=`+n,Y.set(e,r)},Vd=function(e,t){var n=al(e,t),r=`_scroll`+t.p2,i=function t(i,a,o,s,c){var l=t.tween,u=a.onComplete,d={};o||=n();var f=zd(n,o,function(){l.kill(),t.tween=0});return c=s&&c||0,s||=i-o,l&&l.kill(),a[r]=i,a.inherit=!1,a.modifiers=d,d[r]=function(){return f(o+s*l.ratio+c*l.ratio*l.ratio)},a.onUpdate=function(){Hc.cache++,t.tween&&Ed()},a.onComplete=function(){t.tween=0,u&&u.call(l)},l=t.tween=Y.to(e,a),l};return e[r]=n,n.wheelHandler=function(){return i.tween&&i.tween.kill()&&(i.tween=0)},Gu(e,`wheel`,n.wheelHandler),Hd.isTouch&&Gu(e,`touchmove`,n.wheelHandler),i},Hd=function(){function e(t,n){pl||e.register(Y)||console.warn(`Please gsap.registerPlugin(ScrollTrigger)`),zl(this),this.init(t,n)}var t=e.prototype;return t.init=function(t,n){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!Xl){this.update=this.refresh=this.kill=nu;return}t=Lu(pu(t)||hu(t)||t.nodeType?{trigger:t}:t,Yu);var r=t,i=r.onUpdate,a=r.toggleClass,o=r.id,s=r.onToggle,c=r.onRefresh,l=r.scrub,u=r.trigger,d=r.pin,f=r.pinSpacing,p=r.invali
vendor: 6,723 bytes, line 1
1dateOnRefresh,m=r.anticipatePin,h=r.onScrubComplete,g=r.onSnapComplete,_=r.once,v=r.snap,y=r.pinReparent,b=r.pinSpacer,x=r.containerAnimation,S=r.fastScrollEnd,C=r.preventOverlaps,w=t.horizontal||t.containerAnimation&&t.horizontal!==!1?tl:nl,T=!l&&l!==0,E=rl(t.scroller||ml),D=Y.core.getCache(E),O=ou(E),k=(`pinType`in t?t.pinType:qc(E,`pinType`)||O&&`fixed`)===`fixed`,A=[t.onEnter,t.onLeave,t.onEnterBack,t.onLeaveBack],j=T&&t.toggleActions.split(` `),M=`markers`in t?t.markers:Yu.markers,N=O?0:parseFloat(Fu(E)[`border`+w.p2+Mu])||0,P=this,F=t.onRefreshInit&&function(){return t.onRefreshInit(P)},ee=lu(E,O,w),te=uu(E,O),ne=0,re=0,ie=0,I=al(E,w),ae,L,oe,se,ce,R,le,z,B,V,ue,de,fe,pe,me,he,H,U,W,ge,G,_e,K,q,ve,ye,be,xe,Se,Ce,we,J,Te,Ee,De,Oe,ke,Ae,je;if(P._startClamp=P._endClamp=!1,P._dir=w,m*=45,P.scroller=E,P.scroll=x?x.time.bind(x):I,se=I(),P.vars=t,n||=t.animation,`refreshPriority`in t&&(jl=1,t.refreshPriority===-9999&&(Td=P)),D.tweenScroll=D.tweenScroll||{top:Vd(E,nl),left:Vd(E,tl)},P.tweenTo=ae=D.tweenScroll[w.p],P.scrubDuration=function(e){Te=hu(e)&&e,Te?J?J.duration(e):J=Y.to(n,{ease:`expo`,totalProgress:`+=0`,inherit:!1,duration:Te,paused:!0,onComplete:function(){return h&&h(P)}}):(J&&J.progress(1).kill(),J=0)},n&&(n.vars.lazy=!1,n._initted&&!P.isReverted||n.vars.immediateRender!==!1&&t.immediateRender!==!1&&n.duration()&&n.render(0,!0,!0),P.animation=n.pause(),n.scrollTrigger=P,P.scrubDuration(l),Ce=0,o||=n.vars.id),v&&((!gu(v)||v.push)&&(v={snapTo:v}),`scrollBehavior`in _l.style&&Y.set(O?[_l,gl]:E,{scrollBehavior:`auto`}),Hc.forEach(function(e){return mu(e)&&e.target===(O?hl.scrollingElement||gl:E)&&(e.smooth=!1)}),oe=mu(v.snapTo)?v.snapTo:v.snapTo===`labels`?Vu(n):v.snapTo===`labelsDirectional`?Uu(n):v.directional===!1?Y.utils.snap(v.snapTo):function(e,t){return Hu(v.snapTo)(e,ql()-re<500?0:t.direction)},Ee=v.duration||{min:.1,max:2},Ee=gu(Ee)?xl(Ee.min,Ee.max):xl(Ee,Ee),De=Y.delayedCall(v.delay||Te/2||.1,function(){var e=I(),t=ql()-re<500,r=ae.tween;if((t||Math.abs(P.getVelocity())<10)&&!r&&!Tl&&ne!==e){var i=(e-R)/pe,a=n&&!T?n.totalProgress():i,o=t?0:(a-we)/(ql()-Sl)*1e3||0,s=Y.utils.clamp(-i,1-i,yu(o/2)*o/.185),c=i+(v.inertia===!1?0:s),l,u,d=v,f=d.onStart,p=d.onInterrupt,m=d.onComplete;if(l=oe(c,P),hu(l)||(l=c),u=Math.max(0,Math.round(R+l*pe)),e<=le&&e>=R&&u!==e){if(r&&!r._initted&&r.data<=yu(u-e))return;v.inertia===!1&&(s=l-i),ae(u,{duration:Ee(yu(Math.max(yu(c-a),yu(l-a))*.185/o/.05||0)),ease:v.ease||`power3`,data:yu(u-e),onInterrupt:function(){return De.restart(!0)&&p&&vu(P,p)},onComplete:function(){P.update(),ne=I(),n&&!T&&(J?J.resetTo(`totalProgress`,l,n._tTime/n._tDur):n.progress(l)),Ce=we=n&&!T?n.totalProgress():P.progress,g&&g(P),m&&vu(P,m)}},e,s*pe,u-e-s*pe),f&&vu(P,f,ae.tween)}}else P.isActive&&ne!==e&&De.restart(!0)}).pause()),o&&(td[o]=P),u=P.trigger=rl(u||d!==!0&&d),je=u&&u._gsap&&u._gsap.stRevert,je&&=je(P),d=d===!0?u:rl(d),pu(a)&&(a={targets:u,className:a}),d&&(f===!1||f===ju||(f=!f&&d.parentNode&&d.parentNode.style&&Fu(d.parentNode).display===`flex`?!1:Au),P.pin=d,L=Y.core.getCache(d),L.spacer?me=L.pinState:(b&&(b=rl(b),b&&!b.nodeType&&(b=b.current||b.nativeElement),L.spacerIsNative=!!b,b&&(L.spacerState=Nd(b))),L.spacer=U=b||hl.createElement(`div`),U.classList.add(`pin-spacer`),o&&U.classList.add(`pin-spacer-`+o),L.pinState=me=Nd(d)),t.force3D!==!1&&Y.set(d,{force3D:!0}),P.spacer=U=L.spacer,Se=Fu(d),q=Se[f+w.os2],ge=Y.getProperty(d),G=Y.quickSetter(d,w.a,Pu),Ad(d,U,Se),H=Nd(d)),M){de=gu(M)?Lu(M,Ju):Ju,V=Qu(`scroller-start`,o,E,w,de,0),ue=Qu(`scroller-end`,o,E,w,de,0,V),W=V[`offset`+w.op.d2];var Me=rl(qc(E,`content`)||E);z=this.markerStart=Qu(`start`,o,Me,w,de,W,0,x),B=this.markerEnd=Qu(`end`,o,Me,w,de,W,0,x),x&&(Ae=Y.quickSetter([z,B],w.a,Pu)),!k&&!(Uc.length&&qc(E,`fixedMarkers`)===!0)&&(Iu(O?_l:E),Y.set([V,ue],{force3D:!0}),ye=Y.quickSetter(V,w.a,Pu),xe=Y.quickSetter(ue,w.a,Pu))}if(x){var Ne=x.vars.onUpdate,Pe=x.vars.onUpdateParams;x.eventCallback(`onUpdate`,function(){P.update(0,0,1),Ne&&Ne.apply(x,Pe||[])})}if(P.previous=function(){return ed[ed.indexOf(P)-1]},P.next=function(){return ed[ed.indexOf(P)+1]},P.revert=function(e,t){if(!t)return P.kill(!0);var r=e!==!1||!P.enabled,i=wl;r!==P.isReverted&&(r&&(Oe=Math.max(I(),P.scroll.rec||0),ie=P.progress,ke=n&&n.progress()),z&&[z,B,V,ue].forEach(function(e){return e.style.display=r?`none`:`block`}),r&&(wl=P,P.update(r)),d&&(!y||!P.isActive)&&(r?kd(d,U,me):Ad(d,U,Fu(d),ve)),r||P.update(r),wl=i,P.isReverted=r)},P.refresh=function(r,i,a,o){if(!((wl||!P.enabled)&&!i)){if(d&&r&&Yl){Gu(e,`scrollEnd`,ld);return}!gd&&F&&F(P),wl=P,ae.tween&&!a&&(ae.tween.kill(),ae.tween=0),J&&J.pause(),p&&n&&(n.revert({kill:!1}).invalidate(),n.getChildren?n.getChildren(!0,!0,!1).forEach(function(e){return e.vars.immediateRender&&e.render(0,!0,!0)}):n.vars.immediateRender&&n.render(0,!0,!0)),P.isReverted||P.revert(!0,!0),P._subPinOffset=!1;var s=ee(),l=te(),m=x?x.duration():du(E,w),h=pe<=.01||!pe,g=0,_=o||0,v=gu(a)?a.end:t.end,b=t.endTrigger||u,S=gu(a)?a.start:t.start||(t.start===0||!u?0:d?`0 0`:`0 100%`),C=P.pinnedContainer=t.pinnedContainer&&rl(t.pinnedContainer,P),D=u&&Math.max(0,ed.indexOf(P))||0,A=D,j,L,oe,de,W,G,q,ye,xe,Se,Ce,we,Te;for(M&&gu(a)&&(we=Y.getProperty(V,w.p),Te=Y.getProperty(ue,w.p));A-->0;)G=ed[A],G.end||G.refresh(0,1)||(wl=P),q=G.pin,q&&(q===u||q===d||q===C)&&!G.isReverted&&(Se||=[],Se.unshift(G),G.revert(!0,!0)),G!==ed[A]&&(D--,A--);for(mu(S)&&(S=S(P)),S=Zl(S,`start`,P),R=Id(S,u,s,w,I(),z,V,P,l,N,k,m,x,P._startClamp&&`_startClamp`)||(d?-.001:0),mu(v)&&(v=v(P)),pu(v)&&!v.indexOf(`+=`)&&(~v.indexOf(` `)?v=(pu(S)?S.split(` `)[0]:``)+v:(g=Zu(v.substr(2),s),v=pu(S)?S:(x?Y.utils.mapRange(0,x.duration(),x.scrollTrigger.start,x.scrollTrigger.end,R):R)+g,b=u)),v=Zl(v,`end`,P),le=Math.max(R,Id(v||(b?`100% 0`:m),b,s,w,I()+g,B,ue,P,l,N,k,m,x,P._endClamp&&`_endClamp`))||-.001,g=0,A=D;A--;)G=ed[A]||{},q=G.pin,q&&G.start-G._pinPush<=R&&!x&&G.end>0&&(j=G.end-(P._startClamp?Math.max(0,G.start):G.start),(q===u&&G.start-G._pinPush<R||q===C)&&isNaN(S)&&(g+=j*(1-G.progress)),q===d&&(_+=j));if(R+=g,le+=g,P._startClamp&&(P._startClamp+=g),P._endClamp&&!gd&&(P._endClamp=le||-.001,le=Math.min(le,du(E,w))),pe=le-R||(R-=.01)&&.001,h&&(ie=Y.utils.clamp(0,1,Y.utils.normalize(R,le,Oe))),P._pinPush=_,z&&g&&(j={},j[w.a]=`+=`+g,C&&(j[w.p]=`-=`+I()),Y.set([z,B],j)),d&&!(Wl&&P.end>=du(E,w)))j=Fu(d),de=w===nl,oe=I(),_e=parseFloat(ge(w.a))+_,!m&&le>1&&(Ce=(O?hl.scrollingElement||gl:E).style,Ce={style:Ce,value:Ce[`overflow`+w.a.toUpperCase()]},O&&Fu(_l)[`overflow`+w.a.toUpperCase()]!==`scroll`&&(Ce.style[`overflow`+w.a.toUpperCase()]=`scroll`)),Ad(d,U,j),H=Nd(d),L=Ru(d,!0),ye=k&&al(E,de?tl:nl)(),f?(ve=[f+w.os2,pe+_+Pu],ve.t=U,A=f===Au?zu(d,w)+pe+_:0,A&&(ve.push(w.d,A
vendor: 4,098 bytes, line 1
1+Pu),U.style.flexBasis!==`auto`&&(U.style.flexBasis=A+Pu)),Md(ve),C&&ed.forEach(function(e){e.pin===C&&e.vars.pinSpacing!==!1&&(e._subPinOffset=!0)}),k&&I(Oe)):(A=zu(d,w),A&&U.style.flexBasis!==`auto`&&(U.style.flexBasis=A+Pu)),k&&(W={top:L.top+(de?oe-R:ye)+Pu,left:L.left+(de?ye:oe-R)+Pu,boxSizing:`border-box`,position:`fixed`},W[wu]=W[`max`+Mu]=Math.ceil(L.width)+Pu,W[Tu]=W[`max`+Nu]=Math.ceil(L.height)+Pu,W[ju]=W[ju+Ou]=W[ju+Eu]=W[ju+ku]=W[ju+Du]=`0`,W[Au]=j[Au],W[Au+Ou]=j[Au+Ou],W[Au+Eu]=j[Au+Eu],W[Au+ku]=j[Au+ku],W[Au+Du]=j[Au+Du],he=Pd(me,W,y),gd&&I(0)),n?(xe=n._initted,Ml(1),n.render(n.duration(),!0,!0),K=ge(w.a)-_e+pe+_,be=Math.abs(pe-K)>1,k&&be&&he.splice(he.length-2,2),n.render(0,!0,!0),xe||n.invalidate(!0),n.parent||n.totalTime(n.totalTime()),Ml(0)):K=pe,Ce&&(Ce.value?Ce.style[`overflow`+w.a.toUpperCase()]=Ce.value:Ce.style.removeProperty(`overflow-`+w.a));else if(u&&I()&&!x)for(L=u.parentNode;L&&L!==_l;)L._pinOffset&&(R-=L._pinOffset,le-=L._pinOffset),L=L.parentNode;Se&&Se.forEach(function(e){return e.revert(!1,!0)}),P.start=R,P.end=le,se=ce=gd?Oe:I(),!x&&!gd&&(se<Oe&&I(Oe),P.scroll.rec=0),P.revert(!1,!0),re=ql(),De&&(ne=-1,De.restart(!0)),wl=0,n&&T&&(n._initted||ke)&&n.progress()!==ke&&n.progress(ke||0,!0).render(n.time(),!0,!0),(h||ie!==P.progress||x||p||n&&!n._initted)&&(n&&!T&&(n._initted||ie||n.vars.immediateRender!==!1)&&n.totalProgress(x&&R<-.001&&!ie?Y.utils.normalize(R,le,0):ie,!0),P.progress=h||(se-R)/pe===ie?0:ie),d&&f&&(U._pinOffset=Math.round(P.progress*K)),J&&J.invalidate(),isNaN(we)||(we-=Y.getProperty(V,w.p),Te-=Y.getProperty(ue,w.p),Bd(V,w,we),Bd(z,w,we-(o||0)),Bd(ue,w,Te),Bd(B,w,Te-(o||0))),h&&!gd&&P.update(),c&&!gd&&!fe&&(fe=!0,c(P),fe=!1)}},P.getVelocity=function(){return(I()-ce)/(ql()-Sl)*1e3||0},P.endAnimation=function(){_u(P.callbackAnimation),n&&(J?J.progress(1):n.paused()?T||_u(n,P.direction<0,1):_u(n,n.reversed()))},P.labelToScroll=function(e){return n&&n.labels&&(R||P.refresh()||R)+n.labels[e]/n.duration()*pe||0},P.getTrailing=function(e){var t=ed.indexOf(P),n=P.direction>0?ed.slice(0,t).reverse():ed.slice(t+1);return(pu(e)?n.filter(function(t){return t.vars.preventOverlaps===e}):n).filter(function(e){return P.direction>0?e.end<=R:e.start>=le})},P.update=function(e,t,r){if(!(x&&!r&&!e)){var o=gd===!0?Oe:P.scroll(),c=e?0:(o-R)/pe,u=c<0?0:c>1?1:c||0,p=P.progress,h,g,b,D,O,M,N,F;if(t&&(ce=se,se=x?I():o,v&&(we=Ce,Ce=n&&!T?n.totalProgress():u)),m&&d&&!wl&&!Kl&&Yl&&(!u&&R<o+(o-ce)/(ql()-Sl)*m?u=1e-4:u===1&&le>o+(o-ce)/(ql()-Sl)*m&&(u=.9999)),u!==p&&P.enabled){if(h=P.isActive=!!u&&u<1,g=!!p&&p<1,M=h!==g,O=M||!!u!=!!p,P.direction=u>p?1:-1,P.progress=u,O&&!wl&&(b=u&&!p?0:u===1?1:p===1?2:3,T&&(D=!M&&j[b+1]!==`none`&&j[b+1]||j[b],F=n&&(D===`complete`||D===`reset`||D in n))),C&&(M||F)&&(F||l||!n)&&(mu(C)?C(P):P.getTrailing(C).forEach(function(e){return e.endAnimation()})),T||(J&&!wl&&!Kl?(J._dp._time-J._start!==J._time&&J.render(J._dp._time-J._start),J.resetTo?J.resetTo(`totalProgress`,u,n._tTime/n._tDur):(J.vars.totalProgress=u,J.invalidate().restart())):n&&n.totalProgress(u,!!(wl&&(re||e)))),d){if(e&&f&&(U.style[f+w.os2]=q),!k)G(ru(_e+K*u));else if(O){if(N=!e&&u>p&&le+1>o&&o+1>=du(E,w),y){if(!e&&(h||N)){var ee=Ru(d,!0),te=o-R;Rd(d,_l,ee.top+(w===nl?te:0)+Pu,ee.left+(w===nl?0:te)+Pu)}else Rd(d,U)}Md(h||N?he:H),be&&u<1&&h||G(_e+(u===1&&!N?K:0))}}v&&!ae.tween&&!wl&&!Kl&&De.restart(!0),a&&(M||_&&u&&(u<1||!Gl))&&bl(a.targets).forEach(function(e){return e.classList[h||_?`add`:`remove`](a.className)}),i&&!T&&!e&&i(P),O&&!wl?(T&&(F&&(D===`complete`?n.pause().totalProgress(1):D===`reset`?n.restart(!0).pause():D===`restart`?n.restart(!0):n[D]()),i&&i(P)),(M||!Gl)&&(s&&M&&vu(P,s),A[b]&&vu(P,A[b]),_&&(u===1?P.kill(!1,1):A[b]=0),M||(b=u===1?1:3,A[b]&&vu(P,A[b]))),S&&!h&&Math.abs(P.getVelocity())>(hu(S)?S:2500)&&(_u(P.callbackAnimation),J?J.progress(1):_u(n,D===`reverse`?1:!u,1))):T&&i&&!wl&&i(P)}if(xe){var ne=x?o/x.duration()*(x._caScrollDist||0):o;ye(ne+ +!!V._isFlipped),xe(ne)}Ae&&Ae(-o/x.duration()*(x._caScrollDist||0))}},P.enable=function(t,n){P.enabled||(P.enabled=!0,Gu(E,`resize`,od),O||Gu(E,`scroll`,i
vendor: 4,812 bytes, line 1
1d),F&&Gu(e,`refreshInit`,F),t!==!1&&(P.progress=ie=0,se=ce=ne=I()),n!==!1&&P.refresh())},P.getTween=function(e){return e&&ae?ae.tween:J},P.setPositions=function(e,t,n,r){if(x){var i=x.scrollTrigger,a=x.duration(),o=i.end-i.start;e=i.start+o*e/a,t=i.start+o*t/a}P.refresh(!1,!1,{start:Ql(e,n&&!!P._startClamp),end:Ql(t,n&&!!P._endClamp)},r),P.update()},P.adjustPinSpacing=function(e){if(ve&&e){var t=ve.indexOf(w.d)+1;ve[t]=parseFloat(ve[t])+e+Pu,ve[1]=parseFloat(ve[1])+e+Pu,Md(ve)}},P.disable=function(t,n){if(t!==!1&&P.revert(!0,!0),P.enabled&&(P.enabled=P.isActive=!1,n||J&&J.pause(),Oe=0,L&&(L.uncache=1),F&&Ku(e,`refreshInit`,F),De&&(De.pause(),ae.tween&&ae.tween.kill()&&(ae.tween=0)),!O)){for(var r=ed.length;r--;)if(ed[r].scroller===E&&ed[r]!==P)return;Ku(E,`resize`,od),O||Ku(E,`scroll`,id)}},P.kill=function(e,r){P.disable(e,r),J&&!r&&J.kill(),o&&delete td[o];var i=ed.indexOf(P);i>=0&&ed.splice(i,1),i===Dl&&wd>0&&Dl--,i=0,ed.forEach(function(e){return e.scroller===P.scroller&&(i=1)}),i||gd||(P.scroll.rec=0),n&&(n.scrollTrigger=null,e&&n.revert({kill:!1}),r||n.kill()),z&&[z,B,V,ue].forEach(function(e){return e.parentNode&&e.parentNode.removeChild(e)}),Td===P&&(Td=0),d&&(L&&(L.uncache=1),i=0,ed.forEach(function(e){return e.pin===d&&i++}),i||(L.spacer=0)),t.onKill&&t.onKill(P)},ed.push(P),P.enable(!1,!1),je&&je(P),n&&n.add&&!pe){var Fe=P.update;P.update=function(){P.update=Fe,Hc.cache++,R||le||P.refresh()},Y.delayedCall(.01,P.update),pe=.01,R=le=0}else P.refresh();d&&yd()},e.register=function(t){return pl||=(Y=t||au(),iu()&&window.document&&e.enable(),Xl),pl},e.defaults=function(e){if(e)for(var t in e)Yu[t]=e[t];return Yu},e.disable=function(e,t){Xl=0,ed.forEach(function(n){return n[t?`kill`:`disable`](e)}),Ku(ml,`wheel`,id),Ku(hl,`scroll`,id),clearInterval(Cl),Ku(hl,`touchcancel`,nu),Ku(_l,`touchstart`,nu),Wu(Ku,hl,`pointerdown,touchstart,mousedown`,eu),Wu(Ku,hl,`pointerup,touchend,mouseup`,tu),yl.kill(),fu(Ku);for(var n=0;n<Hc.length;n+=3)qu(Ku,Hc[n],Hc[n+1]),qu(Ku,Hc[n],Hc[n+2])},e.enable=function(){if(ml=window,hl=document,gl=hl.documentElement,_l=hl.body,Y){if(bl=Y.utils.toArray,xl=Y.utils.clamp,zl=Y.core.context||nu,Ml=Y.core.suppressOverwrites||nu,Bl=ml.history.scrollRestoration||`auto`,Cd=ml.pageYOffset||0,Y.core.globals(`ScrollTrigger`,e),_l){Xl=1,Vl=document.createElement(`div`),Vl.style.height=`100vh`,Vl.style.position=`absolute`,bd(),$l(),dl.register(Y),e.isTouch=dl.isTouch,Rl=dl.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),Fl=dl.isTouch===1,Gu(ml,`wheel`,id),vl=[ml,hl,gl,_l],Y.matchMedia?(e.matchMedia=function(e){var t=Y.matchMedia(),n;for(n in e)t.add(n,e[n]);return t},Y.addEventListener(`matchMediaInit`,function(){pd(),md()}),Y.addEventListener(`matchMediaRevert`,function(){return fd()}),Y.addEventListener(`matchMedia`,function(){Sd(0,1),ud(`matchMedia`)}),Y.matchMedia().add(`(orientation: portrait)`,function(){return ad(),ad})):console.warn(`Requires GSAP 3.11.0 or later`),ad(),Gu(hl,`scroll`,id);var t=_l.hasAttribute(`style`),n=_l.style,r=n.borderTopStyle,i=Y.core.Animation.prototype,a,o;for(i.revert||Object.defineProperty(i,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle=`solid`,a=Ru(_l),nl.m=Math.round(a.top+nl.sc())||0,tl.m=Math.round(a.left+tl.sc())||0,r?n.borderTopStyle=r:n.removeProperty(`border-top-style`),t||(_l.setAttribute(`style`,``),_l.removeAttribute(`style`)),Cl=setInterval(rd,250),Y.delayedCall(.5,function(){return Kl=0}),Gu(hl,`touchcancel`,nu),Gu(_l,`touchstart`,nu),Wu(Gu,hl,`pointerdown,touchstart,mousedown`,eu),Wu(Gu,hl,`pointerup,touchend,mouseup`,tu),El=Y.utils.checkPrefix(`transform`),Od.push(El),pl=ql(),yl=Y.delayedCall(.2,Sd).pause(),Al=[hl,`visibilitychange`,function(){var e=ml.innerWidth,t=ml.innerHeight;hl.hidden?(Ol=e,kl=t):(Ol!==e||kl!==t)&&od()},hl,`DOMContentLoaded`,Sd,ml,`load`,Sd,ml,`resize`,od],fu(Gu),ed.forEach(function(e){return e.enable(0,1)}),o=0;o<Hc.length;o+=3)qu(Ku,Hc[o],Hc[o+1]),qu(Ku,Hc[o],Hc[o+2])}else hl&&hl.addEventListener(`DOMContentLoaded`,function t(){e.enable(),hl.removeEventListener(`DOMContentLoaded`,t)})}},e.config=function(t){`limitCallbacks`in t&&(Gl=!!t.limitCallbacks);var n=t.syncInterval;n&&clearInterval(Cl)||(Cl=n)&&setInterval(rd,n),`ignoreMobileResize`in t&&(Fl=e.isTouch===1&&t.ignoreMobileResize),`autoRefreshEvents`in t&&(fu(Ku)||fu(Gu,t.autoRefreshEvents||`none`),Nl=(t.autoRefreshEvents+``).indexOf(`resize`)===-1)},e.scrollerProxy=function(e,t){var n=rl(e),r=Hc.indexOf(n),i=ou(n);~r&&Hc.splice(r,i?6:2),t&&(i?Uc.unshift(ml,t,_l,t,gl,t):Uc.unshift(n,t))},e.clearMatchMedia=function(e){ed.forEach(function(t){return t._ctx&&t._ctx.query===e&&t._ctx.kill(!0,!0)})},e.isInViewport=function(e,t,n){var r=(pu(e)?rl(e):e).getBoundingClientRect(),i=r[n?wu:Tu]*t||0;return n?r.right-i>0&&r.left+i<ml.innerWidth:r.bottom-i>
vendor: 4,523 bytes, line 1
10&&r.top+i<ml.innerHeight},e.positionInViewport=function(e,t,n){pu(e)&&(e=rl(e));var r=e.getBoundingClientRect(),i=r[n?wu:Tu],a=t==null?i/2:t in Xu?Xu[t]*i:~t.indexOf(`%`)?parseFloat(t)*i/100:parseFloat(t)||0;return n?(r.left+a)/ml.innerWidth:(r.top+a)/ml.innerHeight},e.killAll=function(e){if(ed.slice(0).forEach(function(e){return e.vars.id!==`ScrollSmoother`&&e.kill()}),e!==!0){var t=sd.killAll||[];sd={},t.forEach(function(e){return e()})}},e}(),Hd.version=`3.15.0`,Hd.saveStyles=function(e){return e?bl(e).forEach(function(e){if(e&&e.style){var t=dd.indexOf(e);t>=0&&dd.splice(t,5),dd.push(e,e.style.cssText,e.getBBox&&e.getAttribute(`transform`),Y.core.getCache(e),zl())}}):dd},Hd.revert=function(e,t){return md(!e,t)},Hd.create=function(e,t){return new Hd(e,t)},Hd.refresh=function(e){return e?od(!0):(pl||Hd.register())&&Sd(!0)},Hd.update=function(e){return++Hc.cache&&Ed(e===!0?2:0)},Hd.clearScrollMemory=hd,Hd.maxScroll=function(e,t){return du(e,t?tl:nl)},Hd.getScrollFunc=function(e,t){return al(rl(e),t?tl:nl)},Hd.getById=function(e){return td[e]},Hd.getAll=function(){return ed.filter(function(e){return e.vars.id!==`ScrollSmoother`})},Hd.isScrolling=function(){return!!Yl},Hd.snapDirectional=Hu,Hd.addEventListener=function(e,t){var n=sd[e]||(sd[e]=[]);~n.indexOf(t)||n.push(t)},Hd.removeEventListener=function(e,t){var n=sd[e],r=n&&n.indexOf(t);r>=0&&n.splice(r,1)},Hd.batch=function(e,t){var n=[],r={},i=t.interval||.016,a=t.batchMax||1e9,o=function(e,t){var n=[],r=[],o=Y.delayedCall(i,function(){t(n,r),n=[],r=[]}).pause();return function(e){n.length||o.restart(!0),n.push(e.trigger),r.push(e),a<=n.length&&o.progress(1)}},s;for(s in t)r[s]=s.substr(0,2)===`on`&&mu(t[s])&&s!==`onRefreshInit`?o(s,t[s]):t[s];return mu(a)&&(a=a(),Gu(Hd,`refresh`,function(){return a=t.batchMax()})),bl(e).forEach(function(e){var t={};for(s in r)t[s]=r[s];t.trigger=e,n.push(Hd.create(t))}),n},Ud=function(e,t,n,r){return t>r?e(r):t<0&&e(0),n>r?(r-t)/(n-t):n<0?t/(t-n):1},Wd=function e(t,n){n===!0?t.style.removeProperty(`touch-action`):t.style.touchAction=n===!0?`auto`:n?`pan-`+n+(dl.isTouch?` pinch-zoom`:``):`none`,t===gl&&e(_l,n)},Gd={auto:1,scroll:1},Kd=function(e){var t=e.event,n=e.target,r=e.axis,i=(t.changedTouches?t.changedTouches[0]:t).target,a=i._gsap||Y.core.getCache(i),o=ql(),s;if(!a._isScrollT||o-a._isScrollT>2e3){for(;i&&i!==_l&&(i.scrollHeight<=i.clientHeight&&i.scrollWidth<=i.clientWidth||!(Gd[(s=Fu(i)).overflowY]||Gd[s.overflowX]));)i=i.parentNode;a._isScroll=i&&i!==n&&!ou(i)&&(Gd[(s=Fu(i)).overflowY]||Gd[s.overflowX]),a._isScrollT=o}(a._isScroll||r===`x`)&&(t.stopPropagation(),t._gsapAllow=!0)},qd=function(e,t,n,r){return dl.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:r&&=Kd,onPress:r,onDrag:r,onScroll:r,onEnable:function(){return n&&Gu(hl,dl.eventTypes[0],Xd,!1,!0)},onDisable:function(){return Ku(hl,dl.eventTypes[0],Xd,!0)}})},Jd=/(input|label|select|textarea)/i,Xd=function(e){var t=Jd.test(e.target.tagName);(t||Yd)&&(e._gsapAllow=!0,Yd=t)},Zd=function(e){gu(e)||(e={}),e.preventDefault=e.isNormalizer=e.allowClicks=!0,e.type||(e.type=`wheel,touch`),e.debounce=!!e.debounce,e.id=e.id||`normalizer`;var t=e,n=t.normalizeScrollX,r=t.momentum,i=t.allowNestedScroll,a=t.onRelease,o,s,c=rl(e.target)||gl,l=Y.core.globals().ScrollSmoother,u=l&&l.get(),d=Rl&&(e.content&&rl(e.content)||u&&e.content!==!1&&!u.smooth()&&u.content()),f=al(c,nl),p=al(c,tl),m=1,h=(dl.isTouch&&ml.visualViewport?ml.visualViewport.scale*ml.visualViewport.width:ml.outerWidth)/ml.innerWidth,g=0,_=mu(r)?function(){return r(o)}:function(){return r||2.8},v,y,b=qd(c,e.type,!0,i),x=function(){return y=!1},S=nu,C=nu,w=function(){s=du(c,nl),C=xl(+!!Rl,s),n&&(S=xl(0,du(c,tl))),v=_d},T=function(){d._gsap.y=ru(parseFloat(d._gsap.y)+f.offset)+`px`,d.style.transform=`matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, `+parseFloat(d._gsap.y)+`, 0, 1)`,f.offset=f.cacheID=0},E=function(){if(y){requestAnimationFrame(x);var e=ru(o.deltaY/2),t=C(f.v-e);if(d&&t!==f.v+f.offset){f.offset=t-f.v;var n=ru((parseFloat(d&&d._gsap.y)||0)-f.offset);d.style.transform=`matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, `+n+`, 0, 1)`,d._gsap.y=n+`px`,f.cacheID=Hc.cache,Ed()}return!0}f.offset&&T(),y=!0},D,O,k,A,j=function(){w(),D.isActive()&&D.vars.scrollY>s&&(f()>s?D.progress(1)&&f(s):D.resetTo(`scrollY`,s))};return d&&Y.set(d,{y:`+=0`}),e.ignoreCheck=function(e){return Rl&&e.type===`touchmove`&&E(e)||m>1.05&&e.type!==`touchstart`||o.isGesturing||e.touches&&e.touches.length>1},e.onPress=function(){y=!1;var e=m;
1m=ru((ml.visualViewport&&ml.visualViewport.scale||1)/h),D.pause(),e!==m&&Wd(c,m>1.01||!n&&`x`),O=p(),k=f(),w(),v=_d},e.onRelease=e.onGestureStart=function(e,t){if(f.offset&&T(),!t)A.restart(!0);else{Hc.cache++;var r=_(),i,o;n&&(i=p(),o=i+r*.05*-e.velocityX/.227,r*=Ud(p,i,o,du(c,tl)),D.vars.scrollX=S(o)),i=f(),o=i+r*.05*-e.velocityY/.227,r*=Ud(f,i,o,du(c,nl)),D.vars.scrollY=C(o),D.invalidate().duration(r).play(.01),(Rl&&D.vars.scrollY>=s||i>=s-1)&&Y.to({},{onUpdate:j,duration:r})}a&&a(e)},e.onWheel=function(){D._ts&&D.pause(),ql()-g>1e3&&(v=0,g=ql())},e.onChange=function(e,t,r,i,a){if(_d!==v&&w(),t&&n&&p(S(i[2]===t?O+(e.startX-e.x):p()+t-i[1])),r){f.offset&&T();var o=a[2]===r,s=o?k+e.startY-e.y:f()+r-a[1],c=C(s);o&&s!==c&&(k+=c-s),f(c)}(r||t)&&Ed()},e.onEnable=function(){Wd(c,!n&&`x`),Hd.addEventListener(`refresh`,j),Gu(ml,`resize`,j),f.smooth&&=(f.target.style.scrollBehavior=`auto`,p.smooth=!1),b.enable()},e.onDisable=function(){Wd(c,!0),Ku(ml,`resize`,j),Hd.removeEventListener(`refresh`,j),b.kill()},e.lockAxis=e.lockAxis!==!1,o=new dl(e),o.iOS=Rl,Rl&&!f()&&f(1),Rl&&Y.ticker.add(nu),A=o._dc,D=Y.to(o,{ease:`power4`,paused:!0,inherit:!1,scrollX:n?`+=0.1`:`+=0`,scrollY:`+=0.1`,modifiers:{scrollY:zd(f,f(),function(){return D.pause()})},onUpdate:Ed,onComplete:A.vars.onComplete}),o},Hd.sort=function(e){if(mu(e))return ed.sort(e);var t=ml.pageYOffset||0;return Hd.getAll().forEach(function(e){return e._sortY=e.trigger?t+e.trigger.getBoundingClientRect().top:e.start+ml.innerHeight}),ed.sort(e||function(e,t){return(e.vars.refreshPriority||0)*-1e6+(e.vars.containerAnimation?1e6:e._sortY)-((t.vars.containerAnimation?1e6:t._sortY)+(t.vars.refreshPriority||0)*-1e6)})},Hd.observe=function(e){return new dl(e)},Hd.normalizeScroll=function(e){if(e===void 0)return Pl;if(e===!0&&Pl)return Pl.enable();if(e===!1){Pl&&Pl.kill(),Pl=e;return}var t=e instanceof dl?e:Zd(e);return Pl&&Pl.target===t.target&&Pl.kill(),ou(t.target)&&(Pl=t),t},Hd.core={_getVelocityProp:ol,_inputObserver:qd,_scrollers:Hc,_proxies:Uc,bridge:{ss:function(){Yl||ud(`scrollStart`),Yl=ql()},ref:function(){return wl}}},au()&&Y.registerPlugin(Hd)})),$d=a((()=>{Cc(),Qd(),Sc.registerPlugin(Hd),Sc.from(`.services`,{scrollTrigger:{trigger:`.services`,scrub:!0},scale:.8,ease:`power3`}),Sc.from(`.main-portfolio`,{scrollTrigger:{trigger:`.main-portfolio`,scrub:!0},scale:.8,ease:`none`})}));function ef(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function tf(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function nf(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function rf(){let e=nf(`canvas`);return e.style.display=`block`,e}function af(...e){let t=`THREE.`+e.shift();Fm?Fm(`log`,t,...e):console.log(t,...e)}function of(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function X(...e){e=of(e);let t=`THREE.`+e.shift();if(Fm)Fm(`warn`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function Z(...e){e=of(e);let t=`THREE.`+e.shift();if(Fm)Fm(`error`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function sf(...e){let t=e.join(` `);t in Pm||(Pm[t]=!0,X(...e))}function cf(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}function lf(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Rm[e&255]+Rm[e>>8&255]+Rm[e>>16&255]+Rm[e>>24&255]+`-`+Rm[t&255]+Rm[t>>8&255]+`-`+Rm[t>>16&15|64]+Rm[t>>24&255]+`-`+Rm[n&63|128]+Rm[n>>8&255]+`-`+Rm[n>>16&255]+Rm[n>>24&255]+Rm[r&255]+Rm[r>>8&255]+Rm[r>>16&255]+Rm[r>>24&255]).toLowerCase()}function uf(e,t,n){return Math.max(t,Math.min(n,e))}function df(e,t){return(e%t+t)%t}function ff(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function pf(e,t,n){return e===t?0:(n-e)/(t-e)}function mf(e,t,n){return(1-n)*e+n*t}function hf(e,t,n,r){return mf(e,t,1-Math.exp(-n*r))}function gf(e,t=1){return t-Math.abs(df(e,t*2)-t)}function _f(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function vf(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function yf(e,t){return e+Math.floor(Math.random()*(t-e+1))}function bf(e,t){return e+Math.random()*(t-e)}function xf(e){return e*(.5-Math.random())}function Sf(e){e!==void 0&&(zm=e);let t=zm+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Cf(e){return e*Bm}function wf(e){return e*Vm}function Tf(e){return!(e&e-1)&&e!==0}function Ef(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Df(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function Of(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:X(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function kf(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function Af(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function jf(){let e={enabled:!0,workingColorSpace:Om,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`
1srgb`&&(e.r=Mf(e.r),e.g=Mf(e.g),e.b=Mf(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=Nf(e.r),e.g=Nf(e.g),e.b=Nf(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?km:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return sf(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return sf(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Om]:{primaries:t,whitePoint:r,transfer:km,toXYZ:Ym,fromXYZ:Xm,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Dm},outputColorSpaceConfig:{drawingBufferColorSpace:Dm}},[Dm]:{primaries:t,whitePoint:r,transfer:Am,toXYZ:Ym,fromXYZ:Xm,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Dm}}}),e}function Mf(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function Nf(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}function Pf(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?$m.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(X(`Texture: Unable to serialize Texture.`),{})}function Ff(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}function If(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){bg.fromArray(e,a);let o=i.x*Math.abs(bg.x)+i.y*Math.abs(bg.y)+i.z*Math.abs(bg.z),s=t.dot(bg),c=n.dot(bg),l=r.dot(bg);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}function Lf(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;u_.copy(s),u_.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(u_);return l<n.near||l>n.far?null:{distance:l,point:u_.clone(),object:e}}function Rf(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,i_),e.getVertexPosition(c,a_),e.getVertexPosition(l,o_);let u=Lf(e,t,n,r,i_,a_,o_,l_);if(u){let e=new Q;og.getBarycoord(l_,i_,a_,o_,e),i&&(u.uv=og.getInterpolatedAttribute(i,s,c,l,e,new Um)),a&&(u.uv1=og.getInterpolatedAttribute(a,s,c,l,e,new Um)),o&&(u.normal=og.getInterpolatedAttribute(o,s,c,l,e,new Q),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new Q,materialIndex:0};og.getNormal(i_,a_,o_,t.normal),u.face=t,u.barycoord=e}return u}function zf(e,t,n,r,i,a,o){let s=e.geometry.attributes.position;if(G_.fromBufferAttribute(s,i),K_.fromBufferAttribute(s,a),n.distanceSqToSegment(G_,K_,X_,Z_)>r)return;
1X_.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(X_);if(!(c<t.near||c>t.far))return{distance:c,point:Z_.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}function Bf(e,t,n,r,i,a,o){let s=av.distanceSqToPoint(e);if(s<n){let n=new Q;av.closestPointToPoint(e,n),n.applyMatrix4(r);let c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}function Vf(e){let t={};for(let n in e){t[n]={};for(let r in e[n]){let i=e[n][r];if(Uf(i))i.isRenderTargetTexture?(X(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone();else if(Array.isArray(i)){if(Uf(i[0])){let e=[];for(let t=0,n=i.length;t<n;t++)e[t]=i[t].clone();t[n][r]=e}else t[n][r]=i.slice()}else t[n][r]=i}}return t}function Hf(e){let t={};for(let n=0;n<e.length;n++){let r=Vf(e[n]);for(let e in r)t[e]=r[e]}return t}function Uf(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function Wf(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function Gf(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Zm.workingColorSpace}function Kf(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}function qf(e){function t(t,n){return e[t]-e[n]}let n=e.length,r=Array(n);for(let e=0;e!==n;++e)r[e]=e;return r.sort(t),r}function Jf(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function Yf(e,t,n,r){let i=1,a=e[0];for(;a!==void 0&&a[r]===void 0;)a=e[i++];if(a===void 0)return;let o=a[r];if(o!==void 0){if(Array.isArray(o))do o=a[r],o!==void 0&&(t.push(a.time),n.push(...o)),a=e[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[r],o!==void 0&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(a!==void 0);else do o=a[r],o!==void 0&&(t.push(a.time),n.push(o)),a=e[i++];while(a!==void 0)}}function Xf(e){switch(e.toLowerCase()){case`scalar`:case`double`:case`float`:case`number`:case`integer`:return Mv;case`vector`:case`vector2`:case`vector3`:case`vector4`:return Iv;case`color`:return jv;case`quaternion`:return Pv;case`bool`:case`boolean`:return Av;case`string`:return Fv}throw Error(`THREE.KeyframeTrack: Unsupported typeName: `+e)}function Zf(e){if(e.type===void 0)throw Error(`THREE.KeyframeTrack: track type undefined, can not parse`);let t=Xf(e.type);if(e.times===void 0){let t=[],n=[];Yf(e.keys,t,n,`value`),e.times=t,e.values=n}return t.parse===void 0?new t(e.name,e.times,e.values,e.interpolation):t.parse(e)}function Qf(e){try{let t=e.slice(e.indexOf(`:`)+1);return new URL(t).protocol===`blob:`}catch{return!1}}function $f(e,t,n,r){let i=ep(r);switch(n){case Ep:return e*t;case jp:return e*t/i.components*i.byteLength;case Mp:return e*t/i.components*i.byteLength;case Np:return e*t*2/i.components*i.byteLength;case Pp:return e*t*2/i.components*i.byteLength;case Dp:return e*t*3/i.components*i.byteLength;case Op:return e*t*4/i.components*i.byteLength;case Fp:return e*t*4/i.components*i.byteLength;case Ip:case Lp:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Rp:case zp:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Vp:case Up:return Math.max(e,16)*Math.max(t,8)/4;case Bp:case Hp:return Math.max(e,8)*Math.max(t,8)/2;case Wp:case Gp:case qp:case Jp:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Kp:case Yp:case Xp:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Zp:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Qp:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case $p:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case em:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case tm:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case nm:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case rm:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case im:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case am:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case om:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case sm:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case cm:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case lm:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case um:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case dm:case fm:case pm:return Math.ceil(e/4)*Math.ceil(t/4)*16;case mm:case hm:return Math.ceil(e/4)*Math.ceil(t/4)*8;case gm:case _m:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error(`Unable to determine texture byte length for ${n} format.`)}function ep(e){switch(e){case pp:case mp:return{byteLength:1,components:1};case gp:case hp:case bp:return{byteLength:2,components:1};case xp:case Sp:return{byteLength:2,components:4};case vp:case _p:case yp:return{byteLength:4,components:1};case wp:case Tp:return{byteLength:4,components:3}}throw Error(`THREE.TextureUtils: Unknown texture type ${e}.`)}var tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Z
1p,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Q,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh,sh,ch,lh,uh,dh,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh,Dh,Oh,kh,Ah,jh,Mh,Nh,Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,ng,rg,ig,ag,og,sg,cg,lg,ug,dg,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg,Sg,Cg,wg,Tg,Eg,Dg,Og,kg,Ag,jg,Mg,Ng,Pg,Fg,Ig,Lg,Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg,Qg,$g,e_,t_,n_,r_,i_,a_,o_,s_,c_,l_,u_,d_,f_,p_,m_,h_,g_,__,v_,y_,b_,x_,S_,C_,w_,T_,E_,D_,O_,k_,A_,j_,M_,N_,P_,F_,I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv,dv,fv,pv,mv,hv,gv,_v,vv,yv,bv,xv,Sv,Cv,wv,Tv,Ev,Dv,Ov,kv,Av,jv,Mv,Nv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Uv,Wv,Gv,Kv,qv,Jv,Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy,ay,oy,sy,cy,ly,uy,dy,fy,py,my,hy,gy,_y,vy,yy,by,xy,Sy,Cy,wy,Ty,Ey,Dy,Oy,ky,Ay,jy,My,Ny,Py,Fy,Iy=i((()=>{tp={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},np={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},rp=`attached`,ip=1e3,ap=1001,op=1002,sp=1003,cp=1004,lp=1005,up=1006,dp=1007,fp=1008,pp=1009,mp=1010,hp=1011,gp=1012,_p=1013,vp=1014,yp=1015,bp=1016,xp=1017,Sp=1018,Cp=1020,wp=35902,Tp=35899,Ep=1021,Dp=1022,Op=1023,kp=1026,Ap=1027,jp=1028,Mp=1029,Np=1030,Pp=1031,Fp=1033,Ip=33776,Lp=33777,Rp=33778,zp=33779,Bp=35840,Vp=35841,Hp=35842,Up=35843,Wp=36196,Gp=37492,Kp=37496,qp=37488,Jp=37489,Yp=37490,Xp=37491,Zp=37808,Qp=37809,$p=37810,em=37811,tm=37812,nm=37813,rm=37814,im=37815,am=37816,om=37817,sm=37818,cm=37819,lm=37820,um=37821,dm=36492,fm=36494,pm=36495,mm=36283,hm=36284,gm=36285,_m=36286,vm=2300,ym=2301,bm=2302,xm=2303,Sm=2400,Cm=2401,wm=2402,Tm=2500,Em=3200,Dm=`srgb`,Om=`srgb-linear`,km=`linear`,Am=`srgb`,jm=7680,Mm=35044,Nm=2e3,Pm={},Fm=null,Im={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},Lm=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}},Rm=`00.01.02.03.04.05.06.07.08.09.0a.0b.0c.0d.0e.0f.10.11.12.13.14.15.16.17.18.19.1a.1b.1c.1d.1e.1f.20.21.22.23.24.25.26.27.28.29.2a.2b.2c.2d.2e.2f.30.31.32.33.34.35.36.37.38.39.3a.3b.3c.3d.3e.3f.40.41.42.43.44.45.46.47.48.49.4a.4b.4c.4d.4e.4f.50.51.52.53.54.55.56.57.58.59.5a.5b.5c.5d.5e.5f.60.61.62.63.64.65.66.67.68.69.6a.6b.6c.6d.6e.6f.70.71.72.73.74.75.76.77.78.79.7a.7b.7c.7d.7e.7f.80.81.82.83.84.85.86.87.88.89.8a.8b.8c.8d.8e.8f.90.91.92.93.94.95.96.97.98.99.9a.9b.9c.9d.9e.9f.a0.a1.a2.a3.a4.a5.a6.a7.a8.a9.aa.ab.ac.ad.ae.af.b0.b1.b2.b3.b4.b5.b6.b7.b8.b9.ba.bb.bc.bd.be.bf.c0.c1.c2.c3.c4.c5.c6.c7.c8.c9.ca.cb.cc.cd.ce.cf.d0.d1.d2.d3.d4.d5.d6.d7.d8.d9.da.db.dc.dd.de.df.e0.e1.e2.e3.e4.e5.e6.e7.e8.e9.ea.eb.ec.ed.ee.ef.f0.f1.f2.f3.f4.f5.f6.f7.f8.f9.fa.fb.fc.fd.fe.ff`.split(`.`),zm=1234567,Bm=Math.PI/180,Vm=180/Math.PI,Hm={DEG2RAD:Bm,RAD2DEG:Vm,generateUUID:lf,clamp:uf,euclideanModulo:df,mapLinear:ff,inverseLerp:pf,lerp:mf,damp:hf,pingpong:gf,smoothstep:_f,smootherstep:vf,randInt:yf,randFloat:bf,randFloatSpread:xf,seededRandom:Sf,degToRad:Cf,radToDeg:wf,isPowerOfTwo:Tf,ceilPowerOfTwo:Ef,floorPowerOfTwo:Df,setQuaternionFromProperEuler:Of,normalize:Af,denormalize:kf},Um=class e{static{e.prototype.isVector2=!0}constructor(e=0,t=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 Error(`THREE.Vector2: index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`THREE.Vector2: 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: 5,414 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){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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=uf(this.x,e.x,t.x),this.y=uf(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=uf(this.x,e,t),this.y=uf(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(uf(n,e,t))}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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(uf(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let 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){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Wm=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,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,r){return this._x=e,this._y=t,this._z=n,this._w=r,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){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:X(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>
vendor: 4,473 bytes, line 1
1Math.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(uf(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),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 e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*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}},Q=class e{static{e.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(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 Error(`THREE.Vector3: 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 Error(`THREE.Vector3: 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(Km.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Km.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}
vendor: 13,020 bytes, line 1
1applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,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=uf(this.x,e.x,t.x),this.y=uf(this.y,e.y,t.y),this.z=uf(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=uf(this.x,e,t),this.y=uf(this.y,e,t),this.z=uf(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(uf(n,e,t))}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}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}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Gm.copy(this).projectOnVector(e),this.sub(Gm)}reflect(e){return this.sub(Gm.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(uf(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*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){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}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(){let e=Math.random()*Math.PI*2,t=Math.random()*2-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}},Gm=new Q,Km=new Wm,qm=class e{static{e.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let 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){let 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){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,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){let 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,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return sf(`Matrix3: .scale() is deprecated. Use .makeScale() instead.`),this.premultiply(Jm.makeScale(e,t)),this}rotate(e){return sf(`Matrix3: .rotate() is deprecated. Use .makeRotation() instead.`),this.premultiply(Jm.makeRotation(-e)),this}translate(e,t){return sf(`Matrix3: .translate() is deprecated. Use .makeTranslation() instead.`),this.premultiply(Jm.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){let 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){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])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){let 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)}},Jm=new qm,Ym=new qm().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Xm=new qm().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),Zm=jf(),$m=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Qm===void 0&&(Qm=nf(`canvas`)),Qm.width=e.width,Qm.height=e.height;let t=Qm.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=Qm}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=nf(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=Mf(i[e]/255)*255;return n.putImageData(r,0,0),t}if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(Mf(t[e]/255)*255):t[e]=Mf(t[e]);return{data:t,width:e.width,height:e.height}}return X(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}},eh=0,th=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:eh++}),this.uuid=lf(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<`u`&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<`u`&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t===null?e.set(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(Pf(r[t].image)):e.push(Pf(r[t]))}else e=Pf(r);n.url=e}return t||(e.images[this.uuid]=n),n}},nh=0,rh=new Q,ih=class e extends Lm{constructor(t=e.DEFAULT_IMAGE,n=e.DEFAULT_MAPPING,r=ap,i=ap,a=up,o=fp,s=Op,c=pp,l=e.DEFAULT_ANISOTROPY,u=``){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:nh++}),this.uuid=lf(),this.name=``,this.source=new th(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=c,this.offset=new Um(0,0),this.repeat=new Um(1,1),this.center=new Um(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new qm,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(rh).x}get height(){return this.source.getSize(rh).y}get depth(){return this.source.getSize(rh).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){X(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){X(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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.t
vendor: 4,938 bytes, line 1
1ype,normalized:this.normalized,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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ip:e.x-=Math.floor(e.x);break;case ap:e.x=e.x<0?0:1;break;case op:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ip:e.y-=Math.floor(e.y);break;case ap:e.y=e.y<0?0:1;break;case op:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}},ih.DEFAULT_IMAGE=null,ih.DEFAULT_MAPPING=300,ih.DEFAULT_ANISOTROPY=1,ah=class e{static{e.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}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,r){return this.x=e,this.y=t,this.z=n,this.w=r,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 Error(`THREE.Vector4: 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 Error(`THREE.Vector4: 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=e.w===void 0?1:e.w,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){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let 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,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let 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=uf(this.x,e.x,t.x),this.y=uf(this.y,e.y,t.y),this.z=uf(this.z,e.z,t.z),this.w=uf(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=uf(this.x,e,t),this.y=uf(this.y,e,t),this.z=uf(this.z,e,t),this.w=uf(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(uf(n,e,t))}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: 13,411 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}},oh=class extends Lm{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:up,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new ah(0,0,e,t),this.scissorTest=!1,this.viewport=new ah(0,0,e,t),this.textures=[];let r={width:e,height:t,depth:n.depth},i=new ih(r),a=n.count;for(let e=0;e<a;e++)this.textures[e]=i.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){let t={minFilter:up,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}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 r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);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 t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new th(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:`dispose`})}},sh=class extends oh{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},ch=class extends ih{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=sp,this.minFilter=sp,this.wrapR=ap,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},lh=class extends ih{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=sp,this.minFilter=sp,this.wrapR=ap,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},uh=class e{static{e.prototype.isMatrix4=!0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,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 e().fromArray(this.elements)}copy(e){let 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){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let 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 this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(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){if(e.determinantAffine()===0)return this.identity();let t=this.elements,n=e.elements,r=1/dh.setFromMatrixColumn(e,0).length(),i=1/dh.setFromMatrixColumn(e,1).length(),a=1/dh.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,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){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}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(ph,e,mh)}lookAt(e,t,n){let r=this.elements;return _h.subVectors(e,t),_h.lengthSq()===0&&(_h.z=1),_h.normalize(),hh.crossVectors(n,_h),hh.lengthSq()===0&&(Math.abs(n.z)===1?_h.x+=1e-4:_h.z+=1e-4,_h.normalize(),hh.crossVectors(n,_h)),hh.normalize(),gh.crossVectors(_h,hh),r[0]=hh.x,r[4]=gh.x,r[8]=_h.x,r[1]=hh.y,r[5]=gh.y,r[9]=_h.y,r[2]=hh.z,r[6]=gh.z,r[10]=_h.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],M=r[14],N=r[3],P=r[7],F=r[11],ee=r[15];return i[0]=a*x+o*T+s*k+c*N,i[4]=a*S+o*E+s*A+c*P,i[8]=a*C+o*D+s*j+c*F,i[12]=a*w+o*O+s*M+c*ee,i[1]=l*x+u*T+d*k+f*N,i[5]=l*S+u*E+d*A+f*P,i[9]=l*C+u*D+d*j+f*F,i[13]=l*w+u*O+d*M+f*ee,i[2]=p*x+m*T+h*k+g*N,i[6]=p*S+m*E+h*A+g*P,i[10]=p*C+m*D+h*j+g*F,i[14]=p*w+m*O+h*M+g*ee,i[3]=_*x+v*T+y*k+b*N,i[7]=_*S+v*E+y*A+b*P,i[11]=_*C+v*D+y*j+b*F,i[15]=_*w+v*O+y*M+b*ee,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[1],a=e[5],o=e[9],s=e[2],c=e[6],l=e[10];return t*(a*l-o*c)-n*(i*l-o*s)+r*(i*c-a*s)}transpose(){let e=this.elements,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){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m,O=d*g-f*h,k=_*O-v*D+y*E+b*T-x*w+S*C;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let A=1/k;return e[0]=(o*O-s*D+c*E)*A,e[1]=(r*D-n*O-i*E)*A,e[2]=(m*S-h*x+g*b)*A,e[3]=(d*x-u*S-f*b)*A,e[4]=(s*T-a*O-c*w)*A,e[5]=(t*O-r*T+i*w)*A,e[6]=(h*y-p*S-g*v)*A,e[7]=(l*S-d*y+f*v)*A,e[8]=(a*D-o*T+c*C)*A,e[9]=(n*T-t*D-i*C)*A,e[10]=(p*x-m*y+g*_)*A,e[11]=(u*y-l*x-f*_)*A,e[12]=(o*w-a*E-s*C)*A,e[13]=(t*E-n*w+r*C)*A,e[14]=(m*v-p*b-h*_)*A,e[15]=(l*b-u*v+d*_)*A,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}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){let 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){let 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){let 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){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+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,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let i=this.determinantAffine();if(i===0)return n.set(1,1,1),t.identity(),this;let a=dh.set(r[0],r[1],r[2]).length(),o=dh.set(r[4],r[5],r[6]).length(),s=dh.set(r[8],r[9],r[10]).length();i<0&&(a=-a),fh.copy(this);let c=1/a,l=1/o,u=1/s;return fh.elements[0]*=c,fh.elements[1]*=c,fh.elements[2]*=c,fh.elements[4]*=l,fh.elements[5]*=l,fh.elements[6]*=l,fh.elements[8]*=u,fh.elements[9]*=u,fh.elements[10]*=u,t.setFromRotationMatrix(fh),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,a,o=Nm,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}
vendor: 5,567 bytes, line 1
1makeOrthographic(e,t,n,r,i,a,o=Nm,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])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){let 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}},dh=new Q,fh=new uh,ph=new Q(0,0,0),mh=new Q(1,1,1),hh=new Q,gh=new Q,_h=new Q,vh=new uh,yh=new Wm,bh=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}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 order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(uf(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-uf(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(uf(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-uf(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(uf(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-uf(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:X(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return vh.makeRotationFromQuaternion(e),this.setFromRotationMatrix(vh,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return yh.setFromEuler(this),this.setFromQuaternion(yh,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[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._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}},bh.DEFAULT_ORDER=`XYZ`,xh=class{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(this.mask&e.mask)!==0}isEnabled(e){return!!(this.mask&(1<<e|0))}},Sh=0,Ch=new Q,wh=new Wm,Th=new uh,Eh=new Q,Dh=new Q,Oh=new Q,kh=new Wm,Ah=new Q(1,0,0),jh=new Q(0,1,0),Mh=new Q(0,0,1),Nh={type:`added`},Ph={type:`removed`},Fh={type:`childadded`,child:null},Ih={type:`childremoved`,child:null},Lh=class e extends Lm{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Sh++}),this.uuid=lf(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=e.DEFAULT_UP.clone();let t=new Q,n=new bh,r=new Wm,i=new Q(1,1,1);function a(){r.setFromEuler(n,!1)}function o(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new uh},normalMatrix:{value:new qm}}),this.matrix=new uh,this.matrixWorld=new uh,this.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new xh,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}
vendor: 4,437 bytes, line 1
1setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return wh.setFromAxisAngle(e,t),this.quaternion.multiply(wh),this}rotateOnWorldAxis(e,t){return wh.setFromAxisAngle(e,t),this.quaternion.premultiply(wh),this}rotateX(e){return this.rotateOnAxis(Ah,e)}rotateY(e){return this.rotateOnAxis(jh,e)}rotateZ(e){return this.rotateOnAxis(Mh,e)}translateOnAxis(e,t){return Ch.copy(e).applyQuaternion(this.quaternion),this.position.add(Ch.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Ah,e)}translateY(e){return this.translateOnAxis(jh,e)}translateZ(e){return this.translateOnAxis(Mh,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Th.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Eh.copy(e):Eh.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),Dh.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Th.lookAt(Dh,Eh,this.up):Th.lookAt(Eh,Dh,this.up),this.quaternion.setFromRotationMatrix(Th),r&&(Th.extractRotation(r.matrixWorld),wh.setFromRotationMatrix(Th),this.quaternion.premultiply(wh.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(Z(`Object3D.add: object can't be added as a child of itself.`,e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Nh),Fh.child=e,this.dispatchEvent(Fh),Fh.child=null):Z(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Ph),Ih.child=e,this.dispatchEvent(Ih),Ih.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Th.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Th.multiply(e.parent.matrixWorld)),e.applyMatrix4(Th),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Nh),Fh.child=e,this.dispatchEvent(Fh),Fh.child=null,this}getObjectById(e){return this.getObjectByProperty(`id`,e)}getObjectByName(e){return this.getObjectByProperty(`name`,e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Dh,e,Oh),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Dh,kh,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,r=e.z,i=this.matrix.elements;i[12]+=t-i[0]*t-i[4]*n-i[8]*r,i[13]+=n-i[1]*t-i[5]*n-i[9]*r,i[14]+=r-i[2]*t-i[6]*n-i[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix
vendor: 14,399 bytes, line 1
1):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){let e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0,n)}}toJSON(e){let t=e===void 0||typeof e==`string`,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:`Object`,generator:`Object3D.toJSON`});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==``&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0){if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material)}if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){let t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),c=a(e.skeletons),l=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot===null?null:e.pivot.clone(),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}},Lh.DEFAULT_UP=new Q(0,1,0),Lh.DEFAULT_MATRIX_AUTO_UPDATE=!0,Lh.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,Rh=class extends Lh{constructor(){super(),this.isGroup=!0,this.type=`Group`}},zh={type:`move`},Bh=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Rh,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Rh,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Rh,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Q,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let 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}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(zh)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new Rh;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},Vh={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},Hh={h:0,s:0,l:0},Uh={h:0,s:0,l:0},Wh=class{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(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Dm){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Zm.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Zm.workingColorSpace){return this.r=e,this.g=t,this.b=n,Zm.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Zm.workingColorSpace){if(e=df(e,1),t=uf(t,0,1),n=uf(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ff(i,r,e+1/3),this.g=Ff(i,r,e),this.b=Ff(i,r,e-1/3)}return Zm.colorSpaceToWorking(this,r),this}setStyle(e,t=Dm){function n(t){t!==void 0&&parseFloat(t)<1&&X(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:X(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);X(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Dm){let n=Vh[e.toLowerCase()];return n===void 0?X(`Color: Unknown color `+e):this.setHex(n,t),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=Mf(e.r),this.g=Mf(e.g),this.b=Mf(e.b),this}copyLinearToSRGB(e){return this.r=Nf(e.r),this.g=Nf(e.g),this.b=Nf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Dm){return Zm.workingToColorSpace(Gh.copy(this),e),Math.round(uf(Gh.r*255,0,255))*65536+Math.round(uf(Gh.g*255,0,255))*256+Math.round(uf(Gh.b*255,0,255))}getHexString(e=Dm){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Zm.workingColorSpace){Zm.workingToColorSpace(Gh.copy(this),t);let n=Gh.r,r=Gh.g,i=Gh.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;
vendor: 8,216 bytes, line 1
1if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=Zm.workingColorSpace){return Zm.workingToColorSpace(Gh.copy(this),t),e.r=Gh.r,e.g=Gh.g,e.b=Gh.b,e}getStyle(e=Dm){Zm.workingToColorSpace(Gh.copy(this),e);let t=Gh.r,n=Gh.g,r=Gh.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(Hh),this.setHSL(Hh.h+e,Hh.s+t,Hh.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}lerpColors(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(Hh),e.getHSL(Uh);let n=mf(Hh.h,Uh.h,t),r=mf(Hh.s,Uh.s,t),i=mf(Hh.l,Uh.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,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}},Gh=new Wh,Wh.NAMES=Vh,Kh=class extends Lh{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 bh,this.environmentIntensity=1,this.environmentRotation=new bh,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(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),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},qh=new Q,Jh=new Q,Yh=new Q,Xh=new Q,Zh=new Q,Qh=new Q,$h=new Q,eg=new Q,tg=new Q,ng=new Q,rg=new ah,ig=new ah,ag=new ah,og=class e{constructor(e=new Q,t=new Q,n=new Q){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),qh.subVectors(e,t),r.cross(qh);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){qh.subVectors(r,t),Jh.subVectors(n,t),Yh.subVectors(e,t);let a=qh.dot(qh),o=qh.dot(Jh),s=qh.dot(Yh),c=Jh.dot(Jh),l=Jh.dot(Yh),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Xh)!==null&&Xh.x>=0&&Xh.y>=0&&Xh.x+Xh.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Xh)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Xh.x),s.addScaledVector(a,Xh.y),s.addScaledVector(o,Xh.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return rg.setScalar(0),ig.setScalar(0),ag.setScalar(0),rg.fromBufferAttribute(e,t),ig.fromBufferAttribute(e,n),ag.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(rg,i.x),a.addScaledVector(ig,i.y),a.addScaledVector(ag,i.z),a}static isFrontFacing(e,t,n,r){return qh.subVectors(n,t),Jh.subVectors(e,t),qh.cross(Jh).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),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 qh.subVectors(this.c,this.b),Jh.subVectors(this.a,this.b),qh.cross(Jh).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Zh.subVectors(r,n),Qh.subVectors(i,n),eg.subVectors(e,n);let s=Zh.dot(eg),c=Qh.dot(eg);if(s<=0&&c<=0)return t.copy(n);tg.subVectors(e,r);let l=Zh.dot(tg),u=Qh.dot(tg);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Zh,a);ng.subVectors(e,i);let f=Zh.dot(ng),p=Qh.dot(ng);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Qh,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return $h.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector($h,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Zh,a).addScaledVector(Qh,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},sg=class{constructor(e=new Q(1/0,1/0,1/0),t=new Q(-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(lg.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(lg.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){let n=lg.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);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,lg):lg.fromBufferAttribute(r,t),lg.applyM
vendor: 4,153 bytes, line 1
1atrix4(e.matrixWorld),this.expandByPoint(lg);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),ug.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),ug.copy(e.boundingBox)),ug.applyMatrix4(e.matrixWorld),this.union(ug)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],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,lg),lg.distanceToSquared(e.center)<=e.radius*e.radius}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(_g),vg.subVectors(this.max,_g),dg.subVectors(e.a,_g),fg.subVectors(e.b,_g),pg.subVectors(e.c,_g),mg.subVectors(fg,dg),hg.subVectors(pg,fg),gg.subVectors(dg,pg);let t=[0,-mg.z,mg.y,0,-hg.z,hg.y,0,-gg.z,gg.y,mg.z,0,-mg.x,hg.z,0,-hg.x,gg.z,0,-gg.x,-mg.y,mg.x,0,-hg.y,hg.x,0,-gg.y,gg.x,0];return!If(t,dg,fg,pg,vg)||(t=[1,0,0,0,1,0,0,0,1],!If(t,dg,fg,pg,vg))?!1:(yg.crossVectors(mg,hg),t=[yg.x,yg.y,yg.z],If(t,dg,fg,pg,vg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,lg).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(lg).length()*.5),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()?this:(cg[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),cg[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),cg[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),cg[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),cg[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),cg[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),cg[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),cg[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(cg),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},cg=[new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q],lg=new Q,ug=new sg,dg=new Q,fg=new Q,pg=new Q,mg=new Q,hg=new Q,gg=new Q,_g=new Q,vg=new Q,yg=new Q,bg=new Q,xg=new Q,Sg=new Um,Cg=0,wg=class extends Lm{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Cg++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=Mm,this.updateRanges=[],this.gpuType=yp,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&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,166 bytes, line 1
1for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Sg.fromBufferAttribute(this,t),Sg.applyMatrix3(e),this.setXY(t,Sg.x,Sg.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)xg.fromBufferAttribute(this,t),xg.applyMatrix3(e),this.setXYZ(t,xg.x,xg.y,xg.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)xg.fromBufferAttribute(this,t),xg.applyMatrix4(e),this.setXYZ(t,xg.x,xg.y,xg.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)xg.fromBufferAttribute(this,t),xg.applyNormalMatrix(e),this.setXYZ(t,xg.x,xg.y,xg.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)xg.fromBufferAttribute(this,t),xg.transformDirection(e),this.setXYZ(t,xg.x,xg.y,xg.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=kf(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Af(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=kf(t,this.array)),t}setX(e,t){return this.normalized&&(t=Af(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=kf(t,this.array)),t}setY(e,t){return this.normalized&&(t=Af(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=kf(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Af(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=kf(t,this.array)),t}setW(e,t){return this.normalized&&(t=Af(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Af(t,this.array),n=Af(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Af(t,this.array),n=Af(n,this.array),r=Af(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Af(t,this.array),n=Af(n,this.array),r=Af(r,this.array),i=Af(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==``&&(e.name=this.name),this.usage!==35044&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:`dispose`})}},Tg=class extends wg{constructor(e,t,n){super(new Uint16Array(e),t,n)}},Eg=class extends wg{constructor(e,t,n){super(new Uint32Array(e),t,n)}},Dg=class extends wg{constructor(e,t,n){super(new Float32Array(e),t,n)}},Og=new sg,kg=new Q,Ag=new Q,jg=class{constructor(e=new Q,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){let n=this.center;t===void 0?Og.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),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){let 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){let 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)}
vendor: 41,811 bytes, line 1
1applyMatrix4(e){return this.center.applyMatrix4(e),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;kg.subVectors(e,this.center);let t=kg.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(kg,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Ag.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(kg.copy(e.center).add(Ag)),this.expandByPoint(kg.copy(e.center).sub(Ag))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},Mg=0,Ng=new uh,Pg=new Lh,Fg=new Q,Ig=new sg,Lg=new sg,Rg=new Q,zg=class e extends Lm{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Mg++}),this.uuid=lf(),this.name=``,this.type=`BufferGeometry`,this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return this.index=Array.isArray(e)?new(ef(e)?Eg:Tg)(e,1):e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}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 this.attributes[e]!==void 0}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){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new qm().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return Ng.makeRotationFromQuaternion(e),this.applyMatrix4(Ng),this}rotateX(e){return Ng.makeRotationX(e),this.applyMatrix4(Ng),this}rotateY(e){return Ng.makeRotationY(e),this.applyMatrix4(Ng),this}rotateZ(e){return Ng.makeRotationZ(e),this.applyMatrix4(Ng),this}translate(e,t,n){return Ng.makeTranslation(e,t,n),this.applyMatrix4(Ng),this}scale(e,t,n){return Ng.makeScale(e,t,n),this.applyMatrix4(Ng),this}lookAt(e){return Pg.lookAt(e),Pg.updateMatrix(),this.applyMatrix4(Pg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Fg).negate(),this.translate(Fg.x,Fg.y,Fg.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new Dg(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&X(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new sg);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Z(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new Q(-1/0,-1/0,-1/0),new Q(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Ig.setFromBufferAttribute(n),this.morphTargetsRelative?(Rg.addVectors(this.boundingBox.min,Ig.min),this.boundingBox.expandByPoint(Rg),Rg.addVectors(this.boundingBox.max,Ig.max),this.boundingBox.expandByPoint(Rg)):(this.boundingBox.expandByPoint(Ig.min),this.boundingBox.expandByPoint(Ig.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Z(`BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.`,this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new jg);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Z(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new Q,1/0);return}if(e){let n=this.boundingSphere.center;if(Ig.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Lg.setFromBufferAttribute(n),this.morphTargetsRelative?(Rg.addVectors(Ig.min,Lg.min),Ig.expandByPoint(Rg),Rg.addVectors(Ig.max,Lg.max),Ig.expandByPoint(Rg)):(Ig.expandByPoint(Lg.min),Ig.expandByPoint(Lg.max))}Ig.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Rg.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Rg));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)Rg.fromBufferAttribute(a,t),o&&(Fg.fromBufferAttribute(e,t),Rg.add(Fg)),r=Math.max(r,n.distanceToSquared(Rg))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&Z(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){Z(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv,a=this.getAttribute(`tangent`);(a===void 0||a.count!==n.count)&&(a=new wg(new Float32Array(4*n.count),4),this.setAttribute(`tangent`,a));let o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new Q,s[e]=new Q;let c=new Q,l=new Q,u=new Q,d=new Um,f=new Um,p=new Um,m=new Q,h=new Q;function g(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),l.sub(c),u.sub(c),f.sub(d),p.sub(d);let a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(a),h.copy(u).multiplyScalar(f.x).addScaledVector(l,-p.x).multiplyScalar(a),o[e].add(m),o[t].add(m),o[r].add(m),s[e].add(h),s[t].add(h),s[r].add(h))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new Q,y=new Q,b=new Q,x=new Q;function S(e){b.fromBufferAttribute(r,e),x.copy(b);let t=o[e];v.copy(t),v.sub(b.multiplyScalar(b.dot(t))).normalize(),y.crossVectors(x,t);let n=y.dot(s[e])<0?-1:1;a.setXYZW(e,v.x,v.y,v.z,n)}for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){let e=this.index,t=this.getAttribute(`position`);if(t!==void 0){let n=this.getAttribute(`normal`);if(n===void 0||n.count!==t.count)n=new wg(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new Q,i=new Q,a=new Q,o=new Q,s=new Q,c=new Q,l=new Q,u=new Q;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Rg.fromBufferAttribute(e,t),Rg.normalize(),e.setXYZ(t,Rg.x,Rg.y,Rg.z)}toNonIndexed(){function t(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new wg(a,r,i)}if(this.index===null)return X(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let n=new e,r=this.index.array,i=this.attributes;for(let e in i){let a=i[e],o=t(a,r);n.setAttribute(e,o)}let a=this.morphAttributes;for(let e in a){let i=[],o=a[e];for(let e=0,n=o.length;e<n;e++){let n=o[e],a=t(n,r);i.push(a)}n.morphAttributes[e]=i}n.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let e=0,t=o.length;e<t;e++){let t=o[e];n.addGroup(t.start,t.count,t.materialIndex)}return n}toJSON(){let e={metadata:{version:4.7,type:`BufferGeometry`,generator:`BufferGeometry.toJSON`}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?`BufferGeometry`:this.type,this.name!==``&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),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;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:`dispose`})}},Bg=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=Mm,this.updateRanges=[],this.version=0,this.uuid=lf()}onUploadCallback(){}set needsUpdate(e){e===!0&&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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=lf()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=lf()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},Vg=new Q,Hg=class e{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name=``,this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Vg.fromBufferAttribute(this,t),Vg.applyMatrix4(e),this.setXYZ(t,Vg.x,Vg.y,Vg.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Vg.fromBufferAttribute(this,t),Vg.applyNormalMatrix(e),this.setXYZ(t,Vg.x,Vg.y,Vg.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Vg.fromBufferAttribute(this,t),Vg.transformDirection(e),this.setXYZ(t,Vg.x,Vg.y,Vg.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=kf(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Af(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Af(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Af(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Af(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Af(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=kf(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=kf(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=kf(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=kf(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Af(t,this.array),n=Af(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Af(t,this.array),n=Af(n,this.array),r=Af(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Af(t,this.array),n=Af(n,this.array),r=Af(r,this.array),i=Af(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(t){if(t===void 0){af(`InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new wg(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){af(`InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},Ug=0,Wg=class extends Lm{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Ug++}),this.uuid=lf(),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 Wh(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=jm,this.stencilZFail=jm,this.stencilZPass=jm,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.allowOverride=!0,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(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){X(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){X(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(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()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(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),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(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,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new Wh().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(this.vertexColors=typeof e.vertexColors==`number`?e.vertexColors>0:e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),this.normalScale=new Um().fromArray(t)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new Um().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}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;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].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.allowOverride=e.allowOverride,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){e===!0&&this.version++}},Gg=new Q,Kg=new Q,qg=new Q,Jg=new Q,Yg=new Q,Xg=new Q,Zg=new Q,Qg=class{constructor(e=new Q,t=new Q(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,Gg)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let 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){let t=Gg.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Gg.copy(this.origin).addScaledVector(this.direction,t),Gg.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Kg.copy(e).add(t).multiplyScalar(.5),qg.copy(t).sub(e).normalize(),Jg.copy(this.origin).sub(Kg);let i=e.distanceTo(t)*.5,a=-this.direction.dot(qg),o=Jg.dot(this.direction),s=-Jg.dot(qg),c=Jg.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0){if(u=a*s-o,d=a*o-s,p=i*l,u>=0){if(d>=-p){if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c)}else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Kg).addScaledVector(qg,d),f}intersectSphere(e,t){Gg.subVectors(e.center,this.origin);let n=Gg.dot(this.direction),r=Gg.dot(Gg)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Gg)!==null}intersectTriangle(e,t,n,r,i){Yg.subVectors(t,e),Xg.subVectors(n,e),Zg.crossVectors(Yg,Xg);let a=this.direction.dot(Zg),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Jg.subVectors(this.origin,e);let s=o*this.direction.dot(Xg.crossVectors(Jg,Xg));if(s<0)return null;let c=o*this.direction.dot(Yg.cross(Jg));if(c<0||s+c>a)return null;let l=-o*Jg.dot(Zg);return l<0?null:this.at(l/a,i)}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)}},$g=class extends Wg{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new Wh(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 bh,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}},e_=new uh,t_=new Qg,n_=new jg,r_=new Q,i_=new Q,a_=new Q,o_=new Q,s_=new Q,c_=new Q,l_=new Q,u_=new Q,d_=class extends Lh{constructor(e=new zg,t=new $g){super(),this.isMesh=!0,this.type=`Mesh`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){c_.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(s_.fromBufferAttribute(s,e),a?c_.addScaledVector(s_,r):c_.addScaledVector(s_.sub(t),r))}t.add(c_)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),n_.copy(n.boundingSphere),n_.applyM
1atrix4(i),t_.copy(e.ray).recast(e.near),!(n_.containsPoint(t_.origin)===!1&&(t_.intersectSphere(n_,r_)===null||t_.origin.distanceToSquared(r_)>(e.far-e.near)**2))&&(e_.copy(i).invert(),t_.copy(e.ray).applyMatrix4(e_),(n.boundingBox===null||t_.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,t_)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null){if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=Rf(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=Rf(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}}else if(s!==void 0){if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=Rf(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=Rf(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}}},f_=new ah,p_=new ah,m_=new ah,h_=new ah,g_=new uh,__=new Q,v_=new jg,y_=new uh,b_=new Qg,x_=class extends d_{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type=`SkinnedMesh`,this.bindMode=rp,this.bindMatrix=new uh,this.bindMatrixInverse=new uh,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new sg),this.boundingBox.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e<t.count;e++)this.getVertexPosition(e,__),this.boundingBox.expandByPoint(__)}computeBoundingSphere(){let e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new jg),this.boundingSphere.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e<t.count;e++)this.getVertexPosition(e,__),this.boundingSphere.expandByPoint(__)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let n=this.material,r=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),v_.copy(this.boundingSphere),v_.applyMatrix4(r),e.ray.intersectsSphere(v_)!==!1&&(y_.copy(r).invert(),b_.copy(e.ray).applyMatrix4(y_),(this.boundingBox===null||b_.intersectsBox(this.boundingBox)!==!1)&&this._computeIntersections(e,t,b_)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new ah,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);let r=1/e.manhattanLength();r===1/0?e.set(1,0,0,0):e.multiplyScalar(r),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===`attached`?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===`detached`?this.bindMatrixInverse.copy(this.bindMatrix).invert():X(`SkinnedMesh: Unrecognized bindMode: `+this.bindMode)}applyBoneTransform(e,t){let n=this.skeleton,r=this.geometry;p_.fromBufferAttribute(r.attributes.skinIndex,e),m_.fromBufferAttribute(r.attributes.skinWeight,e),t.isVector4?(f_.copy(t),t.set(0,0,0,0)):(f_.set(...t,1),t.set(0,0,0)),f_.applyMatrix4(this.bindMatrix);for(let e=0;e<4;e++){let r=m_.getComponent(e);
vendor: 21,144 bytes, lines 1-5
1if(r!==0){let i=p_.getComponent(e);g_.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(h_.copy(f_).applyMatrix4(g_),r)}}return t.isVector4&&(t.w=f_.w),t.applyMatrix4(this.bindMatrixInverse)}},S_=class extends Lh{constructor(){super(),this.isBone=!0,this.type=`Bone`}},C_=class extends ih{constructor(e=null,t=1,n=1,r,i,a,o,s,c=sp,l=sp,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},w_=new uh,T_=new uh,E_=class e{constructor(e=[],t=[]){this.uuid=lf(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){X(`Skeleton: Number of inverse bone matrices does not match amount of bones.`),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new uh)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new uh;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){let i=e[r]?e[r].matrixWorld:T_;w_.multiplyMatrices(i,t[r]),w_.toArray(n,r*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new e(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let n=new C_(t,e,e,Op,yp);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){let n=this.bones[t];if(n.name===e)return n}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){let r=e.bones[n],i=t[r];i===void 0&&(X(`Skeleton: No bone found with UUID:`,r),i=new S_),this.bones.push(i),this.boneInverses.push(new uh().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){let e={metadata:{version:4.7,type:`Skeleton`,generator:`Skeleton.toJSON`},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){let i=t[r];e.bones.push(i.uuid);let a=n[r];e.boneInverses.push(a.toArray())}return e}},D_=class extends wg{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},O_=new uh,k_=new uh,A_=[],j_=new sg,M_=new uh,N_=new d_,P_=new jg,F_=class extends d_{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new D_(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e<n;e++)this.setMatrixAt(e,M_)}computeBoundingBox(){let e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new sg),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,O_),j_.copy(e.boundingBox).applyMatrix4(O_),this.boundingBox.union(j_)}computeBoundingSphere(){let e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new jg),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,O_),P_.copy(e.boundingSphere).applyMatrix4(O_),this.boundingSphere.union(P_)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){return this.instanceColor===null?t.setRGB(1,1,1):t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){return t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,i=e*(n.length+1)+1;for(let e=0;e<n.length;e++)n[e]=r[i+e]}raycast(e,t){let n=this.matrixWorld,r=this.count;if(N_.geometry=this.geometry,N_.material=this.material,N_.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),P_.copy(this.boundingSphere),P_.applyMatrix4(n),e.ray.intersectsSphere(P_)!==!1))for(let i=0;i<r;i++){this.getMatrixAt(i,O_),k_.multiplyMatrices(n,O_),N_.matrixWorld=k_,N_.raycast(e,A_);for(let e=0,n=A_.length;e<n;e++){let n=A_[e];n.instanceId=i,n.object=this,t.push(n)}A_.length=0}}setColorAt(e,t){return this.instanceColor===null&&(this.instanceColor=new D_(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3),this}setMatrixAt(e,t){return t.toArray(this.instanceMatrix.array,e*16),this}setMorphAt(e,t){let n=t.morphTargetInfluences,r=n.length+1;this.morphTexture===null&&(this.morphTexture=new C_(new Float32Array(r*this.count),r,this.count,jp,yp));let i=this.morphTexture.source.data.data,a=0;for(let e=0;e<n.length;e++)a+=n[e];let o=this.geometry.morphTargetsRelative?1:1-a,s=r*e;return i[s]=o,i.set(n,s+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:`dispose`}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}},I_=new Q,L_=new Q,R_=new qm,z_=class{constructor(e=new Q(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,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=I_.subVectors(n,t).cross(L_.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let 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,n=!0){let r=e.delta(I_),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let 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){let n=t||R_.getNormalMatrix(e),r=this.coplanarPoint(I_).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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)}},B_=new jg,V_=new Um(.5,.5),H_=new Q,U_=class{constructor(e=new z_,t=new z_,n=new z_,r=new z_,i=new z_,a=new z_){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Nm,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),B_.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),B_.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(B_)}intersectsSprite(e){B_.center.set(0,0,0);let t=V_.distanceTo(e.center);return B_.radius=.7071067811865476+t,B_.applyMatrix4(e.matrixWorld),this.intersectsSphere(B_)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(H_.x=r.normal.x>0?e.max.x:e.min.x,H_.y=r.normal.y>0?e.max.y:e.min.y,H_.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(H_)<0)return!1}return!0}containsPoint(e){let 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)}},W_=class extends Wg{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new Wh(16777215),this.map=null,this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},G_=new Q,K_=new Q,q_=new uh,J_=new Qg,Y_=new jg,X_=new Q,Z_=new Q,Q_=class extends Lh{constructor(e=new zg,t=new W_){super(),this.isLine=!0,this.type=`Line`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)G_.fromBufferAttribute(t,e-1),K_.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=G_.distanceTo(K_);e.setAttribute(`lineDistance`,new Dg(n,1))}else X(`Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Y_.copy(n.boundingSphere),Y_.applyMatrix4(r),Y_.radius+=i,e.ray.intersectsSphere(Y_)===!1)return;q_.copy(r).invert(),J_.copy(e.ray).applyMatrix4(q_);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=this.isLineSegments?2:1,l=n.index,u=n.attributes.position;if(l!==null){let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=l.getX(i),r=l.getX(i+1),a=zf(this,e,J_,s,n,r,i);a&&t.push(a)}if(this.isLineLoop){let i=l.getX(r-1),a=l.getX(n),o=zf(this,e,J_,s,i,a,r-1);o&&t.push(o)}}else{let n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=zf(this,e,J_,s,i,i+1,i);n&&t.push(n)}if(this.isLineLoop){let i=zf(this,e,J_,s,r-1,n,r-1);i&&t.push(i)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}},$_=new Q,ev=new Q,tv=class extends Q_{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)$_.fromBufferAttribute(t,e),ev.fromBufferAttribute(t,e+1),n[e]=e===0?0:n[e-1],n[e+1]=n[e]+$_.distanceTo(ev);e.setAttribute(`lineDistance`,new Dg(n,1))}else X(`LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}},nv=class extends Q_{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type=`LineLoop`}},rv=class extends Wg{constructor(e){super(),this.isPointsMaterial=!0,this.type=`PointsMaterial`,this.color=new Wh(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},iv=new uh,av=new Qg,ov=new jg,sv=new Q,cv=class extends Lh{constructor(e=new zg,t=new rv){super(),this.isPoints=!0,this.type=`Points`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),ov.copy(n.boundingSphere),ov.applyMatrix4(r),ov.radius+=i,e.ray.intersectsSphere(ov)===!1)return;iv.copy(r).invert(),av.copy(e.ray).applyMatrix4(iv);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=n.index,l=n.attributes.position;if(c!==null){let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let a=n,o=i;a<o;a++){let n=c.getX(a);sv.fromBufferAttribute(l,n),Bf(sv,n,s,r,e,t,this)}}else{let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);for(let a=n,o=i;a<o;a++)sv.fromBufferAttribute(l,a),Bf(sv,a,s,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}},lv=class extends ih{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},uv=class extends ih{constructor(e,t,n=vp,r,i,a,o=sp,s=sp,c,l=kp,u=1){if(l!==1026&&l!==1027)throw Error(`THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new th(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},dv=class extends uv{constructor(e,t=vp,n=301,r,i,a=sp,o=sp,s,c=kp){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},fv=class extends ih{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},pv=class e extends zg{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new Dg(c,3)),this.setAttribute(`normal`,new Dg(l,3)),this.setAttribute(`uv`,new Dg(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new Q;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}},mv=class e extends zg{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new Dg(p,3)),this.setAttribute(`normal`,new Dg(m,3)),this.setAttribute(`uv`,new Dg(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}},hv={clone:Vf,merge:Hf},gv=`void main() {
2	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3}`,_v=`void main() {
4	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
5}`,vv=class extends Wg{constructor(e){super(),this.isShaderMaterial=!0,this.type=`ShaderMaterial`,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=gv,this.fragmentShader=_v,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,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Vf(e.uniforms),this.uniformsGroups=Wf(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.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:`t`,value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:`c`,value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:`v2`,value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:`v3`,value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:`v4`,value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:`m3`,value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:`m4`,value:r.toArray()}:t.uniforms[n]={value:r}}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;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(let n in e.uniforms){let r=e.uniforms[n];switch(this.uniforms[n]={},r.type){case`t`:this.uniforms[n].value=t[r.value]||null;break;case`c`:this.uniforms[n].value=new Wh().setHex(r.value);break;case`v2`:this.uniforms[n].value=new Um().fromArray(r.value);break;case`v3`:this.uniforms[n].value=new Q().fromArray(r.value);break;case`v4`:this.uniforms[n].value=new ah().fromArray(r.value);break;case`m3`:this.uniforms[n].value=new qm().fromArray(r.value);break;case`m4`:this.uniforms[n].value=new uh().fromArray(r.value);break;default:this.uniforms[n].value=r.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(let t in e.extensions)this.extensions[t]=e.extensions[t];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}},yv=class extends vv{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type=`RawS
5haderMaterial`}},bv=class extends Wg{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type=`MeshStandardMaterial`,this.defines={STANDARD:``},this.color=new Wh(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wh(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Um(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new bh,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:``},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},xv=class extends bv{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:``,PHYSICAL:``},this.type=`MeshPhysicalMaterial`,this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Um(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return uf(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Wh(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Wh(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Wh(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},Sv=class extends Wg{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=Em,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}},Cv=class extends Wg{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}},wv=class{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{let a;linear_scan:{forward_scan:if(!(e<r)){for(let a=n+2;;){if(r===void 0){if(e<i)break forward_scan;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(i=r,r=t[++n],e<r)break seek}a=t.length;break linear_scan}if(!(e>=i)){let o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(r=i,i=t[--n-1],e>=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n<a;){let r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],i=t[n-1],i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw Error(`THREE.Interpolant: Call to abstract method.`)}intervalChanged_(){}},Tv=class extends wv{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Sm,endingEnd:Sm}}intervalChanged_(e,t,n){let r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(o===void 0)switch(this.getSettings_().endingStart){case Cm:i=e,o=2*t-n;break;case wm:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(s===void 0)switch(this.getSettings_().endingEnd){case Cm:a=e,s=2*n-t;break;case wm:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}let c=(n-t)*.5,l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(n-t)/(r-t),m=p*p,h=m*p,g=-d*h+2*d*m-d*p,_=(1+d)*h+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*h+(1.5+f)*m+.5*p,y=f*h-f*m;for(let e=0;e!==o;++e)i[e]=g*a[l+e]+_*a[c+e]+v*a[s+e]+y*a[u+e];return i}},Ev=class extends wv{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l;for(let e=0;e!==o;++e)i[e]=a[c+e]*u+a[s+e]*l;return i}},Dv=class extends wv{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}},Ov=class extends wv{interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this.inTangents,u=this.outTangents;if(!l||!u){let e=(n-t)/(r-t),l=1-e;for(let t=0;t!==o;++t)i[t]=a[c+t]*l+a[s+t]*e;return i}let d=o*2,f=e-1;for(let p=0;p!==o;
5++p){let o=a[c+p],m=a[s+p],h=f*d+p*2,g=u[h],_=u[h+1],v=e*d+p*2,y=l[v],b=l[v+1],x=(n-t)/(r-t),S,C,w,T,E;for(let e=0;e<8;e++){S=x*x,C=S*x,w=1-x,T=w*w,E=T*w;let e=E*t+3*T*x*g+3*w*S*y+C*r-n;if(Math.abs(e)<1e-10)break;let i=3*T*(g-t)+6*w*x*(y-g)+3*S*(r-y);if(Math.abs(i)<1e-10)break;x-=e/i,x=Math.max(0,Math.min(1,x))}i[p]=E*o+3*T*x*_+3*w*S*b+C*m}return i}},kv=class{constructor(e,t,n,r){if(e===void 0)throw Error(`THREE.KeyframeTrack: track name is undefined`);if(t===void 0||t.length===0)throw Error(`THREE.KeyframeTrack: no keyframes in track named `+e);this.name=e,this.times=Kf(t,this.TimeBufferType),this.values=Kf(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Kf(e.times,Array),values:Kf(e.values,Array)};let t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Dv(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Ev(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Tv(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){let t=new Ov(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.inTangents=this.settings.inTangents,t.outTangents=this.settings.outTangents),t}setInterpolation(e){let t;switch(e){case vm:t=this.InterpolantFactoryMethodDiscrete;break;case ym:t=this.InterpolantFactoryMethodLinear;break;case bm:t=this.InterpolantFactoryMethodSmooth;break;case xm:t=this.InterpolantFactoryMethodBezier}if(t===void 0){let t=`unsupported interpolation for `+this.ValueTypeName+` keyframe track named `+this.name;if(this.createInterpolant===void 0){if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t)}return X(`KeyframeTrack:`,t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return vm;case this.InterpolantFactoryMethodLinear:return ym;case this.InterpolantFactoryMethodSmooth:return bm;case this.InterpolantFactoryMethodBezier:return xm}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){let n=this.times,r=n.length,i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;a!==-1&&n[a]>t;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(Z(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(Z(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){Z(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){Z(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&tf(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){Z(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===bm,i=e.length-1,a=1;for(let o=1;o<i;++o){let i=!1,s=e[o];if(s!==e[o+1]&&(o!==1||s!==e[0])){if(r)i=!0;else{let e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){let n=t[e+o];if(n!==t[r+o]||n!==t[a+o]){i=!0;break}}}}if(i){if(o!==a){e[a]=e[o];let r=o*n,i=a*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++a}}if(i>0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}},kv.prototype.ValueTypeName=``,kv.prototype.TimeBufferType=Float32Array,kv.prototype.ValueBufferType=Float32Array,kv.prototype.DefaultInterpolation=ym,Av=class extends kv{constructor(e,t,n){super(e,t,n)}},Av.prototype.ValueTypeName=`bool`,Av.prototype.ValueBufferType=Array,Av.prototype.DefaultInterpolation=vm,Av.prototype.InterpolantFactoryMethodLinear=void 0,Av.prototype.InterpolantFactoryMethodSmooth=void 0,jv=class extends kv{constructor(e,t,n,r){super(e,t,n,r)}},jv.prototype.ValueTypeName=`color`,Mv=class extends kv{constructor(e,t,n,r){super(e,t,n,r)}},Mv.prototype.ValueTypeName=`number`,Nv=class extends wv{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;
vendor: 15,592 bytes, line 5
5c+=4)Wm.slerpFlat(i,0,a,c-o,a,c,s);return i}},Pv=class extends kv{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new Nv(this.times,this.values,this.getValueSize(),e)}},Pv.prototype.ValueTypeName=`quaternion`,Pv.prototype.InterpolantFactoryMethodSmooth=void 0,Fv=class extends kv{constructor(e,t,n){super(e,t,n)}},Fv.prototype.ValueTypeName=`string`,Fv.prototype.ValueBufferType=Array,Fv.prototype.DefaultInterpolation=vm,Fv.prototype.InterpolantFactoryMethodLinear=void 0,Fv.prototype.InterpolantFactoryMethodSmooth=void 0,Iv=class extends kv{constructor(e,t,n,r){super(e,t,n,r)}},Iv.prototype.ValueTypeName=`vector`,Lv=class{constructor(e=``,t=-1,n=[],r=Tm){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=lf(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(Zf(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i.userData=JSON.parse(e.userData||`{}`),i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,r=n.length;e!==r;++e)t.push(kv.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e<i;e++){let o=[],s=[];o.push((e+i-1)%i,e,(e+1)%i),s.push(0,1,0);let c=qf(o);o=Jf(o,1,c),s=Jf(s,1,c),!r&&o[0]===0&&(o.push(i),s.push(s[0])),a.push(new Mv(`.morphTargetInfluences[`+t[e].name+`]`,o,s).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){let t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){let r={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){let n=e[t],a=n.name.match(i);if(a&&a.length>1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}resetDuration(){let e=this.tracks,t=0;for(let n=0,r=e.length;n!==r;++n){let e=this.tracks[n];t=Math.max(t,e.times[e.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e&&=this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());let t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}},Rv={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(Qf(e)||(this.files[e]=t))},get:function(e){if(this.enabled!==!1&&!Qf(e))return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},zv=class{constructor(e,t,n){let r=this,i=!1,a=0,o=0,s,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return e=e.normalize(`NFC`),s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){let t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t<n;t+=2){let n=c[t],r=c[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||=new AbortController,this._abortController}},Bv=new zv,Vv=class{constructor(e){this.manager=e===void 0?Bv:e,this.crossOrigin=`anonymous`,this.withCredentials=!1,this.path=``,this.resourcePath=``,this.requestHeader={},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}load(){}loadAsync(e,t){let n=this;return new Promise(function(r,i){n.load(e,r,t,i)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}},Vv.DEFAULT_MATERIAL_NAME=`__DEFAULT`,Hv={},Uv=class extends Error{constructor(e,t){super(e),this.response=t}},Wv=class extends Vv{constructor(e){super(e),this.mimeType=``,this.responseType=``,this._abortController=new AbortController}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=Rv.get(`file:${e}`);if(i!==void 0){this.manager.itemStart(e),setTimeout(()=>{t&&t(i),this.manager.itemEnd(e)},0);return}if(Hv[e]!==void 0){Hv[e].push({onLoad:t,onProgress:n,onError:r});return}Hv[e]=[],Hv[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&X(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=Hv[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e<t;e++){let t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}},t=>{e.error(t)})}}});return new Response(c)}throw new Uv(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{Rv.add(`file:${e}`,t);let n=Hv[e];delete Hv[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onLoad&&r.onLoad(t)}}).catch(t=>{let n=Hv[e];if(n===void 0)throw this.manager.itemError(e),t;delete Hv[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},Gv=new WeakMap,Kv=class extends Vv{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=Rv.get(`image:${e}`);if(a!==void 0){if(a.complete===!0)i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);else{let e=Gv.get(a);e===void 0&&(e=[],Gv.set(a,e)),e.push({onLoad:t,onError:r})}return a}let o=nf(`img`);function s(){l(),t&&t(this);let n=Gv.get(this)||[];for(let e=0;e<n.length;e++){let t=n[e];t.onLoad&&t.onLoad(this)}Gv.delete(this),i.manager.itemEnd(e)}function c(t){l(),r&&r(t),Rv.remove(`image:${e}`);let n=Gv.get(this)||[];for(let e=0;e<n.length;e++){let r=n[e];r.onError&&r.onError(t)}Gv.delete(this),i.manager.itemError(e),i.manager.itemEnd(e)}function l(){o.removeEventListener(`load`,s,!1),o.removeEventListener(`error`,c,!1)}return o.addEventListener(`load`,s,!1),o.addEventListener(`error`,c,!1),e.slice(0,5)!==`data:`&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),Rv.add(`image:${e}`,o),i.manager.itemStart(e),o.src=e,o}},qv=class extends Vv{constructor(e){super(e)}load(e,t,n,r){let i=new ih,a=new Kv(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){i.image=e,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}},Jv=class extends Lh{constructor(e,t=1){super(),this.isLight=!0,this.type=`Light`,this.color=new Wh(e),this.intensity=t}dispose(){this.dispatchEvent({type:`dispose`})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}},Yv=new uh,Xv=new Q,Zv=new Q,Qv=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Um(512,512),this.mapType=pp,this.map=null,this.mapPass=null,this.matrix=new uh,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new U_,this._frameExtents=new Um(1,1),this._viewportCount=1,this._viewports=[new ah(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;Xv.setFromMatrixPosition(e.matrixWorld),t.position.copy(Xv),Zv.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Zv),t.updateMatrixWorld(),Yv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yv,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===2001||t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Yv)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},$v=new Q,ey=new Wm,ty=new Q,ny=class extends Lh{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new uh,this.projectionMatrix=new uh,this.projectionMatrixInverse=new uh,this.coordinateSystem=Nm,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}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.matrixWorld.decompose($v,ey,ty),ty.x===1&&ty.y===1&&ty.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose($v,ey,ty.set(1,1,1)).invert()}updateWorldMatrix(e,t,n=!1){super.updateWorldMatrix(e,t,n),this.matrixWorld.decompose($v,ey,ty),ty.x===1&&ty.y===1&&ty.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose($v,ey,ty.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}},ry=new Q,iy=new Um,ay=new Um,oy=class extends ny{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,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=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Vm*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Bm*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Vm*2*Math.atan(Math.tan(Bm*.5*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){ry.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ry.x,ry.y).multiplyScalar(-e/ry.z),ry.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ry.x,ry.y).multiplyScalar(-e/ry.z)}getViewSize(e,t){return this.getViewBounds(e,iy,ay),t.subVectors(ay,iy)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,this.view===null&&(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=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Bm*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let 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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},sy=class extends Qv{constructor(){super(new oy(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){let t=this.camera,n=Vm*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},cy=class extends Jv{constructor(e,t,n=0,r=Math.PI/3,i=0,a=2){super(e,t),this.isSpotLight=!0,this.type=`SpotLight`,this.position.copy(Lh.DEFAULT_UP),this.updateMatrix(),this.target=new Lh,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new sy}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}},ly=class extends Qv{constructor(){super(new oy(90,1,.5,500)),this.isPointLightShadow=!0}
vendor: 4,628 bytes, line 5
5},uy=class extends Jv{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type=`PointLight`,this.distance=n,this.decay=r,this.shadow=new ly}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}},dy=class extends ny{constructor(e=-1,t=1,n=1,r=-1,i=.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=r,this.near=i,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=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){this.view===null&&(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=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let 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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},fy=class extends Qv{constructor(){super(new dy(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},py=class extends Jv{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type=`DirectionalLight`,this.position.copy(Lh.DEFAULT_UP),this.updateMatrix(),this.target=new Lh,this.shadow=new fy}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},my=class extends Jv{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type=`AmbientLight`}},hy=class{static extractUrlBase(e){let t=e.lastIndexOf(`/`);return t===-1?`./`:e.slice(0,t+1)}static resolveURL(e,t){return typeof e!=`string`||e===``?``:(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,`$1`)),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},gy=new WeakMap,_y=class extends Vv{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>`u`&&X(`ImageBitmapLoader: createImageBitmap() not supported.`),typeof fetch>`u`&&X(`ImageBitmapLoader: fetch() not supported.`),this.options={premultiplyAlpha:`none`},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=Rv.get(`image-bitmap:${e}`);if(a!==void 0){if(i.manager.itemStart(e),a.then){a.then(n=>{gy.has(a)===!0?(r&&r(gy.get(a)),i.manager.itemError(e),i.manager.itemEnd(e)):(t&&t(n),i.manager.itemEnd(e))});return}setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);return}let o={};o.credentials=this.crossOrigin===`anonymous`?`same-origin`:`include`,o.headers=this.requestHeader,o.signal=typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let s=fetch(e,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:`none`}))}).then(function(n){Rv.add(`image-bitmap:${e}`,n),t&&t(n),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),gy.set(s,t),Rv.remove(`image-bitmap:${e}`),i.manager.itemError(e),i.manager.itemEnd(e)});Rv.add(`image-bitmap:${e}
5`,s),i.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},vy=-90,yy=1,by=class extends Lh{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new oy(vy,yy,e,t);r.layers=this.layers,this.add(r);let i=new oy(vy,yy,e,t);i.layers=this.layers,this.add(i);let a=new oy(vy,yy,e,t);a.layers=this.layers,this.add(a);let o=new oy(vy,yy,e,t);o.layers=this.layers,this.add(o);let s=new oy(vy,yy,e,t);s.layers=this.layers,this.add(s);let c=new oy(vy,yy,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let h=!1;h=e.isWebGLRenderer===!0?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,i),e.setRenderTarget(n,1,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,4,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},xy=class extends oy{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},Sy=`\\[\\]\\.:\\/`,Cy=RegExp(`[\\[\\]\\.:\\/]`,`g`),wy=`[^\\[\\]\\.:\\/]`,Ty=`[^`+Sy.replace(`\\.`,``)+`]`,Ey=`((?:WC+[\\/:])*)`.replace(`WC`,wy),Dy=`(WCOD+)?`.replace(`WCOD`,Ty),Oy=`(?:\\.(WC+)(?:\\[(.+)\\])?)?`.replace(`WC`,wy),ky=`\\.(WC+)(?:\\[(.+)\\])?`.replace(`WC`,wy),Ay=RegExp(`^`+Ey+Dy+Oy+ky+`$`),jy=[`material`,`materials`,`bones`,`map`],My=class{constructor(e,t,n){let r=n||Ny.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},Ny=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(Cy,``)}static parseTrackName(e){let t=Ay.exec(e);if(t===null)throw Error(`THREE.PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);jy.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`THREE.PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r<e.length;r++){let i=e[r];if(i.name===t||i.uuid===t)return i;let a=n(i.children);if(a)return a}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 4,138 bytes, line 5
5_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let t=this.node,n=this.parsedPath,r=n.objectName,i=n.propertyName,a=n.propertyIndex;if(t||(t=e.findNode(this.rootNode,n.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){X(`PropertyBinding: No target node found for track: `+this.path+`.`);return}if(r){let e=n.objectIndex;switch(r){case`materials`:if(!t.material){Z(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!t.material.materials){Z(`PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.`,this);return}t=t.material.materials;break;case`bones`:if(!t.skeleton){Z(`PropertyBinding: Can not bind to bones as node does not have a skeleton.`,this);return}t=t.skeleton.bones;for(let n=0;n<t.length;n++)if(t[n].name===e){e=n;break}break;case`map`:if(`map`in t){t=t.map;break}if(!t.material){Z(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!t.material.map){Z(`PropertyBinding: Can not bind to material.map as node.material does not have a map.`,this);return}t=t.material.map;break;default:if(t[r]===void 0){Z(`PropertyBinding: Can not bind to objectName of node undefined.`,this);return}t=t[r]}if(e!==void 0){if(t[e]===void 0){Z(`PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.`,this,t);return}t=t[e]}}let o=t[i];if(o===void 0){let e=n.nodeName;Z(`PropertyBinding: Trying to update property for track: `+e+`.`+i+` but it wasn't found.`,t);return}let s=this.Versioning.None;this.targetObject=t,t.isMaterial===!0?s=this.Versioning.NeedsUpdate:t.isObject3D===!0&&(s=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(a!==void 0){if(i===`morphTargetInfluences`){if(!t.geometry){Z(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.`,this);return}if(!t.geometry.morphAttributes){Z(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.`,this);return}t.morphTargetDictionary[a]!==void 0&&(a=t.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=a}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Ny.Composite=My,Ny.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ny.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ny.prototype.GetterByBindingType=[Ny.prototype._getValue_direct,Ny.prototype._getValue_array,Ny.prototype._getValue_arrayElement,Ny.prototype._getValue_toArray],Ny.prototype.SetterByBindingTypeAndVersioning=[[Ny.prototype._setValue_direct,Ny.prototype._setValue_direct_setNeedsUpdate,Ny.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ny.prototype._setValue_array,Ny.prototype._setValue_array_setNeedsUpdate,Ny.prototype._setValue_array_setMatr
5ixWorldNeedsUpdate],[Ny.prototype._setValue_arrayElement,Ny.prototype._setValue_arrayElement_setNeedsUpdate,Ny.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ny.prototype._setValue_fromArray,Ny.prototype._setValue_fromArray_setNeedsUpdate,Ny.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],Py=class{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){let e=1e-6;return this.phi=uf(this.phi,e,Math.PI-e),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(uf(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}},class e{static{e.prototype.isMatrix2=!0}constructor(e,t,n,r){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){let i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}},Fy=class extends Lm{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){X(`Controls: connect() now requires an element.`);return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`185`}})),typeof window<`u`&&(window.__THREE__?X(`WARNING: Multiple instances of Three.js being imported.`):window.__THREE__=`185`)}));function Ly(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&e!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e!==null&&e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Ry(e){let t=new WeakMap;function n(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function r(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],r=a[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,a[t]=r)}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}function i(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)}function a(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))}function o(e,i){if(e.isInterleavedBufferAttribute&&(e=e.data),e.isGLBufferAttribute){let n=t.get(e);(!n||n.version<e.version)&&t.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version});return}let a=t.get(e);if(a===void 0)t.set(e,n(e,i));else if(a.version<e.version){if(a.size!==e.array.byteLength)throw Error(`THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.`);r(a.buffer,e,i),a.version=e.version}}return{get:i,remove:a,update:o}}function zy(e,t,n,r,i,a){let o=new Wh(0),s=i===!0?0:1,c,l,u=null,d=0,f=null;function p(e){let n=e.isScene===!0?e.background:null;if(n&&n.isTexture){let r=e.backgroundBlurriness>0;
vendor: 7,354 bytes, line 5
5n=t.get(n,r)}return n}function m(t){let r=!1,i=p(t);i===null?g(o,s):i&&i.isColor&&(g(i,1),r=!0);let c=e.xr.getEnvironmentBlendMode();c===`additive`?n.buffers.color.setClear(0,0,0,1,a):c===`alpha-blend`&&n.buffers.color.setClear(0,0,0,0,a),(e.autoClear||r)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function h(t,n){let i=p(n);i&&(i.isCubeTexture||i.mapping===306)?(l===void 0&&(l=new d_(new pv(1,1,1),new vv({name:`BackgroundCubeMaterial`,uniforms:Vf(Ux.backgroundCube.uniforms),vertexShader:Ux.backgroundCube.vertexShader,fragmentShader:Ux.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),l.geometry.deleteAttribute(`uv`),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),l.material.uniforms.envMap.value=i,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(Gx.makeRotationFromEuler(n.backgroundRotation)).transpose(),i.isCubeTexture&&i.isRenderTargetTexture===!1&&l.material.uniforms.backgroundRotation.value.premultiply(Kx),l.material.toneMapped=Zm.getTransfer(i.colorSpace)!==Am,(u!==i||d!==i.version||f!==e.toneMapping)&&(l.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(c===void 0&&(c=new d_(new mv(2,2),new vv({name:`BackgroundMaterial`,uniforms:Vf(Ux.background.uniforms),vertexShader:Ux.background.vertexShader,fragmentShader:Ux.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute(`normal`),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=i,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.toneMapped=Zm.getTransfer(i.colorSpace)!==Am,i.matrixAutoUpdate===!0&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),(u!==i||d!==i.version||f!==e.toneMapping)&&(c.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null))}function g(t,r){t.getRGB(Wx,Gf(e)),n.buffers.color.setClear(Wx.r,Wx.g,Wx.b,r,a)}function _(){l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),s=t,g(o,s)},getClearAlpha:function(){return s},setClearAlpha:function(e){s=e,g(o,s)},render:m,addToRenderList:h,dispose:_}}function By(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(n,s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n,i){let a=i.wireframe===!0,o=r[t.id];o===void 0&&(o={},r[t.id]=o);let s=e.isInstancedMesh===!0?e.id:0,l=o[s];l===void 0&&(l={},o[s]=l);let u=l[n.id];u===void 0&&(u={},l[n.id]=u);let d=u[a];return d===void 0&&(d=f(c()),u[a]=d),d}function f(e){let t=[],r=[],i=[];for(let e=0;e<n;e++)t[e]=0,r[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function p(e,t,n,r){let i=a.attributes,o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function g(e){_(e,0)}function _(t,n){let r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,i[t]===0&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function v(){let t=a.newAttributes,n=a.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function y(t,n,r,i,a,o,s){s===!0?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function b(n,r,i,a){h();let o=a.attributes,s=i.getAttributes(),c=r.defaultAttributeValues;for(let r in s){let i=s[r];if(i.location>=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)_(i.location+e,t.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<i.locationSize;e++)g(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)y(i.location+e,o/i.locationSize,u,r,c*d,(p+o/i.locationSize*e)*d,f)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)_(i.location+e,s.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<i.locationSize;e++)g(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)y(i.location+e,o/i.locationSize,u,r,o*d,o/i.locationSize*e*d,f)}}else if(c!==void 0){let t=c[r];if(t!==void 0)switch(t.length){case 2:e.vertexAttrib2fv(i.location,t);break;case 3:e.vertexAttrib3fv(i.location,t);break;case 4:e.vertexAttrib4fv(i.location,t);break;default:e.vertexAttrib1fv(i.location,t)}}}}v()}function x(){T();for(let e in r){let t=r[e];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)u(t[e].object),delete t[e];delete n[e]}}delete r[e]}}function S(e){if(r[e.id]===void 0)return;let t=r[e.id];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)u(t[e].object),delete t[e];delete n[e]}}delete r[e.id]}function C(e){for(let t in r){let n=r[t];for(let t in n){let r=n[t];if(r[e.id]===void 0)continue;let i=r[e.id];for(let e in i)u(i[e].object),delete i[e];delete r[e.id]}}}function w(e){for(let t in r){let n=r[t],i=e.isInstancedMesh===!0?e.id:0,a=n[i];if(a!==void 0){for(let e in a){let t=a[e];for(let e in t)u(t[e].object),delete t[e];delete a[e]}delete n[i],Object.keys(n).length===0&&delete r[t]}}}function T(){E(),o=!0,a!==i&&(a=i,l(a.object))}
vendor: 10,532 bytes, lines 5-184
5function E(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:s,reset:T,resetDefaultState:E,dispose:x,releaseStatesOfGeometry:S,releaseStatesOfObject:w,releaseStatesOfProgram:C,initAttributes:h,enableAttribute:g,disableUnusedAttributes:v}}function Vy(e,t,n){let r;function i(e){r=e}function a(t,i){e.drawArrays(r,t,i),n.update(i,r,1)}function o(t,i,a){a!==0&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}function s(e,i,a){if(a===0)return;t.get(`WEBGL_multi_draw`).multiDrawArraysWEBGL(r,e,0,i,0,a);let o=0;for(let e=0;e<a;e++)o+=i[e];n.update(o,r,1)}this.setMode=i,this.render=a,this.renderInstances=o,this.renderMultiDraw=s}function Hy(e,t,n,r){let i;function a(){if(i!==void 0)return i;if(t.has(`EXT_texture_filter_anisotropic`)===!0){let n=t.get(`EXT_texture_filter_anisotropic`);i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(t){return t===1023||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)}function s(n){let i=n===1016&&(t.has(`EXT_color_buffer_half_float`)||t.has(`EXT_color_buffer_float`));return!(n!==1009&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==1015&&!i)}function c(t){if(t===`highp`){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(X(`WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`);n.reversedDepthBuffer===!0&&f===!1&&X(`WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.`);let p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),m=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),g=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),_=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),b=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=e.getParameter(e.MAX_SAMPLES),S=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:b,maxSamples:x,samples:S}}function Uy(e){let t=this,n=null,r=0,i=!1,a=!1,o=new z_,s=new qm,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length<t)&&(l=new Float32Array(t));for(let t=0,n=r;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant}c.value=l,c.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,l}}function Wy(e){let t=[],n=[],r=[],i=e,a=e-qx+1+Jx.length;for(let o=0;o<a;o++){let a=2**i;t.push(a);let s=1/a;o>e-qx?s=Jx[o-e+qx-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new zg;h.setAttribute(`position`,new wg(f,3)),h.setAttribute(`uv`,new wg(p,2)),h.setAttribute(`faceIndex`,new wg(m,1)),r.push(new d_(h,null)),i>qx&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function Gy(e,t,n){let r=new sh(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function Ky(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function qy(e,t,n){return new vv({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:Xx,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Zy(),fragmentShader:`
6
7			precision highp float;
8			precision highp int;
9
10			varying vec3 vOutputDirection;
11
12			uniform sampler2D envMap;
13			uniform float roughness;
14			uniform float mipInt;
15
16			#define ENVMAP_TYPE_CUBE_UV
17			#include <cube_uv_reflection_fragment>
18
19			#define PI 3.14159265359
20
21			// Van der Corput radical inverse
22			float radicalInverse_VdC(uint bits) {
23				bits = (bits << 16u) | (bits >> 16u);
24				bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
25				bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
26				bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
27				bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
28				return float(bits) * 2.3283064365386963e-10; // / 0x100000000
29			}
30
31			// Hammersley sequence
32			vec2 hammersley(uint i, uint N) {
33				return vec2(float(i) / float(N), radicalInverse_VdC(i));
34			}
35
36			// GGX VNDF importance sampling (Eric Heitz 2018)
37			// "Sampling the GGX Distribution of Visible Normals"
38			// https://jcgt.org/published/0007/04/01/
39			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
40				float alpha = roughness * roughness;
41
42				// Section 4.1: Orthonormal basis
43				vec3 T1 = vec3(1.0, 0.0, 0.0);
44				vec3 T2 = cross(V, T1);
45
46				// Section 4.2: Parameterization of projected area
47				float r = sqrt(Xi.x);
48				float phi = 2.0 * PI * Xi.y;
49				float t1 = r * cos(phi);
50				float t2 = r * sin(phi);
51				float s = 0.5 * (1.0 + V.z);
52				t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
53
54				// Section 4.3: Reprojection onto hemisphere
55				vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;
56
57				// Section 3.4: Transform back to ellipsoid configuration
58				return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
59			}
60
61			void main() {
62				vec3 N = normalize(vOutputDirection);
63				vec3 V = N; // Assume view direction equals normal for pre-filtering
64
65				vec3 prefilteredColor = vec3(0.0);
66				float totalWeight = 0.0;
67
68				// For very low roughness, just sample the environment directly
69				if (roughness < 0.001) {
70					gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
71					return;
72				}
73
74				// Tangent space basis for VNDF sampling
75				vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
76				vec3 tangent = normalize(cross(up, N));
77				vec3 bitangent = cross(N, tangent);
78
79				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
80					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
81
82					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
83					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
84
85					// Transform H back to world space
86					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
87					vec3 L = normalize(2.0 * dot(V, H) * H - V);
88
89					float NdotL = max(dot(N, L), 0.0);
90
91					if(NdotL > 0.0) {
92						// Sample environment at fixed mip level
93						// VNDF importance sampling handles the distribution filtering
94						vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
95
96						// Weight by NdotL for the split-sum approximation
97						// VNDF PDF naturally accounts for the visible microfacet distribution
98						prefilteredColor += sampleColor * NdotL;
99						totalWeight += NdotL;
100					}
101				}
102
103				if (totalWeight > 0.0) {
104					prefilteredColor = prefilteredColor / totalWeight;
105				}
106
107				gl_FragColor = vec4(prefilteredColor, 1.0);
108			}
109		`,blending:0,depthTest:!1,depthWrite:!1})}function Jy(e,t,n){let r=new Float32Array(Yx),i=new Q(0,1,0);return new vv({name:`SphericalGaussianBlur`,defines:{n:Yx,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Zy(),fragmentShader:`
110
111			precision mediump float;
112			precision mediump int;
113
114			varying vec3 vOutputDirection;
115
116			uniform sampler2D envMap;
117			uniform int samples;
118			uniform float weights[ n ];
119			uniform bool latitudinal;
120			uniform float dTheta;
121			uniform float mipInt;
122			uniform vec3 poleAxis;
123
124			#define ENVMAP_TYPE_CUBE_UV
125			#include <cube_uv_reflection_fragment>
126
127			vec3 getSample( float theta, vec3 axis ) {
128
129				float cosTheta = cos( theta );
130				// Rodrigues' axis-angle rotation
131				vec3 sampleDirection = vOutputDirection * cosTheta
132					+ cross( axis, vOutputDirection ) * sin( theta )
133					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
134
135				return bilinearCubeUV( envMap, sampleDirection, mipInt );
136
137			}
138
139			void main() {
140
141				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
142
143				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
144
145					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
146
147				}
148
149				axis = normalize( axis );
150
151				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
152				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
153
154				for ( int i = 1; i < n; i++ ) {
155
156					if ( i >= samples ) {
157
158						break;
159
160					}
161
162					float theta = dTheta * float( i );
163					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
164					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
165
166				}
167
168			}
169		`,blending:0,depthTest:!1,depthWrite:!1})}function Yy(){return new vv({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:Zy(),fragmentShader:`
170
171			precision mediump float;
172			precision mediump int;
173
174			varying vec3 vOutputDirection;
175
176			uniform sampler2D envMap;
177
178			#include <common>
179
180			void main() {
181
182				vec3 outputDirection = normalize( vOutputDirection );
183				vec2 uv = equirectUv( outputDirection );
184
185				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
186
187			}
188		`,blending:0,depthTest:!1,depthWrite:!1})}function Xy(){return new vv({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Zy(),fragmentShader:`
189
190			precision mediump float;
191			precision mediump int;
192
193			uniform float flipEnvMap;
194
195			varying vec3 vOutputDirection;
196
197			uniform samplerCube envMap;
198
199			void main() {
200
201				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
202
203			}
204		`,blending:0,depthTest:!1,depthWrite:!1})}function Zy(){return`
205
206		precision mediump float;
207		precision mediump int;
208
209		attribute float faceIndex;
210
211		varying vec3 vOutputDirection;
212
213		// RH coordinate system; PMREM face-indexing convention
214		vec3 getDirection( vec2 uv, float face ) {
215
216			uv = 2.0 * uv - 1.0;
217
218			vec3 direction = vec3( uv, 1.0 );
219
220			if ( face == 0.0 ) {
221
222				direction = direction.zyx; // ( 1, v, u ) pos x
223
224			} else if ( face == 1.0 ) {
225
226				direction = direction.xzy;
227				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
228
229			} else if ( face == 2.0 ) {
230
231				direction.x *= -1.0; // ( -u, v, 1 ) pos z
232
233			} else if ( face == 3.0 ) {
234
235				direction = direction.zyx;
236				direction.xz *= -1.0; // ( -1, v, -u ) neg x
237
238			} else if ( face == 4.0 ) {
239
240				direction = direction.xzy;
241				direction.xy *= -1.0; // ( -u, -1, v ) neg y
242
243			} else if ( face == 5.0 ) {
244
245				direction.z *= -1.0; // ( u, v, -1 ) neg z
246
247			}
248
249			return direction;
250
251		}
252
253		void main() {
254
255			vOutputDirection = getDirection( uv, faceIndex );
256			gl_Position = vec4( position, 1.0 );
257
258		}
259	`}function Qy(e){let t=new WeakMap,n=new WeakMap,r=null;function i(e,t=!1){return e==null?null:t?o(e):a(e)}function a(n){if(n&&n.isTexture){let r=n.mapping;if(r===303||r===304){if(t.has(n)){let e=t.get(n).texture;return s(e,n.mapping)}{let r=n.image;if(r&&r.height>0){let i=new aS(r.height);return i.fromEquirectangularTexture(e,n),t.set(n,i),n.addEventListener(`dispose`,l),s(i.texture,n.mapping)}return null}}}return n}function o(t){if(t&&t.isTexture){let i=t.mapping,a=i===303||i===304,o=i===301||i===302;if(a||o){let i=n.get(t),s=i===void 0?0:i.texture.pmremVersion;if(t.isRenderTargetTexture&&t.pmremVersion!==s)return r===null&&(r=new iS(e)),i=a?r.fromEquirectangular(t,i):r.fromCubemap(t,i),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),i.texture;if(i!==void 0)return i.texture;{let s=t.image;return a&&s&&s.height>0||o&&s&&c(s)?(r===null&&(r=new iS(e)),i=a?r.fromEquirectangular(t):r.fromCubemap(t),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),t.addEventListener(`dispose`,u),i.texture):null}}}return t}function s(e,t){return t===303?e.mapping=301:t===304&&(e.mapping=302),e}function c(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function l(e){let n=e.target;n.removeEventListener(`dispose`,l);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function u(e){let t=e.target;t.removeEventListener(`dispose`,u);let r=n.get(t);r!==void 0&&(n.delete(t),r.dispose())}function d(){t=new WeakMap,n=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get:i,dispose:d}}function $y(e){let t={};
vendor: 21,270 bytes, lines 259-340
259function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&sf(`WebGLRenderer: `+e+` extension not supported.`),t}}}function eb(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;s.index!==null&&t.remove(s.index);for(let e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),s.isInstancedBufferGeometry===!0&&delete s._maxInstanceCount,n.memory.geometries--}function s(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,o),i[t.id]=!0,n.memory.geometries++,t)}function c(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function l(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(i===void 0)return;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){let r=e[t+0],i=e[t+1],a=e[t+2];n.push(r,i,i,a,a,r)}}else{let e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){let e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}let s=new(i.count>=65535?Eg:Tg)(n,1);s.version=o;let c=a.get(e);c&&t.remove(c),a.set(e,s)}function u(e){let t=a.get(e);if(t){let n=e.index;n!==null&&t.version<n.version&&l(e)}else l(e);return a.get(e)}return{get:s,update:c,getWireframeAttribute:u}}function tb(e,t,n){let r;function i(e){r=e}let a,o;function s(e){a=e.type,o=e.bytesPerElement}function c(t,i){e.drawElements(r,i,a,t*o),n.update(i,r,1)}function l(t,i,s){s!==0&&(e.drawElementsInstanced(r,i,a,t*o,s),n.update(i,r,s))}function u(e,i,o){if(o===0)return;t.get(`WEBGL_multi_draw`).multiDrawElementsWEBGL(r,i,0,a,e,0,o);let s=0;for(let e=0;e<o;e++)s+=i[e];n.update(s,r,1)}this.setMode=i,this.setIndex=s,this.render=c,this.renderInstances=l,this.renderMultiDraw=u}function nb(e){let t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(t,r,i){switch(n.calls++,r){case e.TRIANGLES:n.triangles+=t/3*i;break;case e.LINES:n.lines+=t/2*i;break;case e.LINE_STRIP:n.lines+=i*(t-1);break;case e.LINE_LOOP:n.lines+=i*t;break;case e.POINTS:n.points+=i*t;break;default:Z(`WebGLInfo: Unknown draw mode:`,r)}}function i(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:t,render:n,programs:null,autoReset:!0,reset:i,update:r}}function rb(e,t,n){let r=new WeakMap,i=new ah;function a(a,o,s){let c=a.morphTargetInfluences,l=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=l===void 0?0:l.length,d=r.get(o);if(d===void 0||d.count!==u){d!==void 0&&d.texture.dispose();let e=o.morphAttributes.position!==void 0,n=o.morphAttributes.normal!==void 0,a=o.morphAttributes.color!==void 0,s=o.morphAttributes.position||[],c=o.morphAttributes.normal||[],l=o.morphAttributes.color||[],f=0;e===!0&&(f=1),n===!0&&(f=2),a===!0&&(f=3);let p=o.attributes.position.count*f,m=1;p>t.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new ch(h,p,m,u);g.type=yp,g.needsUpdate=!0;let _=f*4;for(let t=0;t<u;t++){let r=s[t],o=c[t],u=l[t],d=p*m*4*t;for(let t=0;t<r.count;t++){let s=t*_;e===!0&&(i.fromBufferAttribute(r,t),h[d+s+0]=i.x,h[d+s+1]=i.y,h[d+s+2]=i.z,h[d+s+3]=0),n===!0&&(i.fromBufferAttribute(o,t),h[d+s+4]=i.x,h[d+s+5]=i.y,h[d+s+6]=i.z,h[d+s+7]=0),a===!0&&(i.fromBufferAttribute(u,t),h[d+s+8]=i.x,h[d+s+9]=i.y,h[d+s+10]=i.z,h[d+s+11]=u.itemSize===4?i.w:1)}}d={count:u,texture:g,size:new Um(p,m)},r.set(o,d);function v(){g.dispose(),r.delete(o),o.removeEventListener(`dispose`,v)}o.addEventListener(`dispose`,v)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)s.getUniforms().setValue(e,`morphTexture`,a.morphTexture,n);else{let t=0;for(let e=0;e<c.length;e++)t+=c[e];let n=o.morphTargetsRelative?1:1-t;s.getUniforms().setValue(e,`morphTargetBaseInfluence`,n),s.getUniforms().setValue(e,`morphTargetInfluences`,c)}s.getUniforms().setValue(e,`morphTargetsTexture`,d.texture,n),s.getUniforms().setValue(e,`morphTargetsTextureSize`,d.size)}return{update:a}}function ib(e,t,n,r,i){let a=new WeakMap;function o(r){let o=i.render.frame,s=r.geometry,l=t.get(r,s);if(a.get(l)!==o&&(t.update(l),a.set(l,o)),r.isInstancedMesh&&(r.hasEventListener(`dispose`,c)===!1&&r.addEventListener(`dispose`,c),a.get(r)!==o&&(n.update(r.instanceMatrix,e.ARRAY_BUFFER),r.instanceColor!==null&&n.update(r.instanceColor,e.ARRAY_BUFFER),a.set(r,o))),r.isSkinnedMesh){let e=r.skeleton;a.get(e)!==o&&(e.update(),a.set(e,o))}return l}function s(){a=new WeakMap}function c(e){let t=e.target;t.removeEventListener(`dispose`,c),r.releaseStatesOfObject(t),n.remove(t.instanceMatrix),t.instanceColor!==null&&n.remove(t.instanceColor)}return{update:o,dispose:s}}function ab(e,t,n,r,i,a){let o=new sh(t,n,{type:e,depthBuffer:i,stencilBuffer:a,samples:r?4:0,depthTexture:i?new uv(t,n):void 0}),s=new sh(t,n,{type:bp,depthBuffer:!1,stencilBuffer:!1}),c=new zg;c.setAttribute(`position`,new Dg([-1,3,0,-1,-1,0,3,-1,0],3)),c.setAttribute(`uv`,new Dg([0,2,0,0,2,0],2));let l=new yv({uniforms:{tDiffuse:{value:null}},vertexShader:`
260			precision highp float;
261
262			uniform mat4 modelViewMatrix;
263			uniform mat4 projectionMatrix;
264
265			attribute vec3 position;
266			attribute vec2 uv;
267
268			varying vec2 vUv;
269
270			void main() {
271				vUv = uv;
272				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
273			}`,fragmentShader:`
274			precision highp float;
275
276			uniform sampler2D tDiffuse;
277
278			varying vec2 vUv;
279
280			#include <tonemapping_pars_fragment>
281			#include <colorspace_pars_fragment>
282
283			void main() {
284				gl_FragColor = texture2D( tDiffuse, vUv );
285
286				#ifdef LINEAR_TONE_MAPPING
287					gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
288				#elif defined( REINHARD_TONE_MAPPING )
289					gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
290				#elif defined( CINEON_TONE_MAPPING )
291					gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
292				#elif defined( ACES_FILMIC_TONE_MAPPING )
293					gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
294				#elif defined( AGX_TONE_MAPPING )
295					gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
296				#elif defined( NEUTRAL_TONE_MAPPING )
297					gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
298				#elif defined( CUSTOM_TONE_MAPPING )
299					gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
300				#endif
301
302				#ifdef SRGB_TRANSFER
303					gl_FragColor = sRGBTransferOETF( gl_FragColor );
304				#endif
305			}`,depthTest:!1,depthWrite:!1}),u=new d_(c,l),d=new dy(-1,1,1,-1,0,1),f=null,p=null,m=!1,h,g=null,_=[],v=!1;this.setSize=function(e,t){o.setSize(e,t),s.setSize(e,t);for(let n=0;n<_.length;n++){let r=_[n];r.setSize&&r.setSize(e,t)}},this.setEffects=function(e){_=e,v=_.length>0&&_[0].isRenderPass===!0;let t=o.width,n=o.height;for(let e=0;e<_.length;e++){let r=_[e];r.setSize&&r.setSize(t,n)}},this.begin=function(e,t){if(m||e.toneMapping===0&&_.length===0)return!1;if(g=t,t!==null){let e=t.width,n=t.height;(o.width!==e||o.height!==n)&&this.setSize(e,n)}return v===!1&&e.setRenderTarget(o),h=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return v},this.end=function(e,t){e.toneMapping=h,m=!0;let n=o,r=s;for(let i=0;i<_.length;i++){let a=_[i];if(a.enabled!==!1&&(a.render(e,r,n,t),a.needsSwap!==!1)){let e=n;n=r,r=e}}if(f!==e.outputColorSpace||p!==e.toneMapping){f=e.outputColorSpace,p=e.toneMapping,l.defines={},Zm.getTransfer(f)===`srgb`&&(l.defines.SRGB_TRANSFER=``);let t=oS[p];t&&(l.defines[t]=``),l.needsUpdate=!0}l.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(g),e.render(u,d),g=null,m=!1},this.isCompositing=function(){return m},this.dispose=function(){o.depthTexture&&o.depthTexture.dispose(),o.dispose(),s.dispose(),c.dispose(),l.dispose()}}function ob(e,t,n){let r=e[0];if(r<=0||r>0)return e;let i=t*n,a=fS[i];if(a===void 0&&(a=new Float32Array(i),fS[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function sb(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function cb(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function lb(e,t){let n=pS[t];n===void 0&&(n=new Int32Array(t),pS[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function ub(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function db(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(sb(n,t))return;e.uniform2fv(this.addr,t),cb(n,t)}}function fb(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(t.r!==void 0)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(sb(n,t))return;e.uniform3fv(this.addr,t),cb(n,t)}}function pb(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(sb(n,t))return;e.uniform4fv(this.addr,t),cb(n,t)}}function mb(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(sb(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),cb(n,t)}else{if(sb(n,r))return;gS.set(r),e.uniformMatrix2fv(this.addr,!1,gS),cb(n,r)}}function hb(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(sb(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),cb(n,t)}else{if(sb(n,r))return;hS.set(r),e.uniformMatrix3fv(this.addr,!1,hS),cb(n,r)}}function gb(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(sb(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),cb(n,t)}else{if(sb(n,r))return;mS.set(r),e.uniformMatrix4fv(this.addr,!1,mS),cb(n,r)}}function _b(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function vb(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(sb(n,t))return;e.uniform2iv(this.addr,t),cb(n,t)}}function yb(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(sb(n,t))return;e.uniform3iv(this.addr,t),cb(n,t)}}function bb(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(sb(n,t))return;e.uniform4iv(this.addr,t),cb(n,t)}}function xb(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Sb(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(sb(n,t))return;e.uniform2uiv(this.addr,t),cb(n,t)}}function Cb(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(sb(n,t))return;e.uniform3uiv(this.addr,t),cb(n,t)}}function wb(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(sb(n,t))return;e.uniform4uiv(this.addr,t),cb(n,t)}}function Tb(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i);let a;this.type===e.SAMPLER_2D_SHADOW?(cS.compareFunction=n.isReversedDepthBuffer()?518:515,a=cS):a=sS,n.setTexture2D(t||a,i)}function Eb(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||uS,i)}function Db(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||dS,i)}function Ob(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||lS,i)}function kb(e){switch(e){case 5126:return ub;case 35664:return db;case 35665:return fb;case 35666:return pb;case 35674:return mb;case 35675:return hb;case 35676:return gb;case 5124:case 35670:return _b;case 35667:case 35671:return vb;case 35668:case 35672:return yb;case 35669:case 35673:return bb;case 5125:return xb;case 36294:return Sb;case 36295:return Cb;case 36296:return wb;case 35678:case 36198:case 36298:case 36306:case 35682:return Tb;case 35679:case 36299:case 36307:return Eb;case 35680:case 36300:case 36308:case 36293:return Db;case 36289:case 36303:case 36311:case 36292:return Ob}}function Ab(e,t){e.uniform1fv(this.addr,t)}function jb(e,t){let n=ob(t,this.size,2);e.uniform2fv(this.addr,n)}function Mb(e,t){let n=ob(t,this.size,3);e.uniform3fv(this.addr,n)}function Nb(e,t){let n=ob(t,this.size,4);e.uniform4fv(this.addr,n)}function Pb(e,t){let n=ob(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Fb(e,t){let n=ob(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Ib(e,t){let n=ob(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Lb(e,t){e.uniform1iv(this.addr,t)}function Rb(e,t){e.uniform2iv(this.addr,t)}function zb(e,t){e.uniform3iv(this.addr,t)}function Bb(e,t){e.uniform4iv(this.addr,t)}function Vb(e,t){e.uniform1uiv(this.addr,t)}function Hb(e,t){e.uniform2uiv(this.addr,t)}function Ub(e,t){e.uniform3uiv(this.addr,t)}function Wb(e,t){e.uniform4uiv(this.addr,t)}function Gb(e,t,n){let r=this.cache,i=t.length,a=lb(n,i);sb(r,a)||(e.uniform1iv(this.addr,a),cb(r,a));let o;o=this.type===e.SAMPLER_2D_SHADOW?cS:sS;for(let e=0;e!==i;++e)n.setTexture2D(t[e]||o,a[e])}function Kb(e,t,n){let r=this.cache,i=t.length,a=lb(n,i);sb(r,a)||(e.uniform1iv(this.addr,a),cb(r,a));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||uS,a[e])}function qb(e,t,n){let r=this.cache,i=t.length,a=lb(n,i);sb(r,a)||(e.uniform1iv(this.addr,a),cb(r,a));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||dS,a[e])}function Jb(e,t,n){let r=this.cache,i=t.length,a=lb(n,i);sb(r,a)||(e.uniform1iv(this.addr,a),cb(r,a));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||lS,a[e])}function Yb(e){switch(e){case 5126:return Ab;case 35664:return jb;case 35665:return Mb;case 35666:return Nb;case 35674:return Pb;case 35675:return Fb;case 35676:return Ib;case 5124:case 35670:return Lb;case 35667:case 35671:return Rb;case 35668:case 35672:return zb;case 35669:case 35673:return Bb;case 5125:return Vb;case 36294:return Hb;case 36295:return Ub;case 36296:return Wb;case 35678:case 36198:case 36298:case 36306:case 35682:return Gb;case 35679:case 36299:case 36307:return Kb;case 35680:case 36300:case 36308:case 36293:return qb;case 36289:case 36303:case 36311:case 36292:return Jb}}function Xb(e,t){e.seq.push(t),e.map[t.id]=t}function Zb(e,t,n){let r=e.name,i=r.length;for(bS.lastIndex=0;;){let a=bS.exec(r),o=bS.lastIndex,s=a[1],c=a[2]===`]`,l=a[3];if(c&&(s|=0),l===void 0||l===`[`&&o+2===i){Xb(n,l===void 0?new _S(s,e,t):new vS(s,e,t));break}{let e=n.map[s];e===void 0&&(e=new yS(s),Xb(n,e)),n=e}}}function Qb(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}function $b(e,t){let n=e.split(`
306`),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e<a;e++){let i=e+1;r.push(`${i===t?`>`:` `} ${i}: ${n[e]}`)}return r.join(`
307`)}function ex(e){Zm._getMatrix(wS,Zm.workingColorSpace,e);let t=`mat3( ${wS.elements.map(e=>e.toFixed(4))} )`;switch(Zm.getTransfer(e)){case km:return[t,`LinearTransferOETF`];case Am:return[t,`sRGBTransferOETF`];default:return X(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function tx(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+`
308
309`+i+`
310
311`+$b(e.getShaderSource(t),r)}return i}function nx(e,t){let n=ex(t);return[`vec4 ${e}( vec4 value ) {`,`	return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(`
312`)}function rx(e,t){let n=TS[t];return n===void 0?(X(`WebGLProgram: Unsupported toneMapping:`,t),`vec3 `+e+`( vec3 color ) { return LinearToneMapping( color ); }`):`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}function ix(){return Zm.getLuminanceCoefficients(ES),[`float luminance( const in vec3 rgb ) {`,`	const vec3 weights = vec3( ${ES.x.toFixed(4)}, ${ES.y.toFixed(4)}, ${ES.z.toFixed(4)} );`,`	return dot( weights, rgb );`,`}`].join(`
313`)}function ax(e){return[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``].filter(cx).join(`
314`)}function ox(e){let t=[];for(let n in e){let r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(`
315`)}function sx(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){let r=e.getActiveAttrib(t,i),a=r.name,o=1;r.type===e.FLOAT_MAT2&&(o=2),r.type===e.FLOAT_MAT3&&(o=3),r.type===e.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}function cx(e){return e!==``}function lx(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function ux(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function dx(e){return e.replace(DS,fx)}function fx(e,t){let n=Hx[t];if(n===void 0){let e=OS.get(t);if(e!==void 0)n=Hx[e],X(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`THREE.WebGLProgram: Can not resolve #include <`+t+`>`)}return dx(n)}function px(e){return e.replace(kS,mx)}function mx(e,t,n,r){let i=``;for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,`[ `+e+` ]`).replace(/UNROLLED_LOOP_INDEX/g,e);return i}function hx(e){let t=`precision ${e.precision} float;
316	precision ${e.precision} int;
317	precision ${e.precision} sampler2D;
318	precision ${e.precision} samplerCube;
319	precision ${e.precision} sampler3D;
320	precision ${e.precision} sampler2DArray;
321	precision ${e.precision} sampler2DShadow;
322	precision ${e.precision} samplerCubeShadow;
323	precision ${e.precision} sampler2DArrayShadow;
324	precision ${e.precision} isampler2D;
325	precision ${e.precision} isampler3D;
326	precision ${e.precision} isamplerCube;
327	precision ${e.precision} isampler2DArray;
328	precision ${e.precision} usampler2D;
329	precision ${e.precision} usampler3D;
330	precision ${e.precision} usamplerCube;
331	precision ${e.precision} usampler2DArray;
332	`;return e.precision===`highp`?t+=`
333#define HIGH_PRECISION`:e.precision===`mediump`?t+=`
334#define MEDIUM_PRECISION`:e.precision===`lowp`&&(t+=`
335#define LOW_PRECISION`),t}function gx(e){return AS[e.shadowMapType]||`SHADOWMAP_TYPE_BASIC`}function _x(e){return e.envMap===!1?`ENVMAP_TYPE_CUBE`:jS[e.envMapMode]||`ENVMAP_TYPE_CUBE`}function vx(e){return e.envMap===!1?`ENVMAP_MODE_REFLECTION`:MS[e.envMapMode]||`ENVMAP_MODE_REFLECTION`}function yx(e){return e.envMap===!1?`ENVMAP_BLENDING_NONE`:NS[e.combine]||`ENVMAP_BLENDING_NONE`}function bx(e){let t=e.envMapCubeUVHeight;if(t===null)return null;let n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(2**n,112)),texelHeight:r,maxMip:n}}function xx(e,t,n,r){let i=e.getContext(),a=n.defines,o=n.vertexShader,s=n.fragmentShader,c=gx(n),l=_x(n),u=vx(n),d=yx(n),f=bx(n),p=ax(n),m=ox(a),h=i.createProgram(),g,_,v=n.glslVersion?`#version `+n.glslVersion+`
336`:``;n.isRawShaderMaterial?(g=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(cx).join(`
337`),g.length>0&&(g+=`
338`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(cx).join(`
339`),_.length>0&&(_+=`
340`)):(g=[hx(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IR
340IDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexNormals?`#define HAS_NORMAL`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,`	attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,`	attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,`	uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,`	attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,`	attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,`	attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,`	attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,`	attribute vec4 color;`,`#elif defined( USE_COLOR )`,`	attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,`	attribute vec4 skinIndex;`,`	attribute vec4 skinWeight;`,`#endif`,`
341`].filter(cx).join(`
342`),_=[hx(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matc
vendor: 4,278 bytes, lines 342-349
342ap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.packedNormalMap?`#define USE_PACKED_NORMALMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor?`#define USE_COLOR`:``,n.vertexAlphas||n.batchingColor?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.numLightProbeGrids>0?`#define USE_LIGHT_PROBES_GRID`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:Hx.tonemapping_pars_fragment,n.toneMapping===0?``:rx(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,Hx.colorspace_pars_fragment,nx(`linearToOutputTexel`,n.outputColorSpace),ix(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,`
343`].filter(cx).join(`
344`)),o=dx(o),o=lx(o,n),o=ux(o,n),s=dx(s),s=lx(s,n),s=ux(s,n),o=px(o),s=px(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es
345`,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(`
346`)+`
347`+g,_=[`#define varying in`,n.glslVersion===`300 es`?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===`300 es`?``:`#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(`
348`)+`
349`+_);let y=v+g+o,b=v+_+s,x=Qb(i,i.VERTEX_SHADER,y),S=Qb(i,i.FRAGMENT_SHADER,b);i.attachShader(h,x),i.attachShader(h,S),n.index0AttributeName===void 0?n.hasPositionAttribute===!0&&i.bindAttribLocation(h,0,`position`):i.bindAttribLocation(h,0,n.index0AttributeName),i.linkProgram(h);
349function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h)||``,r=i.getShaderInfoLog(x)||``,a=i.getShaderInfoLog(S)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(i.getProgramParameter(h,i.LINK_STATUS)===!1){if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=tx(i,x,`vertex`),n=tx(i,S,`fragment`);Z(`WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+`
350
351Material Name: `+t.name+`
352Material Type: `+t.type+`
353
354Program Info Log: `+o+`
355`+e+`
356`+n)}}else o===``?(s===``||c===``)&&(u=!1):X(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new xS(i,h),T=sx(i,h)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let T;this.getAttributes=function(){return T===void 0&&C(this),T};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(h,SS)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=CS++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}function Sx(e){return e===1030||e===37490||e===36285}function Cx(e,t,n,r,i,a){let o=new xh,s=new FS,c=new Set,l=[],u=new Map,d=r.logarithmicDepthBuffer,f=r.precision,p={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,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 m(e){return c.add(e),e===0?`uv`:`uv${e}`}function h(i,o,l,u,h,g){let _=u.fog,v=h.geometry,y=i.isMeshStandardMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial?u.environment:null,b=i.isMeshStandardMaterial||i.isMeshLambertMaterial&&!i.envMap||i.isMeshPhongMaterial&&!i.envMap,x=t.get(i.envMap||y,b),S=x&&x.mapping===306?x.image.height:null,C=p[i.type];i.precision!==null&&(f=r.getMaxPrecision(i.precision),f!==i.precision&&X(`WebGLProgram.getParameters:`,i.precision,`not supported, using`,f,`instead.`));let w=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,T=w===void 0?0:w.length,E=0;v.morphAttributes.position!==void 0&&(E=1),v.morphAttributes.normal!==void 0&&(E=2),v.morphAttributes.color!==void 0&&(E=3);let D,O,k,A;if(C){let e=Ux[C];D=e.vertexShader,O=e.fragmentShader}else{D=i.vertexShader,O=i.fragmentShader;let e=s.getVertexShaderStage(i),t=s.getFragmentShaderStage(i);s.update(i,e,t),k=e.id,A=t.id}let j=e.getRenderTarget(),M=e.state.buffers.depth.getReversed(),N=h.isInstancedMesh===!0,P=h.isBatchedMesh===!0,F=!!i.map,ee=!!i.matcap,te=!!x,ne=!!i.aoMap,re=!!i.lightMap,ie=!!i.bumpMap&&i.wireframe===!1,I=!!i.normalMap,ae=!!i.displacementMap,L=!!i.emissiveMap,oe=!!i.metalnessMap,se=!!i.roughnessMap,ce=i.anisotropy>0,R=i.clearcoat>0,le=i.dispersion>0,z=i.iridescence>0,B=i.sheen>0,V=i.transmission>0,ue=ce&&!!i.anisotropyMap,de=R&&!!i.clearcoatMap,fe=R&&!!i.clearcoatNormalMap,pe=R&&!!i.clearcoatRoughnessMap,me=z&&!!i.iridescenceMap,he=z&&!!i.iridescenceThicknessMap,H=B&&!!i.sheenColorMap,U=B&&!!i.sheenRoughnessMap,W=!!i.specularMap,ge=!!i.specularColorMap,G=!!i.specularIntensityMap,_e=V&&!!i.transmissionMap,K=V&&!!i.thicknessMap,q=!!i.gradientMap,ve=!!i.alphaMap,ye=i.alphaTest>0,be=!!i.alphaHash,xe=!!i.extensions,Se=0;i.toneMapped&&(j===null||j.isXRRenderTarget===!0)&&(Se=e.toneMapping);let Ce={shaderID:C,shaderType:i.type,shaderName:i.name,vertexShader:D,fragmentShader:O,defines:i.defines,customVertexShaderID:k,customFragmentShaderID:A,isRawShaderMaterial:i.isRawShaderMaterial===!0,glslVersion:i.glslVersion,precision:f,batching:P,batchingColor:P&&h._colorsTexture!==null,instancing:N,instancingColor:N&&h.instanceColor!==null,instancingMorph:N&&h.morphTexture!==null,outputColorSpace:j===null?e.outputColorSpace:j.isXRRenderTarget===!0?j.texture.colorSpace:Zm.workingColorSpace,alphaToCoverage:!!i.alphaToCoverage,map:F,matcap:ee,envMap:te,envMapMode:te&&x.mapping,envMapCubeUVHeight:S,aoMap:ne,lightMap:re,bumpMap:ie,normalMap:I,displacementMap:ae,emissiveMap:L,normalMapObjectSpace:I&&i.normalMapType===1,normalMapTangentSpace:I&&i.normalMapType===0,packedNormalMap:I&&i.normalMapType===0&&Sx(i.normalMap.format),metalnessMap:oe,roughnessMap:se,anisotropy:ce,anisotropyMap:ue,clearcoat:R,clearcoatMap:de,clearcoatNormalMap:fe,clearcoatRoughnessMap:pe,dispersion:le,iridescence:z,iridescenceMap:me,
vendor: 11,687 bytes, line 356
356iridescenceThicknessMap:he,sheen:B,sheenColorMap:H,sheenRoughnessMap:U,specularMap:W,specularColorMap:ge,specularIntensityMap:G,transmission:V,transmissionMap:_e,thicknessMap:K,gradientMap:q,opaque:i.transparent===!1&&i.blending===1&&i.alphaToCoverage===!1,alphaMap:ve,alphaTest:ye,alphaHash:be,combine:i.combine,mapUv:F&&m(i.map.channel),aoMapUv:ne&&m(i.aoMap.channel),lightMapUv:re&&m(i.lightMap.channel),bumpMapUv:ie&&m(i.bumpMap.channel),normalMapUv:I&&m(i.normalMap.channel),displacementMapUv:ae&&m(i.displacementMap.channel),emissiveMapUv:L&&m(i.emissiveMap.channel),metalnessMapUv:oe&&m(i.metalnessMap.channel),roughnessMapUv:se&&m(i.roughnessMap.channel),anisotropyMapUv:ue&&m(i.anisotropyMap.channel),clearcoatMapUv:de&&m(i.clearcoatMap.channel),clearcoatNormalMapUv:fe&&m(i.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:pe&&m(i.clearcoatRoughnessMap.channel),iridescenceMapUv:me&&m(i.iridescenceMap.channel),iridescenceThicknessMapUv:he&&m(i.iridescenceThicknessMap.channel),sheenColorMapUv:H&&m(i.sheenColorMap.channel),sheenRoughnessMapUv:U&&m(i.sheenRoughnessMap.channel),specularMapUv:W&&m(i.specularMap.channel),specularColorMapUv:ge&&m(i.specularColorMap.channel),specularIntensityMapUv:G&&m(i.specularIntensityMap.channel),transmissionMapUv:_e&&m(i.transmissionMap.channel),thicknessMapUv:K&&m(i.thicknessMap.channel),alphaMapUv:ve&&m(i.alphaMap.channel),vertexTangents:!!v.attributes.tangent&&(I||ce),vertexNormals:!!v.attributes.normal,vertexColors:i.vertexColors,vertexAlphas:i.vertexColors===!0&&!!v.attributes.color&&v.attributes.color.itemSize===4,pointsUvs:h.isPoints===!0&&!!v.attributes.uv&&(F||ve),fog:!!_,useFog:i.fog===!0,fogExp2:!!_&&_.isFogExp2,flatShading:i.wireframe===!1&&(i.flatShading===!0||v.attributes.normal===void 0&&I===!1&&(i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshPhysicalMaterial)),sizeAttenuation:i.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:M,skinning:h.isSkinnedMesh===!0,hasPositionAttribute:v.attributes.position!==void 0,morphTargets:v.morphAttributes.position!==void 0,morphNormals:v.morphAttributes.normal!==void 0,morphColors:v.morphAttributes.color!==void 0,morphTargetsCount:T,morphTextureStride:E,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numLightProbeGrids:g.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&l.length>0,shadowMapType:e.shadowMap.type,toneMapping:Se,decodeVideoTexture:F&&i.map.isVideoTexture===!0&&Zm.getTransfer(i.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:L&&i.emissiveMap.isVideoTexture===!0&&Zm.getTransfer(i.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:i.premultipliedAlpha,doubleSided:i.side===2,flipSided:i.side===1,useDepthPacking:i.depthPacking>=0,depthPacking:i.depthPacking||0,index0AttributeName:i.index0AttributeName,extensionClipCullDistance:xe&&i.extensions.clipCullDistance===!0&&n.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(xe&&i.extensions.multiDraw===!0||P)&&n.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:n.has(`KHR_parallel_shader_compile`),customProgramCacheKey:i.customProgramCacheKey()};return Ce.vertexUv1s=c.has(1),Ce.vertexUv2s=c.has(2),Ce.vertexUv3s=c.has(3),c.clear(),Ce}function g(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(_(n,t),v(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function _(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function v(e,t){o.disableAll(),t.instancing&&o.enable(0),t.instancingColor&&o.enable(1),t.instancingMorph&&o.enable(2),t.matcap&&o.enable(3),t.envMap&&o.enable(4),t.normalMapObjectSpace&&o.enable(5),t.normalMapTangentSpace&&o.enable(6),t.clearcoat&&o.enable(7),t.iridescence&&o.enable(8),t.alphaTest&&o.enable(9),t.vertexColors&&o.enable(10),t.vertexAlphas&&o.enable(11),t.vertexUv1s&&o.enable(12),t.vertexUv2s&&o.enable(13),t.vertexUv3s&&o.enable(14),t.vertexTangents&&o.enable(15),t.anisotropy&&o.enable(16),t.alphaHash&&o.enable(17),t.batching&&o.enable(18),t.dispersion&&o.enable(19),t.batchingColor&&o.enable(20),t.gradientMap&&o.enable(21),t.packedNormalMap&&o.enable(22),t.vertexNormals&&o.enable(23),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.reversedDepthBuffer&&o.enable(4),t.skinning&&o.enable(5),t.morphTargets&&o.enable(6),t.morphNormals&&o.enable(7),t.morphColors&&o.enable(8),t.premultipliedAlpha&&o.enable(9),t.shadowMapEnabled&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.transmission&&o.enable(15),t.sheen&&o.enable(16),t.opaque&&o.enable(17),t.pointsUvs&&o.enable(18),t.decodeVideoTexture&&o.enable(19),t.decodeVideoTextureEmissive&&o.enable(20),t.alphaToCoverage&&o.enable(21),t.numLightProbeGrids>0&&o.enable(22),t.hasPositionAttribute&&o.enable(23),e.push(o.mask)}function y(e){let t=p[e.type],n;if(t){let e=Ux[t];n=hv.clone(e.uniforms)}else n=e.uniforms;return n}function b(t,n){let r=u.get(n);return r===void 0?(r=new xx(e,n,t,i),l.push(r),u.set(n,r)):++r.usedTimes,r}function x(e){if(--e.usedTimes===0){let t=l.indexOf(e);l[t]=l[l.length-1],l.pop(),u.delete(e.cacheKey),e.destroy()}}function S(e){s.remove(e)}function C(){s.dispose()}return{getParameters:h,getProgramCacheKey:g,getUniforms:y,acquireProgram:b,releaseProgram:x,releaseShaderCache:S,programs:l,dispose:C}}function wx(){let e=new WeakMap;function t(t){return e.has(t)}function n(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function r(t){e.delete(t)}function i(t,n,r){e.get(t)[n]=r}function a(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:a}}function Tx(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.materialVariant===t.materialVariant?e.z===t.z?e.id-t.id:e.z-t.z:e.materialVariant-t.materialVariant:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function Ex(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function Dx(){let e=[],t=0,n=[],r=[],i=[];function a(){t=0,n.length=0,r.length=0,i.length=0}function o(e){let t=0;return e.isInstancedMesh&&(t+=2),e.isSkinnedMesh&&(t+=1),t}function s(n,r,i,a,s,c){let l=e[t];return l===void 0?(l={id:n.id,object:n,geometry:r,material:i,materialVariant:o(n),groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.materialVariant=o(n),l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}function c(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function l(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function u(e,t,a){n.length>1&&n.sort(e||Tx),r.length>1&&r.sort(t||Ex),i.length>1&&i.sort(t||Ex),a&&(n.reverse(),r.reverse(),i.reverse())}function d(){for(let n=t,r=e.length;n<r;n++){let t=e[n];if(t.id===null)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}}return{opaque:n,transmissive:r,transparent:i,init:a,push:c,unshift:l,finish:d,sort:u}}function Ox(){let e=new WeakMap;function t(t,n){let r=e.get(t),i;return r===void 0?(i=new Dx,e.set(t,[i])):n>=r.length?(i=new Dx,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function kx(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new Q,color:new Wh};break;case`SpotLight`:n={position:new Q,direction:new Q,color:new Wh,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new Q,color:new Wh,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new Q,skyColor:new Wh,groundColor:new Wh};break;case`RectAreaLight`:n={color:new Wh,position:new Q,halfWidth:new Q,halfHeight:new Q}}return e[t.id]=n,n}}}function Ax(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Um};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Um};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Um,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}function jx(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function Mx(e){let t=new kx,n=Ax(),r={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 e=0;e<9;e++)r.probe.push(new Q);let i=new Q,a=new uh,o=new uh;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(jx);for(let e=0,y=i.length;e<y;e++){let y=i[e],b=y.color,x=y.intensity,S=y.distance,C=null;if(y.shadow&&y.shadow.map&&(C=y.shadow.map.texture.format===1030?y.shadow.map.texture:y.shadow.map.depthTexture||y.shadow.map.texture),y.isAmbientLight)a+=b.r*x,o+=b.g*x,s+=b.b*x;else if(y.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(y.sh.coefficients[e],x);v++}else if(y.isDirectionalLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.n
vendor: 4,449 bytes, line 356
356ormalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[c]=t,r.directionalShadowMap[c]=C,r.directionalShadowMatrix[c]=y.shadow.matrix,p++}r.directional[c]=e,c++}else if(y.isSpotLight){let e=t.get(y);e.position.setFromMatrixPosition(y.matrixWorld),e.color.copy(b).multiplyScalar(x),e.distance=S,e.coneCos=Math.cos(y.angle),e.penumbraCos=Math.cos(y.angle*(1-y.penumbra)),e.decay=y.decay,r.spot[u]=e;let i=y.shadow;if(y.map&&(r.spotLightMap[g]=y.map,g++,i.updateMatrices(y),y.castShadow&&_++),r.spotLightMatrix[u]=i.matrix,y.castShadow){let e=n.get(y);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=C,h++}u++}else if(y.isRectAreaLight){let e=t.get(y);e.color.copy(b).multiplyScalar(x),e.halfWidth.set(y.width*.5,0,0),e.halfHeight.set(0,y.height*.5,0),r.rectArea[d]=e,d++}else if(y.isPointLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),e.distance=y.distance,e.decay=y.decay,y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[l]=t,r.pointShadowMap[l]=C,r.pointShadowMatrix[l]=y.shadow.matrix,m++}r.point[l]=e,l++}else if(y.isHemisphereLight){let e=t.get(y);e.skyColor.copy(y.color).multiplyScalar(x),e.groundColor.copy(y.groundColor).multiplyScalar(x),r.hemi[f]=e,f++}}d>0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=$.LTC_FLOAT_1,r.rectAreaLTC2=$.LTC_FLOAT_2):(r.rectAreaLTC1=$.LTC_HALF_1,r.rectAreaLTC2=$.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=LS++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t<f;t++){let f=e[t];if(f.isDirectionalLight){let e=r.directional[n];e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),n++}else if(f.isSpotLight){let e=r.spot[c];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),c++}else if(f.isRectAreaLight){let e=r.rectArea[l];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(f.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(f.width*.5,0,0),e.halfHeight.set(0,f.height*.5,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),l++}else if(f.isPointLight){let e=r.point[s];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),s++}else if(f.isHemisphereLight){let e=r.hemi[u];e.direction.setFromMatrixPosition(f.matrixWorld),e.direction.transformDirection(d),u++}}}return{setup:s,setupView:c,state:r}}function Nx(e){let t=new Mx(e),n=[],r=[],i=[];function a(e){d.camera=e,n.length=0,r.length=0,i.length=0}function o(e){n.push(e)}function s(e){r.push(e)}function c(e){i.push(e)}function l(){t.setup(n)}function u(e){t.setupView(n,e)}let d={lightsArray:n,shadowsArray:r,lightProbeGridArray:i,camera:null,lights:t,transmissionRenderTarget:{},textureUnits:0};return{init:a,state:d,setupLights:l,setupLightsView:u,pushLight:o,pushShadow:s,pushLightProbeGrid:c}}function Px(e){let t=new WeakMap;function n(n,r=0){let i=t.get(n),a;return i===void 0?(a=new Nx(e),t.set(n,[a])):r>=i.length?(a=new Nx(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}
vendor: 11,555 bytes, line 356
356function Fx(e,t,n){let r=new U_,i=new Um,a=new Um,o=new ah,s=new Sv,c=new Cv,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new vv({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Um},radius:{value:4}},vertexShader:RS,fragmentShader:zS}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new zg;m.setAttribute(`position`,new wg(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new d_(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;this.type===2&&(X(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),this.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;c<l;c++){let l=t[c],d=l.shadow;if(d===void 0){X(`WebGLShadowMap:`,l,`has no shadow.`);continue}if(d.autoUpdate===!1&&d.needsUpdate===!1)continue;i.copy(d.mapSize);let m=d.getFrameExtents();i.multiply(m),a.copy(d.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y));let h=e.state.buffers.depth.getReversed();if(d.camera._reversedDepth=h,d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){X(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new sh(i.x,i.y,{format:Np,type:bp,minFilter:up,magFilter:up,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new uv(i.x,i.y,yp),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=kp,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=sp,d.map.depthTexture.magFilter=sp}else l.isPointLight?(d.map=new aS(i.x),d.map.depthTexture=new dv(i.x,vp)):(d.map=new sh(i.x,i.y),d.map.depthTexture=new uv(i.x,i.y,vp)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=kp,this.type===1?(d.map.depthTexture.compareFunction=h?518:515,d.map.depthTexture.minFilter=up,d.map.depthTexture.magFilter=up):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=sp,d.map.depthTexture.magFilter=sp);d.camera.updateProjectionMatrix()}let g=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t<g;t++){if(d.map.isWebGLCubeRenderTarget)e.setRenderTarget(d.map,t),e.clear();else{t===0&&(e.setRenderTarget(d.map),e.clear());let n=d.getViewport(t);o.set(a.x*n.x,a.y*n.y,a.x*n.z,a.y*n.w),f.viewport(o)}if(l.isPointLight){let e=d.camera,n=d.matrix,r=l.distance||e.far;r!==e.far&&(e.far=r,e.updateProjectionMatrix()),US.setFromMatrixPosition(l.matrixWorld),e.position.copy(US),WS.copy(e.position),WS.add(BS[t]),e.up.copy(VS[t]),e.lookAt(WS),e.updateMatrixWorld(),n.makeTranslation(-US.x,-US.y,-US.z),HS.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),d._frustum.setFromProjectionMatrix(HS,e.coordinateSystem,e.reversedDepth)}else d.updateMatrices(l);r=d.getFrustum(),b(n,s,d.camera,l,this.type)}d.isPointLightShadow!==!0&&this.type===3&&v(d,s),d.needsUpdate=!1}_=this.type,g.needsUpdate=!1,e.setRenderTarget(c,l,d)};function v(n,r){let a=t.update(h);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),n.mapPass===null&&(n.mapPass=new sh(i.x,i.y,{format:Np,type:bp})),f.uniforms.shadow_pass.value=n.map.depthTexture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,f,h,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,p,h,null)}function y(t,n,r,i){let a=null,o=r.isPointLight===!0?t.customDistanceMaterial:t.customDepthMaterial;if(o!==void 0)a=o;else if(a=r.isPointLight===!0?c:s,e.localClippingEnabled&&n.clipShadows===!0&&Array.isArray(n.clippingPlanes)&&n.clippingPlanes.length!==0||n.displacementMap&&n.displacementScale!==0||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function b(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l<u;l++){let u=t[l],d=c[u.materialIndex];if(d&&d.visible){let t=y(n,d,o,s);n.onBeforeShadow(e,n,i,a,r,t,u),e.renderBufferDirect(a,null,r,t,n,u),n.onAfterShadow(e,n,i,a,r,t,u)}}}else if(c.visible){let t=y(n,c,o,s);n.onBeforeShadow(e,n,i,a,r,t,null),e.renderBufferDirect(a,null,r,t,n,null),n.onAfterShadow(e,n,i,a,r,t,null)}}let c=n.children;for(let e=0,t=c.length;e<t;e++)b(c[e],i,a,o,s)}function x(e){e.target.removeEventListener(`dispose`,x);for(let t in l){let n=l[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}}function Ix(e,t){function n(){let t=!1,n=new ah,r=null,i=new ah(0,0,0,0);return{setMask:function(n){r!==n&&!t&&(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){s===!0&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),i.equals(n)===!1&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}}function r(){let n=!1,r=!1,i=null,a=null,o=null;return{setReversed:function(e){if(r!==e){let n=t.get(`EXT_clip_control`);e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),r=e;let i=o;o=null,this.setClear(i)}},getReversed:function(){return r},setTest:function(t){t?oe(e.DEPTH_TEST):se(e.DEPTH_TEST)},setMask:function(t){i!==t&&!n&&(e.depthMask(t),i=t)},setFunc:function(t){if(r&&(t=Im[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}a=t}},setLocked:function(e){n=e},setClear:function(t){o!==t&&(o=t,r&&(t=1-t),e.clearDepth(t))},reset:function(){n=!1,i=null,a=null,o=null,r=!1}}}function i(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(n){t||(n?oe(e.STENCIL_TEST):se(e.STENCIL_TEST))},setMask:function(r){n!==r&&!t&&(e.stencilMask(r),n=r)},setFunc:function(t,n,o){(r!==t||i!==n||a!==o)&&(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){(o!==t||s!==n||c!==r)&&(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}}let a=new n,o=new r,s=new i,c=new WeakMap,l=new WeakMap,u={},d={},f={},p=new WeakMap,m=[],h=null,g=!1,_=null,v=null,y=null,b=null,x=null,S=null,C=null,w=new Wh(0,0,0),T=0,E=!1,D=null,O=null,k=null,A=null,j=null,M=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),N=!1,P=0,F=e.getParameter(e.VERSION);F.indexOf(`WebGL`)===-1?F.indexOf(`OpenGL ES`)!==-1&&(P=parseFloat(/^OpenGL ES (\d)/.exec(F)[1]),N=P>=2):(P=parseFloat(/^WebGL (\d)/.exec(F)[1]),N=P>=1);let ee=null,te={},ne=e.getParameter(e.SCISSOR_BOX),re=e.getParameter(e.VIEWPORT),ie=new ah().fromArray(ne),I=new ah().fromArray(re);function ae(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<r;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}let L={};L[e.TEXTURE_2D]=ae(e.TEXTURE_2D,e.TEXTURE_2D,1),L[e.TEXTURE_CUBE_MAP]=ae(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),L[e.TEXTURE_2D_ARRAY]=ae(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),L[e.TEXTURE_3D]=ae(e.TEXTURE_3D,e.TEXTURE_3D,1,1),a.setClear(0,0,0,1),o.setClear(1),s.setClear(0),oe(e.DEPTH_TEST),o.setFunc(3),de(!1),fe(1),oe(e.CULL_FACE),V(0);function oe(t){u[t]!==!0&&(e.enable(t),u[t]=!0)}function se(t){u[t]!==!1&&(e.disable(t),u[t]=!1)}function ce(t,n){return f[t]!==n&&(e.bindFramebuffer(t,n),f[t]=n,t===e.DRAW_FRAMEBUFFER&&(f[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(f[e.DRAW_FRAMEBUFFER]=n),!0)}function R(t,n){let r=m,i=!1;if(t){r=p.get(n),r===void 0&&(r=[],p.set(n,r));let a=t.textures;if(r.length!==a.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=a.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)}function le(t){return h!==t&&(e.useProgram(t),h=t,!0)}let z={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};z[103]=e.MIN,z[104]=e.MAX;let B={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function V(t,n,r,i,a,o,s,c,l,u){if(t===0){g===!0&&(se(e.BLEND),g=!1);return}if(g===!1&&(oe(e.BLEND),g=!0),t!==5){if(t!==_||u!==E){if((v!==100||x!==100)&&(e.blendEquation(e.FUNC_ADD),v=100,x=100),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:Z(`WebGLState: Invalid blending: `,t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:Z(`WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true`);break;case 4:Z(`WebGLState: MultiplyBlending requires material.premultipliedAlpha = true`);break;default:Z(`WebGLState: Invalid blending: `,t)}y=null,b=null,S=null,C=null,w.set(0,0,0),T=0,_=t,E=u}return}a||=n,o||=r,s||=i,(n!==v||a!==x)&&(e.blendEquationSeparate(z[n],z[a]),v=n,x=a),(r!==y||i!==b||o!==S||s!==C)&&(e.blendFuncSeparate(B[r],B[i],B[o],B[s]),y=r,b=i,S=o,C=s),(c.equals(w)===!1||l!==T)&&(e.blendColor
356(c.r,c.g,c.b,l),w.copy(c),T=l),_=t,E=!1}function ue(t,n){t.side===2?se(e.CULL_FACE):oe(e.CULL_FACE);let r=t.side===1;n&&(r=!r),de(r),t.blending===1&&t.transparent===!1?V(0):V(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),a.setMask(t.colorWrite);let i=t.stencilWrite;s.setTest(i),i&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),me(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),t.alphaToCoverage===!0?oe(e.SAMPLE_ALPHA_TO_COVERAGE):se(e.SAMPLE_ALPHA_TO_COVERAGE)}function de(t){D!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),D=t)}function fe(t){t===0?se(e.CULL_FACE):(oe(e.CULL_FACE),t!==O&&(t===1?e.cullFace(e.BACK):t===2?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))),O=t}function pe(t){t!==k&&(N&&e.lineWidth(t),k=t)}function me(t,n,r){t?(oe(e.POLYGON_OFFSET_FILL),(A!==n||j!==r)&&(A=n,j=r,o.getReversed()&&(n=-n),e.polygonOffset(n,r))):se(e.POLYGON_OFFSET_FILL)}function he(t){t?oe(e.SCISSOR_TEST):se(e.SCISSOR_TEST)}function H(t){t===void 0&&(t=e.TEXTURE0+M-1),ee!==t&&(e.activeTexture(t),ee=t)}function U(t,n,r){r===void 0&&(r=ee===null?e.TEXTURE0+M-1:ee);let i=te[r];i===void 0&&(i={type:void 0,texture:void 0},te[r]=i),(i.type!==t||i.texture!==n)&&(ee!==r&&(e.activeTexture(r),ee=r),e.bindTexture(t,n||L[t]),i.type=t,i.texture=n)}function W(){let t=te[ee];t!==void 0&&t.type!==void 0&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)}function ge(){try{e.compressedTexImage2D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function G(){try{e.compressedTexImage3D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function _e(){try{e.texSubImage2D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function K(){try{e.texSubImage3D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function q(){try{e.compressedTexSubImage2D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function ve(){try{e.compressedTexSubImage3D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function ye(){try{e.texStorage2D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function be(){try{e.texStorage3D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function xe(){try{e.texImage2D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function Se(){try{e.texImage3D(...arguments)}catch(e){Z(`WebGLState:`,e)}}function Ce(t){return d[t]===void 0?e.getParameter(t):d[t]}function we(t,n){d[t]!==n&&(e.pixelStorei(t,n),d[t]=n)}function J(t){ie.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),ie.copy(t))}function Te(t){I.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),I.copy(t))}function Ee(t,n){let r=l.get(n);r===void 0&&(r=new WeakMap,l.set(n,r));let i=r.get(t);i===void 0&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))}function De(t,n){let r=l.get(n).get(t);c.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),c.set(n,r))}function Oe(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),o.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),e.pixelStorei(e.PACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),e.pixelStorei(e.PACK_ROW_LENGTH,0),e.pixelStorei(e.PACK_SKIP_PIXELS,0),e.pixelStorei(e.PACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_ROW_LENGTH,0),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,0),e.pixelStorei(e.UNPACK_SKIP_PIXELS,0),e.pixelStorei(e.UNPACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_SKIP_IMAGES,0),u={},d={},ee=null,te={},f={},p=new WeakMap,m=[],h=null,g=!1,_=null,v=null,y=null,b=null,x=null,S=null,C=null,w=new Wh(0,0,0),T=0,E=!1,D=null,O=null,k=null,A=null,j=null,ie.set(0,0,e.canvas.width,e.canvas.height),I.set(0,0,e.canvas.width,e.canvas.height),a.reset(),o.reset(),s.reset()}return{buffers:{color:a,depth:o,stencil:s},enable:oe,disable:se,bindFramebuffer:ce,drawBuffers:R,useProgram:le,setBlending:V,setMaterial:ue,setFlipSided:de,setCullFace:fe,
356setLineWidth:pe,setPolygonOffset:me,setScissorTest:he,activeTexture:H,bindTexture:U,unbindTexture:W,compressedTexImage2D:ge,compressedTexImage3D:G,texImage2D:xe,texImage3D:Se,pixelStorei:we,getParameter:Ce,updateUBOMapping:Ee,uniformBlockBinding:De,texStorage2D:ye,texStorage3D:be,texSubImage2D:_e,texSubImage3D:K,compressedTexSubImage2D:q,compressedTexSubImage3D:ve,scissor:J,viewport:Te,reset:Oe}}function Lx(e,t,n,r,i,a,o){let s=t.has(`WEBGL_multisampled_render_to_texture`)?t.get(`WEBGL_multisampled_render_to_texture`):null,c=typeof navigator>`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Um,u=new WeakMap,d=new Set,f,p=new WeakMap,m=!1;try{m=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function h(e,t){return m?new OffscreenCanvas(e,t):nf(`canvas`)}function g(e,t,n){let r=1,i=ge(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);f===void 0&&(f=h(n,a));let o=t?h(n,a):f;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),X(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}return`data`in e&&X(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e}return e}function _(e){return e.generateMipmaps}function v(t){e.generateMipmap(t)}function y(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function b(n,r,i,a,o,s=!1){if(n!==null){if(e[n]!==void 0)return e[n];X(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let c;a&&(c=t.get(`EXT_texture_norm16`),c||X(`WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension`));let l=r;if(r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8),i===e.UNSIGNED_SHORT&&c&&(l=c.R16_EXT),i===e.SHORT&&c&&(l=c.R16_SNORM_EXT)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.R8UI),i===e.UNSIGNED_SHORT&&(l=e.R16UI),i===e.UNSIGNED_INT&&(l=e.R32UI),i===e.BYTE&&(l=e.R8I),i===e.SHORT&&(l=e.R16I),i===e.INT&&(l=e.R32I)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8),i===e.UNSIGNED_SHORT&&c&&(l=c.RG16_EXT),i===e.SHORT&&c&&(l=c.RG16_SNORM_EXT)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RG8UI),i===e.UNSIGNED_SHORT&&(l=e.RG16UI),i===e.UNSIGNED_INT&&(l=e.RG32UI),i===e.BYTE&&(l=e.RG8I),i===e.SHORT&&(l=e.RG16I),i===e.INT&&(l=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGB8UI),i===e.UNSIGNED_SHORT&&(l=e.RGB16UI),i===e.UNSIGNED_INT&&(l=e.RGB32UI),i===e.BYTE&&(l=e.RGB8I),i===e.SHORT&&(l=e.RGB16I),i===e.INT&&(l=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),i===e.UNSIGNED_INT&&(l=e.RGBA32UI),i===e.BYTE&&(l=e.RGBA8I),i===e.SHORT&&(l=e.RGBA16I),i===e.INT&&(l=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_SHORT&&c&&(l=c.RGB16_EXT),i===e.SHORT&&c&&(l=c.RGB16_SNORM_EXT),i===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),r===e.RGBA){let t=s?km:Zm.getTransfer(o);i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT&&c&&(l=c.RGBA16_EXT),i===e.SHORT&&c&&(l=c.RGBA16_SNORM_EXT),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),l}function x(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,X(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function S(e,t){return _(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function C(e){let t=e.target;t.removeEventListener(`dispose`,C),T(t),t.isVideoTexture&&u.delete(t),t.isHTMLTexture&&d.delete(t)}function w(e){let t=e.target;t.removeEventListener(`dispose`,w),D(t)}function T(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=p.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&E(e),Object.keys(i).length===0&&p.delete(n)}r.remove(e)}function E(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=p.get(i);delete a[n.__cacheKey],o.memory.textures--}function D(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRen
vendor: 1,272 bytes, line 356
356derTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r<n.__webglFramebuffer[t].length;r++)e.deleteFramebuffer(n.__webglFramebuffer[t][r]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}let i=t.textures;for(let t=0,n=i.length;t<n;t++){let n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[t])}r.remove(t)}let O=0;function k(){O=0}function A(){return O}function j(e){O=e}function M(){let e=O;return e>=i.maxTextures&&X(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),O+=1,e}function N(e){let t=[];
vendor: 4,843 bytes, line 356
356return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function P(t,i){let a=r.get(t);if(t.isVideoTexture&&U(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)X(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)X(`WebGLRenderer: Texture marked for update but image is incomplete`);else{se(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function F(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){se(a,t,i);return}t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function ee(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){se(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function te(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){ce(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let ne={[ip]:e.REPEAT,[ap]:e.CLAMP_TO_EDGE,[op]:e.MIRRORED_REPEAT},re={[sp]:e.NEAREST,[cp]:e.NEAREST_MIPMAP_NEAREST,[lp]:e.NEAREST_MIPMAP_LINEAR,[up]:e.LINEAR,[dp]:e.LINEAR_MIPMAP_NEAREST,[fp]:e.LINEAR_MIPMAP_LINEAR},ie={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function I(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&X(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,ne[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,ne[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,ne[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,re[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,re[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,ie[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function ae(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,C));let i=n.source,a=p.get(i);a===void 0&&(a={},p.set(i,a));let s=N(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&E(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function L(e,t,n){return Math.floor(Math.floor(e/n)/t)}function oe(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e<o.length;e++){let t=o[s],n=o[e],i=t.start+t.count,a=L(n.start,r.width,4),c=L(t.start,r.width,4);n.start<=i+1&&a===c&&L(n.start+n.count-1,r.width,4)===a?t.count=Math.max(t.count,n.start+n.count-t.start):(++s,o[s]=n)}o.length=s+1;let c=n.getParameter(e.UNPACK_ROW_LENGTH),l=n.getParameter(e.UNPACK_SKIP_PIXELS),u=n.getParameter(e.UNPACK_SKIP_ROWS);n.pixelStorei(e.UNPACK_ROW_LENGTH,r.width);for(let t=0,s=o.length;t<s;t++){let s=o[t],c=Math.floor(s.start/4),l=Math.ceil(s.count/4),u=c%r.width,d=Math.floor(c/r.width),f=l;n.pixelStorei(e.UNPACK_SKIP_PIXELS,u),n.pixelStorei(e.UNPACK_SKIP_ROWS,d),n.texSubImage2D(e.TEXTURE_2D,0,u,d,f,1,i,a,r.data)}t.clearUpdateRanges(),n.pixelStorei(e.UNPACK_ROW_LENGTH,c),n.pixelStorei(e.UNPACK_SKIP_PIXELS,l),n.pixelStorei(e.UNPACK_SKIP_ROWS,u)}}function se(t,o,s){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);let l=ae(t,o),u=o.source;n.bindTexture(c,t.__webglTexture,e.TEXTURE0+s);let f=r.get(u);if(u.version!==f.__version||l===!0){if(n.activeTexture(e.TEXTURE0+s),!(typeof ImageBitmap<`u`&&o.image instanceof ImageBitmap)){let t=Zm.getPrimaries(Zm.workingColorSpace),r=o.colorSpace
356===``?null:Zm.getPrimaries(o.colorSpace),i=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,i)}n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment);let t=g(o.image,!1,i.maxTextureSize);t=W(o,t);let r=a.convert(o.format,o.colorSpace),p=a.convert(o.type),m=b(o.internalFormat,r,p,o.normalized,o.colorSpace,o.isVideoTexture);I(c,o);let h,y=o.mipmaps,C=o.isVideoTexture!==!0,w=f.__version===void 0||l===!0,T=u.dataReady,E=S(o,t);if(o.isDepthTexture)m=x(o.format===Ap,o.type),w&&(C?n.texStorage2D(e.TEXTURE_2D,1,m,t.width,t.height):n.texImage2D(e.TEXTURE_2D,0,m,t.width,t.height,0,r,p,null));else if(o.isDataTexture){if(y.length>0){C&&w&&n.texStorage2D(e.TEXTURE_2D,E,m,y[0].width,y[0].height);for(let t=0,i=y.length;t<i;t++)h=y[t],C?T&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,p,h.data):n.texImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,r,p,h.data);o.generateMipmaps=!1}else C?(w&&n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height),T&&oe(o,t,r,p)):n.texImage2D(e.TEXTURE_2D,0,m,t.width,t.height,0,r,p,t.data)}else if(o.isCompressedTexture){if(o.isCompressedArrayTexture){C&&w&&n.texStorage3D(e.TEXTURE_2D_ARRAY,E,m,y[0].width,y[0].height,t.depth);for(let i=0,a=y.length;i<a;i++)if(h=y[i],o.format!==1023){if(r!==null){if(C){if(T){if(o.layerUpdates.size>0){let t=$f(h.width,h.height,o.format,o.type);for(let a of o.layerUpdates){let o=h.data.subarray(a*t/h.data.BYTES_PER_ELEMENT,(a+1)*t/h.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,h.width,h.height,1,r,o)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,h.data)}}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,h.data,0,0)}else X(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`)}else C?T&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,p,h.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,r,p,h.data)}else{C&&w&&n.texStorage2D(e.TEXTURE_2D,E,m,y[0].width,y[0].height);for(let t=0,i=y.length;t<i;t++)h=y[t],o.format===1023?C?T&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,p,h.data):n.texImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,r,p,h.data):r===null?X(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`):C?T&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,h.width,h.height,r,h.data):n.compressedTexImage2D(e.TEXTURE_2D,t,m,h.width,h.height,0,h.data)}}else if(o.isDataArrayTexture){if(C){if(w&&n.texStorage3D(e.TEXTURE_2D_ARRAY,E,m,t.width,t.height,t.depth),T){if(o.layerUpdates.size>0){let i=$f(t.width,t.height,o.format,o.type);for(let a of o.layerUpdates){let o=t.data.subarray(a*i/t.data.BYTES_PER_ELEMENT,(a+1)*i/t.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,a,t.width,t.height,1,r,p,o)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)}}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,m,t.width,t.height,t.depth,0,r,p,t.data)}else if(o.isData3DTexture)C?(w&&n.texStorage3D(e.TEXTURE_3D,E,m,t.width,t.height,t.depth),T&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)):n.texImage3D(e.TEXTURE_3D,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isFramebufferTexture){if(w){if(C)n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height);else{let i=t.width,a=t.height;for(let t=0;t<E;t++)n.texImage2D(e.TEXTURE_2D,t,m,i,a,0,r,p,null),i>>=1,a>>=1}}}else if(o.isHTMLTexture){if(`texElementImage2D`in e){let n=e.canvas;if(n.hasAttribute(`layoutsubtree`)||n.setAttribute(`layoutsubtree`,`true`),t.parentNode!==n){n.appendChild(t),d.add(o),n.onpaint=e=>{let t=e.changedElements;for(let e of d)t.includes(e.image)&&(e.needsUpdate=!0)},n.requestPaint();return}if(e.texElementImage2D.length===3)e.texElementImage2D(e.TEXTURE_2D,e.RGBA8,t);else{let n=e.RGBA,r=e.RGBA,i=e.UNSIGNED_BYTE;e.texElementImage2D(e.TEXTURE_2D,0,n,r,i,t)}e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}else if(y.length>0){if(C&&w){let t=ge(y[0]);n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height)}for(let t=0,i=y.length;t<i;t++)h=y[t],C?T&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,r,p,h):n.texImage2D(e.TEXTURE_2D,t,m,r,p,h);o.generateMipmaps=!1}else if(C){if(w){let r=ge(t);n.texStorage2D(e.TEXTURE_2D,E,m,r.width,r.height)}T&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,r,p,t)}else n.texImage2D(e.TEXTURE_2D,0,m,r,p,t);_(o)&&v(c),f.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function ce(t,o,s){if(o.image.length!==6)return;let c=ae(t,o),l=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);let u=r.get(l);if(l.version!==u.__version||c===!0){n.activeTexture(e.TEXTURE0+s);
vendor: 5,574 bytes, line 356
356let t=Zm.getPrimaries(Zm.workingColorSpace),r=o.colorSpace===``?null:Zm.getPrimaries(o.colorSpace),d=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let f=o.isCompressedTexture||o.image[0].isCompressedTexture,p=o.image[0]&&o.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)!f&&!p?m[e]=g(o.image[e],!0,i.maxCubemapSize):m[e]=p?o.image[e].image:o.image[e],m[e]=W(o,m[e]);let h=m[0],y=a.convert(o.format,o.colorSpace),x=a.convert(o.type),C=b(o.internalFormat,y,x,o.normalized,o.colorSpace),w=o.isVideoTexture!==!0,T=u.__version===void 0||c===!0,E=l.dataReady,D=S(o,h);I(e.TEXTURE_CUBE_MAP,o);let O;if(f){w&&T&&n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,h.width,h.height);for(let t=0;t<6;t++){O=m[t].mipmaps;for(let r=0;r<O.length;r++){let i=O[r];o.format===1023?w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,y,x,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,C,i.width,i.height,0,y,x,i.data):y===null?X(`WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()`):w?E&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,y,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,C,i.width,i.height,0,i.data)}}}else{if(O=o.mipmaps,w&&T){O.length>0&&D++;let t=ge(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,y,x,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,y,x,m[t].data);for(let r=0;r<O.length;r++){let i=O[r].image[t].image;w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,y,x,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,C,i.width,i.height,0,y,x,i.data)}}else{w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,y,x,m[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,y,x,m[t]);for(let r=0;r<O.length;r++){let i=O[r];w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,y,x,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,C,y,x,i.image[t])}}}_(o)&&v(e.TEXTURE_CUBE_MAP),u.__version=l.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function R(t,i,o,c,l,u){let d=a.convert(o.format,o.colorSpace),f=a.convert(o.type),p=b(o.internalFormat,d,f,o.normalized,o.colorSpace),m=r.get(i),h=r.get(o);if(h.__renderTarget=i,!m.__hasExternalTextures){let t=Math.max(1,i.width>>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),H(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,he(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function le(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=x(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;H(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,he(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,he(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i<t.length;i++){let o=t[i],c=a.convert(o.format,o.colorSpace),l=a.convert(o.type),u=b(o.internalFormat,c,l,o.normalized,o.colorSpace);H(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,he(n),u,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,he(n),u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function z(t,i,o){let c=i.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(e.FRAMEBUFFER,t),!(i.depthTexture&&i.depthTexture.isDepthTexture))throw Error(`THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.`);let l=r.get(i.depthTexture);if(l.__renderTarget=i,(!l.__webglTexture||i.depthTexture.image.width!==i.width||i.depthTexture.image.height!==i.height)&&(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),c){if(l.__webglInit===void 0&&(l.__webglInit=!0,i.depthTexture.addEventListener(`dispose`,C)),l.__webglTexture===void 0){l.__webglTexture=e.createTexture(),n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),I(e.TEXTURE_CUBE_MAP,i.depthTexture);let t=a.convert(i.depthTexture.format),r=a.convert(i.depthTexture.type),o;i.depthTexture.format===1026?o=e.DEPTH_COMPONENT24:i.depthTexture.format===1027&&(o=e.DEPTH24_STENCIL8);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o,i.width,i.height,0,t,r,null)}}else P(i.depthTexture,0);let u=l.__webglTexture,d=he(i),f=c?e.TEXTURE_CUBE_MAP_POSITIVE_X+o:e.TEXTURE_2D,p=i.depthTexture.format===1027?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(i.depthTexture.format===1026)H(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else if(i.depthTexture.format===1027)H(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else throw Error(`THREE.WebGLTextures: Unknown depthTexture format.`)}
vendor: 5,614 bytes, line 356
356function B(t){let i=r.get(t),a=t.isWebGLCubeRenderTarget===!0;if(i.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){let t=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)for(let e=0;e<6;e++)z(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?z(i.__webglFramebuffer[0],t,0):z(i.__webglFramebuffer,t,0)}}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),le(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),le(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function V(t,n,i){let a=r.get(t);n!==void 0&&R(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&B(t)}function ue(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,w);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(d)for(let t=0,n=l.length;t<n;t++){let n=r.get(l[t]);n.__webglTexture===void 0&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&H(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<l.length;n++){let r=l[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);let i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),c=b(r.internalFormat,i,o,r.normalized,r.colorSpace,t.isXRRenderTarget===!0),u=he(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,c,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),le(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,c.__webglTexture),I(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)R(s.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else R(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);_(i)&&v(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){for(let i=0,a=l.length;i<a;i++){let a=l[i],o=r.get(a),c=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(c=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(c,o.__webglTexture),I(c,a),R(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+i,c,0),_(a)&&v(c)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,c.__webglTexture),I(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)R(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else R(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);_(i)&&v(r),n.unbindTexture()}t.depthBuffer&&B(t)}function de(e){let t=e.textures;for(let i=0,a=t.length;i<a;i++){let a=t[i];if(_(a)){let t=y(e),i=r.get(a).__webglTexture;n.bindTexture(t,i),v(t),n.unbindTexture()}}}let fe=[],pe=[];function me(t){if(t.samples>0){if(H(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer);let f=t.texture.mipmaps;f&&f.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),d){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRen
vendor: 4,537 bytes, line 356
356derbuffer[n]);let t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),c===!0&&(fe.length=0,pe.length=0,fe.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&t.resolveDepthBuffer===!1&&(fe.push(l),pe.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,pe)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,fe))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);let a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&t.resolveDepthBuffer===!1&&c){let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}}}function he(e){return Math.min(i.maxSamples,e.samples)}function H(e){let n=r.get(e);return e.samples>0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function U(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function W(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(Zm.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&X(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):Z(`WebGLTextures: Unsupported texture color space:`,n)),t}function ge(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=M,this.resetTextureUnits=k,this.getTextureUnits=A,this.setTextureUnits=j,this.setTexture2D=P,this.setTexture2DArray=F,this.setTexture3D=ee,this.setTextureCube=te,this.rebindTextures=V,this.setupRenderTarget=ue,this.updateRenderTargetMipmap=de,this.updateMultisampleRenderTarget=me,this.setupDepthRenderbuffer=B,this.setupFrameBufferTexture=R,this.useMultisampledRTT=H,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function Rx(e,t){function n(n,r=``){let i,a=Zm.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779){if(a===`srgb`){if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null}else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null}if(n===35840||n===35841||n===35842||n===35843){if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null}if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491){if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;
356if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null}if(n===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){if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null}if(n===36492||n===36494||n===36495){if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null}if(n===36283||n===36284||n===36285||n===36286){if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null}return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}function zx(e,t){function n(e,t){e.matrixAutoUpdate===!0&&e.updateMatrix(),t.value.copy(e.matrix)}function r(t,n){n.color.getRGB(t.fogColor.value,Gf(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)}function i(e,t,n,r,i){t.isNodeMaterial?t.uniformsNeedUpdate=!1:t.isMeshBasicMaterial?a(e,t):t.isMeshLambertMaterial?(a(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshToonMaterial?(a(e,t),d(e,t)):t.isMeshPhongMaterial?(a(e,t),u(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshStandardMaterial?(a(e,t),f(e,t),t.isMeshPhysicalMaterial&&p(e,t,i)):t.isMeshMatcapMaterial?(a(e,t),m(e,t)):t.isMeshDepthMaterial?a(e,t):t.isMeshDistanceMaterial?(a(e,t),h(e,t)):t.isMeshNormalMaterial?a(e,t):t.isLineBasicMaterial?(o(e,t),t.isLineDashedMaterial&&s(e,t)):t.isPointsMaterial?c(e,t,n,r):t.isSpriteMaterial?l(e,t):t.isShadowMaterial?(e.color.value.copy(t.color),e.opacity.value=t.opacity):t.isShaderMaterial&&(t.uniformsNeedUpdate=!1)}function a(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,r.side===1&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),r.side===1&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,e.envMapRotation.value.setFromMatrix4(YS.makeRotationFromEuler(o)).transpose(),a.isCubeTexture&&a.isRenderTargetTexture===!1&&e.envMapRotation.value.premultiply(XS),e.reflectivity.value=r.reflectivity,e.ior.value=r.
356ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function Bx(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(g(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,v));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(f(e),a[e.id]=c)}function u(t){let n=d();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function d(){for(let e=0;e<s;e++)if(o.indexOf(e)===-1)return o.push(e),e;return Z(`WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.`),0}function f(t){let n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let e=0,t=r.length;e<t;e++){let t=r[e];if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)p(t[n],e,n,a);else p(t,e,0,a)}e.bindBuffer(e.UNIFORM_BUFFER,null)}function p(t,n,r,i){if(h(t,n,r,i)===!0){let n=t.__offset,r=t.value;if(Array.isArray(r)){let e=0;for(let n=0;n<r.length;n++){let i=r[n],a=_(i);m(i,t.__data,e),typeof i!=`number`&&typeof i!=`boolean`&&!i.isMatrix3&&!ArrayBuffer.isView(i)&&(e+=a.storage/Float32Array.BYTES_PER_ELEMENT)}}else m(r,t.__data,0);e.bufferSubData(e.UNIFORM_BUFFER,n,t.__data)}}function m(e,t,n){typeof e==`number`||typeof e==`boolean`?t[0]=e:e.isMatrix3?(t[0]=e.elements[0],t[1]=e.elements[1],t[2]=e.elements[2],t[3]=0,t[4]=e.elements[3],t[5]=e.elements[4],t[6]=e.elements[5],t[7]=0,t[8]=e.elements[6],t[9]=e.elements[7],t[10]=e.elements[8],t[11]=0):ArrayBuffer.isView(e)?t.set(new e.constructor(e.buffer,e.byteOffset,t.length)):e.toArray(t,n)}function h(e,t,n,r){let i=e.value,a=t+`_`+n;if(r[a]===void 0)return r[a]=typeof i==`number`||typeof i==`boolean`?i:ArrayBuffer.isView(i)?i.slice():i.clone(),!0;{let e=r[a];if(typeof i==`number`||typeof i==`boolean`){if(e!==i)return r[a]=i,!0}else if(ArrayBuffer.isView(i))return!0;else if(e.equals(i)===!1)return e.copy(i),!0}return!1}function g(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e<r;e++){let r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){let t=r[e],i=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=i.length;e<r;e++){let r=i[e],a=_(r),o=n%16,s=o%a.boundary,c=o+s;
356n+=s,c!==0&&16-c<a.storage&&(n+=16-c),t.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=a.storage}}}let r=n%16;return r>0&&(n+=16-r),e.__size=n,e.__cache={},this}function _(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?X(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):ArrayBuffer.isView(e)?(t.boundary=16,t.storage=e.byteLength):X(`WebGLRenderer: Unsupported uniform value type.`,e),t}function v(t){let n=t.target;n.removeEventListener(`dispose`,v);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function y(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:y}}function Vx(){return QS===null&&(QS=new C_(ZS,16,16,Np,bp),QS.name=`DFG_LUT`,QS.minFilter=up,QS.magFilter=up,QS.wrapS=ap,QS.wrapT=ap,QS.generateMipmaps=!1,QS.needsUpdate=!0),QS}var Hx,$,Ux,Wx,Gx,Kx,qx,Jx,Yx,Xx,Zx,Qx,$x,eS,tS,nS,rS,iS,aS,oS,sS,cS,lS,uS,dS,fS,pS,mS,hS,gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS,AS,jS,MS,NS,PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC=i((()=>{Iy(),Hx={alphahash_fragment:`#ifdef USE_ALPHAHASH
357	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
358#endif`,alphahash_pars_fragment:`#ifdef USE_ALPHAHASH
359	const float ALPHA_HASH_SCALE = 0.05;
360	float hash2D( vec2 value ) {
361		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
362	}
363	float hash3D( vec3 value ) {
364		return hash2D( vec2( hash2D( value.xy ), value.z ) );
365	}
366	float getAlphaHashThreshold( vec3 position ) {
367		float maxDeriv = max(
368			length( dFdx( position.xyz ) ),
369			length( dFdy( position.xyz ) )
370		);
371		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
372		vec2 pixScales = vec2(
373			exp2( floor( log2( pixScale ) ) ),
374			exp2( ceil( log2( pixScale ) ) )
375		);
376		vec2 alpha = vec2(
377			hash3D( floor( pixScales.x * position.xyz ) ),
378			hash3D( floor( pixScales.y * position.xyz ) )
379		);
380		float lerpFactor = fract( log2( pixScale ) );
381		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
382		float a = min( lerpFactor, 1.0 - lerpFactor );
383		vec3 cases = vec3(
384			x * x / ( 2.0 * a * ( 1.0 - a ) ),
385			( x - 0.5 * a ) / ( 1.0 - a ),
386			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
387		);
388		float threshold = ( x < ( 1.0 - a ) )
389			? ( ( x < a ) ? cases.x : cases.y )
390			: cases.z;
391		return clamp( threshold , 1.0e-6, 1.0 );
392	}
393#endif`,alphamap_fragment:`#ifdef USE_ALPHAMAP
394	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
395#endif`,alphamap_pars_fragment:`#ifdef USE_ALPHAMAP
396	uniform sampler2D alphaMap;
397#endif`,alphatest_fragment:`#ifdef USE_ALPHATEST
398	#ifdef ALPHA_TO_COVERAGE
399	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
400	if ( diffuseColor.a == 0.0 ) discard;
401	#else
402	if ( diffuseColor.a < alphaTest ) discard;
403	#endif
404#endif`,alphatest_pars_fragment:`#ifdef USE_ALPHATEST
405	uniform float alphaTest;
406#endif`,aomap_fragment:`#ifdef USE_AOMAP
407	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
408	reflectedLight.indirectDiffuse *= ambientOcclusion;
409	#if defined( USE_CLEARCOAT ) 
410		clearcoatSpecularIndirect *= ambientOcclusion;
411	#endif
412	#if defined( USE_SHEEN ) 
413		sheenSpecularIndirect *= ambientOcclusion;
414	#endif
415	#if defined( USE_ENVMAP ) && defined( STANDARD )
416		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
417		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
418	#endif
419#endif`,aomap_pars_fragment:`#ifdef USE_AOMAP
420	uniform sampler2D aoMap;
421	uniform float aoMapIntensity;
422#endif`,batching_pars_vertex:`#ifdef USE_BATCHING
423	#if ! defined( GL_ANGLE_multi_draw )
424	#define gl_DrawID _gl_DrawID
425	uniform int _gl_DrawID;
426	#endif
427	uniform highp sampler2D batchingTexture;
428	uniform highp usampler2D batchingIdTexture;
429	mat4 getBatchingMatrix( const in float i ) {
430		int size = textureSize( batchingTexture, 0 ).x;
431		int j = int( i ) * 4;
432		int x = j % size;
433		int y = j / size;
434		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
435		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
436		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
437		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
438		return mat4( v1, v2, v3, v4 );
439	}
440	float getIndirectIndex( const in int i ) {
441		int size = textureSize( batchingIdTexture, 0 ).x;
442		int x = i % size;
443		int y = i / size;
444		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
445	}
446#endif
447#ifdef USE_BATCHING_COLOR
448	uniform sampler2D batchingColorTexture;
449	vec4 getBatchingColor( const in float i ) {
450		int size = textureSize( batchingColorTexture, 0 ).x;
451		int j = int( i );
452		int x = j % size;
453		int y = j / size;
454		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 )
vendor: 6,787 bytes, lines 454-615
454;
455	}
456#endif`,batching_vertex:`#ifdef USE_BATCHING
457	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
458#endif`,begin_vertex:`vec3 transformed = vec3( position );
459#ifdef USE_ALPHAHASH
460	vPosition = vec3( position );
461#endif`,beginnormal_vertex:`vec3 objectNormal = vec3( normal );
462#ifdef USE_TANGENT
463	vec3 objectTangent = vec3( tangent.xyz );
464#endif`,bsdfs:`float G_BlinnPhong_Implicit( ) {
465	return 0.25;
466}
467float D_BlinnPhong( const in float shininess, const in float dotNH ) {
468	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
469}
470vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
471	vec3 halfDir = normalize( lightDir + viewDir );
472	float dotNH = saturate( dot( normal, halfDir ) );
473	float dotVH = saturate( dot( viewDir, halfDir ) );
474	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
475	float G = G_BlinnPhong_Implicit( );
476	float D = D_BlinnPhong( shininess, dotNH );
477	return F * ( G * D );
478} // validated`,iridescence_fragment:`#ifdef USE_IRIDESCENCE
479	const mat3 XYZ_TO_REC709 = mat3(
480		 3.2404542, -0.9692660,  0.0556434,
481		-1.5371385,  1.8760108, -0.2040259,
482		-0.4985314,  0.0415560,  1.0572252
483	);
484	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
485		vec3 sqrtF0 = sqrt( fresnel0 );
486		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
487	}
488	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
489		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
490	}
491	float IorToFresnel0( float transmittedIor, float incidentIor ) {
492		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
493	}
494	vec3 evalSensitivity( float OPD, vec3 shift ) {
495		float phase = 2.0 * PI * OPD * 1.0e-9;
496		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
497		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
498		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
499		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
500		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
501		xyz /= 1.0685e-7;
502		vec3 rgb = XYZ_TO_REC709 * xyz;
503		return rgb;
504	}
505	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
506		vec3 I;
507		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
508		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
509		float cosTheta2Sq = 1.0 - sinTheta2Sq;
510		if ( cosTheta2Sq < 0.0 ) {
511			return vec3( 1.0 );
512		}
513		float cosTheta2 = sqrt( cosTheta2Sq );
514		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
515		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
516		float T121 = 1.0 - R12;
517		float phi12 = 0.0;
518		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
519		float phi21 = PI - phi12;
520		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
521		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
522		vec3 phi23 = vec3( 0.0 );
523		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
524		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
525		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
526		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
527		vec3 phi = vec3( phi21 ) + phi23;
528		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
529		vec3 r123 = sqrt( R123 );
530		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
531		vec3 C0 = R12 + Rs;
532		I = C0;
533		vec3 Cm = Rs - T121;
534		for ( int m = 1; m <= 2; ++ m ) {
535			Cm *= r123;
536			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
537			I += Cm * Sm;
538		}
539		return max( I, vec3( 0.0 ) );
540	}
541#endif`,bumpmap_pars_fragment:`#ifdef USE_BUMPMAP
542	uniform sampler2D bumpMap;
543	uniform float bumpScale;
544	vec2 dHdxy_fwd() {
545		vec2 dSTdx = dFdx( vBumpMapUv );
546		vec2 dSTdy = dFdy( vBumpMapUv );
547		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
548		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
549		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
550		return vec2( dBx, dBy );
551	}
552	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
553		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
554		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
555		vec3 vN = surf_norm;
556		vec3 R1 = cross( vSigmaY, vN );
557		vec3 R2 = cross( vN, vSigmaX );
558		float fDet = dot( vSigmaX, R1 ) * faceDirection;
559		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
560		return normalize( abs( fDet ) * surf_norm - vGrad );
561	}
562#endif`,clipping_planes_fragment:`#if NUM_CLIPPING_PLANES > 0
563	vec4 plane;
564	#ifdef ALPHA_TO_COVERAGE
565		float distanceToPlane, distanceGradient;
566		float clipOpacity = 1.0;
567		#pragma unroll_loop_start
568		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
569			plane = clippingPlanes[ i ];
570			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
571			distanceGradient = fwidth( distanceToPlane ) / 2.0;
572			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
573			if ( clipOpacity == 0.0 ) discard;
574		}
575		#pragma unroll_loop_end
576		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
577			float unionClipOpacity = 1.0;
578			#pragma unroll_loop_start
579			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
580				plane = clippingPlanes[ i ];
581				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
582				distanceGradient = fwidth( distanceToPlane ) / 2.0;
583				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
584			}
585			#pragma unroll_loop_end
586			clipOpacity *= 1.0 - unionClipOpacity;
587		#endif
588		diffuseColor.a *= clipOpacity;
589		if ( diffuseColor.a == 0.0 ) discard;
590	#else
591		#pragma unroll_loop_start
592		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
593			plane = clippingPlanes[ i ];
594			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
595		}
596		#pragma unroll_loop_end
597		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
598			bool clipped = true;
599			#pragma unroll_loop_start
600			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
601				plane = clippingPlanes[ i ];
602				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
603			}
604			#pragma unroll_loop_end
605			if ( clipped ) discard;
606		#endif
607	#endif
608#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0
609	varying vec3 vClipPosition;
610	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
611#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0
612	varying vec3 vClipPosition;
613#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0
614	vClipPosition = - mvPosition.xyz;
615#endif`,color_fragment:`#if defined( USE_COLOR
615 ) || defined( USE_COLOR_ALPHA )
616	diffuseColor *= vColor;
617#endif`,color_pars_fragment:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
618	varying vec4 vColor;
619#endif`,color_pars_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
620	varying vec4 vColor;
621#endif`,color_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
622	vColor = vec4( 1.0 );
623#endif
624#ifdef USE_COLOR_ALPHA
625	vColor *= color;
626#elif defined( USE_COLOR )
627	vColor.rgb *= color;
628#endif
629#ifdef USE_INSTANCING_COLOR
630	vColor.rgb *= instanceColor.rgb;
631#endif
632#ifdef USE_BATCHING_COLOR
633	vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
634#endif`,common:`#define PI 3.141592653589793
635#define PI2 6.283185307179586
636#define PI_HALF 1.5707963267948966
637#define RECIPROCAL_PI 0.3183098861837907
638#define RECIPROCAL_PI2 0.15915494309189535
639#define EPSILON 1e-6
640#ifndef saturate
641#define saturate( a ) clamp( a, 0.0, 1.0 )
642#endif
643#define whiteComplement( a ) ( 1.0 - saturate( a ) )
644float pow2( const in float x ) { return x*x; }
645vec3 pow2( const in vec3 x ) { return x*x; }
646float pow3( const in float x ) { return x*x*x; }
647float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
648float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
649float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
650highp float rand( const in vec2 uv ) {
651	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
652	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
653	return fract( sin( sn ) * c );
654}
655#ifdef HIGH_PRECISION
656	float precisionSafeLength( vec3 v ) { return length( v ); }
657#else
658	float precisionSafeLength( vec3 v ) {
659		float maxComponent = max3( abs( v ) );
660		return length( v / maxComponent ) * maxComponent;
661	}
662#endif
663struct IncidentLight {
664	vec3 color;
665	vec3 direction;
666	bool visible;
667};
668struct ReflectedLight {
669	vec3 directDiffuse;
670	vec3 directSpecular;
671	vec3 indirectDiffuse;
672	vec3 indirectSpecular;
673};
674#ifdef USE_ALPHAHASH
675	varying vec3 vPosition;
676#endif
677vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
678	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
679}
680#define inverseTransformDirection transformDirectionByInverseViewMatrix
681vec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) {
682	return normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz );
683}
684vec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) {
685	return normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz );
686}
687bool isPerspectiveMatrix( mat4 m ) {
688	return m[ 2 ][ 3 ] == - 1.0;
689}
690vec2 equirectUv( in vec3 dir ) {
691	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
692	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
693	return vec2( u, v );
694}
695vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
696	return RECIPROCAL_PI * diffuseColor;
697}
698vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
699	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
700	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
701}
702float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
703	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
704	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
705} // validated`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV
706	#define cubeUV_minMipLevel 4.0
707	#define cubeUV_minTileSize 16.0
708	float getFace( vec3 direction ) {
709		vec3 absDirection = abs( direction );
710		float face = - 1.0;
711		if ( absDirection.x > absDirection.z ) {
712			if ( absDirection.x > absDirection.y )
713				face = direction.x > 0.0 ? 0.0 : 3.0;
714			else
715				face = direction.y > 0.0 ? 1.0 : 4.0;
716		} else {
717			if ( absDirection.z > absDirection.y )
718				face = direction.z > 0.0 ? 2.0 : 5.0;
719			else
720				face = direction.y > 0.0 ? 1.0 : 4.0;
721		}
722		return face;
723	}
724	vec2 getUV( vec3 direction, float face ) {
725		vec2 uv;
726		if ( face == 0.0 ) {
727			uv = vec2( direction.z, direction.y ) / abs( direction.x );
728		} else if ( face == 1.0 ) {
729			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
730		} else if ( face == 2.0 ) {
731			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
732		} else if ( face == 3.0 ) {
733			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
734		} else if ( face == 4.0 ) {
735			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
736		} else {
737			uv = vec2( direction.x, direction.y ) / abs( direction.z );
738		}
739		return 0.5 * ( uv + 1.0 );
740	}
741	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
742		float face = getFace( direction );
743		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
744		mipInt = max( mipInt, cubeUV_minMipLevel );
745		float faceSize = exp2( mipInt );
746		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
747		if ( face > 2.0 ) {
748			uv.y += faceSize;
749			face -= 3.0;
750		}
751		uv.x += face * faceSize;
752		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
753		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
754		uv.x *= CUBEUV_TEXEL_WIDTH;
755		uv.y *= CUBEUV_TEXEL_HEIGHT;
756		#ifdef texture2DGradEXT
757			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
758		#else
759			return texture2D( envMap, uv ).rgb;
760		#endif
761	}
762	#define cubeUV_r0 1.0
763	#define cubeUV_m0 - 2.0
764	#define cubeUV_r1 0.8
765	#define cubeUV_m1 - 1.0
766	#define cubeUV_r4 0.4
767	#define cubeUV_m4 2.0
768	#define cubeUV_r5 0.305
769	#define cubeUV_m5 3.0
770	#define cubeUV_r6 0.21
771	#define cubeUV_m6 4.0
772	float roughnessToMip( float roughness ) {
773		float mip = 0.0;
774		if ( roughness >= cubeUV_r1 ) {
775			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
776		} else if ( roughness >= cubeUV_r4 ) {
777			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
778		} else if ( roughness >= cubeUV_r5 ) {
779			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
780		} else if ( roughness >= cubeUV_r6 ) {
781			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
782		} else {
783			mip = - 2.0 * log2( 1.16 * roughness );		}
784		return mip;
785	}
786	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
787		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
788		float mipF = fract( mip );
789		float mipInt = floor( mip );
790		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
791		if ( mipF == 0.0 ) {
792			return vec4( color0, 1.0 );
793		} else {
794			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
795			return vec4( mix( color0, color1, mipF ), 1.0 );
796		}
797	}
798#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal;
799#ifdef USE_TANGENT
800	vec3 transformedTangent = objectTangent;
801#endif
802#ifdef USE_BATCHING
803	mat3 bm = mat3( batchingMatrix );
804	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
805	transformedNormal = bm * transformedNormal;
806	#ifdef USE_TANGENT
807		transformedTangent = bm * transformedTangent;
808	#endif
809#endif
810#ifdef USE_INSTANCING
811	mat3 im = mat3( instanceMatrix );
812	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
813	transformedNormal = im * transformedNormal;
814	#ifdef USE_TANGENT
815		transformedTangent = im * transformedTangent;
816	#endif
817#endif
818transformedNormal = normalMatrix * transformedNormal;
819#ifdef FLIP_SIDED
820	transformedNormal = - transformedNormal;
821#endif
822#ifdef USE_TANGENT
823	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
824#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP
825	uniform sampler2D displacementMap;
826	uniform float displacementScale;
827	uniform float displacementBias;
828#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP
829	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
830#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP
831	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
832	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
833		emissiveColor = sRGBTransferEOTF( emissiveColor );
834	#endif
835	totalEmissiveRadiance *= emissiveColor.rgb;
836#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP
837	uniform sampler2D emissiveMap;
838#endif`,colorspace_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,colorspace_pars_fragment:`vec4 LinearTransferOETF( in vec4 value ) {
839	return value;
840}
841vec4 sRGBTransferEOTF( in vec4 value ) {
842	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
843}
844vec4 sRGBTransferOETF( in vec4 value ) {
845	return 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 );
846}`,envmap_fragment:`#ifdef USE_ENVMAP
847	#ifdef ENV_WORLDPOS
848		vec3 cameraToFrag;
849		if ( isOrthographic ) {
850			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
851		} else {
852			cameraToFrag = normalize( vWorldPosition - cameraPosition );
853		}
854		vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
855		#ifdef ENVMAP_MODE_REFLECTION
856			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
857		#else
858			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
859		#endif
860	#else
861		vec3 reflectVec = vReflect;
862	#endif
863	#ifdef ENVMAP_TYPE_CUBE
864		vec4 envColor = textureCube( envMap, envMapRotation * reflectVec );
865		#ifdef ENVMAP_BLENDING_MULTIPLY
866			outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
867		#elif defined( ENVMAP_BLENDING_MIX )
868			outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
869		#elif defined( ENVMAP_BLENDING_ADD )
870			outgoingLight += envColor.xyz * specularStrength * reflectivity;
871		#endif
872	#endif
873#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP
874	uniform float envMapIntensity;
875	uniform mat3 envMapRotation;
876	#ifdef ENVMAP_TYPE_CUBE
877		uniform samplerCube envMap;
878	#else
879		uniform sampler2D envMap;
880	#endif
881#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP
882	uniform float reflectivity;
883	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
884		#define ENV_WORLDPOS
885	#endif
886	#ifdef ENV_WORLDPOS
887		varying vec3 vWorldPosition;
888		uniform float refractionRatio;
889	#else
890		varying vec3 vReflect;
891	#endif
892#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP
893	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
894		#define ENV_WORLDPOS
895	#endif
896	#ifdef ENV_WORLDPOS
897		
898		varying vec3 vWorldPosition;
899	#else
900		varying vec3 vReflect;
901		uniform float refractionRatio;
902	#endif
903#endif`,envmap_physical_pars_fragment:`#ifdef USE_ENVMAP
904	vec3 getIBLIrradiance( const in vec3 normal ) {
905		#ifdef ENVMAP_TYPE_CUBE_UV
906			vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
907			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
908			return PI * envMapColor.rgb * envMapIntensity;
909		#else
910			return vec3( 0.0 );
911		#endif
912	}
913	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
914		#ifdef ENVMAP_TYPE_CUBE_UV
915			vec3 reflectVec = reflect( - viewDir, normal );
916			reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
917			reflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix );
918			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
919			return envMapColor.rgb * envMapIntensity;
920		#else
921			return vec3( 0.0 );
922		#endif
923	}
924	#ifdef USE_ANISOTROPY
925		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
926			#ifdef ENVMAP_TYPE_CUBE_UV
927				vec3 bentNormal = cross( bitangent, viewDir );
928				bentNormal = normalize( cross( bentNormal, bitangent ) );
929				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
930				return getIBLRadiance( viewDir, bentNormal, roughness );
931			#else
932				return vec3( 0.0 );
933			#endif
934		}
935	#endif
936#endif`,envmap_vertex:`#ifdef USE_ENVMAP
937	#ifdef ENV_WORLDPOS
938		vWorldPosition = worldPosition.xyz;
939	#else
940		vec3 cameraToVertex;
941		if ( isOrthographic ) {
942			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
943		} else {
944			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
945		}
946		vec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );
947		#ifdef ENVMAP_MODE_REFLECTION
948			vReflect = reflect( cameraToVertex, worldNormal );
949		#else
950			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
951		#endif
952	#endif
953#endif`,fog_vertex:`#ifdef USE_FOG
954	vFogDepth = - mvPosition.z;
955#endif`,fog_pars_vertex:`#ifdef USE_FOG
956	varying float vFogDepth;
957#endif`,fog_fragment:`#ifdef USE_FOG
958	#ifdef FOG_EXP2
959		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
960	#else
961		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
962	#endif
963	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
964#endif`,fog_pars_fragment:`#ifdef USE_FOG
965	uniform vec3 fogColor;
966	varying float vFogDepth;
967	#ifdef FOG_EXP2
968		uniform float fogDensity;
969	#else
970		uniform float fogNear;
971		uniform float fogFar;
972	#endif
973#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP
974	uniform sampler2D gradientMap;
975#endif
976vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
977	float dotNL = dot( normal, lightDirection );
978	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
979	#ifdef USE_GRADIENTMAP
980		return vec3( texture2D( gradientMap, coord ).r );
981	#else
982		vec2 fw = fwidth( coord ) * 0.5;
983		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
984	#endif
985}`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP
986	uniform sampler2D lightMap;
987	uniform float lightMapIntensity;
988#endif`,lights_lambert_fragment:`LambertMaterial material;
989material.diffuseColor = diffuseColor.rgb;
990material.specularStrength = specularStrength;`,lights_lambert_pars_fragment:`varying vec3 vViewPosition;
991struct LambertMaterial {
992	vec3 diffuseColor;
993	float specularStrength;
994};
995void 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 ) {
996	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
997	vec3 irradiance = dotNL * directLight.color;
998	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
999}
1000void 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 ) {
1001	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1002}
1003#define RE_Direct				RE_Direct_Lambert
1004#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,lights_pars_begin:`uniform bool receiveShadow;
1005uniform vec3 ambientLightColor;
1006#if defined( USE_LIGHT_PROBES )
1007	uniform vec3 lightProbe[ 9 ];
1008#endif
1009vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
1010	float x = normal.x, y = normal.y, z = normal.z;
1011	vec3 result = shCoefficients[ 0 ] * 0.886227;
1012	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
1013	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
1014	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
1015	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
1016	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
1017	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
1018	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
1019	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
1020	return result;
1021}
1022vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
1023	vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
1024	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
1025	return irradiance;
1026}
1027vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
1028	vec3 irradiance = ambientLightColor;
1029	return irradiance;
1030}
1031float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
1032	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
1033	if ( cutoffDistance > 0.0 ) {
1034		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
1035	}
1036	return distanceFalloff;
1037}
1038float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
1039	return smoothstep( coneCosine, penumbraCosine, angleCosine );
1040}
1041#if NUM_DIR_LIGHTS > 0
1042	struct DirectionalLight {
1043		vec3 direction;
1044		vec3 color;
1045	};
1046	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
1047	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
1048		light.color = directionalLight.color;
1049		light.direction = directionalLight.direction;
1050		light.visible = true;
1051	}
1052#endif
1053#if NUM_POINT_LIGHTS > 0
1054	struct PointLight {
1055		vec3 position;
1056		vec3 color;
1057		float distance;
1058		float decay;
1059	};
1060	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
1061	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
1062		vec3 lVector = pointLight.position - geometryPosition;
1063		light.direction = normalize( lVector );
1064		float lightDistance = length( lVector );
1065		light.color = pointLight.color;
1066		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
1067		light.visible = ( light.color != vec3( 0.0 ) );
1068	}
1069#endif
1070#if NUM_SPOT_LIGHTS > 0
1071	struct SpotLight {
1072		vec3 position;
1073		vec3 direction;
1074		vec3 color;
1075		float distance;
1076		float decay;
1077		float coneCos;
1078		float penumbraCos;
1079	};
1080	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
1081	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
1082		vec3 lVector = spotLight.position - geometryPosition;
1083		light.direction = normalize( lVector );
1084		float angleCos = dot( light.direction, spotLight.direction );
1085		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
1086		if ( spotAttenuation > 0.0 ) {
1087			float lightDistance = length( lVector );
1088			light.color = spotLight.color * spotAttenuation;
1089			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
1090			light.visible = ( light.color != vec3( 0.0 ) );
1091		} else {
1092			light.color = vec3( 0.0 );
1093			light.visible = false;
1094		}
1095	}
1096#endif
1097#if NUM_RECT_AREA_LIGHTS > 0
1098	struct RectAreaLight {
1099		vec3 color;
1100		vec3 position;
1101		vec3 halfWidth;
1102		vec3 halfHeight;
1103	};
1104	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
1105	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
1106#endif
1107#if NUM_HEMI_LIGHTS > 0
1108	struct HemisphereLight {
1109		vec3 direction;
1110		vec3 skyColor;
1111		vec3 groundColor;
1112	};
1113	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
1114	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
1115		float dotNL = dot( normal, hemiLight.direction );
1116		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
1117		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
1118		return irradiance;
1119	}
1120#endif
1121#include <lightprobes_pars_fragment>`,lights_toon_fragment:`ToonMaterial material;
1122material.diffuseColor = diffuseColor.rgb;`,lights_toon_pars_fragment:`varying vec3 vViewPosition;
1123struct ToonMaterial {
1124	vec3 diffuseColor;
1125};
1126void 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 ) {
1127	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
1128	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1129}
1130void 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 ) {
1131	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1132}
1133#define RE_Direct				RE_Direct_Toon
1134#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,lights_phong_fragment:`BlinnPhongMaterial material;
1135material.diffuseColor = diffuseColor.rgb;
1136material.specularColor = specular;
1137material.specularShininess = shininess;
1138material.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition;
1139struct BlinnPhongMaterial {
1140	vec3 diffuseColor;
1141	vec3 specularColor;
1142	float specularShininess;
1143	float specularStrength;
1144};
1145void 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 ) {
1146	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1147	vec3 irradiance = dotNL * directLight.color;
1148	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1149	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
1150}
1151void 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 ) {
1152	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1153}
1154#define RE_Direct				RE_Direct_BlinnPhong
1155#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,lights_physical_fragment:`PhysicalMaterial material;
1156material.diffuseColor = diffuseColor.rgb;
1157material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
1158material.metalness = metalnessFactor;
1159vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
1160float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
1161material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
1162material.roughness = min( material.roughness, 1.0 );
1163#ifdef IOR
1164	material.ior = ior;
1165	#ifdef USE_SPECULAR
1166		float specularIntensityFactor = specularIntensity;
1167		vec3 specularColorFactor = specularColor;
1168		#ifdef USE_SPECULAR_COLORMAP
1169			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
1170		#endif
1171		#ifdef USE_SPECULAR_INTENSITYMAP
1172			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
1173		#endif
1174		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
1175	#else
1176		float specularIntensityFactor = 1.0;
1177		vec3 specularColorFactor = vec3( 1.0 );
1178		material.specularF90 = 1.0;
1179	#endif
1180	material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;
1181	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
1182#else
1183	material.specularColor = vec3( 0.04 );
1184	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
1185	material.specularF90 = 1.0;
1186#endif
1187#ifdef USE_CLEARCOAT
1188	material.clearcoat = clearcoat;
1189	material.clearcoatRoughness = clearcoatRoughness;
1190	material.clearcoatF0 = vec3( 0.04 );
1191	material.clearcoatF90 = 1.0;
1192	#ifdef USE_CLEARCOATMAP
1193		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
1194	#endif
1195	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1196		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
1197	#endif
1198	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
1199	material.clearcoatRoughness += geometryRoughness;
1200	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
1201#endif
1202#ifdef USE_DISPERSION
1203	material.dispersion = dispersion;
1204#endif
1205#ifdef USE_IRIDESCENCE
1206	material.iridescence = iridescence;
1207	material.iridescenceIOR = iridescenceIOR;
1208	#ifdef USE_IRIDESCENCEMAP
1209		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
1210	#endif
1211	#ifdef USE_IRIDESCENCE_THICKNESSMAP
1212		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
1213	#else
1214		material.iridescenceThickness = iridescenceThicknessMaximum;
1215	#endif
1216#endif
1217#ifdef USE_SHEEN
1218	material.sheenColor = sheenColor;
1219	#ifdef USE_SHEEN_COLORMAP
1220		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
1221	#endif
1222	material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );
1223	#ifdef USE_SHEEN_ROUGHNESSMAP
1224		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
1225	#endif
1226#endif
1227#ifdef USE_ANISOTROPY
1228	#ifdef USE_ANISOTROPYMAP
1229		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
1230		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
1231		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
1232	#else
1233		vec2 anisotropyV = anisotropyVector;
1234	#endif
1235	material.anisotropy = length( anisotropyV );
1236	if( material.anisotropy == 0.0 ) {
1237		anisotropyV = vec2( 1.0, 0.0 );
1238	} else {
1239		anisotropyV /= material.anisotropy;
1240		material.anisotropy = saturate( material.anisotropy );
1241	}
1242	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
1243	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
1244	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
1245#endif`,lights_physical_pars_fragment:`uniform sampler2D dfgLUT;
1246struct PhysicalMaterial {
1247	vec3 diffuseColor;
1248	vec3 diffuseContribution;
1249	vec3 specularColor;
1250	vec3 specularColorBlended;
1251	float roughness;
1252	float metalness;
1253	float specularF90;
1254	float dispersion;
1255	#ifdef USE_CLEARCOAT
1256		float clearcoat;
1257		float clearcoatRoughness;
1258		vec3 clearcoatF0;
1259		float clearcoatF90;
1260	#endif
1261	#ifdef USE_IRIDESCENCE
1262		float iridescence;
1263		float iridescenceIOR;
1264		float iridescenceThickness;
1265		vec3 iridescenceFresnel;
1266		vec3 iridescenceF0;
1267		vec3 iridescenceFresnelDielectric;
1268		vec3 iridescenceFresnelMetallic;
1269	#endif
1270	#ifdef USE_SHEEN
1271		vec3 sheenColor;
1272		float sheenRoughness;
1273	#endif
1274	#ifdef IOR
1275		float ior;
1276	#endif
1277	#ifdef USE_TRANSMISSION
1278		float transmission;
1279		float transmissionAlpha;
1280		float thickness;
1281		float attenuationDistance;
1282		vec3 attenuationColor;
1283	#endif
1284	#ifdef USE_ANISOTROPY
1285		float anisotropy;
1286		float alphaT;
1287		vec3 anisotropyT;
1288		vec3 anisotropyB;
1289	#endif
1290};
1291vec3 clearcoatSpecularDirect = vec3( 0.0 );
1292vec3 clearcoatSpecularIndirect = vec3( 0.0 );
1293vec3 sheenSpecularDirect = vec3( 0.0 );
1294vec3 sheenSpecularIndirect = vec3(0.0 );
1295vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
1296    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
1297    float x2 = x * x;
1298    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
1299    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
1300}
1301float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
1302	float a2 = pow2( alpha );
1303	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
1304	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
1305	return 0.5 / max( gv + gl, EPSILON );
1306}
1307float D_GGX( const in float alpha, const in float dotNH ) {
1308	float a2 = pow2( alpha );
1309	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
1310	return RECIPROCAL_PI * a2 / pow2( denom );
1311}
1312#ifdef USE_ANISOTROPY
1313	float 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 ) {
1314		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
1315		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
1316		return 0.5 / max( gv + gl, EPSILON )
vendor: 3,169 bytes, lines 1316-1391
1316;
1317	}
1318	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
1319		float a2 = alphaT * alphaB;
1320		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
1321		highp float v2 = dot( v, v );
1322		float w2 = a2 / v2;
1323		return RECIPROCAL_PI * a2 * pow2 ( w2 );
1324	}
1325#endif
1326#ifdef USE_CLEARCOAT
1327	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
1328		vec3 f0 = material.clearcoatF0;
1329		float f90 = material.clearcoatF90;
1330		float roughness = material.clearcoatRoughness;
1331		float alpha = pow2( roughness );
1332		vec3 halfDir = normalize( lightDir + viewDir );
1333		float dotNL = saturate( dot( normal, lightDir ) );
1334		float dotNV = saturate( dot( normal, viewDir ) );
1335		float dotNH = saturate( dot( normal, halfDir ) );
1336		float dotVH = saturate( dot( viewDir, halfDir ) );
1337		vec3 F = F_Schlick( f0, f90, dotVH );
1338		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1339		float D = D_GGX( alpha, dotNH );
1340		return F * ( V * D );
1341	}
1342#endif
1343vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1344	vec3 f0 = material.specularColorBlended;
1345	float f90 = material.specularF90;
1346	float roughness = material.roughness;
1347	float alpha = pow2( roughness );
1348	vec3 halfDir = normalize( lightDir + viewDir );
1349	float dotNL = saturate( dot( normal, lightDir ) );
1350	float dotNV = saturate( dot( normal, viewDir ) );
1351	float dotNH = saturate( dot( normal, halfDir ) );
1352	float dotVH = saturate( dot( viewDir, halfDir ) );
1353	vec3 F = F_Schlick( f0, f90, dotVH );
1354	#ifdef USE_IRIDESCENCE
1355		F = mix( F, material.iridescenceFresnel, material.iridescence );
1356	#endif
1357	#ifdef USE_ANISOTROPY
1358		float dotTL = dot( material.anisotropyT, lightDir );
1359		float dotTV = dot( material.anisotropyT, viewDir );
1360		float dotTH = dot( material.anisotropyT, halfDir );
1361		float dotBL = dot( material.anisotropyB, lightDir );
1362		float dotBV = dot( material.anisotropyB, viewDir );
1363		float dotBH = dot( material.anisotropyB, halfDir );
1364		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1365		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1366	#else
1367		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1368		float D = D_GGX( alpha, dotNH );
1369	#endif
1370	return F * ( V * D );
1371}
1372vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1373	const float LUT_SIZE = 64.0;
1374	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1375	const float LUT_BIAS = 0.5 / LUT_SIZE;
1376	float dotNV = saturate( dot( N, V ) );
1377	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1378	uv = uv * LUT_SCALE + LUT_BIAS;
1379	return uv;
1380}
1381float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1382	float l = length( f );
1383	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1384}
1385vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1386	float x = dot( v1, v2 );
1387	float y = abs( x );
1388	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1389	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1390	float v = a / b;
1391	float theta_sintheta = ( x >
vendor: 4,203 bytes, lines 1391-1475
1391 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1392	return cross( v1, v2 ) * theta_sintheta;
1393}
1394vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1395	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1396	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1397	vec3 lightNormal = cross( v1, v2 );
1398	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1399	vec3 T1, T2;
1400	T1 = normalize( V - N * dot( V, N ) );
1401	T2 = - cross( N, T1 );
1402	mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
1403	vec3 coords[ 4 ];
1404	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1405	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1406	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1407	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1408	coords[ 0 ] = normalize( coords[ 0 ] );
1409	coords[ 1 ] = normalize( coords[ 1 ] );
1410	coords[ 2 ] = normalize( coords[ 2 ] );
1411	coords[ 3 ] = normalize( coords[ 3 ] );
1412	vec3 vectorFormFactor = vec3( 0.0 );
1413	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1414	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1415	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1416	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1417	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1418	return vec3( result );
1419}
1420#if defined( USE_SHEEN )
1421float D_Charlie( float roughness, float dotNH ) {
1422	float alpha = pow2( roughness );
1423	float invAlpha = 1.0 / alpha;
1424	float cos2h = dotNH * dotNH;
1425	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1426	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1427}
1428float V_Neubelt( float dotNV, float dotNL ) {
1429	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1430}
1431vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1432	vec3 halfDir = normalize( lightDir + viewDir );
1433	float dotNL = saturate( dot( normal, lightDir ) );
1434	float dotNV = saturate( dot( normal, viewDir ) );
1435	float dotNH = saturate( dot( normal, halfDir ) );
1436	float D = D_Charlie( sheenRoughness, dotNH );
1437	float V = V_Neubelt( dotNV, dotNL );
1438	return sheenColor * ( D * V );
1439}
1440#endif
1441float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1442	float dotNV = saturate( dot( normal, viewDir ) );
1443	float r2 = roughness * roughness;
1444	float rInv = 1.0 / ( roughness + 0.1 );
1445	float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;
1446	float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;
1447	float DG = exp( a * dotNV + b );
1448	return saturate( DG );
1449}
1450vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1451	float dotNV = saturate( dot( normal, viewDir ) );
1452	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1453	return specularColor * fab.x + specularF90 * fab.y;
1454}
1455#ifdef USE_IRIDESCENCE
1456void 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 ) {
1457#else
1458void 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 ) {
1459#endif
1460	float dotNV = saturate( dot( normal, viewDir ) );
1461	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1462	#ifdef USE_IRIDESCENCE
1463		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1464	#else
1465		vec3 Fr = specularColor;
1466	#endif
1467	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1468	float Ess = fab.x + fab.y;
1469	float Ems = 1.0 - Ess;
1470	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1471	singleScatter += FssEss;
1472	multiScatter += Fms * Ems;
1473}
1474vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1475	vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 6,009 bytes, lines 1476-1574
1476	float dotNL = saturate( dot( normal, lightDir ) );
1477	float dotNV = saturate( dot( normal, viewDir ) );
1478	vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;
1479	vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;
1480	vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;
1481	vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;
1482	float Ess_V = dfgV.x + dfgV.y;
1483	float Ess_L = dfgL.x + dfgL.y;
1484	float Ems_V = 1.0 - Ess_V;
1485	float Ems_L = 1.0 - Ess_L;
1486	vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;
1487	vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );
1488	float compensationFactor = Ems_V * Ems_L;
1489	vec3 multiScatter = Fms * compensationFactor;
1490	return singleScatter + multiScatter;
1491}
1492#if NUM_RECT_AREA_LIGHTS > 0
1493	void 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 ) {
1494		vec3 normal = geometryNormal;
1495		vec3 viewDir = geometryViewDir;
1496		vec3 position = geometryPosition;
1497		vec3 lightPos = rectAreaLight.position;
1498		vec3 halfWidth = rectAreaLight.halfWidth;
1499		vec3 halfHeight = rectAreaLight.halfHeight;
1500		vec3 lightColor = rectAreaLight.color;
1501		float roughness = material.roughness;
1502		vec3 rectCoords[ 4 ];
1503		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1504		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1505		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1506		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1507		vec4 t1 = texture2D( ltc_1, uv );
1508		vec4 t2 = texture2D( ltc_2, uv );
1509		mat3 mInv = mat3(
1510			vec3( t1.x, 0, t1.y ),
1511			vec3(    0, 1,    0 ),
1512			vec3( t1.z, 0, t1.w )
1513		);
1514		vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );
1515		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1516		reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1517		#ifdef USE_CLEARCOAT
1518			vec3 Ncc = geometryClearcoatNormal;
1519			vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );
1520			vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );
1521			vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );
1522			mat3 mInvClearcoat = mat3(
1523				vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),
1524				vec3(             0, 1,             0 ),
1525				vec3( t1Clearcoat.z, 0, t1Clearcoat.w )
1526			);
1527			vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;
1528			clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );
1529		#endif
1530	}
1531#endif
1532void 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 ) {
1533	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1534	vec3 irradiance = dotNL * directLight.color;
1535	#ifdef USE_CLEARCOAT
1536		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1537		vec3 ccIrradiance = dotNLcc * directLight.color;
1538		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1539	#endif
1540	#ifdef USE_SHEEN
1541 
1542 		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1543 
1544 		float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1545 		float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );
1546 
1547 		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );
1548 
1549 		irradiance *= sheenEnergyComp;
1550 
1551 	#endif
1552	reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
1553	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );
1554}
1555void 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 ) {
1556	vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );
1557	#ifdef USE_SHEEN
1558		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1559		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1560		diffuse *= sheenEnergyComp;
1561	#endif
1562	reflectedLight.indirectDiffuse += diffuse;
1563}
1564void 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) {
1565	#ifdef USE_CLEARCOAT
1566		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1567	#endif
1568	#ifdef USE_SHEEN
1569		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;
1570 	#endif
1571	vec3 singleScatteringDielectric = vec3( 0.0 );
1572	vec3 multiScatteringDielectric = vec3( 0.0 );
1573	vec3 singleScatteringMetallic = vec3( 0.0 );
1574	vec3 multiScatteringMetallic = vec3( 0.0 );
vendor: 8,137 bytes, lines 1575-1717
1575	#ifdef USE_IRIDESCENCE
1576		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1577		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1578	#else
1579		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1580		computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1581	#endif
1582	vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );
1583	vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );
1584	vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;
1585	vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );
1586	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1587	vec3 indirectSpecular = radiance * singleScattering;
1588	indirectSpecular += multiScattering * cosineWeightedIrradiance;
1589	vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;
1590	#ifdef USE_SHEEN
1591		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1592		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1593		indirectSpecular *= sheenEnergyComp;
1594		indirectDiffuse *= sheenEnergyComp;
1595	#endif
1596	reflectedLight.indirectSpecular += indirectSpecular;
1597	reflectedLight.indirectDiffuse += indirectDiffuse;
1598}
1599#define RE_Direct				RE_Direct_Physical
1600#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1601#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1602#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1603float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1604	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1605}`,lights_fragment_begin:`
1606vec3 geometryPosition = - vViewPosition;
1607vec3 geometryNormal = normal;
1608vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1609vec3 geometryClearcoatNormal = vec3( 0.0 );
1610#ifdef USE_CLEARCOAT
1611	geometryClearcoatNormal = clearcoatNormal;
1612#endif
1613#ifdef USE_IRIDESCENCE
1614	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1615	if ( material.iridescenceThickness == 0.0 ) {
1616		material.iridescence = 0.0;
1617	} else {
1618		material.iridescence = saturate( material.iridescence );
1619	}
1620	if ( material.iridescence > 0.0 ) {
1621		material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1622		material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );
1623		material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );
1624		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1625	}
1626#endif
1627IncidentLight directLight;
1628#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1629	PointLight pointLight;
1630	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1631	PointLightShadow pointLightShadow;
1632	#endif
1633	#pragma unroll_loop_start
1634	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1635		pointLight = pointLights[ i ];
1636		getPointLightInfo( pointLight, geometryPosition, directLight );
1637		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
1638		pointLightShadow = pointLightShadows[ i ];
1639		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1640		#endif
1641		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1642	}
1643	#pragma unroll_loop_end
1644#endif
1645#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1646	SpotLight spotLight;
1647	vec4 spotColor;
1648	vec3 spotLightCoord;
1649	bool inSpotLightMap;
1650	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1651	SpotLightShadow spotLightShadow;
1652	#endif
1653	#pragma unroll_loop_start
1654	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1655		spotLight = spotLights[ i ];
1656		getSpotLightInfo( spotLight, geometryPosition, directLight );
1657		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1658		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1659		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1660		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1661		#else
1662		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1663		#endif
1664		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1665			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1666			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1667			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1668			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1669		#endif
1670		#undef SPOT_LIGHT_MAP_INDEX
1671		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1672		spotLightShadow = spotLightShadows[ i ];
1673		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1674		#endif
1675		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1676	}
1677	#pragma unroll_loop_end
1678#endif
1679#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1680	DirectionalLight directionalLight;
1681	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1682	DirectionalLightShadow directionalLightShadow;
1683	#endif
1684	#pragma unroll_loop_start
1685	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1686		directionalLight = directionalLights[ i ];
1687		getDirectionalLightInfo( directionalLight, directLight );
1688		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1689		directionalLightShadow = directionalLightShadows[ i ];
1690		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1691		#endif
1692		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1693	}
1694	#pragma unroll_loop_end
1695#endif
1696#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1697	RectAreaLight rectAreaLight;
1698	#pragma unroll_loop_start
1699	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1700		rectAreaLight = rectAreaLights[ i ];
1701		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1702	}
1703	#pragma unroll_loop_end
1704#endif
1705#if defined( RE_IndirectDiffuse )
1706	vec3 iblIrradiance = vec3( 0.0 );
1707	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1708	#if defined( USE_LIGHT_PROBES )
1709		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1710	#endif
1711	#if ( NUM_HEMI_LIGHTS > 0 )
1712		#pragma unroll_loop_start
1713		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1714			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1715		}
1716		#pragma unroll_loop_end
1717	#endif
1718	#ifdef USE_LIGHT_PROBES_GRID
1719		vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;
1720		vec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix );
1721		irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );
1722	#endif
1723#endif
1724#if defined( RE_IndirectSpecular )
1725	vec3 radiance = vec3( 0.0 );
1726	vec3 clearcoatRadiance = vec3( 0.0 );
1727#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse )
1728	#ifdef USE_LIGHTMAP
1729		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1730		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1731		irradiance += lightMapIrradiance;
1732	#endif
1733	#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )
1734		#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )
1735			iblIrradiance += getIBLIrradiance( geometryNormal );
1736		#endif
1737	#endif
1738#endif
1739#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1740	#ifdef USE_ANISOTROPY
1741		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1742	#else
1743		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1744	#endif
1745	#ifdef USE_CLEARCOAT
1746		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1747	#endif
1748#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse )
1749	#if defined( LAMBERT ) || defined( PHONG )
1750		irradiance += iblIrradiance;
1751	#endif
1752	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1753#endif
1754#if defined( RE_IndirectSpecular )
1755	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1756#endif`,lightprobes_pars_fragment:`#ifdef USE_LIGHT_PROBES_GRID
1757uniform highp sampler3D probesSH;
1758uniform vec3 probesMin;
1759uniform vec3 probesMax;
1760uniform vec3 probesResolution;
1761vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1762	vec3 res = probesResolution;
1763	vec3 gridRange = probesMax - probesMin;
1764	vec3 resMinusOne = res - 1.0;
1765	vec3 probeSpacing = gridRange / resMinusOne;
1766	vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;
1767	vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );
1768	uvw = uvw * resMinusOne / res + 0.5 / res;
1769	float nz          = res.z;
1770	float paddedSlices = nz + 2.0;
1771	float atlasDepth  = 7.0 * paddedSlices;
1772	float uvZBase     = uvw.z * nz + 1.0;
1773	vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase                       ) / atlasDepth ) );
1774	vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase +       paddedSlices   ) / atlasDepth ) );
1775	vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices   ) / atlasDepth ) );
1776	vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices   ) / atlasDepth ) );
1777	vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices   ) / atlasDepth ) );
1778	vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices   ) / atlasDepth ) );
1779	vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices   ) / atlasDepth ) );
1780	vec3 c0 = s0.xyz;
1781	vec3 c1 = vec3( s0.w, s1.xy );
1782	vec3 c2 = vec3( s1.zw, s2.x );
1783	vec3 c3 = s2.yzw;
1784	vec3 c4 = s3.xyz;
1785	vec3 c5 = vec3( s3.w, s4.xy );
1786	vec3 c6 = vec3( s4.zw, s5.x );
1787	vec3 c7 = s5.yzw;
1788	vec3 c8 = s6.xyz;
1789	float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;
1790	vec3 result = c0 * 0.886227;
1791	result += c1 * 2.0 * 0.511664 * y;
1792	result += c2 * 2.0 * 0.511664 * z;
1793	result += c3 * 2.0 * 0.511664 * x;
1794	result += c4 * 2.0 * 0.429043 * x * y;
1795	result += c5 * 2.0 * 0.429043 * y * z;
1796	result += c6 * ( 0.743125 * z * z - 0.247708 );
1797	result += c7 * 2.0 * 0.429043 * x * z;
1798	result += c8 * 0.429043 * ( x * x - y * y );
1799	return max( result, vec3( 0.0 ) );
1800}
1801#endif`,logdepthbuf_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1802	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1803#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1804	uniform float logDepthBufFC;
1805	varying float vFragDepth;
1806	varying float vIsPerspective;
1807#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1808	varying float vFragDepth;
1809	varying float vIsPerspective;
1810#endif`,logdepthbuf_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1811	vFragDepth = 1.0 + gl_Position.w;
1812	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1813#endif`,map_fragment:`#ifdef USE_MAP
1814	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1815	#ifdef DECODE_VIDEO_TEXTURE
1816		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1817	#endif
1818	diffuseColor *= sampledDiffuseColor;
1819#endif`,map_pars_fragment:`#ifdef USE_MAP
1820	uniform sampler2D map;
1821#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1822	#if defined( USE_POINTS_UV )
1823		vec2 uv = vUv;
1824	#else
1825		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1826	#endif
1827#endif
1828#ifdef USE_MAP
1829	diffuseColor *= texture2D( map, uv );
1830#endif
1831#ifdef USE_ALPHAMAP
1832	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1833#endif`,map_particle_pars_fragment:`#if defined( USE_POINTS_UV )
1834	varying vec2 vUv;
1835#else
1836	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1837		uniform mat3 uvTransform;
1838	#endif
1839#endif
1840#ifdef USE_MAP
1841	uniform sampler2D map;
1842#endif
1843#ifdef USE_ALPHAMAP
1844	uniform sampler2D alphaMap;
1845#endif`,metalnessmap_fragment:`float metalnessFactor = metalness;
1846#ifdef USE_METALNESSMAP
1847	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1848	metalnessFactor *= texelMetalness.b;
1849#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP
1850	uniform sampler2D metalnessMap;
1851#endif`,morphinstance_vertex:`#ifdef USE_INSTANCING_MORPH
1852	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1853	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1854	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1855		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1856	}
1857#endif`,morphcolor_vertex:`#if defined( USE_MORPHCOLORS )
1858	vColor *= morphTargetBaseInfluence;
1859	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1860		#if defined( USE_COLOR_ALPHA )
1861			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1862		#elif defined( USE_COLOR )
1863			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1864		#endif
1865	}
1866#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS
1867	objectNormal *= morphTargetBaseInfluence;
1868	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1869		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1870	}
1871#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS
1872	#ifndef USE_INSTANCING_MORPH
1873		uniform float morphTargetBaseInfluence;
1874		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1875	#endif
1876	uniform sampler2DArray morphTargetsTexture;
1877	uniform ivec2 morphTargetsTextureSize;
1878	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1879		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1880		int y = texelIndex / morphTargetsTextureSize.x;
1881		int x = texelIndex - y * morphTargetsTextureSize.x;
1882		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1883		return texelFetch( morphTargetsTexture, morphUV, 0 );
1884	}
1885#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS
1886	transformed *= morphTargetBaseInfluence;
1887	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1888		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1889	}
1890#endif`,normal_fragment_begin:`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1891#ifdef FLAT_SHADED
1892	vec3 fdx = dFdx( vViewPosition );
1893	vec3 fdy = dFdy( vViewPosition );
1894	vec3 normal = normalize( cross( fdx, fdy ) );
1895#else
1896	vec3 normal = normalize( vNormal );
1897	#ifdef DOUBLE_SIDED
1898		normal *= faceDirection;
1899	#endif
1900#endif
1901#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1902	#ifdef USE_TANGENT
1903		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1904	#else
1905		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1906		#if defined( USE_NORMALMAP )
1907			vNormalMapUv
1908		#elif defined( USE_CLEARCOAT_NORMALMAP )
1909			vClearcoatNormalMapUv
1910		#else
1911			vUv
1912		#endif
1913		);
1914	#endif
1915	#ifdef DOUBLE_SIDED
1916		tbn[0] *= faceDirection;
1917		tbn[1] *= faceDirection;
1918	#endif
1919#endif
1920#ifdef USE_CLEARCOAT_NORMALMAP
1921	#ifdef USE_TANGENT
1922		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1923	#else
1924		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1925	#endif
1926	#ifdef DOUBLE_SIDED
1927		tbn2[0] *= faceDirection;
1928		tbn2[1] *= faceDirection;
1929	#endif
1930#endif
1931vec3 nonPerturbedNormal = normal;`,normal_fragment_maps:`#ifdef USE_NORMALMAP_OBJECTSPACE
1932	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1933	#ifdef FLIP_SIDED
1934		normal = - normal;
1935	#endif
1936	#ifdef DOUBLE_SIDED
1937		normal = normal * faceDirection;
1938	#endif
1939	normal = normalize( normalMatrix * normal );
1940#elif defined( USE_NORMALMAP_TANGENTSPACE )
1941	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1942	#if defined( USE_PACKED_NORMALMAP )
1943		mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );
1944	#endif
1945	mapN.xy *= normalScale;
1946	normal = normalize( tbn * mapN );
1947#elif defined( USE_BUMPMAP )
1948	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1949#endif`,normal_pars_fragment:`#ifndef FLAT_SHADED
1950	varying vec3 vNormal;
1951	#ifdef USE_TANGENT
1952		varying vec3 vTangent;
1953		varying vec3 vBitangent;
1954	#endif
1955#endif`,normal_pars_vertex:`#ifndef FLAT_SHADED
1956	varying vec3 vNormal;
1957	#ifdef USE_TANGENT
1958		varying vec3 vTangent;
1959		varying vec3 vBitangent;
1960	#endif
1961#endif`,normal_vertex:`#ifndef FLAT_SHADED
1962	vNormal = normalize( transformedNormal );
1963	#ifdef USE_TANGENT
1964		vTangent = normalize( transformedTangent );
1965		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1966		#ifdef FLIP_SIDED
1967			vBitangent = - vBitangent;
1968		#endif
1969	#endif
1970#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP
1971	uniform sampler2D normalMap;
1972	uniform vec2 normalScale;
1973#endif
1974#ifdef USE_NORMALMAP_OBJECTSPACE
1975	uniform mat3 normalMatrix;
1976#endif
1977#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1978	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1979		vec3 q0 = dFdx( eye_pos.xyz );
1980		vec3 q1 = dFdy( eye_pos.xyz );
1981		vec2 st0 = dFdx( uv.st );
1982		vec2 st1 = dFdy( uv.st );
1983		vec3 N = surf_norm;
1984		vec3 q1perp = cross( q1, N );
1985		vec3 q0perp = cross( N, q0 );
1986		vec3 T = q1perp * st0.x + q0perp * st1.x;
1987		vec3 B = q1perp * st0.y + q0perp * st1.y;
1988		float det = max( dot( T, T ), dot( B, B ) );
1989		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1990		return mat3( T * scale, B * scale, N );
1991	}
1992#endif`,clearcoat_normal_fragment_begin:`#ifdef USE_CLEARCOAT
1993	vec3 clearcoatNormal = nonPerturbedNormal;
1994#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP
1995	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1996	clearcoatMapN.xy *= clearcoatNormalScale;
1997	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1998#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP
1999	uniform sampler2D clearcoatMap;
2000#endif
2001#ifdef USE_CLEARCOAT_NORMALMAP
2002	uniform sampler2D clearcoatNormalMap;
2003	uniform vec2 clearcoatNormalScale;
2004#endif
2005#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2006	uniform sampler2D clearcoatRoughnessMap;
2007#endif`,iridescence_pars_fragment:`#ifdef USE_IRIDESCENCEMAP
2008	uniform sampler2D iridescenceMap;
2009#endif
2010#ifdef USE_IRIDESCENCE_THICKNESSMAP
2011	uniform sampler2D iridescenceThicknessMap;
2012#endif`,opaque_fragment:`#ifdef OPAQUE
2013diffuseColor.a = 1.0;
2014#endif
2015#ifdef USE_TRANSMISSION
2016diffuseColor.a *= material.transmissionAlpha;
2017#endif
2018gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,packing:`vec3 packNormalToRGB( const in vec3 normal ) {
2019	return normalize( normal ) * 0.5 + 0.5;
2020}
2021vec3 unpackRGBToNormal( const in vec3 rgb ) {
2022	return 2.0 * rgb.xyz - 1.0;
2023}
2024const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
2025const float Inv255 = 1. / 255.;
2026const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
2027const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
2028const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
2029const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
2030vec4 packDepthToRGBA( const in float v ) {
2031	if( v <= 0.0 )
2032		return vec4( 0., 0., 0., 0. );
2033	if( v >= 1.0 )
2034		return vec4( 1., 1., 1., 1. );
2035	float vuf;
2036	float af = modf( v * PackFactors.a, vuf );
2037	float bf = modf( vuf * ShiftRight8, vuf );
2038	float gf = modf( vuf * ShiftRight8, vuf );
2039	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
2040}
2041vec3 packDepthToRGB( const in float v ) {
2042	if( v <= 0.0 )
2043		return vec3( 0., 0., 0. );
2044	if( v >= 1.0 )
2045		return vec3( 1., 1., 1. );
2046	float vuf;
2047	float bf = modf( v * PackFactors.b, vuf );
2048	float gf = modf( vuf * ShiftRight8, vuf );
2049	return vec3( vuf * Inv255, gf * PackUpscale, bf );
2050}
2051vec2 packDepthToRG( const in float v ) {
2052	if( v <= 0.0 )
2053		return vec2( 0., 0. );
2054	if( v >= 1.0 )
2055		return vec2( 1., 1. );
2056	float vuf;
2057	float gf = modf( v * 256., vuf );
2058	return vec2( vuf * Inv255, gf );
2059}
2060float unpackRGBAToDepth( const in vec4 v ) {
2061	return dot( v, UnpackFactors4 );
2062}
2063float unpackRGBToDepth( const in vec3 v ) {
2064	return dot( v, UnpackFactors3 );
2065}
2066float unpackRGToDepth( const in vec2 v ) {
2067	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
2068}
2069vec4 pack2HalfToRGBA( const in vec2 v ) {
2070	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
2071	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
2072}
2073vec2 unpackRGBATo2Half( const in vec4 v ) {
2074	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
2075}
2076float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
2077	return ( viewZ + near ) / ( near - far );
2078}
2079float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
2080	#ifdef USE_REVERSED_DEPTH_BUFFER
2081	
2082		return depth * ( far - near ) - far;
2083	#else
2084		return depth * ( near - far ) - near;
2085	#endif
2086}
2087float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
2088	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
2089}
2090float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
2091	
2092	#ifdef USE_REVERSED_DEPTH_BUFFER
2093		return ( near * far ) / ( ( near - far ) * depth - near );
2094	#else
2095		return ( near * far ) / ( ( far - near ) * depth - far );
2096	#endif
2097}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA
2098	gl_FragColor.rgb *= gl_FragColor.a;
2099#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 );
2100#ifdef USE_BATCHING
2101	mvPosition = batchingMatrix * mvPosition;
2102#endif
2103#ifdef USE_INSTANCING
2104	mvPosition = instanceMatrix * mvPosition;
2105#endif
2106mvPosition = modelViewMatrix * mvPosition;
2107gl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING
2108	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
2109#endif`,dithering_pars_fragment:`#ifdef DITHERING
2110	vec3 dithering( vec3 color ) {
2111		float grid_position = rand( gl_FragCoord.xy );
2112		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
2113		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
2114		return color + dither_shift_RGB;
2115	}
2116#endif`,roughnessmap_fragment:`float roughnessFactor = roughness;
2117#ifdef USE_ROUGHNESSMAP
2118	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
2119	roughnessFactor *= texelRoughness.g;
2120#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP
2121	uniform sampler2D roughnessMap;
2122#endif`,shadowmap_pars_fragment:`#if NUM_SPOT_LIGHT_COORDS > 0
2123	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
2124#endif
2125#if NUM_SPOT_LIGHT_MAPS > 0
2126	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
2127#endif
2128#ifdef USE_SHADOWMAP
2129	#if NUM_DIR_LIGHT_SHADOWS > 0
2130		#if defined( SHADOWMAP_TYPE_PCF )
2131			uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
2132		#else
2133			uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
2134		#endif
2135		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
2136		struct DirectionalLightShadow {
2137			float shadowIntensity;
2138			float shadowBias;
2139			float shadowNormalBias;
2140			float shadowRadius;
2141			vec2 shadowMapSize;
2142		};
2143		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
2144	#endif
2145	#if NUM_SPOT_LIGHT_SHADOWS > 0
2146		#if defined( SHADOWMAP_TYPE_PCF )
2147			uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
2148		#else
2149			uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
2150		#endif
2151		struct SpotLightShadow {
2152			float shadowIntensity;
2153			float shadowBias;
2154			float shadowNormalBias;
2155			float shadowRadius;
2156			vec2 shadowMapSize;
2157		};
2158		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
2159	#endif
2160	#if NUM_POINT_LIGHT_SHADOWS > 0
2161		#if defined( SHADOWMAP_TYPE_PCF )
2162			uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
2163		#elif defined( SHADOWMAP_TYPE_BASIC )
2164			uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
2165		#endif
2166		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
2167		struct PointLightShadow {
2168			float shadowIntensity;
2169			float shadowBias;
2170			float shadowNormalBias;
2171			float shadowRadius;
2172			vec2 shadowMapSize;
2173			float shadowCameraNear;
2174			float shadowCameraFar;
2175		};
2176		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
2177	#endif
2178	#if defined( SHADOWMAP_TYPE_PCF )
2179		float interleavedGradientNoise( vec2 position ) {
2180			return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );
2181		}
2182		vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {
2183			const float goldenAngle = 2.399963229728653;
2184			float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
2185			float theta = float( sampleIndex ) * goldenAngle + phi;
2186			return vec2( cos( theta ), sin( theta ) ) * r;
2187		}
2188	#endif
2189	#if defined( SHADOWMAP_TYPE_PCF )
2190		float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
2191			float shadow = 1.0;
2192			shadowCoord.xyz /= shadowCoord.w;
2193			shadowCoord.z += shadowBias;
2194			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
2195			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
2196			if ( frustumTest ) {
2197				vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
2198				float radius = shadowRadius * texelSize.x;
2199				float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
2200				shadow = (
2201					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +
2202					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +
2203					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +
2204					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +
2205					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )
2206				) * 0.2;
2207			}
2208			return mix( 1.0, shadow, shadowIntensity );
2209		}
2210	#elif defined( SHADOWMAP_TYPE_VSM )
2211		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
2212			float shadow = 1.0;
2213			shadowCoord.xyz /= shadowCoord.w;
2214			#ifdef USE_REVERSED_DEPTH_BUFFER
2215				shadowCoord.z -= shadowBias;
2216			#else
2217				shadowCoord.z += shadowBias;
2218			#endif
2219			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
2220			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
2221			if ( frustumTest ) {
2222				vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;
2223				float mean = distribution.x;
2224				float variance = distribution.y * distribution.y;
2225				#ifdef USE_REVERSED_DEPTH_BUFFER
2226					float hard_shadow = step( mean, shadowCoord.z );
2227				#else
2228					float hard_shadow = step( shadowCoord.z, mean );
2229				#endif
2230				
2231				if ( hard_shadow == 1.0 ) {
2232					shadow = 1.0;
2233				} else {
2234					variance = max( variance, 0.0000001 );
2235					float d = shadowCoord.z - mean;
2236					float p_max = variance / ( variance + d * d );
2237					p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );
2238					shadow = max( hard_shadow, p_max );
2239				}
2240			}
2241			return mix( 1.0, shadow, shadowIntensity );
2242		}
2243	#else
2244		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
2245			float shadow = 1.0;
2246			shadowCoord.xyz /= shadowCoord.w;
2247			#ifdef USE_REVERSED_DEPTH_BUFFER
2248				shadowCoord.z -= shadowBias;
2249			#else
2250				shadowCoord.z += shadowBias;
2251			#endif
2252			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
2253			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
2254			if ( frustumTest ) {
2255				float depth = texture2D( shadowMap, shadowCoord.xy ).r;
2256				#ifdef USE_REVERSED_DEPTH_BUFFER
2257					shadow = step( depth, shadowCoord.z );
2258				#else
2259					shadow = step( shadowCoord.z, depth );
2260				#endif
2261			}
2262			return mix( 1.0, shadow, shadowIntensity );
2263		}
2264	#endif
2265	#if NUM_POINT_LIGHT_SHADOWS > 0
2266	#if defined( SHADOWMAP_TYPE_PCF )
2267	float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
2268		float shadow = 1.0;
2269		vec3 lightToPosition = shadowCoord.xyz;
2270		vec3 bd3D = normalize( lightToPosition );
2271		vec3 absVec = abs( lightToPosition );
2272		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
2273		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
2274			#ifdef USE_REVERSED_DEPTH_BUFFER
2275				float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
2276				dp -= shadowBias;
2277			#else
2278				float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
2279				dp += shadowBias;
2280			#endif
2281			float texelSize = shadowRadius / shadowMapSize.x;
2282			vec3 absDir = abs( bd3D );
2283			vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );
2284			tangent = normalize( cross( bd3D, tangent ) );
2285			vec3 bitangent = cross( bd3D, tangent );
2286			float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
2287			vec2 sample0 = vogelDiskSample( 0, 5, phi );
2288			vec2 sample1 = vogelDiskSample( 1, 5, phi );
2289			vec2 sample2 = vogelDiskSample( 2, 5, phi );
2290			vec2 sample3 = vogelDiskSample( 3, 5, phi );
2291			vec2 sample4 = vogelDiskSample( 4, 5, phi );
2292			shadow = (
2293				texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +
2294				texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +
2295				texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +
2296				texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +
2297				texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )
2298			) * 0.2;
2299		}
2300		return mix( 1.0, shadow, shadowIntensity );
2301	}
2302	#elif defined( SHADOWMAP_TYPE_BASIC )
2303	float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
2304		float shadow = 1.0;
2305		vec3 lightToPosition = shadowCoord.xyz;
2306		vec3 absVec = abs( lightToPosition );
2307		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
2308		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
2309			float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
2310			dp += shadowBias;
2311			vec3 bd3D = normalize( lightToPosition );
2312			float depth = textureCube( shadowMap, bd3D ).r;
2313			#ifdef USE_REVERSED_DEPTH_BUFFER
2314				depth = 1.0 - depth;
2315			#endif
2316			shadow = step( dp, depth );
2317		}
2318		return mix( 1.0, shadow, shadowIntensity );
2319	}
2320	#endif
2321	#endif
2322#endif`,shadowmap_pars_vertex:`#if NUM_SPOT_LIGHT_COORDS > 0
2323	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
2324	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
2325#endif
2326#ifdef USE_SHADOWMAP
2327	#if NUM_DIR_LIGHT_SHADOWS > 0
2328		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
2329		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
2330		struct DirectionalLightShadow {
2331			float shadowIntensity;
2332			float shadowBias;
2333			float shadowNormalBias;
2334			float shadowRadius;
2335			vec2 shadowMapSize;
2336		};
2337		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
2338	#endif
2339	#if NUM_SPOT_LIGHT_SHADOWS > 0
2340		struct SpotLightShadow {
2341			float shadowIntensity;
2342			float shadowBias;
2343			float shadowNormalBias;
2344			float shadowRadius;
2345			vec2 shadowMapSize;
2346		};
2347		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
2348	#endif
2349	#if NUM_POINT_LIGHT_SHADOWS > 0
2350		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
2351		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
2352		struct PointLightShadow {
2353			float shadowIntensity;
2354			float shadowBias;
2355			float shadowNormalBias;
2356			float shadowRadius;
2357			vec2 shadowMapSize;
2358			float shadowCameraNear;
2359			float shadowCameraFar;
2360		};
2361		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
2362	#endif
2363#endif`,shadowmap_vertex:`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
2364	#ifdef HAS_NORMAL
2365		vec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );
2366	#else
2367		vec3 shadowWorldNormal = vec3( 0.0 );
2368	#endif
2369	vec4 shadowWorldPosition;
2370#endif
2371#if defined( USE_SHADOWMAP )
2372	#if NUM_DIR_LIGHT_SHADOWS > 0
2373		#pragma unroll_loop_start
2374		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2375			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
2376			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
2377		}
2378		#pragma unroll_loop_end
2379	#endif
2380	#if NUM_POINT_LIGHT_SHADOWS > 0
2381		#pragma unroll_loop_start
2382		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2383			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
2384			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
2385		}
2386		#pragma unroll_loop_end
2387	#endif
2388#endif
2389#if NUM_SPOT_LIGHT_COORDS > 0
2390	#pragma unroll_loop_start
2391	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
2392		shadowWorldPosition = worldPosition;
2393		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
2394			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
2395		#endif
2396		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
2397	}
2398	#pragma unroll_loop_end
2399#endif`,shadowmask_pars_fragment:`float getShadowMask() {
2400	float shadow = 1.0;
2401	#ifdef USE_SHADOWMAP
2402	#if NUM_DIR_LIGHT_SHADOWS > 0
2403	DirectionalLightShadow directionalLight;
2404	#pragma unroll_loop_start
2405	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2406		directionalLight = directionalLightShadows[ i ];
2407		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
2408	}
2409	#pragma unroll_loop_end
2410	#endif
2411	#if NUM_SPOT_LIGHT_SHADOWS > 0
2412	SpotLightShadow spotLight;
2413	#pragma unroll_loop_start
2414	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
2415		spotLight = spotLightShadows[ i ];
2416		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
2417	}
2418	#pragma unroll_loop_end
2419	#endif
2420	#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
2421	PointLightShadow pointLight;
2422	#pragma unroll_loop_start
2423	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2424		pointLight = pointLightShadows[ i ];
2425		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
2426	}
2427	#pragma unroll_loop_end
2428	#endif
2429	#endif
2430	return shadow;
2431}`,skinbase_vertex:`#ifdef USE_SKINNING
2432	mat4 boneMatX = getBoneMatrix( skinIndex.x );
2433	mat4 boneMatY = getBoneMatrix( skinIndex.y );
2434	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2435	mat4 boneMatW = getBoneMatrix( skinIndex.w );
2436#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING
2437	uniform mat4 bindMatrix;
2438	uniform mat4 bindMatrixInverse;
2439	uniform highp sampler2D boneTexture;
2440	mat4 getBoneMatrix( const in float i ) {
2441		int size = textureSize( boneTexture, 0 ).x;
2442		int j = int( i ) * 4;
2443		int x = j % size;
2444		int y = j / size;
2445		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2446		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2447		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2448		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2449		return mat4( v1, v2, v3, v4 );
2450	}
2451#endif`,skinning_vertex:`#ifdef USE_SKINNING
2452	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2453	vec4 skinned = vec4( 0.0 );
2454	skinned += boneMatX * skinVertex * skinWeight.x;
2455	skinned += boneMatY * skinVertex * skinWeight.y;
2456	skinned += boneMatZ * skinVertex * skinWeight.z;
2457	skinned += boneMatW * skinVertex * skinWeight.w;
2458	transformed = ( bindMatrixInverse * skinned ).xyz;
2459#endif`,skinnormal_vertex:`#ifdef USE_SKINNING
2460	mat4 skinMatrix = mat4( 0.0 );
2461	skinMatrix += skinWeight.x * boneMatX;
2462	skinMatrix += skinWeight.y * boneMatY;
2463	skinMatrix += skinWeight.z * boneMatZ;
2464	skinMatrix += skinWeight.w * boneMatW;
2465	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2466	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2467	#ifdef USE_TANGENT
2468		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2469	#endif
2470#endif`,specularmap_fragment:`float specularStrength;
2471#ifdef USE_SPECULARMAP
2472	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2473	specularStrength = texelSpecular.r;
2474#else
2475	specularStrength = 1.0;
2476#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP
2477	uniform sampler2D specularMap;
2478#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING )
2479	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2480#endif`,tonemapping_pars_fragment:`#ifndef saturate
2481#define saturate( a ) clamp( a, 0.0, 1.0 )
2482#endif
2483uniform float toneMappingExposure;
2484vec3 LinearToneMapping( vec3 color ) {
2485	return saturate( toneMappingExposure * color );
2486}
2487vec3 ReinhardToneMapping( vec3 color ) {
2488	color *= toneMappingExposure;
2489	return saturate( color / ( vec3( 1.0 ) + color ) );
2490}
2491vec3 CineonToneMapping( vec3 color ) {
2492	color *= toneMappingExposure;
2493	color = max( vec3( 0.0 ), color - 0.004 );
2494	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2495}
2496vec3 RRTAndODTFit( vec3 v ) {
2497	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2498	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2499	return a / b;
2500}
2501vec3 ACESFilmicToneMapping( vec3 color ) {
2502	const mat3 ACESInputMat = mat3(
2503		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2504		vec3( 0.04823, 0.01566, 0.83777 )
2505	);
2506	const mat3 ACESOutputMat = mat3(
2507		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2508		vec3( -0.07367, -0.00605,  1.07602 )
2509	);
2510	color *= toneMappingExposure / 0.6;
2511	color = ACESInputMat * color;
2512	color = RRTAndODTFit( color );
2513	color = ACESOutputMat * color;
2514	return saturate( color );
2515}
2516const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2517	vec3( 1.6605, - 0.1246, - 0.0182 ),
2518	vec3( - 0.5876, 1.1329, - 0.1006 ),
2519	vec3( - 0.0728, - 0.0083, 1.1187 )
2520);
2521const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2522	vec3( 0.6274, 0.0691, 0.0164 ),
2523	vec3( 0.3293, 0.9195, 0.0880 ),
2524	vec3( 0.0433, 0.0113, 0.8956 )
2525);
2526vec3 agxDefaultContrastApprox( vec3 x ) {
2527	vec3 x2 = x * x;
2528	vec3 x4 = x2 * x2;
2529	return + 15.5 * x4 * x2
2530		- 40.14 * x4 * x
2531		+ 31.96 * x4
2532		- 6.868 * x2 * x
2533		+ 0.4298 * x2
2534		+ 0.1191 * x
2535		- 0.00232;
2536}
2537vec3 AgXToneMapping( vec3 color ) {
2538	const mat3 AgXInsetMatrix = mat3(
2539		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2540		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2541		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2542	);
2543	const mat3 AgXOutsetMatrix = mat3(
2544		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2545		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2546		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2547	);
2548	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2549	color *= toneMappingExposure;
2550	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2551	color = AgXInsetMatrix * color;
2552	color = max( color, 1e-10 );	color = log2( color );
2553	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2554	color = clamp( color, 0.0, 1.0 );
2555	color = agxDefaultContrastApprox( color );
2556	color = AgXOutsetMatrix * color;
2557	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2558	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2559	color = clamp( color, 0.0, 1.0 );
2560	return color;
2561}
2562vec3 NeutralToneMapping( vec3 color ) {
2563	const float StartCompression = 0.8 - 0.04;
2564	const float Desaturation = 0.15;
2565	color *= toneMappingExposure;
2566	float x = min( color.r, min( color.g, color.b ) );
2567	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2568	color -= offset;
2569	float peak = max( color.r, max( color.g, color.b ) );
2570	if ( peak < StartCompression ) return color;
2571	float d = 1. - StartCompression;
2572	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2573	color *= newPeak / peak;
2574	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2575	return mix( color, vec3( newPeak ), g );
2576}
2577vec3 CustomToneMapping( vec3 color ) { return color; }`,transmission_fragment:`#ifdef USE_TRANSMISSION
2578	material.transmission = transmission;
2579	material.transmissionAlpha = 1.0;
2580	material.thickness = thickness;
2581	material.attenuationDistance = attenuationDistance;
2582	material.attenuationColor = attenuationColor;
2583	#ifdef USE_TRANSMISSIONMAP
2584		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2585	#endif
2586	#ifdef USE_THICKNESSMAP
2587		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2588	#endif
2589	vec3 pos = vWorldPosition;
2590	vec3 v = normalize( cameraPosition - pos );
2591	vec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix );
2592	vec4 transmitted = getIBLVolumeRefraction(
2593		n, v, material.roughness, material.diffuseContribution, material.specularColorBlended
vendor: 14,463 bytes, lines 2593-2997
2593, material.specularF90,
2594		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2595		material.attenuationColor, material.attenuationDistance );
2596	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2597	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2598#endif`,transmission_pars_fragment:`#ifdef USE_TRANSMISSION
2599	uniform float transmission;
2600	uniform float thickness;
2601	uniform float attenuationDistance;
2602	uniform vec3 attenuationColor;
2603	#ifdef USE_TRANSMISSIONMAP
2604		uniform sampler2D transmissionMap;
2605	#endif
2606	#ifdef USE_THICKNESSMAP
2607		uniform sampler2D thicknessMap;
2608	#endif
2609	uniform vec2 transmissionSamplerSize;
2610	uniform sampler2D transmissionSamplerMap;
2611	uniform mat4 modelMatrix;
2612	uniform mat4 projectionMatrix;
2613	varying vec3 vWorldPosition;
2614	float w0( float a ) {
2615		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2616	}
2617	float w1( float a ) {
2618		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2619	}
2620	float w2( float a ){
2621		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2622	}
2623	float w3( float a ) {
2624		return ( 1.0 / 6.0 ) * ( a * a * a );
2625	}
2626	float g0( float a ) {
2627		return w0( a ) + w1( a );
2628	}
2629	float g1( float a ) {
2630		return w2( a ) + w3( a );
2631	}
2632	float h0( float a ) {
2633		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2634	}
2635	float h1( float a ) {
2636		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2637	}
2638	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2639		uv = uv * texelSize.zw + 0.5;
2640		vec2 iuv = floor( uv );
2641		vec2 fuv = fract( uv );
2642		float g0x = g0( fuv.x );
2643		float g1x = g1( fuv.x );
2644		float h0x = h0( fuv.x );
2645		float h1x = h1( fuv.x );
2646		float h0y = h0( fuv.y );
2647		float h1y = h1( fuv.y );
2648		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2649		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2650		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2651		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2652		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2653			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2654	}
2655	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2656		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2657		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2658		vec2 fLodSizeInv = 1.0 / fLodSize;
2659		vec2 cLodSizeInv = 1.0 / cLodSize;
2660		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2661		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2662		return mix( fSample, cSample, fract( lod ) );
2663	}
2664	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2665		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2666		vec3 modelScale;
2667		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2668		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2669		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2670		return normalize( refractionVector ) * thickness * modelScale;
2671	}
2672	float applyIorToRoughness( const in float roughness, const in float ior ) {
2673		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2674	}
2675	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2676		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2677		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2678	}
2679	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2680		if ( isinf( attenuationDistance ) ) {
2681			return vec3( 1.0 );
2682		} else {
2683			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2684			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2685		}
2686	}
2687	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2688		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2689		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2690		const in vec3 attenuationColor, const in float attenuationDistance ) {
2691		vec4 transmittedLight;
2692		vec3 transmittance;
2693		#ifdef USE_DISPERSION
2694			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2695			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2696			for ( int i = 0; i < 3; i ++ ) {
2697				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2698				vec3 refractedRayExit = position + transmissionRay;
2699				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2700				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2701				refractionCoords += 1.0;
2702				refractionCoords /= 2.0;
2703				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2704				transmittedLight[ i ] = transmissionSample[ i ];
2705				transmittedLight.a += transmissionSample.a;
2706				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2707			}
2708			transmittedLight.a /= 3.0;
2709		#else
2710			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2711			vec3 refractedRayExit = position + transmissionRay;
2712			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2713			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2714			refractionCoords += 1.0;
2715			refractionCoords /= 2.0;
2716			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2717			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2718		#endif
2719		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2720		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2721		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2722		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2723	}
2724#endif`,uv_pars_fragment:`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2725	varying vec2 vUv;
2726#endif
2727#ifdef USE_MAP
2728	varying vec2 vMapUv;
2729#endif
2730#ifdef USE_ALPHAMAP
2731	varying vec2 vAlphaMapUv;
2732#endif
2733#ifdef USE_LIGHTMAP
2734	varying vec2 vLightMapUv;
2735#endif
2736#ifdef USE_AOMAP
2737	varying vec2 vAoMapUv;
2738#endif
2739#ifdef USE_BUMPMAP
2740	varying vec2 vBumpMapUv;
2741#endif
2742#ifdef USE_NORMALMAP
2743	varying vec2 vNormalMapUv;
2744#endif
2745#ifdef USE_EMISSIVEMAP
2746	varying vec2 vEmissiveMapUv;
2747#endif
2748#ifdef USE_METALNESSMAP
2749	varying vec2 vMetalnessMapUv;
2750#endif
2751#ifdef USE_ROUGHNESSMAP
2752	varying vec2 vRoughnessMapUv;
2753#endif
2754#ifdef USE_ANISOTROPYMAP
2755	varying vec2 vAnisotropyMapUv;
2756#endif
2757#ifdef USE_CLEARCOATMAP
2758	varying vec2 vClearcoatMapUv;
2759#endif
2760#ifdef USE_CLEARCOAT_NORMALMAP
2761	varying vec2 vClearcoatNormalMapUv;
2762#endif
2763#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2764	varying vec2 vClearcoatRoughnessMapUv;
2765#endif
2766#ifdef USE_IRIDESCENCEMAP
2767	varying vec2 vIridescenceMapUv;
2768#endif
2769#ifdef USE_IRIDESCENCE_THICKNESSMAP
2770	varying vec2 vIridescenceThicknessMapUv;
2771#endif
2772#ifdef USE_SHEEN_COLORMAP
2773	varying vec2 vSheenColorMapUv;
2774#endif
2775#ifdef USE_SHEEN_ROUGHNESSMAP
2776	varying vec2 vSheenRoughnessMapUv;
2777#endif
2778#ifdef USE_SPECULARMAP
2779	varying vec2 vSpecularMapUv;
2780#endif
2781#ifdef USE_SPECULAR_COLORMAP
2782	varying vec2 vSpecularColorMapUv;
2783#endif
2784#ifdef USE_SPECULAR_INTENSITYMAP
2785	varying vec2 vSpecularIntensityMapUv;
2786#endif
2787#ifdef USE_TRANSMISSIONMAP
2788	uniform mat3 transmissionMapTransform;
2789	varying vec2 vTransmissionMapUv;
2790#endif
2791#ifdef USE_THICKNESSMAP
2792	uniform mat3 thicknessMapTransform;
2793	varying vec2 vThicknessMapUv;
2794#endif`,uv_pars_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2795	varying vec2 vUv;
2796#endif
2797#ifdef USE_MAP
2798	uniform mat3 mapTransform;
2799	varying vec2 vMapUv;
2800#endif
2801#ifdef USE_ALPHAMAP
2802	uniform mat3 alphaMapTransform;
2803	varying vec2 vAlphaMapUv;
2804#endif
2805#ifdef USE_LIGHTMAP
2806	uniform mat3 lightMapTransform;
2807	varying vec2 vLightMapUv;
2808#endif
2809#ifdef USE_AOMAP
2810	uniform mat3 aoMapTransform;
2811	varying vec2 vAoMapUv;
2812#endif
2813#ifdef USE_BUMPMAP
2814	uniform mat3 bumpMapTransform;
2815	varying vec2 vBumpMapUv;
2816#endif
2817#ifdef USE_NORMALMAP
2818	uniform mat3 normalMapTransform;
2819	varying vec2 vNormalMapUv;
2820#endif
2821#ifdef USE_DISPLACEMENTMAP
2822	uniform mat3 displacementMapTransform;
2823	varying vec2 vDisplacementMapUv;
2824#endif
2825#ifdef USE_EMISSIVEMAP
2826	uniform mat3 emissiveMapTransform;
2827	varying vec2 vEmissiveMapUv;
2828#endif
2829#ifdef USE_METALNESSMAP
2830	uniform mat3 metalnessMapTransform;
2831	varying vec2 vMetalnessMapUv;
2832#endif
2833#ifdef USE_ROUGHNESSMAP
2834	uniform mat3 roughnessMapTransform;
2835	varying vec2 vRoughnessMapUv;
2836#endif
2837#ifdef USE_ANISOTROPYMAP
2838	uniform mat3 anisotropyMapTransform;
2839	varying vec2 vAnisotropyMapUv;
2840#endif
2841#ifdef USE_CLEARCOATMAP
2842	uniform mat3 clearcoatMapTransform;
2843	varying vec2 vClearcoatMapUv;
2844#endif
2845#ifdef USE_CLEARCOAT_NORMALMAP
2846	uniform mat3 clearcoatNormalMapTransform;
2847	varying vec2 vClearcoatNormalMapUv;
2848#endif
2849#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2850	uniform mat3 clearcoatRoughnessMapTransform;
2851	varying vec2 vClearcoatRoughnessMapUv;
2852#endif
2853#ifdef USE_SHEEN_COLORMAP
2854	uniform mat3 sheenColorMapTransform;
2855	varying vec2 vSheenColorMapUv;
2856#endif
2857#ifdef USE_SHEEN_ROUGHNESSMAP
2858	uniform mat3 sheenRoughnessMapTransform;
2859	varying vec2 vSheenRoughnessMapUv;
2860#endif
2861#ifdef USE_IRIDESCENCEMAP
2862	uniform mat3 iridescenceMapTransform;
2863	varying vec2 vIridescenceMapUv;
2864#endif
2865#ifdef USE_IRIDESCENCE_THICKNESSMAP
2866	uniform mat3 iridescenceThicknessMapTransform;
2867	varying vec2 vIridescenceThicknessMapUv;
2868#endif
2869#ifdef USE_SPECULARMAP
2870	uniform mat3 specularMapTransform;
2871	varying vec2 vSpecularMapUv;
2872#endif
2873#ifdef USE_SPECULAR_COLORMAP
2874	uniform mat3 specularColorMapTransform;
2875	varying vec2 vSpecularColorMapUv;
2876#endif
2877#ifdef USE_SPECULAR_INTENSITYMAP
2878	uniform mat3 specularIntensityMapTransform;
2879	varying vec2 vSpecularIntensityMapUv;
2880#endif
2881#ifdef USE_TRANSMISSIONMAP
2882	uniform mat3 transmissionMapTransform;
2883	varying vec2 vTransmissionMapUv;
2884#endif
2885#ifdef USE_THICKNESSMAP
2886	uniform mat3 thicknessMapTransform;
2887	varying vec2 vThicknessMapUv;
2888#endif`,uv_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2889	vUv = vec3( uv, 1 ).xy;
2890#endif
2891#ifdef USE_MAP
2892	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2893#endif
2894#ifdef USE_ALPHAMAP
2895	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2896#endif
2897#ifdef USE_LIGHTMAP
2898	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2899#endif
2900#ifdef USE_AOMAP
2901	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2902#endif
2903#ifdef USE_BUMPMAP
2904	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2905#endif
2906#ifdef USE_NORMALMAP
2907	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2908#endif
2909#ifdef USE_DISPLACEMENTMAP
2910	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2911#endif
2912#ifdef USE_EMISSIVEMAP
2913	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2914#endif
2915#ifdef USE_METALNESSMAP
2916	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2917#endif
2918#ifdef USE_ROUGHNESSMAP
2919	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2920#endif
2921#ifdef USE_ANISOTROPYMAP
2922	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2923#endif
2924#ifdef USE_CLEARCOATMAP
2925	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2926#endif
2927#ifdef USE_CLEARCOAT_NORMALMAP
2928	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2929#endif
2930#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2931	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2932#endif
2933#ifdef USE_IRIDESCENCEMAP
2934	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2935#endif
2936#ifdef USE_IRIDESCENCE_THICKNESSMAP
2937	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2938#endif
2939#ifdef USE_SHEEN_COLORMAP
2940	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2941#endif
2942#ifdef USE_SHEEN_ROUGHNESSMAP
2943	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2944#endif
2945#ifdef USE_SPECULARMAP
2946	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2947#endif
2948#ifdef USE_SPECULAR_COLORMAP
2949	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2950#endif
2951#ifdef USE_SPECULAR_INTENSITYMAP
2952	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2953#endif
2954#ifdef USE_TRANSMISSIONMAP
2955	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2956#endif
2957#ifdef USE_THICKNESSMAP
2958	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2959#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2960	vec4 worldPosition = vec4( transformed, 1.0 );
2961	#ifdef USE_BATCHING
2962		worldPosition = batchingMatrix * worldPosition;
2963	#endif
2964	#ifdef USE_INSTANCING
2965		worldPosition = instanceMatrix * worldPosition;
2966	#endif
2967	worldPosition = modelMatrix * worldPosition;
2968#endif`,background_vert:`varying vec2 vUv;
2969uniform mat3 uvTransform;
2970void main() {
2971	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2972	gl_Position = vec4( position.xy, 1.0, 1.0 );
2973}`,background_frag:`uniform sampler2D t2D;
2974uniform float backgroundIntensity;
2975varying vec2 vUv;
2976void main() {
2977	vec4 texColor = texture2D( t2D, vUv );
2978	#ifdef DECODE_VIDEO_TEXTURE
2979		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
2980	#endif
2981	texColor.rgb *= backgroundIntensity;
2982	gl_FragColor = texColor;
2983	#include <tonemapping_fragment>
2984	#include <colorspace_fragment>
2985}`,backgroundCube_vert:`varying vec3 vWorldDirection;
2986#include <common>
2987void main() {
2988	vWorldDirection = transformDirection( position, modelMatrix );
2989	#include <begin_vertex>
2990	#include <project_vertex>
2991	gl_Position.z = gl_Position.w;
2992}`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE
2993	uniform samplerCube envMap;
2994#elif defined( ENVMAP_TYPE_CUBE_UV )
2995	uniform sampler2D envMap;
2996#endif
2997uniform float 
2997backgroundBlurriness;
2998uniform float backgroundIntensity;
2999uniform mat3 backgroundRotation;
3000varying vec3 vWorldDirection;
3001#include <cube_uv_reflection_fragment>
3002void main() {
3003	#ifdef ENVMAP_TYPE_CUBE
3004		vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );
3005	#elif defined( ENVMAP_TYPE_CUBE_UV )
3006		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
3007	#else
3008		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3009	#endif
3010	texColor.rgb *= backgroundIntensity;
3011	gl_FragColor = texColor;
3012	#include <tonemapping_fragment>
3013	#include <colorspace_fragment>
3014}`,cube_vert:`varying vec3 vWorldDirection;
3015#include <common>
3016void main() {
3017	vWorldDirection = transformDirection( position, modelMatrix );
3018	#include <begin_vertex>
3019	#include <project_vertex>
3020	gl_Position.z = gl_Position.w;
3021}`,cube_frag:`uniform samplerCube tCube;
3022uniform float tFlip;
3023uniform float opacity;
3024varying vec3 vWorldDirection;
3025void main() {
3026	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
3027	gl_FragColor = texColor;
3028	gl_FragColor.a *= opacity;
3029	#include <tonemapping_fragment>
3030	#include <colorspace_fragment>
3031}`,depth_vert:`#include <common>
3032#include <batching_pars_vertex>
3033#include <uv_pars_vertex>
3034#include <displacementmap_pars_vertex>
3035#include <morphtarget_pars_vertex>
3036#include <skinning_pars_vertex>
3037#include <logdepthbuf_pars_vertex>
3038#include <clipping_planes_pars_vertex>
3039varying vec2 vHighPrecisionZW;
3040void main() {
3041	#include <uv_vertex>
3042	#include <batching_vertex>
3043	#include <skinbase_vertex>
3044	#include <morphinstance_vertex>
3045	#ifdef USE_DISPLACEMENTMAP
3046		#include <beginnormal_vertex>
3047		#include <morphnormal_vertex>
3048		#include <skinnormal_vertex>
3049	#endif
3050	#include <begin_vertex>
3051	#include <morphtarget_vertex>
3052	#include <skinning_vertex>
3053	#include <displacementmap_vertex>
3054	#include <project_vertex>
3055	#include <logdepthbuf_vertex>
3056	#include <clipping_planes_vertex>
3057	vHighPrecisionZW = gl_Position.zw;
3058}`,depth_frag:`#if DEPTH_PACKING == 3200
3059	uniform float opacity;
3060#endif
3061#include <common>
3062#include <packing>
3063#include <uv_pars_fragment>
3064#include <map_pars_fragment>
3065#include <alphamap_pars_fragment>
3066#include <alphatest_pars_fragment>
3067#include <alphahash_pars_fragment>
3068#include <logdepthbuf_pars_fragment>
3069#include <clipping_planes_pars_fragment>
3070varying vec2 vHighPrecisionZW;
3071void main() {
3072	vec4 diffuseColor = vec4( 1.0 );
3073	#include <clipping_planes_fragment>
3074	#if DEPTH_PACKING == 3200
3075		diffuseColor.a = opacity;
3076	#endif
3077	#include <map_fragment>
3078	#include <alphamap_fragment>
3079	#include <alphatest_fragment>
3080	#include <alphahash_fragment>
3081	#include <logdepthbuf_fragment>
3082	#ifdef USE_REVERSED_DEPTH_BUFFER
3083		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
3084	#else
3085		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
3086	#endif
3087	#if DEPTH_PACKING == 3200
3088		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
3089	#elif DEPTH_PACKING == 3201
3090		gl_FragColor = packDepthToRGBA( fragCoordZ );
3091	#elif DEPTH_PACKING == 3202
3092		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
3093	#elif DEPTH_PACKING == 3203
3094		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
3095	#endif
3096}`,distance_vert:`#define DISTANCE
3097varying vec3 vWorldPosition;
3098#include <common>
3099#include <batching_pars_vertex>
3100#include <uv_pars_vertex>
3101#include <displacementmap_pars_vertex>
3102#include <morphtarget_pars_vertex>
3103#include <skinning_pars_vertex>
3104#include <clipping_planes_pars_vertex>
3105void main() {
3106	#include <uv_vertex>
3107	#include <batching_vertex>
3108	#include <skinbase_vertex>
3109	#include <morphinstance_vertex>
3110	#ifdef USE_DISPLACEMENTMAP
3111		#include <beginnormal_vertex>
3112		#include <morphnormal_vertex>
3113		#include <skinnormal_vertex>
3114	#endif
3115	#include <begin_vertex>
3116	#include <morphtarget_vertex>
3117	#include <skinning_vertex>
3118	#include <displacementmap_vertex>
3119	#include <project_vertex>
3120	#include <worldpos_vertex>
3121	#include <clipping_planes_vertex>
3122	vWorldPosition = worldPosition.xyz;
3123}`,distance_frag:`#define DISTANCE
3124uniform vec3 referencePosition;
3125uniform float nearDistance;
3126uniform float farDistance;
3127varying vec3 vWorldPosition;
3128#include <common>
3129#include <uv_pars_fragment>
3130#include <map_pars_fragment>
3131#include <alphamap_pars_fragment>
3132#include <alphatest_pars_fragment>
3133#include <alphahash_pars_fragment>
3134#include <clipping_planes_pars_fragment>
3135void main() {
3136	vec4 diffuseColor = vec4( 1.0 );
3137	#include <clipping_planes_fragment>
3138	#include <map_fragment>
3139	#include <alphamap_fragment>
3140	#include <alphatest_fragment>
3141	#include <alphahash_fragment>
3142	float dist = length( vWorldPosition - referencePosition );
3143	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
3144	dist = saturate( dist );
3145	gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
3146}`,equirect_vert:`varying vec3 vWorldDirection;
3147#include <common>
3148void main() {
3149	vWorldDirection = transformDirection( position, modelMatrix );
3150	#include <begin_vertex>
3151	#include <project_vertex>
3152}`,equirect_frag:`uniform sampler2D tEquirect;
3153varying vec3 vWorldDirection;
3154#include <common>
3155void main() {
3156	vec3 direction = normalize( vWorldDirection );
3157	vec2 sampleUV = equirectUv( direction );
3158	gl_FragColor = texture2D( tEquirect, sampleUV );
3159	#include <tonemapping_fragment>
3160	#include <colorspace_fragment>
3161}`,linedashed_vert:`uniform float scale;
3162attribute float lineDistance;
3163varying float vLineDistance;
3164#include <common>
3165#include <uv_pars_vertex>
3166#include <color_pars_vertex>
3167#include <fog_pars_vertex>
3168#include <morphtarget_pars_vertex>
3169#include <logdepthbuf_pars_vertex>
3170#include <clipping_planes_pars_vertex>
3171void main() {
3172	vLineDistance = scale * lineDistance;
3173	#include <uv_vertex>
3174	#include <color_vertex>
3175	#include <morphinstance_vertex>
3176	#include <morphcolor_vertex>
3177	#include <begin_vertex>
3178	#include <morphtarget_vertex>
3179	#include <project_vertex>
3180	#include <logdepthbuf_vertex>
3181	#include <clipping_planes_vertex>
3182	#include <fog_vertex>
3183}`,linedashed_frag:`uniform vec3 diffuse;
3184uniform float opacity;
3185uniform float dashSize;
3186uniform float totalSize;
3187varying float vLineDistance;
3188#include <common>
3189#include <color_pars_fragment>
3190#include <uv_pars_fragment>
3191#include <map_pars_fragment>
3192#include <fog_pars_fragment>
3193#include <logdepthbuf_pars_fragment>
3194#include <clipping_planes_pars_fragment>
3195void main() {
3196	vec4 diffuseColor = vec4( diffuse, opacity );
3197	#include <clipping_planes_fragment>
3198	if ( mod( vLineDistance, totalSize ) > dashSize ) {
3199		discard;
3200	}
3201	vec3 outgoingLight = vec3( 0.0 );
3202	#include <logdepthbuf_fragment>
3203	#include <map_fragment>
3204	#include <color_fragment>
3205	outgoingLight = diffuseColor.rgb;
3206	#include <opaque_fragment>
3207	#include <tonemapping_fragment>
3208	#include <colorspace_fragment>
3209	#include <fog_fragment>
3210	#include <premultiplied_alpha_fragment>
3211}`,meshbasic_vert:`#include <common>
3212#include <batching_pars_vertex>
3213#include <uv_pars_vertex>
3214#include <envmap_pars_vertex>
3215#include <color_pars_vertex>
3216#include <fog_pars_vertex>
3217#include <morphtarget_pars_vertex>
3218#include <skinning_pars_vertex>
3219#include <logdepthbuf_pars_vertex>
3220#include <clipping_planes_pars_vertex>
3221void main() {
3222	#include <uv_vertex>
3223	#include <color_vertex>
3224	#include <morphinstance_vertex>
3225	#include <morphcolor_vertex>
3226	#include <batching_vertex>
3227	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
3228		#include <beginnormal_vertex>
3229		#include <morphnormal_vertex>
3230		#include <skinbase_vertex>
3231		#include <skinnormal_vertex>
3232		#include <defaultnormal_vertex>
3233	#endif
3234	#include <begin_vertex>
3235	#include <morphtarget_vertex>
3236	#include <skinning_vertex>
3237	#include <project_vertex>
3238	#include <logdepthbuf_vertex>
3239	#include <clipping_planes_vertex>
3240	#include <worldpos_vertex>
3241	#include <envmap_vertex>
3242	#include <fog_vertex>
3243}`,meshbasic_frag:`uniform vec3 diffuse;
3244uniform float opacity;
3245#ifndef FLAT_SHADED
3246	varying vec3 vNormal;
3247#endif
3248#include <common>
3249#include <dithering_pars_fragment>
3250#include <color_pars_fragment>
3251#include <uv_pars_fragment>
3252#include <map_pars_fragment>
3253#include <alphamap_pars_fragment>
3254#include <alphatest_pars_fragment>
3255#include <alphahash_pars_fragment>
3256#include <aomap_pars_fragment>
3257#include <lightmap_pars_fragment>
3258#include <envmap_common_pars_fragment>
3259#include <envmap_pars_fragment>
3260#include <fog_pars_fragment>
3261#include <specularmap_pars_fragment>
3262#include <logdepthbuf_pars_fragment>
3263#include <clipping_planes_pars_fragment>
3264void main() {
3265	vec4 diffuseColor = vec4( diffuse, opacity );
3266	#include <clipping_planes_fragment>
3267	#include <logdepthbuf_fragment>
3268	#include <map_fragment>
3269	#include <color_fragment>
3270	#include <alphamap_fragment>
3271	#include <alphatest_fragment>
3272	#include <alphahash_fragment>
3273	#include <specularmap_fragment>
3274	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3275	#ifdef USE_LIGHTMAP
3276		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
3277		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
3278	#else
3279		reflectedLight.indirectDiffuse += vec3( 1.0 );
3280	#endif
3281	#include <aomap_fragment>
3282	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
3283	vec3 outgoingLight = reflectedLight.indirectDiffuse;
3284	#include <envmap_fragment>
3285	#include <opaque_fragment>
3286	#include <tonemapping_fragment>
3287	#include <colorspace_fragment>
3288	#include <fog_fragment>
3289	#include <premultiplied_alpha_fragment>
3290	#include <dithering_fragment>
3291}`,meshlambert_vert:`#define LAMBERT
3292varying vec3 vViewPosition;
3293#include <common>
3294#include <batching_pars_vertex>
3295#include <uv_pars_vertex>
3296#include <displacementmap_pars_vertex>
3297#include <envmap_pars_vertex>
3298#include <color_pars_vertex>
3299#include <fog_pars_vertex>
3300#include <normal_pars_vertex>
3301#include <morphtarget_pars_vertex>
3302#include <skinning_pars_vertex>
3303#include <shadowmap_pars_vertex>
3304#include <logdepthbuf_pars_vertex>
3305#include <clipping_planes_pars_vertex>
3306void main() {
3307	#include <uv_vertex>
3308	#include <color_vertex>
3309	#include <morphinstance_vertex>
3310	#include <morphcolor_vertex>
3311	#include <batching_vertex>
3312	#include <beginnormal_vertex>
3313	#include <morphnormal_vertex>
3314	#include <skinbase_vertex>
3315	#include <skinnormal_vertex>
3316	#include <defaultnormal_vertex>
3317	#include <normal_vertex>
3318	#include <begin_vertex>
3319	#include <morphtarget_vertex>
3320	#include <skinning_vertex>
3321	#include <displacementmap_vertex>
3322	#include <project_vertex>
3323	#include <logdepthbuf_vertex>
3324	#include <clipping_planes_vertex>
3325	vViewPosition = - mvPosition.xyz;
3326	#include <worldpos_vertex>
3327	#include <envmap_vertex>
3328	#include <shadowmap_vertex>
3329	#include <fog_vertex>
3330}`,meshlambert_frag:`#define LAMBERT
3331uniform vec3 diffuse;
3332uniform vec3 emissive;
3333uniform float opacity;
3334#include <common>
3335#include <dithering_pars_fragment>
3336#include <color_pars_fragment>
3337#include <uv_pars_fragment>
3338#include <map_pars_fragment>
3339#include <alphamap_pars_fragment>
3340#include <alphatest_pars_fragment>
3341#include <alphahash_pars_fragment>
3342#include <aomap_pars_fragment>
3343#include <lightmap_pars_fragment>
3344#include <emissivemap_pars_fragment>
3345#include <cube_uv_reflection_fragment>
3346#include <envmap_common_pars_fragment>
3347#include <envmap_pars_fragment>
3348#include <envmap_physical_pars_fragment>
3349#include <fog_pars_fragment>
3350#include <bsdfs>
3351#include <lights_pars_begin>
3352#include <normal_pars_fragment>
3353#include <lights_lambert_pars_fragment>
3354#include <shadowmap_pars_fragment>
3355#include <bumpmap_pars_fragment>
3356#include <normalmap_pars_fragment>
3357#include <specularmap_pars_fragment>
3358#include <logdepthbuf_pars_fragment>
3359#include <clipping_planes_pars_fragment>
3360void main() {
3361	vec4 diffuseColor = vec4( diffuse, opacity );
3362	#include <clipping_planes_fragment>
3363	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3364	vec3 totalEmissiveRadiance = emissive;
3365	#include <logdepthbuf_fragment>
3366	#include <map_fragment>
3367	#include <color_fragment>
3368	#include <alphamap_fragment>
3369	#include <alphatest_fragment>
3370	#include <alphahash_fragment>
3371	#include <specularmap_fragment>
3372	#include <normal_fragment_begin>
3373	#include <normal_fragment_maps>
3374	#include <emissivemap_fragment>
3375	#include <lights_lambert_fragment>
3376	#include <lights_fragment_begin>
3377	#include <lights_fragment_maps>
3378	#include <lights_fragment_end>
3379	#include <aomap_fragment>
3380	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3381	#include <envmap_fragment>
3382	#include <opaque_fragment>
3383	#include <tonemapping_fragment>
3384	#include <colorspace_fragment>
3385	#include <fog_fragment>
3386	#include <premultiplied_alpha_fragment>
3387	#include <dithering_fragment>
3388}`,meshmatcap_vert:`#define MATCAP
3389varying vec3 vViewPosition;
3390#include <common>
3391#include <batching_pars_vertex>
3392#include <uv_pars_vertex>
3393#include <color_pars_vertex>
3394#include <displacementmap_pars_vertex>
3395#include <fog_pars_vertex>
3396#include <normal_pars_vertex>
3397#include <morphtarget_pars_vertex>
3398#include <skinning_pars_vertex>
3399#include <logdepthbuf_pars_vertex>
3400#include <clipping_planes_pars_vertex>
3401void main() {
3402	#include <uv_vertex>
3403	#include <color_vertex>
3404	#include <morphinstance_vertex>
3405	#include <morphcolor_vertex>
3406	#include <batching_vertex>
3407	#include <beginnormal_vertex>
3408	#include <morphnormal_vertex>
3409	#include <skinbase_vertex>
3410	#include <skinnormal_vertex>
3411	#include <defaultnormal_vertex>
3412	#include <normal_vertex>
3413	#include <begin_vertex>
3414	#include <morphtarget_vertex>
3415	#include <skinning_vertex>
3416	#include <displacementmap_vertex>
3417	#include <project_vertex>
3418	#include <logdepthbuf_vertex>
3419	#include <clipping_planes_vertex>
3420	#include <fog_vertex>
3421	vViewPosition = - mvPosition.xyz;
3422}`,meshmatcap_frag:`#define MATCAP
3423uniform vec3 diffuse;
3424uniform float opacity;
3425uniform sampler2D matcap;
3426varying vec3 vViewPosition;
3427#include <common>
3428#include <dithering_pars_fragment>
3429#include <color_pars_fragment>
3430#include <uv_pars_fragment>
3431#include <map_pars_fragment>
3432#include <alphamap_pars_fragment>
3433#include <alphatest_pars_fragment>
3434#include <alphahash_pars_fragment>
3435#include <fog_pars_fragment>
3436#include <normal_pars_fragment>
3437#include <bumpmap_pars_fragment>
3438#include <normalmap_pars_fragment>
3439#include <logdepthbuf_pars_fragment>
3440#include <clipping_planes_pars_fragment>
3441void main() {
3442	vec4 diffuseColor = vec4( diffuse, opacity );
3443	#include <clipping_planes_fragment>
3444	#include <logdepthbuf_fragment>
3445	#include <map_fragment>
3446	#include <color_fragment>
3447	#include <alphamap_fragment>
3448	#include <alphatest_fragment>
3449	#include <alphahash_fragment>
3450	#include <normal_fragment_begin>
3451	#include <normal_fragment_maps>
3452	vec3 viewDir = normalize( vViewPosition );
3453	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3454	vec3 y = cross( viewDir, x );
3455	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3456	#ifdef USE_MATCAP
3457		vec4 matcapColor = texture2D( matcap, uv );
3458	#else
3459		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3460	#endif
3461	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3462	#include <opaque_fragment>
3463	#include <tonemapping_fragment>
3464	#include <colorspace_fragment>
3465	#include <fog_fragment>
3466	#include <premultiplied_alpha_fragment>
3467	#include <dithering_fragment>
3468}`,meshnormal_vert:`#define NORMAL
3469#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3470	varying vec3 vViewPosition;
3471#endif
3472#include <common>
3473#include <batching_pars_vertex>
3474#include <uv_pars_vertex>
3475#include <displacementmap_pars_vertex>
3476#include <normal_pars_vertex>
3477#include <morphtarget_pars_vertex>
3478#include <skinning_pars_vertex>
3479#include <logdepthbuf_pars_vertex>
3480#include <clipping_planes_pars_vertex>
3481void main() {
3482	#include <uv_vertex>
3483	#include <batching_vertex>
3484	#include <beginnormal_vertex>
3485	#include <morphinstance_vertex>
3486	#include <morphnormal_vertex>
3487	#include <skinbase_vertex>
3488	#include <skinnormal_vertex>
3489	#include <defaultnormal_vertex>
3490	#include <normal_vertex>
3491	#include <begin_vertex>
3492	#include <morphtarget_vertex>
3493	#include <skinning_vertex>
3494	#include <displacementmap_vertex>
3495	#include <project_vertex>
3496	#include <logdepthbuf_vertex>
3497	#include <clipping_planes_vertex>
3498#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3499	vViewPosition = - mvPosition.xyz;
3500#endif
3501}`,meshnormal_frag:`#define NORMAL
3502uniform float opacity;
3503#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3504	varying vec3 vViewPosition;
3505#endif
3506#include <uv_pars_fragment>
3507#include <normal_pars_fragment>
3508#include <bumpmap_pars_fragment>
3509#include <normalmap_pars_fragment>
3510#include <logdepthbuf_pars_fragment>
3511#include <clipping_planes_pars_fragment>
3512void main() {
3513	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3514	#include <clipping_planes_fragment>
3515	#include <logdepthbuf_fragment>
3516	#include <normal_fragment_begin>
3517	#include <normal_fragment_maps>
3518	gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );
3519	#ifdef OPAQUE
3520		gl_FragColor.a = 1.0;
3521	#endif
3522}`,meshphong_vert:`#define PHONG
3523varying vec3 vViewPosition;
3524#include <common>
3525#include <batching_pars_vertex>
3526#include <uv_pars_vertex>
3527#include <displacementmap_pars_vertex>
3528#include <envmap_pars_vertex>
3529#include <color_pars_vertex>
3530#include <fog_pars_vertex>
3531#include <normal_pars_vertex>
3532#include <morphtarget_pars_vertex>
3533#include <skinning_pars_vertex>
3534#include <shadowmap_pars_vertex>
3535#include <logdepthbuf_pars_vertex>
3536#include <clipping_planes_pars_vertex>
3537void main() {
3538	#include <uv_vertex>
3539	#include <color_vertex>
3540	#include <morphcolor_vertex>
3541	#include <batching_vertex>
3542	#include <beginnormal_vertex>
3543	#include <morphinstance_vertex>
3544	#include <morphnormal_vertex>
3545	#include <skinbase_vertex>
3546	#include <skinnormal_vertex>
3547	#include <defaultnormal_vertex>
3548	#include <normal_vertex>
3549	#include <begin_vertex>
3550	#include <morphtarget_vertex>
3551	#include <skinning_vertex>
3552	#include <displacementmap_vertex>
3553	#include <project_vertex>
3554	#include <logdepthbuf_vertex>
3555	#include <clipping_planes_vertex>
3556	vViewPosition = - mvPosition.xyz;
3557	#include <worldpos_vertex>
3558	#include <envmap_vertex>
3559	#include <shadowmap_vertex>
3560	#include <fog_vertex>
3561}`,meshphong_frag:`#define PHONG
3562uniform vec3 diffuse;
3563uniform vec3 emissive;
3564uniform vec3 specular;
3565uniform float shininess;
3566uniform float opacity;
3567#include <common>
3568#include <dithering_pars_fragment>
3569#include <color_pars_fragment>
3570#include <uv_pars_fragment>
3571#include <map_pars_fragment>
3572#include <alphamap_pars_fragment>
3573#include <alphatest_pars_fragment>
3574#include <alphahash_pars_fragment>
3575#include <aomap_pars_fragment>
3576#include <lightmap_pars_fragment>
3577#include <emissivemap_pars_fragment>
3578#include <cube_uv_reflection_fragment>
3579#include <envmap_common_pars_fragment>
3580#include <envmap_pars_fragment>
3581#include <envmap_physical_pars_fragment>
3582#include <fog_pars_fragment>
3583#include <bsdfs>
3584#include <lights_pars_begin>
3585#include <normal_pars_fragment>
3586#include <lights_phong_pars_fragment>
3587#include <shadowmap_pars_fragment>
3588#include <bumpmap_pars_fragment>
3589#include <normalmap_pars_fragment>
3590#include <specularmap_pars_fragment>
3591#include <logdepthbuf_pars_fragment>
3592#include <clipping_planes_pars_fragment>
3593void main() {
3594	vec4 diffuseColor = vec4( diffuse, opacity );
3595	#include <clipping_planes_fragment>
3596	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3597	vec3 totalEmissiveRadiance = emissive;
3598	#include <logdepthbuf_fragment>
3599	#include <map_fragment>
3600	#include <color_fragment>
3601	#include <alphamap_fragment>
3602	#include <alphatest_fragment>
3603	#include <alphahash_fragment>
3604	#include <specularmap_fragment>
3605	#include <normal_fragment_begin>
3606	#include <normal_fragment_maps>
3607	#include <emissivemap_fragment>
3608	#include <lights_phong_fragment>
3609	#include <lights_fragment_begin>
3610	#include <lights_fragment_maps>
3611	#include <lights_fragment_end>
3612	#include <aomap_fragment>
3613	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3614	#include <envmap_fragment>
3615	#include <opaque_fragment>
3616	#include <tonemapping_fragment>
3617	#include <colorspace_fragment>
3618	#include <fog_fragment>
3619	#include <premultiplied_alpha_fragment>
3620	#include <dithering_fragment>
3621}`,meshphysical_vert:`#define STANDARD
3622varying vec3 vViewPosition;
3623#ifdef USE_TRANSMISSION
3624	varying vec3 vWorldPosition;
3625#endif
3626#include <common>
3627#include <batching_pars_vertex>
3628#include <uv_pars_vertex>
3629#include <displacementmap_pars_vertex>
3630#include <color_pars_vertex>
3631#include <fog_pars_vertex>
3632#include <normal_pars_vertex>
3633#include <morphtarget_pars_vertex>
3634#include <skinning_pars_vertex>
3635#include <shadowmap_pars_vertex>
3636#include <logdepthbuf_pars_vertex>
3637#include <clipping_planes_pars_vertex>
3638void main() {
3639	#include <uv_vertex>
3640	#include <color_vertex>
3641	#include <morphinstance_vertex>
3642	#include <morphcolor_vertex>
3643	#include <batching_vertex>
3644	#include <beginnormal_vertex>
3645	#include <morphnormal_vertex>
3646	#include <skinbase_vertex>
3647	#include <skinnormal_vertex>
3648	#include <defaultnormal_vertex>
3649	#include <normal_vertex>
3650	#include <begin_vertex>
3651	#include <morphtarget_vertex>
3652	#include <skinning_vertex>
3653	#include <displacementmap_vertex>
3654	#include <project_vertex>
3655	#include <logdepthbuf_vertex>
3656	#include <clipping_planes_vertex>
3657	vViewPosition = - mvPosition.xyz;
3658	#include <worldpos_vertex>
3659	#include <shadowmap_vertex>
3660	#include <fog_vertex>
3661#ifdef USE_TRANSMISSION
3662	vWorldPosition = worldPosition.xyz;
3663#endif
3664}`,meshphysical_frag:`#define STANDARD
3665#ifdef PHYSICAL
3666	#define IOR
3667	#define USE_SPECULAR
3668#endif
3669uniform vec3 diffuse;
3670uniform vec3 emissive;
3671uniform float roughness;
3672uniform float metalness;
3673uniform float opacity;
3674#ifdef IOR
3675	uniform float ior;
3676#endif
3677#ifdef USE_SPECULAR
3678	uniform float specularIntensity;
3679	uniform vec3 specularColor;
3680	#ifdef USE_SPECULAR_COLORMAP
3681		uniform sampler2D specularColorMap;
3682	#endif
3683	#ifdef USE_SPECULAR_INTENSITYMAP
3684		uniform sampler2D specularIntensityMap;
3685	#endif
3686#endif
3687#ifdef USE_CLEARCOAT
3688	uniform float clearcoat;
3689	uniform float clearcoatRoughness;
3690#endif
3691#ifdef USE_DISPERSION
3692	uniform float dispersion;
3693#endif
3694#ifdef USE_IRIDESCENCE
3695	uniform float iridescence;
3696	uniform float iridescenceIOR;
3697	uniform float iridescenceThicknessMinimum;
3698	uniform float iridescenceThicknessMaximum;
3699#endif
3700#ifdef USE_SHEEN
3701	uniform vec3 sheenColor;
3702	uniform float sheenRoughness;
3703	#ifdef USE_SHEEN_COLORMAP
3704		uniform sampler2D sheenColorMap;
3705	#endif
3706	#ifdef USE_SHEEN_ROUGHNESSMAP
3707		uniform sampler2D sheenRoughnessMap;
3708	#endif
3709#endif
3710#ifdef USE_ANISOTROPY
3711	uniform vec2 anisotropyVector;
3712	#ifdef USE_ANISOTROPYMAP
3713		uniform sampler2D anisotropyMap;
3714	#endif
3715#endif
3716varying vec3 vViewPosition;
3717#include <common>
3718#include <dithering_pars_fragment>
3719#include <color_pars_fragment>
3720#include <uv_pars_fragment>
3721#include <map_pars_fragment>
3722#include <alphamap_pars_fragment>
3723#include <alphatest_pars_fragment>
3724#include <alphahash_pars_fragment>
3725#include <aomap_pars_fragment>
3726#include <lightmap_pars_fragment>
3727#include <emissivemap_pars_fragment>
3728#include <iridescence_fragment>
3729#include <cube_uv_reflection_fragment>
3730#include <envmap_common_pars_fragment>
3731#include <envmap_physical_pars_fragment>
3732#include <fog_pars_fragment>
3733#include <lights_pars_begin>
3734#include <normal_pars_fragment>
3735#include <lights_physical_pars_fragment>
3736#include <transmission_pars_fragment>
3737#include <shadowmap_pars_fragment>
3738#include <bumpmap_pars_fragment>
3739#include <normalmap_pars_fragment>
3740#include <clearcoat_pars_fragment>
3741#include <iridescence_pars_fragment>
3742#include <roughnessmap_pars_fragment>
3743#include <metalnessmap_pars_fragment>
3744#include <logdepthbuf_pars_fragment>
3745#include <clipping_planes_pars_fragment>
3746void main() {
3747	vec4 diffuseColor = vec4( diffuse, opacity );
3748	#include <clipping_planes_fragment>
3749	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3750	vec3 totalEmissiveRadiance = emissive;
3751	#include <logdepthbuf_fragment>
3752	#include <map_fragment>
3753	#include <color_fragment>
3754	#include <alphamap_fragment>
3755	#include <alphatest_fragment>
3756	#include <alphahash_fragment>
3757	#include <roughnessmap_fragment>
3758	#include <metalnessmap_fragment>
3759	#include <normal_fragment_begin>
3760	#include <normal_fragment_maps>
3761	#include <clearcoat_normal_fragment_begin>
3762	#include <clearcoat_normal_fragment_maps>
3763	#include <emissivemap_fragment>
3764	#include <lights_physical_fragment>
3765	#include <lights_fragment_begin>
3766	#include <lights_fragment_maps>
3767	#include <lights_fragment_end>
3768	#include <aomap_fragment>
3769	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3770	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3771	#include <transmission_fragment>
3772	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3773	#ifdef USE_SHEEN
3774 
3775		outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;
3776 
3777 	#endif
3778	#ifdef USE_CLEARCOAT
3779		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3780		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3781		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3782	#endif
3783	#include <opaque_fragment>
3784	#include <tonemapping_fragment>
3785	#include <colorspace_fragment>
3786	#include <fog_fragment>
3787	#include <premultiplied_alpha_fragment>
3788	#include <dithering_fragment>
3789}`,meshtoon_vert:`#define TOON
3790varying vec3 vViewPosition;
3791#include <common>
3792#include <batching_pars_vertex>
3793#include <uv_pars_vertex>
3794#include <displacementmap_pars_vertex>
3795#include <color_pars_vertex>
3796#include <fog_pars_vertex>
3797#include <normal_pars_vertex>
3798#include <morphtarget_pars_vertex>
3799#include <skinning_pars_vertex>
3800#include <shadowmap_pars_vertex>
3801#include <logdepthbuf_pars_vertex>
3802#include <clipping_planes_pars_vertex>
3803void main() {
3804	#include <uv_vertex>
3805	#include <color_vertex>
3806	#include <morphinstance_vertex>
3807	#include <morphcolor_vertex>
3808	#include <batching_vertex>
3809	#include <beginnormal_vertex>
3810	#include <morphnormal_vertex>
3811	#include <skinbase_vertex>
3812	#include <skinnormal_vertex>
3813	#include <defaultnormal_vertex>
3814	#include <normal_vertex>
3815	#include <begin_vertex>
3816	#include <morphtarget_vertex>
3817	#include <skinning_vertex>
3818	#include <displacementmap_vertex>
3819	#include <project_vertex>
3820	#include <logdepthbuf_vertex>
3821	#include <clipping_planes_vertex>
3822	vViewPosition = - mvPosition.xyz;
3823	#include <worldpos_vertex>
3824	#include <shadowmap_vertex>
3825	#include <fog_vertex>
3826}`,meshtoon_frag:`#define TOON
3827uniform vec3 diffuse;
3828uniform vec3 emissive;
3829uniform float opacity;
3830#include <common>
3831#include <dithering_pars_fragment>
3832#include <color_pars_fragment>
3833#include <uv_pars_fragment>
3834#include <map_pars_fragment>
3835#include <alphamap_pars_fragment>
3836#include <alphatest_pars_fragment>
3837#include <alphahash_pars_fragment>
3838#include <aomap_pars_fragment>
3839#include <lightmap_pars_fragment>
3840#include <emissivemap_pars_fragment>
3841#include <gradientmap_pars_fragment>
3842#include <fog_pars_fragment>
3843#include <bsdfs>
3844#include <lights_pars_begin>
3845#include <normal_pars_fragment>
3846#include <lights_toon_pars_fragment>
3847#include <shadowmap_pars_fragment>
3848#include <bumpmap_pars_fragment>
3849#include <normalmap_pars_fragment>
3850#include <logdepthbuf_pars_fragment>
3851#include <clipping_planes_pars_fragment>
3852void main() {
3853	vec4 diffuseColor = vec4( diffuse, opacity );
3854	#include <clipping_planes_fragment>
3855	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3856	vec3 totalEmissiveRadiance = emissive;
3857	#include <logdepthbuf_fragment>
3858	#include <map_fragment>
3859	#include <color_fragment>
3860	#include <alphamap_fragment>
3861	#include <alphatest_fragment>
3862	#include <alphahash_fragment>
3863	#include <normal_fragment_begin>
3864	#include <normal_fragment_maps>
3865	#include <emissivemap_fragment>
3866	#include <lights_toon_fragment>
3867	#include <lights_fragment_begin>
3868	#include <lights_fragment_maps>
3869	#include <lights_fragment_end>
3870	#include <aomap_fragment>
3871	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3872	#include <opaque_fragment>
3873	#include <tonemapping_fragment>
3874	#include <colorspace_fragment>
3875	#include <fog_fragment>
3876	#include <premultiplied_alpha_fragment>
3877	#include <dithering_fragment>
3878}`,points_vert:`uniform float size;
3879uniform float scale;
3880#include <common>
3881#include <color_pars_vertex>
3882#include <fog_pars_vertex>
3883#include <morphtarget_pars_vertex>
3884#include <logdepthbuf_pars_vertex>
3885#include <clipping_planes_pars_vertex>
3886#ifdef USE_POINTS_UV
3887	varying vec2 vUv;
3888	uniform mat3 uvTransform;
3889#endif
3890void main() {
3891	#ifdef USE_POINTS_UV
3892		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3893	#endif
3894	#include <color_vertex>
3895	#include <morphinstance_vertex>
3896	#include <morphcolor_vertex>
3897	#include <begin_vertex>
3898	#include <morphtarget_vertex>
3899	#include <project_vertex>
3900	gl_PointSize = size;
3901	#ifdef USE_SIZEATTENUATION
3902		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3903		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3904	#endif
3905	#include <logdepthbuf_vertex>
3906	#include <clipping_planes_vertex>
3907	#include <worldpos_vertex>
3908	#include <fog_vertex>
3909}`,points_frag:`uniform vec3 diffuse;
3910uniform float opacity;
3911#include <common>
3912#include <color_pars_fragment>
3913#include <map_particle_pars_fragment>
3914#include <alphatest_pars_fragment>
3915#include <alphahash_pars_fragment>
3916#include <fog_pars_fragment>
3917#include <logdepthbuf_pars_fragment>
3918#include <clipping_planes_pars_fragment>
3919void main() {
3920	vec4 diffuseColor = vec4( diffuse, opacity );
3921	#include <clipping_planes_fragment>
3922	vec3 outgoingLight = vec3( 0.0 );
3923	#include <logdepthbuf_fragment>
3924	#include <map_particle_fragment>
3925	#include <color_fragment>
3926	#include <alphatest_fragment>
3927	#include <alphahash_fragment>
3928	outgoingLight = diffuseColor.rgb;
3929	#include <opaque_fragment>
3930	#include <tonemapping_fragment>
3931	#include <colorspace_fragment>
3932	#include <fog_fragment>
3933	#include <premultiplied_alpha_fragment>
3934}`,shadow_vert:`#include <common>
3935#include <batching_pars_vertex>
3936#include <fog_pars_vertex>
3937#include <morphtarget_pars_vertex>
3938#include <skinning_pars_vertex>
3939#include <logdepthbuf_pars_vertex>
3940#include <shadowmap_pars_vertex>
3941void main() {
3942	#include <batching_vertex>
3943	#include <beginnormal_vertex>
3944	#include <morphinstance_vertex>
3945	#include <morphnormal_vertex>
3946	#include <skinbase_vertex>
3947	#include <skinnormal_vertex>
3948	#include <defaultnormal_vertex>
3949	#include <begin_vertex>
3950	#include <morphtarget_vertex>
3951	#include <skinning_vertex>
3952	#include <project_vertex>
3953	#include <logdepthbuf_vertex>
3954	#include <worldpos_vertex>
3955	#include <shadowmap_vertex>
3956	#include <fog_vertex>
3957}`,shadow_frag:`uniform vec3 color;
3958uniform float opacity;
3959#include <common>
3960#include <fog_pars_fragment>
3961#include <bsdfs>
3962#include <lights_pars_begin>
3963#include <logdepthbuf_pars_fragment>
3964#include <shadowmap_pars_fragment>
3965#include <shadowmask_pars_fragment>
3966void main() {
3967	#include <logdepthbuf_fragment>
3968	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3969	#include <tonemapping_fragment>
3970	#include <colorspace_fragment>
3971	#include <fog_fragment>
3972	#include <premultiplied_alpha_fragment>
3973}`,sprite_vert:`uniform float rotation;
3974uniform vec2 center;
3975#include <common>
3976#include <uv_pars_vertex>
3977#include <fog_pars_vertex>
3978#include <logdepthbuf_pars_vertex>
3979#include <clipping_planes_pars_vertex>
3980void main() {
3981	#include <uv_vertex>
3982	vec4 mvPosition = modelViewMatrix[ 3 ];
3983	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3984	#ifndef USE_SIZEATTENUATION
3985		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3986		if ( isPerspective ) scale *= - mvPosition.z;
3987	#endif
3988	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3989	vec2 rotatedPosition;
3990	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3991	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3992	mvPosition.xy += rotatedPosition;
3993	gl_Position = projectionMatrix * mvPosition;
3994	#include <logdepthbuf_vertex>
3995	#include <clipping_planes_vertex>
3996	#include <fog_vertex>
3997}`,sprite_frag:`uniform vec3 diffuse;
3998uniform float opacity;
3999#include <common>
4000#include <uv_pars_fragment>
4001#include <map_pars_fragment>
4002#include <alphamap_pars_fragment>
4003#include <alphatest_pars_fragment>
4004#include <alphahash_pars_fragment>
4005#include <fog_pars_fragment>
4006#include <logdepthbuf_pars_fragment>
4007#include <clipping_planes_pars_fragment>
4008void main() {
4009	vec4 diffuseColor = vec4( diffuse, opacity );
4010	#include <clipping_planes_fragment>
4011	vec3 outgoingLight = vec3( 0.0 );
4012	#include <logdepthbuf_fragment>
4013	#include <map_fragment>
4014	#include <alphamap_fragment>
4015	#include <alphatest_fragment>
4016	#include <alphahash_fragment>
4017	outgoingLight = diffuseColor.rgb;
4018	#include <opaque_fragment>
4019	#include <tonemapping_fragment>
4020	#include <colorspace_fragment>
4021	#include <fog_fragment>
4022}`},$={common:{diffuse:{value:new Wh(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new qm},alphaMap:{value:null},alphaMapTransform:{value:new qm},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new qm}},envmap:{envMap:{value:null},envMapRotation:{value:new qm},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new qm}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new qm}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new qm},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new qm},normalScale:{value:new Um(1,1)}}
vendor: 17,582 bytes, lines 4022-4062
4022,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new qm},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new qm}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new qm}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new qm}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Wh(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new Q},probesMax:{value:new Q},probesResolution:{value:new Q}},points:{diffuse:{value:new Wh(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new qm},alphaTest:{value:0},uvTransform:{value:new qm}},sprite:{diffuse:{value:new Wh(16777215)},opacity:{value:1},center:{value:new Um(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new qm},alphaMap:{value:null},alphaMapTransform:{value:new qm},alphaTest:{value:0}}},Ux={basic:{uniforms:Hf([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.fog]),vertexShader:Hx.meshbasic_vert,fragmentShader:Hx.meshbasic_frag},lambert:{uniforms:Hf([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new Wh(0)},envMapIntensity:{value:1}}]),vertexShader:Hx.meshlambert_vert,fragmentShader:Hx.meshlambert_frag},phong:{uniforms:Hf([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new Wh(0)},specular:{value:new Wh(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Hx.meshphong_vert,fragmentShader:Hx.meshphong_frag},standard:{uniforms:Hf([$.common,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.roughnessmap,$.metalnessmap,$.fog,$.lights,{emissive:{value:new Wh(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Hx.meshphysical_vert,fragmentShader:Hx.meshphysical_frag},toon:{uniforms:Hf([$.common,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.gradientmap,$.fog,$.lights,{emissive:{value:new Wh(0)}}]),vertexShader:Hx.meshtoon_vert,fragmentShader:Hx.meshtoon_frag},matcap:{uniforms:Hf([$.common,$.bumpmap,$.normalmap,$.displacementmap,$.fog,{matcap:{value:null}}]),vertexShader:Hx.meshmatcap_vert,fragmentShader:Hx.meshmatcap_frag},points:{uniforms:Hf([$.points,$.fog]),vertexShader:Hx.points_vert,fragmentShader:Hx.points_frag},dashed:{uniforms:Hf([$.common,$.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Hx.linedashed_vert,fragmentShader:Hx.linedashed_frag},depth:{uniforms:Hf([$.common,$.displacementmap]),vertexShader:Hx.depth_vert,fragmentShader:Hx.depth_frag},normal:{uniforms:Hf([$.common,$.bumpmap,$.normalmap,$.displacementmap,{opacity:{value:1}}]),vertexShader:Hx.meshnormal_vert,fragmentShader:Hx.meshnormal_frag},sprite:{uniforms:Hf([$.sprite,$.fog]),vertexShader:Hx.sprite_vert,fragmentShader:Hx.sprite_frag},background:{uniforms:{uvTransform:{value:new qm},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Hx.background_vert,fragmentShader:Hx.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new qm}},vertexShader:Hx.backgroundCube_vert,fragmentShader:Hx.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Hx.cube_vert,fragmentShader:Hx.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Hx.equirect_vert,fragmentShader:Hx.equirect_frag},distance:{uniforms:Hf([$.common,$.displacementmap,{referencePosition:{value:new Q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Hx.distance_vert,fragmentShader:Hx.distance_frag},shadow:{uniforms:Hf([$.lights,$.fog,{color:{value:new Wh(0)},opacity:{value:1}}]),vertexShader:Hx.shadow_vert,fragmentShader:Hx.shadow_frag}},Ux.physical={uniforms:Hf([Ux.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new qm},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new qm},clearcoatNormalScale:{value:new Um(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new qm},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new qm},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new qm},sheen:{value:0},sheenColor:{value:new Wh(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new qm},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new qm},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new qm},transmissionSamplerSize:{value:new Um},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new qm},attenuationDistance:{value:0},attenuationColor:{value:new Wh(0)},specularColor:{value:new Wh(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new qm},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new qm},anisotropyVector:{value:new Um},anisotropyMap:{value:null},anisotropyMapTransform:{value:new qm}}]),vertexShader:Hx.meshphysical_vert,fragmentShader:Hx.meshphysical_frag},Wx={r:0,b:0,g:0},Gx=new uh,Kx=new qm,Kx.set(-1,0,0,0,1,0,0,0,1),qx=4,Jx=[.125,.215,.35,.446,.526,.582],Yx=20,Xx=256,Zx=new dy,Qx=new Wh,$x=null,eS=0,tS=0,nS=!1,rS=new Q,iS=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=rS}=i;$x=this._renderer.getRenderTarget(),eS=this._renderer.getActiveCubeFace(),tS=this._renderer.getActiveMipmapLevel(),nS=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),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(){this._cubemapMaterial===null&&(this._cubemapMaterial=Xy(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Yy(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget($x,eS,tS),this._renderer.xr.enabled=nS,e.scissorTest=!1,Ky(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===301||e.mapping===302?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),$x=this._renderer.getRenderTarget(),eS=this._renderer.getActiveCubeFace(),tS=this._renderer.getActiveMipmapLevel(),nS=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:up,minFilter:up,generateMipmaps:!1,type:bp,format:Op,colorSpace:Om,depthBuffer:!1},r=Gy(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Gy(e,t,n);let{_lodMax:r}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=Wy(r)),this._blurMaterial=Jy(r,e,t),this._ggxMaterial=qy(r,e,t)}return r}_compileMaterial(e){let t=new d_(new zg,e);this._renderer.compile(t,Zx)}_sceneToCubeUV(e,t,n,r,i){let a=new oy(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],c=this._renderer,l=c.autoClear,u=c.toneMapping;c.getClearColor(Qx),c.toneMapping=0,c.autoClear=!1,c.state.buffers.depth.getReversed()&&(c.setRenderTarget(r),c.clearDepth(),c.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new d_(new pv,new $g({name:`PMREM.Background`,side:1,depthWrite:!1,depthTest:!1})));let d=this._backgroundBox,f=d.material,p=!1,m=e.background;m?m.isColor&&(f.color.copy(m),e.background=null,p=!0):(f.color.copy(Qx),p=!0);for(let t=0;t<6;t++){let n=t%3;n===0?(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+s[t],i.y,i.z)):n===1?(a.up.set(0,0,o[t]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+s[t],i.z)):(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+s[t]));let l=this._cubeSize;Ky(r,n*l,t>2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Xy()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Yy());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;Ky(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,Zx)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;t<r;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=n}_applyGGXFilter(e,t,n){let r=this._renderer,i=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;let s=a.uniforms,c=n/(this._lodMeshes.length-1),l=t/(this._lodMeshes.length-1),u=Math.sqrt(c*c-l*l)*(0+c*1.25),{_lodMax:d}=this,f=this._sizeLods[n],p=3*f*(n>d-qx?n-d+qx:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,Ky(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,Zx),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,Ky(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,Zx)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&Z(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/f,m=isFinite(i)?1+Math.floor(3*p):Yx;m>Yx&&X(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Yx}`);let h=[],g=0;for(let e=0;e<Yx;++e){let t=e/p,n=Math.exp(-t*t/2);h.push(n),e===0?g+=n:e<m&&(g+=2*n)}for(let e=0;e<h.length;e++)h[e]=h[e]/g;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=h,u.latitudinal.value=a===`latitudinal`,o&&(u.poleAxis.value=o);let{_lodMax:_}=this;u.dTheta.value=f,u.mipInt.value=_-n;let v=this._sizeLods[r];Ky(t,3*v*(r>_-qx?r-_+qx:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,Zx)}},aS=class extends sh{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new lv(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`
4023
4024				varying vec3 vWorldDirection;
4025
4026				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
4027
4028					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
4029
4030				}
4031
4032				void main() {
4033
4034					vWorldDirection = transformDirection( position, modelMatrix );
4035
4036					#include <begin_vertex>
4037					#include <project_vertex>
4038
4039				}
4040			`,fragmentShader:`
4041
4042				uniform sampler2D tEquirect;
4043
4044				varying vec3 vWorldDirection;
4045
4046				#include <common>
4047
4048				void main() {
4049
4050					vec3 direction = normalize( vWorldDirection );
4051
4052					vec2 sampleUV = equirectUv( direction );
4053
4054					gl_FragColor = texture2D( tEquirect, sampleUV );
4055
4056				}
4057			`},r=new pv(5,5,5),i=new vv({name:`CubemapFromEquirect`,uniforms:Vf(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new d_(r,i),o=t.minFilter;return t.minFilter===1008&&(t.minFilter=up),new by(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}},oS={1:`LINEAR_TONE_MAPPING`,2:`REINHARD_TONE_MAPPING`,3:`CINEON_TONE_MAPPING`,4:`ACES_FILMIC_TONE_MAPPING`,6:`AGX_TONE_MAPPING`,7:`NEUTRAL_TONE_MAPPING`,5:`CUSTOM_TONE_MAPPING`},sS=new ih,cS=new uv(1,1),lS=new ch,uS=new lh,dS=new lv,fS=[],pS=[],mS=new Float32Array(16),hS=new Float32Array(9),gS=new Float32Array(4),_S=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=kb(t.type)}},vS=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=Yb(t.type)}},yS=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let r=this.seq;for(let i=0,a=r.length;i!==a;++i){let a=r[i];a.setValue(e,t[a.id],n)}}},bS=/(\w+)(\])?(\[|\.)?/g,xS=class{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){let n=e.getActiveUniform(t,r);Zb(n,e.getUniformLocation(t,n.name),this)}let r=[],i=[];for(let t of this.seq)t.type===e.SAMPLER_2D_SHADOW||t.type===e.SAMPLER_CUBE_SHADOW||t.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(t):i.push(t);r.length>0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}},SS=37297,CS=0,wS=new qm,TS={1:`Linear`,2:`Reinhard`,3:`Cineon`,4:`ACESFilmic`,6:`AgX`,7:`Neutral`,5:`Custom`},ES=new Q,DS=/^[ \t]*#include +<([\w\d./]+)>/gm,OS=new Map,kS=/#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,AS={1:`SHADOWMAP_TYPE_PCF`,3:`SHADOWMAP_TYPE_VSM`},jS={301:`ENVMAP_TYPE_CUBE`,302:`ENVMAP_TYPE_CUBE`,306:`ENVMAP_TYPE_CUBE_UV`},MS={302:`ENVMAP_MODE_REFRACTION`},NS={0:`ENVMAP_BLENDING_MULTIPLY`,1:`ENVMAP_BLENDING_MIX`,2:`ENVMAP_BLENDING_ADD`},PS=0,FS=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){let r=this._getShaderCacheForMaterial(e);return r.has(t)===!1&&(r.add(t),t.usedTimes++),r.has(n)===!1&&(r.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new IS(e),t.set(e,n)),n}},IS=class{constructor(e){this.id=PS++,this.code=e,this.usedTimes=0}},LS=0,RS=`void main() {
4058	gl_Position = vec4( position, 1.0 );
4059}`,zS=`uniform sampler2D shadow_pass;
4060uniform vec2 resolution;
4061uniform float radius;
4062void main() {
4063	const float samples = float( VSM_SAMPLES );
4064	float mean = 0.0;
4065	float squared_mean = 0.0;
4066	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
4067	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
4068	for ( float i = 0.0; i < samples; i ++ ) {
4069		float uvOffset = uvStart + i * uvStride;
4070		#ifdef HORIZONTAL_PASS
4071			vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;
4072			mean += distribution.x;
4073			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
4074		#else
4075			float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;
4076			mean += depth;
4077			squared_mean += depth * depth;
4078		#endif
4079	}
4080	mean = mean / samples;
4081	squared_mean = squared_mean / samples;
4082	float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
4083	gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
4084}`,BS=[new Q(1,0,0),new Q(-1,0,0),new Q(0,1,0),new Q(0,-1,0),new Q(0,0,1),new Q(0,0,-1)],VS=[new Q(0,-1,0),new Q(0,-1,0),new Q(0,0,1),new Q(0,0,-1),new Q(0,-1,0),new Q(0,-1,0)],HS=new uh,US=new Q,WS=new Q,GS=`
4085void main() {
4086
4087	gl_Position = vec4( position, 1.0 );
4088
4089}`,KS=`
4090uniform sampler2DArray depthColor;
4091uniform float depthWidth;
4092uniform float depthHeight;
4093
4094void main() {
4095
4096	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
4097
4098	if ( coord.x >= 1.0 ) {
4099
4100		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
4101
4102	} else {
4103
4104		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
4105
4106	}
4107
4108}`,qS=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new fv(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new vv({vertexShader:GS,fragmentShader:KS,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new d_(new mv(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},JS=class extends Lm{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new qS,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new Um,C=null,w=new oy;w.viewport=new ah;let T=new oy;T.viewport=new ah;let E=[w,T],D=new xy,O=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new Bh,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new Bh,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new Bh,b[e]=t),t.getHandSpace()};function A(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function j(){r.removeEventListener(`select`,A),r.removeEventListener(`selectstart`,A),r.removeEventListener(`selectend`,A),r.removeEventListener(`squeeze`,A),r.removeEventListener(`squeezestart`,A),r.removeEventListener(`squeezeend`,A),r.removeEventListener(`end`,j),r.removeEventListener(`inputsourceschange`,M);for(let e=0;e<b.length;e++){let t=x[e];t!==null&&(x[e]=null,b[e].disconnect(t))}O=null,k=null,h.reset();for(let e in g)delete g[e];e.setRenderTarget(v),f=null,d=null,u=null,r=null,y=null,ie.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(S.width,S.height,!1),n.dispatchEvent({type:`sessionend`})}this.setFramebufferScaleFactor=function(e){i=e,n.isPresenting===!0&&X(`WebXRManager: Cannot change framebuffer scale while presenting.`)},this.setReferenceSpaceType=function(e){o=e,n.isPresenting===!0&&X(`WebXRManager: Cannot change reference space type while presenting.`)},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return d===null?f:d},this.getBinding=function(){return u===null&&m&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return p}
vendor: 6,718 bytes, line 4108
4108,this.getSession=function(){return r},this.setSession=async function(l){if(r=l,r!==null){if(v=e.getRenderTarget(),r.addEventListener(`select`,A),r.addEventListener(`selectstart`,A),r.addEventListener(`selectend`,A),r.addEventListener(`squeeze`,A),r.addEventListener(`squeezestart`,A),r.addEventListener(`squeezeend`,A),r.addEventListener(`end`,j),r.addEventListener(`inputsourceschange`,M),_.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(S),m&&`createProjectionLayer`in XRWebGLBinding.prototype){let n=null,a=null,o=null;_.depth&&(o=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=_.stencil?Ap:kp,a=_.stencil?Cp:vp);let s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=this.getBinding(),d=u.createProjectionLayer(s),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new sh(d.textureWidth,d.textureHeight,{format:Op,type:pp,depthTexture:new uv(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{let n={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:i};f=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new sh(f.framebufferWidth,f.framebufferHeight,{format:Op,type:pp,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(s),c=null,a=await r.requestReferenceSpace(o),ie.setContext(r),ie.start(),n.isPresenting=!0,n.dispatchEvent({type:`sessionstart`})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return h.getDepthTexture()};function M(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],r=x.indexOf(n);r>=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],r=x.indexOf(n);if(r===-1){for(let e=0;e<b.length;e++)if(e>=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let N=new Q,P=new Q;function F(e,t,n){N.setFromMatrixPosition(t.matrixWorld),P.setFromMatrixPosition(n.matrixWorld);let r=N.distanceTo(P),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function ee(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||k!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,k=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&-5,T.layers.mask=D.layers.mask&-3;let i=e.parent,a=D.cameras;ee(D,i);for(let e=0;e<a.length;e++)ee(a[e],i);a.length===2?F(D,w,T):D.projectionMatrix.copy(w.projectionMatrix),te(e,D,i)};function te(e,t,n){n===null?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld)),e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=Vm*2*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}this.getCamera=function(){return D},this.getFoveation=function(){if(d!==null||f!==null)return s},this.setFoveation=function(e){s=e,d!==null&&(d.fixedFoveation=e),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=e)},this.hasDepthSensing=function(){return h.texture!==null},this.getDepthSensingMesh=function(){return h.getMesh(D)},this.getCameraTexture=function(e){return g[e]};let ne=null;function re(t,i){if(l=i.getViewerPose(c||a),p=i,l!==null){let t=l.views;f!==null&&(e.setRenderTargetFramebuffer(y,f.framebuffer),e.setRenderTarget(y));let i=!1;t.length!==D.cameras.length&&(D.cameras.length=0,i=!0);for(let n=0;n<t.length;n++){let r=t[n],a=null;if(f!==null)a=f.getViewport(r);else{let t=u.getViewSubImage(d,r);a=t.viewport,n===0&&(e.setRenderTargetTextures(y,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(y))}let o=E[n];o===void 0&&(o=new oy,o.layers.enable(n),o.viewport=new ah,E[n]=o),o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(r.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),n===0&&(D.matrix.copy(o.matrix),D.matrix.decompose(D.position,D.quaternion,D.scale)),i===!0&&D.cameras.push(o)}let a=r.enabledFeatures;if(a&&a.includes(`depth-sensing`)&&r.depthUsage==`gpu-optimized`&&m){u=n.getBinding();let e=u.getDepthInformation(t[0]);e&&e.isValid&&e.texture&&h.init(e,r.renderState)}if(a&&a.includes(`camera-access`)&&m){e.state.unbindTexture(),u=n.getBinding();for(let e=0;e<t.length;e++){let n=t[e].camera;if(n){let e=g[n];e||(e=new fv,g[n]=e);let t=u.getCameraImage(n);e.sourceTexture=t}}}}for(let e=0;e<b.length;e++){let t=x[e],n=b[e];t!==null&&n!==void 0&&n.update(t,i,c||a)}ne&&ne(t,i),i.detectedPlanes&&n.dispatchEvent({type:`planesdetected`,data:i}),p=null}let ie=new Ly;ie.setAnimationLoop(re),this.setAnimationLoop=function(e){ne=e},this.dispose=function(){}}},YS=new uh,XS=new qm,XS.set(-1,0,0,0,1,0,0,0,1),ZS=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10
vendor: 9,029 bytes, line 4108
4108751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),QS=null,$S=class{constructor(e={}){let{canvas:t=rf(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=pp}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([Fp,Pp,Mp]),g=new Set([pp,vp,gp,Cp,xp,Sp]),_=new Uint32Array(4),v=new Int32Array(4),y=new Q,b=null,x=null,S=[],C=[],w=null;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.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let T=this,E=!1,D=null,O=null,k=null,A=null;this._outputColorSpace=Dm;let j=0,M=0,N=null,P=-1,F=null,ee=new ah,te=new ah,ne=null,re=new Wh(0),ie=0,I=t.width,ae=t.height,L=1,oe=null,se=null,ce=new ah(0,0,I,ae),R=new ah(0,0,I,ae),le=!1,z=new U_,B=!1,V=!1,ue=new uh,de=new Q,fe=new ah,pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},me=!1;function he(){return N===null?L:1}let H=n;function U(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r185`),t.addEventListener(`webglcontextlost`,Ie,!1),t.addEventListener(`webglcontextrestored`,Le,!1),t.addEventListener(`webglcontextcreationerror`,Re,!1),H===null){let t=`webgl2`;if(H=U(t,e),H===null)throw U(t)?Error(`THREE.WebGLRenderer: Error creating WebGL context with your selected attributes.`):Error(`THREE.WebGLRenderer: Error creating WebGL context.`)}}catch(e){throw Z(`WebGLRenderer: `+e.message),e}let W,ge,G,_e,K,q,ve,ye,be,xe,Se,Ce,we,J,Te,Ee,De,Oe,ke,Ae,je,Me,Ne;function Pe(){W=new $y(H),W.init(),je=new Rx(H,W),ge=new Hy(H,W,e,je),G=new Ix(H,W),ge.reversedDepthBuffer&&d&&G.buffers.depth.setReversed(!0),O=H.createFramebuffer(),k=H.createFramebuffer(),A=H.createFramebuffer(),_e=new nb(H),K=new wx,q=new Lx(H,W,G,K,ge,je,_e),ve=new Qy(T),ye=new Ry(H),Me=new By(H,ye),be=new eb(H,ye,_e,Me),xe=new ib(H,be,ye,Me,_e),Oe=new rb(H,ge,q),Te=new Uy(K),Se=new Cx(T,ve,W,ge,Me,Te),Ce=new zx(T,K),we=new Ox,J=new Px(W),De=new zy(T,ve,G,xe,p,s),Ee=new Fx(T,xe,ge),Ne=new Bx(H,_e,ge,G),ke=new Vy(H,W,_e),Ae=new tb(H,W,_e),_e.programs=Se.programs,T.capabilities=ge,T.extensions=W,T.properties=K,T.renderLists=we,T.shadowMap=Ee,T.state=G,T.info=_e}Pe(),m!==1009&&(w=new ab(m,t.width,t.height,o,r,i));let Fe=new JS(T,H);this.xr=Fe,this.getContext=function(){return H},this.getContextAttributes=function(){return H.getContextAttributes()},this.forceContextLoss=function(){let e=W.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=W.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(e){e!==void 0&&(L=e,this.setSize(I,ae,!1))},this.getSize=function(e){return e.set(I,ae)},this.setSize=function(e,n,r=!0){if(Fe.isPresenting){X(`WebGLRenderer: Can't change size while VR device is presenting.`);return}I=e,ae=n,t.width=Math.floor(e*L),t.height=Math.floor(n*L),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),w!==null&&w.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(I*L,ae*L).floor()},this.setDrawingBufferSize=function(e,n,r){I=e,ae=n,L=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){Z(`WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t<e.length;t++)if(e[t].isOutputPass===!0){X(`WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.`);break}}w.setEffects(e||[])},this.getCurrentViewport=function(e){return e.copy(ee)},this.getViewport=function(e){return e.copy(ce)},this.setViewport=function(e,t,n,r){e.isVector4?ce.set(e.x,e.y,e.z,e.w):ce.set(e,t,n,r),G.viewport(ee.copy(ce).multiplyScalar(L).round())},this.getScissor=function(e){return e.copy(R)},this.setScissor=function(e,t,n,r){e.isVector4?R.set(e.x,e.y,e.z,e.w):R.set(e,t,n,r),G.scissor(te.copy(R).multiplyScalar(L).round())},this.getScissorTest=function(){return le},this.setScissorTest=function(e){G.setScissorTest(le=e)},this.setOpaqueSort=function(e){oe=e},this.setTransparentSort=function(e){se=e},this.getClearColor=function(e){return e.copy(De.getClearColor())},this.setClearColor=function(){De.setClearColor(...arguments)},this.getClearAlpha=function(){return De.getClearAlpha()},this.setClearAlpha=function(){De.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(N!==null){let t=N.texture.format;e=h.has(t)}if(e){let e=N.texture.type,t=g.has(e),n=De.getClearColor(),r=De.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(_[0]=i,_[1]=a,_[2]=o,_[3]=r,H.clearBufferuiv(H.COLOR,0,_)):(v[0]=i,v[1]=a,v[2]=o,v[3]=r,H.clearBufferiv(H.COLOR,0,v))}else r|=H.COLOR_BUFFER_BIT}t&&(r|=H.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),n&&(r|=H.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),r!==0&&H.clear(r)},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.setNodesHandler=function(e){e.setRenderer(this),D=e},this.dispose=function(){t.removeEventListener(`webglcontextlost`,Ie,!1),t.removeEventListener(`webglcontextrestored`,Le,!1),t.removeEventListener(`webglcontextcreationerror`,Re,!1),De.dispose(),we.dispose(),J.dispose(),K.dispose(),ve.dispose(),xe.dispose(),Me.dispose(),Ne.dispose(),Se.dispose(),Fe.dispose(),Fe.removeEventListener(`sessionstart`,Ge),Fe.removeEventListener(`sessionend`,Ke),qe.stop()};function Ie(e){e.preventDefault(),af(`WebGLRenderer: Context Lost.`),E=!0}function Le(){af(`WebGLRenderer: Context Restored.`),E=!1;let e=_e.autoReset,t=Ee.enabled,n=Ee.autoUpdate,r=Ee.needsUpdate,i=Ee.type;Pe(),_e.autoReset=e,Ee.enabled=t,Ee.autoUpdate=n,Ee.needsUpdate=r,Ee.type=i}function Re(e){Z(`WebGLRenderer: A WebGL context could not be created. Reason: `,e.statusMessage)}function ze(e){let t=e.target;t.removeEventListener(`dispose`,ze),Be(t)}function Be(e){Ve(e),K.remove(e)}function Ve(e){let t=K.get(e).programs;
vendor: 5,417 bytes, line 4108
4108t!==void 0&&(t.forEach(function(e){Se.releaseProgram(e)}),e.isShaderMaterial&&Se.releaseShaderCache(e))}this.renderBufferDirect=function(e,t,n,r,i,a){t===null&&(t=pe);let o=i.isMesh&&i.matrixWorld.determinantAffine()<0,s=rt(e,t,n,r,i);G.setMaterial(r,o);let c=n.index,l=1;if(r.wireframe===!0){if(c=be.getWireframeAttribute(n),c===void 0)return;l=2}let u=n.drawRange,d=n.attributes.position,f=u.start*l,p=(u.start+u.count)*l;a!==null&&(f=Math.max(f,a.start*l),p=Math.min(p,(a.start+a.count)*l)),c===null?d!=null&&(f=Math.max(f,0),p=Math.min(p,d.count)):(f=Math.max(f,0),p=Math.min(p,c.count));let m=p-f;if(m<0||m===1/0)return;Me.setup(i,r,s,n,c);let h,g=ke;if(c!==null&&(h=ye.get(c),g=Ae,g.setIndex(h)),i.isMesh)r.wireframe===!0?(G.setLineWidth(r.wireframeLinewidth*he()),g.setMode(H.LINES)):g.setMode(H.TRIANGLES);else if(i.isLine){let e=r.linewidth;e===void 0&&(e=1),G.setLineWidth(e*he()),i.isLineSegments?g.setMode(H.LINES):i.isLineLoop?g.setMode(H.LINE_LOOP):g.setMode(H.LINE_STRIP)}else i.isPoints?g.setMode(H.POINTS):i.isSprite&&g.setMode(H.TRIANGLES);if(i.isBatchedMesh){if(W.get(`WEBGL_multi_draw`))g.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{let e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,a=c?ye.get(c).bytesPerElement:1,o=K.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)o.setValue(H,`_gl_DrawID`,r),g.render(e[r]/a,t[r])}}else if(i.isInstancedMesh)g.renderInstances(f,m,i.count);else if(n.isInstancedBufferGeometry){let e=n._maxInstanceCount===void 0?1/0:n._maxInstanceCount,t=Math.min(n.instanceCount,e);g.renderInstances(f,m,t)}else g.render(f,m)};function He(e,t,n){e.transparent===!0&&e.side===2&&e.forceSinglePass===!1?(e.side=1,e.needsUpdate=!0,$e(e,t,n),e.side=0,e.needsUpdate=!0,$e(e,t,n),e.side=2):$e(e,t,n)}this.compile=function(e,t,n=null){n===null&&(n=e),x=J.get(n),x.init(t),C.push(x),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(x.pushLight(e),e.castShadow&&x.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(x.pushLight(e),e.castShadow&&x.pushShadow(e))}),x.setupLights();let r=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t){if(Array.isArray(t))for(let i=0;i<t.length;i++){let a=t[i];He(a,n,e),r.add(a)}else He(t,n,e),r.add(t)}}),x=C.pop(),r},this.compileAsync=function(e,t,n=null){let r=this.compile(e,t,n);return new Promise(t=>{function n(){if(r.forEach(function(e){K.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}W.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let Ue=null;function We(e){Ue&&Ue(e)}function Ge(){qe.stop()}function Ke(){qe.start()}let qe=new Ly;qe.setAnimationLoop(We),typeof self<`u`&&qe.setContext(self),this.setAnimationLoop=function(e){Ue=e,Fe.setAnimationLoop(e),e===null?qe.stop():qe.start()},Fe.addEventListener(`sessionstart`,Ge),Fe.addEventListener(`sessionend`,Ke),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){Z(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(E===!0)return;D!==null&&D.renderStart(e,t);let n=Fe.enabled===!0&&Fe.isPresenting===!0,r=w!==null&&(N===null||n)&&w.begin(T,N);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),Fe.enabled===!0&&Fe.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(Fe.cameraAutoUpdate===!0&&Fe.updateCamera(t),t=Fe.getCamera()),e.isScene===!0&&e.onBeforeRender(T,e,t,N),x=J.get(e,C.length),x.init(t),x.state.textureUnits=q.getTextureUnits(),C.push(x),ue.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),z.setFromProjectionMatrix(ue,Nm,t.reversedDepth),V=this.localClippingEnabled,B=Te.init(this.clippingPlanes,V),b=we.get(e,S.length),b.init(),S.push(b),Fe.enabled===!0&&Fe.isPresenting===!0){let e=T.xr.getDepthSensingMesh();e!==null&&Je(e,t,-1/0,T.sortObjects)}Je(e,t,0,T.sortObjects),b.finish(),T.sortObjects===!0&&b.sort(oe,se,t.reversedDepth),me=Fe.enabled===!1||Fe.isPresenting===!1||Fe.hasDepthSensing()===!1,me&&De.addToRenderList(b,e),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),B===!0&&Te.beginShadows();let i=x.state.shadowsArray;if(Ee.render(i,e,t),B===!0&&Te.endShadows(),(r&&w.hasRenderPass())===!1){let n=b.opaque,r=b.transmissive;if(x.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t<a;t++){let a=i[t];Xe(n,r,e,a)}me&&De.render(e);for(let t=0,n=i.length;t<n;t++){let n=i[t];Ye(b,e,n,n.viewport)}}else r.length>0&&Xe(n,r,e,t),me&&De.render(e),Ye(b,e,t)}N!==null&&M===0&&(q.updateMultisampleRenderTarget(N),q.updateRenderTargetMipmap(N)),r&&w.end(T),e.isScene===!0&&e.onAfterRender(T,e,t),Me.resetDefaultState(),P=-1,F=null,C.pop(),C.length>0?(x=C[C.length-1],q.setTextureUnits(x.state.textureUnits),B===!0&&Te.setGlobalState(T.clippingPlanes,x.state.camera)):x=null,S.pop(),b=S.length>0?S[S.length-1]:null,D!==null&&D.renderEnd()};function Je(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLightProbeGrid)x.pushLightProbeGrid(e);else if(e.isLight)x.pushLight(e),e.castShadow&&x.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||z.intersectsSprite(e)){r&&fe.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ue);let t=xe.update(e),i=e.material;
vendor: 12,955 bytes, line 4108
4108i.visible&&b.push(e,t,i,n,fe.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||z.intersectsObject(e))){let t=xe.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),fe.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),fe.copy(e.boundingSphere.center)),fe.applyMatrix4(e.matrixWorld).applyMatrix4(ue)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a<o;a++){let o=r[a],s=i[o.materialIndex];s&&s.visible&&b.push(e,t,s,n,fe.z,o)}}else i.visible&&b.push(e,t,i,n,fe.z,null)}}let i=e.children;for(let e=0,a=i.length;e<a;e++)Je(i[e],t,n,r)}function Ye(e,t,n,r){let{opaque:i,transmissive:a,transparent:o}=e;x.setupLightsView(n),B===!0&&Te.setGlobalState(T.clippingPlanes,n),r&&G.viewport(ee.copy(r)),i.length>0&&Ze(i,t,n),a.length>0&&Ze(a,t,n),o.length>0&&Ze(o,t,n),G.buffers.depth.setTest(!0),G.buffers.depth.setMask(!0),G.buffers.color.setMask(!0),G.setPolygonOffset(!1)}function Xe(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(x.state.transmissionRenderTarget[r.id]===void 0){let e=W.has(`EXT_color_buffer_half_float`)||W.has(`EXT_color_buffer_float`);x.state.transmissionRenderTarget[r.id]=new sh(1,1,{generateMipmaps:!0,type:e?bp:pp,minFilter:fp,samples:Math.max(4,ge.samples),stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Zm.workingColorSpace})}let a=x.state.transmissionRenderTarget[r.id],o=r.viewport||ee;a.setSize(o.z*T.transmissionResolutionScale,o.w*T.transmissionResolutionScale);let s=T.getRenderTarget(),c=T.getActiveCubeFace(),l=T.getActiveMipmapLevel();T.setRenderTarget(a),T.getClearColor(re),ie=T.getClearAlpha(),ie<1&&T.setClearColor(16777215,.5),T.clear(),me&&De.render(n);let u=T.toneMapping;T.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),x.setupLightsView(r),B===!0&&Te.setGlobalState(T.clippingPlanes,r),Ze(e,n,r),q.updateMultisampleRenderTarget(a),q.updateRenderTargetMipmap(a),W.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i<a;i++){let{object:a,geometry:o,material:s,group:c}=t[i];if(s.side===2&&a.layers.test(r.layers)){let t=s.side;s.side=1,s.needsUpdate=!0,Qe(a,n,r,o,s,c),s.side=t,s.needsUpdate=!0,e=!0}}e===!0&&(q.updateMultisampleRenderTarget(a),q.updateRenderTargetMipmap(a))}T.setRenderTarget(s,c,l),T.setClearColor(re,ie),d!==void 0&&(r.viewport=d),T.toneMapping=u}function Ze(e,t,n){let r=t.isScene===!0?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){let a=e[i],{object:o,geometry:s,group:c}=a,l=a.material;l.allowOverride===!0&&r!==null&&(l=r),o.layers.test(n.layers)&&Qe(o,t,n,s,l,c)}}function Qe(e,t,n,r,i,a){e.onBeforeRender(T,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(T,t,n,r,e,a),i.transparent===!0&&i.side===2&&i.forceSinglePass===!1?(i.side=1,i.needsUpdate=!0,T.renderBufferDirect(n,t,r,i,e,a),i.side=0,i.needsUpdate=!0,T.renderBufferDirect(n,t,r,i,e,a),i.side=2):T.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(T,t,n,r,i,a)}function $e(e,t,n){t.isScene!==!0&&(t=pe);let r=K.get(e),i=x.state.lights,a=x.state.shadowsArray,o=i.state.version,s=Se.getParameters(e,i.state,a,t,n,x.state.lightProbeGridArray),c=Se.getProgramCacheKey(s),l=r.programs;r.environment=e.isMeshStandardMaterial||e.isMeshLambertMaterial||e.isMeshPhongMaterial?t.environment:null,r.fog=t.fog;let u=e.isMeshStandardMaterial||e.isMeshLambertMaterial&&!e.envMap||e.isMeshPhongMaterial&&!e.envMap;r.envMap=ve.get(e.envMap||r.environment,u),r.envMapRotation=r.environment!==null&&e.envMap===null?t.environmentRotation:e.envMapRotation,l===void 0&&(e.addEventListener(`dispose`,ze),l=new Map,r.programs=l);let d=l.get(c);if(d!==void 0){if(r.currentProgram===d&&r.lightsStateVersion===o)return tt(e,s),d}else s.uniforms=Se.getUniforms(e),D!==null&&e.isNodeMaterial&&D.build(e,n,s),e.onBeforeCompile(s,T),d=Se.acquireProgram(s,c),l.set(c,d),r.uniforms=s.uniforms;let f=r.uniforms;return(!e.isShaderMaterial&&!e.isRawShaderMaterial||e.clipping===!0)&&(f.clippingPlanes=Te.uniform),tt(e,s),r.needsLights=at(e),r.lightsStateVersion=o,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.ltc_1.value=i.state.rectAreaLTC1,f.ltc_2.value=i.state.rectAreaLTC2,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotLightMatrix.value=i.state.spotLightMatrix,f.spotLightMap.value=i.state.spotLightMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix),r.lightProbeGrid=x.state.lightProbeGridArray.length>0,r.currentProgram=d,r.uniformsList=null,d}function et(e){if(e.uniformsList===null){let t=e.currentProgram.getUniforms();e.uniformsList=xS.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function tt(e,t){let n=K.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}function nt(e,t){if(e.length===0)return null;if(e.length===1)return e[0].texture===null?null:e[0];y.setFromMatrixPosition(t.matrixWorld);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n.texture!==null&&n.boundingBox.containsPoint(y))return n}return null}function rt(e,t,n,r,i){t.isScene!==!0&&(t=pe),q.resetTextureUnits();let a=t.fog,o=r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial?t.environment:null,s=N===null?T.outputColorSpace:N.isXRRenderTarget===!0?N.texture.colorSpace:Zm.workingColorSpace,c=r.isMeshStandardMaterial||r.isMeshLambertMaterial&&!r.envMap||r.isMeshPhongMaterial&&!r.envMap,l=ve.get(r.envMap||o,c),u=r.vertexColors===!0&&!!n.attributes.color&&n.attributes.color.itemSize===4,d=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),f=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color,h=0;r.toneMapped&&(N===null||N.isXRRenderTarget===!0)&&(h=T.toneMapping);let g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=g===void 0?0:g.length,v=K.get(r),y=x.state.lights;if(B===!0&&(V===!0||e!==F)){let t=e===F&&r.id===P;Te.setState(r,e,t)}let b=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version?b=!0:v.outputColorSpace===s?i.isBatchedMesh&&v.batching===!1||!i.isBatchedMesh&&v.batching===!0||i.isBatchedMesh&&v.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&v.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&v.instancing===!1||!i.isInstancedMesh&&v.instancing===!0||i.isSkinnedMesh&&v.skinning===!1||!i.isSkinnedMesh&&v.skinning===!0||i.isInstancedMesh&&v.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&v.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&v.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&v.instancingMorph===!1&&i.morphTexture!==null?b=!0:v.envMap===l?r.fog===!0&&v.fog!==a||v.numClippingPlanes!==void 0&&(v.numClippingPlanes!==Te.numPlanes||v.numIntersection!==Te.numIntersection)?b=!0:v.vertexAlphas===u&&v.vertexTangents===d&&v.morphTargets===f&&v.morphNormals===p&&v.morphColors===m&&v.toneMapping===h&&v.morphTargetsCount===_?!!v.lightProbeGrid!=x.state.lightProbeGridArray.length>0&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=r.version);let S=v.currentProgram;b===!0&&(S=$e(r,t,i),D&&r.isNodeMaterial&&D.onUpdateProgram(r,S,v));let C=!1,w=!1,E=!1,O=S.getUniforms(),k=v.uniforms;if(G.useProgram(S.program)&&(C=!0,w=!0,E=!0),r.id!==P&&(P=r.id,w=!0),v.needsLights){let e=nt(x.state.lightProbeGridArray,i);v.lightProbeGrid!==e&&(v.lightProbeGrid=e,w=!0)}if(C||F!==e){G.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),O.setValue(H,`projectionMatrix`,e.projectionMatrix),O.setValue(H,`viewMatrix`,e.matrixWorldInverse);let t=O.map.cameraPosition;t!==void 0&&t.setValue(H,de.setFromMatrixPosition(e.matrixWorld)),ge.logarithmicDepthBuffer&&O.setValue(H,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&O.setValue(H,`isOrthographic`,e.isOrthographicCamera===!0),F!==e&&(F=e,w=!0,E=!0)}if(v.needsLights&&(y.state.directionalShadowMap.length>0&&O.setValue(H,`directionalShadowMap`,y.state.directionalShadowMap,q),y.state.spotShadowMap.length>0&&O.setValue(H,`spotShadowMap`,y.state.spotShadowMap,q),y.state.pointShadowMap.length>0&&O.setValue(H,`pointShadowMap`,y.state.pointShadowMap,q)),i.isSkinnedMesh){O.setOptional(H,i,`bindMatrix`),O.setOptional(H,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),O.setValue(H,`boneTexture`,e.boneTexture,q))}i.isBatchedMesh&&(O.setOptional(H,i,`batchingTexture`),O.setValue(H,`batchingTexture`,i._matricesTexture,q),O.setOptional(H,i,`batchingIdTexture`),O.setValue(H,`batchingIdTexture`,i._indirectTexture,q),O.setOptional(H,i,`batchingColorTexture`),i._colorsTexture!==null&&O.setValue(H,`batchingColorTexture`,i._colorsTexture,q));let A=n.morphAttributes;if((A.position!==void 0||A.normal!==void 0||A.color!==void 0)&&Oe.update(i,n,S),(w||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,O.setValue(H,`receiveShadow`,i.receiveShadow)),(r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial)&&r.envMap===null&&t.environment!==null&&(k.envMapIntensity.value=t.environmentIntensity),k.dfgLUT!==void 0&&(k.dfgLUT.value=Vx()),w){if(O.setValue(H,`toneMappingExposure`,T.toneMappingExposure),v.needsLights&&it(k,E),a&&r.fog===!0&&Ce.refreshFogUniforms(k,a),Ce.refreshMaterialUniforms(k,r,L,ae,x.state.transmissionRenderTarget[e.id]),v.needsLights&&v.lightProbeGrid){let e=v.lightProbeGrid;k.probesSH.value=e.texture,k.probesMin.value.copy(e.boundingBox.min),k.probesMax.value.copy(e.boundingBox.max),k.probesResolution.value.copy(e.resolution)}xS.upload(H,et(v),k,q)}if(r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(xS.upload(H,et(v),k,q),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&O.setValue(H,`center`,i.center),O.setValue(H,`modelViewMatrix`,i.modelViewMatrix),O.setValue(H,`normalMatrix`,i.normalMatrix),O.setValue(H,`modelMatrix`,i.matrixWorld),r.uniformsGroups!==void 0){let e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){let n=e[t];Ne.update(n,S),Ne.bind(n,S)}}return S}function it(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function at(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&e.lights===!0}this.getActiveCubeFace=function(){return j},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return N},this.setRenderTargetTextures=function(e,t,n){let r=K.get(e);r.__autoAllocateDepthBuffer=e.resolveDepthBuffer===!1,r.__autoAllocateDepthBuffer===!1&&(r.__useRenderToTexture=!1),K.get(e.texture).__webglTexture=t,K.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=K.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=t===void 0},this.setRenderTarget=function(e,t=0,n=0){N=e,j=t,M=n;let r=null,i=!1,a=!1;if(e){let o=K.get(e);if(o.__useDefaultFramebuffer!==void 0){G.bindFramebuffer(H.FRAMEBUFFER,o.__webglFramebuffer),ee.copy(e.viewport),te.copy(e.scissor),ne=e.scissorTest,G.viewport(ee),G.scissor(te),G.setScissorTest(ne),P=-1;return}if(o.__webglFramebuffer===void 0)q.setupRenderTarget(e);else if(o.__hasExternalTextures)q.rebindTextures(e,K.get(e.texture).__webglTexture,K.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(o.__boundDepthTexture!==t){if(t!==null&&K.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error(`THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.`);q.setupDepthRenderbuffer(e)}}let s=e.texture;(s.isData3DTexture||s.isDataArrayTexture||s.isCompressedArrayTexture)&&(a=!0);let c=K.get(e).__webglFramebuffer;
vendor: 12,819 bytes, line 4108
4108e.isWebGLCubeRenderTarget?(r=Array.isArray(c[t])?c[t][n]:c[t],i=!0):r=e.samples>0&&q.useMultisampledRTT(e)===!1?K.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,ee.copy(e.viewport),te.copy(e.scissor),ne=e.scissorTest}else ee.copy(ce).multiplyScalar(L).floor(),te.copy(R).multiplyScalar(L).floor(),ne=le;if(n!==0&&(r=O),G.bindFramebuffer(H.FRAMEBUFFER,r)&&G.drawBuffers(e,r),G.viewport(ee),G.scissor(te),G.setScissorTest(ne),i){let r=K.get(e.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t<e.textures.length;t++){let i=K.get(e.textures[t]);H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0+t,i.__webglTexture,n,r)}}else if(e!==null&&n!==0){let t=K.get(e.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,t.__webglTexture,n)}P=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget)){Z(`WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}let c=K.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){G.bindFramebuffer(H.FRAMEBUFFER,c);try{let o=e.textures[s],c=o.format,l=o.type;if(e.textures.length>1&&H.readBuffer(H.COLOR_ATTACHMENT0+s),!ge.textureFormatReadable(c)){Z(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!ge.textureTypeReadable(l)){Z(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&H.readPixels(t,n,r,i,je.convert(c),je.convert(l),a)}finally{let e=N===null?null:K.get(N).__webglFramebuffer;G.bindFramebuffer(H.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=K.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){G.bindFramebuffer(H.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(e.textures.length>1&&H.readBuffer(H.COLOR_ATTACHMENT0+s),!ge.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!ge.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=H.createBuffer();H.bindBuffer(H.PIXEL_PACK_BUFFER,d),H.bufferData(H.PIXEL_PACK_BUFFER,a.byteLength,H.STREAM_READ),H.readPixels(t,n,r,i,je.convert(l),je.convert(u),0);let f=N===null?null:K.get(N).__webglFramebuffer;G.bindFramebuffer(H.FRAMEBUFFER,f);let p=H.fenceSync(H.SYNC_GPU_COMMANDS_COMPLETE,0);return H.flush(),await cf(H,p,4),H.bindBuffer(H.PIXEL_PACK_BUFFER,d),H.getBufferSubData(H.PIXEL_PACK_BUFFER,0,a),H.deleteBuffer(d),H.deleteSync(p),a}throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)}},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;q.setTexture2D(e,0),H.copyTexSubImage2D(H.TEXTURE_2D,n,0,0,o,s,i,a),G.unbindTexture()},this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=0){let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=je.convert(t.format),_=je.convert(t.type),v;t.isData3DTexture?(q.setTexture3D(t,0),v=H.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(q.setTexture2DArray(t,0),v=H.TEXTURE_2D_ARRAY):(q.setTexture2D(t,0),v=H.TEXTURE_2D),G.activeTexture(H.TEXTURE0),G.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,t.flipY),G.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),G.pixelStorei(H.UNPACK_ALIGNMENT,t.unpackAlignment);let y=G.getParameter(H.UNPACK_ROW_LENGTH),b=G.getParameter(H.UNPACK_IMAGE_HEIGHT),x=G.getParameter(H.UNPACK_SKIP_PIXELS),S=G.getParameter(H.UNPACK_SKIP_ROWS),C=G.getParameter(H.UNPACK_SKIP_IMAGES);G.pixelStorei(H.UNPACK_ROW_LENGTH,h.width),G.pixelStorei(H.UNPACK_IMAGE_HEIGHT,h.height),G.pixelStorei(H.UNPACK_SKIP_PIXELS,l),G.pixelStorei(H.UNPACK_SKIP_ROWS,u),G.pixelStorei(H.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=K.get(e),r=K.get(t),h=K.get(n.__renderTarget),g=K.get(r.__renderTarget);G.bindFramebuffer(H.READ_FRAMEBUFFER,h.__webglFramebuffer),G.bindFramebuffer(H.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n<c;n++)w&&(H.framebufferTextureLayer(H.READ_FRAMEBUFFER,H.COLOR_ATTACHMENT0,K.get(e).__webglTexture,i,d+n),H.framebufferTextureLayer(H.DRAW_FRAMEBUFFER,H.COLOR_ATTACHMENT0,K.get(t).__webglTexture,a,m+n)),H.blitFramebuffer(l,u,o,s,f,p,o,s,H.DEPTH_BUFFER_BIT,H.NEAREST);G.bindFramebuffer(H.READ_FRAMEBUFFER,null),G.bindFramebuffer(H.DRAW_FRAMEBUFFER,null)}else if(i!==0||e.isRenderTargetTexture||K.has(e)){let n=K.get(e),r=K.get(t);G.bindFramebuffer(H.READ_FRAMEBUFFER,k),G.bindFramebuffer(H.DRAW_FRAMEBUFFER,A);for(let e=0;e<c;e++)w?H.framebufferTextureLayer(H.READ_FRAMEBUFFER,H.COLOR_ATTACHMENT0,n.__webglTexture,i,d+e):H.framebufferTexture2D(H.READ_FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,n.__webglTexture,i),T?H.framebufferTextureLayer(H.DRAW_FRAMEBUFFER,H.COLOR_ATTACHMENT0,r.__webglTexture,a,m+e):H.framebufferTexture2D(H.DRAW_FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,r.__webglTexture,a),i===0?T?H.copyTexSubImage3D(v,a,f,p,m+e,l,u,o,s):H.copyTexSubImage2D(v,a,f,p,l,u,o,s):H.blitFramebuffer(l,u,o,s,f,p,o,s,H.COLOR_BUFFER_BIT,H.NEAREST);G.bindFramebuffer(H.READ_FRAMEBUFFER,null),G.bindFramebuffer(H.DRAW_FRAMEBUFFER,null)}else T?e.isDataTexture||e.isData3DTexture?H.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h.data):t.isCompressedArrayTexture?H.compressedTexSubImage3D(v,a,f,p,m,o,s,c,g,h.data):H.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h):e.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,a,f,p,o,s,g,_,h.data):e.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,a,f,p,h.width,h.height,g,h.data):H.texSubImage2D(H.TEXTURE_2D,a,f,p,o,s,g,_,h);G.pixelStorei(H.UNPACK_ROW_LENGTH,y),G.pixelStorei(H.UNPACK_IMAGE_HEIGHT,b),G.pixelStorei(H.UNPACK_SKIP_PIXELS,x),G.pixelStorei(H.UNPACK_SKIP_ROWS,S),G.pixelStorei(H.UNPACK_SKIP_IMAGES,C),a===0&&t.generateMipmaps&&H.generateMipmap(v),G.unbindTexture()},this.initRenderTarget=function(e){K.get(e).__webglFramebuffer===void 0&&q.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?q.setTextureCube(e,0):e.isData3DTexture?q.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?q.setTexture2DArray(e,0):q.setTexture2D(e,0),G.unbindTexture()},this.resetState=function(){j=0,M=0,N=null,G.reset(),Me.reset()},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}get coordinateSystem(){return Nm}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=Zm._getDrawingBufferColorSpace(e),t.unpackColorSpace=Zm._getUnpackColorSpace()}}}));function tC(e,t){if(t===0)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),e;if(t===2||t===1){let n=e.getIndex();if(n===null){let t=[],r=e.getAttribute(`position`);if(r!==void 0){for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}else return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.`),e}let r=n.count-2,i=[];if(t===2)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.`);let a=e.clone();return a.setIndex(i),a.clearGroups(),a}return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:`,t),e}var nC=i((()=>{eC()}));function rC(e){let t=new Map,n=new Map,r=e.clone();return iC(e,r,function(e,r){t.set(r,e),n.set(e,r)}),r.traverse(function(e){if(!e.isSkinnedMesh)return;let r=e,i=t.get(e),a=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=a.map(function(e){return n.get(e)}),r.bind(r.skeleton,r.bindMatrix)}),r}function iC(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)iC(e.children[r],t.children[r],n)}var aC=i((()=>{}));function oC(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}function sC(e,t,n){let r=e.json.materials[t];return r.extensions&&r.extensions[n]?r.extensions[n]:null}function cC(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new bv({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),e.DefaultMaterial}function lC(e,t,n){for(let r in n.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function uC(e,t){t.extras!==void 0&&(typeof t.extras==`object`?Object.assign(e.userData,t.extras):console.warn(`THREE.GLTFLoader: Ignoring primitive type .extras, `+t.extras))}function dC(e,t,n){let r=!1,i=!1,a=!1;for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.POSITION!==void 0&&(r=!0),n.NORMAL!==void 0&&(i=!0),n.COLOR_0!==void 0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(e);let o=[],s=[],c=[];for(let l=0,u=t.length;l<u;l++){let u=t[l];if(r){let t=u.POSITION===void 0?e.attributes.position:n.getDependency(`accessor`,u.POSITION);o.push(t)}if(i){let t=u.NORMAL===void 0?e.attributes.normal:n.getDependency(`accessor`,u.NORMAL);s.push(t)}if(a){let t=u.COLOR_0===void 0?e.attributes.color:n.getDependency(`accessor`,u.COLOR_0);c.push(t)}}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(c)]).then(function(t){let n=t[0],o=t[1],s=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),a&&(e.morphAttributes.color=s),e.morphTargetsRelative=!0,e})}function fC(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){let n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn(`THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.`)}}function pC(e){let t,n=e.extensions&&e.extensions[bC.KHR_DRACO_MESH_COMPRESSION];if(t=n?`draco:`+n.bufferView+`:`+n.indices+`:`+mC(n.attributes):e.indices+`:`+mC(e.attributes)+`:`+e.mode,e.targets!==void 0)for(let n=0,r=e.targets.length;n<r;n++)t+=`:`+mC(e.targets[n]);return t}function mC(e){let t=``,n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+`:`+e[n[r]]+`;`;return t}function hC(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error(`THREE.GLTFLoader: Unsupported normalized accessor component type.`)}}function gC(e){return e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0?`image/jpeg`:e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?`image/webp`:e.search(/\.ktx2($|\?)/i)>0||e.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}function _C(e,t,n){let r=t.attributes,i=new sg;if(r.POSITION!==void 0){let e=n.json.accessors[r.POSITION],t=e.min,a=e.max;if(t!==void 0&&a!==void 0){if(i.set(new Q(t[0],t[1],t[2]),new Q(a[0],a[1],a[2])),e.normalized){let t=hC(XC[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}else{console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`);return}}else return;let a=t.targets;if(a!==void 0){let e=new Q,t=new Q;for(let r=0,i=a.length;r<i;r++){let i=a[r];if(i.POSITION!==void 0){let r=n.json.accessors[i.POSITION],a=r.min,o=r.max;if(a!==void 0&&o!==void 0){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),r.normalized){let e=hC(XC[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`)}}
vendor: 4,203 bytes, line 4108
4108i.expandByVector(e)}e.boundingBox=i;let o=new jg;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}function vC(e,t,n){let r=t.attributes,i=[];function a(t,r){return n.getDependency(`accessor`,t).then(function(t){e.setAttribute(r,t)})}for(let t in r){let n=ew[t]||t.toLowerCase();n in e.attributes||i.push(a(r[t],n))}if(t.indices!==void 0&&!e.index){let r=n.getDependency(`accessor`,t.indices).then(function(t){e.setIndex(t)});i.push(r)}return Zm.workingColorSpace!==`srgb-linear`&&`COLOR_0`in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Zm.workingColorSpace}" not supported.`),uC(e,t),_C(e,t,n),Promise.all(i).then(function(){return t.targets===void 0?e:dC(e,t.targets,n)})}var yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow=i((()=>{eC(),nC(),aC(),yC=class extends Vv{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new wC(e)}),this.register(function(e){return new TC(e)}),this.register(function(e){return new PC(e)}),this.register(function(e){return new FC(e)}),this.register(function(e){return new IC(e)}),this.register(function(e){return new DC(e)}),this.register(function(e){return new OC(e)}),this.register(function(e){return new kC(e)}),this.register(function(e){return new AC(e)}),this.register(function(e){return new CC(e)}),this.register(function(e){return new jC(e)}),this.register(function(e){return new EC(e)}),this.register(function(e){return new NC(e)}),this.register(function(e){return new MC(e)}),this.register(function(e){return new xC(e)}),this.register(function(e){return new LC(e,bC.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new LC(e,bC.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new RC(e)})}load(e,t,n,r){let i=this,a;if(this.resourcePath!==``)a=this.resourcePath;else if(this.path!==``){let t=hy.extractUrlBase(e);a=hy.resolveURL(t,this.path)}else a=hy.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},s=new Wv(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(n){try{i.parse(n,a,function(n){t(n),i.manager.itemEnd(e)},o)}catch(e){o(e)}},n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i,a={},o={},s=new TextDecoder;if(typeof e==`string`)i=JSON.parse(e);else if(e instanceof ArrayBuffer){if(s.decode(new Uint8Array(e,0,4))===zC){try{a[bC.KHR_BINARY_GLTF]=new HC(e)}catch(e){r&&r(e);return}i=JSON.parse(a[bC.KHR_BINARY_GLTF].content)}else i=JSON.parse(s.decode(e))}else i=e;if(i.asset===void 0||i.asset.version[0]<2){r&&r(Error(`THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.`));return}let c=new aw(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](c);t.name||console.error(`THREE.GLTFLoader: Invalid plugin found: missing name`),o[t.name]=t,a[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){let t=i.extensionsUsed[e],n=i.extensionsRequired||[];switch(t){case bC.KHR_MATERIALS_UNLIT:a[t]=new SC;break;case bC.KHR_DRACO_MESH_COMPRESSION:a[t]=new UC(i,this.dracoLoader);break;case bC.KHR_TEXTURE_TRANSFORM:a[t]=new WC;break;case bC.KHR_MESH_QUANTIZATION:a[t]=new GC;break;default:n.indexOf(t)>=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+t+`".`)}}c.setExtensions(a),c.setPlugins(o),c.parse(n,r)}parseAsync(e,t){let n=this;
vendor: 30,066 bytes, line 4108
4108return new Promise(function(r,i){n.parse(e,t,r,i)})}},bC={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,KHR_MESHOPT_COMPRESSION:`KHR_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`},xC=class{constructor(e){this.parser=e,this.name=bC.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,n=`light:`+e,r=t.cache.get(n);if(r)return r;let i=t.json,a=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e],o,s=new Wh(16777215);a.color!==void 0&&s.setRGB(a.color[0],a.color[1],a.color[2],Om);let c=a.range===void 0?0:a.range;switch(a.type){case`directional`:o=new py(s),o.target.position.set(0,0,-1),o.add(o.target);break;case`point`:o=new uy(s),o.distance=c;break;case`spot`:o=new cy(s),o.distance=c,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle===void 0?0:a.spot.innerConeAngle,a.spot.outerConeAngle=a.spot.outerConeAngle===void 0?Math.PI/4:a.spot.outerConeAngle,o.angle=a.spot.outerConeAngle,o.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw Error(`THREE.GLTFLoader: Unexpected light type: `+a.type)}return o.position.set(0,0,0),uC(o,a),a.intensity!==void 0&&(o.intensity=a.intensity),o.name=t.createUniqueName(a.name||`light_`+e),r=Promise.resolve(o),t.cache.add(n,r),r}getDependency(e,t){if(e===`light`)return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return i===void 0?null:this._loadLight(i).then(function(e){return n._getNodeRef(t.cache,i,e)})}},SC=class{constructor(){this.name=bC.KHR_MATERIALS_UNLIT}getMaterialType(){return $g}extendParams(e,t,n){let r=[];e.color=new Wh(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],Om),e.opacity=t[3]}i.baseColorTexture!==void 0&&r.push(n.assignTexture(e,`map`,i.baseColorTexture,Dm))}return Promise.all(r)}},CC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);return n===null||n.emissiveStrength!==void 0&&(t.emissiveIntensity=n.emissiveStrength),Promise.resolve()}},wC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(n.clearcoatFactor!==void 0&&(t.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatMap`,n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatRoughnessMap`,n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(r.push(this.parser.assignTexture(t,`clearcoatNormalMap`,n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){let e=n.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Um(e,e)}return Promise.all(r)}},TC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_DISPERSION}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);return n===null||(t.dispersion=n.dispersion===void 0?0:n.dispersion),Promise.resolve()}},EC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.iridescenceFactor!==void 0&&(t.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceMap`,n.iridescenceTexture)),n.iridescenceIor!==void 0&&(t.iridescenceIOR=n.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceThicknessMap`,n.iridescenceThicknessTexture)),Promise.all(r)}},DC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_SHEEN}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(t.sheenColor=new Wh(0,0,0),t.sheenRoughness=0,t.sheen=1,n.sheenColorFactor!==void 0){let e=n.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],Om)}return n.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenColorMap`,n.sheenColorTexture,Dm)),n.sheenRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenRoughnessMap`,n.sheenRoughnessTexture)),Promise.all(r)}},OC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.transmissionFactor!==void 0&&(t.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&r.push(this.parser.assignTexture(t,`transmissionMap`,n.transmissionTexture)),Promise.all(r)}},kC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_VOLUME}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.thickness=n.thicknessFactor===void 0?0:n.thicknessFactor,n.thicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`thicknessMap`,n.thicknessTexture)),t.attenuationDistance=n.attenuationDistance||1/0;let i=n.attenuationColor||[1,1,1];return t.attenuationColor=new Wh().setRGB(i[0],i[1],i[2],Om),Promise.all(r)}},AC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_IOR}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);return n===null?Promise.resolve():(t.ior=n.ior===void 0?1.5:n.ior,t.ior===0&&(t.ior=1e3),Promise.resolve())}},jC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_SPECULAR}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.specularIntensity=n.specularFactor===void 0?1:n.specularFactor,n.specularTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularIntensityMap`,n.specularTexture));let i=n.specularColorFactor||[1,1,1];return t.specularColor=new Wh().setRGB(i[0],i[1],i[2],Om),n.specularColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularColorMap`,n.specularColorTexture,Dm)),Promise.all(r)}},MC=class{constructor(e){this.parser=e,this.name=bC.EXT_MATERIALS_BUMP}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return t.bumpScale=n.bumpFactor===void 0?1:n.bumpFactor,n.bumpTexture!==void 0&&r.push(this.parser.assignTexture(t,`bumpMap`,n.bumpTexture)),Promise.all(r)}},NC=class{constructor(e){this.parser=e,this.name=bC.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){return sC(this.parser,e,this.name)===null?null:xv}extendMaterialParams(e,t){let n=sC(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.anisotropyStrength!==void 0&&(t.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(t.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&r.push(this.parser.assignTexture(t,`anisotropyMap`,n.anisotropyTexture)),Promise.all(r)}},PC=class{constructor(e){this.parser=e,this.name=bC.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let i=r.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},FC=class{constructor(e){this.parser=e,this.name=bC.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},IC=class{constructor(e){this.parser=e,this.name=bC.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},LC=class{constructor(e,t){this.name=t,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}return null}},RC=class{constructor(e){this.name=bC.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==YC.TRIANGLES&&e.mode!==YC.TRIANGLE_STRIP&&e.mode!==YC.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new uh,n=new Q,a=new Wm,s=new Q(1,1,1),c=new F_(e.geometry,e.material,r);for(let e=0;e<r;e++)o.TRANSLATION&&n.fromBufferAttribute(o.TRANSLATION,e),o.ROTATION&&a.fromBufferAttribute(o.ROTATION,e),o.SCALE&&s.fromBufferAttribute(o.SCALE,e),c.setMatrixAt(e,t.compose(n,a,s));for(let t in o)if(t===`_COLOR_0`){let e=o[t];c.instanceColor=new D_(e.array,e.itemSize,e.normalized)}else t!==`TRANSLATION`&&t!==`ROTATION`&&t!==`SCALE`&&e.geometry.setAttribute(t,o[t]);Lh.prototype.copy.call(c,e),this.parser.assignFinalMaterial(c),i.push(c)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}},zC=`glTF`,BC=12,VC={JSON:1313821514,BIN:5130562},HC=class{constructor(e){this.name=bC.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,BC),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==zC)throw Error(`THREE.GLTFLoader: Unsupported glTF-Binary header.`);if(this.header.version<2)throw Error(`THREE.GLTFLoader: Legacy binary file detected.`);let r=this.header.length-BC,i=new DataView(e,BC),a=0;for(;a<r;){let t=i.getUint32(a,!0);a+=4;let r=i.getUint32(a,!0);if(a+=4,r===VC.JSON){let r=new Uint8Array(e,BC+a,t);this.content=n.decode(r)}else if(r===VC.BIN){let n=BC+a;this.body=e.slice(n,n+t)}a+=t}if(this.content===null)throw Error(`THREE.GLTFLoader: JSON content not found.`)}},UC=class{constructor(e,t){if(!t)throw Error(`THREE.GLTFLoader: No DRACOLoader instance provided.`);this.name=bC.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},c={};for(let e in a){let t=ew[e]||e.toLowerCase();o[t]=a[e]}for(let t in e.attributes){let r=ew[t]||t.toLowerCase();if(a[t]!==void 0){let i=n.accessors[e.attributes[t]];c[r]=XC[i.componentType].name,s[r]=i.normalized===!0}}return t.getDependency(`bufferView`,i).then(function(e){return new Promise(function(t,n){r.decodeDracoFile(e,function(e){for(let t in e.attributes){let n=e.attributes[t],r=s[t];r!==void 0&&(n.normalized=r)}t(e)},o,c,Om,n)})})}},WC=class{constructor(){this.name=bC.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0?e:(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e)}},GC=class{constructor(){this.name=bC.KHR_MESH_QUANTIZATION}},KC=class extends wv{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=o*2,c=o*3,l=r-t,u=(n-t)/l,d=u*u,f=d*u,p=e*c,m=p-c,h=-2*f+3*d,g=f-d,_=1-h,v=g-d+u;for(let e=0;e!==o;e++){let t=a[m+e+o],n=a[m+e+s]*l,r=a[p+e+o],c=a[p+e]*l;i[e]=_*t+v*n+h*r+g*c}return i}},qC=new Wm,JC=class extends KC{interpolate_(e,t,n,r){let i=super.interpolate_(e,t,n,r);return qC.fromArray(i).normalize().toArray(i),i}},YC={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},XC={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ZC={9728:sp,9729:up,9984:cp,9985:dp,9986:lp,9987:fp},QC={33071:ap,33648:op,10497:ip},$C={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ew={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`,COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},tw={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},nw={CUBICSPLINE:void 0,LINEAR:ym,STEP:vm},rw={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`},iw=new uh,aw=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new oC,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=-1,i=!1,a=-1;if(typeof navigator<`u`&&navigator.userAgent!==void 0){let e=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(e)===!0;let t=e.match(/Version\/(\d+)/);r=n&&t?parseInt(t[1],10):-1,i=e.indexOf(`Firefox`)>-1,a=i?e.match(/Firefox\/([0-9]+)\./)[1]:-1}this.textureLoader=typeof createImageBitmap>`u`||n&&r<17||i&&a<98?new qv(this.options.manager):new _y(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Wv(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return lC(i,a,r),uC(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){let r=e[t];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(n[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;let r=n.clone(),i=(e,t)=>{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let r=e(t[n]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let r=0;r<t.length;r++){let i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){let n=e+`:`+t,r=this.cache.get(n);if(!r){switch(e){case`scene`:r=this.loadScene(t);break;case`node`:r=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case`mesh`:r=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case`accessor`:r=this.loadAccessor(t);break;case`bufferView`:r=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case`buffer`:r=this.loadBuffer(t);break;case`material`:r=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case`texture`:r=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case`skin`:r=this.loadSkin(t);break;case`animation`:r=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case`camera`:r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!r)throw Error(`Unknown type: `+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this,r=this.json[e+(e===`mesh`?`es`:`s`)]||[];t=Promise.all(r.map(function(t,r){return n.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!==`arraybuffer`)throw Error(`THREE.GLTFLoader: `+t.type+` buffer type is not supported.`);if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[bC.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(e,i){n.load(hy.resolveURL(t.uri,r.path),e,void 0,function(){i(Error(`THREE.GLTFLoader: Failed to load buffer "`+t.uri+`".`))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency(`buffer`,t.buffer).then(function(e){let n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)})}loadAccessor(e){let t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){let e=$C[r.type],t=XC[r.componentType],n=r.normalized===!0,i=new t(r.count*e);return Promise.resolve(new wg(i,e,n))}let i=[];return r.bufferView===void 0?i.push(null):i.push(this.getDependency(`bufferView`,r.bufferView)),r.sparse!==void 0&&(i.push(this.getDependency(`bufferView`,r.sparse.indices.bufferView)),i.push(this.getDependency(`bufferView`,r.sparse.values.bufferView))),Promise.all(i).then(function(e){let i=e[0],a=$C[r.type],o=XC[r.componentType],s=o.BYTES_PER_ELEMENT,c=s*a,l=r.byteOffset||0,u=r.bufferView===void 0?void 0:n.bufferViews[r.bufferView].byteStride,d=r.normalized===!0,f,p;if(u&&u!==c){let e=Math.floor(l/u),n=`InterleavedBuffer:`+r.bufferView+`:`+r.componentType+`:`+e+`:`+r.count,c=t.cache.get(n);c||(f=new o(i,e*u,r.count*u/s),c=new Bg(f,u/s),t.cache.add(n,c)),p=new Hg(c,a,l%u/s,d)}else f=i===null?new o(r.count*a):new o(i,l,r.count*a),p=new wg(f,a,d);if(r.sparse!==void 0){let t=$C.SCALAR,n=XC[r.sparse.indices.componentType],s=r.sparse.indices.byteOffset||0,c=r.sparse.values.byteOffset||0,l=new n(e[1],s,r.sparse.count*t),u=new o(e[2],c,r.sparse.count*a);i!==null&&(p=new wg(p.array.slice(),p.itemSize,p.normalized)),p.normalized=!1;for(let e=0,t=l.length;e<t;e++){let t=l[e];if(p.setX(t,u[e*a]),a>=2&&p.setY(t,u[e*a+1]),a>=3&&p.setZ(t,u[e*a+2]),a>=4&&p.setW(t,u[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}p.normalized=d}return p})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let c=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=ZC[n.magFilter]||1006,t.minFilter=ZC[n.minFilter]||1008,t.wrapS=QC[n.wrapS]||1e3,t.wrapT=QC[n.wrapT]||1e3,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==1003&&t.minFilter!==1006,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=c,c}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,c=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){c=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let l=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new ih(e);t.needsUpdate=!0,n(t)}),t.load(hy.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return c===!0&&o.revokeObjectURL(s),uC(e,a),e.userData.mimeType=a.mimeType||gC(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[bC.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[bC.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[bC.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(a.colorSpace=r),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new rv,Wg.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new W_,Wg.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return bv}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},c=[];if(s[bC.KHR_MATERIALS_UNLIT]){let e=r[bC.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new Wh(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],Om),o.opacity=e[3]}n.baseColorTexture!==void 0&&c.push(t.assignTexture(o,`map`,n.baseColorTexture,Dm)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),c.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=2);let l=i.alphaMode||rw.OPAQUE;if(l===rw.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===rw.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==$g&&(c.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new Um(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==$g&&(c.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==$g){let e=i.emissiveFactor;o.emissive=new Wh().setRGB(e[0],e[1],e[2],Om)}return i.emissiveTexture!==void 0&&a!==$g&&c.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,Dm)),Promise.all(c).then(function(){let n=new a(o);return i.name&&(n.name=i.name),uC(n,i),t.associations.set(n,{materials:e}),i.extensions&&lC(r,n,i),n})}createUniqueName(e){let t=Ny.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[bC.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return vC(n,e,t)})}let a=[];for(let n=0,o=e.length;n<o;n++){let o=e[n],s=pC(o),c=r[s];if(c)a.push(c.promise);else{let e;e=o.extensions&&o.extensions[bC.KHR_DRACO_MESH_COMPRESSION]?i(o):vC(new zg,o,t),r[s]={primitive:o,promise:e},a.push(e)}}return Promise.all(a)}loadMesh(e){let t=this,n=this.json,r=this.extensions,i=n.meshes[e],a=i.primitives,o=[];for(let e=0,t=a.length;e<t;e++){let t=a[e].material===void 0?cC(this.cache):this.getDependency(`material`,a[e].material);o.push(t)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(n){let o=n.slice(0,n.length-1),s=n[n.length-1],c=[];for(let n=0,l=s.length;n<l;n++){let l=s[n],u=a[n],d,f=o[n];if(u.mode===YC.TRIANGLES||u.mode===YC.TRIANGLE_STRIP||u.mode===YC.TRIANGLE_FAN||u.mode===void 0)d=i.isSkinnedMesh===!0?new x_(l,f):new d_(l,f),d.isSkinnedMesh===!0&&d.normalizeSkinWeights(),u.mode===YC.TRIANGLE_STRIP?d.geometry=tC(d.geometry,1):u.mode===YC.TRIANGLE_FAN&&(d.geometry=tC(d.geometry,2));else if(u.mode===YC.LINES)d=new tv(l,f);else if(u.mode===YC.LINE_STRIP)d=new Q_(l,f);else if(u.mode===YC.LINE_LOOP)d=new nv(l,f);else if(u.mode===YC.POINTS)d=new cv(l,f);else throw Error(`THREE.GLTFLoader: Primitive mode unsupported: `+u.mode);Object.keys(d.geometry.morphAttributes).length>0&&fC(d,i),d.name=t.createUniqueName(i.name||`mesh_`+e),uC(d,i),u.extensions&&lC(r,d,u),t.assignFinalMaterial(d),c.push(d)}for(let n=0,r=c.length;n<r;n++)t.associations.set(c[n],{meshes:e,primitives:n});if(c.length===1)return i.extensions&&lC(r,c[0],i),c[0];let l=new Rh;i.extensions&&lC(r,l,i),t.associations.set(l,{meshes:e});for(let e=0,t=c.length;e<t;e++)l.add(c[e]);return l})}loadCamera(e){let t,n=this.json.cameras[e],r=n[n.type];if(!r){console.warn(`THREE.GLTFLoader: Missing camera parameters.`);return}return n.type===`perspective`?t=new oy(Hm.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type===`orthographic`&&(t=new dy(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),uC(t,n),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],n=[];for(let e=0,r=t.joints.length;e<r;e++)n.push(this._loadNodeShallow(t.joints[e]));return t.inverseBindMatrices===void 0?n.push(null):n.push(this.getDependency(`accessor`,t.inverseBindMatrices)),Promise.all(n).then(function(e){let n=e.pop(),r=e,i=[],a=[];for(let e=0,o=r.length;e<o;e++){let o=r[e];if(o){i.push(o);let t=new uh;n!==null&&t.fromArray(n.array,e*16),a.push(t)}else console.warn(`THREE.GLTFLoader: Joint "%s" could not be found.`,t.joints[e])}return new E_(i,a)})}loadAnimation(e){let t=this.json,n=this,r=t.animations[e],i=r.name?r.name:`animation_`+e,a=[],o=[],s=[],c=[],l=[];for(let e=0,t=r.channels.length;e<t;
4108e++){let t=r.channels[e],n=r.samplers[t.sampler],i=t.target,u=i.node,d=r.parameters===void 0?n.input:r.parameters[n.input],f=r.parameters===void 0?n.output:r.parameters[n.output];i.node!==void 0&&(a.push(this.getDependency(`node`,u)),o.push(this.getDependency(`accessor`,d)),s.push(this.getDependency(`accessor`,f)),c.push(n),l.push(i))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(c),Promise.all(l)]).then(function(e){let t=e[0],a=e[1],o=e[2],s=e[3],c=e[4],l=[];for(let e=0,r=t.length;e<r;e++){let r=t[e],i=a[e],u=o[e],d=s[e],f=c[e];if(r===void 0)continue;r.updateMatrix&&r.updateMatrix();let p=n._createAnimationTracks(r,i,u,d,f);if(p)for(let e=0;e<p.length;e++)l.push(p[e])}let u=new Lv(i,void 0,l);return uC(u,r),u})}createNodeMesh(e){let t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency(`mesh`,r.mesh).then(function(e){let t=n._getNodeRef(n.meshCache,r.mesh,e);return r.weights!==void 0&&t.traverse(function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]}),t})}loadNode(e){let t=this.json,n=this,r=t.nodes[e],i=n._loadNodeShallow(e),a=[],o=r.children||[];for(let e=0,t=o.length;e<t;e++)a.push(n.getDependency(`node`,o[e]));let s=r.skin===void 0?Promise.resolve(null):n.getDependency(`skin`,r.skin);return Promise.all([i,Promise.all(a),s]).then(function(e){let t=e[0],n=e[1],r=e[2];r!==null&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(r,iw)});for(let e=0,r=n.length;e<r;e++)t.add(n[e]);if(t.userData.pivot!==void 0&&n.length>0){let e=t.userData.pivot,r=n[0];t.pivot=new Q().fromArray(e),t.position.x-=e[0],t.position.y-=e[1],t.position.z-=e[2],r.position.set(0,0,0),delete t.userData.pivot}return t})}_loadNodeShallow(e){let t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let i=t.nodes[e],a=i.name?r.createUniqueName(i.name):``,o=[],s=r._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return s&&o.push(s),i.camera!==void 0&&o.push(r.getDependency(`camera`,i.camera).then(function(e){return r._getNodeRef(r.cameraCache,i.camera,e)})),r._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if(o=i.isBone===!0?new S_:t.length>1?new Rh:t.length===1?t[0]:new Lh,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),uC(o,i),i.extensions&&lC(n,o,i),i.matrix!==void 0){let e=new uh;e.fromArray(i.matrix),o.applyMatrix4(e)}else i.translation!==void 0&&o.position.fromArray(i.translation),i.rotation!==void 0&&o.quaternion.fromArray(i.rotation),i.scale!==void 0&&o.scale.fromArray(i.scale);if(!r.associations.has(o))r.associations.set(o,{});else if(i.mesh!==void 0&&r.meshCache.refs[i.mesh]>1){let e=r.associations.get(o);r.associations.set(o,{...e})}return r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],r=this,i=new Rh;n.name&&(i.name=r.createUniqueName(n.name)),uC(i,n),n.extensions&&lC(t,i,n);let a=n.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(r.getDependency(`node`,a[e]));return Promise.all(o).then(function(e){for(let t=0,n=e.length;t<n;t++){let n=e[t];n.parent===null?i.add(n):i.add(rC(n))}return r.associations=(e=>{let t=new Map;for(let[e,n]of r.associations)(e instanceof Wg||e instanceof ih)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];function c(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}tw[i.path]===tw.weights?(c(e),e.isGroup&&e.children.forEach(c)):s.push(o);let l;switch(tw[i.path]){case tw.weights:l=Mv;break;case tw.rotation:l=Pv;break;case tw.translation:case tw.scale:l=Iv;break;default:switch(n.itemSize){case 1:l=Mv;break;default:l=Iv}}let u=r.interpolation===void 0?ym:nw[r.interpolation],d=this._getArrayFromAccessor(n);for(let e=0,n=s.length;e<n;e++){let n=new l(s[e]+`.`+tw[i.path],t.array,d,u);
4108r.interpolation===`CUBICSPLINE`&&this._createCubicSplineTrackInterpolant(n),a.push(n)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=hC(t.constructor),n=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=t[r]*e;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof Pv?JC:KC)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}}));function sw(){let e,t;onmessage=function(r){let i=r.data;switch(i.type){case`init`:e=i.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case`decode`:let r=i.buffer,a=i.taskConfig;t.then(e=>{let t=e.draco,o=new t.Decoder;try{let e=n(t,o,new Int8Array(r),a),s=e.attributes.map(e=>e.array.buffer);e.index&&s.push(e.index.array.buffer),self.postMessage({type:`decode`,id:i.id,geometry:e},s)}catch(e){console.error(e),self.postMessage({type:`error`,id:i.id,error:e.message})}finally{t.destroy(o)}})}};function n(e,t,n,a){let o=a.attributeIDs,s=a.attributeTypes,c,l,u=t.GetEncodedGeometryType(n);if(u===e.TRIANGULAR_MESH)c=new e.Mesh,l=t.DecodeArrayToMesh(n,n.byteLength,c);else if(u===e.POINT_CLOUD)c=new e.PointCloud,l=t.DecodeArrayToPointCloud(n,n.byteLength,c);else throw Error(`THREE.DRACOLoader: Unexpected geometry type.`);if(!l.ok()||c.ptr===0)throw Error(`THREE.DRACOLoader: Decoding failed: `+l.error_msg());let d={index:null,attributes:[]};for(let n in o){let r=self[s[n]],l,u;if(a.useUniqueIDs)u=o[n],l=t.GetAttributeByUniqueId(c,u);else{if(u=t.GetAttributeId(c,e[o[n]]),u===-1)continue;l=t.GetAttribute(c,u)}let f=i(e,t,c,n,r,l);n===`color`&&(f.vertexColorSpace=a.vertexColorSpace),d.attributes.push(f)}return u===e.TRIANGULAR_MESH&&(d.index=r(e,t,c)),e.destroy(c),d}function r(e,t,n){let r=n.num_faces()*3,i=r*4,a=e._malloc(i);t.GetTrianglesUInt32Array(n,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:o,itemSize:1}}function i(e,t,n,r,i,o){let s=n.num_points(),c=o.num_components(),l=a(e,i),u=c*i.BYTES_PER_ELEMENT,d=Math.ceil(u/4)*4,f=d/i.BYTES_PER_ELEMENT,p=s*u,m=s*d,h=e._malloc(p);t.GetAttributeDataArrayForAllPoints(n,o,l,p,h);let g=new i(e.HEAPF32.buffer,h,p/i.BYTES_PER_ELEMENT),_;if(u===d)_=g.slice();else{_=new i(m/i.BYTES_PER_ELEMENT);let e=0;for(let t=0,n=g.length;t<n;t++){for(let n=0;n<c;n++)_[e+n]=g[t*c+n];e+=f}}return e._free(h),{name:r,count:s,itemSize:c,array:_,stride:f}}function a(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}}var cw,lw,uw,dw,fw,pw=i((()=>{eC(),cw=new WeakMap,lw=new URL(`/assets/draco_decoder-C32yEggz.wasm`,``+import.meta.url).toString(),uw=new URL(`/assets/draco_wasm_wrapper-DxJM36Ib.js`,``+import.meta.url).toString(),dw=new URL(`/assets/draco_decoder-fzg4nYZr.js`,``+import.meta.url).toString(),new URL(`/assets/draco_wasm_wrapper-fZCQGLGb.js`,``+import.meta.url).toString(),new URL(`/assets/draco_decoder-Z1_iN-Ht.wasm`,``+import.meta.url).toString(),fw=class extends Vv{constructor(e){super(e),this.decoderPaths={js:uw,wasm:lw,dep_js:dw},this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=``,this.defaultAttributeIDs={position:`POSITION`,normal:`NORMAL`,color:`COLOR`,uv:`TEX_COORD`},this.defaultAttributeTypes={position:`Float32Array`,normal:`Float32Array`,color:`Float32Array`,uv:`Float32Array`}}setDecoderPath(e){let{decoderPaths:t}=this;return typeof e==`object`?(t.js=e.js,t.wasm=e.wasm,t.dep_js=null):(t.js=hy.resolveURL(`draco_wasm_wrapper.js`,e),t.wasm=hy.resolveURL(`draco_decoder.wasm`,e),t.dep_js=hy.resolveURL(`draco_decoder.js`,e)),this}setDecoderConfig(e){return console.warn(`THREE.DRACOLoader: setDecoderConfig to has been deprecated and will be removed in r194.`),this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){let i=new Wv(this.manager);i.setPath(this.path),i.setResponseType(`arraybuffer`),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>{this.parse(e,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,Dm,n).catch(n)}decodeDracoFile(e,t,n,r,i=Om,a=()=>{}){let o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};
4108return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){let n=JSON.stringify(t);if(cw.has(e)){let t=cw.get(e);if(t.key===n)return t.promise;if(e.byteLength===0)throw Error(`THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.`)}let r,i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:`decode`,id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),cw.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new zg;e.index&&t.setIndex(new wg(e.index.array,1));for(let n=0;n<e.attributes.length;n++){let{name:r,array:i,itemSize:a,stride:o,vertexColorSpace:s}=e.attributes[n],c;if(a===o)c=new wg(i,a);else{let e=new Bg(i,o);c=new Hg(e,a,0)}r===`color`&&(this._assignVertexColorSpace(c,s),c.normalized=!(i instanceof Float32Array)),t.setAttribute(r,c)}return t}_assignVertexColorSpace(e,t){if(t!==`srgb`)return;let n=new Wh;for(let t=0,r=e.count;t<r;t++)n.fromBufferAttribute(e,t),Zm.colorSpaceToWorking(n,Dm),e.setXYZ(t,n.r,n.g,n.b)}_loadLibrary(e,t){let n=new Wv(this.manager);return n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((t,r)=>{n.load(e,t,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!=`object`||this.decoderConfig.type===`js`,t=[],{decoderPaths:n}=this;if(e){if(n.dep_js===null)throw Error(`THREE.DRACOLoader: WebAssembly is required when using a custom decoder paths.`);t.push(this._loadLibrary(n.dep_js,`text`))}else t.push(this._loadLibrary(n.js,`text`)),t.push(this._loadLibrary(n.wasm,`arraybuffer`));return this.decoderPending=Promise.all(t).then(t=>{let n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let r=sw.toString(),i=[`/* draco decoder */`,n,``,`/* worker */`,r.substring(r.indexOf(`{`)+1,r.lastIndexOf(`}`))].join(`
4109`);this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:`init`,decoderConfig:this.decoderConfig}),e.onmessage=function(t){let n=t.data;switch(n.type){case`decode`:e._callbacks[n.id].resolve(n);break;case`error`:e._callbacks[n.id].reject(n);break;default:console.error(`THREE.DRACOLoader: Unexpected message, "`+n.type+`"`)}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log(`Task load: `,this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==``&&URL.revokeObjectURL(this.workerSourceURL),this}}})),mw=a((()=>{eC(),ow(),pw(),Cc(),Qd(),Sc.registerPlugin(Hd);var e=document.querySelector(`.main-3d-model`),t=new Kh,n=new $S({canvas:e,antialias:!0,alpha:!0});n.setSize(window.innerWidth,window.innerHeight),n.setPixelRatio(Math.min(window.devicePixelRatio,2));var r=new oy(45,window.innerWidth/window.innerHeight,.1,100);r.position.set(0,2,5),t.add(r),r.lookAt(0,0,0);var i=new my(16777215,.5);t.add(i);var a=new py(16777215,2.1);a.position.set(8,5,5),t.add(a);var o=new fw;o.setDecoderPath(`/assets/draco/`);var s=new yC;s.setDRACOLoader(o),s.load(`/assets/gltfModels/commodore64.glb`,e=>{let n=e.scene;n.scale.set(3,2.2,2),n.position.set(0,0,0),t.add(n),c()});function c(){Sc.timeline({scrollTrigger:{trigger:`body`,start:`top top`,end:`bottom bottom`,scrub:3}}).to(r.position,{x:.4,y:.8,z:1.3,onUpdate:()=>r.lookAt(0,0,0)}).to(r.position,{x:.9,y:.4,z:1.3,onUpdate:()=>r.lookAt(0,0,0)}).to(r.position,{x:1.8,y:.4,z:.8,onUpdate:()=>r.lookAt(0,0,0)})}function l(){requestAnimationFrame(l),n.render(t,r)}l(),window.addEventListener(`resize`,()=>{r.aspect=window.innerWidth/window.innerHeight,r.updateProjectionMatrix(),n.setSize(window.innerWidth,window.innerHeight)})}
4109)),hw=a((()=>{T(),Un(),Zn(),lr(),ur(),dr(),$d(),mw();var e=document.querySelector(`.dark-theme-link`),t=document.querySelector(`.theme-button`),n=document.querySelector(`.weather-block`);document.querySelector(`.navbar-nav`);var r=document.querySelector(`.navbar-toggler`),i=document.querySelector(`.modal-menu-block`),a=document.querySelector(`.close-icon`),o=document.querySelector(`.top-header`),s=document.querySelector(`.tip`);document.querySelector(`.video_bg`),a&&i&&(a.onclick=()=>{i.classList.toggle(`modal-show`)}),r&&r.addEventListener(`click`,c);function c(){i&&i.classList.toggle(`modal-show`),n&&n.style.setProperty(`display`,`none`,`important`)}t.addEventListener(`click`,u);var l=0;function u(){if(console.log(l),!(!e||!o)){if(l===0){e.href=`../style/dark-theme.css`,o.style.backgroundColor=`#1c1c17e3`,s&&(s.style.backgroundColor=`#1c1c17e3`),l++;return}l===1&&(e.href=``,o.style.backgroundColor=`#dedede`,s&&(s.style.backgroundColor=`#f2f2f2`),l--)}}}));export{a as C,Iy as S,Kh as _,ow as a,Um as b,my as c,tp as d,Hm as f,Qg as g,Wm as h,yC as i,Fy as l,z_ as m,fw as n,$S as o,oy as p,pw as r,eC as s,hw as t,py as u,Py as v,i as w,Q as x,np as y};

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.