UNPKG

@acdh-oeaw/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

2 lines 894 kB
/*! For license information please see 5576.fb6391b88382ef5ab113.js.LICENSE.txt */
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[5576],{5576:(t,e,n)=>{n.r(e),n.d(e,{al_angle_editor:()=>A,al_console:()=>C,al_control_panel:()=>j,al_edge_editor:()=>G,al_graph_editor:()=>V,al_graph_settings:()=>Y,al_node_editor:()=>q,al_node_list:()=>J,al_settings:()=>K,al_tabs:()=>$,al_url_picker:()=>tt,al_view_controls:()=>nt,al_viewer:()=>eu,ion_app:()=>nu,ion_button:()=>ou,ion_icon:()=>du,ion_input:()=>mu,ion_item:()=>vu,ion_item_divider:()=>yu,ion_label:()=>bu,ion_list:()=>xu,ion_list_header:()=>wu,ion_range:()=>Eu,ion_ripple_effect:()=>Tu,ion_select:()=>Pu,ion_select_option:()=>Bu,ion_tab:()=>Fu,ion_tab_bar:()=>ju,ion_tab_button:()=>Uu,ion_textarea:()=>Gu,ion_toggle:()=>Wu});var i=n(5873),r=n(884),o=n(636),a=n(1178),s=n(1867),l=n(5721),c=n(8265);t=n.hmd(t);var h,u,d,p,f,m,g,v,y,b,x=(h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},h(t,e)},function(t,e){function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),w=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):new n((function(e){e(t.value)})).then(a,s)}l((i=i.apply(t,e||[])).next())}))},E=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},_=void 0,M="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik05NiAyMzVoMzIwdjQySDk2eiI+PC9wYXRoPjwvc3ZnPgo=",S="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik0xODYuMzAxIDMzOS44OTNMOTYgMjQ5LjQ2MWwtMzIgMzAuNTA3TDE4Ni4zMDEgNDAyIDQ0OCAxNDAuNTA2IDQxNiAxMTB6Ij48L3BhdGg+PC9zdmc+Cg==",T={delete:"Delete",description:"Description",title:"Title",update:"Update"},A=function(){function t(t){(0,i.r)(this,t),this._contentStrings=T,this.deleteAngle=(0,i.c)(this,"deleteAngle",7),this.saveAngle=(0,i.c)(this,"saveAngle",7)}return t.prototype.render=function(){var t=this;if(this.angle){var e=this.angle,n=e[0],r=e[1];return(0,i.h)("form",{onSubmit:function(t){return t.preventDefault()}},(0,i.h)("ion-item",null,(0,i.h)("ion-input",{id:"title",value:r.title,placeholder:this._contentStrings.title,required:!0,onIonChange:function(t){return r.title=t.detail.value},maxlength:20})),(0,i.h)("ion-item",null,(0,i.h)("ion-textarea",{id:"description",value:r.description,placeholder:this._contentStrings.description,rows:5,onIonChange:function(t){return r.description=t.detail.value},maxlength:280})),(0,i.h)("ion-item",null,(0,i.h)("ion-button",{size:"small",onClick:function(){t.deleteAngle.emit(n),t.angle=null}},(0,i.h)("ion-icon",{src:M})," ",this._contentStrings.delete),(0,i.h)("ion-button",{size:"small",type:"submit",onClick:function(){r.title&&t.saveAngle.emit([n,r])}},(0,i.h)("ion-icon",{src:S})," ",this._contentStrings.update)))}return null},Object.defineProperty(t,"style",{get:function(){return"#title{--background:var(--al-input-background-color);--color:var(--al-input-color);--padding-bottom:var(--al-input-padding-bottom);--padding-end:var(--al-input-padding-end);--padding-start:var(--al-input-padding-start);--padding-top:var(--al-input-padding-top);font-size:var(--al-input-font-size)}#description{--background:var(--al-textarea-background-color);--color:var(--al-textarea-color);--padding-bottom:var(--al-textarea-padding-bottom);--padding-end:var(--al-textarea-padding-end);--padding-start:var(--al-textarea-padding-start);--padding-top:var(--al-textarea-padding-top);font-size:var(--al-textarea-font-size)}"},enumerable:!0,configurable:!0}),t}(),L={update:"Update"},C=function(){function t(t){(0,i.r)(this,t),this._contentStrings=L,this.graph=null,this.tabSize=2,this.graphSubmitted=(0,i.c)(this,"graphSubmitted",7)}return t.prototype._getGraphJson=function(){var t="";try{t=JSON.stringify(JSON.parse(this.graph),void 0,this.tabSize)}catch(t){}return t},t.prototype.render=function(){var t=this;return(0,i.h)("form",{onSubmit:function(t){return t.preventDefault()}},(0,i.h)("ion-item",null,(0,i.h)("ion-textarea",{id:"graph",value:this._getGraphJson(),rows:10,required:!0,onIonChange:function(e){return t.graph=e.detail.value},ref:function(e){return t._graph=e}})),(0,i.h)("ion-item",null,(0,i.h)("ion-button",{size:"small",type:"submit",onClick:function(){t.graph&&t.graphSubmitted.emit(t._graph.value)}},(0,i.h)("ion-icon",{src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik0xOTIgMTI4bDEyOCAxMjgtMTI4IDEyOHoiPjwvcGF0aD48L3N2Zz4K"})," ",this._contentStrings.update)))},Object.defineProperty(t,"style",{get:function(){return"#graph{--background:var(--al-textarea-background-color);--color:var(--al-textarea-color);--padding-bottom:var(--al-textarea-padding-bottom);--padding-end:var(--al-textarea-padding-end);--padding-start:var(--al-textarea-padding-start);--padding-top:var(--al-textarea-padding-top);font-size:var(--al-console-font-size)}"},enumerable:!0,configurable:!0}),t}(),P=function(t,e){return(0,i.h)("div",{style:{"overflow-y":"auto",width:"100%","min-height":"0","max-height":"100%",height:t.height}},e)},R={console:"Console",graph:"Nodes",settings:"Settings",src:"Source"},O=function(){};O.boundingBoxWidth=2,O.controllerName="-controller",O.edgeMinSize=75e-6,O.edgeSize=.0075,O.fov=45,O.fontSizeLarge=1,O.fontSizeMedium=.7,O.fontSizeSmall=.4,O.frustrumScaleFactor=.5,O.lightIntensity=.5,O.maxAnimationSteps=50,O.minLoadingMS=500,O.movedEventName="-moved",O.movingStepCount=2,O.nodeMinSize=2e-4,O.nodeSize=.02,O.stackSpaceMultiplier={x:10,y:10,z:10},O.stepPowerMinMax=[1,10],O.targetFrameTime=1e3/24,O.textUnitsDecimalPlaces=3,O.titleIdName="-title",O.topLayerRenderOrder=999,O.unitsDecimalPlaces=6,O.zoomFactor=3,O.volumeRaycastSensitivity=.05,O.volumeStepsDelay=800,O.textPadding={width:.03,height:.03},O.minTimeForThrottle=5*(O.minFrameMS=15),O.buttonColors={active:"#f50057",hover:"#f50057",up:"#00b0ff"},O.colors={red:"#f50057",blue:"#00b0ff",black:"#000000",grey:"#222222",white:"#ffffff",yellow:"#ffeb3b",green:"#76ff03",lightRed:"#f77777"},O.lights={ambientLightColor:13684944,ambientLightIntensity:.25,directionalLight1Color:16777215,directionalLight1Intensity:.75,directionalLight2Color:10584,directionalLight2Intensity:.5},O.camera={dampingFactor:.25,far:1e4,fov:O.fov,maxDistance:8e3,maxPolarAngle:175,minDistance:0,minPolarAngle:5,near:.05,nearFactor:.9,orbitPanSpeed:.3,orbitRotateSpeed:.5,orbitZoomSpeed:1,panSpeed:.9,trackballRotateSpeed:2.5,trackballZoomSpeed:5},function(t){t.NODE="node",t.EDGE="edge",t.ANGLE="angle"}(u||(u={})),function(t){t.ORBIT="orbit",t.TRACKBALL="trackball"}(d||(d={})),function(t){t.SLICES="slices",t.VOLUME="volume",t.MESH="mesh"}(p||(p={})),function(t){t.DEFAULT="default",t.CLAY="clay",t.XRAY="xray",t.NORMALS="normals",t.WIREFRAME="wireframe"}(f||(f={})),function(t){t.GLTF="gltf",t.GLB="glb"}(m||(m={})),function(t){t.CORONAL="coronal",t.SAGGITAL="saggital",t.AXIAL="axial"}(g||(g={})),function(t){t.LOCK="LOCK",t.MESH="MESH"}(v||(v={})),function(t){t.MILLIMETERS="mm",t.METERS="m"}(y||(y={})),function(t){t.DCM="dcm",t.DICOM="dicom"}(b||(b={}));var I=function(){function t(){}return t.isWebGL2Available=function(){try{var t=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!t.getContext("webgl2"))}catch(t){return!1}},t.enableControls=function(t,e,n){n===d.TRACKBALL?t.setAttribute("al-trackball-control","enabled: "+e):t.setAttribute("al-orbit-control","enabled: "+e)},t.waitOneFrame=function(t){window.setTimeout((function(){t()}),O.minFrameMS)},t.objectToVector3=function(t){var e=new THREE.Vector3;return e.x=t.x,e.y=t.y,e.z=t.z,e},t.worldToScreen=function(t,e,n){var i=t.clone();return i.project(e),i.x=Math.round((i.x+1)*n.offsetWidth/2),i.y=Math.round((1-i.y)*n.offsetHeight/2),i.z=0,i},t.normaliseNumber=function(t){return Number(t.toFixed(O.unitsDecimalPlaces))},t.vector3ToString=function(t){return t.toArray().join(" ")},t.vector3ToNormalisedString=function(e){return t.normaliseNumber(e.x)+" "+t.normaliseNumber(e.y)+" "+t.normaliseNumber(e.z)},t.stringToVector3=function(t){var e=t.split(" "),n=new THREE.Vector3;return n.x=Number(e[0]),n.y=Number(e[1]),n.z=Number(e[2]),n},t.normaliseStringVector3=function(e){return t.vector3ToNormalisedString(t.stringToVector3(e))},t.slerp=function(t,e,n){var i=n,r=t,o=e,a=r.angleTo(o);if(a){a=THREE.Math.clamp(a,-.99,.99);var s=Math.sin(1-i)*a,l=Math.sin(i*a),c=Math.sin(a),h=s/c,u=l/c,d=r.clone().multiplyScalar(h),p=o.clone().multiplyScalar(u);return d.add(p)}return null},t.easeInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},t.getSlerpCameraPath=function(e,n,i,r){for(var o=[],a=e.position.clone().addScalar(Number.EPSILON),s=e.target.clone().addScalar(Number.EPSILON),l=n.position.clone().addScalar(Number.EPSILON),c=n.target.clone().addScalar(Number.EPSILON),h=0;h<=O.maxAnimationSteps;h++){var u=this.easeInOutCubic(h/O.maxAnimationSteps);o.push({position:i?t.slerp(a.clone(),l.clone(),u):l,target:r?t.slerp(s.clone(),c.clone(),u):c})}return o},t.getSlerp3Path=function(e,n){for(var i=[],r=e.clone().addScalar(Number.EPSILON),o=n.clone().addScalar(Number.EPSILON),a=0;a<=O.maxAnimationSteps;a++){var s=this.easeInOutCubic(a/O.maxAnimationSteps);i.push(t.slerp(r.clone(),o.clone(),s))}return i},t.lookToFrustrumSpace=function(t,e,n,i){var r=new THREE.Vector3;e.getWorldDirection(r);var o=i.distanceTo(new THREE.Vector3(0,0,0)),a=new THREE.Plane(r,o),s=new THREE.Vector3;a.projectPoint(n,s),t.lookAt(s)},t.getFrustrumSpaceDistance=function(t,e,n){var i=new THREE.Vector3;t.getWorldDirection(i);var r=n.distanceTo(new THREE.Vector3(0,0,0)),o=new THREE.Plane(i,r),a=new THREE.Vector3;o.projectPoint(e,a);var s=new THREE.Ray(e);return s.lookAt(a),s.distanceToPlane(o)},t}(),D=function(){function t(){}return t._traceDataRay=function(t,e,n,i,r,o,a,s,l,c){var h=0,u=Math.floor,d=0|u(e),p=0|u(n),f=0|u(i),m=r>0?1:-1,g=o>0?1:-1,v=a>0?1:-1,y=Math.abs(1/r),b=Math.abs(1/o),x=Math.abs(1/a),w=y<1/0?y*(m>0?d+1-e:e-d):1/0,E=b<1/0?b*(g>0?p+1-n:n-p):1/0,_=x<1/0?x*(v>0?f+1-i:i-f):1/0,M=t.windowCenter-.5*t.windowWidth;M-=M*O.volumeRaycastSensitivity;for(var S=-1;h<=s;){var T,A=new THREE.Vector3(d,p,f),L=AMI.CoreUtils.worldToData(t.stack.lps2IJK,A),C=AMI.CoreUtils.getPixelData(t.stack,L);if(T=null!==C&&C>M?1:0)return l&&(l.x=e+h*r,l.y=n+h*o,l.z=i+h*a),c&&(c.x=c.y=c.z=0,0===S&&(c.x=-m),1===S&&(c.y=-g),2===S&&(c.z=-v)),T;w<E?w<_?(d+=m,h=w,w+=y,S=0):(f+=v,h=_,_+=x,S=2):E<_?(p+=g,h=E,E+=b,S=1):(f+=v,h=_,_+=x,S=2)}return l&&(l.x=e+h*r,l.y=n+h*o,l.z=i+h*a),c&&(c.x=c.y=c.z=0),0},t.volumeRay=function(t,e,n,i,r,o){var a=+e.x,s=+e.y,l=+e.z,c=+n.x,h=+n.y,u=+n.z,d=Math.sqrt(c*c+h*h+u*u);if(0===d)throw new Error("Can't raycast along a zero vector");return c/=d,h/=d,u/=d,i=void 0===i?64:+i,this._traceDataRay(t,a,s,l,c,h,u,i,r,o)},t.toAframeSpace=function(t){return t.divide(I.objectToVector3(O.stackSpaceMultiplier))},t}(),k=function(){function t(){}return t.debounce=function(t,e){return e=e||100,function(){if(!t.debouncing){var n=Array.prototype.slice.apply(arguments);t.lastReturnVal=t.apply(this,n),t.debouncing=!0}return clearTimeout(t.debounceTimeout),t.debounceTimeout=setTimeout((function(){t.debouncing=!1}),e),t.lastReturnVal}},t}(),N=function(){};N.SELECTED="al-graph-selected",N.POINTER_OVER="al-graph-pointer-over",N.POINTER_OUT="al-graph-pointer-out",N.DRAGGED="al-graph-dragged",N.POINTER_DOWN="al-graph-pointer-down",N.POINTER_UP="al-graph-pointer-up";var z=function(){function t(){}return t.getEntryWithHighestId=function(t){return t.size?Math.max.apply(Math,Array.from(t).map((function(t){var e=t[0];return Number(e.split(" ")[1])}))):0},t.getNextId=function(t,e){return t.charAt(0).toUpperCase()+t.slice(1)+" "+Number(this.getEntryWithHighestId(e)+1)},t}(),B=function(){function t(){}return t.addCssUnits=function(t){return this.cssUnits.some((function(e){return t.includes(e)}))||(t+="px"),t},t.getFileExtension=function(t){return t.substring(t.lastIndexOf(".")+1)},t.getFileEndCharacters=function(t,e){return t.slice(t.length-e)},t.getGeometryCenter=function(t){var e;return(e=t instanceof THREE.BufferGeometry?(new THREE.Geometry).fromBufferGeometry(t):t).computeBoundingSphere(),e.boundingSphere.center},t.getSceneDistanceFromMesh=function(t,e,n){return t?e*t.geometry.boundingSphere.radius/Math.tan(n*Math.PI/180):null},t.getSceneDistanceFromModel=function(e,n,i){if(e){var r=t.getBoundingBox(e),o=new THREE.Sphere;return r.getBoundingSphere(o),n*o.radius/Math.tan(i*Math.PI/180)}return null},t.getCameraStateFromMesh=function(t,e){if(t){var n=t.geometry,i=this.getGeometryCenter(n),r=new THREE.Vector3;return r.copy(i),r.z+=e,{target:i,position:r}}return null},t.getCameraStateFromModel=function(e,n){if(e){var i=t.getBoundingBox(e),r=new THREE.Vector3;i.getCenter(r);var o=new THREE.Vector3;return o.y=r.y,o.z+=n,{target:r,position:o}}return null},t.getCameraPositionFromNode=function(t,e,n){if(!t)return null;var i=new THREE.Vector3;i.copy(AFRAME.utils.coordinates.parse(t.position));var r=i.clone().sub(n.clone()).normalize(),o=new THREE.Vector3;return o.copy(i),o.add(r.clone().multiplyScalar(e*O.zoomFactor)),o},t.getNearFromSceneDistance=function(t){return t?t*(1-O.camera.nearFactor):null},t.getFarFromSceneDistance=function(t){return t?100*t:null},t.getBoundingBox=function(t){return(new THREE.Box3).setFromObject(t)},t.normalise=function(t,e,n){return(t-e)/(n-e)},t.reverseNumber=function(t,e,n){return n+e-t},t}();B.cssUnits=["%","ch","cm","em","ex","in","mm","pc","pt","px","rem","vh","vmax","vmin","vw"];var H,F,j=function(){function t(t){(0,i.r)(this,t),this._contentStrings=R,this.angles=null,this.consoleTabEnabled=!0,this.edges=null,this.graphTabEnabled=!0,this.nodes=null,this.selected=null,this.settingsTabEnabled=!0,this.srcTabEnabled=!0,this.tabContentHeight=null,this.url=null,this.urls=null}return t.prototype._getGraphJson=function(){if(this.nodes&&this.edges&&this.angles){var t={nodes:Array.from(this.nodes).map((function(t){var e=t[0],n=t[1];return[e,{normal:n.normal?I.normaliseStringVector3(n.normal):new THREE.Vector3,position:I.normaliseStringVector3(n.position),scale:I.normaliseNumber(n.scale),targetId:n.targetId,title:n.title,description:n.description}]})),edges:Array.from(this.edges),angles:Array.from(this.angles)};return JSON.stringify(t)}return""},t.prototype.render=function(){var t=this.tabContentHeight||this.el.parentElement.clientHeight+"px",e=[this.consoleTabEnabled,this.graphTabEnabled,this.settingsTabEnabled,this.srcTabEnabled].filter(Boolean).length;return(0,i.h)("ion-app",null,(0,i.h)("al-tabs",null,e>1?(0,i.h)("ion-tab-bar",null,this.srcTabEnabled?(0,i.h)("ion-tab-button",{tab:"src"},(0,i.h)("ion-icon",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBkPSJNNDAzLjAwMiAyMTcuMDAxQzM4OC45OTggMTQ4LjAwMiAzMjguOTk4IDk2IDI1NiA5NmMtNTcuOTk4IDAtMTA3Ljk5OCAzMi45OTgtMTMyLjk5OCA4MS4wMDFDNjMuMDAyIDE4My4wMDIgMTYgMjMzLjk5OCAxNiAyOTZjMCA2NS45OTYgNTMuOTk5IDEyMCAxMjAgMTIwaDI2MGM1NSAwIDEwMC00NSAxMDAtMTAwIDAtNTIuOTk4LTQwLjk5Ni05Ni4wMDEtOTIuOTk4LTk4Ljk5OXpNMjg4IDI3NnY3NmgtNjR2LTc2aC02OGwxMDAtMTAwIDEwMCAxMDBoLTY4eiIvPjwvc3ZnPg=="}),(0,i.h)("ion-label",null,this._contentStrings.src)):null,this.settingsTabEnabled?(0,i.h)("ion-tab-button",{tab:"settings"},(0,i.h)("ion-icon",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBkPSJNMzIgMzg0aDI3MnYzMkgzMnpNNDAwIDM4NGg4MHYzMmgtODB6TTM4NCA0NDcuNWMwIDE3Ljk0OS0xNC4zMjcgMzIuNS0zMiAzMi41LTE3LjY3MyAwLTMyLTE0LjU1MS0zMi0zMi41di05NWMwLTE3Ljk0OSAxNC4zMjctMzIuNSAzMi0zMi41IDE3LjY3MyAwIDMyIDE0LjU1MSAzMiAzMi41djk1eiIvPjxnPjxwYXRoIGQ9Ik0zMiAyNDBoODB2MzJIMzJ6TTIwOCAyNDBoMjcydjMySDIwOHpNMTkyIDMwMy41YzAgMTcuOTQ5LTE0LjMyNyAzMi41LTMyIDMyLjUtMTcuNjczIDAtMzItMTQuNTUxLTMyLTMyLjV2LTk1YzAtMTcuOTQ5IDE0LjMyNy0zMi41IDMyLTMyLjUgMTcuNjczIDAgMzIgMTQuNTUxIDMyIDMyLjV2OTV6Ii8+PC9nPjxnPjxwYXRoIGQ9Ik0zMiA5NmgyNzJ2MzJIMzJ6TTQwMCA5Nmg4MHYzMmgtODB6TTM4NCAxNTkuNWMwIDE3Ljk0OS0xNC4zMjcgMzIuNS0zMiAzMi41LTE3LjY3MyAwLTMyLTE0LjU1MS0zMi0zMi41di05NWMwLTE3Ljk0OSAxNC4zMjctMzIuNSAzMi0zMi41IDE3LjY3MyAwIDMyIDE0LjU1MSAzMiAzMi41djk1eiIvPjwvZz48L3N2Zz4="}),(0,i.h)("ion-label",null,this._contentStrings.settings)):null,this.graphTabEnabled?(0,i.h)("ion-tab-button",{tab:"graph"},(0,i.h)("ion-icon",{src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik0yNTYgNDhDMTQxLjEyNSA0OCA0OCAxNDEuMTI1IDQ4IDI1NnM5My4xMjUgMjA4IDIwOCAyMDggMjA4LTkzLjEyNSAyMDgtMjA4UzM3MC44NzUgNDggMjU2IDQ4em0xMDcgMjI5aC04NnY4NmgtNDJ2LTg2aC04NnYtNDJoODZ2LTg2aDQydjg2aDg2djQyeiI+PC9wYXRoPjwvc3ZnPgo="}),(0,i.h)("ion-label",null,this._contentStrings.graph)):null,this.consoleTabEnabled?(0,i.h)("ion-tab-button",{tab:"console"},(0,i.h)("ion-icon",{src:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuNiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGQ9Ik00MjQsNjRIODhjLTI2LjYsMC00OCwyMS42LTQ4LDQ4djI4OGMwLDI2LjQsMjEuNCw0OCw0OCw0OGgzMzZjMjYuNCwwLDQ4LTIxLjYsNDgtNDhWMTEyQzQ3Miw4NS42LDQ1MC42LDY0LDQyNCw2NHoKCSBNNDI0LDQwMEg4OFYxNzZoMzM2VjQwMHoiLz4KPHBhdGggZD0iTTIwMi42LDI4Ni40bC01OC4zLDU4LjNjLTIuOCwyLjgtNy40LDIuOC0xMC4yLDBsLTYuOC02LjhjLTIuOC0yLjgtMi44LTcuNCwwLTEwLjJsNDYuMi00Ni40bC00Ni4yLTQ2LjQKCWMtMi44LTIuOC0yLjgtNy40LDAtMTAuMmw2LjgtNi44YzIuOC0yLjgsNy40LTIuOCwxMC4yLDBsNTguMyw1OC4zQzIwNS40LDI3OSwyMDUuNCwyODMuNiwyMDIuNiwyODYuNHogTTM0My4yLDM0MS4zdi05LjYKCWMwLTQtMy4yLTcuMi03LjItNy4yaC05MS4yYy00LDAtNy4yLDMuMi03LjIsNy4ydjkuNmMwLDQsMy4yLDcuMiw3LjIsNy4ySDMzNkMzMzkuOSwzNDguNSwzNDMuMiwzNDUuMywzNDMuMiwzNDEuM3oiLz4KPC9zdmc+Cg=="}),(0,i.h)("ion-label",null,this._contentStrings.console)):null):null,this.srcTabEnabled?(0,i.h)("ion-tab",{tab:"src"},(0,i.h)("al-view-controls",{"bounding-box-enabled":this.boundingBoxEnabled,"controls-type":this.controlsType}),(0,i.h)("al-url-picker",{urls:this.urls,url:this.url})):null,this.settingsTabEnabled?(0,i.h)("ion-tab",{tab:"settings"},(0,i.h)(P,{height:t},(0,i.h)("al-view-controls",{"bounding-box-enabled":this.boundingBoxEnabled,"controls-type":this.controlsType}),(0,i.h)("al-settings",{"display-mode":this.displayMode,orientation:this.orientation,"slices-index":this.slicesIndex,"slices-max-index":this.slicesMaxIndex,"slices-brightness":this.slicesBrightness,"slices-contrast":this.slicesContrast,"volume-brightness":this.volumeBrightness,"volume-contrast":this.volumeContrast,"volume-steps":this.volumeSteps,"volume-steps-high-enabled":this.volumeStepsHighEnabled}))):null,this.graphTabEnabled?(0,i.h)("ion-tab",{tab:"graph"},(0,i.h)(P,{height:t},(0,i.h)("al-view-controls",{"bounding-box-enabled":this.boundingBoxEnabled,"controls-type":this.controlsType}),(0,i.h)("al-graph-editor",{selected:this.selected,nodes:this.nodes,angles:this.angles,edges:this.edges,"graph-enabled":this.graphEnabled,"graph-visible":this.graphTabEnabled,units:this.units}))):null,this.consoleTabEnabled?(0,i.h)("ion-tab",{tab:"console"},(0,i.h)(P,{height:t},(0,i.h)("al-view-controls",{"bounding-box-enabled":this.boundingBoxEnabled,"controls-type":this.controlsType}),(0,i.h)("al-console",{graph:this._getGraphJson()}))):null))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return"al-tabs{--ion-tab-bar-border-color:var(--al-item-border-color)}"},enumerable:!0,configurable:!0}),t}(),U={delete:"Delete",description:"Description",title:"Title",update:"Update"},G=function(){function t(t){(0,i.r)(this,t),this._contentStrings=U,this.deleteEdge=(0,i.c)(this,"deleteEdge",7),this.saveEdge=(0,i.c)(this,"saveEdge",7)}return t.prototype.render=function(){var t=this;if(this.edge){var e=this.edge,n=e[0],r=e[1];return(0,i.h)("form",{onSubmit:function(t){return t.preventDefault()}},(0,i.h)("ion-item",null,(0,i.h)("ion-input",{id:"title",value:r.title,placeholder:this._contentStrings.title,required:!0,onIonChange:function(t){return r.title=t.detail.value},maxlength:20})),(0,i.h)("ion-item",null,(0,i.h)("ion-textarea",{id:"description",value:r.description,placeholder:this._contentStrings.description,rows:5,onIonChange:function(t){return r.description=t.detail.value},maxlength:280})),(0,i.h)("ion-item",null,(0,i.h)("ion-button",{size:"small",onClick:function(){t.deleteEdge.emit(n),t.edge=null}},(0,i.h)("ion-icon",{src:M})," ",this._contentStrings.delete),(0,i.h)("ion-button",{size:"small",type:"submit",onClick:function(){r.title&&t.saveEdge.emit([n,r])}},(0,i.h)("ion-icon",{src:S})," ",this._contentStrings.update)))}return null},Object.defineProperty(t,"style",{get:function(){return"#title{--background:var(--al-input-background-color);--color:var(--al-input-color);--padding-bottom:var(--al-input-padding-bottom);--padding-end:var(--al-input-padding-end);--padding-start:var(--al-input-padding-start);--padding-top:var(--al-input-padding-top);font-size:var(--al-input-font-size)}#description{--background:var(--al-textarea-background-color);--color:var(--al-textarea-color);--padding-bottom:var(--al-textarea-padding-bottom);--padding-end:var(--al-textarea-padding-end);--padding-start:var(--al-textarea-padding-start);--padding-top:var(--al-textarea-padding-top);font-size:var(--al-textarea-font-size)}"},enumerable:!0,configurable:!0}),t}(),V=function(){function t(t){(0,i.r)(this,t),this.nodes=null,this.angles=null,this.edges=null,this.selected=null}return t.prototype._getSelectedNode=function(){if(this.selected&&this.nodes){var t=this.nodes.get(this.selected);if(t)return[this.selected,t]}return null},t.prototype._getSelectedEdge=function(){if(this.selected&&this.edges){var t=this.edges.get(this.selected);if(t)return[this.selected,t]}return null},t.prototype._getSelectedAngle=function(){if(this.selected&&this.angles){var t=this.angles.get(this.selected);if(t)return[this.selected,t]}return null},t.prototype.render=function(){return[(0,i.h)("al-graph-settings",{"graph-enabled":this.graphEnabled,"graph-visible":this.graphVisible,units:this.units}),(0,i.h)("al-node-list",{nodes:this.nodes,selected:this.selected}),(0,i.h)("ion-item-divider",null),(0,i.h)("al-node-editor",{node:this._getSelectedNode()}),(0,i.h)("al-edge-editor",{edge:this._getSelectedEdge()}),(0,i.h)("al-angle-editor",{angle:this._getSelectedAngle()})]},Object.defineProperty(t,"style",{get:function(){return""},enumerable:!0,configurable:!0}),t}(),W={graphEnabled:"Enable Nodes",units:"Units",meters:"Meters",millimeters:"Millimeters"},Y=function(){function t(t){(0,i.r)(this,t),this._contentStrings=W,this.unitsChange=(0,i.c)(this,"unitsChange",7),this.graphEnabledChange=(0,i.c)(this,"graphEnabledChange",7)}return t.prototype._graphEnabled=function(t){this.graphEnabled=t,this.graphEnabledChange.emit(t)},t.prototype._units=function(t){this.units=t,this.unitsChange.emit(this.units)},t.prototype.renderGraphEnabled=function(){var t=this;return this.graphVisible?(0,i.h)("div",null,(0,i.h)("ion-item",{style:{display:"var(--graph-enabled-display, block)"}},(0,i.h)("span",{title:this._contentStrings.graphEnabled},this._contentStrings.graphEnabled),(0,i.h)("ion-toggle",{slot:"end",checked:this.graphEnabled,onIonChange:function(e){return t._graphEnabled(e.detail.checked)}})),(0,i.h)("ion-item",{style:{display:"var(--units-display, block)"}},(0,i.h)("span",{title:this._contentStrings.units},this._contentStrings.units),(0,i.h)("select",{slot:"end",onChange:function(e){return t._units(e.srcElement.value)}},(0,i.h)("option",{selected:this.units===y.MILLIMETERS,value:y.MILLIMETERS},this._contentStrings.millimeters),(0,i.h)("option",{selected:this.units===y.METERS,value:y.METERS},this._contentStrings.meters)))):(0,i.h)("span",null,"hello world")},t.prototype.render=function(){return(0,i.h)("div",{style:{"max-width":"100%","overflow-x":"hidden"}},this.renderGraphEnabled())},Object.defineProperty(t,"style",{get:function(){return"select{padding:5px;min-width:100px;background-color:var(--al-select-background-color);color:var(--al-item-color);border:none}@supports (-moz-appearance:none){select{background-color:#fff!important;color:#000!important}}ion-label{color:var(--al-item-color)}"},enumerable:!0,configurable:!0}),t}(),X={delete:"Delete",description:"Description",title:"Title",update:"Update"},q=function(){function t(t){(0,i.r)(this,t),this._contentStrings=X,this.deleteNode=(0,i.c)(this,"deleteNode",7),this.saveNode=(0,i.c)(this,"saveNode",7)}return t.prototype.render=function(){var t=this;if(this.node){var e=this.node,n=e[0],r=e[1];return(0,i.h)("form",{onSubmit:function(t){return t.preventDefault()}},(0,i.h)("ion-item",null,(0,i.h)("ion-input",{id:"title",value:r.title,placeholder:this._contentStrings.title,required:!0,onIonChange:function(t){return r.title=t.detail.value},maxlength:128})),(0,i.h)("ion-item",null,(0,i.h)("ion-textarea",{id:"description",value:r.description,placeholder:this._contentStrings.description,rows:5,onIonChange:function(t){return r.description=t.detail.value},maxlength:1024})),(0,i.h)("ion-item",null,(0,i.h)("ion-button",{size:"small",onClick:function(){t.deleteNode.emit(n),t.node=null}},(0,i.h)("ion-icon",{src:M})," ",this._contentStrings.delete),(0,i.h)("ion-button",{size:"small",type:"submit",onClick:function(){r.title&&t.saveNode.emit([n,r])}},(0,i.h)("ion-icon",{src:S})," ",this._contentStrings.update)))}return null},Object.defineProperty(t,"style",{get:function(){return"#title{--background:var(--al-input-background-color);--color:var(--al-input-color);--padding-bottom:var(--al-input-padding-bottom);--padding-end:var(--al-input-padding-end);--padding-start:var(--al-input-padding-start);--padding-top:var(--al-input-padding-top);font-size:var(--al-input-font-size)}#description{--background:var(--al-textarea-background-color);--color:var(--al-textarea-color);--padding-bottom:var(--al-textarea-padding-bottom);--padding-end:var(--al-textarea-padding-end);--padding-start:var(--al-textarea-padding-start);--padding-top:var(--al-textarea-padding-top);font-size:var(--al-textarea-font-size)}"},enumerable:!0,configurable:!0}),t}(),Z={graphEmpty:"No nodes have been placed."},J=function(){function t(t){(0,i.r)(this,t),this._contentStrings=Z,this.nodes=null,this.selected=null,this.selectedChange=(0,i.c)(this,"selectedChange",7)}return t.prototype.render=function(){var t=this;return this.nodes&&this.nodes.size?(0,i.h)("ion-list",{style:{color:"var(--al-item-color)","border-width":"1px 0 0 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","margin-top":"10px"}},Array.from(this.nodes).map((function(e){var n=e[0],r=e[1];return(0,i.h)("ion-item",{"data-selected":t.selected===n,onClick:function(){return t.selectedChange.emit(n)}},r.title)}))):(0,i.h)("ion-item",{style:{color:"var(--al-item-color)","border-width":"1px 0 0 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","margin-top":"10px"}},(0,i.h)("p",null,this._contentStrings.graphEmpty))},Object.defineProperty(t,"style",{get:function(){return"ion-item{--color:var(--al-item-color);--border-color:var(--al-item-border-color);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-item[data-selected]{--color:var(--al-item-selected-color)}"},enumerable:!0,configurable:!0}),t}(),Q={axial:"XY (Top)",bounds:"Bounds",boundingBoxEnabled:"Bounding Box",brightness:"Level",clay:"Clay",contrast:"Width",controlsType:"Controls Type",coronal:"XZ (Front)",default:"Default",displayMode:"Display Mode",graphEnabled:"Enable Node Placement",material:"Material",normals:"Normals",orbit:"Orbit",orientation:"Orientation",recenter:"Origin",renderSteps:"Render Steps",rotate:"Rotate",saggital:"YZ (Side)",sliceIndex:"Slice Index",slices:"Slices",slice:"Slice",trackball:"Trackball",units:"Units",volume:"Volume",volumeSteps:"Render Detail (only increase if you know your device is capable!)",volumeStepsHighEnabled:"Enable High Res",volumeStepsHighEnabledWarning:"Activate High Resolution Mode (Computationally Intensive!)",windowingTitle:"Windowing (Brightness/Contrast)",wireframe:"Wireframe",xray:"XRay"},K=function(){function t(t){(0,i.r)(this,t),this._contentStrings=Q,this.displayModeChange=(0,i.c)(this,"displayModeChange",7),this.orientationChange=(0,i.c)(this,"orientationChange",7),this.slicesIndexChange=(0,i.c)(this,"slicesIndexChange",7),this.slicesBrightnessChange=(0,i.c)(this,"slicesBrightnessChange",7),this.slicesContrastChange=(0,i.c)(this,"slicesContrastChange",7),this.volumeBrightnessChange=(0,i.c)(this,"volumeBrightnessChange",7),this.volumeContrastChange=(0,i.c)(this,"volumeContrastChange",7),this.volumeStepsChange=(0,i.c)(this,"volumeStepsChange",7),this.volumeStepsHighEnabledChange=(0,i.c)(this,"volumeStepsHighEnabledChange",7)}return t.prototype._displayMode=function(t){this.displayMode=t,this.displayModeChange.emit(t)},t.prototype._orientation=function(t){this.orientation=t,this.orientationChange.emit(t)},t.prototype._slicesIndex=function(t){this.slicesIndex=t,this.slicesIndexChange.emit(t)},t.prototype._slicesBrightness=function(t){this.slicesBrightness=t,this.slicesBrightnessChange.emit(t)},t.prototype._slicesContrast=function(t){this.slicesContrast=t,this.slicesContrastChange.emit(t)},t.prototype._volumeBrightness=function(t){this.volumeBrightness=t,this.volumeBrightnessChange.emit(t)},t.prototype._volumeContrast=function(t){this.volumeContrast=t,this.volumeContrastChange.emit(t)},t.prototype._volumeSteps=function(t){t=Math.round(10*t)/10,this.volumeSteps=t,this.volumeStepsChange.emit(t)},t.prototype._volumeStepsHighEnabled=function(t){t?this._volumeSteps(this.volumeSteps+.2):this._volumeSteps(this.volumeSteps-.2)},t.prototype.renderDisplayModeToggle=function(){var t=this;return this.displayMode!==p.MESH?(0,i.h)("ion-item",{style:{display:"var(--display-mode-display, block)","margin-top":"10px"}},(0,i.h)("span",{title:this._contentStrings.displayMode},"Mode"),(0,i.h)("select",{slot:"end",onChange:function(e){return t._displayMode(e.srcElement.value)}},(0,i.h)("option",{selected:this.displayMode===p.SLICES,value:p.SLICES},this._contentStrings.slices),(0,i.h)("option",{selected:this.displayMode===p.VOLUME,value:p.VOLUME},this._contentStrings.volume))):null},t.prototype.renderHiResEnabled=function(){var t=this;return(0,i.h)("ion-item",{style:{display:"var(--volume-steps-high-display, block)"}},(0,i.h)("span",{title:this._contentStrings.volumeStepsHighEnabledWarning},this._contentStrings.volumeStepsHighEnabled," ",(0,i.h)("ion-icon",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBkPSJNMzIgNDY0aDQ0OEwyNTYgNDggMzIgNDY0em0yNDgtNjRoLTQ4di00OGg0OHY0OHptMC04MGgtNDh2LTk2aDQ4djk2eiIvPjwvc3ZnPg=="})),(0,i.h)("ion-toggle",{slot:"end",checked:this.volumeStepsHighEnabled,onIonChange:function(e){return t._volumeStepsHighEnabled(e.detail.checked)}}))},t.prototype.renderSlicesControls=function(){var t=this;return(0,i.h)("div",null,(0,i.h)("ion-item",{style:{display:"var(--slices-orientation-display, block)"}},(0,i.h)("span",{color:"primary"},"Plane"),(0,i.h)("select",{slot:"end",onChange:function(e){return t._orientation(e.srcElement.value)}},(0,i.h)("option",{selected:this.orientation===g.CORONAL,value:g.CORONAL},this._contentStrings.coronal),(0,i.h)("option",{selected:this.orientation===g.SAGGITAL,value:g.SAGGITAL},this._contentStrings.saggital),(0,i.h)("option",{selected:this.orientation===g.AXIAL,value:g.AXIAL},this._contentStrings.axial))),(0,i.h)("ion-item",{style:{display:"var(--slices-index-display, block)"}},(0,i.h)("span",null,this._contentStrings.slice),(0,i.h)("ion-range",{slot:"end",min:0,max:1,step:1/this.slicesMaxIndex,value:this.slicesIndex,onIonChange:function(e){return t._slicesIndex(e.detail.value)}})))},t.prototype.renderSlicesWindowingControls=function(){var t=this;return(0,i.h)("div",null,(0,i.h)("ion-list-header",{style:{color:"var(--al-item-color)","border-width":"1px 0 0 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","margin-top":"10px"}},(0,i.h)("span",null,this._contentStrings.windowingTitle)),(0,i.h)("ion-item",{style:{display:"var(--slices-brightness-display, block)"}},(0,i.h)("span",null,this._contentStrings.brightness),(0,i.h)("ion-range",{slot:"end",min:0,max:1,step:.05,snaps:!0,ticks:!1,value:this.slicesBrightness,onIonChange:function(e){t._slicesBrightness(e.detail.value)}})),(0,i.h)("ion-item",{style:{display:"var(--slices-contrast-display, block)"}},(0,i.h)("span",null,this._contentStrings.contrast),(0,i.h)("ion-range",{slot:"end",min:0,max:1,step:.05,snaps:!0,ticks:!1,value:this.slicesContrast,onIonChange:function(e){return t._slicesContrast(e.detail.value)}})))},t.prototype.renderVolumeWindowingControls=function(){var t=this;return(0,i.h)("div",null,(0,i.h)("ion-list-header",{style:{color:"var(--al-item-color)","border-width":"1px 0 0 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","margin-top":"10px"}},(0,i.h)("span",null,this._contentStrings.windowingTitle)),(0,i.h)("ion-item",{style:{display:"var(--volume-brightness-display, block)"}},(0,i.h)("span",null,this._contentStrings.brightness),(0,i.h)("ion-range",{slot:"end",min:0,max:1,step:.05,snaps:!0,ticks:!1,value:this.volumeBrightness,onIonChange:function(e){t._volumeBrightness(e.detail.value)}})),(0,i.h)("ion-item",{style:{display:"var(--volume-contrast-display, block)"}},(0,i.h)("span",null,this._contentStrings.contrast),(0,i.h)("ion-range",{slot:"end",min:0,max:1,step:.05,snaps:!0,ticks:!1,value:this.volumeContrast,onIonChange:function(e){return t._volumeContrast(e.detail.value)}})))},t.prototype.renderOptions=function(){switch(this.displayMode){case p.SLICES:return(0,i.h)("div",null,this.renderSlicesControls(),this.renderSlicesWindowingControls());case p.VOLUME:return(0,i.h)("div",null,this.renderHiResEnabled(),this.renderVolumeWindowingControls());default:return}},t.prototype.render=function(){return(0,i.h)("div",{style:{"max-width":"100%","overflow-x":"hidden"}},this.renderDisplayModeToggle(),this.renderOptions())},Object.defineProperty(t,"style",{get:function(){return"select{padding:5px;min-width:100px;background-color:var(--al-select-background-color);color:var(--al-item-color);border:none}@supports (-moz-appearance:none){select{background-color:#fff!important;color:#000!important}}ion-label{color:var(--al-item-color)}"},enumerable:!0,configurable:!0}),t}(),$=function(){function t(t){var e=this;(0,i.r)(this,t),this.transitioning=!1,this.onTabClicked=function(t){var n=t.detail.tab;e.select(n)},this.ionNavWillLoad=(0,i.c)(this,"ionNavWillLoad",7),this.ionTabsWillChange=(0,i.c)(this,"ionTabsWillChange",3),this.ionTabsDidChange=(0,i.c)(this,"ionTabsDidChange",3)}return t.prototype.componentWillLoad=function(){return w(this,void 0,void 0,(function(){var t;return E(this,(function(e){switch(e.label){case 0:return t=this.tabs,[4,this.select(t[0])];case 1:return e.sent(),this.ionNavWillLoad.emit(),[2]}}))}))},t.prototype.componentWillRender=function(){var t=this.el.querySelector("ion-tab-bar");if(t){var e=this.selectedTab?this.selectedTab.tab:void 0;t.selectedTab=e}},t.prototype.select=function(t){return w(this,void 0,void 0,(function(){var e;return E(this,(function(n){switch(n.label){case 0:return[4,this.getTab(t)];case 1:return(e=n.sent())&&this.shouldSwitch(e)?(this.setActive(e),this.tabSwitch(),[2,!0]):[2,!1]}}))}))},t.prototype.getTab=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return[2,"string"==typeof t?this.tabs.find((function(e){return e.tab===t})):t]}))}))},t.prototype.getSelected=function(){return Promise.resolve(this.selectedTab?this.selectedTab.tab:void 0)},t.prototype.setActive=function(t){if(this.transitioning)return Promise.reject("transitioning already happening");this.transitioning=!0,this.leavingTab=this.selectedTab,this.selectedTab=t,this.ionTabsWillChange.emit({tab:t.tab});try{t.setActive()}catch(t){}return!0},t.prototype.tabSwitch=function(){var t=this.selectedTab,e=this.leavingTab;this.leavingTab=void 0,this.transitioning=!1,t&&e!==t&&(e&&(e.active=!1),this.ionTabsDidChange.emit({tab:t.tab}))},t.prototype.shouldSwitch=function(t){var e=this.selectedTab;return void 0!==t&&t!==e&&!this.transitioning},Object.defineProperty(t.prototype,"tabs",{get:function(){return Array.from(this.el.querySelectorAll("ion-tab"))},enumerable:!0,configurable:!0}),t.prototype.render=function(){return(0,i.h)(i.H,{onIonTabButtonClick:this.onTabClicked},(0,i.h)("slot",{name:"top"}),(0,i.h)("div",{class:"tabs-inner"},(0,i.h)("slot",null)),(0,i.h)("slot",{name:"bottom"}))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{z-index:var(--z-index-page-container);--ion-tab-bar-color:var(--al-item-color)}.tabs-inner{position:relative}"},enumerable:!0,configurable:!0}),t}(),tt=function(){function t(t){(0,i.r)(this,t),this.urls=null,this.url=null,this.urlChange=(0,i.c)(this,"urlChange",7)}return t.prototype.render=function(){var t=this;return this.urls?(0,i.h)("form",{onSubmit:function(t){return t.preventDefault()}},(0,i.h)("ion-item",null,(0,i.h)("ion-select",{id:"select",value:this.url,interface:"popover",placeholder:"",onIonChange:function(e){return t.urlChange.emit(e.detail.value)}},Array.from(this.urls).map((function(t){var e=t[0],n=t[1];return(0,i.h)("ion-select-option",{value:e},n)})))),(0,i.h)("ion-item",null,(0,i.h)("ion-input",{id:"input",type:"url",size:100,placeholder:"src",required:!0,value:this.url,ref:function(e){return t._input=e}})),(0,i.h)("ion-item",null,(0,i.h)("ion-button",{id:"submit",size:"small",type:"submit",onClick:function(){return t.urlChange.emit(t._input.value)}},(0,i.h)("ion-icon",{src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik0yNTYgMzg4Yy03Mi41OTcgMC0xMzItNTkuNDA1LTEzMi0xMzIgMC03Mi42MDEgNTkuNDAzLTEzMiAxMzItMTMyIDM2LjMgMCA2OS4yOTkgMTUuNCA5Mi40MDYgMzkuNjAxTDI3OCAyMzRoMTU0VjgwbC01MS42OTggNTEuNzAyQzM0OC40MDYgOTkuNzk4IDMwNC40MDYgODAgMjU2IDgwYy05Ni43OTcgMC0xNzYgNzkuMjAzLTE3NiAxNzZzNzguMDk0IDE3NiAxNzYgMTc2YzgxLjA0NSAwIDE0OC4yODctNTQuMTM0IDE2OS40MDEtMTI4SDM3OC44NWMtMTguNzQ1IDQ5LjU2MS02Ny4xMzggODQtMTIyLjg1IDg0eiI+PC9wYXRoPjwvc3ZnPgo="})," Load"))):null},Object.defineProperty(t,"style",{get:function(){return"#select{--padding-start:0px;width:100%;max-width:100%!important}#input{--background:var(--al-input-background-color);--color:var(--al-input-color);--padding-start:var(--al-input-padding-start)}"},enumerable:!0,configurable:!0}),t}(),et={axial:"XY (Top)",bounds:"Bounds",boundingBoxEnabled:"Bounding Box",brightness:"Level",clay:"Clay",contrast:"Width",controlsType:"Controls Type",coronal:"XZ (Front)",default:"Default",displayMode:"Display Mode",graphEnabled:"Enable Node Placement",material:"Material",meters:"Meters",millimeters:"Millimeters",normals:"Normals",orbit:"Orbit",orientation:"Orientation",recenter:"Origin",renderSteps:"Render Steps",rotate:"Rotate",saggital:"YZ (Side)",sliceIndex:"Slice Index",slices:"Slices",slice:"Slice",trackball:"Trackball",units:"Units",volume:"Volume",volumeSteps:"Render Detail (only increase if you know your device is capable!)",volumeStepsHighEnabled:"Enable High Res",volumeStepsHighEnabledWarning:"Activate High Resolution Mode (Computationally Intensive!)",windowingTitle:"Windowing (Brightness/Contrast)",wireframe:"Wireframe",xray:"XRay"},nt=function(){function t(t){(0,i.r)(this,t),this._contentStrings=et,this.boundingBoxEnabledChange=(0,i.c)(this,"boundingBoxEnabledChange",7),this.controlsTypeChange=(0,i.c)(this,"controlsTypeChange",7),this.recenter=(0,i.c)(this,"recenter",7)}return t.prototype._boundingBoxEnabled=function(t){this.boundingBoxEnabled=t,this.boundingBoxEnabledChange.emit(t)},t.prototype._controlsType=function(t){this.controlsType=t,this.controlsTypeChange.emit(t)},t.prototype._switchBoundingBoxEnabled=function(){this.boundingBoxEnabled?this._boundingBoxEnabled(!1):this._boundingBoxEnabled(!0)},t.prototype._switchControls=function(){this.controlsType===d.ORBIT?this._controlsType(d.TRACKBALL):this.controlsType===d.TRACKBALL&&this._controlsType(d.ORBIT)},t.prototype.renderControlsTypeSelect=function(){var t,e,n,r=this;return this.controlsType===d.ORBIT?(t="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuNiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGQ9Ik0zOTMuMSwzMzcuN3YtNTljMC05LjMtNy44LTE2LjgtMTcuMy0xNi44SDE2Ni41Yy05LjUsMC0xNy4zLDcuNi0xNy4zLDE2Ljh2MTY4LjZjMCw5LjMsNy44LDE2LjksMTcuMywxNi45aDIwOS40CgljOS41LDAsMTcuMy03LjYsMTcuMy0xNi44di01OWw2Ni41LDY3LjRWMjcwLjNMMzkzLjEsMzM3Ljd6Ii8+CjxwYXRoIGQ9Ik05OS41LDMwNC4zYzAtODEuMyw2NS4zLTE0Ny44LDE0NS4yLTE0Ny44djczLjlsOTYuOC05OC42bC05Ni44LTk4LjZ2NzMuOWMtMTA2LjUsMC0xOTMuNiw4OC43LTE5My42LDE5Ny4xIi8+Cjwvc3ZnPgo=",e=this._contentStrings.orbit):this.controlsType===d.TRACKBALL&&(t="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuNiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGQ9Ik0xMDguMSwyODYuNGMwLTgxLjMsNjUuMy0xNDcuOCwxNDUuMi0xNDcuOHY3My45bDk2LjgtOTguNmwtOTYuOC05OC42djczLjlDMTQ2LjgsODkuMiw1OS43LDE3OCw1OS43LDI4Ni40Ii8+CjxjaXJjbGUgY3g9IjMwMyIgY3k9IjM1MS40IiByPSIxMDQiLz4KPC9zdmc+Cg==",e=this._contentStrings.rotate),n=this.boundingBoxEnabled?"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuNiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzNjAgMzYwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAzNjAgMzYwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGQ9Ik0xOTcuNSwzNTIuNGgtMzVWMTgwLjlMOC40LDEwM2MtOC42LTQuNC0xMi4xLTE0LjktNy43LTIzLjVjNC40LTguNiwxNC45LTEyLjEsMjMuNS03LjdMMTgwLDE1MC41bDE1Ni43LTc4LjhsMTUuNywzMS4zCglsLTE1NC45LDc3LjlWMzUyLjR6Ii8+CjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjE4MCIgY3k9IjE4MCIgcj0iNzUuOSIvPgo8cGF0aCBkPSJNMTgwLDM2OS45Yy0yLjcsMC01LjQtMC42LTcuOS0xLjlMOC40LDI4NS4zYy01LjktMy05LjYtOS05LjYtMTUuNlY4Ny40YzAtNi43LDMuOC0xMi44LDkuOS0xNS43TDE3Mi40LTcuOQoJYzQuOC0yLjMsMTAuNC0yLjMsMTUuMywwbDE2NC42LDc5LjVjNiwyLjksOS45LDksOS45LDE1Ljh2MTgxLjhjMCw2LjYtMy43LDEyLjYtOS42LDE1LjZsLTE2NC42LDgzLjMKCUMxODUuNCwzNjkuMywxODIuNywzNjkuOSwxODAsMzY5Ljl6IE0zMy44LDI1OC45TDE4MCwzMzIuOGwxNDcuMS03NC41di0xNjBMMTgwLDI3LjNsLTE0Ni4zLDcxVjI1OC45eiIvPgo8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMTA0LjEsMTMxLjgiLz4KPHBhdGggY2xhc3M9InN0MiIgZD0iTTkyLjEsMTM5LjUiLz4KPC9zdmc+Cg==":"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuNiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDM2MCAzNjAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDM2MCAzNjA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTgwIiBjeT0iMTgwIiByPSIxMDEuMiIvPgo8L3N2Zz4K",(0,i.h)("div",{style:{"margin-top":"10px","text-align":"center"}},(0,i.h)("ion-button",{style:{width:"28%",height:"45px","margin-left":"5px","margin-right":"5px"},size:"small",onClick:function(){r._switchControls()}},(0,i.h)("div",{style:{"font-size":"10px",color:"white","margin-bottom":"2px"}},(0,i.h)("ion-icon",{style:{"min-width":"20px","min-height":"20px","margin-bottom":"2px"},src:t,title:e}),(0,i.h)("br",null),e)),(0,i.h)("ion-button",{style:{width:"28%",height:"45px","margin-left":"5px","margin-right":"5px"},size:"small",onClick:function(){r.recenter.emit()}},(0,i.h)("div",{style:{"font-size":"10px",color:"white","margin-bottom":"2px"}},(0,i.h)("ion-icon",{style:{"min-width":"20px","min-height":"20px","margin-bottom":"2px"},src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik0yNTYgNDhjLTQyLjkgMC04NC4yIDEzLTExOS4yIDM3LjUtMzQuMiAyNC02MC4yIDU3LjItNzUuMSA5Ni4xTDU4IDE5Mmg0NS43bDEuOS01YzguMi0xNy44IDE5LjQtMzMuOSAzMy41LTQ4IDMxLjItMzEuMiA3Mi43LTQ4LjQgMTE2LjktNDguNHM4NS43IDE3LjIgMTE2LjkgNDguNGMzMS4yIDMxLjIgNDguNCA3Mi43IDQ4LjQgMTE2LjkgMCA0NC4xLTE3LjIgODUuNy00OC40IDExNi45LTMxLjIgMzEuMi03Mi43IDQ4LjQtMTE2LjkgNDguNC00NC4xIDAtODUuNi0xNy4yLTExNi45LTQ4LjQtMTQtMTQtMjUuMy0zMC4xLTMzLjUtNDcuOWwtMS45LTVINThsMy42IDEwLjRjMTQuOSAzOC45IDQwLjkgNzIuMSA3NS4xIDk2LjFDMTcxLjggNDUxLjEgMjEzIDQ2NCAyNTYgNDY0YzExNC43IDAgMjA4LTkzLjMgMjA4LTIwOFMzNzAuNyA0OCAyNTYgNDh6Ij48L3BhdGg+PHBhdGggZD0iTTQ4IDI3Ny40aDE4OS43bC00My42IDQ0LjdMMjI0IDM1Mmw5Ni05Ni05Ni05Ni0zMSAyOS45IDQ0LjcgNDQuN0g0OHY0Mi44eiI+PC9wYXRoPjwvc3ZnPgo=",title:this._contentStrings.recenter}),(0,i.h)("br",null),this._contentStrings.recenter)),(0,i.h)("ion-button",{style:{width:"28%",height:"45px","margin-left":"5px","margin-right":"5px"},size:"small",onClick:function(){r._switchBoundingBoxEnabled()}},(0,i.h)("div",{style:{"font-size":"10px",color:"white","margin-bottom":"2px"}},(0,i.h)("ion-icon",{style:{"min-width":"20px","min-height":"20px","margin-bottom":"2px"},src:n,title:this._contentStrings.bounds}),(0,i.h)("br",null),this._contentStrings.bounds)))},t.prototype.render=function(){return(0,i.h)("div",{style:{"max-width":"100%","overflow-x":"hidden","border-width":"0 0 1px 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","padding-bottom":"10px","margin-bottom":"10px"}},this.renderControlsTypeSelect())},Object.defineProperty(t,"style",{get:function(){return"select{padding:5px;min-width:100px;background-color:var(--al-select-background-color);color:var(--al-item-color);border:none}@supports (-moz-appearance:none){select{background-color:#fff!important;color:#000!important}}ion-label{color:var(--al-item-color)}"},enumerable:!0,configurable:!0}),t}();function it(){}!function(t){t[t.Backspace=8]="Backspace",t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Shift=16]="Shift",t[t.Ctrl=17]="Ctrl",t[t.Alt=18]="Alt",t[t.PauseBreak=19]="PauseBreak",t[t.CapsLock=20]="CapsLock",t[t.Escape=27]="Escape",t[t.Spacebar=32]="Spacebar",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.LeftArrow=37]="LeftArrow",t[t.UpArrow=38]="UpArrow",t[t.RightArrow=39]="RightArrow",t[t.DownArrow=40]="DownArrow",t[t.PrintScrn=44]="PrintScrn",t[t.Insert=45]="Insert",t[t.Delete=46]="Delete",t[t.Zero=48]="Zero",t[t.One=49]="One",t[t.Two=50]="Two",t[t.Three=51]="Three",t[t.Four=52]="Four",t[t.Five=53]="Five",t[t.Six=54]="Six",t[t.Seven=55]="Seven",t[t.Eight=56]="Eight",t[t.Nine=57]="Nine",t[t.a=65]="a",t[t.b=66]="b",t[t.c=67]="c",t[t.d=68]="d",t[t.e=69]="e",t[t.f=70]="f",t[t.g=71]="g",t[t.h=72]="h",t[t.i=73]="i",t[t.j=74]="j",t[t.k=75]="k",t[t.l=76]="l",t[t.m=77]="m",t[t.n=78]="n",t[t.o=79]="o",t[t.p=80]="p",t[t.q=81]="q",t[t.r=82]="r",t[t.s=83]="s",t[t.t=84]="t",t[t.u=85]="u",t[t.v=86]="v",t[t.w=87]="w",t[t.x=88]="x",t[t.y=89]="y",t[t.z=90]="z",t[t.LeftWindowKey=91]="LeftWindowKey",t[t.RightWindowKey=92]="RightWindowKey",t[t.SelectKey=93]="SelectKey",t[t.Numpad0=96]="Numpad0",t[t.Numpad1=97]="Numpad1",t[t.Numpad2=98]="Numpad2",t[t.Numpad3=99]="Numpad3",t[t.Numpad4=100]="Numpad4",t[t.Numpad5=101]="Numpad5",t[t.Numpad6=102]="Numpad6",t[t.Numpad7=103]="Numpad7",t[t.Numpad8=104]="Numpad8",t[t.Numpad9=105]="Numpad9",t[t.Multiply=106]="Multiply",t[t.NumpadPlus=107]="NumpadPlus",t[t.NumpadMinus=109]="NumpadMinus",t[t.DecimalPoint=110]="DecimalPoint",t[t.Divide=111]="Divide",t[t.F1=112]="F1",t[t.F2=113]="F2",t[t.F3=114]="F3",t[t.F4=115]="F4",t[t.F5=116]="F5",t[t.F6=117]="F6",t[t.F7=118]="F7",t[t.F8=119]="F8",t[t.F9=120]="F9",t[t.F10=121]="F10",t[t.F11=122]="F11",t[t.F12=123]="F12",t[t.NumLock=144]="NumLock",t[t.ScrollLock=145]="ScrollLock",t[t.Semicolon=186]="Semicolon",t[t.Equals=187]="Equals",t[t.Comma=188]="Comma",t[t.LessThan=188]="LessThan",t[t.Dash=189]="Dash",t[t.Period=190]="Period",t[t.GreaterThan=190]="GreaterThan",t[t.ForwardSlash=191]="ForwardSlash",t[t.QuestionMark=191]="QuestionMark",t[t.GraveAccent=192]="GraveAccent",t[t.Tilde=192]="Tilde",t[t.OpenCurlyBracket=219]="OpenCurlyBracket",t[t.OpenSquareBracket=219]="OpenSquareBracket",t[t.BackSlash=220]="BackSlash",t[t.VerticalPipe=220]="VerticalPipe",t[t.CloseCurlyBracket=221]="CloseCurlyBracket",t[t.CloseSquareBracket=221]="CloseSquareBracket",t[t.Quote=222]="Quote",t[t.CommandFF=224]="CommandFF"}(H||(H={})),function(t){t[t.Backspace=8]="Backspace",t[t.Enter=13]="Enter",t[t.Spacebar=32]="Spacebar",t[t.Hash=35]="Hash",t[t.GraveAccent=39]="GraveAccent",t[t.DoubleQuote=34]="DoubleQuote",t[t.Asterisk=42]="Asterisk",t[t.Plus=43]="Plus",t[t.Comma=44]="Comma",t[t.Minus=45]="Minus",t[t.Period=46]="Period",t[t.ForwardSlash=47]="ForwardSlash",t[t.Zero=48]="Zero",t[t.One=49]="One",t[t.Two=50]="Two",t[t.Three=51]="Three",t[t.Four=52]="Four",t[t.Five=53]="Five",t[t.Six=54]="Six",t[t.Seven=55]="Seven",t[t.Eight=56]="Eight",t[t.Nine=57]="Nine",t[t.Colon=58]="Colon",t[t.Semicolon=59]="Semicolon",t[t.LessThan=60]="LessThan",t[t.Equals=61]="Equals",t[t.GreaterThan=62]="GreaterThan",t[t.QuestionMark=63]="QuestionMark",t[t.At=64]="At",t[t.OpenSquareBracket=91]="OpenSquareBracket",t[t.BackSlash=92]="BackSlash",t[t.CloseSquareBracket=93]="CloseSquareBracket",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.OpenCurlyBracket=123]="OpenCurlyBracket",t[t.VerticalPipe=124]="VerticalPipe",t[t.CloseCurlyBracket=125]="CloseCurlyBracket",t[t.Tilde=126]="Tilde"}(F||(F={})),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}),Object.assign(it.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var i=n.indexOf(e);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),i=0,r=n.length;i<r;i++)n[i].call(this,t)}}}});var rt,ot,at,st,lt=100,ct=103,ht=104,ut=300,dt=301,pt=302,ft=304,mt=306,gt=307,vt=1e3,yt=1001,bt=1002,xt=1003,wt=1004,Et=1005,_t=1006,Mt=1007,St=1008,Tt=1009,At=1012,Lt=1014,Ct=1015,Pt=1016,Rt=1020,Ot=1022,It=1023,Dt=1026,kt=1027,Nt=33776,zt=33777,Bt=33778,Ht=33779,Ft=35840,jt=35841,Ut=35842,Gt=35843,Vt=2300,Wt=2301,Yt=2302,Xt=2400,qt=2401,Zt=2402,Jt=3e3,Qt=3007,Kt=7680,$t={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var t=[],e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16);return function(){var e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&n]+t[n>>8&255]+"-"+t[n>>16&15|64]+t[n>>24&255]+"-"+t[63&i|128]+t[i>>8&255]+"-"+t[i>>16&255]+t[i>>24&255]+t[255&r]+t[r>>8&255]+t[r>>16&255]+t[r>>24&255]).toUpperCase()}}(),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*$t.DEG2RAD},radToDeg:function(t){return t*$t.RAD2DEG},isPowerOfTwo:function(t){return!(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};function te(t,e){this.x=t||0,this.y=e||0}function ee(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}function ne(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function ie(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(te.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(te.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}}),Object.assign(ee,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,o,a){var s=n[i+0],l=n[i+1],c=n[i+2],h=n[i+3],u=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];if(h!==f||s!==u||l!==d||c!==p){var m=1-a,g=s*u+l*d+c*p+h*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var b=Math.sqrt(y),x=Math.atan2(b,g*v);m=Math.sin(m*x)/b,a=Math.sin(a*x)/b}var w=a*v;if(s=s*m+u*w,l=l*m+d*w,c=c*m+p*w,h=h*m+f*w,m===1-a){var E=1/Math.sqrt(s*s+l*l+c*c+h*h);s*=E,l*=E,c*=E,h*=E}}t[e]=s,t[e+1]=l,t[e+2]=c,t[e+3]=h}}),Object.defineProperties(ee.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(ee.prototype,{isQuaternion:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,o=t.order,a=Math.cos,s=Math.sin,l=a(n/2),c=a(i/2),h=a(r/2),u=s(n/2),d=s(i/2),p=s(r/2);return"XYZ"===o?(this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p):"YXZ"===o?(this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p):"ZXY"===o?(this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p):"ZYX"===o?(this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p):"YZX"===o?(this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p):"XZY"===o&&(this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p),!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],h=n[6],u=n[10],d=i+s+u;return d>0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(h-l)*e,this._y=(o-c)*e,this._z=(a-r)*e):i>s&&i>u?(e=2*Math.sqrt(1+i-s-u),this._w=(h-l)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+c)/e):s>u?(e=2*Math.sqrt(1+s-i-u),this._w=(o-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(l+h)/e):(e=2*Math.sqrt(1+u-i-s),this._w=(a-r)/e,this._x=(o+c)/e,this._y=(l+h)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs($t.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var i=Math.min(1,e/n);return this.slerp(t,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,s=e._y,l=e._z,c=e._w;return this._x=n*c+o*a+i*l-r*s,this._y=i*c+o*s+r*a-n*l,this._z=r*c+o*l+n*s-i*a,this._w=o*c-n*a-i*s-r*l,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;var s=1-a*a;if(s<=Number.EPSILON){var l=1-e;return this._w=l*o+e*this._w,this._x=l*n+e*this._x,this._y=l*i+e*this._y,this._z=l*r+e*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),h=Math.atan2(c,a),u=Math.sin((1-e)*h)/c,d=Math.sin(e*h)/c;return this._w=o*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(ne.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:(ot=new ee,function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ot.setFromEuler(t))}),applyAxisAngle:function(){var t=new ee;return function(e,n){return this.applyQuaternion(t.setFromAxisAngle(e,n))}}(),applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,s=t.w,l=s*e+o*i-a*n,c=s*n+a*e-r*i,h=s*i+r*n-o*e,u=-r*e-o*n-a*i;return this.x=l*s+u*-r+c*-a-h*-o,this.y=c*s+u*-o+h*-r-l*-a,this.z=h*s+u*-a+l*-o-c*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-i*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:(rt=new ne,function(t){return rt.copy(this).projectOnVector(t),this.sub(rt)}),reflect:function(){var t=new ne;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos($t.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(ie.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,o,a,s,l){var c=this.elements;return c[0]=t,c[1]=i,c[2]=a,c[3]=e,c[4]=r,c[5]=s,c[6]=n,c[7]=o,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(t){void 0===at&&(at=new ne);for(var e=0,n=t.count;e<n;e++)at.x=t.getX(e),at.y=t.getY(e),at.z=t.getZ(e),at.applyMatrix3(this),t.setXYZ(e,at.x,at.y,at.z);return t},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[3],s=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],b=i[7],x=i[2],w=i[5],E=i[8];return r[0]=o*f+a*v+s*x,r[3]=o*m+a*y+s*w,r[6]=o*g+a*b+s*E,r[1]=l*f+c*v+h*x,r[4]=l*m+c*y+h*w,r[7]=l*g+c*b+h*E,r[2]=u*f+d*v+p*x,r[5]=u*m+d*y+p*w,r[8]=u*g+d*b+p*E,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],c=t[8];return e*o*c-e*a*l-n*r*c+n*a*s+i*r*l-i*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,i=this.elements,r=n[0],o=n[1],a=n[2],s=n[3],l=n[4],c=n[5],h=n[6],u=n[7],d=n[8],p=d*l-c*u,f=c*h-d*s,m=u*s-l*h,g=r*p+o*f+a*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return i[0]=p*y,i[1]=(a*u-d*o)*y,i[2]=(c*o-a*l)*y,i[3]=f*y,i[4]=(d*r-a*h)*y,i[5]=(a*s-c*r)*y,i[6]=m*y,i[7]=(o*h-u*r)*y,i[8]=(l*r-o*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,o,a){var s=Math.cos(r),l=Math.sin(r);this.set(n*s,n*l,-n*(s*o+l*a)+o+t,-i*l,i*s,-i*(-l*o+s*a)+a+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],o=i[3],a=i[6],s=i[1],l=i[4],c=i[7];return i[0]=e*r+n*s,i[3]=e*o+n*l,i[6]=e*a+n*c,i[1]=-n*r+e*s,i[4]=-n*o+e*l,i[7]=-n*a+e*c,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var re,oe,ae,se,le,ce,he,ue,de,pe={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===st&&(st=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),st.width=t.width,st.height=t.height;var n=st.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=st}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},fe=0;function me(t,e,n,i,r,o,a,s,l,c){Object.defineProperty(this,"id",{value:fe++}),this.uuid=$t.generateUUID(),this.name="",this.image=void 0!==t?t:me.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:me.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:yt,this.wrapT=void 0!==i?i:yt,this.magFilter=void 0!==r?r:_t,this.minFilter=void 0!==o?o:St,this.anisotropy=void 0!==l?l:1,this.format=void 0!==a?a:It,this.type=void 0!==s?s:Tt,this.offset=new te(0,0),this.repeat=new te(1,1),this.center=new te(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ie,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:Jt,this.version=0,this.onUpdate=null}function ge(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function ve(t,e,n){this.width=t,this.height=e,this.scissor=new ge(0,0,t,e),this.scissorTest=!1,this.viewport=new ge(0,0,t,e),n=n||{},this.texture=new me(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:_t,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function ye(t,e,n){ve.call(this,t,e,n),this.samples=4}function be(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function xe(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||xe.DefaultOrder}function we(){this.mask=1}me.DEFAULT_IMAGE=void 0,me.DEFAULT_MAPPING=ut,me.prototype=Object.assign(Object.create(it.prototype),{constructor:me,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=$t.generateUUID()),!e&&void 0===t.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var o=0,a=i.length;o<a;o++)r.push(pe.getDataURL(i[o]))}else r=pe.getDataURL(i);t.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping!==ut)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case vt:t.x=t.x-Math.floor(t.x);break;case yt:t.x=t.x<0?0:1;break;case bt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case vt:t.y=t.y-Math.floor(t.y);break;case yt:t.y=t.y<0?0:1;break;case bt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(me.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(ge.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(ge.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,i,r,o=.01,a=.1,s=t.elements,l=s[0],c=s[4],h=s[8],u=s[1],d=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(c-u)<o&&Math.abs(h-f)<o&&Math.abs(p-m)<o){if(Math.abs(c+u)<a&&Math.abs(h+f)<a&&Math.abs(p+m)<a&&Math.abs(l+d+g-3)<a)return this.set(1,0,0,0),this;e=Math.PI;var v=(l+1)/2,y=(d+1)/2,b=(g+1)/2,x=(c+u)/4,w=(h+f)/4,E=(p+m)/4;return v>y&&v>b?v<o?(n=0,i=.707106781,r=.707106781):(i=x/(n=Math.sqrt(v)),r=w/n):y>b?y<o?(n=.707106781,i=0,r=.707106781):(n=x/(i=Math.sqrt(y)),r=E/i):b<o?(n=.707106781,i=.707106781,r=0):(n=w/(r=Math.sqrt(b)),i=E/r),this.set(n,i,r,e),this}var _=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(_)<.001&&(_=1),this.x=(m-p)/_,this.y=(h-f)/_,this.z=(u-c)/_,this.w=Math.acos((l+d+g-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){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:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){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:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),ve.prototype=Object.assign(Object.create(it.prototype),{constructor:ve,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ye.prototype=Object.assign(Object.create(ve.prototype),{constructor:ye,isWebGLMultisampleRenderTarget:!0,copy:function(t){return ve.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(be.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,o,a,s,l,c,h,u,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new be).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(){var t=new ne;return function(e){var n=this.elements,i=e.elements,r=1/t.setFromMatrixColumn(e,0).length(),o=1/t.setFromMatrixColumn(e,1).length(),a=1/t.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*o,n[5]=i[5]*o,n[6]=i[6]*o,n[7]=0,n[8]=i[8]*a,n[9]=i[9]*a,n[10]=i[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){var u=o*c,d=o*h,p=a*c,f=a*h;e[0]=s*c,e[4]=-s*h,e[8]=l,e[1]=d+p*l,e[5]=u-f*l,e[9]=-a*s,e[2]=f-u*l,e[6]=p+d*l,e[10]=o*s}else if("YXZ"===t.order){var m=s*c,g=s*h,v=l*c,y=l*h;e[0]=m+y*a,e[4]=v*a-g,e[8]=o*l,e[1]=o*h,e[5]=o*c,e[9]=-a,e[2]=g*a-v,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order)m=s*c,g=s*h,v=l*c,y=l*h,e[0]=m-y*a,e[4]=-o*h,e[8]=v+g*a,e[1]=g+v*a,e[5]=o*c,e[9]=y-m*a,e[2]=-o*l,e[6]=a,e[10]=o*s;else if("ZYX"===t.order)u=o*c,d=o*h,p=a*c,f=a*h,e[0]=s*c,e[4]=p*l-d,e[8]=u*l+f,e[1]=s*h,e[5]=f*l+u,e[9]=d*l-p,e[2]=-l,e[6]=a*s,e[10]=o*s;else if("YZX"===t.order){var b=o*s,x=o*l,w=a*s,E=a*l;e[0]=s*c,e[4]=E-b*h,e[8]=w*h+x,e[1]=h,e[5]=o*c,e[9]=-a*c,e[2]=-l*c,e[6]=x*h+w,e[10]=b-E*h}else"XZY"===t.order&&(b=o*s,x=o*l,w=a*s,E=a*l,e[0]=s*c,e[4]=-h,e[8]=l*c,e[1]=b*h+E,e[5]=o*c,e[9]=x*h-w,e[2]=w*h-x,e[6]=a*c,e[10]=E*h+b);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:(ce=new ne(0,0,0),he=new ne(1,1,1),function(t){return this.compose(ce,t,he)}),lookAt:(ae=new ne,se=new ne,le=new ne,function(t,e,n){var i=this.elements;return le.subVectors(t,e),0===le.lengthSq()&&(le.z=1),le.normalize(),ae.crossVectors(n,le),0===ae.lengthSq()&&(1===Math.abs(n.z)?le.x+=1e-4:le.z+=1e-4,le.normalize(),ae.crossVectors(n,le)),ae.normalize(),se.crossVectors(le,ae),i[0]=ae.x,i[4]=se.x,i[8]=le.x,i[1]=ae.y,i[5]=se.y,i[9]=le.y,i[2]=ae.z,i[6]=se.z,i[10]=le.z,this}),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[4],s=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],b=n[11],x=n[15],w=i[0],E=i[4],_=i[8],M=i[12],S=i[1],T=i[5],A=i[9],L=i[13],C=i[2],P=i[6],R=i[10],O=i[14],I=i[3],D=i[7],k=i[11],N=i[15];return r[0]=o*w+a*S+s*C+l*I,r[4]=o*E+a*T+s*P+l*D,r[8]=o*_+a*A+s*R+l*k,r[12]=o*M+a*L+s*O+l*N,r[1]=c*w+h*S+u*C+d*I,r[5]=c*E+h*T+u*P+d*D,r[9]=c*_+h*A+u*R+d*k,r[13]=c*M+h*L+u*O+d*N,r[2]=p*w+f*S+m*C+g*I,r[6]=p*E+f*T+m*P+g*D,r[10]=p*_+f*A+m*R+g*k,r[14]=p*M+f*L+m*O+g*N,r[3]=v*w+y*S+b*C+x*I,r[7]=v*E+y*T+b*P+x*D,r[11]=v*_+y*A+b*R+x*k,r[15]=v*M+y*L+b*O+x*N,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t=new ne;return function(e){for(var n=0,i=e.count;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.applyMatrix4(this),e.setXYZ(n,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],s=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*s*h-i*l*h-r*a*u+n*l*u+i*a*d-n*s*d)+t[7]*(+e*s*d-e*l*u+r*o*u-i*o*d+i*l*c-r*s*c)+t[11]*(+e*l*h-e*a*d-r*o*h+n*o*d+r*a*c-n*l*c)+t[15]*(-i*a*c-e*s*h+e*a*u+i*o*h-n*o*u+n*s*c)},transpose:function(){var t,e=this.elements;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:function(t,e,n){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this},getInverse:function(t,e){var n=this.elements,i=t.elements,r=i[0],o=i[1],a=i[2],s=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],b=i[15],x=p*y*u-v*f*u+v*h*m-c*y*m-p*h*b+c*f*b,w=g*f*u-d*y*u-g*h*m+l*y*m+d*h*b-l*f*b,E=d*v*u-g*p*u+g*c*m-l*v*m-d*c*b+l*p*b,_=g*p*h-d*v*h-g*c*f+l*v*f+d*c*y-l*p*y,M=r*x+o*w+a*E+s*_;if(0===M){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(S);return console.warn(S),this.identity()}var T=1/M;return n[0]=x*T,n[1]=(v*f*s-p*y*s-v*a*m+o*y*m+p*a*b-o*f*b)*T,n[2]=(c*y*s-v*h*s+v*a*u-o*y*u-c*a*b+o*h*b)*T,n[3]=(p*h*s-c*f*s-p*a*u+o*f*u+c*a*m-o*h*m)*T,n[4]=w*T,n[5]=(d*y*s-g*f*s+g*a*m-r*y*m-d*a*b+r*f*b)*T,n[6]=(g*h*s-l*y*s-g*a*u+r*y*u+l*a*b-r*h*b)*T,n[7]=(l*f*s-d*h*s+d*a*u-r*f*u-l*a*m+r*h*m)*T,n[8]=E*T,n[9]=(g*p*s-d*v*s-g*o*m+r*v*m+d*o*b-r*p*b)*T,n[10]=(l*v*s-g*c*s+g*o*u-r*v*u-l*o*b+r*c*b)*T,n[11]=(d*c*s-l*p*s-d*o*u+r*p*u+l*o*m-r*c*m)*T,n[12]=_*T,n[13]=(d*v*a-g*p*a+g*o*f-r*v*f-d*o*y+r*p*y)*T,n[14]=(g*c*a-l*v*a-g*o*h+r*v*h+l*o*y-r*c*y)*T,n[15]=(l*p*a-d*c*a+d*o*h-r*p*h-l*o*f+r*c*f)*T,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,s=t.z,l=r*o,c=r*a;return this.set(l*o+n,l*a-i*s,l*s+i*a,0,l*a+i*s,c*a+n,c*s-i*o,0,l*s-i*a,c*s+i*o,r*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var i=this.elements,r=e._x,o=e._y,a=e._z,s=e._w,l=r+r,c=o+o,h=a+a,u=r*l,d=r*c,p=r*h,f=o*c,m=o*h,g=a*h,v=s*l,y=s*c,b=s*h,x=n.x,w=n.y,E=n.z;return i[0]=(1-(f+g))*x,i[1]=(d+b)*x,i[2]=(p-y)*x,i[3]=0,i[4]=(d-b)*w,i[5]=(1-(u+g))*w,i[6]=(m+v)*w,i[7]=0,i[8]=(p+y)*E,i[9]=(m-v)*E,i[10]=(1-(u+f))*E,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:(re=new ne,oe=new be,function(t,e,n){var i=this.elements,r=re.set(i[0],i[1],i[2]).length(),o=re.set(i[4],i[5],i[6]).length(),a=re.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],oe.copy(this);var s=1/r,l=1/o,c=1/a;return oe.elements[0]*=s,oe.elements[1]*=s,oe.elements[2]*=s,oe.elements[4]*=l,oe.elements[5]*=l,oe.elements[6]*=l,oe.elements[8]*=c,oe.elements[9]*=c,oe.elements[10]*=c,e.setFromRotationMatrix(oe),n.x=r,n.y=o,n.z=a,this}),makePerspective:function(t,e,n,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*r/(e-t),l=2*r/(n-i),c=(e+t)/(e-t),h=(n+i)/(n-i),u=-(o+r)/(o-r),d=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,i,r,o){var a=this.elements,s=1/(e-t),l=1/(n-i),c=1/(o-r),h=(e+t)*s,u=(n+i)*l,d=(o+r)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}),xe.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],xe.DefaultOrder="XYZ",Object.defineProperties(xe.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(xe.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var i=$t.clamp,r=t.elements,o=r[0],a=r[4],s=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,c),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o))):"ZYX"===e?(this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c))):"YZX"===e?(this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===e?(this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-h,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return void 0===ue&&(ue=new be),ue.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ue,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return void 0===de&&(de=new ee),de.setFromEuler(this),this.setFromQuaternion(de,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new ne(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(we.prototype,{set:function(t){this.mask=1<<t},enable:function(t){this.mask|=1<<t},toggle:function(t){this.mask^=1<<t},disable:function(t){this.mask&=~(1<<t)},test:function(t){return!!(this.mask&t.mask)}});var Ee,_e,Me,Se,Te,Ae,Le,Ce,Pe,Re,Oe,Ie,De,ke,Ne,ze,Be,He,Fe,je,Ue=0;function Ge(){Object.defineProperty(this,"id",{value:Ue++}),this.uuid=$t.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ge.DefaultUp.clone();var t=new ne,e=new xe,n=new ee,i=new ne(1,1,1);e._onChange((function(){n.setFromEuler(e,!1)})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new be},normalMatrix:{value:new ie}}),this.matrix=new be,this.matrixWorld=new be,this.matrixAutoUpdate=Ge.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new we,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function Ve(){Ge.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function We(t,e){this.min=void 0!==t?t:new ne(1/0,1/0,1/0),this.max=void 0!==e?e:new ne(-1/0,-1/0,-1/0)}function Ye(t,e){this.center=void 0!==t?t:new ne,this.radius=void 0!==e?e:0}function Xe(t,e){this.origin=void 0!==t?t:new ne,this.direction=void 0!==e?e:new ne}function qe(t,e,n){this.a=void 0!==t?t:new ne,this.b=void 0!==e?e:new ne,this.c=void 0!==n?n:new ne}Ge.DefaultUp=new ne(0,1,0),Ge.DefaultMatrixAutoUpdate=!0,Ge.prototype=Object.assign(Object.create(it.prototype),{constructor:Ge,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:(Te=new ee,function(t,e){return Te.setFromAxisAngle(t,e),this.quaternion.multiply(Te),this}),rotateOnWorldAxis:function(){var t=new ee;return function(e,n){return t.setFromAxisAngle(e,n),this.quaternion.premultiply(t),this}}(),rotateX:function(){var t=new ne(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new ne(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new ne(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new ne;return function(e,n){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(n)),this}}(),translateX:function(){var t=new ne(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new ne(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new ne(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:(Se=new be,function(t){return t.applyMatrix4(Se.getInverse(this.matrixWorld))}),lookAt:function(){var t=new ee,e=new be,n=new ne,i=new ne;return function(r,o,a){r.isVector3?n.copy(r):n.set(r,o,a);var s=this.parent;this.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?e.lookAt(i,n,this.up):e.lookAt(n,i,this.up),this.quaternion.setFromRotationMatrix(e),s&&(e.extractRotation(s.matrixWorld),t.setFromRotationMatrix(e),this.quaternion.premultiply(t.inverse()))}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent({type:"removed"})),this},attach:(Me=new be,function(t){return this.updateWorldMatrix(!0,!1),Me.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Me.multiply(t.parent.matrixWorld)),t.applyMatrix(Me),t.updateWorldMatrix(!1,!1),this.add(t),this}),getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new ne),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Ee=new ne,_e=new ne,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new ee),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ee,t,_e),t}),getWorldScale:function(){var t=new ne,e=new ee;return function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),n=new ne),this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,n),n}}(),getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new ne),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var i=this.children,r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(t){var e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isMesh&&0!==this.drawMode&&(i.drawMode=this.drawMode),this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,l=a.length;s<l;s++){var c=a[s];r(t.shapes,c)}else r(t.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var h=[];for(s=0,l=this.material.length;s<l;s++)h.push(r(t.materials,this.material[s]));i.material=h}else i.material=r(t.materials,this.material);if(this.children.length>0)for(i.children=[],s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(t).object);if(e){var u=m(t.geometries),d=m(t.materials),p=m(t.textures),f=m(t.images);a=m(t.shapes),u.length>0&&(n.geometries=u),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),f.length>0&&(n.images=f),a.length>0&&(n.shapes=a)}return n.object=i,n;function m(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var i=t.children[n];this.add(i.clone())}return this}}),Ve.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Ve,isScene:!0,copy:function(t,e){return Ge.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=Ge.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.assign(We.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,l=t.length;s<l;s+=3){var c=t[s],h=t[s+1],u=t[s+2];c<e&&(e=c),h<n&&(n=h),u<i&&(i=u),c>r&&(r=c),h>o&&(o=h),u>a&&(a=u)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,l=t.count;s<l;s++){var c=t.getX(s),h=t.getY(s),u=t.getZ(s);c<e&&(e=c),h<n&&(n=h),u<i&&(i=u),c>r&&(r=c),h>o&&(o=h),u>a&&(a=u)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new ne;return function(e,n){var i=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){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:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new ne),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new ne),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){var t,e,n,i=new ne;function r(r){var o=r.geometry;if(void 0!==o)if(o.isGeometry){var a=o.vertices;for(e=0,n=a.length;e<n;e++)i.copy(a[e]),i.applyMatrix4(r.matrixWorld),t.expandByPoint(i)}else if(o.isBufferGeometry){var s=o.attributes.position;if(void 0!==s)for(e=0,n=s.count;e<n;e++)i.fromBufferAttribute(s,e).applyMatrix4(r.matrixWorld),t.expandByPoint(i)}}return function(e){return t=this,e.updateMatrixWorld(!0),e.traverse(r),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new ne),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:(Le=new ne,function(t){return this.clampPoint(t.center,Le),Le.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(){var t=new ne,e=new ne,n=new ne,i=new ne,r=new ne,o=new ne,a=new ne,s=new ne,l=new ne,c=new ne;function h(i){var r,o;for(r=0,o=i.length-3;r<=o;r+=3){a.fromArray(i,r);var s=l.x*Math.abs(a.x)+l.y*Math.abs(a.y)+l.z*Math.abs(a.z),c=t.dot(a),h=e.dot(a),u=n.dot(a);if(Math.max(-Math.max(c,h,u),Math.min(c,h,u))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),l.subVectors(this.max,s),t.subVectors(a.a,s),e.subVectors(a.b,s),n.subVectors(a.c,s),i.subVectors(e,t),r.subVectors(n,e),o.subVectors(t,n);var u=[0,-i.z,i.y,0,-r.z,r.y,0,-o.z,o.y,i.z,0,-i.x,r.z,0,-r.x,o.z,0,-o.x,-i.y,i.x,0,-r.y,r.x,0,-o.y,o.x,0];return!!h(u)&&!!h(u=[1,0,0,0,1,0,0,0,1])&&(c.crossVectors(i,r),h(u=[c.x,c.y,c.z]))}}(),clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new ne),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new ne;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new ne;return function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(t).length(),e}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(Ae=[new ne,new ne,new ne,new ne,new ne,new ne,new ne,new ne],function(t){return this.isEmpty()||(Ae[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ae[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ae[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ae[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ae[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ae[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ae[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ae[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ae)),this}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(Ye.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){void 0===Ce&&(Ce=new We);var n=this.center;void 0!==e?n.copy(e):Ce.setFromPoints(t).getCenter(n);for(var i=0,r=0,o=t.length;r<o;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new ne),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new We),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(Xe.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new ne),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new ne;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new ne),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new ne;return function(e){var n=t.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(n).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:(Re=new ne,Oe=new ne,Ie=new ne,function(t,e,n,i){Re.copy(t).add(e).multiplyScalar(.5),Oe.copy(e).sub(t).normalize(),Ie.copy(this.origin).sub(Re);var r,o,a,s,l=.5*t.distanceTo(e),c=-this.direction.dot(Oe),h=Ie.dot(this.direction),u=-Ie.dot(Oe),d=Ie.lengthSq(),p=Math.abs(1-c*c);if(p>0)if(o=c*h-u,s=l*p,(r=c*u-h)>=0)if(o>=-s)if(o<=s){var f=1/p;a=(r*=f)*(r+c*(o*=f)+2*h)+o*(c*r+o+2*u)+d}else o=l,a=-(r=Math.max(0,-(c*o+h)))*r+o*(o+2*u)+d;else o=-l,a=-(r=Math.max(0,-(c*o+h)))*r+o*(o+2*u)+d;else o<=-s?a=-(r=Math.max(0,-(-c*l+h)))*r+(o=r>0?-l:Math.min(Math.max(-l,-u),l))*(o+2*u)+d:o<=s?(r=0,a=(o=Math.min(Math.max(-l,-u),l))*(o+2*u)+d):a=-(r=Math.max(0,-(c*l+h)))*r+(o=r>0?l:Math.min(Math.max(-l,-u),l))*(o+2*u)+d;else o=c>0?-l:l,a=-(r=Math.max(0,-(c*o+h)))*r+o*(o+2*u)+d;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(Oe).multiplyScalar(o).add(Re),a}),intersectSphere:function(){var t=new ne;return function(e,n){t.subVectors(e.center,this.origin);var i=t.dot(this.direction),r=t.dot(t)-i*i,o=e.radius*e.radius;if(r>o)return null;var a=Math.sqrt(o-r),s=i-a,l=i+a;return s<0&&l<0?null:s<0?this.at(l,n):this.at(s,n)}}(),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,i,r,o,a,s,l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,o=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,o=(t.min.y-u.y)*c),n>o||r>i?null:((r>n||n!=n)&&(n=r),(o<i||i!=i)&&(i=o),h>=0?(a=(t.min.z-u.z)*h,s=(t.max.z-u.z)*h):(a=(t.max.z-u.z)*h,s=(t.min.z-u.z)*h),n>s||a>i?null:((a>n||n!=n)&&(n=a),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,e)))},intersectsBox:(Pe=new ne,function(t){return null!==this.intersectBox(t,Pe)}),intersectTriangle:function(){var t=new ne,e=new ne,n=new ne,i=new ne;return function(r,o,a,s,l){e.subVectors(o,r),n.subVectors(a,r),i.crossVectors(e,n);var c,h=this.direction.dot(i);if(h>0){if(s)return null;c=1}else{if(!(h<0))return null;c=-1,h=-h}t.subVectors(this.origin,r);var u=c*this.direction.dot(n.crossVectors(t,n));if(u<0)return null;var d=c*this.direction.dot(e.cross(t));if(d<0)return null;if(u+d>h)return null;var p=-c*t.dot(i);return p<0?null:this.at(p/h,l)}}(),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(qe,{getNormal:(ke=new ne,function(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new ne),i.subVectors(n,e),ke.subVectors(t,e),i.cross(ke);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}),getBarycoord:function(){var t=new ne,e=new ne,n=new ne;return function(i,r,o,a,s){t.subVectors(a,r),e.subVectors(o,r),n.subVectors(i,r);var l=t.dot(t),c=t.dot(e),h=t.dot(n),u=e.dot(e),d=e.dot(n),p=l*u-c*c;if(void 0===s&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),s=new ne),0===p)return s.set(-2,-1,-1);var f=1/p,m=(u*h-c*d)*f,g=(l*d-c*h)*f;return s.set(1-m-g,g,m)}}(),containsPoint:function(){var t=new ne;return function(e,n,i,r){return qe.getBarycoord(e,n,i,r,t),t.x>=0&&t.y>=0&&t.x+t.y<=1}}(),getUV:(De=new ne,function(t,e,n,i,r,o,a,s){return this.getBarycoord(t,e,n,i,De),s.set(0,0),s.addScaledVector(r,De.x),s.addScaledVector(o,De.y),s.addScaledVector(a,De.z),s}),isFrontFacing:function(){var t=new ne,e=new ne;return function(n,i,r,o){return t.subVectors(r,i),e.subVectors(n,i),t.cross(e).dot(o)<0}}()}),Object.assign(qe.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){var t=new ne,e=new ne;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new ne),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return qe.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new ne),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return qe.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,i,r){return qe.getUV(t,this.a,this.b,this.c,e,n,i,r)},containsPoint:function(t){return qe.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return qe.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:(Ne=new ne,ze=new ne,Be=new ne,He=new ne,Fe=new ne,je=new ne,function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new ne);var n,i,r=this.a,o=this.b,a=this.c;Ne.subVectors(o,r),ze.subVectors(a,r),He.subVectors(t,r);var s=Ne.dot(He),l=ze.dot(He);if(s<=0&&l<=0)return e.copy(r);Fe.subVectors(t,o);var c=Ne.dot(Fe),h=ze.dot(Fe);if(c>=0&&h<=c)return e.copy(o);var u=s*h-c*l;if(u<=0&&s>=0&&c<=0)return n=s/(s-c),e.copy(r).addScaledVector(Ne,n);je.subVectors(t,a);var d=Ne.dot(je),p=ze.dot(je);if(p>=0&&d<=p)return e.copy(a);var f=d*l-s*p;if(f<=0&&l>=0&&p<=0)return i=l/(l-p),e.copy(r).addScaledVector(ze,i);var m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return Be.subVectors(a,o),i=(h-c)/(h-c+(d-p)),e.copy(o).addScaledVector(Be,i);var g=1/(m+f+u);return n=f*g,i=u*g,e.copy(r).addScaledVector(Ne,n).addScaledVector(ze,i)}),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var Ze,Je,Qe,Ke={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};function $e(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function tn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function en(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function nn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function rn(t,e,n,i,r,o){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new ne,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new $e,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Object.assign($e.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=$t.euclideanModulo(t,1),e=$t.clamp(e,0,1),n=$t.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=tn(r,i,t+1/3),this.g=tn(r,i,t),this.b=tn(r,i,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var i,r=n[1],o=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(a,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var c,h=(c=n[1]).length;if(3===h)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return t&&t.length>0&&(void 0!==(c=Ke[t])?this.setHex(c):console.warn("THREE.Color: Unknown color "+t)),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=en(t.r),this.g=en(t.g),this.b=en(t.b),this},copyLinearToSRGB:function(t){return this.r=nn(t.r),this.g=nn(t.g),this.b=nn(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,i=this.r,r=this.g,o=this.b,a=Math.max(i,r,o),s=Math.min(i,r,o),l=(s+a)/2;if(s===a)e=0,n=0;else{var c=a-s;switch(n=l<=.5?c/(a+s):c/(2-a-s),a){case i:e=(r-o)/c+(r<o?6:0);break;case r:e=(o-i)/c+2;break;case o:e=(i-r)/c+4}e/=6}return t.h=e,t.s=n,t.l=l,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(Qe={},function(t,e,n){return this.getHSL(Qe),Qe.h+=t,Qe.s+=e,Qe.l+=n,this.setHSL(Qe.h,Qe.s,Qe.l),this}),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:(Ze={h:0,s:0,l:0},Je={h:0,s:0,l:0},function(t,e){this.getHSL(Ze),t.getHSL(Je);var n=$t.lerp(Ze.h,Je.h,e),i=$t.lerp(Ze.s,Je.s,e),r=$t.lerp(Ze.l,Je.l,e);return this.setHSL(n,i,r),this}),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}}),Object.assign(rn.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var on=0;function an(){Object.defineProperty(this,"id",{value:on++}),this.uuid=$t.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=lt,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilFunc=519,this.stencilRef=0,this.stencilMask=255,this.stencilFail=Kt,this.stencilZFail=Kt,this.stencilZPass=Kt,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.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.userData={},this.needsUpdate=!0}function sn(t){an.call(this),this.type="MeshBasicMaterial",this.color=new $e(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.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function ln(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function cn(t,e,n){ln.call(this,new Int8Array(t),e,n)}function hn(t,e,n){ln.call(this,new Uint8Array(t),e,n)}function un(t,e,n){ln.call(this,new Uint8ClampedArray(t),e,n)}function dn(t,e,n){ln.call(this,new Int16Array(t),e,n)}function pn(t,e,n){ln.call(this,new Uint16Array(t),e,n)}function fn(t,e,n){ln.call(this,new Int32Array(t),e,n)}function mn(t,e,n){ln.call(this,new Uint32Array(t),e,n)}function gn(t,e,n){ln.call(this,new Float32Array(t),e,n)}function vn(t,e,n){ln.call(this,new Float64Array(t),e,n)}function yn(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function bn(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}an.prototype=Object.assign(Object.create(it.prototype),{constructor:an,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilMask=this.stencilMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var r=i(t.textures),o=i(t.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWrite=t.stencilWrite,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilMask=t.stencilMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),sn.prototype=Object.create(an.prototype),sn.prototype.constructor=sn,sn.prototype.isMeshBasicMaterial=!0,sn.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},Object.defineProperty(ln.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(ln.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new $e),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new te),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new ne),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new ge),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),cn.prototype=Object.create(ln.prototype),cn.prototype.constructor=cn,hn.prototype=Object.create(ln.prototype),hn.prototype.constructor=hn,un.prototype=Object.create(ln.prototype),un.prototype.constructor=un,dn.prototype=Object.create(ln.prototype),dn.prototype.constructor=dn,pn.prototype=Object.create(ln.prototype),pn.prototype.constructor=pn,fn.prototype=Object.create(ln.prototype),fn.prototype.constructor=fn,mn.prototype=Object.create(ln.prototype),mn.prototype.constructor=mn,gn.prototype=Object.create(ln.prototype),gn.prototype.constructor=gn,vn.prototype=Object.create(ln.prototype),vn.prototype.constructor=vn,Object.assign(yn.prototype,{computeGroups:function(t){for(var e,n=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var a=r[o];a.materialIndex!==i&&(i=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:i})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,i=t.vertices,r=t.faceVertexUvs,o=r[0]&&r[0].length>0,a=r[1]&&r[1].length>0,s=t.morphTargets,l=s.length;if(l>0){e=[];for(var c=0;c<l;c++)e[c]={name:s[c].name,data:[]};this.morphTargets.position=e}var h,u=t.morphNormals,d=u.length;if(d>0){for(h=[],c=0;c<d;c++)h[c]={name:u[c].name,data:[]};this.morphTargets.normal=h}var p=t.skinIndices,f=t.skinWeights,m=p.length===i.length,g=f.length===i.length;for(i.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),c=0;c<n.length;c++){var v=n[c];this.vertices.push(i[v.a],i[v.b],i[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var b=v.normal;this.normals.push(b,b,b)}var x,w=v.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var E=v.color;this.colors.push(E,E,E)}!0===o&&(void 0!==(x=r[0][c])?this.uvs.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new te,new te,new te))),!0===a&&(void 0!==(x=r[1][c])?this.uvs2.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new te,new te,new te)));for(var _=0;_<l;_++){var M=s[_].vertices;e[_].data.push(M[v.a],M[v.b],M[v.c])}for(_=0;_<d;_++){var S=u[_].vertexNormals[c];h[_].data.push(S.a,S.b,S.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var xn,wn,En,_n=1;function Mn(){Object.defineProperty(this,"id",{value:_n+=2}),this.uuid=$t.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function Sn(t,e){Ge.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new Mn,this.material=void 0!==e?e:new sn({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}Mn.prototype=Object.assign(Object.create(it.prototype),{constructor:Mn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(bn(t)>65535?mn:pn)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):(this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new ln(arguments[1],arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new ie).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);var i=this.attributes.tangent;return void 0!==i&&((new ie).getNormalMatrix(t).applyToBufferAttribute(i),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new be;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new be;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new be;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new be;return function(e,n,i){return t.makeTranslation(e,n,i),this.applyMatrix(t),this}}(),scale:function(){var t=new be;return function(e,n,i){return t.makeScale(e,n,i),this.applyMatrix(t),this}}(),lookAt:(En=new Ge,function(t){En.lookAt(t),En.updateMatrix(),this.applyMatrix(En.matrix)}),center:(wn=new ne,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(wn).negate(),this.translate(wn.x,wn.y,wn.z),this}),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new gn(3*e.vertices.length,3),i=new gn(3*e.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(e.vertices)),this.addAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new gn(e.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];e.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new gn(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new yn).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new ln(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var n=new Float32Array(3*t.normals.length);this.addAttribute("normal",new ln(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var i=new Float32Array(3*t.colors.length);this.addAttribute("color",new ln(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new ln(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new ln(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],l=t.morphTargets[a],c=0,h=l.length;c<h;c++){var u=l[c],d=new gn(3*u.data.length,3);d.name=u.name,s.push(d.copyVector3sArray(u.data))}this.morphAttributes[a]=s}if(t.skinIndices.length>0){var p=new gn(4*t.skinIndices.length,4);this.addAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new gn(4*t.skinWeights.length,4);this.addAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:(xn=new We,function(){null===this.boundingBox&&(this.boundingBox=new We);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,i=e.length;n<i;n++){var r=e[n];xn.setFromBufferAttribute(r),this.boundingBox.expandByPoint(xn.min),this.boundingBox.expandByPoint(xn.max)}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}),computeBoundingSphere:function(){var t=new We,e=new We,n=new ne;return function(){null===this.boundingSphere&&(this.boundingSphere=new Ye);var i=this.attributes.position,r=this.morphAttributes.position;if(i){var o=this.boundingSphere.center;if(t.setFromBufferAttribute(i),r)for(var a=0,s=r.length;a<s;a++){var l=r[a];e.setFromBufferAttribute(l),t.expandByPoint(e.min),t.expandByPoint(e.max)}t.getCenter(o);var c=0;for(a=0,s=i.count;a<s;a++)n.fromBufferAttribute(i,a),c=Math.max(c,o.distanceToSquared(n));if(r)for(a=0,s=r.length;a<s;a++)for(var h=0,u=(l=r[a]).count;h<u;h++)n.fromBufferAttribute(l,h),c=Math.max(c,o.distanceToSquared(n));this.boundingSphere.radius=Math.sqrt(c),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new ln(new Float32Array(n.length),3));else for(var i=e.normal.array,r=0,o=i.length;r<o;r++)i[r]=0;var a,s,l,c=e.normal.array,h=new ne,u=new ne,d=new ne,p=new ne,f=new ne;if(t){var m=t.array;for(r=0,o=t.count;r<o;r+=3)a=3*m[r+0],s=3*m[r+1],l=3*m[r+2],h.fromArray(n,a),u.fromArray(n,s),d.fromArray(n,l),p.subVectors(d,u),f.subVectors(h,u),p.cross(f),c[a]+=p.x,c[a+1]+=p.y,c[a+2]+=p.z,c[s]+=p.x,c[s+1]+=p.y,c[s+2]+=p.z,c[l]+=p.x,c[l+1]+=p.y,c[l+2]+=p.z}else for(r=0,o=n.length;r<o;r+=9)h.fromArray(n,r),u.fromArray(n,r+3),d.fromArray(n,r+6),p.subVectors(d,u),f.subVectors(h,u),p.cross(f),c[r]=p.x,c[r+1]=p.y,c[r+2]=p.z,c[r+3]=p.x,c[r+4]=p.y,c[r+5]=p.z,c[r+6]=p.x,c[r+7]=p.y,c[r+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var i in n)if(void 0!==t.attributes[i])for(var r=n[i].array,o=t.attributes[i],a=o.array,s=o.itemSize*e,l=Math.min(a.length,r.length-s),c=0,h=s;c<l;c++,h++)r[h]=a[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){var t=new ne;return function(){for(var e=this.attributes.normal,n=0,i=e.count;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.normalize(),e.setXYZ(n,t.x,t.y,t.z)}}(),toNonIndexed:function(){function t(t,e){for(var n=t.array,i=t.itemSize,r=new n.constructor(e.length*i),o=0,a=0,s=0,l=e.length;s<l;s++){o=e[s]*i;for(var c=0;c<i;c++)r[a++]=n[o++]}return new ln(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new Mn,n=this.index.array,i=this.attributes;for(var r in i){var o=t(i[r],n);e.addAttribute(r,o)}var a=this.morphAttributes;for(r in a){for(var s=[],l=a[r],c=0,h=l.length;c<h;c++)o=t(l[c],n),s.push(o);e.morphAttributes[r]=s}for(var u=this.groups,d=(c=0,u.length);c<d;c++){var p=u[c];e.addGroup(p.start,p.count,p.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var i=this.index;null!==i&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var o=(d=r[n]).toJSON();""!==d.name&&(o.name=d.name),t.data.attributes[n]=o}var a={},s=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],c=[],h=0,u=l.length;h<u;h++){var d;o=(d=l[h]).toJSON(),""!==d.name&&(o.name=d.name),c.push(o)}c.length>0&&(a[n]=c,s=!0)}s&&(t.data.morphAttributes=a);var p=this.groups;p.length>0&&(t.data.groups=JSON.parse(JSON.stringify(p)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new Mn).copy(this)},copy:function(t){var e,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var o=t.attributes;for(e in o){var a=o[e];this.addAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var l=[],c=s[e];for(n=0,i=c.length;n<i;n++)l.push(c[n].clone());this.morphAttributes[e]=l}var h=t.groups;for(n=0,i=h.length;n<i;n++){var u=h[n];this.addGroup(u.start,u.count,u.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=t.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Sn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Sn,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return Ge.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(o.length>0){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(){var t=new be,e=new Xe,n=new Ye,i=new ne,r=new ne,o=new ne,a=new ne,s=new ne,l=new ne,c=new ne,h=new ne,u=new ne,d=new te,p=new te,f=new te,m=new ne,g=new ne;function v(t,e,n,i,r,o,a,s){if(null===(1===e.side?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,2!==e.side,s)))return null;g.copy(s),g.applyMatrix4(t.matrixWorld);var l=n.ray.origin.distanceTo(g);return l<n.near||l>n.far?null:{distance:l,point:g.clone(),object:t}}function y(t,e,n,g,y,b,x,w,E,_,M){i.fromBufferAttribute(y,E),r.fromBufferAttribute(y,_),o.fromBufferAttribute(y,M);var S=t.morphTargetInfluences;if(e.morphTargets&&b&&S){c.set(0,0,0),h.set(0,0,0),u.set(0,0,0);for(var T=0,A=b.length;T<A;T++){var L=S[T],C=b[T];0!==L&&(a.fromBufferAttribute(C,E),s.fromBufferAttribute(C,_),l.fromBufferAttribute(C,M),c.addScaledVector(a.sub(i),L),h.addScaledVector(s.sub(r),L),u.addScaledVector(l.sub(o),L))}i.add(c),r.add(h),o.add(u)}var P=v(t,e,n,g,i,r,o,m);if(P){x&&(d.fromBufferAttribute(x,E),p.fromBufferAttribute(x,_),f.fromBufferAttribute(x,M),P.uv=qe.getUV(m,i,r,o,d,p,f,new te)),w&&(d.fromBufferAttribute(w,E),p.fromBufferAttribute(w,_),f.fromBufferAttribute(w,M),P.uv2=qe.getUV(m,i,r,o,d,p,f,new te));var R=new rn(E,_,M);qe.getNormal(i,r,o,R.normal),P.face=R}return P}return function(i,r){var o,a=this.geometry,s=this.material,l=this.matrixWorld;if(void 0!==s&&(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(l),!1!==i.ray.intersectsSphere(n)&&(t.getInverse(l),e.copy(i.ray).applyMatrix4(t),null===a.boundingBox||!1!==e.intersectsBox(a.boundingBox))))if(a.isBufferGeometry){var c,h,u,g,b,x,w,E,_,M=a.index,S=a.attributes.position,T=a.morphAttributes.position,A=a.attributes.uv,L=a.attributes.uv2,C=a.groups,P=a.drawRange;if(null!==M)if(Array.isArray(s))for(g=0,x=C.length;g<x;g++)for(_=s[(E=C[g]).materialIndex],b=Math.max(E.start,P.start),w=Math.min(E.start+E.count,P.start+P.count);b<w;b+=3)c=M.getX(b),h=M.getX(b+1),u=M.getX(b+2),(o=y(this,_,i,e,S,T,A,L,c,h,u))&&(o.faceIndex=Math.floor(b/3),o.face.materialIndex=E.materialIndex,r.push(o));else for(g=Math.max(0,P.start),x=Math.min(M.count,P.start+P.count);g<x;g+=3)c=M.getX(g),h=M.getX(g+1),u=M.getX(g+2),(o=y(this,s,i,e,S,T,A,L,c,h,u))&&(o.faceIndex=Math.floor(g/3),r.push(o));else if(void 0!==S)if(Array.isArray(s))for(g=0,x=C.length;g<x;g++)for(_=s[(E=C[g]).materialIndex],b=Math.max(E.start,P.start),w=Math.min(E.start+E.count,P.start+P.count);b<w;b+=3)(o=y(this,_,i,e,S,T,A,L,c=b,h=b+1,u=b+2))&&(o.faceIndex=Math.floor(b/3),o.face.materialIndex=E.materialIndex,r.push(o));else for(g=Math.max(0,P.start),x=Math.min(S.count,P.start+P.count);g<x;g+=3)(o=y(this,s,i,e,S,T,A,L,c=g,h=g+1,u=g+2))&&(o.faceIndex=Math.floor(g/3),r.push(o))}else if(a.isGeometry){var R,O,I,D,k=Array.isArray(s),N=a.vertices,z=a.faces,B=a.faceVertexUvs[0];B.length>0&&(D=B);for(var H=0,F=z.length;H<F;H++){var j=z[H],U=k?s[j.materialIndex]:s;if(void 0!==U&&(R=N[j.a],O=N[j.b],I=N[j.c],o=v(this,U,i,e,R,O,I,m))){if(D&&D[H]){var G=D[H];d.copy(G[0]),p.copy(G[1]),f.copy(G[2]),o.uv=qe.getUV(m,R,O,I,d,p,f,new te)}o.face=j,o.faceIndex=H,r.push(o)}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Tn=0;function An(){Object.defineProperty(this,"id",{value:Tn+=2}),this.uuid=$t.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Ln(t,e,n,i,r,o){An.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new Cn(t,e,n,i,r,o)),this.mergeVertices()}function Cn(t,e,n,i,r,o){Mn.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};var a=this;t=t||1,e=e||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;var s=[],l=[],c=[],h=[],u=0,d=0;function p(t,e,n,i,r,o,p,f,m,g,v){var y,b,x=o/m,w=p/g,E=o/2,_=p/2,M=f/2,S=m+1,T=g+1,A=0,L=0,C=new ne;for(b=0;b<T;b++){var P=b*w-_;for(y=0;y<S;y++){var R=y*x-E;C[t]=R*i,C[e]=P*r,C[n]=M,l.push(C.x,C.y,C.z),C[t]=0,C[e]=0,C[n]=f>0?1:-1,c.push(C.x,C.y,C.z),h.push(y/m),h.push(1-b/g),A+=1}}for(b=0;b<g;b++)for(y=0;y<m;y++){var O=u+y+S*b,I=u+y+S*(b+1),D=u+(y+1)+S*(b+1),k=u+(y+1)+S*b;s.push(O,I,k),s.push(I,D,k),L+=6}a.addGroup(d,L,v),d+=L,u+=A}p("z","y","x",-1,-1,n,e,t,o,r,0),p("z","y","x",1,-1,n,e,-t,o,r,1),p("x","z","y",1,1,t,n,e,i,o,2),p("x","z","y",1,-1,t,n,-e,i,o,3),p("x","y","z",1,-1,t,e,n,i,r,4),p("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(s),this.addAttribute("position",new gn(l,3)),this.addAttribute("normal",new gn(c,3)),this.addAttribute("uv",new gn(h,2))}function Pn(t){var e={};for(var n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}return e}function Rn(t){for(var e={},n=0;n<t.length;n++){var i=Pn(t[n]);for(var r in i)e[r]=i[r]}return e}An.prototype=Object.assign(Object.create(it.prototype),{constructor:An,isGeometry:!0,applyMatrix:function(t){for(var e=(new ie).getNormalMatrix(t),n=0,i=this.vertices.length;n<i;n++)this.vertices[n].applyMatrix4(t);for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(e).normalize();for(var o=0,a=r.vertexNormals.length;o<a;o++)r.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t=new be;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new be;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new be;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new be;return function(e,n,i){return t.makeTranslation(e,n,i),this.applyMatrix(t),this}}(),scale:function(){var t=new be;return function(e,n,i){return t.makeScale(e,n,i),this.applyMatrix(t),this}}(),lookAt:function(){var t=new Ge;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,i=t.attributes,r=i.position.array,o=void 0!==i.normal?i.normal.array:void 0,a=void 0!==i.color?i.color.array:void 0,s=void 0!==i.uv?i.uv.array:void 0,l=void 0!==i.uv2?i.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var c=0;c<r.length;c+=3)e.vertices.push((new ne).fromArray(r,c)),void 0!==a&&e.colors.push((new $e).fromArray(a,c));function h(t,n,i,r){var c=void 0===a?[]:[e.colors[t].clone(),e.colors[n].clone(),e.colors[i].clone()],h=new rn(t,n,i,void 0===o?[]:[(new ne).fromArray(o,3*t),(new ne).fromArray(o,3*n),(new ne).fromArray(o,3*i)],c,r);e.faces.push(h),void 0!==s&&e.faceVertexUvs[0].push([(new te).fromArray(s,2*t),(new te).fromArray(s,2*n),(new te).fromArray(s,2*i)]),void 0!==l&&e.faceVertexUvs[1].push([(new te).fromArray(l,2*t),(new te).fromArray(l,2*n),(new te).fromArray(l,2*i)])}var u=t.groups;if(u.length>0)for(c=0;c<u.length;c++)for(var d=u[c],p=d.start,f=p,m=p+d.count;f<m;f+=3)void 0!==n?h(n[f],n[f+1],n[f+2],d.materialIndex):h(f,f+1,f+2,d.materialIndex);else if(void 0!==n)for(c=0;c<n.length;c+=3)h(n[c],n[c+1],n[c+2]);else for(c=0;c<r.length/3;c+=3)h(c,c+1,c+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){var t=new ne;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(t).negate(),this.translate(t.x,t.y,t.z),this}}(),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,i=new be;return i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var t=new ne,e=new ne,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],o=this.vertices[r.a],a=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,n,i,r,o,a;for(void 0===t&&(t=!0),a=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)a[e]=new ne;if(t){var s,l,c,h=new ne,u=new ne;for(i=0,r=this.faces.length;i<r;i++)o=this.faces[i],s=this.vertices[o.a],l=this.vertices[o.b],c=this.vertices[o.c],h.subVectors(c,l),u.subVectors(s,l),h.cross(u),a[o.a].add(h),a[o.b].add(h),a[o.c].add(h)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)a[(o=this.faces[i]).a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(e=0,n=this.vertices.length;e<n;e++)a[e].normalize();for(i=0,r=this.faces.length;i<r;i++){var d=(o=this.faces[i]).vertexNormals;3===d.length?(d[0].copy(a[o.a]),d[1].copy(a[o.b]),d[2].copy(a[o.c])):(d[0]=a[o.a].clone(),d[1]=a[o.b].clone(),d[2]=a[o.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var i=(n=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var o=new An;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var a=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)l=new ne,c={a:new ne,b:new ne,c:new ne},a.push(l),s.push(c)}var l,c,h=this.morphNormals[t];for(o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],l=h.faceNormals[n],c=h.vertexNormals[n],l.copy(r.normal),c.a.copy(r.vertexNormals[0]),c.b.copy(r.vertexNormals[1]),c.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new We),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Ye),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var i,r=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,l=t.faces,c=this.colors,h=t.colors;void 0===n&&(n=0),void 0!==e&&(i=(new ie).getNormalMatrix(e));for(var u=0,d=a.length;u<d;u++){var p=a[u].clone();void 0!==e&&p.applyMatrix4(e),o.push(p)}for(u=0,d=h.length;u<d;u++)c.push(h[u].clone());for(u=0,d=l.length;u<d;u++){var f,m,g,v=l[u],y=v.vertexNormals,b=v.vertexColors;(f=new rn(v.a+r,v.b+r,v.c+r)).normal.copy(v.normal),void 0!==i&&f.normal.applyMatrix3(i).normalize();for(var x=0,w=y.length;x<w;x++)m=y[x].clone(),void 0!==i&&m.applyMatrix3(i).normalize(),f.vertexNormals.push(m);for(f.color.copy(v.color),x=0,w=b.length;x<w;x++)g=b[x],f.vertexColors.push(g.clone());f.materialIndex=v.materialIndex+n,s.push(f)}for(u=0,d=t.faceVertexUvs.length;u<d;u++){var E=t.faceVertexUvs[u];for(void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]),x=0,w=E.length;x<w;x++){for(var _=E[x],M=[],S=0,T=_.length;S<T;S++)M.push(_[S].clone());this.faceVertexUvs[u].push(M)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,i,r,o,a,s,l={},c=[],h=[],u=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)t=this.vertices[n],void 0===l[e=Math.round(t.x*u)+"_"+Math.round(t.y*u)+"_"+Math.round(t.z*u)]?(l[e]=n,c.push(this.vertices[n]),h[n]=c.length-1):h[n]=h[l[e]];var d=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=h[r.a],r.b=h[r.b],r.c=h[r.c],o=[r.a,r.b,r.c];for(var p=0;p<3;p++)if(o[p]===o[(p+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var f=d[n];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(f,1)}var m=this.vertices.length-c.length;return this.vertices=c,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];this.vertices.push(new ne(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort((function(t,e){return t.materialIndex-e.materialIndex}));var i,r,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];for(o&&o.length===e&&(i=[]),a&&a.length===e&&(r=[]),n=0;n<e;n++){var s=t[n]._id;i&&i.push(o[s]),r&&r.push(a[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var i=[],r=0;r<this.vertices.length;r++){var o=this.vertices[r];i.push(o.x,o.y,o.z)}var a=[],s=[],l={},c=[],h={},u=[],d={};for(r=0;r<this.faces.length;r++){var p=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],m=p.normal.length()>0,g=p.vertexNormals.length>0,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=p.vertexColors.length>0,b=0;if(b=_(b,0,0),b=_(b,1,!0),b=_(b,2,!1),b=_(b,3,f),b=_(b,4,m),b=_(b,5,g),b=_(b,6,v),b=_(b,7,y),a.push(b),a.push(p.a,p.b,p.c),a.push(p.materialIndex),f){var x=this.faceVertexUvs[0][r];a.push(T(x[0]),T(x[1]),T(x[2]))}if(m&&a.push(M(p.normal)),g){var w=p.vertexNormals;a.push(M(w[0]),M(w[1]),M(w[2]))}if(v&&a.push(S(p.color)),y){var E=p.vertexColors;a.push(S(E[0]),S(E[1]),S(E[2]))}}function _(t,e,n){return n?t|1<<e:t&~(1<<e)}function M(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==l[e]||(l[e]=s.length/3,s.push(t.x,t.y,t.z)),l[e]}function S(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==h[e]||(h[e]=c.length,c.push(t.getHex())),h[e]}function T(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]||(d[e]=u.length/2,u.push(t.x,t.y)),d[e]}return t.data={},t.data.vertices=i,t.data.normals=s,c.length>0&&(t.data.colors=c),u.length>0&&(t.data.uvs=[u]),t.data.faces=a,t},clone:function(){return(new An).copy(this)},copy:function(t){var e,n,i,r,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var l=t.colors;for(e=0,n=l.length;e<n;e++)this.colors.push(l[e].clone());var c=t.faces;for(e=0,n=c.length;e<n;e++)this.faces.push(c[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var h=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),i=0,r=h.length;i<r;i++){var u=h[i],d=[];for(o=0,a=u.length;o<a;o++){var p=u[o];d.push(p.clone())}this.faceVertexUvs[e].push(d)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],i=0,r=f[e].vertices.length;i<r;i++)m.vertices.push(f[e].vertices[i].clone());if(void 0!==f[e].normals)for(m.normals=[],i=0,r=f[e].normals.length;i<r;i++)m.normals.push(f[e].normals[i].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],i=0,r=g[e].vertexNormals.length;i<r;i++){var y=g[e].vertexNormals[i],b={};b.a=y.a.clone(),b.b=y.b.clone(),b.c=y.c.clone(),v.vertexNormals.push(b)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],i=0,r=g[e].faceNormals.length;i<r;i++)v.faceNormals.push(g[e].faceNormals[i].clone());this.morphNormals.push(v)}var x=t.skinWeights;for(e=0,n=x.length;e<n;e++)this.skinWeights.push(x[e].clone());var w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var E=t.lineDistances;for(e=0,n=E.length;e<n;e++)this.lineDistances.push(E[e]);var _=t.boundingBox;null!==_&&(this.boundingBox=_.clone());var M=t.boundingSphere;return null!==M&&(this.boundingSphere=M.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Ln.prototype=Object.create(An.prototype),Ln.prototype.constructor=Ln,Cn.prototype=Object.create(Mn.prototype),Cn.prototype.constructor=Cn;var On={clone:Pn,merge:Rn};function In(t){an.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Dn(){Ge.call(this),this.type="Camera",this.matrixWorldInverse=new be,this.projectionMatrix=new be,this.projectionMatrixInverse=new be}function kn(t,e,n,i){Dn.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}In.prototype=Object.create(an.prototype),In.prototype.constructor=In,In.prototype.isShaderMaterial=!0,In.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Pn(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},In.prototype.toJSON=function(t){var e=an.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var r={};for(var o in this.extensions)!0===this.extensions[o]&&(r[o]=!0);return Object.keys(r).length>0&&(e.extensions=r),e},Dn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Dn,isCamera:!0,copy:function(t,e){return Ge.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new ne),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Ge.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),kn.prototype=Object.assign(Object.create(Dn.prototype),{constructor:kn,isPerspectiveCamera:!0,copy:function(t,e){return Dn.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*$t.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*$t.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*$t.RAD2DEG*Math.atan(Math.tan(.5*$t.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*$t.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/a,e-=o.offsetY*n/s,i*=o.width/a,n*=o.height/s}var l=this.filmOffset;0!==l&&(r+=t*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Ge.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});var Nn,zn,Bn=90;function Hn(t,e,n,i){Ge.call(this),this.type="CubeCamera";var r=new kn(Bn,1,t,e);r.up.set(0,-1,0),r.lookAt(new ne(1,0,0)),this.add(r);var o=new kn(Bn,1,t,e);o.up.set(0,-1,0),o.lookAt(new ne(-1,0,0)),this.add(o);var a=new kn(Bn,1,t,e);a.up.set(0,0,1),a.lookAt(new ne(0,1,0)),this.add(a);var s=new kn(Bn,1,t,e);s.up.set(0,0,-1),s.lookAt(new ne(0,-1,0)),this.add(s);var l=new kn(Bn,1,t,e);l.up.set(0,-1,0),l.lookAt(new ne(0,0,1)),this.add(l);var c=new kn(Bn,1,t,e);c.up.set(0,-1,0),c.lookAt(new ne(0,0,-1)),this.add(c),i=i||{format:Ot,magFilter:_t,minFilter:_t},this.renderTarget=new Fn(n,n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),i=this.renderTarget,h=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,r),t.setRenderTarget(i,1),t.render(e,o),t.setRenderTarget(i,2),t.render(e,a),t.setRenderTarget(i,3),t.render(e,s),t.setRenderTarget(i,4),t.render(e,l),i.texture.generateMipmaps=h,t.setRenderTarget(i,5),t.render(e,c),t.setRenderTarget(n)},this.clear=function(t,e,n,i){for(var r=t.getRenderTarget(),o=this.renderTarget,a=0;a<6;a++)t.setRenderTarget(o,a),t.clear(e,n,i);t.setRenderTarget(r)}}function Fn(t,e,n){ve.call(this,t,e,n)}function jn(t,e,n,i,r,o,a,s,l,c,h,u){me.call(this,null,o,a,s,l,c,i,r,h,u),this.image={data:t,width:e,height:n},this.magFilter=void 0!==l?l:xt,this.minFilter=void 0!==c?c:xt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Un(t,e){this.normal=void 0!==t?t:new ne(1,0,0),this.constant=void 0!==e?e:0}function Gn(t,e,n,i,r,o){this.planes=[void 0!==t?t:new Un,void 0!==e?e:new Un,void 0!==n?n:new Un,void 0!==i?i:new Un,void 0!==r?r:new Un,void 0!==o?o:new Un]}Hn.prototype=Object.create(Ge.prototype),Hn.prototype.constructor=Hn,Fn.prototype=Object.create(ve.prototype),Fn.prototype.constructor=Fn,Fn.prototype.isWebGLRenderTargetCube=!0,Fn.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new Ve,i={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},r=new In({type:"CubemapFromEquirect",uniforms:Pn(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;var o=new Sn(new Cn(5,5,5),r);n.add(o);var a=new Hn(1,10,1);return a.renderTarget=this,a.renderTarget.texture.name="CubeCameraTexture",a.update(t,n),o.geometry.dispose(),o.material.dispose(),this},jn.prototype=Object.create(me.prototype),jn.prototype.constructor=jn,jn.prototype.isDataTexture=!0,Object.assign(Un.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new ne,e=new ne;return function(n,i,r){var o=t.subVectors(r,i).cross(e.subVectors(n,i)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new ne),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new ne;return function(e,n){void 0===n&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new ne);var i=e.delta(t),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(e.start)?n.copy(e.start):void 0;var o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?void 0:n.copy(i).multiplyScalar(o).add(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new ne),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new ne,e=new ie;return function(n,i){var r=i||e.getNormalMatrix(n),o=this.coplanarPoint(t).applyMatrix4(n),a=this.normal.applyMatrix3(r).normalize();return this.constant=-o.dot(a),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(Gn.prototype,{set:function(t,e,n,i,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-i,h-s,f-u,y-m).normalize(),e[1].setComponents(a+i,h+s,f+u,y+m).normalize(),e[2].setComponents(a+r,h+l,f+d,y+g).normalize(),e[3].setComponents(a-r,h-l,f-d,y-g).normalize(),e[4].setComponents(a-o,h-c,f-p,y-v).normalize(),e[5].setComponents(a+o,h+c,f+p,y+v).normalize(),this},intersectsObject:(zn=new Ye,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),zn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(zn)}),intersectsSprite:function(){var t=new Ye;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++)if(e[r].distanceToPoint(n)<i)return!1;return!0},intersectsBox:(Nn=new ne,function(t){for(var e=this.planes,n=0;n<6;n++){var i=e[n];if(Nn.x=i.normal.x>0?t.max.x:t.min.x,Nn.y=i.normal.y>0?t.max.y:t.min.y,Nn.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Nn)<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var Vn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE  = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS  = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale =  bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn 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 );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value )  {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy = normalScale * mapN.xy;\n\t\t\tnormal = normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Wn={common:{diffuse:{value:new $e(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ie},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new te(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new $e(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new $e(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new ie}},sprite:{diffuse:{value:new $e(15658734)},opacity:{value:1},center:{value:new te(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new ie}}},Yn={basic:{uniforms:Rn([Wn.common,Wn.specularmap,Wn.envmap,Wn.aomap,Wn.lightmap,Wn.fog]),vertexShader:Vn.meshbasic_vert,fragmentShader:Vn.meshbasic_frag},lambert:{uniforms:Rn([Wn.common,Wn.specularmap,Wn.envmap,Wn.aomap,Wn.lightmap,Wn.emissivemap,Wn.fog,Wn.lights,{emissive:{value:new $e(0)}}]),vertexShader:Vn.meshlambert_vert,fragmentShader:Vn.meshlambert_frag},phong:{uniforms:Rn([Wn.common,Wn.specularmap,Wn.envmap,Wn.aomap,Wn.lightmap,Wn.emissivemap,Wn.bumpmap,Wn.normalmap,Wn.displacementmap,Wn.gradientmap,Wn.fog,Wn.lights,{emissive:{value:new $e(0)},specular:{value:new $e(1118481)},shininess:{value:30}}]),vertexShader:Vn.meshphong_vert,fragmentShader:Vn.meshphong_frag},standard:{uniforms:Rn([Wn.common,Wn.envmap,Wn.aomap,Wn.lightmap,Wn.emissivemap,Wn.bumpmap,Wn.normalmap,Wn.displacementmap,Wn.roughnessmap,Wn.metalnessmap,Wn.fog,Wn.lights,{emissive:{value:new $e(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Vn.meshphysical_vert,fragmentShader:Vn.meshphysical_frag},matcap:{uniforms:Rn([Wn.common,Wn.bumpmap,Wn.normalmap,Wn.displacementmap,Wn.fog,{matcap:{value:null}}]),vertexShader:Vn.meshmatcap_vert,fragmentShader:Vn.meshmatcap_frag},points:{uniforms:Rn([Wn.points,Wn.fog]),vertexShader:Vn.points_vert,fragmentShader:Vn.points_frag},dashed:{uniforms:Rn([Wn.common,Wn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Vn.linedashed_vert,fragmentShader:Vn.linedashed_frag},depth:{uniforms:Rn([Wn.common,Wn.displacementmap]),vertexShader:Vn.depth_vert,fragmentShader:Vn.depth_frag},normal:{uniforms:Rn([Wn.common,Wn.bumpmap,Wn.normalmap,Wn.displacementmap,{opacity:{value:1}}]),vertexShader:Vn.normal_vert,fragmentShader:Vn.normal_frag},sprite:{uniforms:Rn([Wn.sprite,Wn.fog]),vertexShader:Vn.sprite_vert,fragmentShader:Vn.sprite_frag},background:{uniforms:{uvTransform:{value:new ie},t2D:{value:null}},vertexShader:Vn.background_vert,fragmentShader:Vn.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Vn.cube_vert,fragmentShader:Vn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Vn.equirect_vert,fragmentShader:Vn.equirect_frag},distanceRGBA:{uniforms:Rn([Wn.common,Wn.displacementmap,{referencePosition:{value:new ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Vn.distanceRGBA_vert,fragmentShader:Vn.distanceRGBA_frag},shadow:{uniforms:Rn([Wn.lights,Wn.fog,{color:{value:new $e(0)},opacity:{value:1}}]),vertexShader:Vn.shadow_vert,fragmentShader:Vn.shadow_frag}};function Xn(){var t=null,e=!1,n=null;function i(r,o){!1!==e&&(n(r,o),t.requestAnimationFrame(i))}return{start:function(){!0!==e&&null!==n&&(t.requestAnimationFrame(i),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function qn(t){var e=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var i=e.get(n);i&&(t.deleteBuffer(i.buffer),e.delete(n))},update:function(n,i){n.isInterleavedBufferAttribute&&(n=n.data);var r=e.get(n);void 0===r?e.set(n,function(e,n){var i=e.array,r=e.dynamic?35048:35044,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,i,r),e.onUploadCallback();var a=5126;return i instanceof Float32Array?a=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?a=5123:i instanceof Int16Array?a=5122:i instanceof Uint32Array?a=5125:i instanceof Int32Array?a=5124:i instanceof Int8Array?a=5120:i instanceof Uint8Array&&(a=5121),{buffer:o,type:a,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(n,i)):r.version<n.version&&(function(e,n,i){var r=n.array,o=n.updateRange;t.bindBuffer(i,e),!1===n.dynamic?t.bufferData(i,r,35044):-1===o.count?t.bufferSubData(i,0,r):0===o.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(i,o.offset*r.BYTES_PER_ELEMENT,r.subarray(o.offset,o.offset+o.count)),o.count=-1)}(r.buffer,n,i),r.version=n.version)}}}function Zn(t,e,n,i){An.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new Jn(t,e,n,i)),this.mergeVertices()}function Jn(t,e,n,i){Mn.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};var r,o,a=(t=t||1)/2,s=(e=e||1)/2,l=Math.floor(n)||1,c=Math.floor(i)||1,h=l+1,u=c+1,d=t/l,p=e/c,f=[],m=[],g=[],v=[];for(o=0;o<u;o++){var y=o*p-s;for(r=0;r<h;r++){var b=r*d-a;m.push(b,-y,0),g.push(0,0,1),v.push(r/l),v.push(1-o/c)}}for(o=0;o<c;o++)for(r=0;r<l;r++){var x=r+h*o,w=r+h*(o+1),E=r+1+h*(o+1),_=r+1+h*o;f.push(x,w,_),f.push(w,E,_)}this.setIndex(f),this.addAttribute("position",new gn(m,3)),this.addAttribute("normal",new gn(g,3)),this.addAttribute("uv",new gn(v,2))}function Qn(t,e,n,i){var r,o,a=new $e(0),s=0,l=null,c=0;function h(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return a},setClearColor:function(t,e){a.set(t),h(a,s=void 0!==e?e:1)},getClearAlpha:function(){return s},setClearAlpha:function(t){h(a,s=t)},render:function(e,i,u,d){var p=i.background,f=t.vr,m=f.getSession&&f.getSession();if(m&&"additive"===m.environmentBlendMode&&(p=null),null===p?(h(a,s),l=null,c=0):p&&p.isColor&&(h(p,1),d=!0,l=null,c=0),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),p&&(p.isCubeTexture||p.isWebGLRenderTargetCube)){void 0===o&&((o=new Sn(new Cn(1,1,1),new In({type:"BackgroundCubeMaterial",uniforms:Pn(Yn.cube.uniforms),vertexShader:Yn.cube.vertexShader,fragmentShader:Yn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),o.geometry.removeAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.tCube.value}}),n.update(o));var g=p.isWebGLRenderTargetCube?p.texture:p;o.material.uniforms.tCube.value=g,o.material.uniforms.tFlip.value=p.isWebGLRenderTargetCube?1:-1,l===p&&c===g.version||(o.material.needsUpdate=!0,l=p,c=g.version),e.unshift(o,o.geometry,o.material,0,0,null)}else p&&p.isTexture&&(void 0===r&&((r=new Sn(new Jn(2,2),new In({type:"BackgroundMaterial",uniforms:Pn(Yn.background.uniforms),vertexShader:Yn.background.vertexShader,fragmentShader:Yn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(r)),r.material.uniforms.t2D.value=p,!0===p.matrixAutoUpdate&&p.updateMatrix(),r.material.uniforms.uvTransform.value.copy(p.matrix),l===p&&c===p.version||(r.material.needsUpdate=!0,l=p,c=p.version),e.unshift(r,r.geometry,r.material,0,0,null))}}}function Kn(t,e,n,i){var r;this.setMode=function(t){r=t},this.render=function(e,i){t.drawArrays(r,e,i),n.update(i,r)},this.renderInstances=function(o,a,s){var l;if(i.isWebGL2)l=t;else if(null===(l=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[i.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](r,a,s,o.maxInstancedCount),n.update(s,r,o.maxInstancedCount)}}function $n(t,e,n){var i;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext,a=void 0!==n.precision?n.precision:"highp",s=r(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var l=!0===n.logarithmicDepthBuffer,c=t.getParameter(34930),h=t.getParameter(35660),u=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=h>0,y=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=e.get("EXT_texture_filter_anisotropic");return i=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:o?t.getParameter(36183):0}}function ti(){var t=this,e=null,n=0,i=!1,r=!1,o=new Un,a=new ie,s={value:null,needsUpdate:!1};function l(){s.value!==e&&(s.value=e,s.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function c(e,n,i,r){var l=null!==e?e.length:0,c=null;if(0!==l){if(c=s.value,!0!==r||null===c){var h=i+4*l,u=n.matrixWorldInverse;a.getNormalMatrix(u),(null===c||c.length<h)&&(c=new Float32Array(h));for(var d=0,p=i;d!==l;++d,p+=4)o.copy(e[d]).applyMatrix4(u,a),o.normal.toArray(c,p),c[p+3]=o.constant}s.value=c,s.needsUpdate=!0}return t.numPlanes=l,c}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,o){var a=0!==t.length||r||0!==n||i;return i=r,e=c(t,o,0),n=t.length,a},this.beginShadows=function(){r=!0,c(null)},this.endShadows=function(){r=!1,l()},this.setState=function(t,o,a,h,u,d){if(!i||null===t||0===t.length||r&&!a)r?c(null):l();else{var p=r?0:n,f=4*p,m=u.clippingState||null;s.value=m,m=c(t,h,f,d);for(var g=0;g!==f;++g)m[g]=e[g];u.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=p}}}function ei(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=i,i}}}function ni(t,e,n){var i={},r={};function o(t){var a=t.target,s=i[a.id];for(var l in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[l]);a.removeEventListener("dispose",o),delete i[a.id];var c=r[s.id];c&&(e.remove(c),delete r[s.id]),n.memory.geometries--}function a(t){var n=[],i=t.index,o=t.attributes.position,a=0;if(null!==i){var s=i.array;a=i.version;for(var l=0,c=s.length;l<c;l+=3){var h=s[l+0],u=s[l+1],d=s[l+2];n.push(h,u,u,d,d,h)}}else for(s=o.array,a=o.version,l=0,c=s.length/3-1;l<c;l+=3)h=l+0,u=l+1,d=l+2,n.push(h,u,u,d,d,h);var p=new(bn(n)>65535?mn:pn)(n,1);p.version=a,e.update(p,34963);var f=r[t.id];f&&e.remove(f),r[t.id]=p}return{get:function(t,e){var r=i[e.id];return r||(e.addEventListener("dispose",o),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new Mn).setFromObject(t)),r=e._bufferGeometry),i[e.id]=r,n.memory.geometries++,r)},update:function(t){var n=t.index,i=t.attributes;for(var r in null!==n&&e.update(n,34963),i)e.update(i[r],34962);var o=t.morphAttributes;for(var r in o)for(var a=o[r],s=0,l=a.length;s<l;s++)e.update(a[s],34962)},getWireframeAttribute:function(t){var e=r[t.id];if(e){var n=t.index;null!==n&&e.version<n.version&&a(t)}else a(t);return r[t.id]}}}function ii(t,e,n,i){var r,o,a;this.setMode=function(t){r=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,i){t.drawElements(r,i,o,e*a),n.update(i,r)},this.renderInstances=function(s,l,c){var h;if(i.isWebGL2)h=t;else if(null===(h=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[i.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](r,c,o,l*a,s.maxInstancedCount),n.update(c,r,s.maxInstancedCount)}}function ri(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,i){switch(i=i||1,e.calls++,n){case 4:e.triangles+=i*(t/3);break;case 5:case 6:e.triangles+=i*(t-2);break;case 1:e.lines+=i*(t/2);break;case 3:e.lines+=i*(t-1);break;case 2:e.lines+=i*t;break;case 0:e.points+=i*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function oi(t,e){return Math.abs(e[1])-Math.abs(t[1])}function ai(t){var e={},n=new Float32Array(8);return{update:function(i,r,o,a){var s=i.morphTargetInfluences,l=s.length,c=e[r.id];if(void 0===c){c=[];for(var h=0;h<l;h++)c[h]=[h,0];e[r.id]=c}var u=o.morphTargets&&r.morphAttributes.position,d=o.morphNormals&&r.morphAttributes.normal;for(h=0;h<l;h++)0!==(p=c[h])[1]&&(u&&r.removeAttribute("morphTarget"+h),d&&r.removeAttribute("morphNormal"+h));for(h=0;h<l;h++)(p=c[h])[0]=h,p[1]=s[h];for(c.sort(oi),h=0;h<8;h++){var p;if(p=c[h]){var f=p[0],m=p[1];if(m){u&&r.addAttribute("morphTarget"+h,u[f]),d&&r.addAttribute("morphNormal"+h,d[f]),n[h]=m;continue}}n[h]=0}a.getUniforms().setValue(t,"morphTargetInfluences",n)}}}function si(t,e){var n={};return{update:function(i){var r=e.render.frame,o=i.geometry,a=t.get(i,o);return n[a.id]!==r&&(o.isGeometry&&a.updateFromObject(i),t.update(a),n[a.id]=r),a},dispose:function(){n={}}}}function li(t,e,n,i,r,o,a,s,l,c){t=void 0!==t?t:[],e=void 0!==e?e:dt,a=void 0!==a?a:Ot,me.call(this,t,e,n,i,r,o,a,s,l,c),this.flipY=!1}function ci(t,e,n,i){me.call(this,null),this.image={data:t,width:e,height:n,depth:i},this.magFilter=xt,this.minFilter=xt,this.wrapR=yt,this.generateMipmaps=!1,this.flipY=!1}function hi(t,e,n,i){me.call(this,null),this.image={data:t,width:e,height:n,depth:i},this.magFilter=xt,this.minFilter=xt,this.wrapR=yt,this.generateMipmaps=!1,this.flipY=!1}Yn.physical={uniforms:Rn([Yn.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Vn.meshphysical_vert,fragmentShader:Vn.meshphysical_frag},Zn.prototype=Object.create(An.prototype),Zn.prototype.constructor=Zn,Jn.prototype=Object.create(Mn.prototype),Jn.prototype.constructor=Jn,li.prototype=Object.create(me.prototype),li.prototype.constructor=li,li.prototype.isCubeTexture=!0,Object.defineProperty(li.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),ci.prototype=Object.create(me.prototype),ci.prototype.constructor=ci,ci.prototype.isDataTexture2DArray=!0,hi.prototype=Object.create(me.prototype),hi.prototype.constructor=hi,hi.prototype.isDataTexture3D=!0;var ui=new me,di=new ci,pi=new hi,fi=new li,mi=[],gi=[],vi=new Float32Array(16),yi=new Float32Array(9),bi=new Float32Array(4);function xi(t,e,n){var i=t[0];if(i<=0||i>0)return t;var r=e*n,o=mi[r];if(void 0===o&&(o=new Float32Array(r),mi[r]=o),0!==e){i.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function wi(t,e){if(t.length!==e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Ei(t,e){for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}function _i(t,e){var n=gi[e];void 0===n&&(n=new Int32Array(e),gi[e]=n);for(var i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function Mi(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Si(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(wi(n,e))return;t.uniform2fv(this.addr,e),Ei(n,e)}}function Ti(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(wi(n,e))return;t.uniform3fv(this.addr,e),Ei(n,e)}}function Ai(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(wi(n,e))return;t.uniform4fv(this.addr,e),Ei(n,e)}}function Li(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(wi(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ei(n,e)}else{if(wi(n,i))return;bi.set(i),t.uniformMatrix2fv(this.addr,!1,bi),Ei(n,i)}}function Ci(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(wi(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ei(n,e)}else{if(wi(n,i))return;yi.set(i),t.uniformMatrix3fv(this.addr,!1,yi),Ei(n,i)}}function Pi(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(wi(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ei(n,e)}else{if(wi(n,i))return;vi.set(i),t.uniformMatrix4fv(this.addr,!1,vi),Ei(n,i)}}function Ri(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(e||ui,r)}function Oi(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||di,r)}function Ii(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||pi,r)}function Di(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(e||fi,r)}function ki(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Ni(t,e){var n=this.cache;wi(n,e)||(t.uniform2iv(this.addr,e),Ei(n,e))}function zi(t,e){var n=this.cache;wi(n,e)||(t.uniform3iv(this.addr,e),Ei(n,e))}function Bi(t,e){var n=this.cache;wi(n,e)||(t.uniform4iv(this.addr,e),Ei(n,e))}function Hi(t,e){t.uniform1fv(this.addr,e)}function Fi(t,e){t.uniform1iv(this.addr,e)}function ji(t,e){t.uniform2iv(this.addr,e)}function Ui(t,e){t.uniform3iv(this.addr,e)}function Gi(t,e){t.uniform4iv(this.addr,e)}function Vi(t,e){var n=xi(e,this.size,2);t.uniform2fv(this.addr,n)}function Wi(t,e){var n=xi(e,this.size,3);t.uniform3fv(this.addr,n)}function Yi(t,e){var n=xi(e,this.size,4);t.uniform4fv(this.addr,n)}function Xi(t,e){var n=xi(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function qi(t,e){var n=xi(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Zi(t,e){var n=xi(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Ji(t,e,n){var i=e.length,r=_i(n,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)n.safeSetTexture2D(e[o]||ui,r[o])}function Qi(t,e,n){var i=e.length,r=_i(n,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)n.safeSetTextureCube(e[o]||fi,r[o])}function Ki(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Mi;case 35664:return Si;case 35665:return Ti;case 35666:return Ai;case 35674:return Li;case 35675:return Ci;case 35676:return Pi;case 35678:case 36198:return Ri;case 35679:return Ii;case 35680:return Di;case 36289:return Oi;case 5124:case 35670:return ki;case 35667:case 35671:return Ni;case 35668:case 35672:return zi;case 35669:case 35673:return Bi}}(e.type)}function $i(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Hi;case 35664:return Vi;case 35665:return Wi;case 35666:return Yi;case 35674:return Xi;case 35675:return qi;case 35676:return Zi;case 35678:return Ji;case 35680:return Qi;case 5124:case 35670:return Fi;case 35667:case 35671:return ji;case 35668:case 35672:return Ui;case 35669:case 35673:return Gi}}(e.type)}function tr(t){this.id=t,this.seq=[],this.map={}}$i.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Ei(e,t)},tr.prototype.setValue=function(t,e,n){for(var i=this.seq,r=0,o=i.length;r!==o;++r){var a=i[r];a.setValue(t,e[a.id],n)}};var er=/([\w\d_]+)(\])?(\[|\.)?/g;function nr(t,e){t.seq.push(e),t.map[e.id]=e}function ir(t,e,n){var i=t.name,r=i.length;for(er.lastIndex=0;;){var o=er.exec(i),a=er.lastIndex,s=o[1],l="]"===o[2],c=o[3];if(l&&(s|=0),void 0===c||"["===c&&a+2===r){nr(n,void 0===c?new Ki(s,t,e):new $i(s,t,e));break}var h=n.map[s];void 0===h&&nr(n,h=new tr(s)),n=h}}function rr(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),i=0;i<n;++i){var r=t.getActiveUniform(e,i);ir(r,t.getUniformLocation(e,r.name),this)}}function or(t,e,n){var i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}rr.prototype.setValue=function(t,e,n,i){var r=this.map[e];void 0!==r&&r.setValue(t,n,i)},rr.prototype.setOptional=function(t,e,n){var i=e[n];void 0!==i&&this.setValue(t,n,i)},rr.upload=function(t,e,n,i){for(var r=0,o=e.length;r!==o;++r){var a=e[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,i)}},rr.seqWithValue=function(t,e){for(var n=[],i=0,r=t.length;i!==r;++i){var o=t[i];o.id in e&&n.push(o)}return n};var ar=0;function sr(t){switch(t){case Jt:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case Qt:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function lr(t,e,n){var i=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(t.getShaderSource(e))}function cr(t,e){var n=sr(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function hr(t,e){var n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;case 5:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function ur(t){return""!==t}function dr(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function pr(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function fr(t){return t.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,(function(t,e){var n=Vn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return fr(n)}))}function mr(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(t,e,n,i){for(var r="",o=parseInt(e);o<parseInt(n);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]");return r}))}function gr(t,e,n,i,r,o,a){var s=t.getContext(),l=i.defines,c=r.vertexShader,h=r.fragmentShader,u="SHADOWMAP_TYPE_BASIC";1===o.shadowMapType?u="SHADOWMAP_TYPE_PCF":2===o.shadowMapType&&(u="SHADOWMAP_TYPE_PCF_SOFT");var d="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(i.envMap.mapping){case dt:case pt:d="ENVMAP_TYPE_CUBE";break;case mt:case gt:d="ENVMAP_TYPE_CUBE_UV";break;case 303:case ft:d="ENVMAP_TYPE_EQUIREC";break;case 305:d="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case pt:case ft:p="ENVMAP_MODE_REFRACTION"}switch(i.combine){case 0:f="ENVMAP_BLENDING_MULTIPLY";break;case 1:f="ENVMAP_BLENDING_MIX";break;case 2:f="ENVMAP_BLENDING_ADD"}}var m,g,v,y,b=t.gammaFactor>0?t.gammaFactor:1,x=a.isWebGL2?"":function(t,e,n){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap&&!e.objectSpaceNormalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ur).join("\n")}(i.extensions,o,e),w=function(t){var e=[];for(var n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(l),E=s.createProgram();if(i.isRawShaderMaterial?((m=[w].filter(ur).join("\n")).length>0&&(m+="\n"),(g=[x,w].filter(ur).join("\n")).length>0&&(g+="\n")):(m=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,w,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+p:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexTangents?"#define USE_TANGENT":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ur).join("\n"),g=[x,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,w,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+b,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.matcap?"#define USE_MATCAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+d:"",o.envMap?"#define "+p:"",o.envMap?"#define "+f:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexTangents?"#define USE_TANGENT":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(a.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==o.toneMapping?"#define TONE_MAPPING":"",0!==o.toneMapping?Vn.tonemapping_pars_fragment:"",0!==o.toneMapping?hr("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.matcapEncoding||o.envMapEncoding||o.emissiveMapEncoding?Vn.encodings_pars_fragment:"",o.mapEncoding?cr("mapTexelToLinear",o.mapEncoding):"",o.matcapEncoding?cr("matcapTexelToLinear",o.matcapEncoding):"",o.envMapEncoding?cr("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?cr("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?(v=o.outputEncoding,y=sr(v),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+y[0]+y[1]+"; }"):"",o.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(ur).join("\n")),c=pr(c=dr(c=fr(c),o),o),h=pr(h=dr(h=fr(h),o),o),c=mr(c),h=mr(h),a.isWebGL2&&!i.isRawShaderMaterial){var _=!1,M=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==c.match(M)&&null!==h.match(M)&&(_=!0,c=c.replace(M,""),h=h.replace(M,"")),m=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#version 300 es\n","#define varying in",_?"":"out highp vec4 pc_fragColor;",_?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+g}var S,T,A=g+h,L=or(s,35633,m+c),C=or(s,35632,A);if(s.attachShader(E,L),s.attachShader(E,C),void 0!==i.index0AttributeName?s.bindAttribLocation(E,0,i.index0AttributeName):!0===o.morphTargets&&s.bindAttribLocation(E,0,"position"),s.linkProgram(E),t.debug.checkShaderErrors){var P=s.getProgramInfoLog(E).trim(),R=s.getShaderInfoLog(L).trim(),O=s.getShaderInfoLog(C).trim(),I=!0,D=!0;if(!1===s.getProgramParameter(E,35714)){I=!1;var k=lr(s,L,"vertex"),N=lr(s,C,"fragment");console.error("THREE.WebGLProgram: shader error: ",s.getError(),"35715",s.getProgramParameter(E,35715),"gl.getProgramInfoLog",P,k,N)}else""!==P?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",P):""!==R&&""!==O||(D=!1);D&&(this.diagnostics={runnable:I,material:i,programLog:P,vertexShader:{log:R,prefix:m},fragmentShader:{log:O,prefix:g}})}return s.deleteShader(L),s.deleteShader(C),this.getUniforms=function(){return void 0===S&&(S=new rr(s,E)),S},this.getAttributes=function(){return void 0===T&&(T=function(t,e){for(var n={},i=t.getProgramParameter(e,35721),r=0;r<i;r++){var o=t.getActiveAttrib(e,r).name;n[o]=t.getAttribLocation(e,o)}return n}(s,E)),T},this.destroy=function(){s.deleteProgram(E),this.program=void 0},this.name=r.name,this.id=ar++,this.code=n,this.usedTimes=1,this.program=E,this.vertexShader=L,this.fragmentShader=C,this}function vr(t,e,n){var i=[],r={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},o=["precision","supportsVertexTextures","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function a(t,e){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=Jt,n===Jt&&e&&(n=Qt),n}this.getParameters=function(e,i,o,s,l,c,h){var u=r[e.type],d=h.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(n.floatVertexTextures)return 1024;var i=n.maxVertexUniforms,r=Math.floor((i-20)/4),o=Math.min(r,e.length);return o<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+o+"."),0):o}(h):0,p=n.precision;null!==e.precision&&(p=n.getMaxPrecision(e.precision))!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",p,"instead.");var f=t.getRenderTarget();return{shaderID:u,precision:p,supportsVertexTextures:n.vertexTextures,outputEncoding:a(f?f.texture:null,t.gammaOutput),map:!!e.map,mapEncoding:a(e.map,t.gammaInput),matcap:!!e.matcap,matcapEncoding:a(e.matcap,t.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:a(e.envMap,t.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===mt||e.envMap.mapping===gt),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:a(e.emissiveMap,t.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:1===e.normalMapType,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexTangents:e.normalMap&&e.vertexTangents,vertexColors:e.vertexColors,fog:!!s,useFog:e.fog,fogExp:s&&s.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:e.skinning&&d>0,maxBones:d,useVertexTexture:n.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numClippingPlanes:l,numClipIntersection:c,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.receiveShadow&&o.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:2===e.side,flipSided:1===e.side,depthPacking:void 0!==e.depthPacking&&e.depthPacking}},this.getProgramCode=function(e,n){var i=[];if(n.shaderID?i.push(n.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)i.push(r),i.push(e.defines[r]);for(var a=0;a<o.length;a++)i.push(n[o[a]]);return i.push(e.onBeforeCompile.toString()),i.push(t.gammaOutput),i.push(t.gammaFactor),i.join()},this.acquireProgram=function(r,o,a,s){for(var l,c=0,h=i.length;c<h;c++){var u=i[c];if(u.code===s){++(l=u).usedTimes;break}}return void 0===l&&(l=new gr(t,e,s,r,o,a,n),i.push(l)),l},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=i.indexOf(t);i[e]=i[i.length-1],i.pop(),t.destroy()}},this.programs=i}function yr(){var t=new WeakMap;return{get:function(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}}function br(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function xr(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function wr(){var t=[],e=0,n=[],i=[],r={id:-1};function o(n,i,o,a,s,l){var c=t[e];return void 0===c?(c={id:n.id,object:n,geometry:i,material:o,program:o.program||r,groupOrder:a,renderOrder:n.renderOrder,z:s,group:l},t[e]=c):(c.id=n.id,c.object=n,c.geometry=i,c.material=o,c.program=o.program||r,c.groupOrder=a,c.renderOrder=n.renderOrder,c.z=s,c.group=l),e++,c}return{opaque:n,transparent:i,init:function(){e=0,n.length=0,i.length=0},push:function(t,e,r,a,s,l){var c=o(t,e,r,a,s,l);(!0===r.transparent?i:n).push(c)},unshift:function(t,e,r,a,s,l){var c=o(t,e,r,a,s,l);(!0===r.transparent?i:n).unshift(c)},sort:function(){n.length>1&&n.sort(br),i.length>1&&i.sort(xr)}}}function Er(){var t={};function e(n){var i=n.target;i.removeEventListener("dispose",e),delete t[i.id]}return{get:function(n,i){var r,o=t[n.id];return void 0===o?(r=new wr,t[n.id]={},t[n.id][i.id]=r,n.addEventListener("dispose",e)):void 0===(r=o[i.id])&&(r=new wr,o[i.id]=r),r},dispose:function(){t={}}}}function _r(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new ne,color:new $e,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new te};break;case"SpotLight":n={position:new ne,direction:new ne,color:new $e,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new te};break;case"PointLight":n={position:new ne,color:new $e,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new te,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new ne,skyColor:new $e,groundColor:new $e};break;case"RectAreaLight":n={color:new $e,position:new ne,halfWidth:new ne,halfHeight:new ne}}return t[e.id]=n,n}}}var Mr=0;function Sr(){for(var t=new _r,e={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=0;n<9;n++)e.probe.push(new ne);var i=new ne,r=new be,o=new be;return{setup:function(n,a,s){for(var l=0,c=0,h=0,u=0;u<9;u++)e.probe[u].set(0,0,0);for(var d=0,p=0,f=0,m=0,g=0,v=s.matrixWorldInverse,y=(u=0,n.length);u<y;u++){var b=n[u],x=b.color,w=b.intensity,E=b.distance,_=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)l+=x.r*w,c+=x.g*w,h+=x.b*w;else if(b.isLightProbe)for(var M=0;M<9;M++)e.probe[M].addScaledVector(b.sh.coefficients[M],w);else if(b.isDirectionalLight){if((T=t.get(b)).color.copy(b.color).multiplyScalar(b.intensity),T.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),T.direction.sub(i),T.direction.transformDirection(v),T.shadow=b.castShadow,b.castShadow){var S=b.shadow;T.shadowBias=S.bias,T.shadowRadius=S.radius,T.shadowMapSize=S.mapSize}e.directionalShadowMap[d]=_,e.directionalShadowMatrix[d]=b.shadow.matrix,e.directional[d]=T,d++}else if(b.isSpotLight)(T=t.get(b)).position.setFromMatrixPosition(b.matrixWorld),T.position.applyMatrix4(v),T.color.copy(x).multiplyScalar(w),T.distance=E,T.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),T.direction.sub(i),T.direction.transformDirection(v),T.coneCos=Math.cos(b.angle),T.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),T.decay=b.decay,T.shadow=b.castShadow,b.castShadow&&(S=b.shadow,T.shadowBias=S.bias,T.shadowRadius=S.radius,T.shadowMapSize=S.mapSize),e.spotShadowMap[f]=_,e.spotShadowMatrix[f]=b.shadow.matrix,e.spot[f]=T,f++;else if(b.isRectAreaLight)(T=t.get(b)).color.copy(x).multiplyScalar(w),T.position.setFromMatrixPosition(b.matrixWorld),T.position.applyMatrix4(v),o.identity(),r.copy(b.matrixWorld),r.premultiply(v),o.extractRotation(r),T.halfWidth.set(.5*b.width,0,0),T.halfHeight.set(0,.5*b.height,0),T.halfWidth.applyMatrix4(o),T.halfHeight.applyMatrix4(o),e.rectArea[m]=T,m++;else if(b.isPointLight)(T=t.get(b)).position.setFromMatrixPosition(b.matrixWorld),T.position.applyMatrix4(v),T.color.copy(b.color).multiplyScalar(b.intensity),T.distance=b.distance,T.decay=b.decay,T.shadow=b.castShadow,b.castShadow&&(S=b.shadow,T.shadowBias=S.bias,T.shadowRadius=S.radius,T.shadowMapSize=S.mapSize,T.shadowCameraNear=S.camera.near,T.shadowCameraFar=S.camera.far),e.pointShadowMap[p]=_,e.pointShadowMatrix[p]=b.shadow.matrix,e.point[p]=T,p++;else if(b.isHemisphereLight){var T;(T=t.get(b)).direction.setFromMatrixPosition(b.matrixWorld),T.direction.transformDirection(v),T.direction.normalize(),T.skyColor.copy(b.color).multiplyScalar(w),T.groundColor.copy(b.groundColor).multiplyScalar(w),e.hemi[g]=T,g++}}e.ambient[0]=l,e.ambient[1]=c,e.ambient[2]=h;var A=e.hash;A.directionalLength===d&&A.pointLength===p&&A.spotLength===f&&A.rectAreaLength===m&&A.hemiLength===g&&A.shadowsLength===a.length||(e.directional.length=d,e.spot.length=f,e.rectArea.length=m,e.point.length=p,e.hemi.length=g,A.directionalLength=d,A.pointLength=p,A.spotLength=f,A.rectAreaLength=m,A.hemiLength=g,A.shadowsLength=a.length,e.version=Mr++)},state:e}}function Tr(){var t=new Sr,e=[],n=[];return{init:function(){e.length=0,n.length=0},state:{lightsArray:e,shadowsArray:n,lights:t},setupLights:function(i){t.setup(e,n,i)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)}}}function Ar(){var t={};function e(n){var i=n.target;i.removeEventListener("dispose",e),delete t[i.id]}return{get:function(n,i){var r;return void 0===t[n.id]?(r=new Tr,t[n.id]={},t[n.id][i.id]=r,n.addEventListener("dispose",e)):void 0===t[n.id][i.id]?(r=new Tr,t[n.id][i.id]=r):r=t[n.id][i.id],r},dispose:function(){t={}}}}function Lr(t){an.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function Cr(t){an.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new ne,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function Pr(t,e,n){for(var i=new Gn,r=new be,o=new te,a=new te(n,n),s=new ne,l=new ne,c=new Array(4),h=new Array(4),u={},d={0:1,1:0,2:2},p=[new ne(1,0,0),new ne(-1,0,0),new ne(0,0,1),new ne(0,0,-1),new ne(0,1,0),new ne(0,-1,0)],f=[new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,0,1),new ne(0,0,-1)],m=[new ge,new ge,new ge,new ge,new ge,new ge],g=0;4!==g;++g){var v=!!(1&g),y=!!(2&g),b=new Lr({depthPacking:3201,morphTargets:v,skinning:y});c[g]=b;var x=new Cr({morphTargets:v,skinning:y});h[g]=x}var w=this;function E(e,n,i,r,o,a){var s=e.geometry,l=null,p=c,f=e.customDepthMaterial;if(i&&(p=h,f=e.customDistanceMaterial),f)l=f;else{var m=!1;n.morphTargets&&(s&&s.isBufferGeometry?m=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),e.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var g=0;m&&(g|=1),e.isSkinnedMesh&&n.skinning&&(g|=2),l=p[g]}if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var v=l.uuid,y=n.uuid,b=u[v];void 0===b&&(b={},u[v]=b);var x=b[y];void 0===x&&(x=l.clone(),b[y]=x),l=x}return l.visible=n.visible,l.wireframe=n.wireframe,l.side=null!=n.shadowSide?n.shadowSide:d[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,i&&l.isMeshDistanceMaterial&&(l.referencePosition.copy(r),l.nearDistance=o,l.farDistance=a),l}function _(n,r,o,a){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var s=e.update(n),c=n.material;if(Array.isArray(c))for(var h=s.groups,u=0,d=h.length;u<d;u++){var p=h[u],f=c[p.materialIndex];if(f&&f.visible){var m=E(n,f,a,l,o.near,o.far);t.renderBufferDirect(o,null,s,m,n,p)}}else c.visible&&(m=E(n,c,a,l,o.near,o.far),t.renderBufferDirect(o,null,s,m,n,null))}for(var g=n.children,v=0,y=g.length;v<y;v++)_(g[v],r,o,a)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,n,c){if(!1!==w.enabled&&(!1!==w.autoUpdate||!1!==w.needsUpdate)&&0!==e.length){var h,u=t.getRenderTarget(),d=t.getActiveCubeFace(),g=t.getActiveMipmapLevel(),v=t.state;v.setBlending(0),v.buffers.color.setClear(1,1,1,1),v.buffers.depth.setTest(!0),v.setScissorTest(!1);for(var y=0,b=e.length;y<b;y++){var x=e[y],E=x.shadow,M=x&&x.isPointLight;if(void 0!==E){var S=E.camera;if(o.copy(E.mapSize),o.min(a),M){var T=o.x,A=o.y;m[0].set(2*T,A,T,A),m[1].set(0,A,T,A),m[2].set(3*T,A,T,A),m[3].set(T,A,T,A),m[4].set(3*T,0,T,A),m[5].set(T,0,T,A),o.x*=4,o.y*=2}if(null===E.map){var L={minFilter:xt,magFilter:xt,format:It};E.map=new ve(o.x,o.y,L),E.map.texture.name=x.name+".shadowMap",S.updateProjectionMatrix()}E.isSpotLightShadow&&E.update(x);var C=E.map,P=E.matrix;l.setFromMatrixPosition(x.matrixWorld),S.position.copy(l),M?(h=6,P.makeTranslation(-l.x,-l.y,-l.z)):(h=1,s.setFromMatrixPosition(x.target.matrixWorld),S.lookAt(s),S.updateMatrixWorld(),P.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),P.multiply(S.projectionMatrix),P.multiply(S.matrixWorldInverse)),t.setRenderTarget(C),t.clear();for(var R=0;R<h;R++){if(M){s.copy(S.position),s.add(p[R]),S.up.copy(f[R]),S.lookAt(s),S.updateMatrixWorld();var O=m[R];v.viewport(O)}r.multiplyMatrices(S.projectionMatrix,S.matrixWorldInverse),i.setFromMatrix(r),_(n,c,S,M)}}else console.warn("THREE.WebGLShadowMap:",x,"has no shadow.")}w.needsUpdate=!1,t.setRenderTarget(u,d,g)}}}function Rr(t,e,n,i){var r=new function(){var e=!1,n=new ge,i=null,r=new ge(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,o,a,s){!0===s&&(e*=a,i*=a,o*=a),n.set(e,i,o,a),!1===r.equals(n)&&(t.clearColor(e,i,o,a),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},o=new function(){var e=!1,n=null,i=null,r=null;return{setTest:function(t){t?H(2929):F(2929)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(e)switch(e){case 0:t.depthFunc(512);break;case 1:t.depthFunc(519);break;case 2:t.depthFunc(513);break;case 3:default:t.depthFunc(515);break;case 4:t.depthFunc(514);break;case 5:t.depthFunc(518);break;case 6:t.depthFunc(516);break;case 7:t.depthFunc(517)}else t.depthFunc(515);i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}},a=new function(){var e=!1,n=null,i=null,r=null,o=null,a=null,s=null,l=null,c=null;return{setTest:function(t){t?H(2960):F(2960)},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&o===a||(t.stencilFunc(e,n,a),i=e,r=n,o=a)},setOp:function(e,n,i){a===e&&s===n&&l===i||(t.stencilOp(e,n,i),a=e,s=n,l=i)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,n=null,i=null,r=null,o=null,a=null,s=null,l=null,c=null}}},s=t.getParameter(34921),l=new Uint8Array(s),c=new Uint8Array(s),h=new Uint8Array(s),u={},d=null,p=null,f=null,m=null,g=null,v=null,y=null,b=null,x=null,w=null,E=!1,_=null,M=null,S=null,T=null,A=null,L=t.getParameter(35661),C=!1,P=0,R=t.getParameter(7938);-1!==R.indexOf("WebGL")?(P=parseFloat(/^WebGL\ ([0-9])/.exec(R)[1]),C=P>=1):-1!==R.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(R)[1]),C=P>=2);var O=null,I={},D=new ge,k=new ge;function N(e,n,i){var r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;a<i;a++)t.texImage2D(n+a,0,6408,1,1,0,6408,5121,r);return o}var z={};function B(n,r){l[n]=1,0===c[n]&&(t.enableVertexAttribArray(n),c[n]=1),h[n]!==r&&((i.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),h[n]=r)}function H(e){!0!==u[e]&&(t.enable(e),u[e]=!0)}function F(e){!1!==u[e]&&(t.disable(e),u[e]=!1)}function j(e,i,r,o,a,s,l,c){if(0!==e){if(f||(H(3042),f=!0),5===e)a=a||i,s=s||r,l=l||o,i===g&&a===b||(t.blendEquationSeparate(n.convert(i),n.convert(a)),g=i,b=a),r===v&&o===y&&s===x&&l===w||(t.blendFuncSeparate(n.convert(r),n.convert(o),n.convert(s),n.convert(l)),v=r,y=o,x=s,w=l),m=e,E=null;else if(e!==m||c!==E){if(g===lt&&b===lt||(t.blendEquation(32774),g=lt,b=lt),c)switch(e){case 1:t.blendFuncSeparate(1,771,1,771);break;case 2:t.blendFunc(1,1);break;case 3:t.blendFuncSeparate(0,0,769,771);break;case 4:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(770,771,1,771);break;case 2:t.blendFunc(770,1);break;case 3:t.blendFunc(0,769);break;case 4:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}v=null,y=null,x=null,w=null,m=e,E=c}}else f&&(F(3042),f=!1)}function U(e){_!==e&&(e?t.frontFace(2304):t.frontFace(2305),_=e)}function G(e){0!==e?(H(2884),e!==M&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):F(2884),M=e}function V(e,n,i){e?(H(32823),T===n&&A===i||(t.polygonOffset(n,i),T=n,A=i)):F(32823)}function W(e){void 0===e&&(e=33984+L-1),O!==e&&(t.activeTexture(e),O=e)}return z[3553]=N(3553,3553,1),z[34067]=N(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),a.setClear(0),H(2929),o.setFunc(3),U(!1),G(1),H(2884),j(0),{buffers:{color:r,depth:o,stencil:a},initAttributes:function(){for(var t=0,e=l.length;t<e;t++)l[t]=0},enableAttribute:function(t){B(t,0)},enableAttributeAndDivisor:B,disableUnusedAttributes:function(){for(var e=0,n=c.length;e!==n;++e)c[e]!==l[e]&&(t.disableVertexAttribArray(e),c[e]=0)},enable:H,disable:F,getCompressedTextureFormats:function(){if(null===d&&(d=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")||e.get("WEBGL_compressed_texture_astc")))for(var n=t.getParameter(34467),i=0;i<n.length;i++)d.push(n[i]);return d},useProgram:function(e){return p!==e&&(t.useProgram(e),p=e,!0)},setBlending:j,setMaterial:function(t,e){2===t.side?F(2884):H(2884);var n=1===t.side;e&&(n=!n),U(n),1===t.blending&&!1===t.transparent?j(0):j(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),r.setMask(t.colorWrite);var i=t.stencilWrite;a.setTest(i),i&&(a.setFunc(t.stencilFunc,t.stencilRef,t.stencilMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),V(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:U,setCullFace:G,setLineWidth:function(e){e!==S&&(C&&t.lineWidth(e),S=e)},setPolygonOffset:V,setScissorTest:function(t){t?H(3089):F(3089)},activeTexture:W,bindTexture:function(e,n){null===O&&W();var i=I[O];void 0===i&&(i={type:void 0,texture:void 0},I[O]=i),i.type===e&&i.texture===n||(t.bindTexture(e,n||z[e]),i.type=e,i.texture=n)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===D.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),D.copy(e))},viewport:function(e){!1===k.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),k.copy(e))},reset:function(){for(var e=0;e<c.length;e++)1===c[e]&&(t.disableVertexAttribArray(e),c[e]=0);u={},d=null,O=null,I={},p=null,m=null,_=null,M=null,r.reset(),o.reset(),a.reset()}}}function Or(t,e,n,i,r,o,a){var s,l={},c="undefined"!=typeof OffscreenCanvas;function h(t,e){return c?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function u(t,e,n,i){var r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var o=e?$t.floorPowerOfTwo:Math.floor,a=o(r*t.width),l=o(r*t.height);void 0===s&&(s=h(a,l));var c=n?h(a,l):s;return c.width=a,c.height=l,c.getContext("2d").drawImage(t,0,0,a,l),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+l+")."),c}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function d(t){return $t.isPowerOfTwo(t.width)&&$t.isPowerOfTwo(t.height)}function p(t,e){return t.generateMipmaps&&e&&t.minFilter!==xt&&t.minFilter!==_t}function f(e,n,r,o){t.generateMipmap(e),i.get(n).__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function m(t,n){if(!r.isWebGL2)return t;var i=t;return 6403===t&&(5126===n&&(i=33326),5131===n&&(i=33325),5121===n&&(i=33321)),6407===t&&(5126===n&&(i=34837),5131===n&&(i=34843),5121===n&&(i=32849)),6408===t&&(5126===n&&(i=34836),5131===n&&(i=34842),5121===n&&(i=32856)),33325===i||33326===i||34842===i||34836===i?e.get("EXT_color_buffer_float"):34843!==i&&34837!==i||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),i}function g(t){return t===xt||t===wt||t===Et?9728:9729}function v(e){var n=e.target;n.removeEventListener("dispose",v),function(e){var n=i.get(e);void 0!==n.__webglInit&&(t.deleteTexture(n.__webglTexture),i.remove(e))}(n),n.isVideoTexture&&delete l[n.id],a.memory.textures--}function y(e){var n=e.target;n.removeEventListener("dispose",y),function(e){var n=i.get(e),r=i.get(e.texture);if(e){if(void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);i.remove(e.texture),i.remove(e)}}(n),a.memory.textures--}var b=0;function x(t,e){var r=i.get(t);if(t.isVideoTexture&&function(t){var e=t.id,n=a.render.frame;l[e]!==n&&(l[e]=n,t.update())}(t),t.version>0&&r.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void S(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,r.__webglTexture)}function w(e,a){var s=i.get(e);if(6===e.image.length)if(e.version>0&&s.__version!==e.version){M(s,e),n.activeTexture(33984+a),n.bindTexture(34067,s.__webglTexture),t.pixelStorei(37440,e.flipY);for(var l=e&&e.isCompressedTexture,c=e.image[0]&&e.image[0].isDataTexture,h=[],g=0;g<6;g++)h[g]=l||c?c?e.image[g].image:e.image[g]:u(e.image[g],!1,!0,r.maxCubemapSize);var v=h[0],y=d(v)||r.isWebGL2,b=o.convert(e.format),x=o.convert(e.type),w=m(b,x);for(_(34067,e,y),g=0;g<6;g++)if(l)for(var E,S=h[g].mipmaps,T=0,A=S.length;T<A;T++)E=S[T],e.format!==It&&e.format!==Ot?n.getCompressedTextureFormats().indexOf(b)>-1?n.compressedTexImage2D(34069+g,T,w,E.width,E.height,0,E.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+g,T,w,E.width,E.height,0,b,x,E.data);else c?n.texImage2D(34069+g,0,w,h[g].width,h[g].height,0,b,x,h[g].data):n.texImage2D(34069+g,0,w,b,x,h[g]);s.__maxMipLevel=l?S.length-1:0,p(e,y)&&f(34067,e,v.width,v.height),s.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+a),n.bindTexture(34067,s.__webglTexture)}function E(t,e){n.activeTexture(33984+e),n.bindTexture(34067,i.get(t).__webglTexture)}function _(n,a,s){var l;if(s?(t.texParameteri(n,10242,o.convert(a.wrapS)),t.texParameteri(n,10243,o.convert(a.wrapT)),32879!==n&&35866!==n||t.texParameteri(n,32882,o.convert(a.wrapR)),t.texParameteri(n,10240,o.convert(a.magFilter)),t.texParameteri(n,10241,o.convert(a.minFilter))):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),a.wrapS===yt&&a.wrapT===yt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,g(a.magFilter)),t.texParameteri(n,10241,g(a.minFilter)),a.minFilter!==xt&&a.minFilter!==_t&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),l=e.get("EXT_texture_filter_anisotropic")){if(a.type===Ct&&null===e.get("OES_texture_float_linear"))return;if(a.type===Pt&&null===(r.isWebGL2||e.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||i.get(a).__currentAnisotropy)&&(t.texParameterf(n,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function M(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",v),e.__webglTexture=t.createTexture(),a.memory.textures++)}function S(e,i,a){var s=3553;i.isDataTexture2DArray&&(s=35866),i.isDataTexture3D&&(s=32879),M(e,i),n.activeTexture(33984+a),n.bindTexture(s,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);var l=function(t){return!r.isWebGL2&&(t.wrapS!==yt||t.wrapT!==yt||t.minFilter!==xt&&t.minFilter!==_t)}(i)&&!1===d(i.image),c=u(i.image,l,!1,r.maxTextureSize),h=d(c)||r.isWebGL2,g=o.convert(i.format),v=o.convert(i.type),y=m(g,v);_(s,i,h);var b,x=i.mipmaps;if(i.isDepthTexture){if(y=6402,i.type===Ct){if(!r.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");y=36012}else r.isWebGL2&&(y=33189);i.format===Dt&&6402===y&&i.type!==At&&i.type!==Lt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=At,v=o.convert(i.type)),i.format===kt&&(y=34041,i.type!==Rt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=Rt,v=o.convert(i.type))),n.texImage2D(3553,0,y,c.width,c.height,0,g,v,null)}else if(i.isDataTexture)if(x.length>0&&h){for(var w=0,E=x.length;w<E;w++)b=x[w],n.texImage2D(3553,w,y,b.width,b.height,0,g,v,b.data);i.generateMipmaps=!1,e.__maxMipLevel=x.length-1}else n.texImage2D(3553,0,y,c.width,c.height,0,g,v,c.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(w=0,E=x.length;w<E;w++)b=x[w],i.format!==It&&i.format!==Ot?n.getCompressedTextureFormats().indexOf(g)>-1?n.compressedTexImage2D(3553,w,y,b.width,b.height,0,b.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,w,y,b.width,b.height,0,g,v,b.data);e.__maxMipLevel=x.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,y,c.width,c.height,c.depth,0,g,v,c.data),e.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,y,c.width,c.height,c.depth,0,g,v,c.data),e.__maxMipLevel=0;else if(x.length>0&&h){for(w=0,E=x.length;w<E;w++)b=x[w],n.texImage2D(3553,w,y,g,v,b);i.generateMipmaps=!1,e.__maxMipLevel=x.length-1}else n.texImage2D(3553,0,y,g,v,c),e.__maxMipLevel=0;p(i,h)&&f(3553,i,c.width,c.height),e.__version=i.version,i.onUpdate&&i.onUpdate(i)}function T(e,r,a,s){var l=o.convert(r.texture.format),c=o.convert(r.texture.type),h=m(l,c);n.texImage2D(s,0,h,r.width,r.height,0,l,c,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,s,i.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function A(e,n,i){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){if(i){var r=L(n);t.renderbufferStorageMultisample(36161,r,33189,n.width,n.height)}else t.renderbufferStorage(36161,33189,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer)i?(r=L(n),t.renderbufferStorageMultisample(36161,r,35056,n.width,n.height)):t.renderbufferStorage(36161,34041,n.width,n.height),t.framebufferRenderbuffer(36160,33306,36161,e);else{var a=m(o.convert(n.texture.format),o.convert(n.texture.type));i?(r=L(n),t.renderbufferStorageMultisample(36161,r,a,n.width,n.height)):t.renderbufferStorage(36161,a,n.width,n.height)}t.bindRenderbuffer(36161,null)}function L(t){return r.isWebGL2&&t.isWebGLMultisampleRenderTarget?Math.min(r.maxSamples,t.samples):0}var C=!1,P=!1;this.allocateTextureUnit=function(){var t=b;return t>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+r.maxTextures),b+=1,t},this.resetTextureUnits=function(){b=0},this.setTexture2D=x,this.setTexture2DArray=function(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?S(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?S(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=w,this.setTextureCubeDynamic=E,this.setupRenderTarget=function(e){var s=i.get(e),l=i.get(e.texture);e.addEventListener("dispose",y),l.__webglTexture=t.createTexture(),a.memory.textures++;var c=!0===e.isWebGLRenderTargetCube,h=!0===e.isWebGLMultisampleRenderTarget,u=d(e)||r.isWebGL2;if(c){s.__webglFramebuffer=[];for(var g=0;g<6;g++)s.__webglFramebuffer[g]=t.createFramebuffer()}else if(s.__webglFramebuffer=t.createFramebuffer(),h)if(r.isWebGL2){s.__webglMultisampledFramebuffer=t.createFramebuffer(),s.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var v=m(o.convert(e.texture.format),o.convert(e.texture.type)),b=L(e);t.renderbufferStorageMultisample(36161,b,v,e.width,e.height),t.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(s.__webglDepthRenderbuffer=t.createRenderbuffer(),A(s.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){for(n.bindTexture(34067,l.__webglTexture),_(34067,e.texture,u),g=0;g<6;g++)T(s.__webglFramebuffer[g],e,36064,34069+g);p(e.texture,u)&&f(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,l.__webglTexture),_(3553,e.texture,u),T(s.__webglFramebuffer,e,36064,3553),p(e.texture,u)&&f(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&function(e){var n=i.get(e),r=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),x(n.depthTexture,0);var r=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Dt)t.framebufferTexture2D(36160,36096,3553,r,0);else{if(n.depthTexture.format!==kt)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,r,0)}}(n.__webglFramebuffer,e)}else if(r){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),A(n.__webglDepthbuffer[o],e)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),A(n.__webglDepthbuffer,e);t.bindFramebuffer(36160,null)}(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(p(e,d(t)||r.isWebGL2)){var o=t.isWebGLRenderTargetCube?34067:3553,a=i.get(e).__webglTexture;n.bindTexture(o,a),f(o,e,t.width,t.height),n.bindTexture(o,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(r.isWebGL2){var n=i.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var o=e.width,a=e.height,s=16384;e.depthBuffer&&(s|=256),e.stencilBuffer&&(s|=1024),t.blitFramebuffer(0,0,o,a,0,0,o,a,s,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===C&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),C=!0),t=t.texture),x(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLRenderTargetCube&&(!1===P&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),P=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?w(t,e):E(t,e)}}function Ir(t,e,n){return{convert:function(t){var i;if(t===vt)return 10497;if(t===yt)return 33071;if(t===bt)return 33648;if(t===xt)return 9728;if(t===wt)return 9984;if(t===Et)return 9986;if(t===_t)return 9729;if(t===Mt)return 9985;if(t===St)return 9987;if(t===Tt)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(t===At)return 5123;if(1013===t)return 5124;if(t===Lt)return 5125;if(t===Ct)return 5126;if(t===Pt){if(n.isWebGL2)return 5131;if(null!==(i=e.get("OES_texture_half_float")))return i.HALF_FLOAT_OES}if(1021===t)return 6406;if(t===Ot)return 6407;if(t===It)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(t===Dt)return 6402;if(t===kt)return 34041;if(1028===t)return 6403;if(t===lt)return 32774;if(101===t)return 32778;if(102===t)return 32779;if(200===t)return 0;if(201===t)return 1;if(202===t)return 768;if(203===t)return 769;if(204===t)return 770;if(205===t)return 771;if(206===t)return 772;if(207===t)return 773;if(208===t)return 774;if(209===t)return 775;if(210===t)return 776;if((t===Nt||t===zt||t===Bt||t===Ht)&&null!==(i=e.get("WEBGL_compressed_texture_s3tc"))){if(t===Nt)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===zt)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Bt)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Ht)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===Ft||t===jt||t===Ut||t===Gt)&&null!==(i=e.get("WEBGL_compressed_texture_pvrtc"))){if(t===Ft)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===jt)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Ut)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===Gt)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t&&null!==(i=e.get("WEBGL_compressed_texture_etc1")))return i.COMPRESSED_RGB_ETC1_WEBGL;if((37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t)&&null!==(i=e.get("WEBGL_compressed_texture_astc")))return t;if(t===ct||t===ht){if(n.isWebGL2){if(t===ct)return 32775;if(t===ht)return 32776}if(null!==(i=e.get("EXT_blend_minmax"))){if(t===ct)return i.MIN_EXT;if(t===ht)return i.MAX_EXT}}if(t===Rt){if(n.isWebGL2)return 34042;if(null!==(i=e.get("WEBGL_depth_texture")))return i.UNSIGNED_INT_24_8_WEBGL}return 0}}}function Dr(){Ge.call(this),this.type="Group"}function kr(t){kn.call(this),this.cameras=t||[]}Lr.prototype=Object.create(an.prototype),Lr.prototype.constructor=Lr,Lr.prototype.isMeshDepthMaterial=!0,Lr.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Cr.prototype=Object.create(an.prototype),Cr.prototype.constructor=Cr,Cr.prototype.isMeshDistanceMaterial=!0,Cr.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Dr.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Dr,isGroup:!0}),kr.prototype=Object.assign(Object.create(kn.prototype),{constructor:kr,isArrayCamera:!0});var Nr,zr,Br,Hr,Fr,jr,Ur=new ne,Gr=new ne;function Vr(t,e,n){Ur.setFromMatrixPosition(e.matrixWorld),Gr.setFromMatrixPosition(n.matrixWorld);var i=Ur.distanceTo(Gr),r=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(o[8]+1)/o[0],d=a*h,p=a*u,f=i/(-h+u),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=a+f,v=s+f,y=d-m,b=p+(i-m),x=l*s/v*g,w=c*s/v*g;t.projectionMatrix.makePerspective(y,b,x,w,g,v)}function Wr(t){var e,n,i=this,r=null,o=null,a=null,s=[],l=new be,c=new be,h=1,u="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(o=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",w,!1));var d=new be,p=new ee,f=new ne,m=new kn;m.viewport=new ge,m.layers.enable(1);var g=new kn;g.viewport=new ge,g.layers.enable(2);var v=new kr([m,g]);function y(){return null!==r&&!0===r.isPresenting}v.layers.enable(1),v.layers.enable(2);var b,x=new te;function w(){if(y()){var o=r.getEyeParameters("left");e=2*o.renderWidth*h,n=o.renderHeight*h,b=t.getPixelRatio(),t.getSize(x),t.setDrawingBufferSize(e,n,1),m.viewport.set(0,0,e/2,n),g.viewport.set(e/2,0,e/2,n),S.start(),i.dispatchEvent({type:"sessionstart"})}else i.enabled&&t.setDrawingBufferSize(x.width,x.height,b),S.stop(),i.dispatchEvent({type:"sessionend"})}var E=[];function _(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),n=0,i=0,r=e.length;n<r;n++){var o=e[n];if(o&&("Daydream Controller"===o.id||"Gear VR Controller"===o.id||"Oculus Go Controller"===o.id||"OpenVR Gamepad"===o.id||o.id.startsWith("Oculus Touch")||o.id.startsWith("HTC Vive Focus")||o.id.startsWith("Spatial Controller"))){if(i===t)return o;i++}}}function M(t,i){null!==i&&4===i.length&&t.set(i[0]*e,i[1]*n,i[2]*e,i[3]*n)}this.enabled=!1,this.getController=function(t){var e=s[t];return void 0===e&&((e=new Dr).matrixAutoUpdate=!1,e.visible=!1,s[t]=e),e},this.getDevice=function(){return r},this.setDevice=function(t){void 0!==t&&(r=t),S.setContext(t)},this.setFramebufferScaleFactor=function(t){h=t},this.setReferenceSpaceType=function(t){u=t},this.setPoseTarget=function(t){void 0!==t&&(a=t)},this.getCamera=function(t){var e="local-floor"===u?1.6:0;if(!1===y())return t.position.set(0,e,0),t.rotation.set(0,0,0),t;if(r.depthNear=t.near,r.depthFar=t.far,r.getFrameData(o),"local-floor"===u){var n=r.stageParameters;n?l.fromArray(n.sittingToStandingTransform):l.makeTranslation(0,e,0)}var i=o.pose,h=null!==a?a:t;h.matrix.copy(l),h.matrix.decompose(h.position,h.quaternion,h.scale),null!==i.orientation&&(p.fromArray(i.orientation),h.quaternion.multiply(p)),null!==i.position&&(p.setFromRotationMatrix(l),f.fromArray(i.position),f.applyQuaternion(p),h.position.add(f)),h.updateMatrixWorld(),m.near=t.near,g.near=t.near,m.far=t.far,g.far=t.far,m.matrixWorldInverse.fromArray(o.leftViewMatrix),g.matrixWorldInverse.fromArray(o.rightViewMatrix),c.getInverse(l),"local-floor"===u&&(m.matrixWorldInverse.multiply(c),g.matrixWorldInverse.multiply(c));var b=h.parent;null!==b&&(d.getInverse(b.matrixWorld),m.matrixWorldInverse.multiply(d),g.matrixWorldInverse.multiply(d)),m.matrixWorld.getInverse(m.matrixWorldInverse),g.matrixWorld.getInverse(g.matrixWorldInverse),m.projectionMatrix.fromArray(o.leftProjectionMatrix),g.projectionMatrix.fromArray(o.rightProjectionMatrix),Vr(v,m,g);var x=r.getLayers();if(x.length){var w=x[0];M(m.viewport,w.leftBounds),M(g.viewport,w.rightBounds)}return function(){for(var t=0;t<s.length;t++){var e=s[t],n=_(t);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&e.position.set(.2,-.6,-.05),null!==i.position&&e.position.fromArray(i.position),null!==i.orientation&&e.quaternion.fromArray(i.orientation),e.matrix.compose(e.position,e.quaternion,e.scale),e.matrix.premultiply(l),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0;var r="Daydream Controller"===n.id?0:1;void 0===E[t]&&(E[t]=!1),E[t]!==n.buttons[r].pressed&&(E[t]=n.buttons[r].pressed,!0===E[t]?e.dispatchEvent({type:"selectstart"}):(e.dispatchEvent({type:"selectend"}),e.dispatchEvent({type:"select"})))}else e.visible=!1}}(),v},this.getStandingMatrix=function(){return l},this.isPresenting=y;var S=new Xn;this.setAnimationLoop=function(t){S.setAnimationLoop(t),y()&&S.start()},this.submitFrame=function(){y()&&r.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",w)},this.setFrameOfReferenceType=function(){console.warn("THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}function Yr(t,e){var n=this,i=null,r=null,o="local-floor",a=null,s=[],l=[];function c(){return null!==i&&null!==r}var h=new kn;h.layers.enable(1),h.viewport=new ge;var u=new kn;u.layers.enable(2),u.viewport=new ge;var d=new kr([h,u]);function p(t){for(var e=0;e<s.length;e++)l[e]===t.inputSource&&s[e].dispatchEvent({type:t.type})}function f(){t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),y.stop(),n.dispatchEvent({type:"sessionend"})}function m(t){r=t,y.setContext(i),y.start(),n.dispatchEvent({type:"sessionstart"})}function g(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}d.layers.enable(1),d.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=s[t];return void 0===e&&((e=new Dr).matrixAutoUpdate=!1,e.visible=!1,s[t]=e),e},this.setFramebufferScaleFactor=function(t){},this.setReferenceSpaceType=function(t){o=t},this.getSession=function(){return i},this.setSession=function(t){null!==(i=t)&&(i.addEventListener("select",p),i.addEventListener("selectstart",p),i.addEventListener("selectend",p),i.addEventListener("end",f),i.updateRenderState({baseLayer:new XRWebGLLayer(i,e)}),i.requestReferenceSpace(o).then(m),l=i.inputSources,i.addEventListener("inputsourceschange",(function(){l=i.inputSources,console.log(l);for(var t=0;t<s.length;t++)s[t].userData.inputSource=l[t]})))},this.getCamera=function(t){if(c()){var e=t.parent,n=d.cameras;g(d,e);for(var i=0;i<n.length;i++)g(n[i],e);t.matrixWorld.copy(d.matrixWorld);for(var r=t.children,o=(i=0,r.length);i<o;i++)r[i].updateMatrixWorld(!0);return Vr(d,h,u),d}return t},this.isPresenting=c;var v=null,y=new Xn;y.setAnimationLoop((function(e,n){if(null!==(a=n.getViewerPose(r))){var o=a.views,c=i.renderState.baseLayer;t.setFramebuffer(c.framebuffer);for(var h=0;h<o.length;h++){var u=o[h],p=c.getViewport(u),f=u.transform.inverse.matrix,m=d.cameras[h];m.matrix.fromArray(f).getInverse(m.matrix),m.projectionMatrix.fromArray(u.projectionMatrix),m.viewport.set(p.x,p.y,p.width,p.height),0===h&&d.matrix.copy(m.matrix)}}for(h=0;h<s.length;h++){var g=s[h],y=l[h];if(y){var b=n.getPose(y.targetRaySpace,r);if(null!==b){g.matrix.fromArray(b.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.visible=!0;continue}}g.visible=!1}v&&v(e)})),this.setAnimationLoop=function(t){v=t},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new be},this.getDevice=function(){console.warn("THREE.WebXRManager: getDevice() has been deprecated.")},this.setDevice=function(){console.warn("THREE.WebXRManager: setDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}function Xr(t){console.log("THREE.WebGLRenderer","107");var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,i=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",h=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,u=null,d=null;this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p,f,m,g,v,y,b,x,w,E,_,M,S,T,A,L,C,P,R=this,O=!1,I=null,D=0,k=0,N=null,z=null,B=-1,H={geometry:null,program:null,wireframe:!1},F=null,j=null,U=new ge,G=new ge,V=null,W=e.width,Y=e.height,X=1,q=new ge(0,0,W,Y),Z=new ge(0,0,W,Y),J=!1,Q=new Gn,K=new ti,$=!1,tt=!1,et=new be,nt=new ne;function it(){return null===N?X:1}try{var rt={alpha:i,depth:r,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:h,xrCompatible:!0};if(e.addEventListener("webglcontextlost",lt,!1),e.addEventListener("webglcontextrestored",ct,!1),null===(p=n||e.getContext("webgl",rt)||e.getContext("experimental-webgl",rt)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===p.getShaderPrecisionFormat&&(p.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function ot(){f=new ei(p),(m=new $n(p,f,t)).isWebGL2||(f.get("WEBGL_depth_texture"),f.get("OES_texture_float"),f.get("OES_texture_half_float"),f.get("OES_texture_half_float_linear"),f.get("OES_standard_derivatives"),f.get("OES_element_index_uint"),f.get("ANGLE_instanced_arrays")),f.get("OES_texture_float_linear"),P=new Ir(p,f,m),(g=new Rr(p,f,P,m)).scissor(G.copy(Z).multiplyScalar(X).floor()),g.viewport(U.copy(q).multiplyScalar(X).floor()),v=new ri(p),y=new yr,b=new Or(p,f,g,y,m,P,v),x=new qn(p),w=new ni(p,x,v),E=new si(w,v),A=new ai(p),_=new vr(R,f,m),M=new Er,S=new Ar,T=new Qn(R,g,E,s),L=new Kn(p,f,v,m),C=new ii(p,f,v,m),v.programs=_.programs,R.capabilities=m,R.extensions=f,R.properties=y,R.renderLists=M,R.state=g,R.info=v}ot();var at="undefined"!=typeof navigator&&"xr"in navigator&&"supportsSession"in navigator.xr?new Yr(R,p):new Wr(R);this.vr=at;var st=new Pr(R,E,m.maxTextureSize);function lt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),O=!0}function ct(){console.log("THREE.WebGLRenderer: Context Restored."),O=!1,ot()}function ht(t){var e=t.target;e.removeEventListener("dispose",ht),function(t){ut(t),y.remove(t)}(e)}function ut(t){var e=y.get(t).program;t.program=void 0,void 0!==e&&_.releaseProgram(e)}this.shadowMap=st,this.getContext=function(){return p},this.getContextAttributes=function(){return p.getContextAttributes()},this.forceContextLoss=function(){var t=f.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=f.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return X},this.setPixelRatio=function(t){void 0!==t&&(X=t,this.setSize(W,Y,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new te),t.set(W,Y)},this.setSize=function(t,n,i){at.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(W=t,Y=n,e.width=Math.floor(t*X),e.height=Math.floor(n*X),!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new te),t.set(W*X,Y*X).floor()},this.setDrawingBufferSize=function(t,n,i){W=t,Y=n,X=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new ge),t.copy(U)},this.getViewport=function(t){return t.copy(q)},this.setViewport=function(t,e,n,i){t.isVector4?q.set(t.x,t.y,t.z,t.w):q.set(t,e,n,i),g.viewport(U.copy(q).multiplyScalar(X).floor())},this.getScissor=function(t){return t.copy(Z)},this.setScissor=function(t,e,n,i){t.isVector4?Z.set(t.x,t.y,t.z,t.w):Z.set(t,e,n,i),g.scissor(G.copy(Z).multiplyScalar(X).floor())},this.getScissorTest=function(){return J},this.setScissorTest=function(t){g.setScissorTest(J=t)},this.getClearColor=function(){return T.getClearColor()},this.setClearColor=function(){T.setClearColor.apply(T,arguments)},this.getClearAlpha=function(){return T.getClearAlpha()},this.setClearAlpha=function(){T.setClearAlpha.apply(T,arguments)},this.clear=function(t,e,n){var i=0;(void 0===t||t)&&(i|=16384),(void 0===e||e)&&(i|=256),(void 0===n||n)&&(i|=1024),p.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",lt,!1),e.removeEventListener("webglcontextrestored",ct,!1),M.dispose(),S.dispose(),y.dispose(),E.dispose(),at.dispose(),pt.stop()},this.renderBufferImmediate=function(t,e){g.initAttributes();var n=y.get(t);t.hasPositions&&!n.position&&(n.position=p.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=p.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=p.createBuffer()),t.hasColors&&!n.color&&(n.color=p.createBuffer());var i=e.getAttributes();t.hasPositions&&(p.bindBuffer(34962,n.position),p.bufferData(34962,t.positionArray,35048),g.enableAttribute(i.position),p.vertexAttribPointer(i.position,3,5126,!1,0,0)),t.hasNormals&&(p.bindBuffer(34962,n.normal),p.bufferData(34962,t.normalArray,35048),g.enableAttribute(i.normal),p.vertexAttribPointer(i.normal,3,5126,!1,0,0)),t.hasUvs&&(p.bindBuffer(34962,n.uv),p.bufferData(34962,t.uvArray,35048),g.enableAttribute(i.uv),p.vertexAttribPointer(i.uv,2,5126,!1,0,0)),t.hasColors&&(p.bindBuffer(34962,n.color),p.bufferData(34962,t.colorArray,35048),g.enableAttribute(i.color),p.vertexAttribPointer(i.color,3,5126,!1,0,0)),g.disableUnusedAttributes(),p.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,i,r,o){var a=r.isMesh&&r.matrixWorld.determinant()<0;g.setMaterial(i,a);var s=yt(t,e,i,r),l=!1;H.geometry===n.id&&H.program===s.id&&H.wireframe===(!0===i.wireframe)||(H.geometry=n.id,H.program=s.id,H.wireframe=!0===i.wireframe,l=!0),r.morphTargetInfluences&&(A.update(r,n,i,s),l=!0);var c,h=n.index,u=n.attributes.position,d=1;!0===i.wireframe&&(h=w.getWireframeAttribute(n),d=2);var v=L;null!==h&&(c=x.get(h),(v=C).setIndex(c)),l&&(function(t,e,n){if(n&&n.isInstancedBufferGeometry&&!m.isWebGL2&&null===f.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{g.initAttributes();var i=n.attributes,r=e.getAttributes(),o=t.defaultAttributeValues;for(var a in r){var s=r[a];if(s>=0){var l=i[a];if(void 0!==l){var c=l.normalized,h=l.itemSize,u=x.get(l);if(void 0===u)continue;var d=u.buffer,v=u.type,y=u.bytesPerElement;if(l.isInterleavedBufferAttribute){var b=l.data,w=b.stride,E=l.offset;b&&b.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(s,b.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=b.meshPerAttribute*b.count)):g.enableAttribute(s),p.bindBuffer(34962,d),p.vertexAttribPointer(s,h,v,c,w*y,E*y)}else l.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(s,l.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=l.meshPerAttribute*l.count)):g.enableAttribute(s),p.bindBuffer(34962,d),p.vertexAttribPointer(s,h,v,c,0,0)}else if(void 0!==o){var _=o[a];if(void 0!==_)switch(_.length){case 2:p.vertexAttrib2fv(s,_);break;case 3:p.vertexAttrib3fv(s,_);break;case 4:p.vertexAttrib4fv(s,_);break;default:p.vertexAttrib1fv(s,_)}}}}g.disableUnusedAttributes()}}(i,s,n),null!==h&&p.bindBuffer(34963,c.buffer));var y=1/0;null!==h?y=h.count:void 0!==u&&(y=u.count);var b=n.drawRange.start*d,E=n.drawRange.count*d,_=null!==o?o.start*d:0,M=null!==o?o.count*d:1/0,S=Math.max(b,_),T=Math.min(y,b+E,_+M)-1,P=Math.max(0,T-S+1);if(0!==P){if(r.isMesh)if(!0===i.wireframe)g.setLineWidth(i.wireframeLinewidth*it()),v.setMode(1);else switch(r.drawMode){case 0:v.setMode(4);break;case 1:v.setMode(5);break;case 2:v.setMode(6)}else if(r.isLine){var R=i.linewidth;void 0===R&&(R=1),g.setLineWidth(R*it()),r.isLineSegments?v.setMode(1):r.isLineLoop?v.setMode(2):v.setMode(3)}else r.isPoints?v.setMode(0):r.isSprite&&v.setMode(4);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&v.renderInstances(n,S,P):v.render(S,P)}},this.compile=function(t,e){(d=S.get(t,e)).init(),t.traverse((function(t){t.isLight&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))})),d.setupLights(e),t.traverse((function(e){if(e.material)if(Array.isArray(e.material))for(var n=0;n<e.material.length;n++)vt(e.material[n],t.fog,e);else vt(e.material,t.fog,e)}))};var dt=null,pt=new Xn;function ft(t,e,n,i){if(!1!==t.visible){if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)d.pushLight(t),t.castShadow&&d.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Q.intersectsSprite(t)){i&&nt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(et);var r=E.update(t);(o=t.material).visible&&u.push(t,r,o,n,nt.z,null)}}else if(t.isImmediateRenderObject)i&&nt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(et),u.push(t,null,t.material,n,nt.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||Q.intersectsObject(t))){i&&nt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(et),r=E.update(t);var o=t.material;if(Array.isArray(o))for(var a=r.groups,s=0,l=a.length;s<l;s++){var c=a[s],h=o[c.materialIndex];h&&h.visible&&u.push(t,r,h,n,nt.z,c)}else o.visible&&u.push(t,r,o,n,nt.z,null)}var p=t.children;for(s=0,l=p.length;s<l;s++)ft(p[s],e,n,i)}}function mt(t,e,n,i){for(var r=0,o=t.length;r<o;r++){var a=t[r],s=a.object,l=a.geometry,c=void 0===i?a.material:i,h=a.group;if(n.isArrayCamera){j=n;for(var u=n.cameras,p=0,f=u.length;p<f;p++){var m=u[p];s.layers.test(m.layers)&&(g.viewport(U.copy(m.viewport)),d.setupLights(m),gt(s,e,m,l,c,h))}}else j=null,gt(s,e,n,l,c,h)}}function gt(t,e,n,i,r,o){if(t.onBeforeRender(R,e,n,i,r,o),d=S.get(e,j||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){g.setMaterial(r);var a=yt(n,e.fog,r,t);H.geometry=null,H.program=null,H.wireframe=!1,function(t,e){t.render((function(t){R.renderBufferImmediate(t,e)}))}(t,a)}else R.renderBufferDirect(n,e.fog,i,r,t,o);t.onAfterRender(R,e,n,i,r,o),d=S.get(e,j||n)}function vt(t,e,n){var i=y.get(t),r=d.state.lights,o=d.state.shadowsArray,a=r.state.version,s=_.getParameters(t,r.state,o,e,K.numPlanes,K.numIntersection,n),l=_.getProgramCode(t,s),c=i.program,h=!0;if(void 0===c)t.addEventListener("dispose",ht);else if(c.code!==l)ut(t);else if(i.lightsStateVersion!==a)i.lightsStateVersion=a,h=!1;else{if(void 0!==s.shaderID)return;h=!1}if(h){if(s.shaderID){var u=Yn[s.shaderID];i.shader={name:t.type,uniforms:Pn(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else i.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(i.shader,R),l=_.getProgramCode(t,s),c=_.acquireProgram(t,i.shader,s,l),i.program=c,t.program=c}var p=c.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var f=0;f<R.maxMorphTargets;f++)p["morphTarget"+f]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals)for(t.numSupportedMorphNormals=0,f=0;f<R.maxMorphNormals;f++)p["morphNormal"+f]>=0&&t.numSupportedMorphNormals++;var m=i.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=K.numPlanes,i.numIntersection=K.numIntersection,m.clippingPlanes=K.uniform),i.fog=e,i.lightsStateVersion=a,t.lights&&(m.ambientLightColor.value=r.state.ambient,m.lightProbe.value=r.state.probe,m.directionalLights.value=r.state.directional,m.spotLights.value=r.state.spot,m.rectAreaLights.value=r.state.rectArea,m.pointLights.value=r.state.point,m.hemisphereLights.value=r.state.hemi,m.directionalShadowMap.value=r.state.directionalShadowMap,m.directionalShadowMatrix.value=r.state.directionalShadowMatrix,m.spotShadowMap.value=r.state.spotShadowMap,m.spotShadowMatrix.value=r.state.spotShadowMatrix,m.pointShadowMap.value=r.state.pointShadowMap,m.pointShadowMatrix.value=r.state.pointShadowMatrix);var g=i.program.getUniforms(),v=rr.seqWithValue(g.seq,m);i.uniformsList=v}function yt(t,e,n,i){b.resetTextureUnits();var r=y.get(n),o=d.state.lights;if($&&(tt||t!==F)){var a=t===F&&n.id===B;K.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,r,a)}!1===n.needsUpdate&&(void 0===r.program||n.fog&&r.fog!==e||n.lights&&r.lightsStateVersion!==o.state.version?n.needsUpdate=!0:void 0===r.numClippingPlanes||r.numClippingPlanes===K.numPlanes&&r.numIntersection===K.numIntersection||(n.needsUpdate=!0)),n.needsUpdate&&(vt(n,e,i),n.needsUpdate=!1);var s,l,c=!1,h=!1,u=!1,f=r.program,v=f.getUniforms(),x=r.shader.uniforms;if(g.useProgram(f.program)&&(c=!0,h=!0,u=!0),n.id!==B&&(B=n.id,h=!0),c||F!==t){if(v.setValue(p,"projectionMatrix",t.projectionMatrix),m.logarithmicDepthBuffer&&v.setValue(p,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),F!==t&&(F=t,h=!0,u=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var w=v.map.cameraPosition;void 0!==w&&w.setValue(p,nt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&v.setValue(p,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){v.setOptional(p,i,"bindMatrix"),v.setOptional(p,i,"bindMatrixInverse");var E=i.skeleton;if(E){var _=E.bones;if(m.floatVertexTextures){if(void 0===E.boneTexture){var M=Math.sqrt(4*_.length);M=$t.ceilPowerOfTwo(M),M=Math.max(M,4);var S=new Float32Array(M*M*4);S.set(E.boneMatrices);var T=new jn(S,M,M,It,Ct);T.needsUpdate=!0,E.boneMatrices=S,E.boneTexture=T,E.boneTextureSize=M}v.setValue(p,"boneTexture",E.boneTexture,b),v.setValue(p,"boneTextureSize",E.boneTextureSize)}else v.setOptional(p,E,"boneMatrices")}}return h&&(v.setValue(p,"toneMappingExposure",R.toneMappingExposure),v.setValue(p,"toneMappingWhitePoint",R.toneMappingWhitePoint),n.lights&&(l=u,(s=x).ambientLightColor.needsUpdate=l,s.lightProbe.needsUpdate=l,s.directionalLights.needsUpdate=l,s.pointLights.needsUpdate=l,s.spotLights.needsUpdate=l,s.rectAreaLights.needsUpdate=l,s.hemisphereLights.needsUpdate=l),e&&n.fog&&function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(x,e),n.isMeshBasicMaterial?bt(x,n):n.isMeshLambertMaterial?(bt(x,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(x,n)):n.isMeshPhongMaterial?(bt(x,n),n.isMeshToonMaterial?function(t,e){xt(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(x,n):xt(x,n)):n.isMeshStandardMaterial?(bt(x,n),n.isMeshPhysicalMaterial?function(t,e){wt(t,e),t.reflectivity.value=e.reflectivity,t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness}(x,n):wt(x,n)):n.isMeshMatcapMaterial?(bt(x,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,n)):n.isMeshDepthMaterial?(bt(x,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,n)):n.isMeshDistanceMaterial?(bt(x,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(x,n)):n.isMeshNormalMaterial?(bt(x,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(x,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(x,n)):n.isPointsMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*X,t.scale.value=.5*Y,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(x,n):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(x,n):n.isShadowMaterial&&(x.color.value.copy(n.color),x.opacity.value=n.opacity),void 0!==x.ltc_1&&(x.ltc_1.value=Wn.LTC_1),void 0!==x.ltc_2&&(x.ltc_2.value=Wn.LTC_2),rr.upload(p,r.uniformsList,x,b)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(rr.upload(p,r.uniformsList,x,b),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&v.setValue(p,"center",i.center),v.setValue(p,"modelViewMatrix",i.modelViewMatrix),v.setValue(p,"normalMatrix",i.normalMatrix),v.setValue(p,"modelMatrix",i.matrixWorld),f}function bt(t,e){var n;t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=y.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function xt(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function wt(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}pt.setAnimationLoop((function(t){at.isPresenting()||dt&&dt(t)})),"undefined"!=typeof window&&pt.setContext(window),this.setAnimationLoop=function(t){dt=t,at.setAnimationLoop(t),pt.start()},this.render=function(t,e){var n,i;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),e&&e.isCamera){if(!O){H.geometry=null,H.program=null,H.wireframe=!1,B=-1,F=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),at.enabled&&(e=at.getCamera(e)),(d=S.get(t,e)).init(),t.onBeforeRender(R,t,e,n||N),et.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Q.setFromMatrix(et),tt=this.localClippingEnabled,$=K.init(this.clippingPlanes,tt,e),(u=M.get(t,e)).init(),ft(t,e,0,R.sortObjects),!0===R.sortObjects&&u.sort(),$&&K.beginShadows();var r=d.state.shadowsArray;st.render(r,t,e),d.setupLights(e),$&&K.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),T.render(u,t,e,i);var o=u.opaque,a=u.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&mt(o,t,e,s),a.length&&mt(a,t,e,s)}else o.length&&mt(o,t,e),a.length&&mt(a,t,e);t.onAfterRender(R,t,e),null!==N&&(b.updateRenderTargetMipmap(N),b.updateMultisampleRenderTarget(N)),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),at.enabled&&at.submitFrame(),u=null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){I!==t&&p.bindFramebuffer(36160,t),I=t},this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return k},this.getRenderTarget=function(){return N},this.setRenderTarget=function(t,e,n){N=t,D=e,k=n,t&&void 0===y.get(t).__webglFramebuffer&&b.setupRenderTarget(t);var i=I,r=!1;if(t){var o=y.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(i=o[e||0],r=!0):i=t.isWebGLMultisampleRenderTarget?y.get(t).__webglMultisampledFramebuffer:o,U.copy(t.viewport),G.copy(t.scissor),V=t.scissorTest}else U.copy(q).multiplyScalar(X).floor(),G.copy(Z).multiplyScalar(X).floor(),V=J;if(z!==i&&(p.bindFramebuffer(36160,i),z=i),g.viewport(U),g.scissor(G),g.setScissorTest(V),r){var a=y.get(t.texture);p.framebufferTexture2D(36160,36064,34069+(e||0),a.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,i,r,o,a){if(t&&t.isWebGLRenderTarget){var s=y.get(t).__webglFramebuffer;if(t.isWebGLRenderTargetCube&&void 0!==a&&(s=s[a]),s){var l=!1;s!==z&&(p.bindFramebuffer(36160,s),l=!0);try{var c=t.texture,h=c.format,u=c.type;if(h!==It&&P.convert(h)!==p.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u===Tt||P.convert(u)===p.getParameter(35738)||u===Ct&&(m.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||u===Pt&&(m.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===p.checkFramebufferStatus(36160)?e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&p.readPixels(e,n,i,r,P.convert(h),P.convert(u),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&p.bindFramebuffer(36160,z)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){var i=e.image.width,r=e.image.height,o=P.convert(e.format);b.setTexture2D(e,0),p.copyTexImage2D(3553,n||0,o,t.x,t.y,i,r,0)},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,o=e.image.height,a=P.convert(n.format),s=P.convert(n.type);b.setTexture2D(n,0),e.isDataTexture?p.texSubImage2D(3553,i||0,t.x,t.y,r,o,a,s,e.image.data):p.texSubImage2D(3553,i||0,t.x,t.y,a,s,e.image)},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function qr(t,e){this.name="",this.color=new $e(t),this.density=void 0!==e?e:25e-5}function Zr(t,e,n){this.name="",this.color=new $e(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Jr(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Qr(t,e,n,i){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===i}function Kr(t){an.call(this),this.type="SpriteMaterial",this.color=new $e(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function $r(t){if(Ge.call(this),this.type="Sprite",void 0===Nr){Nr=new Mn;var e=new Jr(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Nr.setIndex([0,1,2,0,2,3]),Nr.addAttribute("position",new Qr(e,3,0,!1)),Nr.addAttribute("uv",new Qr(e,2,3,!1))}this.geometry=Nr,this.material=void 0!==t?t:new Kr,this.center=new te(.5,.5)}function to(){Ge.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function eo(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Sn.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new be,this.bindMatrixInverse=new be}function no(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new be)}}function io(){Ge.call(this),this.type="Bone"}function ro(t){an.call(this),this.type="LineBasicMaterial",this.color=new $e(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function oo(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Ge.call(this),this.type="Line",this.geometry=void 0!==t?t:new Mn,this.material=void 0!==e?e:new ro({color:16777215*Math.random()})}function ao(t,e){oo.call(this,t,e),this.type="LineSegments"}function so(t,e){oo.call(this,t,e),this.type="LineLoop"}function lo(t){an.call(this),this.type="PointsMaterial",this.color=new $e(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function co(t,e){Ge.call(this),this.type="Points",this.geometry=void 0!==t?t:new Mn,this.material=void 0!==e?e:new lo({color:16777215*Math.random()}),this.updateMorphTargets()}function ho(t,e,n,i,r,o,a,s,l){me.call(this,t,e,n,i,r,o,a,s,l),this.format=void 0!==a?a:Ot,this.minFilter=void 0!==o?o:_t,this.magFilter=void 0!==r?r:_t,this.generateMipmaps=!1}function uo(t,e,n,i,r,o,a,s,l,c,h,u){me.call(this,null,o,a,s,l,c,i,r,h,u),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function po(t,e,n,i,r,o,a,s,l){me.call(this,t,e,n,i,r,o,a,s,l),this.needsUpdate=!0}function fo(t,e,n,i,r,o,a,s,l,c){if((c=void 0!==c?c:Dt)!==Dt&&c!==kt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Dt&&(n=At),void 0===n&&c===kt&&(n=Rt),me.call(this,null,i,r,o,a,s,c,n,l),this.image={width:t,height:e},this.magFilter=void 0!==a?a:xt,this.minFilter=void 0!==s?s:xt,this.flipY=!1,this.generateMipmaps=!1}function mo(t){Mn.call(this),this.type="WireframeGeometry";var e,n,i,r,o,a,s,l,c,h,u=[],d=[0,0],p={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,i=m.length;e<i;e++){var g=m[e];for(n=0;n<3;n++)s=g[f[n]],l=g[f[(n+1)%3]],d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[c=d[0]+","+d[1]]&&(p[c]={index1:d[0],index2:d[1]})}for(c in p)a=p[c],h=t.vertices[a.index1],u.push(h.x,h.y,h.z),h=t.vertices[a.index2],u.push(h.x,h.y,h.z)}else if(t&&t.isBufferGeometry){var v,y,b,x,w,E,_;if(h=new ne,null!==t.index){for(v=t.attributes.position,y=t.index,0===(b=t.groups).length&&(b=[{start:0,count:y.count,materialIndex:0}]),r=0,o=b.length;r<o;++r)for(e=w=(x=b[r]).start,i=w+x.count;e<i;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),l=y.getX(e+(n+1)%3),d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[c=d[0]+","+d[1]]&&(p[c]={index1:d[0],index2:d[1]});for(c in p)a=p[c],h.fromBufferAttribute(v,a.index1),u.push(h.x,h.y,h.z),h.fromBufferAttribute(v,a.index2),u.push(h.x,h.y,h.z)}else for(e=0,i=(v=t.attributes.position).count/3;e<i;e++)for(n=0;n<3;n++)E=3*e+n,h.fromBufferAttribute(v,E),u.push(h.x,h.y,h.z),_=3*e+(n+1)%3,h.fromBufferAttribute(v,_),u.push(h.x,h.y,h.z)}this.addAttribute("position",new gn(u,3))}function go(t,e,n){An.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new vo(t,e,n)),this.mergeVertices()}function vo(t,e,n){Mn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var i,r,o=[],a=[],s=[],l=[],c=1e-5,h=new ne,u=new ne,d=new ne,p=new ne,f=new ne;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=e+1;for(i=0;i<=n;i++){var g=i/n;for(r=0;r<=e;r++){var v=r/e;t(v,g,u),a.push(u.x,u.y,u.z),v-c>=0?(t(v-c,g,d),p.subVectors(u,d)):(t(v+c,g,d),p.subVectors(d,u)),g-c>=0?(t(v,g-c,d),f.subVectors(u,d)):(t(v,g+c,d),f.subVectors(d,u)),h.crossVectors(p,f).normalize(),s.push(h.x,h.y,h.z),l.push(v,g)}}for(i=0;i<n;i++)for(r=0;r<e;r++){var y=i*m+r,b=i*m+r+1,x=(i+1)*m+r+1,w=(i+1)*m+r;o.push(y,b,w),o.push(b,x,w)}this.setIndex(o),this.addAttribute("position",new gn(a,3)),this.addAttribute("normal",new gn(s,3)),this.addAttribute("uv",new gn(l,2))}function yo(t,e,n,i){An.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new bo(t,e,n,i)),this.mergeVertices()}function bo(t,e,n,i){Mn.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},n=n||1;var r=[],o=[];function a(t,e,n,i){var r,o,a=Math.pow(2,i),l=[];for(r=0;r<=a;r++){l[r]=[];var c=t.clone().lerp(n,r/a),h=e.clone().lerp(n,r/a),u=a-r;for(o=0;o<=u;o++)l[r][o]=0===o&&r===a?c:c.clone().lerp(h,o/u)}for(r=0;r<a;r++)for(o=0;o<2*(a-r)-1;o++){var d=Math.floor(o/2);o%2==0?(s(l[r][d+1]),s(l[r+1][d]),s(l[r][d])):(s(l[r][d+1]),s(l[r+1][d+1]),s(l[r+1][d]))}}function s(t){r.push(t.x,t.y,t.z)}function l(e,n){var i=3*e;n.x=t[i+0],n.y=t[i+1],n.z=t[i+2]}function c(t,e,n,i){i<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=i/2/Math.PI+.5)}function h(t){return Math.atan2(t.z,-t.x)}function u(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){for(var n=new ne,i=new ne,r=new ne,o=0;o<e.length;o+=3)l(e[o+0],n),l(e[o+1],i),l(e[o+2],r),a(n,i,r,t)}(i=i||0),function(t){for(var e=new ne,n=0;n<r.length;n+=3)e.x=r[n+0],e.y=r[n+1],e.z=r[n+2],e.normalize().multiplyScalar(t),r[n+0]=e.x,r[n+1]=e.y,r[n+2]=e.z}(n),function(){for(var t=new ne,e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];var n=h(t)/2/Math.PI+.5,i=u(t)/Math.PI+.5;o.push(n,1-i)}(function(){for(var t=new ne,e=new ne,n=new ne,i=new ne,a=new te,s=new te,l=new te,u=0,d=0;u<r.length;u+=9,d+=6){t.set(r[u+0],r[u+1],r[u+2]),e.set(r[u+3],r[u+4],r[u+5]),n.set(r[u+6],r[u+7],r[u+8]),a.set(o[d+0],o[d+1]),s.set(o[d+2],o[d+3]),l.set(o[d+4],o[d+5]),i.copy(t).add(e).add(n).divideScalar(3);var p=h(i);c(a,d+0,t,p),c(s,d+2,e,p),c(l,d+4,n,p)}})(),function(){for(var t=0;t<o.length;t+=6){var e=o[t+0],n=o[t+2],i=o[t+4],r=Math.max(e,n,i),a=Math.min(e,n,i);r>.9&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),i<.2&&(o[t+4]+=1))}}()}(),this.addAttribute("position",new gn(r,3)),this.addAttribute("normal",new gn(r.slice(),3)),this.addAttribute("uv",new gn(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function xo(t,e){An.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new wo(t,e)),this.mergeVertices()}function wo(t,e){bo.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Eo(t,e){An.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new _o(t,e)),this.mergeVertices()}function _o(t,e){bo.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Mo(t,e){An.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new So(t,e)),this.mergeVertices()}function So(t,e){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];bo.call(this,i,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function To(t,e){An.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ao(t,e)),this.mergeVertices()}function Ao(t,e){var n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];bo.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Lo(t,e,n,i,r,o){An.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Co(t,e,n,i,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Co(t,e,n,i,r){Mn.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},e=e||64,n=n||1,i=i||8,r=r||!1;var o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,l=new ne,c=new ne,h=new te,u=new ne,d=[],p=[],f=[],m=[];function g(r){u=t.getPointAt(r/e,u);var a=o.normals[r],h=o.binormals[r];for(s=0;s<=i;s++){var f=s/i*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);c.x=g*a.x+m*h.x,c.y=g*a.y+m*h.y,c.z=g*a.z+m*h.z,c.normalize(),p.push(c.x,c.y,c.z),l.x=u.x+n*c.x,l.y=u.y+n*c.y,l.z=u.z+n*c.z,d.push(l.x,l.y,l.z)}}!function(){for(a=0;a<e;a++)g(a);g(!1===r?e:0),function(){for(a=0;a<=e;a++)for(s=0;s<=i;s++)h.x=a/e,h.y=s/i,f.push(h.x,h.y)}(),function(){for(s=1;s<=e;s++)for(a=1;a<=i;a++){var t=(i+1)*(s-1)+(a-1),n=(i+1)*s+(a-1),r=(i+1)*s+a,o=(i+1)*(s-1)+a;m.push(t,n,o),m.push(n,r,o)}}()}(),this.setIndex(m),this.addAttribute("position",new gn(d,3)),this.addAttribute("normal",new gn(p,3)),this.addAttribute("uv",new gn(f,2))}function Po(t,e,n,i,r,o,a){An.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Ro(t,e,n,i,r,o)),this.mergeVertices()}function Ro(t,e,n,i,r,o){Mn.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,o=o||3;var a,s,l=[],c=[],h=[],u=[],d=new ne,p=new ne,f=new ne,m=new ne,g=new ne,v=new ne,y=new ne;for(a=0;a<=n;++a){var b=a/n*r*Math.PI*2;for(A(b,r,o,t,f),A(b+.01,r,o,t,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=i;++s){var x=s/i*Math.PI*2,w=-e*Math.cos(x),E=e*Math.sin(x);d.x=f.x+(w*y.x+E*g.x),d.y=f.y+(w*y.y+E*g.y),d.z=f.z+(w*y.z+E*g.z),c.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),h.push(p.x,p.y,p.z),u.push(a/n),u.push(s/i)}}for(s=1;s<=n;s++)for(a=1;a<=i;a++){var _=(i+1)*(s-1)+(a-1),M=(i+1)*s+(a-1),S=(i+1)*s+a,T=(i+1)*(s-1)+a;l.push(_,M,T),l.push(M,S,T)}function A(t,e,n,i,r){var o=Math.cos(t),a=Math.sin(t),s=n/e*t,l=Math.cos(s);r.x=i*(2+l)*.5*o,r.y=i*(2+l)*a*.5,r.z=i*Math.sin(s)*.5}this.setIndex(l),this.addAttribute("position",new gn(c,3)),this.addAttribute("normal",new gn(h,3)),this.addAttribute("uv",new gn(u,2))}function Oo(t,e,n,i,r){An.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new Io(t,e,n,i,r)),this.mergeVertices()}function Io(t,e,n,i,r){Mn.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var o,a,s=[],l=[],c=[],h=[],u=new ne,d=new ne,p=new ne;for(o=0;o<=n;o++)for(a=0;a<=i;a++){var f=a/i*r,m=o/n*Math.PI*2;d.x=(t+e*Math.cos(m))*Math.cos(f),d.y=(t+e*Math.cos(m))*Math.sin(f),d.z=e*Math.sin(m),l.push(d.x,d.y,d.z),u.x=t*Math.cos(f),u.y=t*Math.sin(f),p.subVectors(d,u).normalize(),c.push(p.x,p.y,p.z),h.push(a/i),h.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=i;a++){var g=(i+1)*o+a-1,v=(i+1)*(o-1)+a-1,y=(i+1)*(o-1)+a,b=(i+1)*o+a;s.push(g,v,b),s.push(v,y,b)}this.setIndex(s),this.addAttribute("position",new gn(l,3)),this.addAttribute("normal",new gn(c,3)),this.addAttribute("uv",new gn(h,2))}Object.assign(Wr.prototype,it.prototype),Object.assign(Yr.prototype,it.prototype),Object.assign(qr.prototype,{isFogExp2:!0,clone:function(){return new qr(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Zr.prototype,{isFog:!0,clone:function(){return new Zr(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Jr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Jr.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(Qr.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Qr.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}}),Kr.prototype=Object.create(an.prototype),Kr.prototype.constructor=Kr,Kr.prototype.isSpriteMaterial=!0,Kr.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},$r.prototype=Object.assign(Object.create(Ge.prototype),{constructor:$r,isSprite:!0,raycast:function(){var t=new ne,e=new ne,n=new ne,i=new te,r=new te,o=new be,a=new ne,s=new ne,l=new ne,c=new te,h=new te,u=new te;function d(t,e,n,a,s,l){i.subVectors(t,n).addScalar(.5).multiply(a),void 0!==s?(r.x=l*i.x-s*i.y,r.y=s*i.x+l*i.y):r.copy(i),t.copy(e),t.x+=r.x,t.y+=r.y,t.applyMatrix4(o)}return function(i,r){e.setFromMatrixScale(this.matrixWorld),o.copy(i._camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(i._camera.matrixWorldInverse,this.matrixWorld),n.setFromMatrixPosition(this.modelViewMatrix),i._camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&e.multiplyScalar(-n.z);var p,f,m=this.material.rotation;0!==m&&(f=Math.cos(m),p=Math.sin(m));var g=this.center;d(a.set(-.5,-.5,0),n,g,e,p,f),d(s.set(.5,-.5,0),n,g,e,p,f),d(l.set(.5,.5,0),n,g,e,p,f),c.set(0,0),h.set(1,0),u.set(1,1);var v=i.ray.intersectTriangle(a,s,l,!1,t);if(null!==v||(d(s.set(-.5,.5,0),n,g,e,p,f),h.set(0,1),null!==(v=i.ray.intersectTriangle(a,l,s,!1,t)))){var y=i.ray.origin.distanceTo(t);y<i.near||y>i.far||r.push({distance:y,point:t.clone(),uv:qe.getUV(t,a,s,l,c,h,u,new te),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Ge.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),to.prototype=Object.assign(Object.create(Ge.prototype),{constructor:to,isLOD:!0,copy:function(t){Ge.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n<i;n++){var r=e[n];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,i=0;i<n.length&&!(e<n[i].distance);i++);return n.splice(i,0,{distance:e,object:t}),this.add(t),this},getObjectForDistance:function(t){for(var e=this.levels,n=1,i=e.length;n<i&&!(t<e[n].distance);n++);return e[n-1].object},raycast:(zr=new ne,function(t,e){zr.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(zr);this.getObjectForDistance(n).raycast(t,e)}),update:function(){var t=new ne,e=new ne;return function(n){var i=this.levels;if(i.length>1){t.setFromMatrixPosition(n.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var r=t.distanceTo(e);i[0].object.visible=!0;for(var o=1,a=i.length;o<a&&r>=i[o].distance;o++)i[o-1].object.visible=!1,i[o].object.visible=!0;for(;o<a;o++)i[o].object.visible=!1}}}(),toJSON:function(t){var e=Ge.prototype.toJSON.call(this,t);e.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var o=n[i];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),eo.prototype=Object.assign(Object.create(Sn.prototype),{constructor:eo,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new ge,e=this.geometry.attributes.skinWeight,n=0,i=e.count;n<i;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Sn.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Object.assign(no.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new be;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:(Br=new be,Hr=new be,function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,o=t.length;r<o;r++){var a=t[r]?t[r].matrixWorld:Hr;Br.multiplyMatrices(a,e[r]),Br.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)}),clone:function(){return new no(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var i=this.bones[e];if(i.name===t)return i}}}),io.prototype=Object.assign(Object.create(Ge.prototype),{constructor:io,isBone:!0}),ro.prototype=Object.create(an.prototype),ro.prototype.constructor=ro,ro.prototype.isLineBasicMaterial=!0,ro.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},oo.prototype=Object.assign(Object.create(Ge.prototype),{constructor:oo,isLine:!0,computeLineDistances:(Fr=new ne,jr=new ne,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],i=1,r=e.count;i<r;i++)Fr.fromBufferAttribute(e,i-1),jr.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=Fr.distanceTo(jr);t.addAttribute("lineDistance",new gn(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;for((n=t.lineDistances)[0]=0,i=1,r=o.length;i<r;i++)n[i]=n[i-1],n[i]+=o[i-1].distanceTo(o[i])}return this}),raycast:function(){var t=new be,e=new Xe,n=new Ye;return function(i,r){var o=i.linePrecision,a=this.geometry,s=this.matrixWorld;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=o,!1!==i.ray.intersectsSphere(n)){t.getInverse(s),e.copy(i.ray).applyMatrix4(t);var l=o/((this.scale.x+this.scale.y+this.scale.z)/3),c=l*l,h=new ne,u=new ne,d=new ne,p=new ne,f=this&&this.isLineSegments?2:1;if(a.isBufferGeometry){var m=a.index,g=a.attributes.position.array;if(null!==m)for(var v=m.array,y=0,b=v.length-1;y<b;y+=f){var x=v[y],w=v[y+1];h.fromArray(g,3*x),u.fromArray(g,3*w),e.distanceSqToSegment(h,u,p,d)>c||(p.applyMatrix4(this.matrixWorld),(M=i.ray.origin.distanceTo(p))<i.near||M>i.far||r.push({distance:M,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}else for(y=0,b=g.length/3-1;y<b;y+=f)h.fromArray(g,3*y),u.fromArray(g,3*y+3),e.distanceSqToSegment(h,u,p,d)>c||(p.applyMatrix4(this.matrixWorld),(M=i.ray.origin.distanceTo(p))<i.near||M>i.far||r.push({distance:M,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}else if(a.isGeometry){var E=a.vertices,_=E.length;for(y=0;y<_-1;y+=f){var M;e.distanceSqToSegment(E[y],E[y+1],p,d)>c||(p.applyMatrix4(this.matrixWorld),(M=i.ray.origin.distanceTo(p))<i.near||M>i.far||r.push({distance:M,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ao.prototype=Object.assign(Object.create(oo.prototype),{constructor:ao,isLineSegments:!0,computeLineDistances:function(){var t=new ne,e=new ne;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var i=n.attributes.position,r=[],o=0,a=i.count;o<a;o+=2)t.fromBufferAttribute(i,o),e.fromBufferAttribute(i,o+1),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e);n.addAttribute("lineDistance",new gn(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(r=n.lineDistances,o=0,a=s.length;o<a;o+=2)t.copy(s[o]),e.copy(s[o+1]),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e)}return this}}()}),so.prototype=Object.assign(Object.create(oo.prototype),{constructor:so,isLineLoop:!0}),lo.prototype=Object.create(an.prototype),lo.prototype.constructor=lo,lo.prototype.isPointsMaterial=!0,lo.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},co.prototype=Object.assign(Object.create(Ge.prototype),{constructor:co,isPoints:!0,raycast:function(){var t=new be,e=new Xe,n=new Ye;return function(i,r){var o=this,a=this.geometry,s=this.matrixWorld,l=i.params.Points.threshold;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=l,!1!==i.ray.intersectsSphere(n)){t.getInverse(s),e.copy(i.ray).applyMatrix4(t);var c=l/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=new ne,d=new ne;if(a.isBufferGeometry){var p=a.index,f=a.attributes.position.array;if(null!==p)for(var m=p.array,g=0,v=m.length;g<v;g++){var y=m[g];u.fromArray(f,3*y),w(u,y)}else{g=0;for(var b=f.length/3;g<b;g++)u.fromArray(f,3*g),w(u,g)}}else{var x=a.vertices;for(g=0,b=x.length;g<b;g++)w(x[g],g)}}function w(t,n){var a=e.distanceSqToPoint(t);if(a<h){e.closestPointToPoint(t,d),d.applyMatrix4(s);var l=i.ray.origin.distanceTo(d);if(l<i.near||l>i.far)return;r.push({distance:l,distanceToRay:Math.sqrt(a),point:d.clone(),index:n,face:null,object:o})}}}}(),updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(o.length>0){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ho.prototype=Object.assign(Object.create(me.prototype),{constructor:ho,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),uo.prototype=Object.create(me.prototype),uo.prototype.constructor=uo,uo.prototype.isCompressedTexture=!0,po.prototype=Object.create(me.prototype),po.prototype.constructor=po,po.prototype.isCanvasTexture=!0,fo.prototype=Object.create(me.prototype),fo.prototype.constructor=fo,fo.prototype.isDepthTexture=!0,mo.prototype=Object.create(Mn.prototype),mo.prototype.constructor=mo,go.prototype=Object.create(An.prototype),go.prototype.constructor=go,vo.prototype=Object.create(Mn.prototype),vo.prototype.constructor=vo,yo.prototype=Object.create(An.prototype),yo.prototype.constructor=yo,bo.prototype=Object.create(Mn.prototype),bo.prototype.constructor=bo,xo.prototype=Object.create(An.prototype),xo.prototype.constructor=xo,wo.prototype=Object.create(bo.prototype),wo.prototype.constructor=wo,Eo.prototype=Object.create(An.prototype),Eo.prototype.constructor=Eo,_o.prototype=Object.create(bo.prototype),_o.prototype.constructor=_o,Mo.prototype=Object.create(An.prototype),Mo.prototype.constructor=Mo,So.prototype=Object.create(bo.prototype),So.prototype.constructor=So,To.prototype=Object.create(An.prototype),To.prototype.constructor=To,Ao.prototype=Object.create(bo.prototype),Ao.prototype.constructor=Ao,Lo.prototype=Object.create(An.prototype),Lo.prototype.constructor=Lo,Co.prototype=Object.create(Mn.prototype),Co.prototype.constructor=Co,Co.prototype.toJSON=function(){var t=Mn.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},Po.prototype=Object.create(An.prototype),Po.prototype.constructor=Po,Ro.prototype=Object.create(Mn.prototype),Ro.prototype.constructor=Ro,Oo.prototype=Object.create(An.prototype),Oo.prototype.constructor=Oo,Io.prototype=Object.create(Mn.prototype),Io.prototype.constructor=Io;function Do(t,e,n,i,r){var o,a;if(r===function(t,e,n,i){for(var r=0,o=e,a=n-i;o<n;o+=i)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}(t,e,n,i)>0)for(o=e;o<n;o+=i)a=Ko(o,t[o],t[o+1],a);else for(o=n-i;o>=e;o-=i)a=Ko(o,t[o],t[o+1],a);return a&&qo(a,a.next)&&($o(a),a=a.next),a}function ko(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!qo(i,i.next)&&0!==Xo(i.prev,i,i.next))i=i.next;else{if($o(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function No(t,e,n,i,r,o,a){if(t){!a&&o&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=Go(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,a,s,l,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,i=n,s=0,e=0;e<c&&(s++,i=i.nextZ);e++);for(l=c;s>0||l>0&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(a>1)}(r)}(t,i,r,o);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?Bo(t,i,r,o):zo(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),$o(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?No(t=Ho(t,e,n),e,n,i,r,o,2):2===a&&Fo(t,e,n,i,r,o):No(ko(t),e,n,i,r,o,1);break}}}function zo(t){var e=t.prev,n=t,i=t.next;if(Xo(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Wo(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&Xo(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Bo(t,e,n,i){var r=t.prev,o=t,a=t.next;if(Xo(r,o,a)>=0)return!1;for(var s=r.x<o.x?r.x<a.x?r.x:a.x:o.x<a.x?o.x:a.x,l=r.y<o.y?r.y<a.y?r.y:a.y:o.y<a.y?o.y:a.y,c=r.x>o.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,h=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,u=Go(s,l,e,n,i),d=Go(c,h,e,n,i),p=t.prevZ,f=t.nextZ;p&&p.z>=u&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&Wo(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Xo(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&Wo(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Xo(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&Wo(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Xo(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&Wo(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Xo(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ho(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!qo(r,o)&&Zo(r,i,i.next,o)&&Jo(r,o)&&Jo(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),$o(i),$o(i.next),i=t=o),i=i.next}while(i!==t);return i}function Fo(t,e,n,i,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Yo(a,s)){var l=Qo(a,s);return a=ko(a,a.next),l=ko(l,l.next),No(a,e,n,i,r,o),void No(l,e,n,i,r,o)}s=s.next}a=a.next}while(a!==t)}function jo(t,e){return t.x-e.x}function Uo(t,e){if(e=function(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>a){if(a=s,s===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===a)return n.prev;var l,c=n,h=n.x,u=n.y,d=1/0;for(i=n.next;i!==c;)r>=i.x&&i.x>=h&&r!==i.x&&Wo(o<u?r:a,o,h,u,o<u?a:r,o,i.x,i.y)&&((l=Math.abs(o-i.y)/(r-i.x))<d||l===d&&i.x>n.x)&&Jo(i,t)&&(n=i,d=l),i=i.next;return n}(t,e),e){var n=Qo(e,t);ko(n,n.next)}}function Go(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Vo(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Wo(t,e,n,i,r,o,a,s){return(r-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(i-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(r-a)*(i-s)>=0}function Yo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Zo(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&Jo(t,e)&&Jo(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)}function Xo(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function qo(t,e){return t.x===e.x&&t.y===e.y}function Zo(t,e,n,i){return!!(qo(t,n)&&qo(e,i)||qo(t,i)&&qo(n,e))||Xo(t,e,n)>0!=Xo(t,e,i)>0&&Xo(n,i,t)>0!=Xo(n,i,e)>0}function Jo(t,e){return Xo(t.prev,t,t.next)<0?Xo(t,e,t.next)>=0&&Xo(t,t.prev,e)>=0:Xo(t,e,t.prev)<0||Xo(t,t.next,e)<0}function Qo(t,e){var n=new ta(t.i,t.x,t.y),i=new ta(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Ko(t,e,n,i){var r=new ta(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function $o(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ta(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var ea={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return ea.area(t)<0},triangulateShape:function(t,e){var n=[],i=[],r=[];na(t),ia(n,t);var o=t.length;e.forEach(na);for(var a=0;a<e.length;a++)i.push(o),o+=e[a].length,ia(n,e[a]);var s=function(t,e,n){n=n||2;var i,r,o,a,s,l,c,h=e&&e.length,u=h?e[0]*n:t.length,d=Do(t,0,u,n,!0),p=[];if(!d||d.next===d.prev)return p;if(h&&(d=function(t,e,n,i){var r,o,a,s=[];for(r=0,o=e.length;r<o;r++)(a=Do(t,e[r]*i,r<o-1?e[r+1]*i:t.length,i,!1))===a.next&&(a.steiner=!0),s.push(Vo(a));for(s.sort(jo),r=0;r<s.length;r++)Uo(s[r],n),n=ko(n,n.next);return n}(t,e,d,n)),t.length>80*n){i=o=t[0],r=a=t[1];for(var f=n;f<u;f+=n)(s=t[f])<i&&(i=s),(l=t[f+1])<r&&(r=l),s>o&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-i,a-r))?1/c:0}return No(d,p,n,i,r,c),p}(n,i);for(a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}};function na(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function ia(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function ra(t,e){An.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new oa(t,e)),this.mergeVertices()}function oa(t,e){Mn.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];for(var n=this,i=[],r=[],o=0,a=t.length;o<a;o++)s(t[o]);function s(t){var o=[],a=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:100,c=void 0===e.bevelEnabled||e.bevelEnabled,h=void 0!==e.bevelThickness?e.bevelThickness:6,u=void 0!==e.bevelSize?e.bevelSize:h-2,d=void 0!==e.bevelOffset?e.bevelOffset:0,p=void 0!==e.bevelSegments?e.bevelSegments:3,f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:aa;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=e.amount);var g,v,y,b,x,w,E,_,M=!1;f&&(g=f.getSpacedPoints(s),M=!0,c=!1,v=f.computeFrenetFrames(s,!1),y=new ne,b=new ne,x=new ne),c||(p=0,h=0,u=0,d=0);var S=t.extractPoints(a),T=S.shape,A=S.holes;if(!ea.isClockWise(T))for(T=T.reverse(),E=0,_=A.length;E<_;E++)w=A[E],ea.isClockWise(w)&&(A[E]=w.reverse());var L=ea.triangulateShape(T,A),C=T;for(E=0,_=A.length;E<_;E++)w=A[E],T=T.concat(w);function P(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var R,O,I,D,k,N,z=T.length,B=L.length;function H(t,e,n){var i,r,o,a=t.x-e.x,s=t.y-e.y,l=n.x-t.x,c=n.y-t.y,h=a*a+s*s,u=a*c-s*l;if(Math.abs(u)>Number.EPSILON){var d=Math.sqrt(h),p=Math.sqrt(l*l+c*c),f=e.x-s/d,m=e.y+a/d,g=((n.x-c/p-f)*c-(n.y+l/p-m)*l)/(a*c-s*l),v=(i=f+a*g-t.x)*i+(r=m+s*g-t.y)*r;if(v<=2)return new te(i,r);o=Math.sqrt(v/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(c)&&(y=!0),y?(i=-s,r=a,o=Math.sqrt(h)):(i=a,r=s,o=Math.sqrt(h/2))}return new te(i/o,r/o)}for(var F=[],j=0,U=C.length,G=U-1,V=j+1;j<U;j++,G++,V++)G===U&&(G=0),V===U&&(V=0),F[j]=H(C[j],C[G],C[V]);var W,Y,X=[],q=F.concat();for(E=0,_=A.length;E<_;E++){for(w=A[E],W=[],j=0,G=(U=w.length)-1,V=j+1;j<U;j++,G++,V++)G===U&&(G=0),V===U&&(V=0),W[j]=H(w[j],w[G],w[V]);X.push(W),q=q.concat(W)}for(R=0;R<p;R++){for(I=R/p,D=h*Math.cos(I*Math.PI/2),O=u*Math.sin(I*Math.PI/2)+d,j=0,U=C.length;j<U;j++)J((k=P(C[j],F[j],O)).x,k.y,-D);for(E=0,_=A.length;E<_;E++)for(w=A[E],W=X[E],j=0,U=w.length;j<U;j++)J((k=P(w[j],W[j],O)).x,k.y,-D)}for(O=u+d,j=0;j<z;j++)k=c?P(T[j],q[j],O):T[j],M?(b.copy(v.normals[0]).multiplyScalar(k.x),y.copy(v.binormals[0]).multiplyScalar(k.y),x.copy(g[0]).add(b).add(y),J(x.x,x.y,x.z)):J(k.x,k.y,0);for(Y=1;Y<=s;Y++)for(j=0;j<z;j++)k=c?P(T[j],q[j],O):T[j],M?(b.copy(v.normals[Y]).multiplyScalar(k.x),y.copy(v.binormals[Y]).multiplyScalar(k.y),x.copy(g[Y]).add(b).add(y),J(x.x,x.y,x.z)):J(k.x,k.y,l/s*Y);for(R=p-1;R>=0;R--){for(I=R/p,D=h*Math.cos(I*Math.PI/2),O=u*Math.sin(I*Math.PI/2)+d,j=0,U=C.length;j<U;j++)J((k=P(C[j],F[j],O)).x,k.y,l+D);for(E=0,_=A.length;E<_;E++)for(w=A[E],W=X[E],j=0,U=w.length;j<U;j++)k=P(w[j],W[j],O),M?J(k.x,k.y+g[s-1].y,g[s-1].x+D):J(k.x,k.y,l+D)}function Z(t,e){var n,i;for(j=t.length;--j>=0;){n=j,(i=j-1)<0&&(i=t.length-1);var r=0,o=s+2*p;for(r=0;r<o;r++){var a=z*r,l=z*(r+1);K(e+n+a,e+i+a,e+i+l,e+n+l)}}}function J(t,e,n){o.push(t),o.push(e),o.push(n)}function Q(t,e,r){$(t),$(e),$(r);var o=i.length/3,a=m.generateTopUV(n,i,o-3,o-2,o-1);tt(a[0]),tt(a[1]),tt(a[2])}function K(t,e,r,o){$(t),$(e),$(o),$(e),$(r),$(o);var a=i.length/3,s=m.generateSideWallUV(n,i,a-6,a-3,a-2,a-1);tt(s[0]),tt(s[1]),tt(s[3]),tt(s[1]),tt(s[2]),tt(s[3])}function $(t){i.push(o[3*t+0]),i.push(o[3*t+1]),i.push(o[3*t+2])}function tt(t){r.push(t.x),r.push(t.y)}!function(){var t=i.length/3;if(c){var e=0,r=z*e;for(j=0;j<B;j++)Q((N=L[j])[2]+r,N[1]+r,N[0]+r);for(r=z*(e=s+2*p),j=0;j<B;j++)Q((N=L[j])[0]+r,N[1]+r,N[2]+r)}else{for(j=0;j<B;j++)Q((N=L[j])[2],N[1],N[0]);for(j=0;j<B;j++)Q((N=L[j])[0]+z*s,N[1]+z*s,N[2]+z*s)}n.addGroup(t,i.length/3-t,0)}(),function(){var t=i.length/3,e=0;for(Z(C,e),e+=C.length,E=0,_=A.length;E<_;E++)Z(w=A[E],e),e+=w.length;n.addGroup(t,i.length/3-t,1)}()}this.addAttribute("position",new gn(i,3)),this.addAttribute("uv",new gn(r,2)),this.computeVertexNormals()}ra.prototype=Object.create(An.prototype),ra.prototype.constructor=ra,ra.prototype.toJSON=function(){var t=An.prototype.toJSON.call(this);return sa(this.parameters.shapes,this.parameters.options,t)},oa.prototype=Object.create(Mn.prototype),oa.prototype.constructor=oa,oa.prototype.toJSON=function(){var t=Mn.prototype.toJSON.call(this);return sa(this.parameters.shapes,this.parameters.options,t)};var aa={generateTopUV:function(t,e,n,i,r){var o=e[3*n],a=e[3*n+1],s=e[3*i],l=e[3*i+1],c=e[3*r],h=e[3*r+1];return[new te(o,a),new te(s,l),new te(c,h)]},generateSideWallUV:function(t,e,n,i,r,o){var a=e[3*n],s=e[3*n+1],l=e[3*n+2],c=e[3*i],h=e[3*i+1],u=e[3*i+2],d=e[3*r],p=e[3*r+1],f=e[3*r+2],m=e[3*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(s-h)<.01?[new te(a,1-l),new te(c,1-u),new te(d,1-f),new te(m,1-v)]:[new te(s,1-l),new te(h,1-u),new te(p,1-f),new te(g,1-v)]}};function sa(t,e,n){if(n.shapes=[],Array.isArray(t))for(var i=0,r=t.length;i<r;i++){var o=t[i];n.shapes.push(o.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function la(t,e){An.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new ca(t,e)),this.mergeVertices()}function ca(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new An;var i=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),oa.call(this,i,e),this.type="TextBufferGeometry"}function ha(t,e,n,i,r,o,a){An.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new ua(t,e,n,i,r,o,a)),this.mergeVertices()}function ua(t,e,n,i,r,o,a){Mn.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,o=void 0!==o?o:0,a=void 0!==a?a:Math.PI;var s,l,c=Math.min(o+a,Math.PI),h=0,u=[],d=new ne,p=new ne,f=[],m=[],g=[],v=[];for(l=0;l<=n;l++){var y=[],b=l/n,x=0;for(0==l&&0==o?x=.5/e:l==n&&c==Math.PI&&(x=-.5/e),s=0;s<=e;s++){var w=s/e;d.x=-t*Math.cos(i+w*r)*Math.sin(o+b*a),d.y=t*Math.cos(o+b*a),d.z=t*Math.sin(i+w*r)*Math.sin(o+b*a),m.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),v.push(w+x,1-b),y.push(h++)}u.push(y)}for(l=0;l<n;l++)for(s=0;s<e;s++){var E=u[l][s+1],_=u[l][s],M=u[l+1][s],S=u[l+1][s+1];(0!==l||o>0)&&f.push(E,_,S),(l!==n-1||c<Math.PI)&&f.push(_,M,S)}this.setIndex(f),this.addAttribute("position",new gn(m,3)),this.addAttribute("normal",new gn(g,3)),this.addAttribute("uv",new gn(v,2))}function da(t,e,n,i,r,o){An.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new pa(t,e,n,i,r,o)),this.mergeVertices()}function pa(t,e,n,i,r,o){Mn.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},t=t||.5,e=e||1,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,l,c=[],h=[],u=[],d=[],p=t,f=(e-t)/(i=void 0!==i?Math.max(1,i):1),m=new ne,g=new te;for(s=0;s<=i;s++){for(l=0;l<=n;l++)a=r+l/n*o,m.x=p*Math.cos(a),m.y=p*Math.sin(a),h.push(m.x,m.y,m.z),u.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,d.push(g.x,g.y);p+=f}for(s=0;s<i;s++){var v=s*(n+1);for(l=0;l<n;l++){var y=a=l+v,b=a+n+1,x=a+n+2,w=a+1;c.push(y,b,w),c.push(b,x,w)}}this.setIndex(c),this.addAttribute("position",new gn(h,3)),this.addAttribute("normal",new gn(u,3)),this.addAttribute("uv",new gn(d,2))}function fa(t,e,n,i){An.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new ma(t,e,n,i)),this.mergeVertices()}function ma(t,e,n,i){Mn.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=$t.clamp(i,0,2*Math.PI);var r,o,a,s=[],l=[],c=[],h=1/e,u=new ne,d=new te;for(o=0;o<=e;o++){var p=n+o*h*i,f=Math.sin(p),m=Math.cos(p);for(a=0;a<=t.length-1;a++)u.x=t[a].x*f,u.y=t[a].y,u.z=t[a].x*m,l.push(u.x,u.y,u.z),d.x=o/e,d.y=a/(t.length-1),c.push(d.x,d.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){var g=r=a+o*t.length,v=r+t.length,y=r+t.length+1,b=r+1;s.push(g,v,b),s.push(v,y,b)}if(this.setIndex(s),this.addAttribute("position",new gn(l,3)),this.addAttribute("uv",new gn(c,2)),this.computeVertexNormals(),i===2*Math.PI){var x=this.attributes.normal.array,w=new ne,E=new ne,_=new ne;for(r=e*t.length*3,o=0,a=0;o<t.length;o++,a+=3)w.x=x[a+0],w.y=x[a+1],w.z=x[a+2],E.x=x[r+a+0],E.y=x[r+a+1],E.z=x[r+a+2],_.addVectors(w,E).normalize(),x[a+0]=x[r+a+0]=_.x,x[a+1]=x[r+a+1]=_.y,x[a+2]=x[r+a+2]=_.z}}function ga(t,e){An.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new va(t,e)),this.mergeVertices()}function va(t,e){Mn.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],i=[],r=[],o=[],a=0,s=0;if(!1===Array.isArray(t))c(t);else for(var l=0;l<t.length;l++)c(t[l]),this.addGroup(a,s,l),a+=s,s=0;function c(t){var a,l,c,h=i.length/3,u=t.extractPoints(e),d=u.shape,p=u.holes;for(!1===ea.isClockWise(d)&&(d=d.reverse()),a=0,l=p.length;a<l;a++)c=p[a],!0===ea.isClockWise(c)&&(p[a]=c.reverse());var f=ea.triangulateShape(d,p);for(a=0,l=p.length;a<l;a++)c=p[a],d=d.concat(c);for(a=0,l=d.length;a<l;a++){var m=d[a];i.push(m.x,m.y,0),r.push(0,0,1),o.push(m.x,m.y)}for(a=0,l=f.length;a<l;a++){var g=f[a],v=g[0]+h,y=g[1]+h,b=g[2]+h;n.push(v,y,b),s+=3}}this.setIndex(n),this.addAttribute("position",new gn(i,3)),this.addAttribute("normal",new gn(r,3)),this.addAttribute("uv",new gn(o,2))}function ya(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function ba(t,e){Mn.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,i,r,o,a=[],s=Math.cos($t.DEG2RAD*e),l=[0,0],c={},h=["a","b","c"];t.isBufferGeometry?(o=new An).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var u=o.vertices,d=o.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],g=0;g<3;g++)n=m[h[g]],i=m[h[(g+1)%3]],l[0]=Math.min(n,i),l[1]=Math.max(n,i),void 0===c[r=l[0]+","+l[1]]?c[r]={index1:l[0],index2:l[1],face1:p,face2:void 0}:c[r].face2=p;for(r in c){var v=c[r];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var y=u[v.index1];a.push(y.x,y.y,y.z),y=u[v.index2],a.push(y.x,y.y,y.z)}}this.addAttribute("position",new gn(a,3))}function xa(t,e,n,i,r,o,a,s){An.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new wa(t,e,n,i,r,o,a,s)),this.mergeVertices()}function wa(t,e,n,i,r,o,a,s){Mn.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s};var l=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,i=Math.floor(i)||8,r=Math.floor(r)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var c=[],h=[],u=[],d=[],p=0,f=[],m=n/2,g=0;function v(n){var r,o,f,v=new te,y=new ne,b=0,x=!0===n?t:e,w=!0===n?1:-1;for(o=p,r=1;r<=i;r++)h.push(0,m*w,0),u.push(0,w,0),d.push(.5,.5),p++;for(f=p,r=0;r<=i;r++){var E=r/i*s+a,_=Math.cos(E),M=Math.sin(E);y.x=x*M,y.y=m*w,y.z=x*_,h.push(y.x,y.y,y.z),u.push(0,w,0),v.x=.5*_+.5,v.y=.5*M*w+.5,d.push(v.x,v.y),p++}for(r=0;r<i;r++){var S=o+r,T=f+r;!0===n?c.push(T,T+1,S):c.push(T+1,T,S),b+=3}l.addGroup(g,b,!0===n?1:2),g+=b}!function(){var o,v,y=new ne,b=new ne,x=0,w=(e-t)/n;for(v=0;v<=r;v++){var E=[],_=v/r,M=_*(e-t)+t;for(o=0;o<=i;o++){var S=o/i,T=S*s+a,A=Math.sin(T),L=Math.cos(T);b.x=M*A,b.y=-_*n+m,b.z=M*L,h.push(b.x,b.y,b.z),y.set(A,w,L).normalize(),u.push(y.x,y.y,y.z),d.push(S,1-_),E.push(p++)}f.push(E)}for(o=0;o<i;o++)for(v=0;v<r;v++){var C=f[v][o],P=f[v+1][o],R=f[v+1][o+1],O=f[v][o+1];c.push(C,P,O),c.push(P,R,O),x+=6}l.addGroup(g,x,0),g+=x}(),!1===o&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.addAttribute("position",new gn(h,3)),this.addAttribute("normal",new gn(u,3)),this.addAttribute("uv",new gn(d,2))}function Ea(t,e,n,i,r,o,a){xa.call(this,0,t,e,n,i,r,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function _a(t,e,n,i,r,o,a){wa.call(this,0,t,e,n,i,r,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Ma(t,e,n,i){An.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new Sa(t,e,n,i)),this.mergeVertices()}function Sa(t,e,n,i){Mn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,o,a=[],s=[],l=[],c=[],h=new ne,u=new te;for(s.push(0,0,0),l.push(0,0,1),c.push(.5,.5),o=0,r=3;o<=e;o++,r+=3){var d=n+o/e*i;h.x=t*Math.cos(d),h.y=t*Math.sin(d),s.push(h.x,h.y,h.z),l.push(0,0,1),u.x=(s[r]/t+1)/2,u.y=(s[r+1]/t+1)/2,c.push(u.x,u.y)}for(r=1;r<=e;r++)a.push(r,r+1,0);this.setIndex(a),this.addAttribute("position",new gn(s,3)),this.addAttribute("normal",new gn(l,3)),this.addAttribute("uv",new gn(c,2))}la.prototype=Object.create(An.prototype),la.prototype.constructor=la,ca.prototype=Object.create(oa.prototype),ca.prototype.constructor=ca,ha.prototype=Object.create(An.prototype),ha.prototype.constructor=ha,ua.prototype=Object.create(Mn.prototype),ua.prototype.constructor=ua,da.prototype=Object.create(An.prototype),da.prototype.constructor=da,pa.prototype=Object.create(Mn.prototype),pa.prototype.constructor=pa,fa.prototype=Object.create(An.prototype),fa.prototype.constructor=fa,ma.prototype=Object.create(Mn.prototype),ma.prototype.constructor=ma,ga.prototype=Object.create(An.prototype),ga.prototype.constructor=ga,ga.prototype.toJSON=function(){var t=An.prototype.toJSON.call(this);return ya(this.parameters.shapes,t)},va.prototype=Object.create(Mn.prototype),va.prototype.constructor=va,va.prototype.toJSON=function(){var t=Mn.prototype.toJSON.call(this);return ya(this.parameters.shapes,t)},ba.prototype=Object.create(Mn.prototype),ba.prototype.constructor=ba,xa.prototype=Object.create(An.prototype),xa.prototype.constructor=xa,wa.prototype=Object.create(Mn.prototype),wa.prototype.constructor=wa,Ea.prototype=Object.create(xa.prototype),Ea.prototype.constructor=Ea,_a.prototype=Object.create(wa.prototype),_a.prototype.constructor=_a,Ma.prototype=Object.create(An.prototype),Ma.prototype.constructor=Ma,Sa.prototype=Object.create(Mn.prototype),Sa.prototype.constructor=Sa;var Ta=Object.freeze({WireframeGeometry:mo,ParametricGeometry:go,ParametricBufferGeometry:vo,TetrahedronGeometry:xo,TetrahedronBufferGeometry:wo,OctahedronGeometry:Eo,OctahedronBufferGeometry:_o,IcosahedronGeometry:Mo,IcosahedronBufferGeometry:So,DodecahedronGeometry:To,DodecahedronBufferGeometry:Ao,PolyhedronGeometry:yo,PolyhedronBufferGeometry:bo,TubeGeometry:Lo,TubeBufferGeometry:Co,TorusKnotGeometry:Po,TorusKnotBufferGeometry:Ro,TorusGeometry:Oo,TorusBufferGeometry:Io,TextGeometry:la,TextBufferGeometry:ca,SphereGeometry:ha,SphereBufferGeometry:ua,RingGeometry:da,RingBufferGeometry:pa,PlaneGeometry:Zn,PlaneBufferGeometry:Jn,LatheGeometry:fa,LatheBufferGeometry:ma,ShapeGeometry:ga,ShapeBufferGeometry:va,ExtrudeGeometry:ra,ExtrudeBufferGeometry:oa,EdgesGeometry:ba,ConeGeometry:Ea,ConeBufferGeometry:_a,CylinderGeometry:xa,CylinderBufferGeometry:wa,CircleGeometry:Ma,CircleBufferGeometry:Sa,BoxGeometry:Ln,BoxBufferGeometry:Cn});function Aa(t){an.call(this),this.type="ShadowMaterial",this.color=new $e(0),this.transparent=!0,this.setValues(t)}function La(t){In.call(this,t),this.type="RawShaderMaterial"}function Ca(t){an.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new $e(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new te(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Pa(t){Ca.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function Ra(t){an.call(this),this.type="MeshPhongMaterial",this.color=new $e(16777215),this.specular=new $e(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new te(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Oa(t){Ra.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function Ia(t){an.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new te(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Da(t){an.call(this),this.type="MeshLambertMaterial",this.color=new $e(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $e(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ka(t){an.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new $e(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new te(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(t)}function Na(t){ro.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Aa.prototype=Object.create(an.prototype),Aa.prototype.constructor=Aa,Aa.prototype.isShadowMaterial=!0,Aa.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.color.copy(t.color),this},La.prototype=Object.create(In.prototype),La.prototype.constructor=La,La.prototype.isRawShaderMaterial=!0,Ca.prototype=Object.create(an.prototype),Ca.prototype.constructor=Ca,Ca.prototype.isMeshStandardMaterial=!0,Ca.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Pa.prototype=Object.create(Ca.prototype),Pa.prototype.constructor=Pa,Pa.prototype.isMeshPhysicalMaterial=!0,Pa.prototype.copy=function(t){return Ca.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},Ra.prototype=Object.create(an.prototype),Ra.prototype.constructor=Ra,Ra.prototype.isMeshPhongMaterial=!0,Ra.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Oa.prototype=Object.create(Ra.prototype),Oa.prototype.constructor=Oa,Oa.prototype.isMeshToonMaterial=!0,Oa.prototype.copy=function(t){return Ra.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},Ia.prototype=Object.create(an.prototype),Ia.prototype.constructor=Ia,Ia.prototype.isMeshNormalMaterial=!0,Ia.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Da.prototype=Object.create(an.prototype),Da.prototype.constructor=Da,Da.prototype.isMeshLambertMaterial=!0,Da.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},ka.prototype=Object.create(an.prototype),ka.prototype.constructor=ka,ka.prototype.isMeshMatcapMaterial=!0,ka.prototype.copy=function(t){return an.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Na.prototype=Object.create(ro.prototype),Na.prototype.constructor=Na,Na.prototype.isLineDashedMaterial=!0,Na.prototype.copy=function(t){return ro.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var za=Object.freeze({ShadowMaterial:Aa,SpriteMaterial:Kr,RawShaderMaterial:La,ShaderMaterial:In,PointsMaterial:lo,MeshPhysicalMaterial:Pa,MeshStandardMaterial:Ca,MeshPhongMaterial:Ra,MeshToonMaterial:Oa,MeshNormalMaterial:Ia,MeshLambertMaterial:Da,MeshDepthMaterial:Lr,MeshDistanceMaterial:Cr,MeshBasicMaterial:sn,MeshMatcapMaterial:ka,LineDashedMaterial:Na,LineBasicMaterial:ro,Material:an}),Ba={arraySlice:function(t,e,n){return Ba.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),i=0;i!==e;++i)n[i]=i;return n.sort((function(e,n){return t[e]-t[n]})),n},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),o=0,a=0;a!==i;++o)for(var s=n[o]*e,l=0;l!==e;++l)r[a++]=t[s+l];return r},flattenJSON:function(t,e,n,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var a=o[i];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[i])&&(e.push(o.time),n.push.apply(n,a)),o=t[r++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[i])&&(e.push(o.time),a.toArray(n,n.length)),o=t[r++]}while(void 0!==o);else do{void 0!==(a=o[i])&&(e.push(o.time),n.push(a)),o=t[r++]}while(void 0!==o)}}};function Ha(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function Fa(t,e,n,i){Ha.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function ja(t,e,n,i){Ha.call(this,t,e,n,i)}function Ua(t,e,n,i){Ha.call(this,t,e,n,i)}function Ga(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Ba.convertArray(e,this.TimeBufferType),this.values=Ba.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function Va(t,e,n){Ga.call(this,t,e,n)}function Wa(t,e,n,i){Ga.call(this,t,e,n,i)}function Ya(t,e,n,i){Ga.call(this,t,e,n,i)}function Xa(t,e,n,i){Ha.call(this,t,e,n,i)}function qa(t,e,n,i){Ga.call(this,t,e,n,i)}function Za(t,e,n,i){Ga.call(this,t,e,n,i)}function Ja(t,e,n,i){Ga.call(this,t,e,n,i)}function Qa(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=$t.generateUUID(),this.duration<0&&this.resetDuration()}function Ka(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ya;case"vector":case"vector2":case"vector3":case"vector4":return Ja;case"color":return Wa;case"quaternion":return qa;case"bool":case"boolean":return Va;case"string":return Za}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],i=[];Ba.flattenJSON(t.keys,n,i,"value"),t.times=n,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(Ha.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{var o;n:{i:if(!(t<i)){for(var a=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,r)}if(n===a)break;if(r=i,t<(i=e[++n]))break e}o=e.length;break n}if(t>=r)break t;var s=e[1];for(t<s&&(n=2,r=s),a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(n===a)break;if(i=r,t>=(r=e[--n-1]))break e}o=n,n=0}for(;n<o;){var l=n+o>>>1;t<e[l]?o=l:n=l+1}if(i=e[n],void 0===(r=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,r,t)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i,o=0;o!==i;++o)e[o]=n[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Ha.prototype,{beforeStart_:Ha.prototype.copySampleValue_,afterEnd_:Ha.prototype.copySampleValue_}),Fa.prototype=Object.assign(Object.create(Ha.prototype),{constructor:Fa,DefaultSettings_:{endingStart:Xt,endingEnd:Xt},intervalChanged_:function(t,e,n){var i=this.parameterPositions,r=t-2,o=t+1,a=i[r],s=i[o];if(void 0===a)switch(this.getSettings_().endingStart){case qt:r=t,a=2*e-n;break;case Zt:a=e+i[r=i.length-2]-i[r+1];break;default:r=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case qt:o=t,s=2*n-e;break;case Zt:o=1,s=n+i[1]-i[0];break;default:o=t-1,s=e}var l=.5*(n-e),c=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(s-n),this._offsetPrev=r*c,this._offsetNext=o*c},interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=s-a,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(n-e)/(i-e),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,b=d*m-d*f,x=0;x!==a;++x)r[x]=g*o[c+x]+v*o[l+x]+y*o[s+x]+b*o[h+x];return r}}),ja.prototype=Object.assign(Object.create(Ha.prototype),{constructor:ja,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=s-a,c=(n-e)/(i-e),h=1-c,u=0;u!==a;++u)r[u]=o[l+u]*h+o[s+u]*c;return r}}),Ua.prototype=Object.assign(Object.create(Ha.prototype),{constructor:Ua,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Ga,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:Ba.convertArray(t.times,Array),values:Ba.convertArray(t.values,Array)};var i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}}),Object.assign(Ga.prototype,{constructor:Ga,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Wt,InterpolantFactoryMethodDiscrete:function(t){return new Ua(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new ja(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Fa(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case Vt:e=this.InterpolantFactoryMethodDiscrete;break;case Wt:e=this.InterpolantFactoryMethodLinear;break;case Yt:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Vt;case this.InterpolantFactoryMethodLinear:return Wt;case this.InterpolantFactoryMethodSmooth:return Yt}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,i=n.length,r=0,o=i-1;r!==i&&n[r]<t;)++r;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==r||o!==i){r>=o&&(r=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Ba.arraySlice(n,r,o),this.values=Ba.arraySlice(this.values,r*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==r;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==i&&Ba.isTypedArray(i)){a=0;for(var l=i.length;a!==l;++a){var c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),i=this.getInterpolation()===Yt,r=1,o=t.length-1,a=1;a<o;++a){var s=!1,l=t[a];if(l!==t[a+1]&&(1!==a||l!==l[0]))if(i)s=!0;else for(var c=a*n,h=c-n,u=c+n,d=0;d!==n;++d){var p=e[c+d];if(p!==e[h+d]||p!==e[u+d]){s=!0;break}}if(s){if(a!==r){t[r]=t[a];var f=a*n,m=r*n;for(d=0;d!==n;++d)e[m+d]=e[f+d]}++r}}if(o>0){for(t[r]=t[o],f=o*n,m=r*n,d=0;d!==n;++d)e[m+d]=e[f+d];++r}return r!==t.length&&(this.times=Ba.arraySlice(t,0,r),this.values=Ba.arraySlice(e,0,r*n)),this},clone:function(){var t=Ba.arraySlice(this.times,0),e=Ba.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Va.prototype=Object.assign(Object.create(Ga.prototype),{constructor:Va,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Vt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Wa.prototype=Object.assign(Object.create(Ga.prototype),{constructor:Wa,ValueTypeName:"color"}),Ya.prototype=Object.assign(Object.create(Ga.prototype),{constructor:Ya,ValueTypeName:"number"}),Xa.prototype=Object.assign(Object.create(Ha.prototype),{constructor:Xa,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=(n-e)/(i-e),c=s+a;s!==c;s+=4)ee.slerpFlat(r,0,o,s-a,o,s,l);return r}}),qa.prototype=Object.assign(Object.create(Ga.prototype),{constructor:qa,ValueTypeName:"quaternion",DefaultInterpolation:Wt,InterpolantFactoryMethodLinear:function(t){return new Xa(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Za.prototype=Object.assign(Object.create(Ga.prototype),{constructor:Za,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Vt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ja.prototype=Object.assign(Object.create(Ga.prototype),{constructor:Ja,ValueTypeName:"vector"}),Object.assign(Qa,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,o=n.length;r!==o;++r)e.push(Ka(n[r]).scale(i));return new Qa(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,o=n.length;r!==o;++r)e.push(Ga.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,o=[],a=0;a<r;a++){var s=[],l=[];s.push((a+r-1)%r,a,(a+1)%r),l.push(0,1,0);var c=Ba.getKeyframeOrder(s);s=Ba.sortedArray(s,1,c),l=Ba.sortedArray(l,1,c),i||0!==s[0]||(s.push(r),l.push(l[0])),o.push(new Ya(".morphTargetInfluences["+e[a].name+"]",s,l).scale(1/n))}return new Qa(t,-1,o)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){var i=t;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],l=s.name.match(r);if(l&&l.length>1){var c=i[u=l[1]];c||(i[u]=c=[]),c.push(s)}}var h=[];for(var u in i)h.push(Qa.CreateFromMorphTargetSequence(u,i[u],e,n));return h},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){if(0!==n.length){var o=[],a=[];Ba.flattenJSON(n,o,a,i),0!==o.length&&r.push(new t(e,o,a))}},i=[],r=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],l=0;l<s.length;l++){var c=s[l].keys;if(c&&0!==c.length)if(c[0].morphTargets){for(var h={},u=0;u<c.length;u++)if(c[u].morphTargets)for(var d=0;d<c[u].morphTargets.length;d++)h[c[u].morphTargets[d]]=-1;for(var p in h){var f=[],m=[];for(d=0;d!==c[u].morphTargets.length;++d){var g=c[u];f.push(g.time),m.push(g.morphTarget===p?1:0)}i.push(new Ya(".morphTargetInfluence["+p+"]",f,m))}o=h.length*(a||1)}else{var v=".bones["+e[l].name+"]";n(Ja,v+".position",c,"pos",i),n(qa,v+".quaternion",c,"rot",i),n(Ja,v+".scale",c,"scl",i)}}return 0===i.length?null:new Qa(r,o,i)}}),Object.assign(Qa.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new Qa(this.name,this.duration,t)}});var $a={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function ts(t,e,n){var i=this,r=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,a),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,a),o===a&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}var es=new ts,ns={};function is(t){this.manager=void 0!==t?t:es}function rs(t){this.manager=void 0!==t?t:es}function os(t){this.manager=void 0!==t?t:es,this._parser=null}function as(t){this.manager=void 0!==t?t:es,this._parser=null}function ss(t){this.manager=void 0!==t?t:es}function ls(t){this.manager=void 0!==t?t:es}function cs(t){this.manager=void 0!==t?t:es}function hs(){this.type="Curve",this.arcLengthDivisions=200}function us(t,e,n,i,r,o,a,s){hs.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function ds(t,e,n,i,r,o){us.call(this,t,e,n,n,i,r,o),this.type="ArcCurve"}function ps(){var t=0,e=0,n=0,i=0;function r(r,o,a,s){t=r,e=a,n=-3*r+3*o-2*a-s,i=2*r-2*o+a+s}return{initCatmullRom:function(t,e,n,i,o){r(e,n,o*(n-t),o*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,o,a,s){var l=(e-t)/o-(n-t)/(o+a)+(n-e)/a,c=(n-e)/a-(i-e)/(a+s)+(i-n)/s;r(e,n,l*=a,c*=a)},calc:function(r){var o=r*r;return t+e*r+n*o+i*(o*r)}}}Object.assign(is.prototype,{load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=$a.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;if(void 0===ns[t]){var a=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],l=!!a[2],c=a[3];c=decodeURIComponent(c),l&&(c=atob(c));try{var h,u=(this.responseType||"").toLowerCase();switch(u){case"arraybuffer":case"blob":for(var d=new Uint8Array(c.length),p=0;p<c.length;p++)d[p]=c.charCodeAt(p);h="blob"===u?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;h=f.parseFromString(c,s);break;case"json":h=JSON.parse(c);break;default:h=c}setTimeout((function(){e&&e(h),r.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}),0)}}else{ns[t]=[],ns[t].push({onLoad:e,onProgress:n,onError:i});var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",(function(e){var n=this.response;$a.add(t,n);var i=ns[t];if(delete ns[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var o=0,a=i.length;o<a;o++)(s=i[o]).onLoad&&s.onLoad(n);r.manager.itemEnd(t)}else{for(o=0,a=i.length;o<a;o++){var s;(s=i[o]).onError&&s.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}}),!1),m.addEventListener("progress",(function(e){for(var n=ns[t],i=0,r=n.length;i<r;i++){var o=n[i];o.onProgress&&o.onProgress(e)}}),!1),m.addEventListener("error",(function(e){var n=ns[t];delete ns[t];for(var i=0,o=n.length;i<o;i++){var a=n[i];a.onError&&a.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),m.addEventListener("abort",(function(e){var n=ns[t];delete ns[t];for(var i=0,o=n.length;i<o;i++){var a=n[i];a.onError&&a.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return r.manager.itemStart(t),m}ns[t].push({onLoad:e,onProgress:n,onError:i})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(rs.prototype,{load:function(t,e,n,i){var r=this,o=new is(r.manager);o.setPath(r.path),o.load(t,(function(t){e(r.parse(JSON.parse(t)))}),n,i)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var i=Qa.parse(t[n]);e.push(i)}return e},setPath:function(t){return this.path=t,this}}),Object.assign(os.prototype,{load:function(t,e,n,i){var r=this,o=[],a=new uo;a.image=o;var s=new is(this.manager);function l(l){s.load(t[l],(function(t){var n=r._parser(t,!0);o[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(a.minFilter=_t),a.format=n.format,a.needsUpdate=!0,e&&e(a))}),n,i)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var c=0,h=0,u=t.length;h<u;++h)l(h);else s.load(t,(function(t){var n=r._parser(t,!0);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,s=0;s<i;s++){o[s]={mipmaps:[]};for(var l=0;l<n.mipmapCount;l++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+l]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=_t),a.format=n.format,a.needsUpdate=!0,e&&e(a)}),n,i);return a},setPath:function(t){return this.path=t,this}}),Object.assign(as.prototype,{load:function(t,e,n,i){var r=this,o=new jn,a=new is(this.manager);return a.setResponseType("arraybuffer"),a.setPath(this.path),a.load(t,(function(t){var n=r._parser(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:yt,o.wrapT=void 0!==n.wrapT?n.wrapT:yt,o.magFilter=void 0!==n.magFilter?n.magFilter:_t,o.minFilter=void 0!==n.minFilter?n.minFilter:St,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps),1===n.mipmapCount&&(o.minFilter=_t),o.needsUpdate=!0,e&&e(o,n))}),n,i),o},setPath:function(t){return this.path=t,this}}),Object.assign(ss.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=$a.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),$a.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}return a.addEventListener("load",s,!1),a.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(ls.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){var r=new li,o=new ss(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(t[n],(function(t){r.images[n]=t,6==++a&&(r.needsUpdate=!0,e&&e(r))}),void 0,i)}for(var l=0;l<t.length;++l)s(l);return r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(cs.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){var r=new me,o=new ss(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(n){r.image=n;var i=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=i?Ot:It,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(hs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,i=[],r=this.getPoint(0),o=0;for(i.push(0),n=1;n<=t;n++)o+=(e=this.getPoint(n/t)).distanceTo(r),i.push(o),r=e;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,o=i.length;n=e||t*i[o-1];for(var a,s=0,l=o-1;s<=l;)if((a=i[r=Math.floor(s+(l-s)/2)]-n)<0)s=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(i[r=l]===n)return r/(o-1);var c=i[r];return(r+(n-c)/(i[r+1]-c))/(o-1)},getTangent:function(t){var e=1e-4,n=t-e,i=t+e;n<0&&(n=0),i>1&&(i=1);var r=this.getPoint(n);return this.getPoint(i).clone().sub(r).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,i,r,o=new ne,a=[],s=[],l=[],c=new ne,h=new be;for(n=0;n<=t;n++)i=n/t,a[n]=this.getTangentAt(i),a[n].normalize();s[0]=new ne,l[0]=new ne;var u=Number.MAX_VALUE,d=Math.abs(a[0].x),p=Math.abs(a[0].y),f=Math.abs(a[0].z);for(d<=u&&(u=d,o.set(1,0,0)),p<=u&&(u=p,o.set(0,1,0)),f<=u&&o.set(0,0,1),c.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],c),l[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),c.crossVectors(a[n-1],a[n]),c.length()>Number.EPSILON&&(c.normalize(),r=Math.acos($t.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(h.makeRotationAxis(c,r))),l[n].crossVectors(a[n],s[n]);if(!0===e)for(r=Math.acos($t.clamp(s[0].dot(s[t]),-1,1)),r/=t,a[0].dot(c.crossVectors(s[0],s[t]))>0&&(r=-r),n=1;n<=t;n++)s[n].applyMatrix4(h.makeRotationAxis(a[n],r*n)),l[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),us.prototype=Object.create(hs.prototype),us.prototype.constructor=us,us.prototype.isEllipseCurve=!0,us.prototype.getPoint=function(t,e){for(var n=e||new te,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);var a=this.aStartAngle+t*r,s=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),h=Math.sin(this.aRotation),u=s-this.aX,d=l-this.aY;s=u*c-d*h+this.aX,l=u*h+d*c+this.aY}return n.set(s,l)},us.prototype.copy=function(t){return hs.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},us.prototype.toJSON=function(){var t=hs.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},us.prototype.fromJSON=function(t){return hs.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},ds.prototype=Object.create(us.prototype),ds.prototype.constructor=ds,ds.prototype.isArcCurve=!0;var fs=new ne,ms=new ps,gs=new ps,vs=new ps;function ys(t,e,n,i){hs.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=i||.5}function bs(t,e,n,i,r){var o=.5*(i-e),a=.5*(r-n),s=t*t;return(2*n-2*i+o+a)*(t*s)+(-3*n+3*i-2*o-a)*s+o*t+n}function xs(t,e,n,i){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}function ws(t,e,n,i,r){return function(t,e){var n=1-t;return n*n*n*e}(t,e)+function(t,e){var n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,i)+function(t,e){return t*t*t*e}(t,r)}function Es(t,e,n,i){hs.call(this),this.type="CubicBezierCurve",this.v0=t||new te,this.v1=e||new te,this.v2=n||new te,this.v3=i||new te}function _s(t,e,n,i){hs.call(this),this.type="CubicBezierCurve3",this.v0=t||new ne,this.v1=e||new ne,this.v2=n||new ne,this.v3=i||new ne}function Ms(t,e){hs.call(this),this.type="LineCurve",this.v1=t||new te,this.v2=e||new te}function Ss(t,e){hs.call(this),this.type="LineCurve3",this.v1=t||new ne,this.v2=e||new ne}function Ts(t,e,n){hs.call(this),this.type="QuadraticBezierCurve",this.v0=t||new te,this.v1=e||new te,this.v2=n||new te}function As(t,e,n){hs.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new ne,this.v1=e||new ne,this.v2=n||new ne}function Ls(t){hs.call(this),this.type="SplineCurve",this.points=t||[]}ys.prototype=Object.create(hs.prototype),ys.prototype.constructor=ys,ys.prototype.isCatmullRomCurve3=!0,ys.prototype.getPoint=function(t,e){var n,i,r,o,a=e||new ne,s=this.points,l=s.length,c=(l-(this.closed?0:1))*t,h=Math.floor(c),u=c-h;if(this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/l)+1)*l:0===u&&h===l-1&&(h=l-2,u=1),this.closed||h>0?n=s[(h-1)%l]:(fs.subVectors(s[0],s[1]).add(s[0]),n=fs),i=s[h%l],r=s[(h+1)%l],this.closed||h+2<l?o=s[(h+2)%l]:(fs.subVectors(s[l-1],s[l-2]).add(s[l-1]),o=fs),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(i),d),f=Math.pow(i.distanceToSquared(r),d),m=Math.pow(r.distanceToSquared(o),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),ms.initNonuniformCatmullRom(n.x,i.x,r.x,o.x,p,f,m),gs.initNonuniformCatmullRom(n.y,i.y,r.y,o.y,p,f,m),vs.initNonuniformCatmullRom(n.z,i.z,r.z,o.z,p,f,m)}else"catmullrom"===this.curveType&&(ms.initCatmullRom(n.x,i.x,r.x,o.x,this.tension),gs.initCatmullRom(n.y,i.y,r.y,o.y,this.tension),vs.initCatmullRom(n.z,i.z,r.z,o.z,this.tension));return a.set(ms.calc(u),gs.calc(u),vs.calc(u)),a},ys.prototype.copy=function(t){hs.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},ys.prototype.toJSON=function(){var t=hs.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},ys.prototype.fromJSON=function(t){hs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new ne).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Es.prototype=Object.create(hs.prototype),Es.prototype.constructor=Es,Es.prototype.isCubicBezierCurve=!0,Es.prototype.getPoint=function(t,e){var n=e||new te,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(ws(t,i.x,r.x,o.x,a.x),ws(t,i.y,r.y,o.y,a.y)),n},Es.prototype.copy=function(t){return hs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Es.prototype.toJSON=function(){var t=hs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Es.prototype.fromJSON=function(t){return hs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},_s.prototype=Object.create(hs.prototype),_s.prototype.constructor=_s,_s.prototype.isCubicBezierCurve3=!0,_s.prototype.getPoint=function(t,e){var n=e||new ne,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(ws(t,i.x,r.x,o.x,a.x),ws(t,i.y,r.y,o.y,a.y),ws(t,i.z,r.z,o.z,a.z)),n},_s.prototype.copy=function(t){return hs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},_s.prototype.toJSON=function(){var t=hs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},_s.prototype.fromJSON=function(t){return hs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Ms.prototype=Object.create(hs.prototype),Ms.prototype.constructor=Ms,Ms.prototype.isLineCurve=!0,Ms.prototype.getPoint=function(t,e){var n=e||new te;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Ms.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Ms.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Ms.prototype.copy=function(t){return hs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ms.prototype.toJSON=function(){var t=hs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ms.prototype.fromJSON=function(t){return hs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ss.prototype=Object.create(hs.prototype),Ss.prototype.constructor=Ss,Ss.prototype.isLineCurve3=!0,Ss.prototype.getPoint=function(t,e){var n=e||new ne;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Ss.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Ss.prototype.copy=function(t){return hs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ss.prototype.toJSON=function(){var t=hs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ss.prototype.fromJSON=function(t){return hs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ts.prototype=Object.create(hs.prototype),Ts.prototype.constructor=Ts,Ts.prototype.isQuadraticBezierCurve=!0,Ts.prototype.getPoint=function(t,e){var n=e||new te,i=this.v0,r=this.v1,o=this.v2;return n.set(xs(t,i.x,r.x,o.x),xs(t,i.y,r.y,o.y)),n},Ts.prototype.copy=function(t){return hs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ts.prototype.toJSON=function(){var t=hs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ts.prototype.fromJSON=function(t){return hs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},As.prototype=Object.create(hs.prototype),As.prototype.constructor=As,As.prototype.isQuadraticBezierCurve3=!0,As.prototype.getPoint=function(t,e){var n=e||new ne,i=this.v0,r=this.v1,o=this.v2;return n.set(xs(t,i.x,r.x,o.x),xs(t,i.y,r.y,o.y),xs(t,i.z,r.z,o.z)),n},As.prototype.copy=function(t){return hs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},As.prototype.toJSON=function(){var t=hs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},As.prototype.fromJSON=function(t){return hs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ls.prototype=Object.create(hs.prototype),Ls.prototype.constructor=Ls,Ls.prototype.isSplineCurve=!0,Ls.prototype.getPoint=function(t,e){var n=e||new te,i=this.points,r=(i.length-1)*t,o=Math.floor(r),a=r-o,s=i[0===o?o:o-1],l=i[o],c=i[o>i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bs(a,s.x,l.x,c.x,h.x),bs(a,s.y,l.y,c.y,h.y)),n},Ls.prototype.copy=function(t){hs.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this},Ls.prototype.toJSON=function(){var t=hs.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t},Ls.prototype.fromJSON=function(t){hs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new te).fromArray(i))}return this};var Cs=Object.freeze({ArcCurve:ds,CatmullRomCurve3:ys,CubicBezierCurve:Es,CubicBezierCurve3:_s,EllipseCurve:us,LineCurve:Ms,LineCurve3:Ss,QuadraticBezierCurve:Ts,QuadraticBezierCurve3:As,SplineCurve:Ls});function Ps(){hs.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Rs(t){Ps.call(this),this.type="Path",this.currentPoint=new te,t&&this.setFromPoints(t)}function Os(t){Rs.call(this,t),this.uuid=$t.generateUUID(),this.type="Shape",this.holes=[]}function Is(t,e){Ge.call(this),this.type="Light",this.color=new $e(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Ds(t,e,n){Is.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Ge.DefaultUp),this.updateMatrix(),this.groundColor=new $e(e)}function ks(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new te(512,512),this.map=null,this.matrix=new be}function Ns(){ks.call(this,new kn(50,1,.5,500))}function zs(t,e,n,i,r,o){Is.call(this,t,e),this.type="SpotLight",this.position.copy(Ge.DefaultUp),this.updateMatrix(),this.target=new Ge,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new Ns}function Bs(t,e,n,i){Is.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new ks(new kn(90,1,.5,500))}function Hs(t,e,n,i,r,o){Dn.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function Fs(){ks.call(this,new Hs(-5,5,5,-5,.5,500))}function js(t,e){Is.call(this,t,e),this.type="DirectionalLight",this.position.copy(Ge.DefaultUp),this.updateMatrix(),this.target=new Ge,this.shadow=new Fs}function Us(t,e){Is.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Gs(t,e,n,i){Is.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function Vs(t){this.manager=void 0!==t?t:es,this.textures={}}Ps.prototype=Object.assign(Object.create(hs.prototype),{constructor:Ps,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Ms(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=e){var r=n[i]-e,o=this.curves[i],a=o.getLength(),s=0===a?0:1-r/a;return o.getPointAt(s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),l=0;l<s.length;l++){var c=s[l];e&&e.equals(c)||(n.push(c),e=c)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){hs.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=hs.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){hs.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push((new Cs[i.type]).fromJSON(i))}return this}}),Rs.prototype=Object.assign(Object.create(Ps.prototype),{constructor:Rs,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new Ms(this.currentPoint.clone(),new te(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,i){var r=new Ts(this.currentPoint.clone(),new te(t,e),new te(n,i));this.curves.push(r),this.currentPoint.set(n,i)},bezierCurveTo:function(t,e,n,i,r,o){var a=new Es(this.currentPoint.clone(),new te(t,e),new te(n,i),new te(r,o));this.curves.push(a),this.currentPoint.set(r,o)},splineThru:function(t){var e=new Ls([this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,n,i,r,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+a,e+s,n,i,r,o)},absarc:function(t,e,n,i,r,o){this.absellipse(t,e,n,n,i,r,o)},ellipse:function(t,e,n,i,r,o,a,s){var l=this.currentPoint.x,c=this.currentPoint.y;this.absellipse(t+l,e+c,n,i,r,o,a,s)},absellipse:function(t,e,n,i,r,o,a,s){var l=new us(t,e,n,i,r,o,a,s);if(this.curves.length>0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var h=l.getPoint(1);this.currentPoint.copy(h)},copy:function(t){return Ps.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Ps.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Ps.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Os.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Os,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Rs.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){var t=Rs.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){Rs.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push((new Rs).fromJSON(i))}return this}}),Is.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Is,isLight:!0,copy:function(t){return Ge.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Ge.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Ds.prototype=Object.assign(Object.create(Is.prototype),{constructor:Ds,isHemisphereLight:!0,copy:function(t){return Is.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(ks.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Ns.prototype=Object.assign(Object.create(ks.prototype),{constructor:Ns,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*$t.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix())}}),zs.prototype=Object.assign(Object.create(Is.prototype),{constructor:zs,isSpotLight:!0,copy:function(t){return Is.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Bs.prototype=Object.assign(Object.create(Is.prototype),{constructor:Bs,isPointLight:!0,copy:function(t){return Is.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Hs.prototype=Object.assign(Object.create(Dn.prototype),{constructor:Hs,isOrthographicCamera:!0,copy:function(t,e){return Dn.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-t,o=n+t,a=i+e,s=i-e;if(null!==this.view&&this.view.enabled){var l=this.zoom/(this.view.width/this.view.fullWidth),c=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;o=(r+=h*(this.view.offsetX/l))+h*(this.view.width/l),s=(a-=u*(this.view.offsetY/c))-u*(this.view.height/c)}this.projectionMatrix.makeOrthographic(r,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Ge.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Fs.prototype=Object.assign(Object.create(ks.prototype),{constructor:Fs}),js.prototype=Object.assign(Object.create(Is.prototype),{constructor:js,isDirectionalLight:!0,copy:function(t){return Is.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Us.prototype=Object.assign(Object.create(Is.prototype),{constructor:Us,isAmbientLight:!0}),Gs.prototype=Object.assign(Object.create(Is.prototype),{constructor:Gs,isRectAreaLight:!0,copy:function(t){return Is.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=Is.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(Vs.prototype,{load:function(t,e,n,i){var r=this,o=new is(r.manager);o.setPath(r.path),o.load(t,(function(t){e(r.parse(JSON.parse(t)))}),n,i)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var i=new za[t.type];if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&i.specular.setHex(t.specular),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearCoat&&(i.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(i.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.vertexColors&&(i.vertexColors=t.vertexColors),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(i.skinning=t.skinning),void 0!==t.morphTargets&&(i.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(i.morphNormals=t.morphNormals),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.uniforms)for(var r in t.uniforms){var o=t.uniforms[r];switch(i.uniforms[r]={},o.type){case"t":i.uniforms[r].value=n(o.value);break;case"c":i.uniforms[r].value=(new $e).setHex(o.value);break;case"v2":i.uniforms[r].value=(new te).fromArray(o.value);break;case"v3":i.uniforms[r].value=(new ne).fromArray(o.value);break;case"v4":i.uniforms[r].value=(new ge).fromArray(o.value);break;case"m3":i.uniforms[r].value=(new ie).fromArray(o.value);case"m4":i.uniforms[r].value=(new be).fromArray(o.value);break;default:i.uniforms[r].value=o.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var a in t.extensions)i.extensions[a]=t.extensions[a];if(void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap),i.transparent=!0),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),i.normalScale=(new te).fromArray(s)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),i},setPath:function(t){return this.path=t,this},setTextures:function(t){return this.textures=t,this}});var Ws={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function Ys(){Mn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Xs(t,e,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),ln.call(this,t,e,n),this.meshPerAttribute=i||1}function qs(t){this.manager=void 0!==t?t:es}Ys.prototype=Object.assign(Object.create(Mn.prototype),{constructor:Ys,isInstancedBufferGeometry:!0,copy:function(t){return Mn.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=Mn.prototype.toJSON.call(this);return t.maxInstancedCount=this.maxInstancedCount,t.isInstancedBufferGeometry=!0,t}}),Xs.prototype=Object.assign(Object.create(ln.prototype),{constructor:Xs,isInstancedBufferAttribute:!0,copy:function(t){return ln.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=ln.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),Object.assign(qs.prototype,{load:function(t,e,n,i){var r=this,o=new is(r.manager);o.setPath(r.path),o.load(t,(function(t){e(r.parse(JSON.parse(t)))}),n,i)},parse:function(t){var e=t.isInstancedBufferGeometry?new Ys:new Mn,n=t.data.index;if(void 0!==n){var i=new Zs[n.type](n.array);e.setIndex(new ln(i,1))}var r=t.data.attributes;for(var o in r){var a=r[o],s=(i=new Zs[a.type](a.array),new(a.isInstancedBufferAttribute?Xs:ln)(i,a.itemSize,a.normalized));void 0!==a.name&&(s.name=a.name),e.addAttribute(o,s)}var l=t.data.morphAttributes;if(l)for(var o in l){for(var c=l[o],h=[],u=0,d=c.length;u<d;u++)a=c[u],s=new ln(i=new Zs[a.type](a.array),a.itemSize,a.normalized),void 0!==a.name&&(s.name=a.name),h.push(s);e.morphAttributes[o]=h}var p=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==p){u=0;for(var f=p.length;u!==f;++u){var m=p[u];e.addGroup(m.start,m.count,m.materialIndex)}}var g=t.data.boundingSphere;if(void 0!==g){var v=new ne;void 0!==g.center&&v.fromArray(g.center),e.boundingSphere=new Ye(v,g.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e},setPath:function(t){return this.path=t,this}});var Zs={Int8Array,Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Js(t){this.manager=void 0!==t?t:es,this.resourcePath=""}Object.assign(Js.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){var r=this,o=void 0===this.path?Ws.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;var a=new is(r.manager);a.setPath(this.path),a.load(t,(function(n){var o=null;try{o=JSON.parse(n)}catch(e){return void 0!==i&&i(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?r.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t)}),n,i)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){var n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),r=this.parseImages(t.images,(function(){void 0!==e&&e(s)})),o=this.parseTextures(t.textures,r),a=this.parseMaterials(t.materials,o),s=this.parseObject(t.object,i,a);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,i=t.length;n<i;n++){var r=(new Os).fromJSON(t[n]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var i=new qs,r=0,o=t.length;r<o;r++){var a,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new Ta[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new Ta[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new Ta[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new Ta[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new Ta[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new Ta[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":a=new Ta[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new Ta[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new Ta[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new Ta[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":a=new Ta[s.type]((new Cs[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":a=new Ta[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":a=new Ta[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],c=0,h=s.shapes.length;c<h;c++){var u=e[s.shapes[c]];l.push(u)}a=new Ta[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],c=0,h=s.shapes.length;c<h;c++)u=e[s.shapes[c]],l.push(u);var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new Cs[d.type]).fromJSON(d)),a=new Ta[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(s);break;case"Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?a=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),!0===a.isBufferGeometry&&void 0!==s.userData&&(a.userData=s.userData),n[s.uuid]=a}return n},parseMaterials:function(t,e){var n={},i={};if(void 0!==t){var r=new Vs;r.setTextures(e);for(var o=0,a=t.length;o<a;o++){var s=t[o];if("MultiMaterial"===s.type){for(var l=[],c=0;c<s.materials.length;c++){var h=s.materials[c];void 0===n[h.uuid]&&(n[h.uuid]=r.parse(h)),l.push(n[h.uuid])}i[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n],r=Qa.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),e.push(r)}return e},parseImages:function(t,e){var n=this,i={};function r(t){return n.manager.itemStart(t),o.load(t,(function(){n.manager.itemEnd(t)}),void 0,(function(){n.manager.itemError(t),n.manager.itemEnd(t)}))}if(void 0!==t&&t.length>0){var o=new ss(new ts(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var l=t[a],c=l.url;if(Array.isArray(c)){i[l.uuid]=[];for(var h=0,u=c.length;h<u;h++){var d=c[h],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;i[l.uuid].push(r(p))}}else p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url,i[l.uuid]=r(p)}}return i},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var i={};if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var a,s=t[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(a=Array.isArray(e[s.image])?new li(e[s.image]):new me(e[s.image])).needsUpdate=!0,a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=n(s.mapping,nl)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=n(s.wrap[0],il),a.wrapT=n(s.wrap[1],il)),void 0!==s.format&&(a.format=s.format),void 0!==s.type&&(a.type=s.type),void 0!==s.encoding&&(a.encoding=s.encoding),void 0!==s.minFilter&&(a.minFilter=n(s.minFilter,rl)),void 0!==s.magFilter&&(a.magFilter=n(s.magFilter,rl)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(a.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(a.unpackAlignment=s.unpackAlignment),i[s.uuid]=a}return i},parseObject:function(t,e,n){var i;function r(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function o(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],i=0,r=t.length;i<r;i++){var o=t[i];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),e.push(n[o])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":i=new Ve,void 0!==t.background&&Number.isInteger(t.background)&&(i.background=new $e(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?i.fog=new Zr(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(i.fog=new qr(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":i=new kn(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(i.focus=t.focus),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.filmGauge&&(i.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(i.filmOffset=t.filmOffset),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"OrthographicCamera":i=new Hs(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"AmbientLight":i=new Us(t.color,t.intensity);break;case"DirectionalLight":i=new js(t.color,t.intensity);break;case"PointLight":i=new Bs(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":i=new Gs(t.color,t.intensity,t.width,t.height);break;case"SpotLight":i=new zs(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":i=new Ds(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var a=r(t.geometry),s=o(t.material);i=a.bones&&a.bones.length>0?new eo(a,s):new Sn(a,s),void 0!==t.drawMode&&i.setDrawMode(t.drawMode);break;case"LOD":i=new to;break;case"Line":i=new oo(r(t.geometry),o(t.material),t.mode);break;case"LineLoop":i=new so(r(t.geometry),o(t.material));break;case"LineSegments":i=new ao(r(t.geometry),o(t.material));break;case"PointCloud":case"Points":i=new co(r(t.geometry),o(t.material));break;case"Sprite":i=new $r(o(t.material));break;case"Group":i=new Dr;break;default:i=new Ge}if(i.uuid=t.uuid,void 0!==t.name&&(i.name=t.name),void 0!==t.matrix?(i.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(i.matrixAutoUpdate=t.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==t.position&&i.position.fromArray(t.position),void 0!==t.rotation&&i.rotation.fromArray(t.rotation),void 0!==t.quaternion&&i.quaternion.fromArray(t.quaternion),void 0!==t.scale&&i.scale.fromArray(t.scale)),void 0!==t.castShadow&&(i.castShadow=t.castShadow),void 0!==t.receiveShadow&&(i.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(i.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(i.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&i.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(i.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.frustumCulled&&(i.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(i.renderOrder=t.renderOrder),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.layers&&(i.layers.mask=t.layers),void 0!==t.children)for(var l=t.children,c=0;c<l.length;c++)i.add(this.parseObject(l[c],e,n));if("LOD"===t.type)for(var h=t.levels,u=0;u<h.length;u++){var d=h[u],p=i.getObjectByProperty("uuid",d.object);void 0!==p&&i.addLevel(p,d.distance)}return i}});var Qs,Ks,$s,tl,el,nl={UVMapping:ut,CubeReflectionMapping:dt,CubeRefractionMapping:pt,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:ft,SphericalReflectionMapping:305,CubeUVReflectionMapping:mt,CubeUVRefractionMapping:gt},il={RepeatWrapping:vt,ClampToEdgeWrapping:yt,MirroredRepeatWrapping:bt},rl={NearestFilter:xt,NearestMipmapNearestFilter:wt,NearestMipmapLinearFilter:Et,LinearFilter:_t,LinearMipmapNearestFilter:Mt,LinearMipmapLinearFilter:St};function ol(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==t?t:es,this.options=void 0}function al(){this.type="ShapePath",this.color=new $e,this.subPaths=[],this.currentPath=null}function sl(t){this.type="Font",this.data=t}function ll(t,e,n,i,r){var o=r.glyphs[t]||r.glyphs["?"];if(o){var a,s,l,c,h,u,d,p,f=new al;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),g=0,v=m.length;g<v;)switch(m[g++]){case"m":a=m[g++]*e+n,s=m[g++]*e+i,f.moveTo(a,s);break;case"l":a=m[g++]*e+n,s=m[g++]*e+i,f.lineTo(a,s);break;case"q":l=m[g++]*e+n,c=m[g++]*e+i,h=m[g++]*e+n,u=m[g++]*e+i,f.quadraticCurveTo(h,u,l,c);break;case"b":l=m[g++]*e+n,c=m[g++]*e+i,h=m[g++]*e+n,u=m[g++]*e+i,d=m[g++]*e+n,p=m[g++]*e+i,f.bezierCurveTo(h,u,d,p,l,c)}return{offsetX:o.ha*e,path:f}}console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".")}function cl(t){this.manager=void 0!==t?t:es}function hl(){}ol.prototype={constructor:ol,setOptions:function(t){return this.options=t,this},load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=$a.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;fetch(t).then((function(t){return t.blob()})).then((function(t){return void 0===r.options?createImageBitmap(t):createImageBitmap(t,r.options)})).then((function(n){$a.add(t,n),e&&e(n),r.manager.itemEnd(t)})).catch((function(e){i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)})),r.manager.itemStart(t)},setCrossOrigin:function(){return this},setPath:function(t){return this.path=t,this}},Object.assign(al.prototype,{moveTo:function(t,e){this.currentPath=new Rs,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,n,i){this.currentPath.quadraticCurveTo(t,e,n,i)},bezierCurveTo:function(t,e,n,i,r,o){this.currentPath.bezierCurveTo(t,e,n,i,r,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function n(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n],o=new Os;o.curves=r.curves,e.push(o)}return e}function i(t,e){for(var n=e.length,i=!1,r=n-1,o=0;o<n;r=o++){var a=e[r],s=e[o],l=s.x-a.x,c=s.y-a.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(a=e[o],l=-l,s=e[r],c=-c),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var h=c*(t.x-a.x)-l*(t.y-a.y);if(0===h)return!0;if(h<0)continue;i=!i}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return i}var r=ea.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,l,c=[];if(1===o.length)return s=o[0],(l=new Os).curves=s.curves,c.push(l),c;var h=!r(o[0].getPoints());h=t?!h:h;var u,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=o.length;v<y;v++)a=r(u=(s=o[v]).getPoints()),(a=t?!a:a)?(!h&&f[g]&&g++,f[g]={s:new Os,p:u},f[g].s.curves=s.curves,h&&g++,m[g]=[]):m[g].push({h:s,p:u[0]});if(!f[0])return n(o);if(f.length>1){for(var b=!1,x=[],w=0,E=f.length;w<E;w++)p[w]=[];for(w=0,E=f.length;w<E;w++)for(var _=m[w],M=0;M<_.length;M++){for(var S=_[M],T=!0,A=0;A<f.length;A++)i(S.p,f[A].p)&&(w!==A&&x.push({froms:w,tos:A,hole:M}),T?(T=!1,p[A].push(S)):b=!0);T&&p[w].push(S)}x.length>0&&(b||(m=p))}v=0;for(var L=f.length;v<L;v++){l=f[v].s,c.push(l);for(var C=0,P=(d=m[v]).length;C<P;C++)l.holes.push(d[C].h)}return c}}),Object.assign(sl.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],i=function(t,e,n){for(var i=Array.from?Array.from(t):String(t).split(""),r=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,a=[],s=0,l=0,c=0;c<i.length;c++){var h=i[c];if("\n"===h)s=0,l-=o;else{var u=ll(h,r,s,l,n);s+=u.offsetX,a.push(u.path)}}return a}(t,e,this.data),r=0,o=i.length;r<o;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),Object.assign(cl.prototype,{load:function(t,e,n,i){var r=this,o=new is(this.manager);o.setPath(this.path),o.load(t,(function(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var i=r.parse(n);e&&e(i)}),n,i)},parse:function(t){return new sl(t)},setPath:function(t){return this.path=t,this}}),hl.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,n=0,i=e.length;n<i;n+=2){var r=e[n],o=e[n+1];if(r.test(t))return o}return null}},Object.assign(hl.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,n){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],e,n);return i},createMaterial:(Qs={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},Ks=new $e,$s=new cs,tl=new Vs,function(t,e,n){var i={};function r(t,r,o,a,s){var l,c=e+t,h=hl.Handlers.get(c);null!==h?l=h.load(c):($s.setCrossOrigin(n),l=$s.load(c)),void 0!==r&&(l.repeat.fromArray(r),1!==r[0]&&(l.wrapS=vt),1!==r[1]&&(l.wrapT=vt)),void 0!==o&&l.offset.fromArray(o),void 0!==a&&("repeat"===a[0]&&(l.wrapS=vt),"mirror"===a[0]&&(l.wrapS=bt),"repeat"===a[1]&&(l.wrapT=vt),"mirror"===a[1]&&(l.wrapT=bt)),void 0!==s&&(l.anisotropy=s);var u=$t.generateUUID();return i[u]=l,u}var o={uuid:$t.generateUUID(),type:"MeshLambertMaterial"};for(var a in t){var s=t[a];switch(a){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"DbgName":o.name=s;break;case"blending":o.blending=Qs[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",a,"is no longer supported.");break;case"colorDiffuse":o.color=Ks.fromArray(s).getHex();break;case"colorSpecular":o.specular=Ks.fromArray(s).getHex();break;case"colorEmissive":o.emissive=Ks.fromArray(s).getHex();break;case"specularCoef":o.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(o.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(o.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(o.type="MeshStandardMaterial");break;case"mapDiffuse":o.map=r(s,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapEmissive":o.emissiveMap=r(s,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapLight":o.lightMap=r(s,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapAO":o.aoMap=r(s,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapBump":o.bumpMap=r(s,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":o.bumpScale=s;break;case"mapNormal":o.normalMap=r(s,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":o.normalScale=s;break;case"mapSpecular":o.specularMap=r(s,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapMetalness":o.metalnessMap=r(s,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapRoughness":o.roughnessMap=r(s,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapAlpha":o.alphaMap=r(s,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"flipSided":o.side=1;break;case"doubleSided":o.side=2;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),o.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":o[a]=s;break;case"vertexColors":!0===s&&(o.vertexColors=2),"face"===s&&(o.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",a,s)}}return"MeshBasicMaterial"===o.type&&delete o.emissive,"MeshPhongMaterial"!==o.type&&delete o.specular,o.opacity<1&&(o.transparent=!0),tl.setTextures(i),tl.parse(o)})});var ul={getContext:function(){return void 0===el&&(el=new(window.AudioContext||window.webkitAudioContext)),el},setContext:function(t){el=t}};function dl(t){this.manager=void 0!==t?t:es}function pl(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new ne)}function fl(t,e){Is.call(this,void 0,e),this.sh=void 0!==t?t:new pl}function ml(t,e,n){fl.call(this,void 0,n);var i=(new $e).set(t),r=(new $e).set(e),o=new ne(i.r,i.g,i.b),a=new ne(r.r,r.g,r.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(l)}function gl(t,e){fl.call(this,void 0,e);var n=(new $e).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}function vl(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new kn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new kn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function yl(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function bl(){Ge.call(this),this.type="AudioListener",this.context=ul.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function xl(t){Ge.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function wl(t){xl.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function El(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function _l(t,e,n){this.binding=t,this.valueSize=n;var i,r=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(dl.prototype,{load:function(t,e,n,i){var r=new is(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(t,(function(t){var n=t.slice(0);ul.getContext().decodeAudioData(n,(function(t){e(t)}))}),n,i)},setPath:function(t){return this.path=t,this}}),Object.assign(pl.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,i=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScale(o[1],.488603*i),e.addScale(o[2],.488603*r),e.addScale(o[3],.488603*n),e.addScale(o[4],n*i*1.092548),e.addScale(o[5],i*r*1.092548),e.addScale(o[6],.315392*(3*r*r-1)),e.addScale(o[7],n*r*1.092548),e.addScale(o[8],.546274*(n*n-i*i)),e},getIrradianceAt:function(t,e){var n=t.x,i=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScale(o[1],1.023328*i),e.addScale(o[2],1.023328*r),e.addScale(o[3],1.023328*n),e.addScale(o[4],.858086*n*i),e.addScale(o[5],.858086*i*r),e.addScale(o[6],.743125*r*r-.247708),e.addScale(o[7],.858086*n*r),e.addScale(o[8],.429043*(n*n-i*i)),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t){for(var e=this.coefficients,n=0;n<9;n++)e[n].fromArray(t,3*n);return this},toArray:function(){for(var t=[],e=this.coefficients,n=0;n<9;n++)e[n].toArray(t,3*n);return t}}),Object.assign(pl,{getBasisAt:function(t,e){var n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}),fl.prototype=Object.assign(Object.create(Is.prototype),{constructor:fl,isLightProbe:!0,copy:function(t){return Is.prototype.copy.call(this,t),this.sh.copy(t.sh),this.intensity=t.intensity,this},toJSON:function(t){return Is.prototype.toJSON.call(this,t)}}),ml.prototype=Object.assign(Object.create(fl.prototype),{constructor:ml,isHemisphereLightProbe:!0,copy:function(t){return fl.prototype.copy.call(this,t),this},toJSON:function(t){return fl.prototype.toJSON.call(this,t)}}),gl.prototype=Object.assign(Object.create(fl.prototype),{constructor:gl,isAmbientLightProbe:!0,copy:function(t){return fl.prototype.copy.call(this,t),this},toJSON:function(t){return fl.prototype.toJSON.call(this,t)}}),Object.assign(vl.prototype,{update:function(){var t,e,n,i,r,o,a,s,l=new be,c=new be;return function(h){if(t!==this||e!==h.focus||n!==h.fov||i!==h.aspect*this.aspect||r!==h.near||o!==h.far||a!==h.zoom||s!==this.eyeSep){t=this,e=h.focus,n=h.fov,i=h.aspect*this.aspect,r=h.near,o=h.far,a=h.zoom;var u,d,p=h.projectionMatrix.clone(),f=(s=this.eyeSep/2)*r/e,m=r*Math.tan($t.DEG2RAD*n*.5)/a;c.elements[12]=-s,l.elements[12]=s,u=-m*i+f,d=m*i+f,p.elements[0]=2*r/(d-u),p.elements[8]=(d+u)/(d-u),this.cameraL.projectionMatrix.copy(p),u=-m*i-f,d=m*i-f,p.elements[0]=2*r/(d-u),p.elements[8]=(d+u)/(d-u),this.cameraR.projectionMatrix.copy(p)}this.cameraL.matrixWorld.copy(h.matrixWorld).multiply(c),this.cameraR.matrixWorld.copy(h.matrixWorld).multiply(l)}}()}),Object.assign(yl.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),bl.prototype=Object.assign(Object.create(Ge.prototype),{constructor:bl,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(){var t=new ne,e=new ee,n=new ne,i=new ne,r=new yl;return function(o){Ge.prototype.updateMatrixWorld.call(this,o);var a=this.context.listener,s=this.up;if(this.timeDelta=r.getDelta(),this.matrixWorld.decompose(t,e,n),i.set(0,0,-1).applyQuaternion(e),a.positionX){var l=this.context.currentTime+this.timeDelta;a.positionX.linearRampToValueAtTime(t.x,l),a.positionY.linearRampToValueAtTime(t.y,l),a.positionZ.linearRampToValueAtTime(t.z,l),a.forwardX.linearRampToValueAtTime(i.x,l),a.forwardY.linearRampToValueAtTime(i.y,l),a.forwardZ.linearRampToValueAtTime(i.z,l),a.upX.linearRampToValueAtTime(s.x,l),a.upY.linearRampToValueAtTime(s.y,l),a.upZ.linearRampToValueAtTime(s.z,l)}else a.setPosition(t.x,t.y,t.z),a.setOrientation(i.x,i.y,i.z,s.x,s.y,s.z)}}()}),xl.prototype=Object.assign(Object.create(Ge.prototype),{constructor:xl,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}),wl.prototype=Object.assign(Object.create(xl.prototype),{constructor:wl,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(){var t=new ne,e=new ee,n=new ne,i=new ne;return function(r){if(Ge.prototype.updateMatrixWorld.call(this,r),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(t,e,n),i.set(0,0,1).applyQuaternion(e);var o=this.panner;if(o.positionX){var a=this.context.currentTime+this.listener.timeDelta;o.positionX.linearRampToValueAtTime(t.x,a),o.positionY.linearRampToValueAtTime(t.y,a),o.positionZ.linearRampToValueAtTime(t.z,a),o.orientationX.linearRampToValueAtTime(i.x,a),o.orientationY.linearRampToValueAtTime(i.y,a),o.orientationZ.linearRampToValueAtTime(i.z,a)}else o.setPosition(t.x,t.y,t.z),o.setOrientation(i.x,i.y,i.z)}}}()}),Object.assign(El.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(_l.prototype,{accumulate:function(t,e){var n=this.buffer,i=this.valueSize,r=t*i+i,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==i;++a)n[r+a]=n[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,r<1){var a=3*e;this._mixBufferRegion(n,i,a,1-r,e)}for(var s=e,l=e+e;s!==l;++s)if(n[s]!==n[s+e]){o.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=3*n;t.getValue(e,i);for(var r=n,o=i;r!==o;++r)e[r]=e[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,i,r){if(i>=.5)for(var o=0;o!==r;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,i){ee.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var o=1-i,a=0;a!==r;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*i}}});var Ml,Sl,Tl,Al,Ll,Cl,Pl,Rl,Ol,Il,Dl,kl,Nl,zl,Bl,Hl="\\[\\]\\.:\\/";function Fl(t,e,n){var i=n||jl.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function jl(t,e,n){this.path=e,this.parsedPath=n||jl.parseTrackName(e),this.node=jl.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Ul(){this.uuid=$t.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Gl(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,o=new Array(r),a={endingStart:Xt,endingEnd:Xt},s=0;s!==r;++s){var l=i[s].createInterpolant(null);o[s]=l,l.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Vl(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Wl(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Yl(t,e,n){Jr.call(this,t,e),this.meshPerAttribute=n||1}function Xl(t,e,n,i){this.ray=new Xe(t,e),this.near=n||0,this.far=i||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function ql(t,e){return t.distance-e.distance}function Zl(t,e,n,i){if(!1!==t.visible&&(t.raycast(e,n),!0===i))for(var r=t.children,o=0,a=r.length;o<a;o++)Zl(r[o],e,n,!0)}function Jl(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function Ql(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}function Kl(t,e){this.min=void 0!==t?t:new te(1/0,1/0),this.max=void 0!==e?e:new te(-1/0,-1/0)}function $l(t,e){this.start=void 0!==t?t:new ne,this.end=void 0!==e?e:new ne}function tc(t){Ge.call(this),this.material=t,this.render=function(){}}function ec(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16711680,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var l=new Mn,c=new gn(2*a*3,3);l.addAttribute("position",c),ao.call(this,l,new ro({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function nc(t,e){Ge.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new Mn,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,o=1;r<32;r++,o++){var a=r/32*Math.PI*2,s=o/32*Math.PI*2;i.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new gn(i,3));var l=new ro({fog:!1});this.cone=new ao(n,l),this.add(this.cone),this.update()}function ic(t){var e=[];t&&t.isBone&&e.push(t);for(var n=0;n<t.children.length;n++)e.push.apply(e,ic(t.children[n]));return e}function rc(t){for(var e=ic(t),n=new Mn,i=[],r=[],o=new $e(0,0,1),a=new $e(0,1,0),s=0;s<e.length;s++){var l=e[s];l.parent&&l.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}n.addAttribute("position",new gn(i,3)),n.addAttribute("color",new gn(r,3));var c=new ro({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});ao.call(this,n,c),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function oc(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var i=new ua(e,4,2),r=new sn({wireframe:!0,fog:!1});Sn.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function ac(t,e){this.type="RectAreaLightHelper",this.light=t,this.color=e;var n=new Mn;n.addAttribute("position",new gn([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere();var i=new ro({fog:!1});oo.call(this,n,i);var r=new Mn;r.addAttribute("position",new gn([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),r.computeBoundingSphere(),this.add(new Sn(r,new sn({side:1,fog:!1}))),this.update()}function sc(t,e,n){Ge.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new _o(e);i.rotateY(.5*Math.PI),this.material=new sn({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);var r=i.getAttribute("position"),o=new Float32Array(3*r.count);i.addAttribute("color",new ln(o,3)),this.add(new Sn(i,this.material)),this.update()}function lc(t,e){this.lightProbe=t,this.size=e;var n=new In({defines:{GAMMA_OUTPUT:""},uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","vec3 linearToOutput( in vec3 a ) {","\t#ifdef GAMMA_OUTPUT","\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );","\t#else","\t\treturn a;","\t#endif","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\toutgoingLight = linearToOutput( outgoingLight );","\tgl_FragColor = vec4( outgoingLight, 1.0 );","}"].join("\n")}),i=new ua(1,32,16);Sn.call(this,i,n),this.onBeforeRender()}function cc(t,e,n,i){t=t||10,e=e||10,n=new $e(void 0!==n?n:4473924),i=new $e(void 0!==i?i:8947848);for(var r=e/2,o=t/e,a=t/2,s=[],l=[],c=0,h=0,u=-a;c<=e;c++,u+=o){s.push(-a,0,u,a,0,u),s.push(u,0,-a,u,0,a);var d=c===r?n:i;d.toArray(l,h),h+=3,d.toArray(l,h),h+=3,d.toArray(l,h),h+=3,d.toArray(l,h),h+=3}var p=new Mn;p.addAttribute("position",new gn(s,3)),p.addAttribute("color",new gn(l,3));var f=new ro({vertexColors:2});ao.call(this,p,f)}function hc(t,e,n,i,r,o){t=t||10,e=e||16,n=n||8,i=i||64,r=new $e(void 0!==r?r:4473924),o=new $e(void 0!==o?o:8947848);var a,s,l,c,h,u,d,p=[],f=[];for(c=0;c<=e;c++)l=c/e*(2*Math.PI),a=Math.sin(l)*t,s=Math.cos(l)*t,p.push(0,0,0),p.push(a,0,s),d=1&c?r:o,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(c=0;c<=n;c++)for(d=1&c?r:o,u=t-t/n*c,h=0;h<i;h++)l=h/i*(2*Math.PI),a=Math.sin(l)*u,s=Math.cos(l)*u,p.push(a,0,s),f.push(d.r,d.g,d.b),l=(h+1)/i*(2*Math.PI),a=Math.sin(l)*u,s=Math.cos(l)*u,p.push(a,0,s),f.push(d.r,d.g,d.b);var m=new Mn;m.addAttribute("position",new gn(p,3)),m.addAttribute("color",new gn(f,3));var g=new ro({vertexColors:2});ao.call(this,m,g)}function uc(t,e,n,i){this.audio=t,this.range=e||1,this.divisionsInnerAngle=n||16,this.divisionsOuterAngle=i||2;var r=new Mn,o=this.divisionsInnerAngle+2*this.divisionsOuterAngle,a=new Float32Array(3*(3*o+3));r.addAttribute("position",new ln(a,3));var s=new ro({color:65280}),l=new ro({color:16776960});oo.call(this,r,[l,s]),this.update()}function dc(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16776960,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var l=new Mn,c=new gn(2*a*3,3);l.addAttribute("position",c),ao.call(this,l,new ro({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function pc(t,e,n){Ge.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var i=new Mn;i.addAttribute("position",new gn([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new ro({fog:!1});this.lightPlane=new oo(i,r),this.add(this.lightPlane),(i=new Mn).addAttribute("position",new gn([0,0,0,0,0,1],3)),this.targetLine=new oo(i,r),this.add(this.targetLine),this.update()}function fc(t){var e=new Mn,n=new ro({color:16777215,vertexColors:1}),i=[],r=[],o={},a=new $e(16755200),s=new $e(16711680),l=new $e(43775),c=new $e(16777215),h=new $e(3355443);function u(t,e,n){d(t,n),d(e,n)}function d(t,e){i.push(0,0,0),r.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}u("n1","n2",a),u("n2","n4",a),u("n4","n3",a),u("n3","n1",a),u("f1","f2",a),u("f2","f4",a),u("f4","f3",a),u("f3","f1",a),u("n1","f1",a),u("n2","f2",a),u("n3","f3",a),u("n4","f4",a),u("p","n1",s),u("p","n2",s),u("p","n3",s),u("p","n4",s),u("u1","u2",l),u("u2","u3",l),u("u3","u1",l),u("c","t",c),u("p","c",h),u("cn1","cn2",h),u("cn3","cn4",h),u("cf1","cf2",h),u("cf3","cf4",h),e.addAttribute("position",new gn(i,3)),e.addAttribute("color",new gn(r,3)),ao.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function mc(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new Mn;r.setIndex(new ln(n,1)),r.addAttribute("position",new ln(i,3)),ao.call(this,r,new ro({color:e})),this.matrixAutoUpdate=!1,this.update()}function gc(t,e){this.type="Box3Helper",this.box=t,e=e||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Mn;i.setIndex(new ln(n,1)),i.addAttribute("position",new gn([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),ao.call(this,i,new ro({color:e})),this.geometry.computeBoundingSphere()}function vc(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var i=void 0!==n?n:16776960,r=new Mn;r.addAttribute("position",new gn([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),oo.call(this,r,new ro({color:i}));var o=new Mn;o.addAttribute("position",new gn([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new Sn(o,new sn({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}function yc(t,e,n,i,r,o){Ge.call(this),void 0===t&&(t=new ne(0,0,1)),void 0===e&&(e=new ne(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===o&&(o=.2*r),void 0===kl&&((kl=new Mn).addAttribute("position",new gn([0,0,0,0,1,0],3)),(Nl=new wa(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new oo(kl,new ro({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Sn(Nl,new sn({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,o)}function bc(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new Mn;n.addAttribute("position",new gn(e,3)),n.addAttribute("color",new gn([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new ro({vertexColors:2});ao.call(this,n,i)}function xc(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ys.call(this,t),this.type="catmullrom",this.closed=!0}function wc(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ys.call(this,t),this.type="catmullrom"}function Ec(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),ys.call(this,t),this.type="catmullrom"}Object.assign(Fl.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(jl,{Composite:Fl,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new jl.Composite(t,e,n):new jl(t,e,n)},sanitizeNodeName:(Ol=new RegExp("["+Hl+"]","g"),function(t){return t.replace(/\s/g,"_").replace(Ol,"")}),parseTrackName:(Ml="[^"+Hl+"]",Sl="[^"+Hl.replace("\\.","")+"]",Tl=/((?:WC+[\/:])*)/.source.replace("WC",Ml),Al=/(WCOD+)?/.source.replace("WCOD",Sl),Ll=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ml),Cl=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ml),Pl=new RegExp("^"+Tl+Al+Ll+Cl+"$"),Rl=["material","materials","bones"],function(t){var e=Pl.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==Rl.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}),findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var i=function(t){for(var n=0;n<t.length;n++){var r=t[n];if(r.name===e||r.uuid===e)return r;var o=i(r.children);if(o)return o}return null},r=i(t.children);if(r)return r}return null}}),Object.assign(jl.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)t[e++]=n[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,r=e.propertyIndex;if(t||(t=jl.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var s=t[i];if(void 0!==s){var l=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(t.geometry.morphAttributes.position[a].name===r){r=a;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===r){r=a;break}}}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}else{var h=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(jl.prototype,{_getValue_unbound:jl.prototype.getValue,_setValue_unbound:jl.prototype.setValue}),Object.assign(Ul.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,l=void 0,c=0,h=arguments.length;c!==h;++c){var u=arguments[c],d=u.uuid,p=i[d];if(void 0===p){p=e++,i[d]=p,t.push(u);for(var f=0,m=s;f!==m;++f)a[f].push(new jl(u,r[f],o[f]))}else if(p<n){l=t[p];var g=--n,v=t[g];for(i[v.uuid]=p,t[p]=v,i[d]=g,t[g]=u,f=0,m=s;f!==m;++f){var y=a[f],b=y[g],x=y[p];y[p]=b,void 0===x&&(x=new jl(u,r[f],o[f])),y[g]=x}}else t[p]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],l=s.uuid,c=n[l];if(void 0!==c&&c>=e){var h=e++,u=t[h];n[u.uuid]=c,t[c]=u,n[l]=h,t[h]=s;for(var d=0,p=r;d!==p;++d){var f=i[d],m=f[h],g=f[c];f[c]=m,f[h]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,o=r.length,a=0,s=arguments.length;a!==s;++a){var l=arguments[a].uuid,c=i[l];if(void 0!==c)if(delete i[l],c<n){var h=--n,u=t[h],d=t[v=--e];i[u.uuid]=c,t[c]=u,i[d.uuid]=h,t[h]=d,t.pop();for(var p=0,f=o;p!==f;++p){var m=(y=r[p])[h],g=y[v];y[c]=m,y[h]=g,y.pop()}}else{var v;for(i[(d=t[v=--e]).uuid]=c,t[c]=d,t.pop(),p=0,f=o;p!==f;++p){var y;(y=r[p])[c]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var o=this._paths,a=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,h=new Array(l);i=r.length,n[t]=i,o.push(t),a.push(e),r.push(h);for(var u=c,d=s.length;u!==d;++u){var p=s[u];h[u]=new jl(p,t,e)}return h},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var i=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=n,o[n]=s,o.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}),Object.assign(Gl.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var i=this._clip.duration,r=t._clip.duration,o=r/i,a=i/r;t.warp(1,o,e),this.warp(a,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var i=this._mixer,r=i.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,l=o.sampleValues;return s[0]=r,s[1]=r+n,l[0]=t/a,l[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var o=(t-r)*n;if(o<0||0===n)return;this._startTime=null,e=n*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var l=this._interpolants,c=this._propertyBindings,h=0,u=l.length;h!==u;++h)l[h].evaluate(a),c[h].accumulate(i,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,i=this.loop,r=this._loopCount,o=2202===i;if(0===t)return-1===r||!o||1&~r?e:n-e;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=n)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=n||e<0){var a=Math.floor(e/n);e-=n*a,r+=Math.abs(a);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var l=t<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=e;if(o&&!(1&~r))return n-e}return e},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=qt,i.endingEnd=qt):(i.endingStart=t?this.zeroSlopeAtStart?qt:Xt:Zt,i.endingEnd=e?this.zeroSlopeAtEnd?qt:Xt:Zt)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=r,s[0]=e,a[1]=r+t,s[1]=n,this}}),Vl.prototype=Object.assign(Object.create(it.prototype),{constructor:Vl,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var h=0;h!==r;++h){var u=i[h],d=u.name,p=c[d];if(void 0!==p)o[h]=p;else{if(void 0!==(p=o[h])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[h].binding.parsedPath;++(p=new _l(jl.create(n,d,f),u.ValueTypeName,u.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),o[h]=p}a[h].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,o=0,a=r.length;o!==a;++o){var s=r[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var i=this._actions,r=this._actionsByClip,o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=i.length,i.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],i=t._cacheIndex;n._cacheIndex=i,e[i]=n,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,o=this._actionsByClip,a=o[r],s=a.knownActions,l=s[s.length-1],c=t._byClipCacheIndex;l._byClipCacheIndex=c,s[c]=l,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_addInactiveBinding:function(t,e,n){var i=this._bindingsByRootAndName,r=i[e],o=this._bindings;void 0===r&&(r={},i[e]=r),r[n]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,a=o[i],s=e[e.length-1],l=t._cacheIndex;s._cacheIndex=l,e[l]=s,e.pop(),delete a[r],0===Object.keys(a).length&&delete o[i]},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&((n=new ja(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];t.__cacheIndex=i,e[i]=t,r.__cacheIndex=n,e[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?Qa.findByName(n,t):t,o=null!==r?r.uuid:t,a=this._actionsByClip[o],s=null;if(void 0!==a){var l=a.actionByRoot[i];if(void 0!==l)return l;s=a.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var c=new Gl(this,r,e);return this._bindAction(c,s),this._addInactiveAction(c,o,i),c},existingAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?Qa.findByName(n,t):t,o=r?r.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[i]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==e;++r)t[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a)e[a]._update(i,t,r,o);var s=this._bindings,l=this._nActiveBindings;for(a=0;a!==l;++a)s[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var o=r.knownActions,a=0,s=o.length;a!==s;++a){var l=o[a];this._deactivateAction(l);var c=l._cacheIndex,h=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,h._cacheIndex=c,e[c]=h,e.pop(),this._removeInactiveBindingsForAction(l)}delete i[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var o=this._bindingsByRootAndName[e];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Wl.prototype.clone=function(){return new Wl(void 0===this.value.clone?this.value:this.value.clone())},Yl.prototype=Object.assign(Object.create(Jr.prototype),{constructor:Yl,isInstancedInterleavedBuffer:!0,copy:function(t){return Jr.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Xl.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this._camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this._camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var i=n||[];return Zl(t,this,i,e),i.sort(ql),i},intersectObjects:function(t,e,n){var i=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,o=t.length;r<o;r++)Zl(t[r],this,i,e);return i.sort(ql),i}}),Object.assign(Jl.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){var t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos($t.clamp(e/this.radius,-1,1))),this}}),Object.assign(Ql.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}}),Object.assign(Kl.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new te;return function(e,n){var i=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new te),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new te),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new te),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new te),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new te;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign($l.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new ne),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new ne),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new ne),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){void 0===Il&&(Il=new ne,Dl=new ne),Il.subVectors(t,this.start),Dl.subVectors(this.end,this.start);var n=Dl.dot(Dl),i=Dl.dot(Il)/n;return e&&(i=$t.clamp(i,0,1)),i},closestPointToPoint:function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new ne),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),tc.prototype=Object.create(Ge.prototype),tc.prototype.constructor=tc,tc.prototype.isImmediateRenderObject=!0,ec.prototype=Object.create(ao.prototype),ec.prototype.constructor=ec,ec.prototype.update=function(){var t=new ne,e=new ne,n=new ie;return function(){var i=["a","b","c"];this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,l=a.faces,c=0,h=0,u=l.length;h<u;h++)for(var d=l[h],p=0,f=d.vertexNormals.length;p<f;p++){var m=s[d[i[p]]],g=d.vertexNormals[p];t.copy(m).applyMatrix4(r),e.copy(g).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(c,t.x,t.y,t.z),c+=1,o.setXYZ(c,e.x,e.y,e.z),c+=1}else if(a&&a.isBufferGeometry){var v=a.attributes.position,y=a.attributes.normal;for(c=0,p=0,f=v.count;p<f;p++)t.set(v.getX(p),v.getY(p),v.getZ(p)).applyMatrix4(r),e.set(y.getX(p),y.getY(p),y.getZ(p)),e.applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(c,t.x,t.y,t.z),c+=1,o.setXYZ(c,e.x,e.y,e.z),c+=1}o.needsUpdate=!0}}(),nc.prototype=Object.create(Ge.prototype),nc.prototype.constructor=nc,nc.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},nc.prototype.update=function(){var t=new ne;return function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,n=e*Math.tan(this.light.angle);this.cone.scale.set(n,n,e),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),rc.prototype=Object.create(ao.prototype),rc.prototype.constructor=rc,rc.prototype.updateMatrixWorld=function(){var t=new ne,e=new be,n=new be;return function(i){var r=this.bones,o=this.geometry,a=o.getAttribute("position");n.getInverse(this.root.matrixWorld);for(var s=0,l=0;s<r.length;s++){var c=r[s];c.parent&&c.parent.isBone&&(e.multiplyMatrices(n,c.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(l,t.x,t.y,t.z),e.multiplyMatrices(n,c.parent.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(l+1,t.x,t.y,t.z),l+=2)}o.getAttribute("position").needsUpdate=!0,Ge.prototype.updateMatrixWorld.call(this,i)}}(),oc.prototype=Object.create(Sn.prototype),oc.prototype.constructor=oc,oc.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},oc.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},ac.prototype=Object.create(oo.prototype),ac.prototype.constructor=ac,ac.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var t=this.material.color,e=Math.max(t.r,t.g,t.b);e>1&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color)}},ac.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},sc.prototype=Object.create(Ge.prototype),sc.prototype.constructor=sc,sc.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},sc.prototype.update=function(){var t=new ne,e=new $e,n=new $e;return function(){var i=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var r=i.geometry.getAttribute("color");e.copy(this.light.color),n.copy(this.light.groundColor);for(var o=0,a=r.count;o<a;o++){var s=o<a/2?e:n;r.setXYZ(o,s.r,s.g,s.b)}r.needsUpdate=!0}i.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),lc.prototype=Object.create(Sn.prototype),lc.prototype.constructor=lc,lc.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},lc.prototype.onBeforeRender=function(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity},cc.prototype=Object.assign(Object.create(ao.prototype),{constructor:cc,copy:function(t){return ao.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),hc.prototype=Object.create(ao.prototype),hc.prototype.constructor=hc,uc.prototype=Object.create(oo.prototype),uc.prototype.constructor=uc,uc.prototype.update=function(){var t,e,n=this.audio,i=this.range,r=this.divisionsInnerAngle,o=this.divisionsOuterAngle,a=$t.degToRad(n.panner.coneInnerAngle),s=$t.degToRad(n.panner.coneOuterAngle),l=a/2,c=s/2,h=0,u=0,d=this.geometry,p=d.attributes.position;function f(n,r,o,a){var s=(r-n)/o;for(p.setXYZ(h,0,0,0),u++,t=n;t<r;t+=s)e=h+u,p.setXYZ(e,Math.sin(t)*i,0,Math.cos(t)*i),p.setXYZ(e+1,Math.sin(Math.min(t+s,r))*i,0,Math.cos(Math.min(t+s,r))*i),p.setXYZ(e+2,0,0,0),u+=3;d.addGroup(h,u,a),h+=u,u=0}d.clearGroups(),f(-c,-l,o,0),f(-l,l,r,1),f(l,c,o,0),p.needsUpdate=!0,a===s&&(this.material[0].visible=!1)},uc.prototype.dispose=function(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()},dc.prototype=Object.create(ao.prototype),dc.prototype.constructor=dc,dc.prototype.update=function(){var t=new ne,e=new ne,n=new ie;return function(){this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);for(var i=this.object.matrixWorld,r=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,l=0,c=0,h=s.length;c<h;c++){var u=s[c],d=u.normal;t.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(i),e.copy(d).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),r.setXYZ(l,t.x,t.y,t.z),l+=1,r.setXYZ(l,e.x,e.y,e.z),l+=1}r.needsUpdate=!0}}(),pc.prototype=Object.create(Ge.prototype),pc.prototype.constructor=pc,pc.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},pc.prototype.update=function(){var t=new ne,e=new ne,n=new ne;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(e,t),this.lightPlane.lookAt(e),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(e),this.targetLine.scale.z=n.length()}}(),fc.prototype=Object.create(ao.prototype),fc.prototype.constructor=fc,fc.prototype.update=function(){var t,e,n=new ne,i=new Dn;function r(r,o,a,s){n.set(o,a,s).unproject(i);var l=e[r];if(void 0!==l)for(var c=t.getAttribute("position"),h=0,u=l.length;h<u;h++)c.setXYZ(l[h],n.x,n.y,n.z)}return function(){t=this.geometry,e=this.pointMap,i.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),r("c",0,0,-1),r("t",0,0,1),r("n1",-1,-1,-1),r("n2",1,-1,-1),r("n3",-1,1,-1),r("n4",1,1,-1),r("f1",-1,-1,1),r("f2",1,-1,1),r("f3",-1,1,1),r("f4",1,1,1),r("u1",.7,1.1,-1),r("u2",-.7,1.1,-1),r("u3",0,2,-1),r("cf1",-1,0,1),r("cf2",1,0,1),r("cf3",0,-1,1),r("cf4",0,1,1),r("cn1",-1,0,-1),r("cn2",1,0,-1),r("cn3",0,-1,-1),r("cn4",0,1,-1),t.getAttribute("position").needsUpdate=!0}}(),mc.prototype=Object.create(ao.prototype),mc.prototype.constructor=mc,mc.prototype.update=function(){var t=new We;return function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&t.setFromObject(this.object),!t.isEmpty()){var n=t.min,i=t.max,r=this.geometry.attributes.position,o=r.array;o[0]=i.x,o[1]=i.y,o[2]=i.z,o[3]=n.x,o[4]=i.y,o[5]=i.z,o[6]=n.x,o[7]=n.y,o[8]=i.z,o[9]=i.x,o[10]=n.y,o[11]=i.z,o[12]=i.x,o[13]=i.y,o[14]=n.z,o[15]=n.x,o[16]=i.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=i.x,o[22]=n.y,o[23]=n.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),mc.prototype.setFromObject=function(t){return this.object=t,this.update(),this},mc.prototype.copy=function(t){return ao.prototype.copy.call(this,t),this.object=t.object,this},mc.prototype.clone=function(){return(new this.constructor).copy(this)},gc.prototype=Object.create(ao.prototype),gc.prototype.constructor=gc,gc.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Ge.prototype.updateMatrixWorld.call(this,t))},vc.prototype=Object.create(oo.prototype),vc.prototype.constructor=vc,vc.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?1:0,this.lookAt(this.plane.normal),Ge.prototype.updateMatrixWorld.call(this,t)},yc.prototype=Object.create(Ge.prototype),yc.prototype.constructor=yc,yc.prototype.setDirection=(Bl=new ne,function(t){t.y>.99999?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(Bl.set(t.z,0,-t.x).normalize(),zl=Math.acos(t.y),this.quaternion.setFromAxisAngle(Bl,zl))}),yc.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},yc.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},yc.prototype.copy=function(t){return Ge.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},yc.prototype.clone=function(){return(new this.constructor).copy(this)},bc.prototype=Object.create(ao.prototype),bc.prototype.constructor=bc,hs.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(hs.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Ps.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new An,n=0,i=t.length;n<i;n++){var r=t[n];e.vertices.push(new ne(r.x,r.y,r.z||0))}return e}}),Object.assign(Rs.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),xc.prototype=Object.create(ys.prototype),wc.prototype=Object.create(ys.prototype),Ec.prototype=Object.create(ys.prototype),Object.assign(Ec.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),cc.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},rc.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(hl.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Ws.extractUrlBase(t)}}),Object.assign(Js.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(Kl.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(We.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),$l.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign($t,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),$t.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),$t.ceilPowerOfTwo(t)}}),Object.assign(ie.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(be.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new ne),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,o)}}),Un.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},ee.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Xe.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(qe.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(qe,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),qe.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),qe.getNormal(t,e,n,i)}}),Object.assign(Os.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ra(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ga(this,t)}}),Object.assign(te.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ne.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ge.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(An.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(Ge.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(Ge.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(to.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(no.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),eo.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(hs.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),kn.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Is.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(ln.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(Mn.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(Mn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.assign(oa.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Wl.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(an.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new $e}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}}}),Object.defineProperties(Ra.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(In.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Xr.prototype,{clearTarget:function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Xr.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}}}),Object.defineProperties(Pr.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Fn.prototype,{activeCubeFace:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),Object.defineProperties(ve.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Wr.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),xl.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new dl).load(t,(function(t){e.setBuffer(t)})),this},El.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Hn.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var _c={merge:function(t,e,n){var i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};pe.crossOrigin=void 0,pe.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new cs;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},pe.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new ls;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},pe.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},pe.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Mc={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}},Sc=Object.freeze({ACESFilmicToneMapping:5,AddEquation:lt,AddOperation:2,AdditiveBlending:2,AlphaFormat:1021,AlwaysDepth:1,AlwaysStencilFunc:519,AmbientLight:Us,AmbientLightProbe:gl,AnimationClip:Qa,AnimationLoader:rs,AnimationMixer:Vl,AnimationObjectGroup:Ul,AnimationUtils:Ba,ArcCurve:ds,ArrayCamera:kr,ArrowHelper:yc,Audio:xl,AudioAnalyser:El,AudioContext:ul,AudioListener:bl,AudioLoader:dl,AxesHelper:bc,AxisHelper:function(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new bc(t)},BackSide:1,BasicDepthPacking:3200,BasicShadowMap:0,BinaryTextureLoader:function(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new as(t)},Bone:io,BooleanKeyframeTrack:Va,BoundingBoxHelper:function(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new mc(t,e)},Box2:Kl,Box3:We,Box3Helper:gc,BoxBufferGeometry:Cn,BoxGeometry:Ln,BoxHelper:mc,BufferAttribute:ln,BufferGeometry:Mn,BufferGeometryLoader:qs,ByteType:1010,Cache:$a,Camera:Dn,CameraHelper:fc,CanvasRenderer:function(){console.error("THREE.CanvasRenderer has been removed")},CanvasTexture:po,CatmullRomCurve3:ys,CineonToneMapping:4,CircleBufferGeometry:Sa,CircleGeometry:Ma,ClampToEdgeWrapping:yt,Clock:yl,ClosedSplineCurve3:xc,Color:$e,ColorKeyframeTrack:Wa,CompressedTexture:uo,CompressedTextureLoader:os,ConeBufferGeometry:_a,ConeGeometry:Ea,CubeCamera:Hn,CubeGeometry:Ln,CubeReflectionMapping:dt,CubeRefractionMapping:pt,CubeTexture:li,CubeTextureLoader:ls,CubeUVReflectionMapping:mt,CubeUVRefractionMapping:gt,CubicBezierCurve:Es,CubicBezierCurve3:_s,CubicInterpolant:Fa,CullFaceBack:1,CullFaceFront:2,CullFaceFrontBack:3,CullFaceNone:0,Curve:hs,CurvePath:Ps,CustomBlending:5,CylinderBufferGeometry:wa,CylinderGeometry:xa,Cylindrical:Ql,DataTexture:jn,DataTexture2DArray:ci,DataTexture3D:hi,DataTextureLoader:as,DecrementStencilOp:7683,DecrementWrapStencilOp:34056,DefaultLoadingManager:es,DepthFormat:Dt,DepthStencilFormat:kt,DepthTexture:fo,DirectionalLight:js,DirectionalLightHelper:pc,DirectionalLightShadow:Fs,DiscreteInterpolant:Ua,DodecahedronBufferGeometry:Ao,DodecahedronGeometry:To,DoubleSide:2,DstAlphaFactor:206,DstColorFactor:208,DynamicBufferAttribute:function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new ln(t,e).setDynamic(!0)},EdgesGeometry:ba,EdgesHelper:function(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new ao(new ba(t.geometry),new ro({color:void 0!==e?e:16777215}))},EllipseCurve:us,EqualDepth:4,EqualStencilFunc:514,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:ft,Euler:xe,EventDispatcher:it,ExtrudeBufferGeometry:oa,ExtrudeGeometry:ra,Face3:rn,Face4:function(t,e,n,i,r,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new rn(t,e,n,r,o,a)},FaceColors:1,FaceNormalsHelper:dc,FileLoader:is,FlatShading:1,Float32Attribute:function(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new gn(t,e)},Float32BufferAttribute:gn,Float64Attribute:function(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new vn(t,e)},Float64BufferAttribute:vn,FloatType:Ct,Fog:Zr,FogExp2:qr,Font:sl,FontLoader:cl,FrontFaceDirectionCCW:1,FrontFaceDirectionCW:0,FrontSide:0,Frustum:Gn,GammaEncoding:Qt,Geometry:An,GeometryUtils:_c,GreaterDepth:6,GreaterEqualDepth:5,GreaterEqualStencilFunc:518,GreaterStencilFunc:516,GridHelper:cc,Group:Dr,HalfFloatType:Pt,HemisphereLight:Ds,HemisphereLightHelper:sc,HemisphereLightProbe:ml,IcosahedronBufferGeometry:So,IcosahedronGeometry:Mo,ImageBitmapLoader:ol,ImageLoader:ss,ImageUtils:pe,ImmediateRenderObject:tc,IncrementStencilOp:7682,IncrementWrapStencilOp:34055,InstancedBufferAttribute:Xs,InstancedBufferGeometry:Ys,InstancedInterleavedBuffer:Yl,Int16Attribute:function(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new dn(t,e)},Int16BufferAttribute:dn,Int32Attribute:function(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new fn(t,e)},Int32BufferAttribute:fn,Int8Attribute:function(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new cn(t,e)},Int8BufferAttribute:cn,IntType:1013,InterleavedBuffer:Jr,InterleavedBufferAttribute:Qr,Interpolant:Ha,InterpolateDiscrete:Vt,InterpolateLinear:Wt,InterpolateSmooth:Yt,InvertStencilOp:5386,JSONLoader:function(){console.error("THREE.JSONLoader has been removed.")},KeepStencilOp:Kt,KeyframeTrack:Ga,LOD:to,LatheBufferGeometry:ma,LatheGeometry:fa,Layers:we,LensFlare:function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")},LessDepth:2,LessEqualDepth:3,LessEqualStencilFunc:515,LessStencilFunc:513,Light:Is,LightProbe:fl,LightProbeHelper:lc,LightShadow:ks,Line:oo,Line3:$l,LineBasicMaterial:ro,LineCurve:Ms,LineCurve3:Ss,LineDashedMaterial:Na,LineLoop:so,LinePieces:1,LineSegments:ao,LineStrip:0,LinearEncoding:Jt,LinearFilter:_t,LinearInterpolant:ja,LinearMipMapLinearFilter:1008,LinearMipMapNearestFilter:1007,LinearMipmapLinearFilter:St,LinearMipmapNearestFilter:Mt,LinearToneMapping:1,Loader:hl,LoaderUtils:Ws,LoadingManager:ts,LogLuvEncoding:3003,LoopOnce:2200,LoopPingPong:2202,LoopRepeat:2201,LuminanceAlphaFormat:1025,LuminanceFormat:1024,MOUSE:{LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Material:an,MaterialLoader:Vs,Math:$t,Matrix3:ie,Matrix4:be,MaxEquation:ht,Mesh:Sn,MeshBasicMaterial:sn,MeshDepthMaterial:Lr,MeshDistanceMaterial:Cr,MeshFaceMaterial:function(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t},MeshLambertMaterial:Da,MeshMatcapMaterial:ka,MeshNormalMaterial:Ia,MeshPhongMaterial:Ra,MeshPhysicalMaterial:Pa,MeshStandardMaterial:Ca,MeshToonMaterial:Oa,MinEquation:ct,MirroredRepeatWrapping:bt,MixOperation:1,MultiMaterial:function(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t},MultiplyBlending:4,MultiplyOperation:0,NearestFilter:xt,NearestMipMapLinearFilter:1005,NearestMipMapNearestFilter:1004,NearestMipmapLinearFilter:Et,NearestMipmapNearestFilter:wt,NeverDepth:0,NeverStencilFunc:512,NoBlending:0,NoColors:0,NoToneMapping:0,NormalBlending:1,NotEqualDepth:7,NotEqualStencilFunc:517,NumberKeyframeTrack:Ya,Object3D:Ge,ObjectLoader:Js,ObjectSpaceNormalMap:1,OctahedronBufferGeometry:_o,OctahedronGeometry:Eo,OneFactor:201,OneMinusDstAlphaFactor:207,OneMinusDstColorFactor:209,OneMinusSrcAlphaFactor:205,OneMinusSrcColorFactor:203,OrthographicCamera:Hs,PCFShadowMap:1,PCFSoftShadowMap:2,ParametricBufferGeometry:vo,ParametricGeometry:go,Particle:function(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new $r(t)},ParticleBasicMaterial:function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new lo(t)},ParticleSystem:function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new co(t,e)},ParticleSystemMaterial:function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new lo(t)},Path:Rs,PerspectiveCamera:kn,Plane:Un,PlaneBufferGeometry:Jn,PlaneGeometry:Zn,PlaneHelper:vc,PointCloud:function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new co(t,e)},PointCloudMaterial:function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new lo(t)},PointLight:Bs,PointLightHelper:oc,Points:co,PointsMaterial:lo,PolarGridHelper:hc,PolyhedronBufferGeometry:bo,PolyhedronGeometry:yo,PositionalAudio:wl,PositionalAudioHelper:uc,PropertyBinding:jl,PropertyMixer:_l,QuadraticBezierCurve:Ts,QuadraticBezierCurve3:As,Quaternion:ee,QuaternionKeyframeTrack:qa,QuaternionLinearInterpolant:Xa,REVISION:"107",RGBADepthPacking:3201,RGBAFormat:It,RGBA_ASTC_10x10_Format:37819,RGBA_ASTC_10x5_Format:37816,RGBA_ASTC_10x6_Format:37817,RGBA_ASTC_10x8_Format:37818,RGBA_ASTC_12x10_Format:37820,RGBA_ASTC_12x12_Format:37821,RGBA_ASTC_4x4_Format:37808,RGBA_ASTC_5x4_Format:37809,RGBA_ASTC_5x5_Format:37810,RGBA_ASTC_6x5_Format:37811,RGBA_ASTC_6x6_Format:37812,RGBA_ASTC_8x5_Format:37813,RGBA_ASTC_8x6_Format:37814,RGBA_ASTC_8x8_Format:37815,RGBA_PVRTC_2BPPV1_Format:Gt,RGBA_PVRTC_4BPPV1_Format:Ut,RGBA_S3TC_DXT1_Format:zt,RGBA_S3TC_DXT3_Format:Bt,RGBA_S3TC_DXT5_Format:Ht,RGBDEncoding:3006,RGBEEncoding:3002,RGBEFormat:1023,RGBFormat:Ot,RGBM16Encoding:3005,RGBM7Encoding:3004,RGB_ETC1_Format:36196,RGB_PVRTC_2BPPV1_Format:jt,RGB_PVRTC_4BPPV1_Format:Ft,RGB_S3TC_DXT1_Format:Nt,RawShaderMaterial:La,Ray:Xe,Raycaster:Xl,RectAreaLight:Gs,RectAreaLightHelper:ac,RedFormat:1028,ReinhardToneMapping:2,RepeatWrapping:vt,ReplaceStencilOp:7681,ReverseSubtractEquation:102,RingBufferGeometry:pa,RingGeometry:da,Scene:Ve,SceneUtils:Mc,ShaderChunk:Vn,ShaderLib:Yn,ShaderMaterial:In,ShadowMaterial:Aa,Shape:Os,ShapeBufferGeometry:va,ShapeGeometry:ga,ShapePath:al,ShapeUtils:ea,ShortType:1011,Skeleton:no,SkeletonHelper:rc,SkinnedMesh:eo,SmoothShading:2,Sphere:Ye,SphereBufferGeometry:ua,SphereGeometry:ha,Spherical:Jl,SphericalHarmonics3:pl,SphericalReflectionMapping:305,Spline:Ec,SplineCurve:Ls,SplineCurve3:wc,SpotLight:zs,SpotLightHelper:nc,SpotLightShadow:Ns,Sprite:$r,SpriteMaterial:Kr,SrcAlphaFactor:204,SrcAlphaSaturateFactor:210,SrcColorFactor:202,StereoCamera:vl,StringKeyframeTrack:Za,SubtractEquation:101,SubtractiveBlending:3,TOUCH:{ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},TangentSpaceNormalMap:0,TetrahedronBufferGeometry:wo,TetrahedronGeometry:xo,TextBufferGeometry:ca,TextGeometry:la,Texture:me,TextureLoader:cs,TorusBufferGeometry:Io,TorusGeometry:Oo,TorusKnotBufferGeometry:Ro,TorusKnotGeometry:Po,Triangle:qe,TriangleFanDrawMode:2,TriangleStripDrawMode:1,TrianglesDrawMode:0,TubeBufferGeometry:Co,TubeGeometry:Lo,UVMapping:ut,Uint16Attribute:function(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new pn(t,e)},Uint16BufferAttribute:pn,Uint32Attribute:function(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new mn(t,e)},Uint32BufferAttribute:mn,Uint8Attribute:function(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new hn(t,e)},Uint8BufferAttribute:hn,Uint8ClampedAttribute:function(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new un(t,e)},Uint8ClampedBufferAttribute:un,Uncharted2ToneMapping:3,Uniform:Wl,UniformsLib:Wn,UniformsUtils:On,UnsignedByteType:Tt,UnsignedInt248Type:Rt,UnsignedIntType:Lt,UnsignedShort4444Type:1017,UnsignedShort5551Type:1018,UnsignedShort565Type:1019,UnsignedShortType:At,Vector2:te,Vector3:ne,Vector4:ge,VectorKeyframeTrack:Ja,Vertex:function(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new ne(t,e,n)},VertexColors:2,VertexNormalsHelper:ec,VideoTexture:ho,WebGLMultisampleRenderTarget:ye,WebGLRenderTarget:ve,WebGLRenderTargetCube:Fn,WebGLRenderer:Xr,WebGLUtils:Ir,WireframeGeometry:mo,WireframeHelper:function(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new ao(new mo(t.geometry),new ro({color:void 0!==e?e:16777215}))},WrapAroundEnding:Zt,XHRLoader:function(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new is(t)},ZeroCurvatureEnding:Xt,ZeroFactor:200,ZeroSlopeEnding:qt,ZeroStencilOp:0,sRGBEncoding:3001}),Tc=function(){function t(){}return t.getHaloMaterial=function(t,e,n,i,r){return void 0===t&&(t=.5),void 0===e&&(e=.5),void 0===n&&(n=.5),void 0===i&&(i=.1),void 0===r&&(r=.5),new THREE.ShaderMaterial({uniforms:{r:{value:t},g:{value:e},b:{value:n},a:{value:i},c:{value:r}},vertexShader:"#define GLSLIFY 1\nvarying vec3 vNormal;\n\nvoid main()\n{\n    vNormal = normalize( normalMatrix * normal );\n    gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"#define GLSLIFY 1\nvarying vec3 vNormal;\nuniform float r;\nuniform float g;\nuniform float b;\nuniform float a;\nuniform float c;\n\nvoid main()\n{\n    float intensity = pow( abs(c) - dot( vNormal, vec3( 0.0, 0.0, 1.0 ) ), 4.0 );\n    gl_FragColor = vec4(r, g, b, a) * intensity;\n}",side:THREE.BackSide,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!1})},t}();AFRAME.registerComponent("al-angle",{schema:{angle:{type:"number"},edge0Pos:{type:"vec3"},edge1Pos:{type:"vec3"},length:{type:"number"},minFrameMS:{type:"number",default:15},position:{type:"vec3"},radius:{type:"number"},scale:{type:"number"},selected:{type:"boolean"}},init:function(){this.tickFunction=AFRAME.utils.throttle(this.tickFunction,this.data.minFrameMS,this),this.bindMethods(),this.addEventListeners(),this.state={selected:!0,hovered:!1},this.createMesh()},bindMethods:function(){this.createMesh=this.createMesh.bind(this),this.getMatrix=this.getMatrix.bind(this),this.objectToVector3=this.objectToVector3.bind(this),this.pointerDown=this.pointerDown.bind(this),this.pointerOut=this.pointerOut.bind(this),this.pointerOver=this.pointerOver.bind(this)},objectToVector3:function(t){var e=new THREE.Vector3;return e.x=t.x,e.y=t.y,e.z=t.z,e},addEventListeners:function(){this.el.addEventListener("mousedown",this.pointerDown,{capture:!1,once:!1,passive:!0}),this.el.addEventListener("raycaster-intersected",this.pointerOver,{capture:!0,once:!1,passive:!0}),this.el.addEventListener("raycaster-intersected-cleared",this.pointerOut,{capture:!1,once:!1,passive:!0})},removeEventListeners:function(){this.el.removeEventListener("mousedown",this.pointerDown),this.el.removeEventListener("raycaster-intersected",this.pointerOver),this.el.removeEventListener("raycaster-intersected-cleared",this.pointerOut)},pointerDown:function(t){this.el.sceneEl.emit(N.SELECTED,{type:u.ANGLE,id:this.el.id},!0)},pointerOver:function(t){this.state.hovered=!0,this.el.sceneEl.emit(N.POINTER_OVER,{id:this.el.id},!0)},pointerOut:function(t){this.state.hovered=!1,this.el.sceneEl.emit(N.POINTER_OUT,{},!0)},getMatrix:function(){var t=this.objectToVector3(this.data.edge0Pos),e=this.objectToVector3(this.data.edge1Pos),n=new THREE.Matrix4;n.makeScale(this.data.scale,this.data.scale,1);var i=new THREE.Matrix4;i.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);var r=new THREE.Matrix4;return r.lookAt(t,e,(new THREE.Object3D).up),r.multiply(n),r.multiply(i),r},createMesh:function(){var t=new THREE.CylinderGeometry(this.data.radius,this.data.radius,this.data.length,6,4),e=new THREE.MeshBasicMaterial,n=new THREE.Mesh(t,e);n.applyMatrix(this.getMatrix()),n.position.copy(this.objectToVector3(this.data.position)),this.state.geometry=t,this.state.material=e,this.state.mesh=n;var i=new THREE.CylinderGeometry(this.data.radius,this.data.radius,this.data.length,6,4),r=Tc.getHaloMaterial(),o=new THREE.Mesh(i,r);this.state.outlineGeometry=i,this.state.outlineMaterialt=r,this.state.outlineMesh=o,n.add(o),this.el.setObject3D("mesh",n),this.el.object3D.renderOrder=O.topLayerRenderOrder-3},update:function(t){this.state.selected=this.data.selected,!t||t.angle===this.data.angle&&t.scale===this.data.scale||this.createMesh()},tickFunction:function(){var t=this.el,e=this.state;e.hovered?e.material.color=new THREE.Color(O.buttonColors.hover):e.selected?e.material.color=new THREE.Color(O.buttonColors.active):e.material.color=new THREE.Color(O.buttonColors.up);var n=t.firstChild;if(n){var i=n.object3D;e.hovered?i.visible=!0:i.visible=!1}},tick:function(){this.tickFunction()},remove:function(){this.removeEventListeners(),this.el.removeObject3D("mesh")}}),AFRAME.registerComponent("al-background",{schema:{boundingRadius:{type:"number",default:1},frustrumDistance:{type:"number",default:1},minFrameMS:{type:"number",default:15},scale:{type:"number",default:8},text:{type:"string",default:""}},init:function(){this.state={hasUpdated:!1},this.bindMethods(),this.addEventListeners(),this.tickFunction=AFRAME.utils.throttle(this.tickFunction,this.data.minFrameMS,this)},bindMethods:function(){},addEventListeners:function(){},removeEventListeners:function(){},update:function(t){this.data.text!==t.text&&(this.state.hasUpdated=!1)},tickFunction:function(){if(!this.state.hasUpdated){var t=this.el.object3DMap.text,e=void 0;if(t&&(e=t.geometry).attributes.position){e.computeBoundingBox();var n=new THREE.Vector3;e.boundingBox.getSize(n);var i=(.001*n.y+O.textPadding.height)*this.data.boundingRadius,r=new THREE.PlaneGeometry(1,1,1,1),o=new THREE.MeshStandardMaterial;o.color=new THREE.Color(O.colors.black),o.transparent=!0,o.opacity=.9,o.flatShading=!0,o.roughness=1,o.depthTest=!1;var a=new THREE.Mesh(r,o);a.scale.set((.001*n.x+O.textPadding.width)*this.data.boundingRadius,i,1),a.renderOrder=O.topLayerRenderOrder-1,a.position.add(new THREE.Vector3(0,i*(this.data.frustrumDistance/4),0)),this.el.object3D.add(a),this.state.hasUpdated=!0}}},tick:function(){this.tickFunction()},remove:function(){this.removeEventListeners()}}),AFRAME.registerComponent("al-billboard",{schema:{cameraPosition:{type:"string"},cameraTarget:{type:"string",default:"0 0 0"},controlsType:{type:"string",default:"orbit"},minFrameMS:{type:"number",default:15},worldPosition:{type:"string"}},init:function(){this.bindMethods(),this.addEventListeners(),this.tickFunction=AFRAME.utils.throttle(this.tickFunction,this.data.minFrameMS,this)},bindMethods:function(){},addEventListeners:function(){},removeEventListeners:function(){},tickFunction:function(){var t=this.el.sceneEl.camera,e=this.el.object3D,n=I.stringToVector3(this.data.worldPosition),i=I.stringToVector3(this.data.cameraPosition);I.lookToFrustrumSpace(e,t,n,i),e.up.copy(this.el.sceneEl.camera.up)},tick:function(){this.tickFunction()},remove:function(){this.removeEventListeners()}});var Ac="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function Lc(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}var Cc=function(t,e){return function(t,e){(function(){var n=void 0!==Lc,i=this.THREE||n&&Sc;if(!i)throw new Error("MeshLine requires three.js");function r(){i.BufferGeometry.call(this),this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._vertices=[],this._bufferArray=[],this.widthCallback=null,this.matrixWorld=new i.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this},set:function(t){this.setFromGeometry(t)}},vertices:{enumerable:!0,get:function(){return this._vertices},set:function(t){this.setVertices(t)}},bufferArray:{enumerable:!0,get:function(){return this._bufferArray},set:function(t){this.setBufferArray(t)}}})}function o(t,e){var n=new i.Matrix4,r=new i.Ray,o=new i.Sphere,a=new i.Vector3,s=this.geometry;if(o.copy(s.boundingSphere),o.applyMatrix4(this.matrixWorld),!1!==t.ray.intersectSphere(o,a)){n.getInverse(this.matrixWorld),r.copy(t.ray).applyMatrix4(n);var l=new i.Vector3,c=new i.Vector3,h=new i.Vector3,u=this instanceof i.LineSegments?2:1,d=s.index,p=s.attributes;if(null!==d)for(var f=d.array,m=p.position.array,g=p.width.array,v=0,y=f.length-1;v<y;v+=u){var b=f[v],x=f[v+1];l.fromArray(m,3*b),c.fromArray(m,3*x);var w=null!=g[Math.floor(v/3)]?g[Math.floor(v/3)]:1,E=t.params.Line.threshold+this.material.lineWidth*w/2,_=E*E;if(!(r.distanceSqToSegment(l,c,a,h)>_)){a.applyMatrix4(this.matrixWorld);var M=t.ray.origin.distanceTo(a);M<t.near||M>t.far||(e.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=y)}}}}function a(t,e,n,i,r){var o;if(t=t.subarray||t.slice?t:t.buffer,n=n.subarray||n.slice?n:n.buffer,t=e?t.subarray?t.subarray(e,r&&e+r):t.slice(e,r&&e+r):t,n.set)n.set(t,i);else for(o=0;o<t.length;o++)n[o+i]=t[o];return n}function s(t){i.ShaderMaterial.call(this,{uniforms:Object.assign({},i.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new i.Color(16777215)},opacity:{value:1},resolution:{value:new i.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new i.Vector2(1,1)}}),vertexShader:i.ShaderChunk.meshline_vert,fragmentShader:i.ShaderChunk.meshline_frag}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=0!==t?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(t)}r.prototype=Object.create(i.BufferGeometry.prototype),r.prototype.constructor=r,r.prototype.isMeshLine=!0,r.prototype.setMatrixWorld=function(t){this.matrixWorld=t},r.prototype.setFromGeometry=function(t,e){t instanceof i.Geometry&&this.setVertices(t.vertices,e),t instanceof i.BufferGeometry&&this.setBufferArray(t.getAttribute("position").array,e),(t instanceof Float32Array||t instanceof Array)&&this.setBufferArray(t,e)},r.prototype.setGeometry=function(t,e){this.setFromGeometry(t,e)},r.prototype.setVertices=function(t,e){this._vertices=t,this.widthCallback=e||this.widthCallback,this.positions=[],this.counters=[];for(var n=0;n<t.length;n++){var i=t[n],r=n/t.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(r),this.counters.push(r)}this.process()},r.prototype.setBufferArray=function(t,e){this._bufferArray=t,this.widthCallback=e||this.widthCallback,this.positions=[],this.counters=[];for(var n=0;n<t.length;n+=3){var i=n/t.length;this.positions.push(t[n],t[n+1],t[n+2]),this.positions.push(t[n],t[n+1],t[n+2]),this.counters.push(i),this.counters.push(i)}this.process()},r.prototype.raycast=o,r.prototype.compareV3=function(t,e){var n=6*t,i=6*e;return this.positions[n]===this.positions[i]&&this.positions[n+1]===this.positions[i+1]&&this.positions[n+2]===this.positions[i+2]},r.prototype.copyV3=function(t){var e=6*t;return[this.positions[e],this.positions[e+1],this.positions[e+2]]},r.prototype.process=function(){var t,e,n=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],e=this.compareV3(0,n-1)?this.copyV3(n-2):this.copyV3(0),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);for(var r=0;r<n;r++){if(this.side.push(1),this.side.push(-1),t=this.widthCallback?this.widthCallback(r/(n-1)):1,this.width.push(t),this.width.push(t),this.uvs.push(r/(n-1),0),this.uvs.push(r/(n-1),1),r<n-1){e=this.copyV3(r),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);var o=2*r;this.indices_array.push(o,o+1,o+2),this.indices_array.push(o+2,o+1,o+3)}r>0&&(e=this.copyV3(r),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]))}e=this.compareV3(n-1,0)?this.copyV3(1):this.copyV3(n-1),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]),this._attributes&&this._attributes.position.count===this.positions.length?(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0):this._attributes={position:new i.BufferAttribute(new Float32Array(this.positions),3),previous:new i.BufferAttribute(new Float32Array(this.previous),3),next:new i.BufferAttribute(new Float32Array(this.next),3),side:new i.BufferAttribute(new Float32Array(this.side),1),width:new i.BufferAttribute(new Float32Array(this.width),1),uv:new i.BufferAttribute(new Float32Array(this.uvs),2),index:new i.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new i.BufferAttribute(new Float32Array(this.counters),1)},this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()},r.prototype.advance=function(t){var e=this._attributes.position.array,n=this._attributes.previous.array,i=this._attributes.next.array,r=e.length;a(e,0,n,0,r),a(e,6,e,0,r-6),e[r-6]=t.x,e[r-5]=t.y,e[r-4]=t.z,e[r-3]=t.x,e[r-2]=t.y,e[r-1]=t.z,a(e,6,i,0,r-6),i[r-6]=t.x,i[r-5]=t.y,i[r-4]=t.z,i[r-3]=t.x,i[r-2]=t.y,i[r-1]=t.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0},i.ShaderChunk.meshline_vert=["",i.ShaderChunk.logdepthbuf_pars_vertex,i.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {","","    vec2 res = i.xy / i.w;","    res.x *= aspect;","\t vCounters = counters;","    return res;","","}","","void main() {","","    float aspect = resolution.x / resolution.y;","","    vColor = vec4( color, opacity );","    vUV = uv;","","    mat4 m = projectionMatrix * modelViewMatrix;","    vec4 finalPosition = m * vec4( position, 1.0 );","    vec4 prevPos = m * vec4( previous, 1.0 );","    vec4 nextPos = m * vec4( next, 1.0 );","","    vec2 currentP = fix( finalPosition, aspect );","    vec2 prevP = fix( prevPos, aspect );","    vec2 nextP = fix( nextPos, aspect );","","    float w = lineWidth * width;","","    vec2 dir;","    if( nextP == currentP ) dir = normalize( currentP - prevP );","    else if( prevP == currentP ) dir = normalize( nextP - currentP );","    else {","        vec2 dir1 = normalize( currentP - prevP );","        vec2 dir2 = normalize( nextP - currentP );","        dir = normalize( dir1 + dir2 );","","        vec2 perp = vec2( -dir1.y, dir1.x );","        vec2 miter = vec2( -dir.y, dir.x );","        //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );","","    }","","    //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;","    vec4 normal = vec4( -dir.y, dir.x, 0., 1. );","    normal.xy *= .5 * w;","    normal *= projectionMatrix;","    if( sizeAttenuation == 0. ) {","        normal.xy *= finalPosition.w;","        normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;","    }","","    finalPosition.xy += normal.xy * side;","","    gl_Position = finalPosition;","",i.ShaderChunk.logdepthbuf_vertex,i.ShaderChunk.fog_vertex&&"    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",i.ShaderChunk.fog_vertex,"}"].join("\n"),i.ShaderChunk.meshline_frag=["",i.ShaderChunk.fog_pars_fragment,i.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",i.ShaderChunk.logdepthbuf_fragment,"","    vec4 c = vColor;","    if( useMap == 1. ) c *= texture2D( map, vUV * repeat );","    if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;","    if( c.a < alphaTest ) discard;","    if( useDash == 1. ){","        c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));","    }","    gl_FragColor = c;","    gl_FragColor.a *= step(vCounters, visibility);","",i.ShaderChunk.fog_fragment,"}"].join("\n"),s.prototype=Object.create(i.ShaderMaterial.prototype),s.prototype.constructor=s,s.prototype.isMeshLineMaterial=!0,s.prototype.copy=function(t){return i.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this},t.exports&&(e=t.exports={MeshLine:r,MeshLineMaterial:s,MeshLineRaycast:o}),e.MeshLine=r,e.MeshLineMaterial=s,e.MeshLineRaycast=o}).call(Ac)}(e={exports:{}},e.exports),e.exports}(),Pc=Cc.MeshLine,Rc=Cc.MeshLineMaterial;function Oc(t,e,n,i){t&&(e=e||[],t.traverse((function(t){var r;t.isMesh&&((r=t.material)?Array.isArray(r)?r:r.materials?r.materials:[r]:[]).forEach((function(t){t&&!("envMap"in t)||e.length&&-1===e.indexOf(t.name)||(t.envMap=n,t.reflectivity=i,t.needsUpdate=!0)}))})))}AFRAME.registerComponent("al-bounding-box",{schema:{boundingBoxWidth:{type:"number",default:2},color:{type:"string",default:"#fff"},scale:{type:"string"},enabled:{type:"boolean",default:!0},topLayerRenderOrder:{type:"number",default:999}},init:function(){this.bindMethods(),this.addEventListeners(),this.state={box:new THREE.Box3}},bindMethods:function(){},addEventListeners:function(){},removeEventListeners:function(){},update:function(){var t=this,e=this.el,n=this.state,i=AFRAME.utils.coordinates.parse(this.data.scale);n.box.setFromCenterAndSize(new THREE.Vector3(0,0,0),i);var r=new THREE.BoxGeometry(i.x,i.y,i.z),o=new THREE.MeshBasicMaterial({color:this.data.color,visible:!1}),a=new THREE.Mesh(r,o);e.setObject3D("mesh",a);var s=new THREE.Mesh;s.renderOrder=this.data.topLayerRenderOrder-5;var l=new Rc({color:new THREE.Color(this.data.color),alphaTest:0,resolution:new THREE.Vector2(this.el.sceneEl.canvas.clientWidth,this.el.sceneEl.canvas.clientHeight),sizeAttenuation:0,lineWidth:this.data.boundingBoxWidth}),c=new THREE.Vector3(i.x,i.y,i.z).multiplyScalar(.5),h=new THREE.Vector3(-i.x,i.y,i.z).multiplyScalar(.5),u=new THREE.Vector3(i.x,i.y,-i.z).multiplyScalar(.5),d=new THREE.Vector3(-i.x,i.y,-i.z).multiplyScalar(.5),p=new THREE.Vector3(i.x,-i.y,i.z).multiplyScalar(.5),f=new THREE.Vector3(-i.x,-i.y,i.z).multiplyScalar(.5),m=new THREE.Vector3(i.x,-i.y,-i.z).multiplyScalar(.5),g=new THREE.Vector3(-i.x,-i.y,-i.z).multiplyScalar(.5),v=new THREE.Geometry;v.vertices.push(c),v.vertices.push(h);var y=new Pc;y.setGeometry(v,(function(e){return t.data.boundingBoxWidth}));var b=new THREE.Mesh(y.geometry,l);s.add(b);var x=new THREE.Geometry;x.vertices.push(c),x.vertices.push(u);var w=new Pc;w.setGeometry(x,(function(e){return t.data.boundingBoxWidth}));var E=new THREE.Mesh(w.geometry,l);s.add(E);var _=new THREE.Geometry;_.vertices.push(c),_.vertices.push(p);var M=new Pc;M.setGeometry(_,(function(e){return t.data.boundingBoxWidth}));var S=new THREE.Mesh(M.geometry,l);s.add(S);var T=new THREE.Geometry;T.vertices.push(d),T.vertices.push(h);var A=new Pc;A.setGeometry(T,(function(e){return t.data.boundingBoxWidth}));var L=new THREE.Mesh(A.geometry,l);s.add(L);var C=new THREE.Geometry;C.vertices.push(d),C.vertices.push(u);var P=new Pc;P.setGeometry(C,(function(e){return t.data.boundingBoxWidth}));var R=new THREE.Mesh(P.geometry,l);s.add(R);var O=new THREE.Geometry;O.vertices.push(d),O.vertices.push(g);var I=new Pc;I.setGeometry(O,(function(e){return t.data.boundingBoxWidth}));var D=new THREE.Mesh(I.geometry,l);s.add(D);var k=new THREE.Geometry;k.vertices.push(g),k.vertices.push(f);var N=new Pc;N.setGeometry(k,(function(e){return t.data.boundingBoxWidth}));var z=new THREE.Mesh(N.geometry,l);s.add(z);var B=new THREE.Geometry;B.vertices.push(g),B.vertices.push(m);var H=new Pc;H.setGeometry(B,(function(e){return t.data.boundingBoxWidth}));var F=new THREE.Mesh(H.geometry,l);s.add(F);var j=new THREE.Geometry;j.vertices.push(p),j.vertices.push(m);var U=new Pc;U.setGeometry(j,(function(e){return t.data.boundingBoxWidth}));var G=new THREE.Mesh(U.geometry,l);s.add(G);var V=new THREE.Geometry;V.vertices.push(p),V.vertices.push(f);var W=new Pc;W.setGeometry(V,(function(e){return t.data.boundingBoxWidth}));var Y=new THREE.Mesh(W.geometry,l);s.add(Y);var X=new THREE.Geometry;X.vertices.push(h),X.vertices.push(f);var q=new Pc;q.setGeometry(X,(function(e){return t.data.boundingBoxWidth}));var Z=new THREE.Mesh(q.geometry,l);s.add(Z);var J=new THREE.Geometry;J.vertices.push(u),J.vertices.push(m);var Q=new Pc;Q.setGeometry(J,(function(e){return t.data.boundingBoxWidth}));var K=new THREE.Mesh(Q.geometry,l);s.add(K),n.mesh=s,n.material=l,this.data.enabled?e.setObject3D("bbox",s):e.object3DMap.bbox&&e.removeObject3D("bbox")},remove:function(){this.removeEventListeners(),this.el.removeObject3D("mesh")}}),AFRAME.registerComponent("al-child-hover-visible",{schema:{minFrameMS:{type:"number",default:15},nodeLabelsAlwaysVisible:{type:"boolean",default:!1}},init:function(){this.tickFunction=AFRAME.utils.throttle(this.tickFunction,this.data.minFrameMS,this),this.bindMethods(),this.addEventListeners(),this.hovered=!1},bindMethods:function(){this.pointerOver=this.pointerOver.bind(this),this.pointerOut=this.pointerOut.bind(this)},addEventListeners:function(){this.el.addEventListener("raycaster-intersected",this.pointerOver,{capture:!0,once:!1,passive:!0}),this.el.addEventListener("raycaster-intersected-cleared",this.pointerOut,{capture:!1,once:!1,passive:!0})},removeEventListeners:function(){this.el.removeEventListener("raycaster-intersected",this.pointerOver),this.el.removeEventListener("raycaster-intersected-cleared",this.pointerOut)},pointerOver:function(t){this.hovered=!0},pointerOut:function(t){this.hovered=!1},tickFunction:function(){var t=this.el.firstChild.firstChild;if(t){var e=t.object3D;this.hovered||this.data.nodeLabelsAlwaysVisible?e.visible=!0:e.visible=!1}},tick:function(){this.tickFunction()},remove:function(){this.removeEventListeners()}}),AFRAME.registerComponent("al-control-lights",{schema:{color:{type:"string",default:"#fff"},controlsType:{type:"string",default:"orbit"},lightIntensity:{type:"number",default:.8},minFrameMS:{type:"number",default:15}},init:function(){this.bindMethods(),this.addEventListeners(),this.tickFunction=AFRAME.utils.throttle(this.tickFunction,this.data.minFrameMS,this);var t=this.el.getObject3D("camera"),e=new THREE.DirectionalLight(new THREE.Color(this.data.color),this.data.lightIntensity);e.position.copy(new THREE.Vector3(1,1,1)),t.add(e);var n=new THREE.DirectionalLight(new THREE.Color(this.data.color),this.data.lightIntensity);n.position.copy(new THREE.Vector3(-1,-1,-1)),t.add(n)},bindMethods:function(){},addEventListeners:function(){},removeEventListeners:function(){},update:function(t){this.data.controlsType!==t.controlsType&&this.el.object3D.up.copy(this.el.sceneEl.camera.up.clone())},tick:function(){},remove:function(){}}),AFRAME.registerComponent("al-cube-env-map",{multiple:!0,schema:{path:{default:""},extension:{default:"jpg",oneOf:["jpg","png"]},format:{default:"RGBFormat",oneOf:["RGBFormat","RGBAFormat"]},enableBackground:{default:!1},reflectivity:{default:1,min:0,max:1},materials:{default:[]}},init:function(){var t=this,e=this.data;e.path&&(this.texture=(new THREE.CubeTextureLoader).load([e.path+"posx."+e.extension,e.path+"negx."+e.extension,e.path+"posy."+e.extension,e.path+"negy."+e.extension,e.path+"posz."+e.extension,e.path+"negz."+e.extension]),this.texture.format=THREE[e.format],this.object3dsetHandler=function(){var e=t.el.getObject3D("mesh"),n=t.data;Oc(e,n.materials,t.texture,n.reflectivity)},this.el.addEventListener("object3dset",this.object3dsetHandler))},update:function(t){var e=this.data,n=this.el.getObject3D("mesh"),i=[],r=[];if(e.materials.length&&(t.materials?(i=e.materials.filter((function(e){return!t.materials.includes(e)})),r=t.materials.filter((function(t){return!e.materials.includes(t)}))):i=e.materials),i.length&&Oc(n,i,this.texture,e.reflectivity),r.length&&Oc(n,r,null,1),t.materials&&e.reflectivity!==t.reflectivity){var o=e.materials.filter((function(e){return t.materials.includes(e)}));o.length&&Oc(n,o,this.texture,e.reflectivity)}this.data.enableBackground&&!t.enableBackground?this.setBackground(this.texture):!this.data.enableBackground&&t.enableBackground&&this.setBackground(null)},remove:function(){this.el.removeEventListener("object3dset",this.object3dsetHandler);var t=this.el.getObject3D("mesh"),e=this.data;Oc(t,e.materials,null,1),e.enableBackground&&this.setBackground(null)},setBackground:function(t){this.el.sceneEl.object3D.background=t}});var Ic,Dc,kc,Nc,zc="click",Bc="mouseup",Hc="cursor-fusing",Fc="cursor-hovering",jc="cursor-hovered",Uc={DOWN:["mousedown","touchstart"],UP:["mouseup","touchend"]},Gc="a-mouse-cursor-hover";AFRAME.registerComponent("al-cursor",{dependencies:["raycaster"],schema:{downEvents:{default:[]},fuse:{default:AFRAME.utils.device.isMobile()},fuseTimeout:{default:1500,min:0},mouseCursorStylesEnabled:{default:!0},upEvents:{default:[]},rayOrigin:{default:"entity",oneOf:["mouse","entity"]}},init:function(){var t=this;this.fuseTimeout=void 0,this.cursorDownEl=null,this.intersectedEl=null,this.canvasBounds=document.body.getBoundingClientRect(),this.isCursorDown=!1,this.updateCanvasBounds=AFRAME.utils.debounce((function(){t.canvasBounds=t.el.sceneEl.canvas.getBoundingClientRect()}),500),this.eventDetail={},this.intersectedEventDetail={cursorEl:this.el},this.onCursorDown=AFRAME.utils.bind(this.onCursorDown,this),this.onCursorUp=AFRAME.utils.bind(this.onCursorUp,this),this.onIntersection=AFRAME.utils.bind(this.onIntersection,this),this.onIntersectionCleared=AFRAME.utils.bind(this.onIntersectionCleared,this),this.onMouseMove=AFRAME.utils.bind(this.onMouseMove,this)},update:function(t){this.data.rayOrigin!==t.rayOrigin&&this.updateMouseEventListeners()},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},remove:function(){var t=this.el;t.removeState(Fc),t.removeState(Hc),clearTimeout(this.fuseTimeout),this.intersectedEl&&this.intersectedEl.removeState(jc),this.removeEventListeners()},addEventListeners:function(){var t,e=this.data,n=this.el,i=this;function r(){t=n.sceneEl.canvas,e.downEvents.length||e.upEvents.length||(Uc.DOWN.forEach((function(e){t.addEventListener(e,i.onCursorDown)})),Uc.UP.forEach((function(e){t.addEventListener(e,i.onCursorUp)})))}(t=n.sceneEl.canvas)?r():n.sceneEl.addEventListener("render-target-loaded",r),e.downEvents.forEach((function(t){n.addEventListener(t,i.onCursorDown)})),e.upEvents.forEach((function(t){n.addEventListener(t,i.onCursorUp)})),n.addEventListener("raycaster-intersection",this.onIntersection),n.addEventListener("raycaster-intersection-cleared",this.onIntersectionCleared),n.sceneEl.addEventListener("rendererresize",this.updateCanvasBounds),window.addEventListener("resize",this.updateCanvasBounds),window.addEventListener("scroll",this.updateCanvasBounds),this.updateMouseEventListeners()},removeEventListeners:function(){var t,e=this.data,n=this.el,i=this;!(t=n.sceneEl.canvas)||e.downEvents.length||e.upEvents.length||(Uc.DOWN.forEach((function(e){t.removeEventListener(e,i.onCursorDown)})),Uc.UP.forEach((function(e){t.removeEventListener(e,i.onCursorUp)}))),e.downEvents.forEach((function(t){n.removeEventListener(t,i.onCursorDown)})),e.upEvents.forEach((function(t){n.removeEventListener(t,i.onCursorUp)})),n.removeEventListener("raycaster-intersection",this.onIntersection),n.removeEventListener("raycaster-intersection-cleared",this.onIntersectionCleared),t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("touchstart",this.onMouseMove),t.removeEventListener("touchmove",this.onMouseMove),n.sceneEl.removeEventListener("rendererresize",this.updateCanvasBounds),window.removeEventListener("resize",this.updateCanvasBounds),window.removeEventListener("scroll",this.updateCanvasBounds)},updateMouseEventListeners:function(){var t,e=this.el;(t=e.sceneEl.canvas).removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("touchmove",this.onMouseMove),e.setAttribute("raycaster","useWorldCoordinates",!1),e.setAttribute("raycaster","far",1e3),"mouse"===this.data.rayOrigin&&(t.addEventListener("mousemove",this.onMouseMove,!1),t.addEventListener("touchmove",this.onMouseMove,!1),e.setAttribute("raycaster","useWorldCoordinates",!0),e.setAttribute("raycaster","far",1e5),this.updateCanvasBounds())},onMouseMove:(Ic=new THREE.Vector3,Dc=new THREE.Vector2,kc=new THREE.Vector3,Nc={origin:kc,direction:Ic},function(t){var e,n,i,r=this.canvasBounds,o=this.el.sceneEl.camera;o.parent.updateMatrixWorld(),e=(n="touchmove"===t.type||"touchstart"===t.type?t.touches.item(0):t).clientX-r.left,i=n.clientY-r.top,Dc.x=e/r.width*2-1,Dc.y=-i/r.height*2+1,kc.setFromMatrixPosition(o.matrixWorld),Ic.set(Dc.x,Dc.y,.5).unproject(o).sub(kc).normalize(),this.el.setAttribute("raycaster",Nc),"touchmove"===t.type&&t.preventDefault()}),onCursorDown:function(t){this.isCursorDown=!0,"mouse"===this.data.rayOrigin&&"touchstart"===t.type&&(this.onMouseMove(t),this.el.components.raycaster.checkIntersections(),t.preventDefault()),this.twoWayEmit("mousedown"),this.cursorDownEl=this.intersectedEl},onCursorUp:function(t){if(this.isCursorDown){this.isCursorDown=!1;var e=this.data;this.twoWayEmit(Bc),this.cursorDownEl&&this.cursorDownEl!==this.intersectedEl&&(this.intersectedEventDetail.intersection=null,this.cursorDownEl.emit(Bc,this.intersectedEventDetail)),e.fuse&&"mouse"!==e.rayOrigin||!this.intersectedEl||this.cursorDownEl!==this.intersectedEl||this.twoWayEmit(zc),this.cursorDownEl=null,"touchend"===t.type&&t.preventDefault()}},onIntersection:function(t){var e,n,i,r,o=this.el;n=t.detail.els[0]===o?1:0,r=t.detail.intersections[n],(i=t.detail.els[n])&&this.intersectedEl!==i&&(this.intersectedEl&&(e=this.el.components.raycaster.getIntersection(this.intersectedEl))&&e.distance<=r.distance||(this.clearCurrentIntersection(!0),this.setIntersection(i,r)))},onIntersectionCleared:function(t){-1!==t.detail.clearedEls.indexOf(this.intersectedEl)&&this.clearCurrentIntersection()},setIntersection:function(t){var e=this.el,n=this.data,i=this;this.intersectedEl!==t&&(this.intersectedEl=t,e.addState(Fc),t.addState(jc),this.twoWayEmit("mouseenter"),this.data.mouseCursorStylesEnabled&&"mouse"===this.data.rayOrigin&&this.el.sceneEl.canvas.classList.add(Gc),0!==n.fuseTimeout&&n.fuse&&(e.addState(Hc),this.twoWayEmit("fusing"),this.fuseTimeout=setTimeout((function(){e.removeState(Hc),i.twoWayEmit(zc)}),n.fuseTimeout)))},clearCurrentIntersection:function(t){var e,n,i=this.el;this.intersectedEl&&(this.intersectedEl.removeState(jc),i.removeState(Fc),i.removeState(Hc),this.twoWayEmit("mouseleave"),this.data.mouseCursorStylesEnabled&&"mouse"===this.data.rayOrigin&&this.el.sceneEl.canvas.classList.remove(Gc),this.intersectedEl=null,clearTimeout(this.fuseTimeout),!0!==t&&0!==(n=this.el.components.raycaster.intersections).length&&(e=n[n[0].object.el===i?1:0])&&this.setIntersection(e.object.el,e))},twoWayEmit:function(t){var e,n=this.el,i=this.intersectedEl;e=this.el.components.raycaster.getIntersection(i),this.eventDetail.intersectedEl=i,this.eventDetail.intersection=e,n.emit(t,this.eventDetail),i&&(this.intersectedEventDetail.intersection=e,i.emit(t,this.intersectedEventDetail))}}),AFRAME.registerComponent("al-edge",{schema:{length:{type:"number"},minFrameMS:{type:"number",default:15},node1:{type:"vec3"},node2:{type:"vec3"},nodeScale:{type:"number"},radius:{type:"number"},scale:{type:"number"},selected:{type:"boolean"}},init:function(){this.tickFunction=AFRAME.utils.throttle(this.tickFunction,this.data.minFrameMS,this),this.bindMethods(),this.addEventListeners(),this.state={selected:!0,hovered:!1}},bindMethods:function(){this.pointerDown=this.pointerDown.bind(this),this.pointerOver=this.pointerOver.bind(this),this.pointerOut=this.pointerOut.bind(this),this.createMesh=this.createMesh.bind(this),this.getMatrix=this.getMatrix.bind(this)},addEventListeners:function(){this.el.sceneEl.addEventListener("mousedown",this.pointerDown,{capture:!1,once:!1,passive:!0}),this.el.addEventListener("raycaster-intersected",this.pointerOver,{capture:!0,once:!1,passive:!0}),this.el.addEventListener("raycaster-intersected-cleared",this.pointerOut,{capture:!1,once:!1,passive:!0})},removeEventListeners:function(){this.el.sceneEl.removeEventListener("mousedown",this.pointerDown),this.el.removeEventListener("raycaster-intersected",this.pointerOver),this.el.removeEventListener("raycaster-intersected-cleared",this.pointerOut)},pointerDown:function(t){this.state.hovered&&this.el.sceneEl.emit(N.SELECTED,{type:u.EDGE,id:this.el.id},!1)},pointerOver:function(t){this.state.hovered=!0,this.el.sceneEl.emit(N.POINTER_OVER,{id:this.el.id},!1)},pointerOut:function(t){this.state.hovered=!1,this.el.sceneEl.emit(N.POINTER_OUT,{},!1)},getMatrix:function(){var t=I.objectToVector3(this.data.node1),e=I.objectToVector3(this.data.node2),n=new THREE.Matrix4;n.makeScale(this.data.scale,this.data.scale,1);var i=new THREE.Matrix4;i.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);var r=new THREE.Matrix4;return r.lookAt(t,e,(new THREE.Object3D).up),r.multiply(n),r.multiply(i),r},createMesh:function(){var t=new THREE.CylinderGeometry(this.data.radius,this.data.radius,this.data.length,6,4),e=new THREE.MeshBasicMaterial,n=new THREE.Mesh(t,e);n.applyMatrix(this.getMatrix()),this.state.geometry=t,this.state.material=e,this.state.mesh=n;var i=new THREE.CylinderGeometry(this.data.radius,this.data.radius,this.data.length-2*this.data.nodeScale,6,4),r=Tc.getHaloMaterial(),o=new THREE.Mesh(i,r);this.state.outlineGeometry=i,this.state.outlineMaterialt=r,this.state.outlineMesh=o,n.add(o),this.el.setObject3D("mesh",n),this.el.object3D.renderOrder=O.topLayerRenderOrder-2},update:function(t){this.state.selected=this.data.selected,!t||t.radius===this.data.radius&&t.length===this.data.length&&t.scale===this.data.scale||this.createMesh()},tickFunction:function(){var t=this.el,e=this.state;e.hovered?e.material.color=new THREE.Color(O.buttonColors.hover):e.selected?e.material.color=new THREE.Color(O.buttonColors.active):e.material.color=new THREE.Color(O.buttonColors.up);var n=t.firstChild;if(n){var i=n.object3D;e.hovered?i.visible=!0:i.visible=!1}},tick:function(){this.tickFunction()},remove:function(){this.removeEventListeners(),this.el.removeObject3D("mesh")}});AFRAME.registerComponent("al-gltf-model",{schema:{src:{type:"model",default:""},dracoDecoderPath:{type:"string",default:""}},init:function(){this.bindMethods(),this.addEventListeners(),this.model=null,this.loader=new THREE.GLTFLoader,this.dracoLoader=new THREE.DRACOLoader,this.dracoLoader.setDecoderPath(this.data.dracoDecoderPath),this.loader.setDRACOLoader(this.dracoLoader)},bindMethods:function(){},addEventListeners:function(){},removeEventListeners:function(){},update:function(t){var e=this,n=this.el,i=this.data.src;t&&t.src!==i&&(this.remove(),this.loader.load(i,(function(t){e.model=t.scene||t.scenes[0],e.model.animations=t.animations,n.setObject3D("mesh",e.model),n.sceneEl.emit("al-model-loaded",{format:"gltf",model:e.model},!1)}),void 0,(function(t){var e=t&&t.message?t.message:"Failed to load glTF model";console.warn(e),n.sceneEl.emit("al-model-error",{format:"gltf",src:i},!1)})))},remove:function(){this.model&&(this.removeEventListeners(),this.el.removeObject3D("mesh"))}}),AFRAME.registerComponent("al-node",{schema:{graphEnabled:{type:"boolean"},minFrameMS:{type:"number",default:15},scale:{type:"number",default:1},selected:{type:"boolean"}},init:function(){this.tickFunction=AFRAME.utils.throttle(this.tickFunction,this.data.minFrameMS,this),this.bindMethods(),this.addEventListeners();var t=this.data,e=this.el,n=e.sceneEl.camera.el.object3DMap.camera;t.scale<O.nodeMinSize&&(t.scale=O.nodeMinSize);var i=new THREE.SphereGeometry(t.scale,16,16),r=new THREE.MeshBasicMaterial,o=new THREE.Mesh(i,r),a=new THREE.SphereGeometry(t.scale,16,16),s=Tc.getHaloMaterial(),l=new THREE.Mesh(a,s);o.add(l),e.setObject3D("mesh",o),e.object3D.renderOrder=O.topLayerRenderOrder-1,this.state={selected:!0,hovered:!1,geometry:i,material:r,mesh:o,outlineGeometry:a,outlineMaterial:s,outlineMesh:l,camera:n,dragging:!1}},bindMethods:function(){this.pointerDown=this.pointerDown.bind(this),this.pointerUp=this.pointerUp.bind(this),this.pointerOver=this.pointerOver.bind(this),this.pointerOut=this.pointerOut.bind(this)},addEventListeners:function(){this.el.sceneEl.addEventListener("mousedown",this.pointerDown,{capture:!1,once:!1,passive:!0}),this.el.addEventListener("mouseup",this.pointerUp,{capture:!1,once:!1,passive:!0}),this.el.sceneEl.addEventListener("mouseup",this.pointerUp,{capture:!1,once:!1,passive:!0}),this.el.addEventListener("raycaster-intersected",this.pointerOver,{capture:!0,once:!1,passive:!0}),this.el.addEventListener("raycaster-intersected-cleared",this.pointerOut,{capture:!1,once:!1,passive:!0})},removeEventListeners:function(){this.el.sceneEl.removeEventListener("mousedown",this.pointerDown),this.el.sceneEl.removeEventListener("mouseup",this.pointerUp),this.el.removeEventListener("mouseup",this.pointerUp),this.el.removeEventListener("raycaster-intersected",this.pointerOver),this.el.removeEventListener("raycaster-intersected-cleared",this.pointerOut)},pointerDown:function(t){this.state.hovered&&(this.el.sceneEl.emit(N.SELECTED,{type:u.NODE,id:this.el.id},!0),this.data.graphEnabled&&(this.state.mouseDown=!0,this.el.sceneEl.emit(N.POINTER_DOWN,{},!0)))},pointerUp:function(t){var e=this.state;this.data.graphEnabled&&(e.dragging=!1,e.mouseDown=!1,this.el.sceneEl.emit(N.POINTER_UP,{},!0))},pointerOver:function(t){this.state.hovered=!0,this.el.sceneEl.emit(N.POINTER_OVER,{id:this.el.id},!0)},pointerOut:function(t){var e=this.state;e.hovered=!1,e.mouseDown&&e.selected&&(e.dragging=!0),this.el.sceneEl.emit(N.POINTER_OUT,{},!0)},update:function(){this.state.selected=this.data.selected},tickFunction:function(){var t=this.el,e=this.state;this.data.graphEnabled&&e.dragging&&this.el.sceneEl.emit(N.DRAGGED,{id:this.el.id},!0),e.hovered||e.dragging?e.material.color=new THREE.Color(O.buttonColors.hover):e.selected?e.material.color=new THREE.Color(O.buttonColors.active):e.material.color=new THREE.Color(O.buttonColors.up);var n=t.firstChild;if(n){var i=n.object3D;e.hovered||e.dragging?i.visible=!0:i.visible=!1}},tick:function(){this.tickFunction()},remove:function(){this.removeEventListeners(),this.el.removeObject3D("mesh")}}),AFRAME.registerComponent("al-node-spawner",{schema:{graphEnabled:{type:"boolean"},minFrameMS:{type:"number",default:15}},init:function(){this.bindMethods(),this.addEventListeners(),this.state={left:!1,intersecting:!1}},bindMethods:function(){this.canvasMouseDown=this.canvasMouseDown.bind(this),this.pointerOver=this.pointerOver.bind(this),this.pointerOut=this.pointerOut.bind(this),this.elClick=this.elClick.bind(this),this.canvasMouseUp=this.canvasMouseUp.bind(this),this.pointerDown=this.pointerDown.bind(this),this.pointerUp=this.pointerUp.bind(this)},addEventListeners:function(){this.el.sceneEl.canvas.addEventListener("mousedown",this.canvasMouseDown,{capture:!1,once:!1,passive:!0}),this.el.sceneEl.canvas.addEventListener("mouseup",this.canvasMouseUp,{capture:!1,once:!1,passive:!0}),this.el.addEventListener("raycaster-intersected",this.pointerOver,{capture:!1,once:!1,passive:!0}),this.el.addEventListener("raycaster-intersected-cleared",this.pointerOut,!1),this.el.addEventListener("click",this.elClick,{capture:!1,once:!1,passive:!0}),this.el.addEventListener("mousedown",this.pointerDown,{capture:!1,once:!1,passive:!0}),this.el.addEventListener("mouseup",this.pointerUp,{capture:!1,once:!1,passive:!0})},removeEventListeners:function(){this.el.sceneEl.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.el.sceneEl.canvas.removeEventListener("mouseup",this.canvasMouseUp),this.el.removeEventListener("raycaster-intersected",this.pointerOver),this.el.removeEventListener("raycaster-intersected-cleared",this.pointerOut),this.el.removeEventListener("click",this.elClick),this.el.removeEventListener("mousedown",this.pointerDown),this.el.removeEventListener("mouseup",this.pointerUp)},canvasMouseDown:function(t){this.state.left=0===t.button},canvasMouseUp:function(t){var e=this;setTimeout((function(){e.state.left=!1}),this.data.minFrameMS)},pointerOver:function(t){this.state.intersecting=!0,this.el.sceneEl.emit("al-valid-target",{valid:!0},!1)},pointerOut:function(t){this.state.intersecting=!1,this.el.sceneEl.emit("al-valid-target",{valid:!1},!1)},pointerDown:function(t){this.data.graphEnabled&&this.el.sceneEl.emit("al-graph-pointer-down",{},!1)},pointerUp:function(t){this.data.graphEnabled&&this.el.sceneEl.emit("al-graph-pointer-up",{},!1)},elClick:function(t){this.state.left&&this.data.graphEnabled&&this.el.sceneEl.emit("al-add-node",{aframeEvent:t},!1)},remove:function(){this.removeEventListeners()}});var Vc="al-control-interaction",Wc="al-control-interaction-finished",Yc="al-controls-animation-started";AFRAME.registerComponent("al-orbit-control",{dependencies:["camera"],schema:{animating:{type:"boolean",default:!1},autoRotate:{type:"boolean"},autoRotateSpeed:{default:2},controlPosition:{type:"vec3"},controlTarget:{type:"vec3"},dampingFactor:{default:.1},enabled:{default:!0},enableDamping:{default:!0},enableKeys:{default:!0},enablePan:{default:!0},enableRotate:{default:!0},enableZoom:{default:!0},keyPanSpeed:{default:7},maxAzimuthAngle:{type:"number",default:1/0},maxDistance:{default:8e3},maxPolarAngle:{default:88},minAzimuthAngle:{type:"number",default:-1/0},minDistance:{default:1},minFrameMS:{type:"number",default:15},minPolarAngle:{default:0},panSpeed:{default:1},rotateSpeed:{default:.05},screenSpacePanning:{default:!1},zoomSpeed:{type:"number",default:.5}},bindMethods:function(){this.canvasWheel=this.canvasWheel.bind(this),this.getCameraState=this.getCameraState.bind(this),this.handleAnimationCache=this.handleAnimationCache.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseUp=this.mouseUp.bind(this),this.objectToVector3=this.objectToVector3.bind(this),this.onWheel=this.onWheel.bind(this)},objectToVector3:function(t){var e=new THREE.Vector3;return e.x=t.x,e.y=t.y,e.z=t.z,e},addListeners:function(){window.addEventListener("mouseup",this.mouseUp,{capture:!1,once:!1,passive:!0}),window.addEventListener("mousemove",this.mouseMove,{capture:!1,once:!1,passive:!0}),this.el.sceneEl.canvas.addEventListener("mousedown",this.mouseDown,{capture:!1,once:!1,passive:!0}),this.el.sceneEl.canvas.addEventListener("wheel",this.canvasWheel,{capture:!1,once:!1,passive:!0}),this.el.sceneEl.addEventListener(Yc,this.handleAnimationCache,!1)},removeListeners:function(){window.removeEventListener("mouseup",this.mouseUp),window.removeEventListener("mousemove",this.mouseMove),this.el.sceneEl.canvas.removeEventListener("mousedown",this.mouseDown),this.el.sceneEl.canvas.removeEventListener("wheel",this.canvasWheel),this.el.sceneEl.removeEventListener(Yc,this.handleAnimationCache,!1)},handleAnimationCache:function(t){this.state.animationCache=t.detail.slerpPath},mouseUp:function(t){document.body.style.cursor="grab",this.state.controls.enabled&&this.el.sceneEl.emit(Wc,{cameraState:this.getCameraState(),needsRender:this.state.mouseDown},!1),this.state.mouseDown=!1},mouseDown:function(t){this.state.mouseDown=!0,document.body.style.cursor="grabbing"},mouseMove:function(t){this.state.mouseDown&&this.el.sceneEl.emit(Vc,{cameraState:this.getCameraState(),needsRender:this.state.mouseDown},!1)},onWheel:function(){var t=this,e=this.state;e.wheelMarker=!1,e.wheelCounter2=e.wheelCounter1,setTimeout((function(){e.wheelCounter2===e.wheelCounter1?(e.wheelMarker=!0,e.wheelCounter1=0,e.wheelCounter2=0,t.el.sceneEl.emit(Wc,{cameraState:t.getCameraState(),needsRender:!0},!1)):t.onWheel()}),e.wheelInterval)},canvasWheel:function(t){var e=this.state;e.wheelCounter1+=1,e.wheelMarker&&this.onWheel(),this.el.sceneEl.emit(Vc,{cameraState:this.getCameraState(),needsRender:!0},!1)},init:function(){var t=this,e=this.el,n=this.data;document.body.style.cursor="grab",this.tickFunction=AFRAME.utils.throttle(this.tickFunction,this.data.minFrameMS,this);var i=new THREE.OrbitControls(e.getObject3D("camera"),e.sceneEl.renderer.domElement),r=this.objectToVector3(n.controlPosition),o=this.objectToVector3(n.controlTarget);i.object.position.copy(r),e.getObject3D("camera").position.copy(r),i.target.copy(o),this.state={animationCache:[],controls:i,mouseDown:!1,wheelCounter1:0,wheelCounter2:void 0,wheelInterval:50,wheelMarker:!0},this.bindMethods(),this.addListeners(),setTimeout((function(){t.el.sceneEl.emit(Vc,{cameraState:t.getCameraState(),needsRender:!1},!1)}),this.data.minFrameMS)},getCameraState:function(){return{position:this.state.controls.object.position,target:this.state.controls.target}},update:function(t){var e=this.state.controls,n=this.data;e.target=this.objectToVector3(n.controlTarget),e.autoRotate=n.autoRotate,e.autoRotateSpeed=n.autoRotateSpeed,e.dampingFactor=n.dampingFactor,e.enabled=n.enabled,e.enableDamping=n.enableDamping,e.enableKeys=n.enableKeys,e.enablePan=n.enablePan,e.enableRotate=n.enableRotate,e.enableZoom=n.enableZoom,e.keyPanSpeed=n.keyPanSpeed,e.maxPolarAngle=THREE.Math.degToRad(n.maxPolarAngle),e.maxAzimuthAngle=THREE.Math.degToRad(n.maxAzimuthAngle),e.maxDistance=n.maxDistance,e.minDistance=n.minDistance,e.minPolarAngle=THREE.Math.degToRad(n.minPolarAngle),e.minAzimuthAngle=THREE.Math.degToRad(n.minAzimuthAngle),e.panSpeed=n.panSpeed,e.rotateSpeed=n.rotateSpeed,e.screenSpacePanning=n.screenSpacePanning,e.zoomSpeed=n.zoomSpeed,this.el.getObject3D("camera").position.copy(this.objectToVector3(n.controlPosition))},tickFunction:function(){var t=this.state.controls;if(t.enabled){if(this.data.animating){var e=this.state.animationCache.shift();e&&e.position&&e.target&&(t.object.position.copy(e.position),this.el.getObject3D("camera").position.copy(e.position),t.target.copy(e.target),this.el.sceneEl.emit(Vc,{cameraState:this.getCameraState(),needsRender:!0},!1)),0===this.state.animationCache.length&&(this.el.sceneEl.emit("al-controls-animation-finished",{},!1),this.el.sceneEl.emit(Wc,{cameraState:this.getCameraState(),needsRender:!0},!1))}t.enabled&&(t.enableDamping||t.autoRotate)&&t.update()}},tick:function(){this.tickFunction()},remove:function(){this.state.controls.reset(),this.removeListeners();var t=this.state;t.controls.dispose(),t=null}}),AFRAME.registerComponent("al-render-order",{schema:{renderOrder:{type:"number",default:999}},init:function(){var t=this;this.bindMethods(),this.addEventListeners(),Object.keys(this.el.object3DMap).forEach((function(e){t.el.object3DMap[e].renderOrder=t.data.renderOrder}))},bindMethods:function(){},addEventListeners:function(){},removeEventListeners:function(){},update:function(){var t=this;Object.keys(this.el.object3DMap).forEach((function(e){t.el.object3DMap[e].renderOrder=t.data.renderOrder}))},remove:function(){this.removeEventListeners()}}),AFRAME.registerComponent("al-render-overlaid",{schema:{renderOrder:{type:"number",default:999}},init:function(t){this.bindMethods(),this.addEventListeners(),this.setDepth(this.el.object3DMap.mesh),this.setDepth(this.el.object3DMap.text)},bindMethods:function(){},addEventListeners:function(){},removeEventListeners:function(){},setDepth:function(t){t&&(t.renderOrder=this.data.renderOrder,t.material&&(t.material.depthTest=!1))},remove:function(){this.removeEventListeners()}});var Xc=function(){};Xc.INTERACTION="al-control-interaction",Xc.INTERACTION_FINISHED="al-control-interaction-finished",Xc.ANIMATION_STARTED="al-controls-animation-started",Xc.ANIMATION_FINISHED="al-controls-animation-finished";var qc=-1,Zc=THREE.MOUSE.LEFT,Jc=THREE.MOUSE.MIDDLE,Qc=THREE.MOUSE.RIGHT,Kc=function(t){function e(e,n){var i=t.call(this)||this;return i.screen={left:0,top:0,width:0,height:0},i._changeEvent={type:"change"},i._startEvent={type:"start"},i._endEvent={type:"end"},i.object=e,i.domElement=void 0!==n?n:document,i.enabled=!0,i.screen={left:0,top:0,width:0,height:0},i.rotateSpeed=1,i.zoomSpeed=1.2,i.panSpeed=.3,i.noRotate=!1,i.noZoom=!1,i.noPan=!1,i.staticMoving=!1,i.dynamicDampingFactor=.2,i.minDistance=0,i.maxDistance=1/0,i.target=new THREE.Vector3,i.EPS=1e-6,i._lastPosition=new THREE.Vector3,i._state=qc,i._eye=new THREE.Vector3,i._movePrev=new THREE.Vector2,i._moveCurr=new THREE.Vector2,i._lastAxis=new THREE.Vector3,i._lastAngle=0,i._zoomStart=new THREE.Vector2,i._zoomEnd=new THREE.Vector2,i._touchZoomDistanceStart=0,i._touchZoomDistanceEnd=0,i._panStart=new THREE.Vector2,i._panEnd=new THREE.Vector2,i._target0=i.target.clone(),i._position0=i.object.position.clone(),i._up0=i.object.up.clone(),i._bindMethods(),i._addListeners(),i.update(),i}return x(e,t),Object.defineProperty(e.prototype,"up0",{get:function(){return this._up0.clone()},enumerable:!0,configurable:!0}),e.prototype._bindMethods=function(){this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._mouseWheel=this._mouseWheel.bind(this),this._touchStart=this._touchStart.bind(this),this._touchEnd=this._touchEnd.bind(this),this._touchMove=this._touchMove.bind(this),this._resize=this._resize.bind(this)},e.prototype._addListeners=function(){this.domElement.addEventListener("mousedown",this._mouseDown,{capture:!1,once:!1,passive:!0}),window.addEventListener("mousemove",this._mouseMove,{capture:!1,once:!1,passive:!0}),window.addEventListener("mouseup",this._mouseUp,{capture:!1,once:!1,passive:!0}),this.domElement.addEventListener("wheel",this._mouseWheel,{capture:!1,once:!1,passive:!1}),this.domElement.addEventListener("touchstart",this._touchStart,{capture:!1,once:!1,passive:!0}),window.addEventListener("touchend",this._touchEnd,{capture:!1,once:!1,passive:!0}),window.addEventListener("touchmove",this._touchMove,{capture:!1,once:!1,passive:!0})},e.prototype._mouseDown=function(t){if(!1!==this.enabled){if(this._state===qc)switch(t.button){case Zc:this._state=0,this.noRotate||(this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)),this._movePrev.copy(this._moveCurr));break;case Jc:this._state=1,this.noZoom||(this._zoomStart.copy(this._getMouseOnScreen(t.pageX,t.pageY)),this._zoomEnd.copy(this._zoomStart));break;case Qc:this._state=2,this.noPan||(this._panStart.copy(this._getMouseOnScreen(t.pageX,t.pageY)),this._panEnd.copy(this._panStart));break;default:this._state=qc}this.dispatchEvent(this._startEvent),this.update()}},e.prototype._mouseMove=function(t){!1!==this.enabled&&(0!==this._state||this.noRotate?1!==this._state||this.noZoom?2!==this._state||this.noPan||this._panEnd.copy(this._getMouseOnScreen(t.pageX,t.pageY)):this._zoomEnd.copy(this._getMouseOnScreen(t.pageX,t.pageY)):(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY))),this.update())},e.prototype._mouseUp=function(t){!1!==this.enabled&&(this._state=qc,this.dispatchEvent(this._endEvent),this.update())},e.prototype._mouseWheel=function(t){if(!1!==this.enabled&&!0!==this.noZoom){switch(t.preventDefault(),t.stopPropagation(),t.deltaMode){case 2:this._zoomStart.y-=.025*t.deltaY;break;case 1:this._zoomStart.y-=.01*t.deltaY;break;default:this._zoomStart.y-=25e-5*t.deltaY}this.dispatchEvent(this._startEvent),this.dispatchEvent(this._endEvent),this.update()}},e.prototype._touchStart=function(t){if(!1!==this.enabled){if(1===t.touches.length)this._state=3,this._moveCurr.copy(this._getMouseOnCircle(t.touches[0].pageX,t.touches[0].pageY)),this._movePrev.copy(this._moveCurr);else{this._state=4;var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(e*e+n*n);var i=(t.touches[0].pageX+t.touches[1].pageX)/2,r=(t.touches[0].pageY+t.touches[1].pageY)/2;this._panStart.copy(this._getMouseOnScreen(i,r)),this._panEnd.copy(this._panStart)}this.dispatchEvent(this._startEvent),this.update()}},e.prototype._touchEnd=function(t){if(!1!==this.enabled){switch(t.touches.length){case 0:this._state=qc;break;case 1:this._state=3,this._moveCurr.copy(this._getMouseOnCircle(t.touches[0].pageX,t.touches[0].pageY)),this._movePrev.copy(this._moveCurr)}this.dispatchEvent(this._endEvent),this.update()}},e.prototype._touchMove=function(t){if(!1!==this.enabled){if(1===t.touches.length)this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(t.touches[0].pageX,t.touches[0].pageY));else{var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY;this._touchZoomDistanceEnd=Math.sqrt(e*e+n*n);var i=(t.touches[0].pageX+t.touches[1].pageX)/2,r=(t.touches[0].pageY+t.touches[1].pageY)/2;this._panEnd.copy(this._getMouseOnScreen(i,r))}this.update()}},e.prototype._resize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var t=this.domElement.getBoundingClientRect(),e=this.domElement.ownerDocument.documentElement;this.screen.left=t.left+window.pageXOffset-e.clientLeft,this.screen.top=t.top+window.pageYOffset-e.clientTop,this.screen.width=t.width,this.screen.height=t.height}},e.prototype._getMouseOnScreen=function(t,e){var n=new THREE.Vector2;return n.set((t-this.screen.left)/this.screen.width,(e-this.screen.top)/this.screen.height),n},e.prototype._getMouseOnCircle=function(t,e){var n=new THREE.Vector2;return n.set((t-.5*this.screen.width-this.screen.left)/(.5*this.screen.width),(this.screen.height+2*(this.screen.top-e))/this.screen.width),n},e.prototype._rotateCamera=function(){var t,e=new THREE.Vector3,n=new THREE.Quaternion,i=new THREE.Vector3,r=new THREE.Vector3,o=new THREE.Vector3,a=new THREE.Vector3;a.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0),(t=a.length())?(this._eye.copy(this.object.position).sub(this.target),i.copy(this._eye).normalize(),r.copy(this.object.up).normalize(),o.crossVectors(r,i).normalize(),r.setLength(this._moveCurr.y-this._movePrev.y),o.setLength(this._moveCurr.x-this._movePrev.x),a.copy(r.add(o)),e.crossVectors(a,this._eye).normalize(),t*=this.rotateSpeed,n.setFromAxisAngle(e,t),this._eye.applyQuaternion(n),this.object.up.applyQuaternion(n),this._lastAxis.copy(e),this._lastAngle=t):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),n.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(n),this.object.up.applyQuaternion(n)),this._movePrev.copy(this._moveCurr)},e.prototype._zoomCamera=function(){var t;4===this._state?(t=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this._eye.multiplyScalar(t)):(1!=(t=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed)&&t>0&&this._eye.multiplyScalar(t),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)},e.prototype._panCamera=function(){var t=new THREE.Vector2,e=new THREE.Vector3,n=new THREE.Vector3;t.copy(this._panEnd).sub(this._panStart),t.lengthSq()&&(t.multiplyScalar(this._eye.length()*this.panSpeed),n.copy(this._eye).cross(this.object.up).setLength(t.x),n.add(e.copy(this.object.up).setLength(t.y)),this.object.position.add(n),this.target.add(n),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(t.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor)))},e.prototype._checkDistances=function(){this.noZoom&&this.noPan||(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))},e.prototype.update=function(){this._eye.subVectors(this.object.position,this.target),this.noRotate||this._rotateCamera(),this.noZoom||this._zoomCamera(),this.noPan||this._panCamera(),this.object.position.addVectors(this.target,this._eye),this._checkDistances(),this.object.lookAt(this.target),this._lastPosition.distanceToSquared(this.object.position)>this.EPS&&(this.dispatchEvent(this._changeEvent),this._lastPosition.copy(this.object.position))},e.prototype.reset=function(){this._state=qc,this.target.copy(this._target0),this.object.position.copy(this._position0),this.object.up.copy(this._up0),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(this._changeEvent),this._lastPosition.copy(this.object.position)},e.prototype.dispose=function(){this._removeListeners()},e.prototype._removeListeners=function(){this.domElement.removeEventListener("mousedown",this._mouseDown,!1),window.removeEventListener("mousemove",this._mouseMove,!1),window.removeEventListener("mouseup",this._mouseUp,!1),this.domElement.removeEventListener("wheel",this._mouseWheel,!1),this.domElement.removeEventListener("touchstart",this._touchStart,!1),window.removeEventListener("touchend",this._touchEnd,!1),window.removeEventListener("touchmove",this._touchMove,!1)},e}(THREE.EventDispatcher);AFRAME.registerComponent("al-trackball-control",{dependencies:["camera"],schema:{animating:{type:"boolean",default:!1},controlPosition:{type:"vec3"},controlTarget:{type:"vec3"},dynamicDampingFactor:{default:.1},enabled:{type:"boolean",default:!0},maxDistance:{type:"number",default:8e3},minDistance:{type:"number",default:0},noPan:{type:"boolean",default:!1},noRotate:{type:"boolean",default:!1},noZoom:{type:"boolean",default:!1},panSpeed:{type:"number",default:.3},rotateSpeed:{type:"number",default:1},screenHeight:{type:"number",default:0},screenLeft:{type:"number",default:0},screenTop:{type:"number",default:0},screenWidth:{type:"number",default:0},staticMoving:{type:"boolean",default:!0},zoomSpeed:{type:"number",default:.5}},bindMethods:function(){this.canvasWheel=this.canvasWheel.bind(this),this.getCameraState=this.getCameraState.bind(this),this.handleAnimationCache=this.handleAnimationCache.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseUp=this.mouseUp.bind(this),this.onWheel=this.onWheel.bind(this)},addListeners:function(){window.addEventListener("mouseup",this.mouseUp,{capture:!1,once:!1,passive:!0}),window.addEventListener("mousemove",this.mouseMove,{capture:!1,once:!1,passive:!0}),this.el.sceneEl.canvas.addEventListener("mousedown",this.mouseDown,{capture:!1,once:!1,passive:!0}),this.el.sceneEl.canvas.addEventListener("wheel",this.canvasWheel,{capture:!1,once:!1,passive:!0}),this.el.sceneEl.oncontextmenu=function(t){t.preventDefault()},this.el.sceneEl.addEventListener(Xc.ANIMATION_STARTED,this.handleAnimationCache,!1)},removeListeners:function(){window.removeEventListener("mouseup",this.mouseUp),window.removeEventListener("mousemove",this.mouseMove),this.el.sceneEl.canvas.removeEventListener("mousedown",this.mouseDown),this.el.sceneEl.canvas.removeEventListener("wheel",this.canvasWheel),this.el.sceneEl.removeEventListener(Xc.ANIMATION_STARTED,this.handleAnimationCache,!1)},handleAnimationCache:function(t){this.state.animationCache=t.detail.slerpPath;var e=this.el.getObject3D("camera");this.state.cameraAnimationCache=I.getSlerp3Path(e.up.clone(),this.state.controls.up0)},mouseUp:function(t){document.body.style.cursor="grab",this.state.controls.enabled&&this.el.sceneEl.emit(Xc.INTERACTION_FINISHED,{cameraState:this.getCameraState(),needsRender:this.state.mouseDown},!1),this.state.mouseDown=!1},mouseDown:function(t){this.state.mouseDown=!0,document.body.style.cursor="grabbing"},mouseMove:function(t){this.state.mouseDown&&this.el.sceneEl.emit(Xc.INTERACTION,{cameraState:this.getCameraState(),needsRender:this.state.mouseDown},!1)},onWheel:function(){var t=this,e=this.state;e.wheelMarker=!1,e.wheelCounter2=e.wheelCounter1,setTimeout((function(){e.wheelCounter2===e.wheelCounter1?(e.wheelMarker=!0,e.wheelCounter1=0,e.wheelCounter2=0,t.el.sceneEl.emit(Xc.INTERACTION_FINISHED,{cameraState:t.getCameraState(),needsRender:!0},!1)):t.onWheel()}),e.wheelInterval)},canvasWheel:function(t){var e=this.state;e.wheelCounter1+=1,e.wheelMarker&&this.onWheel(),this.el.sceneEl.emit(Xc.INTERACTION,{cameraState:this.getCameraState(),needsRender:!0},!1)},init:function(){var t=this,e=this.el,n=this.data;document.body.style.cursor="grab",this.tickFunction=AFRAME.utils.throttle(this.tickFunction,O.minFrameMS,this);var i=new Kc(e.getObject3D("camera"),e.sceneEl.renderer.domElement),r=I.objectToVector3(n.controlPosition),o=I.objectToVector3(n.controlTarget);i.object.position.copy(r),e.getObject3D("camera").position.copy(r),i.target.copy(o),this.state={animationCache:[],cameraAnimationCache:null,controls:i,mouseDown:!1,wheelCounter1:0,wheelCounter2:void 0,wheelInterval:50,wheelMarker:!0},this.bindMethods(),this.addListeners(),I.waitOneFrame((function(){t.el.sceneEl.emit(Xc.INTERACTION,{cameraState:t.getCameraState(),needsRender:!1},!1)}))},getCameraState:function(){return{position:this.state.controls.object.position,target:this.state.controls.target}},update:function(t){var e=this.state.controls,n=this.data;e.target=I.objectToVector3(n.controlTarget),e.dynamicDampingFactor=n.dynamicDampingFactor,e.enabled=n.enabled,e.maxDistance=n.maxDistance,e.minDistance=n.minDistance,e.noPan=n.noPan,e.noRotate=n.noRotate,e.noZoom=n.noZoom,e.panSpeed=n.panSpeed,e.rotateSpeed=n.rotateSpeed,e.screen.height=n.screenHeight,e.screen.left=n.screenLeft,e.screen.top=n.screenTop,e.screen.width=n.screenWidth,e.staticMoving=n.screenHeight,e.zoomSpeed=n.zoomSpeed,this.el.getObject3D("camera").position.copy(I.objectToVector3(n.controlPosition))},tickFunction:function(){var t=this.state.controls;if(t.enabled){if(this.data.animating&&this.state.cameraAnimationCache){var e=this.state.animationCache.shift(),n=this.state.cameraAnimationCache.shift();if(e&&e.position&&e.target){var i=this.el.getObject3D("camera");t.object.position.copy(e.position),i.position.copy(e.position),n&&i.up.copy(n),t.target.copy(e.target),this.el.sceneEl.emit(Xc.INTERACTION,{cameraState:this.getCameraState(),needsRender:!0},!1)}0===this.state.animationCache.length&&(this.el.sceneEl.emit(Xc.ANIMATION_FINISHED,{},!1),this.el.sceneEl.emit(Xc.INTERACTION_FINISHED,{cameraState:this.getCameraState(),needsRender:!0},!1))}t.enabled&&t.update()}},tick:function(){this.tickFunction()},remove:function(){this.state.controls.reset(),this.removeListeners();var t=this.state;t.controls.dispose(),t=null}});var $c=function(){function t(){}return t.prototype.load=function(t,e){var n=this;return new Promise((function(i,r){var o=new XMLHttpRequest,a=B.getFileExtension(t),s=B.getFileEndCharacters(t,3);if(Object.values(b).includes(a)||Object.values(b).includes(s)){var l=[t];n._loadVolume(l,i,r,e)}else o.open("GET",t,!0),o.onload=function(){var t=JSON.parse(o.responseText);t=n._mapfiles(t.baseurl,t.series),n._loadVolume(t,i,r,e)},o.onerror=function(t){r(t)},o.send()}))},t.prototype._loadVolume=function(t,e,n,i){var r=new AMI.VolumeLoader(i);r.load(t).then((function(){var t=r.data[0].mergeSeries(r.data)[0].stack[0];r.free(),e(t)})).catch((function(t){console.error("Volume load error"),n(t)}))},t.prototype._mapfiles=function(t,e){return e.map((function(e){return t.endsWith("/")||(t+="/"),""+t+e}))},t}(),th=function(){};th.DEFAULT_RENDER_STEPS="al-default-render-steps",th.ERROR="al-volume-error",th.LOADED="al-volume-loaded",th.SLICES_MAX_INDEX="al-volume-slices-max-index",th.VOLUME_RAY_REQUEST="al-volume-ray-requested",th.VOLUME_RAY_CAST="al-volume-ray-cast";var eh=function(){};eh.CREATE="create",eh.DRAG="drag",AFRAME.registerComponent("al-volume",{schema:{controlsType:{type:"string"},displayMode:{type:"string"},minFrameMS:{type:"number",default:15},slicesIndex:{type:"number"},slicesOrientation:{type:"string"},src:{type:"string"},srcLoaded:{type:"boolean"},volumeSteps:{type:"number"},volumeWindowCenter:{type:"number"},volumeWindowWidth:{type:"number"}},init:function(){this.tickFunction=AFRAME.utils.throttle(this.tickFunction,this.data.minFrameMS,this),this.loader=new $c,this.state={bufferScene:new THREE.Scene,bufferSceneTextureHeight:this.el.sceneEl.canvas.clientHeight,bufferSceneTextureWidth:this.el.sceneEl.canvas.clientWidth,debounce:!1,frameTime:window.performance.now(),loaded:!1,lastRenderTime:0,volumeSteps:0},this.bindMethods(),this.addEventListeners(),this.createBufferTexture(),this.debouncedRenderBufferScene=k.debounce(this.renderBufferScene,this.data.minFrameMS).bind(this)},bindMethods:function(){this.addEventListeners=this.addEventListeners.bind(this),this.denormaliseVolumeSteps=this.denormaliseVolumeSteps.bind(this),this.castVolumeRay=this.castVolumeRay.bind(this),this.createBufferTexture=this.createBufferTexture.bind(this),this.getDefaultVolumeSteps=this.getDefaultVolumeSteps.bind(this),this.handleStack=this.handleStack.bind(this),this.onInteraction=this.onInteraction.bind(this),this.onInteractionFinished=this.onInteractionFinished.bind(this),this.removeEventListeners=this.removeEventListeners.bind(this),this.renderBufferScene=this.renderBufferScene.bind(this),this.rendererResize=this.rendererResize.bind(this),this.updateSlicesStack=this.updateSlicesStack.bind(this),this.updateVolumeStack=this.updateVolumeStack.bind(this)},addEventListeners:function(){this.el.sceneEl.addEventListener("rendererresize",this.rendererResize,!1),this.el.sceneEl.addEventListener(Xc.INTERACTION,this.onInteraction,!1),this.el.sceneEl.addEventListener(Xc.INTERACTION_FINISHED,this.onInteractionFinished,!1),this.el.sceneEl.addEventListener(th.VOLUME_RAY_REQUEST,this.castVolumeRay,!1)},removeEventListeners:function(){this.el.sceneEl.removeEventListener("rendererresize",this.rendererResize),this.el.sceneEl.removeEventListener(Xc.INTERACTION,this.onInteraction),this.el.sceneEl.removeEventListener(Xc.INTERACTION_FINISHED,this.onInteractionFinished),this.el.sceneEl.addEventListener(th.VOLUME_RAY_REQUEST,this.castVolumeRay)},castVolumeRay:function(t){var e=t.detail.cameraPosition,n=t.detail.cameraDirection,i=t.detail.intersection,r=new THREE.Vector3,o=new THREE.Vector3,a=D.volumeRay(this.state.stackhelper,e,n,O.camera.far,r,o);this.el.sceneEl.emit(th.VOLUME_RAY_CAST,{hitPosition:r,intersection:i,rayResult:a,hitNormal:o,type:t.detail.type})},createBufferTexture:function(){this.state.bufferSceneTexture=new THREE.WebGLRenderTarget(this.state.bufferSceneTextureWidth,this.state.bufferSceneTextureHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter}),this.el.sceneEl.object3D.background=this.state.bufferSceneTexture.texture},onInteraction:function(t){this.state.stackhelper&&t.detail.needsRender&&(this.state.volumeSteps=2)},onInteractionFinished:function(t){this.state.stackhelper&&t.detail.needsRender&&(this.state.volumeSteps=this.denormaliseVolumeSteps(this.data.volumeSteps)),this.state.debounce=!1},getDefaultVolumeSteps:function(){var t;return t=AFRAME.utils.device.isMobile()?5:7,Math.pow(2,t)},denormaliseVolumeSteps:function(t){return Math.pow(2,10*t)},rendererResize:function(){var t=this.state;(t.bufferSceneTextureWidth!==this.el.sceneEl.canvas.clientWidth||t.bufferSceneTextureHeight!==this.el.sceneEl.canvas.clientHeight)&&this.data.displayMode===p.VOLUME&&(t.bufferSceneTextureWidth=this.el.sceneEl.canvas.clientWidth,t.bufferSceneTextureHeight=this.el.sceneEl.canvas.clientHeight,this.state.volumeSteps=this.data.volumeSteps)},renderBufferScene:function(){if(this.data.displayMode===p.VOLUME){this.createBufferTexture(),this.state.stackhelper.steps=this.state.volumeSteps;var t=window.performance.now();this.el.sceneEl.renderer.setRenderTarget(this.state.bufferSceneTexture),this.el.sceneEl.renderer.render(this.state.bufferScene,this.el.sceneEl.camera),this.el.sceneEl.renderer.setRenderTarget(null);var e=window.performance.now()-t;this.state.lastRenderTime=e,this.state.volumeSteps=0}},handleStack:function(t){var e=this.state,n=this.el;switch(e.stack=t,this.data.displayMode){case p.SLICES:e.stackhelper=new AMI.StackHelper(e.stack),e.stackhelper.bbox.visible=!1,e.stackhelper.border.color=O.colors.blue;break;case p.VOLUME:var i=n.sceneEl.parentEl.querySelector("#lut-canvases");e.lutHelper=new AMI.LutHelper(i),e.lutHelper.luts=AMI.LutHelper.presetLuts(),e.lutHelper.lutsO=AMI.LutHelper.presetLutsO(),e.stackhelper=new AMI.VolumeRenderHelper(e.stack),e.stackhelper.textureLUT=e.lutHelper.texture,e.stackhelper.steps=this.getDefaultVolumeSteps()}n.object3DMap.mesh&&n.removeObject3D("mesh"),this.data.displayMode===p.SLICES?n.setObject3D("mesh",this.state.stackhelper):(this.state.bufferScene.children.length&&this.state.bufferScene.remove(this.state.bufferScene.children[0]),this.state.bufferScene.add(this.state.stackhelper)),this.state.loaded||(n.sceneEl.emit(th.LOADED,e.stackhelper,!1),this.state.loaded=!0)},updateSlicesStack:function(){if(this.state.stackhelper&&(!this.state.stackhelper||this.state.stackhelper.slice)){var t,e=Object.keys(g).indexOf(this.data.slicesOrientation.toUpperCase()),n=this.state.stackhelper.stack.zCosine;t=1===Math.round(n.x)?1:1===Math.round(n.y)?2:0;var i,r=Math.round((e+t)%3),o=Math.round((e+t+2)%3),a=this.state.stackhelper.stack.dimensionsIJK[Object.keys(this.state.stackhelper.stack.dimensionsIJK)[o]]-1;o!==this._lastStackOrientationIndex||void 0===this.data.slicesIndex?(i=Math.floor(.5*a),this.el.sceneEl.emit(th.SLICES_MAX_INDEX,a,!1)):i=a*this.data.slicesIndex,this._lastStackOrientationIndex=o;var s=this.state.stackhelper.stack.minMax[1],l=Math.floor(B.reverseNumber(s*this.data.volumeWindowCenter,0,s)),c=this.state.stackhelper.stack.minMax[1]-this.state.stackhelper.stack.minMax[0],h=Math.floor(c*this.data.volumeWindowWidth);this.state.stackhelper.orientation=r,this.state.stackhelper.index=i,this.state.stackhelper.slice.windowCenter=l,this.state.stackhelper.slice.windowWidth=h}},updateVolumeStack:function(){if(this.state.stackhelper){var t=this.state.stackhelper.stack.minMax[1],e=Math.floor(B.reverseNumber(t*this.data.volumeWindowCenter,0,t)),n=this.state.stackhelper.stack.minMax[1]-this.state.stackhelper.stack.minMax[0],i=Math.floor(n*this.data.volumeWindowWidth);this.state.stackhelper.windowCenter=e,this.state.stackhelper.windowWidth=i}},update:function(t){var e=this,n=this.state,i=this.el;if(this.data.src)switch(t&&t.src!==this.data.src?this.loader.load(this.data.src,i).then((function(t){e.handleStack(t)})):t&&t.displayMode!==this.data.displayMode&&n.stack&&(this.removeEventListeners(),this.handleStack(n.stack),this.addEventListeners(),this.data.displayMode===p.VOLUME?(this.createBufferTexture(),setTimeout((function(){var t=e.getDefaultVolumeSteps(),n=Math.log2(t)/10;e.el.sceneEl.emit(th.DEFAULT_RENDER_STEPS,n,!1),e.state.volumeSteps=t}),O.volumeStepsDelay)):this.el.sceneEl.object3D.background=null),this.data.displayMode){case p.SLICES:this.updateSlicesStack();break;case p.VOLUME:this.updateVolumeStack(),t&&t.volumeSteps!==this.data.volumeSteps&&(this.state.volumeSteps=this.denormaliseVolumeSteps(this.data.volumeSteps)),t&&t.controlsType&&t.controlsType!==this.data.controlsType&&setTimeout((function(){e.state.volumeSteps=e.denormaliseVolumeSteps(e.data.volumeSteps)}),O.volumeStepsDelay),t&&t.volumeWindowCenter&&t.volumeWindowCenter!==this.data.volumeWindowCenter&&(this.state.debounce=!0,this.state.stackhelper.stack.windowCenter=this.data.volumeWindowCenter,this.state.volumeSteps=this.denormaliseVolumeSteps(this.data.volumeSteps)),t&&t.volumeWindowWidth&&t.volumeWindowWidth!==this.data.volumeWindowWidth&&(this.state.debounce=!0,this.state.stackhelper.stack.windowWidth=this.data.volumeWindowWidth,this.state.volumeSteps=this.denormaliseVolumeSteps(this.data.volumeSteps))}},tickFunction:function(){this.state.stackhelper&&(this.data.displayMode===p.SLICES&&this.el.setObject3D("mesh",this.state.stackhelper),this.state.volumeSteps>0&&!this.state.debounce&&this.renderBufferScene())},tick:function(){this.tickFunction()},remove:function(){this.data.displayMode===p.SLICES&&this.el.removeObject3D("mesh"),this.removeEventListeners(),this.el.sceneEl.object3D.background=null}}),AFRAME.registerPrimitive("al-a-camera",{defaultComponents:{camera:{},"look-controls":{},"wasd-controls":{},position:{x:0,y:1.6,z:0}},mappings:{active:"camera.active",aspect:"camera.aspect",far:"camera.far",fov:"camera.fov","look-controls-enabled":"look-controls.enabled",near:"camera.near","pointer-lock-enabled":"look-controls.pointerLockEnabled","wasd-controls-enabled":"wasd-controls.enabled","reverse-mouse-drag":"look-controls.reverseMouseDrag",zoom:"camera.zoom"}});THREE.OrbitControls=function(t,e){this.object=t,this.domElement=void 0!==e?e:document,this.enabled=!0,this.target=new THREE.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:THREE.MOUSE.LEFT,MIDDLE:THREE.MOUSE.MIDDLE,RIGHT:THREE.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return c.phi},this.getAzimuthalAngle=function(){return c.theta},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(i),n.update(),s=a.NONE},this.update=function(){var e=new THREE.Vector3,r=(new THREE.Quaternion).setFromUnitVectors(t.up,new THREE.Vector3(0,1,0)),o=r.clone().inverse(),f=new THREE.Vector3,m=new THREE.Quaternion;return function(){var t=n.object.position;return e.copy(t).sub(n.target),e.applyQuaternion(r),c.setFromVector3(e),n.autoRotate&&s===a.NONE&&M(2*Math.PI/60/60*n.autoRotateSpeed),c.theta+=h.theta,c.phi+=h.phi,c.theta=Math.max(n.minAzimuthAngle,Math.min(n.maxAzimuthAngle,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.makeSafe(),c.radius*=u,c.radius=Math.max(n.minDistance,Math.min(n.maxDistance,c.radius)),n.target.add(d),e.setFromSpherical(c),e.applyQuaternion(o),t.copy(n.target).add(e),n.object.lookAt(n.target),!0===n.enableDamping?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(h.set(0,0,0),d.set(0,0,0)),u=1,!!(p||f.distanceToSquared(n.object.position)>l||8*(1-m.dot(n.object.quaternion))>l)&&(n.dispatchEvent(i),f.copy(n.object.position),m.copy(n.object.quaternion),p=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",F,!1),n.domElement.removeEventListener("mousedown",O,!1),n.domElement.removeEventListener("wheel",k,!1),n.domElement.removeEventListener("touchstart",z,!1),n.domElement.removeEventListener("touchend",H,!1),n.domElement.removeEventListener("touchmove",B,!1),document.removeEventListener("mousemove",I,!1),document.removeEventListener("mouseup",D,!1),window.removeEventListener("keydown",N,!1)};var n=this,i={type:"change"},r={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},s=a.NONE,l=1e-6,c=new THREE.Spherical,h=new THREE.Spherical,u=1,d=new THREE.Vector3,p=!1,f=new THREE.Vector2,m=new THREE.Vector2,g=new THREE.Vector2,v=new THREE.Vector2,y=new THREE.Vector2,b=new THREE.Vector2,x=new THREE.Vector2,w=new THREE.Vector2,E=new THREE.Vector2;function _(){return Math.pow(.95,n.zoomSpeed)}function M(t){h.theta-=t}function S(t){h.phi-=t}var T=function(){var t=new THREE.Vector3;return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),d.add(t)}}(),A=function(){var t=new THREE.Vector3;return function(e,i){!0===n.screenSpacePanning?t.setFromMatrixColumn(i,1):(t.setFromMatrixColumn(i,0),t.crossVectors(n.object.up,t)),t.multiplyScalar(e),d.add(t)}}(),L=function(){var t=new THREE.Vector3;return function(e,i){var r=n.domElement===document?n.domElement.body:n.domElement;if(n.object.isPerspectiveCamera){var o=n.object.position;t.copy(o).sub(n.target);var a=t.length();a*=Math.tan(n.object.fov/2*Math.PI/180),T(2*e*a/r.clientHeight,n.object.matrix),A(2*i*a/r.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(T(e*(n.object.right-n.object.left)/n.object.zoom/r.clientWidth,n.object.matrix),A(i*(n.object.top-n.object.bottom)/n.object.zoom/r.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function C(t){n.object.isPerspectiveCamera?u/=t:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*t)),n.object.updateProjectionMatrix(),p=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function P(t){n.object.isPerspectiveCamera?u*=t:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/t)),n.object.updateProjectionMatrix(),p=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function R(t){v.set(t.clientX,t.clientY)}function O(t){if(!1!==n.enabled){switch(t.preventDefault(),n.domElement.focus?n.domElement.focus():window.focus(),t.button){case n.mouseButtons.LEFT:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enablePan)return;R(t),s=a.PAN}else{if(!1===n.enableRotate)return;!function(t){f.set(t.clientX,t.clientY)}(t),s=a.ROTATE}break;case n.mouseButtons.MIDDLE:if(!1===n.enableZoom)return;!function(t){x.set(t.clientX,t.clientY)}(t),s=a.DOLLY;break;case n.mouseButtons.RIGHT:if(!1===n.enablePan)return;R(t),s=a.PAN}s!==a.NONE&&(document.addEventListener("mousemove",I,!1),document.addEventListener("mouseup",D,!1),n.dispatchEvent(r))}}function I(t){if(!1!==n.enabled)switch(t.preventDefault(),s){case a.ROTATE:if(!1===n.enableRotate)return;!function(t){m.set(t.clientX,t.clientY),g.subVectors(m,f).multiplyScalar(n.rotateSpeed);var e=n.domElement===document?n.domElement.body:n.domElement;M(2*Math.PI*g.x/e.clientHeight),S(2*Math.PI*g.y/e.clientHeight),f.copy(m),n.update()}(t);break;case a.DOLLY:if(!1===n.enableZoom)return;!function(t){w.set(t.clientX,t.clientY),E.subVectors(w,x),E.y>0?C(_()):E.y<0&&P(_()),x.copy(w),n.update()}(t);break;case a.PAN:if(!1===n.enablePan)return;!function(t){y.set(t.clientX,t.clientY),b.subVectors(y,v).multiplyScalar(n.panSpeed),L(b.x,b.y),v.copy(y),n.update()}(t)}}function D(t){!1!==n.enabled&&(document.removeEventListener("mousemove",I,!1),document.removeEventListener("mouseup",D,!1),n.dispatchEvent(o),s=a.NONE)}function k(t){!1===n.enabled||!1===n.enableZoom||s!==a.NONE&&s!==a.ROTATE||(t.preventDefault(),t.stopPropagation(),n.dispatchEvent(r),function(t){t.deltaY<0?P(_()):t.deltaY>0&&C(_()),n.update()}(t),n.dispatchEvent(o))}function N(t){!1!==n.enabled&&!1!==n.enableKeys&&!1!==n.enablePan&&function(t){var e=!1;switch(t.keyCode){case n.keys.UP:L(0,n.keyPanSpeed),e=!0;break;case n.keys.BOTTOM:L(0,-n.keyPanSpeed),e=!0;break;case n.keys.LEFT:L(n.keyPanSpeed,0),e=!0;break;case n.keys.RIGHT:L(-n.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),n.update())}(t)}function z(t){if(!1!==n.enabled){switch(t.preventDefault(),t.touches.length){case 1:if(!1===n.enableRotate)return;!function(t){f.set(t.touches[0].pageX,t.touches[0].pageY)}(t),s=a.TOUCH_ROTATE;break;case 2:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){if(n.enableZoom){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+i*i);x.set(0,r)}if(n.enablePan){var o=.5*(t.touches[0].pageX+t.touches[1].pageX),a=.5*(t.touches[0].pageY+t.touches[1].pageY);v.set(o,a)}}(t),s=a.TOUCH_DOLLY_PAN;break;default:s=a.NONE}s!==a.NONE&&n.dispatchEvent(r)}}function B(t){if(!1!==n.enabled)switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:if(!1===n.enableRotate)return;if(s!==a.TOUCH_ROTATE)return;!function(t){m.set(t.touches[0].pageX,t.touches[0].pageY),g.subVectors(m,f).multiplyScalar(n.rotateSpeed);var e=n.domElement===document?n.domElement.body:n.domElement;M(2*Math.PI*g.x/e.clientHeight),S(2*Math.PI*g.y/e.clientHeight),f.copy(m),n.update()}(t);break;case 2:if(!1===n.enableZoom&&!1===n.enablePan)return;if(s!==a.TOUCH_DOLLY_PAN)return;!function(t){if(n.enableZoom){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+i*i);w.set(0,r),E.set(0,Math.pow(w.y/x.y,n.zoomSpeed)),C(E.y),x.copy(w)}if(n.enablePan){var o=.5*(t.touches[0].pageX+t.touches[1].pageX),a=.5*(t.touches[0].pageY+t.touches[1].pageY);y.set(o,a),b.subVectors(y,v).multiplyScalar(n.panSpeed),L(b.x,b.y),v.copy(y)}n.update()}(t);break;default:s=a.NONE}}function H(t){!1!==n.enabled&&(n.dispatchEvent(o),s=a.NONE)}function F(t){!1!==n.enabled&&t.preventDefault()}n.domElement.addEventListener("contextmenu",F,!1),n.domElement.addEventListener("mousedown",O,!1),n.domElement.addEventListener("wheel",k,!1),n.domElement.addEventListener("touchstart",z,!1),n.domElement.addEventListener("touchend",H,!1),n.domElement.addEventListener("touchmove",B,!1),window.addEventListener("keydown",N,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,Object.defineProperties(THREE.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(t){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!t}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(t){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!t}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(t){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!t}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(t){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!t}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(t){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!t}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(t){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=t}}});var nh,ih=function(t,e){var n=t.angles,r=t.boundingSphereRadius,o=t.camera,a=t.cameraPosition,s=t.controlsType,l=t.edges,c=t.edgeMinSize,h=t.edgeSize,u=t.fontSize,d=t.nodes,p=t.selected;return Array.from(n).map((function(t){var e=t[0],n=t[1],f=l.get(n.edge1Id),m=l.get(n.edge2Id);if(f&&m){var g=void 0,v=void 0,y=void 0;f.node1Id===m.node1Id?(g=d.get(m.node1Id),v=d.get(f.node2Id),y=d.get(m.node2Id)):f.node1Id===m.node2Id?(g=d.get(m.node2Id),v=d.get(f.node2Id),y=d.get(m.node1Id)):f.node2Id===m.node1Id?(g=d.get(m.node1Id),v=d.get(f.node1Id),y=d.get(m.node2Id)):f.node2Id===m.node2Id&&(g=d.get(m.node2Id),v=d.get(f.node1Id),y=d.get(m.node1Id));var b=r*h>c?r*h:c,x=I.stringToVector3(v.position),w=I.stringToVector3(y.position),E=I.stringToVector3(g.position),_=x.clone().sub(E).normalize(),M=w.clone().sub(E).normalize(),S=M.angleTo(_),T=Math.min(E.distanceTo(x),E.distanceTo(w)),A=Math.min(.25*T,25*b);A=Math.max(A,10*b);var L=_.clone().multiplyScalar(A),C=M.clone().multiplyScalar(A),P=L.clone().distanceTo(C.clone()),R=L.clone().add(C.clone()).divideScalar(2),D=new THREE.Vector3(0,2.5,0),k=(v.scale+y.scale+g.scale)/3;D.multiplyScalar(k);var N=THREE.Math.radToDeg(S).toFixed(O.textUnitsDecimalPlaces),z=N+" "+(1==parseInt(N)?"degree":"degrees"),B=I.getFrustrumSpaceDistance(o,E.clone(),a)/r*O.frustrumScaleFactor;return(0,i.h)("a-entity",{"al-child-hover-visible":!0,id:e+"-parent"},(0,i.h)("a-entity",{position:I.vector3ToString(E),id:e+"-title-anchor","al-billboard":"\n              controlsType: "+s+";\n              cameraPosition: "+I.vector3ToString(o.position)+";\n              worldPosition: "+I.vector3ToString(E.clone().add(D.clone()))+";\n            "},(0,i.h)("a-entity",{id:e+"-title",text:"\n                  value: "+z+";\n                  side: double;\n                  align: center;\n                  baseline: bottom;\n                  anchor: center;\n                  width: "+u*r+";\n                  zOffset: 1e-7;\n                ",position:I.vector3ToString(D),visible:""+(p===e),scale:" "+B+" "+B+" "+B+";","al-background":"\n                    text: "+z+";\n                    boundingRadius: "+u*r+";\n                ","al-render-overlaid":!0})),(0,i.h)("a-entity",{"data-raycastable":!0,id:e,position:g.position,"al-angle":"\n                selected: "+(p===e)+";\n                edge0Pos: "+I.vector3ToString(L)+";\n                edge1Pos: "+I.vector3ToString(C)+";\n                position: "+I.vector3ToString(R)+";\n                length: "+P+";\n                radius: "+b+";\n                angle: "+n+";\n                scale: 1;\n              "}))}}))},rh=function(t,e){var n=t.boundingBox,r=t.boundingBoxEnabled,o=t.cb,a=t.color,s=t.displayMode,l=t.graphEnabled,c=t.mesh,h=t.srcLoaded,u=t.targetEntity;return function(){if(h){if(!c)return null;var t=new THREE.Vector3;n.getSize(t);var e=c.geometry,d=void 0;if(s===p.VOLUME)return d=u.object3D.position.clone().add(B.getGeometryCenter(e)),(0,i.h)("a-entity",{"data-raycastable":!0,position:I.vector3ToString(d),"al-bounding-box":"\n              scale: "+I.vector3ToString(t)+";\n              color: "+a+";\n              enabled: "+r+";\n            ","al-node-spawner":"\n              graphEnabled: "+l+";\n            ",ref:function(t){return o(t)}});if(s===p.SLICES)return d=u.object3D.position.clone().add(B.getGeometryCenter(e)),(0,i.h)("a-entity",{position:I.vector3ToString(d),"al-bounding-box":"\n              scale: "+I.vector3ToString(t)+";\n              color: "+a+";\n              enabled: "+r+";\n            ",ref:function(t){return o(t)}});var f=n.getCenter(new THREE.Vector3);return(d=new THREE.Vector3).x-=u.object3D.position.x-f.x,d.y-=u.object3D.position.y-f.y,d.z-=u.object3D.position.z-f.z,(0,i.h)("a-entity",{position:I.vector3ToString(d),"al-bounding-box":"\n              scale: "+I.vector3ToString(t)+";\n              color: "+a+";\n              enabled: "+r+";\n            ",ref:function(t){return o(t)}})}return null}()},oh=function(t,e){var n=t.boundingSphereRadius,r=t.camera,o=t.cameraPosition,a=t.controlsType,s=t.displayMode,l=t.edges,c=t.edgeSize,h=t.fontSize,u=t.edgeMinSize,d=t.nodes,f=t.selected,m=t.units;return Array.from(l).map((function(t){var e=t[0],l=t[1],g=d.get(l.node1Id),v=d.get(l.node2Id);if(g&&v){var b=I.stringToVector3(g.position),x=I.stringToVector3(v.position).clone().sub(b),w=x.length();x=x.normalize().multiplyScalar(.5*w);var E=b.clone().add(x),_=new THREE.Vector3(0,2.5,0),M=(g.scale+v.scale)/2,S=n*c>u?n*c:u;_.multiplyScalar(M);var T=function(t,e,n){if(e===p.MESH)switch(n){case y.METERS:return t.toFixed(O.textUnitsDecimalPlaces)+" "+n;case y.MILLIMETERS:return(t/.001).toFixed(O.textUnitsDecimalPlaces)+" "+n}else switch(n){case y.METERS:return(t/1e3).toFixed(O.textUnitsDecimalPlaces)+" "+n;case y.MILLIMETERS:return t.toFixed(O.textUnitsDecimalPlaces)+" "+n}}(w,s,m),A=I.getFrustrumSpaceDistance(r,E.clone(),o)/n*O.frustrumScaleFactor;return(0,i.h)("a-entity",{"al-child-hover-visible":!0,id:e+"-parent"},(0,i.h)("a-entity",{position:I.vector3ToString(E),id:e+"-title-anchor","al-billboard":"\n              controlsType: "+a+";\n              cameraPosition: "+I.vector3ToString(r.position)+";\n              worldPosition: "+I.vector3ToString(E.clone().add(_.clone()))+";\n            "},(0,i.h)("a-entity",{id:e+"-title",text:"\n                  value: "+T+";\n                  side: double;\n                  align: center;\n                  baseline: bottom;\n                  anchor: center;\n                  width: "+h*n+";\n                  zOffset: 1e-7;\n                ",position:I.vector3ToString(_),"al-render-overlaid":!0,visible:""+(f===e),"al-background":"\n                  text: "+T+";\n                  boundingRadius: "+h*n+";\n                ",scale:" "+A+" "+A+" "+A+";"})),(0,i.h)("a-entity",{"data-raycastable":!0,id:e,position:I.vector3ToString(E),"al-edge":"\n                length: "+w+";\n                node1: "+g.position+";\n                node2: "+v.position+";\n                selected: "+(f===e)+";\n                radius: "+S+";\n                nodeScale: "+M+";\n                scale: 1;\n              "}))}}))},ah=function(t,e){var n=t.ambientLightColor,r=t.ambientLightIntensity;return(0,i.h)("a-entity",{id:"ambient-light",light:"type: ambient; color: "+n+"; intensity: "+r})},sh=function(t,e){var n=t.boundingSphereRadius,r=t.camera,o=t.cameraPosition,a=t.controlsType,s=t.fontSize,l=t.graphEnabled,c=t.nodes,h=t.nodeLabelsAlwaysVisible,u=t.selected;return Array.from(c).map((function(t){var e=t[0],c=t[1],d=I.getFrustrumSpaceDistance(r,I.stringToVector3(c.position),o)/n*O.frustrumScaleFactor,p=new THREE.Vector3(0,3,0);return p.multiplyScalar(c.scale),(0,i.h)("a-entity",{"al-child-hover-visible":"nodeLabelsAlwaysVisible: "+(!0===h),id:e+"-parent"},(0,i.h)("a-entity",{position:c.position,id:e+"-title-anchor","al-billboard":"\n              controlsType: "+a+";\n              cameraPosition: "+I.vector3ToString(r.position)+";\n              worldPosition: "+I.vector3ToString(I.stringToVector3(c.position).add(p.clone()))+";\n            "},(0,i.h)("a-entity",{text:"\n                value: "+c.title+";\n                side: double;\n                align: center;\n                baseline: bottom;\n                anchor: center;\n                width: "+s*n+";\n                zOffset: 1e-7;\n              ",position:I.vector3ToString(p),"al-render-overlaid":!0,visible:""+(u===e),id:e+"-label","al-background":"\n                  text: "+c.title+";\n                  boundingRadius: "+s*n+";\n              ",scale:" "+d+" "+d+" "+d+";"})),(0,i.h)("a-entity",{"data-raycastable":!0,id:e,position:c.position,"al-node":"\n              scale: "+c.scale+";\n              selected: "+(u===e)+";\n              graphEnabled: "+l+";\n            ",scale:" 1 1 1;"}))}))},lh=function(t,e){var n=t.animating,r=t.aspect,o=t.cb,a=t.controlPosition,s=t.controlTarget,l=t.dampingFactor,c=t.enabled,h=t.far,u=t.fov,d=t.graphEnabled,p=t.maxDistance,f=t.maxPolarAngle,m=t.minDistance,g=t.minPolarAngle,v=t.near,y=t.panSpeed,b=t.rotateSpeed,x=t.zoomSpeed;return d?(0,i.h)("al-a-camera",{fov:u,near:v,aspect:r,"look-controls":"enabled: false",far:h,id:"mainCamera",raycaster:"objects: [data-raycastable]","al-cursor":"rayOrigin: mouse","al-orbit-control":"\n            minDistance: "+m+";\n            minPolarAngle: "+g+";\n            maxDistance: "+p+";\n            maxPolarAngle: "+f+";\n            screenSpacePanning: true;\n            rotateSpeed: "+b+";\n            zoomSpeed: "+x+";\n            enableDamping: true;\n            dampingFactor: "+l+";\n            controlTarget: "+s+";\n            controlPosition: "+a+";\n            enabled: "+c+";\n            animating: "+n+";\n            panSpeed: "+y+"\n          ","al-control-lights":!0,ref:function(t){return o(t)}}):(0,i.h)("al-a-camera",{fov:u,near:v,aspect:r,"look-controls":"enabled: false",far:h,id:"mainCamera","al-orbit-control":"\n            minDistance: "+m+";\n            minPolarAngle: "+g+";\n            maxDistance: "+p+";\n            maxPolarAngle: "+f+";\n            screenSpacePanning: true;\n            rotateSpeed: "+b+";\n            zoomSpeed: "+x+";\n            enableDamping: true;\n            dampingFactor: "+l+";\n            controlTarget: "+s+";\n            controlPosition: "+a+";\n            enabled: "+c+";\n            animating: "+n+";\n            panSpeed: "+y+"\n          ","al-control-lights":!0,ref:function(t){return o(t)}})},ch=function(t,e){var n=t.cb,r=t.isWebGl2;return(0,i.h)("a-scene",{embedded:!0,renderer:"\n      colorManagement: true;\n      sortObjects: true;\n      webgl2: "+r+";\n      antialias: true;\n    ","vr-mode-ui":"enabled: false",ref:function(t){return n(t)}},e)},hh=function(t,e){var n=t.cb,r=t.controlsType,o=t.displayMode,a=t.dracoDecoderPath,s=t.envMapPath,l=t.graphEnabled,c=t.orientation,h=t.slicesIndex,u=t.src,d=t.srcLoaded,f=t.volumeSteps,m=t.volumeWindowCenter,g=t.volumeWindowWidth;return function(){if(!u)return null;switch(o){case p.MESH:return(0,i.h)("a-entity",{"data-raycastable":!0,"al-node-spawner":"\n                graphEnabled: "+l+";\n              ","al-gltf-model":"\n                src: url("+u+");\n                dracoDecoderPath: "+a+";\n              ","al-cube-env-map":"\n                path: "+(s||"")+";\n              ",position:"0 0 0",scale:"1 1 1",ref:function(t){return n(t)}});case p.SLICES:return(0,i.h)("a-entity",{id:"target-entity","data-raycastable":!0,"al-node-spawner":"\n                graphEnabled: "+l+";\n              ","al-volume":"\n                controlsType: "+r+";\n                displayMode: "+o+";\n                slicesIndex: "+h+";\n                slicesOrientation: "+c+";\n                src: "+u+";\n                srcLoaded: "+d+";\n                volumeSteps: "+f+";\n                volumeWindowCenter: "+m+";\n                volumeWindowWidth: "+g+";\n              ",position:"0 0 0",ref:function(t){return n(t)}});case p.VOLUME:return(0,i.h)("a-entity",{id:"target-entity","al-volume":"\n                controlsType: "+r+";\n                displayMode: "+o+";\n                slicesIndex: "+h+";\n                slicesOrientation: "+c+";\n                src: "+u+";\n                srcLoaded: "+d+";\n                volumeSteps: "+f+";\n                volumeWindowCenter: "+m+";\n                volumeWindowWidth: "+g+";\n              ",position:"0 0 0",ref:function(t){return n(t)}});default:return}}()},uh=function(t,e){var n=t.animating,r=t.aspect,o=t.cb,a=t.controlPosition,s=t.controlTarget,l=t.dampingFactor,c=t.enabled,h=t.far,u=t.fov,d=t.graphEnabled,p=t.maxDistance,f=t.near,m=t.panSpeed,g=t.rotateSpeed,v=t.screenHeight,y=t.screenWidth,b=t.zoomSpeed;return d?(0,i.h)("al-a-camera",{fov:u,near:f,aspect:r,"look-controls":"enabled: false",far:h,id:"mainCamera",raycaster:"objects: [data-raycastable]","al-cursor":"rayOrigin: mouse","al-trackball-control":"\n            screenLeft: 0;\n            screenTop: 0;\n            screenWidth: "+y+";\n            screenHeight: "+v+";\n            rotateSpeed: "+g+";\n            zoomSpeed: "+b+";\n            panSpeed: "+m+";\n            maxDistance: "+p+";\n            dynamicDampingFactor: "+l+";\n            controlTarget: "+s+";\n            controlPosition: "+a+";\n            enabled: "+c+";\n            animating: "+n+"\n          ","al-control-lights":!0,ref:function(t){return o(t)}}):(0,i.h)("al-a-camera",{fov:u,near:f,aspect:r,"look-controls":"enabled: false",far:h,id:"mainCamera","al-trackball-control":"\n            screenLeft: 0;\n            screenTop: 0;\n            screenWidth: "+y+";\n            screenHeight: "+v+";\n            rotateSpeed: "+g+";\n            zoomSpeed: "+b+";\n            panSpeed: "+m+";\n            maxDistance: "+p+";\n            dynamicDampingFactor: "+l+";\n            controlTarget: "+s+";\n            controlPosition: "+a+";\n            enabled: "+c+";\n            animating: "+n+"\n          ","al-control-lights":!0,ref:function(t){return o(t)}})};!function(t){t.NULL="NULL",t.ERROR="ERROR",t.APP_CLEAR_ANGLES="APP_LOAD_ANGLES",t.APP_CLEAR_EDGES="APP_LOAD_EDGES",t.APP_CLEAR_NODES="APP_LOAD_NODES",t.APP_DELETE_ANGLE="APP_DELETE_ANGLE",t.APP_DELETE_EDGE="APP_DELETE_EDGE",t.APP_DELETE_NODE="APP_DELETE_NODE",t.APP_SELECT_ANGLE="APP_SELECT_ANGLE",t.APP_SELECT_EDGE="APP_SELECT_EDGE",t.APP_SELECT_NODE="APP_SELECT_NODE",t.APP_SET_ANGLE="APP_SET_ANGLE",t.APP_SET_BOUNDINGBOX_ENABLED="APP_SET_BOUNDINGBOX_ENABLED",t.APP_SET_CAMERA="APP_SET_CAMERA",t.APP_SET_CONTROLS_ENABLED="APP_SET_CONTROLS_ENABLED",t.APP_SET_CONTROLS_TYPE="APP_SET_CONTROLS_TYPE",t.APP_SET_DISPLAY_MODE="APP_SET_DISPLAY_MODE",t.APP_SET_EDGE="APP_SET_EDGE",t.APP_SET_MATERIAL="APP_SET_MATERIAL",t.APP_SET_NODE="APP_SET_NODE",t.APP_SET_NODES_ENABLED="APP_SET_NODES_ENABLED",t.APP_SET_NODE_LABELS_ALWAYS_VISIBLE="APP_SET_NODE_LABELS_ALWAYS_VISIBLE",t.APP_SET_ORIENTATION="APP_SET_ORIENTATION",t.APP_SET_SCENE_DISTANCE="APP_SET_SCENE_DISTANCE",t.APP_SET_SLICES_INDEX="APP_SET_SLICES_INDEX",t.APP_SET_SLICES_MAX_INDEX="APP_SET_SLICES_MAX_INDEX",t.APP_SET_SLICES_WINDOW_CENTER="APP_SET_SLICES_WINDOW_CENTER",t.APP_SET_SLICES_WINDOW_WIDTH="APP_SET_SLICES_WINDOW_WIDTH",t.APP_SET_SRC="APP_SET_SRC",t.APP_SET_SRC_LOADED="APP_SET_SRC_LOADED",t.APP_SET_UNITS="APP_SET_UNITS",t.APP_SET_VOLUME_STEPS="APP_SET_VOLUME_STEPS",t.APP_SET_VOLUME_WINDOW_CENTER="APP_SET_VOLUME_WINDOW_CENTER",t.APP_SET_VOLUME_WINDOW_WIDTH="APP_SET_VOLUME_WINDOW_WIDTH"}(nh||(nh={}));var dh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_SRC,payload:t})]}))}))}},ph=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_SRC_LOADED,payload:t})]}))}))}},fh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_NODE,payload:t})]}))}))}},mh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_DELETE_NODE,payload:t})]}))}))}},gh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SELECT_NODE,payload:t})]}))}))}},vh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_CLEAR_NODES,payload:t})]}))}))}},yh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_EDGE,payload:t})]}))}))}},bh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_DELETE_EDGE,payload:t})]}))}))}},xh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SELECT_EDGE,payload:t})]}))}))}},wh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_CLEAR_EDGES,payload:t})]}))}))}},Eh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_ANGLE,payload:t})]}))}))}},_h=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_DELETE_ANGLE,payload:t})]}))}))}},Mh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SELECT_ANGLE,payload:t})]}))}))}},Sh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_CLEAR_ANGLES,payload:t})]}))}))}},Th=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_BOUNDINGBOX_ENABLED,payload:t})]}))}))}},Ah=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_DISPLAY_MODE,payload:t})]}))}))}},Lh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_NODES_ENABLED,payload:t})]}))}))}},Ch=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_MATERIAL,payload:t})]}))}))}},Ph=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_NODE_LABELS_ALWAYS_VISIBLE,payload:t})]}))}))}},Rh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_UNITS,payload:t})]}))}))}},Oh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_ORIENTATION,payload:t})]}))}))}},Ih=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_SCENE_DISTANCE,payload:t})]}))}))}},Dh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_SLICES_INDEX,payload:t})]}))}))}},kh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_SLICES_MAX_INDEX,payload:t})]}))}))}},Nh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_VOLUME_STEPS,payload:t})]}))}))}},zh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_VOLUME_WINDOW_WIDTH,payload:t})]}))}))}},Bh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_VOLUME_WINDOW_CENTER,payload:t})]}))}))}},Hh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_CAMERA,payload:t})]}))}))}},Fh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_CONTROLS_ENABLED,payload:t})]}))}))}},jh=function(t){return function(e,n){return w(_,void 0,void 0,(function(){return E(this,(function(n){return[2,e({type:nh.APP_SET_CONTROLS_TYPE,payload:t})]}))}))}},Uh=function(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:t),Gh=function(){return Math.random().toString(36).substring(7).split("").join(".")},Vh={INIT:"@@redux/INIT"+Gh(),REPLACE:"@@redux/REPLACE"+Gh(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Gh()}};function Wh(t,e,n){var i;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function");if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(Wh)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var r=t,o=e,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function h(){if(l)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function u(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(l)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var e=!0;return c(),s.push(t),function(){if(e){if(l)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");e=!1,c();var n=s.indexOf(t);s.splice(n,1)}}}function d(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(l)throw new Error("Reducers may not dispatch actions.");try{l=!0,o=r(o,t)}finally{l=!1}for(var e=a=s,n=0;n<e.length;n++)(0,e[n])();return t}return d({type:Vh.INIT}),(i={dispatch:d,subscribe:u,getState:h,replaceReducer:function(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");r=t,d({type:Vh.REPLACE})}})[Uh]=function(){var t,e=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function n(){t.next&&t.next(h())}return n(),{unsubscribe:e(n)}}})[Uh]=function(){return this},t},i}function Yh(t,e){var n=e&&e.type;return"Given "+(n&&'action "'+String(n)+'"'||"an action")+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function Xh(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qh(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function Zh(t){return function(e){var n=e.dispatch,i=e.getState;return function(e){return function(r){return"function"==typeof r?r(n,i,t):e(r)}}}}var Jh=Zh();Jh.withExtraArgument=Zh;var Qh,Kh=function(){return{angles:new Map,boundingBoxEnabled:!1,camera:null,controlsEnabled:!0,controlsType:d.TRACKBALL,displayMode:p.MESH,edges:new Map,material:f.DEFAULT,nodes:new Map,nodeLabelsAlwaysVisible:!1,graphEnabled:!1,orientation:g.CORONAL,selected:null,slicesIndex:.5,slicesMaxIndex:void 0,src:null,srcLoaded:!1,units:y.METERS,volumeSteps:.5,volumeStepsHighEnabled:!1,volumeWindowCenter:.5,volumeWindowWidth:1}},$h=function(t){for(var e=Object.keys(t),n={},i=0;i<e.length;i++){var r=e[i];"function"==typeof t[r]&&(n[r]=t[r])}var o,a=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:Vh.INIT}))throw new Error('Reducer "'+e+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:Vh.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+e+"\" returned undefined when probed with a random type. Don't try to handle "+Vh.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var i=!1,r={},s=0;s<a.length;s++){var l=a[s],c=n[l],h=t[l],u=c(h,e);if(void 0===u){var d=Yh(l,e);throw new Error(d)}r[l]=u,i=i||u!==h}return i?r:t}}({app:function(t,e){switch(void 0===t&&(t=Kh()),e.type){case nh.APP_SET_SRC:var n,i=e.payload,r=i[0],o=i[1];if(o)n=o;else if(r){var a=B.getFileExtension(r),s=B.getFileEndCharacters(r,3);n=Object.values(m).includes(a)||Object.values(m).includes(s)?p.MESH:p.SLICES}else n=p.MESH;return Object.assign({},Kh(),{displayMode:n,src:r});case nh.APP_SET_SRC_LOADED:return Object.assign({},t,{controlsEnabled:e.payload,srcLoaded:e.payload,boundingBoxEnabled:t.displayMode!==p.MESH||t.boundingBoxEnabled,controlsType:t.displayMode===p.MESH?d.ORBIT:d.TRACKBALL,units:t.displayMode!==p.MESH?y.MILLIMETERS:y.METERS});case nh.APP_SET_NODE:var l=e.payload,c=l[0],h=l[1],u=JSON.parse(JSON.stringify(h)),f=t.nodes.get(c),g=Object.assign({},f,u);return Object.assign({},t,{selected:f?t.selected:c,nodes:new Map(t.nodes).set(c,g)});case nh.APP_DELETE_NODE:return Object.assign({},t,{selected:t.selected===e.payload?null:t.selected,nodes:new Map(Array.from(t.nodes).filter((function(t){return t[0]!==e.payload}))),edges:new Map(Array.from(t.edges).filter((function(t){t[0];var n=t[1];return e.payload!==n.node1Id&&e.payload!==n.node2Id})))});case nh.APP_SELECT_NODE:return Object.assign({},t,{selected:e.payload});case nh.APP_CLEAR_NODES:return Object.assign({},t,{nodes:new Map});case nh.APP_SET_EDGE:var v=e.payload;return c=v[0],h=v[1],u=JSON.parse(JSON.stringify(h)),f=t.edges.get(c),g=Object.assign({},f,u),Object.assign({},t,{selected:f?t.selected:c,edges:new Map(t.edges).set(c,g)});case nh.APP_DELETE_EDGE:return Object.assign({},t,{selected:t.selected===e.payload?null:t.selected,edges:new Map(Array.from(t.edges).filter((function(t){return t[0]!==e.payload}))),angles:new Map(Array.from(t.angles).filter((function(t){t[0];var n=t[1];return e.payload!==n.edge1Id&&e.payload!==n.edge2Id})))});case nh.APP_SELECT_EDGE:return Object.assign({},t,{selected:e.payload});case nh.APP_CLEAR_EDGES:return Object.assign({},t,{edges:new Map});case nh.APP_SET_ANGLE:var b=e.payload;return c=b[0],h=b[1],u=JSON.parse(JSON.stringify(h)),f=t.angles.get(c),g=Object.assign({},f,u),Object.assign({},t,{selected:f?t.selected:c,angles:new Map(t.angles).set(c,g)});case nh.APP_DELETE_ANGLE:return Object.assign({},t,{selected:t.selected===e.payload?null:t.selected,angles:new Map(Array.from(t.angles).filter((function(t){return t[0]!==e.payload})))});case nh.APP_SELECT_ANGLE:return Object.assign({},t,{selected:e.payload});case nh.APP_CLEAR_ANGLES:return Object.assign({},t,{angles:new Map});case nh.APP_SET_DISPLAY_MODE:return Object.assign({},t,{displayMode:e.payload,boundingBoxEnabled:e.payload===p.SLICES});case nh.APP_SET_ORIENTATION:return Object.assign({},t,{slicesIndex:.5,orientation:e.payload});case nh.APP_SET_MATERIAL:return Object.assign({},t,{material:e.payload});case nh.APP_SET_NODES_ENABLED:return Object.assign({},t,{graphEnabled:e.payload});case nh.APP_SET_BOUNDINGBOX_ENABLED:return Object.assign({},t,{boundingBoxEnabled:e.payload});case nh.APP_SET_NODE_LABELS_ALWAYS_VISIBLE:return Object.assign({},t,{nodeLabelsAlwaysVisible:e.payload});case nh.APP_SET_SCENE_DISTANCE:return Object.assign({},t,{sceneDistance:e.payload});case nh.APP_SET_SLICES_INDEX:return Object.assign({},t,{slicesIndex:e.payload});case nh.APP_SET_SLICES_MAX_INDEX:return Object.assign({},t,{slicesMaxIndex:e.payload});case nh.APP_SET_UNITS:return Object.assign({},t,{units:e.payload});case nh.APP_SET_VOLUME_STEPS:return Object.assign({},t,{volumeSteps:e.payload});case nh.APP_SET_VOLUME_WINDOW_WIDTH:return Object.assign({},t,{volumeWindowWidth:e.payload});case nh.APP_SET_VOLUME_WINDOW_CENTER:return Object.assign({},t,{volumeWindowCenter:e.payload});case nh.APP_SET_CAMERA:return Object.assign({},t,{camera:Object.assign({},t.camera,e.payload)});case nh.APP_SET_CONTROLS_ENABLED:return Object.assign({},t,{controlsEnabled:e.payload});case nh.APP_SET_CONTROLS_TYPE:return Object.assign({},t,{controlsType:e.payload});default:return Object.assign({},t)}}}),tu=function(t,e){return(0,i.h)("a-entity",{id:"model-container"},e)},eu=function(){function t(t){(0,i.r)(this,t),this._hovered=null,this._isShiftDown=!1,this._isWebGl2=!0,this.width="640",this.height="480",this.change=(0,i.c)(this,"change",7),this.loaded=(0,i.c)(this,"loaded",7),this.store=(0,i.e)(this,"store")}return t.prototype.load=function(t,e){return w(this,void 0,void 0,(function(){var n=this;return E(this,(function(i){return this.src?(this._setSrc(null),setTimeout((function(){n._setSrc(t,e)}),O.minLoadingMS)):this._setSrc(t,e),[2]}))}))},t.prototype.resize=function(){return w(this,void 0,void 0,(function(){return E(this,(function(t){return this._resize(),[2]}))}))},t.prototype.setNode=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setNode(t),[2]}))}))},t.prototype.setGraph=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setGraph(t),[2]}))}))},t.prototype.deleteNode=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._deleteNode(t),[2]}))}))},t.prototype.clearGraph=function(){return w(this,void 0,void 0,(function(){return E(this,(function(t){return this._clearGraph(),[2]}))}))},t.prototype.selectNode=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._selectNode(t,!0),[2]}))}))},t.prototype.deleteEdge=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._deleteEdge(t),[2]}))}))},t.prototype.deleteAngle=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._deleteAngle(t),[2]}))}))},t.prototype.setEdge=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setEdge(t),[2]}))}))},t.prototype.recenter=function(){return w(this,void 0,void 0,(function(){return E(this,(function(t){return this._recenter(),[2]}))}))},t.prototype.setBoundingBoxEnabled=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setBoundingBoxEnabled(t),[2]}))}))},t.prototype.setDisplayMode=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setDisplayMode(t),[2]}))}))},t.prototype.setControlsEnabled=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setControlsEnabled(t),[2]}))}))},t.prototype.setControlsType=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setControlsType(t),[2]}))}))},t.prototype.setGraphEnabled=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setGraphEnabled(t),[2]}))}))},t.prototype.setMaterial=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setMaterial(t),[2]}))}))},t.prototype.setNodeLabelsAlwaysVisible=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setNodeLabelsAlwaysVisible(t),[2]}))}))},t.prototype.setOrientation=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setOrientation(t),[2]}))}))},t.prototype.setSceneDistance=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setSceneDistance(t),[2]}))}))},t.prototype.setSlicesIndex=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setSlicesIndex(t),[2]}))}))},t.prototype.setUnits=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setUnits(t),[2]}))}))},t.prototype.setVolumeSteps=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setVolumeSteps(t),[2]}))}))},t.prototype.setVolumeBrightness=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setVolumeWindowCenter(t),[2]}))}))},t.prototype.setVolumeContrast=function(t){return w(this,void 0,void 0,(function(){return E(this,(function(e){return this._setVolumeWindowWidth(t),[2]}))}))},t.prototype.componentWillLoad=function(){return w(this,void 0,void 0,(function(){return E(this,(function(t){return this._isWebGl2=I.isWebGL2Available(),this.store.setStore(Wh($h,{},function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),i=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},r={getState:n.getState,dispatch:function(){return i.apply(void 0,arguments)}},o=e.map((function(t){return t(r)}));return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),i.forEach((function(e){Xh(t,e,n[e])}))}return t}({},n,{dispatch:i=qh.apply(void 0,o)(n.dispatch)})}}}(Jh))),this.store.mapStateToProps(this,(function(t){var e=t.app;return{angles:e.angles,boundingBoxEnabled:e.boundingBoxEnabled,camera:e.camera,controlsEnabled:e.controlsEnabled,controlsType:e.controlsType,displayMode:e.displayMode,edges:e.edges,graphEnabled:e.graphEnabled,material:e.material,nodes:e.nodes,nodeLabelsAlwaysVisible:e.nodeLabelsAlwaysVisible,orientation:e.orientation,selected:e.selected,sceneDistance:e.sceneDistance,slicesIndex:e.slicesIndex,slicesMaxIndex:e.slicesMaxIndex,src:e.src,srcLoaded:e.srcLoaded,units:e.units,volumeSteps:e.volumeSteps,volumeWindowCenter:e.volumeWindowCenter,volumeWindowWidth:e.volumeWindowWidth}})),this.store.mapDispatchToProps(this,{appClearAngles:Sh,appClearEdges:wh,appClearNodes:vh,appDeleteAngle:_h,appDeleteEdge:bh,appDeleteNode:mh,appSelectAngle:Mh,appSelectEdge:xh,appSelectNode:gh,appSetAngle:Eh,appSetBoundingBoxEnabled:Th,appSetCamera:Hh,appSetControlsEnabled:Fh,appSetControlsType:jh,appSetDisplayMode:Ah,appSetEdge:yh,appSetGraphEnabled:Lh,appSetMaterial:Ch,appSetNode:fh,appSetNodeLabelsAlwaysVisible:Ph,appSetOrientation:Oh,appSetSceneDistance:Ih,appSetSlicesIndex:Dh,appSetSlicesMaxIndex:kh,appSetSrc:dh,appSetSrcLoaded:ph,appSetUnits:Rh,appSetVolumeSteps:Nh,appSetVolumeWindowCenter:Bh,appSetVolumeWindowWidth:zh}),this._controlsAnimationFinishedHandler=this._controlsAnimationFinishedHandler.bind(this),this._controlsInteractionHandler=this._controlsInteractionHandler.bind(this),this._graphEntryDraggedHandler=this._graphEntryDraggedHandler.bind(this),this._graphEntryPointerDownHandler=this._graphEntryPointerDownHandler.bind(this),this._graphEntryPointerOutHandler=this._graphEntryPointerOutHandler.bind(this),this._graphEntryPointerOverHandler=this._graphEntryPointerOverHandler.bind(this),this._graphEntryPointerUpHandler=this._graphEntryPointerUpHandler.bind(this),this._graphEntrySelectedHandler=this._graphEntrySelectedHandler.bind(this),this._graphEntryValidTargetHandler=this._graphEntryValidTargetHandler.bind(this),this._keyDownHandler=this._keyDownHandler.bind(this),this._keyUpHandler=this._keyUpHandler.bind(this),this._controlsInteractionFinishedHandler=this._controlsInteractionFinishedHandler.bind(this),this._slicesMaxIndexHandler=this._slicesMaxIndexHandler.bind(this),this._spawnNodeHandler=this._spawnNodeHandler.bind(this),this._srcLoadedHandler=this._srcLoadedHandler.bind(this),this._volumeDefaultRenderStepsHandler=this._volumeDefaultRenderStepsHandler.bind(this),this._volumeRaycastHandler=this._volumeRaycastHandler.bind(this),this._debouncedAppSetCamera=k.debounce(this.appSetCamera,O.minFrameMS).bind(this),[2]}))}))},t.prototype._renderScene=function(){var t=this;return(0,i.h)(ch,{cb:function(e){t._scene=e,t._scene.addEventListener("loaded",(function(){t._scene.sceneEl.renderer.toneMapping=THREE.ACESFilmicToneMapping}))},isWebGl2:this._isWebGl2},(0,i.h)(tu,null,(0,i.h)(hh,{cb:function(e){t._targetEntity=e},controlsType:this.controlsType,displayMode:this.displayMode,dracoDecoderPath:this.dracoDecoderPath,envMapPath:this.envMapPath,graphEnabled:this.graphEnabled,orientation:this.orientation,slicesIndex:this.slicesIndex,src:this.src,srcLoaded:this.srcLoaded,volumeSteps:this.volumeSteps,volumeWindowCenter:this.volumeWindowCenter,volumeWindowWidth:this.volumeWindowWidth}),(0,i.h)(rh,{cb:function(e){t._boundingEntity=e},boundingBox:this._boundingBox,boundingBoxEnabled:this.boundingBoxEnabled,color:O.colors.white,displayMode:this.displayMode,graphEnabled:this.graphEnabled,mesh:this._getMesh(),srcLoaded:this.srcLoaded,targetEntity:this._targetEntity})),(0,i.h)(sh,{boundingSphereRadius:this._boundingSphereRadius,camera:this._scene?this._scene.camera:null,cameraPosition:this.camera?this.camera.position:null,controlsType:this.controlsType,fontSize:O.fontSizeMedium,graphEnabled:this.graphEnabled,nodes:this.nodes,nodeLabelsAlwaysVisible:this.nodeLabelsAlwaysVisible,selected:this.selected}),(0,i.h)(oh,{boundingSphereRadius:this._boundingSphereRadius,camera:this._scene?this._scene.camera:null,cameraPosition:this.camera?this.camera.position:null,controlsType:this.controlsType,displayMode:this.displayMode,edges:this.edges,edgeMinSize:O.edgeMinSize,edgeSize:O.edgeSize,fontSize:O.fontSizeMedium,nodes:this.nodes,selected:this.selected,units:this.units}),(0,i.h)(ih,{angles:this.angles,boundingSphereRadius:this._boundingSphereRadius,camera:this._scene?this._scene.camera:null,cameraPosition:this.camera?this.camera.position:null,controlsType:this.controlsType,edges:this.edges,edgeMinSize:O.edgeMinSize,edgeSize:O.edgeSize,fontSize:O.fontSizeMedium,nodes:this.nodes,selected:this.selected}),function(){switch(t.controlsType){case d.TRACKBALL:return(0,i.h)(uh,{cb:function(e){t._camera=e},animating:!(!t.camera||!t.camera.animating)&&t.camera.animating,aspect:t._scene?t._scene.offsetWidth/t._scene.offsetHeight:null,controlPosition:I.vector3ToString(t.camera?t.camera.position:new THREE.Vector3(0,0,0)),controlTarget:I.vector3ToString(t.camera?t.camera.target:new THREE.Vector3(0,0,0)),dampingFactor:O.camera.dampingFactor,enabled:t.controlsEnabled,far:t.sceneDistance?B.getFarFromSceneDistance(t.sceneDistance):O.camera.far,fov:O.camera.fov,graphEnabled:t.graphEnabled,maxDistance:t.sceneDistance?B.getFarFromSceneDistance(t.sceneDistance):O.camera.maxDistance,near:t.sceneDistance?B.getNearFromSceneDistance(t.sceneDistance):O.camera.near,panSpeed:O.camera.panSpeed,rotateSpeed:O.camera.trackballRotateSpeed,screenHeight:t._scene?t._scene.canvas.height:0,screenWidth:t._scene?t._scene.canvas.width:0,zoomSpeed:O.camera.trackballZoomSpeed});case d.ORBIT:return(0,i.h)(lh,{cb:function(e){t._camera=e},animating:!(!t.camera||!t.camera.animating)&&t.camera.animating,aspect:t._scene?t._scene.offsetWidth/t._scene.offsetHeight:null,controlPosition:I.vector3ToString(t.camera?t.camera.position:new THREE.Vector3(0,0,0)),controlTarget:I.vector3ToString(t.camera?t.camera.target:new THREE.Vector3(0,0,0)),dampingFactor:O.camera.dampingFactor,enabled:t.controlsEnabled,far:t.sceneDistance?B.getFarFromSceneDistance(t.sceneDistance):O.camera.far,fov:O.camera.fov,graphEnabled:t.graphEnabled,maxDistance:t.sceneDistance?B.getFarFromSceneDistance(t.sceneDistance):O.camera.maxDistance,maxPolarAngle:O.camera.maxPolarAngle,minDistance:O.camera.minDistance,minPolarAngle:O.camera.minPolarAngle,panSpeed:O.camera.orbitPanSpeed,near:t.sceneDistance?B.getNearFromSceneDistance(t.sceneDistance):O.camera.near,rotateSpeed:O.camera.orbitRotateSpeed,zoomSpeed:O.camera.orbitZoomSpeed});default:return null}}(),(0,i.h)(ah,{ambientLightColor:O.lights.ambientLightColor,ambientLightIntensity:O.lights.ambientLightIntensity}))},t.prototype.render=function(){return(0,i.h)("div",{id:"al-container",class:this.displayMode,style:{width:B.addCssUnits(this.width),height:B.addCssUnits(this.height)}},(0,i.h)("div",{id:"lut-container"},(0,i.h)("div",{id:"lut-min"},"0.0"),(0,i.h)("div",{id:"lut-canvases"}),(0,i.h)("div",{id:"lut-max"},"1.0")),this._renderScene(),this.src&&!this.srcLoaded&&(0,i.h)("div",{id:"spinner"},(0,i.h)("div",{class:"square"})))},t.prototype._resize=function(){this._scene&&this._scene.resize()},t.prototype._createEdge=function(t,e){if(!Array.from(this.edges).find((function(n){n[0];var i=n[1];return i.node1Id===t&&i.node2Id===e||i.node1Id===e&&i.node2Id===t}))){var n={node1Id:t,node2Id:e},i=z.getNextId(u.EDGE,this.edges);this._setEdge([i,n])}},t.prototype._createAngle=function(t,e){if(Array.from(this.angles).find((function(n){n[0];var i=n[1];return i.edge1Id===t&&i.edge2Id===e||i.edge1Id===e&&i.edge2Id===t})))console.warn("cannot create angle: angle already exists");else{var n=this.edges.get(t),i=this.edges.get(e);if(n.node1Id===i.node1Id||n.node1Id===i.node2Id||n.node2Id===i.node1Id||n.node2Id===i.node2Id){var r={edge1Id:t,edge2Id:e},o=z.getNextId(u.ANGLE,this.angles);this._setAngle([o,r])}else console.warn("cannot create angle: edges not connected")}},t.prototype._stateChanged=function(){this.change.emit(this.store.getState().app)},t.prototype._setGraph=function(t){var e=this;t.nodes&&new Map(t.nodes).forEach((function(t,n){e.appSetNode([n,t])})),t.edges&&new Map(t.edges).forEach((function(t,n){e.appSetEdge([n,t])})),t.angles&&new Map(t.angles).forEach((function(t,n){e.appSetAngle([n,t])})),this._stateChanged()},t.prototype._clearGraph=function(){this.appClearNodes(),this.appClearEdges(),this.appClearAngles(),this._stateChanged()},t.prototype._deleteNode=function(t){this.appDeleteNode(t),this._stateChanged()},t.prototype._setNode=function(t){this.appSetNode(t),this._stateChanged()},t.prototype._animateBetween=function(t,e){var n={position:e,target:B.getCameraStateFromMesh(this._getMesh(),this.sceneDistance).target.clone()};if(e){var i=n.position.distanceTo(this.camera.position),r=n.target.distanceTo(this.camera.target),o=i/O.maxAnimationSteps>Number.EPSILON,a=r/O.maxAnimationSteps>Number.EPSILON;if(o||a){n.position.copy(e.clone());var s=I.getSlerpCameraPath(t,n,o,a);this._scene.emit(Xc.ANIMATION_STARTED,{slerpPath:s},!1),this.appSetCamera({animating:!0}),this._stateChanged()}}},t.prototype._selectNode=function(t,e){if(void 0===e&&(e=!1),e&&t!==this.selected){var n={position:this.camera.position.clone(),target:this.camera.target.clone()},i=B.getCameraPositionFromNode(this.nodes.get(t),this._boundingSphereRadius,this.camera.target);this.appSelectNode(t),this._animateBetween(n,i)}else this.appSelectNode(t),this._stateChanged()},t.prototype._setEdge=function(t){this.appSetEdge(t),this._stateChanged()},t.prototype._deleteEdge=function(t){this.appDeleteEdge(t),this._stateChanged()},t.prototype._recenter=function(){var t=B.getCameraStateFromMesh(this._getMesh(),this.sceneDistance),e={position:this.camera.position.clone(),target:this.camera.target.clone()};this._selectNode(null),this._animateBetween(e,t.position)},t.prototype._selectEdge=function(t){this.appSelectEdge(t),this._stateChanged()},t.prototype._setAngle=function(t){this.appSetAngle(t),this._stateChanged()},t.prototype._selectAngle=function(t){this.appSelectAngle(t),this._stateChanged()},t.prototype._deleteAngle=function(t){this.appDeleteAngle(t),this._stateChanged()},t.prototype._setBoundingBoxEnabled=function(t){this.appSetBoundingBoxEnabled(t),this._stateChanged()},t.prototype._setControlsEnabled=function(t){this.appSetControlsEnabled(t),this._stateChanged()},t.prototype._setControlsType=function(t){this.appSetControlsType(t),this._scene.camera.up.copy(this._targetEntity.object3D.up),this._stateChanged()},t.prototype._setGraphEnabled=function(t){this.appSetGraphEnabled(t),this._stateChanged()},t.prototype._setMaterial=function(t){this.appSetMaterial(t),this._stateChanged()},t.prototype._setNodeLabelsAlwaysVisible=function(t){this.appSetNodeLabelsAlwaysVisible(t),this._stateChanged()},t.prototype._setOrientation=function(t){this.appSetOrientation(t),this._stateChanged()},t.prototype._setSceneDistance=function(t){this.appSetSceneDistance(t),this._stateChanged()},t.prototype._setSlicesIndex=function(t){this.appSetSlicesIndex(t),this._stateChanged()},t.prototype._setUnits=function(t){this.appSetUnits(t),this._stateChanged()},t.prototype._setVolumeSteps=function(t){this.appSetVolumeSteps(t),this._stateChanged()},t.prototype._setVolumeWindowCenter=function(t){this.appSetVolumeWindowCenter(t),this._stateChanged()},t.prototype._setVolumeWindowWidth=function(t){this.appSetVolumeWindowWidth(t),this._stateChanged()},t.prototype._setDisplayMode=function(t){this.appSetDisplayMode(t),this._stateChanged()},t.prototype._setSrc=function(t,e){this.appSetSrc([t,e]),this._stateChanged()},t.prototype._getMesh=function(){var t=null;if(this._targetEntity&&this.displayMode===p.MESH){var e=this._targetEntity.object3DMap.mesh;e instanceof THREE.Mesh?t=e:e&&e.traverse((function(e){if(e instanceof THREE.Mesh&&null===t)return t=e}))}else this._loadedObject&&this._loadedObject._bBox?t=this._loadedObject._bBox._mesh:this._loadedObject&&(t=this._loadedObject._mesh);return t},t.prototype._srcLoadedHandler=function(t){var e,n;if(this._loadedObject=t.detail,this._loadedObject.model){this._boundingBox=B.getBoundingBox(this._loadedObject.model);var i=new Ye;this._boundingSphereRadius=this._boundingBox.getBoundingSphere(i).radius,n=B.getSceneDistanceFromModel(this._loadedObject.model,O.zoomFactor,O.fov),e=B.getCameraStateFromModel(this._loadedObject.model,n)}else{var r=this._getMesh();r.geometry.computeBoundingSphere(),r.geometry.computeBoundingBox(),this._boundingBox=B.getBoundingBox(r),this._boundingSphereRadius=r.geometry.boundingSphere.radius,n=B.getSceneDistanceFromMesh(r,O.zoomFactor,O.fov),e=B.getCameraStateFromMesh(r,n)}n&&this.appSetSceneDistance(n),e&&this.appSetCamera(e),this.appSetSrcLoaded(!0),this._stateChanged(),this.loaded.emit(t.detail)},t.prototype._keyDownHandler=function(t){this._isShiftDown=t.shiftKey,t.keyCode===H.Delete&&this.selected&&(this.nodes.has(this.selected)?this._deleteNode(this.selected):this.edges.has(this.selected)?this._deleteEdge(this.selected):this.angles.has(this.selected)&&this._deleteAngle(this.selected))},t.prototype._keyUpHandler=function(t){this._isShiftDown=!1},t.prototype._graphEntryPointerUpHandler=function(t){this.appSetControlsEnabled(!0),I.enableControls(this._camera,!0,this.controlsType)},t.prototype._graphEntryPointerDownHandler=function(t){this.appSetControlsEnabled(!1),I.enableControls(this._camera,!1,this.controlsType)},t.prototype._graphEntryPointerOutHandler=function(t){this._hovered=null},t.prototype._graphEntryPointerOverHandler=function(t){this._hovered=t.detail.id},t.prototype._controlsInteractionHandler=function(t){var e=t.detail.cameraState;this.appSetCamera(e)},t.prototype._controlsInteractionFinishedHandler=function(t){var e=t.detail.cameraState;this._debouncedAppSetCamera(e)},t.prototype._spawnNodeHandler=function(t){if(this.graphEnabled&&this._validTarget&&null===this._hovered){var e=void 0,n=z.getNextId(u.NODE,this.nodes),i=t.detail.aframeEvent.detail.intersection;if(this.displayMode===p.VOLUME&&i?this._scene.emit(th.VOLUME_RAY_REQUEST,{cameraPosition:this._camera.object3D.children[0].position.clone(),cameraDirection:this._camera.getAttribute("raycaster").direction,intersection:i,type:eh.CREATE}):i&&(e={targetId:this.src,position:I.vector3ToString(i.point),scale:this._boundingSphereRadius*O.nodeSize,normal:I.vector3ToString(i.face.normal),title:n}),e){var r=this.selected;this._setNode([n,e]),this._isShiftDown&&this.nodes.has(r)&&(this._createEdge(r,n),this._selectNode(n))}}},t.prototype._volumeRaycastHandler=function(t){var e=t.detail.hitPosition,n=t.detail.rayResult;switch(t.detail.type){case eh.CREATE:var i=void 0,r=z.getNextId(u.NODE,this.nodes);if(n&&(i={targetId:this.src,position:I.vector3ToString(e),scale:this._boundingSphereRadius*O.nodeSize,title:r}),i){var o=this.selected;this._setNode([r,i]),this._isShiftDown&&this.nodes.has(o)&&(this._createEdge(o,r),this._selectNode(r))}break;case eh.DRAG:if(r=this.selected,!n){var a=this._camera.object3D.children[0].position.distanceTo(this._targetEntity.getAttribute("position"));e.copy(this._camera.object3D.children[0].position),e.add(this._camera.getAttribute("raycaster").direction.clone().multiplyScalar(1.5*a))}this._setNode([r,{position:I.vector3ToString(e)}]);var s=r+O.movedEventName;this._scene.emit(s,{},!0)}},t.prototype._graphEntryValidTargetHandler=function(t){this._validTarget=t.detail.valid},t.prototype._controlsAnimationFinishedHandler=function(t){this.appSetCamera({animating:!1})},t.prototype._graphEntrySelectedHandler=function(t){if(this.graphEnabled){var e=t.detail.type,n=t.detail.id;switch(e){case u.NODE:null!==this._hovered&&this.nodes.has(this._hovered)&&null!==this.selected&&this.nodes.has(this.selected)&&this.selected!==this._hovered&&this._isShiftDown&&this._createEdge(this.selected,this._hovered),this._selectNode(n);break;case u.EDGE:null!==this._hovered&&this.edges.has(this._hovered)&&null!==this.selected&&this.edges.has(this.selected)&&this.selected!==this._hovered&&this._isShiftDown&&this._createAngle(this.selected,this._hovered),this._selectEdge(n);break;case u.ANGLE:this._selectAngle(n)}}},t.prototype._graphEntryDraggedHandler=function(t){var e=t.detail.id,n=this._camera.components.raycaster,i=this._camera.getAttribute("raycaster"),r=new THREE.Vector3,o=!1;if(this.displayMode===p.VOLUME)(a=n.getIntersection(this._boundingEntity))&&this._scene.emit(th.VOLUME_RAY_REQUEST,{cameraPosition:this._camera.object3D.children[0].position.clone(),cameraDirection:this._camera.getAttribute("raycaster").direction,intersection:a,type:eh.DRAG});else{var a;if((a=n.getIntersection(this._targetEntity))&&(r.copy(a.point),o=!0),o)r.copy(a.point);else{var s=this._camera.object3D.children[0].position.distanceTo(this._targetEntity.getAttribute("position"));r.copy(this._camera.object3D.children[0].position),r.add(i.direction.clone().multiplyScalar(1.5*s))}this._setNode([e,{position:I.vector3ToString(r)}]);var l=e+O.movedEventName;this._scene.emit(l,{},!0)}},t.prototype._volumeDefaultRenderStepsHandler=function(t){this.appSetVolumeSteps(t.detail),this._stateChanged()},t.prototype._slicesMaxIndexHandler=function(t){this.appSetSlicesMaxIndex(t.detail)},t.prototype._addEventListeners=function(){window.addEventListener("keydown",this._keyDownHandler,!1),window.addEventListener("keyup",this._keyUpHandler,!1),this._scene.addEventListener(th.VOLUME_RAY_CAST,this._volumeRaycastHandler,!1),this._scene.addEventListener(Xc.ANIMATION_FINISHED,this._controlsAnimationFinishedHandler,!1),this._scene.addEventListener(Xc.INTERACTION,this._controlsInteractionHandler,!1),this._scene.addEventListener(Xc.INTERACTION_FINISHED,this._controlsInteractionFinishedHandler,!1),this._scene.addEventListener(N.POINTER_UP,this._graphEntryPointerUpHandler,!1),this._scene.addEventListener(N.POINTER_DOWN,this._graphEntryPointerDownHandler,!1),this._scene.addEventListener(N.DRAGGED,this._graphEntryDraggedHandler,!1),this._scene.addEventListener(N.SELECTED,this._graphEntrySelectedHandler,!1),this._scene.addEventListener("al-add-node",this._spawnNodeHandler,!1),this._scene.addEventListener("al-valid-target",this._graphEntryValidTargetHandler,!1),this._scene.addEventListener("al-model-loaded",this._srcLoadedHandler,!1),this._scene.addEventListener(th.DEFAULT_RENDER_STEPS,this._volumeDefaultRenderStepsHandler,!1),this._scene.addEventListener(th.LOADED,this._srcLoadedHandler,!1),this._scene.addEventListener(th.SLICES_MAX_INDEX,this._slicesMaxIndexHandler,!1),this._scene.addEventListener(N.POINTER_OVER,this._graphEntryPointerOverHandler,!1),this._scene.addEventListener(N.POINTER_OUT,this._graphEntryPointerOutHandler,!1)},t.prototype.componentDidUpdate=function(){this._scene&&this._addEventListeners()},Object.defineProperty(t,"style",{get:function(){return"#al-container{position:relative;font-family:sans-serif}#al-container a-scene{display:block;width:100%;height:100%}#al-container.mesh a-scene{background-color:var(--al-mesh-viewport-background-color)}#al-container.slices a-scene{background-color:var(--al-slices-viewport-background-color)}#al-container.volume a-scene{background-color:var(--al-volume-viewport-background-color)}#al-container #lut-container{display:none}#al-container .progress.container{position:absolute;top:auto!important;bottom:0!important}#al-container .progress.container .load.progress,#al-container .progress.container .parse.progress{border:none!important;height:4px!important;background-color:var(--load-progress-color,#fff)!important}#al-container #spinner{position:absolute;left:50%;top:calc(50% - 15px)}#al-container #spinner .square{margin:0 0 0 -15px;width:30px;height:30px;-webkit-animation:sk-rotateplane 1.2s ease-in-out infinite;-moz-animation:sk-rotateplane 1.2s infinite ease-in-out;animation:sk-rotateplane 1.2s ease-in-out infinite}#al-container.mesh #spinner .square,#al-container.slices #spinner .square,#al-container.volume #spinner .square{background-color:var(--spinner-color,#fff)}@-webkit-keyframes sk-rotateplane{0%{-webkit-transform:perspective(120px)}50%{-webkit-transform:perspective(120px) rotateY(180deg)}to{-webkit-transform:perspective(120px) rotateY(180deg) rotateX(180deg)}}@keyframes sk-rotateplane{0%{transform:perspective(120px) rotateX(0deg) rotateY(0deg);-webkit-transform:perspective(120px) rotateX(0deg) rotateY(0deg)}50%{transform:perspective(120px) rotateX(-180.1deg) rotateY(0deg);-webkit-transform:perspective(120px) rotateX(-180.1deg) rotateY(0deg)}to{transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg);-webkit-transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg)}}"},enumerable:!0,configurable:!0}),t}(),nu=function(){function t(t){(0,i.r)(this,t)}return t.prototype.componentDidLoad=function(){ru((function(){var t=(0,i.j)(window,"hybrid");i.i.getBoolean("_testing")||n.e(9678).then(n.bind(n,9678)).then((function(t){return t.startTapClick(i.i)})),i.i.getBoolean("statusTap",t)&&n.e(6845).then(n.bind(n,6845)).then((function(t){return t.startStatusTap()})),i.i.getBoolean("inputShims",iu())&&n.e(6520).then(n.bind(n,6520)).then((function(t){return t.startInputShims(i.i)})),i.i.getBoolean("hardwareBackButton",t)&&n.e(7854).then(n.bind(n,7854)).then((function(t){return t.startHardwareBackButton()})),n.e(4101).then(n.bind(n,4101)).then((function(t){return t.startFocusVisible()}))}))},t.prototype.render=function(){var t,e=(0,i.f)(this);return(0,i.h)(i.H,{class:(t={},t[e]=!0,t["ion-page"]=!0,t["force-statusbar-padding"]=i.i.getBoolean("_forceStatusbarPadding"),t)})},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return"html.plt-mobile ion-app{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-app.force-statusbar-padding{--ion-safe-area-top:20px}"},enumerable:!0,configurable:!0}),t}(),iu=function(){return(0,i.j)(window,"ios")&&(0,i.j)(window,"mobile")},ru=function(t){"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t,32)},ou=function(){function t(t){var e=this;(0,i.r)(this,t),this.inToolbar=!1,this.inItem=!1,this.buttonType="button",this.disabled=!1,this.routerDirection="forward",this.strong=!1,this.type="button",this.handleClick=function(t){if("button"===e.type)(0,o.o)(e.href,t,e.routerDirection);else if((0,r.h)(e.el)){var n=e.el.closest("form");if(n){t.preventDefault();var i=document.createElement("button");i.type=e.type,i.style.display="none",n.appendChild(i),i.click(),i.remove()}}},this.onFocus=function(){e.ionFocus.emit()},this.onBlur=function(){e.ionBlur.emit()},this.ionFocus=(0,i.c)(this,"ionFocus",7),this.ionBlur=(0,i.c)(this,"ionBlur",7)}return t.prototype.componentWillLoad=function(){this.inToolbar=!!this.el.closest("ion-buttons"),this.inItem=!!this.el.closest("ion-item")||!!this.el.closest("ion-item-divider")},Object.defineProperty(t.prototype,"hasIconOnly",{get:function(){return!!this.el.querySelector('ion-icon[slot="icon-only"]')},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rippleType",{get:function(){return(void 0===this.fill||"clear"===this.fill)&&this.hasIconOnly&&this.inToolbar?"unbounded":"bounded"},enumerable:!0,configurable:!0}),t.prototype.render=function(){var t,e=(0,i.f)(this),n=this,r=n.buttonType,a=n.type,s=n.disabled,l=n.rel,c=n.target,h=n.size,u=n.href,d=n.color,p=n.expand,f=n.hasIconOnly,m=n.shape,g=n.strong,v=void 0===h&&this.inItem?"small":h,y=void 0===u?"button":"a",b="button"===y?{type:a}:{download:this.download,href:u,rel:l,target:c},x=this.fill;return void 0===x&&(x=this.inToolbar?"clear":"solid"),(0,i.h)(i.H,{onClick:this.handleClick,"aria-disabled":s?"true":null,class:Object.assign(Object.assign({},(0,o.c)(d)),(t={},t[e]=!0,t[r]=!0,t[r+"-"+p]=void 0!==p,t[r+"-"+v]=void 0!==v,t[r+"-"+m]=void 0!==m,t[r+"-"+x]=!0,t[r+"-strong"]=g,t["button-has-icon-only"]=f,t["button-disabled"]=s,t["ion-activatable"]=!0,t["ion-focusable"]=!0,t))},(0,i.h)(y,Object.assign({},b,{class:"button-native",disabled:s,onFocus:this.onFocus,onBlur:this.onBlur}),(0,i.h)("span",{class:"button-inner"},(0,i.h)("slot",{name:"icon-only"}),(0,i.h)("slot",{name:"start"}),(0,i.h)("slot",null),(0,i.h)("slot",{name:"end"})),"md"===e&&(0,i.h)("ion-ripple-effect",{type:this.rippleType})))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-hover:initial;--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family,inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;pointer-events:auto;-webkit-font-kerning:none;font-kerning:none}:host(.button-disabled){--opacity:.5;pointer-events:none}:host(.button-disabled) .button-native{cursor:default;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary,#3880ff);--background-focused:var(--ion-color-primary-shade,#3171e0);--background-hover:var(--ion-color-primary-tint,#4c8dff);--color:var(--ion-color-primary-contrast,#fff);--color-activated:var(--ion-color-primary-contrast,#fff);--color-focused:var(--ion-color-primary-contrast,#fff)}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-solid.ion-color.ion-focused) .button-native{background:var(--ion-color-shade)}:host(.button-outline){--border-color:var(--ion-color-primary,#3880ff);--background:transparent;--color:var(--ion-color-primary,#3880ff);--color-focused:var(--ion-color-primary,#3880ff)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-outline.ion-focused.ion-color) .button-native{background:rgba(var(--ion-color-base-rgb),.1);color:var(--ion-color-base)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary,#3880ff)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-focused.ion-color) .button-native{background:rgba(var(--ion-color-base-rgb),.1);color:var(--ion-color-base)}:host(.button-clear.activated.ion-color) .button-native{background:transparent}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native:after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-.3em;margin-right:.3em;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-.3em;margin-inline-start:-.3em;-webkit-margin-end:.3em;margin-inline-end:.3em}}::slotted(ion-icon[slot=end]){margin-left:.3em;margin-right:-.2em;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:.3em;margin-inline-start:.3em;-webkit-margin-end:-.2em;margin-inline-end:-.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}:host(.ion-focused) .button-native{background:var(--background-focused);color:var(--color-focused)}:host(.activated) .button-native{background:var(--background-activated);color:var(--color-activated)}@media (any-hover:hover){:host(:hover) .button-native{background:var(--background-hover);color:var(--color-hover)}}:host{--border-radius:4px;--padding-top:0;--padding-bottom:0;--padding-start:1.1em;--padding-end:1.1em;--transition:box-shadow 280ms cubic-bezier(.4,0,.2,1),background-color 15ms linear,color 15ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:36px;font-size:14px;font-weight:500;letter-spacing:.06em;text-transform:uppercase}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:var(--background);--box-shadow:0 3px 1px -2px rgba(0,0,0,0.2),0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12)}:host(.button-solid.activated){--box-shadow:0 5px 5px -3px rgba(0,0,0,0.2),0 8px 10px 1px rgba(0,0,0,0.14),0 3px 14px 2px rgba(0,0,0,0.12)}:host(.button-outline){--border-width:2px;--border-style:solid;--box-shadow:none;--background-activated:transparent;--background-focused:rgba(var(--ion-color-primary-rgb,56,128,255),0.1);--background-hover:rgba(var(--ion-color-primary-rgb,56,128,255),0.04);--color-activated:var(--ion-color-primary,#3880ff)}:host(.button-outline.activated.ion-color) .button-native{background:transparent}:host(.button-clear){--background-activated:transparent;--background-focused:rgba(var(--ion-color-primary-rgb,56,128,255),0.1);--background-hover:rgba(var(--ion-color-primary-rgb,56,128,255),0.04);--color-activated:var(--ion-color-primary,#3880ff);--color-focused:var(--ion-color-primary,#3880ff)}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-large){--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-strong){font-weight:700}::slotted(ion-icon[slot=icon-only]){padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}@media (any-hover:hover){:host(.button-solid.ion-color:hover) .button-native{background:var(--ion-color-tint)}:host(.button-clear.ion-color:hover) .button-native,:host(.button-outline.ion-color:hover) .button-native{background:rgba(var(--ion-color-base-rgb),.04)}}"},enumerable:!0,configurable:!0}),t}(),au=function(t,e,n,i,r){return n="ios"===(n&&n.toLowerCase())?"ios":"md",i&&"ios"===n?t=i.toLowerCase():r&&"md"===n?t=r.toLowerCase():(t||!e||lu(e)||(t=e),cu(t)&&(t=t.toLowerCase(),/^md-|^ios-|^logo-/.test(t)||(t=n+"-"+t))),cu(t)&&""!==t.trim()?""!==t.replace(/[a-z]|-|\d/gi,"")?null:t:null},su=function(t){return cu(t)&&(t=t.trim(),lu(t))?t:null},lu=function(t){return t.length>0&&/(\/|\.)/.test(t)},cu=function(t){return"string"==typeof t},hu=function(t){if(1===t.nodeType){if("script"===t.nodeName.toLowerCase())return!1;for(var e=0;e<t.attributes.length;e++){var n=t.attributes[e].value;if(cu(n)&&0===n.toLowerCase().indexOf("on"))return!1}for(e=0;e<t.childNodes.length;e++)if(!hu(t.childNodes[e]))return!1}return!0},uu=new Map,du=function(){function t(t){(0,i.r)(this,t),this.mode=pu(this),this.isVisible=!1,this.lazy=!1}return t.prototype.connectedCallback=function(){var t=this;this.waitUntilVisible(this.el,"50px",(function(){t.isVisible=!0,t.loadIcon()}))},t.prototype.disconnectedCallback=function(){this.io&&(this.io.disconnect(),this.io=void 0)},t.prototype.waitUntilVisible=function(t,e,n){var i=this;if(this.lazy&&"undefined"!=typeof window&&window.IntersectionObserver){var r=this.io=new window.IntersectionObserver((function(t){t[0].isIntersecting&&(r.disconnect(),i.io=void 0,n())}),{rootMargin:e});r.observe(t)}else n()},t.prototype.loadIcon=function(){var t=this;if(this.isVisible){var e=function(t){var e,n=su(t.src);if(n)return n;if(n=au(t.name,t.icon,t.mode,t.ios,t.md))return e=n,function(){if(!Qh){var t=window;t.Ionicons=t.Ionicons||{},Qh=t.Ionicons.map=t.Ionicons.map||new Map}return Qh}().get(e)||(0,i.k)("svg/"+e+".svg");if(t.icon){if(n=su(t.icon))return n;if(n=su(t.icon[t.mode]))return n}return null}(this);e&&function(t){var e=uu.get(t);return e||(e=fetch(t).then((function(t){return t.status<=299?t.text():Promise.resolve(null)})).then((function(t){return function(t){if(t){var e=document.createElement("div");e.innerHTML=t;for(var n=e.childNodes.length-1;n>=0;n--)"svg"!==e.childNodes[n].nodeName.toLowerCase()&&e.removeChild(e.childNodes[n]);var i=e.firstElementChild;if(i&&"svg"===i.nodeName.toLowerCase()&&(i.setAttribute("class","s-ion-icon"),hu(i)))return e.innerHTML}return""}(t)})),uu.set(t,e)),e}(e).then((function(e){return t.svgContent=e}))}if(!this.ariaLabel){var n=au(this.name,this.icon,this.mode,this.ios,this.md);n&&(this.ariaLabel=n.replace("ios-","").replace("md-","").replace(/\-/g," "))}},t.prototype.render=function(){var t,e,n=this.mode||"md",r=this.flipRtl||this.ariaLabel&&this.ariaLabel.indexOf("arrow")>-1&&!1!==this.flipRtl;return(0,i.h)(i.H,{role:"img",class:Object.assign((t={},t[n]=!0,t),fu(this.color),(e={},e["icon-"+this.size]=!!this.size,e["flip-rtl"]=!!r&&"rtl"===this.el.ownerDocument.dir,e))},this.svgContent?(0,i.h)("div",{class:"icon-inner",innerHTML:this.svgContent}):(0,i.h)("div",{class:"icon-inner"}))},Object.defineProperty(t,"assetsDirs",{get:function(){return["svg"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{name:["loadIcon"],src:["loadIcon"],icon:["loadIcon"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;-webkit-box-sizing:content-box!important;box-sizing:content-box!important}.icon-inner,svg{display:block;height:100%;width:100%}:host(.flip-rtl) .icon-inner{-webkit-transform:scaleX(-1);transform:scaleX(-1)}:host(.icon-small){font-size:18px!important}:host(.icon-large){font-size:32px!important}:host(.ion-color){color:var(--ion-color-base)!important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary,#3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary,#0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary,#f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success,#10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning,#ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger,#f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light,#f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium,#989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark,#222428)}"},enumerable:!0,configurable:!0}),t}(),pu=function(t){return(0,i.l)(t)||document.documentElement.getAttribute("mode")||"md"},fu=function(t){var e;return t?((e={"ion-color":!0})["ion-color-"+t]=!0,e):null},mu=function(){function t(t){var e=this;(0,i.r)(this,t),this.inputId="ion-input-"+gu++,this.didBlurAfterEdit=!1,this.hasFocus=!1,this.autocapitalize="off",this.autocomplete="off",this.autocorrect="off",this.autofocus=!1,this.clearInput=!1,this.debounce=0,this.disabled=!1,this.name=this.inputId,this.readonly=!1,this.required=!1,this.spellcheck=!1,this.type="text",this.value="",this.onInput=function(t){var n=t.target;n&&(e.value=n.value||""),e.ionInput.emit(t)},this.onBlur=function(){e.hasFocus=!1,e.focusChanged(),e.emitStyle(),e.ionBlur.emit()},this.onFocus=function(){e.hasFocus=!0,e.focusChanged(),e.emitStyle(),e.ionFocus.emit()},this.onKeydown=function(){e.shouldClearOnEdit()&&(e.didBlurAfterEdit&&e.hasValue()&&e.clearTextInput(),e.didBlurAfterEdit=!1)},this.clearTextInput=function(t){e.clearInput&&!e.readonly&&!e.disabled&&t&&(t.preventDefault(),t.stopPropagation()),e.value="",e.nativeInput&&(e.nativeInput.value="")},this.ionInput=(0,i.c)(this,"ionInput",7),this.ionChange=(0,i.c)(this,"ionChange",7),this.ionBlur=(0,i.c)(this,"ionBlur",7),this.ionFocus=(0,i.c)(this,"ionFocus",7),this.ionInputDidLoad=(0,i.c)(this,"ionInputDidLoad",7),this.ionInputDidUnload=(0,i.c)(this,"ionInputDidUnload",7),this.ionStyle=(0,i.c)(this,"ionStyle",7)}return t.prototype.debounceChanged=function(){this.ionChange=(0,r.d)(this.ionChange,this.debounce)},t.prototype.disabledChanged=function(){this.emitStyle()},t.prototype.valueChanged=function(){this.emitStyle(),this.ionChange.emit({value:this.value})},t.prototype.connectedCallback=function(){this.emitStyle(),this.debounceChanged(),this.el.dispatchEvent(new CustomEvent("ionInputDidLoad",{detail:this.el}))},t.prototype.disconnectedCallback=function(){document.dispatchEvent(new CustomEvent("ionInputDidUnload",{detail:this.el}))},t.prototype.setFocus=function(){return w(this,void 0,void 0,(function(){return E(this,(function(t){return this.nativeInput&&this.nativeInput.focus(),[2]}))}))},t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)},t.prototype.shouldClearOnEdit=function(){var t=this.type,e=this.clearOnEdit;return void 0===e?"password"===t:e},t.prototype.getValue=function(){return this.value||""},t.prototype.emitStyle=function(){this.ionStyle.emit({interactive:!0,input:!0,"has-placeholder":null!=this.placeholder,"has-value":this.hasValue(),"has-focus":this.hasFocus,"interactive-disabled":this.disabled})},t.prototype.focusChanged=function(){!this.hasFocus&&this.shouldClearOnEdit()&&this.hasValue()&&(this.didBlurAfterEdit=!0)},t.prototype.hasValue=function(){return this.getValue().length>0},t.prototype.render=function(){var t,e=this,n=(0,i.f)(this),a=this.getValue(),s=this.inputId+"-lbl",l=(0,r.f)(this.el);return l&&(l.id=s),(0,i.h)(i.H,{"aria-disabled":this.disabled?"true":null,class:Object.assign(Object.assign({},(0,o.c)(this.color)),(t={},t[n]=!0,t["has-value"]=this.hasValue(),t["has-focus"]=this.hasFocus,t))},(0,i.h)("input",{class:"native-input",ref:function(t){return e.nativeInput=t},"aria-labelledby":s,disabled:this.disabled,accept:this.accept,autoCapitalize:this.autocapitalize,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,autoFocus:this.autofocus,inputMode:this.inputmode,min:this.min,max:this.max,minLength:this.minlength,maxLength:this.maxlength,multiple:this.multiple,name:this.name,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readonly,required:this.required,spellCheck:this.spellcheck,step:this.step,size:this.size,type:this.type,value:a,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeydown}),this.clearInput&&!this.readonly&&!this.disabled&&(0,i.h)("button",{type:"button",class:"input-clear-icon",tabindex:"-1",onTouchStart:this.clearTextInput,onMouseDown:this.clearTextInput}))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{debounce:["debounceChanged"],disabled:["disabledChanged"],value:["valueChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return".sc-ion-input-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;--padding-top:0;--padding-bottom:0;--padding-start:0;--background:transparent;--color:initial;display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;width:100%;padding:0!important;background:var(--background);color:var(--color);font-family:var(--ion-font-family,inherit);z-index:2}ion-item.sc-ion-input-md-h:not(.item-label), ion-item:not(.item-label) .sc-ion-input-md-h{--padding-start:0}.ion-color.sc-ion-input-md-h{color:var(--ion-color-base)}.native-input.sc-ion-input-md{border-radius:var(--border-radius);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:inline-block;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.native-input.sc-ion-input-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-input.sc-ion-input-md::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md:-webkit-autofill{background-color:transparent}.native-input.sc-ion-input-md:invalid{-webkit-box-shadow:none;box-shadow:none}.native-input.sc-ion-input-md::-ms-clear{display:none}.native-input[disabled].sc-ion-input-md{opacity:.4}.cloned-input.sc-ion-input-md{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-input-md-h .cloned-input.sc-ion-input-md, [dir=rtl] .sc-ion-input-md-h .cloned-input.sc-ion-input-md, [dir=rtl].sc-ion-input-md .cloned-input.sc-ion-input-md{left:unset;right:unset;right:0}.input-clear-icon.sc-ion-input-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;background-position:50%;border:0;outline:none;background-color:transparent;background-repeat:no-repeat;visibility:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}.has-focus.has-value.sc-ion-input-md-h .input-clear-icon.sc-ion-input-md{visibility:visible}.has-focus.sc-ion-input-md-h{pointer-events:none}.has-focus.sc-ion-input-md-h a.sc-ion-input-md, .has-focus.sc-ion-input-md-h button.sc-ion-input-md, .has-focus.sc-ion-input-md-h input.sc-ion-input-md{pointer-events:auto}.sc-ion-input-md-h{--padding-top:10px;--padding-end:0;--padding-bottom:10px;--padding-start:8px;font-size:inherit}.item-label-floating.sc-ion-input-md-h, .item-label-floating .sc-ion-input-md-h, .item-label-stacked.sc-ion-input-md-h, .item-label-stacked .sc-ion-input-md-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0}.input-clear-icon.sc-ion-input-md{background-image:url(\"data:image/svg+xml;charset=utf-8,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'><polygon%20fill='var(--ion-color-step-600,%20%23666666)'%20points='405,136.798%20375.202,107%20256,226.202%20136.798,107%20107,136.798%20226.202,256%20107,375.202%20136.798,405%20256,285.798%20375.202,405%20405,375.202%20285.798,256'/></svg>\");width:30px;height:30px;background-size:22px}"},enumerable:!0,configurable:!0}),t}(),gu=0,vu=function(){function t(t){(0,i.r)(this,t),this.itemStyles=new Map,this.multipleInputs=!1,this.button=!1,this.detailIcon="ios-arrow-forward",this.disabled=!1,this.routerDirection="forward",this.type="button"}return t.prototype.itemStyle=function(t){t.stopPropagation();var e=t.target.tagName,n=t.detail,i={},r=this.itemStyles.get(e)||{},o=!1;Object.keys(n).forEach((function(t){if(n[t]){var e="item-"+t;r[e]||(o=!0),i[e]=!0}})),o||Object.keys(i).length===Object.keys(r).length||(o=!0),o&&(this.itemStyles.set(e,i),this.el.forceUpdate())},t.prototype.componentDidLoad=function(){var t=this.el.querySelectorAll("ion-checkbox, ion-datetime, ion-select, ion-radio"),e=this.el.querySelectorAll("ion-input, ion-range, ion-searchbar, ion-segment, ion-textarea, ion-toggle");this.multipleInputs=t.length+e.length>1},t.prototype.hasCover=function(){return 1===this.el.querySelectorAll("ion-checkbox, ion-datetime, ion-select, ion-radio").length&&!this.multipleInputs},t.prototype.isClickable=function(){return void 0!==this.href||this.button},t.prototype.canActivate=function(){return this.isClickable()||this.hasCover()},t.prototype.render=function(){var t,e=this,n=e.detail,r=e.detailIcon,a=e.download,s=e.lines,l=e.disabled,c=e.href,h=e.rel,u=e.target,d=e.routerDirection,p={},f=(0,i.f)(this),m=this.isClickable(),g=this.canActivate(),v=m?void 0===c?"button":"a":"div",y="button"===v?{type:this.type}:{download:a,href:c,rel:h,target:u},b=void 0!==n?n:"ios"===f&&m;return this.itemStyles.forEach((function(t){Object.assign(p,t)})),(0,i.h)(i.H,{"aria-disabled":l?"true":null,class:Object.assign(Object.assign(Object.assign({},p),(0,o.c)(this.color)),(t={item:!0},t[f]=!0,t["item-lines-"+s]=void 0!==s,t["item-disabled"]=l,t["in-list"]=(0,o.h)("ion-list",this.el),t["item-multiple-inputs"]=this.multipleInputs,t["ion-activatable"]=g,t["ion-focusable"]=!0,t))},(0,i.h)(v,Object.assign({},y,{class:"item-native",disabled:l,onClick:function(t){return(0,o.o)(c,t,d)}}),(0,i.h)("slot",{name:"start"}),(0,i.h)("div",{class:"item-inner"},(0,i.h)("div",{class:"input-wrapper"},(0,i.h)("slot",null)),(0,i.h)("slot",{name:"end"}),b&&(0,i.h)("ion-icon",{icon:r,lazy:!1,class:"item-detail-icon"}),(0,i.h)("div",{class:"item-inner-highlight"})),g&&"md"===f&&(0,i.h)("ion-ripple-effect",null)),(0,i.h)("div",{class:"item-highlight"}))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--box-shadow:none;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:var(--ion-item-background-activated,currentColor);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;outline:none;color:var(--color);font-family:var(--ion-font-family,inherit);text-align:initial;text-decoration:none;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}:host(.ion-color) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color) .item-inner,:host(.ion-color) .item-native{border-color:var(--ion-color-shade)}:host(.ion-focused) .item-native{background:var(--background-focused);color:var(--color-focused)}:host(.ion-color.ion-focused) .item-native{background:var(--ion-color-shade);color:var(--ion-color-contrast)}@media (any-hover:hover){:host(.ion-activatable:hover) .item-native{background:var(--background-hover);color:var(--color-hover)}:host(.ion-color.ion-activatable:hover) .item-native{background:var(--ion-color-tint);color:var(--ion-color-contrast)}}:host(.activated) .item-native{background:var(--background-activated);color:var(--color-activated)}:host(.item-disabled),:host(.item-interactive-disabled:not(.item-multiple-inputs)){cursor:default;pointer-events:none}:host(.item-disabled){opacity:.3}.item-native{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:var(--min-height);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.item-native{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.item-native::-moz-focus-inner{border:0}a,button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none}.item-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);-webkit-box-shadow:var(--inner-box-shadow);box-shadow:var(--inner-box-shadow);overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.item-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-detail-icon{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}::slotted(ion-icon){font-size:1.6em}::slotted(ion-button){--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}::slotted(ion-label){-ms-flex:1;flex:1}:host(.item-input),:host([vertical-align-top]){-ms-flex-align:start;align-items:flex-start}.input-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;text-overflow:ellipsis;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}:host(.item-label-floating) .item-native,:host(.item-label-stacked) .item-native{-ms-flex-align:start;align-items:start}:host(.item-label-floating) .input-wrapper,:host(.item-label-stacked) .input-wrapper{-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column}.item-highlight,.item-inner-highlight{left:0;right:0;bottom:0;position:absolute;background:var(--highlight-background)}.item-highlight{height:var(--full-highlight-height)}.item-inner-highlight{height:var(--inset-highlight-height)}:host(.item-interactive.ion-touched.ion-invalid),:host(.item-interactive.item-has-focus){--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}:host(.item-interactive.item-has-focus){--highlight-background:var(--highlight-color-focused)}:host(.item-interactive.ion-valid){--highlight-background:var(--highlight-color-valid)}:host(.item-interactive.ion-invalid){--highlight-background:var(--highlight-color-invalid)}:host(.item-label-floating) ::slotted(ion-select),:host(.item-label-stacked) ::slotted(ion-select){-ms-flex-item-align:stretch;align-self:stretch;width:100%;max-width:100%}:host(.item-label-floating) ::slotted(ion-datetime),:host(.item-label-stacked) ::slotted(ion-datetime){--padding-start:0;width:100%}:host(.item-multiple-inputs) ::slotted(ion-checkbox),:host(.item-multiple-inputs) ::slotted(ion-datetime),:host(.item-multiple-inputs) ::slotted(ion-radio),:host(.item-multiple-inputs) ::slotted(ion-select){position:relative}:host(.item-textarea){-ms-flex-align:stretch;align-items:stretch}::slotted(ion-reorder[slot]){margin-top:0;margin-bottom:0}ion-ripple-effect{color:var(--ripple-color)}:host{--min-height:48px;--background:var(--ion-item-background,var(--ion-background-color,#fff));--background-activated:var(--background);--background-focused:var(--ion-item-background-focused,var(--ion-color-step-100,#e1e1e1));--background-hover:var(--ion-item-background-hover,rgba(var(--ion-text-color-rgb,0,0,0),0.04));--transition:background-color 300ms cubic-bezier(.4,0,.2,1);--padding-start:16px;--color:var(--ion-item-color,var(--ion-text-color,#000));--border-color:var(--ion-item-border-color,var(--ion-border-color,var(--ion-color-step-150,rgba(0,0,0,0.13))));--inner-padding-end:16px;--inner-border-width:0 0 1px 0;--highlight-height:2px;--highlight-color-focused:var(--ion-color-primary,#3880ff);--highlight-color-valid:var(--ion-color-success,#10dc60);--highlight-color-invalid:var(--ion-color-danger,#f04141);font-size:16px;font-weight:400;text-transform:none}:host(.ion-focused.activated) .item-native{background:var(--background-focused);color:var(--color-focused)}:host(.ion-color.activated) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color.ion-focused.activated) .item-native{background:var(--ion-color-shade);color:var(--ion-color-contrast)}:host(.item-interactive){--inner-border-width:0}:host(.item-interactive),:host(.item-lines-full){--border-width:0 0 1px 0;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-inset){--inner-border-width:0 0 1px 0;--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-inset),:host(.item-lines-none){--border-width:0;--show-full-highlight:0}:host(.item-lines-full),:host(.item-lines-none){--inner-border-width:0;--show-inset-highlight:0}:host(.item-multi-line) ::slotted([slot=end]),:host(.item-multi-line) ::slotted([slot=start]){margin-top:16px;margin-bottom:16px;-ms-flex-item-align:start;align-self:flex-start}::slotted([slot=start]){margin-right:32px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted([slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted([slot=end]){margin-left:32px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted([slot=end]){margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb,0,0,0),.54);font-size:24px}:host(.ion-color) ::slotted(ion-icon){color:var(--ion-color-contrast)}::slotted(ion-icon[slot]){margin-top:12px;margin-bottom:12px}::slotted(ion-icon[slot=start]){margin-right:32px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted(ion-icon[slot=end]){margin-left:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-icon[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-note),::slotted(ion-toggle[slot=end]),::slotted(ion-toggle[slot=start]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}::slotted(ion-note){-ms-flex-item-align:start;align-self:flex-start;font-size:11px}::slotted(ion-note[slot]){padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}::slotted(ion-note[slot=start]){padding-right:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-note[slot=start]){padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-note[slot=end]){padding-left:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-note[slot=end]){padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}::slotted(ion-avatar){width:40px;height:40px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar),::slotted(ion-thumbnail){margin-top:8px;margin-bottom:8px}::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:11px;margin-bottom:10px}:host(.item-label-floating) ::slotted([slot=end]),:host(.item-label-stacked) ::slotted([slot=end]){margin-top:7px;margin-bottom:7px}:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:0}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}::slotted(.button-small){--padding-top:0;--padding-bottom:0;--padding-start:.6em;--padding-end:.6em;height:25px;font-size:12px}:host(.item-label-floating),:host(.item-label-stacked){--min-height:55px}:host(.item-label-floating) ::slotted(ion-select),:host(.item-label-stacked) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0}:host(.item-has-focus:not(.ion-color)) ::slotted(.label-floating),:host(.item-has-focus:not(.ion-color)) ::slotted(.label-stacked){color:var(--ion-color-primary,#3880ff)}"},enumerable:!0,configurable:!0}),t}(),yu=function(){function t(t){(0,i.r)(this,t),this.sticky=!1}return t.prototype.render=function(){var t,e=(0,i.f)(this);return(0,i.h)(i.H,{class:Object.assign(Object.assign({},(0,o.c)(this.color)),(t={},t[e]=!0,t["item-divider-sticky"]=this.sticky,t.item=!0,t))},(0,i.h)("slot",{name:"start"}),(0,i.h)("div",{class:"item-divider-inner"},(0,i.h)("div",{class:"item-divider-wrapper"},(0,i.h)("slot",null)),(0,i.h)("slot",{name:"end"})))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--inner-padding-top:0px;--inner-padding-end:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:30px;background:var(--background);color:var(--color);font-family:var(--ion-font-family,inherit);overflow:hidden;z-index:100;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.item-divider-sticky){position:-webkit-sticky;position:sticky;top:0}.item-divider-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;min-height:inherit;border:0;overflow:hidden}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.item-divider-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-divider-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;text-overflow:ellipsis;overflow:hidden}:host{--background:var(--ion-background-color,#fff);--color:var(--ion-color-step-400,#999);--padding-start:16px;--inner-padding-end:0;border-bottom:1px solid var(--ion-item-border-color,var(--ion-border-color,var(--ion-color-step-150,rgba(0,0,0,.13))));font-size:14px}::slotted([slot=start]){margin-right:32px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted([slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted([slot=end]){margin-left:32px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted([slot=end]){margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:13px;margin-bottom:10px}::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb,0,0,0),.54);font-size:24px}:host(.ion-color) ::slotted(ion-icon){color:var(--ion-color-contrast)}::slotted(ion-icon[slot]){margin-top:12px;margin-bottom:12px}::slotted(ion-icon[slot=start]){margin-right:32px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted(ion-icon[slot=end]){margin-left:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-icon[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-note){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-ms-flex-item-align:start;align-self:flex-start;font-size:11px}::slotted(ion-note[slot]){padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}::slotted(ion-note[slot=start]){padding-right:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-note[slot=start]){padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-note[slot=end]){padding-left:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-note[slot=end]){padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}::slotted(ion-avatar){width:40px;height:40px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar),::slotted(ion-thumbnail){margin-top:8px;margin-bottom:8px}::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:16px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(h1){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:400}::slotted(h2){font-size:16px}::slotted(h2),::slotted(h3,h4,h5,h6){margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-weight:400}::slotted(h3,h4,h5,h6),::slotted(p){font-size:14px;line-height:normal}::slotted(p){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;color:var(--ion-color-step-600,#666);text-overflow:inherit;overflow:inherit}"},enumerable:!0,configurable:!0}),t}(),bu=function(){function t(t){(0,i.r)(this,t),this.noAnimate=!1,this.ionStyle=(0,i.c)(this,"ionStyle",7)}return t.prototype.componentWillLoad=function(){this.noAnimate="floating"===this.position,this.emitStyle()},t.prototype.componentDidLoad=function(){var t=this;this.noAnimate&&setTimeout((function(){t.noAnimate=!1}),1e3)},t.prototype.positionChanged=function(){this.emitStyle()},t.prototype.emitStyle=function(){var t,e=this.position;this.ionStyle.emit(((t={label:!0})["label-"+e]=void 0!==e,t))},t.prototype.render=function(){var t,e=this.position,n=(0,i.f)(this);return(0,i.h)(i.H,{class:Object.assign(Object.assign({},(0,o.c)(this.color)),(t={},t[n]=!0,t["label-"+e]=void 0!==e,t["label-no-animate"]=this.noAnimate,t))})},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{position:["positionChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return".item.sc-ion-label-md-h, .item .sc-ion-label-md-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family,inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-label-md-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-md-h, [text-wrap].sc-ion-label-md-h{white-space:normal}.item-interactive-disabled.sc-ion-label-md-h:not(.item-multiple-inputs), .item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-md-h{cursor:default;opacity:.3;pointer-events:none}.item-input.sc-ion-label-md-h, .item-input .sc-ion-label-md-h{-ms-flex:initial;flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-md-h, .item-textarea .sc-ion-label-md-h{-ms-flex-item-align:baseline;align-self:baseline}.label-fixed.sc-ion-label-md-h{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-floating.sc-ion-label-md-h, .label-stacked.sc-ion-label-md-h{-ms-flex-item-align:stretch;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-md-h{-webkit-transition:none;transition:none}.ion-text-wrap.sc-ion-label-md-h, [text-wrap].sc-ion-label-md-h{line-height:1.5}.label-stacked.sc-ion-label-md-h{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translate3d(0,50%,0) scale(.75);transform:translate3d(0,50%,0) scale(.75);-webkit-transition:color .15s cubic-bezier(.4,0,.2,1);transition:color .15s cubic-bezier(.4,0,.2,1)}[dir=rtl].label-stacked.sc-ion-label-md-h, [dir=rtl] .label-stacked.sc-ion-label-md-h, [dir=rtl].sc-ion-label-md-h -no-combinator.label-stacked.sc-ion-label-md-h, [dir=rtl] .sc-ion-label-md-h -no-combinator.label-stacked.sc-ion-label-md-h{-webkit-transform-origin:right top;transform-origin:right top}.label-floating.sc-ion-label-md-h{-webkit-transform:translate3d(0,96%,0);transform:translate3d(0,96%,0);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:color .15s cubic-bezier(.4,0,.2,1),-webkit-transform .15s cubic-bezier(.4,0,.2,1);transition:color .15s cubic-bezier(.4,0,.2,1),-webkit-transform .15s cubic-bezier(.4,0,.2,1);transition:color .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1);transition:color .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1),-webkit-transform .15s cubic-bezier(.4,0,.2,1)}[dir=rtl].label-floating.sc-ion-label-md-h, [dir=rtl] .label-floating.sc-ion-label-md-h, [dir=rtl].sc-ion-label-md-h -no-combinator.label-floating.sc-ion-label-md-h, [dir=rtl] .sc-ion-label-md-h -no-combinator.label-floating.sc-ion-label-md-h{-webkit-transform-origin:right top;transform-origin:right top}.label-floating.sc-ion-label-md-h, .label-stacked.sc-ion-label-md-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.item-select.label-floating.sc-ion-label-md-h, .item-select .label-floating.sc-ion-label-md-h{-webkit-transform:translate3d(0,130%,0);transform:translate3d(0,130%,0)}.item-has-focus.label-floating.sc-ion-label-md-h, .item-has-focus .label-floating.sc-ion-label-md-h, .item-has-placeholder.label-floating.sc-ion-label-md-h, .item-has-placeholder .label-floating.sc-ion-label-md-h, .item-has-value.label-floating.sc-ion-label-md-h, .item-has-value .label-floating.sc-ion-label-md-h{-webkit-transform:translate3d(0,50%,0) scale(.75);transform:translate3d(0,50%,0) scale(.75)}.item-has-focus.label-floating.sc-ion-label-md-h, .item-has-focus .label-floating.sc-ion-label-md-h, .item-has-focus.label-stacked.sc-ion-label-md-h, .item-has-focus .label-stacked.sc-ion-label-md-h{color:var(--ion-color-primary,#3880ff)}.sc-ion-label-md-s  h1 {margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:400}.sc-ion-label-md-s  h2 {margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:400}.sc-ion-label-md-s  h3 , .sc-ion-label-md-s  h4 , .sc-ion-label-md-s  h5 , .sc-ion-label-md-s  h6 {margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:400;line-height:normal}.sc-ion-label-md-s  p {margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:20px;text-overflow:inherit;overflow:inherit}.sc-ion-label-md-s > p{color:var(--ion-color-step-600,#666)}.sc-ion-label-md-h.ion-color.sc-ion-label-md-s > p, .ion-color .sc-ion-label-md-h.sc-ion-label-md-s > p{color:inherit}"},enumerable:!0,configurable:!0}),t}(),xu=function(){function t(t){(0,i.r)(this,t),this.inset=!1}return t.prototype.closeSlidingItems=function(){return w(this,void 0,void 0,(function(){var t;return E(this,(function(e){return(t=this.el.querySelector("ion-item-sliding"))&&t.closeOpened?[2,t.closeOpened()]:[2,!1]}))}))},t.prototype.render=function(){var t,e=(0,i.f)(this),n=this.lines,r=this.inset;return(0,i.h)(i.H,{class:(t={},t[e]=!0,t["list-"+e]=!0,t["list-inset"]=r,t["list-lines-"+n]=void 0!==n,t["list-"+e+"-lines-"+n]=void 0!==n,t)})},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return"ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{-webkit-transform:translateZ(0);transform:translateZ(0);overflow:hidden}.list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;background:var(--ion-item-background,var(--ion-background-color,#fff))}.list-md>.input:last-child:after{left:0}:host-context([dir=rtl]) .list-md>.input:last-child:after,[dir=rtl] .list-md>.input:last-child:after{left:unset;right:unset;right:0}.list-md.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:2px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.list-md.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-md.list-inset ion-item:first-child{--border-radius:2px 2px 0 0;--border-width:0 0 1px 0}.list-md.list-inset ion-item:last-child{--border-radius:0 0 2px,2px;--border-width:0}.list-md.list-inset .item-interactive{--padding-start:0;--padding-end:0}.list-md.list-inset+ion-list.list-inset{margin-top:0}.list-md-lines-none .item{--border-width:0;--inner-border-width:0}.list-md-lines-full .item,.list-md .item-lines-full{--border-width:0 0 1px 0}.list-md-lines-full .item{--inner-border-width:0}.list-md-lines-inset .item,.list-md .item-lines-inset{--inner-border-width:0 0 1px 0}.list-md .item-lines-inset{--border-width:0}.list-md .item-lines-full{--inner-border-width:0}.list-md .item-lines-none{--border-width:0;--inner-border-width:0}"},enumerable:!0,configurable:!0}),t}(),wu=function(){function t(t){(0,i.r)(this,t)}return t.prototype.render=function(){var t,e=(0,i.f)(this);return(0,i.h)(i.H,{class:Object.assign(Object.assign({},(0,o.c)(this.color)),(t={},t[e]=!0,t))},(0,i.h)("slot",null))},Object.defineProperty(t,"style",{get:function(){return":host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:40px;background:var(--background);color:var(--color);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{--background:transparent;--color:var(--ion-text-color,#000);padding-left:calc(var(--ion-safe-area-left, 0px) + 16px);min-height:45px;font-size:14px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;-webkit-padding-start:calc(var(--ion-safe-area-left, 0px) + 16px);padding-inline-start:calc(var(--ion-safe-area-left, 0px) + 16px)}}"},enumerable:!0,configurable:!0}),t}(),Eu=function(){function t(t){var e=this;(0,i.r)(this,t),this.noUpdate=!1,this.hasFocus=!1,this.ratioA=0,this.ratioB=0,this.debounce=0,this.name="",this.dualKnobs=!1,this.min=0,this.max=100,this.pin=!1,this.snaps=!1,this.step=1,this.ticks=!0,this.disabled=!1,this.value=0,this.clampBounds=function(t){return(0,r.c)(e.min,t,e.max)},this.ensureValueInBounds=function(t){return e.dualKnobs?{lower:e.clampBounds(t.lower),upper:e.clampBounds(t.upper)}:e.clampBounds(t)},this.handleKeyboard=function(t,n){var i=e.step;i=i>0?i:1,i/=e.max-e.min,n||(i*=-1),"A"===t?e.ratioA=(0,r.c)(0,e.ratioA+i,1):e.ratioB=(0,r.c)(0,e.ratioB+i,1),e.updateValue()},this.onBlur=function(){e.hasFocus&&(e.hasFocus=!1,e.ionBlur.emit(),e.emitStyle())},this.onFocus=function(){e.hasFocus||(e.hasFocus=!0,e.ionFocus.emit(),e.emitStyle())},this.ionChange=(0,i.c)(this,"ionChange",7),this.ionStyle=(0,i.c)(this,"ionStyle",7),this.ionFocus=(0,i.c)(this,"ionFocus",7),this.ionBlur=(0,i.c)(this,"ionBlur",7)}return t.prototype.debounceChanged=function(){this.ionChange=(0,r.d)(this.ionChange,this.debounce)},t.prototype.minChanged=function(){this.noUpdate||this.updateRatio()},t.prototype.maxChanged=function(){this.noUpdate||this.updateRatio()},t.prototype.disabledChanged=function(){this.gesture&&this.gesture.setDisabled(this.disabled),this.emitStyle()},t.prototype.valueChanged=function(t){this.noUpdate||this.updateRatio(),t=this.ensureValueInBounds(t),this.ionChange.emit({value:t})},t.prototype.connectedCallback=function(){this.updateRatio(),this.debounceChanged(),this.disabledChanged()},t.prototype.disconnectedCallback=function(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)},t.prototype.componentDidLoad=function(){return w(this,void 0,void 0,(function(){var t,e,i=this;return E(this,(function(r){switch(r.label){case 0:return(t=this.rangeSlider)?(e=this,[4,n.e(3748).then(n.bind(n,3748))]):[3,2];case 1:e.gesture=r.sent().createGesture({el:t,gestureName:"range",gesturePriority:100,threshold:0,onStart:function(t){return i.onStart(t)},onMove:function(t){return i.onMove(t)},onEnd:function(t){return i.onEnd(t)}}),this.gesture.setDisabled(this.disabled),r.label=2;case 2:return[2]}}))}))},t.prototype.getValue=function(){var t=this.value||0;return this.dualKnobs?"object"==typeof t?t:{lower:0,upper:t}:"object"==typeof t?t.upper:t},t.prototype.emitStyle=function(){this.ionStyle.emit({interactive:!0,"interactive-disabled":this.disabled})},t.prototype.onStart=function(t){var e=this.rect=this.rangeSlider.getBoundingClientRect(),n=t.currentX,i=(0,r.c)(0,(n-e.left)/e.width,1);"rtl"===document.dir&&(i=1-i),this.pressedKnob=!this.dualKnobs||Math.abs(this.ratioA-i)<Math.abs(this.ratioB-i)?"A":"B",this.setFocus(this.pressedKnob),this.update(n)},t.prototype.onMove=function(t){this.update(t.currentX)},t.prototype.onEnd=function(t){this.update(t.currentX),this.pressedKnob=void 0},t.prototype.update=function(t){var e=this.rect,n=(0,r.c)(0,(t-e.left)/e.width,1);"rtl"===document.dir&&(n=1-n),this.snaps&&(n=Su(Mu(n,this.min,this.max,this.step),this.min,this.max)),"A"===this.pressedKnob?this.ratioA=n:this.ratioB=n,this.updateValue()},Object.defineProperty(t.prototype,"valA",{get:function(){return Mu(this.ratioA,this.min,this.max,this.step)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valB",{get:function(){return Mu(this.ratioB,this.min,this.max,this.step)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ratioLower",{get:function(){return this.dualKnobs?Math.min(this.ratioA,this.ratioB):0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ratioUpper",{get:function(){return this.dualKnobs?Math.max(this.ratioA,this.ratioB):this.ratioA},enumerable:!0,configurable:!0}),t.prototype.updateRatio=function(){var t=this.getValue(),e=this.min,n=this.max;this.dualKnobs?(this.ratioA=Su(t.lower,e,n),this.ratioB=Su(t.upper,e,n)):this.ratioA=Su(t,e,n)},t.prototype.updateValue=function(){this.noUpdate=!0;var t=this.valA,e=this.valB;this.value=this.dualKnobs?{lower:Math.min(t,e),upper:Math.max(t,e)}:t,this.noUpdate=!1},t.prototype.setFocus=function(t){if(this.el.shadowRoot){var e=this.el.shadowRoot.querySelector("A"===t?".range-knob-a":".range-knob-b");e&&e.focus()}},t.prototype.render=function(){var t,e,n=this,a=this,s=a.min,l=a.max,c=a.step,h=a.el,u=a.handleKeyboard,d=a.pressedKnob,p=a.disabled,f=a.pin,m=a.ratioLower,g=a.ratioUpper,v=(0,i.f)(this),y=100*m+"%",b=100-100*g+"%",x="rtl"===document.dir,w=x?"right":"left",E=x?"left":"right",_=function(t){var e;return(e={})[w]=t[w],e},M=((t={})[w]=y,t[E]=b,t),S=[];if(this.snaps&&this.ticks)for(var T=s;T<=l;T+=c){var A=Su(T,s,l),L={ratio:A,active:A>=m&&A<=g};L[w]=100*A+"%",S.push(L)}return(0,r.r)(!0,h,this.name,JSON.stringify(this.getValue()),p),(0,i.h)(i.H,{onFocusin:this.onFocus,onFocusout:this.onBlur,class:Object.assign(Object.assign({},(0,o.c)(this.color)),(e={},e[v]=!0,e["in-item"]=(0,o.h)("ion-item",h),e["range-disabled"]=p,e["range-pressed"]=void 0!==d,e["range-has-pin"]=f,e))},(0,i.h)("slot",{name:"start"}),(0,i.h)("div",{class:"range-slider",ref:function(t){return n.rangeSlider=t}},S.map((function(t){return(0,i.h)("div",{style:_(t),role:"presentation",class:{"range-tick":!0,"range-tick-active":t.active}})})),(0,i.h)("div",{class:"range-bar",role:"presentation"}),(0,i.h)("div",{class:"range-bar range-bar-active",role:"presentation",style:M}),_u(x,{knob:"A",pressed:"A"===d,value:this.valA,ratio:this.ratioA,pin:f,disabled:p,handleKeyboard:u,min:s,max:l}),this.dualKnobs&&_u(x,{knob:"B",pressed:"B"===d,value:this.valB,ratio:this.ratioB,pin:f,disabled:p,handleKeyboard:u,min:s,max:l})),(0,i.h)("slot",{name:"end"}))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{debounce:["debounceChanged"],min:["minChanged"],max:["maxChanged"],disabled:["disabledChanged"],value:["valueChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return':host{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family,inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){-ms-flex:initial;flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:-webkit-grabbing;cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);-webkit-box-sizing:border-box;box-sizing:border-box}.range-knob-handle{left:0;top:calc((var(--height) - var(--knob-handle-size)) / 2);margin-left:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}:host-context([dir=rtl]) .range-knob-handle,[dir=rtl] .range-knob-handle{right:unset;right:0}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.range-knob-handle{margin-left:unset;-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2)}}:host-context([dir=rtl]) .range-knob-handle,[dir=rtl] .range-knob-handle{left:unset}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar{border-radius:var(--bar-border-radius);left:0;top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}:host-context([dir=rtl]) .range-bar,[dir=rtl] .range-bar{right:unset;right:0;left:unset}.range-knob{border-radius:var(--knob-border-radius);left:calc(50% - var(--knob-size) / 2);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);pointer-events:none}:host-context([dir=rtl]) .range-knob,[dir=rtl] .range-knob{right:unset;right:calc(50% - var(--knob-size) / 2);left:unset}:host(.range-pressed) .range-bar-active{will-change:left,right}:host(.in-item){width:100%}:host(.in-item) ::slotted(ion-label){-ms-flex-item-align:center;align-self:center}:host{--knob-border-radius:50%;--knob-background:var(--bar-background-active);--knob-box-shadow:none;--knob-size:18px;--bar-height:2px;--bar-background:rgba(var(--ion-color-primary-rgb,56,128,255),0.26);--bar-background-active:var(--ion-color-primary,#3880ff);--bar-border-radius:0;--height:42px;--pin-background:var(--ion-color-primary,#3880ff);--pin-color:var(--ion-color-primary-contrast,#fff);padding-left:14px;padding-right:14px;padding-top:8px;padding-bottom:8px;font-size:12px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:14px;padding-inline-start:14px;-webkit-padding-end:14px;padding-inline-end:14px}}:host(.ion-color) .range-bar{background:rgba(var(--ion-color-base-rgb),.26)}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-knob,:host(.ion-color) .range-pin,:host(.ion-color) .range-pin:before,:host(.ion-color) .range-tick{background:var(--ion-color-base);color:var(--ion-color-contrast)}::slotted([slot=start]){margin-left:0;margin-right:14px;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:14px;margin-inline-end:14px}}::slotted([slot=end]){margin-left:14px;margin-right:0;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:14px;margin-inline-start:14px;-webkit-margin-end:0;margin-inline-end:0}}:host(.range-has-pin){padding-top:28px}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-knob{-webkit-transform:scale(.67);transform:scale(.67);-webkit-transition-duration:.12s;transition-duration:.12s;-webkit-transition-property:background-color,border,-webkit-transform;transition-property:background-color,border,-webkit-transform;transition-property:transform,background-color,border;transition-property:transform,background-color,border,-webkit-transform;-webkit-transition-timing-function:ease;transition-timing-function:ease;z-index:2}.range-tick{position:absolute;top:calc((var(--height) - var(--bar-height)) / 2);width:var(--bar-height);height:var(--bar-height);background:var(--bar-background-active);z-index:1;pointer-events:none}.range-tick-active{background:transparent}.range-pin{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;border-radius:50%;-webkit-transform:translateZ(0) scale(.01);transform:translateZ(0) scale(.01);display:inline-block;position:relative;min-width:28px;height:28px;-webkit-transition:background .12s ease,-webkit-transform .12s ease;transition:background .12s ease,-webkit-transform .12s ease;transition:transform .12s ease,background .12s ease;transition:transform .12s ease,background .12s ease,-webkit-transform .12s ease;color:var(--pin-color);text-align:center}.range-pin,.range-pin:before{background:var(--pin-background)}.range-pin:before{left:50%;top:3px;margin-left:-13px;border-radius:50% 50% 50% 0;position:absolute;width:26px;height:26px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transition:background .12s ease;transition:background .12s ease;content:"";z-index:-1}:host-context([dir=rtl]) .range-pin:before,[dir=rtl] .range-pin:before{right:unset;right:50%}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.range-pin:before{margin-left:unset;-webkit-margin-start:-13px;margin-inline-start:-13px}}:host-context([dir=rtl]) .range-pin:before,[dir=rtl] .range-pin:before{left:unset}.range-knob-pressed .range-pin{-webkit-transform:translate3d(0,-24px,0) scale(1);transform:translate3d(0,-24px,0) scale(1)}:host(:not(.range-has-pin)) .range-knob-pressed .range-knob{-webkit-transform:scale(1);transform:scale(1)}:host(.range-disabled) .range-bar,:host(.range-disabled) .range-bar-active,:host(.range-disabled) .range-knob,:host(.range-disabled) .range-tick{background-color:var(--ion-color-step-250,#bfbfbf)}:host(.range-disabled) .range-knob{-webkit-transform:scale(.55);transform:scale(.55);outline:5px solid #fff}'},enumerable:!0,configurable:!0}),t}(),_u=function(t,e){var n,r=e.knob,o=e.value,a=e.ratio,s=e.min,l=e.max,c=e.disabled,h=e.pressed,u=e.pin,d=e.handleKeyboard,p=t?"right":"left";return(0,i.h)("div",{onKeyDown:function(t){var e=t.key;"ArrowLeft"===e||"ArrowDown"===e?(d(r,!1),t.preventDefault(),t.stopPropagation()):"ArrowRight"!==e&&"ArrowUp"!==e||(d(r,!0),t.preventDefault(),t.stopPropagation())},class:{"range-knob-handle":!0,"range-knob-a":"A"===r,"range-knob-b":"B"===r,"range-knob-pressed":h,"range-knob-min":o===s,"range-knob-max":o===l},style:(n={},n[p]=100*a+"%",n),role:"slider",tabindex:c?-1:0,"aria-valuemin":s,"aria-valuemax":l,"aria-disabled":c?"true":null,"aria-valuenow":o},u&&(0,i.h)("div",{class:"range-pin",role:"presentation"},Math.round(o)),(0,i.h)("div",{class:"range-knob",role:"presentation"}))},Mu=function(t,e,n,i){var o=(n-e)*t;return i>0&&(o=Math.round(o/i)*i+e),(0,r.c)(e,o,n)},Su=function(t,e,n){return(0,r.c)(0,(t-e)/(n-e),1)},Tu=function(){function t(t){(0,i.r)(this,t),this.type="bounded"}return t.prototype.addRipple=function(t,e){return w(this,void 0,void 0,(function(){var n=this;return E(this,(function(r){return[2,new Promise((function(r){(0,i.m)((function(){var o=n.el.getBoundingClientRect(),a=o.width,s=o.height,l=Math.sqrt(a*a+s*s),c=Math.max(s,a),h=n.unbounded?c:l+Lu,u=Math.floor(c*Cu),d=h/u,p=t-o.left,f=e-o.top;n.unbounded&&(p=.5*a,f=.5*s);var m=p-.5*u,g=f-.5*u,v=.5*a-p,y=.5*s-f;(0,i.w)((function(){var t=document.createElement("div");t.classList.add("ripple-effect");var e=t.style;e.top=g+"px",e.left=m+"px",e.width=e.height=u+"px",e.setProperty("--final-scale",""+d),e.setProperty("--translate-end",v+"px, "+y+"px"),(n.el.shadowRoot||n.el).appendChild(t),setTimeout((function(){r((function(){Au(t)}))}),325)}))}))}))]}))}))},Object.defineProperty(t.prototype,"unbounded",{get:function(){return"unbounded"===this.type},enumerable:!0,configurable:!0}),t.prototype.render=function(){var t,e=(0,i.f)(this);return(0,i.h)(i.H,{role:"presentation",class:(t={},t[e]=!0,t.unbounded=this.unbounded,t)})},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;-webkit-animation:rippleAnimation 225ms forwards,fadeInAnimation 75ms forwards;animation:rippleAnimation 225ms forwards,fadeInAnimation 75ms forwards;will-change:transform,opacity;pointer-events:none}.fade-out{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale,1));transform:translate(var(--translate-end)) scale(var(--final-scale,1));-webkit-animation:fadeOutAnimation .15s forwards;animation:fadeOutAnimation .15s forwards}@-webkit-keyframes rippleAnimation{0%{-webkit-animation-timing-function:cubic-bezier(.4,0,.2,1);animation-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale,1));transform:translate(var(--translate-end)) scale(var(--final-scale,1))}}@keyframes rippleAnimation{0%{-webkit-animation-timing-function:cubic-bezier(.4,0,.2,1);animation-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale,1));transform:translate(var(--translate-end)) scale(var(--final-scale,1))}}@-webkit-keyframes fadeInAnimation{0%{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:.16}}@keyframes fadeInAnimation{0%{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:.16}}@-webkit-keyframes fadeOutAnimation{0%{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:.16}to{opacity:0}}@keyframes fadeOutAnimation{0%{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:.16}to{opacity:0}}"},enumerable:!0,configurable:!0}),t}(),Au=function(t){t.classList.add("fade-out"),setTimeout((function(){t.remove()}),200)},Lu=10,Cu=.5,Pu=function(){function t(t){var e=this;(0,i.r)(this,t),this.inputId="ion-sel-"+zu++,this.didInit=!1,this.isExpanded=!1,this.disabled=!1,this.cancelText="Cancel",this.okText="OK",this.name=this.inputId,this.multiple=!1,this.interface="alert",this.interfaceOptions={},this.onClick=function(t){e.setFocus(),e.open(t)},this.onFocus=function(){e.ionFocus.emit()},this.onBlur=function(){e.ionBlur.emit()},this.ionChange=(0,i.c)(this,"ionChange",7),this.ionCancel=(0,i.c)(this,"ionCancel",7),this.ionFocus=(0,i.c)(this,"ionFocus",7),this.ionBlur=(0,i.c)(this,"ionBlur",7),this.ionStyle=(0,i.c)(this,"ionStyle",7)}return t.prototype.disabledChanged=function(){this.emitStyle()},t.prototype.valueChanged=function(){this.updateOptions(),this.emitStyle(),this.didInit&&this.ionChange.emit({value:this.value})},t.prototype.connectedCallback=function(){return w(this,void 0,void 0,(function(){var t,e=this;return E(this,(function(n){return void 0===this.value&&(this.multiple?(t=this.childOpts.filter((function(t){return t.selected})),this.value=t.map((function(t){return Ru(t)}))):(t=this.childOpts.find((function(t){return t.selected})))&&(this.value=Ru(t))),this.updateOptions(),this.updateOverlayOptions(),this.emitStyle(),this.mutationO=(0,s.w)(this.el,"ion-select-option",(function(){return w(e,void 0,void 0,(function(){return E(this,(function(t){return this.updateOptions(),this.updateOverlayOptions(),[2]}))}))})),[2]}))}))},t.prototype.disconnectedCallback=function(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0)},t.prototype.componentDidLoad=function(){this.didInit=!0},t.prototype.open=function(t){return w(this,void 0,void 0,(function(){var e,n,i=this;return E(this,(function(r){switch(r.label){case 0:return this.disabled||this.isExpanded?[2,void 0]:(n=this,[4,this.createOverlay(t)]);case 1:return e=n.overlay=r.sent(),this.isExpanded=!0,e.onDidDismiss().then((function(){i.overlay=void 0,i.isExpanded=!1,i.setFocus()})),[4,e.present()];case 2:return r.sent(),[2,e]}}))}))},t.prototype.createOverlay=function(t){var e=this.interface;return"action-sheet"!==e&&"popover"!==e||!this.multiple||(console.warn('Select interface cannot be "'+e+'" with a multi-value select. Using the "alert" interface instead.'),e="alert"),"popover"!==e||t||(console.warn('Select interface cannot be a "popover" without passing an event. Using the "alert" interface instead.'),e="alert"),"popover"===e?this.openPopover(t):"action-sheet"===e?this.openActionSheet():this.openAlert()},t.prototype.updateOverlayOptions=function(){var t=this.overlay;if(t){var e=this.childOpts;switch(this.interface){case"action-sheet":t.buttons=this.createActionSheetButtons(e);break;case"popover":var n=t.querySelector("ion-select-popover");n&&(n.options=this.createPopoverOptions(e));break;case"alert":var i=this.multiple?"checkbox":"radio";t.inputs=this.createAlertInputs(e,i)}}},t.prototype.createActionSheetButtons=function(t){var e=this,n=t.map((function(t){return{role:t.selected?"selected":"",text:t.textContent,handler:function(){e.value=Ru(t)}}}));return n.push({text:this.cancelText,role:"cancel",handler:function(){e.ionCancel.emit()}}),n},t.prototype.createAlertInputs=function(t,e){return t.map((function(t){return{type:e,label:t.textContent,value:Ru(t),checked:t.selected,disabled:t.disabled}}))},t.prototype.createPopoverOptions=function(t){var e=this;return t.map((function(t){var n=Ru(t);return{text:t.textContent,value:n,checked:t.selected,disabled:t.disabled,handler:function(){e.value=n,e.close()}}}))},t.prototype.openPopover=function(t){return w(this,void 0,void 0,(function(){var e,n,r;return E(this,(function(o){return e=this.interfaceOptions,n=(0,i.f)(this),r=Object.assign(Object.assign({mode:n},e),{component:"ion-select-popover",cssClass:["select-popover",e.cssClass],event:t,componentProps:{header:e.header,subHeader:e.subHeader,message:e.message,value:this.value,options:this.createPopoverOptions(this.childOpts)}}),[2,a.p.create(r)]}))}))},t.prototype.openActionSheet=function(){return w(this,void 0,void 0,(function(){var t,e,n;return E(this,(function(r){return t=(0,i.f)(this),e=this.interfaceOptions,n=Object.assign(Object.assign({mode:t},e),{buttons:this.createActionSheetButtons(this.childOpts),cssClass:["select-action-sheet",e.cssClass]}),[2,a.a.create(n)]}))}))},t.prototype.openAlert=function(){return w(this,void 0,void 0,(function(){var t,e,n,r,o,s,l=this;return E(this,(function(c){return t=this.getLabel(),e=t?t.textContent:null,n=this.interfaceOptions,r=this.multiple?"checkbox":"radio",o=(0,i.f)(this),s=Object.assign(Object.assign({mode:o},n),{header:n.header?n.header:e,inputs:this.createAlertInputs(this.childOpts,r),buttons:[{text:this.cancelText,role:"cancel",handler:function(){l.ionCancel.emit()}},{text:this.okText,handler:function(t){l.value=t}}],cssClass:["select-alert",n.cssClass,this.multiple?"multiple-select-alert":"single-select-alert"]}),[2,a.b.create(s)]}))}))},t.prototype.close=function(){return this.overlay?this.overlay.dismiss():Promise.resolve(!1)},t.prototype.updateOptions=function(){for(var t=!0,e=this,n=e.value,i=e.childOpts,r=e.compareWith,o=e.multiple,a=0,s=i;a<s.length;a++){var l=s[a],c=Ru(l),h=t&&Iu(n,c,r);l.selected=h,h&&!o&&(t=!1)}},t.prototype.getLabel=function(){return(0,r.f)(this.el)},t.prototype.hasValue=function(){return""!==this.getText()},Object.defineProperty(t.prototype,"childOpts",{get:function(){return Array.from(this.el.querySelectorAll("ion-select-option"))},enumerable:!0,configurable:!0}),t.prototype.getText=function(){var t=this.selectedText;return null!=t&&""!==t?t:ku(this.childOpts,this.value,this.compareWith)},t.prototype.setFocus=function(){this.buttonEl&&this.buttonEl.focus()},t.prototype.emitStyle=function(){this.ionStyle.emit({interactive:!0,select:!0,"has-placeholder":null!=this.placeholder,"has-value":this.hasValue(),"interactive-disabled":this.disabled,"select-disabled":this.disabled})},t.prototype.render=function(){var t,e=this,n=this,a=n.placeholder,s=n.name,l=n.disabled,c=n.isExpanded,h=n.value,u=n.el,d=(0,i.f)(this),p=this.inputId+"-lbl",f=(0,r.f)(u);f&&(f.id=p);var m=!1,g=this.getText();""===g&&null!=a&&(g=a,m=!0),(0,r.r)(!0,u,s,Ou(h),l);var v={"select-text":!0,"select-placeholder":m};return(0,i.h)(i.H,{onClick:this.onClick,role:"combobox","aria-haspopup":"dialog","aria-disabled":l?"true":null,"aria-expanded":""+c,"aria-labelledby":p,class:(t={},t[d]=!0,t["in-item"]=(0,o.h)("ion-item",u),t["select-disabled"]=l,t)},(0,i.h)("div",{class:v},g),(0,i.h)("div",{class:"select-icon",role:"presentation"},(0,i.h)("div",{class:"select-icon-inner"})),(0,i.h)("button",{type:"button",onFocus:this.onFocus,onBlur:this.onBlur,disabled:l,ref:function(t){return e.buttonEl=t}}))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{disabled:["disabledChanged"],placeholder:["disabledChanged"],value:["valueChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;font-family:var(--ion-font-family,inherit);overflow:hidden;z-index:2}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.in-item){position:static;max-width:45%}:host(.select-disabled){opacity:.4;pointer-events:none}:host(.ion-focused) button{border:2px solid #5e9ed6}.select-placeholder{color:currentColor;opacity:.33}button{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}:host-context([dir=rtl]) button,[dir=rtl] button{left:unset;right:unset;right:0}button::-moz-focus-inner{border:0}.select-icon{position:relative}.select-text{-ms-flex:1;flex:1;min-width:16px;font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.select-icon-inner{left:5px;top:50%;margin-top:-3px;position:absolute;width:0;height:0;border-top:5px solid;border-right:5px solid transparent;border-left:5px solid transparent;color:currentColor;opacity:.33;pointer-events:none}:host-context([dir=rtl]) .select-icon-inner,[dir=rtl] .select-icon-inner{left:unset;right:unset;right:5px}:host{--padding-top:10px;--padding-end:0;--padding-bottom:11px;--padding-start:16px}.select-icon{width:19px;height:19px}"},enumerable:!0,configurable:!0}),t}(),Ru=function(t){var e=t.value;return void 0===e?t.textContent||"":e},Ou=function(t){if(null!=t)return Array.isArray(t)?t.join(","):t.toString()},Iu=function(t,e,n){return void 0!==t&&(Array.isArray(t)?t.some((function(t){return Du(t,e,n)})):Du(t,e,n))},Du=function(t,e,n){return"function"==typeof n?n(t,e):"string"==typeof n?t[n]===e[n]:t===e},ku=function(t,e,n){return void 0===e?"":Array.isArray(e)?e.map((function(e){return Nu(t,e,n)})).filter((function(t){return null!==t})).join(", "):Nu(t,e,n)||""},Nu=function(t,e,n){var i=t.find((function(t){return Du(Ru(t),e,n)}));return i?i.textContent:null},zu=0,Bu=function(){function t(t){(0,i.r)(this,t),this.inputId="ion-selopt-"+Hu++,this.disabled=!1,this.selected=!1}return t.prototype.render=function(){return(0,i.h)(i.H,{role:"option",id:this.inputId,class:(0,i.f)(this)})},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{display:none}"},enumerable:!0,configurable:!0}),t}(),Hu=0,Fu=function(){function t(t){(0,i.r)(this,t),this.loaded=!1,this.active=!1}return t.prototype.componentWillLoad=function(){},t.prototype.setActive=function(){return w(this,void 0,void 0,(function(){return E(this,(function(t){switch(t.label){case 0:return[4,this.prepareLazyLoaded()];case 1:return t.sent(),this.active=!0,[2]}}))}))},t.prototype.prepareLazyLoaded=function(){if(!this.loaded&&null!=this.component){this.loaded=!0;try{return(0,l.a)(this.delegate,this.el,this.component,["ion-page"])}catch(t){console.error(t)}}return Promise.resolve(void 0)},t.prototype.render=function(){var t=this,e=t.tab,n=t.active,r=t.component;return(0,i.h)(i.H,{role:"tabpanel","aria-hidden":n?null:"true","aria-labelledby":"tab-button-"+e,class:{"ion-page":void 0===r,"tab-hidden":!n}},(0,i.h)("slot",null))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host(.tab-hidden){display:none!important}"},enumerable:!0,configurable:!0}),t}(),ju=function(){function t(t){(0,i.r)(this,t),this.keyboardVisible=!1,this.translucent=!1,this.ionTabBarChanged=(0,i.c)(this,"ionTabBarChanged",7)}return t.prototype.selectedTabChanged=function(){void 0!==this.selectedTab&&this.ionTabBarChanged.emit({tab:this.selectedTab})},t.prototype.onKeyboardWillHide=function(){var t=this;setTimeout((function(){return t.keyboardVisible=!1}),50)},t.prototype.onKeyboardWillShow=function(){"top"!==this.el.getAttribute("slot")&&(this.keyboardVisible=!0)},t.prototype.componentWillLoad=function(){this.selectedTabChanged()},t.prototype.render=function(){var t,e=this,n=e.color,r=e.translucent,a=e.keyboardVisible,s=(0,i.f)(this);return(0,i.h)(i.H,{role:"tablist","aria-hidden":a?"true":null,class:Object.assign(Object.assign({},(0,o.c)(n)),(t={},t[s]=!0,t["tab-bar-translucent"]=r,t["tab-bar-hidden"]=a,t))},(0,i.h)("slot",null))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{selectedTab:["selectedTabChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-bottom:var(--ion-safe-area-bottom,0);border-top:var(--border);background:var(--background);color:var(--color);text-align:center;contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:10;-webkit-box-sizing:content-box!important;box-sizing:content-box!important}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}:host(.ion-color) ::slotted(ion-tab-button){--background-focused:var(--ion-color-shade);--color-selected:var(--ion-color-contrast)}:host(.ion-color) ::slotted(.tab-selected){color:var(--ion-color-contrast)}:host(.ion-color),:host(.ion-color) ::slotted(ion-tab-button){color:rgba(var(--ion-color-contrast-rgb),.7);background:var(--ion-color-base)}:host(.ion-color) ::slotted(ion-tab-button.ion-focused),:host(.tab-bar-translucent) ::slotted(ion-tab-button.ion-focused){background:var(--background-focused)}:host(.tab-bar-translucent) ::slotted(ion-tab-button){background:transparent}:host([slot=top]){padding-bottom:0;border-top:0;border-bottom:var(--border)}:host(.tab-bar-hidden){display:none!important}:host{--background:var(--ion-tab-bar-background,var(--ion-background-color,#fff));--background-focused:var(--ion-tab-bar-background-focused,#e0e0e0);--border:1px solid var(--ion-tab-bar-border-color,var(--ion-border-color,var(--ion-color-step-150,rgba(0,0,0,0.07))));--color:var(--ion-tab-bar-color,var(--ion-color-step-600,#666));--color-selected:var(--ion-tab-bar-color-activated,var(--ion-color-primary,#3880ff));height:56px}"},enumerable:!0,configurable:!0}),t}(),Uu=function(){function t(t){var e=this;(0,i.r)(this,t),this.disabled=!1,this.selected=!1,this.onKeyUp=function(t){"Enter"!==t.key&&" "!==t.key||e.selectTab(t)},this.onClick=function(t){e.selectTab(t)},this.ionTabButtonClick=(0,i.c)(this,"ionTabButtonClick",7)}return t.prototype.onTabBarChanged=function(t){this.selected=this.tab===t.detail.tab},t.prototype.componentWillLoad=function(){void 0===this.layout&&(this.layout=i.i.get("tabButtonLayout","icon-top"))},t.prototype.selectTab=function(t){void 0!==this.tab&&(this.disabled||this.ionTabButtonClick.emit({tab:this.tab,href:this.href,selected:this.selected}),t.preventDefault())},Object.defineProperty(t.prototype,"hasLabel",{get:function(){return!!this.el.querySelector("ion-label")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasIcon",{get:function(){return!!this.el.querySelector("ion-icon")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tabIndex",{get:function(){return this.disabled?-1:this.el.hasAttribute("tabindex")?this.el.getAttribute("tabindex"):0},enumerable:!0,configurable:!0}),t.prototype.render=function(){var t,e=this,n=e.disabled,r=e.hasIcon,o=e.hasLabel,a=e.tabIndex,s=e.href,l=e.rel,c=e.target,h=e.layout,u=e.selected,d=e.tab,p=(0,i.f)(this),f={download:this.download,href:s,rel:l,target:c};return(0,i.h)(i.H,{onClick:this.onClick,onKeyup:this.onKeyUp,role:"tab",tabindex:a,"aria-selected":u?"true":null,id:void 0!==d?"tab-button-"+d:null,class:(t={},t[p]=!0,t["tab-selected"]=u,t["tab-disabled"]=n,t["tab-has-label"]=o,t["tab-has-icon"]=r,t["tab-has-label-only"]=o&&!r,t["tab-has-icon-only"]=r&&!o,t["tab-layout-"+h]=!0,t["ion-activatable"]=!0,t["ion-selectable"]=!0,t["ion-focusable"]=!0,t)},(0,i.h)("a",Object.assign({},f,{tabIndex:-1}),(0,i.h)("slot",null),"md"===p&&(0,i.h)("ion-ripple-effect",{type:"unbounded"})))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{--ripple-color:var(--color-selected);-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:var(--background);color:var(--color)}:host,a{height:100%;outline:none}a{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;width:100%;border:0;background:transparent;text-decoration:none;cursor:pointer;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-drag:none}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){a{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-focused){background:var(--background-focused)}@media (any-hover:hover){a:hover{color:var(--color-selected)}}:host(.tab-selected){color:var(--color-selected)}:host(.tab-hidden){display:none!important}:host(.tab-disabled){pointer-events:none;opacity:.4}::slotted(ion-icon),::slotted(ion-label){display:block;-ms-flex-item-align:center;align-self:center;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}::slotted(ion-label){-ms-flex-order:0;order:0}::slotted(ion-icon){-ms-flex-order:-1;order:-1;height:1em}:host(.tab-has-label-only) ::slotted(ion-label){white-space:normal}::slotted(ion-badge){-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;z-index:1}:host(.tab-layout-icon-start){-ms-flex-direction:row;flex-direction:row}:host(.tab-layout-icon-end){-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.tab-layout-icon-bottom){-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.tab-layout-icon-hide) ::slotted(ion-icon),:host(.tab-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color)}:host{--padding-top:0;--padding-end:12px;--padding-bottom:0;--padding-start:12px;max-width:168px;font-size:12px;font-weight:400;letter-spacing:.03em}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;text-transform:none}::slotted(ion-icon){margin-left:0;margin-right:0;margin-top:16px;margin-bottom:16px;-webkit-transform-origin:center center;transform-origin:center center;font-size:22px}:host-context([dir=rtl]) ::slotted(ion-icon),[dir=rtl] ::slotted(ion-icon){-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}::slotted(ion-badge){border-radius:8px;padding-left:2px;padding-right:2px;padding-top:3px;padding-bottom:2px;left:calc(50% + 6px);top:8px;min-width:12px;font-size:8px;font-weight:400}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted(ion-badge){padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:2px;padding-inline-end:2px}}:host-context([dir=rtl]) ::slotted(ion-badge),[dir=rtl] ::slotted(ion-badge){left:unset;right:unset;right:calc(50% + 6px)}::slotted(ion-badge:empty){display:block;min-width:8px;height:8px}:host(.tab-layout-icon-top) ::slotted(ion-icon){margin-top:6px;margin-bottom:2px}:host(.tab-layout-icon-top) ::slotted(ion-label){margin-top:0;margin-bottom:6px}:host(.tab-layout-icon-bottom) ::slotted(ion-badge){left:70%;top:8px}:host-context([dir=rtl]).tab-layout-icon-bottom ::slotted(ion-badge),:host-context([dir=rtl]):host(.tab-layout-icon-bottom) ::slotted(ion-badge){left:unset;right:unset;right:70%}:host(.tab-layout-icon-bottom) ::slotted(ion-icon){margin-top:0;margin-bottom:6px}:host(.tab-layout-icon-bottom) ::slotted(ion-label){margin-top:6px;margin-bottom:0}:host(.tab-layout-icon-end) ::slotted(ion-badge),:host(.tab-layout-icon-start) ::slotted(ion-badge){left:80%;top:16px}:host-context([dir=rtl]).tab-layout-icon-end ::slotted(ion-badge),:host-context([dir=rtl]).tab-layout-icon-start ::slotted(ion-badge),:host-context([dir=rtl]):host(.tab-layout-icon-end) ::slotted(ion-badge),:host-context([dir=rtl]):host(.tab-layout-icon-start) ::slotted(ion-badge){left:unset;right:unset;right:80%}:host(.tab-layout-icon-start) ::slotted(ion-icon){margin-right:6px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host(.tab-layout-icon-start) ::slotted(ion-icon){margin-right:unset;-webkit-margin-end:6px;margin-inline-end:6px}}:host(.tab-layout-icon-end) ::slotted(ion-icon){margin-left:6px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host(.tab-layout-icon-end) ::slotted(ion-icon){margin-left:unset;-webkit-margin-start:6px;margin-inline-start:6px}}:host(.tab-has-label-only) ::slotted(ion-badge),:host(.tab-layout-icon-hide) ::slotted(ion-badge){left:70%;top:16px}:host-context([dir=rtl]).tab-has-label-only ::slotted(ion-badge),:host-context([dir=rtl]).tab-layout-icon-hide ::slotted(ion-badge),:host-context([dir=rtl]):host(.tab-has-label-only) ::slotted(ion-badge),:host-context([dir=rtl]):host(.tab-layout-icon-hide) ::slotted(ion-badge){left:unset;right:unset;right:70%}:host(.tab-has-label-only) ::slotted(ion-label),:host(.tab-layout-icon-hide) ::slotted(ion-label){margin-top:0;margin-bottom:0}:host(.tab-has-icon-only) ::slotted(ion-badge),:host(.tab-layout-label-hide) ::slotted(ion-badge){top:16px}:host(.tab-has-icon-only) ::slotted(ion-icon),:host(.tab-layout-label-hide) ::slotted(ion-icon){margin-top:0;margin-bottom:0;font-size:24px}"},enumerable:!0,configurable:!0}),t}(),Gu=function(){function t(t){var e=this;(0,i.r)(this,t),this.inputId="ion-input-"+Vu++,this.didBlurAfterEdit=!1,this.hasFocus=!1,this.autocapitalize="none",this.autofocus=!1,this.clearOnEdit=!1,this.debounce=0,this.disabled=!1,this.name=this.inputId,this.readonly=!1,this.required=!1,this.spellcheck=!1,this.autoGrow=!1,this.value="",this.onInput=function(t){e.nativeInput&&(e.value=e.nativeInput.value),e.emitStyle(),e.ionInput.emit(t)},this.onFocus=function(){e.hasFocus=!0,e.focusChange(),e.ionFocus.emit()},this.onBlur=function(){e.hasFocus=!1,e.focusChange(),e.ionBlur.emit()},this.onKeyDown=function(){e.checkClearOnEdit()},this.ionChange=(0,i.c)(this,"ionChange",7),this.ionInput=(0,i.c)(this,"ionInput",7),this.ionStyle=(0,i.c)(this,"ionStyle",7),this.ionBlur=(0,i.c)(this,"ionBlur",7),this.ionFocus=(0,i.c)(this,"ionFocus",7)}return t.prototype.debounceChanged=function(){this.ionChange=(0,r.d)(this.ionChange,this.debounce)},t.prototype.disabledChanged=function(){this.emitStyle()},t.prototype.valueChanged=function(){var t=this.nativeInput,e=this.getValue();t&&t.value!==e&&(t.value=e),this.runAutoGrow(),this.emitStyle(),this.ionChange.emit({value:e})},t.prototype.connectedCallback=function(){this.emitStyle(),this.debounceChanged(),this.el.dispatchEvent(new CustomEvent("ionInputDidLoad",{detail:this.el}))},t.prototype.disconnectedCallback=function(){document.dispatchEvent(new CustomEvent("ionInputDidUnload",{detail:this.el}))},t.prototype.componentDidLoad=function(){this.runAutoGrow()},t.prototype.runAutoGrow=function(){var t=this.nativeInput;t&&this.autoGrow&&(0,i.m)((function(){t.style.height="inherit",t.style.height=t.scrollHeight+"px"}))},t.prototype.setFocus=function(){return w(this,void 0,void 0,(function(){return E(this,(function(t){return this.nativeInput&&this.nativeInput.focus(),[2]}))}))},t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)},t.prototype.emitStyle=function(){this.ionStyle.emit({interactive:!0,textarea:!0,input:!0,"interactive-disabled":this.disabled,"has-placeholder":null!=this.placeholder,"has-value":this.hasValue(),"has-focus":this.hasFocus})},t.prototype.checkClearOnEdit=function(){this.clearOnEdit&&(this.didBlurAfterEdit&&this.hasValue()&&(this.value=""),this.didBlurAfterEdit=!1)},t.prototype.focusChange=function(){this.clearOnEdit&&!this.hasFocus&&this.hasValue()&&(this.didBlurAfterEdit=!0),this.emitStyle()},t.prototype.hasValue=function(){return""!==this.getValue()},t.prototype.getValue=function(){return this.value||""},t.prototype.render=function(){var t,e=this,n=(0,i.f)(this),a=this.getValue(),s=this.inputId+"-lbl",l=(0,r.f)(this.el);return l&&(l.id=s),(0,i.h)(i.H,{"aria-disabled":this.disabled?"true":null,class:Object.assign(Object.assign({},(0,o.c)(this.color)),(t={},t[n]=!0,t))},(0,i.h)("textarea",{class:"native-textarea",ref:function(t){return e.nativeInput=t},autoCapitalize:this.autocapitalize,autoFocus:this.autofocus,disabled:this.disabled,maxLength:this.maxlength,minLength:this.minlength,name:this.name,placeholder:this.placeholder||"",readOnly:this.readonly,required:this.required,spellCheck:this.spellcheck,cols:this.cols,rows:this.rows,wrap:this.wrap,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeyDown},a))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{debounce:["debounceChanged"],disabled:["disabledChanged"],value:["valueChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return".sc-ion-textarea-md-h{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;--padding-top:0;--padding-bottom:0;--padding-start:0;--border-radius:0;display:block;position:relative;-ms-flex:1;flex:1;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background:var(--background);color:var(--color);font-family:var(--ion-font-family,inherit);white-space:pre-wrap;z-index:2}.ion-color.sc-ion-textarea-md-h{background:initial;color:var(--ion-color-base)}ion-item.sc-ion-textarea-md-h, ion-item .sc-ion-textarea-md-h{-ms-flex-item-align:baseline;align-self:baseline}ion-item.sc-ion-textarea-md-h:not(.item-label), ion-item:not(.item-label) .sc-ion-textarea-md-h{--padding-start:0}.native-textarea.sc-ion-textarea-md{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;resize:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.native-textarea.sc-ion-textarea-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-textarea.sc-ion-textarea-md::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-md::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-md:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-md::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea[disabled].sc-ion-textarea-md{opacity:.4}.cloned-input.sc-ion-textarea-md{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md, [dir=rtl] .sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md, [dir=rtl].sc-ion-textarea-md .cloned-input.sc-ion-textarea-md{left:unset;right:unset;right:0}.sc-ion-textarea-md-h{--padding-top:10px;--padding-end:0;--padding-bottom:11px;--padding-start:8px;margin-left:0;margin-right:0;margin-top:8px;margin-bottom:0;font-size:inherit}.item-label-floating.sc-ion-textarea-md-h, .item-label-floating .sc-ion-textarea-md-h, .item-label-stacked.sc-ion-textarea-md-h, .item-label-stacked .sc-ion-textarea-md-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0}"},enumerable:!0,configurable:!0}),t}(),Vu=0,Wu=function(){function t(t){var e=this;(0,i.r)(this,t),this.inputId="ion-tg-"+Xu++,this.lastDrag=0,this.activated=!1,this.name=this.inputId,this.checked=!1,this.disabled=!1,this.value="on",this.onClick=function(){e.lastDrag+300<Date.now()&&(e.checked=!e.checked)},this.onFocus=function(){e.ionFocus.emit()},this.onBlur=function(){e.ionBlur.emit()},this.ionChange=(0,i.c)(this,"ionChange",7),this.ionFocus=(0,i.c)(this,"ionFocus",7),this.ionBlur=(0,i.c)(this,"ionBlur",7),this.ionStyle=(0,i.c)(this,"ionStyle",7)}return t.prototype.checkedChanged=function(t){this.ionChange.emit({checked:t,value:this.value})},t.prototype.disabledChanged=function(){this.emitStyle(),this.gesture&&this.gesture.setDisabled(this.disabled)},t.prototype.connectedCallback=function(){return w(this,void 0,void 0,(function(){var t,e=this;return E(this,(function(i){switch(i.label){case 0:return t=this,[4,n.e(3748).then(n.bind(n,3748))];case 1:return t.gesture=i.sent().createGesture({el:this.el,gestureName:"toggle",gesturePriority:100,threshold:5,passive:!1,onStart:function(){return e.onStart()},onMove:function(t){return e.onMove(t)},onEnd:function(t){return e.onEnd(t)}}),this.disabledChanged(),[2]}}))}))},t.prototype.disconnectedCallback=function(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)},t.prototype.componentWillLoad=function(){this.emitStyle()},t.prototype.emitStyle=function(){this.ionStyle.emit({"interactive-disabled":this.disabled})},t.prototype.onStart=function(){this.activated=!0,this.setFocus()},t.prototype.onMove=function(t){Yu(document,this.checked,t.deltaX,-10)&&(this.checked=!this.checked,(0,c.h)())},t.prototype.onEnd=function(t){this.activated=!1,this.lastDrag=Date.now(),t.event.preventDefault(),t.event.stopImmediatePropagation()},t.prototype.getValue=function(){return this.value||""},t.prototype.setFocus=function(){this.buttonEl&&this.buttonEl.focus()},t.prototype.render=function(){var t,e=this,n=this,a=n.inputId,s=n.disabled,l=n.checked,c=n.activated,h=n.color,u=n.el,d=(0,i.f)(this),p=a+"-lbl",f=(0,r.f)(u),m=this.getValue();return f&&(f.id=p),(0,r.r)(!0,u,this.name,l?m:"",s),(0,i.h)(i.H,{onClick:this.onClick,role:"checkbox","aria-disabled":s?"true":null,"aria-checked":""+l,"aria-labelledby":p,class:Object.assign(Object.assign({},(0,o.c)(h)),(t={},t[d]=!0,t["in-item"]=(0,o.h)("ion-item",u),t["toggle-activated"]=c,t["toggle-checked"]=l,t["toggle-disabled"]=s,t.interactive=!0,t))},(0,i.h)("div",{class:"toggle-icon"},(0,i.h)("div",{class:"toggle-inner"})),(0,i.h)("button",{type:"button",onFocus:this.onFocus,onBlur:this.onBlur,disabled:s,ref:function(t){return e.buttonEl=t}}))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{checked:["checkedChanged"],disabled:["disabledChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return":host{-webkit-box-sizing:content-box!important;box-sizing:content-box!important;display:inline-block;outline:none;contain:content;cursor:pointer;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.ion-focused) input{border:2px solid #5e9ed6}:host(.toggle-disabled){pointer-events:none}button{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}:host-context([dir=rtl]) button,[dir=rtl] button{left:unset;right:unset;right:0}button::-moz-focus-inner{border:0}:host{--background:rgba(var(--ion-text-color-rgb,0,0,0),0.3);--background-checked:rgba(var(--ion-color-primary-rgb,56,128,255),0.5);--handle-background:#fff;--handle-background-checked:var(--ion-color-primary,#3880ff);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;-webkit-box-sizing:content-box;box-sizing:content-box;position:relative;width:36px;height:14px;contain:strict}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host(.ion-color.toggle-checked) .toggle-icon{background:rgba(var(--ion-color-base-rgb),.5)}:host(.ion-color.toggle-checked) .toggle-inner{background:var(--ion-color-base)}.toggle-icon{border-radius:14px;display:block;position:relative;width:100%;height:100%;-webkit-transition:background-color .16s;transition:background-color .16s;background:var(--background);pointer-events:none}.toggle-inner{left:0;top:-3px;border-radius:50%;position:absolute;width:20px;height:20px;-webkit-transition-duration:.16s;transition-duration:.16s;-webkit-transition-property:background-color,-webkit-transform;transition-property:background-color,-webkit-transform;transition-property:transform,background-color;transition-property:transform,background-color,-webkit-transform;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);background:var(--handle-background);-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);will-change:transform,background-color;contain:strict}:host-context([dir=rtl]) .toggle-inner,[dir=rtl] .toggle-inner{left:unset;right:unset;right:0}:host(.toggle-checked) .toggle-icon{background:var(--background-checked)}:host(.toggle-checked) .toggle-inner{-webkit-transform:translate3d(16px,0,0);transform:translate3d(16px,0,0);background:var(--handle-background-checked)}:host-context([dir=rtl]).toggle-checked .toggle-inner,:host-context([dir=rtl]):host(.toggle-checked) .toggle-inner{-webkit-transform:translate3d(calc(-1 * 16px),0,0);transform:translate3d(calc(-1 * 16px),0,0)}:host(.toggle-disabled){opacity:.3}:host(.in-item[slot]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:16px;padding-right:0;padding-top:12px;padding-bottom:12px;cursor:pointer}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host(.in-item[slot]){padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:0;padding-inline-end:0}}:host(.in-item[slot=start]){padding-left:2px;padding-right:18px;padding-top:12px;padding-bottom:12px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host(.in-item[slot=start]){padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:18px;padding-inline-end:18px}}"},enumerable:!0,configurable:!0}),t}(),Yu=function(t,e,n,i){var r="rtl"===t.dir;return e?!r&&i>n||r&&-i<n:!r&&-i<n||r&&i>n},Xu=0},5721:(t,e,n)=>{n.d(e,{a:()=>i,d:()=>r});var i=function(t,e,n,i,r){return o=void 0,a=void 0,l=function(){var o;return function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(a){switch(a.label){case 0:if(t)return[2,t.attachViewToDom(e,n,r,i)];if("string"!=typeof n&&!(n instanceof HTMLElement))throw new Error("framework delegate is missing");return o="string"==typeof n?e.ownerDocument&&e.ownerDocument.createElement(n):n,i&&i.forEach((function(t){return o.classList.add(t)})),r&&Object.assign(o,r),e.appendChild(o),o.componentOnReady?[4,o.componentOnReady()]:[3,2];case 1:a.sent(),a.label=2;case 2:return[2,o]}}))},new((s=void 0)||(s=Promise))((function(t,e){function n(t){try{r(l.next(t))}catch(t){e(t)}}function i(t){try{r(l.throw(t))}catch(t){e(t)}}function r(e){e.done?t(e.value):new s((function(t){t(e.value)})).then(n,i)}r((l=l.apply(o,a||[])).next())}));var o,a,s,l},r=function(t,e){if(e){if(t){var n=e.parentElement;return t.removeViewFromDom(n,e)}e.remove()}return Promise.resolve()}},8265:(t,e,n)=>{n.d(e,{a:()=>r,b:()=>o,c:()=>a,h:()=>i});var i=function(){var t=window.TapticEngine;t&&t.selection()},r=function(){var t=window.TapticEngine;t&&t.gestureSelectionStart()},o=function(){var t=window.TapticEngine;t&&t.gestureSelectionChanged()},a=function(){var t=window.TapticEngine;t&&t.gestureSelectionEnd()}},884:(t,e,n)=>{n.d(e,{a:()=>i,b:()=>l,c:()=>s,d:()=>d,e:()=>p,f:()=>o,h:()=>r,i:()=>u,n:()=>c,p:()=>h,r:()=>a});var i=function(t){return"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(t):"function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t)},r=function(t){return!!t.shadowRoot&&!!t.attachShadow},o=function(t){var e=t.closest("ion-item");return e?e.querySelector("ion-label"):null},a=function(t,e,n,i,o){if(t||r(e)){var a=e.querySelector("input.aux-input");a||((a=e.ownerDocument.createElement("input")).type="hidden",a.classList.add("aux-input"),e.appendChild(a)),a.disabled=o,a.name=n,a.value=i||""}},s=function(t,e,n){return Math.max(t,Math.min(e,n))},l=function(t,e){if(!t){var n="ASSERT: "+e;throw console.error(n),new Error(n)}},c=function(t){return t.timeStamp||Date.now()},h=function(t){if(t){var e=t.changedTouches;if(e&&e.length>0){var n=e[0];return{x:n.clientX,y:n.clientY}}if(void 0!==t.pageX)return{x:t.pageX,y:t.pageY}}return{x:0,y:0}},u=function(t){var e="rtl"===document.dir;switch(t){case"start":return e;case"end":return!e;default:throw new Error('"'+t+'" is not a valid value for [side]. Use "start" or "end" instead.')}},d=function(t,e){var n=t._original||t;return{_original:t,emit:p(n.emit.bind(n),e)}},p=function(t,e){var n;return void 0===e&&(e=0),function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];clearTimeout(n),n=setTimeout.apply(void 0,[t,e].concat(i))}}},1178:(t,e,n)=>{n.d(e,{B:()=>L,a:()=>h,b:()=>c,c:()=>p,d:()=>y,e:()=>b,f:()=>E,g:()=>f,h:()=>g,i:()=>M,j:()=>v,k:()=>u,p:()=>d,s:()=>A});var i=n(5873),r=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):new n((function(e){e(t.value)})).then(a,s)}l((i=i.apply(t,e||[])).next())}))},o=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},a=void 0,s=0,l=function(t){return{create:function(e){return f(t,e)},dismiss:function(e,n,i){return g(document,e,n,t,i)},getTop:function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,v(document,t)]}))}))}}},c=l("ion-alert"),h=l("ion-action-sheet"),u=l("ion-picker"),d=l("ion-popover"),p=function(t){var e=document;m(e);var n=s++;t.overlayIndex=n,t.hasAttribute("id")||(t.id="ion-overlay-"+n)},f=function(t,e){return customElements.whenDefined(t).then((function(){var n=document,i=n.createElement(t);return i.classList.add("overlay-hidden"),Object.assign(i,e),x(n).appendChild(i),i.componentOnReady()}))},m=function(t){0===s&&(s=1,t.addEventListener("focusin",(function(e){var n=v(t);if(n&&n.backdropDismiss&&!S(n,e.target)){var i=n.querySelector("input,button");i&&i.focus()}})),t.addEventListener("ionBackButton",(function(e){var n=v(t);n&&n.backdropDismiss&&e.detail.register(100,(function(){return n.dismiss(void 0,L)}))})),t.addEventListener("keyup",(function(e){if("Escape"===e.key){var n=v(t);n&&n.backdropDismiss&&n.dismiss(void 0,L)}})))},g=function(t,e,n,i,r){var o=v(t,i,r);return o?o.dismiss(e,n):Promise.reject("overlay does not exist")},v=function(t,e,n){var i=function(t,e){return void 0===e&&(e="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(t.querySelectorAll(e)).filter((function(t){return t.overlayIndex>0}))}(t,e);return void 0===n?i[i.length-1]:i.find((function(t){return t.id===n}))},y=function(t,e,n,s,l){return r(a,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return t.presented?[2]:(t.presented=!0,t.willPresent.emit(),r=t.enterAnimation?t.enterAnimation:i.i.get(e,"ios"===t.mode?n:s),[4,w(t,r,t.el,l)]);case 1:return o.sent()&&t.didPresent.emit(),[2]}}))}))},b=function(t,e,n,s,l,c,h){return r(a,void 0,void 0,(function(){var r,a;return o(this,(function(o){switch(o.label){case 0:if(!t.presented)return[2,!1];t.presented=!1,o.label=1;case 1:return o.trys.push([1,3,,4]),t.willDismiss.emit({data:e,role:n}),r=t.leaveAnimation?t.leaveAnimation:i.i.get(s,"ios"===t.mode?l:c),[4,w(t,r,t.el,h)];case 2:return o.sent(),t.didDismiss.emit({data:e,role:n}),[3,4];case 3:return a=o.sent(),console.error(a),[3,4];case 4:return t.el.remove(),[2,!0]}}))}))},x=function(t){return t.querySelector("ion-app")||t.body},w=function(t,e,s,l){return r(a,void 0,void 0,(function(){var r,a,c,h,u;return o(this,(function(o){switch(o.label){case 0:if(t.animation)return t.animation.destroy(),t.animation=void 0,[2,!1];s.classList.remove("overlay-hidden"),r=s.shadowRoot||t.el,c=!0,o.label=1;case 1:return o.trys.push([1,4,,5]),[4,n.e(1605).then(n.bind(n,1605))];case 2:return[4,o.sent().create(e,r,l)];case 3:return a=o.sent(),[3,5];case 4:return o.sent(),(a=e(r,l)).fill("both"),c=!1,[3,5];case 5:return t.animation=a,t.animated&&i.i.getBoolean("animated",!0)||a.duration(0),t.keyboardClose&&a.beforeAddWrite((function(){var t=s.ownerDocument.activeElement;t&&t.matches("input, ion-input, ion-textarea")&&t.blur()})),[4,a.playAsync()];case 6:return h=o.sent(),u=void 0===h||a.hasCompleted,c&&a.destroy(),t.animation=void 0,[2,u]}}))}))},E=function(t,e){var n,i=new Promise((function(t){return n=t}));return _(t,e,(function(t){n(t.detail)})),i},_=function(t,e,n){var i=function(r){t.removeEventListener(e,i),n(r)};t.addEventListener(e,i)},M=function(t){return"cancel"===t||t===L},S=function(t,e){for(;e;){if(e===t)return!0;e=e.parentElement}return!1},T=function(t){return t()},A=function(t,e){if("function"==typeof t)return i.i.get("_zoneGate",T)((function(){try{return t(e)}catch(t){console.error(t)}}))},L="backdrop"},636:(t,e,n)=>{n.d(e,{c:()=>r,g:()=>o,h:()=>i,o:()=>s});var i=function(t,e){return null!==e.closest(t)},r=function(t){var e;return"string"==typeof t&&t.length>0?((e={"ion-color":!0})["ion-color-"+t]=!0,e):void 0},o=function(t){var e={};return function(t){return void 0!==t?(Array.isArray(t)?t:t.split(" ")).filter((function(t){return null!=t})).map((function(t){return t.trim()})).filter((function(t){return""!==t})):[]}(t).forEach((function(t){return e[t]=!0})),e},a=/^[a-z][a-z0-9+\-.]*:/,s=function(t,e,n){return i=void 0,r=void 0,s=function(){var i;return function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(r){return null!=t&&"#"!==t[0]&&!a.test(t)&&(i=document.querySelector("ion-router"))?(null!=e&&e.preventDefault(),[2,i.push(t,n)]):[2,!1]}))},new((o=void 0)||(o=Promise))((function(t,e){function n(t){try{l(s.next(t))}catch(t){e(t)}}function a(t){try{l(s.throw(t))}catch(t){e(t)}}function l(e){e.done?t(e.value):new o((function(t){t(e.value)})).then(n,a)}l((s=s.apply(i,r||[])).next())}));var i,r,o,s}},1867:(t,e,n)=>{n.d(e,{f:()=>o,w:()=>i});var i=function(t,e,n){var i=new MutationObserver((function(t){n(r(t,e))}));return i.observe(t,{childList:!0,subtree:!0}),i},r=function(t,e){var n;return t.forEach((function(t){for(var i=0;i<t.addedNodes.length;i++)n=o(t.addedNodes[i],e)||n})),n},o=function(t,e){if(1===t.nodeType)return(t.tagName===e.toUpperCase()?[t]:Array.from(t.querySelectorAll(e))).find((function(t){return!0===t.checked}))}}}]);