;// bundle: page___1c04bb509b5a7eef124c16643899981d_m
;// files: Thumbnails/ThumbnailUtils.js, extensions/ThreeDeeThumbnails.js, extensions/AnimatedThumbnails.js, Thumbnails/ThumbnailView.js, Thumbnails/ThumbnailSpinner.js, 3D/three.js, 3D/MTLLoader.js, 3D/OBJMTLLoader.js, 3D/tween.js, 3D/RobloxOrbitControls.js, ~/Generated/js/Roblox_TranslationResources_Feature_ItemResources_en_us_standard.js, ~/Generated/js/Roblox_TranslationResources_Feature_CatalogResources_en_us_standard.js, ~/Generated/js/Roblox_TranslationResources_Purchasing_PurchaseDialogResources_en_us_standard.js, Item/ContextMenu.js, utilities/robloxAds.js, NumberFormatting.js, ItemPurchaseForDialog/ItemPurchaseForDialog.js, utilities/dialog.js, Tracking/ModalEvents.js, Events/AssetActionButtonClickEvent.js, utilities/datetime/formatDateTimesI18n.js, GenericModal.js, Item/ItemPage.js, GenericConfirmation.js, common/deviceMeta.js, TosModalCheck.js, AbuseReport/AbuseReportDispatcher.js

;// Thumbnails/ThumbnailUtils.js
Roblox=Roblox||{},Roblox.ThumbnailUtils=function(){var n='<div class="thumbnail-loader"><span class="spinner spinner-default"></span></div>',t=".thumbnail-loader";return{addLightsToScene:function(n,t){var h=!1,o=$("#use-dynamic-thumbnail-lighting"),r,u,f,i,e,s,c;return o!==null&&o.length>0&&(h=o.data("use-dynamic-thumbnail-lighting")==="True"),h?(i=new THREE.AmbientLight(4473924),t.add(i),r=new THREE.DirectionalLight(13948116),r.target=t,r.position.set(-7.5,.5,-6).normalize(),t.add(r),u=new THREE.DirectionalLight(11316396),u.target=t,u.position.set(20,4,-0).normalize(),t.add(u),f=new THREE.DirectionalLight(11316396),f.target=t,f.position.set(0,1,1).normalize(),t.add(f)):(i=new THREE.AmbientLight(8882048),n.add(i),e=new THREE.DirectionalLight(11316396),e.position.set(-.671597898,.671597898,.312909544).normalize(),n.add(e),s=new THREE.DirectionalLight(4473924),c=(new THREE.Vector3).copy(e.position).negate().normalize(),s.position.set(c),n.add(s)),{scene:n,camera:t}}}}();

;// extensions/ThreeDeeThumbnails.js
$(function(){function r(n){var t,r;for(t in i)if(i[t].container==n)return i[t].renderer;return r={container:n,renderer:new THREE.WebGLRenderer({antialias:!0,alpha:!0})},i.push(r),r.renderer}function a(n,t){Roblox.ThumbnailUtils.addLightsToScene(n,t)}function u(n){n.find("canvas").remove()}function v(n){return n.parent()?typeof n.parent().data("moderation-mode")=="string":!1}function y(n,t,i,u,f,e){function l(){return i.parent().width()}function y(){return i.parent().height()}function b(){p.render(c,h)}function k(){w.enabled&&w.update(),TWEEN.update(),b(),requestAnimationFrame(k)}function it(){h.aspect=l()/y(),h.updateProjectionMatrix(),p.setSize(l(),y())}function rt(){p.setSize(l(),y());var n=p.domElement,t;$(window).resize(function(){clearTimeout(t),t=setTimeout(it,100)}).on("beforeunload",function(){$(n).hide()});return n}function ut(){var n=new THREE.OrbitControls(h,i.get(0),u,"static");return tt?(n.autoRotate=!1,n.minDistance=.1,n.noPan=!1,n.noKeys=!1,n.noResetToInitialCameraPosition=!0):(n.rotateSpeed=1.5,n.zoomSpeed=1.5,n.dynamicDampingFactor=.3),n.addEventListener("change",b),n}function g(n){a(c,h),c.add(h),c.add(n);var t=rt();w=ut(),b(),k(),f(t)}var p=r(i),tt=v(i),d=new THREE.Vector3(u.aabb.max.x,u.aabb.max.y,u.aabb.max.z).length()*4,ft=Math.max(d,s),nt=typeof u.camera.fov!="undefined"?u.camera.fov:70,h=new THREE.PerspectiveCamera(nt,l()/y(),o,ft),c=new THREE.Scene,w,et=new THREE.OBJMTLLoader;et.load(n,t,g,undefined,e)}var t=$("#image-retry-data"),f=t?t.data("ga-logging-percent"):0,e=window.GoogleAnalyticsEvents&&GoogleAnalyticsEvents.FireEvent||function(){},n=function(n){Math.random()<=f/100&&e(n)},o=.1,s=1e3,h=500,c=t?t.data("image-retry-max-times"):10,l=t?t.data("image-retry-timer"):1500,i=[];$.fn.load3DThumbnail=function(t,i){function o(){f=!0}function e(t,r,u,f){function o(i){if(i.realRegeneration=!0,u-->0)i.retriesDone++,setTimeout(function(){e(t,r,u,i)},l);else{var f=+new Date-i.start;n(["ThumbnailGenTime","3D","Gave Up",f]),n(["ThumbnailGenRetries","3D","Gave Up",i.retriesDone])}}function s(t,u){var f=+new Date-u.start;t.Final?$.getJSON(t.Url,function(t){u.realRegeneration&&(n(["ThumbnailGenTime","3D","Success",f]),n(["ThumbnailGenRetries","3D","Success",u.retriesDone])),r(t,u)}).fail(function(){n(["ThumbnailGenErrors","3D","Failure",t.Url]),n(["ThumbnailGenTime","3D","Failure",f]),n(["ThumbnailGenRetries","3D","Failure",u.retriesDone]),i("3D Thumbnail failed to load")}):o(u)}$.ajax({url:t+"&_="+$.now(),method:"GET",crossDomain:!0,contentType:"application/json; charset=utf-8",dataType:"json",xhrFields:{withCredentials:!0},cache:!1}).success(function(n){s(n,f)}).fail(function(){o(f)})}var f=!1;return this.each(function(){var o=$(this),s;try{s=function(){function v(){s&&(clearTimeout(s),s=undefined)}function p(){s=setTimeout(function(){f||Roblox.ThumbnailSpinner.show(o)},h)}function w(){v(),Roblox.ThumbnailSpinner.hide(o)}function b(n){var t=new MutationObserver(function(i){i.forEach(function(i){var f=i.removedNodes,u,e;if(i.type==="childList")for(u=0;u<f.length;++u)if(f[u]===n){e=r(o),e.forceContextLoss(),t.disconnect();return}})});t.observe(n.parentNode,{childList:!0})}function k(r,e){var s=+new Date;y(r.obj,r.mtl,o,r,function(i){if(u(o),!f){w(),o.append(i),b(i);var r=+new Date-s;e.realRegeneration&&n(["ThumbnailInBrowserRenderTime","3D","Success",r]),t(i,e)}},i)}var a={start:+new Date,realRegeneration:!1,retriesDone:0},l=Roblox.Endpoints.generateAbsoluteUrl(o.data("3d-url"),null,!0),s;l&&(u(o),p(),e(l,k,c,a))},s()}catch(l){i(l)}}),{cancel:o}}});

;// extensions/AnimatedThumbnails.js
$(function(){function f(n){n.find("canvas").remove()}function e(n){var i,r;for(i in t)if(t[i].container===n)return t[i].renderer;return r={container:n,renderer:new THREE.WebGLRenderer({antialias:!0,alpha:!0})},t.push(r),r.renderer}function y(n,t){Roblox.ThumbnailUtils.addLightsToScene(n,t)}function p(n,t,r){function p(){return n.parent().width()}function b(){return n.parent().height()}function ct(n,t,i){var f,u,r;i.preload(),f=new THREE.MTLLoader.MaterialCreator,f.setMaterials(i),t.children[1].geometry.computeBoundingBox(),u=t.children[1].geometry.boundingBox,r=new THREE.Vector3,r.subVectors(u.max,u.min),r.multiplyScalar(.5),r.add(u.min),r.applyMatrix4(t.children[0].matrixWorld),t.children[1].geometry.applyMatrix((new THREE.Matrix4).makeTranslation(-r.x,-r.y,-r.z)),t.children[1].geometry.verticesNeedUpdate=!0,t.children[1].position.x=r.x,t.children[1].position.y=r.y,t.children[1].position.z=r.z,ut[n]=t,t.matrixAutoUpdate=!1,o.add(t),rt++,lt()}function lt(){rt===kt&&at()}function at(){y(o,s),o.add(s);var n=ft();l=dt(o,s),d(),it(),r(n)}function d(){w.render(o,s)}function it(){wt(),l.enabled&&l.update(),TWEEN.update(),d(),u=requestAnimationFrame(it)}function wt(){var u,t,n,r;for(l.update(),c===nt.length&&(c=0,i+=1),u=nt[c],t=0;t<h.length;++t)n=u[h[t]],r=ut[h[t]],typeof n!="undefined"&&typeof r!="undefined"&&(r.children[1].position.set(n.Position.x,n.Position.y,n.Position.z),r.children[1].quaternion.set(n.Rotation.x,n.Rotation.y,n.Rotation.z,n.Rotation.w),r.updateMatrix());c++,o.updateMatrixWorld}function bt(){s.aspect=p()/b(),s.updateProjectionMatrix(),w.setSize(p(),b())}function ft(){w.setSize(p(),b());var n=w.domElement,t;$(window).resize(function(){clearTimeout(t),t=setTimeout(bt,100)}).on("beforeunload",function(){$(n).hide()});return n}function dt(i,r){var u=new THREE.OrbitControls(r,n.get(0),t,"animated");return u.addEventListener("change",d),u}var w=e(n),g=t.aabb.max,pt=new THREE.Vector3(g.x,g.y,g.z).length()*4,yt=Math.max(pt,v),vt=typeof t.camera.fov!="undefined"?t.camera.fov:70,s=new THREE.PerspectiveCamera(vt,p()/b(),a,yt),o=new THREE.Scene,k,nt,c;o.add(s);var l,ut={},et=new THREE.OBJMTLLoader,h=Object.keys(t.partobjs),rt=0,kt=h.length;for(k=0;k<h.length;++k){var tt=h[k],ot=t.partobjs[tt].files["scene.obj"].content,st=t.partobjs[tt].files["scene.mtl"].content;function ht(n){return function(t,i){return ct(n,t,i)}}et.load(ot,st,ht(tt))}nt=t.frames,c=0}var r=$("#image-retry-data"),o=10,s=r?r.data("ga-logging-percent"):0,h=window.GoogleAnalyticsEvents&&GoogleAnalyticsEvents.FireEvent||function(){},n=function(n){Math.random()<=s/100&&h(n)},c=500,l=1500,u=null,a=.1,v=1e3,t=[],i=0;$.fn.getNumOfLoops=function(){return i},$.fn.clearCurrentAnimationFrame=function(){i=0,cancelAnimationFrame(u)},$.fn.loadAnimatedThumbnail=function(t,r,u){function a(){s=!0}function h(t,i,u,f){function e(r){if(r.realRegeneration=!0,u-->0)r.retriesDone++,setTimeout(function(){h(t,i,u,r)},l);else{var f=+new Date-r.start;n(["ThumbnailGenTime","Animated","Gave Up",f]),n(["ThumbnailGenRetries","Animated","Gave Up",r.retriesDone])}}function o(t,u){var f=+new Date-u.start;t.Final?$.getJSON(t.Url,function(t){u.realRegeneration&&(n(["ThumbnailGenTime","Animated","Success",f]),n(["ThumbnailGenRetries","Animated","Success",u.retriesDone])),i(t,u)}).fail(function(){n(["ThumbnailGenErrors","Animated","Failure",t.Url]),n(["ThumbnailGenTime","Animated","Failure",f]),n(["ThumbnailGenRetries","Animated","Failure",u.retriesDone]),r("Animated Thumbnail failed to load")}):e(u)}$.ajax({url:t+"&_="+$.now(),method:"GET",crossDomain:!0,contentType:"application/json; charset=utf-8",dataType:"json",xhrFields:{withCredentials:!0},cache:!1}).success(function(n){o(n,f)}).fail(function(){e(f)})}var s=!1;return this.each(function(){var l=$(this),a;try{a=function(){function y(){a&&(clearTimeout(a),a=undefined)}function w(){a=setTimeout(function(){s||Roblox.ThumbnailSpinner.show(l)},c)}function b(){y(),Roblox.ThumbnailSpinner.hide(l)}function k(n){var t=new MutationObserver(function(i){i.forEach(function(i){var u=i.removedNodes,r,f;if(i.type==="childList")for(r=0;r<u.length;++r)if(u[r]===n){f=e(l),f.forceContextLoss(),t.disconnect();return}})});t.observe(n.parentNode,{childList:!0})}function d(u,e){i=0;var o=+new Date;p(l,u,function(i){if(f(l),!s){b(),l.append(i),k(i);var r=+new Date-o;e.realRegeneration&&n(["ThumbnailInBrowserRenderTime","Animated","Success",r]),t(i,e)}},r)}var v={start:+new Date,realRegeneration:!1,retriesDone:0},a;((u===null||u==="")&&(u=Roblox.Endpoints.generateAbsoluteUrl(l.data("animated-asset-url"),null,!0)),u)&&(f(l),w(),h(u,d,o,v))},a()}catch(v){r(v)}}),{cancel:a}}});

;// Thumbnails/ThumbnailView.js
typeof Roblox=="undefined"&&(Roblox={}),Roblox.ThumbnailView=function(){function o(n){var t=n.find("canvas");t.remove()}function w(n){n.forEach(function(n){n.reload()})}function y(n){n.forEach(function(n){n.showSpinner()})}function h(){if(n===null)try{var t=document.createElement("canvas");n=!!window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))?!0:!1}catch(i){n=!1}return n}function l(){return Roblox&&Roblox.LocalStorage?Roblox.LocalStorage.isAvailable():window.localStorage&&localStorage.setItem&&localStorage.getItem}function p(){l()&&(localStorage.getItem(u)==="true"?i=!0:(i=!1,localStorage.setItem(u,"false")))}function t(n,t){return h()?e(n)?t?!0:i:!1:!1}function b(n,t){(h()||(i=!1),e(t)||n!==!0)&&(i=n,l()&&localStorage.setItem(u,n.toString()))}function e(n){return typeof n.data("3d-thumbs-enabled")=="string"||n.hasClass("3d-thumbs-enabled")}function v(i){function a(){return i.find(".thumbnail-span")}function tt(){return i.find(".thumbnail-span-original")}function ni(){return i.find(".thumbnail-span-try-it-on")}function k(n){return n.find("img")}function u(){return i.find(".thumbnail-holder")}function l(){return i.find(f)}function ht(){return i.find(c)}function et(n,t){n.html(t.html()),n.data("url",t.data("url")?t.data("url"):""),n.data("3d-url",t.data("3d-url")?t.data("3d-url"):""),n.data("orig-retry-url",t.data("orig-retry-url")?t.data("orig-retry-url"):""),n.data("retry-url",t.data("retry-url")?t.data("retry-url"):""),n.data("animated-asset-url",t.data("animated-asset-url")?t.data("animated-asset-url"):"")}function rt(){return d==="static"&&"2D"||(h?ti:ii)}function it(){return d==="static"&&"3D"||wt}function st(){return Roblox.Lang.ItemResources?w?Roblox.Lang.ItemResources["Action.TakeOff"]:Roblox.Lang.ItemResources["Action.TryOn"]:w?"Take Off":"Try On"}function ft(){var n=a();o(i),Roblox.ThumbnailSpinner.show(n),k(n).hide();n.one("thumbnailLoaded",function(){k(n).show(),Roblox.ThumbnailSpinner.hide(n)})}function bt(){h?($(f).addClass("bundle-animation-play"),l().html(h&&nt.getIsLoopingThroughAnimations()?rt():it())):l().html(t(u(),h)?rt():it()),t(u(),h)||(e(u())?n?l().css("visibility","visible"):l().addClass("disabled"):l().css("visibility","hidden")),ht().html(st())}function kt(n){v=undefined,i.find("canvas").not(n).remove()}function dt(){v=undefined,l().addClass("disabled")}function gt(){v&&v.cancel(),ct();var n=t(u(),h);b(!n,u()),n!==t(u(),h)&&(p!==""?i.load(p+"&_="+$.now(),function(){y()}):y())}function ct(){tt().length>0&&(ht().html(st()),w?et(a(),ni()):et(a(),tt()))}function lt(){h?nt.startAnimationLoop():y()}function at(n){return function(t,i){kt(t);var r=+new Date;Roblox.ThumbnailMetrics.logFinalThumbnailTime(r-i.start,n)}}function vt(n){return function(){dt(),Roblox.ThumbnailMetrics.logThumbnailTimeout(n)}}function y(n){var e=t(u(),h),r,f;n||(n=a()),e?(o(i),k(n).hide(),d==="static"?v=n.load3DThumbnail(at("3dThumbnail"),vt("3dThumbnail")):(v=n.clearCurrentAnimationFrame(),v=n.loadAnimatedThumbnail(at("AnimationThumbnail"),vt("AnimationThumbnail"),yt)),k(n).hide()):(s&&(s=!1,r=n.data("orig-retry-url"),n.data("retry-url",r)),f=n.data("retry-url"),f?(ft(n),n.loadRobloxThumbnails()):(o(i),Roblox.ThumbnailSpinner.hide(u()),k(n).show())),bt()}function ut(){var n=a(),e,r,f;if(s=!0,e=t(u(),h),e){y(n);return}r=n.data("orig-retry-url"),typeof r!="undefined"?(n.data("retry-url",r),y(n)):(p!==""&&u().data("url",p),f=u().data("url"),f&&i.load(f+"&_="+$.now(),function(){y(n)}))}function pt(){function st(){return n}function s(){return i.find("#current-animation-name")}function k(){g.removeClass("hidden"),s().removeClass("hidden"),n=!0,ft(),b(!0),clearInterval(f),f=setInterval(b,e)}function tt(){clearTimeout(c),clearInterval(f),r=0,o=0}function b(i){var h,f;n?(h=a(),r+=e,(h.getNumOfLoops()>=et||i||r>ot)&&(u!==null&&t>=u.length&&(o++,t=0),f=e-100,f=f>0?f:0,h.fadeOut(f),c=setTimeout(function(){w($(u[t]),!0),t+=1,r=0,h.fadeIn(500),v!==-1&&o>=v&&(tt(),g.addClass("hidden"),s().addClass("hidden"),n=!1,l().html(it()))},f))):tt()}function w(n,i){var u=n.attr("data-animated-asset-url"),f=n.attr("data-static-url"),e=n.attr("data-three-dee-type"),r;t=parseInt(n.attr("data-index")),r=n.attr("data-name"),s().html(r),y(f,u,e,i),$(".bundle-animation-btn.selected").removeClass("selected"),n.addClass("selected")}function y(t,i,r,u){yt=i,p=t,d=r,n=u,ut()}function ht(){n?(n=!1,l().html(n?rt():it())):k()}var u=$(".bundle-animation-btn"),n=!1,t=0,f,c,r=0,e=200,o=0,v=-1,et=3,ot=1e4;i.on("click",".bundle-animation-play",function(){!$(this).hasClass("disabled")&&h&&nt.clickToggleAnimationLoopButton()});return{startAnimationLoop:k,getIsLoopingThroughAnimations:st,clickToggleAnimationLoopButton:ht,changeThumbnailFromBundleItem:w,changeThumbnail:y}}var v,yt="",p="",d="static",g=$(".bundle-animation-btn-container"),h=g!==null&&g.length>0,nt=h?pt():null,w=!1,ot;d=u().data("3dtype")||"static",tt().length>0&&et(a(),tt());var wt="<span class='icon-bigplay-fill'></span>",ii="<span class='icon-bigstop-fill'></span>",ti="<span class='icon-pause-fill'></span>";ot={container:i,holder:u,span:a,button:l,showSpinner:ft,outerLoad:lt,reload:ut,bundleAnimationCtrl:nt};i.on("click",f,function(){$(this).hasClass("disabled")||h||gt()}).on("click",c,function(){w=!w,ct(),ut()});return lt(),r.push(ot),ot}function a(n){$(n).each(function(){var n=$(this).parent();v(n)})}var u="RobloxUse3DThumbnailsV2",r=[],f=".enable-three-dee",n=null,c=".try-it-on",i=!1,s=!1;return $(".bundle-animation-btn").click(function(n){var t=$(n.currentTarget);r[0].bundleAnimationCtrl.changeThumbnailFromBundleItem(t,!1)}),p(),$(function(){a(".thumbnail-holder")}),{showSpinner:function(){return y(r)},reloadThumbnail:function(){return w(r)},setupDelayedThumbnailHolders:function(){a(".delayed-thumbnail-holder")}}}();

;// Thumbnails/ThumbnailSpinner.js
Roblox=Roblox||{},Roblox.ThumbnailSpinner=function(){var t='<div class="thumbnail-loader"><span class="spinner spinner-default"></span></div>',n=".thumbnail-loader";return{show:function(i){if(!(i.find(n).length>0)){var r=$(t);i.append(r)}},hide:function(t){t.find(n).remove()}}}();

;// 3D/three.js
(function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.THREE=n.THREE||{})})(this,function(n){"use strict";function vi(){}function i(n,t){this.x=n||0,this.y=t||0}function w(n,t,r,u,f,e,o,s,h,l){Object.defineProperty(this,"id",{value:cp++}),this.uuid=c.generateUUID(),this.name="",this.image=n!==undefined?n:w.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=t!==undefined?t:w.DEFAULT_MAPPING,this.wrapS=r!==undefined?r:ct,this.wrapT=u!==undefined?u:ct,this.magFilter=f!==undefined?f:ot,this.minFilter=e!==undefined?e:eo,this.anisotropy=h!==undefined?h:1,this.format=o!==undefined?o:fi,this.type=s!==undefined?s:el,this.offset=new i(0,0),this.repeat=new i(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l!==undefined?l:fs,this.version=0,this.onUpdate=null}function y(n,t,i,r){this.x=n||0,this.y=t||0,this.z=i||0,this.w=r!==undefined?r:1}function lu(n,t,i){this.uuid=c.generateUUID(),this.width=n,this.height=t,this.scissor=new y(0,0,n,t),this.scissorTest=!1,this.viewport=new y(0,0,n,t),i=i||{},i.minFilter===undefined&&(i.minFilter=ot),this.texture=new w(undefined,undefined,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.depthBuffer=i.depthBuffer!==undefined?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==undefined?i.stencilBuffer:!0,this.depthTexture=i.depthTexture!==undefined?i.depthTexture:null}function au(n,t,i){lu.call(this,n,t,i),this.activeCubeFace=0,this.activeMipMapLevel=0}function g(n,t,i,r){this._x=n||0,this._y=t||0,this._z=i||0,this._w=r!==undefined?r:1}function t(n,t,i){this.x=n||0,this.y=t||0,this.z=i||0}function o(){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 fu(n,t,i,r,u,f,e,o,s,h,c,l){w.call(this,null,f,e,o,s,h,r,u,c,l),this.image={data:n,width:t,height:i},this.magFilter=s!==undefined?s:at,this.minFilter=h!==undefined?h:at,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function ki(n,t,i,r,u,f,e,o,s,h){n=n!==undefined?n:[],t=t!==undefined?t:ol,w.call(this,n,t,i,r,u,f,e,o,s,h),this.flipY=!1}function ep(){this.seq=[],this.map={}}function vu(n,t,i){var e=n[0],u,r,f,o;if(e<=0||e>0)return n;if(u=t*i,r=rp[u],r===undefined&&(r=new Float32Array(u),rp[u]=r),t!==0)for(e.toArray(r,0),f=1,o=0;f!==t;++f)o+=i,n[f].toArray(r,o);return r}function ib(n,t){var i=ip[t],r;for(i===undefined&&(i=new Int32Array(t),ip[t]=i),r=0;r!==t;++r)i[r]=n.allocTextureUnit();return i}function wit(n,t){n.uniform1f(this.addr,t)}function pit(n,t){n.uniform1i(this.addr,t)}function yit(n,t){t.x===undefined?n.uniform2fv(this.addr,t):n.uniform2f(this.addr,t.x,t.y)}function vit(n,t){t.x!==undefined?n.uniform3f(this.addr,t.x,t.y,t.z):t.r!==undefined?n.uniform3f(this.addr,t.r,t.g,t.b):n.uniform3fv(this.addr,t)}function ait(n,t){t.x===undefined?n.uniform4fv(this.addr,t):n.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function lit(n,t){n.uniformMatrix2fv(this.addr,!1,t.elements||t)}function cit(n,t){t.elements===undefined?n.uniformMatrix3fv(this.addr,!1,t):(rb.set(t.elements),n.uniformMatrix3fv(this.addr,!1,rb))}function hit(n,t){t.elements===undefined?n.uniformMatrix4fv(this.addr,!1,t):(gy.set(t.elements),n.uniformMatrix4fv(this.addr,!1,gy))}function sit(n,t,i){var r=i.allocTextureUnit();n.uniform1i(this.addr,r),i.setTexture2D(t||bl,r)}function oit(n,t,i){var r=i.allocTextureUnit();n.uniform1i(this.addr,r),i.setTextureCube(t||pl,r)}function ob(n,t){n.uniform2iv(this.addr,t)}function sb(n,t){n.uniform3iv(this.addr,t)}function hb(n,t){n.uniform4iv(this.addr,t)}function eit(n){switch(n){case 5126:return wit;case 35664:return yit;case 35665:return vit;case 35666:return ait;case 35674:return lit;case 35675:return cit;case 35676:return hit;case 35678:return sit;case 35680:return oit;case 5124:case 35670:return pit;case 35667:case 35671:return ob;case 35668:case 35672:return sb;case 35669:case 35673:return hb}}function fit(n,t){n.uniform1fv(this.addr,t)}function uit(n,t){n.uniform1iv(this.addr,t)}function rit(n,t){n.uniform2fv(this.addr,vu(t,this.size,2))}function iit(n,t){n.uniform3fv(this.addr,vu(t,this.size,3))}function dit(n,t){n.uniform4fv(this.addr,vu(t,this.size,4))}function nrt(n,t){n.uniformMatrix2fv(this.addr,!1,vu(t,this.size,4))}function drt(n,t){n.uniformMatrix3fv(this.addr,!1,vu(t,this.size,9))}function trt(n,t){n.uniformMatrix4fv(this.addr,!1,vu(t,this.size,16))}function krt(n,t,i){var u=t.length,f=ib(i,u),r;for(n.uniform1iv(this.addr,f),r=0;r!==u;++r)i.setTexture2D(t[r]||bl,f[r])}function brt(n,t,i){var u=t.length,f=ib(i,u),r;for(n.uniform1iv(this.addr,f),r=0;r!==u;++r)i.setTextureCube(t[r]||pl,f[r])}function wrt(n){switch(n){case 5126:return fit;case 35664:return rit;case 35665:return iit;case 35666:return dit;case 35674:return nrt;case 35675:return drt;case 35676:return trt;case 35678:return krt;case 35680:return brt;case 5124:case 35670:return uit;case 35667:case 35671:return ob;case 35668:case 35672:return sb;case 35669:case 35673:return hb}}function prt(n,t,i){this.id=n,this.addr=i,this.setValue=eit(t.type)}function yrt(n,t,i){this.id=n,this.addr=i,this.size=t.size,this.setValue=wrt(t.type)}function td(n){this.id=n,ep.call(this)}function dk(n,t){n.seq.push(t),n.map[t.id]=t}function vrt(n,t,i){var o=n.name,h=o.length,s,u;for(tl.lastIndex=0;;){var f=tl.exec(o),c=tl.lastIndex,r=f[1],l=f[2]==="]",e=f[3];if(l&&(r=r|0),e===undefined||e==="["&&c+2===h){dk(i,e===undefined?new prt(r,n,t):new yrt(r,n,t));break}else s=i.map,u=s[r],u===undefined&&(u=new td(r),dk(i,u)),i=u}}function cr(n,t,i){var u,r;for(ep.call(this),this.renderer=i,u=n.getProgramParameter(t,n.ACTIVE_UNIFORMS),r=0;r<u;++r){var f=n.getActiveUniform(t,r),e=f.name,o=n.getUniformLocation(t,e);vrt(f,o,this)}}function e(n,t,i){return t===undefined&&i===undefined?this.set(n):this.setRGB(n,t,i)}function oc(n,t){this.min=n!==undefined?n:new i(+ Infinity,+ Infinity),this.max=t!==undefined?t:new i(- Infinity,- Infinity)}function ift(n,r){function y(){var n=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),t=new Uint16Array([0,1,2,0,2,3]);c=u.createBuffer(),l=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,c),u.bufferData(u.ARRAY_BUFFER,n,u.STATIC_DRAW),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,l),u.bufferData(u.ELEMENT_ARRAY_BUFFER,t,u.STATIC_DRAW),h=u.createTexture(),a=u.createTexture(),f.bindTexture(u.TEXTURE_2D,h),u.texImage2D(u.TEXTURE_2D,0,u.RGB,16,16,0,u.RGB,u.UNSIGNED_BYTE,null),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.NEAREST),f.bindTexture(u.TEXTURE_2D,a),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,16,16,0,u.RGBA,u.UNSIGNED_BYTE,null),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.NEAREST),v={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility =        visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *=       visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},e=p(v),s={vertex:u.getAttribLocation(e,"position"),uv:u.getAttribLocation(e,"uv")},o={renderType:u.getUniformLocation(e,"renderType"),map:u.getUniformLocation(e,"map"),occlusionMap:u.getUniformLocation(e,"occlusionMap"),opacity:u.getUniformLocation(e,"opacity"),color:u.getUniformLocation(e,"color"),scale:u.getUniformLocation(e,"scale"),rotation:u.getUniformLocation(e,"rotation"),screenPosition:u.getUniformLocation(e,"screenPosition")}}function p(t){var i=u.createProgram(),r=u.createShader(u.FRAGMENT_SHADER),f=u.createShader(u.VERTEX_SHADER),e="precision "+n.getPrecision()+" float;\n";return u.shaderSource(r,e+t.fragmentShader),u.shaderSource(f,e+t.vertexShader),u.compileShader(r),u.compileShader(f),u.attachShader(i,r),u.attachShader(i,f),u.linkProgram(i),i}var u=n.context,f=n.state,c,l,v,e,s,o,h,a;this.render=function(v,p,w){var it,ct,d,rt,ht,b;if(r.length!==0){var ut=new t,ft=w.w/w.z,ot=w.z*.5,st=w.w*.5,g=16/w.w,tt=new i(g*ft,g),k=new t(1,1,0),nt=new i(1,1),et=new oc;for(et.min.set(w.x,w.y),et.max.set(w.x+(w.z-16),w.y+(w.w-16)),e===undefined&&y(),u.useProgram(e),f.initAttributes(),f.enableAttribute(s.vertex),f.enableAttribute(s.uv),f.disableUnusedAttributes(),u.uniform1i(o.occlusionMap,0),u.uniform1i(o.map,1),u.bindBuffer(u.ARRAY_BUFFER,c),u.vertexAttribPointer(s.vertex,2,u.FLOAT,!1,16,0),u.vertexAttribPointer(s.uv,2,u.FLOAT,!1,16,8),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,l),f.disable(u.CULL_FACE),f.buffers.depth.setMask(!1),it=0,ct=r.length;it<ct;it++)if(g=16/w.w,tt.set(g*ft,g),d=r[it],ut.set(d.matrixWorld.elements[12],d.matrixWorld.elements[13],d.matrixWorld.elements[14]),ut.applyMatrix4(p.matrixWorldInverse),ut.applyMatrix4(p.projectionMatrix),k.copy(ut),nt.x=w.x+k.x*ot+ot-8,nt.y=w.y+k.y*st+st-8,et.containsPoint(nt)===!0)for(f.activeTexture(u.TEXTURE0),f.bindTexture(u.TEXTURE_2D,null),f.activeTexture(u.TEXTURE1),f.bindTexture(u.TEXTURE_2D,h),u.copyTexImage2D(u.TEXTURE_2D,0,u.RGB,nt.x,nt.y,16,16,0),u.uniform1i(o.renderType,0),u.uniform2f(o.scale,tt.x,tt.y),u.uniform3f(o.screenPosition,k.x,k.y,k.z),f.disable(u.BLEND),f.enable(u.DEPTH_TEST),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,0),f.activeTexture(u.TEXTURE0),f.bindTexture(u.TEXTURE_2D,a),u.copyTexImage2D(u.TEXTURE_2D,0,u.RGBA,nt.x,nt.y,16,16,0),u.uniform1i(o.renderType,1),f.disable(u.DEPTH_TEST),f.activeTexture(u.TEXTURE1),f.bindTexture(u.TEXTURE_2D,h),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,0),d.positionScreen.copy(k),d.customUpdateCallback?d.customUpdateCallback(d):d.updateLensFlares(),u.uniform1i(o.renderType,2),f.enable(u.BLEND),rt=0,ht=d.lensFlares.length;rt<ht;rt++)b=d.lensFlares[rt],b.opacity>.001&&b.scale>.001&&(k.x=b.x,k.y=b.y,k.z=b.z,g=b.size*b.scale/w.w,tt.x=g*ft,tt.y=g,u.uniform3f(o.screenPosition,k.x,k.y,k.z),u.uniform2f(o.scale,tt.x,tt.y),u.uniform1f(o.rotation,b.rotation),u.uniform1f(o.opacity,b.opacity),u.uniform3f(o.color,b.color.r,b.color.g,b.color.b),f.setBlending(b.blending,b.blendEquation,b.blendSrc,b.blendDst),n.setTexture2D(b.texture,1),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,0));f.enable(u.CULL_FACE),f.enable(u.DEPTH_TEST),f.buffers.depth.setMask(!0),n.resetGLState()}}}function rft(n,i){function y(){var i=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),e=new Uint16Array([0,1,2,0,2,3]),n,t;s=r.createBuffer(),h=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,s),r.bufferData(r.ARRAY_BUFFER,i,r.STATIC_DRAW),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e,r.STATIC_DRAW),f=p(),o={position:r.getAttribLocation(f,"position"),uv:r.getAttribLocation(f,"uv")},u={uvOffset:r.getUniformLocation(f,"uvOffset"),uvScale:r.getUniformLocation(f,"uvScale"),rotation:r.getUniformLocation(f,"rotation"),scale:r.getUniformLocation(f,"scale"),color:r.getUniformLocation(f,"color"),map:r.getUniformLocation(f,"map"),opacity:r.getUniformLocation(f,"opacity"),modelViewMatrix:r.getUniformLocation(f,"modelViewMatrix"),projectionMatrix:r.getUniformLocation(f,"projectionMatrix"),fogType:r.getUniformLocation(f,"fogType"),fogDensity:r.getUniformLocation(f,"fogDensity"),fogNear:r.getUniformLocation(f,"fogNear"),fogFar:r.getUniformLocation(f,"fogFar"),fogColor:r.getUniformLocation(f,"fogColor"),alphaTest:r.getUniformLocation(f,"alphaTest")},n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n.width=8,n.height=8,t=n.getContext("2d"),t.fillStyle="white",t.fillRect(0,0,8,8),c=new w(n),c.needsUpdate=!0}function p(){var t=r.createProgram(),i=r.createShader(r.VERTEX_SHADER),u=r.createShader(r.FRAGMENT_SHADER);return r.shaderSource(i,["precision "+n.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),r.shaderSource(u,["precision "+n.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),r.compileShader(i),r.compileShader(u),r.attachShader(t,i),r.attachShader(t,u),r.linkProgram(t),t}function b(n,t){return n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.z!==t.z?t.z-n.z:t.id-n.id}var r=n.context,e=n.state,s,h,f,o,u,c,a=new t,v=new g,l=new t;this.render=function(t,p){var ut,g,rt,d,w,tt;if(i.length!==0){f===undefined&&y(),r.useProgram(f),e.initAttributes(),e.enableAttribute(o.position),e.enableAttribute(o.uv),e.disableUnusedAttributes(),e.disable(r.CULL_FACE),e.enable(r.BLEND),r.bindBuffer(r.ARRAY_BUFFER,s),r.vertexAttribPointer(o.position,2,r.FLOAT,!1,16,0),r.vertexAttribPointer(o.uv,2,r.FLOAT,!1,16,8),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.uniformMatrix4fv(u.projectionMatrix,!1,p.projectionMatrix.elements),e.activeTexture(r.TEXTURE0),r.uniform1i(u.map,0);var nt=0,it=0,k=t.fog;for(k?(r.uniform3f(u.fogColor,k.color.r,k.color.g,k.color.b),k.isFog?(r.uniform1f(u.fogNear,k.near),r.uniform1f(u.fogFar,k.far),r.uniform1i(u.fogType,1),nt=1,it=1):k.isFogExp2&&(r.uniform1f(u.fogDensity,k.density),r.uniform1i(u.fogType,2),nt=2,it=2)):(r.uniform1i(u.fogType,0),nt=0,it=0),g=0,rt=i.length;g<rt;g++)d=i[g],d.modelViewMatrix.multiplyMatrices(p.matrixWorldInverse,d.matrixWorld),d.z=-d.modelViewMatrix.elements[14];for(i.sort(b),ut=[],g=0,rt=i.length;g<rt;g++)(d=i[g],w=d.material,w.visible!==!1)&&(r.uniform1f(u.alphaTest,w.alphaTest),r.uniformMatrix4fv(u.modelViewMatrix,!1,d.modelViewMatrix.elements),d.matrixWorld.decompose(a,v,l),ut[0]=l.x,ut[1]=l.y,tt=0,t.fog&&w.fog&&(tt=it),nt!==tt&&(r.uniform1i(u.fogType,tt),nt=tt),w.map!==null?(r.uniform2f(u.uvOffset,w.map.offset.x,w.map.offset.y),r.uniform2f(u.uvScale,w.map.repeat.x,w.map.repeat.y)):(r.uniform2f(u.uvOffset,0,0),r.uniform2f(u.uvScale,1,1)),r.uniform1f(u.opacity,w.opacity),r.uniform3f(u.color,w.color.r,w.color.g,w.color.b),r.uniform1f(u.rotation,w.rotation),r.uniform2fv(u.scale,ut),e.setBlending(w.blending,w.blendEquation,w.blendSrc,w.blendDst),e.buffers.depth.setTest(w.depthTest),e.buffers.depth.setMask(w.depthWrite),w.map?n.setTexture2D(w.map,0):n.setTexture2D(c,0),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0));e.enable(r.CULL_FACE),n.resetGLState()}}}function a(){Object.defineProperty(this,"id",{value:id++}),this.uuid=c.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=ce,this.side=bu,this.shading=ya,this.vertexColors=sh,this.opacity=1,this.transparent=!1,this.blendSrc=oa,this.blendDst=sa,this.blendEquation=lv,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=sc,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,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.overdraw=0,this.visible=!0,this.needsUpdate=!0}function ft(n){a.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=undefined,n!==undefined&&(n.attributes!==undefined&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(n))}function bi(n){a.call(this),this.type="MeshDepthMaterial",this.depthPacking=ap,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(n)}function hi(n,i){this.min=n!==undefined?n:new t(+ Infinity,+ Infinity,+ Infinity),this.max=i!==undefined?i:new t(- Infinity,- Infinity,- Infinity)}function ri(n,i){this.center=n!==undefined?n:new t,this.radius=i!==undefined?i:0}function ti(){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.")}function bt(n,i){this.normal=n!==undefined?n:new t(1,0,0),this.constant=i!==undefined?i:0}function lh(n,t,i,r,u,f){this.planes=[n!==undefined?n:new bt,t!==undefined?t:new bt,i!==undefined?i:new bt,r!==undefined?r:new bt,u!==undefined?u:new bt,f!==undefined?f:new bt]}function gb(n,r,u,f){function ct(t,i,r,u){var e=t.geometry,f=null,y=ot,v=t.customDepthMaterial,c,p,a,h,o;if(r&&(y=ht,v=t.customDistanceMaterial),v?f=v:(c=!1,i.morphTargets&&(e&&e.isBufferGeometry?c=e.morphAttributes&&e.morphAttributes.position&&e.morphAttributes.position.length>0:e&&e.isGeometry&&(c=e.morphTargets&&e.morphTargets.length>0)),t.isSkinnedMesh&&i.skinning===!1&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t),p=t.isSkinnedMesh&&i.skinning,a=0,c&&(a|=k),p&&(a|=d),f=y[a]),n.localClippingEnabled&&i.clipShadows===!0&&i.clippingPlanes.length!==0){var w=f.uuid,b=i.uuid,s=st[w];s===undefined&&(s={},st[w]=s),h=s[b],h===undefined&&(h=f.clone(),s[b]=h),f=h}return f.visible=i.visible,f.wireframe=i.wireframe,o=i.side,l.renderSingleSided&&o==pu&&(o=bu),l.renderReverseSided&&(o===bu?o=ir:o===ir&&(o=bu)),f.side=o,f.clipShadows=i.clipShadows,f.clippingPlanes=i.clippingPlanes,f.wireframeLinewidth=i.wireframeLinewidth,f.linewidth=i.linewidth,r&&f.uniforms.lightPos!==undefined&&f.uniforms.lightPos.value.copy(u),f}function yt(t,i,r,f){var w,o,e,v,s,b,y,c,l,p,a,k;if(t.visible!==!1){if(w=t.layers.test(i.layers),w&&(t.isMesh||t.isLine||t.isPoints)&&t.castShadow&&(!t.frustumCulled||vt.intersectsObject(t)))if(t.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,t.matrixWorld),o=u.update(t),e=t.material,Array.isArray(e))for(v=o.groups,s=0,b=v.length;s<b;s++)y=v[s],c=e[y.materialIndex],c&&c.visible&&(l=ct(t,c,f,h),n.renderBufferDirect(r,null,o,l,t,y));else e.visible&&(l=ct(t,e,f,h),n.renderBufferDirect(r,null,o,l,t,null));for(p=t.children,a=0,k=p.length;a<k;a++)yt(p[a],i,r,f)}}var bt=n.context,v=n.state,vt=new lh,lt=new o,w=r.shadows,e=new i,wt=new i(f.maxTextureSize,f.maxTextureSize),a=new t,h=new t,k=1,d=2,g=(k|d)+1,ot=new Array(g),ht=new Array(g),st={},pt=[new t(1,0,0),new t(-1,0,0),new t(0,0,1),new t(0,0,-1),new t(0,1,0),new t(0,-1,0)],kt=[new t(0,1,0),new t(0,1,0),new t(0,1,0),new t(0,1,0),new t(0,0,1),new t(0,0,-1)],c=[new y,new y,new y,new y,new y,new y],b=new bi,p,rt,s,tt,l;for(b.depthPacking=up,b.clipping=!0,p=nr.distanceRGBA,rt=et.clone(p.uniforms),s=0;s!==g;++s){var it=(s&k)!=0,ut=(s&d)!=0,nt=b.clone();nt.morphTargets=it,nt.skinning=ut,ot[s]=nt,tt=new ft({defines:{USE_SHADOWMAP:""},uniforms:rt,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,morphTargets:it,skinning:ut,clipping:!0}),ht[s]=tt}l=this,this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=vv,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(t,i){var d,b,k,g,s,f,r,p,u,o,tt,it,y,rt,nt,ut;if(l.enabled!==!1&&(l.autoUpdate!==!1||l.needsUpdate!==!1)&&w.length!==0){for(v.disable(bt.BLEND),v.buffers.color.setClear(1,1,1,1),v.buffers.depth.setTest(!0),v.setScissorTest(!1),k=0,g=w.length;k<g;k++){if(s=w[k],f=s.shadow,f===undefined){console.warn("THREE.WebGLShadowMap:",s,"has no shadow.");continue}for(r=f.camera,p=f.matrix,h.setFromMatrixPosition(s.matrixWorld),r.position.copy(h),e.copy(f.mapSize),e.min(wt),s&&s.isPointLight?(d=6,b=!0,u=e.x,o=e.y,c[0].set(u*2,o,u,o),c[1].set(0,o,u,o),c[2].set(u*3,o,u,o),c[3].set(u,o,u,o),c[4].set(u*3,0,u,o),c[5].set(u,0,u,o),e.x*=4,e.y*=2,p.makeTranslation(-h.x,-h.y,-h.z)):(d=1,b=!1,a.setFromMatrixPosition(s.target.matrixWorld),r.lookAt(a),r.updateMatrixWorld(),r.matrixWorldInverse.getInverse(r.matrixWorld),p.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),p.multiply(r.projectionMatrix),p.multiply(r.matrixWorldInverse)),f.map===null&&(tt={minFilter:at,magFilter:at,format:fi},f.map=new lu(e.x,e.y,tt),f.map.texture.name=s.name+".shadowMap",r.updateProjectionMatrix()),f.isSpotLightShadow&&f.update(s),it=f.map,n.setRenderTarget(it),n.clear(),y=0;y<d;y++)b&&(a.copy(r.position),a.add(pt[y]),r.up.copy(kt[y]),r.lookAt(a),r.updateMatrixWorld(),r.matrixWorldInverse.getInverse(r.matrixWorld),rt=c[y],v.viewport(rt)),lt.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),vt.setFromMatrix(lt),yt(t,i,r,b)}nt=n.getClearColor(),ut=n.getClearAlpha(),n.setClearColor(nt,ut),l.needsUpdate=!1}}}function rr(n,i){this.origin=n!==undefined?n:new t,this.direction=i!==undefined?i:new t}function tr(n,t,i,r){this._x=n||0,this._y=t||0,this._z=i||0,this._order=r||tr.DefaultOrder}function ha(){this.mask=1}function u(){function e(){i.setFromEuler(n,!1)}function s(){n.setFromQuaternion(i,undefined,!1)}Object.defineProperty(this,"id",{value:yb++}),this.uuid=c.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=u.DefaultUp.clone();var r=new t,n=new tr,i=new g,f=new t(1,1,1);n.onChange(e);i.onChange(s);Object.defineProperties(this,{position:{enumerable:!0,value:r},rotation:{enumerable:!0,value:n},quaternion:{enumerable:!0,value:i},scale:{enumerable:!0,value:f},modelViewMatrix:{value:new o},normalMatrix:{value:new ti}}),this.matrix=new o,this.matrixWorld=new o,this.matrixAutoUpdate=u.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ha,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={},this.onBeforeRender=function(){},this.onAfterRender=function(){}}function yf(n,i){this.start=n!==undefined?n:new t,this.end=i!==undefined?i:new t}function ci(n,i,r){this.a=n!==undefined?n:new t,this.b=i!==undefined?i:new t,this.c=r!==undefined?r:new t}function li(n,i,r,u,f,o){this.a=n,this.b=i,this.c=r,this.normal=u&&u.isVector3?u:new t,this.vertexNormals=Array.isArray(u)?u:[],this.color=f&&f.isColor?f:new e,this.vertexColors=Array.isArray(f)?f:[],this.materialIndex=o!==undefined?o:0}function yt(n){a.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=hs,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(n)}function l(n,t,i){if(Array.isArray(n))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=c.generateUUID(),this.array=n,this.itemSize=t,this.count=n!==undefined?n.length/t:0,this.normalized=i===!0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function io(n,t){l.call(this,new Int8Array(n),t)}function to(n,t){l.call(this,new Uint8Array(n),t)}function no(n,t){l.call(this,new Uint8ClampedArray(n),t)}function ge(n,t){l.call(this,new Int16Array(n),t)}function vr(n,t){l.call(this,new Uint16Array(n),t)}function ao(n,t){l.call(this,new Int32Array(n),t)}function yr(n,t){l.call(this,new Uint32Array(n),t)}function r(n,t){l.call(this,new Float32Array(n),t)}function ls(n,t){l.call(this,new Float64Array(n),t)}function pb(){this.indices=[],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 ea(n){var i,t,r;if(n.length===0)return- Infinity;for(i=n[0],t=1,r=n.length;t<r;++t)n[t]>i&&(i=n[t]);return i}function fa(){return ab++}function s(){Object.defineProperty(this,"id",{value:fa()}),this.uuid=c.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 f(){Object.defineProperty(this,"id",{value:fa()}),this.uuid=c.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:Infinity}}function ut(n,t){u.call(this),this.type="Mesh",this.geometry=n!==undefined?n:new f,this.material=t!==undefined?t:new yt({color:Math.random()*16777215}),this.drawMode=ev,this.updateMorphTargets()}function du(n,t,i,r,u,f){s.call(this),this.type="BoxGeometry",this.parameters={width:n,height:t,depth:i,widthSegments:r,heightSegments:u,depthSegments:f},this.fromBufferGeometry(new pr(n,t,i,r,u,f)),this.mergeVertices()}function pr(n,i,u,e,o,s){function h(n,i,r,u,f,e,o,s,h,b,k){for(var yt=e/h,at=o/b,lt=e/2,pt=o/2,ht=s/2,tt=h+1,st=b+1,ot=0,it=0,nt,d=new t,ft,ut,g=0;g<st;g++)for(ft=g*at-pt,nt=0;nt<tt;nt++)ut=nt*yt-lt,d[n]=ut*u,d[i]=ft*f,d[r]=ht,y.push(d.x,d.y,d.z),d[n]=0,d[i]=0,d[r]=s>0?1:-1,p.push(d.x,d.y,d.z),a.push(nt/h),a.push(1-g/b),ot+=1;for(g=0;g<b;g++)for(nt=0;nt<h;nt++){var vt=c+nt+tt*g,rt=c+nt+tt*(g+1),ct=c+(nt+1)+tt*(g+1),et=c+(nt+1)+tt*g;l.push(vt,rt,et),l.push(rt,ct,et),it+=6}v.addGroup(w,it,k),w+=it,c+=ot}var v;f.call(this),this.type="BoxBufferGeometry",this.parameters={width:n,height:i,depth:u,widthSegments:e,heightSegments:o,depthSegments:s},v=this,e=Math.floor(e)||1,o=Math.floor(o)||1,s=Math.floor(s)||1;var l=[],y=[],p=[],a=[],c=0,w=0;h("z","y","x",-1,-1,u,i,n,s,o,0),h("z","y","x",1,-1,u,i,-n,s,o,1),h("x","z","y",1,1,n,u,i,e,s,2),h("x","z","y",1,-1,n,u,-i,e,s,3),h("x","y","z",1,-1,n,i,u,e,o,4),h("x","y","z",-1,-1,n,i,-u,e,o,5),this.setIndex(l),this.addAttribute("position",new r(y,3)),this.addAttribute("normal",new r(p,3)),this.addAttribute("uv",new r(a,2))}function ko(n,t,i,r){s.call(this),this.type="PlaneGeometry",this.parameters={width:n,height:t,widthSegments:i,heightSegments:r},this.fromBufferGeometry(new wr(n,t,i,r)),this.mergeVertices()}function wr(n,t,i,u){var p,y;f.call(this),this.type="PlaneBufferGeometry",this.parameters={width:n,height:t,widthSegments:i,heightSegments:u};for(var rt=n/2,tt=t/2,h=Math.floor(i)||1,c=Math.floor(u)||1,s=h+1,nt=c+1,g=n/h,ut=t/c,e,a=[],k=[],w=[],l=[],o=0;o<nt;o++)for(p=o*ut-tt,e=0;e<s;e++)y=e*g-rt,k.push(y,-p,0),w.push(0,0,1),l.push(e/h),l.push(1-o/c);for(o=0;o<c;o++)for(e=0;e<h;e++){var it=e+s*o,v=e+s*(o+1),d=e+1+s*(o+1),b=e+1+s*o;a.push(it,v,b),a.push(v,d,b)}this.setIndex(a),this.addAttribute("position",new r(k,3)),this.addAttribute("normal",new r(w,3)),this.addAttribute("uv",new r(l,2))}function oi(){u.call(this),this.type="Camera",this.matrixWorldInverse=new o,this.projectionMatrix=new o}function nt(n,t,i,r){oi.call(this),this.type="PerspectiveCamera",this.fov=n!==undefined?n:50,this.zoom=1,this.near=i!==undefined?i:.1,this.far=r!==undefined?r:2e3,this.focus=10,this.aspect=t!==undefined?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function pf(n,t,i,r,u,f){oi.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=n,this.right=t,this.top=i,this.bottom=r,this.near=u!==undefined?u:.1,this.far=f!==undefined?f:2e3,this.updateProjectionMatrix()}function nn(n){function i(t,i){var r=t.array,e=t.dynamic?n.DYNAMIC_DRAW:n.STATIC_DRAW,f=n.createBuffer(),u;return n.bindBuffer(i,f),n.bufferData(i,r,e),t.onUploadCallback(),u=n.FLOAT,r instanceof Float32Array?u=n.FLOAT:r instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):r instanceof Uint16Array?u=n.UNSIGNED_SHORT:r instanceof Int16Array?u=n.SHORT:r instanceof Uint32Array?u=n.UNSIGNED_INT:r instanceof Int32Array?u=n.INT:r instanceof Int8Array?u=n.BYTE:r instanceof Uint8Array&&(u=n.UNSIGNED_BYTE),{buffer:f,type:u,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}function r(t,i,r){var f=i.array,u=i.updateRange;n.bindBuffer(r,t),i.dynamic===!1?n.bufferData(r,f,n.STATIC_DRAW):u.count===-1?n.bufferSubData(r,0,f):u.count===0?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."):(n.bufferSubData(r,u.offset*f.BYTES_PER_ELEMENT,f.subarray(u.offset,u.offset+u.count)),u.count=0)}function u(n){return n.isInterleavedBufferAttribute&&(n=n.data),t[n.uuid]}function f(i){var r=t[i.uuid];r&&(n.deleteBuffer(r.buffer),delete t[i.uuid])}function e(n,u){n.isInterleavedBufferAttribute&&(n=n.data);var f=t[n.uuid];f===undefined?t[n.uuid]=i(n,u):f.version<n.version&&(r(f.buffer,n,u),f.version=n.version)}var t={};return{get:u,remove:f,update:e}}function uet(n,t){return n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.program&&t.program&&n.program!==t.program?n.program.id-t.program.id:n.material.id!==t.material.id?n.material.id-t.material.id:n.z!==t.z?n.z-t.z:n.id-t.id}function ret(n,t){return n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.z!==t.z?t.z-n.z:n.id-t.id}function iet(){function u(){i=-1,r=-1}function f(u,f,e,o,s){var c,l,h;e.transparent?(c=t,l=++r):(c=n,l=++i),h=c[l],h?(h.id=u.id,h.object=u,h.geometry=f,h.material=e,h.program=e.program,h.renderOrder=u.renderOrder,h.z=o,h.group=s):(h={id:u.id,object:u,geometry:f,material:e,program:e.program,renderOrder:u.renderOrder,z:o,group:s},c.push(h))}function e(){n.length=i+1,t.length=r+1}function o(){n.sort(uet),t.sort(ret)}var n=[],i=-1,t=[],r=-1;return{opaque:n,transparent:t,init:u,push:f,finish:e,sort:o}}function tet(){function t(t,i){var u=t.id+","+i.id,r=n[u];return r===undefined&&(r=new iet,n[u]=r),r}function i(){n={}}var n={};return{get:t,dispose:i}}function net(n,t,i){function e(n){r=n}function o(i){i.array instanceof Uint32Array&&t.get("OES_element_index_uint")?(u=n.UNSIGNED_INT,f=4):i.array instanceof Uint16Array?(u=n.UNSIGNED_SHORT,f=2):(u=n.UNSIGNED_BYTE,f=1)}function s(t,e){n.drawElements(r,e,u,t*f),i.calls++,i.vertices+=e,r===n.TRIANGLES&&(i.faces+=e/3)}function h(e,o,s){var h=t.get("ANGLE_instanced_arrays");if(h===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}h.drawElementsInstancedANGLE(r,s,u,o*f,e.maxInstancedCount),i.calls++,i.vertices+=s*e.maxInstancedCount,r===n.TRIANGLES&&(i.faces+=e.maxInstancedCount*s/3)}var r,u,f;this.setMode=e,this.setIndex=o,this.render=s,this.renderInstances=h}function gft(n,t,i){function u(n){r=n}function f(t,u){n.drawArrays(r,t,u),i.calls++,i.vertices+=u,r===n.TRIANGLES&&(i.faces+=u/3)}function e(u,f,e){var o=t.get("ANGLE_instanced_arrays"),s;if(o===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}s=u.attributes.position,s.isInterleavedBufferAttribute?(e=s.data.count,o.drawArraysInstancedANGLE(r,0,e,u.maxInstancedCount)):o.drawArraysInstancedANGLE(r,f,e,u.maxInstancedCount),i.calls++,i.vertices+=e*u.maxInstancedCount,r===n.TRIANGLES&&(i.faces+=u.maxInstancedCount*e/3)}var r;this.setMode=u,this.render=f,this.renderInstances=e}function dft(n,t,i){function e(n){var s=n.target,f=u[s.id],h,o;f.index!==null&&t.remove(f.index);for(h in f.attributes)t.remove(f.attributes[h]);s.removeEventListener("dispose",e),delete u[s.id],o=r[s.id],o&&(t.remove(o),delete r[s.id]),o=r[f.id],o&&(t.remove(o),delete r[f.id]),i.geometries--}function o(n,t){var r=u[t.id];return r?r:(t.addEventListener("dispose",e),t.isBufferGeometry?r=t:t.isGeometry&&(t._bufferGeometry===undefined&&(t._bufferGeometry=(new f).setFromObject(n)),r=t._bufferGeometry),u[t.id]=r,i.geometries++,r)}function s(i){var o=i.index,s=i.attributes,f,r,e,u,h;o!==null&&t.update(o,n.ELEMENT_ARRAY_BUFFER);for(r in s)t.update(s[r],n.ARRAY_BUFFER);f=i.morphAttributes;for(r in f)for(e=f[r],u=0,h=e.length;u<h;u++)t.update(e[u],n.ARRAY_BUFFER)}function h(i){var e=r[i.id],f,u,s;if(e)return e;var o=[],a=i.index,v=i.attributes;if(a!==null)for(f=a.array,u=0,s=f.length;u<s;u+=3){var h=f[u+0],c=f[u+1],l=f[u+2];o.push(h,c,c,l,l,h)}else for(f=v.position.array,u=0,s=f.length/3-1;u<s;u+=3){var h=u+0,c=u+1,l=u+2;o.push(h,c,c,l,l,h)}return e=new(ea(o)>65535?yr:vr)(o,1),t.update(e,n.ELEMENT_ARRAY_BUFFER),r[i.id]=e,e}var u={},r={};return{get:o,update:s,getWireframeAttribute:h}}function kft(){var n={};return{get:function(r){if(n[r.id]!==undefined)return n[r.id];var u;switch(r.type){case"DirectionalLight":u={direction:new t,color:new e,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"SpotLight":u={position:new t,direction:new t,color:new e,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"PointLight":u={position:new t,color:new e,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"HemisphereLight":u={direction:new t,skyColor:new e,groundColor:new e};break;case"RectAreaLight":u={color:new e,position:new t,halfWidth:new t,halfHeight:new t}}return n[r.id]=u,u}}}function bft(n,t,i){function u(n){var f=i.frame,e=n.geometry,u=t.get(n,e);return r[u.id]!==f&&(e.isGeometry&&u.updateFromObject(n),t.update(u),r[u.id]=f),u}function f(){r={}}var r={};return{update:u,clear:f}}function wft(n){for(var i=n.split("\n"),t=0;t<i.length;t++)i[t]=t+1+": "+i[t];return i.join("\n")}function vk(n,t,i){var r=n.createShader(t);return n.shaderSource(r,i),n.compileShader(r),n.getShaderParameter(r,n.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),n.getShaderInfoLog(r)!==""&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===n.VERTEX_SHADER?"vertex":"fragment",n.getShaderInfoLog(r),wft(i)),r}function lk(n){switch(n){case fs:return["Linear","( value )"];case tb:return["sRGB","( value )"];case op:return["RGBE","( value )"];case wy:return["RGBM","( value, 7.0 )"];case by:return["RGBM","( value, 16.0 )"];case np:return["RGBD","( value, 256.0 )"];case ov:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+n);}}function ca(n,t){var i=lk(t);return"vec4 "+n+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function pft(n,t){var i=lk(t);return"vec4 "+n+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function yft(n,t){var i;switch(t){case av:i="Linear";break;case lp:i="Reinhard";break;case hp:i="Uncharted2";break;case fp:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t);}return"vec3 "+n+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function vft(n,t,i){n=n||{};var r=[n.derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(n.fragDepth||t.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",n.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(n.shaderTextureLOD||t.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return r.filter(th).join("\n")}function aft(n){var r=[],t,i;for(t in n)(i=n[t],i!==!1)&&r.push("#define "+t+" "+i);return r.join("\n")}function lft(n,t){for(var f={},o=n.getProgramParameter(t,n.ACTIVE_ATTRIBUTES),e,u,r=0;r<o;r++)e=n.getActiveAttrib(t,r),u=e.name,f[u]=n.getAttribLocation(t,u);return f}function th(n){return n!==""}function ky(n,t){return n.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function kl(n){function i(n,t){var i=v[t];if(i===undefined)throw new Error("Can not resolve #include <"+t+">");return kl(i)}var t=/^[ \t]*#include +<([\w\d.]+)>/gm;return n.replace(t,i)}function dy(n){function i(n,t,i,r){for(var f="",u=parseInt(t);u<parseInt(i);u++)f+=r.replace(/\[ i \]/g,"[ "+u+" ]");return f}var t=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return n.replace(t,i)}function cft(n,t,i,r){var u=n.context,st=i.extensions,ot=i.defines,e=i.__webglShader.vertexShader,o=i.__webglShader.fragmentShader,a="SHADOWMAP_TYPE_BASIC",nt,g;r.shadowMapType===vv?a="SHADOWMAP_TYPE_PCF":r.shadowMapType===wk&&(a="SHADOWMAP_TYPE_PCF_SOFT");var s="ENVMAP_TYPE_CUBE",tt="ENVMAP_MODE_REFLECTION",w="ENVMAP_BLENDING_MULTIPLY";if(r.envMap){switch(i.envMap.mapping){case ol:case cl:s="ENVMAP_TYPE_CUBE";break;case wc:case al:s="ENVMAP_TYPE_CUBE_UV";break;case pa:case ll:s="ENVMAP_TYPE_EQUIREC";break;case ta:s="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case cl:case ll:tt="ENVMAP_MODE_REFRACTION"}switch(i.combine){case hs:w="ENVMAP_BLENDING_MULTIPLY";break;case sp:w="ENVMAP_BLENDING_MIX";break;case yy:w="ENVMAP_BLENDING_ADD"}}var it=n.gammaFactor>0?n.gammaFactor:1,ft=vft(st,r,n.extensions),h=aft(ot),f=u.createProgram(),p,b;i.isRawShaderMaterial?(p=[h,"\n"].filter(th).join("\n"),b=[ft,h,"\n"].filter(th).join("\n")):(p=["precision "+r.precision+" float;","precision "+r.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,h,r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+it,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+tt:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&r.flatShading===!1?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+r.numClippingPlanes,r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+a:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&n.extensions.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_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(th).join("\n"),b=[ft,"precision "+r.precision+" float;","precision "+r.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,h,r.alphaTest?"#define ALPHATEST "+r.alphaTest:"","#define GAMMA_FACTOR "+it,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+s:"",r.envMap?"#define "+tt:"",r.envMap?"#define "+w:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+r.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(r.numClippingPlanes-r.numClipIntersection),r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+a:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&n.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",r.envMap&&n.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",r.toneMapping!==kc?"#define TONE_MAPPING":"",r.toneMapping!==kc?v.tonemapping_pars_fragment:"",r.toneMapping!==kc?yft("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.outputEncoding||r.mapEncoding||r.envMapEncoding||r.emissiveMapEncoding?v.encodings_pars_fragment:"",r.mapEncoding?ca("mapTexelToLinear",r.mapEncoding):"",r.envMapEncoding?ca("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMapEncoding?ca("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.outputEncoding?pft("linearToOutputTexel",r.outputEncoding):"",r.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(th).join("\n")),e=kl(e,r),e=ky(e,r),o=kl(o,r),o=ky(o,r),i.isShaderMaterial||(e=dy(e),o=dy(o));var ht=p+e,et=b+o,c=vk(u,u.VERTEX_SHADER,ht),l=vk(u,u.FRAGMENT_SHADER,et);u.attachShader(f,c),u.attachShader(f,l),i.index0AttributeName!==undefined?u.bindAttribLocation(f,0,i.index0AttributeName):r.morphTargets===!0&&u.bindAttribLocation(f,0,"position"),u.linkProgram(f);var y=u.getProgramInfoLog(f),k=u.getShaderInfoLog(c),d=u.getShaderInfoLog(l),rt=!0,ut=!0;return u.getProgramParameter(f,u.LINK_STATUS)===!1?(rt=!1,console.error("THREE.WebGLProgram: shader error: ",u.getError(),"gl.VALIDATE_STATUS",u.getProgramParameter(f,u.VALIDATE_STATUS),"gl.getProgramInfoLog",y,k,d)):y!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",y):(k===""||d==="")&&(ut=!1),ut&&(this.diagnostics={runnable:rt,material:i,programLog:y,vertexShader:{log:k,prefix:p},fragmentShader:{log:d,prefix:b}}),u.deleteShader(c),u.deleteShader(l),this.getUniforms=function(){return nt===undefined&&(nt=new cr(u,f,n)),nt},this.getAttributes=function(){return g===undefined&&(g=lft(u,f)),g},this.destroy=function(){u.deleteProgram(f),this.program=undefined},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=ak++,this.code=t,this.usedTimes=1,this.program=f,this.vertexShader=c,this.fragmentShader=l,this}function hft(n,t){function e(n){var u=n.skeleton,i=u.bones;if(t.floatVertexTextures)return 1024;var f=t.maxVertexUniforms,e=Math.floor((f-20)/4),r=Math.min(e,i.length);return r<i.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+i.length+" bones. This GPU supports "+r+"."),0):r}function r(n,t){var i;return n?n.isTexture?i=n.encoding:n.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=n.texture.encoding):i=fs,i===fs&&t&&(i=ov),i}var i=[],f={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},u=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","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"];this.getParameters=function(i,u,o,s,h,c){var p=f[i.type],v=c.isSkinnedMesh?e(c):0,l=n.getPrecision(),a,y;return i.precision!==null&&(l=t.getMaxPrecision(i.precision),l!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",l,"instead.")),a=n.getRenderTarget(),y={shaderID:p,precision:l,supportsVertexTextures:t.vertexTextures,outputEncoding:r(a?a.texture:null,n.gammaOutput),map:!!i.map,mapEncoding:r(i.map,n.gammaInput),envMap:!!i.envMap,envMapMode:i.envMap&&i.envMap.mapping,envMapEncoding:r(i.envMap,n.gammaInput),envMapCubeUV:!!i.envMap&&(i.envMap.mapping===wc||i.envMap.mapping===al),lightMap:!!i.lightMap,aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:r(i.emissiveMap,n.gammaInput),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,displacementMap:!!i.displacementMap,roughnessMap:!!i.roughnessMap,metalnessMap:!!i.metalnessMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,gradientMap:!!i.gradientMap,combine:i.combine,vertexColors:i.vertexColors,fog:!!o,useFog:i.fog,fogExp:o&&o.isFogExp2,flatShading:i.shading===yv,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:t.logarithmicDepthBuffer,skinning:i.skinning&&v>0,maxBones:v,useVertexTexture:t.floatVertexTextures,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:n.maxMorphTargets,maxMorphNormals:n.maxMorphNormals,numDirLights:u.directional.length,numPointLights:u.point.length,numSpotLights:u.spot.length,numRectAreaLights:u.rectArea.length,numHemiLights:u.hemi.length,numClippingPlanes:s,numClipIntersection:h,dithering:i.dithering,shadowMapEnabled:n.shadowMap.enabled&&c.receiveShadow&&u.shadows.length>0,shadowMapType:n.shadowMap.type,toneMapping:n.toneMapping,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===pu,flipSided:i.side===ir,depthPacking:i.depthPacking!==undefined?i.depthPacking:!1},y},this.getProgramCode=function(n,t){var i=[],f,r;if(t.shaderID?i.push(t.shaderID):(i.push(n.fragmentShader),i.push(n.vertexShader)),n.defines!==undefined)for(f in n.defines)i.push(f),i.push(n.defines[f]);for(r=0;r<u.length;r++)i.push(t[u[r]]);return i.join()},this.acquireProgram=function(t,r,u){for(var f,o,e=0,s=i.length;e<s;e++)if(o=i[e],o.code===u){f=o,++f.usedTimes;break}return f===undefined&&(f=new cft(n,u,t,r),i.push(f)),f},this.releaseProgram=function(n){if(--n.usedTimes==0){var t=i.indexOf(n);i[t]=i[i.length-1],i.pop(),n.destroy()}},this.programs=i}function sft(n,t,i,r,u,f,e){function w(n,t){var r,i,u;return n.width>t||n.height>t?(r=t/Math.max(n.width,n.height),i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),i.width=Math.floor(n.width*r),i.height=Math.floor(n.height*r),u=i.getContext("2d"),u.drawImage(n,0,0,n.width,n.height,0,0,i.width,i.height),console.warn("THREE.WebGLRenderer: image is too big ("+n.width+"x"+n.height+"). Resized to "+i.width+"x"+i.height,n),i):n}function o(n){return c.isPowerOfTwo(n.width)&&c.isPowerOfTwo(n.height)}function k(n){var t,i;return n instanceof HTMLImageElement||n instanceof HTMLCanvasElement?(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t.width=c.nearestPowerOfTwo(n.width),t.height=c.nearestPowerOfTwo(n.height),i=t.getContext("2d"),i.drawImage(n,0,0,t.width,t.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+n.width+"x"+n.height+"). Resized to "+t.width+"x"+t.height,n),t):n}function ft(n){return n.wrapS!==ct||n.wrapT!==ct||n.minFilter!==at&&n.minFilter!==ot}function l(t){return t===at||t===hl||t===sl?n.NEAREST:n.LINEAR}function h(n){var t=n.target;t.removeEventListener("dispose",h),rt(t),e.textures--}function a(n){var t=n.target;t.removeEventListener("dispose",a),it(t),e.textures--}function rt(t){var i=r.get(t);if(t.image&&i.__image__webglTextureCube)n.deleteTexture(i.__image__webglTextureCube);else{if(i.__webglInit===undefined)return;n.deleteTexture(i.__webglTexture)}r.remove(t)}function it(t){var i=r.get(t),f=r.get(t.texture),u;if(t){if(f.__webglTexture!==undefined&&n.deleteTexture(f.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(u=0;u<6;u++)n.deleteFramebuffer(i.__webglFramebuffer[u]),i.__webglDepthbuffer&&n.deleteRenderbuffer(i.__webglDepthbuffer[u]);else n.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&n.deleteRenderbuffer(i.__webglDepthbuffer);r.remove(t.texture),r.remove(t)}}function p(t,u){var f=r.get(t),e;if(t.version>0&&f.__version!==t.version)if(e=t.image,e===undefined)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else if(e.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t);else{nt(f,t,u);return}i.activeTexture(n.TEXTURE0+u),i.bindTexture(n.TEXTURE_2D,f.__webglTexture)}function tt(t,c){var p=r.get(t),l,y,g,b,it;if(t.image.length===6)if(t.version>0&&p.__version!==t.version){p.__image__webglTextureCube||(t.addEventListener("dispose",h),p.__image__webglTextureCube=n.createTexture(),e.textures++),i.activeTexture(n.TEXTURE0+c),i.bindTexture(n.TEXTURE_CUBE_MAP,p.__image__webglTextureCube),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t.flipY);var nt=t&&t.isCompressedTexture,k=t.image[0]&&t.image[0].isDataTexture,a=[];for(l=0;l<6;l++)a[l]=nt||k?k?t.image[l].image:t.image[l]:w(t.image[l],u.maxCubemapSize);var rt=a[0],tt=o(rt),v=f(t.format),d=f(t.type);for(s(n.TEXTURE_CUBE_MAP,t,tt),l=0;l<6;l++)if(nt)for(g=a[l].mipmaps,b=0,it=g.length;b<it;b++)y=g[b],t.format!==fi&&t.format!==he?i.getCompressedTextureFormats().indexOf(v)>-1?i.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+l,b,v,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+l,b,v,y.width,y.height,0,v,d,y.data);else k?i.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,v,a[l].width,a[l].height,0,v,d,a[l].data):i.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,v,v,d,a[l]);if(t.generateMipmaps&&tt&&n.generateMipmap(n.TEXTURE_CUBE_MAP),p.__version=t.version,t.onUpdate)t.onUpdate(t)}else i.activeTexture(n.TEXTURE0+c),i.bindTexture(n.TEXTURE_CUBE_MAP,p.__image__webglTextureCube)}function et(t,u){i.activeTexture(n.TEXTURE0+u),i.bindTexture(n.TEXTURE_CUBE_MAP,r.get(t).__webglTexture)}function s(i,e,o){var s;if(o?(n.texParameteri(i,n.TEXTURE_WRAP_S,f(e.wrapS)),n.texParameteri(i,n.TEXTURE_WRAP_T,f(e.wrapT)),n.texParameteri(i,n.TEXTURE_MAG_FILTER,f(e.magFilter)),n.texParameteri(i,n.TEXTURE_MIN_FILTER,f(e.minFilter))):(n.texParameteri(i,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(i,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(e.wrapS!==ct||e.wrapT!==ct)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",e),n.texParameteri(i,n.TEXTURE_MAG_FILTER,l(e.magFilter)),n.texParameteri(i,n.TEXTURE_MIN_FILTER,l(e.minFilter)),e.minFilter!==at&&e.minFilter!==ot&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",e)),s=t.get("EXT_texture_filter_anisotropic"),s){if(e.type===kf&&t.get("OES_texture_float_linear")===null)return;if(e.type===ul&&t.get("OES_texture_half_float_linear")===null)return;(e.anisotropy>1||r.get(e).__currentAnisotropy)&&(n.texParameterf(i,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,u.getMaxAnisotropy())),r.get(e).__currentAnisotropy=e.anisotropy)}}function nt(t,r,c){var y,v,p,g,l,nt;t.__webglInit===undefined&&(t.__webglInit=!0,r.addEventListener("dispose",h),t.__webglTexture=n.createTexture(),e.textures++),i.activeTexture(n.TEXTURE0+c),i.bindTexture(n.TEXTURE_2D,t.__webglTexture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,r.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,r.unpackAlignment),y=w(r.image,u.maxTextureSize),ft(r)&&o(y)===!1&&(y=k(y));var tt=o(y),a=f(r.format),d=f(r.type);if(s(n.TEXTURE_2D,r,tt),p=r.mipmaps,r.isDepthTexture){if(g=n.DEPTH_COMPONENT,r.type===kf){if(!b)throw new Error("Float Depth Texture only supported in WebGL2.0");g=n.DEPTH_COMPONENT32F}else b&&(g=n.DEPTH_COMPONENT16);r.format===ar&&g===n.DEPTH_COMPONENT&&r.type!==be&&r.type!==ba&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=be,d=f(r.type)),r.format===df&&(g=n.DEPTH_STENCIL,r.type!==yo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=yo,d=f(r.type))),i.texImage2D(n.TEXTURE_2D,0,g,y.width,y.height,0,a,d,null)}else if(r.isDataTexture)if(p.length>0&&tt){for(l=0,nt=p.length;l<nt;l++)v=p[l],i.texImage2D(n.TEXTURE_2D,l,a,v.width,v.height,0,a,d,v.data);r.generateMipmaps=!1}else i.texImage2D(n.TEXTURE_2D,0,a,y.width,y.height,0,a,d,y.data);else if(r.isCompressedTexture)for(l=0,nt=p.length;l<nt;l++)v=p[l],r.format!==fi&&r.format!==he?i.getCompressedTextureFormats().indexOf(a)>-1?i.compressedTexImage2D(n.TEXTURE_2D,l,a,v.width,v.height,0,v.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(n.TEXTURE_2D,l,a,v.width,v.height,0,a,d,v.data);else if(p.length>0&&tt){for(l=0,nt=p.length;l<nt;l++)v=p[l],i.texImage2D(n.TEXTURE_2D,l,a,a,d,v);r.generateMipmaps=!1}else i.texImage2D(n.TEXTURE_2D,0,a,a,d,y);if(r.generateMipmaps&&tt&&n.generateMipmap(n.TEXTURE_2D),t.__version=r.version,r.onUpdate)r.onUpdate(r)}function y(t,u,e,o){var s=f(u.texture.format),h=f(u.texture.type);i.texImage2D(o,0,s,u.width,u.height,0,s,h,null),n.bindFramebuffer(n.FRAMEBUFFER,t),n.framebufferTexture2D(n.FRAMEBUFFER,e,o,r.get(u.texture).__webglTexture,0),n.bindFramebuffer(n.FRAMEBUFFER,null)}function v(t,i){n.bindRenderbuffer(n.RENDERBUFFER,t),i.depthBuffer&&!i.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,i.width,i.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t)):i.depthBuffer&&i.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,i.width,i.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,t)):n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,i.width,i.height),n.bindRenderbuffer(n.RENDERBUFFER,null)}function g(t,i){var f=i&&i.isWebGLRenderTargetCube,u;if(f)throw new Error("Depth Texture with cube render targets is not supported!");if(n.bindFramebuffer(n.FRAMEBUFFER,t),!(i.depthTexture&&i.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),p(i.depthTexture,0),u=r.get(i.depthTexture).__webglTexture,i.depthTexture.format===ar)n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,u,0);else if(i.depthTexture.format===df)n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,u,0);else throw new Error("Unknown depthTexture format");}function d(t){var i=r.get(t),f=t.isWebGLRenderTargetCube===!0,u;if(t.depthTexture){if(f)throw new Error("target.depthTexture not supported in Cube render targets");g(i.__webglFramebuffer,t)}else if(f)for(i.__webglDepthbuffer=[],u=0;u<6;u++)n.bindFramebuffer(n.FRAMEBUFFER,i.__webglFramebuffer[u]),i.__webglDepthbuffer[u]=n.createRenderbuffer(),v(i.__webglDepthbuffer[u],t);else n.bindFramebuffer(n.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=n.createRenderbuffer(),v(i.__webglDepthbuffer,t);n.bindFramebuffer(n.FRAMEBUFFER,null)}function ut(t){var f=r.get(t),c=r.get(t.texture),l,h,u;if(t.addEventListener("dispose",a),c.__webglTexture=n.createTexture(),e.textures++,l=t.isWebGLRenderTargetCube===!0,h=o(t),l)for(f.__webglFramebuffer=[],u=0;u<6;u++)f.__webglFramebuffer[u]=n.createFramebuffer();else f.__webglFramebuffer=n.createFramebuffer();if(l){for(i.bindTexture(n.TEXTURE_CUBE_MAP,c.__webglTexture),s(n.TEXTURE_CUBE_MAP,t.texture,h),u=0;u<6;u++)y(f.__webglFramebuffer[u],t,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+u);t.texture.generateMipmaps&&h&&n.generateMipmap(n.TEXTURE_CUBE_MAP),i.bindTexture(n.TEXTURE_CUBE_MAP,null)}else i.bindTexture(n.TEXTURE_2D,c.__webglTexture),s(n.TEXTURE_2D,t.texture,h),y(f.__webglFramebuffer,t,n.COLOR_ATTACHMENT0,n.TEXTURE_2D),t.texture.generateMipmaps&&h&&n.generateMipmap(n.TEXTURE_2D),i.bindTexture(n.TEXTURE_2D,null);t.depthBuffer&&d(t)}function st(t){var u=t.texture,f,e;u.generateMipmaps&&o(t)&&u.minFilter!==at&&u.minFilter!==ot&&(f=t&&t.isWebGLRenderTargetCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D,e=r.get(u).__webglTexture,i.bindTexture(f,e),n.generateMipmap(f),i.bindTexture(f,null))}var b=typeof WebGL2RenderingContext!="undefined"&&n instanceof WebGL2RenderingContext;this.setTexture2D=p,this.setTextureCube=tt,this.setTextureCubeDynamic=et,this.setupRenderTarget=ut,this.updateRenderTargetMipmap=st}function oft(){function t(t){var r=t.uuid,i=n[r];return i===undefined&&(i={},n[r]=i),i}function i(t){delete n[t.uuid]}function r(){n={}}var n={};return{get:t,remove:i,clear:r}}function eft(n,t,i){function bi(){var t=!1,i=new y,r=null,u=new y;return{setMask:function(i){r===i||t||(n.colorMask(i,i,i,i),r=i)},setLocked:function(n){t=n},setClear:function(t,r,f,e,o){o===!0&&(t*=e,r*=e,f*=e),i.set(t,r,f,e),u.equals(i)===!1&&(n.clearColor(t,r,f,e),u.copy(i))},reset:function(){t=!1,r=null,u.set(0,0,0,1)}}}function wi(){var t=!1,i=null,u=null,e=null;return{setTest:function(t){t?r(n.DEPTH_TEST):f(n.DEPTH_TEST)},setMask:function(r){i===r||t||(n.depthMask(r),i=r)},setFunc:function(t){if(u!==t){if(t)switch(t){case eb:n.depthFunc(n.NEVER);break;case fk:n.depthFunc(n.ALWAYS);break;case pk:n.depthFunc(n.LESS);break;case sc:n.depthFunc(n.LEQUAL);break;case kk:n.depthFunc(n.EQUAL);break;case vp:n.depthFunc(n.GEQUAL);break;case ck:n.depthFunc(n.GREATER);break;case yk:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}else n.depthFunc(n.LEQUAL);u=t}},setLocked:function(n){t=n},setClear:function(t){e!==t&&(n.clearDepth(t),e=t)},reset:function(){t=!1,i=null,u=null,e=null}}}function pi(){var t=!1,i=null,u=null,e=null,o=null,s=null,h=null,c=null,l=null;return{setTest:function(t){t?r(n.STENCIL_TEST):f(n.STENCIL_TEST)},setMask:function(r){i===r||t||(n.stencilMask(r),i=r)},setFunc:function(t,i,r){(u!==t||e!==i||o!==r)&&(n.stencilFunc(t,i,r),u=t,e=i,o=r)},setOp:function(t,i,r){(s!==t||h!==i||c!==r)&&(n.stencilOp(t,i,r),s=t,h=i,c=r)},setLocked:function(n){t=n},setClear:function(t){l!==t&&(n.clearStencil(t),l=t)},reset:function(){t=!1,i=null,u=null,e=null,o=null,s=null,h=null,c=null,l=null}}}function lt(t,i,r){var e=new Uint8Array(4),f=n.createTexture(),u;for(n.bindTexture(t,f),n.texParameteri(t,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(t,n.TEXTURE_MAG_FILTER,n.NEAREST),u=0;u<r;u++)n.texImage2D(i+u,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,e);return f}function li(){v.setClear(0,0,0,1),e.setClear(1),p.setClear(0),r(n.DEPTH_TEST),e.setFunc(sc),w(!1),ht(lo),r(n.CULL_FACE),r(n.BLEND),a(ce)}function ci(){for(var n=0,t=c.length;n<t;n++)c[n]=0}function hi(i){if(c[i]=1,u[i]===0&&(n.enableVertexAttribArray(i),u[i]=1),l[i]!==0){var r=t.get("ANGLE_instanced_arrays");r.vertexAttribDivisorANGLE(i,0),l[i]=0}}function si(i,r){if(c[i]=1,u[i]===0&&(n.enableVertexAttribArray(i),u[i]=1),l[i]!==r){var f=t.get("ANGLE_instanced_arrays");f.vertexAttribDivisorANGLE(i,r),l[i]=r}}function oi(){for(var t=0,i=u.length;t!==i;++t)u[t]!==c[t]&&(n.disableVertexAttribArray(t),u[t]=0)}function r(t){h[t]!==!0&&(n.enable(t),h[t]=!0)}function f(t){h[t]!==!1&&(n.disable(t),h[t]=!1)}function ki(){var r,i;if(s===null&&(s=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")))for(r=n.getParameter(n.COMPRESSED_TEXTURE_FORMATS),i=0;i<r.length;i++)s.push(r[i]);return s}function a(t,u,e,o,s,h,c,l){t!==cc?r(n.BLEND):f(n.BLEND),(t!==it||l!==st)&&(t===aa?l?(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ONE,n.ONE,n.ONE,n.ONE)):(n.blendEquation(n.FUNC_ADD),n.blendFunc(n.SRC_ALPHA,n.ONE)):t===sv?l?(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ZERO,n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ONE_MINUS_SRC_ALPHA)):(n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ZERO,n.ONE_MINUS_SRC_COLOR)):t===hv?l?(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA)):(n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ZERO,n.SRC_COLOR)):l?(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA)):(n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA)),it=t,st=l),t===cv?(s=s||u,h=h||e,c=c||o,(u!==ut||s!==rt)&&(n.blendEquationSeparate(i(u),i(s)),ut=u,rt=s),(e!==ot||o!==ft||h!==et||c!==nt)&&(n.blendFuncSeparate(i(e),i(o),i(h),i(c)),ot=e,ft=o,et=h,nt=c)):(ut=null,ot=null,ft=null,rt=null,et=null,nt=null)}function ti(t){t.side===pu?f(n.CULL_FACE):r(n.CULL_FACE),w(t.side===ir),t.transparent===!0?a(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):a(cc),e.setFunc(t.depthFunc),e.setTest(t.depthTest),e.setMask(t.depthWrite),v.setMask(t.colorWrite),ct(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function w(t){tt!==t&&(t?n.frontFace(n.CW):n.frontFace(n.CCW),tt=t)}function ht(t){t!==gp?(r(n.CULL_FACE),t!==g&&(t===lo?n.cullFace(n.BACK):t===iy?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):f(n.CULL_FACE),g=t}function ni(t){t!==kt&&(ai&&n.lineWidth(t),kt=t)}function ct(t,i,u){t?(r(n.POLYGON_OFFSET_FILL),(bt!==i||wt!==u)&&(n.polygonOffset(i,u),bt=i,wt=u)):f(n.POLYGON_OFFSET_FILL)}function gt(){return pt}function dt(t){pt=t,t?r(n.SCISSOR_TEST):f(n.SCISSOR_TEST)}function yt(t){t===undefined&&(t=n.TEXTURE0+yi-1),o!==t&&(n.activeTexture(t),o=t)}function fi(t,i){o===null&&yt();var r=k[o];r===undefined&&(r={type:undefined,texture:undefined},k[o]=r),(r.type!==t||r.texture!==i)&&(n.bindTexture(t,i||b[t]),r.type=t,r.texture=i)}function ui(){try{n.compressedTexImage2D.apply(n,arguments)}catch(t){console.error(t)}}function ii(){try{n.texImage2D.apply(n,arguments)}catch(t){console.error(t)}}function ri(t){vt.equals(t)===!1&&(n.scissor(t.x,t.y,t.z,t.w),vt.copy(t))}function vi(t){at.equals(t)===!1&&(n.viewport(t.x,t.y,t.z,t.w),at.copy(t))}function di(){for(var t=0;t<u.length;t++)u[t]===1&&(n.disableVertexAttribArray(t),u[t]=0);h={},s=null,o=null,k={},it=null,tt=null,g=null,v.reset(),e.reset(),p.reset()}var v=new bi,e=new wi,p=new pi,d=n.getParameter(n.MAX_VERTEX_ATTRIBS),c=new Uint8Array(d),u=new Uint8Array(d),l=new Uint8Array(d),h={},s=null,it=null,ut=null,ot=null,ft=null,rt=null,et=null,nt=null,st=!1,tt=null,g=null,kt=null,bt=null,wt=null,pt=null,yi=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),ei=parseFloat(/^WebGL\ ([0-9])/.exec(n.getParameter(n.VERSION))[1]),ai=parseFloat(ei)>=1,o=null,k={},vt=new y,at=new y,b={};return b[n.TEXTURE_2D]=lt(n.TEXTURE_2D,n.TEXTURE_2D,1),b[n.TEXTURE_CUBE_MAP]=lt(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),{buffers:{color:v,depth:e,stencil:p},init:li,initAttributes:ci,enableAttribute:hi,enableAttributeAndDivisor:si,disableUnusedAttributes:oi,enable:r,disable:f,getCompressedTextureFormats:ki,setBlending:a,setMaterial:ti,setFlipSided:w,setCullFace:ht,setLineWidth:ni,setPolygonOffset:ct,getScissorTest:gt,setScissorTest:dt,activeTexture:yt,bindTexture:fi,compressedTexImage2D:ui,texImage2D:ii,scissor:ri,viewport:vi,reset:di}}function fft(n,t,i){function b(){if(r!==undefined)return r;var i=t.get("EXT_texture_filter_anisotropic");return r=i!==null?n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function o(t){if(t==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return t==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var r,u=i.precision!==undefined?i.precision:"highp",f=o(u);f!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",f,"instead."),u=f);var w=i.logarithmicDepthBuffer===!0&&!!t.get("EXT_frag_depth"),v=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),k=n.getParameter(n.MAX_VERTEX_ATTRIBS),a=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),l=n.getParameter(n.MAX_VARYING_VECTORS),c=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),e=h>0,s=!!t.get("OES_texture_float"),d=e&&s;return{getMaxAnisotropy:b,getMaxPrecision:o,precision:u,logarithmicDepthBuffer:w,maxTextures:v,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:y,maxAttributes:k,maxVertexUniforms:a,maxVaryings:l,maxFragmentUniforms:c,vertexTextures:e,floatFragmentTextures:s,floatVertexTextures:d}}function tn(n){var t={};return{get:function(i){if(t[i]!==undefined)return t[i];var r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=n.getExtension("WEBGL_compressed_texture_etc1");break;default:r=n.getExtension(i)}return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),t[i]=r,r}}}function utt(){function h(){n.value!==r&&(n.value=r,n.needsUpdate=t>0),f.numPlanes=t,f.numIntersection=0}function u(t,i,r,u){var h=t!==null?t.length:0,e=null,a,v,c,l;if(h!==0){if(e=n.value,u!==!0||e===null)for(a=r+h*4,v=i.matrixWorldInverse,s.getNormalMatrix(v),(e===null||e.length<a)&&(e=new Float32Array(a)),c=0,l=r;c!==h;++c,l+=4)o.copy(t[c]).applyMatrix4(v,s),o.normal.toArray(e,l),e[l+3]=o.constant;n.value=e,n.needsUpdate=!0}return f.numPlanes=h,e}var f=this,r=null,t=0,e=!1,i=!1,o=new bt,s=new ti,n={value:null,needsUpdate:!1};this.uniform=n,this.numPlanes=0,this.numIntersection=0,this.init=function(n,i,f){var o=n.length!==0||i||t!==0||e;return e=i,r=u(n,f,0),t=n.length,o},this.beginShadows=function(){i=!0,u(null)},this.endShadows=function(){i=!1,h()},this.setState=function(f,o,s,c,l,a){var v;if(e&&f!==null&&f.length!==0&&(!i||s)){var p=i?0:t,w=p*4,y=l.clippingState||null;for(n.value=y,y=u(f,c,w,a),v=0;v!==w;++v)y[v]=r[v];l.clippingState=y,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=p}else i?u(null):h()}}function ra(n){function hu(){return hr===null?a:1}function su(){u.init(),u.scissor(li.copy(ki).multiplyScalar(a)),u.viewport(gt.copy(ii).multiplyScalar(a)),u.buffers.color.setClear(v.r,v.g,v.b,vt,dt)}function wu(){ur=null,pt=null,ei="",ui=-1,u.reset()}function br(n){n.preventDefault(),wu(),su(),p.clear(),ti.clear()}function kr(n){var t=n.target;t.removeEventListener("dispose",kr),lf(t)}function lf(n){dr(n),p.remove(n)}function dr(n){var t=p.get(n).program;n.program=undefined,t!==undefined&&ri.releaseProgram(t)}function cf(n,t,i){n.render(function(n){l.renderBufferImmediate(n,t,i)})}function hf(n,t){return Math.abs(t[0])-Math.abs(n[0])}function sf(n,t,r,f){var l,e,o,h;if(r&&r.isInstancedBufferGeometry&&s.get("ANGLE_instanced_arrays")===null){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}f===undefined&&(f=0),u.initAttributes();var nt=r.attributes,g=t.getAttributes(),p=n.defaultAttributeValues;for(l in g)if(e=g[l],e>=0)if(o=nt[l],o!==undefined){var w=o.normalized,a=o.itemSize,v=vi.get(o),b=v.buffer,k=v.type,y=v.bytesPerElement;if(o.isInterleavedBufferAttribute){var c=o.data,d=c.stride,tt=o.offset;c&&c.isInstancedInterleavedBuffer?(u.enableAttributeAndDivisor(e,c.meshPerAttribute),r.maxInstancedCount===undefined&&(r.maxInstancedCount=c.meshPerAttribute*c.count)):u.enableAttribute(e),i.bindBuffer(i.ARRAY_BUFFER,b),i.vertexAttribPointer(e,a,k,w,d*y,(f*d+tt)*y)}else o.isInstancedBufferAttribute?(u.enableAttributeAndDivisor(e,o.meshPerAttribute),r.maxInstancedCount===undefined&&(r.maxInstancedCount=o.meshPerAttribute*o.count)):u.enableAttribute(e),i.bindBuffer(i.ARRAY_BUFFER,b),i.vertexAttribPointer(e,a,k,w,0,f*a*y)}else if(p!==undefined&&(h=p[l],h!==undefined))switch(h.length){case 2:i.vertexAttrib2fv(e,h);break;case 3:i.vertexAttrib3fv(e,h);break;case 4:i.vertexAttrib4fv(e,h);break;default:i.vertexAttrib1fv(e,h)}u.disableUnusedAttributes()}function tu(n,t,i){var l,f,u,s,h,o,c,r,e;if(n.visible){if(l=n.layers.test(t.layers),l)if(n.isLight)lt.push(n);else if(n.isSprite)(!n.frustumCulled||lr.intersectsSprite(n))&&gi.push(n);else if(n.isLensFlare)sr.push(n);else if(n.isImmediateRenderObject)i&&d.setFromMatrixPosition(n.matrixWorld).applyMatrix4(ci),g.push(n,null,n.material,d.z,null);else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.update(),!n.frustumCulled||lr.intersectsObject(n)))if(i&&d.setFromMatrixPosition(n.matrixWorld).applyMatrix4(ci),f=ti.update(n),u=n.material,Array.isArray(u))for(s=f.groups,r=0,e=s.length;r<e;r++)h=s[r],o=u[h.materialIndex],o&&o.visible&&g.push(n,f,o,d.z,h);else u.visible&&g.push(n,f,u,d.z,null);for(c=n.children,r=0,e=c.length;r<e;r++)tu(c[r],t,i)}}function yi(n,t,i,r){for(var y,v,b,p,u,f=0,w=n.length;f<w;f++){var e=n[f],o=e.object,s=e.geometry,h=r===undefined?e.material:r,c=e.group;o.onBeforeRender(l,t,i,s,h,c);if(i.isArrayCamera&&i.enabled)for(y=i.cameras,v=0,b=y.length;v<b;v++)p=y[v],u=p.bounds,l.setViewport(u.x*ht*a,u.y*tt*a,u.z*ht*a,u.w*tt*a),l.setScissor(u.x*ht*a,u.y*tt*a,u.z*ht*a,u.w*tt*a),l.setScissorTest(!0),iu(o,t,p,s,h,c);else iu(o,t,i,s,h,c);o.onAfterRender(l,t,i,s,h,c)}}function iu(n,t,i,r,f,e){if(n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld),n.normalMatrix.getNormalMatrix(n.modelViewMatrix),n.isImmediateRenderObject){u.setMaterial(f);var o=nu(i,t.fog,f,n);ei="",cf(n,o,f)}else l.renderBufferDirect(i,t.fog,r,f,n,e)}function fr(n,t,i){var f=p.get(n),s=ri.getParameters(n,r,t,b.numPlanes,b.numIntersection,i),a=ri.getProgramCode(n,s),o=f.program,v=!0,h,c,e,u,y,w;if(o===undefined)n.addEventListener("dispose",kr);else if(o.code!==a)dr(n);else{if(s.shaderID!==undefined)return;v=!1}if(v&&(s.shaderID?(h=nr[s.shaderID],f.__webglShader={name:n.type,uniforms:et.clone(h.uniforms),vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}):f.__webglShader={name:n.type,uniforms:n.uniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader},n.__webglShader=f.__webglShader,o=ri.acquireProgram(n,s,a),f.program=o,n.program=o),c=o.getAttributes(),n.morphTargets)for(n.numSupportedMorphTargets=0,e=0;e<l.maxMorphTargets;e++)c["morphTarget"+e]>=0&&n.numSupportedMorphTargets++;if(n.morphNormals)for(n.numSupportedMorphNormals=0,e=0;e<l.maxMorphNormals;e++)c["morphNormal"+e]>=0&&n.numSupportedMorphNormals++;u=f.__webglShader.uniforms,(n.isShaderMaterial||n.isRawShaderMaterial)&&n.clipping!==!0||(f.numClippingPlanes=b.numPlanes,f.numIntersection=b.numIntersection,u.clippingPlanes=b.uniform),f.fog=t,f.lightsHash=r.hash,n.lights&&(u.ambientLightColor.value=r.ambient,u.directionalLights.value=r.directional,u.spotLights.value=r.spot,u.rectAreaLights.value=r.rectArea,u.pointLights.value=r.point,u.hemisphereLights.value=r.hemi,u.directionalShadowMap.value=r.directionalShadowMap,u.directionalShadowMatrix.value=r.directionalShadowMatrix,u.spotShadowMap.value=r.spotShadowMap,u.spotShadowMatrix.value=r.spotShadowMatrix,u.pointShadowMap.value=r.pointShadowMap,u.pointShadowMatrix.value=r.pointShadowMatrix),y=f.program.getUniforms(),w=cr.seqWithValue(y.seq,u),f.uniformsList=w}function nu(n,t,u,f){var s,ut,tt,a,rt,v,g,ft;di=0,s=p.get(u),hi&&(vr||n!==pt)&&(ut=n===pt&&u.id===ui,b.setState(u.clippingPlanes,u.clipIntersection,u.clipShadows,n,s,ut)),u.needsUpdate===!1&&(s.program===undefined?u.needsUpdate=!0:u.fog&&s.fog!==t?u.needsUpdate=!0:u.lights&&s.lightsHash!==r.hash?u.needsUpdate=!0:s.numClippingPlanes!==undefined&&(s.numClippingPlanes!==b.numPlanes||s.numIntersection!==b.numIntersection)&&(u.needsUpdate=!0)),u.needsUpdate&&(fr(u,t,f),u.needsUpdate=!1);var it=!1,w=!1,nt=!1,y=s.program,o=y.getUniforms(),e=s.__webglShader.uniforms;return y.id!==ur&&(i.useProgram(y.program),ur=y.id,it=!0,w=!0,nt=!0),u.id!==ui&&(ui=u.id,w=!0),(it||n!==pt)&&(o.setValue(i,"projectionMatrix",n.projectionMatrix),k.logarithmicDepthBuffer&&o.setValue(i,"logDepthBufFC",2/(Math.log(n.far+1)/Math.LN2)),n!==pt&&(pt=n,w=!0,nt=!0),(u.isShaderMaterial||u.isMeshPhongMaterial||u.isMeshStandardMaterial||u.envMap)&&(tt=o.map.cameraPosition,tt!==undefined&&tt.setValue(i,d.setFromMatrixPosition(n.matrixWorld))),(u.isMeshPhongMaterial||u.isMeshLambertMaterial||u.isMeshBasicMaterial||u.isMeshStandardMaterial||u.isShaderMaterial||u.skinning)&&o.setValue(i,"viewMatrix",n.matrixWorldInverse),o.setValue(i,"toneMappingExposure",l.toneMappingExposure),o.setValue(i,"toneMappingWhitePoint",l.toneMappingWhitePoint)),u.skinning&&(o.setOptional(i,f,"bindMatrix"),o.setOptional(i,f,"bindMatrixInverse"),a=f.skeleton,a&&(rt=a.bones,k.floatVertexTextures?(a.boneTexture===undefined&&(v=Math.sqrt(rt.length*4),v=c.nextPowerOfTwo(Math.ceil(v)),v=Math.max(v,4),g=new Float32Array(v*v*4),g.set(a.boneMatrices),ft=new fu(g,v,v,fi,kf),a.boneMatrices=g,a.boneTexture=ft,a.boneTextureSize=v),o.setValue(i,"boneTexture",a.boneTexture),o.setValue(i,"boneTextureSize",a.boneTextureSize)):o.setOptional(i,a,"boneMatrices"))),w&&(u.lights&&tf(e,nt),t&&u.fog&&uf(e,t),(u.isMeshBasicMaterial||u.isMeshLambertMaterial||u.isMeshPhongMaterial||u.isMeshStandardMaterial||u.isMeshNormalMaterial||u.isMeshDepthMaterial)&&of(e,u),u.isLineBasicMaterial?pu(e,u):u.isLineDashedMaterial?(pu(e,u),ef(e,u)):u.isPointsMaterial?gf(e,u):u.isMeshLambertMaterial?rf(e,u):u.isMeshToonMaterial?du(e,u):u.isMeshPhongMaterial?gr(e,u):u.isMeshPhysicalMaterial?ku(e,u):u.isMeshStandardMaterial?uu(e,u):u.isMeshDepthMaterial?u.displacementMap&&(e.displacementMap.value=u.displacementMap,e.displacementScale.value=u.displacementScale,e.displacementBias.value=u.displacementBias):u.isMeshNormalMaterial&&gu(e,u),e.ltcMat!==undefined&&(e.ltcMat.value=h.LTC_MAT_TEXTURE),e.ltcMag!==undefined&&(e.ltcMag.value=h.LTC_MAG_TEXTURE),cr.upload(i,s.uniformsList,e,l)),o.setValue(i,"modelViewMatrix",f.modelViewMatrix),o.setValue(i,"normalMatrix",f.normalMatrix),o.setValue(i,"modelMatrix",f.matrixWorld),y}function of(n,t){var i,r,u;n.opacity.value=t.opacity,n.diffuse.value=t.color,t.emissive&&n.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),n.map.value=t.map,n.specularMap.value=t.specularMap,n.alphaMap.value=t.alphaMap,t.lightMap&&(n.lightMap.value=t.lightMap,n.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(n.aoMap.value=t.aoMap,n.aoMapIntensity.value=t.aoMapIntensity),t.map?i=t.map:t.specularMap?i=t.specularMap:t.displacementMap?i=t.displacementMap:t.normalMap?i=t.normalMap:t.bumpMap?i=t.bumpMap:t.roughnessMap?i=t.roughnessMap:t.metalnessMap?i=t.metalnessMap:t.alphaMap?i=t.alphaMap:t.emissiveMap&&(i=t.emissiveMap),i!==undefined&&(i.isWebGLRenderTarget&&(i=i.texture),r=i.offset,u=i.repeat,n.offsetRepeat.value.set(r.x,r.y,u.x,u.y)),n.envMap.value=t.envMap,n.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,n.reflectivity.value=t.reflectivity,n.refractionRatio.value=t.refractionRatio}function pu(n,t){n.diffuse.value=t.color,n.opacity.value=t.opacity}function ef(n,t){n.dashSize.value=t.dashSize,n.totalSize.value=t.dashSize+t.gapSize,n.scale.value=t.scale}function gf(n,t){if(n.diffuse.value=t.color,n.opacity.value=t.opacity,n.size.value=t.size*a,n.scale.value=tt*.5,n.map.value=t.map,t.map!==null){var i=t.map.offset,r=t.map.repeat;n.offsetRepeat.value.set(i.x,i.y,r.x,r.y)}}function uf(n,t){n.fogColor.value=t.color,t.isFog?(n.fogNear.value=t.near,n.fogFar.value=t.far):t.isFogExp2&&(n.fogDensity.value=t.density)}function rf(n,t){t.emissiveMap&&(n.emissiveMap.value=t.emissiveMap)}function gr(n,t){n.specular.value=t.specular,n.shininess.value=Math.max(t.shininess,.0001),t.emissiveMap&&(n.emissiveMap.value=t.emissiveMap),t.bumpMap&&(n.bumpMap.value=t.bumpMap,n.bumpScale.value=t.bumpScale),t.normalMap&&(n.normalMap.value=t.normalMap,n.normalScale.value.copy(t.normalScale)),t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias)}function du(n,t){gr(n,t),t.gradientMap&&(n.gradientMap.value=t.gradientMap)}function uu(n,t){n.roughness.value=t.roughness,n.metalness.value=t.metalness,t.roughnessMap&&(n.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(n.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(n.emissiveMap.value=t.emissiveMap),t.bumpMap&&(n.bumpMap.value=t.bumpMap,n.bumpScale.value=t.bumpScale),t.normalMap&&(n.normalMap.value=t.normalMap,n.normalScale.value.copy(t.normalScale)),t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias),t.envMap&&(n.envMapIntensity.value=t.envMapIntensity)}function ku(n,t){n.clearCoat.value=t.clearCoat,n.clearCoatRoughness.value=t.clearCoatRoughness,uu(n,t)}function gu(n,t){t.bumpMap&&(n.bumpMap.value=t.bumpMap,n.bumpScale.value=t.bumpScale),t.normalMap&&(n.normalMap.value=t.normalMap,n.normalScale.value.copy(t.normalScale)),t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias)}function tf(n,t){n.ambientLightColor.needsUpdate=t,n.directionalLights.needsUpdate=t,n.pointLights.needsUpdate=t,n.spotLights.needsUpdate=t,n.rectAreaLights.needsUpdate=t,n.hemisphereLights.needsUpdate=t}function nf(n){for(var i=0,u,t=0,f=n.length;t<f;t++)u=n[t],u.castShadow&&(r.shadows[i]=u,i++);r.shadows.length=i}function lu(n,t){for(var i,f,w=0,b=0,k=0,l,e,g,y,o=t.matrixWorldInverse,s=0,h=0,c=0,p=0,v=0,u,a=0,nt=n.length;a<nt;a++)i=n[a],l=i.color,e=i.intensity,g=i.distance,y=i.shadow&&i.shadow.map?i.shadow.map.texture:null,i.isAmbientLight?(w+=l.r*e,b+=l.g*e,k+=l.b*e):i.isDirectionalLight?(u=ni.get(i),u.color.copy(i.color).multiplyScalar(i.intensity),u.direction.setFromMatrixPosition(i.matrixWorld),d.setFromMatrixPosition(i.target.matrixWorld),u.direction.sub(d),u.direction.transformDirection(o),u.shadow=i.castShadow,i.castShadow&&(f=i.shadow,u.shadowBias=f.bias,u.shadowRadius=f.radius,u.shadowMapSize=f.mapSize),r.directionalShadowMap[s]=y,r.directionalShadowMatrix[s]=i.shadow.matrix,r.directional[s]=u,s++):i.isSpotLight?(u=ni.get(i),u.position.setFromMatrixPosition(i.matrixWorld),u.position.applyMatrix4(o),u.color.copy(l).multiplyScalar(e),u.distance=g,u.direction.setFromMatrixPosition(i.matrixWorld),d.setFromMatrixPosition(i.target.matrixWorld),u.direction.sub(d),u.direction.transformDirection(o),u.coneCos=Math.cos(i.angle),u.penumbraCos=Math.cos(i.angle*(1-i.penumbra)),u.decay=i.distance===0?0:i.decay,u.shadow=i.castShadow,i.castShadow&&(f=i.shadow,u.shadowBias=f.bias,u.shadowRadius=f.radius,u.shadowMapSize=f.mapSize),r.spotShadowMap[c]=y,r.spotShadowMatrix[c]=i.shadow.matrix,r.spot[c]=u,c++):i.isRectAreaLight?(u=ni.get(i),u.color.copy(l).multiplyScalar(e/(i.width*i.height)),u.position.setFromMatrixPosition(i.matrixWorld),u.position.applyMatrix4(o),ai.identity(),or.copy(i.matrixWorld),or.premultiply(o),ai.extractRotation(or),u.halfWidth.set(i.width*.5,0,0),u.halfHeight.set(0,i.height*.5,0),u.halfWidth.applyMatrix4(ai),u.halfHeight.applyMatrix4(ai),r.rectArea[p]=u,p++):i.isPointLight?(u=ni.get(i),u.position.setFromMatrixPosition(i.matrixWorld),u.position.applyMatrix4(o),u.color.copy(i.color).multiplyScalar(i.intensity),u.distance=i.distance,u.decay=i.distance===0?0:i.decay,u.shadow=i.castShadow,i.castShadow&&(f=i.shadow,u.shadowBias=f.bias,u.shadowRadius=f.radius,u.shadowMapSize=f.mapSize),r.pointShadowMap[h]=y,r.pointShadowMatrix[h]=i.shadow.matrix,r.point[h]=u,h++):i.isHemisphereLight&&(u=ni.get(i),u.direction.setFromMatrixPosition(i.matrixWorld),u.direction.transformDirection(o),u.direction.normalize(),u.skyColor.copy(i.color).multiplyScalar(e),u.groundColor.copy(i.groundColor).multiplyScalar(e),r.hemi[v]=u,v++);r.ambient[0]=w,r.ambient[1]=b,r.ambient[2]=k,r.directional.length=s,r.spot.length=c,r.rectArea.length=p,r.point.length=h,r.hemi.length=v,r.hash=s+","+h+","+c+","+p+","+v+","+r.shadows.length}function bu(){var n=di;return n>=k.maxTextures&&console.warn("WebGLRenderer: trying to use "+n+" texture units while this GPU supports only "+k.maxTextures),di+=1,n}function wt(n){var t;if(n===wi)return i.REPEAT;if(n===ct)return i.CLAMP_TO_EDGE;if(n===cu)return i.MIRRORED_REPEAT;if(n===at)return i.NEAREST;if(n===hl)return i.NEAREST_MIPMAP_NEAREST;if(n===sl)return i.NEAREST_MIPMAP_LINEAR;if(n===ot)return i.LINEAR;if(n===wa)return i.LINEAR_MIPMAP_NEAREST;if(n===eo)return i.LINEAR_MIPMAP_LINEAR;if(n===el)return i.UNSIGNED_BYTE;if(n===fw)return i.UNSIGNED_SHORT_4_4_4_4;if(n===ew)return i.UNSIGNED_SHORT_5_5_5_1;if(n===ow)return i.UNSIGNED_SHORT_5_6_5;if(n===tw)return i.BYTE;if(n===iw)return i.SHORT;if(n===be)return i.UNSIGNED_SHORT;if(n===rw)return i.INT;if(n===ba)return i.UNSIGNED_INT;if(n===kf)return i.FLOAT;if(n===ul&&(t=s.get("OES_texture_half_float"),t!==null))return t.HALF_FLOAT_OES;if(n===sw)return i.ALPHA;if(n===he)return i.RGB;if(n===fi)return i.RGBA;if(n===hw)return i.LUMINANCE;if(n===cw)return i.LUMINANCE_ALPHA;if(n===ar)return i.DEPTH_COMPONENT;if(n===df)return i.DEPTH_STENCIL;if(n===lv)return i.FUNC_ADD;if(n===ek)return i.FUNC_SUBTRACT;if(n===fb)return i.FUNC_REVERSE_SUBTRACT;if(n===ub)return i.ZERO;if(n===wb)return i.ONE;if(n===tk)return i.SRC_COLOR;if(n===ik)return i.ONE_MINUS_SRC_COLOR;if(n===oa)return i.SRC_ALPHA;if(n===sa)return i.ONE_MINUS_SRC_ALPHA;if(n===ud)return i.DST_ALPHA;if(n===db)return i.ONE_MINUS_DST_ALPHA;if(n===bb)return i.DST_COLOR;if(n===uk)return i.ONE_MINUS_DST_COLOR;if(n===cb)return i.SRC_ALPHA_SATURATE;if((n===da||n===ga||n===nv||n===tv)&&(t=s.get("WEBGL_compressed_texture_s3tc"),t!==null)){if(n===da)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===ga)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===nv)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===tv)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((n===iv||n===rv||n===uv||n===fv)&&(t=s.get("WEBGL_compressed_texture_pvrtc"),t!==null)){if(n===iv)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===rv)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===uv)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===fv)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===ww&&(t=s.get("WEBGL_compressed_texture_etc1"),t!==null))return t.COMPRESSED_RGB_ETC1_WEBGL;if((n===ia||n===dl)&&(t=s.get("EXT_blend_minmax"),t!==null)){if(n===ia)return t.MIN_EXT;if(n===dl)return t.MAX_EXT}return n===yo&&(t=s.get("WEBGL_depth_texture"),t!==null)?t.UNSIGNED_INT_24_8_WEBGL:0}var i,rr,s,ou,au,bi,bt,rt,st,tr,ru,yr;console.log("THREE.WebGLRenderer",lb),n=n||{};var w=n.canvas!==undefined?n.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),vf=n.context!==undefined?n.context:null,af=n.alpha!==undefined?n.alpha:!1,ff=n.depth!==undefined?n.depth:!0,bf=n.stencil!==undefined?n.stencil:!0,wf=n.antialias!==undefined?n.antialias:!1,dt=n.premultipliedAlpha!==undefined?n.premultipliedAlpha:!0,yf=n.preserveDrawingBuffer!==undefined?n.preserveDrawingBuffer:!1,lt=[],g=null,oi=new Float32Array(8),gi=[],sr=[];this.domElement=w,this.context=null,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=av,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var l=this,ur=null,hr=null,si=null,ui=-1,ei="",pt=null,li=new y,pi=null,gt=new y,di=0,v=new e(0),vt=0,ht=w.width,tt=w.height,a=1,ki=new y(0,0,ht,tt),eu=!1,ii=new y(0,0,ht,tt),lr=new lh,b=new utt,hi=!1,vr=!1,ci=new o,d=new t,or=new o,ai=new o,r={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},er={geometries:0,textures:0},it={frame:0,calls:0,vertices:0,faces:0,points:0};this.info={render:it,memory:er,programs:null};try{if(rr={alpha:af,depth:ff,stencil:bf,antialias:wf,premultipliedAlpha:dt,preserveDrawingBuffer:yf},i=vf||w.getContext("webgl",rr)||w.getContext("experimental-webgl",rr),i===null)if(w.getContext("webgl")!==null)throw"Error creating WebGL context with your selected attributes.";else throw"Error creating WebGL context.";i.getShaderPrecisionFormat===undefined&&(i.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),w.addEventListener("webglcontextlost",br,!1)}catch(ne){console.error("THREE.WebGLRenderer: "+ne)}s=new tn(i),s.get("WEBGL_depth_texture"),s.get("OES_texture_float"),s.get("OES_texture_float_linear"),s.get("OES_texture_half_float"),s.get("OES_texture_half_float_linear"),s.get("OES_standard_derivatives"),s.get("ANGLE_instanced_arrays"),s.get("OES_element_index_uint")&&(f.MaxIndex=4294967296);var k=new fft(i,s,n),u=new eft(i,s,wt),p=new oft,kt=new sft(i,s,u,p,k,wt,er),vi=new nn(i),yu=new dft(i,vi,er),ti=new bft(i,yu,it),ri=new hft(this,k),ni=new kft,vu=new tet;this.info.programs=ri.programs,ou=new gft(i,s,it),au=new net(i,s,it),su(),this.context=i,this.capabilities=k,this.extensions=s,this.properties=p,this.state=u,tr=new gb(this,r,ti,k),this.shadowMap=tr,ru=new rft(this,gi),yr=new ift(this,sr),this.getContext=function(){return i},this.getContextAttributes=function(){return i.getContextAttributes()},this.forceContextLoss=function(){var n=s.get("WEBGL_lose_context");n&&n.loseContext()},this.getMaxAnisotropy=function(){return k.getMaxAnisotropy()},this.getPrecision=function(){return k.precision},this.getPixelRatio=function(){return a},this.setPixelRatio=function(n){n!==undefined&&(a=n,this.setSize(ii.z,ii.w,!1))},this.getSize=function(){return{width:ht,height:tt}},this.setSize=function(n,t,i){ht=n,tt=t,w.width=n*a,w.height=t*a,i!==!1&&(w.style.width=n+"px",w.style.height=t+"px"),this.setViewport(0,0,n,t)},this.setViewport=function(n,t,i,r){u.viewport(ii.set(n,t,i,r))},this.setScissor=function(n,t,i,r){u.scissor(ki.set(n,t,i,r))},this.setScissorTest=function(n){u.setScissorTest(eu=n)},this.getClearColor=function(){return v},this.setClearColor=function(n,t){v.set(n),vt=t!==undefined?t:1,u.buffers.color.setClear(v.r,v.g,v.b,vt,dt)},this.getClearAlpha=function(){return vt},this.setClearAlpha=function(n){vt=n,u.buffers.color.setClear(v.r,v.g,v.b,vt,dt)},this.clear=function(n,t,r){var u=0;(n===undefined||n)&&(u|=i.COLOR_BUFFER_BIT),(t===undefined||t)&&(u|=i.DEPTH_BUFFER_BIT),(r===undefined||r)&&(u|=i.STENCIL_BUFFER_BIT),i.clear(u)},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.clearTarget=function(n,t,i,r){this.setRenderTarget(n),this.clear(t,i,r)},this.resetGLState=wu,this.dispose=function(){w.removeEventListener("webglcontextlost",br,!1),vu.dispose()},this.renderBufferImmediate=function(n,t,r){var o,s,f,a;if(u.initAttributes(),o=p.get(n),n.hasPositions&&!o.position&&(o.position=i.createBuffer()),n.hasNormals&&!o.normal&&(o.normal=i.createBuffer()),n.hasUvs&&!o.uv&&(o.uv=i.createBuffer()),n.hasColors&&!o.color&&(o.color=i.createBuffer()),s=t.getAttributes(),n.hasPositions&&(i.bindBuffer(i.ARRAY_BUFFER,o.position),i.bufferData(i.ARRAY_BUFFER,n.positionArray,i.DYNAMIC_DRAW),u.enableAttribute(s.position),i.vertexAttribPointer(s.position,3,i.FLOAT,!1,0,0)),n.hasNormals){if(i.bindBuffer(i.ARRAY_BUFFER,o.normal),!r.isMeshPhongMaterial&&!r.isMeshStandardMaterial&&!r.isMeshNormalMaterial&&r.shading===yv)for(f=0,a=n.count*3;f<a;f+=9){var e=n.normalArray,h=(e[f+0]+e[f+3]+e[f+6])/3,c=(e[f+1]+e[f+4]+e[f+7])/3,l=(e[f+2]+e[f+5]+e[f+8])/3;e[f+0]=h,e[f+1]=c,e[f+2]=l,e[f+3]=h,e[f+4]=c,e[f+5]=l,e[f+6]=h,e[f+7]=c,e[f+8]=l}i.bufferData(i.ARRAY_BUFFER,n.normalArray,i.DYNAMIC_DRAW),u.enableAttribute(s.normal),i.vertexAttribPointer(s.normal,3,i.FLOAT,!1,0,0)}n.hasUvs&&r.map&&(i.bindBuffer(i.ARRAY_BUFFER,o.uv),i.bufferData(i.ARRAY_BUFFER,n.uvArray,i.DYNAMIC_DRAW),u.enableAttribute(s.uv),i.vertexAttribPointer(vi.uv,2,i.FLOAT,!1,0,0)),n.hasColors&&r.vertexColors!==sh&&(i.bindBuffer(i.ARRAY_BUFFER,o.color),i.bufferData(i.ARRAY_BUFFER,n.colorArray,i.DYNAMIC_DRAW),u.enableAttribute(s.color),i.vertexAttribPointer(s.color,3,i.FLOAT,!1,0,0)),u.disableUnusedAttributes(),i.drawArrays(i.TRIANGLES,0,n.count),n.count=0},this.renderBufferDirect=function(n,t,r,f,e,o){var p,l,y,b,a,c,s,it,h,w,k;u.setMaterial(f);var nt=nu(n,t,f,e),ut=r.id+"_"+nt.id+"_"+(f.wireframe===!0),g=!1;if(ut!==ei&&(ei=ut,g=!0),p=e.morphTargetInfluences,p!==undefined){for(l=[],s=0,b=p.length;s<b;s++)a=p[s],l.push([a,s]);for(l.sort(hf),l.length>8&&(l.length=8),y=r.morphAttributes,s=0,b=l.length;s<b;s++)a=l[s],oi[s]=a[0],a[0]!==0?(c=a[1],f.morphTargets===!0&&y.position&&r.addAttribute("morphTarget"+s,y.position[c]),f.morphNormals===!0&&y.normal&&r.addAttribute("morphNormal"+s,y.normal[c])):(f.morphTargets===!0&&r.removeAttribute("morphTarget"+s),f.morphNormals===!0&&r.removeAttribute("morphNormal"+s));for(s=l.length,it=oi.length;s<it;s++)oi[s]=0;nt.getUniforms().setValue(i,"morphTargetInfluences",oi),g=!0}var c=r.index,rt=r.attributes.position,v=1;f.wireframe===!0&&(c=yu.getWireframeAttribute(r),v=2),h=ou,c!==null&&(h=au,h.setIndex(c)),g&&(sf(f,nt,r),c!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,vi.get(c).buffer)),w=0,c!==null?w=c.count:rt!==undefined&&(w=rt.count);var ft=r.drawRange.start*v,ot=r.drawRange.count*v,et=o!==null?o.start*v:0,st=o!==null?o.count*v:Infinity,tt=Math.max(ft,et),ht=Math.min(w,ft+ot,et+st)-1,d=Math.max(0,ht-tt+1);if(d!==0){if(e.isMesh)if(f.wireframe===!0)u.setLineWidth(f.wireframeLinewidth*hu()),h.setMode(i.LINES);else switch(e.drawMode){case ev:h.setMode(i.TRIANGLES);break;case nb:h.setMode(i.TRIANGLE_STRIP);break;case pp:h.setMode(i.TRIANGLE_FAN)}else e.isLine?(k=f.linewidth,k===undefined&&(k=1),u.setLineWidth(k*hu()),e.isLineSegments?h.setMode(i.LINES):e.isLineLoop?h.setMode(i.LINE_LOOP):h.setMode(i.LINE_STRIP)):e.isPoints&&h.setMode(i.POINTS);r&&r.isInstancedBufferGeometry?r.maxInstancedCount>0&&h.renderInstances(r,tt,d):h.render(tt,d)}},this.compile=function(n,t){lt=[],n.traverse(function(n){n.isLight&&lt.push(n)}),lu(lt,t),n.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var i=0;i<t.material.length;i++)fr(t.material[i],n.fog,t);else fr(t.material,n.fog,t)})},this.render=function(n,t,i,r){var f,e,o,s;if(t!==undefined&&t.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}ei="",ui=-1,pt=null,n.autoUpdate===!0&&n.updateMatrixWorld();t.onBeforeRender(l);t.parent===null&&t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),ci.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),lr.setFromMatrix(ci),lt.length=0,gi.length=0,sr.length=0,vr=this.localClippingEnabled,hi=b.init(this.clippingPlanes,vr,t),g=vu.get(n,t),g.init(),tu(n,t,l.sortObjects),g.finish(),l.sortObjects===!0&&g.sort(),hi&&b.beginShadows(),nf(lt),tr.render(n,t),lu(lt,t),hi&&b.endShadows(),it.frame++,it.calls=0,it.vertices=0,it.faces=0,it.points=0,i===undefined&&(i=null),this.setRenderTarget(i),f=n.background,f===null?u.buffers.color.setClear(v.r,v.g,v.b,vt,dt):f&&f.isColor&&(u.buffers.color.setClear(f.r,f.g,f.b,1,dt),r=!0),(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),f&&f.isCubeTexture?(rt===undefined&&(rt=new nt,st=new ut(new pr(5,5,5),new ft({uniforms:nr.cube.uniforms,vertexShader:nr.cube.vertexShader,fragmentShader:nr.cube.fragmentShader,side:ir,depthTest:!1,depthWrite:!1,fog:!1}))),rt.projectionMatrix.copy(t.projectionMatrix),rt.matrixWorld.extractRotation(t.matrixWorld),rt.matrixWorldInverse.getInverse(rt.matrixWorld),st.material.uniforms.tCube.value=f,st.modelViewMatrix.multiplyMatrices(rt.matrixWorldInverse,st.matrixWorld),ti.update(st),l.renderBufferDirect(rt,null,st.geometry,st.material,st,null)):f&&f.isTexture&&(bi===undefined&&(bi=new pf(-1,1,1,-1,0,1),bt=new ut(new wr(2,2),new yt({depthTest:!1,depthWrite:!1,fog:!1}))),bt.material.map=f,ti.update(bt),l.renderBufferDirect(bi,null,bt.geometry,bt.material,bt,null)),e=g.opaque,o=g.transparent,n.overrideMaterial?(s=n.overrideMaterial,e.length&&yi(e,n,t,s),o.length&&yi(o,n,t,s)):(e.length&&yi(e,n,t),o.length&&yi(o,n,t)),ru.render(n,t),yr.render(n,t,gt),i&&kt.updateRenderTargetMipmap(i),u.buffers.depth.setTest(!0),u.buffers.depth.setMask(!0),u.buffers.color.setMask(!0),t.isArrayCamera&&t.enabled&&l.setScissorTest(!1);t.onAfterRender(l)},this.setFaceCulling=function(n,t){u.setCullFace(n),u.setFlipSided(t===vb)},this.allocTextureUnit=bu,this.setTexture2D=function(){var n=!1;return function(t,i){t&&t.isWebGLRenderTarget&&(n||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),n=!0),t=t.texture),kt.setTexture2D(t,i)}}(),this.setTexture=function(){var n=!1;return function(t,i){n||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),n=!0),kt.setTexture2D(t,i)}}(),this.setTextureCube=function(){var n=!1;return function(t,i){t&&t.isWebGLRenderTargetCube&&(n||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),n=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&t.image.length===6?kt.setTextureCube(t,i):kt.setTextureCubeDynamic(t,i)}}(),this.getRenderTarget=function(){return hr},this.setRenderTarget=function(n){var r,t,f,e;hr=n,n&&p.get(n).__webglFramebuffer===undefined&&kt.setupRenderTarget(n),r=n&&n.isWebGLRenderTargetCube,n?(f=p.get(n),t=r?f.__webglFramebuffer[n.activeCubeFace]:f.__webglFramebuffer,li.copy(n.scissor),pi=n.scissorTest,gt.copy(n.viewport)):(t=null,li.copy(ki).multiplyScalar(a),pi=eu,gt.copy(ii).multiplyScalar(a)),si!==t&&(i.bindFramebuffer(i.FRAMEBUFFER,t),si=t),u.scissor(li),u.setScissorTest(pi),u.viewport(gt),r&&(e=p.get(n.texture),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+n.activeCubeFace,e.__webglTexture,n.activeMipMapLevel))},this.readRenderTargetPixels=function(n,t,r,u,f,e){var h,c;if((n&&n.isWebGLRenderTarget)===!1){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}if(h=p.get(n).__webglFramebuffer,h){c=!1,h!==si&&(i.bindFramebuffer(i.FRAMEBUFFER,h),c=!0);try{var a=n.texture,l=a.format,o=a.type;if(l!==fi&&wt(l)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(o!==el&&wt(o)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&!(o===kf&&(s.get("OES_texture_float")||s.get("WEBGL_color_buffer_float")))&&!(o===ul&&s.get("EXT_color_buffer_half_float"))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}i.checkFramebufferStatus(i.FRAMEBUFFER)===i.FRAMEBUFFER_COMPLETE?t>=0&&t<=n.width-u&&r>=0&&r<=n.height-f&&i.readPixels(t,r,u,f,wt(l),wt(o),e):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&i.bindFramebuffer(i.FRAMEBUFFER,si)}}}}function yu(n,t){this.name="",this.color=new e(n),this.density=t!==undefined?t:.00025}function wu(n,t,i){this.name="",this.color=new e(n),this.near=t!==undefined?t:1,this.far=i!==undefined?i:1e3}function wh(){u.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function va(n,i,r,f,e){u.call(this),this.lensFlares=[],this.positionScreen=new t,this.customUpdateCallback=undefined,n!==undefined&&this.add(n,i,r,f,e)}function di(n){a.call(this),this.type="SpriteMaterial",this.color=new e(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(n)}function us(n){u.call(this),this.type="Sprite",this.material=n!==undefined?n:new di}function rs(){u.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function is(n,t){if(n=n||[],this.bones=n.slice(0),this.boneMatrices=new Float32Array(this.bones.length*16),t===undefined)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new o)}}function ph(){u.call(this),this.type="Bone"}function yh(n,t){ut.call(this,n,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new o,this.bindMatrixInverse=new o;var i=this.initBones(),r=new is(i);this.bind(r,this.matrixWorld),this.normalizeSkinWeights()}function k(n){a.call(this),this.type="LineBasicMaterial",this.color=new e(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(n)}function pt(n,t,i){if(i===1)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new b(n,t);u.call(this),this.type="Line",this.geometry=n!==undefined?n:new f,this.material=t!==undefined?t:new k({color:Math.random()*16777215})}function b(n,t){pt.call(this,n,t),this.type="LineSegments"}function vh(n,t){pt.call(this,n,t),this.type="LineLoop"}function gt(n){a.call(this),this.type="PointsMaterial",this.color=new e(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(n)}function vf(n,t){u.call(this),this.type="Points",this.geometry=n!==undefined?n:new f,this.material=t!==undefined?t:new gt({color:Math.random()*16777215})}function ns(){u.call(this),this.type="Group"}function ch(n,t,i,r,u,f,e,o,s){function h(){requestAnimationFrame(h),n.readyState>=n.HAVE_CURRENT_DATA&&(c.needsUpdate=!0)}w.call(this,n,t,i,r,u,f,e,o,s),this.generateMipmaps=!1;var c=this;h()}function wf(n,t,i,r,u,f,e,o,s,h,c,l){w.call(this,null,f,e,o,s,h,r,u,c,l),this.image={width:t,height:i},this.mipmaps=n,this.flipY=!1,this.generateMipmaps=!1}function uc(n,t,i,r,u,f,e,o,s){w.call(this,n,t,i,r,u,f,e,o,s),this.needsUpdate=!0}function ts(n,t,i,r,u,f,e,o,s,h){if(h=h!==undefined?h:ar,h!==ar&&h!==df)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===undefined&&h===ar&&(i=be),i===undefined&&h===df&&(i=yo),w.call(this,null,r,u,f,e,o,h,i,s),this.image={width:n,height:t},this.magFilter=e!==undefined?e:at,this.minFilter=o!==undefined?o:at,this.flipY=!1,this.generateMipmaps=!1}function ve(n){var d,nt,l,k,w,tt,g,it,ut,et;f.call(this),this.type="WireframeGeometry";var c=[],e,u,a,b,rt,o=[0,0],h={},v,y,p,s,ft=["a","b","c"],i;if(n&&n.isGeometry){for(d=n.faces,e=0,a=d.length;e<a;e++)for(nt=d[e],u=0;u<3;u++)y=nt[ft[u]],p=nt[ft[(u+1)%3]],o[0]=Math.min(y,p),o[1]=Math.max(y,p),s=o[0]+","+o[1],h[s]===undefined&&(h[s]={index1:o[0],index2:o[1]});for(s in h)v=h[s],i=n.vertices[v.index1],c.push(i.x,i.y,i.z),i=n.vertices[v.index2],c.push(i.x,i.y,i.z)}else if(n&&n.isBufferGeometry)if(i=new t,n.index!==null){for(l=n.attributes.position,k=n.index,w=n.groups,w.length===0&&(w=[{start:0,count:k.count,materialIndex:0}]),b=0,rt=w.length;b<rt;++b)for(tt=w[b],g=tt.start,it=tt.count,e=g,a=g+it;e<a;e+=3)for(u=0;u<3;u++)y=k.getX(e+u),p=k.getX(e+(u+1)%3),o[0]=Math.min(y,p),o[1]=Math.max(y,p),s=o[0]+","+o[1],h[s]===undefined&&(h[s]={index1:o[0],index2:o[1]});for(s in h)v=h[s],i.fromBufferAttribute(l,v.index1),c.push(i.x,i.y,i.z),i.fromBufferAttribute(l,v.index2),c.push(i.x,i.y,i.z)}else for(l=n.attributes.position,e=0,a=l.count/3;e<a;e++)for(u=0;u<3;u++)ut=3*e+u,i.fromBufferAttribute(l,ut),c.push(i.x,i.y,i.z),et=3*e+(u+1)%3,i.fromBufferAttribute(l,et),c.push(i.x,i.y,i.z);this.addAttribute("position",new r(c,3))}function es(n,t,i){s.call(this),this.type="ParametricGeometry",this.parameters={func:n,slices:t,stacks:i},this.fromBufferGeometry(new ae(n,t,i)),this.mergeVertices()}function ae(n,i,u){var l,c;f.call(this),this.type="ParametricBufferGeometry",this.parameters={func:n,slices:i,stacks:u};for(var b=[],d=[],nt=[],g=[],a=1e-5,v=new t,h=new t,e=new t,w=new t,p=new t,s,y=i+1,o=0;o<=u;o++)for(l=o/u,s=0;s<=i;s++)c=s/i,h=n(c,l,h),d.push(h.x,h.y,h.z),c-a>=0?(e=n(c-a,l,e),w.subVectors(h,e)):(e=n(c+a,l,e),w.subVectors(e,h)),l-a>=0?(e=n(c,l-a,e),p.subVectors(h,e)):(e=n(c,l+a,e),p.subVectors(e,h)),v.crossVectors(w,p).normalize(),nt.push(v.x,v.y,v.z),g.push(c,l);for(o=0;o<u;o++)for(s=0;s<i;s++){var it=o*y+s,k=o*y+s+1,rt=(o+1)*y+s+1,tt=(o+1)*y+s;b.push(it,k,tt),b.push(k,rt,tt)}this.setIndex(b),this.addAttribute("position",new r(d,3)),this.addAttribute("normal",new r(nt,3)),this.addAttribute("uv",new r(g,2))}function os(n,t,i,r){s.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:n,indices:t,radius:i,detail:r},this.fromBufferGeometry(new ht(n,t,i,r)),this.mergeVertices()}function ht(n,u,e,o){function k(n){for(var r=new t,f=new t,e=new t,i=0;i<u.length;i+=3)a(u[i+0],r),a(u[i+1],f),a(u[i+2],e),b(r,f,e,n)}function b(n,t,i,r){for(var o=Math.pow(2,r),e=[],f,s,u=0;u<=o;u++){e[u]=[];var h=n.clone().lerp(i,u/o),a=t.clone().lerp(i,u/o),l=o-u;for(f=0;f<=l;f++)e[u][f]=f===0&&u===o?h:h.clone().lerp(a,f/l)}for(u=0;u<o;u++)for(f=0;f<2*(o-u)-1;f++)s=Math.floor(f/2),f%2==0?(c(e[u][s+1]),c(e[u+1][s]),c(e[u][s])):(c(e[u][s+1]),c(e[u+1][s+1]),c(e[u+1][s]))}function p(n){for(var r=new t,i=0;i<s.length;i+=3)r.x=s[i+0],r.y=s[i+1],r.z=s[i+2],r.normalize().multiplyScalar(n),s[i+0]=r.x,s[i+1]=r.y,s[i+2]=r.z}function w(){for(var i=new t,r,u,n=0;n<s.length;n+=3)i.x=s[n+0],i.y=s[n+1],i.z=s[n+2],r=v(i)/2/Math.PI+.5,u=g(i)/Math.PI+.5,h.push(r,1-u);y(),d()}function d(){for(var n=0;n<h.length;n+=6){var t=h[n+0],i=h[n+2],r=h[n+4],u=Math.max(t,i,r),f=Math.min(t,i,r);u>.9&&f<.1&&(t<.2&&(h[n+0]+=1),i<.2&&(h[n+2]+=1),r<.2&&(h[n+4]+=1))}}function c(n){s.push(n.x,n.y,n.z)}function a(t,i){var r=t*3;i.x=n[r+0],i.y=n[r+1],i.z=n[r+2]}function y(){for(var f=new t,e=new t,o=new t,c=new t,a=new i,y=new i,p=new i,u,n=0,r=0;n<s.length;n+=9,r+=6)f.set(s[n+0],s[n+1],s[n+2]),e.set(s[n+3],s[n+4],s[n+5]),o.set(s[n+6],s[n+7],s[n+8]),a.set(h[r+0],h[r+1]),y.set(h[r+2],h[r+3]),p.set(h[r+4],h[r+5]),c.copy(f).add(e).add(o).divideScalar(3),u=v(c),l(a,r+0,f,u),l(y,r+2,e,u),l(p,r+4,o,u)}function l(n,t,i,r){r<0&&n.x===1&&(h[t]=n.x-1),i.x===0&&i.z===0&&(h[t]=r/2/Math.PI+.5)}function v(n){return Math.atan2(n.z,-n.x)}function g(n){return Math.atan2(-n.y,Math.sqrt(n.x*n.x+n.z*n.z))}f.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:n,indices:u,radius:e,detail:o},e=e||1,o=o||0;var s=[],h=[];k(o),p(e),w(),this.addAttribute("position",new r(s,3)),this.addAttribute("normal",new r(s.slice(),3)),this.addAttribute("uv",new r(h,2)),this.normalizeNormals()}function as(n,t){s.call(this),this.type="TetrahedronGeometry",this.parameters={radius:n,detail:t},this.fromBufferGeometry(new oe(n,t)),this.mergeVertices()}function oe(n,t){var i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];ht.call(this,i,r,n,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:n,detail:t}}function ys(n,t){s.call(this),this.type="OctahedronGeometry",this.parameters={radius:n,detail:t},this.fromBufferGeometry(new lr(n,t)),this.mergeVertices()}function lr(n,t){var i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];ht.call(this,i,r,n,t),this.type="OctahedronBufferGeometry",this.parameters={radius:n,detail:t}}function ps(n,t){s.call(this),this.type="IcosahedronGeometry",this.parameters={radius:n,detail:t},this.fromBufferGeometry(new re(n,t)),this.mergeVertices()}function re(n,t){var i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],u=[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];ht.call(this,r,u,n,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:n,detail:t}}function ds(n,t){s.call(this),this.type="DodecahedronGeometry",this.parameters={radius:n,detail:t},this.fromBufferGeometry(new ne(n,t)),this.mergeVertices()}function ne(n,t){var i=(1+Math.sqrt(5))/2,r=1/i,u=[-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,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],f=[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];ht.call(this,u,f,n,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:n,detail:t}}function fh(n,t,i,r,u,f){s.call(this),this.type="TubeGeometry",this.parameters={path:n,tubularSegments:t,radius:i,radialSegments:r,closed:u},f!==undefined&&console.warn("THREE.TubeGeometry: taper has been removed.");var e=new gf(n,t,i,r,u);this.tangents=e.tangents,this.normals=e.normals,this.binormals=e.binormals,this.fromBufferGeometry(e),this.mergeVertices()}function gf(n,u,e,o,s){function nt(){for(c=0;c<u;c++)d(c);d(s===!1?u:0),tt(),g()}function d(t){var i=n.getPointAt(t/u),r=a.normals[t],f=a.binormals[t];for(h=0;h<=o;h++){var y=h/o*Math.PI*2,s=Math.sin(y),c=-Math.cos(y);l.x=c*r.x+s*f.x,l.y=c*r.y+s*f.y,l.z=c*r.z+s*f.z,l.normalize(),b.push(l.x,l.y,l.z),v.x=i.x+e*l.x,v.y=i.y+e*l.y,v.z=i.z+e*l.z,w.push(v.x,v.y,v.z)}}function g(){for(h=1;h<=u;h++)for(c=1;c<=o;c++){var i=(o+1)*(h-1)+(c-1),n=(o+1)*h+(c-1),r=(o+1)*h+c,t=(o+1)*(h-1)+c;p.push(i,n,t),p.push(n,r,t)}}function tt(){for(c=0;c<=u;c++)for(h=0;h<=o;h++)y.x=c/u,y.y=h/o,k.push(y.x,y.y)}var a;f.call(this),this.type="TubeBufferGeometry",this.parameters={path:n,tubularSegments:u,radius:e,radialSegments:o,closed:s},u=u||64,e=e||1,o=o||8,s=s||!1,a=n.computeFrenetFrames(u,s),this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var v=new t,l=new t,y=new i,c,h,w=[],b=[],k=[],p=[];nt(),this.setIndex(p),this.addAttribute("position",new r(w,3)),this.addAttribute("normal",new r(b,3)),this.addAttribute("uv",new r(k,2))}function go(n,t,i,r,u,f,e){s.call(this),this.type="TorusKnotGeometry",this.parameters={radius:n,tube:t,tubularSegments:i,radialSegments:r,p:u,q:f},e!==undefined&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new le(n,t,i,r,u,f)),this.mergeVertices()}function le(n,i,u,e,o,s){function ot(n,t,i,r,u){var o=Math.cos(n),s=Math.sin(n),f=i/t*n,e=Math.cos(f);u.x=r*(2+e)*.5*o,u.y=r*(2+e)*s*.5,u.z=r*Math.sin(f)*.5}var d;f.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:n,tube:i,tubularSegments:u,radialSegments:e,p:o,q:s},n=n||100,i=i||40,u=Math.floor(u)||64,e=Math.floor(e)||8,o=o||2,s=s||3;for(var k=[],ut=[],rt=[],tt=[],c,v=new t,p=new t,a=new t,w=new t,y=new t,b=new t,l=new t,h=0;h<=u;++h)for(d=h/u*o*Math.PI*2,ot(d,o,s,n,a),ot(d+.01,o,s,n,w),b.subVectors(w,a),l.addVectors(w,a),y.crossVectors(b,l),l.crossVectors(y,b),y.normalize(),l.normalize(),c=0;c<=e;++c){var ft=c/e*Math.PI*2,g=-i*Math.cos(ft),nt=i*Math.sin(ft);v.x=a.x+(g*l.x+nt*y.x),v.y=a.y+(g*l.y+nt*y.y),v.z=a.z+(g*l.z+nt*y.z),ut.push(v.x,v.y,v.z),p.subVectors(v,a).normalize(),rt.push(p.x,p.y,p.z),tt.push(h/u),tt.push(c/e)}for(c=1;c<=u;c++)for(h=1;h<=e;h++){var st=(e+1)*(c-1)+(h-1),et=(e+1)*c+(h-1),ht=(e+1)*c+h,it=(e+1)*(c-1)+h;k.push(st,et,it),k.push(et,ht,it)}this.setIndex(k),this.addAttribute("position",new r(ut,3)),this.addAttribute("normal",new r(rt,3)),this.addAttribute("uv",new r(tt,2))}function ro(n,t,i,r,u){s.call(this),this.type="TorusGeometry",this.parameters={radius:n,tube:t,radialSegments:i,tubularSegments:r,arc:u},this.fromBufferGeometry(new te(n,t,i,r,u)),this.mergeVertices()}function te(n,i,u,e,o){var l,a;f.call(this),this.type="TorusBufferGeometry",this.parameters={radius:n,tube:i,radialSegments:u,tubularSegments:e,arc:o},n=n||100,i=i||40,u=Math.floor(u)||8,e=Math.floor(e)||6,o=o||Math.PI*2;for(var w=[],k=[],b=[],p=[],y=new t,c=new t,v=new t,s,h=0;h<=u;h++)for(s=0;s<=e;s++)l=s/e*o,a=h/u*Math.PI*2,c.x=(n+i*Math.cos(a))*Math.cos(l),c.y=(n+i*Math.cos(a))*Math.sin(l),c.z=i*Math.sin(a),k.push(c.x,c.y,c.z),y.x=n*Math.cos(l),y.y=n*Math.sin(l),v.subVectors(c,y).normalize(),b.push(v.x,v.y,v.z),p.push(s/e),p.push(h/u);for(h=1;h<=u;h++)for(s=1;s<=e;s++){var nt=(e+1)*h+s-1,d=(e+1)*(h-1)+s-1,tt=(e+1)*(h-1)+s,g=(e+1)*h+s;w.push(nt,d,g),w.push(d,tt,g)}this.setIndex(w),this.addAttribute("position",new r(k,3)),this.addAttribute("normal",new r(b,3)),this.addAttribute("uv",new r(p,2))}function gi(n,t){s.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:n,options:t},this.fromBufferGeometry(new ii(n,t)),this.mergeVertices()}function ii(n,t){if(typeof n=="undefined"){n=[];return}f.call(this),this.type="ExtrudeBufferGeometry",n=Array.isArray(n)?n:[n],this.addShapeList(n,t),this.computeVertexNormals()}function po(n,t){s.call(this),this.type="TextGeometry",this.parameters={text:n,parameters:t},this.fromBufferGeometry(new we(n,t)),this.mergeVertices()}function we(n,t){var i,r;if(t=t||{},i=t.font,(i&&i.isFont)===!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new s;r=i.generateShapes(n,t.size,t.curveSegments),t.amount=t.height!==undefined?t.height:50,t.bevelThickness===undefined&&(t.bevelThickness=10),t.bevelSize===undefined&&(t.bevelSize=8),t.bevelEnabled===undefined&&(t.bevelEnabled=!1),ii.call(this,r,t),this.type="TextBufferGeometry"}function ke(n,t,i,r,u,f,e){s.call(this),this.type="SphereGeometry",this.parameters={radius:n,widthSegments:t,heightSegments:i,phiStart:r,phiLength:u,thetaStart:f,thetaLength:e},this.fromBufferGeometry(new br(n,t,i,r,u,f,e)),this.mergeVertices()}function br(n,i,u,e,o,s,h){var k,y,w;f.call(this),this.type="SphereBufferGeometry",this.parameters={radius:n,widthSegments:i,heightSegments:u,phiStart:e,phiLength:o,thetaStart:s,thetaLength:h},n=n||50,i=Math.max(3,Math.floor(i)||8),u=Math.max(2,Math.floor(u)||6),e=e!==undefined?e:0,o=o!==undefined?o:Math.PI*2,s=s!==undefined?s:0,h=h!==undefined?h:Math.PI;for(var et=s+h,l,rt=0,v=[],a=new t,p=new t,b=[],d=[],g=[],nt=[],c=0;c<=u;c++){for(k=[],y=c/u,l=0;l<=i;l++)w=l/i,a.x=-n*Math.cos(e+w*o)*Math.sin(s+y*h),a.y=n*Math.cos(s+y*h),a.z=n*Math.sin(e+w*o)*Math.sin(s+y*h),d.push(a.x,a.y,a.z),p.set(a.x,a.y,a.z).normalize(),g.push(p.x,p.y,p.z),nt.push(w,1-y),k.push(rt++);v.push(k)}for(c=0;c<u;c++)for(l=0;l<i;l++){var ft=v[c][l+1],tt=v[c][l],ut=v[c+1][l],it=v[c+1][l+1];(c!==0||s>0)&&b.push(ft,tt,it),(c!==u-1||et<Math.PI)&&b.push(tt,ut,it)}this.setIndex(b),this.addAttribute("position",new r(d,3)),this.addAttribute("normal",new r(g,3)),this.addAttribute("uv",new r(nt,2))}function nh(n,t,i,r,u,f){s.call(this),this.type="RingGeometry",this.parameters={innerRadius:n,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:u,thetaLength:f},this.fromBufferGeometry(new ye(n,t,i,r,u,f)),this.mergeVertices()}function ye(n,u,e,o,s,h){var d;f.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:n,outerRadius:u,thetaSegments:e,phiSegments:o,thetaStart:s,thetaLength:h},n=n||20,u=u||50,s=s!==undefined?s:0,h=h!==undefined?h:Math.PI*2,e=e!==undefined?Math.max(3,e):8,o=o!==undefined?Math.max(1,o):1;for(var w=[],nt=[],b=[],k=[],l,p=n,rt=(u-n)/o,a=new t,y=new i,c,v=0;v<=o;v++){for(c=0;c<=e;c++)l=s+c/e*h,a.x=p*Math.cos(l),a.y=p*Math.sin(l),nt.push(a.x,a.y,a.z),b.push(0,0,1),y.x=(a.x/u+1)/2,y.y=(a.y/u+1)/2,k.push(y.x,y.y);p+=rt}for(v=0;v<o;v++)for(d=v*(e+1),c=0;c<e;c++){l=c+d;var ut=l,g=l+e+1,it=l+e+2,tt=l+1;w.push(ut,g,tt),w.push(g,it,tt)}this.setIndex(w),this.addAttribute("position",new r(nt,3)),this.addAttribute("normal",new r(b,3)),this.addAttribute("uv",new r(k,2))}function vo(n,t,i,r){s.call(this),this.type="LatheGeometry",this.parameters={points:n,segments:t,phiStart:i,phiLength:r},this.fromBufferGeometry(new se(n,t,i,r)),this.mergeVertices()}function se(n,u,e,o){f.call(this),this.type="LatheBufferGeometry",this.parameters={points:n,segments:u,phiStart:e,phiLength:o},u=Math.floor(u)||12,e=e||0,o=o||Math.PI*2,o=c.clamp(o,0,Math.PI*2);for(var k=[],d=[],it=[],l,rt=1/u,v=new t,y=new i,s,a=0;a<=u;a++){var g=e+a*rt*o,ut=Math.sin(g),ft=Math.cos(g);for(s=0;s<=n.length-1;s++)v.x=n[s].x*ut,v.y=n[s].y,v.z=n[s].x*ft,d.push(v.x,v.y,v.z),y.x=a/u,y.y=s/(n.length-1),it.push(y.x,y.y)}for(a=0;a<u;a++)for(s=0;s<n.length-1;s++){l=s+a*n.length;var et=l,nt=l+n.length,ot=l+n.length+1,tt=l+1;k.push(et,nt,tt),k.push(nt,ot,tt)}if(this.setIndex(k),this.addAttribute("position",new r(d,3)),this.addAttribute("uv",new r(it,2)),this.computeVertexNormals(),o===Math.PI*2){var h=this.attributes.normal.array,w=new t,p=new t,b=new t;for(l=u*n.length*3,a=0,s=0;a<n.length;a++,s+=3)w.x=h[s+0],w.y=h[s+1],w.z=h[s+2],p.x=h[l+s+0],p.y=h[l+s+1],p.z=h[l+s+2],b.addVectors(w,p).normalize(),h[s+0]=h[l+s+0]=b.x,h[s+1]=h[l+s+1]=b.y,h[s+2]=h[l+s+2]=b.z}}function fe(n,t){s.call(this),this.type="ShapeGeometry",typeof t=="object"&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:n,curveSegments:t},this.fromBufferGeometry(new ue(n,t)),this.mergeVertices()}function ue(n,t){function l(n){var i,r,l,v=e.length/3,w=n.extractPoints(t),f=w.shape,c=w.holes,y,a;if(wt.isClockWise(f)===!1)for(f=f.reverse(),i=0,r=c.length;i<r;i++)l=c[i],wt.isClockWise(l)===!0&&(c[i]=l.reverse());for(y=wt.triangulateShape(f,c),i=0,r=c.length;i<r;i++)l=c[i],f=f.concat(l);for(i=0,r=f.length;i<r;i++)a=f[i],e.push(a.x,a.y,0),s.push(0,0,1),h.push(a.x,a.y);for(i=0,r=y.length;i<r;i++){var p=y[i],b=p[0]+v,k=p[1]+v,d=p[2]+v;o.push(b,k,d),u+=3}}var i;f.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:n,curveSegments:t},t=t||12;var o=[],e=[],s=[],h=[],c=0,u=0;if(Array.isArray(n)===!1)l(n);else for(i=0;i<n.length;i++)l(n[i]),this.addGroup(c,u,i),c+=u,u=0;this.setIndex(o),this.addAttribute("position",new r(e,3)),this.addAttribute("normal",new r(s,3)),this.addAttribute("uv",new r(h,2))}function ie(n,t){var b,v,l,g,k,y,h,i;f.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==undefined?t:1;var d=[],tt=Math.cos(c.DEG2RAD*t),e=[0,0],a={},p,w,o,nt=["a","b","c"],u;for(n.isBufferGeometry?(u=new s,u.fromBufferGeometry(n)):u=n.clone(),u.mergeVertices(),u.computeFaceNormals(),b=u.vertices,v=u.faces,l=0,g=v.length;l<g;l++)for(k=v[l],y=0;y<3;y++)p=k[nt[y]],w=k[nt[(y+1)%3]],e[0]=Math.min(p,w),e[1]=Math.max(p,w),o=e[0]+","+e[1],a[o]===undefined?a[o]={index1:e[0],index2:e[1],face1:l,face2:undefined}:a[o].face2=l;for(o in a)h=a[o],(h.face2===undefined||v[h.face1].normal.dot(v[h.face2].normal)<=tt)&&(i=b[h.index1],d.push(i.x,i.y,i.z),i=b[h.index2],d.push(i.x,i.y,i.z));this.addAttribute("position",new r(d,3))}function eu(n,t,i,r,u,f,e,o){s.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:n,radiusBottom:t,height:i,radialSegments:r,heightSegments:u,openEnded:f,thetaStart:e,thetaLength:o},this.fromBufferGeometry(new yi(n,t,i,r,u,f,e,o)),this.mergeVertices()}function yi(n,u,e,o,s,h,c,l){function tt(){for(var i,h=new t,f=new t,nt=0,at=(u-n)/e,r=0;r<=s;r++){var ot=[],tt=r/s,et=tt*(u-n)+n;for(i=0;i<=o;i++){var st=i/o,ft=st*l+c,ut=Math.sin(ft),rt=Math.cos(ft);f.x=et*ut,f.y=-tt*e+g,f.z=et*rt,k.push(f.x,f.y,f.z),h.set(ut,at,rt).normalize(),p.push(h.x,h.y,h.z),w.push(st,1-tt),ot.push(v++)}a.push(ot)}for(i=0;i<o;i++)for(r=0;r<s;r++){var lt=a[r][i],it=a[r+1][i],ct=a[r+1][i+1],ht=a[r][i+1];y.push(lt,it,ht),y.push(it,ct,ht),nt+=6}d.addGroup(b,nt,0),b+=nt}function nt(r){for(var rt,a=new i,e=new t,nt=0,ut=r===!0?n:u,s=r===!0?1:-1,tt,h,it=v,f=1;f<=o;f++)k.push(0,g*s,0),p.push(0,s,0),w.push(.5,.5),v++;for(rt=v,f=0;f<=o;f++){var st=f/o,ft=st*l+c,et=Math.cos(ft),ot=Math.sin(ft);e.x=ut*ot,e.y=g*s,e.z=ut*et,k.push(e.x,e.y,e.z),p.push(0,s,0),a.x=et*.5+.5,a.y=ot*.5*s+.5,w.push(a.x,a.y),v++}for(f=0;f<o;f++)tt=it+f,h=rt+f,r===!0?y.push(h,h+1,tt):y.push(h+1,h,tt),nt+=3;d.addGroup(b,nt,r===!0?1:2),b+=nt}var d;f.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:n,radiusBottom:u,height:e,radialSegments:o,heightSegments:s,openEnded:h,thetaStart:c,thetaLength:l},d=this,n=n!==undefined?n:20,u=u!==undefined?u:20,e=e!==undefined?e:100,o=Math.floor(o)||8,s=Math.floor(s)||1,h=h!==undefined?h:!1,c=c!==undefined?c:0,l=l!==undefined?l:2*Math.PI;var y=[],k=[],p=[],w=[],v=0,a=[],g=e/2,b=0;tt(),h===!1&&(n>0&&nt(!0),u>0&&nt(!1)),this.setIndex(y),this.addAttribute("position",new r(k,3)),this.addAttribute("normal",new r(p,3)),this.addAttribute("uv",new r(w,2))}function uh(n,t,i,r,u,f,e){eu.call(this,0,n,t,i,r,u,f,e),this.type="ConeGeometry",this.parameters={radius:n,height:t,radialSegments:i,heightSegments:r,openEnded:u,thetaStart:f,thetaLength:e}}function rh(n,t,i,r,u,f,e){yi.call(this,0,n,t,i,r,u,f,e),this.type="ConeBufferGeometry",this.parameters={radius:n,height:t,radialSegments:i,heightSegments:r,openEnded:u,thetaStart:f,thetaLength:e}}function ih(n,t,i,r){s.call(this),this.type="CircleGeometry",this.parameters={radius:n,segments:t,thetaStart:i,thetaLength:r},this.fromBufferGeometry(new ee(n,t,i,r)),this.mergeVertices()}function ee(n,u,e,o){var p;f.call(this),this.type="CircleBufferGeometry",this.parameters={radius:n,segments:u,thetaStart:e,thetaLength:o},n=n||50,u=u!==undefined?Math.max(3,u):8,e=e!==undefined?e:0,o=o!==undefined?o:Math.PI*2;var w=[],h=[],v=[],y=[],s,l,c=new t,a=new i;for(h.push(0,0,0),v.push(0,0,1),y.push(.5,.5),l=0,s=3;l<=u;l++,s+=3)p=e+l/u*o,c.x=n*Math.cos(p),c.y=n*Math.sin(p),h.push(c.x,c.y,c.z),v.push(0,0,1),a.x=(h[s]/n+1)/2,a.y=(h[s+1]/n+1)/2,y.push(a.x,a.y);for(s=1;s<=u;s++)w.push(s,s+1,0);this.setIndex(w),this.addAttribute("position",new r(h,3)),this.addAttribute("normal",new r(v,3)),this.addAttribute("uv",new r(y,2))}function pe(n){ft.call(this,{uniforms:et.merge([h.lights,{opacity:{value:1}}]),vertexShader:v.shadow_vert,fragmentShader:v.shadow_frag}),this.lights=!0,this.transparent=!0,Object.defineProperties(this,{opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(n){this.uniforms.opacity.value=n}}}),this.setValues(n)}function ef(n){ft.call(this,n),this.type="RawShaderMaterial"}function si(n){a.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.normalScale=new i(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(n)}function su(n){si.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(n)}function dt(n){a.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.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=hs,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(n)}function tu(n){dt.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(n)}function ur(n){a.call(this,n),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(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(n)}function er(n){a.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=hs,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(n)}function or(n){a.call(this),this.type="LineDashedMaterial",this.color=new e(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.lights=!1,this.setValues(n)}function wl(n,t,i){var r=this,e=!1,u=0,f=0;this.onStart=undefined,this.onLoad=n,this.onProgress=t,this.onError=i,this.itemStart=function(n){if(f++,e===!1&&r.onStart!==undefined)r.onStart(n,u,f);e=!0},this.itemEnd=function(n){if(u++,r.onProgress!==undefined)r.onProgress(n,u,f);u===f&&(e=!1,r.onLoad!==undefined&&r.onLoad())},this.itemError=function(n){if(r.onError!==undefined)r.onError(n)}}function ni(n){this.manager=n!==undefined?n:st}function kb(n){this.manager=n!==undefined?n:st,this._parser=null}function yl(n){this.manager=n!==undefined?n:st,this._parser=null}function ws(n){this.manager=n!==undefined?n:st}function gl(n){this.manager=n!==undefined?n:st}function kh(n){this.manager=n!==undefined?n:st}function d(n,t){u.call(this),this.type="Light",this.color=new e(n),this.intensity=t!==undefined?t:1,this.receiveShadow=undefined}function dh(n,t,i){d.call(this,n,i),this.type="HemisphereLight",this.castShadow=undefined,this.position.copy(u.DefaultUp),this.updateMatrix(),this.groundColor=new e(t)}function gr(n){this.camera=n,this.bias=0,this.radius=1,this.mapSize=new i(512,512),this.map=null,this.matrix=new o}function gh(){gr.call(this,new nt(50,1,.5,500))}function nc(n,t,i,r,f,e){d.call(this,n,t),this.type="SpotLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.target=new u,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(n){this.intensity=n/Math.PI}}),this.distance=i!==undefined?i:0,this.angle=r!==undefined?r:Math.PI/3,this.penumbra=f!==undefined?f:0,this.decay=e!==undefined?e:1,this.shadow=new gh}function tc(n,t,i,r){d.call(this,n,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return this.intensity*4*Math.PI},set:function(n){this.intensity=n/(4*Math.PI)}}),this.distance=i!==undefined?i:0,this.decay=r!==undefined?r:1,this.shadow=new gr(new nt(90,1,.5,500))}function ic(){gr.call(this,new pf(-5,5,5,-5,.5,500))}function rc(n,t){d.call(this,n,t),this.type="DirectionalLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.target=new u,this.shadow=new ic}function fc(n,t){d.call(this,n,t),this.type="AmbientLight",this.castShadow=undefined}function ec(n,t,i,r){d.call(this,n,t),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=i!==undefined?i:10,this.height=r!==undefined?r:10}function lt(n,t,i,r){this.parameterPositions=n,this._cachedIndex=0,this.resultBuffer=r!==undefined?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i}function hc(n,t,i,r){lt.call(this,n,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function bo(n,t,i,r){lt.call(this,n,t,i,r)}function lc(n,t,i,r){lt.call(this,n,t,i,r)}function sr(n,t,i,r){if(n===undefined)throw new Error("track name is undefined");if(t===undefined||t.length===0)throw new Error("no keyframes in track named "+n);this.name=n,this.times=it.convertArray(t,this.TimeBufferType),this.values=it.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function af(n,t,i,r){sr.call(this,n,t,i,r)}function ac(n,t,i,r){lt.call(this,n,t,i,r)}function oo(n,t,i,r){sr.call(this,n,t,i,r)}function lf(n,t,i,r){sr.call(this,n,t,i,r)}function vc(n,t,i,r){sr.call(this,n,t,i,r)}function yc(n,t,i){sr.call(this,n,t,i)}function ah(n,t,i,r){sr.call(this,n,t,i,r)}function fr(){sr.apply(this,arguments)}function kt(n,t,i){this.name=n,this.tracks=i,this.duration=t!==undefined?t:-1,this.uuid=c.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function pc(n){this.manager=n!==undefined?n:st,this.textures={}}function wv(n){this.manager=n!==undefined?n:st}function cf(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function ey(n){typeof n=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),n=undefined),this.manager=n!==undefined?n:st,this.withCredentials=!1}function gk(n){this.manager=n!==undefined?n:st,this.texturePath=""}function kw(n,t,i,r,u){var f=(r-t)*.5,e=(u-i)*.5,o=n*n,s=n*o;return(2*i-2*r+f+e)*s+(-3*i+3*r-2*f-e)*o+f*n+i}function wd(n,t){var i=1-n;return i*i*t}function gd(n,t){return 2*(1-n)*n*t}function ng(n,t){return n*n*t}function dr(n,t,i,r){return wd(n,t)+gd(n,i)+ng(n,r)}function rg(n,t){var i=1-n;return i*i*i*t}function ug(n,t){var i=1-n;return 3*i*i*n*t}function fg(n,t){return 3*(1-n)*n*n*t}function eg(n,t){return n*n*n*t}function kr(n,t,i,r,u){return rg(n,t)+ug(n,i)+fg(n,r)+eg(n,u)}function p(){this.arcLengthDivisions=200}function ei(n,t){p.call(this),this.v1=n,this.v2=t}function de(){p.call(this),this.curves=[],this.autoClose=!1}function ai(n,t,i,r,u,f,e,o){p.call(this),this.aX=n,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=u,this.aEndAngle=f,this.aClockwise=e,this.aRotation=o||0}function ou(n){p.call(this),this.points=n===undefined?[]:n}function hf(n,t,i,r){p.call(this),this.v0=n,this.v1=t,this.v2=i,this.v3=r}function sf(n,t,i){p.call(this),this.v0=n,this.v1=t,this.v2=i}function bs(n){de.call(this),this.currentPoint=new i,n&&this.fromPoints(n)}function hu(){bs.apply(this,arguments),this.holes=[]}function dv(){this.subPaths=[],this.currentPath=null}function gv(n){this.data=n}function pw(n){this.manager=n!==undefined?n:st}function ty(n){this.manager=n!==undefined?n:st}function aw(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new nt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new nt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function hh(n,i,r){var o,s,h,c,l,v;u.call(this),this.type="CubeCamera";var f=90,e=1,a=new nt(f,e,n,i);a.up.set(0,-1,0),a.lookAt(new t(1,0,0)),this.add(a),o=new nt(f,e,n,i),o.up.set(0,-1,0),o.lookAt(new t(-1,0,0)),this.add(o),s=new nt(f,e,n,i),s.up.set(0,0,1),s.lookAt(new t(0,1,0)),this.add(s),h=new nt(f,e,n,i),h.up.set(0,0,-1),h.lookAt(new t(0,-1,0)),this.add(h),c=new nt(f,e,n,i),c.up.set(0,-1,0),c.lookAt(new t(0,0,1)),this.add(c),l=new nt(f,e,n,i),l.up.set(0,-1,0),l.lookAt(new t(0,0,-1)),this.add(l),v={format:he,magFilter:ot,minFilter:ot},this.renderTarget=new au(r,r,v),this.renderTarget.texture.name="CubeCamera",this.updateCubeMap=function(n,t){this.parent===null&&this.updateMatrixWorld();var i=this.renderTarget,r=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,i.activeCubeFace=0,n.render(t,a,i),i.activeCubeFace=1,n.render(t,o,i),i.activeCubeFace=2,n.render(t,s,i),i.activeCubeFace=3,n.render(t,h,i),i.activeCubeFace=4,n.render(t,c,i),i.texture.generateMipmaps=r,i.activeCubeFace=5,n.render(t,l,i),n.setRenderTarget(null)}}function fy(n){nt.call(this),this.enabled=!1,this.cameras=n||[]}function pv(){u.call(this),this.type="AudioListener",this.context=oh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function gu(n){u.call(this),this.type="Audio",this.context=n.context,this.gain=this.context.createGain(),this.gain.connect(n.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function oy(n){gu.call(this,n),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function ly(n,t){this.analyser=n.context.createAnalyser(),this.analyser.fftSize=t!==undefined?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),n.getOutput().connect(this.analyser)}function ay(n,t,i){this.binding=n,this.valueSize=i;var u=Float64Array,r;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":u=Array,r=this._select;break;default:r=this._lerp}this.buffer=new u(i*4),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function nw(n,t,i){var r=i||rt.parseTrackName(t);this._targetGroup=n,this._bindings=n.subscribe_(t,r)}function rt(n,t,i){this.path=t,this.parsedPath=i||rt.parseTrackName(t),this.node=rt.findNode(n,this.parsedPath.nodeName)||n,this.rootNode=n}function dp(){var r,t,u,i;for(this.uuid=c.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0,r={},this._indicesByUUID=r,t=0,u=arguments.length;t!==u;++t)r[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={},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 kp(n,t,i){var r,f;this._mixer=n,this._clip=t,this._localRoot=i||null;var e=t.tracks,u=e.length,o=new Array(u),s={endingStart:ru,endingEnd:ru};for(r=0;r!==u;++r)f=e[r].createInterpolant(null),o[r]=f,f.settings=s;this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(u),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=yp,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=Infinity,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function bp(n){this._root=n,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function bh(n){typeof n=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),n=arguments[1]),this.value=n}function cy(){f.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=undefined}function hy(n,t,i,r){this.uuid=c.generateUUID(),this.data=n,this.itemSize=t,this.offset=i,this.normalized=r===!0}function bf(n,t){this.uuid=c.generateUUID(),this.array=n,this.stride=t,this.count=n!==undefined?n.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function ua(n,t,i){bf.call(this,n,t),this.meshPerAttribute=i||1}function la(n,t,i){l.call(this,n,t),this.meshPerAttribute=i||1}function wp(n,t,i,r){this.ray=new rr(n,t),this.near=i||0,this.far=r||Infinity,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 uw(n,t){return n.distance-t.distance}function ry(n,t,i,r){var f,u,e;if(n.visible!==!1&&(n.raycast(t,i),r===!0))for(f=n.children,u=0,e=f.length;u<e;u++)ry(f[u],t,i,!0)}function vw(n){this.autoStart=n!==undefined?n:!0,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function yw(n,t,i){return this.radius=n!==undefined?n:1,this.phi=t!==undefined?t:0,this.theta=i!==undefined?i:0,this}function gw(n,t,i){return this.radius=n!==undefined?n:1,this.theta=t!==undefined?t:0,this.y=i!==undefined?i:0,this}function tt(n,t){ut.call(this,n,t),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length,r="__default",u=0,f=i-1,e=i/1;this.createAnimation(r,u,f,e),this.setAnimationWeight(r,1)}function ks(n){u.call(this),this.material=n,this.render=function(){}}function gs(n,t,i,u){var s,h;this.object=n,this.size=t!==undefined?t:1;var c=i!==undefined?i:16711680,l=u!==undefined?u:1,o=0,e=this.object.geometry;e&&e.isGeometry?o=e.faces.length*3:e&&e.isBufferGeometry&&(o=e.attributes.normal.count),s=new f,h=new r(o*6,3),s.addAttribute("position",h),b.call(this,s,new k({color:c,linewidth:l})),this.matrixAutoUpdate=!1,this.update()}function nf(n){var t,i,s,h,l;u.call(this),this.light=n,this.light.updateMatrixWorld(),this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1,t=new f,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];for(var e=0,c=1,o=32;e<o;e++,c++)s=e/o*Math.PI*2,h=c/o*Math.PI*2,i.push(Math.cos(s),Math.sin(s),1,Math.cos(h),Math.sin(h),1);t.addAttribute("position",new r(i,3)),l=new k({fog:!1}),this.cone=new b(t,l),this.add(this.cone),this.update()}function tf(n){var t,c,l;this.bones=this.getBoneList(n);var i=new f,u=[],o=[],s=new e(0,0,1),h=new e(0,1,0);for(t=0;t<this.bones.length;t++)c=this.bones[t],c.parent&&c.parent.isBone&&(u.push(0,0,0),u.push(0,0,0),o.push(s.r,s.g,s.b),o.push(h.r,h.g,h.b));i.addAttribute("position",new r(u,3)),i.addAttribute("color",new r(o,3)),l=new k({vertexColors:hr,depthTest:!1,depthWrite:!1,transparent:!0}),b.call(this,i,l),this.root=n,this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function rf(n,t){this.light=n,this.light.updateMatrixWorld();var r=new br(t,4,2),i=new yt({wireframe:!0,fog:!1});i.color.copy(this.light.color),ut.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1}function uf(n){u.call(this),this.light=n,this.light.updateMatrixWorld(),this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1;var i=new k({color:n.color}),t=new f;t.addAttribute("position",new l(new Float32Array(15),3)),this.add(new pt(t,i)),this.update()}function ff(n,t){var i;u.call(this),this.light=n,this.light.updateMatrixWorld(),this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1,i=new lr(t),i.rotateY(Math.PI*.5);var r=new yt({vertexColors:hr,wireframe:!0}),f=i.getAttribute("position"),e=new Float32Array(f.count*3);i.addAttribute("color",new l(e,3)),this.add(new ut(i,r)),this.update()}function wo(n,t,i,u){var l,a,p;n=n||10,t=t||10,i=new e(i!==undefined?i:4473924),u=new e(u!==undefined?u:8947848);for(var w=t/2,d=n/t,s=n/2,v=[],h=[],y=0,o=0,c=-s;y<=t;y++,c+=d)v.push(-s,0,c,s,0,c),v.push(c,0,-s,c,0,s),l=y===w?i:u,l.toArray(h,o),o+=3,l.toArray(h,o),o+=3,l.toArray(h,o),o+=3,l.toArray(h,o),o+=3;a=new f,a.addAttribute("position",new r(v,3)),a.addAttribute("color",new r(h,3)),p=new k({vertexColors:hr}),b.call(this,a,p)}function dc(n,t,i,u,o,s){var y,v,a,p,l,c,w,d,h,g,nt;for(n=n||10,t=t||16,i=i||8,u=u||64,o=new e(o!==undefined?o:4473924),s=new e(s!==undefined?s:8947848),y=[],v=[],c=0;c<=t;c++)l=c/t*Math.PI*2,a=Math.sin(l)*n,p=Math.cos(l)*n,y.push(0,0,0),y.push(a,0,p),h=c&1?o:s,v.push(h.r,h.g,h.b),v.push(h.r,h.g,h.b);for(c=0;c<=i;c++)for(h=c&1?o:s,d=n-n/i*c,w=0;w<u;w++)l=w/u*Math.PI*2,a=Math.sin(l)*d,p=Math.cos(l)*d,y.push(a,0,p),v.push(h.r,h.g,h.b),l=(w+1)/u*Math.PI*2,a=Math.sin(l)*d,p=Math.cos(l)*d,y.push(a,0,p),v.push(h.r,h.g,h.b);g=new f,g.addAttribute("position",new r(y,3)),g.addAttribute("color",new r(v,3)),nt=new k({vertexColors:hr}),b.call(this,g,nt)}function so(n,t,i,u){var o,h;this.object=n,this.size=t!==undefined?t:1;var c=i!==undefined?i:16776960,l=u!==undefined?u:1,s=0,e=this.object.geometry;e&&e.isGeometry?s=e.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead."),o=new f,h=new r(s*6,3),o.addAttribute("position",h),b.call(this,o,new k({color:c,linewidth:l})),this.matrixAutoUpdate=!1,this.update()}function of(n,t){var i,e;u.call(this),this.light=n,this.light.updateMatrixWorld(),this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1,t===undefined&&(t=1),i=new f,i.addAttribute("position",new r([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3)),e=new k({fog:!1}),this.add(new pt(i,e)),i=new f,i.addAttribute("position",new r([0,0,0,0,0,1],3)),this.add(new pt(i,e)),this.update()}function co(n){function t(n,t,i){v(n,i),v(t,i)}function v(n,t){c.push(0,0,0),a.push(t.r,t.g,t.b),o[n]===undefined&&(o[n]=[]),o[n].push(c.length/3-1)}var h=new f,y=new k({color:16777215,vertexColors:ka}),c=[],a=[],o={},i=new e(16755200),s=new e(16711680),l=new e(43775),p=new e(16777215),u=new e(3355443);t("n1","n2",i),t("n2","n4",i),t("n4","n3",i),t("n3","n1",i),t("f1","f2",i),t("f2","f4",i),t("f4","f3",i),t("f3","f1",i),t("n1","f1",i),t("n2","f2",i),t("n3","f3",i),t("n4","f4",i),t("p","n1",s),t("p","n2",s),t("p","n3",s),t("p","n4",s),t("u1","u2",l),t("u2","u3",l),t("u3","u1",l),t("c","t",p),t("p","c",u),t("cn1","cn2",u),t("cn3","cn4",u),t("cf1","cf2",u),t("cf3","cf4",u),h.addAttribute("position",new r(c,3)),h.addAttribute("color",new r(a,3)),b.call(this,h,y),this.camera=n,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function iu(n,t){this.object=n,t===undefined&&(t=16776960);var r=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]),u=new Float32Array(24),i=new f;i.setIndex(new l(r,1)),i.addAttribute("position",new l(u,3)),b.call(this,i,new k({color:t})),this.matrixAutoUpdate=!1,this.update()}function nu(n,t,i,e,o,s){u.call(this),e===undefined&&(e=16776960),i===undefined&&(i=1),o===undefined&&(o=.2*i),s===undefined&&(s=.2*o),gc===undefined&&(gc=new f,gc.addAttribute("position",new r([0,0,0,0,1,0],3)),sy=new yi(0,.5,1,5,1),sy.translate(0,-.5,0)),this.position.copy(t),this.line=new pt(gc,new k({color:e})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ut(sy,new yt({color:e})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(n),this.setLength(i,o,s)}function nl(n){var i;n=n||1;var u=[0,0,0,n,0,0,0,0,0,0,n,0,0,0,0,0,0,n],e=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],t=new f;t.addAttribute("position",new r(u,3)),t.addAttribute("color",new r(e,3)),i=new k({vertexColors:hr}),b.call(this,t,i)}function ny(){function u(u,f,e,o){n=u,t=e,i=-3*u+3*f-2*e-o,r=2*u-2*f+e+o}var n=0,t=0,i=0,r=0;return{initCatmullRom:function(n,t,i,r,f){u(t,i,f*(i-n),f*(r-t))},initNonuniformCatmullRom:function(n,t,i,r,f,e,o){var s=(t-n)/f-(i-n)/(f+e)+(i-t)/e,h=(i-t)/e-(r-t)/(e+o)+(r-i)/o;s*=e,h*=e,u(t,i,s,h)},calc:function(u){var f=u*u,e=f*u;return n+t*u+i*f+r*e}}}function ui(n){p.call(this),this.points=n||[],this.closed=!1}function uo(n,t,i,r){p.call(this),this.v0=n,this.v1=t,this.v2=i,this.v3=r}function fo(n,t,i){p.call(this),this.v0=n,this.v1=t,this.v2=i}function ho(n,t){p.call(this),this.v1=n,this.v2=t}function fl(n,t,i,r,u,f){ai.call(this,n,t,i,i,r,u,f)}function yd(n,t,i,r,u,f,e){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new li(n,t,i,u,f,e)}function fd(n){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),n}function pd(n){return n===undefined&&(n=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),n.isMultiMaterial=!0,n.materials=n,n.clone=function(){return n.slice()},n}function ed(n,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new vf(n,t)}function ld(n){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new us(n)}function od(n,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new vf(n,t)}function hd(n){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new gt(n)}function cd(n){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new gt(n)}function dg(n){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new gt(n)}function kg(n,i,r){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new t(n,i,r)}function bg(n,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new l(n,t).setDynamic(!0)}function wg(n,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new io(n,t)}function pg(n,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new to(n,t)}function yg(n,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new no(n,t)}function vd(n,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new ge(n,t)}function ag(n,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new vr(n,t)}function lg(n,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new ao(n,t)}function cg(n,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new yr(n,t)}function sg(n,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new r(n,t)}function og(n,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new ls(n,t)}function ok(n){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ui.call(this,n),this.type="catmullrom",this.closed=!0}function rd(n){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ui.call(this,n),this.type="catmullrom"}function na(n){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),ui.call(this,n),this.type="catmullrom"}function ig(n,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new iu(n,t)}function tg(n,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new b(new ie(n.geometry),new k({color:t!==undefined?t:16777215}))}function dd(n,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new b(new ve(n.geometry),new k({color:t!==undefined?t:16777215}))}function bd(n){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new ni(n)}function gg(n){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new yl(n)}function uft(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(n,t){console.warn("THREE.Projector: .projectVector() is now vector.project()."),n.project(t)},this.unprojectVector=function(n,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),n.unproject(t)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function nut(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}}var cp,bl,pl,tl,bk,id,yb,ab,ak,wt,vt,tp,ku,st,it,pi,bv,bc,eh,oh,gc,sy,rk,nk,nd,py,lw;Number.EPSILON===undefined&&(Number.EPSILON=Math.pow(2,-52)),Number.isInteger===undefined&&(Number.isInteger=function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n}),Math.sign===undefined&&(Math.sign=function(n){return n<0?-1:n>0?1:+n}),Function.prototype.name===undefined&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),Object.assign===undefined&&function(){Object.assign=function(n){var u,i,t,r;if(n===undefined||n===null)throw new TypeError("Cannot convert undefined or null to object");for(u=Object(n),i=1;i<arguments.length;i++)if(t=arguments[i],t!==undefined&&t!==null)for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(u[r]=t[r]);return u}}(),Object.assign(vi.prototype,{addEventListener:function(n,t){this._listeners===undefined&&(this._listeners={});var i=this._listeners;i[n]===undefined&&(i[n]=[]),i[n].indexOf(t)===-1&&i[n].push(t)},hasEventListener:function(n,t){if(this._listeners===undefined)return!1;var i=this._listeners;return i[n]!==undefined&&i[n].indexOf(t)!==-1},removeEventListener:function(n,t){var u,i,r;this._listeners!==undefined&&(u=this._listeners,i=u[n],i!==undefined&&(r=i.indexOf(t),r!==-1&&i.splice(r,1)))},dispatchEvent:function(n){var r,i;if(this._listeners!==undefined&&(r=this._listeners,i=r[n.type],i!==undefined)){n.target=this;for(var u=[],t=0,f=i.length,t=0;t<f;t++)u[t]=i[t];for(t=0;t<f;t++)u[t].call(this,n)}}});var lb="85",vg={LEFT:0,MIDDLE:1,RIGHT:2},gp=0,lo=1,iy=2,hg=3,vb=0,sd=1,ad=0,vv=1,wk=2,bu=0,ir=1,pu=2,yv=1,ya=2,sh=0,ka=1,hr=2,cc=0,ce=1,aa=2,sv=3,hv=4,cv=5,lv=100,ek=101,fb=102,ia=103,dl=104,ub=200,wb=201,tk=202,ik=203,oa=204,sa=205,ud=206,db=207,bb=208,uk=209,cb=210,eb=0,fk=1,pk=2,sc=3,kk=4,vp=5,ck=6,yk=7,hs=0,sp=1,yy=2,kc=0,av=1,lp=2,hp=3,fp=4,il=300,ol=301,cl=302,pa=303,ll=304,ta=305,wc=306,al=307,wi=1e3,ct=1001,cu=1002,at=1003,hl=1004,sl=1005,ot=1006,wa=1007,eo=1008,el=1009,tw=1010,iw=1011,be=1012,rw=1013,ba=1014,kf=1015,ul=1016,fw=1017,ew=1018,ow=1019,yo=1020,sw=1021,he=1022,fi=1023,hw=1024,cw=1025,kit=fi,ar=1026,df=1027,da=2001,ga=2002,nv=2003,tv=2004,iv=2100,rv=2101,uv=2102,fv=2103,ww=2151,bw=2200,yp=2201,dw=2202,vs=2300,cs=2301,vl=2302,ru=2400,uu=2401,ss=2402,ev=0,nb=1,pp=2,fs=3e3,tb=3001,ov=3007,op=3002,bit=3003,wy=3004,by=3005,np=3006,ap=3200,up=3201,c={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),t=new Array(36),n=0,i;return function(){for(var u=0;u<36;u++)u===8||u===13||u===18||u===23?t[u]="-":u===14?t[u]="4":(n<=2&&(n=33554432+Math.random()*16777216|0),i=n&15,n=n>>4,t[u]=r[u===19?i&3|8:i]);return t.join("")}}(),clamp:function(n,t,i){return Math.max(t,Math.min(i,n))},euclideanModulo:function(n,t){return(n%t+t)%t},mapLinear:function(n,t,i,r,u){return r+(n-t)*(u-r)/(i-t)},lerp:function(n,t,i){return(1-i)*n+i*t},smoothstep:function(n,t,i){return n<=t?0:n>=i?1:(n=(n-t)/(i-t),n*n*(3-2*n))},smootherstep:function(n,t,i){return n<=t?0:n>=i?1:(n=(n-t)/(i-t),n*n*n*(n*(n*6-15)+10))},randInt:function(n,t){return n+Math.floor(Math.random()*(t-n+1))},randFloat:function(n,t){return n+Math.random()*(t-n)},randFloatSpread:function(n){return n*(.5-Math.random())},degToRad:function(n){return n*c.DEG2RAD},radToDeg:function(n){return n*c.RAD2DEG},isPowerOfTwo:function(n){return(n&n-1)==0&&n!==0},nearestPowerOfTwo:function(n){return Math.pow(2,Math.round(Math.log(n)/Math.LN2))},nextPowerOfTwo:function(n){return n--,n|=n>>1,n|=n>>2,n|=n>>4,n|=n>>8,n|=n>>16,n++,n}};Object.defineProperties(i.prototype,{width:{get:function(){return this.x},set:function(n){this.x=n}},height:{get:function(){return this.y},set:function(n){this.y=n}}}),Object.assign(i.prototype,{isVector2:!0,set:function(n,t){return this.x=n,this.y=t,this},setScalar:function(n){return this.x=n,this.y=n,this},setX:function(n){return this.x=n,this},setY:function(n){return this.y=n,this},setComponent:function(n,t){switch(n){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+n);}return this},getComponent:function(n){switch(n){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+n);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(n){return this.x=n.x,this.y=n.y,this},add:function(n,t){return t!==undefined?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(n,t)):(this.x+=n.x,this.y+=n.y,this)},addScalar:function(n){return this.x+=n,this.y+=n,this},addVectors:function(n,t){return this.x=n.x+t.x,this.y=n.y+t.y,this},addScaledVector:function(n,t){return this.x+=n.x*t,this.y+=n.y*t,this},sub:function(n,t){return t!==undefined?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(n,t)):(this.x-=n.x,this.y-=n.y,this)},subScalar:function(n){return this.x-=n,this.y-=n,this},subVectors:function(n,t){return this.x=n.x-t.x,this.y=n.y-t.y,this},multiply:function(n){return this.x*=n.x,this.y*=n.y,this},multiplyScalar:function(n){return this.x*=n,this.y*=n,this},divide:function(n){return this.x/=n.x,this.y/=n.y,this},divideScalar:function(n){return this.multiplyScalar(1/n)},min:function(n){return this.x=Math.min(this.x,n.x),this.y=Math.min(this.y,n.y),this},max:function(n){return this.x=Math.max(this.x,n.x),this.y=Math.max(this.y,n.y),this},clamp:function(n,t){return this.x=Math.max(n.x,Math.min(t.x,this.x)),this.y=Math.max(n.y,Math.min(t.y,this.y)),this},clampScalar:function(){var n=new i,t=new i;return function(i,r){return n.set(i,i),t.set(r,r),this.clamp(n,t)}}(),clampLength:function(n,t){var i=this.length();return this.multiplyScalar(Math.max(n,Math.min(t,i))/i)},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(n){return this.x*n.x+this.y*n.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var n=Math.atan2(this.y,this.x);return n<0&&(n+=2*Math.PI),n},distanceTo:function(n){return Math.sqrt(this.distanceToSquared(n))},distanceToSquared:function(n){var t=this.x-n.x,i=this.y-n.y;return t*t+i*i},distanceToManhattan:function(n){return Math.abs(this.x-n.x)+Math.abs(this.y-n.y)},setLength:function(n){return this.multiplyScalar(n/this.length())},lerp:function(n,t){return this.x+=(n.x-this.x)*t,this.y+=(n.y-this.y)*t,this},lerpVectors:function(n,t,i){return this.subVectors(t,n).multiplyScalar(i).add(n)},equals:function(n){return n.x===this.x&&n.y===this.y},fromArray:function(n,t){return t===undefined&&(t=0),this.x=n[t],this.y=n[t+1],this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this.x,n[t+1]=this.y,n},fromBufferAttribute:function(n,t,i){return i!==undefined&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=n.getX(t),this.y=n.getY(t),this},rotateAround:function(n,t){var i=Math.cos(t),r=Math.sin(t),u=this.x-n.x,f=this.y-n.y;return this.x=u*i-f*r+n.x,this.y=u*r+f*i+n.y,this}}),cp=0,w.DEFAULT_IMAGE=undefined,w.DEFAULT_MAPPING=il,Object.defineProperty(w.prototype,"needsUpdate",{set:function(n){n===!0&&this.version++}}),Object.assign(w.prototype,vi.prototype,{constructor:w,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.name=n.name,this.image=n.image,this.mipmaps=n.mipmaps.slice(0),this.mapping=n.mapping,this.wrapS=n.wrapS,this.wrapT=n.wrapT,this.magFilter=n.magFilter,this.minFilter=n.minFilter,this.anisotropy=n.anisotropy,this.format=n.format,this.type=n.type,this.offset.copy(n.offset),this.repeat.copy(n.repeat),this.generateMipmaps=n.generateMipmaps,this.premultiplyAlpha=n.premultiplyAlpha,this.flipY=n.flipY,this.unpackAlignment=n.unpackAlignment,this.encoding=n.encoding,this},toJSON:function(n){function r(n){var t;return n.toDataURL!==undefined?t=n:(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t.width=n.width,t.height=n.height,t.getContext("2d").drawImage(n,0,0,n.width,n.height)),t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}var i,t;return n.textures[this.uuid]!==undefined?n.textures[this.uuid]:(i={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],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY},this.image!==undefined&&(t=this.image,t.uuid===undefined&&(t.uuid=c.generateUUID()),n.images[t.uuid]===undefined&&(n.images[t.uuid]={uuid:t.uuid,url:r(t)}),i.image=t.uuid),n.textures[this.uuid]=i,i)},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(n){if(this.mapping===il){if(n.multiply(this.repeat),n.add(this.offset),n.x<0||n.x>1)switch(this.wrapS){case wi:n.x=n.x-Math.floor(n.x);break;case ct:n.x=n.x<0?0:1;break;case cu:n.x=Math.abs(Math.floor(n.x)%2)===1?Math.ceil(n.x)-n.x:n.x-Math.floor(n.x)}if(n.y<0||n.y>1)switch(this.wrapT){case wi:n.y=n.y-Math.floor(n.y);break;case ct:n.y=n.y<0?0:1;break;case cu:n.y=Math.abs(Math.floor(n.y)%2)===1?Math.ceil(n.y)-n.y:n.y-Math.floor(n.y)}this.flipY&&(n.y=1-n.y)}}}),Object.assign(y.prototype,{isVector4:!0,set:function(n,t,i,r){return this.x=n,this.y=t,this.z=i,this.w=r,this},setScalar:function(n){return this.x=n,this.y=n,this.z=n,this.w=n,this},setX:function(n){return this.x=n,this},setY:function(n){return this.y=n,this},setZ:function(n){return this.z=n,this},setW:function(n){return this.w=n,this},setComponent:function(n,t){switch(n){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+n);}return this},getComponent:function(n){switch(n){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: "+n);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(n){return this.x=n.x,this.y=n.y,this.z=n.z,this.w=n.w!==undefined?n.w:1,this},add:function(n,t){return t!==undefined?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(n,t)):(this.x+=n.x,this.y+=n.y,this.z+=n.z,this.w+=n.w,this)},addScalar:function(n){return this.x+=n,this.y+=n,this.z+=n,this.w+=n,this},addVectors:function(n,t){return this.x=n.x+t.x,this.y=n.y+t.y,this.z=n.z+t.z,this.w=n.w+t.w,this},addScaledVector:function(n,t){return this.x+=n.x*t,this.y+=n.y*t,this.z+=n.z*t,this.w+=n.w*t,this},sub:function(n,t){return t!==undefined?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(n,t)):(this.x-=n.x,this.y-=n.y,this.z-=n.z,this.w-=n.w,this)},subScalar:function(n){return this.x-=n,this.y-=n,this.z-=n,this.w-=n,this},subVectors:function(n,t){return this.x=n.x-t.x,this.y=n.y-t.y,this.z=n.z-t.z,this.w=n.w-t.w,this},multiplyScalar:function(n){return this.x*=n,this.y*=n,this.z*=n,this.w*=n,this},applyMatrix4:function(n){var i=this.x,r=this.y,u=this.z,f=this.w,t=n.elements;return this.x=t[0]*i+t[4]*r+t[8]*u+t[12]*f,this.y=t[1]*i+t[5]*r+t[9]*u+t[13]*f,this.z=t[2]*i+t[6]*r+t[10]*u+t[14]*f,this.w=t[3]*i+t[7]*r+t[11]*u+t[15]*f,this},divideScalar:function(n){return this.multiplyScalar(1/n)},setAxisAngleFromQuaternion:function(n){this.w=2*Math.acos(n.w);var t=Math.sqrt(1-n.w*n.w);return t<.0001?(this.x=1,this.y=0,this.z=0):(this.x=n.x/t,this.y=n.y/t,this.z=n.z/t),this},setAxisAngleFromRotationMatrix:function(n){var nt,t,i,r,c=.01,v=.1,u=n.elements,b=u[0],l=u[4],s=u[8],h=u[1],k=u[5],o=u[9],e=u[2],f=u[6],d=u[10],a;if(Math.abs(l-h)<c&&Math.abs(s-e)<c&&Math.abs(o-f)<c){if(Math.abs(l+h)<v&&Math.abs(s+e)<v&&Math.abs(o+f)<v&&Math.abs(b+k+d-3)<v)return this.set(1,0,0,0),this;nt=Math.PI;var y=(b+1)/2,p=(k+1)/2,w=(d+1)/2,tt=(l+h)/4,it=(s+e)/4,g=(o+f)/4;return y>p&&y>w?y<c?(t=0,i=.707106781,r=.707106781):(t=Math.sqrt(y),i=tt/t,r=it/t):p>w?p<c?(t=.707106781,i=0,r=.707106781):(i=Math.sqrt(p),t=tt/i,r=g/i):w<c?(t=.707106781,i=.707106781,r=0):(r=Math.sqrt(w),t=it/r,i=g/r),this.set(t,i,r,nt),this}return a=Math.sqrt((f-o)*(f-o)+(s-e)*(s-e)+(h-l)*(h-l)),Math.abs(a)<.001&&(a=1),this.x=(f-o)/a,this.y=(s-e)/a,this.z=(h-l)/a,this.w=Math.acos((b+k+d-1)/2),this},min:function(n){return this.x=Math.min(this.x,n.x),this.y=Math.min(this.y,n.y),this.z=Math.min(this.z,n.z),this.w=Math.min(this.w,n.w),this},max:function(n){return this.x=Math.max(this.x,n.x),this.y=Math.max(this.y,n.y),this.z=Math.max(this.z,n.z),this.w=Math.max(this.w,n.w),this},clamp:function(n,t){return this.x=Math.max(n.x,Math.min(t.x,this.x)),this.y=Math.max(n.y,Math.min(t.y,this.y)),this.z=Math.max(n.z,Math.min(t.z,this.z)),this.w=Math.max(n.w,Math.min(t.w,this.w)),this},clampScalar:function(){var n=new y,t=new y;return function(i,r){return n.set(i,i,i,i),t.set(r,r,r,r),this.clamp(n,t)}}(),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(n){return this.x*n.x+this.y*n.y+this.z*n.z+this.w*n.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)},lengthManhattan: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())},setLength:function(n){return this.multiplyScalar(n/this.length())},lerp:function(n,t){return this.x+=(n.x-this.x)*t,this.y+=(n.y-this.y)*t,this.z+=(n.z-this.z)*t,this.w+=(n.w-this.w)*t,this},lerpVectors:function(n,t,i){return this.subVectors(t,n).multiplyScalar(i).add(n)},equals:function(n){return n.x===this.x&&n.y===this.y&&n.z===this.z&&n.w===this.w},fromArray:function(n,t){return t===undefined&&(t=0),this.x=n[t],this.y=n[t+1],this.z=n[t+2],this.w=n[t+3],this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this.x,n[t+1]=this.y,n[t+2]=this.z,n[t+3]=this.w,n},fromBufferAttribute:function(n,t,i){return i!==undefined&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=n.getX(t),this.y=n.getY(t),this.z=n.getZ(t),this.w=n.getW(t),this}}),Object.assign(lu.prototype,vi.prototype,{isWebGLRenderTarget:!0,setSize:function(n,t){(this.width!==n||this.height!==t)&&(this.width=n,this.height=t,this.dispose()),this.viewport.set(0,0,n,t),this.scissor.set(0,0,n,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.width=n.width,this.height=n.height,this.viewport.copy(n.viewport),this.texture=n.texture.clone(),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),au.prototype=Object.create(lu.prototype),au.prototype.constructor=au,au.prototype.isWebGLRenderTargetCube=!0,Object.assign(g,{slerp:function(n,t,i,r){return i.copy(n).slerp(t,r)},slerpFlat:function(n,t,i,r,u,f,e){var o=i[r+0],s=i[r+1],h=i[r+2],c=i[r+3],g=u[f+0],d=u[f+1],w=u[f+2],b=u[f+3],p,k,v,a;if(c!==b||o!==g||s!==d||h!==w){var l=1-e,y=o*g+s*d+h*w+c*b,nt=y>=0?1:-1,tt=1-y*y;tt>Number.EPSILON&&(p=Math.sqrt(tt),k=Math.atan2(p,y*nt),l=Math.sin(l*k)/p,e=Math.sin(e*k)/p),v=e*nt,o=o*l+g*v,s=s*l+d*v,h=h*l+w*v,c=c*l+b*v,l===1-e&&(a=1/Math.sqrt(o*o+s*s+h*h+c*c),o*=a,s*=a,h*=a,c*=a)}n[t]=o,n[t+1]=s,n[t+2]=h,n[t+3]=c}}),Object.defineProperties(g.prototype,{x:{get:function(){return this._x},set:function(n){this._x=n,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(n){this._y=n,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(n){this._z=n,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(n){this._w=n,this.onChangeCallback()}}}),Object.assign(g.prototype,{set:function(n,t,i,r){return this._x=n,this._y=t,this._z=i,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(n){return this._x=n.x,this._y=n.y,this._z=n.z,this._w=n.w,this.onChangeCallback(),this},setFromEuler:function(n,t){if((n&&n.isEuler)===!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var l=n._x,a=n._y,v=n._z,s=n.order,h=Math.cos,c=Math.sin,i=h(l/2),r=h(a/2),u=h(v/2),f=c(l/2),e=c(a/2),o=c(v/2);return s==="XYZ"?(this._x=f*r*u+i*e*o,this._y=i*e*u-f*r*o,this._z=i*r*o+f*e*u,this._w=i*r*u-f*e*o):s==="YXZ"?(this._x=f*r*u+i*e*o,this._y=i*e*u-f*r*o,this._z=i*r*o-f*e*u,this._w=i*r*u+f*e*o):s==="ZXY"?(this._x=f*r*u-i*e*o,this._y=i*e*u+f*r*o,this._z=i*r*o+f*e*u,this._w=i*r*u-f*e*o):s==="ZYX"?(this._x=f*r*u-i*e*o,this._y=i*e*u+f*r*o,this._z=i*r*o-f*e*u,this._w=i*r*u+f*e*o):s==="YZX"?(this._x=f*r*u+i*e*o,this._y=i*e*u+f*r*o,this._z=i*r*o-f*e*u,this._w=i*r*u-f*e*o):s==="XZY"&&(this._x=f*r*u-i*e*o,this._y=i*e*u-f*r*o,this._z=i*r*o+f*e*u,this._w=i*r*u+f*e*o),t!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(n,t){var r=t/2,i=Math.sin(r);return this._x=n.x*i,this._y=n.y*i,this._z=n.z*i,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(n){var i=n.elements,r=i[0],e=i[4],o=i[8],s=i[1],u=i[5],h=i[9],c=i[2],l=i[6],f=i[10],a=r+u+f,t;return a>0?(t=.5/Math.sqrt(a+1),this._w=.25/t,this._x=(l-h)*t,this._y=(o-c)*t,this._z=(s-e)*t):r>u&&r>f?(t=2*Math.sqrt(1+r-u-f),this._w=(l-h)/t,this._x=.25*t,this._y=(e+s)/t,this._z=(o+c)/t):u>f?(t=2*Math.sqrt(1+u-r-f),this._w=(o-c)/t,this._x=(e+s)/t,this._y=.25*t,this._z=(h+l)/t):(t=2*Math.sqrt(1+f-r-u),this._w=(s-e)/t,this._x=(o+c)/t,this._y=(h+l)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var n=new t,i,r=1e-6;return function(u,f){return n===undefined&&(n=new t),i=u.dot(f)+1,i<r?(i=0,Math.abs(u.x)>Math.abs(u.z)?n.set(-u.y,u.x,0):n.set(0,-u.z,u.y)):n.crossVectors(u,f),this._x=n.x,this._y=n.y,this._z=n.z,this._w=i,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(n){return this._x*n._x+this._y*n._y+this._z*n._z+this._w*n._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 n=this.length();return n===0?(this._x=0,this._y=0,this._z=0,this._w=1):(n=1/n,this._x=this._x*n,this._y=this._y*n,this._z=this._z*n,this._w=this._w*n),this.onChangeCallback(),this},multiply:function(n,t){return t!==undefined?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(n,t)):this.multiplyQuaternions(this,n)},premultiply:function(n){return this.multiplyQuaternions(n,this)},multiplyQuaternions:function(n,t){var i=n._x,r=n._y,u=n._z,f=n._w,e=t._x,o=t._y,s=t._z,h=t._w;return this._x=i*h+f*e+r*s-u*o,this._y=r*h+f*o+u*e-i*s,this._z=u*h+f*s+i*o-r*e,this._w=f*h-i*e-r*o-u*s,this.onChangeCallback(),this},slerp:function(n,t){var r;if(t===0)return this;if(t===1)return this.copy(n);var u=this._x,f=this._y,e=this._z,o=this._w,i=o*n._w+u*n._x+f*n._y+e*n._z;if(i<0?(this._w=-n._w,this._x=-n._x,this._y=-n._y,this._z=-n._z,i=-i):this.copy(n),i>=1)return this._w=o,this._x=u,this._y=f,this._z=e,this;if(r=Math.sqrt(1-i*i),Math.abs(r)<.001)return this._w=.5*(o+this._w),this._x=.5*(u+this._x),this._y=.5*(f+this._y),this._z=.5*(e+this._z),this;var c=Math.atan2(r,i),s=Math.sin((1-t)*c)/r,h=Math.sin(t*c)/r;return this._w=o*s+this._w*h,this._x=u*s+this._x*h,this._y=f*s+this._y*h,this._z=e*s+this._z*h,this.onChangeCallback(),this},equals:function(n){return n._x===this._x&&n._y===this._y&&n._z===this._z&&n._w===this._w},fromArray:function(n,t){return t===undefined&&(t=0),this._x=n[t],this._y=n[t+1],this._z=n[t+2],this._w=n[t+3],this.onChangeCallback(),this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this._x,n[t+1]=this._y,n[t+2]=this._z,n[t+3]=this._w,n},onChange:function(n){return this.onChangeCallback=n,this},onChangeCallback:function(){}}),Object.assign(t.prototype,{isVector3:!0,set:function(n,t,i){return this.x=n,this.y=t,this.z=i,this},setScalar:function(n){return this.x=n,this.y=n,this.z=n,this},setX:function(n){return this.x=n,this},setY:function(n){return this.y=n,this},setZ:function(n){return this.z=n,this},setComponent:function(n,t){switch(n){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+n);}return this},getComponent:function(n){switch(n){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+n);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(n){return this.x=n.x,this.y=n.y,this.z=n.z,this},add:function(n,t){return t!==undefined?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(n,t)):(this.x+=n.x,this.y+=n.y,this.z+=n.z,this)},addScalar:function(n){return this.x+=n,this.y+=n,this.z+=n,this},addVectors:function(n,t){return this.x=n.x+t.x,this.y=n.y+t.y,this.z=n.z+t.z,this},addScaledVector:function(n,t){return this.x+=n.x*t,this.y+=n.y*t,this.z+=n.z*t,this},sub:function(n,t){return t!==undefined?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(n,t)):(this.x-=n.x,this.y-=n.y,this.z-=n.z,this)},subScalar:function(n){return this.x-=n,this.y-=n,this.z-=n,this},subVectors:function(n,t){return this.x=n.x-t.x,this.y=n.y-t.y,this.z=n.z-t.z,this},multiply:function(n,t){return t!==undefined?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(n,t)):(this.x*=n.x,this.y*=n.y,this.z*=n.z,this)},multiplyScalar:function(n){return this.x*=n,this.y*=n,this.z*=n,this},multiplyVectors:function(n,t){return this.x=n.x*t.x,this.y=n.y*t.y,this.z=n.z*t.z,this},applyEuler:function(){var n=new g;return function(t){return(t&&t.isEuler)===!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(n.setFromEuler(t))}}(),applyAxisAngle:function(){var n=new g;return function(t,i){return this.applyQuaternion(n.setFromAxisAngle(t,i))}}(),applyMatrix3:function(n){var i=this.x,r=this.y,u=this.z,t=n.elements;return this.x=t[0]*i+t[3]*r+t[6]*u,this.y=t[1]*i+t[4]*r+t[7]*u,this.z=t[2]*i+t[5]*r+t[8]*u,this},applyMatrix4:function(n){var i=this.x,r=this.y,u=this.z,t=n.elements,f;return this.x=t[0]*i+t[4]*r+t[8]*u+t[12],this.y=t[1]*i+t[5]*r+t[9]*u+t[13],this.z=t[2]*i+t[6]*r+t[10]*u+t[14],f=t[3]*i+t[7]*r+t[11]*u+t[15],this.divideScalar(f)},applyQuaternion:function(n){var f=this.x,e=this.y,o=this.z,t=n.x,i=n.y,r=n.z,u=n.w,s=u*f+i*o-r*e,h=u*e+r*f-t*o,c=u*o+t*e-i*f,l=-t*f-i*e-r*o;return this.x=s*u+l*-t+h*-r-c*-i,this.y=h*u+l*-i+c*-t-s*-r,this.z=c*u+l*-r+s*-i-h*-t,this},project:function(){var n=new o;return function(t){return n.multiplyMatrices(t.projectionMatrix,n.getInverse(t.matrixWorld)),this.applyMatrix4(n)}}(),unproject:function(){var n=new o;return function(t){return n.multiplyMatrices(t.matrixWorld,n.getInverse(t.projectionMatrix)),this.applyMatrix4(n)}}(),transformDirection:function(n){var i=this.x,r=this.y,u=this.z,t=n.elements;return this.x=t[0]*i+t[4]*r+t[8]*u,this.y=t[1]*i+t[5]*r+t[9]*u,this.z=t[2]*i+t[6]*r+t[10]*u,this.normalize()},divide:function(n){return this.x/=n.x,this.y/=n.y,this.z/=n.z,this},divideScalar:function(n){return this.multiplyScalar(1/n)},min:function(n){return this.x=Math.min(this.x,n.x),this.y=Math.min(this.y,n.y),this.z=Math.min(this.z,n.z),this},max:function(n){return this.x=Math.max(this.x,n.x),this.y=Math.max(this.y,n.y),this.z=Math.max(this.z,n.z),this},clamp:function(n,t){return this.x=Math.max(n.x,Math.min(t.x,this.x)),this.y=Math.max(n.y,Math.min(t.y,this.y)),this.z=Math.max(n.z,Math.min(t.z,this.z)),this},clampScalar:function(){var n=new t,i=new t;return function(t,r){return n.set(t,t,t),i.set(r,r,r),this.clamp(n,i)}}(),clampLength:function(n,t){var i=this.length();return this.multiplyScalar(Math.max(n,Math.min(t,i))/i)},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(n){return this.x*n.x+this.y*n.y+this.z*n.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)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(n){return this.multiplyScalar(n/this.length())},lerp:function(n,t){return this.x+=(n.x-this.x)*t,this.y+=(n.y-this.y)*t,this.z+=(n.z-this.z)*t,this},lerpVectors:function(n,t,i){return this.subVectors(t,n).multiplyScalar(i).add(n)},cross:function(n,t){if(t!==undefined)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(n,t);var i=this.x,r=this.y,u=this.z;return this.x=r*n.z-u*n.y,this.y=u*n.x-i*n.z,this.z=i*n.y-r*n.x,this},crossVectors:function(n,t){var i=n.x,r=n.y,u=n.z,f=t.x,e=t.y,o=t.z;return this.x=r*o-u*e,this.y=u*f-i*o,this.z=i*e-r*f,this},projectOnVector:function(n){var t=n.dot(this)/n.lengthSq();return this.copy(n).multiplyScalar(t)},projectOnPlane:function(){var n=new t;return function(t){return n.copy(this).projectOnVector(t),this.sub(n)}}(),reflect:function(){var n=new t;return function(t){return this.sub(n.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(n){var t=this.dot(n)/Math.sqrt(this.lengthSq()*n.lengthSq());return Math.acos(c.clamp(t,-1,1))},distanceTo:function(n){return Math.sqrt(this.distanceToSquared(n))},distanceToSquared:function(n){var t=this.x-n.x,i=this.y-n.y,r=this.z-n.z;return t*t+i*i+r*r},distanceToManhattan:function(n){return Math.abs(this.x-n.x)+Math.abs(this.y-n.y)+Math.abs(this.z-n.z)},setFromSpherical:function(n){var t=Math.sin(n.phi)*n.radius;return this.x=t*Math.sin(n.theta),this.y=Math.cos(n.phi)*n.radius,this.z=t*Math.cos(n.theta),this},setFromCylindrical:function(n){return this.x=n.radius*Math.sin(n.theta),this.y=n.y,this.z=n.radius*Math.cos(n.theta),this},setFromMatrixPosition:function(n){return this.setFromMatrixColumn(n,3)},setFromMatrixScale:function(n){var t=this.setFromMatrixColumn(n,0).length(),i=this.setFromMatrixColumn(n,1).length(),r=this.setFromMatrixColumn(n,2).length();return this.x=t,this.y=i,this.z=r,this},setFromMatrixColumn:function(n,t){return this.fromArray(n.elements,t*4)},equals:function(n){return n.x===this.x&&n.y===this.y&&n.z===this.z},fromArray:function(n,t){return t===undefined&&(t=0),this.x=n[t],this.y=n[t+1],this.z=n[t+2],this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this.x,n[t+1]=this.y,n[t+2]=this.z,n},fromBufferAttribute:function(n,t,i){return i!==undefined&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=n.getX(t),this.y=n.getY(t),this.z=n.getZ(t),this}}),Object.assign(o.prototype,{isMatrix4:!0,set:function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p){var w=this.elements;return w[0]=n,w[4]=t,w[8]=i,w[12]=r,w[1]=u,w[5]=f,w[9]=e,w[13]=o,w[2]=s,w[6]=h,w[10]=c,w[14]=l,w[3]=a,w[7]=v,w[11]=y,w[15]=p,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 o).fromArray(this.elements)},copy:function(n){var t=this.elements,i=n.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this},copyPosition:function(n){var t=this.elements,i=n.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this},extractBasis:function(n,t,i){return n.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(n,t,i){return this.set(n.x,t.x,i.x,0,n.y,t.y,i.y,0,n.z,t.z,i.z,0,0,0,0,1),this},extractRotation:function(){var n=new t;return function(t){var i=this.elements,r=t.elements,u=1/n.setFromMatrixColumn(t,0).length(),f=1/n.setFromMatrixColumn(t,1).length(),e=1/n.setFromMatrixColumn(t,2).length();return i[0]=r[0]*u,i[1]=r[1]*u,i[2]=r[2]*u,i[4]=r[4]*f,i[5]=r[5]*f,i[6]=r[6]*f,i[8]=r[8]*e,i[9]=r[9]*e,i[10]=r[10]*e,this}}(),makeRotationFromEuler:function(n){(n&&n.isEuler)===!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,tt=n.x,nt=n.y,g=n.z,f=Math.cos(tt),i=Math.sin(tt),e=Math.cos(nt),r=Math.sin(nt),o=Math.cos(g),u=Math.sin(g);if(n.order==="XYZ"){var y=f*o,w=f*u,p=i*o,k=i*u;t[0]=e*o,t[4]=-e*u,t[8]=r,t[1]=w+p*r,t[5]=y-k*r,t[9]=-i*e,t[2]=k-y*r,t[6]=p+w*r,t[10]=f*e}else if(n.order==="YXZ"){var v=e*o,a=e*u,l=r*o,c=r*u;t[0]=v+c*i,t[4]=l*i-a,t[8]=f*r,t[1]=f*u,t[5]=f*o,t[9]=-i,t[2]=a*i-l,t[6]=c+v*i,t[10]=f*e}else if(n.order==="ZXY"){var v=e*o,a=e*u,l=r*o,c=r*u;t[0]=v-c*i,t[4]=-f*u,t[8]=l+a*i,t[1]=a+l*i,t[5]=f*o,t[9]=c-v*i,t[2]=-f*r,t[6]=i,t[10]=f*e}else if(n.order==="ZYX"){var y=f*o,w=f*u,p=i*o,k=i*u;t[0]=e*o,t[4]=p*r-w,t[8]=y*r+k,t[1]=e*u,t[5]=k*r+y,t[9]=w*r-p,t[2]=-r,t[6]=i*e,t[10]=f*e}else if(n.order==="YZX"){var h=f*e,s=f*r,b=i*e,d=i*r;t[0]=e*o,t[4]=d-h*u,t[8]=b*u+s,t[1]=u,t[5]=f*o,t[9]=-i*o,t[2]=-r*o,t[6]=s*u+b,t[10]=h-d*u}else if(n.order==="XZY"){var h=f*e,s=f*r,b=i*e,d=i*r;t[0]=e*o,t[4]=-u,t[8]=r*o,t[1]=h*u+d,t[5]=f*o,t[9]=s*u-b,t[2]=b*u-s,t[6]=i*o,t[10]=d*u+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(n){var t=this.elements,i=n._x,u=n._y,f=n._z,e=n._w,s=i+i,o=u+u,r=f+f,c=i*s,l=i*o,a=i*r,v=u*o,y=u*r,p=f*r,w=e*s,h=e*o,b=e*r;return t[0]=1-(v+p),t[4]=l-b,t[8]=a+h,t[1]=l+b,t[5]=1-(c+p),t[9]=y-w,t[2]=a-h,t[6]=y+w,t[10]=1-(c+v),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var i=new t,r=new t,n=new t;return function(t,u,f){var e=this.elements;return n.subVectors(t,u),n.lengthSq()===0&&(n.z=1),n.normalize(),i.crossVectors(f,n),i.lengthSq()===0&&(n.z+=.0001,i.crossVectors(f,n)),i.normalize(),r.crossVectors(n,i),e[0]=i.x,e[4]=r.x,e[8]=n.x,e[1]=i.y,e[5]=r.y,e[9]=n.y,e[2]=i.z,e[6]=r.z,e[10]=n.z,this}}(),multiply:function(n,t){return t!==undefined?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(n,t)):this.multiplyMatrices(this,n)},premultiply:function(n){return this.multiplyMatrices(n,this)},multiplyMatrices:function(n,t){var i=n.elements,r=t.elements,u=this.elements,vt=i[0],at=i[4],lt=i[8],ct=i[12],ht=i[1],st=i[5],ot=i[9],et=i[13],ft=i[2],ut=i[6],rt=i[10],it=i[14],tt=i[3],g=i[7],yt=i[11],d=i[15],v=r[0],f=r[4],e=r[8],o=r[12],s=r[1],h=r[5],c=r[9],k=r[13],a=r[2],l=r[6],y=r[10],p=r[14],w=r[3],b=r[7],nt=r[11],pt=r[15];return u[0]=vt*v+at*s+lt*a+ct*w,u[4]=vt*f+at*h+lt*l+ct*b,u[8]=vt*e+at*c+lt*y+ct*nt,u[12]=vt*o+at*k+lt*p+ct*pt,u[1]=ht*v+st*s+ot*a+et*w,u[5]=ht*f+st*h+ot*l+et*b,u[9]=ht*e+st*c+ot*y+et*nt,u[13]=ht*o+st*k+ot*p+et*pt,u[2]=ft*v+ut*s+rt*a+it*w,u[6]=ft*f+ut*h+rt*l+it*b,u[10]=ft*e+ut*c+rt*y+it*nt,u[14]=ft*o+ut*k+rt*p+it*pt,u[3]=tt*v+g*s+yt*a+d*w,u[7]=tt*f+g*h+yt*l+d*b,u[11]=tt*e+g*c+yt*y+d*nt,u[15]=tt*o+g*k+yt*p+d*pt,this},multiplyScalar:function(n){var t=this.elements;return t[0]*=n,t[4]*=n,t[8]*=n,t[12]*=n,t[1]*=n,t[5]*=n,t[9]*=n,t[13]*=n,t[2]*=n,t[6]*=n,t[10]*=n,t[14]*=n,t[3]*=n,t[7]*=n,t[11]*=n,t[15]*=n,this},applyToBufferAttribute:function(){var n=new t;return function(t){for(var i=0,r=t.count;i<r;i++)n.x=t.getX(i),n.y=t.getY(i),n.z=t.getZ(i),n.applyMatrix4(this),t.setXYZ(i,n.x,n.y,n.z);return t}}(),determinant:function(){var n=this.elements,l=n[0],c=n[4],h=n[8],s=n[12],o=n[1],a=n[5],f=n[9],e=n[13],u=n[2],r=n[6],i=n[10],t=n[14],y=n[3],p=n[7],v=n[11],w=n[15];return y*(+s*f*r-h*e*r-s*a*i+c*e*i+h*a*t-c*f*t)+p*(+l*f*t-l*e*i+s*o*i-h*o*t+h*e*u-s*f*u)+v*(+l*e*r-l*a*t-s*o*r+c*o*t+s*a*u-c*e*u)+w*(-h*a*u-l*f*r+l*a*i+h*o*r-c*o*i+c*f*u)},transpose:function(){var n=this.elements,t;return t=n[1],n[1]=n[4],n[4]=t,t=n[2],n[2]=n[8],n[8]=t,t=n[6],n[6]=n[9],n[9]=t,t=n[3],n[3]=n[12],n[12]=t,t=n[7],n[7]=n[13],n[13]=t,t=n[11],n[11]=n[14],n[14]=t,this},setPosition:function(n){var t=this.elements;return t[12]=n.x,t[13]=n.y,t[14]=n.z,this},getInverse:function(n,t){var g=this.elements,d=n.elements,i=d[0],r=d[1],u=d[2],f=d[3],w=d[4],p=d[5],y=d[6],v=d[7],b=d[8],a=d[9],l=d[10],c=d[11],h=d[12],s=d[13],o=d[14],e=d[15],tt=a*o*v-s*l*v+s*y*c-p*o*c-a*y*e+p*l*e,it=h*l*v-b*o*v-h*y*c+w*o*c+b*y*e-w*l*e,rt=b*s*v-h*a*v+h*p*c-w*s*c-b*p*e+w*a*e,ut=h*a*y-b*s*y-h*p*l+w*s*l+b*p*o-w*a*o,ft=i*tt+r*it+u*rt+f*ut,nt,k;if(ft===0){if(nt="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0",t===!0)throw new Error(nt);else console.warn(nt);return this.identity()}return k=1/ft,g[0]=tt*k,g[1]=(s*l*f-a*o*f-s*u*c+r*o*c+a*u*e-r*l*e)*k,g[2]=(p*o*f-s*y*f+s*u*v-r*o*v-p*u*e+r*y*e)*k,g[3]=(a*y*f-p*l*f-a*u*v+r*l*v+p*u*c-r*y*c)*k,g[4]=it*k,g[5]=(b*o*f-h*l*f+h*u*c-i*o*c-b*u*e+i*l*e)*k,g[6]=(h*y*f-w*o*f-h*u*v+i*o*v+w*u*e-i*y*e)*k,g[7]=(w*l*f-b*y*f+b*u*v-i*l*v-w*u*c+i*y*c)*k,g[8]=rt*k,g[9]=(h*a*f-b*s*f-h*r*c+i*s*c+b*r*e-i*a*e)*k,g[10]=(w*s*f-h*p*f+h*r*v-i*s*v-w*r*e+i*p*e)*k,g[11]=(b*p*f-w*a*f-b*r*v+i*a*v+w*r*c-i*p*c)*k,g[12]=ut*k,g[13]=(b*s*u-h*a*u+h*r*l-i*s*l-b*r*o+i*a*o)*k,g[14]=(h*p*u-w*s*u-h*r*y+i*s*y+w*r*o-i*p*o)*k,g[15]=(w*a*u-b*p*u+b*r*y-i*a*y-w*r*l+i*p*l)*k,this},scale:function(n){var t=this.elements,i=n.x,r=n.y,u=n.z;return t[0]*=i,t[4]*=r,t[8]*=u,t[1]*=i,t[5]*=r,t[9]*=u,t[2]*=i,t[6]*=r,t[10]*=u,t[3]*=i,t[7]*=r,t[11]*=u,this},getMaxScaleOnAxis:function(){var n=this.elements,t=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],i=n[4]*n[4]+n[5]*n[5]+n[6]*n[6],r=n[8]*n[8]+n[9]*n[9]+n[10]*n[10];return Math.sqrt(Math.max(t,i,r))},makeTranslation:function(n,t,i){return this.set(1,0,0,n,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(n){var t=Math.cos(n),i=Math.sin(n);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(n){var t=Math.cos(n),i=Math.sin(n);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(n){var t=Math.cos(n),i=Math.sin(n);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(n,t){var e=Math.cos(t),r=Math.sin(t),s=1-e,o=n.x,u=n.y,i=n.z,f=s*o,h=s*u;return this.set(f*o+e,f*u-r*i,f*i+r*u,0,f*u+r*i,h*u+e,h*i-r*o,0,f*i-r*u,h*i+r*o,s*i*i+e,0,0,0,0,1),this},makeScale:function(n,t,i){return this.set(n,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(n,t,i){return this.set(1,t,i,0,n,1,i,0,n,t,1,0,0,0,0,1),this},compose:function(n,t,i){return this.makeRotationFromQuaternion(t),this.scale(i),this.setPosition(n),this},decompose:function(){var i=new t,n=new o;return function(t,r,u){var f=this.elements,e=i.set(f[0],f[1],f[2]).length(),c=i.set(f[4],f[5],f[6]).length(),l=i.set(f[8],f[9],f[10]).length(),a=this.determinant();a<0&&(e=-e),t.x=f[12],t.y=f[13],t.z=f[14],n.copy(this);var o=1/e,s=1/c,h=1/l;return n.elements[0]*=o,n.elements[1]*=o,n.elements[2]*=o,n.elements[4]*=s,n.elements[5]*=s,n.elements[6]*=s,n.elements[8]*=h,n.elements[9]*=h,n.elements[10]*=h,r.setFromRotationMatrix(n),u.x=e,u.y=c,u.z=l,this}}(),makePerspective:function(n,t,i,r,u,f){f===undefined&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var e=this.elements,o=2*u/(t-n),s=2*u/(i-r),h=(t+n)/(t-n),c=(i+r)/(i-r),l=-(f+u)/(f-u),a=-2*f*u/(f-u);return e[0]=o,e[4]=0,e[8]=h,e[12]=0,e[1]=0,e[5]=s,e[9]=c,e[13]=0,e[2]=0,e[6]=0,e[10]=l,e[14]=a,e[3]=0,e[7]=0,e[11]=-1,e[15]=0,this},makeOrthographic:function(n,t,i,r,u,f){var e=this.elements,o=1/(t-n),s=1/(i-r),h=1/(f-u),c=(t+n)*o,l=(i+r)*s,a=(f+u)*h;return e[0]=2*o,e[4]=0,e[8]=0,e[12]=-c,e[1]=0,e[5]=2*s,e[9]=0,e[13]=-l,e[2]=0,e[6]=0,e[10]=-2*h,e[14]=-a,e[3]=0,e[7]=0,e[11]=0,e[15]=1,this},equals:function(n){for(var i=this.elements,r=n.elements,t=0;t<16;t++)if(i[t]!==r[t])return!1;return!0},fromArray:function(n,t){t===undefined&&(t=0);for(var i=0;i<16;i++)this.elements[i]=n[i+t];return this},toArray:function(n,t){n===undefined&&(n=[]),t===undefined&&(t=0);var i=this.elements;return n[t]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=i[3],n[t+4]=i[4],n[t+5]=i[5],n[t+6]=i[6],n[t+7]=i[7],n[t+8]=i[8],n[t+9]=i[9],n[t+10]=i[10],n[t+11]=i[11],n[t+12]=i[12],n[t+13]=i[13],n[t+14]=i[14],n[t+15]=i[15],n}}),fu.prototype=Object.create(w.prototype),fu.prototype.constructor=fu,fu.prototype.isDataTexture=!0,ki.prototype=Object.create(w.prototype),ki.prototype.constructor=ki,ki.prototype.isCubeTexture=!0,Object.defineProperty(ki.prototype,"images",{get:function(){return this.image},set:function(n){this.image=n}}),bl=new w,pl=new ki;var rp=[],ip=[],gy=new Float32Array(16),rb=new Float32Array(9);td.prototype.setValue=function(n,t){for(var u=this.seq,r,i=0,f=u.length;i!==f;++i)r=u[i],r.setValue(n,t[r.id])},tl=/([\w\d_]+)(\])?(\[|\.)?/g,cr.prototype.setValue=function(n,t,i){var r=this.map[t];r!==undefined&&r.setValue(n,i,this.renderer)},cr.prototype.setOptional=function(n,t,i){var r=t[i];r!==undefined&&this.setValue(n,i,r)},cr.upload=function(n,t,i,r){for(var f,e,u=0,o=t.length;u!==o;++u)f=t[u],e=i[f.id],e.needsUpdate!==!1&&f.setValue(n,e.value,r)},cr.seqWithValue=function(n,t){for(var u=[],r,i=0,f=n.length;i!==f;++i)r=n[i],r.id in t&&u.push(r);return u},bk={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,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},Object.assign(e.prototype,{isColor:!0,r:1,g:1,b:1,set:function(n){return n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n),this},setScalar:function(n){return this.r=n,this.g=n,this.b=n,this},setHex:function(n){return n=Math.floor(n),this.r=(n>>16&255)/255,this.g=(n>>8&255)/255,this.b=(n&255)/255,this},setRGB:function(n,t,i){return this.r=n,this.g=t,this.b=i,this},setHSL:function(){function n(n,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*6*(2/3-i):n}return function(t,i,r){if(t=c.euclideanModulo(t,1),i=c.clamp(i,0,1),r=c.clamp(r,0,1),i===0)this.r=this.g=this.b=r;else{var u=r<=.5?r*(1+i):r+i-r*i,f=2*r-u;this.r=n(f,u,t+1/3),this.g=n(f,u,t),this.b=n(f,u,t-1/3)}return this}}(),setStyle:function(n){function f(t){t!==undefined&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+n+" will be ignored.")}var r,i,o,u,e,t;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(n)){o=r[1],u=r[2];switch(o){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(u))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,f(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(u))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,f(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(u)){var s=parseFloat(i[1])/360,h=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return f(i[5]),this.setHSL(s,h,c)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(n)){if(t=r[1],e=t.length,e===3)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(e===6)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return n&&n.length>0&&(t=bk[n],t!==undefined?this.setHex(t):console.warn("THREE.Color: Unknown color "+n)),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(n){return this.r=n.r,this.g=n.g,this.b=n.b,this},copyGammaToLinear:function(n,t){return t===undefined&&(t=2),this.r=Math.pow(n.r,t),this.g=Math.pow(n.g,t),this.b=Math.pow(n.b,t),this},copyLinearToGamma:function(n,t){t===undefined&&(t=2);var i=t>0?1/t:1;return this.r=Math.pow(n.r,i),this.g=Math.pow(n.g,i),this.b=Math.pow(n.b,i),this},convertGammaToLinear:function(){var n=this.r,t=this.g,i=this.b;return this.r=n*n,this.g=t*t,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(n){var s=n||{h:0,s:0,l:0},e=this.r,t=this.g,i=this.b,r=Math.max(e,t,i),o=Math.min(e,t,i),u,h,c=(o+r)/2,f;if(o===r)u=0,h=0;else{f=r-o,h=c<=.5?f/(r+o):f/(2-r-o);switch(r){case e:u=(t-i)/f+(t<i?6:0);break;case t:u=(i-e)/f+2;break;case i:u=(e-t)/f+4}u/=6}return s.h=u,s.s=h,s.l=c,s},getStyle:function(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"},offsetHSL:function(n,t,i){var r=this.getHSL();return r.h+=n,r.s+=t,r.l+=i,this.setHSL(r.h,r.s,r.l),this},add:function(n){return this.r+=n.r,this.g+=n.g,this.b+=n.b,this},addColors:function(n,t){return this.r=n.r+t.r,this.g=n.g+t.g,this.b=n.b+t.b,this},addScalar:function(n){return this.r+=n,this.g+=n,this.b+=n,this},sub:function(n){return this.r=Math.max(0,this.r-n.r),this.g=Math.max(0,this.g-n.g),this.b=Math.max(0,this.b-n.b),this},multiply:function(n){return this.r*=n.r,this.g*=n.g,this.b*=n.b,this},multiplyScalar:function(n){return this.r*=n,this.g*=n,this.b*=n,this},lerp:function(n,t){return this.r+=(n.r-this.r)*t,this.g+=(n.g-this.g)*t,this.b+=(n.b-this.b)*t,this},equals:function(n){return n.r===this.r&&n.g===this.g&&n.b===this.b},fromArray:function(n,t){return t===undefined&&(t=0),this.r=n[t],this.g=n[t+1],this.b=n[t+2],this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this.r,n[t+1]=this.g,n[t+2]=this.b,n},toJSON:function(){return this.getHex()}});var h={common:{diffuse:{value:new e(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new y(0,0,1,1)},specularMap:{value:null},alphaMap:{value:null},envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},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 i(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:.00025},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new e(16777215)}},lights:{ambientLightColor:{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:{}}},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},offsetRepeat:{value:new y(0,0,1,1)}}},et={merge:function(n){for(var u={},i,r,t=0;t<n.length;t++){i=this.clone(n[t]);for(r in i)u[r]=i[r]}return u},clone:function(n){var r={},i,u,t;for(i in n){r[i]={};for(u in n[i])t=n[i][u],r[i][u]=t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture)?t.clone():Array.isArray(t)?t.slice():t}return r}},art="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",lrt="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",crt="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",hrt="#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\n",srt="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",ort="\nvec3 transformed = vec3( position );\n",ert="\nvec3 objectNormal = vec3( normal );\n",frt="float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\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}\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 theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\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.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - 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 * transpose( 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\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn 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\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\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}\n",urt="#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 = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\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\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",rrt="#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",irt="#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",tit="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",nit="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",gtt="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",dtt="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",kn="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",bn="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",wn="#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 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n",pn="#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(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\n",yn="#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",vn="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",an="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",dn="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",ln="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",hn="  gl_FragColor = linearToOutputTexel( gl_FragColor );\n",sn="\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\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.w );\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.w );\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.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, 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.x, 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 = value.rgb * cLogLuvM;\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 = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",on="#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, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * 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\n",en="#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\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\n",fn="#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\n",un="#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\n",rn="\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",cn="#ifdef USE_FOG\n  varying float fogDepth;\n#endif\n",gn="#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\n",ntt="#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\n",ttt="#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\n",ktt="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",btt="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",wtt="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 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\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\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\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\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",ptt="uniform vec3 ambientLightColor;\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};\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 ltcMat;\tuniform sampler2D ltcMag;\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\n#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( 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(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 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\n",ytt="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",vtt="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};\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_BlinnPhong( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in BlinnPhongMaterial 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 = BlinnExponentToGGXRoughness( material.specularShininess );\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\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3(   1,   0, t.y ),\n\t\t\tvec3(   0, t.z,   0 ),\n\t\t\tvec3( t.w,   0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\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_Direct_RectArea\t\tRE_Direct_RectArea_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",att="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\n",ltt="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\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3(   1,   0, t.y ),\n\t\t\tvec3(   0, t.z,   0 ),\n\t\t\tvec3( t.w,   0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), 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\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, 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\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\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}\n",ctt="\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\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 ] ) : 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\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\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\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\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 ( NUM_HEMI_LIGHTS > 0 )\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\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",htt="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",stt="#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",ott="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",ett="#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",ftt="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",rtt="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",itt="#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",git="#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",grt="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",wet="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",tut="#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\n",het="#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",cet="#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\n",aet="#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",vet="#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 ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",yet="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",pet="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\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}\n",uot="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",bet="#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",ket="#if defined( DITHERING )\n  gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",det="#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\n",get="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",not="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",tot="#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\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\treturn (\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( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, 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( 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 / 9.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\treturn (\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\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\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 ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\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\n",iot="#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\n",rot="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\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\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\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",oot="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\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\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\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 ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",fot="#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",kot="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform 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\n",bot="#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\tskinned  = bindMatrixInverse * skinned;\n#endif\n",wot="#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#endif\n",pot="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",yot="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",vot="#if defined( TONE_MAPPING )\n  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",dot="#define saturate(a) clamp( a, 0.0, 1.0 )\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}\n",lot="#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",cot="#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 vec4 offsetRepeat;\n#endif\n",aot="#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 = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",eot="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",sot="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",hot="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",set="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",oet="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",eet="varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",fet="#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( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",nft="#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#include <begin_vertex>\n\t#include <displacementmap_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}\n",gut="uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",dut="varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition;\n}\n",kut="uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",but="varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",wut="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}\n",put="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}\n",yut="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 <normal_flip>\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}\n",vut="#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}\n",tft="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\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>\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#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 <normal_flip>\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}\n",aut="#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\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>\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}\n",cut="#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>\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_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\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}\n",hut="#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 <displacementmap_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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",sut="#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#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 <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\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 <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\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}\n",out="#define PHYSICAL\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 <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 <specularmap_pars_fragment>\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 <displacementmap_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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",eut="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\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>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",fut="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\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>\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#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",uut="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_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}\n",rut="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadowmap_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 <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",iut="uniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n",lut="#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}\n",v={alphamap_fragment:art,alphamap_pars_fragment:lrt,alphatest_fragment:crt,aomap_fragment:hrt,aomap_pars_fragment:srt,begin_vertex:ort,beginnormal_vertex:ert,bsdfs:frt,bumpmap_pars_fragment:urt,clipping_planes_fragment:rrt,clipping_planes_pars_fragment:irt,clipping_planes_pars_vertex:tit,clipping_planes_vertex:nit,color_fragment:gtt,color_pars_fragment:dtt,color_pars_vertex:kn,color_vertex:bn,common:wn,cube_uv_reflection_fragment:pn,defaultnormal_vertex:yn,displacementmap_pars_vertex:vn,displacementmap_vertex:an,emissivemap_fragment:dn,emissivemap_pars_fragment:ln,encodings_fragment:hn,encodings_pars_fragment:sn,envmap_fragment:on,envmap_pars_fragment:en,envmap_pars_vertex:fn,envmap_vertex:un,fog_vertex:rn,fog_pars_vertex:cn,fog_fragment:gn,fog_pars_fragment:ntt,gradientmap_pars_fragment:ttt,lightmap_fragment:ktt,lightmap_pars_fragment:btt,lights_lambert_vertex:wtt,lights_pars:ptt,lights_phong_fragment:ytt,lights_phong_pars_fragment:vtt,lights_physical_fragment:att,lights_physical_pars_fragment:ltt,lights_template:ctt,logdepthbuf_fragment:htt,logdepthbuf_pars_fragment:stt,logdepthbuf_pars_vertex:ott,logdepthbuf_vertex:ett,map_fragment:ftt,map_pars_fragment:rtt,map_particle_fragment:itt,map_particle_pars_fragment:git,metalnessmap_fragment:grt,metalnessmap_pars_fragment:wet,morphnormal_vertex:tut,morphtarget_pars_vertex:het,morphtarget_vertex:cet,normal_flip:aet,normal_fragment:vet,normalmap_pars_fragment:yet,packing:pet,premultiplied_alpha_fragment:uot,project_vertex:bet,dithering_fragment:ket,dithering_pars_fragment:det,roughnessmap_fragment:get,roughnessmap_pars_fragment:not,shadowmap_pars_fragment:tot,shadowmap_pars_vertex:iot,shadowmap_vertex:rot,shadowmask_pars_fragment:oot,skinbase_vertex:fot,skinning_pars_vertex:kot,skinning_vertex:bot,skinnormal_vertex:wot,specularmap_fragment:pot,specularmap_pars_fragment:yot,tonemapping_fragment:vot,tonemapping_pars_fragment:dot,uv_pars_fragment:lot,uv_pars_vertex:cot,uv_vertex:aot,uv2_pars_fragment:eot,uv2_pars_vertex:sot,uv2_vertex:hot,worldpos_vertex:set,cube_frag:oet,cube_vert:eet,depth_frag:fet,depth_vert:nft,distanceRGBA_frag:gut,distanceRGBA_vert:dut,equirect_frag:kut,equirect_vert:but,linedashed_frag:wut,linedashed_vert:put,meshbasic_frag:yut,meshbasic_vert:vut,meshlambert_frag:tft,meshlambert_vert:aut,meshphong_frag:cut,meshphong_vert:hut,meshphysical_frag:sut,meshphysical_vert:out,normal_frag:eut,normal_vert:fut,points_frag:uut,points_vert:rut,shadow_frag:iut,shadow_vert:lut},nr={basic:{uniforms:et.merge([h.common,h.aomap,h.lightmap,h.fog]),vertexShader:v.meshbasic_vert,fragmentShader:v.meshbasic_frag},lambert:{uniforms:et.merge([h.common,h.aomap,h.lightmap,h.emissivemap,h.fog,h.lights,{emissive:{value:new e(0)}}]),vertexShader:v.meshlambert_vert,fragmentShader:v.meshlambert_frag},phong:{uniforms:et.merge([h.common,h.aomap,h.lightmap,h.emissivemap,h.bumpmap,h.normalmap,h.displacementmap,h.gradientmap,h.fog,h.lights,{emissive:{value:new e(0)},specular:{value:new e(1118481)},shininess:{value:30}}]),vertexShader:v.meshphong_vert,fragmentShader:v.meshphong_frag},standard:{uniforms:et.merge([h.common,h.aomap,h.lightmap,h.emissivemap,h.bumpmap,h.normalmap,h.displacementmap,h.roughnessmap,h.metalnessmap,h.fog,h.lights,{emissive:{value:new e(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:v.meshphysical_vert,fragmentShader:v.meshphysical_frag},points:{uniforms:et.merge([h.points,h.fog]),vertexShader:v.points_vert,fragmentShader:v.points_frag},dashed:{uniforms:et.merge([h.common,h.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:v.linedashed_vert,fragmentShader:v.linedashed_frag},depth:{uniforms:et.merge([h.common,h.displacementmap]),vertexShader:v.depth_vert,fragmentShader:v.depth_frag},normal:{uniforms:et.merge([h.common,h.bumpmap,h.normalmap,h.displacementmap,{opacity:{value:1}}]),vertexShader:v.normal_vert,fragmentShader:v.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:v.cube_vert,fragmentShader:v.cube_frag},equirect:{uniforms:{tEquirect:{value:null},tFlip:{value:-1}},vertexShader:v.equirect_vert,fragmentShader:v.equirect_frag},distanceRGBA:{uniforms:{lightPos:{value:new t}},vertexShader:v.distanceRGBA_vert,fragmentShader:v.distanceRGBA_frag}};nr.physical={uniforms:et.merge([nr.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:v.meshphysical_vert,fragmentShader:v.meshphysical_frag},Object.assign(oc.prototype,{set:function(n,t){return this.min.copy(n),this.max.copy(t),this},setFromPoints:function(n){this.makeEmpty();for(var t=0,i=n.length;t<i;t++)this.expandByPoint(n[t]);return this},setFromCenterAndSize:function(){var n=new i;return function(t,i){var r=n.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.min.copy(n.min),this.max.copy(n.max),this},makeEmpty:function(){return this.min.x=this.min.y=+ Infinity,this.max.x=this.max.y=- Infinity,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(n){var t=n||new i;return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(n){var t=n||new i;return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(n){return this.min.min(n),this.max.max(n),this},expandByVector:function(n){return this.min.sub(n),this.max.add(n),this},expandByScalar:function(n){return this.min.addScalar(-n),this.max.addScalar(n),this},containsPoint:function(n){return n.x<this.min.x||n.x>this.max.x||n.y<this.min.y||n.y>this.max.y?!1:!0},containsBox:function(n){return this.min.x<=n.min.x&&n.max.x<=this.max.x&&this.min.y<=n.min.y&&n.max.y<=this.max.y},getParameter:function(n,t){var r=t||new i;return r.set((n.x-this.min.x)/(this.max.x-this.min.x),(n.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(n){return n.max.x<this.min.x||n.min.x>this.max.x||n.max.y<this.min.y||n.min.y>this.max.y?!1:!0},clampPoint:function(n,t){var r=t||new i;return r.copy(n).clamp(this.min,this.max)},distanceToPoint:function(){var n=new i;return function(t){var i=n.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(n){return this.min.max(n.min),this.max.min(n.max),this},union:function(n){return this.min.min(n.min),this.max.max(n.max),this},translate:function(n){return this.min.add(n),this.max.add(n),this},equals:function(n){return n.min.equals(this.min)&&n.max.equals(this.max)}}),id=0,Object.assign(a.prototype,vi.prototype,{isMaterial:!0,setValues:function(n){var t,i,r;if(n!==undefined)for(t in n){if(i=n[t],i===undefined){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(r=this[t],r===undefined){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=t==="overdraw"?Number(i):i}},toJSON:function(n){function f(n){var i=[],r,t;for(r in n)t=n[r],delete t.metadata,i.push(t);return i}var u=n===undefined,t,i,r;return u&&(n={textures:{},images:{}}),t={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}},t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.color&&this.color.isColor&&(t.color=this.color.getHex()),this.roughness!==undefined&&(t.roughness=this.roughness),this.metalness!==undefined&&(t.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(t.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(t.specular=this.specular.getHex()),this.shininess!==undefined&&(t.shininess=this.shininess),this.clearCoat!==undefined&&(t.clearCoat=this.clearCoat),this.clearCoatRoughness!==undefined&&(t.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(t.map=this.map.toJSON(n).uuid),this.alphaMap&&this.alphaMap.isTexture&&(t.alphaMap=this.alphaMap.toJSON(n).uuid),this.lightMap&&this.lightMap.isTexture&&(t.lightMap=this.lightMap.toJSON(n).uuid),this.bumpMap&&this.bumpMap.isTexture&&(t.bumpMap=this.bumpMap.toJSON(n).uuid,t.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(t.normalMap=this.normalMap.toJSON(n).uuid,t.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(t.displacementMap=this.displacementMap.toJSON(n).uuid,t.displacementScale=this.displacementScale,t.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(t.roughnessMap=this.roughnessMap.toJSON(n).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(t.metalnessMap=this.metalnessMap.toJSON(n).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(t.emissiveMap=this.emissiveMap.toJSON(n).uuid),this.specularMap&&this.specularMap.isTexture&&(t.specularMap=this.specularMap.toJSON(n).uuid),this.envMap&&this.envMap.isTexture&&(t.envMap=this.envMap.toJSON(n).uuid,t.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(t.gradientMap=this.gradientMap.toJSON(n).uuid),this.size!==undefined&&(t.size=this.size),this.sizeAttenuation!==undefined&&(t.sizeAttenuation=this.sizeAttenuation),this.blending!==ce&&(t.blending=this.blending),this.shading!==ya&&(t.shading=this.shading),this.side!==bu&&(t.side=this.side),this.vertexColors!==sh&&(t.vertexColors=this.vertexColors),this.opacity<1&&(t.opacity=this.opacity),this.transparent===!0&&(t.transparent=this.transparent),t.depthFunc=this.depthFunc,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,this.alphaTest>0&&(t.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(t.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(t.wireframe=this.wireframe),this.wireframeLinewidth>1&&(t.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(t.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(t.wireframeLinejoin=this.wireframeLinejoin),t.skinning=this.skinning,t.morphTargets=this.morphTargets,t.dithering=this.dithering,u&&(i=f(n.textures),r=f(n.images),i.length>0&&(t.textures=i),r.length>0&&(t.images=r)),t},clone:function(){return(new this.constructor).copy(this)},copy:function(n){var i,r,u,t;if(this.name=n.name,this.fog=n.fog,this.lights=n.lights,this.blending=n.blending,this.side=n.side,this.shading=n.shading,this.vertexColors=n.vertexColors,this.opacity=n.opacity,this.transparent=n.transparent,this.blendSrc=n.blendSrc,this.blendDst=n.blendDst,this.blendEquation=n.blendEquation,this.blendSrcAlpha=n.blendSrcAlpha,this.blendDstAlpha=n.blendDstAlpha,this.blendEquationAlpha=n.blendEquationAlpha,this.depthFunc=n.depthFunc,this.depthTest=n.depthTest,this.depthWrite=n.depthWrite,this.colorWrite=n.colorWrite,this.precision=n.precision,this.polygonOffset=n.polygonOffset,this.polygonOffsetFactor=n.polygonOffsetFactor,this.polygonOffsetUnits=n.polygonOffsetUnits,this.dithering=n.dithering,this.alphaTest=n.alphaTest,this.premultipliedAlpha=n.premultipliedAlpha,this.overdraw=n.overdraw,this.visible=n.visible,this.clipShadows=n.clipShadows,this.clipIntersection=n.clipIntersection,i=n.clippingPlanes,r=null,i!==null)for(u=i.length,r=new Array(u),t=0;t!==u;++t)r[t]=i[t].clone();return this.clippingPlanes=r,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ft.prototype=Object.create(a.prototype),ft.prototype.constructor=ft,ft.prototype.isShaderMaterial=!0,ft.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.fragmentShader=n.fragmentShader,this.vertexShader=n.vertexShader,this.uniforms=et.clone(n.uniforms),this.defines=n.defines,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.lights=n.lights,this.clipping=n.clipping,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this.extensions=n.extensions,this},ft.prototype.toJSON=function(n){var t=a.prototype.toJSON.call(this,n);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},bi.prototype=Object.create(a.prototype),bi.prototype.constructor=bi,bi.prototype.isMeshDepthMaterial=!0,bi.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.depthPacking=n.depthPacking,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.map=n.map,this.alphaMap=n.alphaMap,this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this},Object.assign(hi.prototype,{isBox3:!0,set:function(n,t){return this.min.copy(n),this.max.copy(t),this},setFromArray:function(n){for(var f=+ Infinity,e=+ Infinity,o=+ Infinity,s=- Infinity,h=- Infinity,c=- Infinity,t=0,l=n.length;t<l;t+=3){var i=n[t],r=n[t+1],u=n[t+2];i<f&&(f=i),r<e&&(e=r),u<o&&(o=u),i>s&&(s=i),r>h&&(h=r),u>c&&(c=u)}return this.min.set(f,e,o),this.max.set(s,h,c),this},setFromBufferAttribute:function(n){for(var f=+ Infinity,e=+ Infinity,o=+ Infinity,s=- Infinity,h=- Infinity,c=- Infinity,t=0,l=n.count;t<l;t++){var i=n.getX(t),r=n.getY(t),u=n.getZ(t);i<f&&(f=i),r<e&&(e=r),u<o&&(o=u),i>s&&(s=i),r>h&&(h=r),u>c&&(c=u)}return this.min.set(f,e,o),this.max.set(s,h,c),this},setFromPoints:function(n){this.makeEmpty();for(var t=0,i=n.length;t<i;t++)this.expandByPoint(n[t]);return this},setFromCenterAndSize:function(){var n=new t;return function(t,i){var r=n.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(n){return this.makeEmpty(),this.expandByObject(n)},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.min.copy(n.min),this.max.copy(n.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=+ Infinity,this.max.x=this.max.y=this.max.z=- Infinity,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(n){var i=n||new t;return this.isEmpty()?i.set(0,0,0):i.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(n){var i=n||new t;return this.isEmpty()?i.set(0,0,0):i.subVectors(this.max,this.min)},expandByPoint:function(n){return this.min.min(n),this.max.max(n),this},expandByVector:function(n){return this.min.sub(n),this.max.add(n),this},expandByScalar:function(n){return this.min.addScalar(-n),this.max.addScalar(n),this},expandByObject:function(){var n=new t;return function(t){var i=this;return t.updateMatrixWorld(!0),t.traverse(function(t){var r,f,u=t.geometry,o,e;if(u!==undefined)if(u.isGeometry)for(o=u.vertices,r=0,f=o.length;r<f;r++)n.copy(o[r]),n.applyMatrix4(t.matrixWorld),i.expandByPoint(n);else if(u.isBufferGeometry&&(e=u.attributes.position,e!==undefined))for(r=0,f=e.count;r<f;r++)n.fromBufferAttribute(e,r).applyMatrix4(t.matrixWorld),i.expandByPoint(n)}),this}}(),containsPoint:function(n){return n.x<this.min.x||n.x>this.max.x||n.y<this.min.y||n.y>this.max.y||n.z<this.min.z||n.z>this.max.z?!1:!0},containsBox:function(n){return this.min.x<=n.min.x&&n.max.x<=this.max.x&&this.min.y<=n.min.y&&n.max.y<=this.max.y&&this.min.z<=n.min.z&&n.max.z<=this.max.z},getParameter:function(n,i){var r=i||new t;return r.set((n.x-this.min.x)/(this.max.x-this.min.x),(n.y-this.min.y)/(this.max.y-this.min.y),(n.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(n){return n.max.x<this.min.x||n.min.x>this.max.x||n.max.y<this.min.y||n.min.y>this.max.y||n.max.z<this.min.z||n.min.z>this.max.z?!1:!0},intersectsSphere:function(){var n=new t;return function(t){return this.clampPoint(t.center,n),n.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(n){var t,i;return n.normal.x>0?(t=n.normal.x*this.min.x,i=n.normal.x*this.max.x):(t=n.normal.x*this.max.x,i=n.normal.x*this.min.x),n.normal.y>0?(t+=n.normal.y*this.min.y,i+=n.normal.y*this.max.y):(t+=n.normal.y*this.max.y,i+=n.normal.y*this.min.y),n.normal.z>0?(t+=n.normal.z*this.min.z,i+=n.normal.z*this.max.z):(t+=n.normal.z*this.max.z,i+=n.normal.z*this.min.z),t<=n.constant&&i>=n.constant},clampPoint:function(n,i){var r=i||new t;return r.copy(n).clamp(this.min,this.max)},distanceToPoint:function(){var n=new t;return function(t){var i=n.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var n=new t;return function(t){var i=t||new ri;return this.getCenter(i.center),i.radius=this.getSize(n).length()*.5,i}}(),intersect:function(n){return this.min.max(n.min),this.max.min(n.max),this.isEmpty()&&this.makeEmpty(),this},union:function(n){return this.min.min(n.min),this.max.max(n.max),this},applyMatrix4:function(){var n=[new t,new t,new t,new t,new t,new t,new t,new t];return function(t){return this.isEmpty()?this:(n[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),n[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),n[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),n[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),n[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),n[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),n[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),n[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(n),this)}}(),translate:function(n){return this.min.add(n),this.max.add(n),this},equals:function(n){return n.min.equals(this.min)&&n.max.equals(this.max)}}),Object.assign(ri.prototype,{set:function(n,t){return this.center.copy(n),this.radius=t,this},setFromPoints:function(){var n=new hi;return function(t,i){var f=this.center,r,u,e;for(i!==undefined?f.copy(i):n.setFromPoints(t).getCenter(f),r=0,u=0,e=t.length;u<e;u++)r=Math.max(r,f.distanceToSquared(t[u]));return this.radius=Math.sqrt(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.center.copy(n.center),this.radius=n.radius,this},empty:function(){return this.radius<=0},containsPoint:function(n){return n.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(n){return n.distanceTo(this.center)-this.radius},intersectsSphere:function(n){var t=this.radius+n.radius;return n.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(n){return n.intersectsSphere(this)},intersectsPlane:function(n){return Math.abs(this.center.dot(n.normal)-n.constant)<=this.radius},clampPoint:function(n,i){var u=this.center.distanceToSquared(n),r=i||new t;return r.copy(n),u>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(n){var t=n||new hi;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(n){return this.center.applyMatrix4(n),this.radius=this.radius*n.getMaxScaleOnAxis(),this},translate:function(n){return this.center.add(n),this},equals:function(n){return n.center.equals(this.center)&&n.radius===this.radius}}),Object.assign(ti.prototype,{isMatrix3:!0,set:function(n,t,i,r,u,f,e,o,s){var h=this.elements;return h[0]=n,h[1]=r,h[2]=e,h[3]=t,h[4]=u,h[5]=o,h[6]=i,h[7]=f,h[8]=s,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(n){var t=this.elements,i=n.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this},setFromMatrix4:function(n){var t=n.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(){var n=new t;return function(t){for(var i=0,r=t.count;i<r;i++)n.x=t.getX(i),n.y=t.getY(i),n.z=t.getZ(i),n.applyMatrix3(this),t.setXYZ(i,n.x,n.y,n.z);return t}}(),multiply:function(n){return this.multiplyMatrices(this,n)},premultiply:function(n){return this.multiplyMatrices(n,this)},multiplyMatrices:function(n,t){var i=n.elements,r=t.elements,u=this.elements,g=i[0],d=i[3],k=i[6],b=i[1],w=i[4],p=i[7],v=i[2],nt=i[5],a=i[8],l=r[0],c=r[3],h=r[6],s=r[1],o=r[4],e=r[7],f=r[2],y=r[5],tt=r[8];return u[0]=g*l+d*s+k*f,u[3]=g*c+d*o+k*y,u[6]=g*h+d*e+k*tt,u[1]=b*l+w*s+p*f,u[4]=b*c+w*o+p*y,u[7]=b*h+w*e+p*tt,u[2]=v*l+nt*s+a*f,u[5]=v*c+nt*o+a*y,u[8]=v*h+nt*e+a*tt,this},multiplyScalar:function(n){var t=this.elements;return t[0]*=n,t[3]*=n,t[6]*=n,t[1]*=n,t[4]*=n,t[7]*=n,t[2]*=n,t[5]*=n,t[8]*=n,this},determinant:function(){var n=this.elements,t=n[0],i=n[1],r=n[2],u=n[3],f=n[4],e=n[5],o=n[6],s=n[7],h=n[8];return t*f*h-t*e*s-i*u*h+i*e*o+r*u*s-r*f*o},getInverse:function(n,t){var y,i;n&&n.isMatrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var u=n.elements,r=this.elements,f=u[0],e=u[1],o=u[2],s=u[3],h=u[4],v=u[5],c=u[6],l=u[7],a=u[8],p=a*h-v*l,w=v*c-a*s,b=l*s-h*c,k=f*p+e*w+o*b;if(k===0){if(y="THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0",t===!0)throw new Error(y);else console.warn(y);return this.identity()}return i=1/k,r[0]=p*i,r[1]=(o*l-a*e)*i,r[2]=(v*e-o*h)*i,r[3]=w*i,r[4]=(a*f-o*c)*i,r[5]=(o*s-v*f)*i,r[6]=b*i,r[7]=(e*c-l*f)*i,r[8]=(h*f-e*s)*i,this},transpose:function(){var t,n=this.elements;return t=n[1],n[1]=n[3],n[3]=t,t=n[2],n[2]=n[6],n[6]=t,t=n[5],n[5]=n[7],n[7]=t,this},getNormalMatrix:function(n){return this.setFromMatrix4(n).getInverse(this).transpose()},transposeIntoArray:function(n){var t=this.elements;return n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],this},equals:function(n){for(var i=this.elements,r=n.elements,t=0;t<9;t++)if(i[t]!==r[t])return!1;return!0},fromArray:function(n,t){t===undefined&&(t=0);for(var i=0;i<9;i++)this.elements[i]=n[i+t];return this},toArray:function(n,t){n===undefined&&(n=[]),t===undefined&&(t=0);var i=this.elements;return n[t]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=i[3],n[t+4]=i[4],n[t+5]=i[5],n[t+6]=i[6],n[t+7]=i[7],n[t+8]=i[8],n}}),Object.assign(bt.prototype,{set:function(n,t){return this.normal.copy(n),this.constant=t,this},setComponents:function(n,t,i,r){return this.normal.set(n,t,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(n,t){return this.normal.copy(n),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var n=new t,i=new t;return function(t,r,u){var f=n.subVectors(u,r).cross(i.subVectors(t,r)).normalize();return this.setFromNormalAndCoplanarPoint(f,t),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.normal.copy(n.normal),this.constant=n.constant,this},normalize:function(){var n=1/this.normal.length();return this.normal.multiplyScalar(n),this.constant*=n,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(n){return this.normal.dot(n)+this.constant},distanceToSphere:function(n){return this.distanceToPoint(n.center)-n.radius},projectPoint:function(n,t){return this.orthoPoint(n,t).sub(n).negate()},orthoPoint:function(n,i){var r=this.distanceToPoint(n),u=i||new t;return u.copy(this.normal).multiplyScalar(r)},intersectLine:function(){var n=new t;return function(i,r){var f=r||new t,e=i.delta(n),o=this.normal.dot(e),u;return o===0?this.distanceToPoint(i.start)===0?f.copy(i.start):undefined:(u=-(i.start.dot(this.normal)+this.constant)/o,u<0||u>1)?undefined:f.copy(e).multiplyScalar(u).add(i.start)}}(),intersectsLine:function(n){var t=this.distanceToPoint(n.start),i=this.distanceToPoint(n.end);return t<0&&i>0||i<0&&t>0},intersectsBox:function(n){return n.intersectsPlane(this)},intersectsSphere:function(n){return n.intersectsPlane(this)},coplanarPoint:function(n){var i=n||new t;return i.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var n=new t,i=new ti;return function(t,r){var u=this.coplanarPoint(n).applyMatrix4(t),f=r||i.getNormalMatrix(t),e=this.normal.applyMatrix3(f).normalize();return this.constant=-u.dot(e),this}}(),translate:function(n){return this.constant=this.constant-n.dot(this.normal),this},equals:function(n){return n.normal.equals(this.normal)&&n.constant===this.constant}}),Object.assign(lh.prototype,{set:function(n,t,i,r,u,f){var e=this.planes;return e[0].copy(n),e[1].copy(t),e[2].copy(i),e[3].copy(r),e[4].copy(u),e[5].copy(f),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){for(var i=this.planes,t=0;t<6;t++)i[t].copy(n.planes[t]);return this},setFromMatrix:function(n){var e=this.planes,t=n.elements,l=t[0],o=t[1],b=t[2],u=t[3],s=t[4],h=t[5],k=t[6],r=t[7],a=t[8],v=t[9],y=t[10],i=t[11],p=t[12],w=t[13],c=t[14],f=t[15];return e[0].setComponents(u-l,r-s,i-a,f-p).normalize(),e[1].setComponents(u+l,r+s,i+a,f+p).normalize(),e[2].setComponents(u+o,r+h,i+v,f+w).normalize(),e[3].setComponents(u-o,r-h,i-v,f-w).normalize(),e[4].setComponents(u-b,r-k,i-y,f-c).normalize(),e[5].setComponents(u+b,r+k,i+y,f+c).normalize(),this},intersectsObject:function(){var n=new ri;return function(t){var i=t.geometry;return i.boundingSphere===null&&i.computeBoundingSphere(),n.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(n)}}(),intersectsSprite:function(){var n=new ri;return function(t){return n.center.set(0,0,0),n.radius=.70710678118654757,n.applyMatrix4(t.matrixWorld),this.intersectsSphere(n)}}(),intersectsSphere:function(n){for(var r=this.planes,u=n.center,f=-n.radius,i,t=0;t<6;t++)if(i=r[t].distanceToPoint(u),i<f)return!1;return!0},intersectsBox:function(){var n=new t,i=new t;return function(t){for(var o=this.planes,r,f,e,u=0;u<6;u++)if(r=o[u],n.x=r.normal.x>0?t.min.x:t.max.x,i.x=r.normal.x>0?t.max.x:t.min.x,n.y=r.normal.y>0?t.min.y:t.max.y,i.y=r.normal.y>0?t.max.y:t.min.y,n.z=r.normal.z>0?t.min.z:t.max.z,i.z=r.normal.z>0?t.max.z:t.min.z,f=r.distanceToPoint(n),e=r.distanceToPoint(i),f<0&&e<0)return!1;return!0}}(),containsPoint:function(n){for(var i=this.planes,t=0;t<6;t++)if(i[t].distanceToPoint(n)<0)return!1;return!0}}),Object.assign(rr.prototype,{set:function(n,t){return this.origin.copy(n),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.origin.copy(n.origin),this.direction.copy(n.direction),this},at:function(n,i){var r=i||new t;return r.copy(this.direction).multiplyScalar(n).add(this.origin)},lookAt:function(n){return this.direction.copy(n).sub(this.origin).normalize(),this},recast:function(){var n=new t;return function(t){return this.origin.copy(this.at(t,n)),this}}(),closestPointToPoint:function(n,i){var r=i||new t,u;return(r.subVectors(n,this.origin),u=r.dot(this.direction),u<0)?r.copy(this.origin):r.copy(this.direction).multiplyScalar(u).add(this.origin)},distanceToPoint:function(n){return Math.sqrt(this.distanceSqToPoint(n))},distanceSqToPoint:function(){var n=new t;return function(t){var i=n.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(n.copy(this.direction).multiplyScalar(i).add(this.origin),n.distanceToSquared(t))}}(),distanceSqToSegment:function(){var r=new t,n=new t,i=new t;return function(t,u,f,e){var b;r.copy(t).add(u).multiplyScalar(.5),n.copy(u).sub(t).normalize(),i.copy(this.origin).sub(r);var h=t.distanceTo(u)*.5,c=-this.direction.dot(n),a=i.dot(this.direction),l=-i.dot(n),y=i.lengthSq(),w=Math.abs(1-c*c),s,o,v,p;return w>0?(s=c*l-a,o=c*a-l,p=h*w,s>=0?o>=-p?o<=p?(b=1/w,s*=b,o*=b,v=s*(s+c*o+2*a)+o*(c*s+o+2*l)+y):(o=h,s=Math.max(0,-(c*o+a)),v=-s*s+o*(o+2*l)+y):(o=-h,s=Math.max(0,-(c*o+a)),v=-s*s+o*(o+2*l)+y):o<=-p?(s=Math.max(0,-(-c*h+a)),o=s>0?-h:Math.min(Math.max(-h,-l),h),v=-s*s+o*(o+2*l)+y):o<=p?(s=0,o=Math.min(Math.max(-h,-l),h),v=o*(o+2*l)+y):(s=Math.max(0,-(c*h+a)),o=s>0?h:Math.min(Math.max(-h,-l),h),v=-s*s+o*(o+2*l)+y)):(o=c>0?-h:h,s=Math.max(0,-(c*o+a)),v=-s*s+o*(o+2*l)+y),f&&f.copy(this.direction).multiplyScalar(s).add(this.origin),e&&e.copy(n).multiplyScalar(o).add(r),v}}(),intersectSphere:function(){var n=new t;return function(t,i){n.subVectors(t.center,this.origin);var r=n.dot(this.direction),f=n.dot(n)-r*r,e=t.radius*t.radius;if(f>e)return null;var o=Math.sqrt(e-f),u=r-o,s=r+o;return u<0&&s<0?null:u<0?this.at(s,i):this.at(u,i)}}(),intersectsSphere:function(n){return this.distanceToPoint(n.center)<=n.radius},distanceToPlane:function(n){var i=n.normal.dot(this.direction),t;return i===0?n.distanceToPoint(this.origin)===0?0:null:(t=-(this.origin.dot(n.normal)+n.constant)/i,t>=0?t:null)},intersectPlane:function(n,t){var i=this.distanceToPlane(n);return i===null?null:this.at(i,t)},intersectsPlane:function(n){var t=n.distanceToPoint(this.origin),i;return t===0?!0:(i=n.normal.dot(this.direction),i*t<0)?!0:!1},intersectBox:function(n,t){var i,r,f,e,o,s,h=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,u=this.origin;return(h>=0?(i=(n.min.x-u.x)*h,r=(n.max.x-u.x)*h):(i=(n.max.x-u.x)*h,r=(n.min.x-u.x)*h),c>=0?(f=(n.min.y-u.y)*c,e=(n.max.y-u.y)*c):(f=(n.max.y-u.y)*c,e=(n.min.y-u.y)*c),i>e||f>r)?null:((f>i||i!==i)&&(i=f),(e<r||r!==r)&&(r=e),l>=0?(o=(n.min.z-u.z)*l,s=(n.max.z-u.z)*l):(o=(n.max.z-u.z)*l,s=(n.min.z-u.z)*l),i>s||o>r)?null:((o>i||i!==i)&&(i=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(i>=0?i:r,t)},intersectsBox:function(){var n=new t;return function(t){return this.intersectBox(t,n)!==null}}(),intersectTriangle:function(){var n=new t,r=new t,i=new t,u=new t;return function(t,f,e,o,s){var h,c,l,a,v;if(r.subVectors(f,t),i.subVectors(e,t),u.crossVectors(r,i),h=this.direction.dot(u),h>0){if(o)return null;c=1}else if(h<0)c=-1,h=-h;else return null;return(n.subVectors(this.origin,t),l=c*this.direction.dot(i.crossVectors(n,i)),l<0)?null:(a=c*this.direction.dot(r.cross(n)),a<0)?null:l+a>h?null:(v=-c*n.dot(u),v<0)?null:this.at(v/h,s)}}(),applyMatrix4:function(n){return this.direction.add(this.origin).applyMatrix4(n),this.origin.applyMatrix4(n),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(n){return n.origin.equals(this.origin)&&n.direction.equals(this.direction)}}),tr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],tr.DefaultOrder="XYZ",Object.defineProperties(tr.prototype,{x:{get:function(){return this._x},set:function(n){this._x=n,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(n){this._y=n,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(n){this._z=n,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(n){this._order=n,this.onChangeCallback()}}}),Object.assign(tr.prototype,{isEuler:!0,set:function(n,t,i,r){return this._x=n,this._y=t,this._z=i,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(n){return this._x=n._x,this._y=n._y,this._z=n._z,this._order=n._order,this.onChangeCallback(),this},setFromRotationMatrix:function(n,t,i){var u=c.clamp,r=n.elements,f=r[0],s=r[4],h=r[8],l=r[1],e=r[5],a=r[9],v=r[2],y=r[6],o=r[10];return t=t||this._order,t==="XYZ"?(this._y=Math.asin(u(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(-a,o),this._z=Math.atan2(-s,f)):(this._x=Math.atan2(y,e),this._z=0)):t==="YXZ"?(this._x=Math.asin(-u(a,-1,1)),Math.abs(a)<.99999?(this._y=Math.atan2(h,o),this._z=Math.atan2(l,e)):(this._y=Math.atan2(-v,f),this._z=0)):t==="ZXY"?(this._x=Math.asin(u(y,-1,1)),Math.abs(y)<.99999?(this._y=Math.atan2(-v,o),this._z=Math.atan2(-s,e)):(this._y=0,this._z=Math.atan2(l,f))):t==="ZYX"?(this._y=Math.asin(-u(v,-1,1)),Math.abs(v)<.99999?(this._x=Math.atan2(y,o),this._z=Math.atan2(l,f)):(this._x=0,this._z=Math.atan2(-s,e))):t==="YZX"?(this._z=Math.asin(u(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-a,e),this._y=Math.atan2(-v,f)):(this._x=0,this._y=Math.atan2(h,o))):t==="XZY"?(this._z=Math.asin(-u(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(y,e),this._y=Math.atan2(h,f)):(this._x=Math.atan2(-a,o),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,i!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var n=new o;return function(t,i,r){return n.makeRotationFromQuaternion(t),this.setFromRotationMatrix(n,i,r)}}(),setFromVector3:function(n,t){return this.set(n.x,n.y,n.z,t||this._order)},reorder:function(){var n=new g;return function(t){return n.setFromEuler(this),this.setFromQuaternion(n,t)}}(),equals:function(n){return n._x===this._x&&n._y===this._y&&n._z===this._z&&n._order===this._order},fromArray:function(n){return this._x=n[0],this._y=n[1],this._z=n[2],n[3]!==undefined&&(this._order=n[3]),this.onChangeCallback(),this},toArray:function(n,t){return n===undefined&&(n=[]),t===undefined&&(t=0),n[t]=this._x,n[t+1]=this._y,n[t+2]=this._z,n[t+3]=this._order,n},toVector3:function(n){return n?n.set(this._x,this._y,this._z):new t(this._x,this._y,this._z)},onChange:function(n){return this.onChangeCallback=n,this},onChangeCallback:function(){}}),Object.assign(ha.prototype,{set:function(n){this.mask=1<<n|0},enable:function(n){this.mask|=1<<n|0},toggle:function(n){this.mask^=1<<n|0},disable:function(n){this.mask&=~(1<<n|0)},test:function(n){return(this.mask&n.mask)!=0}}),yb=0,u.DefaultUp=new t(0,1,0),u.DefaultMatrixAutoUpdate=!0,Object.assign(u.prototype,vi.prototype,{isObject3D:!0,applyMatrix:function(n){this.matrix.multiplyMatrices(n,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(n,t){this.quaternion.setFromAxisAngle(n,t)},setRotationFromEuler:function(n){this.quaternion.setFromEuler(n,!0)},setRotationFromMatrix:function(n){this.quaternion.setFromRotationMatrix(n)},setRotationFromQuaternion:function(n){this.quaternion.copy(n)},rotateOnAxis:function(){var n=new g;return function(t,i){return n.setFromAxisAngle(t,i),this.quaternion.multiply(n),this}}(),rotateX:function(){var n=new t(1,0,0);return function(t){return this.rotateOnAxis(n,t)}}(),rotateY:function(){var n=new t(0,1,0);return function(t){return this.rotateOnAxis(n,t)}}(),rotateZ:function(){var n=new t(0,0,1);return function(t){return this.rotateOnAxis(n,t)}}(),translateOnAxis:function(){var n=new t;return function(t,i){return n.copy(t).applyQuaternion(this.quaternion),this.position.add(n.multiplyScalar(i)),this}}(),translateX:function(){var n=new t(1,0,0);return function(t){return this.translateOnAxis(n,t)}}(),translateY:function(){var n=new t(0,1,0);return function(t){return this.translateOnAxis(n,t)}}(),translateZ:function(){var n=new t(0,0,1);return function(t){return this.translateOnAxis(n,t)}}(),localToWorld:function(n){return n.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var n=new o;return function(t){return t.applyMatrix4(n.getInverse(this.matrixWorld))}}(),lookAt:function(){var n=new o;return function(t){this.isCamera?n.lookAt(this.position,t,this.up):n.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(n)}}(),add:function(n){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return n===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",n),this):(n&&n.isObject3D?(n.parent!==null&&n.parent.remove(n),n.parent=this,n.dispatchEvent({type:"added"}),this.children.push(n)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",n),this)},remove:function(n){var t,i;if(arguments.length>1)for(t=0;t<arguments.length;t++)this.remove(arguments[t]);i=this.children.indexOf(n),i!==-1&&(n.parent=null,n.dispatchEvent({type:"removed"}),this.children.splice(i,1))},getObjectById:function(n){return this.getObjectByProperty("id",n)},getObjectByName:function(n){return this.getObjectByProperty("name",n)},getObjectByProperty:function(n,t){var i,u,f,r;if(this[n]===t)return this;for(i=0,u=this.children.length;i<u;i++)if(f=this.children[i],r=f.getObjectByProperty(n,t),r!==undefined)return r;return undefined},getWorldPosition:function(n){var i=n||new t;return this.updateMatrixWorld(!0),i.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var n=new t,i=new t;return function(t){var r=t||new g;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(n,r,i),r}}(),getWorldRotation:function(){var n=new g;return function(t){var i=t||new tr;return this.getWorldQuaternion(n),i.setFromQuaternion(n,this.rotation.order,!1)}}(),getWorldScale:function(){var n=new t,i=new g;return function(r){var u=r||new t;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(n,i,u),u}}(),getWorldDirection:function(){var n=new g;return function(i){var r=i||new t;return this.getWorldQuaternion(n),r.set(0,0,1).applyQuaternion(n)}}(),raycast:function(){},traverse:function(n){var i,t,r;for(n(this),i=this.children,t=0,r=i.length;t<r;t++)i[t].traverse(n)},traverseVisible:function(n){var i,t,r;if(this.visible!==!1)for(n(this),i=this.children,t=0,r=i.length;t<r;t++)i[t].traverseVisible(n)},traverseAncestors:function(n){var t=this.parent;t!==null&&(n(t),t.traverseAncestors(n))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(n){var i,t,r;for(this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,n=!0),i=this.children,t=0,r=i.length;t<r;t++)i[t].updateMatrixWorld(n)},toJSON:function(n){function f(t,i){return t[i.uuid]===undefined&&(t[i.uuid]=i.toJSON(n)),i.uuid}function u(n){var i=[],r,t;for(r in n)t=n[r],delete t.metadata,i.push(t);return i}var o=n===undefined||n==="",r={},t,e,s,i;if(o&&(n={geometries:{},materials:{},textures:{},images:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"}),t={},t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),JSON.stringify(this.userData)!=="{}"&&(t.userData=this.userData),this.castShadow===!0&&(t.castShadow=!0),this.receiveShadow===!0&&(t.receiveShadow=!0),this.visible===!1&&(t.visible=!1),t.matrix=this.matrix.toArray(),this.geometry!==undefined&&(t.geometry=f(n.geometries,this.geometry)),this.material!==undefined)if(Array.isArray(this.material)){for(e=[],i=0,s=this.material.length;i<s;i++)e.push(f(n.materials,this.material[i]));t.material=e}else t.material=f(n.materials,this.material);if(this.children.length>0)for(t.children=[],i=0;i<this.children.length;i++)t.children.push(this.children[i].toJSON(n).object);if(o){var h=u(n.geometries),c=u(n.materials),l=u(n.textures),a=u(n.images);h.length>0&&(r.geometries=h),c.length>0&&(r.materials=c),l.length>0&&(r.textures=l),a.length>0&&(r.images=a)}return r.object=t,r},clone:function(n){return(new this.constructor).copy(this,n)},copy:function(n,t){var i,r;if(t===undefined&&(t=!0),this.name=n.name,this.up.copy(n.up),this.position.copy(n.position),this.quaternion.copy(n.quaternion),this.scale.copy(n.scale),this.matrix.copy(n.matrix),this.matrixWorld.copy(n.matrixWorld),this.matrixAutoUpdate=n.matrixAutoUpdate,this.matrixWorldNeedsUpdate=n.matrixWorldNeedsUpdate,this.layers.mask=n.layers.mask,this.visible=n.visible,this.castShadow=n.castShadow,this.receiveShadow=n.receiveShadow,this.frustumCulled=n.frustumCulled,this.renderOrder=n.renderOrder,this.userData=JSON.parse(JSON.stringify(n.userData)),t===!0)for(i=0;i<n.children.length;i++)r=n.children[i],this.add(r.clone());return this}}),Object.assign(yf.prototype,{set:function(n,t){return this.start.copy(n),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.start.copy(n.start),this.end.copy(n.end),this},getCenter:function(n){var i=n||new t;return i.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(n){var i=n||new t;return i.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(n,i){var r=i||new t;return this.delta(r).multiplyScalar(n).add(this.start)},closestPointToPointParameter:function(){var i=new t,n=new t;return function(t,r){i.subVectors(t,this.start),n.subVectors(this.end,this.start);var f=n.dot(n),e=n.dot(i),u=e/f;return r&&(u=c.clamp(u,0,1)),u}}(),closestPointToPoint:function(n,i,r){var u=this.closestPointToPointParameter(n,i),f=r||new t;return this.delta(f).multiplyScalar(u).add(this.start)},applyMatrix4:function(n){return this.start.applyMatrix4(n),this.end.applyMatrix4(n),this},equals:function(n){return n.start.equals(this.start)&&n.end.equals(this.end)}}),Object.assign(ci,{normal:function(){var n=new t;return function(i,r,u,f){var e=f||new t,o;return(e.subVectors(u,r),n.subVectors(i,r),e.cross(n),o=e.lengthSq(),o>0)?e.multiplyScalar(1/Math.sqrt(o)):e.set(0,0,0)}}(),barycoordFromPoint:function(){var n=new t,i=new t,r=new t;return function(u,f,e,o,s){n.subVectors(o,f),i.subVectors(e,f),r.subVectors(u,f);var c=n.dot(n),h=n.dot(i),l=n.dot(r),a=i.dot(i),v=i.dot(r),y=c*a-h*h,p=s||new t;if(y===0)return p.set(-2,-1,-1);var w=1/y,b=(a*l-h*v)*w,k=(c*v-h*l)*w;return p.set(1-b-k,k,b)}}(),containsPoint:function(){var n=new t;return function(t,i,r,u){var f=ci.barycoordFromPoint(t,i,r,u,n);return f.x>=0&&f.y>=0&&f.x+f.y<=1}}()}),Object.assign(ci.prototype,{set:function(n,t,i){return this.a.copy(n),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(n,t,i,r){return this.a.copy(n[t]),this.b.copy(n[i]),this.c.copy(n[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.a.copy(n.a),this.b.copy(n.b),this.c.copy(n.c),this},area:function(){var n=new t,i=new t;return function(){return n.subVectors(this.c,this.b),i.subVectors(this.a,this.b),n.cross(i).length()*.5}}(),midpoint:function(n){var i=n||new t;return i.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(n){return ci.normal(this.a,this.b,this.c,n)},plane:function(n){var t=n||new bt;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(n,t){return ci.barycoordFromPoint(n,this.a,this.b,this.c,t)},containsPoint:function(n){return ci.containsPoint(n,this.a,this.b,this.c)},closestPointToPoint:function(){var u=new bt,n=[new yf,new yf,new yf],i=new t,r=new t;return function(f,e){var s=e||new t,c=Infinity,o,h;if(u.setFromCoplanarPoints(this.a,this.b,this.c),u.projectPoint(f,i),this.containsPoint(i)===!0)s.copy(i);else for(n[0].set(this.a,this.b),n[1].set(this.b,this.c),n[2].set(this.c,this.a),o=0;o<n.length;o++)n[o].closestPointToPoint(i,!0,r),h=i.distanceToSquared(r),h<c&&(c=h,s.copy(r));return s}}(),equals:function(n){return n.a.equals(this.a)&&n.b.equals(this.b)&&n.c.equals(this.c)}}),Object.assign(li.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(n){var t,i;for(this.a=n.a,this.b=n.b,this.c=n.c,this.normal.copy(n.normal),this.color.copy(n.color),this.materialIndex=n.materialIndex,t=0,i=n.vertexNormals.length;t<i;t++)this.vertexNormals[t]=n.vertexNormals[t].clone();for(t=0,i=n.vertexColors.length;t<i;t++)this.vertexColors[t]=n.vertexColors[t].clone();return this}}),yt.prototype=Object.create(a.prototype),yt.prototype.constructor=yt,yt.prototype.isMeshBasicMaterial=!0,yt.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.specularMap=n.specularMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.combine=n.combine,this.reflectivity=n.reflectivity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this},Object.defineProperty(l.prototype,"needsUpdate",{set:function(n){n===!0&&this.version++}}),Object.assign(l.prototype,{isBufferAttribute:!0,setArray:function(n){if(Array.isArray(n))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=n!==undefined?n.length/this.itemSize:0,this.array=n},setDynamic:function(n){return this.dynamic=n,this},copy:function(n){return this.array=new n.array.constructor(n.array),this.itemSize=n.itemSize,this.count=n.count,this.normalized=n.normalized,this.dynamic=n.dynamic,this},copyAt:function(n,t,i){n*=this.itemSize,i*=t.itemSize;for(var r=0,u=this.itemSize;r<u;r++)this.array[n+r]=t.array[i+r];return this},copyArray:function(n){return this.array.set(n),this},copyColorsArray:function(n){for(var r=this.array,u=0,t,i=0,f=n.length;i<f;i++)t=n[i],t===undefined&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),t=new e),r[u++]=t.r,r[u++]=t.g,r[u++]=t.b;return this},copyIndicesArray:function(n){for(var r=this.array,u=0,i,t=0,f=n.length;t<f;t++)i=n[t],r[u++]=i.a,r[u++]=i.b,r[u++]=i.c;return this},copyVector2sArray:function(n){for(var u=this.array,f=0,r,t=0,e=n.length;t<e;t++)r=n[t],r===undefined&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",t),r=new i),u[f++]=r.x,u[f++]=r.y;return this},copyVector3sArray:function(n){for(var u=this.array,f=0,i,r=0,e=n.length;r<e;r++)i=n[r],i===undefined&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),i=new t),u[f++]=i.x,u[f++]=i.y,u[f++]=i.z;return this},copyVector4sArray:function(n){for(var r=this.array,u=0,t,i=0,f=n.length;i<f;i++)t=n[i],t===undefined&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),t=new y),r[u++]=t.x,r[u++]=t.y,r[u++]=t.z,r[u++]=t.w;return this},set:function(n,t){return t===undefined&&(t=0),this.array.set(n,t),this},getX:function(n){return this.array[n*this.itemSize]},setX:function(n,t){return this.array[n*this.itemSize]=t,this},getY:function(n){return this.array[n*this.itemSize+1]},setY:function(n,t){return this.array[n*this.itemSize+1]=t,this},getZ:function(n){return this.array[n*this.itemSize+2]},setZ:function(n,t){return this.array[n*this.itemSize+2]=t,this},getW:function(n){return this.array[n*this.itemSize+3]},setW:function(n,t){return this.array[n*this.itemSize+3]=t,this},setXY:function(n,t,i){return n*=this.itemSize,this.array[n+0]=t,this.array[n+1]=i,this},setXYZ:function(n,t,i,r){return n*=this.itemSize,this.array[n+0]=t,this.array[n+1]=i,this.array[n+2]=r,this},setXYZW:function(n,t,i,r,u){return n*=this.itemSize,this.array[n+0]=t,this.array[n+1]=i,this.array[n+2]=r,this.array[n+3]=u,this},onUpload:function(n){return this.onUploadCallback=n,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),io.prototype=Object.create(l.prototype),io.prototype.constructor=io,to.prototype=Object.create(l.prototype),to.prototype.constructor=to,no.prototype=Object.create(l.prototype),no.prototype.constructor=no,ge.prototype=Object.create(l.prototype),ge.prototype.constructor=ge,vr.prototype=Object.create(l.prototype),vr.prototype.constructor=vr,ao.prototype=Object.create(l.prototype),ao.prototype.constructor=ao,yr.prototype=Object.create(l.prototype),yr.prototype.constructor=yr,r.prototype=Object.create(l.prototype),r.prototype.constructor=r,ls.prototype=Object.create(l.prototype),ls.prototype.constructor=ls,Object.assign(pb.prototype,{computeGroups:function(n){for(var t,r=[],u=undefined,e=n.faces,f,i=0;i<e.length;i++)f=e[i],f.materialIndex!==u&&(u=f.materialIndex,t!==undefined&&(t.count=i*3-t.start,r.push(t)),t={start:i*3,materialIndex:u});t!==undefined&&(t.count=i*3-t.start,r.push(t)),this.groups=r},fromGeometry:function(n){var tt=n.faces,o=n.vertices,e=n.faceVertexUvs,ft=e[0]&&e[0].length>0,ut=e[1]&&e[1].length>0,nt=n.morphTargets,g=nt.length,w,d,p,y,t,r,h,l,s,c,f,b,u,k;if(g>0){for(w=[],t=0;t<g;t++)w[t]=[];this.morphTargets.position=w}if(d=n.morphNormals,p=d.length,p>0){for(y=[],t=0;t<p;t++)y[t]=[];this.morphTargets.normal=y}var v=n.skinIndices,a=n.skinWeights,it=v.length===o.length,rt=a.length===o.length;for(t=0;t<tt.length;t++){for(r=tt[t],this.vertices.push(o[r.a],o[r.b],o[r.c]),h=r.vertexNormals,h.length===3?this.normals.push(h[0],h[1],h[2]):(l=r.normal,this.normals.push(l,l,l)),s=r.vertexColors,s.length===3?this.colors.push(s[0],s[1],s[2]):(c=r.color,this.colors.push(c,c,c)),ft===!0&&(f=e[0][t],f!==undefined?this.uvs.push(f[0],f[1],f[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",t),this.uvs.push(new i,new i,new i))),ut===!0&&(f=e[1][t],f!==undefined?this.uvs2.push(f[0],f[1],f[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",t),this.uvs2.push(new i,new i,new i))),u=0;u<g;u++)b=nt[u].vertices,w[u].push(b[r.a],b[r.b],b[r.c]);for(u=0;u<p;u++)k=d[u].vertexNormals[t],y[u].push(k.a,k.b,k.c);it&&this.skinIndices.push(v[r.a],v[r.b],v[r.c]),rt&&this.skinWeights.push(a[r.a],a[r.b],a[r.c])}return this.computeGroups(n),this.verticesNeedUpdate=n.verticesNeedUpdate,this.normalsNeedUpdate=n.normalsNeedUpdate,this.colorsNeedUpdate=n.colorsNeedUpdate,this.uvsNeedUpdate=n.uvsNeedUpdate,this.groupsNeedUpdate=n.groupsNeedUpdate,this}}),ab=0,Object.assign(s.prototype,vi.prototype,{isGeometry:!0,applyMatrix:function(n){for(var f=(new ti).getNormalMatrix(n),e,r,u,o,t=0,i=this.vertices.length;t<i;t++)e=this.vertices[t],e.applyMatrix4(n);for(t=0,i=this.faces.length;t<i;t++)for(r=this.faces[t],r.normal.applyMatrix3(f).normalize(),u=0,o=r.vertexNormals.length;u<o;u++)r.vertexNormals[u].applyMatrix3(f).normalize();return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var n=new o;return function(t){return n.makeRotationX(t),this.applyMatrix(n),this}}(),rotateY:function(){var n=new o;return function(t){return n.makeRotationY(t),this.applyMatrix(n),this}}(),rotateZ:function(){var n=new o;return function(t){return n.makeRotationZ(t),this.applyMatrix(n),this}}(),translate:function(){var n=new o;return function(t,i,r){return n.makeTranslation(t,i,r),this.applyMatrix(n),this}}(),scale:function(){var n=new o;return function(t,i,r){return n.makeScale(t,i,r),this.applyMatrix(n),this}}(),lookAt:function(){var n=new u;return function(t){n.lookAt(t),n.updateMatrix(),this.applyMatrix(n.matrix)}}(),fromBufferGeometry:function(n){function p(n,t,i,r){var u=c!==undefined?[w[n].clone(),w[t].clone(),w[i].clone()]:[],f=l!==undefined?[s.colors[n].clone(),s.colors[t].clone(),s.colors[i].clone()]:[],e=new li(n,t,i,u,f,r);s.faces.push(e),k!==undefined&&s.faceVertexUvs[0].push([b[n].clone(),b[t].clone(),b[i].clone()]),a!==undefined&&s.faceVertexUvs[1].push([d[n].clone(),d[t].clone(),d[i].clone()])}var s=this,f=n.index!==null?n.index.array:undefined,o=n.attributes,h=o.position.array,c=o.normal!==undefined?o.normal.array:undefined,l=o.color!==undefined?o.color.array:undefined,k=o.uv!==undefined?o.uv.array:undefined,a=o.uv2!==undefined?o.uv2.array:undefined,y,u,nt,r;a!==undefined&&(this.faceVertexUvs[1]=[]);var w=[],b=[],d=[];for(r=0,u=0;r<h.length;r+=3,u+=2)s.vertices.push(new t(h[r],h[r+1],h[r+2])),c!==undefined&&w.push(new t(c[r],c[r+1],c[r+2])),l!==undefined&&s.colors.push(new e(l[r],l[r+1],l[r+2])),k!==undefined&&b.push(new i(k[u],k[u+1])),a!==undefined&&d.push(new i(a[u],a[u+1]));if(y=n.groups,y.length>0)for(r=0;r<y.length;r++){var v=y[r],g=v.start,tt=v.count;for(u=g,nt=g+tt;u<nt;u+=3)f!==undefined?p(f[u],f[u+1],f[u+2],v.materialIndex):p(u,u+1,u+2,v.materialIndex)}else if(f!==undefined)for(r=0;r<f.length;r+=3)p(f[r],f[r+1],f[r+2]);else for(r=0;r<h.length/3;r+=3)p(r,r+1,r+2);return this.computeFaceNormals(),n.boundingBox!==null&&(this.boundingBox=n.boundingBox.clone()),n.boundingSphere!==null&&(this.boundingSphere=n.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var n=this.boundingBox.getCenter().negate();return this.translate(n.x,n.y,n.z),n},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,i=this.boundingSphere.radius,n=i===0?1:1/i,r=new o;return r.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(r),this},computeFaceNormals:function(){for(var n=new t,u=new t,i=0,f=this.faces.length;i<f;i++){var r=this.faces[i],o=this.vertices[r.a],e=this.vertices[r.b],s=this.vertices[r.c];n.subVectors(s,e),u.subVectors(o,e),n.cross(u),n.normalize(),r.normal.copy(n)}},computeVertexNormals:function(n){var f,h,u,o,i,r,a,c,v,s,l,e;for(n===undefined&&(n=!0),r=new Array(this.vertices.length),f=0,h=this.vertices.length;f<h;f++)r[f]=new t;if(n)for(s=new t,l=new t,u=0,o=this.faces.length;u<o;u++)i=this.faces[u],a=this.vertices[i.a],c=this.vertices[i.b],v=this.vertices[i.c],s.subVectors(v,c),l.subVectors(a,c),s.cross(l),r[i.a].add(s),r[i.b].add(s),r[i.c].add(s);else for(this.computeFaceNormals(),u=0,o=this.faces.length;u<o;u++)i=this.faces[u],r[i.a].add(i.normal),r[i.b].add(i.normal),r[i.c].add(i.normal);for(f=0,h=this.vertices.length;f<h;f++)r[f].normalize();for(u=0,o=this.faces.length;u<o;u++)i=this.faces[u],e=i.vertexNormals,e.length===3?(e[0].copy(r[i.a]),e[1].copy(r[i.b]),e[2].copy(r[i.c])):(e[0]=r[i.a].clone(),e[1]=r[i.b].clone(),e[2]=r[i.c].clone());this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var i,r,n,t;for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)n=this.faces[i],t=n.vertexNormals,t.length===3?(t[0].copy(n.normal),t[1].copy(n.normal),t[2].copy(n.normal)):(t[0]=n.normal.clone(),t[1]=n.normal.clone(),t[2]=n.normal.clone());this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var i,o,n,e,l,a,c,h,f,r=0,u=this.faces.length;r<u;r++)for(n=this.faces[r],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),i=0,o=n.vertexNormals.length;i<o;i++)n.__originalVertexNormals[i]?n.__originalVertexNormals[i].copy(n.vertexNormals[i]):n.__originalVertexNormals[i]=n.vertexNormals[i].clone();for(e=new s,e.faces=this.faces,i=0,o=this.morphTargets.length;i<o;i++){if(!this.morphNormals[i])for(this.morphNormals[i]={},this.morphNormals[i].faceNormals=[],this.morphNormals[i].vertexNormals=[],l=this.morphNormals[i].faceNormals,a=this.morphNormals[i].vertexNormals,r=0,u=this.faces.length;r<u;r++)h=new t,f={a:new t,b:new t,c:new t},l.push(h),a.push(f);for(c=this.morphNormals[i],e.vertices=this.morphTargets[i].vertices,e.computeFaceNormals(),e.computeVertexNormals(),r=0,u=this.faces.length;r<u;r++)n=this.faces[r],h=c.faceNormals[r],f=c.vertexNormals[r],h.copy(n.normal),f.a.copy(n.vertexNormals[0]),f.b.copy(n.vertexNormals[1]),f.c.copy(n.vertexNormals[2])}for(r=0,u=this.faces.length;r<u;r++)n=this.faces[r],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeLineDistances:function(){for(var i=0,t=this.vertices,n=0,r=t.length;n<r;n++)n>0&&(i+=t[n].distanceTo(t[n-1])),this.lineDistances[n]=i},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new hi),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new ri),this.boundingSphere.setFromPoints(this.vertices)},merge:function(n,t,i){var tt,v,r,o,c,y,u,s;if((n&&n.isGeometry)===!1){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",n);return}var h,l=this.vertices.length,ft=this.vertices,g=n.vertices,ut=this.faces,w=n.faces,rt=this.faceVertexUvs[0],p=n.faceVertexUvs[0],it=this.colors,nt=n.colors;for(i===undefined&&(i=0),t!==undefined&&(h=(new ti).getNormalMatrix(t)),r=0,o=g.length;r<o;r++)tt=g[r],v=tt.clone(),t!==undefined&&v.applyMatrix4(t),ft.push(v);for(r=0,o=nt.length;r<o;r++)it.push(nt[r].clone());for(r=0,o=w.length;r<o;r++){var e=w[r],f,a,b,k=e.vertexNormals,d=e.vertexColors;for(f=new li(e.a+l,e.b+l,e.c+l),f.normal.copy(e.normal),h!==undefined&&f.normal.applyMatrix3(h).normalize(),u=0,s=k.length;u<s;u++)a=k[u].clone(),h!==undefined&&a.applyMatrix3(h).normalize(),f.vertexNormals.push(a);for(f.color.copy(e.color),u=0,s=d.length;u<s;u++)b=d[u],f.vertexColors.push(b.clone());f.materialIndex=e.materialIndex+i,ut.push(f)}for(r=0,o=p.length;r<o;r++)if(c=p[r],y=[],c!==undefined){for(u=0,s=c.length;u<s;u++)y.push(c[u].clone());rt.push(y)}},mergeMesh:function(n){if((n&&n.isMesh)===!1){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",n);return}n.matrixAutoUpdate&&n.updateMatrix(),this.merge(n.geometry,n.matrix)},mergeVertices:function(){for(var c={},f=[],i=[],e,o,w=4,a=Math.pow(10,w),t,v,h,y,s,r,l,p,n=0,u=this.vertices.length;n<u;n++)e=this.vertices[n],o=Math.round(e.x*a)+"_"+Math.round(e.y*a)+"_"+Math.round(e.z*a),c[o]===undefined?(c[o]=n,f.push(this.vertices[n]),i[n]=f.length-1):i[n]=i[c[o]];for(s=[],n=0,u=this.faces.length;n<u;n++)for(t=this.faces[n],t.a=i[t.a],t.b=i[t.b],t.c=i[t.c],v=[t.a,t.b,t.c],r=0;r<3;r++)if(v[r]===v[(r+1)%3]){s.push(n);break}for(n=s.length-1;n>=0;n--)for(l=s[n],this.faces.splice(l,1),h=0,y=this.faceVertexUvs.length;h<y;h++)this.faceVertexUvs[h].splice(l,1);return p=this.vertices.length-f.length,this.vertices=f,p},sortFacesByMaterialIndex:function(){function s(n,t){return n.materialIndex-t.materialIndex}for(var r=this.faces,u=r.length,f,e,t,i,o,n=0;n<u;n++)r[n]._id=n;for(r.sort(s),f=this.faceVertexUvs[0],e=this.faceVertexUvs[1],f&&f.length===u&&(t=[]),e&&e.length===u&&(i=[]),n=0;n<u;n++)o=r[n]._id,t&&t.push(f[o]),i&&i.push(e[o]);t&&(this.faceVertexUvs[0]=t),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){function f(n,t,i){return i?n|1<<t:n&~(1<<t)}function e(n){var t=n.x.toString()+n.y.toString()+n.z.toString();return s[t]!==undefined?s[t]:(s[t]=g.length/3,g.push(n.x,n.y,n.z),s[t])}function y(n){var t=n.r.toString()+n.g.toString()+n.b.toString();return c[t]!==undefined?c[t]:(c[t]=k.length,k.push(n.getHex()),c[t])}function d(n){var t=n.x.toString()+n.y.toString();return a[t]!==undefined?a[t]:(a[t]=l.length/2,l.push(n.x,n.y),a[t])}var i={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}},v,b,nt,o,r,h,w,p;if(i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.parameters!==undefined){v=this.parameters;for(b in v)v[b]!==undefined&&(i[b]=v[b]);return i}for(nt=[],r=0;r<this.vertices.length;r++)o=this.vertices[r],nt.push(o.x,o.y,o.z);var u=[],g=[],s={},k=[],c={},l=[],a={};for(r=0;r<this.faces.length;r++){var t=this.faces[r],ot=!0,et=!1,ut=this.faceVertexUvs[0][r]!==undefined,rt=t.normal.length()>0,it=t.vertexNormals.length>0,ft=t.color.r!==1||t.color.g!==1||t.color.b!==1,tt=t.vertexColors.length>0,n=0;n=f(n,0,0),n=f(n,1,ot),n=f(n,2,et),n=f(n,3,ut),n=f(n,4,rt),n=f(n,5,it),n=f(n,6,ft),n=f(n,7,tt),u.push(n),u.push(t.a,t.b,t.c),u.push(t.materialIndex),ut&&(h=this.faceVertexUvs[0][r],u.push(d(h[0]),d(h[1]),d(h[2]))),rt&&u.push(e(t.normal)),it&&(w=t.vertexNormals,u.push(e(w[0]),e(w[1]),e(w[2]))),ft&&u.push(y(t.color)),tt&&(p=t.vertexColors,u.push(y(p[0]),y(p[1]),y(p[2])))}return i.data={},i.data.vertices=nt,i.data.normals=g,k.length>0&&(i.data.colors=k),l.length>0&&(i.data.uvs=[l]),i.data.faces=u,i},clone:function(){return(new s).copy(this)},copy:function(n){var t,r,i,u,c,it,nt,g,d,k,b,p,rt,f,o,e,s,l,h,y,v,a,w,tt;for(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=n.name,nt=n.vertices,t=0,r=nt.length;t<r;t++)this.vertices.push(nt[t].clone());for(g=n.colors,t=0,r=g.length;t<r;t++)this.colors.push(g[t].clone());for(d=n.faces,t=0,r=d.length;t<r;t++)this.faces.push(d[t].clone());for(t=0,r=n.faceVertexUvs.length;t<r;t++)for(k=n.faceVertexUvs[t],this.faceVertexUvs[t]===undefined&&(this.faceVertexUvs[t]=[]),i=0,u=k.length;i<u;i++){for(b=k[i],p=[],c=0,it=b.length;c<it;c++)rt=b[c],p.push(rt.clone());this.faceVertexUvs[t].push(p)}for(f=n.morphTargets,t=0,r=f.length;t<r;t++){if(o={},o.name=f[t].name,f[t].vertices!==undefined)for(o.vertices=[],i=0,u=f[t].vertices.length;i<u;i++)o.vertices.push(f[t].vertices[i].clone());if(f[t].normals!==undefined)for(o.normals=[],i=0,u=f[t].normals.length;i<u;i++)o.normals.push(f[t].normals[i].clone());this.morphTargets.push(o)}for(e=n.morphNormals,t=0,r=e.length;t<r;t++){if(s={},e[t].vertexNormals!==undefined)for(s.vertexNormals=[],i=0,u=e[t].vertexNormals.length;i<u;i++)l=e[t].vertexNormals[i],h={},h.a=l.a.clone(),h.b=l.b.clone(),h.c=l.c.clone(),s.vertexNormals.push(h);if(e[t].faceNormals!==undefined)for(s.faceNormals=[],i=0,u=e[t].faceNormals.length;i<u;i++)s.faceNormals.push(e[t].faceNormals[i].clone());this.morphNormals.push(s)}for(y=n.skinWeights,t=0,r=y.length;t<r;t++)this.skinWeights.push(y[t].clone());for(v=n.skinIndices,t=0,r=v.length;t<r;t++)this.skinIndices.push(v[t].clone());for(a=n.lineDistances,t=0,r=a.length;t<r;t++)this.lineDistances.push(a[t]);return w=n.boundingBox,w!==null&&(this.boundingBox=w.clone()),tt=n.boundingSphere,tt!==null&&(this.boundingSphere=tt.clone()),this.elementsNeedUpdate=n.elementsNeedUpdate,this.verticesNeedUpdate=n.verticesNeedUpdate,this.uvsNeedUpdate=n.uvsNeedUpdate,this.normalsNeedUpdate=n.normalsNeedUpdate,this.colorsNeedUpdate=n.colorsNeedUpdate,this.lineDistancesNeedUpdate=n.lineDistancesNeedUpdate,this.groupsNeedUpdate=n.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),f.MaxIndex=65535,Object.assign(f.prototype,vi.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(n){this.index=Array.isArray(n)?new(ea(n)>65535?yr:vr)(n,1):n},addAttribute:function(n,t){if((t&&t.isBufferAttribute)===!1&&(t&&t.isInterleavedBufferAttribute)===!1){console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(n,new l(arguments[1],arguments[2]));return}if(n==="index"){console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t);return}return this.attributes[n]=t,this},getAttribute:function(n){return this.attributes[n]},removeAttribute:function(n){return delete this.attributes[n],this},addGroup:function(n,t,i){this.groups.push({start:n,count:t,materialIndex:i!==undefined?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(n,t){this.drawRange.start=n,this.drawRange.count=t},applyMatrix:function(n){var i=this.attributes.position,t,r;return i!==undefined&&(n.applyToBufferAttribute(i),i.needsUpdate=!0),t=this.attributes.normal,t!==undefined&&(r=(new ti).getNormalMatrix(n),r.applyToBufferAttribute(t),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},rotateX:function(){var n=new o;return function(t){return n.makeRotationX(t),this.applyMatrix(n),this}}(),rotateY:function(){var n=new o;return function(t){return n.makeRotationY(t),this.applyMatrix(n),this}}(),rotateZ:function(){var n=new o;return function(t){return n.makeRotationZ(t),this.applyMatrix(n),this}}(),translate:function(){var n=new o;return function(t,i,r){return n.makeTranslation(t,i,r),this.applyMatrix(n),this}}(),scale:function(){var n=new o;return function(t,i,r){return n.makeScale(t,i,r),this.applyMatrix(n),this}}(),lookAt:function(){var n=new u;return function(t){n.lookAt(t),n.updateMatrix(),this.applyMatrix(n.matrix)}}(),center:function(){this.computeBoundingBox();var n=this.boundingBox.getCenter().negate();return this.translate(n.x,n.y,n.z),n},setFromObject:function(n){var t=n.geometry,i,u,f;return n.isPoints||n.isLine?(i=new r(t.vertices.length*3,3),u=new r(t.colors.length*3,3),this.addAttribute("position",i.copyVector3sArray(t.vertices)),this.addAttribute("color",u.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length&&(f=new r(t.lineDistances.length,1),this.addAttribute("lineDistance",f.copyArray(t.lineDistances))),t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone())):n.isMesh&&t&&t.isGeometry&&this.fromGeometry(t),this},updateFromObject:function(n){var t=n.geometry,r,i;if(n.isMesh){if(r=t.__directGeometry,t.elementsNeedUpdate===!0&&(r=undefined,t.elementsNeedUpdate=!1),r===undefined)return this.fromGeometry(t);r.verticesNeedUpdate=t.verticesNeedUpdate,r.normalsNeedUpdate=t.normalsNeedUpdate,r.colorsNeedUpdate=t.colorsNeedUpdate,r.uvsNeedUpdate=t.uvsNeedUpdate,r.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=r}return t.verticesNeedUpdate===!0&&(i=this.attributes.position,i!==undefined&&(i.copyVector3sArray(t.vertices),i.needsUpdate=!0),t.verticesNeedUpdate=!1),t.normalsNeedUpdate===!0&&(i=this.attributes.normal,i!==undefined&&(i.copyVector3sArray(t.normals),i.needsUpdate=!0),t.normalsNeedUpdate=!1),t.colorsNeedUpdate===!0&&(i=this.attributes.color,i!==undefined&&(i.copyColorsArray(t.colors),i.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(i=this.attributes.uv,i!==undefined&&(i.copyVector2sArray(t.uvs),i.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(i=this.attributes.lineDistance,i!==undefined&&(i.copyArray(t.lineDistances),i.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(n.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(n){return n.__directGeometry=(new pb).fromGeometry(n),this.fromDirectGeometry(n.__directGeometry)},fromDirectGeometry:function(n){var k=new Float32Array(n.vertices.length*3),v,a,c,w,o,s,e,f,u,t,y,i,p,h,b;this.addAttribute("position",new l(k,3).copyVector3sArray(n.vertices)),n.normals.length>0&&(v=new Float32Array(n.normals.length*3),this.addAttribute("normal",new l(v,3).copyVector3sArray(n.normals))),n.colors.length>0&&(a=new Float32Array(n.colors.length*3),this.addAttribute("color",new l(a,3).copyColorsArray(n.colors))),n.uvs.length>0&&(c=new Float32Array(n.uvs.length*2),this.addAttribute("uv",new l(c,2).copyVector2sArray(n.uvs))),n.uvs2.length>0&&(w=new Float32Array(n.uvs2.length*2),this.addAttribute("uv2",new l(w,2).copyVector2sArray(n.uvs2))),n.indices.length>0&&(o=ea(n.indices)>65535?Uint32Array:Uint16Array,s=new o(n.indices.length*3),this.setIndex(new l(s,1).copyIndicesArray(n.indices))),this.groups=n.groups;for(e in n.morphTargets){for(f=[],u=n.morphTargets[e],t=0,y=u.length;t<y;t++)i=u[t],p=new r(i.length*3,3),f.push(p.copyVector3sArray(i));this.morphAttributes[e]=f}return n.skinIndices.length>0&&(h=new r(n.skinIndices.length*4,4),this.addAttribute("skinIndex",h.copyVector4sArray(n.skinIndices))),n.skinWeights.length>0&&(b=new r(n.skinWeights.length*4,4),this.addAttribute("skinWeight",b.copyVector4sArray(n.skinWeights))),n.boundingSphere!==null&&(this.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(this.boundingBox=n.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new hi);var n=this.attributes.position;n!==undefined?this.boundingBox.setFromBufferAttribute(n):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 i=new hi,n=new t;return function(){var t,f,u,r,e;if(this.boundingSphere===null&&(this.boundingSphere=new ri),t=this.attributes.position,t){for(f=this.boundingSphere.center,i.setFromBufferAttribute(t),i.getCenter(f),u=0,r=0,e=t.count;r<e;r++)n.x=t.getX(r),n.y=t.getY(r),n.z=t.getZ(r),u=Math.max(u,f.distanceToSquared(n));this.boundingSphere.radius=Math.sqrt(u),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 g=this.index,f=this.attributes,k=this.groups,u,b,a,w,tt,n,o;if(f.position){if(u=f.position.array,f.normal===undefined)this.addAttribute("normal",new l(new Float32Array(u.length),3));else for(b=f.normal.array,n=0,o=b.length;n<o;n++)b[n]=0;var r=f.normal.array,c,h,s,v=new t,e=new t,y=new t,i=new t,p=new t;if(g)for(a=g.array,k.length===0&&this.addGroup(0,a.length),w=0,tt=k.length;w<tt;++w){var d=k[w],nt=d.start,it=d.count;for(n=nt,o=nt+it;n<o;n+=3)c=a[n+0]*3,h=a[n+1]*3,s=a[n+2]*3,v.fromArray(u,c),e.fromArray(u,h),y.fromArray(u,s),i.subVectors(y,e),p.subVectors(v,e),i.cross(p),r[c]+=i.x,r[c+1]+=i.y,r[c+2]+=i.z,r[h]+=i.x,r[h+1]+=i.y,r[h+2]+=i.z,r[s]+=i.x,r[s+1]+=i.y,r[s+2]+=i.z}else for(n=0,o=u.length;n<o;n+=9)v.fromArray(u,n),e.fromArray(u,n+3),y.fromArray(u,n+6),i.subVectors(y,e),p.subVectors(v,e),i.cross(p),r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r[n+3]=i.x,r[n+4]=i.y,r[n+5]=i.z,r[n+6]=i.x,r[n+7]=i.y,r[n+8]=i.z;this.normalizeNormals(),f.normal.needsUpdate=!0}},merge:function(n,t){var u,i,r,f;if((n&&n.isBufferGeometry)===!1){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",n);return}t===undefined&&(t=0),u=this.attributes;for(i in u)if(n.attributes[i]!==undefined){var s=u[i],h=s.array,e=n.attributes[i],o=e.array,c=e.itemSize;for(r=0,f=c*t;r<o.length;r++,f++)h[f]=o[r]}return this},normalizeNormals:function(){for(var t=this.attributes.normal,i,r,u,f,n=0,e=t.count;n<e;n++)i=t.getX(n),r=t.getY(n),u=t.getZ(n),f=1/Math.sqrt(i*i+r*r+u*u),t.setXYZ(n,i*f,r*f,u*f)},toNonIndexed:function(){var r,t,v,u;if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new f,i=this.index.array,o=this.attributes;for(r in o){var s=o[r],h=s.array,n=s.itemSize,c=new h.constructor(i.length*n),a=0,y=0;for(t=0,v=i.length;t<v;t++)for(a=i[t]*n,u=0;u<n;u++)c[y++]=h[a++];e.addAttribute(r,new l(c,n))}return e},toJSON:function(){var n={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}},r,u,o,t,i,f,s,e;if(n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.parameters!==undefined){r=this.parameters;for(t in r)r[t]!==undefined&&(n[t]=r[t]);return n}n.data={attributes:{}},u=this.index,u!==null&&(f=Array.prototype.slice.call(u.array),n.data.index={type:u.array.constructor.name,array:f}),o=this.attributes;for(t in o)i=o[t],f=Array.prototype.slice.call(i.array),n.data.attributes[t]={itemSize:i.itemSize,type:i.array.constructor.name,array:f,normalized:i.normalized};return s=this.groups,s.length>0&&(n.data.groups=JSON.parse(JSON.stringify(s))),e=this.boundingSphere,e!==null&&(n.data.boundingSphere={center:e.center.toArray(),radius:e.radius}),n},clone:function(){return(new f).copy(this)},copy:function(n){var i,t,r,f,e,v,o,s,h,c,u,l,a;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=n.name,f=n.index,f!==null&&this.setIndex(f.clone()),e=n.attributes;for(i in e)v=e[i],this.addAttribute(i,v.clone());o=n.morphAttributes;for(i in o){for(s=[],h=o[i],t=0,r=h.length;t<r;t++)s.push(h[t].clone());this.morphAttributes[i]=s}for(c=n.groups,t=0,r=c.length;t<r;t++)u=c[t],this.addGroup(u.start,u.count,u.materialIndex);return l=n.boundingBox,l!==null&&(this.boundingBox=l.clone()),a=n.boundingSphere,a!==null&&(this.boundingSphere=a.clone()),this.drawRange.start=n.drawRange.start,this.drawRange.count=n.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ut.prototype=Object.assign(Object.create(u.prototype),{constructor:ut,isMesh:!0,setDrawMode:function(n){this.drawMode=n},copy:function(n){return u.prototype.copy.call(this,n),this.drawMode=n.drawMode,this},updateMorphTargets:function(){var t=this.geometry.morphTargets,n,i;if(t!==undefined&&t.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},n=0,i=t.length;n<i;n++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[t[n].name]=n},raycast:function(){function p(n,t,i,r,u,f,e){return ci.barycoordFromPoint(n,t,i,r,a),u.multiplyScalar(a.x),f.multiplyScalar(a.y),e.multiplyScalar(a.z),u.add(f).add(e),u.clone()}function y(n,t,i,r,u,f,e){var h,c=n.material,o;return(h=c.side===ir?i.intersectTriangle(f,u,r,!0,e):i.intersectTriangle(r,u,f,c.side!==pu,e),h===null)?null:(s.copy(e),s.applyMatrix4(n.matrixWorld),o=t.ray.origin.distanceTo(s),o<t.near||o>t.far)?null:{distance:o,point:s.clone(),object:n}}function b(t,i,f,o,s,a,v,w){n.fromBufferAttribute(o,a),r.fromBufferAttribute(o,v),u.fromBufferAttribute(o,w);var b=y(t,i,f,n,r,u,h);return b&&(s&&(e.fromBufferAttribute(s,a),c.fromBufferAttribute(s,v),l.fromBufferAttribute(s,w),b.uv=p(h,n,r,u,e,c,l)),b.face=new li(a,v,w,ci.normal(n,r,u)),b.faceIndex=a),b}var w=new o,f=new rr,v=new ri,n=new t,r=new t,u=new t,g=new t,d=new t,k=new t,e=new i,c=new i,l=new i,a=new t,h=new t,s=new t;return function(t,i){var o=this.geometry,pt=this.material,gt=this.matrixWorld,s,tt,ui,nt,bt,wt,ti,ot,ii,ft,vt,ht;if(pt!==undefined&&(o.boundingSphere===null&&o.computeBoundingSphere(),v.copy(o.boundingSphere),v.applyMatrix4(gt),t.ray.intersectsSphere(v)!==!1)&&(w.getInverse(gt),f.copy(t.ray).applyMatrix4(w),o.boundingBox===null||f.intersectsBox(o.boundingBox)!==!1))if(o.isBufferGeometry){var et,at,ct,st=o.index,kt=o.attributes.position,ri=o.attributes.uv,a,lt;if(st!==null)for(a=0,lt=st.count;a<lt;a+=3)et=st.getX(a),at=st.getX(a+1),ct=st.getX(a+2),s=b(this,t,f,kt,ri,et,at,ct),s&&(s.faceIndex=Math.floor(a/3),i.push(s));else for(a=0,lt=kt.count;a<lt;a+=3)et=a,at=a+1,ct=a+2,s=b(this,t,f,kt,ri,et,at,ct),s&&(s.index=et,i.push(s))}else if(o.isGeometry){var rt,it,ut,ei=Array.isArray(pt),dt=o.vertices,ni=o.faces,yt,fi=o.faceVertexUvs[0];for(fi.length>0&&(yt=fi),tt=0,ui=ni.length;tt<ui;tt++)if(nt=ni[tt],bt=ei?pt[nt.materialIndex]:pt,bt!==undefined){if(rt=dt[nt.a],it=dt[nt.b],ut=dt[nt.c],bt.morphTargets===!0){for(wt=o.morphTargets,ti=this.morphTargetInfluences,n.set(0,0,0),r.set(0,0,0),u.set(0,0,0),ot=0,ii=wt.length;ot<ii;ot++)(ft=ti[ot],ft!==0)&&(vt=wt[ot].vertices,n.addScaledVector(g.subVectors(vt[nt.a],rt),ft),r.addScaledVector(d.subVectors(vt[nt.b],it),ft),u.addScaledVector(k.subVectors(vt[nt.c],ut),ft));n.add(rt),r.add(it),u.add(ut),rt=n,it=r,ut=u}s=y(this,t,f,rt,it,ut,h),s&&(yt&&yt[tt]&&(ht=yt[tt],e.copy(ht[0]),c.copy(ht[1]),l.copy(ht[2]),s.uv=p(h,rt,it,ut,e,c,l)),s.face=nt,s.faceIndex=tt,i.push(s))}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),du.prototype=Object.create(s.prototype),du.prototype.constructor=du,pr.prototype=Object.create(f.prototype),pr.prototype.constructor=pr,ko.prototype=Object.create(s.prototype),ko.prototype.constructor=ko,wr.prototype=Object.create(f.prototype),wr.prototype.constructor=wr,oi.prototype=Object.assign(Object.create(u.prototype),{constructor:oi,isCamera:!0,copy:function(n){return u.prototype.copy.call(this,n),this.matrixWorldInverse.copy(n.matrixWorldInverse),this.projectionMatrix.copy(n.projectionMatrix),this},getWorldDirection:function(){var n=new g;return function(i){var r=i||new t;return this.getWorldQuaternion(n),r.set(0,0,-1).applyQuaternion(n)}}(),clone:function(){return(new this.constructor).copy(this)}}),nt.prototype=Object.assign(Object.create(oi.prototype),{constructor:nt,isPerspectiveCamera:!0,copy:function(n){return oi.prototype.copy.call(this,n),this.fov=n.fov,this.zoom=n.zoom,this.near=n.near,this.far=n.far,this.focus=n.focus,this.aspect=n.aspect,this.view=n.view===null?null:Object.assign({},n.view),this.filmGauge=n.filmGauge,this.filmOffset=n.filmOffset,this},setFocalLength:function(n){var t=.5*this.getFilmHeight()/n;this.fov=c.RAD2DEG*2*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var n=Math.tan(c.DEG2RAD*.5*this.fov);return.5*this.getFilmHeight()/n},getEffectiveFOV:function(){return c.RAD2DEG*2*Math.atan(Math.tan(c.DEG2RAD*.5*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(n,t,i,r,u,f){this.aspect=n/t,this.view={fullWidth:n,fullHeight:t,offsetX:i,offsetY:r,width:u,height:f},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var f=this.near,t=f*Math.tan(c.DEG2RAD*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,u=-.5*r,n=this.view,e,o,s;n!==null&&(e=n.fullWidth,o=n.fullHeight,u+=n.offsetX*r/e,t-=n.offsetY*i/o,r*=n.width/e,i*=n.height/o),s=this.filmOffset,s!==0&&(u+=f*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(u,u+r,t,t-i,f,this.far)},toJSON:function(n){var t=u.prototype.toJSON.call(this,n);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),pf.prototype=Object.assign(Object.create(oi.prototype),{constructor:pf,isOrthographicCamera:!0,copy:function(n){return oi.prototype.copy.call(this,n),this.left=n.left,this.right=n.right,this.top=n.top,this.bottom=n.bottom,this.near=n.near,this.far=n.far,this.zoom=n.zoom,this.view=n.view===null?null:Object.assign({},n.view),this},setViewOffset:function(n,t,i,r,u,f){this.view={fullWidth:n,fullHeight:t,offsetX:i,offsetY:r,width:u,height:f},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var i=(this.right-this.left)/(2*this.zoom),r=(this.top-this.bottom)/(2*this.zoom),u=(this.right+this.left)/2,f=(this.top+this.bottom)/2,n=u-i,e=u+i,t=f+r,o=f-r;if(this.view!==null){var s=this.zoom/(this.view.width/this.view.fullWidth),h=this.zoom/(this.view.height/this.view.fullHeight),c=(this.right-this.left)/this.view.width,l=(this.top-this.bottom)/this.view.height;n+=c*(this.view.offsetX/s),e=n+c*(this.view.width/s),t-=l*(this.view.offsetY/h),o=t-l*(this.view.height/h)}this.projectionMatrix.makeOrthographic(n,e,t,o,this.near,this.far)},toJSON:function(n){var t=u.prototype.toJSON.call(this,n);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}),ak=0,yu.prototype.isFogExp2=!0,yu.prototype.clone=function(){return new yu(this.color.getHex(),this.density)},yu.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},wu.prototype.isFog=!0,wu.prototype.clone=function(){return new wu(this.color.getHex(),this.near,this.far)},wu.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},wh.prototype=Object.assign(Object.create(u.prototype),{constructor:wh,copy:function(n,t){return u.prototype.copy.call(this,n,t),n.background!==null&&(this.background=n.background.clone()),n.fog!==null&&(this.fog=n.fog.clone()),n.overrideMaterial!==null&&(this.overrideMaterial=n.overrideMaterial.clone()),this.autoUpdate=n.autoUpdate,this.matrixAutoUpdate=n.matrixAutoUpdate,this},toJSON:function(n){var t=u.prototype.toJSON.call(this,n);return this.background!==null&&(t.object.background=this.background.toJSON(n)),this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}),va.prototype=Object.assign(Object.create(u.prototype),{constructor:va,isLensFlare:!0,copy:function(n){u.prototype.copy.call(this,n),this.positionScreen.copy(n.positionScreen),this.customUpdateCallback=n.customUpdateCallback;for(var t=0,i=n.lensFlares.length;t<i;t++)this.lensFlares.push(n.lensFlares[t]);return this},add:function(n,t,i,r,u,f){t===undefined&&(t=-1),i===undefined&&(i=0),f===undefined&&(f=1),u===undefined&&(u=new e(16777215)),r===undefined&&(r=ce),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:n,size:t,distance:i,x:0,y:0,z:0,scale:1,rotation:0,opacity:f,color:u,blending:r})},updateLensFlares:function(){for(var i=this.lensFlares.length,n,r=-this.positionScreen.x*2,u=-this.positionScreen.y*2,t=0;t<i;t++)n=this.lensFlares[t],n.x=this.positionScreen.x+r*n.distance,n.y=this.positionScreen.y+u*n.distance,n.wantedRotation=n.x*Math.PI*.25,n.rotation+=(n.wantedRotation-n.rotation)*.25}}),di.prototype=Object.create(a.prototype),di.prototype.constructor=di,di.prototype.isSpriteMaterial=!0,di.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.rotation=n.rotation,this},us.prototype=Object.assign(Object.create(u.prototype),{constructor:us,isSprite:!0,raycast:function(){var n=new t,i=new t,r=new t;return function(t,u){var e,f;(i.setFromMatrixPosition(this.matrixWorld),t.ray.closestPointToPoint(i,n),r.setFromMatrixScale(this.matrixWorld),e=r.x*r.y/4,i.distanceToSquared(n)>e)||(f=t.ray.origin.distanceTo(n),f<t.near||f>t.far)||u.push({distance:f,point:n.clone(),face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),rs.prototype=Object.assign(Object.create(u.prototype),{constructor:rs,copy:function(n){var i,t,f,r;for(u.prototype.copy.call(this,n,!1),i=n.levels,t=0,f=i.length;t<f;t++)r=i[t],this.addLevel(r.object.clone(),r.distance);return this},addLevel:function(n,t){var r,i;for(t===undefined&&(t=0),t=Math.abs(t),r=this.levels,i=0;i<r.length;i++)if(t<r[i].distance)break;r.splice(i,0,{distance:t,object:n}),this.add(n)},getObjectForDistance:function(n){for(var i=this.levels,t=1,r=i.length;t<r;t++)if(n<i[t].distance)break;return i[t-1].object},raycast:function(){var n=new t;return function(t,i){n.setFromMatrixPosition(this.matrixWorld);var r=t.ray.origin.distanceTo(n);this.getObjectForDistance(r).raycast(t,i)}}(),update:function(){var n=new t,i=new t;return function(t){var u=this.levels,e,r,f;if(u.length>1){for(n.setFromMatrixPosition(t.matrixWorld),i.setFromMatrixPosition(this.matrixWorld),e=n.distanceTo(i),u[0].object.visible=!0,r=1,f=u.length;r<f;r++)if(e>=u[r].distance)u[r-1].object.visible=!1,u[r].object.visible=!0;else break;for(;r<f;r++)u[r].object.visible=!1}}}(),toJSON:function(n){var i=u.prototype.toJSON.call(this,n),r,t,e,f;for(i.object.levels=[],r=this.levels,t=0,e=r.length;t<e;t++)f=r[t],i.object.levels.push({object:f.object.uuid,distance:f.distance});return i}}),Object.assign(is.prototype,{calculateInverses:function(){var n,i,t;for(this.boneInverses=[],n=0,i=this.bones.length;n<i;n++)t=new o,this.bones[n]&&t.getInverse(this.bones[n].matrixWorld),this.boneInverses.push(t)},pose:function(){for(var n,t=0,i=this.bones.length;t<i;t++)n=this.bones[t],n&&n.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,i=this.bones.length;t<i;t++)n=this.bones[t],n&&(n.parent&&n.parent.isBone?(n.matrix.getInverse(n.parent.matrixWorld),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))},update:function(){var n=new o,t=new o;return function(){for(var r=this.bones,o=this.boneInverses,s=this.boneMatrices,u=this.boneTexture,e,i=0,f=r.length;i<f;i++)e=r[i]?r[i].matrixWorld:t,n.multiplyMatrices(e,o[i]),n.toArray(s,i*16);u!==undefined&&(u.needsUpdate=!0)}}(),clone:function(){return new is(this.bones,this.boneInverses)}}),ph.prototype=Object.assign(Object.create(u.prototype),{constructor:ph,isBone:!0}),yh.prototype=Object.assign(Object.create(ut.prototype),{constructor:yh,isSkinnedMesh:!0,initBones:function(){var i=[],r,n,t,u;if(this.geometry&&this.geometry.bones!==undefined){for(t=0,u=this.geometry.bones.length;t<u;t++)n=this.geometry.bones[t],r=new ph,i.push(r),r.name=n.name,r.position.fromArray(n.pos),r.quaternion.fromArray(n.rotq),n.scl!==undefined&&r.scale.fromArray(n.scl);for(t=0,u=this.geometry.bones.length;t<u;t++)n=this.geometry.bones[t],n.parent!==-1&&n.parent!==null&&i[n.parent]!==undefined?i[n.parent].add(i[t]):this.add(i[t])}return this.updateMatrixWorld(!0),i},bind:function(n,t){this.skeleton=n,t===undefined&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var r,n,u,t,i;if(this.geometry&&this.geometry.isGeometry)for(n=0;n<this.geometry.skinWeights.length;n++)u=this.geometry.skinWeights[n],r=1/u.lengthManhattan(),r!==Infinity?u.multiplyScalar(r):u.set(1,0,0,0);else if(this.geometry&&this.geometry.isBufferGeometry)for(t=new y,i=this.geometry.attributes.skinWeight,n=0;n<i.count;n++)t.x=i.getX(n),t.y=i.getY(n),t.z=i.getZ(n),t.w=i.getW(n),r=1/t.lengthManhattan(),r!==Infinity?t.multiplyScalar(r):t.set(1,0,0,0),i.setXYZW(n,t.x,t.y,t.z,t.w)},updateMatrixWorld:function(n){ut.prototype.updateMatrixWorld.call(this,n),this.bindMode==="attached"?this.bindMatrixInverse.getInverse(this.matrixWorld):this.bindMode==="detached"?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)}}),k.prototype=Object.create(a.prototype),k.prototype.constructor=k,k.prototype.isLineBasicMaterial=!0,k.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.color.copy(n.color),this.linewidth=n.linewidth,this.linecap=n.linecap,this.linejoin=n.linejoin,this},pt.prototype=Object.assign(Object.create(u.prototype),{constructor:pt,isLine:!0,raycast:function(){var r=new o,n=new rr,i=new ri;return function(u,f){var it=u.linePrecision,k=it*it,h=this.geometry,tt=this.matrixWorld,p,rt,g,b,y,ut,e,l,o;if(h.boundingSphere===null&&h.computeBoundingSphere(),i.copy(h.boundingSphere),i.applyMatrix4(tt),u.ray.intersectsSphere(i)!==!1){r.getInverse(tt),n.copy(u.ray).applyMatrix4(r);var w=new t,v=new t,c=new t,s=new t,d=this&&this.isLineSegments?2:1;if(h.isBufferGeometry){var nt=h.index,ft=h.attributes,a=ft.position.array;if(nt!==null)for(p=nt.array,e=0,b=p.length-1;e<b;e+=d)(rt=p[e],g=p[e+1],w.fromArray(a,rt*3),v.fromArray(a,g*3),l=n.distanceSqToSegment(w,v,s,c),l>k)||(s.applyMatrix4(this.matrixWorld),o=u.ray.origin.distanceTo(s),o<u.near||o>u.far)||f.push({distance:o,point:c.clone().applyMatrix4(this.matrixWorld),index:e,face:null,faceIndex:null,object:this});else for(e=0,b=a.length/3-1;e<b;e+=d)(w.fromArray(a,3*e),v.fromArray(a,3*e+3),l=n.distanceSqToSegment(w,v,s,c),l>k)||(s.applyMatrix4(this.matrixWorld),o=u.ray.origin.distanceTo(s),o<u.near||o>u.far)||f.push({distance:o,point:c.clone().applyMatrix4(this.matrixWorld),index:e,face:null,faceIndex:null,object:this})}else if(h.isGeometry)for(y=h.vertices,ut=y.length,e=0;e<ut-1;e+=d)(l=n.distanceSqToSegment(y[e],y[e+1],s,c),l>k)||(s.applyMatrix4(this.matrixWorld),o=u.ray.origin.distanceTo(s),o<u.near||o>u.far)||f.push({distance:o,point:c.clone().applyMatrix4(this.matrixWorld),index:e,face:null,faceIndex:null,object:this})}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),b.prototype=Object.assign(Object.create(pt.prototype),{constructor:b,isLineSegments:!0}),vh.prototype=Object.assign(Object.create(pt.prototype),{constructor:vh,isLineLoop:!0}),gt.prototype=Object.create(a.prototype),gt.prototype.constructor=gt,gt.prototype.isPointsMaterial=!0,gt.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.size=n.size,this.sizeAttenuation=n.sizeAttenuation,this},vf.prototype=Object.assign(Object.create(u.prototype),{constructor:vf,isPoints:!0,raycast:function(){var r=new o,i=new rr,n=new ri;return function(u,f){function v(n,t){var o=i.distanceSqToPoint(n),r,e;if(o<tt){if(r=i.closestPointToPoint(n),r.applyMatrix4(y),e=u.ray.origin.distanceTo(r),e<u.near||e>u.far)return;f.push({distance:e,distanceToRay:Math.sqrt(o),point:r.clone(),index:t,face:null,object:nt})}}var nt=this,o=this.geometry,y=this.matrixWorld,k=u.params.Points.threshold,l,d,c,p,e,s;if(o.boundingSphere===null&&o.computeBoundingSphere(),n.copy(o.boundingSphere),n.applyMatrix4(y),n.radius+=k,u.ray.intersectsSphere(n)!==!1){r.getInverse(y),i.copy(u.ray).applyMatrix4(r);var b=k/((this.scale.x+this.scale.y+this.scale.z)/3),tt=b*b,h=new t;if(o.isBufferGeometry){var w=o.index,g=o.attributes,a=g.position.array;if(w!==null)for(l=w.array,e=0,d=l.length;e<d;e++)c=l[e],h.fromArray(a,c*3),v(h,c);else for(e=0,s=a.length/3;e<s;e++)h.fromArray(a,e*3),v(h,e)}else for(p=o.vertices,e=0,s=p.length;e<s;e++)v(p[e],e)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ns.prototype=Object.assign(Object.create(u.prototype),{constructor:ns}),ch.prototype=Object.create(w.prototype),ch.prototype.constructor=ch,wf.prototype=Object.create(w.prototype),wf.prototype.constructor=wf,wf.prototype.isCompressedTexture=!0,uc.prototype=Object.create(w.prototype),uc.prototype.constructor=uc,ts.prototype=Object.create(w.prototype),ts.prototype.constructor=ts,ts.prototype.isDepthTexture=!0,ve.prototype=Object.create(f.prototype),ve.prototype.constructor=ve,es.prototype=Object.create(s.prototype),es.prototype.constructor=es,ae.prototype=Object.create(f.prototype),ae.prototype.constructor=ae,os.prototype=Object.create(s.prototype),os.prototype.constructor=os,ht.prototype=Object.create(f.prototype),ht.prototype.constructor=ht,as.prototype=Object.create(s.prototype),as.prototype.constructor=as,oe.prototype=Object.create(ht.prototype),oe.prototype.constructor=oe,ys.prototype=Object.create(s.prototype),ys.prototype.constructor=ys,lr.prototype=Object.create(ht.prototype),lr.prototype.constructor=lr,ps.prototype=Object.create(s.prototype),ps.prototype.constructor=ps,re.prototype=Object.create(ht.prototype),re.prototype.constructor=re,ds.prototype=Object.create(s.prototype),ds.prototype.constructor=ds,ne.prototype=Object.create(ht.prototype),ne.prototype.constructor=ne,fh.prototype=Object.create(s.prototype),fh.prototype.constructor=fh,gf.prototype=Object.create(f.prototype),gf.prototype.constructor=gf,go.prototype=Object.create(s.prototype),go.prototype.constructor=go,le.prototype=Object.create(f.prototype),le.prototype.constructor=le,ro.prototype=Object.create(s.prototype),ro.prototype.constructor=ro,te.prototype=Object.create(f.prototype),te.prototype.constructor=te,wt={area:function(n){for(var r=n.length,u=0,i=r-1,t=0;t<r;i=t++)u+=n[i].x*n[t].y-n[t].x*n[i].y;return u*.5},triangulate:function(){function n(n,t,i,r,u,f){var y,h,o,c,l,a,v,e,s,ft,ut,rt,it,nt,tt,ot,g,d,k,b,w,p,et,st;if(h=n[f[t]].x,o=n[f[t]].y,c=n[f[i]].x,l=n[f[i]].y,a=n[f[r]].x,v=n[f[r]].y,(c-h)*(v-o)-(l-o)*(a-h)<=0)return!1;for(ft=a-c,ut=v-l,rt=h-a,it=o-v,nt=c-h,tt=l-o,y=0;y<u;y++)if((e=n[f[y]].x,s=n[f[y]].y,(e!==h||s!==o)&&(e!==c||s!==l)&&(e!==a||s!==v))&&(ot=e-h,g=s-o,d=e-c,k=s-l,b=e-a,w=s-v,st=ft*k-ut*d,p=nt*g-tt*ot,et=rt*w-it*b,st>=-Number.EPSILON&&et>=-Number.EPSILON&&p>=-Number.EPSILON))return!1;return!0}return function(t,i){var s=t.length,f,a,y,p,w,v,h;if(s<3)return null;var c=[],u=[],l=[],e,r,o;if(wt.area(t)>0)for(r=0;r<s;r++)u[r]=r;else for(r=0;r<s;r++)u[r]=s-1-r;for(f=s,a=2*f,r=f-1;f>2;){if(a--<=0)return(console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i)?l:c;if(e=r,f<=e&&(e=0),r=e+1,f<=r&&(r=0),o=r+1,f<=o&&(o=0),n(t,e,r,o,f,u)){for(y=u[e],p=u[r],w=u[o],c.push([t[y],t[p],t[w]]),l.push([u[e],u[r],u[o]]),v=r,h=r+1;h<f;v++,h++)u[v]=u[h];f--,a=2*f}}return i?l:c}}(),triangulateShape:function(n,t){function p(n){var t=n.length;t>2&&n[t-1].equals(n[0])&&n.pop()}function v(n,t,i){return n.x!==t.x?n.x<t.x?n.x<=i.x&&i.x<=t.x:t.x<=i.x&&i.x<=n.x:n.y<t.y?n.y<=i.y&&i.y<=t.y:t.y<=i.y&&i.y<=n.y}function b(n,t,i,r,u){var k=t.x-n.x,g=t.y-n.y,b=r.x-i.x,d=r.y-i.y,tt=n.x-i.x,nt=n.y-i.y,f=g*b-k*d,e=g*tt-k*nt,o,it,ut,rt,y,w,l,h,c,p,a,s;if(Math.abs(f)>Number.EPSILON){if(f>0){if(e<0||e>f)return[];if(o=d*tt-b*nt,o<0||o>f)return[]}else{if(e>0||e<f)return[];if(o=d*tt-b*nt,o>0||o<f)return[]}return o===0?u&&(e===0||e===f)?[]:[n]:o===f?u&&(e===0||e===f)?[]:[t]:e===0?[i]:e===f?[r]:(it=o/f,[{x:n.x+it*k,y:n.y+it*g}])}return e!==0||d*tt!=b*nt?[]:(ut=k===0&&g===0,rt=b===0&&d===0,ut&&rt)?n.x!==i.x||n.y!==i.y?[]:[n]:ut?v(i,r,n)?[n]:[]:rt?v(n,t,i)?[i]:[]:(k!==0?(n.x<t.x?(y=n,l=n.x,w=t,h=t.x):(y=t,l=t.x,w=n,h=n.x),i.x<r.x?(c=i,a=i.x,p=r,s=r.x):(c=r,a=r.x,p=i,s=i.x)):(n.y<t.y?(y=n,l=n.y,w=t,h=t.y):(y=t,l=t.y,w=n,h=n.y),i.y<r.y?(c=i,a=i.y,p=r,s=r.y):(c=r,a=r.y,p=i,s=i.y)),l<=a?h<a?[]:h===a?u?[]:[c]:h<=s?[c,w]:[c,p]:l>s?[]:l===s?u?[]:[y]:h<=s?[y,w]:[y,p])}function a(n,t,i,r){var e=t.x-n.x,o=t.y-n.y,s=i.x-n.x,h=i.y-n.y,c=r.x-n.x,l=r.y-n.y,a=e*h-o*s,u=e*l-o*c,f;return Math.abs(a)>Number.EPSILON?(f=c*h-l*s,a>0?u>=0&&f>=0:u>=0||f>=0):u>0}function k(n,t){function rt(n,t){var c=i.length-1,s=n-1,u,f,h,e,o;return(s<0&&(s=c),u=n+1,u>c&&(u=0),f=a(i[n],i[s],i[u],r[t]),!f)?!1:(h=r.length-1,e=t-1,e<0&&(e=h),o=t+1,o>h&&(o=0),f=a(r[t],r[e],r[o],i[n]),!f)?!1:!0}function it(n,t){for(var u,f,r=0;r<i.length;r++)if(u=r+1,u%=i.length,f=b(n,t,i[r],i[u],!0),f.length>0)return!0;return!1}function ut(n,i){for(var r,u,o,s,e=0;e<f.length;e++)for(r=t[f[e]],u=0;u<r.length;u++)if(o=u+1,o%=r.length,s=b(n,i,r[u],r[o],!0),s.length>0)return!0;return!1}for(var i=n.concat(),r,f=[],o,e,h,p,l,v,w=[],k,d,g,nt,y,c,s,u=0,tt=t.length;u<tt;u++)f.push(u);for(y=0,c=f.length*2;f.length>0;){if(c--,c<0){console.log("Infinite Loop! Holes left:"+f.length+", Probably Hole outside Shape!");break}for(e=y;e<i.length;e++){for(h=i[e],o=-1,u=0;u<f.length;u++)if(l=f[u],v=h.x+":"+h.y+":"+l,w[v]===undefined){for(r=t[l],s=0;s<r.length;s++)if((p=r[s],rt(e,s))&&!it(h,p)&&!ut(h,p)){o=s,f.splice(u,1),k=i.slice(0,e+1),d=i.slice(e),g=r.slice(o),nt=r.slice(0,o+1),i=k.concat(g).concat(nt).concat(d),y=e;break}if(o>=0)break;w[v]=!0}if(o>=0)break}}return i}var i,e,u,o,r,l,s,f,h,w,y,c;for(p(n),t.forEach(p),s={},f=n.concat(),h=0,w=t.length;h<w;h++)Array.prototype.push.apply(f,t[h]);for(i=0,e=f.length;i<e;i++)r=f[i].x+":"+f[i].y,s[r]!==undefined&&console.warn("THREE.ShapeUtils: Duplicate point",r,i),s[r]=i;for(y=k(n,t),c=wt.triangulate(y,!1),i=0,e=c.length;i<e;i++)for(o=c[i],u=0;u<3;u++)r=o[u].x+":"+o[u].y,l=s[r],l!==undefined&&(o[u]=l);return c.concat()},isClockWise:function(n){return wt.area(n)<0}},gi.prototype=Object.create(s.prototype),gi.prototype.constructor=gi,ii.prototype=Object.create(f.prototype),ii.prototype.constructor=ii,ii.prototype.getArrays=function(){var n=this.getAttribute("position"),r=n?Array.prototype.slice.call(n.array):[],t=this.getAttribute("uv"),u=t?Array.prototype.slice.call(t.array):[],i=this.index,f=i?Array.prototype.slice.call(i.array):[];return{position:r,uv:u,index:f}},ii.prototype.addShapeList=function(n,t){var f=n.length,i,u;for(t.arrays=this.getArrays(),i=0;i<f;i++)u=n[i],this.addShape(u,t);this.setIndex(t.arrays.index),this.addAttribute("position",new r(t.arrays.position,3)),this.addAttribute("uv",new r(t.arrays.uv,2))},ii.prototype.addShape=function(n,u){function lt(n,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(n)}function pi(n,t,r){var o,s,l=1,u=n.x-t.x,f=n.y-t.y,e=r.x-n.x,h=r.y-n.y,v=u*u+f*f,d=u*h-f*e,a,c;if(Math.abs(d)>Number.EPSILON){var y=Math.sqrt(v),p=Math.sqrt(e*e+h*h),w=t.x-f/y,b=t.y+u/y,g=r.x-h/p,nt=r.y+e/p,k=((g-w)*h-(nt-b)*e)/(u*h-f*e);if(o=w+u*k-n.x,s=b+f*k-n.y,a=o*o+s*s,a<=2)return new i(o,s);l=Math.sqrt(a/2)}else c=!1,u>Number.EPSILON?e>Number.EPSILON&&(c=!0):u<-Number.EPSILON?e<-Number.EPSILON&&(c=!0):Math.sign(f)===Math.sign(h)&&(c=!0),c?(o=-f,s=u,l=Math.sqrt(v)):(o=u,s=f,l=Math.sqrt(v/2));return new i(o/l,s/l)}function bi(){var i=a.length/3,t,n;if(ni){for(t=0,n=b*t,f=0;f<kt;f++)c=ct[f],ui(c[2]+n,c[1]+n,c[0]+n);for(t=w+ot*2,n=b*t,f=0;f<kt;f++)c=ct[f],ui(c[0]+n,c[1]+n,c[2]+n)}else{for(f=0;f<kt;f++)c=ct[f],ui(c[2],c[1],c[0]);for(f=0;f<kt;f++)c=ct[f],ui(c[0]+b*w,c[1]+b*w,c[2]+b*w)}ei.addGroup(i,a.length/3-i,u.material!==undefined?u.material:0)}function ki(){var t=a.length/3,n=0;for(ci(p,n),n+=p.length,e=0,y=l.length;e<y;e++)s=l[e],ci(s,n),n+=s.length;ei.addGroup(t,a.length/3-t,u.extrudeMaterial!==undefined?u.extrudeMaterial:1)}function ci(n,t){var u,r,i,e;for(f=n.length;--f>=0;)for(u=f,r=f-1,r<0&&(r=n.length-1),i=0,e=w+ot*2,i=0;i<e;i++){var o=b*i,s=b*(i+1),h=t+u+o,c=t+r+o,l=t+r+s,a=t+u+s;di(h,c,l,a,n,i,e,u,r)}}function nt(n,t,i){ht.push(n),ht.push(t),ht.push(i)}function ui(n,t,i){g(n),g(t),g(i);var r=a.length/3,u=wi.generateTopUV(ei,a,r-3,r-2,r-1);rt(u[0]),rt(u[1]),rt(u[2])}function di(n,t,i,r){g(n),g(t),g(r),g(t),g(i),g(r);var c=a.length/3,h=wi.generateSideWallUV(ei,a,c-6,c-3,c-2,c-1);rt(h[0]),rt(h[1]),rt(h[3]),rt(h[1]),rt(h[2]),rt(h[3])}function g(n){ai.push(a.length/3),a.push(ht[n*3+0]),a.push(ht[n*3+1]),a.push(ht[n*3+2])}function rt(n){vi.push(n.x),vi.push(n.y)}var hi=u.arrays?u.arrays:this.getArrays(),a=hi.position,ai=hi.index,vi=hi.uv,ht=[],si=u.amount!==undefined?u.amount:100,ri=u.bevelThickness!==undefined?u.bevelThickness:6,ii=u.bevelSize!==undefined?u.bevelSize:ri-2,ot=u.bevelSegments!==undefined?u.bevelSegments:3,ni=u.bevelEnabled!==undefined?u.bevelEnabled:!0,nr=u.curveSegments!==undefined?u.curveSegments:12,w=u.steps!==undefined?u.steps:1,oi=u.extrudePath,dt,fi=!1,wi=u.UVGenerator!==undefined?u.UVGenerator:gi.WorldUVGenerator,gt,vt,bt,it,ct,p,ft,d,at,st,o,b,c,kt,pt,ti,ut,yt,et;oi&&(dt=oi.getSpacedPoints(w),fi=!0,ni=!1,gt=u.frames!==undefined?u.frames:oi.computeFrenetFrames(w,!1),vt=new t,bt=new t,it=new t),ni||(ot=0,ri=0,ii=0);var s,e,y,ei=this,yi=n.extractPoints(nr),v=yi.shape,l=yi.holes,li=!wt.isClockWise(v);if(li){for(v=v.reverse(),e=0,y=l.length;e<y;e++)s=l[e],wt.isClockWise(s)&&(l[e]=s.reverse());li=!1}for(ct=wt.triangulateShape(v,l),p=v,e=0,y=l.length;e<y;e++)s=l[e],v=v.concat(s);b=v.length,kt=ct.length,pt=[];for(var f=0,h=p.length,k=h-1,tt=f+1;f<h;f++,k++,tt++)k===h&&(k=0),tt===h&&(tt=0),pt[f]=pi(p[f],p[k],p[tt]);for(ti=[],yt=pt.concat(),e=0,y=l.length;e<y;e++){for(s=l[e],ut=[],f=0,h=s.length,k=h-1,tt=f+1;f<h;f++,k++,tt++)k===h&&(k=0),tt===h&&(tt=0),ut[f]=pi(s[f],s[k],s[tt]);ti.push(ut),yt=yt.concat(ut)}for(ft=0;ft<ot;ft++){for(at=ft/ot,st=ri*Math.cos(at*Math.PI/2),d=ii*Math.sin(at*Math.PI/2),f=0,h=p.length;f<h;f++)o=lt(p[f],pt[f],d),nt(o.x,o.y,-st);for(e=0,y=l.length;e<y;e++)for(s=l[e],ut=ti[e],f=0,h=s.length;f<h;f++)o=lt(s[f],ut[f],d),nt(o.x,o.y,-st)}for(d=ii,f=0;f<b;f++)o=ni?lt(v[f],yt[f],d):v[f],fi?(bt.copy(gt.normals[0]).multiplyScalar(o.x),vt.copy(gt.binormals[0]).multiplyScalar(o.y),it.copy(dt[0]).add(bt).add(vt),nt(it.x,it.y,it.z)):nt(o.x,o.y,0);for(et=1;et<=w;et++)for(f=0;f<b;f++)o=ni?lt(v[f],yt[f],d):v[f],fi?(bt.copy(gt.normals[et]).multiplyScalar(o.x),vt.copy(gt.binormals[et]).multiplyScalar(o.y),it.copy(dt[et]).add(bt).add(vt),nt(it.x,it.y,it.z)):nt(o.x,o.y,si/w*et);for(ft=ot-1;ft>=0;ft--){for(at=ft/ot,st=ri*Math.cos(at*Math.PI/2),d=ii*Math.sin(at*Math.PI/2),f=0,h=p.length;f<h;f++)o=lt(p[f],pt[f],d),nt(o.x,o.y,si+st);for(e=0,y=l.length;e<y;e++)for(s=l[e],ut=ti[e],f=0,h=s.length;f<h;f++)o=lt(s[f],ut[f],d),fi?nt(o.x,o.y+dt[w-1].y,dt[w-1].x+st):nt(o.x,o.y,si+st)}bi(),ki(),u.arrays||(this.setIndex(ai),this.addAttribute("position",new r(a,3)),this.addAttribute("uv",new r(u.arrays.uv,2)))},gi.WorldUVGenerator={generateTopUV:function(n,t,r,u,f){var e=t[r*3],o=t[r*3+1],s=t[u*3],h=t[u*3+1],c=t[f*3],l=t[f*3+1];return[new i(e,o),new i(s,h),new i(c,l)]},generateSideWallUV:function(n,t,r,u,f,e){var w=t[r*3],l=t[r*3+1],c=t[r*3+2],k=t[u*3],h=t[u*3+1],s=t[u*3+2],y=t[f*3],p=t[f*3+1],o=t[f*3+2],b=t[e*3],v=t[e*3+1],a=t[e*3+2];return Math.abs(l-h)<.01?[new i(w,1-c),new i(k,1-s),new i(y,1-o),new i(b,1-a)]:[new i(l,1-c),new i(h,1-s),new i(p,1-o),new i(v,1-a)]}},po.prototype=Object.create(s.prototype),po.prototype.constructor=po,we.prototype=Object.create(ii.prototype),we.prototype.constructor=we,ke.prototype=Object.create(s.prototype),ke.prototype.constructor=ke,br.prototype=Object.create(f.prototype),br.prototype.constructor=br,nh.prototype=Object.create(s.prototype),nh.prototype.constructor=nh,ye.prototype=Object.create(f.prototype),ye.prototype.constructor=ye,vo.prototype=Object.create(s.prototype),vo.prototype.constructor=vo,se.prototype=Object.create(f.prototype),se.prototype.constructor=se,fe.prototype=Object.create(s.prototype),fe.prototype.constructor=fe,ue.prototype=Object.create(f.prototype),ue.prototype.constructor=ue,ie.prototype=Object.create(f.prototype),ie.prototype.constructor=ie,eu.prototype=Object.create(s.prototype),eu.prototype.constructor=eu,yi.prototype=Object.create(f.prototype),yi.prototype.constructor=yi,uh.prototype=Object.create(eu.prototype),uh.prototype.constructor=uh,rh.prototype=Object.create(yi.prototype),rh.prototype.constructor=rh,ih.prototype=Object.create(s.prototype),ih.prototype.constructor=ih,ee.prototype=Object.create(f.prototype),ee.prototype.constructor=ee,vt=Object.freeze({WireframeGeometry:ve,ParametricGeometry:es,ParametricBufferGeometry:ae,TetrahedronGeometry:as,TetrahedronBufferGeometry:oe,OctahedronGeometry:ys,OctahedronBufferGeometry:lr,IcosahedronGeometry:ps,IcosahedronBufferGeometry:re,DodecahedronGeometry:ds,DodecahedronBufferGeometry:ne,PolyhedronGeometry:os,PolyhedronBufferGeometry:ht,TubeGeometry:fh,TubeBufferGeometry:gf,TorusKnotGeometry:go,TorusKnotBufferGeometry:le,TorusGeometry:ro,TorusBufferGeometry:te,TextGeometry:po,TextBufferGeometry:we,SphereGeometry:ke,SphereBufferGeometry:br,RingGeometry:nh,RingBufferGeometry:ye,PlaneGeometry:ko,PlaneBufferGeometry:wr,LatheGeometry:vo,LatheBufferGeometry:se,ShapeGeometry:fe,ShapeBufferGeometry:ue,ExtrudeGeometry:gi,ExtrudeBufferGeometry:ii,EdgesGeometry:ie,ConeGeometry:uh,ConeBufferGeometry:rh,CylinderGeometry:eu,CylinderBufferGeometry:yi,CircleGeometry:ih,CircleBufferGeometry:ee,BoxGeometry:du,BoxBufferGeometry:pr}),pe.prototype=Object.create(ft.prototype),pe.prototype.constructor=pe,pe.prototype.isShadowMaterial=!0,ef.prototype=Object.create(ft.prototype),ef.prototype.constructor=ef,ef.prototype.isRawShaderMaterial=!0,si.prototype=Object.create(a.prototype),si.prototype.constructor=si,si.prototype.isMeshStandardMaterial=!0,si.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.defines={STANDARD:""},this.color.copy(n.color),this.roughness=n.roughness,this.metalness=n.metalness,this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.emissive.copy(n.emissive),this.emissiveMap=n.emissiveMap,this.emissiveIntensity=n.emissiveIntensity,this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.roughnessMap=n.roughnessMap,this.metalnessMap=n.metalnessMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.envMapIntensity=n.envMapIntensity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this},su.prototype=Object.create(si.prototype),su.prototype.constructor=su,su.prototype.isMeshPhysicalMaterial=!0,su.prototype.copy=function(n){return si.prototype.copy.call(this,n),this.defines={PHYSICAL:""},this.reflectivity=n.reflectivity,this.clearCoat=n.clearCoat,this.clearCoatRoughness=n.clearCoatRoughness,this},dt.prototype=Object.create(a.prototype),dt.prototype.constructor=dt,dt.prototype.isMeshPhongMaterial=!0,dt.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.color.copy(n.color),this.specular.copy(n.specular),this.shininess=n.shininess,this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.emissive.copy(n.emissive),this.emissiveMap=n.emissiveMap,this.emissiveIntensity=n.emissiveIntensity,this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.specularMap=n.specularMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.combine=n.combine,this.reflectivity=n.reflectivity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this},tu.prototype=Object.create(dt.prototype),tu.prototype.constructor=tu,tu.prototype.isMeshToonMaterial=!0,tu.prototype.copy=function(n){return dt.prototype.copy.call(this,n),this.gradientMap=n.gradientMap,this},ur.prototype=Object.create(a.prototype),ur.prototype.constructor=ur,ur.prototype.isMeshNormalMaterial=!0,ur.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this},er.prototype=Object.create(a.prototype),er.prototype.constructor=er,er.prototype.isMeshLambertMaterial=!0,er.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.emissive.copy(n.emissive),this.emissiveMap=n.emissiveMap,this.emissiveIntensity=n.emissiveIntensity,this.specularMap=n.specularMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.combine=n.combine,this.reflectivity=n.reflectivity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this},or.prototype=Object.create(a.prototype),or.prototype.constructor=or,or.prototype.isLineDashedMaterial=!0,or.prototype.copy=function(n){return a.prototype.copy.call(this,n),this.color.copy(n.color),this.linewidth=n.linewidth,this.scale=n.scale,this.dashSize=n.dashSize,this.gapSize=n.gapSize,this},tp=Object.freeze({ShadowMaterial:pe,SpriteMaterial:di,RawShaderMaterial:ef,ShaderMaterial:ft,PointsMaterial:gt,MeshPhysicalMaterial:su,MeshStandardMaterial:si,MeshPhongMaterial:dt,MeshToonMaterial:tu,MeshNormalMaterial:ur,MeshLambertMaterial:er,MeshDepthMaterial:bi,MeshBasicMaterial:yt,LineDashedMaterial:or,LineBasicMaterial:k,Material:a}),ku={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(this.files[n]=t)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}},st=new wl,Object.assign(ni.prototype,{load:function(n,t,i,r){var u,c,v,s,o,a,p,h,y,f,l;if(n===undefined&&(n=""),this.path!==undefined&&(n=this.path+n),u=this,c=ku.get(n),c!==undefined)return u.manager.itemStart(n),setTimeout(function(){t&&t(c),u.manager.itemEnd(n)},0),c;if(v=/^data:(.*?)(;base64)?,(.*)$/,s=n.match(v),s){var w=s[1],b=!!s[2],e=s[3];e=window.decodeURIComponent(e),b&&(e=window.atob(e));try{a=(this.responseType||"").toLowerCase();switch(a){case"arraybuffer":case"blob":for(o=new ArrayBuffer(e.length),p=new Uint8Array(o),h=0;h<e.length;h++)p[h]=e.charCodeAt(h);a==="blob"&&(o=new Blob([o],{type:w}));break;case"document":y=new DOMParser,o=y.parseFromString(e,w);break;case"json":o=JSON.parse(e);break;default:o=e}window.setTimeout(function(){t&&t(o),u.manager.itemEnd(n)},0)}catch(k){window.setTimeout(function(){r&&r(k),u.manager.itemEnd(n),u.manager.itemError(n)},0)}}else{f=new XMLHttpRequest,f.open("GET",n,!0),f.addEventListener("load",function(i){var f=i.target.response;ku.add(n,f),this.status===200?(t&&t(f),u.manager.itemEnd(n)):this.status===0?(console.warn("THREE.FileLoader: HTTP Status 0 received."),t&&t(f),u.manager.itemEnd(n)):(r&&r(i),u.manager.itemEnd(n),u.manager.itemError(n))},!1),i!==undefined&&f.addEventListener("progress",function(n){i(n)},!1),f.addEventListener("error",function(t){r&&r(t),u.manager.itemEnd(n),u.manager.itemError(n)},!1),this.responseType!==undefined&&(f.responseType=this.responseType),this.withCredentials!==undefined&&(f.withCredentials=this.withCredentials),f.overrideMimeType&&f.overrideMimeType(this.mimeType!==undefined?this.mimeType:"text/plain");for(l in this.requestHeader)f.setRequestHeader(l,this.requestHeader[l]);f.send(null)}return u.manager.itemStart(n),f},setPath:function(n){return this.path=n,this},setResponseType:function(n){return this.responseType=n,this},setWithCredentials:function(n){return this.withCredentials=n,this},setMimeType:function(n){return this.mimeType=n,this},setRequestHeader:function(n){return this.requestHeader=n,this}}),Object.assign(kb.prototype,{load:function(n,t,i,r){function l(o){e.load(n[o],function(n){var i=h._parser(n,!0);f[o]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},s+=1,s===6&&(i.mipmapCount===1&&(u.minFilter=ot),u.format=i.format,u.needsUpdate=!0,t&&t(u))},i,r)}var h=this,f=[],u=new wf,e,s,o,c;if(u.image=f,e=new ni(this.manager),e.setPath(this.path),e.setResponseType("arraybuffer"),Array.isArray(n))for(s=0,o=0,c=n.length;o<c;++o)l(o);else e.load(n,function(n){var i=h._parser(n,!0),o,r,e;if(i.isCubemap)for(o=i.mipmaps.length/i.mipmapCount,r=0;r<o;r++)for(f[r]={mipmaps:[]},e=0;e<i.mipmapCount;e++)f[r].mipmaps.push(i.mipmaps[r*i.mipmapCount+e]),f[r].format=i.format,f[r].width=i.width,f[r].height=i.height;else u.image.width=i.width,u.image.height=i.height,u.mipmaps=i.mipmaps;i.mipmapCount===1&&(u.minFilter=ot),u.format=i.format,u.needsUpdate=!0,t&&t(u)},i,r);return u},setPath:function(n){return this.path=n,this}}),Object.assign(yl.prototype,{load:function(n,t,i,r){var e=this,u=new fu,f=new ni(this.manager);return f.setResponseType("arraybuffer"),f.load(n,function(n){var i=e._parser(n);i&&(undefined!==i.image?u.image=i.image:undefined!==i.data&&(u.image.width=i.width,u.image.height=i.height,u.image.data=i.data),u.wrapS=undefined!==i.wrapS?i.wrapS:ct,u.wrapT=undefined!==i.wrapT?i.wrapT:ct,u.magFilter=undefined!==i.magFilter?i.magFilter:ot,u.minFilter=undefined!==i.minFilter?i.minFilter:eo,u.anisotropy=undefined!==i.anisotropy?i.anisotropy:1,undefined!==i.format&&(u.format=i.format),undefined!==i.type&&(u.type=i.type),undefined!==i.mipmaps&&(u.mipmaps=i.mipmaps),1===i.mipmapCount&&(u.minFilter=ot),u.needsUpdate=!0,t&&t(u,i))},i,r),u}}),Object.assign(ws.prototype,{load:function(n,t,i,r){var u,e,f;return(n===undefined&&(n=""),this.path!==undefined&&(n=this.path+n),u=this,e=ku.get(n),e!==undefined)?(u.manager.itemStart(n),setTimeout(function(){t&&t(e),u.manager.itemEnd(n)},0),e):(f=document.createElementNS("http://www.w3.org/1999/xhtml","img"),f.addEventListener("load",function(){ku.add(n,this),t&&t(this),u.manager.itemEnd(n)},!1),f.addEventListener("error",function(t){r&&r(t),u.manager.itemEnd(n),u.manager.itemError(n)},!1),n.substr(0,5)!=="data:"&&this.crossOrigin!==undefined&&(f.crossOrigin=this.crossOrigin),u.manager.itemStart(n),f.src=n,f)},setCrossOrigin:function(n){return this.crossOrigin=n,this},setPath:function(n){return this.path=n,this}}),Object.assign(gl.prototype,{load:function(n,t,i,r){function s(i){e.load(n[i],function(n){u.images[i]=n,o++,o===6&&(u.needsUpdate=!0,t&&t(u))},undefined,r)}var u=new ki,e=new ws(this.manager),o,f;for(e.setCrossOrigin(this.crossOrigin),e.setPath(this.path),o=0,f=0;f<n.length;++f)s(f);return u},setCrossOrigin:function(n){return this.crossOrigin=n,this},setPath:function(n){return this.path=n,this}}),Object.assign(kh.prototype,{load:function(n,t,i,r){var f=new ws(this.manager),u;return f.setCrossOrigin(this.crossOrigin),f.setPath(this.path),u=new w,u.image=f.load(n,function(){var i=n.search(/\.(jpg|jpeg)$/)>0||n.search(/^data\:image\/jpeg/)===0;u.format=i?he:fi,u.needsUpdate=!0,t!==undefined&&t(u)},i,r),u},setCrossOrigin:function(n){return this.crossOrigin=n,this},setPath:function(n){return this.path=n,this}}),d.prototype=Object.assign(Object.create(u.prototype),{constructor:d,isLight:!0,copy:function(n){return u.prototype.copy.call(this,n),this.color.copy(n.color),this.intensity=n.intensity,this},toJSON:function(n){var t=u.prototype.toJSON.call(this,n);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==undefined&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==undefined&&(t.object.distance=this.distance),this.angle!==undefined&&(t.object.angle=this.angle),this.decay!==undefined&&(t.object.decay=this.decay),this.penumbra!==undefined&&(t.object.penumbra=this.penumbra),this.shadow!==undefined&&(t.object.shadow=this.shadow.toJSON()),t}}),dh.prototype=Object.assign(Object.create(d.prototype),{constructor:dh,isHemisphereLight:!0,copy:function(n){return d.prototype.copy.call(this,n),this.groundColor.copy(n.groundColor),this}}),Object.assign(gr.prototype,{copy:function(n){return this.camera=n.camera.clone(),this.bias=n.bias,this.radius=n.radius,this.mapSize.copy(n.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var n={};return this.bias!==0&&(n.bias=this.bias),this.radius!==1&&(n.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(n.mapSize=this.mapSize.toArray()),n.camera=this.camera.toJSON(!1).object,delete n.camera.matrix,n}}),gh.prototype=Object.assign(Object.create(gr.prototype),{constructor:gh,isSpotLightShadow:!0,update:function(n){var t=this.camera,i=c.RAD2DEG*2*n.angle,r=this.mapSize.width/this.mapSize.height,u=n.distance||t.far;(i!==t.fov||r!==t.aspect||u!==t.far)&&(t.fov=i,t.aspect=r,t.far=u,t.updateProjectionMatrix())}}),nc.prototype=Object.assign(Object.create(d.prototype),{constructor:nc,isSpotLight:!0,copy:function(n){return d.prototype.copy.call(this,n),this.distance=n.distance,this.angle=n.angle,this.penumbra=n.penumbra,this.decay=n.decay,this.target=n.target.clone(),this.shadow=n.shadow.clone(),this}}),tc.prototype=Object.assign(Object.create(d.prototype),{constructor:tc,isPointLight:!0,copy:function(n){return d.prototype.copy.call(this,n),this.distance=n.distance,this.decay=n.decay,this.shadow=n.shadow.clone(),this}}),ic.prototype=Object.assign(Object.create(gr.prototype),{constructor:ic}),rc.prototype=Object.assign(Object.create(d.prototype),{constructor:rc,isDirectionalLight:!0,copy:function(n){return d.prototype.copy.call(this,n),this.target=n.target.clone(),this.shadow=n.shadow.clone(),this}}),fc.prototype=Object.assign(Object.create(d.prototype),{constructor:fc,isAmbientLight:!0}),ec.prototype=Object.assign(Object.create(d.prototype),{constructor:ec,isRectAreaLight:!0,copy:function(n){return d.prototype.copy.call(this,n),this.width=n.width,this.height=n.height,this},toJSON:function(n){var t=d.prototype.toJSON.call(this,n);return t.object.width=this.width,t.object.height=this.height,t}}),it={arraySlice:function(n,t,i){return it.isTypedArray(n)?new n.constructor(n.subarray(t,i!==undefined?i:n.length)):n.slice(t,i)},convertArray:function(n,t,i){return!n||!i&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){function u(t,i){return n[t]-n[i]}for(var r=n.length,i=new Array(r),t=0;t!==r;++t)i[t]=t;return i.sort(u),i},sortedArray:function(n,t,i){for(var e=n.length,o=new n.constructor(e),s,r,u=0,f=0;f!==e;++u)for(s=i[u]*t,r=0;r!==t;++r)o[f++]=n[s+r];return o},flattenJSON:function(n,t,i,r){for(var e=1,u=n[0],f;u!==undefined&&u[r]===undefined;)u=n[e++];if(u!==undefined&&(f=u[r],f!==undefined))if(Array.isArray(f)){do f=u[r],f!==undefined&&(t.push(u.time),i.push.apply(i,f)),u=n[e++];while(u!==undefined)}else if(f.toArray!==undefined){do f=u[r],f!==undefined&&(t.push(u.time),f.toArray(i,i.length)),u=n[e++];while(u!==undefined)}else do f=u[r],f!==undefined&&(t.push(u.time),i.push(f)),u=n[e++];while(u!==undefined)}},Object.assign(lt.prototype,{evaluate:function(n){var u=this.parameterPositions,t=this._cachedIndex,r=u[t],i=u[t-1],f,s,e,o;n:{t:{i:{r:if(!(n<r)){for(e=t+2;;){if(r===undefined){if(n<i)break r;return t=u.length,this._cachedIndex=t,this.afterEnd_(t-1,n,i)}if(t===e)break;if(i=r,r=u[++t],n<r)break t}f=u.length;break i}if(!(n>=i)){for(s=u[1],n<s&&(t=2,i=s),e=t-2;;){if(i===undefined)return this._cachedIndex=0,this.beforeStart_(0,n,r);if(t===e)break;if(r=i,i=u[--t-1],n>=i)break t}f=t,t=0;break i}break n}while(t<f)o=t+f>>>1,n<u[o]?f=o:t=o+1;if(r=u[t],i=u[t-1],i===undefined)return this._cachedIndex=0,this.beforeStart_(0,n,r);if(r===undefined)return t=u.length,this._cachedIndex=t,this.afterEnd_(t-1,i,n)}this._cachedIndex=t,this.intervalChanged_(t,i,r)}return this.interpolate_(t,i,n,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(n){for(var i=this.resultBuffer,u=this.sampleValues,r=this.valueSize,f=n*r,t=0;t!==r;++t)i[t]=u[f+t];return i},interpolate_:function(){throw new Error("call to abstract method");},intervalChanged_:function(){}}),Object.assign(lt.prototype,{beforeStart_:lt.prototype.copySampleValue_,afterEnd_:lt.prototype.copySampleValue_}),hc.prototype=Object.assign(Object.create(lt.prototype),{constructor:hc,DefaultSettings_:{endingStart:ru,endingEnd:ru},intervalChanged_:function(n,t,i){var r=this.parameterPositions,u=n-2,f=n+1,e=r[u],o=r[f],s,h;if(e===undefined)switch(this.getSettings_().endingStart){case uu:u=n,e=2*t-i;break;case ss:u=r.length-2,e=t+r[u]-r[u+1];break;default:u=n,e=i}if(o===undefined)switch(this.getSettings_().endingEnd){case uu:f=n,o=2*i-t;break;case ss:f=1,o=i+r[1]-r[0];break;default:f=n-1,o=t}s=(i-t)*.5,h=this.valueSize,this._weightPrev=s/(t-e),this._weightNext=s/(o-i),this._offsetPrev=u*h,this._offsetNext=f*h},interpolate_:function(n,t,i,r){for(var v=this.resultBuffer,s=this.sampleValues,l=this.valueSize,a=n*l,y=a-l,p=this._offsetPrev,g=this._offsetNext,f=this._weightPrev,h=this._weightNext,e=(i-t)/(r-t),o=e*e,c=o*e,b=-f*c+2*f*o-f*e,k=(1+f)*c+(-1.5-2*f)*o+(-.5+f)*e+1,d=(-1-h)*c+(1.5+h)*o+.5*e,w=h*c-h*o,u=0;u!==l;++u)v[u]=b*s[p+u]+k*s[y+u]+d*s[a+u]+w*s[g+u];return v}}),bo.prototype=Object.assign(Object.create(lt.prototype),{constructor:bo,interpolate_:function(n,t,i,r){for(var e=this.resultBuffer,o=this.sampleValues,f=this.valueSize,s=n*f,c=s-f,h=(i-t)/(r-t),l=1-h,u=0;u!==f;++u)e[u]=o[c+u]*l+o[s+u]*h;return e}}),lc.prototype=Object.assign(Object.create(lt.prototype),{constructor:lc,interpolate_:function(n){return this.copySampleValue_(n-1)}}),pi={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:cs,InterpolantFactoryMethodDiscrete:function(n){return new lc(this.times,this.values,this.getValueSize(),n)},InterpolantFactoryMethodLinear:function(n){return new bo(this.times,this.values,this.getValueSize(),n)},InterpolantFactoryMethodSmooth:function(n){return new hc(this.times,this.values,this.getValueSize(),n)},setInterpolation:function(n){var t,i;switch(n){case vs:t=this.InterpolantFactoryMethodDiscrete;break;case cs:t=this.InterpolantFactoryMethodLinear;break;case vl:t=this.InterpolantFactoryMethodSmooth}if(t===undefined){if(i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name,this.createInterpolant===undefined)if(n!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);console.warn(i);return}this.createInterpolant=t},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return vs;case this.InterpolantFactoryMethodLinear:return cs;case this.InterpolantFactoryMethodSmooth:return vl}},getValueSize:function(){return this.values.length/this.times.length},shift:function(n){var i,t,r;if(n!==0)for(i=this.times,t=0,r=i.length;t!==r;++t)i[t]+=n;return this},scale:function(n){var i,t,r;if(n!==1)for(i=this.times,t=0,r=i.length;t!==r;++t)i[t]*=n;return this},trim:function(n,t){for(var u=this.times,f=u.length,r=0,i=f-1,e;r!==f&&u[r]<n;)++r;while(i!==-1&&u[i]>t)--i;return++i,(r!==0||i!==f)&&(r>=i&&(i=Math.max(i,1),r=i-1),e=this.getValueSize(),this.times=it.arraySlice(u,r,i),this.values=it.arraySlice(this.values,r*e,i*e)),this},validate:function(){var i=!0,e=this.getValueSize(),r,t,n,h,f;e-Math.floor(e)!=0&&(console.error("invalid value size in track",this),i=!1);var o=this.times,u=this.values,s=o.length;for(s===0&&(console.error("track is empty",this),i=!1),r=null,n=0;n!==s;n++){if(t=o[n],typeof t=="number"&&isNaN(t)){console.error("time is not a valid number",this,n,t),i=!1;break}if(r!==null&&r>t){console.error("out of order keys",this,n,t,r),i=!1;break}r=t}if(u!==undefined&&it.isTypedArray(u))for(n=0,h=u.length;n!==h;++n)if(f=u[n],isNaN(f)){console.error("value is not a valid number",this,n,f),i=!1;break}return i},optimize:function(){for(var u=this.times,f=this.values,t=this.getValueSize(),p=this.getInterpolation()===vl,i=1,e=u.length-1,o,c,a,n,r=1;r<e;++r){var l=!1,h=u[r],w=u[r+1];if(h!==w&&(r!==1||h!==h[0]))if(p)l=!0;else{var s=r*t,v=s-t,y=s+t;for(n=0;n!==t;++n)if(o=f[s+n],o!==f[v+n]||o!==f[y+n]){l=!0;break}}if(l){if(r!==i)for(u[i]=u[r],c=r*t,a=i*t,n=0;n!==t;++n)f[a+n]=f[c+n];++i}}if(e>0){u[i]=u[e];for(var c=e*t,a=i*t,n=0;n!==t;++n)f[a+n]=f[c+n];++i}return i!==u.length&&(this.times=it.arraySlice(u,0,i),this.values=it.arraySlice(f,0,i*t)),this}},af.prototype=Object.assign(Object.create(pi),{constructor:af,ValueTypeName:"vector"}),ac.prototype=Object.assign(Object.create(lt.prototype),{constructor:ac,interpolate_:function(n,t,i,r){for(var e=this.resultBuffer,o=this.sampleValues,f=this.valueSize,u=n*f,h=(i-t)/(r-t),s=u+f;u!==s;u+=4)g.slerpFlat(e,0,o,u-f,o,u,h);return e}}),oo.prototype=Object.assign(Object.create(pi),{constructor:oo,ValueTypeName:"quaternion",DefaultInterpolation:cs,InterpolantFactoryMethodLinear:function(n){return new ac(this.times,this.values,this.getValueSize(),n)},InterpolantFactoryMethodSmooth:undefined}),lf.prototype=Object.assign(Object.create(pi),{constructor:lf,ValueTypeName:"number"}),vc.prototype=Object.assign(Object.create(pi),{constructor:vc,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:vs,InterpolantFactoryMethodLinear:undefined,InterpolantFactoryMethodSmooth:undefined}),yc.prototype=Object.assign(Object.create(pi),{constructor:yc,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:vs,InterpolantFactoryMethodLinear:undefined,InterpolantFactoryMethodSmooth:undefined}),ah.prototype=Object.assign(Object.create(pi),{constructor:ah,ValueTypeName:"color"}),fr.prototype=pi,pi.constructor=fr,Object.assign(fr,{parse:function(n){var t,i,r;if(n.type===undefined)throw new Error("track type undefined, can not parse");return t=fr._getTrackTypeForValueTypeName(n.type),n.times===undefined&&(i=[],r=[],it.flattenJSON(n.keys,i,r,"value"),n.times=i,n.values=r),t.parse!==undefined?t.parse(n):new t(n.name,n.times,n.values,n.interpolation)},toJSON:function(n){var r=n.constructor,t,i;return r.toJSON!==undefined?t=r.toJSON(n):(t={name:n.name,times:it.convertArray(n.times,Array),values:it.convertArray(n.values,Array)},i=n.getInterpolation(),i!==n.DefaultInterpolation&&(t.interpolation=i)),t.type=n.ValueTypeName,t},_getTrackTypeForValueTypeName:function(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return lf;case"vector":case"vector2":case"vector3":case"vector4":return af;case"color":return ah;case"quaternion":return oo;case"bool":case"boolean":return yc;case"string":return vc}throw new Error("Unsupported typeName: "+n);}}),Object.assign(kt,{parse:function(n){for(var i=[],r=n.tracks,f=1/(n.fps||1),t=0,u=r.length;t!==u;++t)i.push(fr.parse(r[t]).scale(f));return new kt(n.name,n.duration,i)},toJSON:function(n){for(var i=[],r=n.tracks,f={name:n.name,duration:n.duration,tracks:i},t=0,u=r.length;t!==u;++t)i.push(fr.toJSON(r[t]));return f},CreateFromMorphTargetSequence:function(n,t,i,r){for(var o=t.length,h=[],u,e,s,f=0;f<o;f++)u=[],e=[],u.push((f+o-1)%o,f,(f+1)%o),e.push(0,1,0),s=it.getKeyframeOrder(u),u=it.sortedArray(u,1,s),e=it.sortedArray(e,1,s),r||u[0]!==0||(u.push(o),e.push(e[0])),h.push(new lf(".morphTargetInfluences["+t[f].name+"]",u,e).scale(1/i));return new kt(n,-1,h)},findByName:function(n,t){var r=n,u,i;for(Array.isArray(n)||(u=n,r=u.geometry&&u.geometry.animations||u.animations),i=0;i<r.length;i++)if(r[i].name===t)return r[i];return null},CreateClipsFromMorphTargetSequences:function(n,t,i){for(var u={},l=/^([\w-]*?)([\d]+)$/,s,e,o,h,r,f=0,c=n.length;f<c;f++)s=n[f],e=s.name.match(l),e&&e.length>1&&(r=e[1],o=u[r],o||(u[r]=o=[]),o.push(s));h=[];for(r in u)h.push(kt.CreateFromMorphTargetSequence(r,u[r],t,i));return h},parseAnimation:function(n,t){var e,i,s,r,h,c,l,u,a,o,w;if(!n)return console.error("  no animation in JSONLoader data"),null;var v=function(n,t,i,r,u){if(i.length!==0){var f=[],e=[];it.flattenJSON(i,f,e,r),f.length!==0&&u.push(new n(t,f,e))}},f=[],b=n.name||"default",y=n.length||-1,k=n.fps||30,p=n.hierarchy||[];for(e=0;e<p.length;e++)if(i=p[e].keys,i&&i.length!==0)if(i[0].morphTargets){for(s={},r=0;r<i.length;r++)if(i[r].morphTargets)for(u=0;u<i[r].morphTargets.length;u++)s[i[r].morphTargets[u]]=-1;for(h in s){for(c=[],l=[],u=0;u!==i[r].morphTargets.length;++u)a=i[r],c.push(a.time),l.push(a.morphTarget===h?1:0);f.push(new lf(".morphTargetInfluence["+h+"]",c,l))}y=s.length*(k||1)}else o=".bones["+t[e].name+"]",v(af,o+".position",i,"pos",f),v(oo,o+".quaternion",i,"rot",f),v(af,o+".scale",i,"scl",f);return f.length===0?null:w=new kt(b,y,f)}}),Object.assign(kt.prototype,{resetDuration:function(){for(var u=this.tracks,t=0,i,n=0,r=u.length;n!==r;++n)i=this.tracks[n],t=Math.max(t,i.times[i.times.length-1]);this.duration=t},trim:function(){for(var n=0;n<this.tracks.length;n++)this.tracks[n].trim(0,this.duration);return this},optimize:function(){for(var n=0;n<this.tracks.length;n++)this.tracks[n].optimize();return this}}),Object.assign(pc.prototype,{load:function(n,t,i,r){var u=this,f=new ni(u.manager);f.setResponseType("json"),f.load(n,function(n){t(u.parse(n))},i,r)},setTextures:function(n){this.textures=n},parse:function(n){function r(n){return f[n]===undefined&&console.warn("THREE.MaterialLoader: Undefined texture",n),f[n]}var f=this.textures,t=new tp[n.type],u;return n.uuid!==undefined&&(t.uuid=n.uuid),n.name!==undefined&&(t.name=n.name),n.color!==undefined&&t.color.setHex(n.color),n.roughness!==undefined&&(t.roughness=n.roughness),n.metalness!==undefined&&(t.metalness=n.metalness),n.emissive!==undefined&&t.emissive.setHex(n.emissive),n.specular!==undefined&&t.specular.setHex(n.specular),n.shininess!==undefined&&(t.shininess=n.shininess),n.clearCoat!==undefined&&(t.clearCoat=n.clearCoat),n.clearCoatRoughness!==undefined&&(t.clearCoatRoughness=n.clearCoatRoughness),n.uniforms!==undefined&&(t.uniforms=n.uniforms),n.vertexShader!==undefined&&(t.vertexShader=n.vertexShader),n.fragmentShader!==undefined&&(t.fragmentShader=n.fragmentShader),n.vertexColors!==undefined&&(t.vertexColors=n.vertexColors),n.fog!==undefined&&(t.fog=n.fog),n.shading!==undefined&&(t.shading=n.shading),n.blending!==undefined&&(t.blending=n.blending),n.side!==undefined&&(t.side=n.side),n.opacity!==undefined&&(t.opacity=n.opacity),n.transparent!==undefined&&(t.transparent=n.transparent),n.alphaTest!==undefined&&(t.alphaTest=n.alphaTest),n.depthTest!==undefined&&(t.depthTest=n.depthTest),n.depthWrite!==undefined&&(t.depthWrite=n.depthWrite),n.colorWrite!==undefined&&(t.colorWrite=n.colorWrite),n.wireframe!==undefined&&(t.wireframe=n.wireframe),n.wireframeLinewidth!==undefined&&(t.wireframeLinewidth=n.wireframeLinewidth),n.wireframeLinecap!==undefined&&(t.wireframeLinecap=n.wireframeLinecap),n.wireframeLinejoin!==undefined&&(t.wireframeLinejoin=n.wireframeLinejoin),n.skinning!==undefined&&(t.skinning=n.skinning),n.morphTargets!==undefined&&(t.morphTargets=n.morphTargets),n.size!==undefined&&(t.size=n.size),n.sizeAttenuation!==undefined&&(t.sizeAttenuation=n.sizeAttenuation),n.map!==undefined&&(t.map=r(n.map)),n.alphaMap!==undefined&&(t.alphaMap=r(n.alphaMap),t.transparent=!0),n.bumpMap!==undefined&&(t.bumpMap=r(n.bumpMap)),n.bumpScale!==undefined&&(t.bumpScale=n.bumpScale),n.normalMap!==undefined&&(t.normalMap=r(n.normalMap)),n.normalScale!==undefined&&(u=n.normalScale,Array.isArray(u)===!1&&(u=[u,u]),t.normalScale=(new i).fromArray(u)),n.displacementMap!==undefined&&(t.displacementMap=r(n.displacementMap)),n.displacementScale!==undefined&&(t.displacementScale=n.displacementScale),n.displacementBias!==undefined&&(t.displacementBias=n.displacementBias),n.roughnessMap!==undefined&&(t.roughnessMap=r(n.roughnessMap)),n.metalnessMap!==undefined&&(t.metalnessMap=r(n.metalnessMap)),n.emissiveMap!==undefined&&(t.emissiveMap=r(n.emissiveMap)),n.emissiveIntensity!==undefined&&(t.emissiveIntensity=n.emissiveIntensity),n.specularMap!==undefined&&(t.specularMap=r(n.specularMap)),n.envMap!==undefined&&(t.envMap=r(n.envMap)),n.reflectivity!==undefined&&(t.reflectivity=n.reflectivity),n.lightMap!==undefined&&(t.lightMap=r(n.lightMap)),n.lightMapIntensity!==undefined&&(t.lightMapIntensity=n.lightMapIntensity),n.aoMap!==undefined&&(t.aoMap=r(n.aoMap)),n.aoMapIntensity!==undefined&&(t.aoMapIntensity=n.aoMapIntensity),n.gradientMap!==undefined&&(t.gradientMap=r(n.gradientMap)),t}}),Object.assign(wv.prototype,{load:function(n,t,i,r){var u=this,f=new ni(u.manager);f.setResponseType("json"),f.load(n,function(n){t(u.parse(n))},i,r)},parse:function(n){var i=new f,c=n.data.index,a,v,r,e,o,s,p,h,u,y;c!==undefined&&(e=new bv[c.type](c.array),i.setIndex(new l(e,1))),a=n.data.attributes;for(v in a)r=a[v],e=new bv[r.type](r.array),i.addAttribute(v,new l(e,r.itemSize,r.normalized));if(o=n.data.groups||n.data.drawcalls||n.data.offsets,o!==undefined)for(s=0,p=o.length;s!==p;++s)h=o[s],i.addGroup(h.start,h.count,h.materialIndex);return u=n.data.boundingSphere,u!==undefined&&(y=new t,u.center!==undefined&&y.fromArray(u.center),i.boundingSphere=new ri(y,u.radius)),i}}),bv={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array},cf.Handlers={handlers:[],add:function(n,t){this.handlers.push(n,t)},get:function(n){for(var i=this.handlers,u,f,t=0,r=i.length;t<r;t+=2)if(u=i[t],f=i[t+1],u.test(n))return f;return null}},Object.assign(cf.prototype,{crossOrigin:undefined,extractUrlBase:function(n){var t=n.split("/");return t.length===1?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(n,t,i){for(var u=[],r=0;r<n.length;++r)u[r]=this.createMaterial(n[r],t,i);return u},createMaterial:function(){var r={NoBlending:cc,NormalBlending:ce,AdditiveBlending:aa,SubtractiveBlending:sv,MultiplyBlending:hv,CustomBlending:cv},n=new e,t=new kh,i=new pc;return function(u,f,e){function h(n,i,r,u,o){var h=f+n,v=cf.Handlers.get(h),s,l;return v!==null?s=v.load(h):(t.setCrossOrigin(e),s=t.load(h)),i!==undefined&&(s.repeat.fromArray(i),i[0]!==1&&(s.wrapS=wi),i[1]!==1&&(s.wrapT=wi)),r!==undefined&&s.offset.fromArray(r),u!==undefined&&(u[0]==="repeat"&&(s.wrapS=wi),u[0]==="mirror"&&(s.wrapS=cu),u[1]==="repeat"&&(s.wrapT=wi),u[1]==="mirror"&&(s.wrapT=cu)),o!==undefined&&(s.anisotropy=o),l=c.generateUUID(),a[l]=s,l}var a={},o={uuid:c.generateUUID(),type:"MeshLambertMaterial"},l,s;for(l in u){s=u[l];switch(l){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":o.name=s;break;case"blending":o.blending=r[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",l,"is no longer supported.");break;case"colorDiffuse":o.color=n.fromArray(s).getHex();break;case"colorSpecular":o.specular=n.fromArray(s).getHex();break;case"colorEmissive":o.emissive=n.fromArray(s).getHex();break;case"specularCoef":o.shininess=s;break;case"shading":s.toLowerCase()==="basic"&&(o.type="MeshBasicMaterial"),s.toLowerCase()==="phong"&&(o.type="MeshPhongMaterial"),s.toLowerCase()==="standard"&&(o.type="MeshStandardMaterial");break;case"mapDiffuse":o.map=h(s,u.mapDiffuseRepeat,u.mapDiffuseOffset,u.mapDiffuseWrap,u.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":o.emissiveMap=h(s,u.mapEmissiveRepeat,u.mapEmissiveOffset,u.mapEmissiveWrap,u.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":o.lightMap=h(s,u.mapLightRepeat,u.mapLightOffset,u.mapLightWrap,u.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":o.aoMap=h(s,u.mapAORepeat,u.mapAOOffset,u.mapAOWrap,u.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":o.bumpMap=h(s,u.mapBumpRepeat,u.mapBumpOffset,u.mapBumpWrap,u.mapBumpAnisotropy);break;case"mapBumpScale":o.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":o.normalMap=h(s,u.mapNormalRepeat,u.mapNormalOffset,u.mapNormalWrap,u.mapNormalAnisotropy);break;case"mapNormalFactor":o.normalScale=[s,s];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":o.specularMap=h(s,u.mapSpecularRepeat,u.mapSpecularOffset,u.mapSpecularWrap,u.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":o.metalnessMap=h(s,u.mapMetalnessRepeat,u.mapMetalnessOffset,u.mapMetalnessWrap,u.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":o.roughnessMap=h(s,u.mapRoughnessRepeat,u.mapRoughnessOffset,u.mapRoughnessWrap,u.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":o.alphaMap=h(s,u.mapAlphaRepeat,u.mapAlphaOffset,u.mapAlphaWrap,u.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":o.side=ir;break;case"doubleSided":o.side=pu;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[l]=s;break;case"vertexColors":s===!0&&(o.vertexColors=hr),s==="face"&&(o.vertexColors=ka);break;default:console.error("THREE.Loader.createMaterial: Unsupported",l,s)}}return o.type==="MeshBasicMaterial"&&delete o.emissive,o.type!=="MeshPhongMaterial"&&delete o.specular,o.opacity<1&&(o.transparent=!0),i.setTextures(a),i.parse(o)}}()}),Object.assign(ey.prototype,{load:function(n,t,i,r){var f=this,e=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:cf.prototype.extractUrlBase(n),u=new ni(this.manager);u.setResponseType("json"),u.setWithCredentials(this.withCredentials),u.load(n,function(i){var o=i.metadata,r,u;if(o!==undefined&&(r=o.type,r!==undefined)){if(r.toLowerCase()==="object"){console.error("THREE.JSONLoader: "+n+" should be loaded with THREE.ObjectLoader instead.");return}if(r.toLowerCase()==="scene"){console.error("THREE.JSONLoader: "+n+" should be loaded with THREE.SceneLoader instead.");return}}u=f.parse(i,e),t(u.geometry,u.materials)},i,r)},setTexturePath:function(n){this.texturePath=n},parse:function(){function n(n,r){function b(n,t){return n&1<<t}var u,w,p,f,ht,y,s,g,nt,v,bt,yt,vt,at,wt,ct,pt,it,a,c,l,k,rt,d,tt,ot,et,o=n.faces,ut=n.vertices,h=n.normals,ft=n.colors,lt=n.scale,st=0;if(n.uvs!==undefined){for(u=0;u<n.uvs.length;u++)n.uvs[u].length&&st++;for(u=0;u<st;u++)r.faceVertexUvs[u]=[]}for(f=0,ht=ut.length;f<ht;)it=new t,it.x=ut[f++]*lt,it.y=ut[f++]*lt,it.z=ut[f++]*lt,r.vertices.push(it);for(f=0,ht=o.length;f<ht;)if(v=o[f++],bt=b(v,0),yt=b(v,1),vt=b(v,3),at=b(v,4),wt=b(v,5),ct=b(v,6),pt=b(v,7),bt){if(c=new li,c.a=o[f],c.b=o[f+1],c.c=o[f+3],l=new li,l.a=o[f+1],l.b=o[f+2],l.c=o[f+3],f+=4,yt&&(nt=o[f++],c.materialIndex=nt,l.materialIndex=nt),p=r.faces.length,vt)for(u=0;u<st;u++)for(d=n.uvs[u],r.faceVertexUvs[u][p]=[],r.faceVertexUvs[u][p+1]=[],w=0;w<4;w++)g=o[f++],ot=d[g*2],et=d[g*2+1],tt=new i(ot,et),w!==2&&r.faceVertexUvs[u][p].push(tt),w!==0&&r.faceVertexUvs[u][p+1].push(tt);if(at&&(s=o[f++]*3,c.normal.set(h[s++],h[s++],h[s]),l.normal.copy(c.normal)),wt)for(u=0;u<4;u++)s=o[f++]*3,rt=new t(h[s++],h[s++],h[s]),u!==2&&c.vertexNormals.push(rt),u!==0&&l.vertexNormals.push(rt);if(ct&&(y=o[f++],k=ft[y],c.color.setHex(k),l.color.setHex(k)),pt)for(u=0;u<4;u++)y=o[f++],k=ft[y],u!==2&&c.vertexColors.push(new e(k)),u!==0&&l.vertexColors.push(new e(k));r.faces.push(c),r.faces.push(l)}else{if(a=new li,a.a=o[f++],a.b=o[f++],a.c=o[f++],yt&&(nt=o[f++],a.materialIndex=nt),p=r.faces.length,vt)for(u=0;u<st;u++)for(d=n.uvs[u],r.faceVertexUvs[u][p]=[],w=0;w<3;w++)g=o[f++],ot=d[g*2],et=d[g*2+1],tt=new i(ot,et),r.faceVertexUvs[u][p].push(tt);if(at&&(s=o[f++]*3,a.normal.set(h[s++],h[s++],h[s])),wt)for(u=0;u<3;u++)s=o[f++]*3,rt=new t(h[s++],h[s++],h[s]),a.vertexNormals.push(rt);if(ct&&(y=o[f++],a.color.setHex(ft[y])),pt)for(u=0;u<3;u++)y=o[f++],a.vertexColors.push(new e(ft[y]));r.faces.push(a)}}function r(n,t){var r=n.influencesPerVertex!==undefined?n.influencesPerVertex:2,i,u;if(n.skinWeights)for(i=0,u=n.skinWeights.length;i<u;i+=r){var f=n.skinWeights[i],e=r>1?n.skinWeights[i+1]:0,o=r>2?n.skinWeights[i+2]:0,s=r>3?n.skinWeights[i+3]:0;t.skinWeights.push(new y(f,e,o,s))}if(n.skinIndices)for(i=0,u=n.skinIndices.length;i<u;i+=r){var h=n.skinIndices[i],c=r>1?n.skinIndices[i+1]:0,l=r>2?n.skinIndices[i+2]:0,a=r>3?n.skinIndices[i+3]:0;t.skinIndices.push(new y(h,c,l,a))}t.bones=n.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}function u(n,i){var s=n.scale,c,f,u,l,e,h,a,r,o;if(n.morphTargets!==undefined)for(r=0,o=n.morphTargets.length;r<o;r++)for(i.morphTargets[r]={},i.morphTargets[r].name=n.morphTargets[r].name,i.morphTargets[r].vertices=[],c=i.morphTargets[r].vertices,f=n.morphTargets[r].vertices,u=0,l=f.length;u<l;u+=3)e=new t,e.x=f[u]*s,e.y=f[u+1]*s,e.z=f[u+2]*s,c.push(e);if(n.morphColors!==undefined&&n.morphColors.length>0)for(console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'),h=i.faces,a=n.morphColors[0].colors,r=0,o=h.length;r<o;r++)h[r].color.fromArray(a,r*3)}function f(n,t){var r=[],i=[],u,f,e;for(n.animation!==undefined&&i.push(n.animation),n.animations!==undefined&&(n.animations.length?i=i.concat(n.animations):i.push(n.animations)),u=0;u<i.length;u++)f=kt.parseAnimation(i[u],t.bones),f&&r.push(f);t.morphTargets&&(e=kt.CreateClipsFromMorphTargetSequences(t.morphTargets,10),r=r.concat(e)),r.length>0&&(t.animations=r)}return function(t,i){var e,o;return t.data!==undefined&&(t=t.data),t.scale=t.scale!==undefined?1/t.scale:1,e=new s,n(t,e),r(t,e),u(t,e),f(t,e),e.computeFaceNormals(),e.computeBoundingSphere(),t.materials===undefined||t.materials.length===0?{geometry:e}:(o=cf.prototype.initMaterials(t.materials,i,this.crossOrigin),{geometry:e,materials:o})}}()}),Object.assign(gk.prototype,{load:function(n,t,i,r){this.texturePath===""&&(this.texturePath=n.substring(0,n.lastIndexOf("/")+1));var u=this,f=new ni(u.manager);f.load(n,function(i){var e=null,f;try{e=JSON.parse(i)}catch(o){r!==undefined&&r(o),console.error("THREE:ObjectLoader: Can't parse "+n+".",o.message);return}if(f=e.metadata,f===undefined||f.type===undefined||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+n+". Use THREE.JSONLoader instead.");return}u.parse(e,t)},i,r)},setTexturePath:function(n){this.texturePath=n},setCrossOrigin:function(n){this.crossOrigin=n},parse:function(n,t){var r=this.parseGeometries(n.geometries),u=this.parseImages(n.images,function(){t!==undefined&&t(i)}),f=this.parseTextures(n.textures,u),e=this.parseMaterials(n.materials,f),i=this.parseObject(n.object,r,e);return n.animations&&(i.animations=this.parseAnimations(n.animations)),(n.images===undefined||n.images.length===0)&&t!==undefined&&t(i),i},parseGeometries:function(n){var u={},f,e,r,o,i,t;if(n!==undefined)for(f=new ey,e=new wv,r=0,o=n.length;r<o;r++){t=n[r];switch(t.type){case"PlaneGeometry":case"PlaneBufferGeometry":i=new vt[t.type](t.width,t.height,t.widthSegments,t.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":i=new vt[t.type](t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":i=new vt[t.type](t.radius,t.segments,t.thetaStart,t.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":i=new vt[t.type](t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":i=new vt[t.type](t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":i=new vt[t.type](t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength);break;case"DodecahedronGeometry":case"IcosahedronGeometry":case"OctahedronGeometry":case"TetrahedronGeometry":i=new vt[t.type](t.radius,t.detail);break;case"RingGeometry":case"RingBufferGeometry":i=new vt[t.type](t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":i=new vt[t.type](t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":i=new vt[t.type](t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q);break;case"LatheGeometry":case"LatheBufferGeometry":i=new vt[t.type](t.points,t.segments,t.phiStart,t.phiLength);break;case"BufferGeometry":i=e.parse(t);break;case"Geometry":i=f.parse(t,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+t.type+'"');continue}i.uuid=t.uuid,t.name!==undefined&&(i.name=t.name),u[t.uuid]=i}return u},parseMaterials:function(n,t){var e={},r,u,s,i,o,f;if(n!==undefined)for(r=new pc,r.setTextures(t),u=0,s=n.length;u<s;u++)if(i=n[u],i.type==="MultiMaterial"){for(o=[],f=0;f<i.materials.length;f++)o.push(r.parse(i.materials[f]));e[i.uuid]=o}else e[i.uuid]=r.parse(i);return e},parseAnimations:function(n){for(var i=[],r,t=0;t<n.length;t++)r=kt.parse(n[t]),i.push(r);return i},parseImages:function(n,t){function c(n){return i.manager.itemStart(n),f.load(n,function(){i.manager.itemEnd(n)},undefined,function(){i.manager.itemEnd(n),i.manager.itemError(n)})}var i=this,e={},o,f,u,s,r,h;if(n!==undefined&&n.length>0)for(o=new wl(t),f=new ws(o),f.setCrossOrigin(this.crossOrigin),u=0,s=n.length;u<s;u++)r=n[u],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(r.url)?r.url:i.texturePath+r.url,e[r.uuid]=c(h);return e},parseTextures:function(n,t){function u(n,t){return typeof n=="number"?n:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",n),t[n])}var e={},f,o,i,r;if(n!==undefined)for(f=0,o=n.length;f<o;f++)i=n[f],i.image===undefined&&console.warn('THREE.ObjectLoader: No "image" specified for',i.uuid),t[i.image]===undefined&&console.warn("THREE.ObjectLoader: Undefined image",i.image),r=new w(t[i.image]),r.needsUpdate=!0,r.uuid=i.uuid,i.name!==undefined&&(r.name=i.name),i.mapping!==undefined&&(r.mapping=u(i.mapping,kd)),i.offset!==undefined&&r.offset.fromArray(i.offset),i.repeat!==undefined&&r.repeat.fromArray(i.repeat),i.wrap!==undefined&&(r.wrapS=u(i.wrap[0],hk),r.wrapT=u(i.wrap[1],hk)),i.minFilter!==undefined&&(r.minFilter=u(i.minFilter,sk)),i.magFilter!==undefined&&(r.magFilter=u(i.magFilter,sk)),i.anisotropy!==undefined&&(r.anisotropy=i.anisotropy),i.flipY!==undefined&&(r.flipY=i.flipY),e[i.uuid]=r;return e},parseObject:function(){var n=new o;return function(t,i,r){function s(n){return i[n]===undefined&&console.warn("THREE.ObjectLoader: Undefined geometry",n),i[n]}function o(n){var u,t,f,i;if(n===undefined)return undefined;if(Array.isArray(n)){for(u=[],t=0,f=n.length;t<f;t++)i=n[t],r[i]===undefined&&console.warn("THREE.ObjectLoader: Undefined material",i),u.push(r[i]);return u}return r[n]===undefined&&console.warn("THREE.ObjectLoader: Undefined material",n),r[n]}var f,h,a,v,l,y,c;switch(t.type){case"Scene":f=new wh,t.background!==undefined&&Number.isInteger(t.background)&&(f.background=new e(t.background)),t.fog!==undefined&&(t.fog.type==="Fog"?f.fog=new wu(t.fog.color,t.fog.near,t.fog.far):t.fog.type==="FogExp2"&&(f.fog=new yu(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":f=new nt(t.fov,t.aspect,t.near,t.far),t.focus!==undefined&&(f.focus=t.focus),t.zoom!==undefined&&(f.zoom=t.zoom),t.filmGauge!==undefined&&(f.filmGauge=t.filmGauge),t.filmOffset!==undefined&&(f.filmOffset=t.filmOffset),t.view!==undefined&&(f.view=Object.assign({},t.view));break;case"OrthographicCamera":f=new pf(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":f=new fc(t.color,t.intensity);break;case"DirectionalLight":f=new rc(t.color,t.intensity);break;case"PointLight":f=new tc(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":f=new ec(t.color,t.intensity,t.width,t.height);break;case"SpotLight":f=new nc(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":f=new dh(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":h=s(t.geometry),a=o(t.material),f=h.bones&&h.bones.length>0?new yh(h,a):new ut(h,a);break;case"LOD":f=new rs;break;case"Line":f=new pt(s(t.geometry),o(t.material),t.mode);break;case"LineLoop":f=new vh(s(t.geometry),o(t.material));break;case"LineSegments":f=new b(s(t.geometry),o(t.material));break;case"PointCloud":case"Points":f=new vf(s(t.geometry),o(t.material));break;case"Sprite":f=new us(o(t.material));break;case"Group":f=new ns;break;default:f=new u}if(f.uuid=t.uuid,t.name!==undefined&&(f.name=t.name),t.matrix!==undefined?(n.fromArray(t.matrix),n.decompose(f.position,f.quaternion,f.scale)):(t.position!==undefined&&f.position.fromArray(t.position),t.rotation!==undefined&&f.rotation.fromArray(t.rotation),t.quaternion!==undefined&&f.quaternion.fromArray(t.quaternion),t.scale!==undefined&&f.scale.fromArray(t.scale)),t.castShadow!==undefined&&(f.castShadow=t.castShadow),t.receiveShadow!==undefined&&(f.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==undefined&&(f.shadow.bias=t.shadow.bias),t.shadow.radius!==undefined&&(f.shadow.radius=t.shadow.radius),t.shadow.mapSize!==undefined&&f.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==undefined&&(f.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==undefined&&(f.visible=t.visible),t.userData!==undefined&&(f.userData=t.userData),t.children!==undefined)for(c in t.children)f.add(this.parseObject(t.children[c],i,r));if(t.type==="LOD")for(v=t.levels,l=0;l<v.length;l++)y=v[l],c=f.getObjectByProperty("uuid",y.object),c!==undefined&&f.addLevel(c,y.distance);return f}}()});var kd={UVMapping:il,CubeReflectionMapping:ol,CubeRefractionMapping:cl,EquirectangularReflectionMapping:pa,EquirectangularRefractionMapping:ll,SphericalReflectionMapping:ta,CubeUVReflectionMapping:wc,CubeUVRefractionMapping:al},hk={RepeatWrapping:wi,ClampToEdgeWrapping:ct,MirroredRepeatWrapping:cu},sk={NearestFilter:at,NearestMipMapNearestFilter:hl,NearestMipMapLinearFilter:sl,LinearFilter:ot,LinearMipMapNearestFilter:wa,LinearMipMapLinearFilter:eo};Object.assign(p.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(n){var t=this.getUtoTmapping(n);return this.getPoint(t)},getPoints:function(n){var i,t;for(n===undefined&&(n=5),i=[],t=0;t<=n;t++)i.push(this.getPoint(t/n));return i},getSpacedPoints:function(n){var i,t;for(n===undefined&&(n=5),i=[],t=0;t<=n;t++)i.push(this.getPointAt(t/n));return i},getLength:function(){var n=this.getLengths();return n[n.length-1]},getLengths:function(n){if(n===undefined&&(n=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===n+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t=[],r,u=this.getPoint(0),i,f=0;for(t.push(0),i=1;i<=n;i++)r=this.getPoint(i/n),f+=r.distanceTo(u),t.push(f),u=r;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(n,t){var r=this.getLengths(),i=0,o=r.length,f,e,u,s;for(f=t?t:n*r[o-1],e=0,u=o-1;e<=u;)if(i=Math.floor(e+(u-e)/2),s=r[i]-f,s<0)e=i+1;else if(s>0)u=i-1;else{u=i;break}if(i=u,r[i]===f)return i/(o-1);var h=r[i],c=r[i+1],l=c-h,a=(f-h)/l;return(i+a)/(o-1)},getTangent:function(n){var r=.0001,t=n-r,i=n+r;t<0&&(t=0),i>1&&(i=1);var u=this.getPoint(t),f=this.getPoint(i),e=f.clone().sub(u);return e.normalize()},getTangentAt:function(n){var t=this.getUtoTmapping(n);return this.getTangent(t)},computeFrenetFrames:function(n,i){for(var a=new t,u=[],f=[],e=[],s=new t,v=new o,y,h,r=0;r<=n;r++)y=r/n,u[r]=this.getTangentAt(y),u[r].normalize();f[0]=new t,e[0]=new t;var l=Number.MAX_VALUE,p=Math.abs(u[0].x),w=Math.abs(u[0].y),b=Math.abs(u[0].z);for(p<=l&&(l=p,a.set(1,0,0)),w<=l&&(l=w,a.set(0,1,0)),b<=l&&a.set(0,0,1),s.crossVectors(u[0],a).normalize(),f[0].crossVectors(u[0],s),e[0].crossVectors(u[0],f[0]),r=1;r<=n;r++)f[r]=f[r-1].clone(),e[r]=e[r-1].clone(),s.crossVectors(u[r-1],u[r]),s.length()>Number.EPSILON&&(s.normalize(),h=Math.acos(c.clamp(u[r-1].dot(u[r]),-1,1)),f[r].applyMatrix4(v.makeRotationAxis(s,h))),e[r].crossVectors(u[r],f[r]);if(i===!0)for(h=Math.acos(c.clamp(f[0].dot(f[n]),-1,1)),h/=n,u[0].dot(s.crossVectors(f[0],f[n]))>0&&(h=-h),r=1;r<=n;r++)f[r].applyMatrix4(v.makeRotationAxis(u[r],h*r)),e[r].crossVectors(u[r],f[r]);return{tangents:u,normals:f,binormals:e}}}),ei.prototype=Object.create(p.prototype),ei.prototype.constructor=ei,ei.prototype.isLineCurve=!0,ei.prototype.getPoint=function(n){if(n===1)return this.v2.clone();var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(n).add(this.v1),t},ei.prototype.getPointAt=function(n){return this.getPoint(n)},ei.prototype.getTangent=function(){var t=this.v2.clone().sub(this.v1);return t.normalize()},de.prototype=Object.assign(Object.create(p.prototype),{constructor:de,add:function(n){this.curves.push(n)},closePath:function(){var n=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);n.equals(t)||this.curves.push(new ei(t,n))},getPoint:function(n){for(var r=n*this.getLength(),i=this.getCurveLengths(),t=0;t<i.length;){if(i[t]>=r){var e=i[t]-r,u=this.curves[t],f=u.getLength(),o=f===0?0:1-e/f;return u.getPointAt(o)}t++}return null},getLength:function(){var n=this.getCurveLengths();return n[n.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){var n,i,t,r;if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(n=[],i=0,t=0,r=this.curves.length;t<r;t++)i+=this.curves[t].getLength(),n.push(i);return this.cacheLengths=n,n},getSpacedPoints:function(n){var t,i;for(n===undefined&&(n=40),t=[],i=0;i<=n;i++)t.push(this.getPoint(i/n));return this.autoClose&&t.push(t[0]),t},getPoints:function(n){var t,e,r,o,u,f;for(n=n||12,t=[],r=0,o=this.curves;r<o.length;r++){var i=o[r],h=i&&i.isEllipseCurve?n*2:i&&i.isLineCurve?1:i&&i.isSplineCurve?n*i.points.length:n,s=i.getPoints(h);for(u=0;u<s.length;u++)(f=s[u],e&&e.equals(f))||(t.push(f),e=f)}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},createPointsGeometry:function(n){var t=this.getPoints(n);return this.createGeometry(t)},createSpacedPointsGeometry:function(n){var t=this.getSpacedPoints(n);return this.createGeometry(t)},createGeometry:function(n){for(var u=new s,r,i=0,f=n.length;i<f;i++)r=n[i],u.vertices.push(new t(r.x,r.y,r.z||0));return u}}),ai.prototype=Object.create(p.prototype),ai.prototype.constructor=ai,ai.prototype.isEllipseCurve=!0,ai.prototype.getPoint=function(n){for(var r=Math.PI*2,t=this.aEndAngle-this.aStartAngle,e=Math.abs(t)<Number.EPSILON;t<0;)t+=r;while(t>r)t-=r;t<Number.EPSILON&&(t=e?0:r),this.aClockwise!==!0||e||(t=t===r?-r:t-r);var o=this.aStartAngle+n*t,u=this.aX+this.xRadius*Math.cos(o),f=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){var s=Math.cos(this.aRotation),h=Math.sin(this.aRotation),c=u-this.aX,l=f-this.aY;u=c*s-l*h+this.aX,f=c*h+l*s+this.aY}return new i(u,f)},ou.prototype=Object.create(p.prototype),ou.prototype.constructor=ou,ou.prototype.isSplineCurve=!0,ou.prototype.getPoint=function(n){var t=this.points,u=(t.length-1)*n,r=Math.floor(u),f=u-r,e=t[r===0?r:r-1],o=t[r],s=t[r>t.length-2?t.length-1:r+1],h=t[r>t.length-3?t.length-1:r+2];return new i(kw(f,e.x,o.x,s.x,h.x),kw(f,e.y,o.y,s.y,h.y))},hf.prototype=Object.create(p.prototype),hf.prototype.constructor=hf,hf.prototype.getPoint=function(n){var t=this.v0,r=this.v1,u=this.v2,f=this.v3;return new i(kr(n,t.x,r.x,u.x,f.x),kr(n,t.y,r.y,u.y,f.y))},sf.prototype=Object.create(p.prototype),sf.prototype.constructor=sf,sf.prototype.getPoint=function(n){var t=this.v0,r=this.v1,u=this.v2;return new i(dr(n,t.x,r.x,u.x),dr(n,t.y,r.y,u.y))},bc=Object.assign(Object.create(de.prototype),{fromPoints:function(n){this.moveTo(n[0].x,n[0].y);for(var t=1,i=n.length;t<i;t++)this.lineTo(n[t].x,n[t].y)},moveTo:function(n,t){this.currentPoint.set(n,t)},lineTo:function(n,t){var r=new ei(this.currentPoint.clone(),new i(n,t));this.curves.push(r),this.currentPoint.set(n,t)},quadraticCurveTo:function(n,t,r,u){var f=new sf(this.currentPoint.clone(),new i(n,t),new i(r,u));this.curves.push(f),this.currentPoint.set(r,u)},bezierCurveTo:function(n,t,r,u,f,e){var o=new hf(this.currentPoint.clone(),new i(n,t),new i(r,u),new i(f,e));this.curves.push(o),this.currentPoint.set(f,e)},splineThru:function(n){var t=[this.currentPoint.clone()].concat(n),i=new ou(t);this.curves.push(i),this.currentPoint.copy(n[n.length-1])},arc:function(n,t,i,r,u,f){var e=this.currentPoint.x,o=this.currentPoint.y;this.absarc(n+e,t+o,i,r,u,f)},absarc:function(n,t,i,r,u,f){this.absellipse(n,t,i,i,r,u,f)},ellipse:function(n,t,i,r,u,f,e,o){var s=this.currentPoint.x,h=this.currentPoint.y;this.absellipse(n+s,t+h,i,r,u,f,e,o)},absellipse:function(n,t,i,r,u,f,e,o){var h=new ai(n,t,i,r,u,f,e,o),s,c;this.curves.length>0&&(s=h.getPoint(0),s.equals(this.currentPoint)||this.lineTo(s.x,s.y)),this.curves.push(h),c=h.getPoint(1),this.currentPoint.copy(c)}}),bs.prototype=bc,bc.constructor=bs,hu.prototype=Object.assign(Object.create(bc),{constructor:hu,getPointsHoles:function(n){for(var i=[],t=0,r=this.holes.length;t<r;t++)i[t]=this.holes[t].getPoints(n);return i},extractAllPoints:function(n){return{shape:this.getPoints(n),holes:this.getPointsHoles(n)}},extractPoints:function(n){return this.extractAllPoints(n)}}),Object.assign(dv.prototype,{moveTo:function(n,t){this.currentPath=new bs,this.subPaths.push(this.currentPath),this.currentPath.moveTo(n,t)},lineTo:function(n,t){this.currentPath.lineTo(n,t)},quadraticCurveTo:function(n,t,i,r){this.currentPath.quadraticCurveTo(n,t,i,r)},bezierCurveTo:function(n,t,i,r,u,f){this.currentPath.bezierCurveTo(n,t,i,r,u,f)},splineThru:function(n){this.currentPath.splineThru(n)},toShapes:function(n,t){function et(n){for(var r=[],f,i,t=0,u=n.length;t<u;t++)f=n[t],i=new hu,i.curves=f.curves,r.push(i);return r}function ht(n,t){for(var c=t.length,o=!1,h,e=c-1,u=0;u<c;e=u++){var i=t[e],r=t[u],s=r.x-i.x,f=r.y-i.y;if(Math.abs(f)>Number.EPSILON){if(f<0&&(i=t[u],s=-s,r=t[e],f=-f),n.y<i.y||n.y>r.y)continue;if(n.y===i.y){if(n.x===i.x)return!0}else{if(h=f*(n.x-i.x)-s*(n.y-i.y),h===0)return!0;if(h<0)continue;o=!o}}else{if(n.y!==i.y)continue;if(r.x<=n.x&&n.x<=i.x||i.x<=n.x&&n.x<=r.x)return!0}}return o}var ft=wt.isClockWise,e=this.subPaths,a,s,l,v,h,ut,rt,nt,r,w,tt,y,p,b,o,it,u,ot,d,st;if(e.length===0)return[];if(t===!0)return et(e);if(v=[],e.length===1)return s=e[0],l=new hu,l.curves=s.curves,v.push(l),v;h=!ft(e[0].getPoints()),h=n?!h:h;var g=[],i=[],c=[],f=0,k;for(i[f]=undefined,c[f]=[],u=0,ut=e.length;u<ut;u++)s=e[u],k=s.getPoints(),a=ft(k),a=n?!a:a,a?(!h&&i[f]&&f++,i[f]={s:new hu,p:k},i[f].s.curves=s.curves,h&&f++,c[f]=[]):c[f].push({h:s,p:k[0]});if(!i[0])return et(e);if(i.length>1){for(rt=!1,nt=[],r=0,w=i.length;r<w;r++)g[r]=[];for(r=0,w=i.length;r<w;r++)for(tt=c[r],y=0;y<tt.length;y++){for(p=tt[y],b=!0,o=0;o<i.length;o++)ht(p.p,i[o].p)&&(r!==o&&nt.push({froms:r,tos:o,hole:y}),b?(b=!1,g[o].push(p)):rt=!0);b&&g[r].push(p)}nt.length>0&&(rt||(c=g))}for(u=0,ot=i.length;u<ot;u++)for(l=i[u].s,v.push(l),it=c[u],d=0,st=it.length;d<st;d++)l.holes.push(it[d].h);return v}}),Object.assign(gv.prototype,{isFont:!0,generateShapes:function(n,t,i){function s(n){for(var o=String(n).split(""),s=t/r.resolution,a=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*s,u=0,c=0,l=[],f,e,i=0;i<o.length;i++)f=o[i],f==="\n"?(u=0,c-=a):(e=h(f,s,u,c),u+=e.offsetX,l.push(e.path));return l}function h(n,t,u,f){var p=r.glyphs[n]||r.glyphs["?"],y,b,g,d,v,w,nt,k,l,c,tt,it,s,o,e,rt,ut,h,a;if(p){if(y=new dv,b=[],p.o)for(o=p._cachedOutline||(p._cachedOutline=p.o.split(" ")),e=0,rt=o.length;e<rt;){ut=o[e++];switch(ut){case"m":g=o[e++]*t+u,d=o[e++]*t+f,y.moveTo(g,d);break;case"l":g=o[e++]*t+u,d=o[e++]*t+f,y.lineTo(g,d);break;case"q":if(v=o[e++]*t+u,w=o[e++]*t+f,l=o[e++]*t+u,c=o[e++]*t+f,y.quadraticCurveTo(l,c,v,w),s=b[b.length-1],s)for(nt=s.x,k=s.y,h=1;h<=i;h++)a=h/i,dr(a,nt,l,v),dr(a,k,c,w);break;case"b":if(v=o[e++]*t+u,w=o[e++]*t+f,l=o[e++]*t+u,c=o[e++]*t+f,tt=o[e++]*t+u,it=o[e++]*t+f,y.bezierCurveTo(l,c,tt,it,v,w),s=b[b.length-1],s)for(nt=s.x,k=s.y,h=1;h<=i;h++)a=h/i,kr(a,nt,l,tt,v),kr(a,k,c,it,w)}}return{offsetX:p.ha*t,path:y}}}var u,o;t===undefined&&(t=100),i===undefined&&(i=4);var r=this.data,f=s(n),e=[];for(u=0,o=f.length;u<o;u++)Array.prototype.push.apply(e,f[u].toShapes());return e}}),Object.assign(pw.prototype,{load:function(n,t,i,r){var u=this,f=new ni(this.manager);f.load(n,function(n){var i,r;try{i=JSON.parse(n)}catch(f){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(n.substring(65,n.length-2))}r=u.parse(i),t&&t(r)},i,r)},parse:function(n){return new gv(n)}}),oh={getContext:function(){return eh===undefined&&(eh=new(window.AudioContext||window.webkitAudioContext)),eh},setContext:function(n){eh=n}},Object.assign(ty.prototype,{load:function(n,t,i,r){var u=new ni(this.manager);u.setResponseType("arraybuffer"),u.load(n,function(n){var i=oh.getContext();i.decodeAudioData(n,function(n){t(n)})},i,r)}}),Object.assign(aw.prototype,{update:function(){var e,r,u,n,t,s,f,i,h=new o,l=new o;return function(o){var b=e!==this||r!==o.focus||u!==o.fov||n!==o.aspect*this.aspect||t!==o.near||s!==o.far||f!==o.zoom||i!==this.eyeSep,y,p,w,a,v;b&&(e=this,r=o.focus,u=o.fov,n=o.aspect*this.aspect,t=o.near,s=o.far,f=o.zoom,y=o.projectionMatrix.clone(),i=this.eyeSep/2,p=i*t/r,w=t*Math.tan(c.DEG2RAD*u*.5)/f,l.elements[12]=-i,h.elements[12]=i,a=-w*n+p,v=w*n+p,y.elements[0]=2*t/(v-a),y.elements[8]=(v+a)/(v-a),this.cameraL.projectionMatrix.copy(y),a=-w*n-p,v=w*n-p,y.elements[0]=2*t/(v-a),y.elements[8]=(v+a)/(v-a),this.cameraR.projectionMatrix.copy(y)),this.cameraL.matrixWorld.copy(o.matrixWorld).multiply(l),this.cameraR.matrixWorld.copy(o.matrixWorld).multiply(h)}}()}),hh.prototype=Object.create(u.prototype),hh.prototype.constructor=hh,fy.prototype=Object.assign(Object.create(nt.prototype),{constructor:fy,isArrayCamera:!0}),pv.prototype=Object.assign(Object.create(u.prototype),{constructor:pv,getInput:function(){return this.gain},removeFilter:function(){this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(n){this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=n,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(n){this.gain.gain.value=n},updateMatrixWorld:function(){var n=new t,r=new g,f=new t,i=new t;return function(t){u.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,o=this.up;this.matrixWorld.decompose(n,r,f),i.set(0,0,-1).applyQuaternion(r),e.positionX?(e.positionX.setValueAtTime(n.x,this.context.currentTime),e.positionY.setValueAtTime(n.y,this.context.currentTime),e.positionZ.setValueAtTime(n.z,this.context.currentTime),e.forwardX.setValueAtTime(i.x,this.context.currentTime),e.forwardY.setValueAtTime(i.y,this.context.currentTime),e.forwardZ.setValueAtTime(i.z,this.context.currentTime),e.upX.setValueAtTime(o.x,this.context.currentTime),e.upY.setValueAtTime(o.y,this.context.currentTime),e.upZ.setValueAtTime(o.z,this.context.currentTime)):(e.setPosition(n.x,n.y,n.z),e.setOrientation(i.x,i.y,i.z,o.x,o.y,o.z))}}()}),gu.prototype=Object.assign(Object.create(u.prototype),{constructor:gu,getOutput:function(){return this.gain},setNodeSource:function(n){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=n,this.connect(),this},setBuffer:function(n){return this.buffer=n,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}var n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.onended=this.onEnded.bind(this),n.playbackRate.setValueAtTime(this.playbackRate,this.startTime),n.start(0,this.startTime),this.isPlaying=!0,this.source=n,this.connect()},pause:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.source.stop(),this.startTime=this.context.currentTime,this.isPlaying=!1,this},stop:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.source.stop(),this.startTime=0,this.isPlaying=!1,this},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var n=1,t=this.filters.length;n<t;n++)this.filters[n-1].connect(this.filters[n]);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 n=1,t=this.filters.length;n<t;n++)this.filters[n-1].disconnect(this.filters[n]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(n){return n||(n=[]),this.isPlaying===!0?(this.disconnect(),this.filters=n,this.connect()):this.filters=n,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(n){return this.setFilters(n?[n]:[])},setPlaybackRate:function(n){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=n,this.isPlaying===!0&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(n){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=n,this.isPlaying===!0&&(this.source.loop=this.loop),this},getVolume:function(){return this.gain.gain.value},setVolume:function(n){return this.gain.gain.value=n,this}}),oy.prototype=Object.assign(Object.create(gu.prototype),{constructor:oy,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(n){this.panner.refDistance=n},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(n){this.panner.rolloffFactor=n},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(n){this.panner.distanceModel=n},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(n){this.panner.maxDistance=n},updateMatrixWorld:function(){var n=new t;return function(t){u.prototype.updateMatrixWorld.call(this,t),n.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(n.x,n.y,n.z)}}()}),Object.assign(ly.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var i=0,t=this.getFrequencyData(),n=0;n<t.length;n++)i+=t[n];return i/t.length}}),Object.assign(ay.prototype,{accumulate:function(n,t){var f=this.buffer,u=this.valueSize,e=n*u+u,i=this.cumulativeWeight,r,o;if(i===0){for(r=0;r!==u;++r)f[e+r]=f[r];i=t}else i+=t,o=t/i,this._mixBufferRegion(f,e,0,o,u);this.cumulativeWeight=i},apply:function(n){var t=this.valueSize,r=this.buffer,u=n*t+t,f=this.cumulativeWeight,s=this.binding,e,i,o;for(this.cumulativeWeight=0,f<1&&(e=t*3,this._mixBufferRegion(r,u,e,1-f,t)),i=t,o=t+t;i!==o;++i)if(r[i]!==r[i+t]){s.setValue(r,u);break}},saveOriginalState:function(){var f=this.binding,t=this.buffer,i=this.valueSize,r=i*3,n,u;for(f.getValue(t,r),n=i,u=r;n!==u;++n)t[n]=t[r+n%i];this.cumulativeWeight=0},restoreOriginalState:function(){var n=this.valueSize*3;this.binding.setValue(this.buffer,n)},_select:function(n,t,i,r,u){if(r>=.5)for(var f=0;f!==u;++f)n[t+f]=n[i+f]},_slerp:function(n,t,i,r){g.slerpFlat(n,t,n,t,n,i,r)},_lerp:function(n,t,i,r,u){for(var o=1-r,e,f=0;f!==u;++f)e=t+f,n[e]=n[e]*o+n[i+f]*r}}),Object.assign(nw.prototype,{getValue:function(n,t){this.bind();var r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==undefined&&i.getValue(n,t)},setValue:function(n,t){for(var r=this._bindings,i=this._targetGroup.nCachedObjects_,u=r.length;i!==u;++i)r[i].setValue(n,t)},bind:function(){for(var t=this._bindings,n=this._targetGroup.nCachedObjects_,i=t.length;n!==i;++n)t[n].bind()},unbind:function(){for(var t=this._bindings,n=this._targetGroup.nCachedObjects_,i=t.length;n!==i;++n)t[n].unbind()}}),Object.assign(rt,{Composite:nw,create:function(n,t,i){return n&&n.isAnimationObjectGroup?new rt.Composite(n,t,i):new rt(n,t,i)},parseTrackName:function(){var n=/((?:[\w-]+[\/:])*)/,t=/([\w-\.]+)?/,i=/(?:\.([\w-]+)(?:\[(.+)\])?)?/,r=/\.([\w-]+)(?:\[(.+)\])?/,u=new RegExp("^"+n.source+t.source+i.source+r.source+"$"),f=["material","materials","bones"];return function(n){var i=u.exec(n),t,r,e;if(!i)throw new Error("PropertyBinding: Cannot parse trackName: "+n);if(t={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},r=t.nodeName&&t.nodeName.lastIndexOf("."),r!==undefined&&r!==-1&&(e=t.nodeName.substring(r+1),f.indexOf(e)!==-1&&(t.nodeName=t.nodeName.substring(0,r),t.objectName=e)),t.propertyName===null||t.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+n);return t}}(),findNode:function(n,t){var f,i,r,u;return!t||t===""||t==="root"||t==="."||t===-1||t===n.name||t===n.uuid?n:n.skeleton&&(f=function(n){for(var r,i=0;i<n.bones.length;i++)if(r=n.bones[i],r.name===t)return r;return null},i=f(n.skeleton),i)?i:n.children&&(r=function(n){for(var i,f,u=0;u<n.length;u++){if(i=n[u],i.name===t||i.uuid===t)return i;if(f=r(i.children),f)return f}return null},u=r(n.children),u)?u:null}}),Object.assign(rt.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(n,t){n[t]=this.node[this.propertyName]},function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)n[t++]=r[i]},function(n,t){n[t]=this.resolvedProperty[this.propertyIndex]},function(n,t){this.resolvedProperty.toArray(n,t)}],SetterByBindingTypeAndVersioning:[[function(n,t){this.node[this.propertyName]=n[t]},function(n,t){this.node[this.propertyName]=n[t],this.targetObject.needsUpdate=!0},function(n,t){this.node[this.propertyName]=n[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)r[i]=n[t++]},function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)r[i]=n[t++];this.targetObject.needsUpdate=!0},function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)r[i]=n[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(n,t){this.resolvedProperty[this.propertyIndex]=n[t]},function(n,t){this.resolvedProperty[this.propertyIndex]=n[t],this.targetObject.needsUpdate=!0},function(n,t){this.resolvedProperty[this.propertyIndex]=n[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(n,t){this.resolvedProperty.fromArray(n,t)},function(n,t){this.resolvedProperty.fromArray(n,t),this.targetObject.needsUpdate=!0},function(n,t){this.resolvedProperty.fromArray(n,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(n,t){this.bind(),this.getValue(n,t)},setValue:function(n,t){this.bind(),this.setValue(n,t)},bind:function(){var n=this.node,r=this.parsedPath,e=r.objectName,o=r.propertyName,s=r.propertyIndex,u,i,c,h,f,t;if(n||(n=rt.findNode(this.rootNode,r.nodeName)||this.rootNode,this.node=n),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!n){console.error("  trying to update node for track: "+this.path+" but it wasn't found.");return}if(e){u=r.objectIndex;switch(e){case"materials":if(!n.material){console.error("  can not bind to material as node does not have a material",this);return}if(!n.material.materials){console.error("  can not bind to material.materials as node.material does not have a materials array",this);return}n=n.material.materials;break;case"bones":if(!n.skeleton){console.error("  can not bind to bones as node does not have a skeleton",this);return}for(n=n.skeleton.bones,t=0;t<n.length;t++)if(n[t].name===u){u=t;break}break;default:if(n[e]===undefined){console.error("  can not bind to objectName of node, undefined",this);return}n=n[e]}if(u!==undefined){if(n[u]===undefined){console.error("  trying to bind to objectIndex of objectName, but is undefined:",this,n);return}n=n[u]}}if(i=n[o],i===undefined){c=r.nodeName,console.error("  trying to update property for track: "+c+"."+o+" but it wasn't found.",n);return}if(h=this.Versioning.None,n.needsUpdate!==undefined?(h=this.Versioning.NeedsUpdate,this.targetObject=n):n.matrixWorldNeedsUpdate!==undefined&&(h=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=n),f=this.BindingType.Direct,s!==undefined){if(o==="morphTargetInfluences"){if(!n.geometry){console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry",this);return}if(!n.geometry.morphTargets){console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);return}for(t=0;t<this.node.geometry.morphTargets.length;t++)if(n.geometry.morphTargets[t].name===s){s=t;break}}f=this.BindingType.ArrayElement,this.resolvedProperty=i,this.propertyIndex=s}else i.fromArray!==undefined&&i.toArray!==undefined?(f=this.BindingType.HasFromToArray,this.resolvedProperty=i):Array.isArray(i)?(f=this.BindingType.EntireArray,this.resolvedProperty=i):this.propertyName=o;this.getValue=this.GetterByBindingType[f],this.setValue=this.SetterByBindingTypeAndVersioning[f][h]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(rt.prototype,{_getValue_unbound:rt.prototype.getValue,_setValue_unbound:rt.prototype.setValue}),Object.assign(dp.prototype,{isAnimationObjectGroup:!0,add:function(){for(var r=this._objects,g=r.length,y=this.nCachedObjects_,o=this._indicesByUUID,k=this._paths,b=this._parsedPaths,v=this._bindings,p=v.length,u,c,t,s,h=0,d=arguments.length;h!==d;++h){var f=arguments[h],l=f.uuid,i=o[l],w=undefined;if(i===undefined)for(i=g++,o[l]=i,r.push(f),t=0,s=p;t!==s;++t)v[t].push(new rt(f,k[t],b[t]));else if(i<y)for(w=r[i],u=--y,c=r[u],o[c.uuid]=i,r[i]=c,o[l]=u,r[u]=f,t=0,s=p;t!==s;++t){var e=v[t],nt=e[u],a=e[i];e[i]=nt,a===undefined&&(a=new rt(f,k[t],b[t])),e[u]=a}else r[i]!==w&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=y},remove:function(){for(var e=this._objects,o=this.nCachedObjects_,s=this._indicesByUUID,v=this._bindings,w=v.length,t,h,f,c,u=0,a=arguments.length;u!==a;++u){var l=arguments[u],y=l.uuid,i=s[y];if(i!==undefined&&i>=o)for(t=o++,h=e[t],s[h.uuid]=i,e[i]=h,s[y]=t,e[t]=l,f=0,c=w;f!==c;++f){var r=v[f],p=r[t],b=r[i];r[i]=p,r[t]=b}}this.nCachedObjects_=o},uncache:function(){for(var t=this._objects,w=t.length,l=this.nCachedObjects_,f=this._indicesByUUID,a=this._bindings,p=a.length,o,e,r,h,i,c=0,y=arguments.length;c!==y;++c){var d=arguments[c],v=d.uuid,u=f[v];if(u!==undefined)if(delete f[v],u<l){var s=--l,b=t[s],o=--w,e=t[o];for(f[b.uuid]=u,t[u]=b,f[e.uuid]=s,t[s]=e,t.pop(),r=0,h=p;r!==h;++r){var i=a[r],k=i[s],g=i[o];i[u]=k,i[s]=g,i.pop()}}else for(o=--w,e=t[o],f[e.uuid]=u,t[u]=e,t.pop(),r=0,h=p;r!==h;++r)i=a[r],i[u]=i[o],i.pop()}this.nCachedObjects_=l},subscribe_:function(n,t){var o=this._bindingsIndicesByPath,r=o[n],u=this._bindings,i,s,h;if(r!==undefined)return u[r];var c=this._paths,l=this._parsedPaths,f=this._objects,a=f.length,v=this.nCachedObjects_,e=new Array(a);for(r=u.length,o[n]=r,c.push(n),l.push(t),u.push(e),i=v,s=f.length;i!==s;++i)h=f[i],e[i]=new rt(h,n,t);return e},unsubscribe_:function(n){var e=this._bindingsIndicesByPath,t=e[n];if(t!==undefined){var u=this._paths,f=this._parsedPaths,i=this._bindings,r=i.length-1,o=i[r],s=n[r];e[s]=t,i[t]=o,i.pop(),f[t]=f[r],f.pop(),u[t]=u[r],u.pop()}}}),Object.assign(kp.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&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(n){return this._startTime=n,this},setLoop:function(n,t){return this.loop=n,this.repetitions=t,this},setEffectiveWeight:function(n){return this.weight=n,this._effectiveWeight=this.enabled?n:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(n){return this._scheduleFading(n,0,1)},fadeOut:function(n){return this._scheduleFading(n,1,0)},crossFadeFrom:function(n,t,i){if(n.fadeOut(t),this.fadeIn(t),i){var r=this._clip.duration,u=n._clip.duration,f=u/r,e=r/u;n.warp(1,f,t),this.warp(e,1,t)}return this},crossFadeTo:function(n,t,i){return n.crossFadeFrom(this,t,i)},stopFading:function(){var n=this._weightInterpolant;return n!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(n)),this},setEffectiveTimeScale:function(n){return this.timeScale=n,this._effectiveTimeScale=this.paused?0:n,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(n){return this.timeScale=this._clip.duration/n,this.stopWarping()},syncWith:function(n){return this.time=n.time,this.timeScale=n.timeScale,this.stopWarping()},halt:function(n){return this.warp(this._effectiveTimeScale,0,n)},warp:function(n,t,i){var e=this._mixer,o=e.time,r=this._timeScaleInterpolant,s=this.timeScale,u,f;return r===null&&(r=e._lendControlInterpolant(),this._timeScaleInterpolant=r),u=r.parameterPositions,f=r.sampleValues,u[0]=o,u[1]=o+i,f[0]=n/s,f[1]=t/s,this},stopWarping:function(){var n=this._timeScaleInterpolant;return n!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(n)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(n,t,i,r){var f,e,h,o,s,c,u,l;if(!this.enabled){this._updateWeight(n);return}if(f=this._startTime,f!==null){if(e=(n-f)*i,e<0||i===0)return;this._startTime=null,t=i*e}if(t*=this._updateTimeScale(n),h=this._updateTime(t),o=this._updateWeight(n),o>0)for(s=this._interpolants,c=this._propertyBindings,u=0,l=s.length;u!==l;++u)s[u].evaluate(h),c[u].accumulate(r,o)},_updateWeight:function(n){var t=0,i,r;return this.enabled&&(t=this.weight,i=this._weightInterpolant,i!==null&&(r=i.evaluate(n)[0],t*=r,n>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1)))),this._effectiveWeight=t,t},_updateTimeScale:function(n){var t=0,i,r;return this.paused||(t=this.timeScale,i=this._timeScaleInterpolant,i!==null&&(r=i.evaluate(n)[0],t*=r,n>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))),this._effectiveTimeScale=t,t},_updateTime:function(n){var t=this.time+n,u,f,e,o;if(n===0)return t;var i=this._clip.duration,s=this.loop,r=this._loopCount;if(s===bw){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));n:{if(t>=i)t=i;else if(t<0)t=0;else break n;this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:n<0?-1:1})}}else if(u=s===dw,r===-1&&(n>=0?(r=0,this._setEndings(!0,this.repetitions===0,u)):this._setEndings(this.repetitions===0,!0,u)),(t>=i||t<0)&&(f=Math.floor(t/i),t-=i*f,r+=Math.abs(f),e=this.repetitions-r,e<0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=n>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:n>0?1:-1})):(e===0?(o=n<0,this._setEndings(o,!o,u)):this._setEndings(!1,!1,u),this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:f}))),u&&(r&1)==1)return this.time=t,i-t;return this.time=t,t},_setEndings:function(n,t,i){var r=this._interpolantSettings;i?(r.endingStart=uu,r.endingEnd=uu):(r.endingStart=n?this.zeroSlopeAtStart?uu:ru:ss,r.endingEnd=t?this.zeroSlopeAtEnd?uu:ru:ss)},_scheduleFading:function(n,t,i){var e=this._mixer,o=e.time,r=this._weightInterpolant,u,f;return r===null&&(r=e._lendControlInterpolant(),this._weightInterpolant=r),u=r.parameterPositions,f=r.sampleValues,u[0]=o,f[0]=t,u[1]=o+n,f[1]=i,this}}),Object.assign(bp.prototype,vi.prototype,{_bindAction:function(n,t){var h=n._localRoot||this._root,c=n._clip.tracks,v=c.length,o=n._propertyBindings,y=n._interpolants,u=h.uuid,l=this._bindingsByRootAndName,f=l[u],r,a;for(f===undefined&&(f={},l[u]=f),r=0;r!==v;++r){var s=c[r],e=s.name,i=f[e];if(i!==undefined)o[r]=i;else{if(i=o[r],i!==undefined){i._cacheIndex===null&&(++i.referenceCount,this._addInactiveBinding(i,u,e));continue}a=t&&t._propertyBindings[r].binding.parsedPath,i=new ay(rt.create(h,e,a),s.ValueTypeName,s.getValueSize()),++i.referenceCount,this._addInactiveBinding(i,u,e),o[r]=i}y[r].resultBuffer=i.buffer}},_activateAction:function(n){var r,t,e,i;if(!this._isActiveAction(n)){if(n._cacheIndex===null){var o=(n._localRoot||this._root).uuid,u=n._clip.uuid,f=this._actionsByClip[u];this._bindAction(n,f&&f.knownActions[0]),this._addInactiveAction(n,u,o)}for(r=n._propertyBindings,t=0,e=r.length;t!==e;++t)i=r[t],i.useCount++==0&&(this._lendBinding(i),i.saveOriginalState());this._lendAction(n)}},_deactivateAction:function(n){var r,t,u,i;if(this._isActiveAction(n)){for(r=n._propertyBindings,t=0,u=r.length;t!==u;++t)i=r[t],--i.useCount==0&&(i.restoreOriginalState(),this._takeBackBinding(i));this._takeBackAction(n)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var n=this;this.stats={actions:{get total(){return n._actions.length},get inUse(){return n._nActiveActions}},bindings:{get total(){return n._bindings.length},get inUse(){return n._nActiveBindings}},controlInterpolants:{get total(){return n._controlInterpolants.length},get inUse(){return n._nActiveControlInterpolants}}}},_isActiveAction:function(n){var t=n._cacheIndex;return t!==null&&t<this._nActiveActions},_addInactiveAction:function(n,t,i){var f=this._actions,e=this._actionsByClip,r=e[t],u;r===undefined?(r={knownActions:[n],actionByRoot:{}},n._byClipCacheIndex=0,e[t]=r):(u=r.knownActions,n._byClipCacheIndex=u.length,u.push(n)),n._cacheIndex=f.length,f.push(n),r.actionByRoot[i]=n},_removeInactiveAction:function(n){var i=this._actions,r=i[i.length-1],u=n._cacheIndex,c,l;r._cacheIndex=u,i[u]=r,i.pop(),n._cacheIndex=null;var f=n._clip.uuid,e=this._actionsByClip,o=e[f],t=o.knownActions,s=t[t.length-1],h=n._byClipCacheIndex;s._byClipCacheIndex=h,t[h]=s,t.pop(),n._byClipCacheIndex=null,c=o.actionByRoot,l=(n._localRoot||this._root).uuid,delete c[l],t.length===0&&delete e[f],this._removeInactiveBindingsForAction(n)},_removeInactiveBindingsForAction:function(n){for(var r=n._propertyBindings,i,t=0,u=r.length;t!==u;++t)i=r[t],--i.referenceCount==0&&this._removeInactiveBinding(i)},_lendAction:function(n){var t=this._actions,r=n._cacheIndex,i=this._nActiveActions++,u=t[i];n._cacheIndex=i,t[i]=n,u._cacheIndex=r,t[r]=u},_takeBackAction:function(n){var t=this._actions,r=n._cacheIndex,i=--this._nActiveActions,u=t[i];n._cacheIndex=i,t[i]=n,u._cacheIndex=r,t[r]=u},_addInactiveBinding:function(n,t,i){var u=this._bindingsByRootAndName,r=u[t],f=this._bindings;r===undefined&&(r={},u[t]=r),r[i]=n,n._cacheIndex=f.length,f.push(n)},_removeInactiveBinding:function(n){var t=this._bindings,i=n.binding,r=i.rootNode.uuid,s=i.path,u=this._bindingsByRootAndName,f=u[r],e=t[t.length-1],o=n._cacheIndex,h;e._cacheIndex=o,t[o]=e,t.pop(),delete f[s];n:{for(h in f)break n;delete u[r]}},_lendBinding:function(n){var t=this._bindings,r=n._cacheIndex,i=this._nActiveBindings++,u=t[i];n._cacheIndex=i,t[i]=n,u._cacheIndex=r,t[r]=u},_takeBackBinding:function(n){var t=this._bindings,r=n._cacheIndex,i=--this._nActiveBindings,u=t[i];n._cacheIndex=i,t[i]=n,u._cacheIndex=r,t[r]=u},_lendControlInterpolant:function(){var i=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=i[t];return n===undefined&&(n=new bo(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,i[t]=n),n},_takeBackControlInterpolant:function(n){var t=this._controlInterpolants,r=n.__cacheIndex,i=--this._nActiveControlInterpolants,u=t[i];n.__cacheIndex=i,t[i]=n,u.__cacheIndex=r,t[r]=u},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(n,t){var o=t||this._root,s=o.uuid,i=typeof n=="string"?kt.findByName(o,n):n,h=i!==null?i.uuid:n,u=this._actionsByClip[h],f=null,e,r;if(u!==undefined){if(e=u.actionByRoot[s],e!==undefined)return e;f=u.knownActions[0],i===null&&(i=f._clip)}return i===null?null:(r=new kp(this,i,t),this._bindAction(r,f),this._addInactiveAction(r,h,s),r)},existingAction:function(n,t){var i=t||this._root,f=i.uuid,r=typeof n=="string"?kt.findByName(i,n):n,e=r?r.uuid:n,u=this._actionsByClip[e];return u!==undefined?u.actionByRoot[f]||null:null},stopAllAction:function(){var t=this._actions,i=this._nActiveActions,r=this._bindings,u=this._nActiveBindings,n;for(this._nActiveActions=0,this._nActiveBindings=0,n=0;n!==i;++n)t[n].reset();for(n=0;n!==u;++n)r[n].useCount=0;return this},update:function(n){var r,u,f,t;n*=this.timeScale;var e=this._actions,o=this._nActiveActions,s=this.time+=n,h=Math.sign(n),i=this._accuIndex^=1;for(t=0;t!==o;++t)r=e[t],r._update(s,n,h,i);for(u=this._bindings,f=this._nActiveBindings,t=0;t!==f;++t)u[t].apply(i);return this},getRoot:function(){return this._root},uncacheClip:function(n){var i=this._actions,o=n.uuid,s=this._actionsByClip,h=s[o],u,r,c,t,f,e;if(h!==undefined){for(u=h.knownActions,r=0,c=u.length;r!==c;++r)t=u[r],this._deactivateAction(t),f=t._cacheIndex,e=i[i.length-1],t._cacheIndex=null,t._byClipCacheIndex=null,e._cacheIndex=f,i[f]=e,i.pop(),this._removeInactiveBindingsForAction(t);delete s[o]}},uncacheRoot:function(n){var u=n.uuid,f=this._actionsByClip,e,o,t,s,i,h,r;for(e in f)o=f[e].actionByRoot,t=o[u],t!==undefined&&(this._deactivateAction(t),this._removeInactiveAction(t));if(s=this._bindingsByRootAndName,i=s[u],i!==undefined)for(h in i)r=i[h],r.restoreOriginalState(),this._removeInactiveBinding(r)},uncacheAction:function(n,t){var i=this.existingAction(n,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),bh.prototype.clone=function(){return new bh(this.value.clone===undefined?this.value:this.value.clone())},cy.prototype=Object.assign(Object.create(f.prototype),{constructor:cy,isInstancedBufferGeometry:!0,addGroup:function(n,t,i){this.groups.push({start:n,count:t,materialIndex:i})},copy:function(n){var e=n.index,r,u,o,f,t,s,i;e!==null&&this.setIndex(e.clone()),r=n.attributes;for(u in r)o=r[u],this.addAttribute(u,o.clone());for(f=n.groups,t=0,s=f.length;t<s;t++)i=f[t],this.addGroup(i.start,i.count,i.materialIndex);return this}}),Object.defineProperties(hy.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(hy.prototype,{isInterleavedBufferAttribute:!0,setX:function(n,t){return this.data.array[n*this.data.stride+this.offset]=t,this},setY:function(n,t){return this.data.array[n*this.data.stride+this.offset+1]=t,this},setZ:function(n,t){return this.data.array[n*this.data.stride+this.offset+2]=t,this},setW:function(n,t){return this.data.array[n*this.data.stride+this.offset+3]=t,this},getX:function(n){return this.data.array[n*this.data.stride+this.offset]},getY:function(n){return this.data.array[n*this.data.stride+this.offset+1]},getZ:function(n){return this.data.array[n*this.data.stride+this.offset+2]},getW:function(n){return this.data.array[n*this.data.stride+this.offset+3]},setXY:function(n,t,i){return n=n*this.data.stride+this.offset,this.data.array[n+0]=t,this.data.array[n+1]=i,this},setXYZ:function(n,t,i,r){return n=n*this.data.stride+this.offset,this.data.array[n+0]=t,this.data.array[n+1]=i,this.data.array[n+2]=r,this},setXYZW:function(n,t,i,r,u){return n=n*this.data.stride+this.offset,this.data.array[n+0]=t,this.data.array[n+1]=i,this.data.array[n+2]=r,this.data.array[n+3]=u,this}}),Object.defineProperty(bf.prototype,"needsUpdate",{set:function(n){n===!0&&this.version++}}),Object.assign(bf.prototype,{isInterleavedBuffer:!0,setArray:function(n){if(Array.isArray(n))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=n!==undefined?n.length/this.stride:0,this.array=n},setDynamic:function(n){return this.dynamic=n,this},copy:function(n){return this.array=new n.array.constructor(n.array),this.count=n.count,this.stride=n.stride,this.dynamic=n.dynamic,this},copyAt:function(n,t,i){n*=this.stride,i*=t.stride;for(var r=0,u=this.stride;r<u;r++)this.array[n+r]=t.array[i+r];return this},set:function(n,t){return t===undefined&&(t=0),this.array.set(n,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(n){return this.onUploadCallback=n,this}}),ua.prototype=Object.assign(Object.create(bf.prototype),{constructor:ua,isInstancedInterleavedBuffer:!0,copy:function(n){return bf.prototype.copy.call(this,n),this.meshPerAttribute=n.meshPerAttribute,this}}),la.prototype=Object.assign(Object.create(l.prototype),{constructor:la,isInstancedBufferAttribute:!0,copy:function(n){return l.prototype.copy.call(this,n),this.meshPerAttribute=n.meshPerAttribute,this}}),Object.assign(wp.prototype,{linePrecision:1,set:function(n,t){this.ray.set(n,t)},setFromCamera:function(n,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(n.x,n.y,.5).unproject(t).sub(this.ray.origin).normalize()):t&&t.isOrthographicCamera?(this.ray.origin.set(n.x,n.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(n,t){var i=[];return ry(n,this,i,t),i.sort(uw),i},intersectObjects:function(n,t){var i=[],r,u;if(Array.isArray(n)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(r=0,u=n.length;r<u;r++)ry(n[r],this,i,t);return i.sort(uw),i}}),Object.assign(vw.prototype,{start:function(){this.startTime=(typeof performance=="undefined"?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var n=0,t;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(t=(typeof performance=="undefined"?Date:performance).now(),n=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=n),n)}}),Object.assign(yw.prototype,{set:function(n,t,i){return this.radius=n,this.phi=t,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.radius=n.radius,this.phi=n.phi,this.theta=n.theta,this},makeSafe:function(){var n=1e-6;return this.phi=Math.max(n,Math.min(Math.PI-n,this.phi)),this},setFromVector3:function(n){return this.radius=n.length(),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(n.x,n.z),this.phi=Math.acos(c.clamp(n.y/this.radius,-1,1))),this}}),Object.assign(gw.prototype,{set:function(n,t,i){return this.radius=n,this.theta=t,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.radius=n.radius,this.theta=n.theta,this.y=n.y,this},setFromVector3:function(n){return this.radius=Math.sqrt(n.x*n.x+n.z*n.z),this.theta=Math.atan2(n.x,n.z),this.y=n.y,this}}),tt.prototype=Object.create(ut.prototype),tt.prototype.constructor=tt,tt.prototype.createAnimation=function(n,t,i,r){var u={start:t,end:i,length:i-t+1,fps:r,duration:(i-t)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[n]=u,this.animationsList.push(u)},tt.prototype.autoCreateAnimations=function(n){for(var c=/([a-z]+)_?(\d+)/i,e,u={},o=this.geometry,h,f,i,r,t=0,s=o.morphTargets.length;t<s;t++)h=o.morphTargets[t],f=h.name.match(c),f&&f.length>1&&(i=f[1],u[i]||(u[i]={start:Infinity,end:- Infinity}),r=u[i],t<r.start&&(r.start=t),t>r.end&&(r.end=t),e||(e=i));for(i in u)r=u[i],this.createAnimation(i,r.start,r.end,n);this.firstAnimation=e},tt.prototype.setAnimationDirectionForward=function(n){var t=this.animationsMap[n];t&&(t.direction=1,t.directionBackwards=!1)},tt.prototype.setAnimationDirectionBackward=function(n){var t=this.animationsMap[n];t&&(t.direction=-1,t.directionBackwards=!0)},tt.prototype.setAnimationFPS=function(n,t){var i=this.animationsMap[n];i&&(i.fps=t,i.duration=(i.end-i.start)/i.fps)},tt.prototype.setAnimationDuration=function(n,t){var i=this.animationsMap[n];i&&(i.duration=t,i.fps=(i.end-i.start)/i.duration)},tt.prototype.setAnimationWeight=function(n,t){var i=this.animationsMap[n];i&&(i.weight=t)},tt.prototype.setAnimationTime=function(n,t){var i=this.animationsMap[n];i&&(i.time=t)},tt.prototype.getAnimationTime=function(n){var t=0,i=this.animationsMap[n];return i&&(t=i.time),t},tt.prototype.getAnimationDuration=function(n){var t=-1,i=this.animationsMap[n];return i&&(t=i.duration),t},tt.prototype.playAnimation=function(n){var t=this.animationsMap[n];t?(t.time=0,t.active=!0):console.warn("THREE.MorphBlendMesh: animation["+n+"] undefined in .playAnimation()")},tt.prototype.stopAnimation=function(n){var t=this.animationsMap[n];t&&(t.active=!1)},tt.prototype.update=function(n){for(var t,f,e,i,r,u=0,o=this.animationsList.length;u<o;u++)(t=this.animationsList[u],t.active)&&(f=t.duration/t.length,t.time+=t.direction*n,t.mirroredLoop?(t.time>t.duration||t.time<0)&&(t.direction*=-1,t.time>t.duration&&(t.time=t.duration,t.directionBackwards=!0),t.time<0&&(t.time=0,t.directionBackwards=!1)):(t.time=t.time%t.duration,t.time<0&&(t.time+=t.duration)),e=t.start+c.clamp(Math.floor(t.time/f),0,t.length-1),i=t.weight,e!==t.currentFrame&&(this.morphTargetInfluences[t.lastFrame]=0,this.morphTargetInfluences[t.currentFrame]=1*i,this.morphTargetInfluences[e]=0,t.lastFrame=t.currentFrame,t.currentFrame=e),r=t.time%f/f,t.directionBackwards&&(r=1-r),t.currentFrame!==t.lastFrame?(this.morphTargetInfluences[t.currentFrame]=r*i,this.morphTargetInfluences[t.lastFrame]=(1-r)*i):this.morphTargetInfluences[t.currentFrame]=i)},ks.prototype=Object.create(u.prototype),ks.prototype.constructor=ks,ks.prototype.isImmediateRenderObject=!0,gs.prototype=Object.create(b.prototype),gs.prototype.constructor=gs,gs.prototype.update=function(){var n=new t,i=new t,r=new ti;return function(){var b=["a","b","c"],o,y,s,p,w,t,h;this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);var a=this.object.matrixWorld,e=this.geometry.attributes.position,f=this.object.geometry;if(f&&f.isGeometry){var k=f.vertices,v=f.faces,u=0;for(o=0,y=v.length;o<y;o++)for(s=v[o],t=0,h=s.vertexNormals.length;t<h;t++)p=k[s[b[t]]],w=s.vertexNormals[t],n.copy(p).applyMatrix4(a),i.copy(w).applyMatrix3(r).normalize().multiplyScalar(this.size).add(n),e.setXYZ(u,n.x,n.y,n.z),u=u+1,e.setXYZ(u,i.x,i.y,i.z),u=u+1}else if(f&&f.isBufferGeometry){var c=f.attributes.position,l=f.attributes.normal,u=0;for(t=0,h=c.count;t<h;t++)n.set(c.getX(t),c.getY(t),c.getZ(t)).applyMatrix4(a),i.set(l.getX(t),l.getY(t),l.getZ(t)),i.applyMatrix3(r).normalize().multiplyScalar(this.size).add(n),e.setXYZ(u,n.x,n.y,n.z),u=u+1,e.setXYZ(u,i.x,i.y,i.z),u=u+1}e.needsUpdate=!0}}(),nf.prototype=Object.create(u.prototype),nf.prototype.constructor=nf,nf.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},nf.prototype.update=function(){var n=new t,i=new t;return function(){var t=this.light.distance?this.light.distance:1e3,r=t*Math.tan(this.light.angle);this.cone.scale.set(r,r,t),n.setFromMatrixPosition(this.light.matrixWorld),i.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(i.sub(n)),this.cone.material.color.copy(this.light.color)}}(),tf.prototype=Object.create(b.prototype),tf.prototype.constructor=tf,tf.prototype.getBoneList=function(n){var t=[],i;for(n&&n.isBone&&t.push(n),i=0;i<n.children.length;i++)t.push.apply(t,this.getBoneList(n.children[i]));return t},tf.prototype.update=function(){var n=new t,i=new o,r=new o;return function(){var e=this.geometry,o=e.getAttribute("position"),u,f,t;for(r.getInverse(this.root.matrixWorld),u=0,f=0;u<this.bones.length;u++)t=this.bones[u],t.parent&&t.parent.isBone&&(i.multiplyMatrices(r,t.matrixWorld),n.setFromMatrixPosition(i),o.setXYZ(f,n.x,n.y,n.z),i.multiplyMatrices(r,t.parent.matrixWorld),n.setFromMatrixPosition(i),o.setXYZ(f+1,n.x,n.y,n.z),f+=2);e.getAttribute("position").needsUpdate=!0}}(),rf.prototype=Object.create(ut.prototype),rf.prototype.constructor=rf,rf.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},rf.prototype.update=function(){this.material.color.copy(this.light.color)},uf.prototype=Object.create(u.prototype),uf.prototype.constructor=uf,uf.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},uf.prototype.update=function(){var r=this.children[0];r.material.color.copy(this.light.color);var t=this.light.width*.5,i=this.light.height*.5,u=r.geometry.attributes.position,n=u.array;n[0]=t,n[1]=-i,n[2]=0,n[3]=t,n[4]=i,n[5]=0,n[6]=-t,n[7]=i,n[8]=0,n[9]=-t,n[10]=-i,n[11]=0,n[12]=t,n[13]=-i,n[14]=0,u.needsUpdate=!0},ff.prototype=Object.create(u.prototype),ff.prototype.constructor=ff,ff.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},ff.prototype.update=function(){var r=new t,n=new e,i=new e;return function(){var o=this.children[0],f=o.geometry.getAttribute("color"),t,e,u;for(n.copy(this.light.color),i.copy(this.light.groundColor),t=0,e=f.count;t<e;t++)u=t<e/2?n:i,f.setXYZ(t,u.r,u.g,u.b);o.lookAt(r.setFromMatrixPosition(this.light.matrixWorld).negate()),f.needsUpdate=!0}}(),wo.prototype=Object.create(b.prototype),wo.prototype.constructor=wo,dc.prototype=Object.create(b.prototype),dc.prototype.constructor=dc,so.prototype=Object.create(b.prototype),so.prototype.constructor=so,so.prototype.update=function(){var n=new t,i=new t,r=new ti;return function(){var f,c,u,l;this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);var a=this.object.matrixWorld,e=this.geometry.attributes.position,s=this.object.geometry,o=s.vertices,h=s.faces,t=0;for(f=0,c=h.length;f<c;f++)u=h[f],l=u.normal,n.copy(o[u.a]).add(o[u.b]).add(o[u.c]).divideScalar(3).applyMatrix4(a),i.copy(l).applyMatrix3(r).normalize().multiplyScalar(this.size).add(n),e.setXYZ(t,n.x,n.y,n.z),t=t+1,e.setXYZ(t,i.x,i.y,i.z),t=t+1;e.needsUpdate=!0}}(),of.prototype=Object.create(u.prototype),of.prototype.constructor=of,of.prototype.dispose=function(){var n=this.children[0],t=this.children[1];n.geometry.dispose(),n.material.dispose(),t.geometry.dispose(),t.material.dispose()},of.prototype.update=function(){var i=new t,r=new t,n=new t;return function(){i.setFromMatrixPosition(this.light.matrixWorld),r.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(r,i);var t=this.children[0],u=this.children[1];t.lookAt(n),t.material.color.copy(this.light.color),u.lookAt(n),u.scale.z=n.length()}}(),co.prototype=Object.create(b.prototype),co.prototype.constructor=co,co.prototype.update=function(){function n(n,t,e,o){var s,c,h,l;if(i.set(t,e,o).unproject(f),s=u[n],s!==undefined)for(c=r.getAttribute("position"),h=0,l=s.length;h<l;h++)c.setXYZ(s[h],i.x,i.y,i.z)}var r,u,i=new t,f=new oi;return function(){r=this.geometry,u=this.pointMap;var i=1,t=1;f.projectionMatrix.copy(this.camera.projectionMatrix),n("c",0,0,-1),n("t",0,0,1),n("n1",-i,-t,-1),n("n2",i,-t,-1),n("n3",-i,t,-1),n("n4",i,t,-1),n("f1",-i,-t,1),n("f2",i,-t,1),n("f3",-i,t,1),n("f4",i,t,1),n("u1",i*.7,t*1.1,-1),n("u2",-i*.7,t*1.1,-1),n("u3",0,t*2,-1),n("cf1",-i,0,1),n("cf2",i,0,1),n("cf3",0,-t,1),n("cf4",0,t,1),n("cn1",-i,0,-1),n("cn2",i,0,-1),n("cn3",0,-t,-1),n("cn4",0,t,-1),r.getAttribute("position").needsUpdate=!0}}(),iu.prototype=Object.create(b.prototype),iu.prototype.constructor=iu,iu.prototype.update=function(){var n=new hi;return function(t){if(t!==undefined&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==undefined&&n.setFromObject(this.object),!n.isEmpty()){var r=n.min,u=n.max,f=this.geometry.attributes.position,i=f.array;i[0]=u.x,i[1]=u.y,i[2]=u.z,i[3]=r.x,i[4]=u.y,i[5]=u.z,i[6]=r.x,i[7]=r.y,i[8]=u.z,i[9]=u.x,i[10]=r.y,i[11]=u.z,i[12]=u.x,i[13]=u.y,i[14]=r.z,i[15]=r.x,i[16]=u.y,i[17]=r.z,i[18]=r.x,i[19]=r.y,i[20]=r.z,i[21]=u.x,i[22]=r.y,i[23]=r.z,f.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),iu.prototype.setFromObject=function(n){return this.object=n,this.update(),this},nu.prototype=Object.create(u.prototype),nu.prototype.constructor=nu,nu.prototype.setDirection=function(){var n=new t,i;return function(t){t.y>.99999?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(n.set(t.z,0,-t.x).normalize(),i=Math.acos(t.y),this.quaternion.setFromAxisAngle(n,i))}}(),nu.prototype.setLength=function(n,t,i){t===undefined&&(t=.2*n),i===undefined&&(i=.2*t),this.line.scale.set(1,Math.max(0,n-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=n,this.cone.updateMatrix()},nu.prototype.setColor=function(n){this.line.material.color.copy(n),this.cone.material.color.copy(n)},nl.prototype=Object.create(b.prototype),nl.prototype.constructor=nl;var rl=new t,uy=new ny,vy=new ny,kv=new ny;ui.prototype=Object.create(p.prototype),ui.prototype.constructor=ui,ui.prototype.getPoint=function(n){var i=this.points,r=i.length,f,e,o,s,v;r<2&&console.log("duh, you need at least 2 points");var p=(r-(this.closed?0:1))*n,u=Math.floor(p),c=p-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/i.length)+1)*i.length:c===0&&u===r-1&&(u=r-2,c=1),this.closed||u>0?f=i[(u-1)%r]:(rl.subVectors(i[0],i[1]).add(i[0]),f=rl),e=i[u%r],o=i[(u+1)%r],this.closed||u+2<r?s=i[(u+2)%r]:(rl.subVectors(i[r-1],i[r-2]).add(i[r-1]),s=rl),this.type===undefined||this.type==="centripetal"||this.type==="chordal"){var y=this.type==="chordal"?.5:.25,l=Math.pow(f.distanceToSquared(e),y),h=Math.pow(e.distanceToSquared(o),y),a=Math.pow(o.distanceToSquared(s),y);h<.0001&&(h=1),l<.0001&&(l=h),a<.0001&&(a=h),uy.initNonuniformCatmullRom(f.x,e.x,o.x,s.x,l,h,a),vy.initNonuniformCatmullRom(f.y,e.y,o.y,s.y,l,h,a),kv.initNonuniformCatmullRom(f.z,e.z,o.z,s.z,l,h,a)}else this.type==="catmullrom"&&(v=this.tension!==undefined?this.tension:.5,uy.initCatmullRom(f.x,e.x,o.x,s.x,v),vy.initCatmullRom(f.y,e.y,o.y,s.y,v),kv.initCatmullRom(f.z,e.z,o.z,s.z,v));return new t(uy.calc(c),vy.calc(c),kv.calc(c))},uo.prototype=Object.create(p.prototype),uo.prototype.constructor=uo,uo.prototype.getPoint=function(n){var i=this.v0,r=this.v1,u=this.v2,f=this.v3;return new t(kr(n,i.x,r.x,u.x,f.x),kr(n,i.y,r.y,u.y,f.y),kr(n,i.z,r.z,u.z,f.z))},fo.prototype=Object.create(p.prototype),fo.prototype.constructor=fo,fo.prototype.getPoint=function(n){var i=this.v0,r=this.v1,u=this.v2;return new t(dr(n,i.x,r.x,u.x),dr(n,i.y,r.y,u.y),dr(n,i.z,r.z,u.z))},ho.prototype=Object.create(p.prototype),ho.prototype.constructor=ho,ho.prototype.getPoint=function(n){if(n===1)return this.v2.clone();var i=new t;return i.subVectors(this.v2,this.v1),i.multiplyScalar(n),i.add(this.v1),i},fl.prototype=Object.create(ai.prototype),fl.prototype.constructor=fl,rk={createMultiMaterialObject:function(n,t){for(var r=new ns,i=0,u=t.length;i<u;i++)r.add(new ut(n,t[i]));return r},detach:function(n,t,i){n.applyMatrix(t.matrixWorld),t.remove(n),i.add(n)},attach:function(n,t,i){var r=new o;r.getInverse(i.matrixWorld),n.applyMatrix(r),t.remove(n),i.add(n)}},nk=0,nd=1,p.create=function(n,t){return console.log("THREE.Curve.create() has been deprecated"),n.prototype=Object.create(p.prototype),n.prototype.constructor=n,n.prototype.getPoint=t,n},ok.prototype=Object.create(ui.prototype),rd.prototype=Object.create(ui.prototype),na.prototype=Object.create(ui.prototype),Object.assign(na.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.")}}),wo.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Object.assign(oc.prototype,{center:function(n){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(n)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(n){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},size:function(n){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(n)}}),Object.assign(hi.prototype,{center:function(n){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(n)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(n){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},isIntersectionSphere:function(n){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)},size:function(n){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(n)}}),yf.prototype.center=function(n){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(n)},c.random16=function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},Object.assign(ti.prototype,{flattenToArrayOffset:function(n,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,t)},multiplyVector3:function(n){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)},multiplyVector3Array:function(n){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(n)},applyToBuffer:function(n){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(n)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(o.prototype,{extractPosition:function(n){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(n)},flattenToArrayOffset:function(n,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,t)},getPosition:function(){var n;return function(){return n===undefined&&(n=new t),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),n.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(n){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(n)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(n){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},multiplyVector4:function(n){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},multiplyVector3Array:function(n){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(n)},rotateAxis:function(n){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),n.transformDirection(this)},crossVector:function(n){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.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(n){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(n)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(n,t,i,r,u,f){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(n,t,r,i,u,f)}}),bt.prototype.isIntersectionLine=function(n){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(n)},g.prototype.multiplyVector3=function(n){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),n.applyQuaternion(this)},Object.assign(rr.prototype,{isIntersectionBox:function(n){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},isIntersectionPlane:function(n){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(n)},isIntersectionSphere:function(n){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)}}),Object.assign(hu.prototype,{extrude:function(n){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new gi(this,n)},makeGeometry:function(n){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new fe(this,n)}}),Object.assign(i.prototype,{fromAttribute:function(n,t,i){return console.error("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,t,i)}}),Object.assign(t.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(n){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(n)},getScaleFromMatrix:function(n){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(n)},getColumnFromMatrix:function(n,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,n)},applyProjection:function(n){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(n)},fromAttribute:function(n,t,i){return console.error("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,t,i)}}),Object.assign(y.prototype,{fromAttribute:function(n,t,i){return console.error("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,t,i)}}),s.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},Object.assign(u.prototype,{getChildByName:function(n){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(n)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(n,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,n)}}),Object.defineProperties(u.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(n){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=n}},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(rs.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(is.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(p.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(n){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=n}}),nt.prototype.setLens=function(n,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),t!==undefined&&(this.filmGauge=t),this.setFocalLength(n)},Object.defineProperties(d.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(n){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=n}},shadowCameraLeft:{set:function(n){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=n}},shadowCameraRight:{set:function(n){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=n}},shadowCameraTop:{set:function(n){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=n}},shadowCameraBottom:{set:function(n){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=n}},shadowCameraNear:{set:function(n){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=n}},shadowCameraFar:{set:function(n){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=n}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(n){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=n}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(n){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=n}},shadowMapHeight:{set:function(n){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=n}}}),Object.defineProperties(l.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(f.prototype,{addIndex:function(n){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(n)},addDrawCall:function(n,t,i){i!==undefined&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(n,t)},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(f.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.defineProperties(bh.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(a.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new e}}}),Object.defineProperties(dt.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(ft.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(n){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=n}}}),Object.assign(ra.prototype,{getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},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(n){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(n)},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.")}}),Object.defineProperties(ra.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=n}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=n}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=n}}}),Object.defineProperties(gb.prototype,{cullFace:{get:function(){return this.renderReverseSided?iy:lo},set:function(n){var t=n!==lo;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+t+"."),this.renderReverseSided=t}}}),Object.defineProperties(lu.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=n}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=n}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=n}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=n}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(n){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=n}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(n){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=n}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(n){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=n}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(n){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=n}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(n){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=n}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(n){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=n}}}),gu.prototype.load=function(n){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this,i=new ty;return i.load(n,function(n){t.setBuffer(n)}),this},ly.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},py={merge:function(n,t,i){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var r;t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),n.merge(t,r,i)},center:function(n){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),n.center()}},lw={crossOrigin:undefined,loadTexture:function(n,t,i,r){var u,f;return console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead."),u=new kh,u.setCrossOrigin(this.crossOrigin),f=u.load(n,i,undefined,r),t&&(f.mapping=t),f},loadTextureCube:function(n,t,i,r){var u,f;return console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead."),u=new gl,u.setCrossOrigin(this.crossOrigin),f=u.load(n,i,undefined,r),t&&(f.mapping=t),f},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}},n.WebGLRenderTargetCube=au,n.WebGLRenderTarget=lu,n.WebGLRenderer=ra,n.ShaderLib=nr,n.UniformsLib=h,n.UniformsUtils=et,n.ShaderChunk=v,n.FogExp2=yu,n.Fog=wu,n.Scene=wh,n.LensFlare=va,n.Sprite=us,n.LOD=rs,n.SkinnedMesh=yh,n.Skeleton=is,n.Bone=ph,n.Mesh=ut,n.LineSegments=b,n.LineLoop=vh,n.Line=pt,n.Points=vf,n.Group=ns,n.VideoTexture=ch,n.DataTexture=fu,n.CompressedTexture=wf,n.CubeTexture=ki,n.CanvasTexture=uc,n.DepthTexture=ts,n.Texture=w,n.CompressedTextureLoader=kb,n.DataTextureLoader=yl,n.CubeTextureLoader=gl,n.TextureLoader=kh,n.ObjectLoader=gk,n.MaterialLoader=pc,n.BufferGeometryLoader=wv,n.DefaultLoadingManager=st,n.LoadingManager=wl,n.JSONLoader=ey,n.ImageLoader=ws,n.FontLoader=pw,n.FileLoader=ni,n.Loader=cf,n.Cache=ku,n.AudioLoader=ty,n.SpotLightShadow=gh,n.SpotLight=nc,n.PointLight=tc,n.RectAreaLight=ec,n.HemisphereLight=dh,n.DirectionalLightShadow=ic,n.DirectionalLight=rc,n.AmbientLight=fc,n.LightShadow=gr,n.Light=d,n.StereoCamera=aw,n.PerspectiveCamera=nt,n.OrthographicCamera=pf,n.CubeCamera=hh,n.ArrayCamera=fy,n.Camera=oi,n.AudioListener=pv,n.PositionalAudio=oy,n.AudioContext=oh,n.AudioAnalyser=ly,n.Audio=gu,n.VectorKeyframeTrack=af,n.StringKeyframeTrack=vc,n.QuaternionKeyframeTrack=oo,n.NumberKeyframeTrack=lf,n.ColorKeyframeTrack=ah,n.BooleanKeyframeTrack=yc,n.PropertyMixer=ay,n.PropertyBinding=rt,n.KeyframeTrack=fr,n.AnimationUtils=it,n.AnimationObjectGroup=dp,n.AnimationMixer=bp,n.AnimationClip=kt,n.Uniform=bh,n.InstancedBufferGeometry=cy,n.BufferGeometry=f,n.GeometryIdCount=fa,n.Geometry=s,n.InterleavedBufferAttribute=hy,n.InstancedInterleavedBuffer=ua,n.InterleavedBuffer=bf,n.InstancedBufferAttribute=la,n.Face3=li,n.Object3D=u,n.Raycaster=wp,n.Layers=ha,n.EventDispatcher=vi,n.Clock=vw,n.QuaternionLinearInterpolant=ac,n.LinearInterpolant=bo,n.DiscreteInterpolant=lc,n.CubicInterpolant=hc,n.Interpolant=lt,n.Triangle=ci,n.Math=c,n.Spherical=yw,n.Cylindrical=gw,n.Plane=bt,n.Frustum=lh,n.Sphere=ri,n.Ray=rr,n.Matrix4=o,n.Matrix3=ti,n.Box3=hi,n.Box2=oc,n.Line3=yf,n.Euler=tr,n.Vector4=y,n.Vector3=t,n.Vector2=i,n.Quaternion=g,n.Color=e,n.MorphBlendMesh=tt,n.ImmediateRenderObject=ks,n.VertexNormalsHelper=gs,n.SpotLightHelper=nf,n.SkeletonHelper=tf,n.PointLightHelper=rf,n.RectAreaLightHelper=uf,n.HemisphereLightHelper=ff,n.GridHelper=wo,n.PolarGridHelper=dc,n.FaceNormalsHelper=so,n.DirectionalLightHelper=of,n.CameraHelper=co,n.BoxHelper=iu,n.ArrowHelper=nu,n.AxisHelper=nl,n.CatmullRomCurve3=ui,n.CubicBezierCurve3=uo,n.QuadraticBezierCurve3=fo,n.LineCurve3=ho,n.ArcCurve=fl,n.EllipseCurve=ai,n.SplineCurve=ou,n.CubicBezierCurve=hf,n.QuadraticBezierCurve=sf,n.LineCurve=ei,n.Shape=hu,n.Path=bs,n.ShapePath=dv,n.Font=gv,n.CurvePath=de,n.Curve=p,n.ShapeUtils=wt,n.SceneUtils=rk,n.WireframeGeometry=ve,n.ParametricGeometry=es,n.ParametricBufferGeometry=ae,n.TetrahedronGeometry=as,n.TetrahedronBufferGeometry=oe,n.OctahedronGeometry=ys,n.OctahedronBufferGeometry=lr,n.IcosahedronGeometry=ps,n.IcosahedronBufferGeometry=re,n.DodecahedronGeometry=ds,n.DodecahedronBufferGeometry=ne,n.PolyhedronGeometry=os,n.PolyhedronBufferGeometry=ht,n.TubeGeometry=fh,n.TubeBufferGeometry=gf,n.TorusKnotGeometry=go,n.TorusKnotBufferGeometry=le,n.TorusGeometry=ro,n.TorusBufferGeometry=te,n.TextGeometry=po,n.TextBufferGeometry=we,n.SphereGeometry=ke,n.SphereBufferGeometry=br,n.RingGeometry=nh,n.RingBufferGeometry=ye,n.PlaneGeometry=ko,n.PlaneBufferGeometry=wr,n.LatheGeometry=vo,n.LatheBufferGeometry=se,n.ShapeGeometry=fe,n.ShapeBufferGeometry=ue,n.ExtrudeGeometry=gi,n.ExtrudeBufferGeometry=ii,n.EdgesGeometry=ie,n.ConeGeometry=uh,n.ConeBufferGeometry=rh,n.CylinderGeometry=eu,n.CylinderBufferGeometry=yi,n.CircleGeometry=ih,n.CircleBufferGeometry=ee,n.BoxGeometry=du,n.BoxBufferGeometry=pr,n.ShadowMaterial=pe,n.SpriteMaterial=di,n.RawShaderMaterial=ef,n.ShaderMaterial=ft,n.PointsMaterial=gt,n.MeshPhysicalMaterial=su,n.MeshStandardMaterial=si,n.MeshPhongMaterial=dt,n.MeshToonMaterial=tu,n.MeshNormalMaterial=ur,n.MeshLambertMaterial=er,n.MeshDepthMaterial=bi,n.MeshBasicMaterial=yt,n.LineDashedMaterial=or,n.LineBasicMaterial=k,n.Material=a,n.Float64BufferAttribute=ls,n.Float32BufferAttribute=r,n.Uint32BufferAttribute=yr,n.Int32BufferAttribute=ao,n.Uint16BufferAttribute=vr,n.Int16BufferAttribute=ge,n.Uint8ClampedBufferAttribute=no,n.Uint8BufferAttribute=to,n.Int8BufferAttribute=io,n.BufferAttribute=l,n.REVISION=lb,n.MOUSE=vg,n.CullFaceNone=gp,n.CullFaceBack=lo,n.CullFaceFront=iy,n.CullFaceFrontBack=hg,n.FrontFaceDirectionCW=vb,n.FrontFaceDirectionCCW=sd,n.BasicShadowMap=ad,n.PCFShadowMap=vv,n.PCFSoftShadowMap=wk,n.FrontSide=bu,n.BackSide=ir,n.DoubleSide=pu,n.FlatShading=yv,n.SmoothShading=ya,n.NoColors=sh,n.FaceColors=ka,n.VertexColors=hr,n.NoBlending=cc,n.NormalBlending=ce,n.AdditiveBlending=aa,n.SubtractiveBlending=sv,n.MultiplyBlending=hv,n.CustomBlending=cv,n.AddEquation=lv,n.SubtractEquation=ek,n.ReverseSubtractEquation=fb,n.MinEquation=ia,n.MaxEquation=dl,n.ZeroFactor=ub,n.OneFactor=wb,n.SrcColorFactor=tk,n.OneMinusSrcColorFactor=ik,n.SrcAlphaFactor=oa,n.OneMinusSrcAlphaFactor=sa,n.DstAlphaFactor=ud,n.OneMinusDstAlphaFactor=db,n.DstColorFactor=bb,n.OneMinusDstColorFactor=uk,n.SrcAlphaSaturateFactor=cb,n.NeverDepth=eb,n.AlwaysDepth=fk,n.LessDepth=pk,n.LessEqualDepth=sc,n.EqualDepth=kk,n.GreaterEqualDepth=vp,n.GreaterDepth=ck,n.NotEqualDepth=yk,n.MultiplyOperation=hs,n.MixOperation=sp,n.AddOperation=yy,n.NoToneMapping=kc,n.LinearToneMapping=av,n.ReinhardToneMapping=lp,n.Uncharted2ToneMapping=hp,n.CineonToneMapping=fp,n.UVMapping=il,n.CubeReflectionMapping=ol,n.CubeRefractionMapping=cl,n.EquirectangularReflectionMapping=pa,n.EquirectangularRefractionMapping=ll,n.SphericalReflectionMapping=ta,n.CubeUVReflectionMapping=wc,n.CubeUVRefractionMapping=al,n.RepeatWrapping=wi,n.ClampToEdgeWrapping=ct,n.MirroredRepeatWrapping=cu,n.NearestFilter=at,n.NearestMipMapNearestFilter=hl,n.NearestMipMapLinearFilter=sl,n.LinearFilter=ot,n.LinearMipMapNearestFilter=wa,n.LinearMipMapLinearFilter=eo,n.UnsignedByteType=el,n.ByteType=tw,n.ShortType=iw,n.UnsignedShortType=be,n.IntType=rw,n.UnsignedIntType=ba,n.FloatType=kf,n.HalfFloatType=ul,n.UnsignedShort4444Type=fw,n.UnsignedShort5551Type=ew,n.UnsignedShort565Type=ow,n.UnsignedInt248Type=yo,n.AlphaFormat=sw,n.RGBFormat=he,n.RGBAFormat=fi,n.LuminanceFormat=hw,n.LuminanceAlphaFormat=cw,n.RGBEFormat=kit,n.DepthFormat=ar,n.DepthStencilFormat=df,n.RGB_S3TC_DXT1_Format=da,n.RGBA_S3TC_DXT1_Format=ga,n.RGBA_S3TC_DXT3_Format=nv,n.RGBA_S3TC_DXT5_Format=tv,n.RGB_PVRTC_4BPPV1_Format=iv,n.RGB_PVRTC_2BPPV1_Format=rv,n.RGBA_PVRTC_4BPPV1_Format=uv,n.RGBA_PVRTC_2BPPV1_Format=fv,n.RGB_ETC1_Format=ww,n.LoopOnce=bw,n.LoopRepeat=yp,n.LoopPingPong=dw,n.InterpolateDiscrete=vs,n.InterpolateLinear=cs,n.InterpolateSmooth=vl,n.ZeroCurvatureEnding=ru,n.ZeroSlopeEnding=uu,n.WrapAroundEnding=ss,n.TrianglesDrawMode=ev,n.TriangleStripDrawMode=nb,n.TriangleFanDrawMode=pp,n.LinearEncoding=fs,n.sRGBEncoding=tb,n.GammaEncoding=ov,n.RGBEEncoding=op,n.LogLuvEncoding=bit,n.RGBM7Encoding=wy,n.RGBM16Encoding=by,n.RGBDEncoding=np,n.BasicDepthPacking=ap,n.RGBADepthPacking=up,n.CubeGeometry=du,n.Face4=yd,n.LineStrip=nk,n.LinePieces=nd,n.MeshFaceMaterial=fd,n.MultiMaterial=pd,n.PointCloud=ed,n.Particle=ld,n.ParticleSystem=od,n.PointCloudMaterial=hd,n.ParticleBasicMaterial=cd,n.ParticleSystemMaterial=dg,n.Vertex=kg,n.DynamicBufferAttribute=bg,n.Int8Attribute=wg,n.Uint8Attribute=pg,n.Uint8ClampedAttribute=yg,n.Int16Attribute=vd,n.Uint16Attribute=ag,n.Int32Attribute=lg,n.Uint32Attribute=cg,n.Float32Attribute=sg,n.Float64Attribute=og,n.ClosedSplineCurve3=ok,n.SplineCurve3=rd,n.Spline=na,n.BoundingBoxHelper=ig,n.EdgesHelper=tg,n.WireframeHelper=dd,n.XHRLoader=bd,n.BinaryTextureLoader=gg,n.GeometryUtils=py,n.ImageUtils=lw,n.Projector=uft,n.CanvasRenderer=nut,Object.defineProperty(n,"__esModule",{value:!0})});

;// 3D/MTLLoader.js
THREE.MTLLoader=function(n,t){this.options=n,this.crossOrigin=t},THREE.MTLLoader.prototype={getHashUrl:function(n){for(var i=31,t=0;t<32;t++)i^=n[t].charCodeAt(0);return"https://t"+(i%8).toString()+".rbxcdn.com/"+n},constructor:THREE.MTLLoader,load:function(n,t,i,r){var f=this,u=new THREE.XHRLoader;u.setCrossOrigin(this.crossOrigin),u.load(n,function(n){t(f.parse(n))},function(){},r)},parse:function(n){for(var h=n.split("\n"),u={},l=/\s+/,c={},t,f,i,r,o,s,e=0;e<h.length;e++)(t=h[e],t=t.trim(),t.length!==0&&t.charAt(0)!=="#")&&(f=t.indexOf(" "),i=f>=0?t.substring(0,f):t,i=i.toLowerCase(),r=f>=0?t.substring(f+1):"",r=r.trim(),i==="newmtl"?(u={name:r},c[r]=u):u&&(i==="ka"||i==="kd"||i==="ks"?(o=r.split(l,3),u[i]=[parseFloat(o[0]),parseFloat(o[1]),parseFloat(o[2])]):u[i]=r));return s=new THREE.MTLLoader.MaterialCreator(this.options),s.setMaterials(c),s}},THREE.MTLLoader.MaterialCreator=function(n){this.options=n,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:THREE.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:THREE.RepeatWrapping},THREE.MTLLoader.MaterialCreator.prototype={constructor:THREE.MTLLoader.MaterialCreator,setMaterials:function(n){this.materialsInfo=this.convert(n),this.materials={},this.materialsArray=[],this.nameLookup={}},getHashUrl:function(n){for(var i=31,t=0;t<32;t++)i^=n[t].charCodeAt(0);return"https://t"+(i%8).toString()+".rbxcdn.com/"+n},convert:function(n){var i,r,u,f,e;if(!this.options)return n;i={};for(r in n){u=n[r],f={},i[r]=f;for(e in u){var o=!0,t=u[e],s=e.toLowerCase();switch(s){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(t=[t[0]/255,t[1]/255,t[2]/255]),this.options&&this.options.ignoreZeroRGBs&&t[0]===0&&t[1]===0&&t[1]===0&&(o=!1);break;case"d":this.options&&this.options.invertTransparency&&(t=1-t)}o&&(f[s]=t)}}return i},preload:function(){for(var n in this.materialsInfo)this.create(n)},getIndex:function(n){return this.nameLookup[n]},getAsArray:function(){var n=0,t;for(t in this.materialsInfo)this.materialsArray[n]=this.create(t),this.nameLookup[t]=n,n++;return this.materialsArray},create:function(n){return this.materials[n]===undefined&&this.createMaterial_(n),this.materials[n]},createMaterial_:function(n){var u=this.materialsInfo[n],t={name:n,side:this.side},r,i;for(r in u){i=u[r];switch(r.toLowerCase()){case"kd":t.color=(new THREE.Color).fromArray(i);break;case"ks":t.specular=(new THREE.Color).fromArray(i);break;case"map_kd":t.map=this.loadTexture(this.getHashUrl(i)),t.map.wrapS=this.wrap,t.map.wrapT=this.wrap;break;case"ns":t.shininess=i;break;case"d":i<1&&(t.transparent=!0,t.opacity=i)}}return t.shininess=0,this.materials[n]=new THREE.MeshPhongMaterial(t)},loadTexture:function(n,t,i,r){var s=/\.dds$/i.test(n),u;if(s)u=THREE.ImageUtils.loadCompressedTexture(n,t,i,r);else{var h=new Image,u=new THREE.Texture(h,t),e=new THREE.ImageLoader;e.crossOrigin="anonymous";var f=0,c=4,l=5e3;function o(){e.load(n,y,v,a)}function a(){f<c?(f=f+1,setTimeout(o,l)):typeof r=="function"&&r("Unable to load 3D thumbnail")}function v(){}function y(n){u.image=THREE.MTLLoader.ensurePowerOfTwo_(n),u.needsUpdate=!0,i&&i(u)}o()}return u}},THREE.MTLLoader.ensurePowerOfTwo_=function(n){var t,i;return!THREE.MTLLoader.isPowerOfTwo_(n.width)||!THREE.MTLLoader.isPowerOfTwo_(n.height)?(t=document.createElement("canvas"),t.width=THREE.MTLLoader.nextHighestPowerOfTwo_(n.width),t.height=THREE.MTLLoader.nextHighestPowerOfTwo_(n.height),i=t.getContext("2d"),i.drawImage(n,0,0,n.width,n.height,0,0,t.width,t.height),t):n},THREE.MTLLoader.isPowerOfTwo_=function(n){return(n&n-1)==0},THREE.MTLLoader.nextHighestPowerOfTwo_=function(n){--n;for(var t=1;t<32;t<<=1)n=n|n>>t;return n+1};

;// 3D/OBJMTLLoader.js
THREE.OBJMTLLoader=function(){},THREE.OBJMTLLoader.prototype={constructor:THREE.OBJMTLLoader,getHashUrl:function(n){for(var i=31,t=0;t<32;t++)i^=n[t].charCodeAt(0);return"https://t"+(i%8).toString()+".rbxcdn.com/"+n},loadWithRetries:function(n,t,i,r,u){function h(){f<o?(f=f+1,setTimeout(e,s)):u("Unable to load file",t)}function e(){n.load(t,i,r,h)}var f=0,o=4,s=5e3;e()},interpretData:function(n,t,i){function r(n){return n.length===32&&n.indexOf("/")===-1}function f(n){return!r(n)&&n.indexOf("/")>-1&&n.indexOf("\n")===-1}function o(n){return!r(n)&&!f(n)}var e=this,u=new THREE.FileLoader(e.manager);r(t)?this.loadWithRetries(u,this.getHashUrl(t),function(t){i(n,t)},function(){},function(){}):f(t)?this.loadWithRetries(u,t,function(t){i(n,t)},function(){},function(){}):o(t)&&i(n,t)},cleanObjData:function(n){return n.replace(new RegExp("-1.#IND","g"),"0")},load:function(n,t,i){var u,r,f="anonymous",e=new THREE.MTLLoader({},f);this.interpretData(this,t,function(t,f){u=e.parse(f),t.interpretData(t,n,function(n,t){r=n.cleanObjData(t),r=n.parse(r),r.traverse(function(n){if(n instanceof THREE.Mesh&&n.material.name){var t=u.create(n.material.name);t&&(n.material=t)}}),i(r,u)})})},parse:function(n,t){function g(n,t,i){return new THREE.Vector3(n,t,i)}function tt(n,t){return new THREE.Vector2(n,t)}function d(n,t,i,r){return new THREE.Face3(n,t,i,r)}function p(n,t){s.length>0&&(f.vertices=s,f.mergeVertices(),y.add(w),f=new THREE.Geometry,w=new THREE.Mesh(f,o),ht=0),n!==undefined&&(w.name=n),t!==undefined&&(o=new THREE.MeshLambertMaterial,o.name=t,w.material=o)}function e(n,t,i,r){r===undefined?f.faces.push(d(parseInt(n)-(u+1),parseInt(t)-(u+1),parseInt(i)-(u+1))):f.faces.push(d(parseInt(n)-(u+1),parseInt(t)-(u+1),parseInt(i)-(u+1),[l[parseInt(r[0])-1].clone(),l[parseInt(r[1])-1].clone(),l[parseInt(r[2])-1].clone()]))}function k(n,t,i){f.faceVertexUvs[0].push([a[parseInt(n)-1].clone(),a[parseInt(t)-1].clone(),a[parseInt(i)-1].clone()])}function c(n,t,i){n[3]===undefined?(e(n[0],n[1],n[2],i),!(t===undefined)&&t.length>0&&k(t[0],t[1],t[2])):(!(i===undefined)&&i.length>0?(e(n[0],n[1],n[3],[i[0],i[1],i[3]]),e(n[1],n[2],n[3],[i[1],i[2],i[3]])):(e(n[0],n[1],n[3]),e(n[1],n[2],n[3])),!(t===undefined)&&t.length>0&&(k(t[0],t[1],t[3]),k(t[1],t[2],t[3])))}for(var u=0,b=new THREE.Object3D,y=b,f=new THREE.Geometry,o=new THREE.MeshLambertMaterial,w=new THREE.Mesh(f,o),s=[],ht=0,l=[],a=[],ot=/v( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)/,et=/vn( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)/,rt=/vt( +[\d|\.|\+|\-|e]+)( +[\d|\.|\+|\-|e]+)/,ft=/f( +\d+)( +\d+)( +\d+)( +\d+)?/,ut=/f( +(\d+)\/(\d+))( +(\d+)\/(\d+))( +(\d+)\/(\d+))( +(\d+)\/(\d+))?/,st=/f( +(\d+)\/(\d+)\/(\d+))( +(\d+)\/(\d+)\/(\d+))( +(\d+)\/(\d+)\/(\d+))( +(\d+)\/(\d+)\/(\d+))?/,it=/f( +(\d+)\/\/(\d+))( +(\d+)\/\/(\d+))( +(\d+)\/\/(\d+))( +(\d+)\/\/(\d+))?/,nt=n.split("\n"),r,i,v,h=0;h<nt.length;h++)if(r=nt[h],r=r.trim(),r.length===0||r.charAt(0)==="#")continue;else(i=ot.exec(r))!==null?s.push(g(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]))):(i=et.exec(r))!==null?l.push(g(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]))):(i=rt.exec(r))!==null?a.push(tt(parseFloat(i[1]),parseFloat(i[2]))):(i=ft.exec(r))!==null?c([i[1],i[2],i[3],i[4]]):(i=ut.exec(r))!==null?c([i[2],i[5],i[8],i[11]],[i[3],i[6],i[9],i[12]]):(i=st.exec(r))!==null?c([i[2],i[6],i[10],i[14]],[i[3],i[7],i[11],i[15]],[i[4],i[8],i[12],i[16]]):(i=it.exec(r))!==null?c([i[2],i[5],i[8],i[11]],[],[i[3],i[6],i[9],i[12]]):/^o /.test(r)?(p(),u=u+s.length,s=[],y=new THREE.Object3D,y.name=r.substring(2).trim(),b.add(y)):/^g /.test(r)?p(r.substring(2).trim(),undefined):/^usemtl /.test(r)?p(undefined,r.substring(7).trim()):/^mtllib /.test(r)?t&&(v=r.substring(7),v=v.trim(),t(v)):/^s /.test(r);return p(undefined,undefined),b}};

;// 3D/tween.js
Date.now===undefined&&(Date.now=function(){return(new Date).valueOf()});var TWEEN=TWEEN||function(){var n=[];return{REVISION:"13",getAll:function(){return n},removeAll:function(){n=[]},add:function(t){n.push(t)},remove:function(t){var i=n.indexOf(t);i!==-1&&n.splice(i,1)},update:function(t){if(n.length===0)return!1;var i=0;for(t=t!==undefined?t:typeof window!="undefined"&&window.performance!==undefined&&window.performance.now!==undefined?window.performance.now():Date.now();i<n.length;)n[i].update(t)?i++:n.splice(i,1);return!0}}}();TWEEN.Tween=function(n){var i=n,r={},t={},u={},d=1e3,o=0,p=!1,y=!1,k=!1,a=0,e=null,g=TWEEN.Easing.Linear.None,b=TWEEN.Interpolation.Linear,f=[],l=null,c=!1,h=null,s=null,v=null,w;for(w in n)r[w]=parseFloat(n[w],10);this.to=function(n,i){return i!==undefined&&(d=i),t=n,this},this.start=function(n){TWEEN.add(this),y=!0,c=!1,e=n!==undefined?n:typeof window!="undefined"&&window.performance!==undefined&&window.performance.now!==undefined?window.performance.now():Date.now(),e+=a;for(var f in t){if(t[f]instanceof Array){if(t[f].length===0)continue;t[f]=[i[f]].concat(t[f])}r[f]=i[f],r[f]instanceof Array==!1&&(r[f]*=1),u[f]=r[f]||0}return this},this.stop=function(){return y?(TWEEN.remove(this),y=!1,v!==null&&v.call(i),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var n=0,t=f.length;n<t;n++)f[n].stop()},this.delay=function(n){return a=n,this},this.repeat=function(n){return o=n,this},this.yoyo=function(n){return p=n,this},this.easing=function(n){return g=n,this},this.interpolation=function(n){return b=n,this},this.chain=function(){return f=arguments,this},this.onStart=function(n){return l=n,this},this.onUpdate=function(n){return h=n,this},this.onComplete=function(n){return s=n,this},this.onStop=function(n){return v=n,this},this.update=function(n){var v,w,nt,tt,y,rt,it,ut;if(n<e)return!0;c===!1&&(l!==null&&l.call(i),c=!0),w=(n-e)/d,w=w>1?1:w,nt=g(w);for(v in t)tt=r[v]||0,y=t[v],y instanceof Array?i[v]=b(y,nt):(typeof y=="string"&&(y=tt+parseFloat(y,10)),typeof y=="number"&&(i[v]=tt+(y-tt)*nt));if(h!==null&&h.call(i,nt),w==1){if(o>0){isFinite(o)&&o--;for(v in u)typeof t[v]=="string"&&(u[v]=u[v]+parseFloat(t[v],10)),p&&(rt=u[v],u[v]=t[v],t[v]=rt),r[v]=u[v];return p&&(k=!k),e=n+a,!0}for(s!==null&&s.call(i),it=0,ut=f.length;it<ut;it++)f[it].start(n);return!1}return!0}},TWEEN.Easing={Linear:{None:function(n){return n}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.cos(n*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return.5*(1-Math.cos(Math.PI*n))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){var i,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,i=r/4):i=r*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*2*Math.PI/r)))},Out:function(n){var i,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,i=r/4):i=r*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*n)*Math.sin((n-i)*2*Math.PI/r)+1)},InOut:function(n){var i,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,i=r/4):i=r*Math.asin(1/t)/(2*Math.PI),(n*=2)<1)?-.5*t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*2*Math.PI/r):t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*2*Math.PI/r)*.5+1}},Back:{In:function(n){var t=1.70158;return n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return--n*n*((t+1)*n+t)+1},InOut:function(n){var t=1.70158*1.525;return(n*=2)<1?.5*n*n*((t+1)*n-t):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-TWEEN.Easing.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?TWEEN.Easing.Bounce.In(n*2)*.5:TWEEN.Easing.Bounce.Out(n*2-1)*.5+.5}}},TWEEN.Interpolation={Linear:function(n,t){var i=n.length-1,r=i*t,u=Math.floor(r),f=TWEEN.Interpolation.Utils.Linear;return t<0?f(n[0],n[1],r):t>1?f(n[i],n[i-1],i-r):f(n[u],n[u+1>i?i:u+1],r-u)},Bezier:function(n,t){for(var u=0,r=n.length-1,f=Math.pow,e=TWEEN.Interpolation.Utils.Bernstein,i=0;i<=r;i++)u+=f(1-t,r-i)*f(t,i)*n[i]*e(r,i);return u},CatmullRom:function(n,t){var i=n.length-1,u=i*t,r=Math.floor(u),f=TWEEN.Interpolation.Utils.CatmullRom;return n[0]===n[i]?(t<0&&(r=Math.floor(u=i*(1+t))),f(n[(r-1+i)%i],n[r],n[(r+1)%i],n[(r+2)%i],u-r)):t<0?n[0]-(f(n[0],n[0],n[1],n[1],-u)-n[0]):t>1?n[i]-(f(n[i],n[i],n[i-1],n[i-1],u-i)-n[i]):f(n[r?r-1:0],n[r],n[i<r+1?i:r+1],n[i<r+2?i:r+2],u-r)},Utils:{Linear:function(n,t,i){return(t-n)*i+n},Bernstein:function(n,t){var i=TWEEN.Interpolation.Utils.Factorial;return i(n)/i(t)/i(n-t)},Factorial:function(){var n=[1];return function(t){var r=1,i;if(n[t])return n[t];for(i=t;i>1;i--)r*=i;return n[t]=r}}(),CatmullRom:function(n,t,i,r,u){var f=(i-n)*.5,e=(r-t)*.5,o=u*u,s=u*o;return(2*t-2*i+f+e)*s+(-3*t+3*i-2*f-e)*o+f*u+t}}};

;// 3D/RobloxOrbitControls.js
THREE.OrbitControls=function(n,t,i,r){function tr(){g=undefined}function ni(){g=$.now()}function di(){tt=kt,ft=0}function oi(){return Math.pow(.95,u.zoomSpeed)}function li(n){if(n.preventDefault(),n.button===0){if(u.noRotate===!0)return;tr(),s=1,u.cancelAllTweens(),e=f.ROTATE,nt.set(n.clientX,n.clientY)}else if(n.button===1){if(u.noZoom===!0)return;e=f.DOLLY,a.set(n.clientX,n.clientY)}else if(n.button===2){if(u.noPan===!0)return;e=f.PAN,w.set(n.clientX,n.clientY)}u.domElement.addEventListener("mousemove",fi,!1),u.domElement.addEventListener("mouseup",dt,!1),u.dispatchEvent(wt)}function fi(n){if(u.enabled!==!1){this.autoRotate===!0&&it===!0&&(it=!1),n.preventDefault();var t=u.domElement===document?u.domElement.body:u.domElement;if(e===f.ROTATE){if(u.noRotate===!0)return;k.set(n.clientX,n.clientY),b.subVectors(k,nt),u.rotateLeft(2*Math.PI*b.x/t.clientWidth*u.rotateSpeed),u.rotateUp(2*Math.PI*b.y/t.clientHeight*u.rotateSpeed),nt.copy(k)}else if(e===f.DOLLY){if(u.noZoom===!0)return;l.set(n.clientX,n.clientY),et.subVectors(l,a),et.y>0?u.dollyIn():u.dollyOut(),a.copy(l)}else if(e===f.PAN){if(u.noPan===!0)return;p.set(n.clientX,n.clientY),y.subVectors(p,w),u.pan(y.x,y.y),w.copy(p)}u.update()}}function ai(n){e==f.ROTATE&&(dt(),g=undefined,u.tweenToLastPosition()),n.preventDefault(),n.stopPropagation()}function dt(){u.enabled!==!1&&(ni(),u.domElement.removeEventListener("mousemove",fi,!1),u.domElement.removeEventListener("mouseup",dt,!1),u.dispatchEvent(yt),e=f.NONE)}function ti(n){if(u.enabled!==!1&&u.noZoom!==!0){e!=f.ROTATE&&(ni(),u.cancelAllTweens()),n.preventDefault(),n.stopPropagation();var t=0;n.wheelDelta!==undefined?t=n.wheelDelta:n.detail!==undefined&&(t=-n.detail),t>0?u.dollyOut():u.dollyIn(),u.update(),u.dispatchEvent(wt),u.dispatchEvent(yt)}}function hi(n){if(u.enabled!==!1&&u.noKeys!==!0&&u.noPan!==!0)switch(n.keyCode){case u.keys.UP:u.pan(0,u.keyPanSpeed),u.update();break;case u.keys.BOTTOM:u.pan(0,-u.keyPanSpeed),u.update();break;case u.keys.LEFT:u.pan(u.keyPanSpeed,0),u.update();break;case u.keys.RIGHT:u.pan(-u.keyPanSpeed,0),u.update();break;case u.keys.ZOOMIN:u.dollyOut(),u.update();break;case u.keys.ZOOMOUT:u.dollyIn(),u.update()}}function ci(n){if(u.enabled!==!1){switch(n.touches.length){case 1:if(u.noRotate===!0)return;e=f.TOUCH_ROTATE,nt.set(n.touches[0].pageX,n.touches[0].pageY);break;case 2:if(u.noZoom===!0)return;e=f.TOUCH_DOLLY;var t=n.touches[0].pageX-n.touches[1].pageX,i=n.touches[0].pageY-n.touches[1].pageY,r=Math.sqrt(t*t+i*i);a.set(0,r);break;case 3:if(u.noPan===!0)return;e=f.TOUCH_PAN,w.set(n.touches[0].pageX,n.touches[0].pageY);break;default:e=f.NONE}u.dispatchEvent(wt)}}function bi(n){var t;if(u.enabled!==!1){n.preventDefault(),n.stopPropagation(),t=u.domElement===document?u.domElement.body:u.domElement;switch(n.touches.length){case 1:if(u.noRotate===!0)return;if(e!==f.TOUCH_ROTATE)return;k.set(n.touches[0].pageX,n.touches[0].pageY),b.subVectors(k,nt),u.rotateLeft(2*Math.PI*b.x/t.clientWidth*u.rotateSpeed),u.rotateUp(2*Math.PI*b.y/t.clientHeight*u.rotateSpeed),nt.copy(k),u.update();break;case 2:if(u.noZoom===!0)return;if(e!==f.TOUCH_DOLLY)return;var i=n.touches[0].pageX-n.touches[1].pageX,r=n.touches[0].pageY-n.touches[1].pageY,o=Math.sqrt(i*i+r*r);l.set(0,o),et.subVectors(l,a),et.y>0?u.dollyOut():u.dollyIn(),a.copy(l),u.update();break;case 3:if(u.noPan===!0)return;if(e!==f.TOUCH_PAN)return;p.set(n.touches[0].pageX,n.touches[0].pageY),y.subVectors(p,w),u.pan(y.x,y.y),w.copy(p),u.update();break;default:e=f.NONE}}}function rr(){u.enabled!==!1&&(u.dispatchEvent(yt),e=f.NONE)}var d,c,st,ri,ot,si,g;r=r||"static",this.object=n,this.domElement=t!==undefined?t:document,this.enabled=!0,this.maxDistance=1e3,this.dynamicDampingFactor=.3,r==="animated"?(this.autoRotate=!1,this.fullRotation=!1,this.noResetToInitialCameraPosition=!0):(this.autoRotate=!0,this.fullRotation=!0,this.noResetToInitialCameraPosition=!1),d=i.aabb.max,d=new THREE.Vector3(d.x,d.y,d.z),c=i.aabb.min,c=new THREE.Vector3(c.x,c.y,c.z),st=new THREE.Vector3,st.copy(d).add(c).multiplyScalar(.5),this.target=st,this.center=this.target;var ht=i.camera.position,ct=i.camera.direction,h=new THREE.Vector3(ht.x,ht.y,ht.z),vi=new THREE.Vector3(ct.x,ct.y,ct.z),ui=22.5*(Math.PI/180),vt=new THREE.Vector3;vt.copy(h),vt.sub(vi),this.object.position.set(h.x,h.y,h.z),this.object.lookAt(vt);var ei=new THREE.Vector3,pi=h.z-this.target.z,wi=h.x-this.target.x,pt=Math.atan2(wi,pi),rt=h.distanceTo(this.target),ii=.5;this.minDistance=rt*ii,ri=new THREE.Vector3(this.target.x+rt*Math.sin(pt),this.target.y+rt*Math.sin(ui),this.target.z+rt*Math.cos(pt)),this.lastPosition=ri,this.noZoom=!1,this.zoomSpeed=1,this.noRotate=!1,this.rotateSpeed=1,this.noPan=!0,this.keyPanSpeed=7,ot=Math.PI/180,this.minPolarAngle=0+ot,this.maxPolarAngle=Math.PI-ot,this.noKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40,ZOOMIN:65,ZOOMOUT:90},si=.75*1e3;var kt=pt,nr=Math.PI/6,tt=0,ft=0,gi=-.01;var ki=1500,it=!1,u=this,bt=1e-6,nt=new THREE.Vector2,k=new THREE.Vector2,b=new THREE.Vector2,w=new THREE.Vector2,p=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,o=new THREE.Vector3,a=new THREE.Vector2,l=new THREE.Vector2,et=new THREE.Vector2,at=0,lt=0,s=1,ut=new THREE.Vector3,f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5,IDLE:6},e=this.autoRotate?f.IDLE:f.NONE;this.target0=this.target.clone(),this.position0=this.object.position.clone();var gt=new THREE.Quaternion,yi=gt.clone().inverse(),ir={type:"change"},wt={type:"start"},yt={type:"end"};this.cancelAllTweens=function(){TWEEN.removeAll()},this.tweenToLastPosition=function(){u.noResetToInitialCameraPosition||(this.tweenCamera(this.lastPosition,ki,function(){e=f.IDLE}),di())},this.tweenCamera=function(n,t,i){function f(){it===!1&&r.stop(),u.object.position.x=this.x,u.object.position.y=this.y,u.object.position.z=this.z,u.object.lookAt(u.target)}it=!0;var r;r=new TWEEN.Tween(u.object.position).to(n,t).easing(TWEEN.Easing.Quadratic.InOut).onUpdate(f).onComplete(function(){it=!1,i()}).start()},this.rotateLeft=function(n){n===undefined&&(n=getAutoRotationAngle()),lt-=n},this.rotateUp=function(n){n===undefined&&(n=getAutoRotationAngle()),at-=n},this.panLeft=function(n){var t=this.object.matrix.elements;v.set(t[0],t[1],t[2]),v.multiplyScalar(-n),ut.add(v)},this.panUp=function(n){var t=this.object.matrix.elements;v.set(t[4],t[5],t[6]),v.multiplyScalar(n),ut.add(v)},this.pan=function(n,t){var i=u.domElement===document?u.domElement.body:u.domElement;if(u.object.fov!==undefined){var f=u.object.position,e=f.clone().sub(u.target),r=e.length();r*=Math.tan(u.object.fov/2*Math.PI/180),u.panLeft(2*n*r/i.clientHeight),u.panUp(2*t*r/i.clientHeight)}else u.object.top!==undefined&&(u.panLeft(n*(u.object.right-u.object.left)/i.clientWidth),u.panUp(t*(u.object.top-u.object.bottom)/i.clientHeight))},this.dollyIn=function(n){n===undefined&&(n=oi()),s/=n,s=Math.max(ii,s)},this.dollyOut=function(n){n===undefined&&(n=oi()),s*=n},this.update=function(){var r,t,h,n,i;if(this.autoRotate===!0&&e===f.IDLE){r=Math.max(this.minDistance,Math.min(this.maxDistance,rt*s)),t=new THREE.Vector3(this.target.x+r*Math.sin(tt),this.target.y+r*Math.sin(ui),this.target.z+r*Math.cos(tt)),this.object.position.set(t.x,t.y,t.z),this.object.lookAt(this.target),tt=u.fullRotation===!0?kt+ft:kt+nr*Math.sin(ft),ft+=gi;return}g!==undefined&&$.now()>=g+si&&(g=undefined,u.tweenToLastPosition()),t=this.object.position,o.copy(t).sub(this.target),o.applyQuaternion(gt),h=Math.atan2(o.x,o.z),n=Math.atan2(Math.sqrt(o.x*o.x+o.z*o.z),o.y),h+=lt,n+=at,n=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,n)),n=Math.max(bt,Math.min(Math.PI-bt,n)),i=o.length()*s,i=Math.max(this.minDistance,Math.min(this.maxDistance,i)),this.target.add(ut),o.x=i*Math.sin(n)*Math.sin(h),o.y=i*Math.cos(n),o.z=i*Math.sin(n)*Math.cos(h),o.applyQuaternion(yi),t.copy(this.target).add(o),this.object.lookAt(this.target),lt=0,at=0,s=1,ut.set(0,0,0),ei.distanceToSquared(this.object.position)>bt&&(this.dispatchEvent(ir),ei.copy(this.object.position))},this.reset=function(){e=f.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.update()},Roblox.FixedUI.isMobile==!1&&(this.domElement.addEventListener("mouseleave",ai,!1),this.domElement.addEventListener("mousedown",li,!1),this.domElement.addEventListener("mousewheel",ti,!1),this.domElement.addEventListener("DOMMouseScroll",ti,!1),this.domElement.addEventListener("touchstart",ci,!1),this.domElement.addEventListener("touchend",rr,!1),this.domElement.addEventListener("touchmove",bi,!1),window.addEventListener("keydown",hi,!1),this.update())},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype);

;// ~/Generated/js/Roblox_TranslationResources_Feature_ItemResources_en_us_standard.js
var Roblox=Roblox||{};Roblox.Lang=Roblox.Lang||{},Roblox.Lang["Feature.Item"]={"Action.Add":"Add","Action.AddToGame":"Add To Experience","Action.AddToProfile":"Add to Profile","Action.Advertise":"Advertise","Action.Agree":"Agree","Action.Buy":"Buy","Action.Cancel":"Cancel","Action.Configure":"Configure","Action.Confirm":"Confirm","Action.Delete":"Delete from Inventory","Action.DisableBadge":"Disable Badge","Action.EditAvatar":"Edit Avatar","Action.EnableBadge":"Enable Badge","Action.Get":"Get","Action.GetPremium":"Get Premium","Action.Install":"Install","Action.Inventory":"Inventory","Action.No":"No","Action.Ok":"OK","Action.Remove":"Remove","Action.RemoveFromProfile":"Remove from Profile","Action.Rent":"Rent","Action.ReportItem":"Report Item","Action.Sell":"Sell","Action.SellNow":"Sell Now","Action.SponsorItem":"Sponsor This Item","Action.TakeOff":"Take Off","Action.TakeOffSale":"Take Off Sale","Action.TryInStudio":"Try in Studio","Action.TryOn":"Try On","Action.Upgrade":"Upgrade","Action.Wear":"Wear","Action.Yes":"Yes","Heading.IncludedItems":"Included Items","Heading.PromoteItem":"Promote Item","Label.AllowPlayersPlusEarn":"Allow visitors to use this gear inside your experience plus earn {affiliateSaleTotal} when it's purchased from your experience page.","Label.AssetGrantedModalAcceptText":"OK","Label.AssetGrantedModalMessage":"You just got this item courtesy of our sponsor.","Label.AssetGrantedModalTitle":"This item is now yours","Label.Attributes":"Attributes","Label.BestPrice":"Best Price","Label.BuildersClubExclusive":"Builders Club exclusive.","Label.By":"By {creator}","Label.CountdownTimerDayHourMinute":"Offsale in {numberOfDays} d {numberOfHours} h {numberOfMinutes} m","Label.DeleteFromInventoryConfirm":"Are you sure you want to permanently DELETE this item from your inventory?","Label.DeleteItem":"Delete Item","Label.Description":"Description","Label.DisableBadgeConfirm":"Are you sure you want to disable this Badge?","Label.DiscontinuedItem":"Discontinued item, resellable.","Label.EarnBadgeGameLink":"Earn this Badge in: {placeLink}","Label.EnableBadgeConfirm":"Are you sure you want to enable this Badge?","Label.ErrorOccurred":"Error occurred","Label.Free":"Free","Label.Genres":"Genres","Label.GetBuildersClub":"Only Builders Club members can re-sell collectible items. Get Builders Club today!","Label.GetPremiumMembership":"Only Premium members can re-sell collectible items. Get Premium today!","Label.GetPremiumSubscription":"Only Premium subscribers can re-sell collectible items. Get Premium today!","Label.InvalidPlace":"Invalid Place.","Label.InvalidProduct":"Invalid Product.","Label.ItemOwned":"Item Owned","Label.ItemOwnedAmount":"Item Owned ({amount})","Label.ItemRecentPrice":"{name}'s recent average price is {price}.","Label.MarketplaceFee":"Marketplace fee (at {percent}%)","Label.None":"None","Label.NotAvailable":"N/A","Label.OffsaleCountdownHourMinuteSecond":"Offsale in {numberOfHours} h {numberOfMinutes} m {numberOfSeconds} s","Label.PremiumDiscountOpportunityPrompt":"Get Premium and buy for {premiumDiscountedPrice}","Label.PremiumDiscountSavings":"You save {discountPercentage}% with Premium (original price: {originalPrice})","Label.PremiumExclusiveEligiblePrompt":"Available because you have Premium","Label.PremiumExclusiveIneligiblePrompt":"Available for Premium users only","Label.Price":"Price","Label.PriceIsInvalid":"Price is invalid","Label.PriceMinimumOne":"Price (minimum 1)","Label.PurchaseCompleted":"Purchase Completed","Label.Rarity":"Rarity","Label.ReadMore":"Read More","Label.RentingItem":"Renting Item","Label.Rthro":"Rthro","Label.SellConfirm":"Are you sure you want to sell {name} for {price}?","Label.SellYourCollectibleItem":"Sell Your Collectible Item","Label.SerializedLimitedRelease":"Serialized limited release, resellable.","Label.SerialNotAvailable":"Serial N/A","Label.SerialNumber":"Serial Number","Label.SerialNumberOfTotal":"Serial #{number} of {total}","Label.ShowLess":"Show Less","Label.Tags":"Tags","Label.TakeOffSale":"Take off Sale","Label.TakeOffSaleConfirm":"Are you sure you want to take the item off sale?","Label.ThirteenPlusOnly":"13+ Only.","Label.Type":"Type","Label.Updated":"Updated","Label.UpdatedBy":"(by {link})","Label.UseGamePassLink":"Use this Pass in: {placeLink}","Label.YouGet":"You get","Response.AddedToProfile":"Added to your profile","Response.AddedToYourAvater":"Added to your Avatar","Response.AlreadyHaveMaxItems":"You already have the maximum number of items on your experience!","Response.DisabledBadge":"Successfully disabled the badge","Response.EnabledBadge":"Successfully enabled the badge","Response.FailedToAddToProfile":"Failed to add to profile","Response.FailedToDeleteFromInventory":"Failed to delete item from inventory","Response.FailedToDisableBadge":"Failed to disable badge","Response.FailedToEnableBadge":"Failed to enable badge","Response.FailedToRemoveFromProfile":"Failed to remove from profile","Response.GearAddSuccess":"Added to your experience, {placeName}.","Response.GearAlreadyAdded":"You have already added this gear to {placeName}.","Response.RemovedFromInventory":"Successfully removed from your inventory","Response.RemovedFromProfile":"Removed from your profile","Response.RemovedFromYourAvater":"Removed from your Avatar"},Roblox.Lang.ItemResources=Roblox.Lang["Feature.Item"];

;// ~/Generated/js/Roblox_TranslationResources_Feature_CatalogResources_en_us_standard.js
var Roblox=Roblox||{};Roblox.Lang=Roblox.Lang||{},Roblox.Lang["Feature.Catalog"]={"Action.BuyRobux":"Buy Robux","Action.Dialog.AddGearOk":"OK","Action.Filter.Apply":"Apply","Action.Filter.Cancel":"Cancel","Action.Go":"Go","Action.ViewAllItems":"View All Items","Action.ViewFeaturedItems":"View Featured Items","Description.Dialog.AddGearBody":"To add gear to your experience, find an item in the catalog and click the Add to Experience button. The item will automatically be allowed in experience, and you'll receive a commission on every copy sold from your experience page. (You can only add gear that's for sale.)","Heading.AvatarShop":"Avatar Shop","Heading.CatalogCategory":"Category","Heading.CatalogPage":"Catalog","Label.2D":"2D","Label.3D":"3D","Label.AccessoryHead":"Head","Label.AllCommunityCreations":"All Creations","Label.AllFeaturedItems":"View All Featured Items","Label.AllGenres":"All Genres","Label.AllPremiumItems":"All Premium Items","Label.Amazon":"Amazon","Label.AppleOnly":"Apple Only","Label.BreadCrumb.Free":"Free","Label.BreadCrumb.GenreOrText":"{genreName1} or {genreName2}","Label.BreadCrumb.GenreSelectedText":"Genre: {genreCount} selected","Label.BreadCrumb.Group":"Group:","Label.BreadCrumb.PriceAbove":"{price} and above","Label.BreadCrumb.PriceBelow":"{price} and below","Label.BreadCrumb.ResultsCount":"{startNumber} - {endNumber} of {resultsCount} Results","Label.Bundle":"Bundle","Label.Bundles":"Bundles","Label.ByCreatorLink":"By {linkStart}{creator}{linkEnd}","Label.Card.CreatorBy":"By","Label.Card.PriceWas":"Was","Label.Card.Remaining":"Remaining:","Label.CategoryAttributes":"Attributes","Label.CategoryType":"Type","Label.Characters":"Characters","Label.Clothing.ClassicPants":"Classic Pants","Label.Clothing.ClassicShirts":"Classic Shirts","Label.Clothing.ClassicTShirts":"Classic T-Shirts","Label.Clothing.DressSkirtAccessories":"Dresses & Skirts","Label.Clothing.JacketAccessories":"Jackets","Label.Clothing.PantsAccessories":"Pants","Label.Clothing.ShirtAccessories":"Shirts","Label.Clothing.ShoesBundles":"Shoes","Label.Clothing.ShortsAccessories":"Shorts","Label.Clothing.SweaterAccessories":"Sweaters","Label.Clothing.TShirtAccessories":"T-Shirts","Label.ComingSoon":"Coming soon! Check back later.","Label.CommunityCreations":" Community Creations","Label.Dialog.AddGearTitle":"Add Gear to Your Experience","Label.Emotes":"Emotes","Label.Favorites":"Favorites","Label.FeaturedBundles":"Featured Bundles","Label.FeaturedEmotes":"Featured Emotes","Label.FeaturedItemsOnRoblox":"Featured Items on {spanStart}{roblox}{spanEnd}","Label.Filter.ByTime":"By Time","Label.Filter.Category":"Category","Label.Filter.Creator":"Creator","Label.Filter.Filter":"Filter","Label.Filter.Filters":"Filters","Label.Filter.Genre":"Genre","Label.Filter.Hide":"Hide","Label.Filter.Price":"Price","Label.Filter.PriceMax":"Max","Label.Filter.PriceMin":"Min","Label.Filter.PriceTo":"To","Label.Filter.Show":"Show","Label.Filter.Sorting":"Sorting","Label.Filter.UnavailableItems":"Unavailable Items","Label.GoogleOnly":"Google Only","Label.Ios":"iOS","Label.Mobile":"Mobile","Label.New":"New","Label.Premium":"Premium","Label.Recommended":"Recommended","Label.RecommendedItemsForYou":"Recommended Items for You","Label.Rthro":"Rthro","Label.Sale":"Sale","Label.SearchField":"Search","Label.SeeAll":"See All","Label.TakeOff":"Take Off","Label.TryOn":"Try On","Label.Username":"Username","Label.Xbox":"Xbox",LabelAccessories:"Accessories",LabelAccessoryAll:"All Accessories",LabelAccessoryBack:"Back",LabelAccessoryFace:"Face",LabelAccessoryFront:"Front",LabelAccessoryHair:"Hair",LabelAccessoryHats:"Hats",LabelAccessoryNeck:"Neck",LabelAccessoryShoulder:"Shoulder",LabelAccessoryWaist:"Waist",LabelAll:"All",LabelAllAvatarAnimations:"All Animations",LabelAllBodyParts:"All Body Parts",LabelAllCategories:"All Categories",LabelAllClothing:"All Clothing",LabelAllCollectibles:"All Collectibles",LabelAllCreators:"All Creators",LabelAllCurrency:"All Currency",LabelAllFeatured:"All Featured Items",LabelAllTime:"All Time",LabelAnimations:"Animations",LabelAnyPrice:"Any Price",LabelAvatarAnimations:"Avatar Animations",LabelBestselling:"Bestselling",LabelBodyParts:"Body Parts",LabelClothing:"Clothing",LabelCollectibleAccessories:"Collectible Accessories",LabelCollectibleFaces:"Collectible Faces",LabelCollectibleGear:"Collectible Gear",LabelCollectibles:"Collectibles",LabelFaces:"Faces",LabelFeatured:"Featured",LabelFeaturedAccesories:"Featured Accessories",LabelFeaturedAnimations:"Featured Animations",LabelFeaturedFaces:"Featured Faces",LabelFeaturedGear:"Featured Gear",LabelFeaturedPackages:"Featured Packages",LabelFree:"Free",LabelGear:"Gear",LabelGearAll:"All Gear",LabelGearBuilding:"Building",LabelGearExplosive:"Explosive",LabelGearMelee:"Melee",LabelGearMusical:"Musical",LabelGearNavigation:"Navigation",LabelGearPersonalTransport:"Transport",LabelGearPowerUps:"Power Up",LabelGearRanged:"Ranged",LabelGearSocial:"Social",LabelGenreAdventure:"Adventure",LabelGenreAll:"All Genres",LabelGenreBuilding:"Building",LabelGenreComedy:"Comedy",LabelGenreFantasy:"Medieval",LabelGenreFighting:"Fighting",LabelGenreFPS:"FPS",LabelGenreFunny:"Comedy",LabelGenreHorror:"Horror",LabelGenreMedieval:"Medieval",LabelGenreMilitary:"Military",LabelGenreNaval:"Naval",LabelGenreNinja:"Fighting",LabelGenrePirate:"Naval",LabelGenreRPG:"RPG",LabelGenreScary:"Horror",LabelGenreSciFi:"Sci-Fi",LabelGenreSports:"Sports",LabelGenreTownAndCity:"Town and City",LabelGenreTutorial:"Building",LabelGenreWar:"Military",LabelGenreWestern:"Western",LabelGenreWildWest:"Western",LabelHeads:"Heads",LabelMostFavorited:"Most Favorited",LabelNoResellers:"No Resellers",LabelOffSale:"Offsale",LabelPackages:"Packages",LabelPants:"Pants",LabelPastDay:"Past Day",LabelPastWeek:"Past Week",LabelPriceHighFirst:"Price (High to Low)",LabelPriceLowFirst:"Price (Low to High)",LabelRecentlyUpdated:"Recently Updated",LabelRelevance:"Relevance",LabelRoblox:"Roblox",LabelRobux:"Robux",LabelShirts:"Shirts",LabelTShirts:"T-Shirts","Response.Error.Filter":"Errors exist in Filter tab","Response.GenericError":"An error occurred. Please try again later.","Response.NoItemsFound":"No items found.","Response.NoSaleItemsFromSearch":"Your search did not find items for sale. Unavailable items displayed below.","Response.PlacedOnSaleFailure":"Failed to place on sale","Response.PlacedOnSaleSuccess":"Successfully placed on sale","Response.TakenOffSaleFailure":"Failed to take off sale","Response.TakenOffSaleSuccess":"Successfully taken off sale","Response.TemporarilyUnavailable":"Catalog temporarily unavailable. Please try again later.","Response.Throttled":"You're going too fast! Try again in a minute."},Roblox.Lang.CatalogResources=Roblox.Lang["Feature.Catalog"];

;// ~/Generated/js/Roblox_TranslationResources_Purchasing_PurchaseDialogResources_en_us_standard.js
var Roblox=Roblox||{};Roblox.Lang=Roblox.Lang||{},Roblox.Lang["Purchasing.PurchaseDialog"]={"Action.BuyAccess":"Buy Access","Action.BuyNow":"Buy Now","Action.BuyRobux":"Buy Robux","Action.Cancel":"Cancel","Action.Configure":"Configure","Action.Continue":"Continue","Action.Customize":"Customize","Action.GetNow":"Get Now","Action.GoToSecurity":"Go To Security","Action.GoToSettings":"Go to Settings","Action.NotNow":"Not Now","Action.Ok":"OK","Action.RentNow":"Rent Now","Action.ResendCode":"Resend Code","Action.Verify":"Verify","Heading.BuyItem":"Buy Item","Heading.ErrorOccured":"Error Occured","Heading.GetItem":"Get Item","Heading.InsufficientFunds":"Insufficient Funds","Heading.PriceChanged":"Item Price Has Changed","Heading.PurchaseComplete":"Purchase Complete","Heading.RentItem":"Rent Item","Heading.TwoStepVerificationRequired":"Email Verification Required","Heading.TwoStepVerificationRequiredV2":"Email Verification Required","Heading.TwoStepVerificationRequiredV3":"2-Step Verification Required","Label.AgreeAndPay":"Agree and Pay","Label.CodeInputPlaceholder":"Enter 6-digit Code","Label.EnterEmailCode":"Enter the code we just sent you via email","Label.Free":"Free","Label.NeedHelpContactRobloxSupport":"Need help? Contact Roblox Support","Label.NeedHelpContactSupport":"Need help? Contact {supportLink}","Label.RobloxSupport":"Roblox Support","Label.TwoStepVerification":"2-Step Verification","Message.BalanceAfter":"Your balance after this transaction will be {robuxBalance}.","Message.InsufficientFunds":"You need {robux} more to purchase this item.","Message.PriceChanged":"While you were shopping, the price of this item changed from {robuxBefore} to {robuxAfter}.","Message.PromptBuy":'Would you like to buy the {assetType} "{assetName}" from {seller} for {robux}?',"Message.PromptBuyAccess":'Would you like to buy access to the {assetType} "{assetName}" from {seller} for {robux}?',"Message.PromptGetFree":'Would you like to get the {assetType} "{assetName}" from {seller} for {freeTextStart}Free{freeTextEnd}?',"Message.PromptGetFreeAccess":'Would you like to get access to the {assetType} "{assetName}" from {seller} for {freeTextStart}Free{freeTextEnd}?',"Message.PromptRent":'Would you like to rent the {assetType} "{assetName}" from {seller} for {robux}?',"Message.PromptRentAccess":'Would you like to rent access to the {assetType} "{assetName}" from {seller} for {robux}?',"Message.PurchasingUnavailable":"Purchasing is temporarily unavailable. Please try again later.","Message.SuccessfullyAcquired":"You have successfully acquired the {assetName} {assetType} from {seller} for {robux}.","Message.SuccessfullyAcquiredAccess":"You have successfully acquired access to the {assetName} {assetType} from {seller} for {robux}.","Message.SuccessfullyBought":"You have successfully bought the {assetName} {assetType} from {seller} for {robux}.","Message.SuccessfullyBoughtAccess":"You have successfully bought access to the {assetName} {assetType} from {seller} for {robux}.","Message.SuccessfullyRenewed":"You have successfully renewed the {assetName} {assetType} from {seller} for {robux}.","Message.SuccessfullyRenewedAccess":"You have successfully renewed access to the {assetName} {assetType} from {seller} for {robux}.","Message.SuccessfullyRented":"You have successfully rented the {assetName} {assetType} from {seller} for {robux}.","Message.SuccessfullyRentedAccess":"You have successfully rented access to the {assetName} {assetType} from {seller} for {robux}.","Message.TwoStepVerificationRequired":"2-Step Verification is required to make further transactions. Go to Settings > Security to complete 2-Step Verification.","Message.TwoStepVerificationRequiredv2":"2-Step Verification is required to make further transactions. Go to your Security page to enable and complete 2-Step Verification via email.","Message.TwoStepVerificationRequiredV3":"2-Step Verification is required to make further transactions. Go to your Security page to enable and complete 2-Step Verification via email.","Message.TwoStepVerificationRequiredV4":"2-Step Verification is required to make further transactions. Go to your Security page to enable and complete 2-Step Verification.","Response.CodeSent":"Code Sent","Response.InvalidCode":"Invalid code. Please try again.","Response.InvalidCodeTryAgain":"Invalid code. Please try again.","Response.SuccessfulVerification":"You have successfully verified!","Response.SuccessfulVerificationV2":"You have successfully verified! Please retry your previous action.","Response.VerificationError":"System error occurred during verification."},Roblox.Lang.PurchaseDialogResources=Roblox.Lang["Purchasing.PurchaseDialog"];

;// Item/ContextMenu.js
var Roblox=Roblox||{};Roblox.ContextMenu=function(){function k(){var t=$("#sell-content-wrapper"),n=t.find(".sell-price").val(),i=t.find(".price-form"),u=i.find(".form-control-label"),f=t.find(".commission"),e=t.find(".after-commission");if(!$.isNumeric(n)||Math.floor(n)!=n||n<=0)return i.addClass("form-has-error"),u.removeClass("invisible"),f.text(""),e.text(""),!1;i.removeClass("form-has-error"),u.addClass("invisible");var o=Math.round(n*h),r=o>1?o:1,s=n-r;return f.text(r>0?Roblox.NumberFormatting.commas(r):""),e.text(s>=0?Roblox.NumberFormatting.commas(s):""),!0}function e(n){a.text(n),Roblox.BootstrapWidgets.ToggleSystemMessage(a,c,l)}function r(n){o.text(n),Roblox.BootstrapWidgets.ToggleSystemMessage(o,c,l)}function g(n){e(n),setTimeout(function(){window.location.reload()},1e3)}function y(n,t,i,r,u){e(n);var f=$(".rbx-popover-content").find(i);t?f.attr("data-toggle","False").text(r):f.attr("data-toggle","True").text(u)}function d(){var u=$("#sell-content-wrapper"),t=u.find($(".sell-price")).val();if(!$.isNumeric(t)||Math.floor(t)!=t||t<=0)return!1;var f=parseInt($(".below-market-warning").attr("data-low-price-warning-percentage")),i=parseInt($("#item-average-price").text().replace(/,/g,"")),e=i*f/100,r=Number($("#sell-content-wrapper .serial-dropdown").val());return t<i-e?Roblox.Dialog.open({titleText:n.sellYourCollectibleItem,bodyContent:$("#confirm-sell-modal").clone().attr("id","confirm-sell-content-wrapper").removeClass("hidden"),onAccept:function(){Roblox.Resellers.sellItem(t,r)},fieldValidationRequired:!0,allowHtmlContentInBody:!0,acceptText:n.yes,declineText:n.cancel,xToCancel:!0,onOpenCallback:function(){var n=$("#confirm-sell-content-wrapper");n.find(".attempted-sell-price").text(Roblox.NumberFormatting.commas(parseInt(t))),n.find(".average-price").text(Roblox.NumberFormatting.commas(parseInt(i)))}}):(Roblox.Dialog.close(),Roblox.Resellers.sellItem(t,r)),!1}function tt(n,t){return n===v.badge?$.ajax({type:"DELETE",url:Roblox.EnvironmentUrls.badgesApi+"/v1/user/badges/"+t}):i.data("delete-url")?$.post(i.data("delete-url"),{id:i.data("delete-id")}):$.post("/asset/delete-from-inventory",{assetId:t})}function b(){f||Roblox.Dialog.open({titleText:n.deleteItem,bodyContent:n.deleteFromInventoryConfirm,onAccept:function(){f||(f=!0,tt(i.data("itemType"),i.data("itemId")).done(function(t){!t.hasOwnProperty("isValid")||t.isValid?g(n.removedFromInventory):r(n.failedToDeleteFromInventory)}).fail(function(){r(n.failedToDeleteFromInventory)}).always(function(){f=!1}))},xToCancel:!0,allowHtmlContentInBody:!0})}function w(){var t=$(".popover-content").find(".toggle-profile").attr("data-toggle")==="True",i=$("#item-container").attr("data-item-type"),u=$("#item-container").attr("data-item-id"),f=$("#item-container").attr("data-is-inventory-api-add-to-profile-enabled")==="true";$("#item-context-menu").find(".rbx-menu-item").popover("hide"),f?$.ajax({type:t?"DELETE":"POST",url:Roblox.EnvironmentUrls.inventoryApi+"/v1/collections/items/"+i+"/"+u,success:function(){var i=t?n.removedFromProfile:n.addedToProfile;y(i,t,".toggle-profile",n.addToProfile,n.removeFromProfile)},error:function(i){var u=t?n.failedToRemoveFromProfile:n.failedToAddToProfile;r(i.responseJSON.errors&&i.responseJSON.errors.length>0?i.responseJSON.errors[0].message:u)}}):i===v.asset&&$.post("/asset/toggle-profile",{assetId:u,addToProfile:!t},function(i){var u;i.isValid?(u=t?n.removedFromProfile:n.addedToProfile,y(u,t,".toggle-profile",n.addToProfile,n.removeFromProfile)):(u=t?n.failedToRemoveFromProfile:n.failedToAddToProfile,r(i.error?i.error:u))})}function p(){if(!u){u=!0;var t=$(".popover-content .toggle-wear").data("toggle");$("#item-context-menu").find(".rbx-menu-item").popover("hide"),$.ajax({type:"POST",url:i.data(t?"avatar-remove-url":"avatar-wear-url"),success:function(){$(".rbx-popover-content .toggle-wear").attr("data-toggle",!t).text(t?n.wear:n.takeOff),e(t?n.removedFromYourAvater:n.addedToYourAvater),u=!1},error:function(t){u=!1;var i=t.responseJSON.errors&&t.responseJSON.errors.length>0?t.responseJSON.errors[0].message:n.errorOccured;r(i)}})}}function nt(){Roblox.Dialog.open({titleText:n.takeOffSale,bodyContent:$("#take-off-sale-modal-content").clone().attr("id","take-off-sale-content-wrapper").removeClass("hidden"),onAccept:function(){var n=Number($("#take-off-sale-content-wrapper .serial-dropdown").val());Roblox.Resellers.takeItemOffSale(n)},fieldValidationRequired:!0,allowHtmlContentInBody:!0,acceptText:n.takeOffSale,declineText:n.cancel,xToCancel:!0})}function it(){var t=$("#ItemPurchaseAjaxData");t.attr("data-user-bc")=="0"?Roblox.Dialog.open({titleText:n.sellYourCollectibleItem,bodyContent:n.getPremiumMembership,onAccept:function(){window.location=Roblox.Endpoints.getAbsoluteUrl("/premium/membership")},acceptText:n.upgrade,declineText:n.cancel,xToCancel:!0}):($("#sell-modal-content").find(".form-control-label").addClass("invisible"),Roblox.Dialog.open({titleText:n.sellYourCollectibleItem,bodyContent:$("#sell-modal-content").clone().attr("id","sell-content-wrapper").removeClass("hidden"),onAccept:d,fieldValidationRequired:!0,allowHtmlContentInBody:!0,acceptText:n.sellNow,declineText:n.cancel,xToCancel:!0}))}var t=Roblox.Lang.ItemResources,v={badge:"Badge",bundle:"Bundle",asset:"Asset"},n={removedFromProfile:t["Response.RemovedFromProfile"],addedToProfile:t["Response.AddedToProfile"],failedToRemoveFromProfile:t["Response.FailedToRemoveFromProfile"],failedToAddToProfile:t["Response.FailedToAddToProfile"],addToProfile:t["Action.AddToProfile"],removeFromProfile:t["Action.RemoveFromProfile"],removedFromYourAvater:t["Response.RemovedFromYourAvater"],addedToYourAvater:t["Response.AddedToYourAvater"],wear:t["Action.Wear"],takeOff:t["Action.TakeOff"],errorOccured:t["Label.ErrorOccurred"],removedFromInventory:t["Response.RemovedFromInventory"],failedToDeleteFromInventory:t["Response.FailedToDeleteFromInventory"],deleteItem:t["Label.DeleteItem"],deleteFromInventoryConfirm:t["Label.DeleteFromInventoryConfirm"],takeOffSale:t["Label.TakeOffSale"],cancel:t["Action.Cancel"],sellYourCollectibleItem:t["Label.SellYourCollectibleItem"],upgrade:t["Action.Upgrade"],sellNow:t["Action.SellNow"],getPremiumMembership:t["Label.GetPremiumSubscription"],yes:t["Action.Yes"]},rt=!1,f=!1,a=$(".content .alert-success"),l=2e3,c=100,h=.25,s=$("#sell-modal-content .commission-label").data("rate"),i=$("#item-container"),o=$(".content .alert-warning"),u;return $.isNumeric(s)&&(h=s),u=!1,{ClickProfileButton:w,ClickWearButton:p,showRemoveFromInventoryDialog:b,TakeOffSaleDialog:nt,ValidateResellInput:k,SellDialog:it}}(),$(function(){$("body").on("keyup",".sell-price",function(){Roblox.ContextMenu.ValidateResellInput()});$("#item-context-menu").on("click",".popover-content .toggle-wear",function(n){n.preventDefault(),Roblox.ContextMenu.ClickWearButton()});$("#item-context-menu").on("click",".popover-content .toggle-profile",function(n){n.preventDefault(),Roblox.ContextMenu.ClickProfileButton()});$("#item-context-menu").on("click",".popover-content #delete-item",function(){Roblox.ContextMenu.showRemoveFromInventoryDialog()});$("#item-context-menu").on("click",".popover-content #sell",function(){Roblox.ContextMenu.SellDialog()});$("#item-context-menu").on("click",".popover-content #take-off-sale",function(){Roblox.ContextMenu.TakeOffSaleDialog()})});

;// utilities/robloxAds.js
"use strict";var Roblox=Roblox||{};Roblox.AdsHelper=Roblox.AdsHelper||{},Roblox.AdsLibrary={},Roblox.AdsLibrary.adsIdList=["Skyscraper-Abp-Left","Skyscraper-Abp-Right","Leaderboard-Abp","GamePageAdDiv1","GamePageAdDiv2","GamePageAdDiv3","ProfilePageAdDiv1","ProfilePageAdDiv2"],Roblox.AdsLibrary.adsParameters={"Skyscraper-Abp-Left":{element:$("#Skyscraper-Abp-Left"),template:null,fitTwoAds:!0,fitOneAd:!1,isSkyscraper:!0},"Skyscraper-Abp-Right":{element:$("#Skyscraper-Abp-Right"),tempalte:null,fitTwoAds:!0,fitOneAd:!0,isSkyscraper:!0},"Leaderboard-Abp":{element:$("#Leaderboard-Abp"),tempalte:null,fitTwoAds:!0,fitOneAd:!0,isLeaderboard:!0},GamePageAdDiv1:{element:$("#GamePageAdDiv1"),template:null,isPageAd:!0},GamePageAdDiv2:{element:$("#GamePageAdDiv2"),template:null,isPageAd:!0},GamePageAdDiv3:{element:$("#GamePageAdDiv3"),template:null,isPageAd:!0},ProfilePageAdDiv1:{element:$("#ProfilePageAdDiv1"),template:null,isPageAd:!0},ProfilePageAdDiv2:{element:$("#ProfilePageAdDiv2"),template:null,isPageAd:!0}},Roblox.AdsHelper.AdRefresher=function(){function c(n){return!n||!$.trim($(n).html())}function h(n){t.push(n)}function s(){return googletag.pubadsReady}function r(n){var u,f,e,i;typeof n=="undefined"&&(n=v),u=!1;for(f in t){if(e="#"+t[f]+" [data-js-adtype]",i=$(e),typeof i=="undefined")return;if(i.attr("data-js-adtype")==="iframead")o(i);else if(i.attr("data-js-adtype")==="gptAd")if(s())u=!0;else if(n>0){setTimeout(function(){r(--n)},y);break}}u&&googletag.cmd.push(function(){googletag.pubads().refresh()})}function o(n){var i=n.attr("src"),r,u,t;typeof i=="string"&&(r=i.indexOf("?")<0?"?":"&",u=i+r+"nocache="+(new Date).getMilliseconds().toString(),typeof n[0]!="undefined")&&(t=n[0].contentDocument,t===undefined&&(t=n[0].contentWindow),t&&t.location.href!=="about:blank"&&t.location.replace(u))}function n(n,t,i){i.length&&c(i)&&(i.append(n),r())}function b(){for(var u=$(window).width(),f,r,t,i=0;i<Roblox.AdsLibrary.adsIdList.length;i++)r=Roblox.AdsLibrary.adsIdList[i],t=Roblox.AdsLibrary.adsParameters[r],t&&!t.template&&(f=t.element,t.template=f.html());for(i=0;i<Roblox.AdsLibrary.adsIdList.length;i++)(r=Roblox.AdsLibrary.adsIdList[i],t=Roblox.AdsLibrary.adsParameters[r],t)&&(t.isSkyscraper?u>=e&&t.fitTwoAds?n(t.template,r,t.element):u<e&&u>=l?t.fitOneAd?n(t.template,r,t.element):t.element.empty():t.element.empty():t.isLeaderboard?u<p?t.element.empty():n(t.template,r,t.element):t.isPageAd&&(u<w?t.element.empty():n(t.template,r,t.element)))}var t=[],i=20,u=970,f=160,p=728,y=100,v=16,e=$("[data-max-width-for-two-ads]").attr("data-max-width-for-two-ads")||u+f*2+48-i,l=$("[data-max-width-for-one-ads]").attr("data-max-width-for-one-ads")||u+f+24-i,a=1024,w=a-i;return{registerAd:h,refreshAds:r,adjustAdsFitScreen:b,getAds:n}}(),Roblox.AdsHelper.DynamicAdCreator=function(){function n(){var n=$(".dynamic-ad").filter(".unpopulated");n.each(function(n,t){var i=$(t),u=i.attr("data-ad-slot"),f=parseInt(i.attr("data-ad-width")),e=parseInt(i.attr("data-ad-height")),r=i.children(".ad-slot").attr("id");googletag.cmd.push(function(){var n=googletag.defineSlot(u,[f,e],r).addService(googletag.pubads());googletag.display(r),googletag.pubads().refresh([n])}),i.removeClass("unpopulated")})}return{populateNewAds:n}}(),$(function(){$(window).resize(function(){Roblox.AdsHelper.AdRefresher.adjustAdsFitScreen()})});

;// NumberFormatting.js
typeof Roblox=="undefined"&&(Roblox={}),typeof Roblox.NumberFormatting=="undefined"&&(Roblox.NumberFormatting=function(){var n=function(n){if(typeof n!="number")throw"'number' is not a number";return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},t=function(n){var t;if(typeof n!="number")throw"'number' is not a number";var i=1e3,r=1e6,u=1e9;return n<=0?"0":n<i?n:n<r?(t=Math.round(n/i*10)/10,t>=i)?Math.round(t/i*10)/10+"M":t+"K":n<u?(t=Math.round(n/r*10)/10,t>=i)?Math.round(t/i*10)/10+"B":t+"M":Math.round(n/u*10)/10+"B"},i=function(t){var i,r,u;if(typeof t!="number")throw"'number' is not a number";var f=1e4,e=1e6,o=1e9;return t==0?"0":t<f?n(t):(i="B+",r=9,t<e?(i="K+",r=3):t<o&&(i="M+",r=6),u=t.toString(),u.substring(0,u.length-r)+i)};return{abbreviatedFormat:i,commas:n,abbreviate:t}}());

;// ItemPurchaseForDialog/ItemPurchaseForDialog.js
var Roblox=Roblox||{};Roblox.ItemPurchase=function(n,t,i){function h(n){n+="";for(var i=n.split("."),t=i[0],u=i.length>1?"."+i[1]:"",r=/(\d+)(\d{3})/;r.test(t);)t=t.replace(r,"$1,$2");return t+u}function nt(n){return n<1?n+"":n<1e4?h(n):n>=1e6?Math.floor(n/1e6)+"M+":Math.floor(n/1e3)+"K+"}function l(){window.location.href=Roblox.Endpoints.getAbsoluteUrl("/login/Default.aspx")+"?ReturnUrl="+encodeURIComponent(location.pathname+location.search)}function it(n){return n.toLowerCase()===a.toLowerCase()?a:n}function rt(n){if(!Roblox)return null;var i=Roblox.CurrentUser?Roblox.CurrentUser.userId:null,t=Roblox.UrlParser.getParametersAsObject();return{assetId:n,category:t.Category,creatorId:t.CreatorId,genre:t.GenreCsv,page:t.Page,position:t.Position,searchKeyword:t.SearchKeyword,sortAggregation:t.SortAggregation,sortType:t.SortType,userId:i,searchId:t.SearchId}}function s(n,u){var f=$(n),e;if(f.attr("data-modal-field-validation-required")==="true"&&(u=""),Roblox.Dialog.toggleProcessing(!0),!f.hasClass("btn-disabled-primary")){var c=f.attr("data-product-id"),l=parseInt(f.attr("data-expected-price")),a=f.attr("data-expected-currency"),s=f.attr("data-placeproductpromotion-id"),p=f.attr("data-expected-seller-id"),h=f.attr("data-userasset-id"),b=Roblox.MetaDataValues&&Roblox.MetaDataValues.getPageName()||"",k=b=="LibraryItem";if(t)return t({productId:c,expectedPrice:l,expectedCurrency:a,expectedPromoId:s,expectedSellerId:p,userAssetId:h});e={expectedCurrency:parseInt(a),expectedPrice:parseInt(l),expectedSellerId:parseInt(p)},s&&(e.expectedPromoId=parseInt(s)),h&&(e.userAssetId=parseInt(h)),$.ajax({type:"POST",url:Roblox.EnvironmentUrls.economyApi+"/v1/purchases/products/"+c,data:JSON.stringify(e),cache:!1,processData:!1,contentType:"application/json; charset=utf-8",success:function(n){if(n.statusCode===500)Roblox.Dialog.toggleProcessing(!1,u),n.showDivID===undefined&&(n.showDivID=n.showDivId),n.AssetID===undefined&&(n.AssetID=n.assetId),o(n);else{if(Roblox.Dialog.toggleProcessing(!1,u),k&&Roblox&&Roblox.EventStream&&Roblox.UrlParser){var t=rt(n.assetId);Roblox.EventStream.SendEventWithTarget("LibraryAssetAcquired","Marketplace",t,Roblox.EventStream.TargetTypes.WWW)}i?w():(n={AssetId:n.assetId,AssetIsWearable:n.assetIsWearable,AssetName:n.assetName,AssetType:n.assetType,AssetTypeDisplayName:n.assetTypeDisplayName,Currency:n.currency,IsMultiPrivateSale:n.isMultiPrivateSale,Price:n.price,ProductId:n.productId,Purchased:n.purchased,Reason:n.reason,SellerName:n.sellerName,TransactionVerb:n.transactionVerb},v(n))}},error:function(n){if(Roblox.Dialog.toggleProcessing(!1,u),$.modal.close(".ProcessingView"),n.responseText==="Bad Request")Roblox.Dialog.open({titleText:r["Heading.ErrorOccured"],bodyContent:r["Message.PurchasingUnavailable"],imageUrl:y,acceptText:r["Action.Ok"],acceptColor:Roblox.Dialog.white,declineColor:Roblox.Dialog.none,dismissable:!0,allowHtmlContentInBody:!0});else{var t=$.parseJSON(n.responseText);o(t)}}})}}function o(n){var i,t;if(n.showDivID==="TransactionFailureView")Roblox.Dialog.open({titleText:n.title,bodyContent:n.errorMsg,imageUrl:y,acceptText:r["Action.Ok"],acceptColor:Roblox.Dialog.white,declineColor:Roblox.Dialog.none,dismissable:!0,allowHtmlContentInBody:!0});else if(n.showDivID==="InsufficientFundsView")i="<span class='icon-robux-16x16'></span><span class='text-robux'>"+Roblox.NumberFormatting.commas(n.shortfallPrice)+"</span>",Roblox.Dialog.open({titleText:r["Heading.InsufficientFunds"],bodyContent:e.f(r["Message.InsufficientFunds"],{robux:i}),declineText:r["Action.Cancel"],acceptText:r["Action.BuyRobux"],acceptColor:Roblox.Dialog.green,onAccept:function(){return window.location=Roblox.Endpoints.getAbsoluteUrl("/Upgrades/Robux.aspx")+"?ctx="+n.source,!1},imageUrl:d,allowHtmlContentInBody:!0,allowHtmlContentInFooter:!1,fieldValidationRequired:!0,dismissable:!0,xToCancel:!0});else if(n.showDivID==="PriceChangedView"){t="targetSelector"in n?$(n.targetSelector):$(".PurchaseButton[data-item-id="+n.AssetID+"][data-expected-currency="+n.expectedCurrency+"][data-expected-price="+n.expectedPrice+"]");var u=function(){t.attr("data-expected-price",n.currentPrice),t.attr("data-expected-currency",n.currentCurrency),s(t,"PurchaseVerificationView")},f="<span class='icon-robux-gray-16x16'></span>"+n.expectedPrice,o="<span class='icon-robux-gray-16x16'></span>"+n.currentPrice,h="<span class='icon-robux-gray-16x16'></span>"+n.balanceAfterSale;Roblox.Dialog.open({titleText:r["Heading.PriceChanged"],bodyContent:e.f(r["Message.PriceChanged"],{robuxBefore:f,robuxAfter:o}),acceptText:r["Action.BuyNow"],acceptColor:Roblox.Dialog.green,onAccept:u,declineText:r["Action.Cancel"],footerText:e.f(r["Message.BalanceAfter"],{robuxBalance:h}),allowHtmlContentInBody:!0,allowHtmlContentInFooter:!0,dismissable:!0,checkboxAgreementText:r["Label.AgreeAndPay"],checkboxAgreementRequired:!0})}else n.showDivID==="TwoStepVerificationRequiredView"&&g.start()}function ft(n,t){var i,vt,kt,bt,v,pt,w,f,a,at,lt,ni,ti;if(t=typeof t!="undefined"?t:"item",i=$(n),!i.hasClass("btn-disabled-primary")){if(et){o({showDivID:"TransactionFailureView",title:"Error",errorMsg:ot});return}if(k==="True"&&(vt=i.attr("data-bc-requirement"),vt>tt&&p==="False")){showBCOnlyModal("BCOnlyModal");return}var yt=i.attr("data-item-name"),fi=yt?yt.escapeHTML():"",d=parseInt(i.attr("data-expected-price")),ui=i.attr("data-expected-currency"),ii=it(i.attr("data-seller-name")).escapeHTML(),g=i.attr("data-asset-type"),oi=i.attr("data-asset-type-display-name");(g===0||g==="0")&&(g=i.attr("data-item-type"));var ei=i.attr("data-item-id"),gt=$("#ItemPurchaseAjaxData").attr("data-footer-text"),ct=gt==null?"":gt;if($("#ItemPurchaseAjaxData").attr("data-footer-text",null),u=g=="Place",p==="True"){l();return}var wt=i.hasClass("rentable"),st=parseInt(ut)-d,ht="",rt="",dt="",nt="";if(wt?(ht=c.rent,rt=r["Heading.RentItem"],nt=r["Action.RentNow"]):d===0?(ht=c.get,rt=r["Heading.GetItem"],nt=r["Action.GetNow"]):(ht=c.buy,rt=r["Heading.BuyItem"],nt=r["Action.BuyNow"]),st<0){kt={shortfallPrice:0-st,currentCurrency:ui,showDivID:"InsufficientFundsView",isPlace:u,source:t},o(kt);return}var ri=$("#ItemPurchaseAjaxData").attr("data-imageurl"),ft="<span class='icon-robux-16x16'></span><span class='text-robux'>"+Roblox.NumberFormatting.commas(d)+"</span>",y="";y+=h(st),bt=function(){return s(n,"PurchaseVerificationView")},v=i.attr("data-purchase-title-text"),v=v?v:rt,pt="<span class='font-bold'>"+fi+"</span>",f={assetName:pt,assetType:oi,seller:ii},wt?(w=u?"Message.PromptRentAccess":"Message.PromptRent",f.robux=ft):d===0?(w=u?"Message.PromptGetFreeAccess":"Message.PromptGetFree",f.freeTextStart="<span class='text-robux'>",f.freeTextEnd="</span>"):(w=u?"Message.PromptBuyAccess":"Message.PromptBuy",f.robux=ft),dt=e.f(r[w],f),a=i.attr("data-purchase-body-content"),at=dt,a=a?a.format(ft):at,lt=i.attr("data-modal-field-validation-required")==="true",ni=r["Action.BuyAccess"],ct.length===0&&(y="<span class='icon-robux-gray-16x16'></span>"+y),ti=e.f(r["Message.BalanceAfter"],{robuxBalance:y}),Roblox.Dialog.open({titleText:v,bodyContent:a,imageUrl:ri,xToCancel:!0,acceptText:u?ni:nt,acceptColor:Roblox.Dialog.green,onAccept:bt,declineText:r["Action.Cancel"],footerText:ct.length===0?ti:ct.format(y),footerMiddleAligned:b,allowHtmlContentInBody:!0,allowHtmlContentInFooter:!0,dismissable:!0,fieldValidationRequired:lt,cssClass:"need-padding",onOpenCallback:function(){if($(".modal-confirmation .roblox-item-image").attr("data-item-id",ei),Roblox.require("Widgets.ItemImage",function(n){n.load($(".modal-confirmation .roblox-item-image"))}),Roblox.ModalEvents&&i){var n=i.attr("data-button-type");n&&Roblox.ModalEvents.SendAssetPurchaseConfirmationShown("assetPurchaseConfirmation",n)}}})}}function w(){var n=$(".system-feedback .alert-success");n.length>0&&Roblox.BootstrapWidgets&&(Roblox.BootstrapWidgets.ToggleSystemMessage(n,100,1e3),setTimeout(function(){window.location.reload()},1e3))}function v(t){var f,l,a;t.Price==0?(l=r["Label.Free"],f="<span class='text-robux'>"+l+"</span>"):f="<span class='icon-robux-16x16'></span><span class='text-robux'>"+t.Price+"</span>";var v=$("#ItemPurchaseAjaxData").attr("data-imageurl"),y=function(){var n=$("#ItemPurchaseAjaxData").attr("data-continueshopping-url");n!=undefined&&n!=""&&(document.location.href=n)},p=function(){var n=Roblox.Endpoints.getAbsoluteUrl("/my/avatar");n!=undefined&&n!=""&&(document.location.href=n)},o="",s=r["Action.Continue"],h=Roblox.Dialog.none,c;t.AssetType==="Private Server"?(o=r["Action.Configure"],s=r["Action.NotNow"],h=Roblox.Dialog.blue,c=y):t.AssetIsWearable&&(o=r["Action.Customize"],h=Roblox.Dialog.white,s=r["Action.NotNow"],c=p);var w="<span class='font-bold'>"+t.AssetName.escapeHTML()+"</span>",b=t.AssetTypeDisplayName?t.AssetTypeDisplayName:t.AssetType,k={assetName:w,assetType:b,seller:t.SellerName.escapeHTML(),robux:f},i;i=t.TransactionVerb==="bought"?u?"Message.SuccessfullyBoughtAccess":"Message.SuccessfullyBought":t.TransactionVerb==="rented"?u?"Message.SuccessfullyRentedAccess":"Message.SuccessfullyRented":t.TransactionVerb==="renewed"?u?"Message.SuccessfullyRenewedAccess":"Message.SuccessfullyRenewed":u?"Message.SuccessfullyAcquiredAccess":"Message.SuccessfullyAcquired",a=e.f(r[i],k),Roblox.Dialog.open({titleText:r["Heading.PurchaseComplete"],bodyContent:a,imageUrl:v,acceptText:o,declineText:s,xToCancel:!0,onAccept:c,onDecline:function(){window.location.reload()},acceptColor:h,declineColor:Roblox.Dialog.white,allowHtmlContentInBody:!0,dismissable:!0,onOpenCallback:function(){$(".modal-confirmation .roblox-item-image").html("").attr("data-item-id",t.AssetId),Roblox.require("Widgets.ItemImage",function(n){n.load($(".modal-confirmation .roblox-item-image"))})}}),n(t)}if(!(this instanceof Roblox.ItemPurchase))return new Roblox.ItemPurchase(n,t,i);t=typeof t=="undefined"?!1:t;var e=new Roblox.Intl,r=Roblox.Lang.PurchaseDialogResources,f=$("#ItemPurchaseAjaxData"),p=f.attr("data-authenticateduser-isnull"),ut=f.attr("data-user-balance-robux"),tt=f.attr("data-user-bc"),y=f.attr("data-alerturl"),d=f.attr("data-inSufficentFundsurl"),k=f.attr("data-is-bc-only-requirement-enabled"),u=!1,et=f.attr("data-has-currency-service-error")==="True",ot=f.attr("data-currency-service-error-message"),b=f.attr("data-is-modal-footer-centered-enabled")==="True",a="Roblox",c={buy:"buy",rent:"rent",get:"get"},g=new Roblox.TwoStepVerificationFlow("RobuxSpend");return{purchaseItem:s,openPurchaseVerificationView:ft,openPurchaseConfirmationView:v,redirectToLogin:l,purchaseConfirmationCallback:n,openErrorView:o,addCommasToMoney:h,formatMoney:nt}},Roblox.ItemPurchase.ModalClose=function(n){$.modal.close("."+n)},Roblox.TwoStepVerificationFlow=function(n){function e(){$.ajax({type:"POST",url:Roblox.EnvironmentUrls.economyApi+"/v2/"+r+"/two-step-verification/generate",success:function(t){s=t,Roblox.AccountIntegrityChallengeService.TwoStepVerification.renderChallenge({containerId:"2sv-popup-container",userId:o.userId,challengeId:t,actionType:n,renderInline:!1,shouldShowRememberDeviceCheckbox:!1,shouldDynamicallyLoadTranslationResources:!1,onChallengeCompleted:y,onChallengeInvalidated:p,onModalChallengeAbandoned:$.noop}).catch(function(){u()})},error:function(){u()}})}function l(){var r=function(){window.location.href=Roblox.Endpoints.getAbsoluteUrl("/my/account#!/security")},n={titleText:t["Heading.TwoStepVerificationRequiredV3"],bodyContent:t["Message.TwoStepVerificationRequiredV4"],imageUrl:c,acceptText:t["Action.GoToSecurity"],acceptColor:Roblox.Dialog.green,onAccept:r,declineText:t["Action.Cancel"],dismissable:!0,allowHtmlContentInBody:!0,onOpenCallback:function(){w()}};$.ajax({type:"GET",url:Roblox.EnvironmentUrls.twoStepVerificationApi+"/v1/users/"+o.userId+"/configuration",success:function(t){var u=!1,r;if(t&&t.methods)for(r=0;r<t.methods.length;r++)if(t.methods[r].enabled){u=!0;break}u===!1?(i("settingsRedirectModalTriggered"),Roblox.Dialog.open(n)):(i("codeInputModalTriggered"),e())},error:function(){i("settingsRedirectModalTriggered"),Roblox.Dialog.open(n)}})}function a(){$.modal.close();var n=$(".system-feedback .alert-success"),i=t["Response.SuccessfulVerificationV2"];n.length>0&&Roblox.BootstrapWidgets&&Roblox.BootstrapWidgets.ToggleSystemMessage(n,100,6e3,i)}function u(){$.modal.close();var n=$(".system-feedback .alert-warning"),i=t["Response.VerificationError"];n.length>0&&Roblox.BootstrapWidgets&&Roblox.BootstrapWidgets.ToggleSystemMessage(n,100,6e3,i)}function y(n){var t={challengeToken:s,verificationToken:n.verificationToken};$.ajax({type:"POST",url:Roblox.EnvironmentUrls.economyApi+"/v2/"+r+"/two-step-verification/redeem",data:t,crossDomain:!0,xhrFields:{withCredentials:!0},success:function(n){n?a():u()},error:function(){u()}})}function p(){var n=3;h<n&&e(),h+=1}function i(n){Roblox.EventStream&&Roblox.EventStream.SendEvent(n,f,{})}function w(){$(".modal-btns #confirm-btn").click(function(){i("goToSecurity")}),$(".modal-btns #decline-btn").click(function(){i("closeSettingsRedirectModal")})}var r,f;n==="RobuxSpend"?(r="spend-friction",f="2svRobuxSpend"):(r="resale-friction",f="2svResale");var t=Roblox.Lang.PurchaseDialogResources,v=$("#ItemPurchaseAjaxData"),c=v.attr("data-alerturl"),s="",h=0,o={userId:Roblox.CurrentUser?Roblox.CurrentUser.userId:null,challengeToken:"",verificationToken:"",code:"",actionType:n,supportPageUrl:Roblox.Endpoints.getAbsoluteUrl("/info/account-safety"),supportLink:""};return{start:l}};

;// utilities/dialog.js
typeof Roblox=="undefined"&&(Roblox={}),typeof Roblox.Dialog=="undefined"&&(Roblox.Dialog=function(){function g(f){var k,c,v,w,o,b;n.isOpen=!0,k={titleText:"",bodyContent:"",footerText:"",footerMiddleAligned:!1,acceptText:Roblox.Lang.ControlsResources["Action.Yes"]||a.Yes,declineText:Roblox.Lang.ControlsResources["Action.No"]||a.No,acceptColor:h,declineColor:s,xToCancel:!1,onAccept:function(){return!1},onDecline:function(){return!1},onCancel:function(){return!1},imageUrl:null,showAccept:!0,showDecline:!0,allowHtmlContentInBody:!1,allowHtmlContentInFooter:!1,dismissable:!0,fieldValidationRequired:!1,onOpenCallback:function(){},onCloseCallback:t,cssClass:null,checkboxAgreementText:Roblox.Lang.ControlsResources["Action.Agree"]||a.Agree,checkboxAgreementRequired:!1},f=$.extend({},k,f),i.overlayClose=f.dismissable,i.escClose=f.dismissable,f.onCloseCallback&&(i.onClose=function(){f.onCloseCallback(),t()}),c=$(u),c.html(f.acceptText),c.attr("class",f.acceptColor),c.unbind(),c.bind("click",function(){return p(c)?!1:(f.fieldValidationRequired?nt(f.onAccept):l(f.onAccept),!1)}),v=$(e),v.html(f.declineText),v.attr("class",f.declineColor),v.unbind(),v.bind("click",function(){return p(v)?!1:(l(f.onDecline),!1)}),w=$(tt),w.unbind(),w.bind("change",function(){w.is(":checked")?y(c):r(c)}),o=$('[data-modal-type="confirmation"]'),o.find(".modal-title").text(f.titleText),f.imageUrl==null?o.addClass("noImage"):(o.find("img.modal-thumb").attr("src",f.imageUrl),o.removeClass("noImage")),n.extraClass&&(o.removeClass(n.extraClass),n.extraClass=!1),f.cssClass!=null&&(o.addClass(f.cssClass),n.extraClass=f.cssClass),f.allowHtmlContentInBody?o.find(".modal-message").html(f.bodyContent):o.find(".modal-message").text(f.bodyContent),f.checkboxAgreementRequired?(r(c),o.find(".modal-checkbox.checkbox > input").prop("checked",!1),o.find(".modal-checkbox.checkbox > label").text(f.checkboxAgreementText),o.find(".modal-checkbox.checkbox").show()):(o.find(".modal-checkbox.checkbox > input").prop("checked",!0),o.find(".modal-checkbox.checkbox").hide()),$.trim(f.footerText)==""?o.find(".modal-footer").hide():o.find(".modal-footer").show(),f.allowHtmlContentInFooter?o.find(".modal-footer").html(f.footerText):o.find(".modal-footer").text(f.footerText),f.footerMiddleAligned&&o.find(".modal-footer").addClass("modal-footer-center"),o.modal(i),b=$(d+" .modal-header .close"),b.unbind(),b.bind("click",function(){return l(f.onCancel),!1}),f.xToCancel||b.hide(),f.showAccept||c.hide(),f.showDecline||v.hide(),$("#rbx-body").addClass("modal-mask"),f.onOpenCallback()}function r(n){n.hasClass(s)?n.addClass(f):n.hasClass(v)?n.addClass(o):n.hasClass(h)&&n.addClass(c)}function p(n){return n.hasClass(c)||n.hasClass(f)||n.hasClass(o)?!0:!1}function rt(){var n=$(u),t=$(e);r(n),r(t)}function y(n){n.hasClass(f)?(n.removeClass(f),n.addClass(s)):n.hasClass(o)?(n.removeClass(o),n.addClass(v)):n.hasClass(c)&&(n.removeClass(c),n.addClass(h))}function w(){var n=$(u),t=$(e);y(n),y(t)}function k(){if(n.isOpen){var t=$(u);t.click()}}function b(){var n=$(e);n.click()}function t(t){n.isOpen=!1,typeof t!="undefined"?$.modal.close(t):$.modal.close(),$("#rbx-body").removeClass("modal-mask")}function l(n){t(),typeof n=="function"&&n()}function nt(n){if(typeof n=="function"){var i=n();if(i!=="undefined"&&i==!1)return!1}t()}function ut(n,t){var i=$(".modal-body");n?(i.find(".modal-btns").hide(),i.find(".modal-processing").show()):(i.find(".modal-btns").show(),i.find(".modal-processing").hide()),typeof t!="undefined"&&t!==""&&$.modal.close("."+t)}var d=".simplemodal-container",v="btn-primary-md",h="btn-secondary-md",s="btn-control-md",o="btn-primary-md disabled",c="btn-secondary-md disabled",f="btn-control-md disabled",it="btn-none",u=".modal-btns #confirm-btn",e=".modal-btns #decline-btn",tt="#modal-checkbox-input",n={isOpen:!1},i={overlayClose:!0,escClose:!0,opacity:80,zIndex:1040,overlayCss:{backgroundColor:"#000"},onClose:t,focus:!1},a={Yes:"Yes",No:"No",Agree:"Agree"};return{open:g,close:t,disableButtons:rt,enableButtons:w,clickYes:k,clickNo:b,status:n,toggleProcessing:ut,green:v,blue:h,white:s,none:it}}()),$(document).keypress(function(n){Roblox.Dialog.isOpen&&n.which===13&&Roblox.Dialog.clickYes()});

;// Tracking/ModalEvents.js
Roblox=Roblox||{},Roblox.ModalEvents=function(){function n(n,t,i){Roblox.EventStream&&Roblox.EventStream.SendEvent(n,t,i)}function t(t,i){var r={referralButton:i};n("assetPurchaseConfirmationShown",t,r)}return{SendAssetPurchaseConfirmationShown:t}}();

;// Events/AssetActionButtonClickEvent.js
var Roblox=Roblox||{};Roblox.AssetActionButtonClickEvent=function(){var n="data-button-action",t=function(t){var i=t.attr(n);i&&Roblox.EventStream.SendEvent("assetActionButtonClick",i,{})},i=function(){if(Roblox.EventStream)$("a["+n+"], button["+n+"]").on("click",function(){t($(this))})};return{Init:i}}(),$(function(){Roblox.AssetActionButtonClickEvent.Init()});

;// utilities/datetime/formatDateTimesI18n.js
"use strict";Roblox=Roblox||{},Roblox.FormatDateTimesI18n=function(){document.addEventListener("DOMContentLoaded",function(){for(var u=(new Roblox.Intl).getDateTimeFormatter(),t=document.getElementsByClassName("date-time-i18n"),i,e,r,s,h,o,f,n=0;n<t.length;n++){if(i=t[n].getAttribute("data-date-time-i18n-value"),e=t[n].getAttribute("data-date-time-i18n-format"),e==="custom")try{s=t[n].getAttribute("data-date-time-i18n-options").replace(/'/g,'"'),h=JSON.parse(s),r=u.getCustomDateTime(i,h)}catch(c){r=u.getShortDate(i)}else r=e==="full"?u.getFullDate(i):u.getShortDate(i);t[n].innerHTML=r}for(o=document.querySelectorAll(".wait-for-i18n-format-render"),f=0;f<o.length;f++)o[f].classList.remove("invisible")})}();

;// GenericModal.js
typeof Roblox.GenericModal=="undefined"&&(Roblox.GenericModal=function(){function s(u,f,e,s,h,c){var l,a;t.isOpen=!0,n=$.extend({},n,c),i=s,l=$("div.GenericModal").filter(":first"),l.find("div.Title").text(u),f===null?l.addClass("noImage"):(l.find("img.GenericModalImage").attr("src",f),l.removeClass("noImage")),l.find("div.Message").html(e),h&&(l.removeClass("smallModal"),l.addClass("largeModal")),a=l.find(o),a.attr("class","btn-large "+n.acceptColor),a.unbind(),a.bind("click",function(){r()}),l.modal(n)}function r(){t.isOpen=!1,$.modal.close(),typeof i=="function"&&i()}var f="btn-primary",u="btn-neutral",e="btn-negative",o=".ImageButton.btn-neutral.btn-large.roblox-ok",t={isOpen:!1},n={overlayClose:!0,escClose:!0,opacity:80,overlayCss:{backgroundColor:"#000"},acceptColor:u},i;return $(function(){$(document).on("click",".GenericModal .roblox-ok",function(){r()})}),{close:r,open:s,status:t,green:f,blue:u,gray:e}}()),Roblox.GenericModal.Resources={ErrorText:"Error",ErrorMessage:"Sorry, an error occurred."},$(document).keypress(function(n){n.which===13&&Roblox.GenericModal.status.isOpen&&Roblox.GenericModal.close()});

;// Item/ItemPage.js
var Roblox=Roblox||{};Roblox.ItemPage=function(){function e(){var n=$("#item-container"),i=n.data("asset-granted"),t=n.data("forward-url");i==="True"&&Roblox.Dialog.open({titleText:r,bodyContent:u,acceptText:f,acceptColor:Roblox.Dialog.green,onAccept:function(){if(t){var n=window.open(t,"_blank");n.focus()}},declineColor:Roblox.Dialog.none,dismissable:!0,xToCancel:!0})}function o(){var n={feature:"Avatar",urlPath:null};Roblox&&Roblox.Hybrid&&Roblox.Hybrid.Navigation&&Roblox.Hybrid.Navigation.navigateToFeature(n,function(){})}function i(n,t){if(!Roblox)return null;var i=Roblox.CurrentUser?Roblox.CurrentUser.userId:null;return{assetId:n,category:Roblox.UrlParser.getParameterValueByName("Category"),creatorId:Roblox.UrlParser.getParameterValueByName("CreatorId"),genre:Roblox.UrlParser.getParameterValueByName("Genre"),page:Roblox.UrlParser.getParameterValueByName("Page"),position:Roblox.UrlParser.getParameterValueByName("Position"),redirect:t,searchKeyword:Roblox.UrlParser.getParameterValueByName("SearchKeyword"),sortAggregation:Roblox.UrlParser.getParameterValueByName("SortAggregation"),sortType:Roblox.UrlParser.getParameterValueByName("SortType"),userId:i}}function s(){if(Roblox&&Roblox.EventStream&&Roblox.UrlParser&&Roblox.GameLauncher){var n=$("#item-container").data("item-id"),t=i(n,"studio");Roblox.EventStream.SendEventWithTarget("LibraryAssetTried","Marketplace",t,Roblox.EventStream.TargetTypes.WWW),Roblox.GameLauncher.tryAssetInStudio(n)}}function n(n,t){return t!=undefined&&t!=null&&t!=""?n+t:""}function h(t,r){var e;if(Roblox&&Roblox.EventStream&&Roblox.UrlParser){var r=$("#inventory-button-with-analytics").attr("base-url"),f=$("#item-container").data("item-id"),u=i(f,"inventory");r=r+n("?AssetId=",f),r=r+n("&Category=",u.category),r=r+n("&Page=",u.page),r=r+n("&Position=",u.position),r=r+n("&SortType=",u.sortType),r=r+n("&SortAggregation=",u.sortAggregation),r=r+n("&SearchKeyword=",u.searchKeyword),r=r+n("&Genre=",u.genre),r=r+n("&CreatorId=",u.creatorID),e=$("#inventory-button-with-analytics").attr("href",r)}}var t=Roblox.Lang.ItemResources,r=t["Label.AssetGrantedModalTitle"],u=t["Label.AssetGrantedModalMessage"],f=t["Label.AssetGrantedModalAcceptText"];return{CreateInventoryWithAnalyticsUrl:h,ShowGrantedItemPopUp:e,OpenInAppAvatarEditor:o,OpenTryInStudio:s}}(),$(function(){function n(){var n=$(".sale-clock .text"),t,i;n.length&&(t=$("#item-container").data("current-time"),i=$("#sale-clock").data("off-sale-deadline"),Roblox.CountdownTimer.InitializeClock(t,i,function(t){var i;i=t.days<1?"Offsale in <span class='text-error'>"+t.hours+"</span> h <span class='text-error'>"+t.minutes+"</span> m <span class='text-error'>"+t.seconds+"</span> s ":"Offsale in <span class='text-error'>"+t.days+"</span> d <span class='text-error'>"+t.hours+"</span> h <span class='text-error'>"+t.minutes+"</span> m ",n.html(i)}))}Roblox.ItemPage.CreateInventoryWithAnalyticsUrl(),Roblox.ItemReskinPurchase=new Roblox.ItemPurchase(null,null,!0);$("#item-container").on("click",".PurchaseButton",function(){Roblox.ItemReskinPurchase.openPurchaseVerificationView($(this))});$("#open-in-avatar-editor-button").on("click",function(){Roblox.ItemPage.OpenInAppAvatarEditor()});$("#try-in-studio-button").on("click",function(){Roblox.ItemPage.OpenTryInStudio()});$(".container-main").hasClass("in-app")||$(".description-content").linkify(),Roblox.BootstrapWidgets.ToggleContent(),Roblox.ItemPage.ShowGrantedItemPopUp(),n(),Roblox&&Roblox.Performance&&Roblox.Performance.setPerformanceMark("itemReskin_end")});

;// GenericConfirmation.js
typeof Roblox=="undefined"&&(Roblox={}),typeof Roblox.GenericConfirmation=="undefined"&&(Roblox.GenericConfirmation=function(){function w(){n.isOpen=!1,t()}function k(t){var a,e,o,s,l;n.isOpen=!0,a={titleText:"",bodyContent:"",footerText:"",acceptText:Roblox.Resources.GenericConfirmation.yes,declineText:Roblox.Resources.GenericConfirmation.No,acceptColor:u,declineColor:f,xToCancel:!1,onAccept:function(){return!1},onDecline:function(){return!1},onCancel:function(){return!1},imageUrl:null,allowHtmlContentInBody:!1,allowHtmlContentInFooter:!1,dismissable:!0,fieldValidationRequired:!1,onOpenCallback:function(){}},t=$.extend({},a,t),c.overlayClose=t.dismissable,c.escClose=t.dismissable,e=$(i),e.html(t.acceptText),e.attr("class","btn-large "+t.acceptColor),e.unbind(),e.bind("click",function(){return v(e)?!1:(t.fieldValidationRequired?nt(t.onAccept):h(t.onAccept),!1)}),o=$(r),o.html(t.declineText),o.attr("class","btn-large "+t.declineColor),o.unbind(),o.bind("click",function(){return v(o)?!1:(h(t.onDecline),!1)}),$('[data-modal-handle="confirmation"] div.Title').text(t.titleText),s=$("[data-modal-handle='confirmation']"),t.imageUrl==null?s.addClass("noImage"):(s.find("img.GenericModalImage").attr("src",t.imageUrl),s.removeClass("noImage")),t.allowHtmlContentInBody?$("[data-modal-handle='confirmation'] div.Message").html(t.bodyContent):$("[data-modal-handle='confirmation'] div.Message").text(t.bodyContent),$.trim(t.footerText)==""?$('[data-modal-handle="confirmation"] div.ConfirmationModalFooter').hide():$('[data-modal-handle="confirmation"] div.ConfirmationModalFooter').show(),t.allowHtmlContentInFooter?$('[data-modal-handle="confirmation"] div.ConfirmationModalFooter').html(t.footerText):$('[data-modal-handle="confirmation"] div.ConfirmationModalFooter').text(t.footerText),$("[data-modal-handle='confirmation']").modal(c),l=$("a.genericmodal-close"),l.unbind(),l.bind("click",function(){return h(t.onCancel),!1}),t.xToCancel||l.hide(),t.onOpenCallback()}function a(n){n.hasClass(f)?n.addClass(s):n.hasClass(l)?n.addClass(e):n.hasClass(u)&&n.addClass(o)}function v(n){return n.hasClass(o)||n.hasClass(s)||n.hasClass(e)?!0:!1}function b(){var n=$(i),t=$(r);a(n),a(t)}function g(){var u=$(i),t=$(r),n=o+" "+s+" "+e;u.removeClass(n),t.removeClass(n)}function p(){if(n.isOpen){var t=$(i);t.click()}}function y(){var n=$(r);n.click()}function t(t){n.isOpen=!1,typeof t!="undefined"?$.modal.close(t):$.modal.close()}function h(n){t(),typeof n=="function"&&n()}function nt(n){if(typeof n=="function"){var i=n();if(i!=="undefined"&&i==!1)return!1}t()}var l="btn-primary",u="btn-neutral",f="btn-negative",e="btn-disabled-primary",o="btn-disabled-neutral",s="btn-disabled-negative",d="btn-none",i="#roblox-confirm-btn",r="#roblox-decline-btn",n={isOpen:!1},c={overlayClose:!0,escClose:!0,opacity:80,overlayCss:{backgroundColor:"#000"},onClose:w};return{open:k,close:t,disableButtons:b,enableButtons:g,clickYes:p,clickNo:y,status:n,green:l,blue:u,gray:f,none:d}}()),$(document).keypress(function(n){Roblox.GenericConfirmation.status.isOpen&&n.which===13&&Roblox.GenericConfirmation.clickYes()});

;// common/deviceMeta.js
var Roblox=Roblox||{};Roblox.DeviceMeta=function(){var t=document.querySelector('meta[name="device-meta"]');if(t===null){console.debug("Error loading device information from meta tag - please check if meta tag is present");return}var n=t.dataset||{},i={android:"android",ios:"ios",xbox:"xbox",uwp:"uwp",amazon:"amazon",win32:"win32",universalapp:"universalApp",unknown:"unknown"},r={computer:"computer",tablet:"tablet",phone:"phone",console:"console"};return function(){return{deviceType:r[n.deviceType]||"",appType:i[n.appType]||"",isInApp:n.isInApp==="true",isDesktop:n.isDesktop==="true",isPhone:n.isPhone==="true",isTablet:n.isTablet==="true",isConsole:n.isConsole==="true",isAndroidApp:n.isAndroidApp==="true",isIosApp:n.isIosApp==="true",isUWPApp:n.isUwpApp==="true",isXboxApp:n.isXboxApp==="true",isAmazonApp:n.isAmazonApp==="true",isWin32App:n.isWin32App==="true",isStudio:n.isStudio==="true",isIosDevice:n.isIosDevice==="true",isAndroidDevice:n.isAndroidDevice==="true",isUniversalApp:n.isUniversalApp==="true"}}}();

;// TosModalCheck.js
function showTosModal(n,t,i,r){Roblox.Dialog.open({titleText:n,bodyContent:t,acceptText:i,onAccept:function(){submitTosAgreement(r)},acceptColor:Roblox.Dialog.blue,fieldValidationRequired:!1,dismissable:!1,xToCancel:!1,declineColor:Roblox.Dialog.none,allowHtmlContentInBody:!0})}function submitTosAgreement(n){$.ajax({type:"POST",url:n,contentType:"application/json; charset=utf-8",success:function(){}})}$(function(){var n,t,i,r,u="/UserCheck/show-tos",f=$("#TosAgreementInfo").data("terms-check-needed");$.ajax({type:"GET",url:u,data:{isLicensingTermsCheckNeeded:f},contentType:"application/json; charset=utf-8",success:function(u){if(u.PartialViewName){var f=Roblox.Intl&&new Roblox.Intl,e='<a href="'+u.TermsOfServiceUrl+'" class="text-link" target="_blank">',s=' <a href="'+u.PrivacyUrl+'" class="text-link" target="_blank">',o='<a href="'+u.LegalChangesUrl+'" class="text-link" target="_blank">';u.PartialViewName==="CaptureTosAgreement_v2"?(n=f.f(u.LangResources["Heading.TosHaveChangedTitle"]),t=f.f(u.LangResources["Message.AgreeToTosAndPrivacyBody"],{tosLinkStart:e,tosLinkEnd:"</a>",privacyLinkStart:s,privacyLinkEnd:"</a>",legalChangesLinkStart:o,legalChangesLinkEnd:"</a>"}),i=f.f(u.LangResources["Label.IAgree"]),r="/UserCheck/update-tos"):u.PartialViewName==="CaptureTosAgreementWithExplicitLicenseClause"&&(n=f.f(u.LangResources["Heading.TosAgreementTitle"]),t=f.f(u.LangResources["Message.TosAgreementBody"],{tosLinkStart:e,tosLinkEnd:"</a>",legalChangesLinkStart:o,legalChangesLinkEnd:"</a>"}),i=f.f(u.LangResources["Label.IAgree"]),r="/UserCheck/update-tos-licensing"),showTosModal(n,t,i,r)}},error:function(){}})});

;// AbuseReport/AbuseReportDispatcher.js
var Roblox=Roblox||{};Roblox.AbuseReportDispatcher=function(){var i=!1,n=function(n,t){n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null},r=function(t){var i,o;if(typeof t!="string")return!1;t=t.toLowerCase();var s=t.split("?"),f=s[0],r,u=Roblox.AbuseReportPVMeta,h=Roblox.DeviceMeta();if(u.inApp=h.isInApp,f&&typeof f=="string"&&(r=f.split("abusereport/")[1]),r&&(i={actionName:r,id:n("id",t),redirectUrl:n("redirecturl",t)},n("conversationid",t)&&(i.conversationId=n("conversationid",t)),n("partyguid",t)&&(i.partyGuid=n("partyguid",t)),i.id&&i.redirectUrl)){var c=$.param(i),e="abusereport/embedded/"+r+"?"+c,l=Roblox.Endpoints.getAbsoluteUrl("/"+e);u.inApp?u.inAppEnabled?(o={urlPath:e,feature:"Abuse Report"},console.debug("Calling navigateToFeature for Hybrid Overlay"),Roblox.Hybrid.Navigation.navigateToFeature(o,function(n){console.debug("navigateToFeature ---- status:"+n)})):window.location.href=t:window.location.href=u.phoneEnabled?l:t}},t=function(n){n.preventDefault();var t=$(this).attr("href");t&&r(t)},u=function(){if(!i){$(".abuse-report-modal").click(t);$(".messages-container").on("click",".abuse-report-modal",t);$("#AjaxCommentsContainer").on("click",".abuse-report-modal",t);$("#item-context-menu").on("click",".abuse-report-modal",t);$(".GroupWallPane").on("click",".abuse-report-modal",t);$(".group-details-container").on("click",".abuse-report-modal",t);i=!0}};return{triggerUrlAction:r,initialize:u}}(),$(document).ready(function(){Roblox.AbuseReportDispatcher.initialize()});

;//Bundle detector
Roblox && Roblox.BundleDetector && Roblox.BundleDetector.bundleDetected('page');