ss-component-new 1.1.429 → 1.1.430

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/{array-C3OjTdFF.cjs → array-BE8kxwbF.cjs} +1 -1
  2. package/dist/{array-DriW7TrH.js → array-CmTW1wXQ.js} +1 -1
  3. package/dist/icons/svg/EyeFill.svg +1 -0
  4. package/dist/{index-BHxlvMv6.js → index-B3sv--5l.js} +10 -10
  5. package/dist/{index-CeMds4uE.cjs → index-B8ONEgpW.cjs} +1 -1
  6. package/dist/{index-C041luJT.cjs → index-BCFtIIf_.cjs} +1 -1
  7. package/dist/{index-B1X-bNE0.js → index-BWHERznY.js} +4 -4
  8. package/dist/{index-DAgE3WO9.cjs → index-BZkQ29Tz.cjs} +1 -1
  9. package/dist/{index-D9rAVZEL.cjs → index-B_AUqKy_.cjs} +1 -1
  10. package/dist/{index-o4WPwqzp.cjs → index-Bb7GoIJp.cjs} +2 -2
  11. package/dist/{index-DdLcYvE3.js → index-BiuhwvlL.js} +9 -9
  12. package/dist/{index-BGLizV4G.js → index-BnlhM9YS.js} +7 -7
  13. package/dist/{index-DjBjjDpg.js → index-BwhVhBYj.js} +5 -5
  14. package/dist/index-C-jjWrUl.cjs +1 -0
  15. package/dist/{index-X7EJLhQp.js → index-CMBrDaM5.js} +1 -1
  16. package/dist/{index-De1s3ea7.cjs → index-CNpklHzK.cjs} +1 -1
  17. package/dist/index-CONyMR2I.cjs +74 -0
  18. package/dist/{index-DuomA_Ys.js → index-CSj1osh5.js} +6 -6
  19. package/dist/{index-CLr3y5Du.js → index-CYOSbBn4.js} +212 -219
  20. package/dist/{index-DGnJNcjc.cjs → index-CjlMUufz.cjs} +1 -1
  21. package/dist/{index-Drc2BWLn.cjs → index-Clor83sA.cjs} +1 -1
  22. package/dist/{index-DB1AfPdQ.cjs → index-CqaFuVhy.cjs} +1 -1
  23. package/dist/{index-CrsymeXk.js → index-Cqd4dRu7.js} +4 -4
  24. package/dist/{index-exhk8lMr.js → index-CrtuDvMe.js} +1 -1
  25. package/dist/{index-D2PXGh3y.cjs → index-CsHPoVQL.cjs} +1 -1
  26. package/dist/{index-BDHFJwhX.js → index-CzfGrSpV.js} +7021 -7051
  27. package/dist/{index-Ci4dnyyZ.cjs → index-D2aIlMCu.cjs} +1 -1
  28. package/dist/{index-DErdQiE5.cjs → index-D3ah-UXX.cjs} +1 -1
  29. package/dist/{index-DMqZtCR1.cjs → index-D5JRjtWD.cjs} +1 -1
  30. package/dist/{index-B7NzplQm.cjs → index-D6iTzH06.cjs} +1 -1
  31. package/dist/{index-dpjmnZm7.js → index-DDoTCY3C.js} +5 -5
  32. package/dist/{index-BHO7rTdQ.js → index-DFilfUFX.js} +3 -3
  33. package/dist/{index-CaW2QXnl.cjs → index-DIxSv5u4.cjs} +1 -1
  34. package/dist/{index-oM_7BEoi.cjs → index-DOm1fXtU.cjs} +1 -1
  35. package/dist/{index-C5htghVN.js → index-DQq3rsff.js} +5 -5
  36. package/dist/{index-DpCi5S7b.cjs → index-DUPkZILz.cjs} +1 -1
  37. package/dist/{index-ByT2pf2G.js → index-DXtXtduX.js} +4 -4
  38. package/dist/{index-Cu9nFCcK.cjs → index-D_j7_Hn_.cjs} +1 -1
  39. package/dist/{index-BkvkvC9V.js → index-Daqdy9e9.js} +17274 -17247
  40. package/dist/{index-DOdaH5Dk.js → index-DeXnZk4X.js} +6 -6
  41. package/dist/{index-uSX5QLdo.js → index-Di1ajNKI.js} +4 -4
  42. package/dist/{index-F-6m4uLc.js → index-DkiBGvqU.js} +1 -1
  43. package/dist/{index-C4I9I7dr.js → index-DxCiQhlC.js} +2 -2
  44. package/dist/{index-DhsJZNDO.cjs → index-DxNyBY1w.cjs} +1 -1
  45. package/dist/{index-b6bi-mnI.cjs → index-DygfoHkC.cjs} +1 -1
  46. package/dist/{index-BNA4Hofc.js → index-EzZiR3ly.js} +4 -4
  47. package/dist/{index-BMTUQiR1.js → index-LoH8EwXA.js} +3 -3
  48. package/dist/{index-Nzu-Yg3L.cjs → index-N9Y_z5k_.cjs} +1 -1
  49. package/dist/{index-CRBAzfEs.cjs → index-PdwN7EaB.cjs} +1 -1
  50. package/dist/{index-DqlG2nHS.js → index-eH2F0oMQ.js} +3 -3
  51. package/dist/{index-AFInDriS.cjs → index-gXA0eS6O.cjs} +13 -13
  52. package/dist/{index-BGNfD1q7.cjs → index-o5dof3CA.cjs} +1 -1
  53. package/dist/{index-BEBs6lDF.js → index-pvjM6t0d.js} +6 -6
  54. package/dist/{index-1lEb6AxE.js → index-qEFkFDy8.js} +7 -7
  55. package/dist/{index-d_3spDmN.js → index-uatggqnf.js} +5 -5
  56. package/dist/{index.vue_vue_type_script_setup_true_lang-CQS0yIXC.cjs → index.vue_vue_type_script_setup_true_lang-EaaJleWP.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_script_setup_true_lang-r5ntXx1H.js → index.vue_vue_type_script_setup_true_lang-YlUeUQJ4.js} +3 -3
  58. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BcnUrtwr.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bw_ydbnW.cjs} +58 -58
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DhjhVvbJ.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CClJxB6F.js} +6849 -6849
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_ed9fe0f5_lang-B95fnBYd.cjs → index.vue_vue_type_style_index_0_scoped_ed9fe0f5_lang-B2duMdZT.cjs} +1 -1
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_ed9fe0f5_lang-_nLEVa23.js → index.vue_vue_type_style_index_0_scoped_ed9fe0f5_lang-CcYfjXoA.js} +8 -8
  62. package/dist/index.vue_vue_type_style_index_0_scoped_f69cf49c_lang-TQjM60R4.js +1947 -0
  63. package/dist/index.vue_vue_type_style_index_0_scoped_f69cf49c_lang-Z8fBYrL9.cjs +1 -0
  64. package/dist/{login-Dz-Choxe.js → login-B520hsEu.js} +1 -1
  65. package/dist/{login-4CQsNYqj.cjs → login-BMAi9yYX.cjs} +1 -1
  66. package/dist/{main-D4TIX5ZJ.js → main-Dpbg9Pxc.js} +6 -6
  67. package/dist/{main-Dr2n-t77.cjs → main-yzKa6bxy.cjs} +1 -1
  68. package/dist/{menu-DRqy2FlY.cjs → menu-BAEUpxbd.cjs} +8 -8
  69. package/dist/{menu-C47R8xaz.js → menu-qAL8FiSW.js} +5 -3
  70. package/dist/ss-component.cjs +1 -1
  71. package/dist/ss-component.css +2 -2
  72. package/dist/ss-component.js +10 -10
  73. package/dist/ss-component3.cjs +1 -1
  74. package/dist/ss-component3.js +1 -1
  75. package/dist/{threeModel-DC6dUe7Z.js → threeModel-ClGUp5fG.js} +628 -752
  76. package/dist/threeModel-CxKWxMlL.cjs +1 -0
  77. package/dist/{threeModel.vue_vue_type_style_index_0_scoped_e7dd7d83_lang-P-VgKxw9.cjs → threeModel.vue_vue_type_style_index_0_scoped_3e87dec6_lang-BOT5Tivd.cjs} +181 -181
  78. package/dist/{threeModel.vue_vue_type_style_index_0_scoped_e7dd7d83_lang-DHvoNEJo.js → threeModel.vue_vue_type_style_index_0_scoped_3e87dec6_lang-DYhzYEGg.js} +4567 -5349
  79. package/package.json +1 -1
  80. package/public/icons/svg/EyeFill.svg +1 -0
  81. package/dist/index-D5QWCaxA.cjs +0 -87
  82. package/dist/index-DsAxFIrB.cjs +0 -1
  83. package/dist/index.vue_vue_type_style_index_0_scoped_7ee96c6e_lang-B9DK4OqF.js +0 -1929
  84. package/dist/index.vue_vue_type_style_index_0_scoped_7ee96c6e_lang-CBxAbUn1.cjs +0 -1
  85. package/dist/threeModel-CiX5oIo9.cjs +0 -1
@@ -1,12 +1,12 @@
1
- "use strict";const Du=require("./index-DGnJNcjc.cjs"),rs=require("./menu-DRqy2FlY.cjs"),Xr=require("vue"),Oh=rs.defineStore("modelComp",{state:()=>({itemData:[],originalData:[],extraContents:[],nodeDev:"",isEdit:"view",isRefreshCurStructure:!1,isSubmitCurStructure:!1,curStructureCompIds:[],systemPath:"",freshContent:!1,routeToChildPath:""}),actions:{setItemData(s){this.itemData=s},setFreshContent(s){this.freshContent=s},setRouteToChildPath(s){this.routeToChildPath=s},setSubmitCurStructure(s){this.isSubmitCurStructure=s},setCurStructureCompIds(s){this.curStructureCompIds=s},setRefreshCurStructure(s){this.isRefreshCurStructure=s},setOriginalData(s){this.originalData=s},setExtraContents(s){this.extraContents=s},setNodeDev(s){this.nodeDev=s},setIsEdit(s){this.isEdit=s},setSystemPath(s){this.systemPath=s}}});/**
1
+ "use strict";const xu=require("./index-CjlMUufz.cjs"),ss=require("./menu-BAEUpxbd.cjs"),Vr=require("vue"),Ah=ss.defineStore("modelComp",{state:()=>({itemData:[],originalData:[],extraContents:[],nodeDev:"",isEdit:"view",isRefreshCurStructure:!1,isSubmitCurStructure:!1,curStructureCompIds:[],systemPath:"",freshContent:!1,routeToChildPath:""}),actions:{setItemData(s){this.itemData=s},setFreshContent(s){this.freshContent=s},setRouteToChildPath(s){this.routeToChildPath=s},setSubmitCurStructure(s){this.isSubmitCurStructure=s},setCurStructureCompIds(s){this.curStructureCompIds=s},setRefreshCurStructure(s){this.isRefreshCurStructure=s},setOriginalData(s){this.originalData=s},setExtraContents(s){this.extraContents=s},setNodeDev(s){this.nodeDev=s},setIsEdit(s){this.isEdit=s},setSystemPath(s){this.systemPath=s}}});/**
2
2
  * @license
3
3
  * Copyright 2010-2025 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT
5
- */const fl="177",Uu={ROTATE:0,DOLLY:1,PAN:2},Iu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Nu=0,Hl=1,Fu=2,zh=1,Bh=2,Jn=3,Cn=0,rn=1,tn=2,di=0,as=1,Gl=2,Wl=3,Xl=4,Ou=5,Ai=100,zu=101,Bu=102,ku=103,Vu=104,Hu=200,Gu=201,Wu=202,Xu=203,_o=204,vo=205,qu=206,ju=207,Yu=208,Ju=209,$u=210,Ku=211,Zu=212,Qu=213,td=214,xo=0,yo=1,Mo=2,cs=3,So=4,bo=5,Eo=6,wo=7,ca=0,ed=1,nd=2,fi=0,id=1,sd=2,rd=3,kh=4,ad=5,od=6,ld=7,ql="attached",cd="detached",Vh=300,hs=301,us=302,Ao=303,To=304,ha=306,Nn=1e3,Tn=1001,Ro=1002,mn=1003,hd=1004,ir=1005,pn=1006,ba=1007,$n=1008,zn=1009,Hh=1010,Gh=1011,Vs=1012,pl=1013,Pi=1014,Fn=1015,js=1016,ml=1017,gl=1018,Hs=1020,Wh=35902,Xh=1021,qh=1022,yn=1023,Gs=1026,Ws=1027,jh=1028,_l=1029,Yh=1030,vl=1031,xl=1033,qr=33776,jr=33777,Yr=33778,Jr=33779,Co=35840,Lo=35841,Po=35842,Do=35843,Uo=36196,Io=37492,No=37496,Fo=37808,Oo=37809,zo=37810,Bo=37811,ko=37812,Vo=37813,Ho=37814,Go=37815,Wo=37816,Xo=37817,qo=37818,jo=37819,Yo=37820,Jo=37821,$r=36492,$o=36494,Ko=36495,Jh=36283,Zo=36284,Qo=36285,tl=36286,ea=2300,el=2301,Ea=2302,jl=2400,Yl=2401,Jl=2402,ud=2500,dd=3200,fd=3201,yl=0,pd=1,ui="",Me="srgb",ds="srgb-linear",na="linear",Re="srgb",zi=7680,$l=519,md=512,gd=513,_d=514,$h=515,vd=516,xd=517,yd=518,Md=519,nl=35044,Kl="300 es",Kn=2e3,ia=2001;class Ui{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){const n=this._listeners;return n===void 0?!1:n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){const n=this._listeners;if(n===void 0)return;const i=n[t];if(i!==void 0){const r=i.indexOf(e);r!==-1&&i.splice(r,1)}}dispatchEvent(t){const e=this._listeners;if(e===void 0)return;const n=e[t.type];if(n!==void 0){t.target=this;const i=n.slice(0);for(let r=0,a=i.length;r<a;r++)i[r].call(this,t);t.target=null}}}const Ze=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Zl=1234567;const Fs=Math.PI/180,fs=180/Math.PI;function Rn(){const s=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Ze[s&255]+Ze[s>>8&255]+Ze[s>>16&255]+Ze[s>>24&255]+"-"+Ze[t&255]+Ze[t>>8&255]+"-"+Ze[t>>16&15|64]+Ze[t>>24&255]+"-"+Ze[e&63|128]+Ze[e>>8&255]+"-"+Ze[e>>16&255]+Ze[e>>24&255]+Ze[n&255]+Ze[n>>8&255]+Ze[n>>16&255]+Ze[n>>24&255]).toLowerCase()}function de(s,t,e){return Math.max(t,Math.min(e,s))}function Ml(s,t){return(s%t+t)%t}function Sd(s,t,e,n,i){return n+(s-t)*(i-n)/(e-t)}function bd(s,t,e){return s!==t?(e-s)/(t-s):0}function Os(s,t,e){return(1-e)*s+e*t}function Ed(s,t,e,n){return Os(s,t,1-Math.exp(-e*n))}function wd(s,t=1){return t-Math.abs(Ml(s,t*2)-t)}function Ad(s,t,e){return s<=t?0:s>=e?1:(s=(s-t)/(e-t),s*s*(3-2*s))}function Td(s,t,e){return s<=t?0:s>=e?1:(s=(s-t)/(e-t),s*s*s*(s*(s*6-15)+10))}function Rd(s,t){return s+Math.floor(Math.random()*(t-s+1))}function Cd(s,t){return s+Math.random()*(t-s)}function Ld(s){return s*(.5-Math.random())}function Pd(s){s!==void 0&&(Zl=s);let t=Zl+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Dd(s){return s*Fs}function Ud(s){return s*fs}function Id(s){return(s&s-1)===0&&s!==0}function Nd(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function Fd(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function Od(s,t,e,n,i){const r=Math.cos,a=Math.sin,o=r(e/2),l=a(e/2),c=r((t+n)/2),h=a((t+n)/2),u=r((t-n)/2),d=a((t-n)/2),f=r((n-t)/2),m=a((n-t)/2);switch(i){case"XYX":s.set(o*h,l*u,l*d,o*c);break;case"YZY":s.set(l*d,o*h,l*u,o*c);break;case"ZXZ":s.set(l*u,l*d,o*h,o*c);break;case"XZX":s.set(o*h,l*m,l*f,o*c);break;case"YXY":s.set(l*f,o*h,l*m,o*c);break;case"ZYZ":s.set(l*m,l*f,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function An(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Te(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const Ti={DEG2RAD:Fs,RAD2DEG:fs,generateUUID:Rn,clamp:de,euclideanModulo:Ml,mapLinear:Sd,inverseLerp:bd,lerp:Os,damp:Ed,pingpong:wd,smoothstep:Ad,smootherstep:Td,randInt:Rd,randFloat:Cd,randFloatSpread:Ld,seededRandom:Pd,degToRad:Dd,radToDeg:Ud,isPowerOfTwo:Id,ceilPowerOfTwo:Nd,floorPowerOfTwo:Fd,setQuaternionFromProperEuler:Od,normalize:Te,denormalize:An};class Dt{constructor(t=0,e=0){Dt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=de(this.x,t.x,e.x),this.y=de(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=de(this.x,t,e),this.y=de(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(de(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(de(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*i+t.x,this.y=r*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class gn{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],u=n[i+3];const d=r[a+0],f=r[a+1],m=r[a+2],_=r[a+3];if(o===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u;return}if(o===1){t[e+0]=d,t[e+1]=f,t[e+2]=m,t[e+3]=_;return}if(u!==_||l!==d||c!==f||h!==m){let g=1-o;const p=l*d+c*f+h*m+u*_,E=p>=0?1:-1,b=1-p*p;if(b>Number.EPSILON){const I=Math.sqrt(b),C=Math.atan2(I,p*E);g=Math.sin(g*C)/I,o=Math.sin(o*C)/I}const M=o*E;if(l=l*g+d*M,c=c*g+f*M,h=h*g+m*M,u=u*g+_*M,g===1-o){const I=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=I,c*=I,h*=I,u*=I}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,r,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],u=r[a],d=r[a+1],f=r[a+2],m=r[a+3];return t[e]=o*m+h*u+l*f-c*d,t[e+1]=l*m+h*d+c*u-o*f,t[e+2]=c*m+h*f+o*d-l*u,t[e+3]=h*m-o*u-l*d-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,i=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),u=o(r/2),d=l(n/2),f=l(i/2),m=l(r/2);switch(a){case"XYZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"YXZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"ZXY":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"ZYX":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"YZX":this._x=d*h*u+c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u-d*f*m;break;case"XZY":this._x=d*h*u-c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u+d*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],u=e[10],d=n+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-l)*f,this._y=(r-c)*f,this._z=(a-i)*f}else if(n>o&&n>u){const f=2*Math.sqrt(1+n-o-u);this._w=(h-l)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(r+c)/f}else if(o>u){const f=2*Math.sqrt(1+o-n-u);this._w=(r-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(l+h)/f}else{const f=2*Math.sqrt(1+u-n-o);this._w=(a-i)/f,this._x=(r+c)/f,this._y=(l+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(de(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+a*o+i*c-r*l,this._y=i*h+a*l+r*o-n*c,this._z=r*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,i=this._y,r=this._z,a=this._w;let o=a*t._w+n*t._x+i*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const f=1-e;return this._w=f*a+e*this._w,this._x=f*n+e*this._x,this._y=f*i+e*this._y,this._z=f*r+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-e)*h)/c,d=Math.sin(e*h)/c;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class N{constructor(t=0,e=0,n=0){N.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Ql.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Ql.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*i-o*n),h=2*(o*e-r*i),u=2*(r*n-a*e);return this.x=e+l*c+a*u-o*h,this.y=n+l*h+o*c-r*u,this.z=i+l*u+r*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=de(this.x,t.x,e.x),this.y=de(this.y,t.y,e.y),this.z=de(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=de(this.x,t,e),this.y=de(this.y,t,e),this.z=de(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(de(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=i*l-r*o,this.y=r*a-n*l,this.z=n*o-i*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return wa.copy(this).projectOnVector(t),this.sub(wa)}reflect(t){return this.sub(wa.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(de(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const wa=new N,Ql=new gn;class ue{constructor(t,e,n,i,r,a,o,l,c){ue.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,r,a,o,l,c)}set(t,e,n,i,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=i,h[2]=o,h[3]=e,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],u=n[7],d=n[2],f=n[5],m=n[8],_=i[0],g=i[3],p=i[6],E=i[1],b=i[4],M=i[7],I=i[2],C=i[5],P=i[8];return r[0]=a*_+o*E+l*I,r[3]=a*g+o*b+l*C,r[6]=a*p+o*M+l*P,r[1]=c*_+h*E+u*I,r[4]=c*g+h*b+u*C,r[7]=c*p+h*M+u*P,r[2]=d*_+f*E+m*I,r[5]=d*g+f*b+m*C,r[8]=d*p+f*M+m*P,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-n*r*h+n*o*l+i*r*c-i*a*l}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=h*a-o*c,d=o*l-h*r,f=c*r-a*l,m=e*u+n*d+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return t[0]=u*_,t[1]=(i*c-h*n)*_,t[2]=(o*n-i*a)*_,t[3]=d*_,t[4]=(h*e-i*l)*_,t[5]=(i*r-o*e)*_,t[6]=f*_,t[7]=(n*l-c*e)*_,t[8]=(a*e-n*r)*_,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+t,-i*c,i*l,-i*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Aa.makeScale(t,e)),this}rotate(t){return this.premultiply(Aa.makeRotation(-t)),this}translate(t,e){return this.premultiply(Aa.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Aa=new ue;function Kh(s){for(let t=s.length-1;t>=0;--t)if(s[t]>=65535)return!0;return!1}function Xs(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function zd(){const s=Xs("canvas");return s.style.display="block",s}const tc={};function os(s){s in tc||(tc[s]=!0,console.warn(s))}function Bd(s,t,e){return new Promise(function(n,i){function r(){switch(s.clientWaitSync(t,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}function kd(s){const t=s.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function Vd(s){const t=s.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const ec=new ue().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),nc=new ue().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Hd(){const s={enabled:!0,workingColorSpace:ds,spaces:{},convert:function(i,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Re&&(i.r=Qn(i.r),i.g=Qn(i.g),i.b=Qn(i.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Re&&(i.r=ls(i.r),i.g=ls(i.g),i.b=ls(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===ui?na:this.spaces[i].transfer},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,a){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return os("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return os("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,r)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[ds]:{primaries:t,whitePoint:n,transfer:na,toXYZ:ec,fromXYZ:nc,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Me},outputColorSpaceConfig:{drawingBufferColorSpace:Me}},[Me]:{primaries:t,whitePoint:n,transfer:Re,toXYZ:ec,fromXYZ:nc,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Me}}}),s}const pe=Hd();function Qn(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function ls(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let Bi;class Gd{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let n;if(t instanceof HTMLCanvasElement)n=t;else{Bi===void 0&&(Bi=Xs("canvas")),Bi.width=t.width,Bi.height=t.height;const i=Bi.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),n=Bi}return n.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Xs("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let a=0;a<r.length;a++)r[a]=Qn(r[a]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){const e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(Qn(e[n]/255)*255):e[n]=Qn(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let Wd=0;class Sl{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Wd++}),this.uuid=Rn(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const e=this.data;return e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight):e!==null?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?r.push(Ta(i[a].image)):r.push(Ta(i[a]))}else r=Ta(i);n.url=r}return e||(t.images[this.uuid]=n),n}}function Ta(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?Gd.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Xd=0;const Ra=new N;class $e extends Ui{constructor(t=$e.DEFAULT_IMAGE,e=$e.DEFAULT_MAPPING,n=Tn,i=Tn,r=pn,a=$n,o=yn,l=zn,c=$e.DEFAULT_ANISOTROPY,h=ui){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Xd++}),this.uuid=Rn(),this.name="",this.source=new Sl(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Dt(0,0),this.repeat=new Dt(1,1),this.center=new Dt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ue,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Ra).x}get height(){return this.source.getSize(Ra).y}get depth(){return this.source.getSize(Ra).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}const i=this[e];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Vh)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Nn:t.x=t.x-Math.floor(t.x);break;case Tn:t.x=t.x<0?0:1;break;case Ro:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Nn:t.y=t.y-Math.floor(t.y);break;case Tn:t.y=t.y<0?0:1;break;case Ro:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}$e.DEFAULT_IMAGE=null;$e.DEFAULT_MAPPING=Vh;$e.DEFAULT_ANISOTROPY=1;class me{constructor(t=0,e=0,n=0,i=1){me.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const l=t.elements,c=l[0],h=l[4],u=l[8],d=l[1],f=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-d)<.01&&Math.abs(u-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+f+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(c+1)/2,M=(f+1)/2,I=(p+1)/2,C=(h+d)/4,P=(u+_)/4,D=(m+g)/4;return b>M&&b>I?b<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(b),i=C/n,r=P/n):M>I?M<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(M),n=C/i,r=D/i):I<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(I),n=P/r,i=D/r),this.set(n,i,r,e),this}let E=Math.sqrt((g-m)*(g-m)+(u-_)*(u-_)+(d-h)*(d-h));return Math.abs(E)<.001&&(E=1),this.x=(g-m)/E,this.y=(u-_)/E,this.z=(d-h)/E,this.w=Math.acos((c+f+p-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=de(this.x,t.x,e.x),this.y=de(this.y,t.y,e.y),this.z=de(this.z,t.z,e.z),this.w=de(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=de(this.x,t,e),this.y=de(this.y,t,e),this.z=de(this.z,t,e),this.w=de(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(de(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class qd extends Ui{constructor(t=1,e=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:pn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=n.depth,this.scissor=new me(0,0,t,e),this.scissorTest=!1,this.viewport=new me(0,0,t,e);const i={width:t,height:e,depth:n.depth},r=new $e(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(t={}){const e={minFilter:pn,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(e.mapping=t.mapping),t.wrapS!==void 0&&(e.wrapS=t.wrapS),t.wrapT!==void 0&&(e.wrapT=t.wrapT),t.wrapR!==void 0&&(e.wrapR=t.wrapR),t.magFilter!==void 0&&(e.magFilter=t.magFilter),t.minFilter!==void 0&&(e.minFilter=t.minFilter),t.format!==void 0&&(e.format=t.format),t.type!==void 0&&(e.type=t.type),t.anisotropy!==void 0&&(e.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(e.colorSpace=t.colorSpace),t.flipY!==void 0&&(e.flipY=t.flipY),t.generateMipmaps!==void 0&&(e.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(e.internalFormat=t.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n,this.textures[i].isArrayTexture=this.textures[i].image.depth>1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;const i=Object.assign({},t.textures[e].image);this.textures[e].source=new Sl(i)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Di extends qd{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class Zh extends $e{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=mn,this.minFilter=mn,this.wrapR=Tn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class jd extends $e{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=mn,this.minFilter=mn,this.wrapR=Tn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Bn{constructor(t=new N(1/0,1/0,1/0),e=new N(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(bn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(bn.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=bn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(n!==void 0){const r=n.getAttribute("position");if(e===!0&&r!==void 0&&t.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)t.isMesh===!0?t.getVertexPosition(a,bn):bn.fromBufferAttribute(r,a),bn.applyMatrix4(t.matrixWorld),this.expandByPoint(bn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),sr.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),sr.copy(n.boundingBox)),sr.applyMatrix4(t.matrixWorld),this.union(sr)}const i=t.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,bn),bn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ws),rr.subVectors(this.max,ws),ki.subVectors(t.a,ws),Vi.subVectors(t.b,ws),Hi.subVectors(t.c,ws),ii.subVectors(Vi,ki),si.subVectors(Hi,Vi),_i.subVectors(ki,Hi);let e=[0,-ii.z,ii.y,0,-si.z,si.y,0,-_i.z,_i.y,ii.z,0,-ii.x,si.z,0,-si.x,_i.z,0,-_i.x,-ii.y,ii.x,0,-si.y,si.x,0,-_i.y,_i.x,0];return!Ca(e,ki,Vi,Hi,rr)||(e=[1,0,0,0,1,0,0,0,1],!Ca(e,ki,Vi,Hi,rr))?!1:(ar.crossVectors(ii,si),e=[ar.x,ar.y,ar.z],Ca(e,ki,Vi,Hi,rr))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,bn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(bn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Gn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Gn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Gn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Gn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Gn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Gn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Gn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Gn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Gn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const Gn=[new N,new N,new N,new N,new N,new N,new N,new N],bn=new N,sr=new Bn,ki=new N,Vi=new N,Hi=new N,ii=new N,si=new N,_i=new N,ws=new N,rr=new N,ar=new N,vi=new N;function Ca(s,t,e,n,i){for(let r=0,a=s.length-3;r<=a;r+=3){vi.fromArray(s,r);const o=i.x*Math.abs(vi.x)+i.y*Math.abs(vi.y)+i.z*Math.abs(vi.z),l=t.dot(vi),c=e.dot(vi),h=n.dot(vi);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const Yd=new Bn,As=new N,La=new N;class ei{constructor(t=new N,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):Yd.setFromPoints(t).getCenter(n);let i=0;for(let r=0,a=t.length;r<a;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;As.subVectors(t,this.center);const e=As.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(As,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(La.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(As.copy(t.center).add(La)),this.expandByPoint(As.copy(t.center).sub(La))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}const Wn=new N,Pa=new N,or=new N,ri=new N,Da=new N,lr=new N,Ua=new N;class gs{constructor(t=new N,e=new N(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Wn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Wn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Wn.copy(this.origin).addScaledVector(this.direction,e),Wn.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Pa.copy(t).add(e).multiplyScalar(.5),or.copy(e).sub(t).normalize(),ri.copy(this.origin).sub(Pa);const r=t.distanceTo(e)*.5,a=-this.direction.dot(or),o=ri.dot(this.direction),l=-ri.dot(or),c=ri.lengthSq(),h=Math.abs(1-a*a);let u,d,f,m;if(h>0)if(u=a*l-o,d=a*o-l,m=r*h,u>=0)if(d>=-m)if(d<=m){const _=1/h;u*=_,d*=_,f=u*(u+a*d+2*o)+d*(a*u+d+2*l)+c}else d=r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d=-r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d<=-m?(u=Math.max(0,-(-a*r+o)),d=u>0?-r:Math.min(Math.max(-r,-l),r),f=-u*u+d*(d+2*l)+c):d<=m?(u=0,d=Math.min(Math.max(-r,-l),r),f=d*(d+2*l)+c):(u=Math.max(0,-(a*r+o)),d=u>0?r:Math.min(Math.max(-r,-l),r),f=-u*u+d*(d+2*l)+c);else d=a>0?-r:r,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Pa).addScaledVector(or,d),f}intersectSphere(t,e){Wn.subVectors(t.center,this.origin);const n=Wn.dot(this.direction),i=Wn.dot(Wn)-n*n,r=t.radius*t.radius;if(i>r)return null;const a=Math.sqrt(r-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(t.min.x-d.x)*c,i=(t.max.x-d.x)*c):(n=(t.max.x-d.x)*c,i=(t.min.x-d.x)*c),h>=0?(r=(t.min.y-d.y)*h,a=(t.max.y-d.y)*h):(r=(t.max.y-d.y)*h,a=(t.min.y-d.y)*h),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),u>=0?(o=(t.min.z-d.z)*u,l=(t.max.z-d.z)*u):(o=(t.max.z-d.z)*u,l=(t.min.z-d.z)*u),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Wn)!==null}intersectTriangle(t,e,n,i,r){Da.subVectors(e,t),lr.subVectors(n,t),Ua.crossVectors(Da,lr);let a=this.direction.dot(Ua),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;ri.subVectors(this.origin,t);const l=o*this.direction.dot(lr.crossVectors(ri,lr));if(l<0)return null;const c=o*this.direction.dot(Da.cross(ri));if(c<0||l+c>a)return null;const h=-o*ri.dot(Ua);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Yt{constructor(t,e,n,i,r,a,o,l,c,h,u,d,f,m,_,g){Yt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,r,a,o,l,c,h,u,d,f,m,_,g)}set(t,e,n,i,r,a,o,l,c,h,u,d,f,m,_,g){const p=this.elements;return p[0]=t,p[4]=e,p[8]=n,p[12]=i,p[1]=r,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=u,p[14]=d,p[3]=f,p[7]=m,p[11]=_,p[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Yt().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/Gi.setFromMatrixColumn(t,0).length(),r=1/Gi.setFromMatrixColumn(t,1).length(),a=1/Gi.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const d=a*h,f=a*u,m=o*h,_=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=f+m*c,e[5]=d-_*c,e[9]=-o*l,e[2]=_-d*c,e[6]=m+f*c,e[10]=a*l}else if(t.order==="YXZ"){const d=l*h,f=l*u,m=c*h,_=c*u;e[0]=d+_*o,e[4]=m*o-f,e[8]=a*c,e[1]=a*u,e[5]=a*h,e[9]=-o,e[2]=f*o-m,e[6]=_+d*o,e[10]=a*l}else if(t.order==="ZXY"){const d=l*h,f=l*u,m=c*h,_=c*u;e[0]=d-_*o,e[4]=-a*u,e[8]=m+f*o,e[1]=f+m*o,e[5]=a*h,e[9]=_-d*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const d=a*h,f=a*u,m=o*h,_=o*u;e[0]=l*h,e[4]=m*c-f,e[8]=d*c+_,e[1]=l*u,e[5]=_*c+d,e[9]=f*c-m,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const d=a*l,f=a*c,m=o*l,_=o*c;e[0]=l*h,e[4]=_-d*u,e[8]=m*u+f,e[1]=u,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=f*u+m,e[10]=d-_*u}else if(t.order==="XZY"){const d=a*l,f=a*c,m=o*l,_=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=d*u+_,e[5]=a*h,e[9]=f*u-m,e[2]=m*u-f,e[6]=o*h,e[10]=_*u+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Jd,t,$d)}lookAt(t,e,n){const i=this.elements;return dn.subVectors(t,e),dn.lengthSq()===0&&(dn.z=1),dn.normalize(),ai.crossVectors(n,dn),ai.lengthSq()===0&&(Math.abs(n.z)===1?dn.x+=1e-4:dn.z+=1e-4,dn.normalize(),ai.crossVectors(n,dn)),ai.normalize(),cr.crossVectors(dn,ai),i[0]=ai.x,i[4]=cr.x,i[8]=dn.x,i[1]=ai.y,i[5]=cr.y,i[9]=dn.y,i[2]=ai.z,i[6]=cr.z,i[10]=dn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],u=n[5],d=n[9],f=n[13],m=n[2],_=n[6],g=n[10],p=n[14],E=n[3],b=n[7],M=n[11],I=n[15],C=i[0],P=i[4],D=i[8],S=i[12],y=i[1],U=i[5],B=i[9],k=i[13],q=i[2],K=i[6],z=i[10],tt=i[14],W=i[3],at=i[7],dt=i[11],mt=i[15];return r[0]=a*C+o*y+l*q+c*W,r[4]=a*P+o*U+l*K+c*at,r[8]=a*D+o*B+l*z+c*dt,r[12]=a*S+o*k+l*tt+c*mt,r[1]=h*C+u*y+d*q+f*W,r[5]=h*P+u*U+d*K+f*at,r[9]=h*D+u*B+d*z+f*dt,r[13]=h*S+u*k+d*tt+f*mt,r[2]=m*C+_*y+g*q+p*W,r[6]=m*P+_*U+g*K+p*at,r[10]=m*D+_*B+g*z+p*dt,r[14]=m*S+_*k+g*tt+p*mt,r[3]=E*C+b*y+M*q+I*W,r[7]=E*P+b*U+M*K+I*at,r[11]=E*D+b*B+M*z+I*dt,r[15]=E*S+b*k+M*tt+I*mt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],u=t[6],d=t[10],f=t[14],m=t[3],_=t[7],g=t[11],p=t[15];return m*(+r*l*u-i*c*u-r*o*d+n*c*d+i*o*f-n*l*f)+_*(+e*l*f-e*c*d+r*a*d-i*a*f+i*c*h-r*l*h)+g*(+e*c*u-e*o*f-r*a*u+n*a*f+r*o*h-n*c*h)+p*(-i*o*h-e*l*u+e*o*d+i*a*u-n*a*d+n*l*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],f=t[11],m=t[12],_=t[13],g=t[14],p=t[15],E=u*g*c-_*d*c+_*l*f-o*g*f-u*l*p+o*d*p,b=m*d*c-h*g*c-m*l*f+a*g*f+h*l*p-a*d*p,M=h*_*c-m*u*c+m*o*f-a*_*f-h*o*p+a*u*p,I=m*u*l-h*_*l-m*o*d+a*_*d+h*o*g-a*u*g,C=e*E+n*b+i*M+r*I;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/C;return t[0]=E*P,t[1]=(_*d*r-u*g*r-_*i*f+n*g*f+u*i*p-n*d*p)*P,t[2]=(o*g*r-_*l*r+_*i*c-n*g*c-o*i*p+n*l*p)*P,t[3]=(u*l*r-o*d*r-u*i*c+n*d*c+o*i*f-n*l*f)*P,t[4]=b*P,t[5]=(h*g*r-m*d*r+m*i*f-e*g*f-h*i*p+e*d*p)*P,t[6]=(m*l*r-a*g*r-m*i*c+e*g*c+a*i*p-e*l*p)*P,t[7]=(a*d*r-h*l*r+h*i*c-e*d*c-a*i*f+e*l*f)*P,t[8]=M*P,t[9]=(m*u*r-h*_*r-m*n*f+e*_*f+h*n*p-e*u*p)*P,t[10]=(a*_*r-m*o*r+m*n*c-e*_*c-a*n*p+e*o*p)*P,t[11]=(h*o*r-a*u*r-h*n*c+e*u*c+a*n*f-e*o*f)*P,t[12]=I*P,t[13]=(h*_*i-m*u*i+m*n*d-e*_*d-h*n*g+e*u*g)*P,t[14]=(m*o*i-a*_*i-m*n*l+e*_*l+a*n*g-e*o*g)*P,t[15]=(a*u*i-h*o*i+h*n*l-e*u*l-a*n*d+e*o*d)*P,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,r*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,a){return this.set(1,n,r,0,t,1,a,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,u=o+o,d=r*c,f=r*h,m=r*u,_=a*h,g=a*u,p=o*u,E=l*c,b=l*h,M=l*u,I=n.x,C=n.y,P=n.z;return i[0]=(1-(_+p))*I,i[1]=(f+M)*I,i[2]=(m-b)*I,i[3]=0,i[4]=(f-M)*C,i[5]=(1-(d+p))*C,i[6]=(g+E)*C,i[7]=0,i[8]=(m+b)*P,i[9]=(g-E)*P,i[10]=(1-(d+_))*P,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=Gi.set(i[0],i[1],i[2]).length();const a=Gi.set(i[4],i[5],i[6]).length(),o=Gi.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],En.copy(this);const c=1/r,h=1/a,u=1/o;return En.elements[0]*=c,En.elements[1]*=c,En.elements[2]*=c,En.elements[4]*=h,En.elements[5]*=h,En.elements[6]*=h,En.elements[8]*=u,En.elements[9]*=u,En.elements[10]*=u,e.setFromRotationMatrix(En),n.x=r,n.y=a,n.z=o,this}makePerspective(t,e,n,i,r,a,o=Kn){const l=this.elements,c=2*r/(e-t),h=2*r/(n-i),u=(e+t)/(e-t),d=(n+i)/(n-i);let f,m;if(o===Kn)f=-(a+r)/(a-r),m=-2*a*r/(a-r);else if(o===ia)f=-a/(a-r),m=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,r,a,o=Kn){const l=this.elements,c=1/(e-t),h=1/(n-i),u=1/(a-r),d=(e+t)*c,f=(n+i)*h;let m,_;if(o===Kn)m=(a+r)*u,_=-2*u;else if(o===ia)m=r*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Gi=new N,En=new Yt,Jd=new N(0,0,0),$d=new N(1,1,1),ai=new N,cr=new N,dn=new N,ic=new Yt,sc=new gn;class un{constructor(t=0,e=0,n=0,i=un.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],u=i[2],d=i[6],f=i[10];switch(e){case"XYZ":this._y=Math.asin(de(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-de(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(de(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-de(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(de(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-de(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return ic.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ic,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return sc.setFromEuler(this),this.setFromQuaternion(sc,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}un.DEFAULT_ORDER="XYZ";class bl{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let Kd=0;const rc=new N,Wi=new gn,Xn=new Yt,hr=new N,Ts=new N,Zd=new N,Qd=new gn,ac=new N(1,0,0),oc=new N(0,1,0),lc=new N(0,0,1),cc={type:"added"},tf={type:"removed"},Xi={type:"childadded",child:null},Ia={type:"childremoved",child:null};class Ce extends Ui{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Kd++}),this.uuid=Rn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ce.DEFAULT_UP.clone();const t=new N,e=new un,n=new gn,i=new N(1,1,1);function r(){n.setFromEuler(e,!1)}function a(){e.setFromQuaternion(n,void 0,!1)}e._onChange(r),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Yt},normalMatrix:{value:new ue}}),this.matrix=new Yt,this.matrixWorld=new Yt,this.matrixAutoUpdate=Ce.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Ce.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new bl,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Wi.setFromAxisAngle(t,e),this.quaternion.multiply(Wi),this}rotateOnWorldAxis(t,e){return Wi.setFromAxisAngle(t,e),this.quaternion.premultiply(Wi),this}rotateX(t){return this.rotateOnAxis(ac,t)}rotateY(t){return this.rotateOnAxis(oc,t)}rotateZ(t){return this.rotateOnAxis(lc,t)}translateOnAxis(t,e){return rc.copy(t).applyQuaternion(this.quaternion),this.position.add(rc.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(ac,t)}translateY(t){return this.translateOnAxis(oc,t)}translateZ(t){return this.translateOnAxis(lc,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Xn.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?hr.copy(t):hr.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Ts.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Xn.lookAt(Ts,hr,this.up):Xn.lookAt(hr,Ts,this.up),this.quaternion.setFromRotationMatrix(Xn),i&&(Xn.extractRotation(i.matrixWorld),Wi.setFromRotationMatrix(Xn),this.quaternion.premultiply(Wi.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(cc),Xi.child=t,this.dispatchEvent(Xi),Xi.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(tf),Ia.child=t,this.dispatchEvent(Ia),Ia.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Xn.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Xn.multiply(t.parent.matrixWorld)),t.applyMatrix4(Xn),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(cc),Xi.child=t,this.dispatchEvent(Xi),Xi.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(t,e);if(a!==void 0)return a}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ts,t,Zd),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ts,Qd,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)}updateWorldMatrix(t,e){const n=this.parent;if(t===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),e===!0){const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(t),i.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const u=l[c];r(t.shapes,u)}else r(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(r(t.materials,this.material[l]));i.material=o}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(r(t.animations,l))}}if(e){const o=a(t.geometries),l=a(t.materials),c=a(t.textures),h=a(t.images),u=a(t.shapes),d=a(t.skeletons),f=a(t.animations),m=a(t.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),m.length>0&&(n.nodes=m)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){const i=t.children[n];this.add(i.clone())}return this}}Ce.DEFAULT_UP=new N(0,1,0);Ce.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ce.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const wn=new N,qn=new N,Na=new N,jn=new N,qi=new N,ji=new N,hc=new N,Fa=new N,Oa=new N,za=new N,Ba=new me,ka=new me,Va=new me;class xn{constructor(t=new N,e=new N,n=new N){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),wn.subVectors(t,e),i.cross(wn);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){wn.subVectors(i,e),qn.subVectors(n,e),Na.subVectors(t,e);const a=wn.dot(wn),o=wn.dot(qn),l=wn.dot(Na),c=qn.dot(qn),h=qn.dot(Na),u=a*c-o*o;if(u===0)return r.set(0,0,0),null;const d=1/u,f=(c*l-o*h)*d,m=(a*h-o*l)*d;return r.set(1-f-m,m,f)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,jn)===null?!1:jn.x>=0&&jn.y>=0&&jn.x+jn.y<=1}static getInterpolation(t,e,n,i,r,a,o,l){return this.getBarycoord(t,e,n,i,jn)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,jn.x),l.addScaledVector(a,jn.y),l.addScaledVector(o,jn.z),l)}static getInterpolatedAttribute(t,e,n,i,r,a){return Ba.setScalar(0),ka.setScalar(0),Va.setScalar(0),Ba.fromBufferAttribute(t,e),ka.fromBufferAttribute(t,n),Va.fromBufferAttribute(t,i),a.setScalar(0),a.addScaledVector(Ba,r.x),a.addScaledVector(ka,r.y),a.addScaledVector(Va,r.z),a}static isFrontFacing(t,e,n,i){return wn.subVectors(n,e),qn.subVectors(t,e),wn.cross(qn).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return wn.subVectors(this.c,this.b),qn.subVectors(this.a,this.b),wn.cross(qn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return xn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return xn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,r){return xn.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return xn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return xn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let a,o;qi.subVectors(i,n),ji.subVectors(r,n),Fa.subVectors(t,n);const l=qi.dot(Fa),c=ji.dot(Fa);if(l<=0&&c<=0)return e.copy(n);Oa.subVectors(t,i);const h=qi.dot(Oa),u=ji.dot(Oa);if(h>=0&&u<=h)return e.copy(i);const d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(n).addScaledVector(qi,a);za.subVectors(t,r);const f=qi.dot(za),m=ji.dot(za);if(m>=0&&f<=m)return e.copy(r);const _=f*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),e.copy(n).addScaledVector(ji,o);const g=h*m-f*u;if(g<=0&&u-h>=0&&f-m>=0)return hc.subVectors(r,i),o=(u-h)/(u-h+(f-m)),e.copy(i).addScaledVector(hc,o);const p=1/(g+_+d);return a=_*p,o=d*p,e.copy(n).addScaledVector(qi,a).addScaledVector(ji,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Qh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},oi={h:0,s:0,l:0},ur={h:0,s:0,l:0};function Ha(s,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?s+(t-s)*6*e:e<1/2?t:e<2/3?s+(t-s)*6*(2/3-e):s}class jt{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){const i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Me){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,pe.colorSpaceToWorking(this,e),this}setRGB(t,e,n,i=pe.workingColorSpace){return this.r=t,this.g=e,this.b=n,pe.colorSpaceToWorking(this,i),this}setHSL(t,e,n,i=pe.workingColorSpace){if(t=Ml(t,1),e=de(e,0,1),n=de(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=Ha(a,r,t+1/3),this.g=Ha(a,r,t),this.b=Ha(a,r,t-1/3)}return pe.colorSpaceToWorking(this,i),this}setStyle(t,e=Me){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=i[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Me){const n=Qh[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Qn(t.r),this.g=Qn(t.g),this.b=Qn(t.b),this}copyLinearToSRGB(t){return this.r=ls(t.r),this.g=ls(t.g),this.b=ls(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Me){return pe.workingToColorSpace(Qe.copy(this),t),Math.round(de(Qe.r*255,0,255))*65536+Math.round(de(Qe.g*255,0,255))*256+Math.round(de(Qe.b*255,0,255))}getHexString(t=Me){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=pe.workingColorSpace){pe.workingToColorSpace(Qe.copy(this),e);const n=Qe.r,i=Qe.g,r=Qe.b,a=Math.max(n,i,r),o=Math.min(n,i,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case n:l=(i-r)/u+(i<r?6:0);break;case i:l=(r-n)/u+2;break;case r:l=(n-i)/u+4;break}l/=6}return t.h=l,t.s=c,t.l=h,t}getRGB(t,e=pe.workingColorSpace){return pe.workingToColorSpace(Qe.copy(this),e),t.r=Qe.r,t.g=Qe.g,t.b=Qe.b,t}getStyle(t=Me){pe.workingToColorSpace(Qe.copy(this),t);const e=Qe.r,n=Qe.g,i=Qe.b;return t!==Me?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){return this.getHSL(oi),this.setHSL(oi.h+t,oi.s+e,oi.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(oi),t.getHSL(ur);const n=Os(oi.h,ur.h,e),i=Os(oi.s,ur.s,e),r=Os(oi.l,ur.l,e);return this.setHSL(n,i,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.elements;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Qe=new jt;jt.NAMES=Qh;let ef=0;class Mn extends Ui{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ef++}),this.uuid=Rn(),this.name="",this.type="Material",this.blending=as,this.side=Cn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=_o,this.blendDst=vo,this.blendEquation=Ai,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new jt(0,0,0),this.blendAlpha=0,this.depthFunc=cs,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=$l,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=zi,this.stencilZFail=zi,this.stencilZPass=zi,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==as&&(n.blending=this.blending),this.side!==Cn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==_o&&(n.blendSrc=this.blendSrc),this.blendDst!==vo&&(n.blendDst=this.blendDst),this.blendEquation!==Ai&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==cs&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==$l&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==zi&&(n.stencilFail=this.stencilFail),this.stencilZFail!==zi&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==zi&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=i(t.textures),a=i(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const i=e.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class mi extends Mn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new jt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new un,this.combine=ca,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Be=new N,dr=new Dt;let nf=0;class Oe{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:nf++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=nl,this.updateRanges=[],this.gpuType=Fn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)dr.fromBufferAttribute(this,e),dr.applyMatrix3(t),this.setXY(e,dr.x,dr.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Be.fromBufferAttribute(this,e),Be.applyMatrix3(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Be.fromBufferAttribute(this,e),Be.applyMatrix4(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Be.fromBufferAttribute(this,e),Be.applyNormalMatrix(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Be.fromBufferAttribute(this,e),Be.transformDirection(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=An(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Te(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=An(e,this.array)),e}setX(t,e){return this.normalized&&(e=Te(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=An(e,this.array)),e}setY(t,e){return this.normalized&&(e=Te(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=An(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Te(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=An(e,this.array)),e}setW(t,e){return this.normalized&&(e=Te(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Te(e,this.array),n=Te(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Te(e,this.array),n=Te(n,this.array),i=Te(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Te(e,this.array),n=Te(n,this.array),i=Te(i,this.array),r=Te(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==nl&&(t.usage=this.usage),t}}class tu extends Oe{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class sf extends Oe{constructor(t,e,n){super(new Int32Array(t),e,n)}}class eu extends Oe{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class le extends Oe{constructor(t,e,n){super(new Float32Array(t),e,n)}}let rf=0;const _n=new Yt,Ga=new Ce,Yi=new N,fn=new Bn,Rs=new Bn,We=new N;class Ie extends Ui{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:rf++}),this.uuid=Rn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(Kh(t)?eu:tu)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new ue().getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return _n.makeRotationFromQuaternion(t),this.applyMatrix4(_n),this}rotateX(t){return _n.makeRotationX(t),this.applyMatrix4(_n),this}rotateY(t){return _n.makeRotationY(t),this.applyMatrix4(_n),this}rotateZ(t){return _n.makeRotationZ(t),this.applyMatrix4(_n),this}translate(t,e,n){return _n.makeTranslation(t,e,n),this.applyMatrix4(_n),this}scale(t,e,n){return _n.makeScale(t,e,n),this.applyMatrix4(_n),this}lookAt(t){return Ga.lookAt(t),Ga.updateMatrix(),this.applyMatrix4(Ga.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Yi).negate(),this.translate(Yi.x,Yi.y,Yi.z),this}setFromPoints(t){const e=this.getAttribute("position");if(e===void 0){const n=[];for(let i=0,r=t.length;i<r;i++){const a=t[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new le(n,3))}else{const n=Math.min(t.length,e.count);for(let i=0;i<n;i++){const r=t[i];e.setXYZ(i,r.x,r.y,r.z||0)}t.length>e.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Bn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new N(-1/0,-1/0,-1/0),new N(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){const r=e[n];fn.setFromBufferAttribute(r),this.morphTargetsRelative?(We.addVectors(this.boundingBox.min,fn.min),this.boundingBox.expandByPoint(We),We.addVectors(this.boundingBox.max,fn.max),this.boundingBox.expandByPoint(We)):(this.boundingBox.expandByPoint(fn.min),this.boundingBox.expandByPoint(fn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ei);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new N,1/0);return}if(t){const n=this.boundingSphere.center;if(fn.setFromBufferAttribute(t),e)for(let r=0,a=e.length;r<a;r++){const o=e[r];Rs.setFromBufferAttribute(o),this.morphTargetsRelative?(We.addVectors(fn.min,Rs.min),fn.expandByPoint(We),We.addVectors(fn.max,Rs.max),fn.expandByPoint(We)):(fn.expandByPoint(Rs.min),fn.expandByPoint(Rs.max))}fn.getCenter(n);let i=0;for(let r=0,a=t.count;r<a;r++)We.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(We));if(e)for(let r=0,a=e.length;r<a;r++){const o=e[r],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)We.fromBufferAttribute(o,c),l&&(Yi.fromBufferAttribute(t,c),We.add(Yi)),i=Math.max(i,n.distanceToSquared(We))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=e.position,i=e.normal,r=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Oe(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let D=0;D<n.count;D++)o[D]=new N,l[D]=new N;const c=new N,h=new N,u=new N,d=new Dt,f=new Dt,m=new Dt,_=new N,g=new N;function p(D,S,y){c.fromBufferAttribute(n,D),h.fromBufferAttribute(n,S),u.fromBufferAttribute(n,y),d.fromBufferAttribute(r,D),f.fromBufferAttribute(r,S),m.fromBufferAttribute(r,y),h.sub(c),u.sub(c),f.sub(d),m.sub(d);const U=1/(f.x*m.y-m.x*f.y);isFinite(U)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(u,-f.y).multiplyScalar(U),g.copy(u).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(U),o[D].add(_),o[S].add(_),o[y].add(_),l[D].add(g),l[S].add(g),l[y].add(g))}let E=this.groups;E.length===0&&(E=[{start:0,count:t.count}]);for(let D=0,S=E.length;D<S;++D){const y=E[D],U=y.start,B=y.count;for(let k=U,q=U+B;k<q;k+=3)p(t.getX(k+0),t.getX(k+1),t.getX(k+2))}const b=new N,M=new N,I=new N,C=new N;function P(D){I.fromBufferAttribute(i,D),C.copy(I);const S=o[D];b.copy(S),b.sub(I.multiplyScalar(I.dot(S))).normalize(),M.crossVectors(C,S);const U=M.dot(l[D])<0?-1:1;a.setXYZW(D,b.x,b.y,b.z,U)}for(let D=0,S=E.length;D<S;++D){const y=E[D],U=y.start,B=y.count;for(let k=U,q=U+B;k<q;k+=3)P(t.getX(k+0)),P(t.getX(k+1)),P(t.getX(k+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Oe(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);const i=new N,r=new N,a=new N,o=new N,l=new N,c=new N,h=new N,u=new N;if(t)for(let d=0,f=t.count;d<f;d+=3){const m=t.getX(d+0),_=t.getX(d+1),g=t.getX(d+2);i.fromBufferAttribute(e,m),r.fromBufferAttribute(e,_),a.fromBufferAttribute(e,g),h.subVectors(a,r),u.subVectors(i,r),h.cross(u),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,g),o.add(h),l.add(h),c.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(let d=0,f=e.count;d<f;d+=3)i.fromBufferAttribute(e,d+0),r.fromBufferAttribute(e,d+1),a.fromBufferAttribute(e,d+2),h.subVectors(a,r),u.subVectors(i,r),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)We.fromBufferAttribute(t,e),We.normalize(),t.setXYZ(e,We.x,We.y,We.z)}toNonIndexed(){function t(o,l){const c=o.array,h=o.itemSize,u=o.normalized,d=new c.constructor(l.length*h);let f=0,m=0;for(let _=0,g=l.length;_<g;_++){o.isInterleavedBufferAttribute?f=l[_]*o.data.stride+o.offset:f=l[_]*h;for(let p=0;p<h;p++)d[m++]=c[f++]}return new Oe(d,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Ie,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=t(l,n);e.setAttribute(o,c)}const r=this.morphAttributes;for(const o in r){const l=[],c=r[o];for(let h=0,u=c.length;h<u;h++){const d=c[h],f=t(d,n);l.push(f)}e.morphAttributes[o]=l}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const c=n[l];t.data.attributes[l]=c.toJSON(t.data)}const i={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u<d;u++){const f=c[u];h.push(f.toJSON(t.data))}h.length>0&&(i[l]=h,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere=o.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone());const i=t.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],u=r[c];for(let d=0,f=u.length;d<f;d++)h.push(u[d].clone(e));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;const a=t.groups;for(let c=0,h=a.length;c<h;c++){const u=a[c];this.addGroup(u.start,u.count,u.materialIndex)}const o=t.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const uc=new Yt,xi=new gs,fr=new ei,dc=new N,pr=new N,mr=new N,gr=new N,Wa=new N,_r=new N,fc=new N,vr=new N;class be extends Ce{constructor(t=new Ie,e=new mi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){const i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(t,e){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const o=this.morphTargetInfluences;if(r&&o){_r.set(0,0,0);for(let l=0,c=r.length;l<c;l++){const h=o[l],u=r[l];h!==0&&(Wa.fromBufferAttribute(u,t),a?_r.addScaledVector(Wa,h):_r.addScaledVector(Wa.sub(e),h))}e.add(_r)}return e}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),fr.copy(n.boundingSphere),fr.applyMatrix4(r),xi.copy(t.ray).recast(t.near),!(fr.containsPoint(xi.origin)===!1&&(xi.intersectSphere(fr,dc)===null||xi.origin.distanceToSquared(dc)>(t.far-t.near)**2))&&(uc.copy(r).invert(),xi.copy(t.ray).applyMatrix4(uc),!(n.boundingBox!==null&&xi.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,xi)))}_computeIntersections(t,e,n){let i;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,d=r.groups,f=r.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],E=Math.max(g.start,f.start),b=Math.min(o.count,Math.min(g.start+g.count,f.start+f.count));for(let M=E,I=b;M<I;M+=3){const C=o.getX(M),P=o.getX(M+1),D=o.getX(M+2);i=xr(this,p,t,n,c,h,u,C,P,D),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=g.materialIndex,e.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(o.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const E=o.getX(g),b=o.getX(g+1),M=o.getX(g+2);i=xr(this,a,t,n,c,h,u,E,b,M),i&&(i.faceIndex=Math.floor(g/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],E=Math.max(g.start,f.start),b=Math.min(l.count,Math.min(g.start+g.count,f.start+f.count));for(let M=E,I=b;M<I;M+=3){const C=M,P=M+1,D=M+2;i=xr(this,p,t,n,c,h,u,C,P,D),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=g.materialIndex,e.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(l.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const E=g,b=g+1,M=g+2;i=xr(this,a,t,n,c,h,u,E,b,M),i&&(i.faceIndex=Math.floor(g/3),e.push(i))}}}}function af(s,t,e,n,i,r,a,o){let l;if(t.side===rn?l=n.intersectTriangle(a,r,i,!0,o):l=n.intersectTriangle(i,r,a,t.side===Cn,o),l===null)return null;vr.copy(o),vr.applyMatrix4(s.matrixWorld);const c=e.ray.origin.distanceTo(vr);return c<e.near||c>e.far?null:{distance:c,point:vr.clone(),object:s}}function xr(s,t,e,n,i,r,a,o,l,c){s.getVertexPosition(o,pr),s.getVertexPosition(l,mr),s.getVertexPosition(c,gr);const h=af(s,t,e,n,pr,mr,gr,fc);if(h){const u=new N;xn.getBarycoord(fc,pr,mr,gr,u),i&&(h.uv=xn.getInterpolatedAttribute(i,o,l,c,u,new Dt)),r&&(h.uv1=xn.getInterpolatedAttribute(r,o,l,c,u,new Dt)),a&&(h.normal=xn.getInterpolatedAttribute(a,o,l,c,u,new N),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new N,materialIndex:0};xn.getNormal(pr,mr,gr,d.normal),h.face=d,h.barycoord=u}return h}class _s extends Ie{constructor(t=1,e=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const o=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,n,e,t,a,r,0),m("z","y","x",1,-1,n,e,-t,a,r,1),m("x","z","y",1,1,t,n,e,i,a,2),m("x","z","y",1,-1,t,n,-e,i,a,3),m("x","y","z",1,-1,t,e,n,i,r,4),m("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(l),this.setAttribute("position",new le(c,3)),this.setAttribute("normal",new le(h,3)),this.setAttribute("uv",new le(u,2));function m(_,g,p,E,b,M,I,C,P,D,S){const y=M/P,U=I/D,B=M/2,k=I/2,q=C/2,K=P+1,z=D+1;let tt=0,W=0;const at=new N;for(let dt=0;dt<z;dt++){const mt=dt*U-k;for(let Rt=0;Rt<K;Rt++){const wt=Rt*y-B;at[_]=wt*E,at[g]=mt*b,at[p]=q,c.push(at.x,at.y,at.z),at[_]=0,at[g]=0,at[p]=C>0?1:-1,h.push(at.x,at.y,at.z),u.push(Rt/P),u.push(1-dt/D),tt+=1}}for(let dt=0;dt<D;dt++)for(let mt=0;mt<P;mt++){const Rt=d+mt+K*dt,wt=d+mt+K*(dt+1),X=d+(mt+1)+K*(dt+1),Z=d+(mt+1)+K*dt;l.push(Rt,wt,Z),l.push(wt,X,Z),W+=6}o.addGroup(f,W,S),f+=W,d+=tt}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new _s(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function ps(s){const t={};for(const e in s){t[e]={};for(const n in s[e]){const i=s[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function sn(s){const t={};for(let e=0;e<s.length;e++){const n=ps(s[e]);for(const i in n)t[i]=n[i]}return t}function of(s){const t=[];for(let e=0;e<s.length;e++)t.push(s[e].clone());return t}function nu(s){const t=s.getRenderTarget();return t===null?s.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:pe.workingColorSpace}const El={clone:ps,merge:sn};var lf=`void main() {
5
+ */const al="177",yu={ROTATE:0,DOLLY:1,PAN:2},Mu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Su=0,Ul=1,bu=2,Rh=1,Ch=2,$n=3,Cn=0,rn=1,tn=2,ui=0,rs=1,Il=2,Nl=3,Fl=4,Eu=5,wi=100,wu=101,Tu=102,Au=103,Ru=104,Cu=200,Lu=201,Pu=202,Du=203,co=204,ho=205,Uu=206,Iu=207,Nu=208,Fu=209,Ou=210,zu=211,Bu=212,ku=213,Vu=214,uo=0,fo=1,po=2,ls=3,mo=4,go=5,_o=6,vo=7,ra=0,Hu=1,Gu=2,di=0,Wu=1,Xu=2,qu=3,Lh=4,ju=5,Yu=6,$u=7,Ol="attached",Ku="detached",Ph=300,cs=301,hs=302,xo=303,yo=304,aa=306,Nn=1e3,An=1001,Mo=1002,mn=1003,Ju=1004,tr=1005,pn=1006,xa=1007,Kn=1008,zn=1009,Dh=1010,Uh=1011,zs=1012,ol=1013,Li=1014,Fn=1015,Ws=1016,ll=1017,cl=1018,Bs=1020,Ih=35902,Nh=1021,Fh=1022,yn=1023,ks=1026,Vs=1027,Oh=1028,hl=1029,zh=1030,ul=1031,dl=1033,Hr=33776,Gr=33777,Wr=33778,Xr=33779,So=35840,bo=35841,Eo=35842,wo=35843,To=36196,Ao=37492,Ro=37496,Co=37808,Lo=37809,Po=37810,Do=37811,Uo=37812,Io=37813,No=37814,Fo=37815,Oo=37816,zo=37817,Bo=37818,ko=37819,Vo=37820,Ho=37821,qr=36492,Go=36494,Wo=36495,Bh=36283,Xo=36284,qo=36285,jo=36286,Jr=2300,Yo=2301,ya=2302,zl=2400,Bl=2401,kl=2402,Zu=2500,Qu=3200,td=3201,fl=0,ed=1,hi="",Me="srgb",us="srgb-linear",Zr="linear",Re="srgb",Oi=7680,Vl=519,nd=512,id=513,sd=514,kh=515,rd=516,ad=517,od=518,ld=519,$o=35044,Hl="300 es",Jn=2e3,Qr=2001;class Di{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){const n=this._listeners;return n===void 0?!1:n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){const n=this._listeners;if(n===void 0)return;const i=n[t];if(i!==void 0){const r=i.indexOf(e);r!==-1&&i.splice(r,1)}}dispatchEvent(t){const e=this._listeners;if(e===void 0)return;const n=e[t.type];if(n!==void 0){t.target=this;const i=n.slice(0);for(let r=0,a=i.length;r<a;r++)i[r].call(this,t);t.target=null}}}const Ze=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Gl=1234567;const Ns=Math.PI/180,ds=180/Math.PI;function Rn(){const s=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Ze[s&255]+Ze[s>>8&255]+Ze[s>>16&255]+Ze[s>>24&255]+"-"+Ze[t&255]+Ze[t>>8&255]+"-"+Ze[t>>16&15|64]+Ze[t>>24&255]+"-"+Ze[e&63|128]+Ze[e>>8&255]+"-"+Ze[e>>16&255]+Ze[e>>24&255]+Ze[n&255]+Ze[n>>8&255]+Ze[n>>16&255]+Ze[n>>24&255]).toLowerCase()}function pe(s,t,e){return Math.max(t,Math.min(e,s))}function pl(s,t){return(s%t+t)%t}function cd(s,t,e,n,i){return n+(s-t)*(i-n)/(e-t)}function hd(s,t,e){return s!==t?(e-s)/(t-s):0}function Fs(s,t,e){return(1-e)*s+e*t}function ud(s,t,e,n){return Fs(s,t,1-Math.exp(-e*n))}function dd(s,t=1){return t-Math.abs(pl(s,t*2)-t)}function fd(s,t,e){return s<=t?0:s>=e?1:(s=(s-t)/(e-t),s*s*(3-2*s))}function pd(s,t,e){return s<=t?0:s>=e?1:(s=(s-t)/(e-t),s*s*s*(s*(s*6-15)+10))}function md(s,t){return s+Math.floor(Math.random()*(t-s+1))}function gd(s,t){return s+Math.random()*(t-s)}function _d(s){return s*(.5-Math.random())}function vd(s){s!==void 0&&(Gl=s);let t=Gl+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function xd(s){return s*Ns}function yd(s){return s*ds}function Md(s){return(s&s-1)===0&&s!==0}function Sd(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function bd(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function Ed(s,t,e,n,i){const r=Math.cos,a=Math.sin,o=r(e/2),l=a(e/2),c=r((t+n)/2),h=a((t+n)/2),u=r((t-n)/2),d=a((t-n)/2),p=r((n-t)/2),m=a((n-t)/2);switch(i){case"XYX":s.set(o*h,l*u,l*d,o*c);break;case"YZY":s.set(l*d,o*h,l*u,o*c);break;case"ZXZ":s.set(l*u,l*d,o*h,o*c);break;case"XZX":s.set(o*h,l*m,l*p,o*c);break;case"YXY":s.set(l*p,o*h,l*m,o*c);break;case"ZYZ":s.set(l*m,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Tn(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Ae(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const Ti={DEG2RAD:Ns,RAD2DEG:ds,generateUUID:Rn,clamp:pe,euclideanModulo:pl,mapLinear:cd,inverseLerp:hd,lerp:Fs,damp:ud,pingpong:dd,smoothstep:fd,smootherstep:pd,randInt:md,randFloat:gd,randFloatSpread:_d,seededRandom:vd,degToRad:xd,radToDeg:yd,isPowerOfTwo:Md,ceilPowerOfTwo:Sd,floorPowerOfTwo:bd,setQuaternionFromProperEuler:Ed,normalize:Ae,denormalize:Tn};class Qt{constructor(t=0,e=0){Qt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=pe(this.x,t.x,e.x),this.y=pe(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=pe(this.x,t,e),this.y=pe(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(pe(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(pe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*i+t.x,this.y=r*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class gn{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],u=n[i+3];const d=r[a+0],p=r[a+1],m=r[a+2],_=r[a+3];if(o===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u;return}if(o===1){t[e+0]=d,t[e+1]=p,t[e+2]=m,t[e+3]=_;return}if(u!==_||l!==d||c!==p||h!==m){let g=1-o;const f=l*d+c*p+h*m+u*_,b=f>=0?1:-1,w=1-f*f;if(w>Number.EPSILON){const I=Math.sqrt(w),L=Math.atan2(I,f*b);g=Math.sin(g*L)/I,o=Math.sin(o*L)/I}const S=o*b;if(l=l*g+d*S,c=c*g+p*S,h=h*g+m*S,u=u*g+_*S,g===1-o){const I=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=I,c*=I,h*=I,u*=I}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,r,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],u=r[a],d=r[a+1],p=r[a+2],m=r[a+3];return t[e]=o*m+h*u+l*p-c*d,t[e+1]=l*m+h*d+c*u-o*p,t[e+2]=c*m+h*p+o*d-l*u,t[e+3]=h*m-o*u-l*d-c*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,i=t._y,r=t._z,a=t._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),u=o(r/2),d=l(n/2),p=l(i/2),m=l(r/2);switch(a){case"XYZ":this._x=d*h*u+c*p*m,this._y=c*p*u-d*h*m,this._z=c*h*m+d*p*u,this._w=c*h*u-d*p*m;break;case"YXZ":this._x=d*h*u+c*p*m,this._y=c*p*u-d*h*m,this._z=c*h*m-d*p*u,this._w=c*h*u+d*p*m;break;case"ZXY":this._x=d*h*u-c*p*m,this._y=c*p*u+d*h*m,this._z=c*h*m+d*p*u,this._w=c*h*u-d*p*m;break;case"ZYX":this._x=d*h*u-c*p*m,this._y=c*p*u+d*h*m,this._z=c*h*m-d*p*u,this._w=c*h*u+d*p*m;break;case"YZX":this._x=d*h*u+c*p*m,this._y=c*p*u+d*h*m,this._z=c*h*m-d*p*u,this._w=c*h*u-d*p*m;break;case"XZY":this._x=d*h*u-c*p*m,this._y=c*p*u-d*h*m,this._z=c*h*m+d*p*u,this._w=c*h*u+d*p*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],a=e[1],o=e[5],l=e[9],c=e[2],h=e[6],u=e[10],d=n+o+u;if(d>0){const p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(h-l)*p,this._y=(r-c)*p,this._z=(a-i)*p}else if(n>o&&n>u){const p=2*Math.sqrt(1+n-o-u);this._w=(h-l)/p,this._x=.25*p,this._y=(i+a)/p,this._z=(r+c)/p}else if(o>u){const p=2*Math.sqrt(1+o-n-u);this._w=(r-c)/p,this._x=(i+a)/p,this._y=.25*p,this._z=(l+h)/p}else{const p=2*Math.sqrt(1+u-n-o);this._w=(a-i)/p,this._x=(r+c)/p,this._y=(l+h)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(pe(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,a=t._w,o=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+a*o+i*c-r*l,this._y=i*h+a*l+r*o-n*c,this._z=r*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,i=this._y,r=this._z,a=this._w;let o=a*t._w+n*t._x+i*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const p=1-e;return this._w=p*a+e*this._w,this._x=p*n+e*this._x,this._y=p*i+e*this._y,this._z=p*r+e*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-e)*h)/c,d=Math.sin(e*h)/c;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class O{constructor(t=0,e=0,n=0){O.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Wl.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Wl.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,o=t.z,l=t.w,c=2*(a*i-o*n),h=2*(o*e-r*i),u=2*(r*n-a*e);return this.x=e+l*c+a*u-o*h,this.y=n+l*h+o*c-r*u,this.z=i+l*u+r*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=pe(this.x,t.x,e.x),this.y=pe(this.y,t.y,e.y),this.z=pe(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=pe(this.x,t,e),this.y=pe(this.y,t,e),this.z=pe(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(pe(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,a=e.x,o=e.y,l=e.z;return this.x=i*l-r*o,this.y=r*a-n*l,this.z=n*o-i*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Ma.copy(this).projectOnVector(t),this.sub(Ma)}reflect(t){return this.sub(Ma.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(pe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ma=new O,Wl=new gn;class he{constructor(t,e,n,i,r,a,o,l,c){he.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,r,a,o,l,c)}set(t,e,n,i,r,a,o,l,c){const h=this.elements;return h[0]=t,h[1]=i,h[2]=o,h[3]=e,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],u=n[7],d=n[2],p=n[5],m=n[8],_=i[0],g=i[3],f=i[6],b=i[1],w=i[4],S=i[7],I=i[2],L=i[5],P=i[8];return r[0]=a*_+o*b+l*I,r[3]=a*g+o*w+l*L,r[6]=a*f+o*S+l*P,r[1]=c*_+h*b+u*I,r[4]=c*g+h*w+u*L,r[7]=c*f+h*S+u*P,r[2]=d*_+p*b+m*I,r[5]=d*g+p*w+m*L,r[8]=d*f+p*S+m*P,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-n*r*h+n*o*l+i*r*c-i*a*l}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=h*a-o*c,d=o*l-h*r,p=c*r-a*l,m=e*u+n*d+i*p;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return t[0]=u*_,t[1]=(i*c-h*n)*_,t[2]=(o*n-i*a)*_,t[3]=d*_,t[4]=(h*e-i*l)*_,t[5]=(i*r-o*e)*_,t[6]=p*_,t[7]=(n*l-c*e)*_,t[8]=(a*e-n*r)*_,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+t,-i*c,i*l,-i*(-c*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Sa.makeScale(t,e)),this}rotate(t){return this.premultiply(Sa.makeRotation(-t)),this}translate(t,e){return this.premultiply(Sa.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Sa=new he;function Vh(s){for(let t=s.length-1;t>=0;--t)if(s[t]>=65535)return!0;return!1}function Hs(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function wd(){const s=Hs("canvas");return s.style.display="block",s}const Xl={};function as(s){s in Xl||(Xl[s]=!0,console.warn(s))}function Td(s,t,e){return new Promise(function(n,i){function r(){switch(s.clientWaitSync(t,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}function Ad(s){const t=s.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}function Rd(s){const t=s.elements;t[11]===-1?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=-t[14]+1)}const ql=new he().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),jl=new he().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Cd(){const s={enabled:!0,workingColorSpace:us,spaces:{},convert:function(i,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Re&&(i.r=Qn(i.r),i.g=Qn(i.g),i.b=Qn(i.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Re&&(i.r=os(i.r),i.g=os(i.g),i.b=os(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===hi?Zr:this.spaces[i].transfer},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,a){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return as("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return as("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,r)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[us]:{primaries:t,whitePoint:n,transfer:Zr,toXYZ:ql,fromXYZ:jl,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Me},outputColorSpaceConfig:{drawingBufferColorSpace:Me}},[Me]:{primaries:t,whitePoint:n,transfer:Re,toXYZ:ql,fromXYZ:jl,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Me}}}),s}const fe=Cd();function Qn(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function os(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let zi;class Ld{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let n;if(t instanceof HTMLCanvasElement)n=t;else{zi===void 0&&(zi=Hs("canvas")),zi.width=t.width,zi.height=t.height;const i=zi.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),n=zi}return n.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Hs("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let a=0;a<r.length;a++)r[a]=Qn(r[a]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){const e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(Qn(e[n]/255)*255):e[n]=Qn(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let Pd=0;class ml{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Pd++}),this.uuid=Rn(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const e=this.data;return e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight):e!==null?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?r.push(ba(i[a].image)):r.push(ba(i[a]))}else r=ba(i);n.url=r}return e||(t.images[this.uuid]=n),n}}function ba(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?Ld.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Dd=0;const Ea=new O;class Ke extends Di{constructor(t=Ke.DEFAULT_IMAGE,e=Ke.DEFAULT_MAPPING,n=An,i=An,r=pn,a=Kn,o=yn,l=zn,c=Ke.DEFAULT_ANISOTROPY,h=hi){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Dd++}),this.uuid=Rn(),this.name="",this.source=new ml(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Qt(0,0),this.repeat=new Qt(1,1),this.center=new Qt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new he,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Ea).x}get height(){return this.source.getSize(Ea).y}get depth(){return this.source.getSize(Ea).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}const i=this[e];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Ph)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Nn:t.x=t.x-Math.floor(t.x);break;case An:t.x=t.x<0?0:1;break;case Mo:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Nn:t.y=t.y-Math.floor(t.y);break;case An:t.y=t.y<0?0:1;break;case Mo:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Ke.DEFAULT_IMAGE=null;Ke.DEFAULT_MAPPING=Ph;Ke.DEFAULT_ANISOTROPY=1;class me{constructor(t=0,e=0,n=0,i=1){me.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const l=t.elements,c=l[0],h=l[4],u=l[8],d=l[1],p=l[5],m=l[9],_=l[2],g=l[6],f=l[10];if(Math.abs(h-d)<.01&&Math.abs(u-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+p+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const w=(c+1)/2,S=(p+1)/2,I=(f+1)/2,L=(h+d)/4,P=(u+_)/4,D=(m+g)/4;return w>S&&w>I?w<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(w),i=L/n,r=P/n):S>I?S<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(S),n=L/i,r=D/i):I<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(I),n=P/r,i=D/r),this.set(n,i,r,e),this}let b=Math.sqrt((g-m)*(g-m)+(u-_)*(u-_)+(d-h)*(d-h));return Math.abs(b)<.001&&(b=1),this.x=(g-m)/b,this.y=(u-_)/b,this.z=(d-h)/b,this.w=Math.acos((c+p+f-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=pe(this.x,t.x,e.x),this.y=pe(this.y,t.y,e.y),this.z=pe(this.z,t.z,e.z),this.w=pe(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=pe(this.x,t,e),this.y=pe(this.y,t,e),this.z=pe(this.z,t,e),this.w=pe(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(pe(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Ud extends Di{constructor(t=1,e=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:pn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=n.depth,this.scissor=new me(0,0,t,e),this.scissorTest=!1,this.viewport=new me(0,0,t,e);const i={width:t,height:e,depth:n.depth},r=new Ke(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(t={}){const e={minFilter:pn,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(e.mapping=t.mapping),t.wrapS!==void 0&&(e.wrapS=t.wrapS),t.wrapT!==void 0&&(e.wrapT=t.wrapT),t.wrapR!==void 0&&(e.wrapR=t.wrapR),t.magFilter!==void 0&&(e.magFilter=t.magFilter),t.minFilter!==void 0&&(e.minFilter=t.minFilter),t.format!==void 0&&(e.format=t.format),t.type!==void 0&&(e.type=t.type),t.anisotropy!==void 0&&(e.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(e.colorSpace=t.colorSpace),t.flipY!==void 0&&(e.flipY=t.flipY),t.generateMipmaps!==void 0&&(e.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(e.internalFormat=t.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n,this.textures[i].isArrayTexture=this.textures[i].image.depth>1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;const i=Object.assign({},t.textures[e].image);this.textures[e].source=new ml(i)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Pi extends Ud{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class Hh extends Ke{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=mn,this.minFilter=mn,this.wrapR=An,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class Id extends Ke{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=mn,this.minFilter=mn,this.wrapR=An,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Bn{constructor(t=new O(1/0,1/0,1/0),e=new O(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(bn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(bn.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=bn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(n!==void 0){const r=n.getAttribute("position");if(e===!0&&r!==void 0&&t.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)t.isMesh===!0?t.getVertexPosition(a,bn):bn.fromBufferAttribute(r,a),bn.applyMatrix4(t.matrixWorld),this.expandByPoint(bn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),er.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),er.copy(n.boundingBox)),er.applyMatrix4(t.matrixWorld),this.union(er)}const i=t.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,bn),bn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Es),nr.subVectors(this.max,Es),Bi.subVectors(t.a,Es),ki.subVectors(t.b,Es),Vi.subVectors(t.c,Es),ni.subVectors(ki,Bi),ii.subVectors(Vi,ki),gi.subVectors(Bi,Vi);let e=[0,-ni.z,ni.y,0,-ii.z,ii.y,0,-gi.z,gi.y,ni.z,0,-ni.x,ii.z,0,-ii.x,gi.z,0,-gi.x,-ni.y,ni.x,0,-ii.y,ii.x,0,-gi.y,gi.x,0];return!wa(e,Bi,ki,Vi,nr)||(e=[1,0,0,0,1,0,0,0,1],!wa(e,Bi,ki,Vi,nr))?!1:(ir.crossVectors(ni,ii),e=[ir.x,ir.y,ir.z],wa(e,Bi,ki,Vi,nr))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,bn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(bn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Gn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Gn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Gn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Gn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Gn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Gn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Gn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Gn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Gn),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const Gn=[new O,new O,new O,new O,new O,new O,new O,new O],bn=new O,er=new Bn,Bi=new O,ki=new O,Vi=new O,ni=new O,ii=new O,gi=new O,Es=new O,nr=new O,ir=new O,_i=new O;function wa(s,t,e,n,i){for(let r=0,a=s.length-3;r<=a;r+=3){_i.fromArray(s,r);const o=i.x*Math.abs(_i.x)+i.y*Math.abs(_i.y)+i.z*Math.abs(_i.z),l=t.dot(_i),c=e.dot(_i),h=n.dot(_i);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const Nd=new Bn,ws=new O,Ta=new O;class ei{constructor(t=new O,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;e!==void 0?n.copy(e):Nd.setFromPoints(t).getCenter(n);let i=0;for(let r=0,a=t.length;r<a;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;ws.subVectors(t,this.center);const e=ws.lengthSq();if(e>this.radius*this.radius){const n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(ws,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Ta.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ws.copy(t.center).add(Ta)),this.expandByPoint(ws.copy(t.center).sub(Ta))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}const Wn=new O,Aa=new O,sr=new O,si=new O,Ra=new O,rr=new O,Ca=new O;class ms{constructor(t=new O,e=new O(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Wn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Wn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Wn.copy(this.origin).addScaledVector(this.direction,e),Wn.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Aa.copy(t).add(e).multiplyScalar(.5),sr.copy(e).sub(t).normalize(),si.copy(this.origin).sub(Aa);const r=t.distanceTo(e)*.5,a=-this.direction.dot(sr),o=si.dot(this.direction),l=-si.dot(sr),c=si.lengthSq(),h=Math.abs(1-a*a);let u,d,p,m;if(h>0)if(u=a*l-o,d=a*o-l,m=r*h,u>=0)if(d>=-m)if(d<=m){const _=1/h;u*=_,d*=_,p=u*(u+a*d+2*o)+d*(a*u+d+2*l)+c}else d=r,u=Math.max(0,-(a*d+o)),p=-u*u+d*(d+2*l)+c;else d=-r,u=Math.max(0,-(a*d+o)),p=-u*u+d*(d+2*l)+c;else d<=-m?(u=Math.max(0,-(-a*r+o)),d=u>0?-r:Math.min(Math.max(-r,-l),r),p=-u*u+d*(d+2*l)+c):d<=m?(u=0,d=Math.min(Math.max(-r,-l),r),p=d*(d+2*l)+c):(u=Math.max(0,-(a*r+o)),d=u>0?r:Math.min(Math.max(-r,-l),r),p=-u*u+d*(d+2*l)+c);else d=a>0?-r:r,u=Math.max(0,-(a*d+o)),p=-u*u+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Aa).addScaledVector(sr,d),p}intersectSphere(t,e){Wn.subVectors(t.center,this.origin);const n=Wn.dot(this.direction),i=Wn.dot(Wn)-n*n,r=t.radius*t.radius;if(i>r)return null;const a=Math.sqrt(r-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(t.min.x-d.x)*c,i=(t.max.x-d.x)*c):(n=(t.max.x-d.x)*c,i=(t.min.x-d.x)*c),h>=0?(r=(t.min.y-d.y)*h,a=(t.max.y-d.y)*h):(r=(t.max.y-d.y)*h,a=(t.min.y-d.y)*h),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),u>=0?(o=(t.min.z-d.z)*u,l=(t.max.z-d.z)*u):(o=(t.max.z-d.z)*u,l=(t.min.z-d.z)*u),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Wn)!==null}intersectTriangle(t,e,n,i,r){Ra.subVectors(e,t),rr.subVectors(n,t),Ca.crossVectors(Ra,rr);let a=this.direction.dot(Ca),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;si.subVectors(this.origin,t);const l=o*this.direction.dot(rr.crossVectors(si,rr));if(l<0)return null;const c=o*this.direction.dot(Ra.cross(si));if(c<0||l+c>a)return null;const h=-o*si.dot(Ca);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Zt{constructor(t,e,n,i,r,a,o,l,c,h,u,d,p,m,_,g){Zt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,r,a,o,l,c,h,u,d,p,m,_,g)}set(t,e,n,i,r,a,o,l,c,h,u,d,p,m,_,g){const f=this.elements;return f[0]=t,f[4]=e,f[8]=n,f[12]=i,f[1]=r,f[5]=a,f[9]=o,f[13]=l,f[2]=c,f[6]=h,f[10]=u,f[14]=d,f[3]=p,f[7]=m,f[11]=_,f[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Zt().fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/Hi.setFromMatrixColumn(t,0).length(),r=1/Hi.setFromMatrixColumn(t,1).length(),a=1/Hi.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const d=a*h,p=a*u,m=o*h,_=o*u;e[0]=l*h,e[4]=-l*u,e[8]=c,e[1]=p+m*c,e[5]=d-_*c,e[9]=-o*l,e[2]=_-d*c,e[6]=m+p*c,e[10]=a*l}else if(t.order==="YXZ"){const d=l*h,p=l*u,m=c*h,_=c*u;e[0]=d+_*o,e[4]=m*o-p,e[8]=a*c,e[1]=a*u,e[5]=a*h,e[9]=-o,e[2]=p*o-m,e[6]=_+d*o,e[10]=a*l}else if(t.order==="ZXY"){const d=l*h,p=l*u,m=c*h,_=c*u;e[0]=d-_*o,e[4]=-a*u,e[8]=m+p*o,e[1]=p+m*o,e[5]=a*h,e[9]=_-d*o,e[2]=-a*c,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const d=a*h,p=a*u,m=o*h,_=o*u;e[0]=l*h,e[4]=m*c-p,e[8]=d*c+_,e[1]=l*u,e[5]=_*c+d,e[9]=p*c-m,e[2]=-c,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const d=a*l,p=a*c,m=o*l,_=o*c;e[0]=l*h,e[4]=_-d*u,e[8]=m*u+p,e[1]=u,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=p*u+m,e[10]=d-_*u}else if(t.order==="XZY"){const d=a*l,p=a*c,m=o*l,_=o*c;e[0]=l*h,e[4]=-u,e[8]=c*h,e[1]=d*u+_,e[5]=a*h,e[9]=p*u-m,e[2]=m*u-p,e[6]=o*h,e[10]=_*u+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Fd,t,Od)}lookAt(t,e,n){const i=this.elements;return dn.subVectors(t,e),dn.lengthSq()===0&&(dn.z=1),dn.normalize(),ri.crossVectors(n,dn),ri.lengthSq()===0&&(Math.abs(n.z)===1?dn.x+=1e-4:dn.z+=1e-4,dn.normalize(),ri.crossVectors(n,dn)),ri.normalize(),ar.crossVectors(dn,ri),i[0]=ri.x,i[4]=ar.x,i[8]=dn.x,i[1]=ri.y,i[5]=ar.y,i[9]=dn.y,i[2]=ri.z,i[6]=ar.z,i[10]=dn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],u=n[5],d=n[9],p=n[13],m=n[2],_=n[6],g=n[10],f=n[14],b=n[3],w=n[7],S=n[11],I=n[15],L=i[0],P=i[4],D=i[8],M=i[12],y=i[1],U=i[5],B=i[9],k=i[13],q=i[2],J=i[6],z=i[10],tt=i[14],W=i[3],at=i[7],dt=i[11],mt=i[15];return r[0]=a*L+o*y+l*q+c*W,r[4]=a*P+o*U+l*J+c*at,r[8]=a*D+o*B+l*z+c*dt,r[12]=a*M+o*k+l*tt+c*mt,r[1]=h*L+u*y+d*q+p*W,r[5]=h*P+u*U+d*J+p*at,r[9]=h*D+u*B+d*z+p*dt,r[13]=h*M+u*k+d*tt+p*mt,r[2]=m*L+_*y+g*q+f*W,r[6]=m*P+_*U+g*J+f*at,r[10]=m*D+_*B+g*z+f*dt,r[14]=m*M+_*k+g*tt+f*mt,r[3]=b*L+w*y+S*q+I*W,r[7]=b*P+w*U+S*J+I*at,r[11]=b*D+w*B+S*z+I*dt,r[15]=b*M+w*k+S*tt+I*mt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],a=t[1],o=t[5],l=t[9],c=t[13],h=t[2],u=t[6],d=t[10],p=t[14],m=t[3],_=t[7],g=t[11],f=t[15];return m*(+r*l*u-i*c*u-r*o*d+n*c*d+i*o*p-n*l*p)+_*(+e*l*p-e*c*d+r*a*d-i*a*p+i*c*h-r*l*h)+g*(+e*c*u-e*o*p-r*a*u+n*a*p+r*o*h-n*c*h)+f*(-i*o*h-e*l*u+e*o*d+i*a*u-n*a*d+n*l*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],p=t[11],m=t[12],_=t[13],g=t[14],f=t[15],b=u*g*c-_*d*c+_*l*p-o*g*p-u*l*f+o*d*f,w=m*d*c-h*g*c-m*l*p+a*g*p+h*l*f-a*d*f,S=h*_*c-m*u*c+m*o*p-a*_*p-h*o*f+a*u*f,I=m*u*l-h*_*l-m*o*d+a*_*d+h*o*g-a*u*g,L=e*b+n*w+i*S+r*I;if(L===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/L;return t[0]=b*P,t[1]=(_*d*r-u*g*r-_*i*p+n*g*p+u*i*f-n*d*f)*P,t[2]=(o*g*r-_*l*r+_*i*c-n*g*c-o*i*f+n*l*f)*P,t[3]=(u*l*r-o*d*r-u*i*c+n*d*c+o*i*p-n*l*p)*P,t[4]=w*P,t[5]=(h*g*r-m*d*r+m*i*p-e*g*p-h*i*f+e*d*f)*P,t[6]=(m*l*r-a*g*r-m*i*c+e*g*c+a*i*f-e*l*f)*P,t[7]=(a*d*r-h*l*r+h*i*c-e*d*c-a*i*p+e*l*p)*P,t[8]=S*P,t[9]=(m*u*r-h*_*r-m*n*p+e*_*p+h*n*f-e*u*f)*P,t[10]=(a*_*r-m*o*r+m*n*c-e*_*c-a*n*f+e*o*f)*P,t[11]=(h*o*r-a*u*r-h*n*c+e*u*c+a*n*p-e*o*p)*P,t[12]=I*P,t[13]=(h*_*i-m*u*i+m*n*d-e*_*d-h*n*g+e*u*g)*P,t[14]=(m*o*i-a*_*i-m*n*l+e*_*l+a*n*g-e*o*g)*P,t[15]=(a*u*i-h*o*i+h*n*l-e*u*l-a*n*d+e*o*d)*P,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,a=t.x,o=t.y,l=t.z,c=r*a,h=r*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,r*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,a){return this.set(1,n,r,0,t,1,a,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,a=e._y,o=e._z,l=e._w,c=r+r,h=a+a,u=o+o,d=r*c,p=r*h,m=r*u,_=a*h,g=a*u,f=o*u,b=l*c,w=l*h,S=l*u,I=n.x,L=n.y,P=n.z;return i[0]=(1-(_+f))*I,i[1]=(p+S)*I,i[2]=(m-w)*I,i[3]=0,i[4]=(p-S)*L,i[5]=(1-(d+f))*L,i[6]=(g+b)*L,i[7]=0,i[8]=(m+w)*P,i[9]=(g-b)*P,i[10]=(1-(d+_))*P,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=Hi.set(i[0],i[1],i[2]).length();const a=Hi.set(i[4],i[5],i[6]).length(),o=Hi.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],En.copy(this);const c=1/r,h=1/a,u=1/o;return En.elements[0]*=c,En.elements[1]*=c,En.elements[2]*=c,En.elements[4]*=h,En.elements[5]*=h,En.elements[6]*=h,En.elements[8]*=u,En.elements[9]*=u,En.elements[10]*=u,e.setFromRotationMatrix(En),n.x=r,n.y=a,n.z=o,this}makePerspective(t,e,n,i,r,a,o=Jn){const l=this.elements,c=2*r/(e-t),h=2*r/(n-i),u=(e+t)/(e-t),d=(n+i)/(n-i);let p,m;if(o===Jn)p=-(a+r)/(a-r),m=-2*a*r/(a-r);else if(o===Qr)p=-a/(a-r),m=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,r,a,o=Jn){const l=this.elements,c=1/(e-t),h=1/(n-i),u=1/(a-r),d=(e+t)*c,p=(n+i)*h;let m,_;if(o===Jn)m=(a+r)*u,_=-2*u;else if(o===Qr)m=r*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Hi=new O,En=new Zt,Fd=new O(0,0,0),Od=new O(1,1,1),ri=new O,ar=new O,dn=new O,Yl=new Zt,$l=new gn;class un{constructor(t=0,e=0,n=0,i=un.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],u=i[2],d=i[6],p=i[10];switch(e){case"XYZ":this._y=Math.asin(pe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-pe(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(pe(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-pe(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(pe(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-pe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Yl.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Yl,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return $l.setFromEuler(this),this.setFromQuaternion($l,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}un.DEFAULT_ORDER="XYZ";class gl{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let zd=0;const Kl=new O,Gi=new gn,Xn=new Zt,or=new O,Ts=new O,Bd=new O,kd=new gn,Jl=new O(1,0,0),Zl=new O(0,1,0),Ql=new O(0,0,1),tc={type:"added"},Vd={type:"removed"},Wi={type:"childadded",child:null},La={type:"childremoved",child:null};class Ce extends Di{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:zd++}),this.uuid=Rn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ce.DEFAULT_UP.clone();const t=new O,e=new un,n=new gn,i=new O(1,1,1);function r(){n.setFromEuler(e,!1)}function a(){e.setFromQuaternion(n,void 0,!1)}e._onChange(r),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Zt},normalMatrix:{value:new he}}),this.matrix=new Zt,this.matrixWorld=new Zt,this.matrixAutoUpdate=Ce.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Ce.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new gl,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Gi.setFromAxisAngle(t,e),this.quaternion.multiply(Gi),this}rotateOnWorldAxis(t,e){return Gi.setFromAxisAngle(t,e),this.quaternion.premultiply(Gi),this}rotateX(t){return this.rotateOnAxis(Jl,t)}rotateY(t){return this.rotateOnAxis(Zl,t)}rotateZ(t){return this.rotateOnAxis(Ql,t)}translateOnAxis(t,e){return Kl.copy(t).applyQuaternion(this.quaternion),this.position.add(Kl.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Jl,t)}translateY(t){return this.translateOnAxis(Zl,t)}translateZ(t){return this.translateOnAxis(Ql,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Xn.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?or.copy(t):or.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Ts.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Xn.lookAt(Ts,or,this.up):Xn.lookAt(or,Ts,this.up),this.quaternion.setFromRotationMatrix(Xn),i&&(Xn.extractRotation(i.matrixWorld),Gi.setFromRotationMatrix(Xn),this.quaternion.premultiply(Gi.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(tc),Wi.child=t,this.dispatchEvent(Wi),Wi.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Vd),La.child=t,this.dispatchEvent(La),La.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Xn.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Xn.multiply(t.parent.matrixWorld)),t.applyMatrix4(Xn),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(tc),Wi.child=t,this.dispatchEvent(Wi),Wi.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(t,e);if(a!==void 0)return a}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ts,t,Bd),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ts,kd,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)}updateWorldMatrix(t,e){const n=this.parent;if(t===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),e===!0){const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(t),i.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const u=l[c];r(t.shapes,u)}else r(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(r(t.materials,this.material[l]));i.material=o}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(r(t.animations,l))}}if(e){const o=a(t.geometries),l=a(t.materials),c=a(t.textures),h=a(t.images),u=a(t.shapes),d=a(t.skeletons),p=a(t.animations),m=a(t.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),p.length>0&&(n.animations=p),m.length>0&&(n.nodes=m)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){const i=t.children[n];this.add(i.clone())}return this}}Ce.DEFAULT_UP=new O(0,1,0);Ce.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ce.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const wn=new O,qn=new O,Pa=new O,jn=new O,Xi=new O,qi=new O,ec=new O,Da=new O,Ua=new O,Ia=new O,Na=new me,Fa=new me,Oa=new me;class xn{constructor(t=new O,e=new O,n=new O){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),wn.subVectors(t,e),i.cross(wn);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){wn.subVectors(i,e),qn.subVectors(n,e),Pa.subVectors(t,e);const a=wn.dot(wn),o=wn.dot(qn),l=wn.dot(Pa),c=qn.dot(qn),h=qn.dot(Pa),u=a*c-o*o;if(u===0)return r.set(0,0,0),null;const d=1/u,p=(c*l-o*h)*d,m=(a*h-o*l)*d;return r.set(1-p-m,m,p)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,jn)===null?!1:jn.x>=0&&jn.y>=0&&jn.x+jn.y<=1}static getInterpolation(t,e,n,i,r,a,o,l){return this.getBarycoord(t,e,n,i,jn)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,jn.x),l.addScaledVector(a,jn.y),l.addScaledVector(o,jn.z),l)}static getInterpolatedAttribute(t,e,n,i,r,a){return Na.setScalar(0),Fa.setScalar(0),Oa.setScalar(0),Na.fromBufferAttribute(t,e),Fa.fromBufferAttribute(t,n),Oa.fromBufferAttribute(t,i),a.setScalar(0),a.addScaledVector(Na,r.x),a.addScaledVector(Fa,r.y),a.addScaledVector(Oa,r.z),a}static isFrontFacing(t,e,n,i){return wn.subVectors(n,e),qn.subVectors(t,e),wn.cross(qn).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return wn.subVectors(this.c,this.b),qn.subVectors(this.a,this.b),wn.cross(qn).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return xn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return xn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,r){return xn.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return xn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return xn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let a,o;Xi.subVectors(i,n),qi.subVectors(r,n),Da.subVectors(t,n);const l=Xi.dot(Da),c=qi.dot(Da);if(l<=0&&c<=0)return e.copy(n);Ua.subVectors(t,i);const h=Xi.dot(Ua),u=qi.dot(Ua);if(h>=0&&u<=h)return e.copy(i);const d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(n).addScaledVector(Xi,a);Ia.subVectors(t,r);const p=Xi.dot(Ia),m=qi.dot(Ia);if(m>=0&&p<=m)return e.copy(r);const _=p*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),e.copy(n).addScaledVector(qi,o);const g=h*m-p*u;if(g<=0&&u-h>=0&&p-m>=0)return ec.subVectors(r,i),o=(u-h)/(u-h+(p-m)),e.copy(i).addScaledVector(ec,o);const f=1/(g+_+d);return a=_*f,o=d*f,e.copy(n).addScaledVector(Xi,a).addScaledVector(qi,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Gh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ai={h:0,s:0,l:0},lr={h:0,s:0,l:0};function za(s,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?s+(t-s)*6*e:e<1/2?t:e<2/3?s+(t-s)*6*(2/3-e):s}class qt{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){const i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Me){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,fe.colorSpaceToWorking(this,e),this}setRGB(t,e,n,i=fe.workingColorSpace){return this.r=t,this.g=e,this.b=n,fe.colorSpaceToWorking(this,i),this}setHSL(t,e,n,i=fe.workingColorSpace){if(t=pl(t,1),e=pe(e,0,1),n=pe(n,0,1),e===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=za(a,r,t+1/3),this.g=za(a,r,t),this.b=za(a,r,t-1/3)}return fe.colorSpaceToWorking(this,i),this}setStyle(t,e=Me){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const r=i[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Me){const n=Gh[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Qn(t.r),this.g=Qn(t.g),this.b=Qn(t.b),this}copyLinearToSRGB(t){return this.r=os(t.r),this.g=os(t.g),this.b=os(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Me){return fe.workingToColorSpace(Qe.copy(this),t),Math.round(pe(Qe.r*255,0,255))*65536+Math.round(pe(Qe.g*255,0,255))*256+Math.round(pe(Qe.b*255,0,255))}getHexString(t=Me){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=fe.workingColorSpace){fe.workingToColorSpace(Qe.copy(this),e);const n=Qe.r,i=Qe.g,r=Qe.b,a=Math.max(n,i,r),o=Math.min(n,i,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case n:l=(i-r)/u+(i<r?6:0);break;case i:l=(r-n)/u+2;break;case r:l=(n-i)/u+4;break}l/=6}return t.h=l,t.s=c,t.l=h,t}getRGB(t,e=fe.workingColorSpace){return fe.workingToColorSpace(Qe.copy(this),e),t.r=Qe.r,t.g=Qe.g,t.b=Qe.b,t}getStyle(t=Me){fe.workingToColorSpace(Qe.copy(this),t);const e=Qe.r,n=Qe.g,i=Qe.b;return t!==Me?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){return this.getHSL(ai),this.setHSL(ai.h+t,ai.s+e,ai.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(ai),t.getHSL(lr);const n=Fs(ai.h,lr.h,e),i=Fs(ai.s,lr.s,e),r=Fs(ai.l,lr.l,e);return this.setHSL(n,i,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.elements;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Qe=new qt;qt.NAMES=Gh;let Hd=0;class Mn extends Di{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Hd++}),this.uuid=Rn(),this.name="",this.type="Material",this.blending=rs,this.side=Cn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=co,this.blendDst=ho,this.blendEquation=wi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new qt(0,0,0),this.blendAlpha=0,this.depthFunc=ls,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Vl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Oi,this.stencilZFail=Oi,this.stencilZPass=Oi,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==rs&&(n.blending=this.blending),this.side!==Cn&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==co&&(n.blendSrc=this.blendSrc),this.blendDst!==ho&&(n.blendDst=this.blendDst),this.blendEquation!==wi&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==ls&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Vl&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Oi&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Oi&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Oi&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(e){const r=i(t.textures),a=i(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(e!==null){const i=e.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class pi extends Mn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new qt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new un,this.combine=ra,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Be=new O,cr=new Qt;let Gd=0;class Oe{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Gd++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=$o,this.updateRanges=[],this.gpuType=Fn,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)cr.fromBufferAttribute(this,e),cr.applyMatrix3(t),this.setXY(e,cr.x,cr.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Be.fromBufferAttribute(this,e),Be.applyMatrix3(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Be.fromBufferAttribute(this,e),Be.applyMatrix4(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Be.fromBufferAttribute(this,e),Be.applyNormalMatrix(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Be.fromBufferAttribute(this,e),Be.transformDirection(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Tn(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Ae(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Tn(e,this.array)),e}setX(t,e){return this.normalized&&(e=Ae(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Tn(e,this.array)),e}setY(t,e){return this.normalized&&(e=Ae(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Tn(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Ae(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Tn(e,this.array)),e}setW(t,e){return this.normalized&&(e=Ae(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Ae(e,this.array),n=Ae(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Ae(e,this.array),n=Ae(n,this.array),i=Ae(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Ae(e,this.array),n=Ae(n,this.array),i=Ae(i,this.array),r=Ae(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==$o&&(t.usage=this.usage),t}}class Wh extends Oe{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class Wd extends Oe{constructor(t,e,n){super(new Int32Array(t),e,n)}}class Xh extends Oe{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class de extends Oe{constructor(t,e,n){super(new Float32Array(t),e,n)}}let Xd=0;const _n=new Zt,Ba=new Ce,ji=new O,fn=new Bn,As=new Bn,We=new O;class Ne extends Di{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Xd++}),this.uuid=Rn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(Vh(t)?Xh:Wh)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new he().getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return _n.makeRotationFromQuaternion(t),this.applyMatrix4(_n),this}rotateX(t){return _n.makeRotationX(t),this.applyMatrix4(_n),this}rotateY(t){return _n.makeRotationY(t),this.applyMatrix4(_n),this}rotateZ(t){return _n.makeRotationZ(t),this.applyMatrix4(_n),this}translate(t,e,n){return _n.makeTranslation(t,e,n),this.applyMatrix4(_n),this}scale(t,e,n){return _n.makeScale(t,e,n),this.applyMatrix4(_n),this}lookAt(t){return Ba.lookAt(t),Ba.updateMatrix(),this.applyMatrix4(Ba.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ji).negate(),this.translate(ji.x,ji.y,ji.z),this}setFromPoints(t){const e=this.getAttribute("position");if(e===void 0){const n=[];for(let i=0,r=t.length;i<r;i++){const a=t[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new de(n,3))}else{const n=Math.min(t.length,e.count);for(let i=0;i<n;i++){const r=t[i];e.setXYZ(i,r.x,r.y,r.z||0)}t.length>e.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Bn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new O(-1/0,-1/0,-1/0),new O(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){const r=e[n];fn.setFromBufferAttribute(r),this.morphTargetsRelative?(We.addVectors(this.boundingBox.min,fn.min),this.boundingBox.expandByPoint(We),We.addVectors(this.boundingBox.max,fn.max),this.boundingBox.expandByPoint(We)):(this.boundingBox.expandByPoint(fn.min),this.boundingBox.expandByPoint(fn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ei);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new O,1/0);return}if(t){const n=this.boundingSphere.center;if(fn.setFromBufferAttribute(t),e)for(let r=0,a=e.length;r<a;r++){const o=e[r];As.setFromBufferAttribute(o),this.morphTargetsRelative?(We.addVectors(fn.min,As.min),fn.expandByPoint(We),We.addVectors(fn.max,As.max),fn.expandByPoint(We)):(fn.expandByPoint(As.min),fn.expandByPoint(As.max))}fn.getCenter(n);let i=0;for(let r=0,a=t.count;r<a;r++)We.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(We));if(e)for(let r=0,a=e.length;r<a;r++){const o=e[r],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)We.fromBufferAttribute(o,c),l&&(ji.fromBufferAttribute(t,c),We.add(ji)),i=Math.max(i,n.distanceToSquared(We))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=e.position,i=e.normal,r=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Oe(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let D=0;D<n.count;D++)o[D]=new O,l[D]=new O;const c=new O,h=new O,u=new O,d=new Qt,p=new Qt,m=new Qt,_=new O,g=new O;function f(D,M,y){c.fromBufferAttribute(n,D),h.fromBufferAttribute(n,M),u.fromBufferAttribute(n,y),d.fromBufferAttribute(r,D),p.fromBufferAttribute(r,M),m.fromBufferAttribute(r,y),h.sub(c),u.sub(c),p.sub(d),m.sub(d);const U=1/(p.x*m.y-m.x*p.y);isFinite(U)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(u,-p.y).multiplyScalar(U),g.copy(u).multiplyScalar(p.x).addScaledVector(h,-m.x).multiplyScalar(U),o[D].add(_),o[M].add(_),o[y].add(_),l[D].add(g),l[M].add(g),l[y].add(g))}let b=this.groups;b.length===0&&(b=[{start:0,count:t.count}]);for(let D=0,M=b.length;D<M;++D){const y=b[D],U=y.start,B=y.count;for(let k=U,q=U+B;k<q;k+=3)f(t.getX(k+0),t.getX(k+1),t.getX(k+2))}const w=new O,S=new O,I=new O,L=new O;function P(D){I.fromBufferAttribute(i,D),L.copy(I);const M=o[D];w.copy(M),w.sub(I.multiplyScalar(I.dot(M))).normalize(),S.crossVectors(L,M);const U=S.dot(l[D])<0?-1:1;a.setXYZW(D,w.x,w.y,w.z,U)}for(let D=0,M=b.length;D<M;++D){const y=b[D],U=y.start,B=y.count;for(let k=U,q=U+B;k<q;k+=3)P(t.getX(k+0)),P(t.getX(k+1)),P(t.getX(k+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Oe(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let d=0,p=n.count;d<p;d++)n.setXYZ(d,0,0,0);const i=new O,r=new O,a=new O,o=new O,l=new O,c=new O,h=new O,u=new O;if(t)for(let d=0,p=t.count;d<p;d+=3){const m=t.getX(d+0),_=t.getX(d+1),g=t.getX(d+2);i.fromBufferAttribute(e,m),r.fromBufferAttribute(e,_),a.fromBufferAttribute(e,g),h.subVectors(a,r),u.subVectors(i,r),h.cross(u),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,g),o.add(h),l.add(h),c.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(let d=0,p=e.count;d<p;d+=3)i.fromBufferAttribute(e,d+0),r.fromBufferAttribute(e,d+1),a.fromBufferAttribute(e,d+2),h.subVectors(a,r),u.subVectors(i,r),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)We.fromBufferAttribute(t,e),We.normalize(),t.setXYZ(e,We.x,We.y,We.z)}toNonIndexed(){function t(o,l){const c=o.array,h=o.itemSize,u=o.normalized,d=new c.constructor(l.length*h);let p=0,m=0;for(let _=0,g=l.length;_<g;_++){o.isInterleavedBufferAttribute?p=l[_]*o.data.stride+o.offset:p=l[_]*h;for(let f=0;f<h;f++)d[m++]=c[p++]}return new Oe(d,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Ne,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=t(l,n);e.setAttribute(o,c)}const r=this.morphAttributes;for(const o in r){const l=[],c=r[o];for(let h=0,u=c.length;h<u;h++){const d=c[h],p=t(d,n);l.push(p)}e.morphAttributes[o]=l}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const l in n){const c=n[l];t.data.attributes[l]=c.toJSON(t.data)}const i={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u<d;u++){const p=c[u];h.push(p.toJSON(t.data))}h.length>0&&(i[l]=h,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere=o.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;n!==null&&this.setIndex(n.clone());const i=t.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(e))}const r=t.morphAttributes;for(const c in r){const h=[],u=r[c];for(let d=0,p=u.length;d<p;d++)h.push(u[d].clone(e));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;const a=t.groups;for(let c=0,h=a.length;c<h;c++){const u=a[c];this.addGroup(u.start,u.count,u.materialIndex)}const o=t.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const nc=new Zt,vi=new ms,hr=new ei,ic=new O,ur=new O,dr=new O,fr=new O,ka=new O,pr=new O,sc=new O,mr=new O;class be extends Ce{constructor(t=new Ne,e=new pi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){const i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(t,e){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const o=this.morphTargetInfluences;if(r&&o){pr.set(0,0,0);for(let l=0,c=r.length;l<c;l++){const h=o[l],u=r[l];h!==0&&(ka.fromBufferAttribute(u,t),a?pr.addScaledVector(ka,h):pr.addScaledVector(ka.sub(e),h))}e.add(pr)}return e}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),hr.copy(n.boundingSphere),hr.applyMatrix4(r),vi.copy(t.ray).recast(t.near),!(hr.containsPoint(vi.origin)===!1&&(vi.intersectSphere(hr,ic)===null||vi.origin.distanceToSquared(ic)>(t.far-t.near)**2))&&(nc.copy(r).invert(),vi.copy(t.ray).applyMatrix4(nc),!(n.boundingBox!==null&&vi.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,vi)))}_computeIntersections(t,e,n){let i;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,d=r.groups,p=r.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],f=a[g.materialIndex],b=Math.max(g.start,p.start),w=Math.min(o.count,Math.min(g.start+g.count,p.start+p.count));for(let S=b,I=w;S<I;S+=3){const L=o.getX(S),P=o.getX(S+1),D=o.getX(S+2);i=gr(this,f,t,n,c,h,u,L,P,D),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=g.materialIndex,e.push(i))}}else{const m=Math.max(0,p.start),_=Math.min(o.count,p.start+p.count);for(let g=m,f=_;g<f;g+=3){const b=o.getX(g),w=o.getX(g+1),S=o.getX(g+2);i=gr(this,a,t,n,c,h,u,b,w,S),i&&(i.faceIndex=Math.floor(g/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],f=a[g.materialIndex],b=Math.max(g.start,p.start),w=Math.min(l.count,Math.min(g.start+g.count,p.start+p.count));for(let S=b,I=w;S<I;S+=3){const L=S,P=S+1,D=S+2;i=gr(this,f,t,n,c,h,u,L,P,D),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=g.materialIndex,e.push(i))}}else{const m=Math.max(0,p.start),_=Math.min(l.count,p.start+p.count);for(let g=m,f=_;g<f;g+=3){const b=g,w=g+1,S=g+2;i=gr(this,a,t,n,c,h,u,b,w,S),i&&(i.faceIndex=Math.floor(g/3),e.push(i))}}}}function qd(s,t,e,n,i,r,a,o){let l;if(t.side===rn?l=n.intersectTriangle(a,r,i,!0,o):l=n.intersectTriangle(i,r,a,t.side===Cn,o),l===null)return null;mr.copy(o),mr.applyMatrix4(s.matrixWorld);const c=e.ray.origin.distanceTo(mr);return c<e.near||c>e.far?null:{distance:c,point:mr.clone(),object:s}}function gr(s,t,e,n,i,r,a,o,l,c){s.getVertexPosition(o,ur),s.getVertexPosition(l,dr),s.getVertexPosition(c,fr);const h=qd(s,t,e,n,ur,dr,fr,sc);if(h){const u=new O;xn.getBarycoord(sc,ur,dr,fr,u),i&&(h.uv=xn.getInterpolatedAttribute(i,o,l,c,u,new Qt)),r&&(h.uv1=xn.getInterpolatedAttribute(r,o,l,c,u,new Qt)),a&&(h.normal=xn.getInterpolatedAttribute(a,o,l,c,u,new O),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new O,materialIndex:0};xn.getNormal(ur,dr,fr,d.normal),h.face=d,h.barycoord=u}return h}class gs extends Ne{constructor(t=1,e=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const o=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],u=[];let d=0,p=0;m("z","y","x",-1,-1,n,e,t,a,r,0),m("z","y","x",1,-1,n,e,-t,a,r,1),m("x","z","y",1,1,t,n,e,i,a,2),m("x","z","y",1,-1,t,n,-e,i,a,3),m("x","y","z",1,-1,t,e,n,i,r,4),m("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(l),this.setAttribute("position",new de(c,3)),this.setAttribute("normal",new de(h,3)),this.setAttribute("uv",new de(u,2));function m(_,g,f,b,w,S,I,L,P,D,M){const y=S/P,U=I/D,B=S/2,k=I/2,q=L/2,J=P+1,z=D+1;let tt=0,W=0;const at=new O;for(let dt=0;dt<z;dt++){const mt=dt*U-k;for(let Rt=0;Rt<J;Rt++){const wt=Rt*y-B;at[_]=wt*b,at[g]=mt*w,at[f]=q,c.push(at.x,at.y,at.z),at[_]=0,at[g]=0,at[f]=L>0?1:-1,h.push(at.x,at.y,at.z),u.push(Rt/P),u.push(1-dt/D),tt+=1}}for(let dt=0;dt<D;dt++)for(let mt=0;mt<P;mt++){const Rt=d+mt+J*dt,wt=d+mt+J*(dt+1),X=d+(mt+1)+J*(dt+1),Z=d+(mt+1)+J*dt;l.push(Rt,wt,Z),l.push(wt,X,Z),W+=6}o.addGroup(p,W,M),p+=W,d+=tt}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new gs(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function fs(s){const t={};for(const e in s){t[e]={};for(const n in s[e]){const i=s[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function sn(s){const t={};for(let e=0;e<s.length;e++){const n=fs(s[e]);for(const i in n)t[i]=n[i]}return t}function jd(s){const t=[];for(let e=0;e<s.length;e++)t.push(s[e].clone());return t}function qh(s){const t=s.getRenderTarget();return t===null?s.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:fe.workingColorSpace}const _l={clone:fs,merge:sn};var Yd=`void main() {
6
6
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
7
- }`,cf=`void main() {
7
+ }`,$d=`void main() {
8
8
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
9
- }`;class ti extends Mn{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=lf,this.fragmentShader=cf,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ps(t.uniforms),this.uniformsGroups=of(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?e.uniforms[i]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?e.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?e.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?e.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?e.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?e.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?e.uniforms[i]={type:"m4",value:a.toArray()}:e.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class iu extends Ce{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Yt,this.projectionMatrix=new Yt,this.projectionMatrixInverse=new Yt,this.coordinateSystem=Kn}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const li=new N,pc=new Dt,mc=new Dt;class Je extends iu{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=fs*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Fs*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return fs*2*Math.atan(Math.tan(Fs*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){li.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(li.x,li.y).multiplyScalar(-t/li.z),li.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(li.x,li.y).multiplyScalar(-t/li.z)}getViewSize(t,e){return this.getViewBounds(t,pc,mc),e.subVectors(mc,pc)}setViewOffset(t,e,n,i,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(Fs*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*i/l,e-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Ji=-90,$i=1;class hf extends Ce{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Je(Ji,$i,t,e);i.layers=this.layers,this.add(i);const r=new Je(Ji,$i,t,e);r.layers=this.layers,this.add(r);const a=new Je(Ji,$i,t,e);a.layers=this.layers,this.add(a);const o=new Je(Ji,$i,t,e);o.layers=this.layers,this.add(o);const l=new Je(Ji,$i,t,e);l.layers=this.layers,this.add(l);const c=new Je(Ji,$i,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,a,o,l]=e;for(const c of e)this.remove(c);if(t===Kn)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===ia)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,u=t.getRenderTarget(),d=t.getActiveCubeFace(),f=t.getActiveMipmapLevel(),m=t.xr.enabled;t.xr.enabled=!1;const _=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,r),t.setRenderTarget(n,1,i),t.render(e,a),t.setRenderTarget(n,2,i),t.render(e,o),t.setRenderTarget(n,3,i),t.render(e,l),t.setRenderTarget(n,4,i),t.render(e,c),n.texture.generateMipmaps=_,t.setRenderTarget(n,5,i),t.render(e,h),t.setRenderTarget(u,d,f),t.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class su extends $e{constructor(t=[],e=hs,n,i,r,a,o,l,c,h){super(t,e,n,i,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class uf extends Di{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new su(i),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`
9
+ }`;class ti extends Mn{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Yd,this.fragmentShader=$d,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=fs(t.uniforms),this.uniformsGroups=jd(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?e.uniforms[i]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?e.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?e.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?e.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?e.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?e.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?e.uniforms[i]={type:"m4",value:a.toArray()}:e.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class jh extends Ce{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Zt,this.projectionMatrix=new Zt,this.projectionMatrixInverse=new Zt,this.coordinateSystem=Jn}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const oi=new O,rc=new Qt,ac=new Qt;class $e extends jh{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=ds*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Ns*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return ds*2*Math.atan(Math.tan(Ns*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){oi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(oi.x,oi.y).multiplyScalar(-t/oi.z),oi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(oi.x,oi.y).multiplyScalar(-t/oi.z)}getViewSize(t,e){return this.getViewBounds(t,rc,ac),e.subVectors(ac,rc)}setViewOffset(t,e,n,i,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(Ns*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*i/l,e-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Yi=-90,$i=1;class Kd extends Ce{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new $e(Yi,$i,t,e);i.layers=this.layers,this.add(i);const r=new $e(Yi,$i,t,e);r.layers=this.layers,this.add(r);const a=new $e(Yi,$i,t,e);a.layers=this.layers,this.add(a);const o=new $e(Yi,$i,t,e);o.layers=this.layers,this.add(o);const l=new $e(Yi,$i,t,e);l.layers=this.layers,this.add(l);const c=new $e(Yi,$i,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,a,o,l]=e;for(const c of e)this.remove(c);if(t===Jn)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Qr)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,u=t.getRenderTarget(),d=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),m=t.xr.enabled;t.xr.enabled=!1;const _=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,r),t.setRenderTarget(n,1,i),t.render(e,a),t.setRenderTarget(n,2,i),t.render(e,o),t.setRenderTarget(n,3,i),t.render(e,l),t.setRenderTarget(n,4,i),t.render(e,c),n.texture.generateMipmaps=_,t.setRenderTarget(n,5,i),t.render(e,h),t.setRenderTarget(u,d,p),t.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class Yh extends Ke{constructor(t=[],e=cs,n,i,r,a,o,l,c,h){super(t,e,n,i,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Jd extends Pi{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Yh(i),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`
10
10
 
11
11
  varying vec3 vWorldDirection;
12
12
 
@@ -41,13 +41,13 @@
41
41
  gl_FragColor = texture2D( tEquirect, sampleUV );
42
42
 
43
43
  }
44
- `},i=new _s(5,5,5),r=new ti({name:"CubemapFromEquirect",uniforms:ps(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:rn,blending:di});r.uniforms.tEquirect.value=e;const a=new be(i,r),o=e.minFilter;return e.minFilter===$n&&(e.minFilter=pn),new hf(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e=!0,n=!0,i=!0){const r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,i);t.setRenderTarget(r)}}class Zn extends Ce{constructor(){super(),this.isGroup=!0,this.type="Group"}}const df={type:"move"};class Xa{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Zn,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Zn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new N,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new N),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Zn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new N,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new N),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const _ of t.hand.values()){const g=e.getJointPose(_,n),p=this._getHandJoint(c,_);g!==null&&(p.matrix.fromArray(g.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=g.radius),p.visible=g!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,m=.005;c.inputState.pinching&&d>f+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=f-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&r!==null&&(i=r),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(df)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const n=new Zn;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class wl extends Ce{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new un,this.environmentIntensity=1,this.environmentRotation=new un,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class ru{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=nl,this.updateRanges=[],this.version=0,this.uuid=Rn()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Rn()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Rn()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const nn=new N;class On{constructor(t,e,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)nn.fromBufferAttribute(this,e),nn.applyMatrix4(t),this.setXYZ(e,nn.x,nn.y,nn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)nn.fromBufferAttribute(this,e),nn.applyNormalMatrix(t),this.setXYZ(e,nn.x,nn.y,nn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)nn.fromBufferAttribute(this,e),nn.transformDirection(t),this.setXYZ(e,nn.x,nn.y,nn.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=An(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Te(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=Te(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Te(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Te(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Te(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=An(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=An(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=An(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=An(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Te(e,this.array),n=Te(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Te(e,this.array),n=Te(n,this.array),i=Te(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Te(e,this.array),n=Te(n,this.array),i=Te(i,this.array),r=Te(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)e.push(this.data.array[i+r])}return new Oe(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new On(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)e.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class ua extends Mn{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new jt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let Ki;const Cs=new N,Zi=new N,Qi=new N,ts=new Dt,Ls=new Dt,au=new Yt,yr=new N,Ps=new N,Mr=new N,gc=new Dt,qa=new Dt,_c=new Dt;class Al extends Ce{constructor(t=new ua){if(super(),this.isSprite=!0,this.type="Sprite",Ki===void 0){Ki=new Ie;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new ru(e,5);Ki.setIndex([0,1,2,0,2,3]),Ki.setAttribute("position",new On(n,3,0,!1)),Ki.setAttribute("uv",new On(n,2,3,!1))}this.geometry=Ki,this.material=t,this.center=new Dt(.5,.5),this.count=1}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Zi.setFromMatrixScale(this.matrixWorld),au.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Qi.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Zi.multiplyScalar(-Qi.z);const n=this.material.rotation;let i,r;n!==0&&(r=Math.cos(n),i=Math.sin(n));const a=this.center;Sr(yr.set(-.5,-.5,0),Qi,a,Zi,i,r),Sr(Ps.set(.5,-.5,0),Qi,a,Zi,i,r),Sr(Mr.set(.5,.5,0),Qi,a,Zi,i,r),gc.set(0,0),qa.set(1,0),_c.set(1,1);let o=t.ray.intersectTriangle(yr,Ps,Mr,!1,Cs);if(o===null&&(Sr(Ps.set(-.5,.5,0),Qi,a,Zi,i,r),qa.set(0,1),o=t.ray.intersectTriangle(yr,Mr,Ps,!1,Cs),o===null))return;const l=t.ray.origin.distanceTo(Cs);l<t.near||l>t.far||e.push({distance:l,point:Cs.clone(),uv:xn.getInterpolation(Cs,yr,Ps,Mr,gc,qa,_c,new Dt),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function Sr(s,t,e,n,i,r){ts.subVectors(s,e).addScalar(.5).multiply(n),i!==void 0?(Ls.x=r*ts.x-i*ts.y,Ls.y=i*ts.x+r*ts.y):Ls.copy(ts),s.copy(t),s.x+=Ls.x,s.y+=Ls.y,s.applyMatrix4(au)}const br=new N,vc=new N;class ff extends Ce{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let n=0,i=e.length;n<i;n++){const r=e[n];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0,n=0){e=Math.abs(e);const i=this.levels;let r;for(r=0;r<i.length&&!(e<i[r].distance);r++);return i.splice(r,0,{distance:e,hysteresis:n,object:t}),this.add(t),this}removeLevel(t){const e=this.levels;for(let n=0;n<e.length;n++)if(e[n].distance===t){const i=e.splice(n,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){const e=this.levels;if(e.length>0){let n,i;for(n=1,i=e.length;n<i;n++){let r=e[n].distance;if(e[n].object.visible&&(r-=r*e[n].hysteresis),t<r)break}return e[n-1].object}return null}raycast(t,e){if(this.levels.length>0){br.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(br);this.getObjectForDistance(i).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){br.setFromMatrixPosition(t.matrixWorld),vc.setFromMatrixPosition(this.matrixWorld);const n=br.distanceTo(vc)/t.zoom;e[0].object.visible=!0;let i,r;for(i=1,r=e.length;i<r;i++){let a=e[i].distance;if(e[i].object.visible&&(a-=a*e[i].hysteresis),n>=a)e[i-1].object.visible=!1,e[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<r;i++)e[i].object.visible=!1}}toJSON(t){const e=super.toJSON(t);this.autoUpdate===!1&&(e.object.autoUpdate=!1),e.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const a=n[i];e.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return e}}const xc=new N,yc=new me,Mc=new me,pf=new N,Sc=new Yt,Er=new N,ja=new ei,bc=new Yt,Ya=new gs;class mf extends be{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=ql,this.bindMatrix=new Yt,this.bindMatrixInverse=new Yt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const t=this.geometry;this.boundingBox===null&&(this.boundingBox=new Bn),this.boundingBox.makeEmpty();const e=t.getAttribute("position");for(let n=0;n<e.count;n++)this.getVertexPosition(n,Er),this.boundingBox.expandByPoint(Er)}computeBoundingSphere(){const t=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new ei),this.boundingSphere.makeEmpty();const e=t.getAttribute("position");for(let n=0;n<e.count;n++)this.getVertexPosition(n,Er),this.boundingSphere.expandByPoint(Er)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone()),t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),ja.copy(this.boundingSphere),ja.applyMatrix4(i),t.ray.intersectsSphere(ja)!==!1&&(bc.copy(i).invert(),Ya.copy(t.ray).applyMatrix4(bc),!(this.boundingBox!==null&&Ya.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(t,e,Ya)))}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,e===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new me,e=this.geometry.attributes.skinWeight;for(let n=0,i=e.count;n<i;n++){t.fromBufferAttribute(e,n);const r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===ql?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===cd?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(t,e){const n=this.skeleton,i=this.geometry;yc.fromBufferAttribute(i.attributes.skinIndex,t),Mc.fromBufferAttribute(i.attributes.skinWeight,t),xc.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let r=0;r<4;r++){const a=Mc.getComponent(r);if(a!==0){const o=yc.getComponent(r);Sc.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),e.addScaledVector(pf.copy(xc).applyMatrix4(Sc),a)}}return e.applyMatrix4(this.bindMatrixInverse)}}class ou extends Ce{constructor(){super(),this.isBone=!0,this.type="Bone"}}class lu extends $e{constructor(t=null,e=1,n=1,i,r,a,o,l,c=mn,h=mn,u,d){super(null,a,o,l,c,h,i,r,u,d),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ec=new Yt,gf=new Yt;class Tl{constructor(t=[],e=[]){this.uuid=Rn(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(t.length*16),e.length===0)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Yt)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const n=new Yt;this.bones[t]&&n.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const n=this.bones[t];n&&n.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const n=this.bones[t];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=t.length;r<a;r++){const o=t[r]?t[r].matrixWorld:gf;Ec.multiplyMatrices(o,e[r]),Ec.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Tl(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(this.bones.length*4);t=Math.ceil(t/4)*4,t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const n=new lu(e,t,t,yn,Fn);return n.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=n,this}getBoneByName(t){for(let e=0,n=this.bones.length;e<n;e++){const i=this.bones[e];if(i.name===t)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let n=0,i=t.bones.length;n<i;n++){const r=t.bones[n];let a=e[r];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),a=new ou),this.bones.push(a),this.boneInverses.push(new Yt().fromArray(t.boneInverses[n]))}return this.init(),this}toJSON(){const t={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,n=this.boneInverses;for(let i=0,r=e.length;i<r;i++){const a=e[i];t.bones.push(a.uuid);const o=n[i];t.boneInverses.push(o.toArray())}return t}}const Ja=new N,_f=new N,vf=new ue;class hi{constructor(t=new N(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Ja.subVectors(n,e).cross(_f.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Ja),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||vf.getNormalMatrix(t),i=this.coplanarPoint(Ja).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const yi=new ei,wr=new N;class Rl{constructor(t=new hi,e=new hi,n=new hi,i=new hi,r=new hi,a=new hi){this.planes=[t,e,n,i,r,a]}set(t,e,n,i,r,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Kn){const n=this.planes,i=t.elements,r=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],u=i[6],d=i[7],f=i[8],m=i[9],_=i[10],g=i[11],p=i[12],E=i[13],b=i[14],M=i[15];if(n[0].setComponents(l-r,d-c,g-f,M-p).normalize(),n[1].setComponents(l+r,d+c,g+f,M+p).normalize(),n[2].setComponents(l+a,d+h,g+m,M+E).normalize(),n[3].setComponents(l-a,d-h,g-m,M-E).normalize(),n[4].setComponents(l-o,d-u,g-_,M-b).normalize(),e===Kn)n[5].setComponents(l+o,d+u,g+_,M+b).normalize();else if(e===ia)n[5].setComponents(o,u,_,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),yi.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),yi.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(yi)}intersectsSprite(t){return yi.center.set(0,0,0),yi.radius=.7071067811865476,yi.applyMatrix4(t.matrixWorld),this.intersectsSphere(yi)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)<i)return!1;return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(wr.x=i.normal.x>0?t.max.x:t.min.x,wr.y=i.normal.y>0?t.max.y:t.min.y,wr.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(wr)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class pi extends Mn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new jt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const sa=new N,ra=new N,wc=new Yt,Ds=new gs,Ar=new ei,$a=new N,Ac=new N;class Cl extends Ce{constructor(t=new Ie,e=new pi){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[0];for(let i=1,r=e.count;i<r;i++)sa.fromBufferAttribute(e,i-1),ra.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=sa.distanceTo(ra);t.setAttribute("lineDistance",new le(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ar.copy(n.boundingSphere),Ar.applyMatrix4(i),Ar.radius+=r,t.ray.intersectsSphere(Ar)===!1)return;wc.copy(i).invert(),Ds.copy(t.ray).applyMatrix4(wc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,h=n.index,d=n.attributes.position;if(h!==null){const f=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let _=f,g=m-1;_<g;_+=c){const p=h.getX(_),E=h.getX(_+1),b=Tr(this,t,Ds,l,p,E,_);b&&e.push(b)}if(this.isLineLoop){const _=h.getX(m-1),g=h.getX(f),p=Tr(this,t,Ds,l,_,g,m-1);p&&e.push(p)}}else{const f=Math.max(0,a.start),m=Math.min(d.count,a.start+a.count);for(let _=f,g=m-1;_<g;_+=c){const p=Tr(this,t,Ds,l,_,_+1,_);p&&e.push(p)}if(this.isLineLoop){const _=Tr(this,t,Ds,l,m-1,f,m-1);_&&e.push(_)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){const i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Tr(s,t,e,n,i,r,a){const o=s.geometry.attributes.position;if(sa.fromBufferAttribute(o,i),ra.fromBufferAttribute(o,r),e.distanceSqToSegment(sa,ra,$a,Ac)>n)return;$a.applyMatrix4(s.matrixWorld);const c=t.ray.origin.distanceTo($a);if(!(c<t.near||c>t.far))return{distance:c,point:Ac.clone().applyMatrix4(s.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:s}}const Tc=new N,Rc=new N;class aa extends Cl{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[];for(let i=0,r=e.count;i<r;i+=2)Tc.fromBufferAttribute(e,i),Rc.fromBufferAttribute(e,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Tc.distanceTo(Rc);t.setAttribute("lineDistance",new le(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Ci extends Mn{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new jt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}const Cc=new Yt,il=new gs,Rr=new ei,Cr=new N;class zs extends Ce{constructor(t=new Ie,e=new Ci){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Rr.copy(n.boundingSphere),Rr.applyMatrix4(i),Rr.radius+=r,t.ray.intersectsSphere(Rr)===!1)return;Cc.copy(i).invert(),il.copy(t.ray).applyMatrix4(Cc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,u=n.attributes.position;if(c!==null){const d=Math.max(0,a.start),f=Math.min(c.count,a.start+a.count);for(let m=d,_=f;m<_;m++){const g=c.getX(m);Cr.fromBufferAttribute(u,g),Lc(Cr,g,l,i,t,e,this)}}else{const d=Math.max(0,a.start),f=Math.min(u.count,a.start+a.count);for(let m=d,_=f;m<_;m++)Cr.fromBufferAttribute(u,m),Lc(Cr,m,l,i,t,e,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){const i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Lc(s,t,e,n,i,r,a){const o=il.distanceSqToPoint(s);if(o<e){const l=new N;il.closestPointToPoint(s,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class xf extends $e{constructor(t,e,n,i,r,a,o,l,c){super(t,e,n,i,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class cu extends $e{constructor(t,e,n=Pi,i,r,a,o=mn,l=mn,c,h=Gs,u=1){if(h!==Gs&&h!==Ws)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const d={width:t,height:e,depth:u};super(d,i,r,a,o,l,h,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new Sl(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class Ll extends Ie{constructor(t=1,e=1,n=1,i=32,r=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:l};const c=this;i=Math.floor(i),r=Math.floor(r);const h=[],u=[],d=[],f=[];let m=0;const _=[],g=n/2;let p=0;E(),a===!1&&(t>0&&b(!0),e>0&&b(!1)),this.setIndex(h),this.setAttribute("position",new le(u,3)),this.setAttribute("normal",new le(d,3)),this.setAttribute("uv",new le(f,2));function E(){const M=new N,I=new N;let C=0;const P=(e-t)/n;for(let D=0;D<=r;D++){const S=[],y=D/r,U=y*(e-t)+t;for(let B=0;B<=i;B++){const k=B/i,q=k*l+o,K=Math.sin(q),z=Math.cos(q);I.x=U*K,I.y=-y*n+g,I.z=U*z,u.push(I.x,I.y,I.z),M.set(K,P,z).normalize(),d.push(M.x,M.y,M.z),f.push(k,1-y),S.push(m++)}_.push(S)}for(let D=0;D<i;D++)for(let S=0;S<r;S++){const y=_[S][D],U=_[S+1][D],B=_[S+1][D+1],k=_[S][D+1];(t>0||S!==0)&&(h.push(y,U,k),C+=3),(e>0||S!==r-1)&&(h.push(U,B,k),C+=3)}c.addGroup(p,C,0),p+=C}function b(M){const I=m,C=new Dt,P=new N;let D=0;const S=M===!0?t:e,y=M===!0?1:-1;for(let B=1;B<=i;B++)u.push(0,g*y,0),d.push(0,y,0),f.push(.5,.5),m++;const U=m;for(let B=0;B<=i;B++){const q=B/i*l+o,K=Math.cos(q),z=Math.sin(q);P.x=S*z,P.y=g*y,P.z=S*K,u.push(P.x,P.y,P.z),d.push(0,y,0),C.x=K*.5+.5,C.y=z*.5*y+.5,f.push(C.x,C.y),m++}for(let B=0;B<i;B++){const k=I+B,q=U+B;M===!0?h.push(q,q+1,k):h.push(q+1,q,k),D+=3}c.addGroup(p,D,M===!0?1:2),p+=D}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ll(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ni{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let a=1;a<=t;a++)n=this.getPoint(a/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e=null){const n=this.getLengths();let i=0;const r=n.length;let a;e?a=e:a=t*n[r-1];let o=0,l=r-1,c;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),c=n[i]-a,c<0)o=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===a)return i/(r-1);const h=n[i],d=n[i+1]-h,f=(a-h)/d;return(i+f)/(r-1)}getTangent(t,e){let i=t-1e-4,r=t+1e-4;i<0&&(i=0),r>1&&(r=1);const a=this.getPoint(i),o=this.getPoint(r),l=e||(a.isVector2?new Dt:new N);return l.copy(o).sub(a).normalize(),l}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e=!1){const n=new N,i=[],r=[],a=[],o=new N,l=new Yt;for(let f=0;f<=t;f++){const m=f/t;i[f]=this.getTangentAt(m,new N)}r[0]=new N,a[0]=new N;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),a[0].crossVectors(i[0],r[0]);for(let f=1;f<=t;f++){if(r[f]=r[f-1].clone(),a[f]=a[f-1].clone(),o.crossVectors(i[f-1],i[f]),o.length()>Number.EPSILON){o.normalize();const m=Math.acos(de(i[f-1].dot(i[f]),-1,1));r[f].applyMatrix4(l.makeRotationAxis(o,m))}a[f].crossVectors(i[f],r[f])}if(e===!0){let f=Math.acos(de(r[0].dot(r[t]),-1,1));f/=t,i[0].dot(o.crossVectors(r[0],r[t]))>0&&(f=-f);for(let m=1;m<=t;m++)r[m].applyMatrix4(l.makeRotationAxis(i[m],f*m)),a[m].crossVectors(i[m],r[m])}return{tangents:i,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class hu extends ni{constructor(t=0,e=0,n=1,i=1,r=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(t,e=new Dt){const n=e,i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(a?r=0:r=i),this.aClockwise===!0&&!a&&(r===i?r=-i:r=r-i);const o=this.aStartAngle+t*r;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),d=l-this.aX,f=c-this.aY;l=d*h-f*u+this.aX,c=d*u+f*h+this.aY}return n.set(l,c)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class yf extends hu{constructor(t,e,n,i,r,a){super(t,e,n,n,i,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Pl(){let s=0,t=0,e=0,n=0;function i(r,a,o,l){s=r,t=o,e=-3*r+3*a-2*o-l,n=2*r-2*a+o+l}return{initCatmullRom:function(r,a,o,l,c){i(a,o,c*(o-r),c*(l-a))},initNonuniformCatmullRom:function(r,a,o,l,c,h,u){let d=(a-r)/c-(o-r)/(c+h)+(o-a)/h,f=(o-a)/h-(l-a)/(h+u)+(l-o)/u;d*=h,f*=h,i(a,o,d,f)},calc:function(r){const a=r*r,o=a*r;return s+t*r+e*a+n*o}}}const Lr=new N,Ka=new Pl,Za=new Pl,Qa=new Pl;class uu extends ni{constructor(t=[],e=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=i}getPoint(t,e=new N){const n=e,i=this.points,r=i.length,a=(r-(this.closed?0:1))*t;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/r)+1)*r:l===0&&o===r-1&&(o=r-2,l=1);let c,h;this.closed||o>0?c=i[(o-1)%r]:(Lr.subVectors(i[0],i[1]).add(i[0]),c=Lr);const u=i[o%r],d=i[(o+1)%r];if(this.closed||o+2<r?h=i[(o+2)%r]:(Lr.subVectors(i[r-1],i[r-2]).add(i[r-1]),h=Lr),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(u),f),_=Math.pow(u.distanceToSquared(d),f),g=Math.pow(d.distanceToSquared(h),f);_<1e-4&&(_=1),m<1e-4&&(m=_),g<1e-4&&(g=_),Ka.initNonuniformCatmullRom(c.x,u.x,d.x,h.x,m,_,g),Za.initNonuniformCatmullRom(c.y,u.y,d.y,h.y,m,_,g),Qa.initNonuniformCatmullRom(c.z,u.z,d.z,h.z,m,_,g)}else this.curveType==="catmullrom"&&(Ka.initCatmullRom(c.x,u.x,d.x,h.x,this.tension),Za.initCatmullRom(c.y,u.y,d.y,h.y,this.tension),Qa.initCatmullRom(c.z,u.z,d.z,h.z,this.tension));return n.set(Ka.calc(l),Za.calc(l),Qa.calc(l)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const i=t.points[e];this.points.push(new N().fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Pc(s,t,e,n,i){const r=(n-t)*.5,a=(i-e)*.5,o=s*s,l=s*o;return(2*e-2*n+r+a)*l+(-3*e+3*n-2*r-a)*o+r*s+e}function Mf(s,t){const e=1-s;return e*e*t}function Sf(s,t){return 2*(1-s)*s*t}function bf(s,t){return s*s*t}function Bs(s,t,e,n){return Mf(s,t)+Sf(s,e)+bf(s,n)}function Ef(s,t){const e=1-s;return e*e*e*t}function wf(s,t){const e=1-s;return 3*e*e*s*t}function Af(s,t){return 3*(1-s)*s*s*t}function Tf(s,t){return s*s*s*t}function ks(s,t,e,n,i){return Ef(s,t)+wf(s,e)+Af(s,n)+Tf(s,i)}class Rf extends ni{constructor(t=new Dt,e=new Dt,n=new Dt,i=new Dt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new Dt){const n=e,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(ks(t,i.x,r.x,a.x,o.x),ks(t,i.y,r.y,a.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Cf extends ni{constructor(t=new N,e=new N,n=new N,i=new N){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new N){const n=e,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(ks(t,i.x,r.x,a.x,o.x),ks(t,i.y,r.y,a.y,o.y),ks(t,i.z,r.z,a.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Lf extends ni{constructor(t=new Dt,e=new Dt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Dt){const n=e;return t===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Dt){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Pf extends ni{constructor(t=new N,e=new N){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new N){const n=e;return t===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new N){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Df extends ni{constructor(t=new Dt,e=new Dt,n=new Dt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new Dt){const n=e,i=this.v0,r=this.v1,a=this.v2;return n.set(Bs(t,i.x,r.x,a.x),Bs(t,i.y,r.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class du extends ni{constructor(t=new N,e=new N,n=new N){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new N){const n=e,i=this.v0,r=this.v1,a=this.v2;return n.set(Bs(t,i.x,r.x,a.x),Bs(t,i.y,r.y,a.y),Bs(t,i.z,r.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Uf extends ni{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Dt){const n=e,i=this.points,r=(i.length-1)*t,a=Math.floor(r),o=r-a,l=i[a===0?a:a-1],c=i[a],h=i[a>i.length-2?i.length-1:a+1],u=i[a>i.length-3?i.length-1:a+2];return n.set(Pc(o,l.x,c.x,h.x,u.x),Pc(o,l.y,c.y,h.y,u.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const i=t.points[e];this.points.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const i=t.points[e];this.points.push(new Dt().fromArray(i))}return this}}var If=Object.freeze({__proto__:null,ArcCurve:yf,CatmullRomCurve3:uu,CubicBezierCurve:Rf,CubicBezierCurve3:Cf,EllipseCurve:hu,LineCurve:Lf,LineCurve3:Pf,QuadraticBezierCurve:Df,QuadraticBezierCurve3:du,SplineCurve:Uf});class Ys extends Ie{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2,a=e/2,o=Math.floor(n),l=Math.floor(i),c=o+1,h=l+1,u=t/o,d=e/l,f=[],m=[],_=[],g=[];for(let p=0;p<h;p++){const E=p*d-a;for(let b=0;b<c;b++){const M=b*u-r;m.push(M,-E,0),_.push(0,0,1),g.push(b/o),g.push(1-p/l)}}for(let p=0;p<l;p++)for(let E=0;E<o;E++){const b=E+c*p,M=E+c*(p+1),I=E+1+c*(p+1),C=E+1+c*p;f.push(b,M,C),f.push(M,I,C)}this.setIndex(f),this.setAttribute("position",new le(m,3)),this.setAttribute("normal",new le(_,3)),this.setAttribute("uv",new le(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ys(t.width,t.height,t.widthSegments,t.heightSegments)}}class da extends Ie{constructor(t=1,e=32,n=16,i=0,r=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const l=Math.min(a+o,Math.PI);let c=0;const h=[],u=new N,d=new N,f=[],m=[],_=[],g=[];for(let p=0;p<=n;p++){const E=[],b=p/n;let M=0;p===0&&a===0?M=.5/e:p===n&&l===Math.PI&&(M=-.5/e);for(let I=0;I<=e;I++){const C=I/e;u.x=-t*Math.cos(i+C*r)*Math.sin(a+b*o),u.y=t*Math.cos(a+b*o),u.z=t*Math.sin(i+C*r)*Math.sin(a+b*o),m.push(u.x,u.y,u.z),d.copy(u).normalize(),_.push(d.x,d.y,d.z),g.push(C+M,1-b),E.push(c++)}h.push(E)}for(let p=0;p<n;p++)for(let E=0;E<e;E++){const b=h[p][E+1],M=h[p][E],I=h[p+1][E],C=h[p+1][E+1];(p!==0||a>0)&&f.push(b,M,C),(p!==n-1||l<Math.PI)&&f.push(M,I,C)}this.setIndex(f),this.setAttribute("position",new le(m,3)),this.setAttribute("normal",new le(_,3)),this.setAttribute("uv",new le(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new da(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Dl extends Ie{constructor(t=new du(new N(-1,-1,0),new N(-1,1,0),new N(1,1,0)),e=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r};const a=t.computeFrenetFrames(e,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new N,l=new N,c=new Dt;let h=new N;const u=[],d=[],f=[],m=[];_(),this.setIndex(m),this.setAttribute("position",new le(u,3)),this.setAttribute("normal",new le(d,3)),this.setAttribute("uv",new le(f,2));function _(){for(let b=0;b<e;b++)g(b);g(r===!1?e:0),E(),p()}function g(b){h=t.getPointAt(b/e,h);const M=a.normals[b],I=a.binormals[b];for(let C=0;C<=i;C++){const P=C/i*Math.PI*2,D=Math.sin(P),S=-Math.cos(P);l.x=S*M.x+D*I.x,l.y=S*M.y+D*I.y,l.z=S*M.z+D*I.z,l.normalize(),d.push(l.x,l.y,l.z),o.x=h.x+n*l.x,o.y=h.y+n*l.y,o.z=h.z+n*l.z,u.push(o.x,o.y,o.z)}}function p(){for(let b=1;b<=e;b++)for(let M=1;M<=i;M++){const I=(i+1)*(b-1)+(M-1),C=(i+1)*b+(M-1),P=(i+1)*b+M,D=(i+1)*(b-1)+M;m.push(I,C,D),m.push(C,P,D)}}function E(){for(let b=0;b<=e;b++)for(let M=0;M<=i;M++)c.x=b/e,c.y=M/i,f.push(c.x,c.y)}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Dl(new If[t.path.type]().fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class Nf extends Ie{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const e=[],n=new Set,i=new N,r=new N;if(t.index!==null){const a=t.attributes.position,o=t.index;let l=t.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const u=l[c],d=u.start,f=u.count;for(let m=d,_=d+f;m<_;m+=3)for(let g=0;g<3;g++){const p=o.getX(m+g),E=o.getX(m+(g+1)%3);i.fromBufferAttribute(a,p),r.fromBufferAttribute(a,E),Dc(i,r,n)===!0&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}}else{const a=t.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const h=3*o+c,u=3*o+(c+1)%3;i.fromBufferAttribute(a,h),r.fromBufferAttribute(a,u),Dc(i,r,n)===!0&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}this.setAttribute("position",new le(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function Dc(s,t,e){const n=`${s.x},${s.y},${s.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${s.x},${s.y},${s.z}`;return e.has(n)===!0||e.has(i)===!0?!1:(e.add(n),e.add(i),!0)}class Ff extends Mn{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new jt(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}class cn extends Mn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new jt(16777215),this.specular=new jt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new jt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yl,this.normalScale=new Dt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new un,this.combine=ca,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Of extends Mn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new jt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new jt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yl,this.normalScale=new Dt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new un,this.combine=ca,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class zf extends Mn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=dd,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Bf extends Mn{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function Pr(s,t){return!s||s.constructor===t?s:typeof t.BYTES_PER_ELEMENT=="number"?new t(s):Array.prototype.slice.call(s)}function kf(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function Vf(s){function t(i,r){return s[i]-s[r]}const e=s.length,n=new Array(e);for(let i=0;i!==e;++i)n[i]=i;return n.sort(t),n}function Uc(s,t,e){const n=s.length,i=new s.constructor(n);for(let r=0,a=0;a!==n;++r){const o=e[r]*t;for(let l=0;l!==t;++l)i[a++]=s[o+l]}return i}function fu(s,t,e,n){let i=1,r=s[0];for(;r!==void 0&&r[n]===void 0;)r=s[i++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(t.push(r.time),e.push(...a)),r=s[i++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(t.push(r.time),a.toArray(e,e.length)),r=s[i++];while(r!==void 0);else do a=r[n],a!==void 0&&(t.push(r.time),e.push(a)),r=s[i++];while(r!==void 0)}class fa{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,i=e[n],r=e[n-1];n:{t:{let a;e:{i:if(!(t<i)){for(let o=n+2;;){if(i===void 0){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=e[++n],t<i)break t}a=e.length;break e}if(!(t>=r)){const o=e[1];t<o&&(n=2,r=o);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=r,r=e[--n-1],t>=r)break t}a=n,n=0;break e}break n}for(;n<a;){const o=n+a>>>1;t<e[o]?a=o:n=o+1}if(i=e[n],r=e[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i;for(let a=0;a!==i;++a)e[a]=n[r+a];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Hf extends fa{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:jl,endingEnd:jl}}intervalChanged_(t,e,n){const i=this.parameterPositions;let r=t-2,a=t+1,o=i[r],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case Yl:r=t,o=2*e-n;break;case Jl:r=i.length-2,o=e+i[r]-i[r+1];break;default:r=t,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case Yl:a=t,l=2*n-e;break;case Jl:a=1,l=n+i[1]-i[0];break;default:a=t-1,l=e}const c=(n-e)*.5,h=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(l-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(t,e,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,c=l-o,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,m=(n-e)/(i-e),_=m*m,g=_*m,p=-d*g+2*d*_-d*m,E=(1+d)*g+(-1.5-2*d)*_+(-.5+d)*m+1,b=(-1-f)*g+(1.5+f)*_+.5*m,M=f*g-f*_;for(let I=0;I!==o;++I)r[I]=p*a[h+I]+E*a[c+I]+b*a[l+I]+M*a[u+I];return r}}class Gf extends fa{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,c=l-o,h=(n-e)/(i-e),u=1-h;for(let d=0;d!==o;++d)r[d]=a[c+d]*u+a[l+d]*h;return r}}class Wf extends fa{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}}class Pn{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Pr(e,this.TimeBufferType),this.values=Pr(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Pr(t.times,Array),values:Pr(t.values,Array)};const i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new Wf(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Gf(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Hf(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case ea:e=this.InterpolantFactoryMethodDiscrete;break;case el:e=this.InterpolantFactoryMethodLinear;break;case Ea:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ea;case this.InterpolantFactoryMethodLinear:return el;case this.InterpolantFactoryMethodSmooth:return Ea}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){const n=this.times,i=n.length;let r=0,a=i-1;for(;r!==i&&n[r]<t;)++r;for(;a!==-1&&n[a]>e;)--a;if(++a,r!==0||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==r;o++){const l=n[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),t=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),t=!1;break}a=l}if(i!==void 0&&kf(i))for(let o=0,l=i.length;o!==l;++o){const c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Ea,r=t.length-1;let a=1;for(let o=1;o<r;++o){let l=!1;const c=t[o],h=t[o+1];if(c!==h&&(o!==1||c!==t[0]))if(i)l=!0;else{const u=o*n,d=u-n,f=u+n;for(let m=0;m!==n;++m){const _=e[u+m];if(_!==e[d+m]||_!==e[f+m]){l=!0;break}}}if(l){if(o!==a){t[a]=t[o];const u=o*n,d=a*n;for(let f=0;f!==n;++f)e[d+f]=e[u+f]}++a}}if(r>0){t[a]=t[r];for(let o=r*n,l=a*n,c=0;c!==n;++c)e[l+c]=e[o+c];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*n)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}Pn.prototype.ValueTypeName="";Pn.prototype.TimeBufferType=Float32Array;Pn.prototype.ValueBufferType=Float32Array;Pn.prototype.DefaultInterpolation=el;class vs extends Pn{constructor(t,e,n){super(t,e,n)}}vs.prototype.ValueTypeName="bool";vs.prototype.ValueBufferType=Array;vs.prototype.DefaultInterpolation=ea;vs.prototype.InterpolantFactoryMethodLinear=void 0;vs.prototype.InterpolantFactoryMethodSmooth=void 0;class pu extends Pn{constructor(t,e,n,i){super(t,e,n,i)}}pu.prototype.ValueTypeName="color";class oa extends Pn{constructor(t,e,n,i){super(t,e,n,i)}}oa.prototype.ValueTypeName="number";class Xf extends fa{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-e)/(i-e);let c=t*o;for(let h=c+o;c!==h;c+=4)gn.slerpFlat(r,0,a,c-o,a,c,l);return r}}class Js extends Pn{constructor(t,e,n,i){super(t,e,n,i)}InterpolantFactoryMethodLinear(t){return new Xf(this.times,this.values,this.getValueSize(),t)}}Js.prototype.ValueTypeName="quaternion";Js.prototype.InterpolantFactoryMethodSmooth=void 0;class xs extends Pn{constructor(t,e,n){super(t,e,n)}}xs.prototype.ValueTypeName="string";xs.prototype.ValueBufferType=Array;xs.prototype.DefaultInterpolation=ea;xs.prototype.InterpolantFactoryMethodLinear=void 0;xs.prototype.InterpolantFactoryMethodSmooth=void 0;class ms extends Pn{constructor(t,e,n,i){super(t,e,n,i)}}ms.prototype.ValueTypeName="vector";class Ic{constructor(t="",e=-1,n=[],i=ud){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Rn(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let a=0,o=n.length;a!==o;++a)e.push(jf(n[a]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let r=0,a=n.length;r!==a;++r)e.push(Pn.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,a=[];for(let o=0;o<r;o++){let l=[],c=[];l.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);const h=Vf(l);l=Uc(l,1,h),c=Uc(c,1,h),!i&&l[0]===0&&(l.push(r),c.push(c[0])),a.push(new oa(".morphTargetInfluences["+e[o].name+"]",l,c).scale(1/n))}return new this(t,-1,a)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const i=t;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let o=0,l=t.length;o<l;o++){const c=t[o],h=c.name.match(r);if(h&&h.length>1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.push(c)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],e,n));return a}static parseAnimation(t,e){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,d,f,m,_){if(f.length!==0){const g=[],p=[];fu(f,g,p,m),g.length!==0&&_.push(new u(d,g,p))}},i=[],r=t.name||"default",a=t.fps||30,o=t.blendMode;let l=t.length||-1;const c=t.hierarchy||[];for(let u=0;u<c.length;u++){const d=c[u].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const f={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let _=0;_<d[m].morphTargets.length;_++)f[d[m].morphTargets[_]]=-1;for(const _ in f){const g=[],p=[];for(let E=0;E!==d[m].morphTargets.length;++E){const b=d[m];g.push(b.time),p.push(b.morphTarget===_?1:0)}i.push(new oa(".morphTargetInfluence["+_+"]",g,p))}l=f.length*a}else{const f=".bones["+e[u].name+"]";n(ms,f+".position",d,"pos",i),n(Js,f+".quaternion",d,"rot",i),n(ms,f+".scale",d,"scl",i)}}return i.length===0?null:new this(r,l,i,o)}resetDuration(){const t=this.tracks;let e=0;for(let n=0,i=t.length;n!==i;++n){const r=this.tracks[n];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function qf(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return oa;case"vector":case"vector2":case"vector3":case"vector4":return ms;case"color":return pu;case"quaternion":return Js;case"bool":case"boolean":return vs;case"string":return xs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function jf(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=qf(s.type);if(s.times===void 0){const e=[],n=[];fu(s.keys,e,n,"value"),s.times=e,s.values=n}return t.parse!==void 0?t.parse(s):new t(s.name,s.times,s.values,s.interpolation)}const la={enabled:!1,files:{},add:function(s,t){this.enabled!==!1&&(this.files[s]=t)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class Yf{constructor(t,e,n){const i=this;let r=!1,a=0,o=0,l;const c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(h){o++,r===!1&&i.onStart!==void 0&&i.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,o),a===o&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,u){return c.push(h,u),this},this.removeHandler=function(h){const u=c.indexOf(h);return u!==-1&&c.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=c.length;u<d;u+=2){const f=c[u],m=c[u+1];if(f.global&&(f.lastIndex=0),f.test(h))return m}return null}}}const Ul=new Yf;class Ln{constructor(t){this.manager=t!==void 0?t:Ul,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise(function(i,r){n.load(t,i,e,r)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}Ln.DEFAULT_MATERIAL_NAME="__DEFAULT";const Yn={};class Jf extends Error{constructor(t,e){super(t),this.response=e}}class ys extends Ln{constructor(t){super(t),this.mimeType="",this.responseType=""}load(t,e,n,i){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const r=la.get(t);if(r!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0),r;if(Yn[t]!==void 0){Yn[t].push({onLoad:e,onProgress:n,onError:i});return}Yn[t]=[],Yn[t].push({onLoad:e,onProgress:n,onError:i});const a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=Yn[t],u=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=d?parseInt(d):0,m=f!==0;let _=0;const g=new ReadableStream({start(p){E();function E(){u.read().then(({done:b,value:M})=>{if(b)p.close();else{_+=M.byteLength;const I=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:f});for(let C=0,P=h.length;C<P;C++){const D=h[C];D.onProgress&&D.onProgress(I)}p.enqueue(M),E()}},b=>{p.error(b)})}}});return new Response(g)}else throw new Jf(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return c.json();default:if(o==="")return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(m=>f.decode(m))}}}).then(c=>{la.add(t,c);const h=Yn[t];delete Yn[t];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onLoad&&f.onLoad(c)}}).catch(c=>{const h=Yn[t];if(h===void 0)throw this.manager.itemError(t),c;delete Yn[t];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onError&&f.onError(c)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class $f extends Ln{constructor(t){super(t)}load(t,e,n,i){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,a=la.get(t);if(a!==void 0)return r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0),a;const o=Xs("img");function l(){h(),la.add(t,this),e&&e(this),r.manager.itemEnd(t)}function c(u){h(),i&&i(u),r.manager.itemError(t),r.manager.itemEnd(t)}function h(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}class Kf extends Ln{constructor(t){super(t)}load(t,e,n,i){const r=this,a=new lu,o=new ys(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(t,function(l){let c;try{c=r.parse(l)}catch(h){if(i!==void 0)i(h);else{console.error(h);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Tn,a.wrapT=c.wrapT!==void 0?c.wrapT:Tn,a.magFilter=c.magFilter!==void 0?c.magFilter:pn,a.minFilter=c.minFilter!==void 0?c.minFilter:pn,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=$n),c.mipmapCount===1&&(a.minFilter=pn),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,e&&e(a,c)},n,i),a}}class Il extends Ln{constructor(t){super(t)}load(t,e,n,i){const r=new $e,a=new $f(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(o){r.image=o,r.needsUpdate=!0,e!==void 0&&e(r)},n,i),r}}class $s extends Ce{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new jt(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(e.object.target=this.target.uuid),e}}class Zf extends $s{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Ce.DEFAULT_UP),this.updateMatrix(),this.groundColor=new jt(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const to=new Yt,Nc=new N,Fc=new N;class Nl{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Dt(512,512),this.mapType=zn,this.map=null,this.mapPass=null,this.matrix=new Yt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Rl,this._frameExtents=new Dt(1,1),this._viewportCount=1,this._viewports=[new me(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Nc.setFromMatrixPosition(t.matrixWorld),e.position.copy(Nc),Fc.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Fc),e.updateMatrixWorld(),to.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(to),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(to)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.intensity!==1&&(t.intensity=this.intensity),this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Qf extends Nl{constructor(){super(new Je(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){const e=this.camera,n=fs*2*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,r=t.distance||e.far;(n!==e.fov||i!==e.aspect||r!==e.far)&&(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class tp extends $s{constructor(t,e,n=0,i=Math.PI/3,r=0,a=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ce.DEFAULT_UP),this.updateMatrix(),this.target=new Ce,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new Qf}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const Oc=new Yt,Us=new N,eo=new N;class ep extends Nl{constructor(){super(new Je(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Dt(4,2),this._viewportCount=6,this._viewports=[new me(2,1,1,1),new me(0,1,1,1),new me(3,1,1,1),new me(1,1,1,1),new me(3,0,1,1),new me(1,0,1,1)],this._cubeDirections=[new N(1,0,0),new N(-1,0,0),new N(0,0,1),new N(0,0,-1),new N(0,1,0),new N(0,-1,0)],this._cubeUps=[new N(0,1,0),new N(0,1,0),new N(0,1,0),new N(0,1,0),new N(0,0,1),new N(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),Us.setFromMatrixPosition(t.matrixWorld),n.position.copy(Us),eo.copy(n.position),eo.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(eo),n.updateMatrixWorld(),i.makeTranslation(-Us.x,-Us.y,-Us.z),Oc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Oc)}}class mu extends $s{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new ep}get power(){return this.intensity*4*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class pa extends iu{constructor(t=-1,e=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,a=n+t,o=i+e,l=i-e;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,a=r+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}class np extends Nl{constructor(){super(new pa(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class gu extends $s{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ce.DEFAULT_UP),this.updateMatrix(),this.target=new Ce,this.shadow=new np}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class _u extends $s{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class Fl{static extractUrlBase(t){const e=t.lastIndexOf("/");return e===-1?"./":t.slice(0,e+1)}static resolveURL(t,e){return typeof t!="string"||t===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}}class ip extends Ie{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class sp extends Je{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}class rp{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=zc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=zc();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function zc(){return performance.now()}class sl extends ru{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}const Bc=new Yt;class ap{constructor(t,e,n=0,i=1/0){this.ray=new gs(t,e),this.near=n,this.far=i,this.camera=null,this.layers=new bl,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return Bc.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Bc),this}intersectObject(t,e=!0,n=[]){return rl(t,this,n,e),n.sort(kc),n}intersectObjects(t,e=!0,n=[]){for(let i=0,r=t.length;i<r;i++)rl(t[i],this,n,e);return n.sort(kc),n}}function kc(s,t){return s.distance-t.distance}function rl(s,t,e,n){let i=!0;if(s.layers.test(t.layers)&&s.raycast(t,e)===!1&&(i=!1),i===!0&&n===!0){const r=s.children;for(let a=0,o=r.length;a<o;a++)rl(r[a],t,e,!0)}}class vu{constructor(t=1,e=0,n=0){this.radius=t,this.phi=e,this.theta=n}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=de(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(de(e/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Vc=new N,Dr=new N;class op{constructor(t=new N,e=new N){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Vc.subVectors(t,this.start),Dr.subVectors(this.end,this.start);const n=Dr.dot(Dr);let r=Dr.dot(Vc)/n;return e&&(r=de(r,0,1)),r}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class lp extends aa{constructor(t=10,e=10,n=4473924,i=8947848){n=new jt(n),i=new jt(i);const r=e/2,a=t/e,o=t/2,l=[],c=[];for(let d=0,f=0,m=-o;d<=e;d++,m+=a){l.push(-o,0,m,o,0,m),l.push(m,0,-o,m,0,o);const _=d===r?n:i;_.toArray(c,f),f+=3,_.toArray(c,f),f+=3,_.toArray(c,f),f+=3,_.toArray(c,f),f+=3}const h=new Ie;h.setAttribute("position",new le(l,3)),h.setAttribute("color",new le(c,3));const u=new pi({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class cp extends Ui{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){if(t===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}}function Hc(s,t,e,n){const i=hp(n);switch(e){case Xh:return s*t;case jh:return s*t/i.components*i.byteLength;case _l:return s*t/i.components*i.byteLength;case Yh:return s*t*2/i.components*i.byteLength;case vl:return s*t*2/i.components*i.byteLength;case qh:return s*t*3/i.components*i.byteLength;case yn:return s*t*4/i.components*i.byteLength;case xl:return s*t*4/i.components*i.byteLength;case qr:case jr:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*8;case Yr:case Jr:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*16;case Lo:case Do:return Math.max(s,16)*Math.max(t,8)/4;case Co:case Po:return Math.max(s,8)*Math.max(t,8)/2;case Uo:case Io:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*8;case No:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*16;case Fo:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*16;case Oo:return Math.floor((s+4)/5)*Math.floor((t+3)/4)*16;case zo:return Math.floor((s+4)/5)*Math.floor((t+4)/5)*16;case Bo:return Math.floor((s+5)/6)*Math.floor((t+4)/5)*16;case ko:return Math.floor((s+5)/6)*Math.floor((t+5)/6)*16;case Vo:return Math.floor((s+7)/8)*Math.floor((t+4)/5)*16;case Ho:return Math.floor((s+7)/8)*Math.floor((t+5)/6)*16;case Go:return Math.floor((s+7)/8)*Math.floor((t+7)/8)*16;case Wo:return Math.floor((s+9)/10)*Math.floor((t+4)/5)*16;case Xo:return Math.floor((s+9)/10)*Math.floor((t+5)/6)*16;case qo:return Math.floor((s+9)/10)*Math.floor((t+7)/8)*16;case jo:return Math.floor((s+9)/10)*Math.floor((t+9)/10)*16;case Yo:return Math.floor((s+11)/12)*Math.floor((t+9)/10)*16;case Jo:return Math.floor((s+11)/12)*Math.floor((t+11)/12)*16;case $r:case $o:case Ko:return Math.ceil(s/4)*Math.ceil(t/4)*16;case Jh:case Zo:return Math.ceil(s/4)*Math.ceil(t/4)*8;case Qo:case tl:return Math.ceil(s/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function hp(s){switch(s){case zn:case Hh:return{byteLength:1,components:1};case Vs:case Gh:case js:return{byteLength:2,components:1};case ml:case gl:return{byteLength:2,components:4};case Pi:case pl:case Fn:return{byteLength:4,components:1};case Wh:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${s}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:fl}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=fl);/**
44
+ `},i=new gs(5,5,5),r=new ti({name:"CubemapFromEquirect",uniforms:fs(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:rn,blending:ui});r.uniforms.tEquirect.value=e;const a=new be(i,r),o=e.minFilter;return e.minFilter===Kn&&(e.minFilter=pn),new Kd(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e=!0,n=!0,i=!0){const r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,i);t.setRenderTarget(r)}}class Zn extends Ce{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Zd={type:"move"};class Va{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Zn,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Zn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new O,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new O),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Zn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new O,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new O),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(const _ of t.hand.values()){const g=e.getJointPose(_,n),f=this._getHandJoint(c,_);g!==null&&(f.matrix.fromArray(g.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,f.jointRadius=g.radius),f.visible=g!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),p=.02,m=.005;c.inputState.pinching&&d>p+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=p-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&r!==null&&(i=r),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Zd)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const n=new Zn;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class vl extends Ce{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new un,this.environmentIntensity=1,this.environmentRotation=new un,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class $h{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=$o,this.updateRanges=[],this.version=0,this.uuid=Rn()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Rn()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Rn()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const nn=new O;class On{constructor(t,e,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)nn.fromBufferAttribute(this,e),nn.applyMatrix4(t),this.setXYZ(e,nn.x,nn.y,nn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)nn.fromBufferAttribute(this,e),nn.applyNormalMatrix(t),this.setXYZ(e,nn.x,nn.y,nn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)nn.fromBufferAttribute(this,e),nn.transformDirection(t),this.setXYZ(e,nn.x,nn.y,nn.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Tn(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Ae(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=Ae(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Ae(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Ae(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Ae(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Tn(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Tn(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Tn(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Tn(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Ae(e,this.array),n=Ae(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Ae(e,this.array),n=Ae(n,this.array),i=Ae(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Ae(e,this.array),n=Ae(n,this.array),i=Ae(i,this.array),r=Ae(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)e.push(this.data.array[i+r])}return new Oe(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new On(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)e.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class oa extends Mn{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new qt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let Ki;const Rs=new O,Ji=new O,Zi=new O,Qi=new Qt,Cs=new Qt,Kh=new Zt,_r=new O,Ls=new O,vr=new O,oc=new Qt,Ha=new Qt,lc=new Qt;class xl extends Ce{constructor(t=new oa){if(super(),this.isSprite=!0,this.type="Sprite",Ki===void 0){Ki=new Ne;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new $h(e,5);Ki.setIndex([0,1,2,0,2,3]),Ki.setAttribute("position",new On(n,3,0,!1)),Ki.setAttribute("uv",new On(n,2,3,!1))}this.geometry=Ki,this.material=t,this.center=new Qt(.5,.5),this.count=1}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ji.setFromMatrixScale(this.matrixWorld),Kh.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Zi.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ji.multiplyScalar(-Zi.z);const n=this.material.rotation;let i,r;n!==0&&(r=Math.cos(n),i=Math.sin(n));const a=this.center;xr(_r.set(-.5,-.5,0),Zi,a,Ji,i,r),xr(Ls.set(.5,-.5,0),Zi,a,Ji,i,r),xr(vr.set(.5,.5,0),Zi,a,Ji,i,r),oc.set(0,0),Ha.set(1,0),lc.set(1,1);let o=t.ray.intersectTriangle(_r,Ls,vr,!1,Rs);if(o===null&&(xr(Ls.set(-.5,.5,0),Zi,a,Ji,i,r),Ha.set(0,1),o=t.ray.intersectTriangle(_r,vr,Ls,!1,Rs),o===null))return;const l=t.ray.origin.distanceTo(Rs);l<t.near||l>t.far||e.push({distance:l,point:Rs.clone(),uv:xn.getInterpolation(Rs,_r,Ls,vr,oc,Ha,lc,new Qt),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function xr(s,t,e,n,i,r){Qi.subVectors(s,e).addScalar(.5).multiply(n),i!==void 0?(Cs.x=r*Qi.x-i*Qi.y,Cs.y=i*Qi.x+r*Qi.y):Cs.copy(Qi),s.copy(t),s.x+=Cs.x,s.y+=Cs.y,s.applyMatrix4(Kh)}const yr=new O,cc=new O;class Qd extends Ce{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let n=0,i=e.length;n<i;n++){const r=e[n];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0,n=0){e=Math.abs(e);const i=this.levels;let r;for(r=0;r<i.length&&!(e<i[r].distance);r++);return i.splice(r,0,{distance:e,hysteresis:n,object:t}),this.add(t),this}removeLevel(t){const e=this.levels;for(let n=0;n<e.length;n++)if(e[n].distance===t){const i=e.splice(n,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){const e=this.levels;if(e.length>0){let n,i;for(n=1,i=e.length;n<i;n++){let r=e[n].distance;if(e[n].object.visible&&(r-=r*e[n].hysteresis),t<r)break}return e[n-1].object}return null}raycast(t,e){if(this.levels.length>0){yr.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(yr);this.getObjectForDistance(i).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){yr.setFromMatrixPosition(t.matrixWorld),cc.setFromMatrixPosition(this.matrixWorld);const n=yr.distanceTo(cc)/t.zoom;e[0].object.visible=!0;let i,r;for(i=1,r=e.length;i<r;i++){let a=e[i].distance;if(e[i].object.visible&&(a-=a*e[i].hysteresis),n>=a)e[i-1].object.visible=!1,e[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<r;i++)e[i].object.visible=!1}}toJSON(t){const e=super.toJSON(t);this.autoUpdate===!1&&(e.object.autoUpdate=!1),e.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const a=n[i];e.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return e}}const hc=new O,uc=new me,dc=new me,tf=new O,fc=new Zt,Mr=new O,Ga=new ei,pc=new Zt,Wa=new ms;class ef extends be{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Ol,this.bindMatrix=new Zt,this.bindMatrixInverse=new Zt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const t=this.geometry;this.boundingBox===null&&(this.boundingBox=new Bn),this.boundingBox.makeEmpty();const e=t.getAttribute("position");for(let n=0;n<e.count;n++)this.getVertexPosition(n,Mr),this.boundingBox.expandByPoint(Mr)}computeBoundingSphere(){const t=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new ei),this.boundingSphere.makeEmpty();const e=t.getAttribute("position");for(let n=0;n<e.count;n++)this.getVertexPosition(n,Mr),this.boundingSphere.expandByPoint(Mr)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone()),t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ga.copy(this.boundingSphere),Ga.applyMatrix4(i),t.ray.intersectsSphere(Ga)!==!1&&(pc.copy(i).invert(),Wa.copy(t.ray).applyMatrix4(pc),!(this.boundingBox!==null&&Wa.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(t,e,Wa)))}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,e===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new me,e=this.geometry.attributes.skinWeight;for(let n=0,i=e.count;n<i;n++){t.fromBufferAttribute(e,n);const r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===Ol?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Ku?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(t,e){const n=this.skeleton,i=this.geometry;uc.fromBufferAttribute(i.attributes.skinIndex,t),dc.fromBufferAttribute(i.attributes.skinWeight,t),hc.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let r=0;r<4;r++){const a=dc.getComponent(r);if(a!==0){const o=uc.getComponent(r);fc.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),e.addScaledVector(tf.copy(hc).applyMatrix4(fc),a)}}return e.applyMatrix4(this.bindMatrixInverse)}}class Jh extends Ce{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Zh extends Ke{constructor(t=null,e=1,n=1,i,r,a,o,l,c=mn,h=mn,u,d){super(null,a,o,l,c,h,i,r,u,d),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const mc=new Zt,nf=new Zt;class yl{constructor(t=[],e=[]){this.uuid=Rn(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(t.length*16),e.length===0)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Zt)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const n=new Zt;this.bones[t]&&n.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const n=this.bones[t];n&&n.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const n=this.bones[t];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=t.length;r<a;r++){const o=t[r]?t[r].matrixWorld:nf;mc.multiplyMatrices(o,e[r]),mc.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new yl(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(this.bones.length*4);t=Math.ceil(t/4)*4,t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const n=new Zh(e,t,t,yn,Fn);return n.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=n,this}getBoneByName(t){for(let e=0,n=this.bones.length;e<n;e++){const i=this.bones[e];if(i.name===t)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let n=0,i=t.bones.length;n<i;n++){const r=t.bones[n];let a=e[r];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),a=new Jh),this.bones.push(a),this.boneInverses.push(new Zt().fromArray(t.boneInverses[n]))}return this.init(),this}toJSON(){const t={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,n=this.boneInverses;for(let i=0,r=e.length;i<r;i++){const a=e[i];t.bones.push(a.uuid);const o=n[i];t.boneInverses.push(o.toArray())}return t}}const Xa=new O,sf=new O,rf=new he;class ci{constructor(t=new O(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Xa.subVectors(n,e).cross(sf.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Xa),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||rf.getNormalMatrix(t),i=this.coplanarPoint(Xa).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const xi=new ei,Sr=new O;class Ml{constructor(t=new ci,e=new ci,n=new ci,i=new ci,r=new ci,a=new ci){this.planes=[t,e,n,i,r,a]}set(t,e,n,i,r,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Jn){const n=this.planes,i=t.elements,r=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],u=i[6],d=i[7],p=i[8],m=i[9],_=i[10],g=i[11],f=i[12],b=i[13],w=i[14],S=i[15];if(n[0].setComponents(l-r,d-c,g-p,S-f).normalize(),n[1].setComponents(l+r,d+c,g+p,S+f).normalize(),n[2].setComponents(l+a,d+h,g+m,S+b).normalize(),n[3].setComponents(l-a,d-h,g-m,S-b).normalize(),n[4].setComponents(l-o,d-u,g-_,S-w).normalize(),e===Jn)n[5].setComponents(l+o,d+u,g+_,S+w).normalize();else if(e===Qr)n[5].setComponents(o,u,_,w).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),xi.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),xi.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(xi)}intersectsSprite(t){return xi.center.set(0,0,0),xi.radius=.7071067811865476,xi.applyMatrix4(t.matrixWorld),this.intersectsSphere(xi)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)<i)return!1;return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(Sr.x=i.normal.x>0?t.max.x:t.min.x,Sr.y=i.normal.y>0?t.max.y:t.min.y,Sr.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Sr)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class fi extends Mn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new qt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const ta=new O,ea=new O,gc=new Zt,Ps=new ms,br=new ei,qa=new O,_c=new O;class Sl extends Ce{constructor(t=new Ne,e=new fi){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[0];for(let i=1,r=e.count;i<r;i++)ta.fromBufferAttribute(e,i-1),ea.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=ta.distanceTo(ea);t.setAttribute("lineDistance",new de(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),br.copy(n.boundingSphere),br.applyMatrix4(i),br.radius+=r,t.ray.intersectsSphere(br)===!1)return;gc.copy(i).invert(),Ps.copy(t.ray).applyMatrix4(gc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,h=n.index,d=n.attributes.position;if(h!==null){const p=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let _=p,g=m-1;_<g;_+=c){const f=h.getX(_),b=h.getX(_+1),w=Er(this,t,Ps,l,f,b,_);w&&e.push(w)}if(this.isLineLoop){const _=h.getX(m-1),g=h.getX(p),f=Er(this,t,Ps,l,_,g,m-1);f&&e.push(f)}}else{const p=Math.max(0,a.start),m=Math.min(d.count,a.start+a.count);for(let _=p,g=m-1;_<g;_+=c){const f=Er(this,t,Ps,l,_,_+1,_);f&&e.push(f)}if(this.isLineLoop){const _=Er(this,t,Ps,l,m-1,p,m-1);_&&e.push(_)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){const i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Er(s,t,e,n,i,r,a){const o=s.geometry.attributes.position;if(ta.fromBufferAttribute(o,i),ea.fromBufferAttribute(o,r),e.distanceSqToSegment(ta,ea,qa,_c)>n)return;qa.applyMatrix4(s.matrixWorld);const c=t.ray.origin.distanceTo(qa);if(!(c<t.near||c>t.far))return{distance:c,point:_c.clone().applyMatrix4(s.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:s}}const vc=new O,xc=new O;class na extends Sl{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,n=[];for(let i=0,r=e.count;i<r;i+=2)vc.fromBufferAttribute(e,i),xc.fromBufferAttribute(e,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+vc.distanceTo(xc);t.setAttribute("lineDistance",new de(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Ri extends Mn{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new qt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}const yc=new Zt,Ko=new ms,wr=new ei,Tr=new O;class Os extends Ce{constructor(t=new Ne,e=new Ri){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),wr.copy(n.boundingSphere),wr.applyMatrix4(i),wr.radius+=r,t.ray.intersectsSphere(wr)===!1)return;yc.copy(i).invert(),Ko.copy(t.ray).applyMatrix4(yc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,u=n.attributes.position;if(c!==null){const d=Math.max(0,a.start),p=Math.min(c.count,a.start+a.count);for(let m=d,_=p;m<_;m++){const g=c.getX(m);Tr.fromBufferAttribute(u,g),Mc(Tr,g,l,i,t,e,this)}}else{const d=Math.max(0,a.start),p=Math.min(u.count,a.start+a.count);for(let m=d,_=p;m<_;m++)Tr.fromBufferAttribute(u,m),Mc(Tr,m,l,i,t,e,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){const i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Mc(s,t,e,n,i,r,a){const o=Ko.distanceSqToPoint(s);if(o<e){const l=new O;Ko.closestPointToPoint(s,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class af extends Ke{constructor(t,e,n,i,r,a,o,l,c){super(t,e,n,i,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Qh extends Ke{constructor(t,e,n=Li,i,r,a,o=mn,l=mn,c,h=ks,u=1){if(h!==ks&&h!==Vs)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const d={width:t,height:e,depth:u};super(d,i,r,a,o,l,h,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new ml(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class bl extends Ne{constructor(t=1,e=1,n=1,i=32,r=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:l};const c=this;i=Math.floor(i),r=Math.floor(r);const h=[],u=[],d=[],p=[];let m=0;const _=[],g=n/2;let f=0;b(),a===!1&&(t>0&&w(!0),e>0&&w(!1)),this.setIndex(h),this.setAttribute("position",new de(u,3)),this.setAttribute("normal",new de(d,3)),this.setAttribute("uv",new de(p,2));function b(){const S=new O,I=new O;let L=0;const P=(e-t)/n;for(let D=0;D<=r;D++){const M=[],y=D/r,U=y*(e-t)+t;for(let B=0;B<=i;B++){const k=B/i,q=k*l+o,J=Math.sin(q),z=Math.cos(q);I.x=U*J,I.y=-y*n+g,I.z=U*z,u.push(I.x,I.y,I.z),S.set(J,P,z).normalize(),d.push(S.x,S.y,S.z),p.push(k,1-y),M.push(m++)}_.push(M)}for(let D=0;D<i;D++)for(let M=0;M<r;M++){const y=_[M][D],U=_[M+1][D],B=_[M+1][D+1],k=_[M][D+1];(t>0||M!==0)&&(h.push(y,U,k),L+=3),(e>0||M!==r-1)&&(h.push(U,B,k),L+=3)}c.addGroup(f,L,0),f+=L}function w(S){const I=m,L=new Qt,P=new O;let D=0;const M=S===!0?t:e,y=S===!0?1:-1;for(let B=1;B<=i;B++)u.push(0,g*y,0),d.push(0,y,0),p.push(.5,.5),m++;const U=m;for(let B=0;B<=i;B++){const q=B/i*l+o,J=Math.cos(q),z=Math.sin(q);P.x=M*z,P.y=g*y,P.z=M*J,u.push(P.x,P.y,P.z),d.push(0,y,0),L.x=J*.5+.5,L.y=z*.5*y+.5,p.push(L.x,L.y),m++}for(let B=0;B<i;B++){const k=I+B,q=U+B;S===!0?h.push(q,q+1,k):h.push(q+1,q,k),D+=3}c.addGroup(f,D,S===!0?1:2),f+=D}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new bl(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Xs extends Ne{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2,a=e/2,o=Math.floor(n),l=Math.floor(i),c=o+1,h=l+1,u=t/o,d=e/l,p=[],m=[],_=[],g=[];for(let f=0;f<h;f++){const b=f*d-a;for(let w=0;w<c;w++){const S=w*u-r;m.push(S,-b,0),_.push(0,0,1),g.push(w/o),g.push(1-f/l)}}for(let f=0;f<l;f++)for(let b=0;b<o;b++){const w=b+c*f,S=b+c*(f+1),I=b+1+c*(f+1),L=b+1+c*f;p.push(w,S,L),p.push(S,I,L)}this.setIndex(p),this.setAttribute("position",new de(m,3)),this.setAttribute("normal",new de(_,3)),this.setAttribute("uv",new de(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Xs(t.width,t.height,t.widthSegments,t.heightSegments)}}class la extends Ne{constructor(t=1,e=32,n=16,i=0,r=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const l=Math.min(a+o,Math.PI);let c=0;const h=[],u=new O,d=new O,p=[],m=[],_=[],g=[];for(let f=0;f<=n;f++){const b=[],w=f/n;let S=0;f===0&&a===0?S=.5/e:f===n&&l===Math.PI&&(S=-.5/e);for(let I=0;I<=e;I++){const L=I/e;u.x=-t*Math.cos(i+L*r)*Math.sin(a+w*o),u.y=t*Math.cos(a+w*o),u.z=t*Math.sin(i+L*r)*Math.sin(a+w*o),m.push(u.x,u.y,u.z),d.copy(u).normalize(),_.push(d.x,d.y,d.z),g.push(L+S,1-w),b.push(c++)}h.push(b)}for(let f=0;f<n;f++)for(let b=0;b<e;b++){const w=h[f][b+1],S=h[f][b],I=h[f+1][b],L=h[f+1][b+1];(f!==0||a>0)&&p.push(w,S,L),(f!==n-1||l<Math.PI)&&p.push(S,I,L)}this.setIndex(p),this.setAttribute("position",new de(m,3)),this.setAttribute("normal",new de(_,3)),this.setAttribute("uv",new de(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new la(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class of extends Ne{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const e=[],n=new Set,i=new O,r=new O;if(t.index!==null){const a=t.attributes.position,o=t.index;let l=t.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const u=l[c],d=u.start,p=u.count;for(let m=d,_=d+p;m<_;m+=3)for(let g=0;g<3;g++){const f=o.getX(m+g),b=o.getX(m+(g+1)%3);i.fromBufferAttribute(a,f),r.fromBufferAttribute(a,b),Sc(i,r,n)===!0&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}}else{const a=t.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const h=3*o+c,u=3*o+(c+1)%3;i.fromBufferAttribute(a,h),r.fromBufferAttribute(a,u),Sc(i,r,n)===!0&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}this.setAttribute("position",new de(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function Sc(s,t,e){const n=`${s.x},${s.y},${s.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${s.x},${s.y},${s.z}`;return e.has(n)===!0||e.has(i)===!0?!1:(e.add(n),e.add(i),!0)}class lf extends Mn{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new qt(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}class cn extends Mn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new qt(16777215),this.specular=new qt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new Qt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new un,this.combine=ra,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class cf extends Mn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new qt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new Qt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new un,this.combine=ra,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class hf extends Mn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Qu,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class uf extends Mn{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function Ar(s,t){return!s||s.constructor===t?s:typeof t.BYTES_PER_ELEMENT=="number"?new t(s):Array.prototype.slice.call(s)}function df(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function ff(s){function t(i,r){return s[i]-s[r]}const e=s.length,n=new Array(e);for(let i=0;i!==e;++i)n[i]=i;return n.sort(t),n}function bc(s,t,e){const n=s.length,i=new s.constructor(n);for(let r=0,a=0;a!==n;++r){const o=e[r]*t;for(let l=0;l!==t;++l)i[a++]=s[o+l]}return i}function tu(s,t,e,n){let i=1,r=s[0];for(;r!==void 0&&r[n]===void 0;)r=s[i++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(t.push(r.time),e.push(...a)),r=s[i++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(t.push(r.time),a.toArray(e,e.length)),r=s[i++];while(r!==void 0);else do a=r[n],a!==void 0&&(t.push(r.time),e.push(a)),r=s[i++];while(r!==void 0)}class ca{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,i=e[n],r=e[n-1];n:{t:{let a;e:{i:if(!(t<i)){for(let o=n+2;;){if(i===void 0){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=e[++n],t<i)break t}a=e.length;break e}if(!(t>=r)){const o=e[1];t<o&&(n=2,r=o);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=r,r=e[--n-1],t>=r)break t}a=n,n=0;break e}break n}for(;n<a;){const o=n+a>>>1;t<e[o]?a=o:n=o+1}if(i=e[n],r=e[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i;for(let a=0;a!==i;++a)e[a]=n[r+a];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class pf extends ca{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:zl,endingEnd:zl}}intervalChanged_(t,e,n){const i=this.parameterPositions;let r=t-2,a=t+1,o=i[r],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case Bl:r=t,o=2*e-n;break;case kl:r=i.length-2,o=e+i[r]-i[r+1];break;default:r=t,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case Bl:a=t,l=2*n-e;break;case kl:a=1,l=n+i[1]-i[0];break;default:a=t-1,l=e}const c=(n-e)*.5,h=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(l-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(t,e,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,c=l-o,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,p=this._weightNext,m=(n-e)/(i-e),_=m*m,g=_*m,f=-d*g+2*d*_-d*m,b=(1+d)*g+(-1.5-2*d)*_+(-.5+d)*m+1,w=(-1-p)*g+(1.5+p)*_+.5*m,S=p*g-p*_;for(let I=0;I!==o;++I)r[I]=f*a[h+I]+b*a[c+I]+w*a[l+I]+S*a[u+I];return r}}class mf extends ca{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=t*o,c=l-o,h=(n-e)/(i-e),u=1-h;for(let d=0;d!==o;++d)r[d]=a[c+d]*u+a[l+d]*h;return r}}class gf extends ca{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}}class Pn{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Ar(e,this.TimeBufferType),this.values=Ar(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Ar(t.times,Array),values:Ar(t.values,Array)};const i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new gf(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new mf(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new pf(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Jr:e=this.InterpolantFactoryMethodDiscrete;break;case Yo:e=this.InterpolantFactoryMethodLinear;break;case ya:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Jr;case this.InterpolantFactoryMethodLinear:return Yo;case this.InterpolantFactoryMethodSmooth:return ya}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){const n=this.times,i=n.length;let r=0,a=i-1;for(;r!==i&&n[r]<t;)++r;for(;a!==-1&&n[a]>e;)--a;if(++a,r!==0||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let o=0;o!==r;o++){const l=n[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),t=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),t=!1;break}a=l}if(i!==void 0&&df(i))for(let o=0,l=i.length;o!==l;++o){const c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===ya,r=t.length-1;let a=1;for(let o=1;o<r;++o){let l=!1;const c=t[o],h=t[o+1];if(c!==h&&(o!==1||c!==t[0]))if(i)l=!0;else{const u=o*n,d=u-n,p=u+n;for(let m=0;m!==n;++m){const _=e[u+m];if(_!==e[d+m]||_!==e[p+m]){l=!0;break}}}if(l){if(o!==a){t[a]=t[o];const u=o*n,d=a*n;for(let p=0;p!==n;++p)e[d+p]=e[u+p]}++a}}if(r>0){t[a]=t[r];for(let o=r*n,l=a*n,c=0;c!==n;++c)e[l+c]=e[o+c];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*n)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}Pn.prototype.ValueTypeName="";Pn.prototype.TimeBufferType=Float32Array;Pn.prototype.ValueBufferType=Float32Array;Pn.prototype.DefaultInterpolation=Yo;class _s extends Pn{constructor(t,e,n){super(t,e,n)}}_s.prototype.ValueTypeName="bool";_s.prototype.ValueBufferType=Array;_s.prototype.DefaultInterpolation=Jr;_s.prototype.InterpolantFactoryMethodLinear=void 0;_s.prototype.InterpolantFactoryMethodSmooth=void 0;class eu extends Pn{constructor(t,e,n,i){super(t,e,n,i)}}eu.prototype.ValueTypeName="color";class ia extends Pn{constructor(t,e,n,i){super(t,e,n,i)}}ia.prototype.ValueTypeName="number";class _f extends ca{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-e)/(i-e);let c=t*o;for(let h=c+o;c!==h;c+=4)gn.slerpFlat(r,0,a,c-o,a,c,l);return r}}class qs extends Pn{constructor(t,e,n,i){super(t,e,n,i)}InterpolantFactoryMethodLinear(t){return new _f(this.times,this.values,this.getValueSize(),t)}}qs.prototype.ValueTypeName="quaternion";qs.prototype.InterpolantFactoryMethodSmooth=void 0;class vs extends Pn{constructor(t,e,n){super(t,e,n)}}vs.prototype.ValueTypeName="string";vs.prototype.ValueBufferType=Array;vs.prototype.DefaultInterpolation=Jr;vs.prototype.InterpolantFactoryMethodLinear=void 0;vs.prototype.InterpolantFactoryMethodSmooth=void 0;class ps extends Pn{constructor(t,e,n,i){super(t,e,n,i)}}ps.prototype.ValueTypeName="vector";class Ec{constructor(t="",e=-1,n=[],i=Zu){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Rn(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let a=0,o=n.length;a!==o;++a)e.push(xf(n[a]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let r=0,a=n.length;r!==a;++r)e.push(Pn.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,a=[];for(let o=0;o<r;o++){let l=[],c=[];l.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);const h=ff(l);l=bc(l,1,h),c=bc(c,1,h),!i&&l[0]===0&&(l.push(r),c.push(c[0])),a.push(new ia(".morphTargetInfluences["+e[o].name+"]",l,c).scale(1/n))}return new this(t,-1,a)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const i=t;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let o=0,l=t.length;o<l;o++){const c=t[o],h=c.name.match(r);if(h&&h.length>1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.push(c)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],e,n));return a}static parseAnimation(t,e){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,d,p,m,_){if(p.length!==0){const g=[],f=[];tu(p,g,f,m),g.length!==0&&_.push(new u(d,g,f))}},i=[],r=t.name||"default",a=t.fps||30,o=t.blendMode;let l=t.length||-1;const c=t.hierarchy||[];for(let u=0;u<c.length;u++){const d=c[u].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const p={};let m;for(m=0;m<d.length;m++)if(d[m].morphTargets)for(let _=0;_<d[m].morphTargets.length;_++)p[d[m].morphTargets[_]]=-1;for(const _ in p){const g=[],f=[];for(let b=0;b!==d[m].morphTargets.length;++b){const w=d[m];g.push(w.time),f.push(w.morphTarget===_?1:0)}i.push(new ia(".morphTargetInfluence["+_+"]",g,f))}l=p.length*a}else{const p=".bones["+e[u].name+"]";n(ps,p+".position",d,"pos",i),n(qs,p+".quaternion",d,"rot",i),n(ps,p+".scale",d,"scl",i)}}return i.length===0?null:new this(r,l,i,o)}resetDuration(){const t=this.tracks;let e=0;for(let n=0,i=t.length;n!==i;++n){const r=this.tracks[n];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function vf(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ia;case"vector":case"vector2":case"vector3":case"vector4":return ps;case"color":return eu;case"quaternion":return qs;case"bool":case"boolean":return _s;case"string":return vs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function xf(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=vf(s.type);if(s.times===void 0){const e=[],n=[];tu(s.keys,e,n,"value"),s.times=e,s.values=n}return t.parse!==void 0?t.parse(s):new t(s.name,s.times,s.values,s.interpolation)}const sa={enabled:!1,files:{},add:function(s,t){this.enabled!==!1&&(this.files[s]=t)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class yf{constructor(t,e,n){const i=this;let r=!1,a=0,o=0,l;const c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(h){o++,r===!1&&i.onStart!==void 0&&i.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,o),a===o&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,u){return c.push(h,u),this},this.removeHandler=function(h){const u=c.indexOf(h);return u!==-1&&c.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=c.length;u<d;u+=2){const p=c[u],m=c[u+1];if(p.global&&(p.lastIndex=0),p.test(h))return m}return null}}}const El=new yf;class Ln{constructor(t){this.manager=t!==void 0?t:El,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise(function(i,r){n.load(t,i,e,r)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}Ln.DEFAULT_MATERIAL_NAME="__DEFAULT";const Yn={};class Mf extends Error{constructor(t,e){super(t),this.response=e}}class xs extends Ln{constructor(t){super(t),this.mimeType="",this.responseType=""}load(t,e,n,i){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const r=sa.get(t);if(r!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0),r;if(Yn[t]!==void 0){Yn[t].push({onLoad:e,onProgress:n,onError:i});return}Yn[t]=[],Yn[t].push({onLoad:e,onProgress:n,onError:i});const a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=Yn[t],u=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),p=d?parseInt(d):0,m=p!==0;let _=0;const g=new ReadableStream({start(f){b();function b(){u.read().then(({done:w,value:S})=>{if(w)f.close();else{_+=S.byteLength;const I=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:p});for(let L=0,P=h.length;L<P;L++){const D=h[L];D.onProgress&&D.onProgress(I)}f.enqueue(S),b()}},w=>{f.error(w)})}}});return new Response(g)}else throw new Mf(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return c.json();default:if(o==="")return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(o),d=u&&u[1]?u[1].toLowerCase():void 0,p=new TextDecoder(d);return c.arrayBuffer().then(m=>p.decode(m))}}}).then(c=>{sa.add(t,c);const h=Yn[t];delete Yn[t];for(let u=0,d=h.length;u<d;u++){const p=h[u];p.onLoad&&p.onLoad(c)}}).catch(c=>{const h=Yn[t];if(h===void 0)throw this.manager.itemError(t),c;delete Yn[t];for(let u=0,d=h.length;u<d;u++){const p=h[u];p.onError&&p.onError(c)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Sf extends Ln{constructor(t){super(t)}load(t,e,n,i){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,a=sa.get(t);if(a!==void 0)return r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0),a;const o=Hs("img");function l(){h(),sa.add(t,this),e&&e(this),r.manager.itemEnd(t)}function c(u){h(),i&&i(u),r.manager.itemError(t),r.manager.itemEnd(t)}function h(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}class bf extends Ln{constructor(t){super(t)}load(t,e,n,i){const r=this,a=new Zh,o=new xs(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(t,function(l){let c;try{c=r.parse(l)}catch(h){if(i!==void 0)i(h);else{console.error(h);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:An,a.wrapT=c.wrapT!==void 0?c.wrapT:An,a.magFilter=c.magFilter!==void 0?c.magFilter:pn,a.minFilter=c.minFilter!==void 0?c.minFilter:pn,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=Kn),c.mipmapCount===1&&(a.minFilter=pn),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,e&&e(a,c)},n,i),a}}class wl extends Ln{constructor(t){super(t)}load(t,e,n,i){const r=new Ke,a=new Sf(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(o){r.image=o,r.needsUpdate=!0,e!==void 0&&e(r)},n,i),r}}class js extends Ce{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new qt(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(e.object.target=this.target.uuid),e}}class Ef extends js{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Ce.DEFAULT_UP),this.updateMatrix(),this.groundColor=new qt(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const ja=new Zt,wc=new O,Tc=new O;class Tl{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Qt(512,512),this.mapType=zn,this.map=null,this.mapPass=null,this.matrix=new Zt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ml,this._frameExtents=new Qt(1,1),this._viewportCount=1,this._viewports=[new me(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;wc.setFromMatrixPosition(t.matrixWorld),e.position.copy(wc),Tc.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Tc),e.updateMatrixWorld(),ja.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ja),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(ja)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.intensity!==1&&(t.intensity=this.intensity),this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class wf extends Tl{constructor(){super(new $e(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){const e=this.camera,n=ds*2*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,r=t.distance||e.far;(n!==e.fov||i!==e.aspect||r!==e.far)&&(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class Tf extends js{constructor(t,e,n=0,i=Math.PI/3,r=0,a=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ce.DEFAULT_UP),this.updateMatrix(),this.target=new Ce,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new wf}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const Ac=new Zt,Ds=new O,Ya=new O;class Af extends Tl{constructor(){super(new $e(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Qt(4,2),this._viewportCount=6,this._viewports=[new me(2,1,1,1),new me(0,1,1,1),new me(3,1,1,1),new me(1,1,1,1),new me(3,0,1,1),new me(1,0,1,1)],this._cubeDirections=[new O(1,0,0),new O(-1,0,0),new O(0,0,1),new O(0,0,-1),new O(0,1,0),new O(0,-1,0)],this._cubeUps=[new O(0,1,0),new O(0,1,0),new O(0,1,0),new O(0,1,0),new O(0,0,1),new O(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),Ds.setFromMatrixPosition(t.matrixWorld),n.position.copy(Ds),Ya.copy(n.position),Ya.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(Ya),n.updateMatrixWorld(),i.makeTranslation(-Ds.x,-Ds.y,-Ds.z),Ac.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ac)}}class nu extends js{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Af}get power(){return this.intensity*4*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class ha extends jh{constructor(t=-1,e=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,a=n+t,o=i+e,l=i-e;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,a=r+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}class Rf extends Tl{constructor(){super(new ha(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class iu extends js{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ce.DEFAULT_UP),this.updateMatrix(),this.target=new Ce,this.shadow=new Rf}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class su extends js{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class Al{static extractUrlBase(t){const e=t.lastIndexOf("/");return e===-1?"./":t.slice(0,e+1)}static resolveURL(t,e){return typeof t!="string"||t===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}}class Cf extends Ne{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class Lf extends $e{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}class Pf{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Rc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Rc();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Rc(){return performance.now()}class Jo extends $h{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}const Cc=new Zt;class Df{constructor(t,e,n=0,i=1/0){this.ray=new ms(t,e),this.near=n,this.far=i,this.camera=null,this.layers=new gl,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return Cc.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Cc),this}intersectObject(t,e=!0,n=[]){return Zo(t,this,n,e),n.sort(Lc),n}intersectObjects(t,e=!0,n=[]){for(let i=0,r=t.length;i<r;i++)Zo(t[i],this,n,e);return n.sort(Lc),n}}function Lc(s,t){return s.distance-t.distance}function Zo(s,t,e,n){let i=!0;if(s.layers.test(t.layers)&&s.raycast(t,e)===!1&&(i=!1),i===!0&&n===!0){const r=s.children;for(let a=0,o=r.length;a<o;a++)Zo(r[a],t,e,!0)}}class ru{constructor(t=1,e=0,n=0){this.radius=t,this.phi=e,this.theta=n}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=pe(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(pe(e/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Pc=new O,Rr=new O;class Uf{constructor(t=new O,e=new O){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Pc.subVectors(t,this.start),Rr.subVectors(this.end,this.start);const n=Rr.dot(Rr);let r=Rr.dot(Pc)/n;return e&&(r=pe(r,0,1)),r}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class If extends na{constructor(t=10,e=10,n=4473924,i=8947848){n=new qt(n),i=new qt(i);const r=e/2,a=t/e,o=t/2,l=[],c=[];for(let d=0,p=0,m=-o;d<=e;d++,m+=a){l.push(-o,0,m,o,0,m),l.push(m,0,-o,m,0,o);const _=d===r?n:i;_.toArray(c,p),p+=3,_.toArray(c,p),p+=3,_.toArray(c,p),p+=3,_.toArray(c,p),p+=3}const h=new Ne;h.setAttribute("position",new de(l,3)),h.setAttribute("color",new de(c,3));const u=new fi({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Nf extends Di{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){if(t===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}}function Dc(s,t,e,n){const i=Ff(n);switch(e){case Nh:return s*t;case Oh:return s*t/i.components*i.byteLength;case hl:return s*t/i.components*i.byteLength;case zh:return s*t*2/i.components*i.byteLength;case ul:return s*t*2/i.components*i.byteLength;case Fh:return s*t*3/i.components*i.byteLength;case yn:return s*t*4/i.components*i.byteLength;case dl:return s*t*4/i.components*i.byteLength;case Hr:case Gr:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*8;case Wr:case Xr:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*16;case bo:case wo:return Math.max(s,16)*Math.max(t,8)/4;case So:case Eo:return Math.max(s,8)*Math.max(t,8)/2;case To:case Ao:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*8;case Ro:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*16;case Co:return Math.floor((s+3)/4)*Math.floor((t+3)/4)*16;case Lo:return Math.floor((s+4)/5)*Math.floor((t+3)/4)*16;case Po:return Math.floor((s+4)/5)*Math.floor((t+4)/5)*16;case Do:return Math.floor((s+5)/6)*Math.floor((t+4)/5)*16;case Uo:return Math.floor((s+5)/6)*Math.floor((t+5)/6)*16;case Io:return Math.floor((s+7)/8)*Math.floor((t+4)/5)*16;case No:return Math.floor((s+7)/8)*Math.floor((t+5)/6)*16;case Fo:return Math.floor((s+7)/8)*Math.floor((t+7)/8)*16;case Oo:return Math.floor((s+9)/10)*Math.floor((t+4)/5)*16;case zo:return Math.floor((s+9)/10)*Math.floor((t+5)/6)*16;case Bo:return Math.floor((s+9)/10)*Math.floor((t+7)/8)*16;case ko:return Math.floor((s+9)/10)*Math.floor((t+9)/10)*16;case Vo:return Math.floor((s+11)/12)*Math.floor((t+9)/10)*16;case Ho:return Math.floor((s+11)/12)*Math.floor((t+11)/12)*16;case qr:case Go:case Wo:return Math.ceil(s/4)*Math.ceil(t/4)*16;case Bh:case Xo:return Math.ceil(s/4)*Math.ceil(t/4)*8;case qo:case jo:return Math.ceil(s/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function Ff(s){switch(s){case zn:case Dh:return{byteLength:1,components:1};case zs:case Uh:case Ws:return{byteLength:2,components:1};case ll:case cl:return{byteLength:2,components:4};case Li:case ol:case Fn:return{byteLength:4,components:1};case Ih:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${s}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:al}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=al);/**
45
45
  * @license
46
46
  * Copyright 2010-2025 Three.js Authors
47
47
  * SPDX-License-Identifier: MIT
48
- */function xu(){let s=null,t=!1,e=null,n=null;function i(r,a){e(r,a),n=s.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=s.requestAnimationFrame(i),t=!0)},stop:function(){s.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(r){e=r},setContext:function(r){s=r}}}function up(s){const t=new WeakMap;function e(o,l){const c=o.array,h=o.usage,u=c.byteLength,d=s.createBuffer();s.bindBuffer(l,d),s.bufferData(l,c,h),o.onUploadCallback();let f;if(c instanceof Float32Array)f=s.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?f=s.HALF_FLOAT:f=s.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=s.SHORT;else if(c instanceof Uint32Array)f=s.UNSIGNED_INT;else if(c instanceof Int32Array)f=s.INT;else if(c instanceof Int8Array)f=s.BYTE;else if(c instanceof Uint8Array)f=s.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=s.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:u}}function n(o,l,c){const h=l.array,u=l.updateRanges;if(s.bindBuffer(c,o),u.length===0)s.bufferSubData(c,0,h);else{u.sort((f,m)=>f.start-m.start);let d=0;for(let f=1;f<u.length;f++){const m=u[d],_=u[f];_.start<=m.start+m.count+1?m.count=Math.max(m.count,_.start+_.count-m.start):(++d,u[d]=_)}u.length=d+1;for(let f=0,m=u.length;f<m;f++){const _=u[f];s.bufferSubData(c,_.start*h.BYTES_PER_ELEMENT,h,_.start,_.count)}l.clearUpdateRanges()}l.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),t.get(o)}function r(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=t.get(o);l&&(s.deleteBuffer(l.buffer),t.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=t.get(o);(!h||h.version<o.version)&&t.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const c=t.get(o);if(c===void 0)t.set(o,e(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,o,l),c.version=o.version}}return{get:i,remove:r,update:a}}var dp=`#ifdef USE_ALPHAHASH
48
+ */function au(){let s=null,t=!1,e=null,n=null;function i(r,a){e(r,a),n=s.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=s.requestAnimationFrame(i),t=!0)},stop:function(){s.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(r){e=r},setContext:function(r){s=r}}}function Of(s){const t=new WeakMap;function e(o,l){const c=o.array,h=o.usage,u=c.byteLength,d=s.createBuffer();s.bindBuffer(l,d),s.bufferData(l,c,h),o.onUploadCallback();let p;if(c instanceof Float32Array)p=s.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?p=s.HALF_FLOAT:p=s.UNSIGNED_SHORT;else if(c instanceof Int16Array)p=s.SHORT;else if(c instanceof Uint32Array)p=s.UNSIGNED_INT;else if(c instanceof Int32Array)p=s.INT;else if(c instanceof Int8Array)p=s.BYTE;else if(c instanceof Uint8Array)p=s.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)p=s.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:p,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:u}}function n(o,l,c){const h=l.array,u=l.updateRanges;if(s.bindBuffer(c,o),u.length===0)s.bufferSubData(c,0,h);else{u.sort((p,m)=>p.start-m.start);let d=0;for(let p=1;p<u.length;p++){const m=u[d],_=u[p];_.start<=m.start+m.count+1?m.count=Math.max(m.count,_.start+_.count-m.start):(++d,u[d]=_)}u.length=d+1;for(let p=0,m=u.length;p<m;p++){const _=u[p];s.bufferSubData(c,_.start*h.BYTES_PER_ELEMENT,h,_.start,_.count)}l.clearUpdateRanges()}l.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),t.get(o)}function r(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=t.get(o);l&&(s.deleteBuffer(l.buffer),t.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=t.get(o);(!h||h.version<o.version)&&t.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const c=t.get(o);if(c===void 0)t.set(o,e(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,o,l),c.version=o.version}}return{get:i,remove:r,update:a}}var zf=`#ifdef USE_ALPHAHASH
49
49
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
50
- #endif`,fp=`#ifdef USE_ALPHAHASH
50
+ #endif`,Bf=`#ifdef USE_ALPHAHASH
51
51
  const float ALPHA_HASH_SCALE = 0.05;
52
52
  float hash2D( vec2 value ) {
53
53
  return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
@@ -82,20 +82,20 @@
82
82
  : cases.z;
83
83
  return clamp( threshold , 1.0e-6, 1.0 );
84
84
  }
85
- #endif`,pp=`#ifdef USE_ALPHAMAP
85
+ #endif`,kf=`#ifdef USE_ALPHAMAP
86
86
  diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
87
- #endif`,mp=`#ifdef USE_ALPHAMAP
87
+ #endif`,Vf=`#ifdef USE_ALPHAMAP
88
88
  uniform sampler2D alphaMap;
89
- #endif`,gp=`#ifdef USE_ALPHATEST
89
+ #endif`,Hf=`#ifdef USE_ALPHATEST
90
90
  #ifdef ALPHA_TO_COVERAGE
91
91
  diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
92
92
  if ( diffuseColor.a == 0.0 ) discard;
93
93
  #else
94
94
  if ( diffuseColor.a < alphaTest ) discard;
95
95
  #endif
96
- #endif`,_p=`#ifdef USE_ALPHATEST
96
+ #endif`,Gf=`#ifdef USE_ALPHATEST
97
97
  uniform float alphaTest;
98
- #endif`,vp=`#ifdef USE_AOMAP
98
+ #endif`,Wf=`#ifdef USE_AOMAP
99
99
  float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
100
100
  reflectedLight.indirectDiffuse *= ambientOcclusion;
101
101
  #if defined( USE_CLEARCOAT )
@@ -108,10 +108,10 @@
108
108
  float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
109
109
  reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
110
110
  #endif
111
- #endif`,xp=`#ifdef USE_AOMAP
111
+ #endif`,Xf=`#ifdef USE_AOMAP
112
112
  uniform sampler2D aoMap;
113
113
  uniform float aoMapIntensity;
114
- #endif`,yp=`#ifdef USE_BATCHING
114
+ #endif`,qf=`#ifdef USE_BATCHING
115
115
  #if ! defined( GL_ANGLE_multi_draw )
116
116
  #define gl_DrawID _gl_DrawID
117
117
  uniform int _gl_DrawID;
@@ -145,15 +145,15 @@
145
145
  int y = j / size;
146
146
  return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
147
147
  }
148
- #endif`,Mp=`#ifdef USE_BATCHING
148
+ #endif`,jf=`#ifdef USE_BATCHING
149
149
  mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
150
- #endif`,Sp=`vec3 transformed = vec3( position );
150
+ #endif`,Yf=`vec3 transformed = vec3( position );
151
151
  #ifdef USE_ALPHAHASH
152
152
  vPosition = vec3( position );
153
- #endif`,bp=`vec3 objectNormal = vec3( normal );
153
+ #endif`,$f=`vec3 objectNormal = vec3( normal );
154
154
  #ifdef USE_TANGENT
155
155
  vec3 objectTangent = vec3( tangent.xyz );
156
- #endif`,Ep=`float G_BlinnPhong_Implicit( ) {
156
+ #endif`,Kf=`float G_BlinnPhong_Implicit( ) {
157
157
  return 0.25;
158
158
  }
159
159
  float D_BlinnPhong( const in float shininess, const in float dotNH ) {
@@ -167,7 +167,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
167
167
  float G = G_BlinnPhong_Implicit( );
168
168
  float D = D_BlinnPhong( shininess, dotNH );
169
169
  return F * ( G * D );
170
- } // validated`,wp=`#ifdef USE_IRIDESCENCE
170
+ } // validated`,Jf=`#ifdef USE_IRIDESCENCE
171
171
  const mat3 XYZ_TO_REC709 = mat3(
172
172
  3.2404542, -0.9692660, 0.0556434,
173
173
  -1.5371385, 1.8760108, -0.2040259,
@@ -230,7 +230,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
230
230
  }
231
231
  return max( I, vec3( 0.0 ) );
232
232
  }
233
- #endif`,Ap=`#ifdef USE_BUMPMAP
233
+ #endif`,Zf=`#ifdef USE_BUMPMAP
234
234
  uniform sampler2D bumpMap;
235
235
  uniform float bumpScale;
236
236
  vec2 dHdxy_fwd() {
@@ -251,7 +251,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
251
251
  vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
252
252
  return normalize( abs( fDet ) * surf_norm - vGrad );
253
253
  }
254
- #endif`,Tp=`#if NUM_CLIPPING_PLANES > 0
254
+ #endif`,Qf=`#if NUM_CLIPPING_PLANES > 0
255
255
  vec4 plane;
256
256
  #ifdef ALPHA_TO_COVERAGE
257
257
  float distanceToPlane, distanceGradient;
@@ -297,26 +297,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
297
297
  if ( clipped ) discard;
298
298
  #endif
299
299
  #endif
300
- #endif`,Rp=`#if NUM_CLIPPING_PLANES > 0
300
+ #endif`,tp=`#if NUM_CLIPPING_PLANES > 0
301
301
  varying vec3 vClipPosition;
302
302
  uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
303
- #endif`,Cp=`#if NUM_CLIPPING_PLANES > 0
303
+ #endif`,ep=`#if NUM_CLIPPING_PLANES > 0
304
304
  varying vec3 vClipPosition;
305
- #endif`,Lp=`#if NUM_CLIPPING_PLANES > 0
305
+ #endif`,np=`#if NUM_CLIPPING_PLANES > 0
306
306
  vClipPosition = - mvPosition.xyz;
307
- #endif`,Pp=`#if defined( USE_COLOR_ALPHA )
307
+ #endif`,ip=`#if defined( USE_COLOR_ALPHA )
308
308
  diffuseColor *= vColor;
309
309
  #elif defined( USE_COLOR )
310
310
  diffuseColor.rgb *= vColor;
311
- #endif`,Dp=`#if defined( USE_COLOR_ALPHA )
311
+ #endif`,sp=`#if defined( USE_COLOR_ALPHA )
312
312
  varying vec4 vColor;
313
313
  #elif defined( USE_COLOR )
314
314
  varying vec3 vColor;
315
- #endif`,Up=`#if defined( USE_COLOR_ALPHA )
315
+ #endif`,rp=`#if defined( USE_COLOR_ALPHA )
316
316
  varying vec4 vColor;
317
317
  #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
318
318
  varying vec3 vColor;
319
- #endif`,Ip=`#if defined( USE_COLOR_ALPHA )
319
+ #endif`,ap=`#if defined( USE_COLOR_ALPHA )
320
320
  vColor = vec4( 1.0 );
321
321
  #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
322
322
  vColor = vec3( 1.0 );
@@ -330,7 +330,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
330
330
  #ifdef USE_BATCHING_COLOR
331
331
  vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
332
332
  vColor.xyz *= batchingColor.xyz;
333
- #endif`,Np=`#define PI 3.141592653589793
333
+ #endif`,op=`#define PI 3.141592653589793
334
334
  #define PI2 6.283185307179586
335
335
  #define PI_HALF 1.5707963267948966
336
336
  #define RECIPROCAL_PI 0.3183098861837907
@@ -404,7 +404,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
404
404
  float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
405
405
  float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
406
406
  return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
407
- } // validated`,Fp=`#ifdef ENVMAP_TYPE_CUBE_UV
407
+ } // validated`,lp=`#ifdef ENVMAP_TYPE_CUBE_UV
408
408
  #define cubeUV_minMipLevel 4.0
409
409
  #define cubeUV_minTileSize 16.0
410
410
  float getFace( vec3 direction ) {
@@ -497,7 +497,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
497
497
  return vec4( mix( color0, color1, mipF ), 1.0 );
498
498
  }
499
499
  }
500
- #endif`,Op=`vec3 transformedNormal = objectNormal;
500
+ #endif`,cp=`vec3 transformedNormal = objectNormal;
501
501
  #ifdef USE_TANGENT
502
502
  vec3 transformedTangent = objectTangent;
503
503
  #endif
@@ -526,21 +526,21 @@ transformedNormal = normalMatrix * transformedNormal;
526
526
  #ifdef FLIP_SIDED
527
527
  transformedTangent = - transformedTangent;
528
528
  #endif
529
- #endif`,zp=`#ifdef USE_DISPLACEMENTMAP
529
+ #endif`,hp=`#ifdef USE_DISPLACEMENTMAP
530
530
  uniform sampler2D displacementMap;
531
531
  uniform float displacementScale;
532
532
  uniform float displacementBias;
533
- #endif`,Bp=`#ifdef USE_DISPLACEMENTMAP
533
+ #endif`,up=`#ifdef USE_DISPLACEMENTMAP
534
534
  transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
535
- #endif`,kp=`#ifdef USE_EMISSIVEMAP
535
+ #endif`,dp=`#ifdef USE_EMISSIVEMAP
536
536
  vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
537
537
  #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
538
538
  emissiveColor = sRGBTransferEOTF( emissiveColor );
539
539
  #endif
540
540
  totalEmissiveRadiance *= emissiveColor.rgb;
541
- #endif`,Vp=`#ifdef USE_EMISSIVEMAP
541
+ #endif`,fp=`#ifdef USE_EMISSIVEMAP
542
542
  uniform sampler2D emissiveMap;
543
- #endif`,Hp="gl_FragColor = linearToOutputTexel( gl_FragColor );",Gp=`vec4 LinearTransferOETF( in vec4 value ) {
543
+ #endif`,pp="gl_FragColor = linearToOutputTexel( gl_FragColor );",mp=`vec4 LinearTransferOETF( in vec4 value ) {
544
544
  return value;
545
545
  }
546
546
  vec4 sRGBTransferEOTF( in vec4 value ) {
@@ -548,7 +548,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) {
548
548
  }
549
549
  vec4 sRGBTransferOETF( in vec4 value ) {
550
550
  return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
551
- }`,Wp=`#ifdef USE_ENVMAP
551
+ }`,gp=`#ifdef USE_ENVMAP
552
552
  #ifdef ENV_WORLDPOS
553
553
  vec3 cameraToFrag;
554
554
  if ( isOrthographic ) {
@@ -577,7 +577,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
577
577
  #elif defined( ENVMAP_BLENDING_ADD )
578
578
  outgoingLight += envColor.xyz * specularStrength * reflectivity;
579
579
  #endif
580
- #endif`,Xp=`#ifdef USE_ENVMAP
580
+ #endif`,_p=`#ifdef USE_ENVMAP
581
581
  uniform float envMapIntensity;
582
582
  uniform float flipEnvMap;
583
583
  uniform mat3 envMapRotation;
@@ -587,7 +587,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
587
587
  uniform sampler2D envMap;
588
588
  #endif
589
589
 
590
- #endif`,qp=`#ifdef USE_ENVMAP
590
+ #endif`,vp=`#ifdef USE_ENVMAP
591
591
  uniform float reflectivity;
592
592
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
593
593
  #define ENV_WORLDPOS
@@ -598,7 +598,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
598
598
  #else
599
599
  varying vec3 vReflect;
600
600
  #endif
601
- #endif`,jp=`#ifdef USE_ENVMAP
601
+ #endif`,xp=`#ifdef USE_ENVMAP
602
602
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
603
603
  #define ENV_WORLDPOS
604
604
  #endif
@@ -609,7 +609,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
609
609
  varying vec3 vReflect;
610
610
  uniform float refractionRatio;
611
611
  #endif
612
- #endif`,Yp=`#ifdef USE_ENVMAP
612
+ #endif`,yp=`#ifdef USE_ENVMAP
613
613
  #ifdef ENV_WORLDPOS
614
614
  vWorldPosition = worldPosition.xyz;
615
615
  #else
@@ -626,18 +626,18 @@ vec4 sRGBTransferOETF( in vec4 value ) {
626
626
  vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
627
627
  #endif
628
628
  #endif
629
- #endif`,Jp=`#ifdef USE_FOG
629
+ #endif`,Mp=`#ifdef USE_FOG
630
630
  vFogDepth = - mvPosition.z;
631
- #endif`,$p=`#ifdef USE_FOG
631
+ #endif`,Sp=`#ifdef USE_FOG
632
632
  varying float vFogDepth;
633
- #endif`,Kp=`#ifdef USE_FOG
633
+ #endif`,bp=`#ifdef USE_FOG
634
634
  #ifdef FOG_EXP2
635
635
  float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
636
636
  #else
637
637
  float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
638
638
  #endif
639
639
  gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
640
- #endif`,Zp=`#ifdef USE_FOG
640
+ #endif`,Ep=`#ifdef USE_FOG
641
641
  uniform vec3 fogColor;
642
642
  varying float vFogDepth;
643
643
  #ifdef FOG_EXP2
@@ -646,7 +646,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
646
646
  uniform float fogNear;
647
647
  uniform float fogFar;
648
648
  #endif
649
- #endif`,Qp=`#ifdef USE_GRADIENTMAP
649
+ #endif`,wp=`#ifdef USE_GRADIENTMAP
650
650
  uniform sampler2D gradientMap;
651
651
  #endif
652
652
  vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
@@ -658,12 +658,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
658
658
  vec2 fw = fwidth( coord ) * 0.5;
659
659
  return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
660
660
  #endif
661
- }`,t0=`#ifdef USE_LIGHTMAP
661
+ }`,Tp=`#ifdef USE_LIGHTMAP
662
662
  uniform sampler2D lightMap;
663
663
  uniform float lightMapIntensity;
664
- #endif`,e0=`LambertMaterial material;
664
+ #endif`,Ap=`LambertMaterial material;
665
665
  material.diffuseColor = diffuseColor.rgb;
666
- material.specularStrength = specularStrength;`,n0=`varying vec3 vViewPosition;
666
+ material.specularStrength = specularStrength;`,Rp=`varying vec3 vViewPosition;
667
667
  struct LambertMaterial {
668
668
  vec3 diffuseColor;
669
669
  float specularStrength;
@@ -677,7 +677,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr
677
677
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
678
678
  }
679
679
  #define RE_Direct RE_Direct_Lambert
680
- #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,i0=`uniform bool receiveShadow;
680
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Cp=`uniform bool receiveShadow;
681
681
  uniform vec3 ambientLightColor;
682
682
  #if defined( USE_LIGHT_PROBES )
683
683
  uniform vec3 lightProbe[ 9 ];
@@ -793,7 +793,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
793
793
  vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
794
794
  return irradiance;
795
795
  }
796
- #endif`,s0=`#ifdef USE_ENVMAP
796
+ #endif`,Lp=`#ifdef USE_ENVMAP
797
797
  vec3 getIBLIrradiance( const in vec3 normal ) {
798
798
  #ifdef ENVMAP_TYPE_CUBE_UV
799
799
  vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
@@ -826,8 +826,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
826
826
  #endif
827
827
  }
828
828
  #endif
829
- #endif`,r0=`ToonMaterial material;
830
- material.diffuseColor = diffuseColor.rgb;`,a0=`varying vec3 vViewPosition;
829
+ #endif`,Pp=`ToonMaterial material;
830
+ material.diffuseColor = diffuseColor.rgb;`,Dp=`varying vec3 vViewPosition;
831
831
  struct ToonMaterial {
832
832
  vec3 diffuseColor;
833
833
  };
@@ -839,11 +839,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo
839
839
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
840
840
  }
841
841
  #define RE_Direct RE_Direct_Toon
842
- #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,o0=`BlinnPhongMaterial material;
842
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Up=`BlinnPhongMaterial material;
843
843
  material.diffuseColor = diffuseColor.rgb;
844
844
  material.specularColor = specular;
845
845
  material.specularShininess = shininess;
846
- material.specularStrength = specularStrength;`,l0=`varying vec3 vViewPosition;
846
+ material.specularStrength = specularStrength;`,Ip=`varying vec3 vViewPosition;
847
847
  struct BlinnPhongMaterial {
848
848
  vec3 diffuseColor;
849
849
  vec3 specularColor;
@@ -860,7 +860,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom
860
860
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
861
861
  }
862
862
  #define RE_Direct RE_Direct_BlinnPhong
863
- #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,c0=`PhysicalMaterial material;
863
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Np=`PhysicalMaterial material;
864
864
  material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
865
865
  vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
866
866
  float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
@@ -946,7 +946,7 @@ material.roughness = min( material.roughness, 1.0 );
946
946
  material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
947
947
  material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
948
948
  material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
949
- #endif`,h0=`struct PhysicalMaterial {
949
+ #endif`,Fp=`struct PhysicalMaterial {
950
950
  vec3 diffuseColor;
951
951
  float roughness;
952
952
  vec3 specularColor;
@@ -1247,7 +1247,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
1247
1247
  #define RE_IndirectSpecular RE_IndirectSpecular_Physical
1248
1248
  float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1249
1249
  return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1250
- }`,u0=`
1250
+ }`,Op=`
1251
1251
  vec3 geometryPosition = - vViewPosition;
1252
1252
  vec3 geometryNormal = normal;
1253
1253
  vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
@@ -1362,7 +1362,7 @@ IncidentLight directLight;
1362
1362
  #if defined( RE_IndirectSpecular )
1363
1363
  vec3 radiance = vec3( 0.0 );
1364
1364
  vec3 clearcoatRadiance = vec3( 0.0 );
1365
- #endif`,d0=`#if defined( RE_IndirectDiffuse )
1365
+ #endif`,zp=`#if defined( RE_IndirectDiffuse )
1366
1366
  #ifdef USE_LIGHTMAP
1367
1367
  vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1368
1368
  vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
@@ -1381,32 +1381,32 @@ IncidentLight directLight;
1381
1381
  #ifdef USE_CLEARCOAT
1382
1382
  clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1383
1383
  #endif
1384
- #endif`,f0=`#if defined( RE_IndirectDiffuse )
1384
+ #endif`,Bp=`#if defined( RE_IndirectDiffuse )
1385
1385
  RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1386
1386
  #endif
1387
1387
  #if defined( RE_IndirectSpecular )
1388
1388
  RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1389
- #endif`,p0=`#if defined( USE_LOGDEPTHBUF )
1389
+ #endif`,kp=`#if defined( USE_LOGDEPTHBUF )
1390
1390
  gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1391
- #endif`,m0=`#if defined( USE_LOGDEPTHBUF )
1391
+ #endif`,Vp=`#if defined( USE_LOGDEPTHBUF )
1392
1392
  uniform float logDepthBufFC;
1393
1393
  varying float vFragDepth;
1394
1394
  varying float vIsPerspective;
1395
- #endif`,g0=`#ifdef USE_LOGDEPTHBUF
1395
+ #endif`,Hp=`#ifdef USE_LOGDEPTHBUF
1396
1396
  varying float vFragDepth;
1397
1397
  varying float vIsPerspective;
1398
- #endif`,_0=`#ifdef USE_LOGDEPTHBUF
1398
+ #endif`,Gp=`#ifdef USE_LOGDEPTHBUF
1399
1399
  vFragDepth = 1.0 + gl_Position.w;
1400
1400
  vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1401
- #endif`,v0=`#ifdef USE_MAP
1401
+ #endif`,Wp=`#ifdef USE_MAP
1402
1402
  vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1403
1403
  #ifdef DECODE_VIDEO_TEXTURE
1404
1404
  sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1405
1405
  #endif
1406
1406
  diffuseColor *= sampledDiffuseColor;
1407
- #endif`,x0=`#ifdef USE_MAP
1407
+ #endif`,Xp=`#ifdef USE_MAP
1408
1408
  uniform sampler2D map;
1409
- #endif`,y0=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1409
+ #endif`,qp=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1410
1410
  #if defined( USE_POINTS_UV )
1411
1411
  vec2 uv = vUv;
1412
1412
  #else
@@ -1418,7 +1418,7 @@ IncidentLight directLight;
1418
1418
  #endif
1419
1419
  #ifdef USE_ALPHAMAP
1420
1420
  diffuseColor.a *= texture2D( alphaMap, uv ).g;
1421
- #endif`,M0=`#if defined( USE_POINTS_UV )
1421
+ #endif`,jp=`#if defined( USE_POINTS_UV )
1422
1422
  varying vec2 vUv;
1423
1423
  #else
1424
1424
  #if defined( USE_MAP ) || defined( USE_ALPHAMAP )
@@ -1430,19 +1430,19 @@ IncidentLight directLight;
1430
1430
  #endif
1431
1431
  #ifdef USE_ALPHAMAP
1432
1432
  uniform sampler2D alphaMap;
1433
- #endif`,S0=`float metalnessFactor = metalness;
1433
+ #endif`,Yp=`float metalnessFactor = metalness;
1434
1434
  #ifdef USE_METALNESSMAP
1435
1435
  vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1436
1436
  metalnessFactor *= texelMetalness.b;
1437
- #endif`,b0=`#ifdef USE_METALNESSMAP
1437
+ #endif`,$p=`#ifdef USE_METALNESSMAP
1438
1438
  uniform sampler2D metalnessMap;
1439
- #endif`,E0=`#ifdef USE_INSTANCING_MORPH
1439
+ #endif`,Kp=`#ifdef USE_INSTANCING_MORPH
1440
1440
  float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1441
1441
  float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1442
1442
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1443
1443
  morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1444
1444
  }
1445
- #endif`,w0=`#if defined( USE_MORPHCOLORS )
1445
+ #endif`,Jp=`#if defined( USE_MORPHCOLORS )
1446
1446
  vColor *= morphTargetBaseInfluence;
1447
1447
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1448
1448
  #if defined( USE_COLOR_ALPHA )
@@ -1451,12 +1451,12 @@ IncidentLight directLight;
1451
1451
  if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1452
1452
  #endif
1453
1453
  }
1454
- #endif`,A0=`#ifdef USE_MORPHNORMALS
1454
+ #endif`,Zp=`#ifdef USE_MORPHNORMALS
1455
1455
  objectNormal *= morphTargetBaseInfluence;
1456
1456
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1457
1457
  if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1458
1458
  }
1459
- #endif`,T0=`#ifdef USE_MORPHTARGETS
1459
+ #endif`,Qp=`#ifdef USE_MORPHTARGETS
1460
1460
  #ifndef USE_INSTANCING_MORPH
1461
1461
  uniform float morphTargetBaseInfluence;
1462
1462
  uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
@@ -1470,12 +1470,12 @@ IncidentLight directLight;
1470
1470
  ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1471
1471
  return texelFetch( morphTargetsTexture, morphUV, 0 );
1472
1472
  }
1473
- #endif`,R0=`#ifdef USE_MORPHTARGETS
1473
+ #endif`,t0=`#ifdef USE_MORPHTARGETS
1474
1474
  transformed *= morphTargetBaseInfluence;
1475
1475
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1476
1476
  if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1477
1477
  }
1478
- #endif`,C0=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1478
+ #endif`,e0=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1479
1479
  #ifdef FLAT_SHADED
1480
1480
  vec3 fdx = dFdx( vViewPosition );
1481
1481
  vec3 fdy = dFdy( vViewPosition );
@@ -1516,7 +1516,7 @@ IncidentLight directLight;
1516
1516
  tbn2[1] *= faceDirection;
1517
1517
  #endif
1518
1518
  #endif
1519
- vec3 nonPerturbedNormal = normal;`,L0=`#ifdef USE_NORMALMAP_OBJECTSPACE
1519
+ vec3 nonPerturbedNormal = normal;`,n0=`#ifdef USE_NORMALMAP_OBJECTSPACE
1520
1520
  normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1521
1521
  #ifdef FLIP_SIDED
1522
1522
  normal = - normal;
@@ -1531,25 +1531,25 @@ vec3 nonPerturbedNormal = normal;`,L0=`#ifdef USE_NORMALMAP_OBJECTSPACE
1531
1531
  normal = normalize( tbn * mapN );
1532
1532
  #elif defined( USE_BUMPMAP )
1533
1533
  normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1534
- #endif`,P0=`#ifndef FLAT_SHADED
1534
+ #endif`,i0=`#ifndef FLAT_SHADED
1535
1535
  varying vec3 vNormal;
1536
1536
  #ifdef USE_TANGENT
1537
1537
  varying vec3 vTangent;
1538
1538
  varying vec3 vBitangent;
1539
1539
  #endif
1540
- #endif`,D0=`#ifndef FLAT_SHADED
1540
+ #endif`,s0=`#ifndef FLAT_SHADED
1541
1541
  varying vec3 vNormal;
1542
1542
  #ifdef USE_TANGENT
1543
1543
  varying vec3 vTangent;
1544
1544
  varying vec3 vBitangent;
1545
1545
  #endif
1546
- #endif`,U0=`#ifndef FLAT_SHADED
1546
+ #endif`,r0=`#ifndef FLAT_SHADED
1547
1547
  vNormal = normalize( transformedNormal );
1548
1548
  #ifdef USE_TANGENT
1549
1549
  vTangent = normalize( transformedTangent );
1550
1550
  vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1551
1551
  #endif
1552
- #endif`,I0=`#ifdef USE_NORMALMAP
1552
+ #endif`,a0=`#ifdef USE_NORMALMAP
1553
1553
  uniform sampler2D normalMap;
1554
1554
  uniform vec2 normalScale;
1555
1555
  #endif
@@ -1571,13 +1571,13 @@ vec3 nonPerturbedNormal = normal;`,L0=`#ifdef USE_NORMALMAP_OBJECTSPACE
1571
1571
  float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1572
1572
  return mat3( T * scale, B * scale, N );
1573
1573
  }
1574
- #endif`,N0=`#ifdef USE_CLEARCOAT
1574
+ #endif`,o0=`#ifdef USE_CLEARCOAT
1575
1575
  vec3 clearcoatNormal = nonPerturbedNormal;
1576
- #endif`,F0=`#ifdef USE_CLEARCOAT_NORMALMAP
1576
+ #endif`,l0=`#ifdef USE_CLEARCOAT_NORMALMAP
1577
1577
  vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1578
1578
  clearcoatMapN.xy *= clearcoatNormalScale;
1579
1579
  clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1580
- #endif`,O0=`#ifdef USE_CLEARCOATMAP
1580
+ #endif`,c0=`#ifdef USE_CLEARCOATMAP
1581
1581
  uniform sampler2D clearcoatMap;
1582
1582
  #endif
1583
1583
  #ifdef USE_CLEARCOAT_NORMALMAP
@@ -1586,18 +1586,18 @@ vec3 nonPerturbedNormal = normal;`,L0=`#ifdef USE_NORMALMAP_OBJECTSPACE
1586
1586
  #endif
1587
1587
  #ifdef USE_CLEARCOAT_ROUGHNESSMAP
1588
1588
  uniform sampler2D clearcoatRoughnessMap;
1589
- #endif`,z0=`#ifdef USE_IRIDESCENCEMAP
1589
+ #endif`,h0=`#ifdef USE_IRIDESCENCEMAP
1590
1590
  uniform sampler2D iridescenceMap;
1591
1591
  #endif
1592
1592
  #ifdef USE_IRIDESCENCE_THICKNESSMAP
1593
1593
  uniform sampler2D iridescenceThicknessMap;
1594
- #endif`,B0=`#ifdef OPAQUE
1594
+ #endif`,u0=`#ifdef OPAQUE
1595
1595
  diffuseColor.a = 1.0;
1596
1596
  #endif
1597
1597
  #ifdef USE_TRANSMISSION
1598
1598
  diffuseColor.a *= material.transmissionAlpha;
1599
1599
  #endif
1600
- gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,k0=`vec3 packNormalToRGB( const in vec3 normal ) {
1600
+ gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,d0=`vec3 packNormalToRGB( const in vec3 normal ) {
1601
1601
  return normalize( normal ) * 0.5 + 0.5;
1602
1602
  }
1603
1603
  vec3 unpackRGBToNormal( const in vec3 rgb ) {
@@ -1666,9 +1666,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const
1666
1666
  }
1667
1667
  float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1668
1668
  return ( near * far ) / ( ( far - near ) * depth - far );
1669
- }`,V0=`#ifdef PREMULTIPLIED_ALPHA
1669
+ }`,f0=`#ifdef PREMULTIPLIED_ALPHA
1670
1670
  gl_FragColor.rgb *= gl_FragColor.a;
1671
- #endif`,H0=`vec4 mvPosition = vec4( transformed, 1.0 );
1671
+ #endif`,p0=`vec4 mvPosition = vec4( transformed, 1.0 );
1672
1672
  #ifdef USE_BATCHING
1673
1673
  mvPosition = batchingMatrix * mvPosition;
1674
1674
  #endif
@@ -1676,22 +1676,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
1676
1676
  mvPosition = instanceMatrix * mvPosition;
1677
1677
  #endif
1678
1678
  mvPosition = modelViewMatrix * mvPosition;
1679
- gl_Position = projectionMatrix * mvPosition;`,G0=`#ifdef DITHERING
1679
+ gl_Position = projectionMatrix * mvPosition;`,m0=`#ifdef DITHERING
1680
1680
  gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1681
- #endif`,W0=`#ifdef DITHERING
1681
+ #endif`,g0=`#ifdef DITHERING
1682
1682
  vec3 dithering( vec3 color ) {
1683
1683
  float grid_position = rand( gl_FragCoord.xy );
1684
1684
  vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1685
1685
  dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1686
1686
  return color + dither_shift_RGB;
1687
1687
  }
1688
- #endif`,X0=`float roughnessFactor = roughness;
1688
+ #endif`,_0=`float roughnessFactor = roughness;
1689
1689
  #ifdef USE_ROUGHNESSMAP
1690
1690
  vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1691
1691
  roughnessFactor *= texelRoughness.g;
1692
- #endif`,q0=`#ifdef USE_ROUGHNESSMAP
1692
+ #endif`,v0=`#ifdef USE_ROUGHNESSMAP
1693
1693
  uniform sampler2D roughnessMap;
1694
- #endif`,j0=`#if NUM_SPOT_LIGHT_COORDS > 0
1694
+ #endif`,x0=`#if NUM_SPOT_LIGHT_COORDS > 0
1695
1695
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1696
1696
  #endif
1697
1697
  #if NUM_SPOT_LIGHT_MAPS > 0
@@ -1877,7 +1877,7 @@ gl_Position = projectionMatrix * mvPosition;`,G0=`#ifdef DITHERING
1877
1877
  }
1878
1878
  return mix( 1.0, shadow, shadowIntensity );
1879
1879
  }
1880
- #endif`,Y0=`#if NUM_SPOT_LIGHT_COORDS > 0
1880
+ #endif`,y0=`#if NUM_SPOT_LIGHT_COORDS > 0
1881
1881
  uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1882
1882
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1883
1883
  #endif
@@ -1918,7 +1918,7 @@ gl_Position = projectionMatrix * mvPosition;`,G0=`#ifdef DITHERING
1918
1918
  };
1919
1919
  uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1920
1920
  #endif
1921
- #endif`,J0=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1921
+ #endif`,M0=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1922
1922
  vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
1923
1923
  vec4 shadowWorldPosition;
1924
1924
  #endif
@@ -1950,7 +1950,7 @@ gl_Position = projectionMatrix * mvPosition;`,G0=`#ifdef DITHERING
1950
1950
  vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
1951
1951
  }
1952
1952
  #pragma unroll_loop_end
1953
- #endif`,$0=`float getShadowMask() {
1953
+ #endif`,S0=`float getShadowMask() {
1954
1954
  float shadow = 1.0;
1955
1955
  #ifdef USE_SHADOWMAP
1956
1956
  #if NUM_DIR_LIGHT_SHADOWS > 0
@@ -1982,12 +1982,12 @@ gl_Position = projectionMatrix * mvPosition;`,G0=`#ifdef DITHERING
1982
1982
  #endif
1983
1983
  #endif
1984
1984
  return shadow;
1985
- }`,K0=`#ifdef USE_SKINNING
1985
+ }`,b0=`#ifdef USE_SKINNING
1986
1986
  mat4 boneMatX = getBoneMatrix( skinIndex.x );
1987
1987
  mat4 boneMatY = getBoneMatrix( skinIndex.y );
1988
1988
  mat4 boneMatZ = getBoneMatrix( skinIndex.z );
1989
1989
  mat4 boneMatW = getBoneMatrix( skinIndex.w );
1990
- #endif`,Z0=`#ifdef USE_SKINNING
1990
+ #endif`,E0=`#ifdef USE_SKINNING
1991
1991
  uniform mat4 bindMatrix;
1992
1992
  uniform mat4 bindMatrixInverse;
1993
1993
  uniform highp sampler2D boneTexture;
@@ -2002,7 +2002,7 @@ gl_Position = projectionMatrix * mvPosition;`,G0=`#ifdef DITHERING
2002
2002
  vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2003
2003
  return mat4( v1, v2, v3, v4 );
2004
2004
  }
2005
- #endif`,Q0=`#ifdef USE_SKINNING
2005
+ #endif`,w0=`#ifdef USE_SKINNING
2006
2006
  vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2007
2007
  vec4 skinned = vec4( 0.0 );
2008
2008
  skinned += boneMatX * skinVertex * skinWeight.x;
@@ -2010,7 +2010,7 @@ gl_Position = projectionMatrix * mvPosition;`,G0=`#ifdef DITHERING
2010
2010
  skinned += boneMatZ * skinVertex * skinWeight.z;
2011
2011
  skinned += boneMatW * skinVertex * skinWeight.w;
2012
2012
  transformed = ( bindMatrixInverse * skinned ).xyz;
2013
- #endif`,tm=`#ifdef USE_SKINNING
2013
+ #endif`,T0=`#ifdef USE_SKINNING
2014
2014
  mat4 skinMatrix = mat4( 0.0 );
2015
2015
  skinMatrix += skinWeight.x * boneMatX;
2016
2016
  skinMatrix += skinWeight.y * boneMatY;
@@ -2021,17 +2021,17 @@ gl_Position = projectionMatrix * mvPosition;`,G0=`#ifdef DITHERING
2021
2021
  #ifdef USE_TANGENT
2022
2022
  objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2023
2023
  #endif
2024
- #endif`,em=`float specularStrength;
2024
+ #endif`,A0=`float specularStrength;
2025
2025
  #ifdef USE_SPECULARMAP
2026
2026
  vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2027
2027
  specularStrength = texelSpecular.r;
2028
2028
  #else
2029
2029
  specularStrength = 1.0;
2030
- #endif`,nm=`#ifdef USE_SPECULARMAP
2030
+ #endif`,R0=`#ifdef USE_SPECULARMAP
2031
2031
  uniform sampler2D specularMap;
2032
- #endif`,im=`#if defined( TONE_MAPPING )
2032
+ #endif`,C0=`#if defined( TONE_MAPPING )
2033
2033
  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2034
- #endif`,sm=`#ifndef saturate
2034
+ #endif`,L0=`#ifndef saturate
2035
2035
  #define saturate( a ) clamp( a, 0.0, 1.0 )
2036
2036
  #endif
2037
2037
  uniform float toneMappingExposure;
@@ -2128,7 +2128,7 @@ vec3 NeutralToneMapping( vec3 color ) {
2128
2128
  float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2129
2129
  return mix( color, vec3( newPeak ), g );
2130
2130
  }
2131
- vec3 CustomToneMapping( vec3 color ) { return color; }`,rm=`#ifdef USE_TRANSMISSION
2131
+ vec3 CustomToneMapping( vec3 color ) { return color; }`,P0=`#ifdef USE_TRANSMISSION
2132
2132
  material.transmission = transmission;
2133
2133
  material.transmissionAlpha = 1.0;
2134
2134
  material.thickness = thickness;
@@ -2149,7 +2149,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rm=`#ifdef USE_TRANSMISS
2149
2149
  material.attenuationColor, material.attenuationDistance );
2150
2150
  material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2151
2151
  totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2152
- #endif`,am=`#ifdef USE_TRANSMISSION
2152
+ #endif`,D0=`#ifdef USE_TRANSMISSION
2153
2153
  uniform float transmission;
2154
2154
  uniform float thickness;
2155
2155
  uniform float attenuationDistance;
@@ -2275,7 +2275,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rm=`#ifdef USE_TRANSMISS
2275
2275
  float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2276
2276
  return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2277
2277
  }
2278
- #endif`,om=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2278
+ #endif`,U0=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2279
2279
  varying vec2 vUv;
2280
2280
  #endif
2281
2281
  #ifdef USE_MAP
@@ -2345,7 +2345,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rm=`#ifdef USE_TRANSMISS
2345
2345
  #ifdef USE_THICKNESSMAP
2346
2346
  uniform mat3 thicknessMapTransform;
2347
2347
  varying vec2 vThicknessMapUv;
2348
- #endif`,lm=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2348
+ #endif`,I0=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2349
2349
  varying vec2 vUv;
2350
2350
  #endif
2351
2351
  #ifdef USE_MAP
@@ -2439,7 +2439,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rm=`#ifdef USE_TRANSMISS
2439
2439
  #ifdef USE_THICKNESSMAP
2440
2440
  uniform mat3 thicknessMapTransform;
2441
2441
  varying vec2 vThicknessMapUv;
2442
- #endif`,cm=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2442
+ #endif`,N0=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2443
2443
  vUv = vec3( uv, 1 ).xy;
2444
2444
  #endif
2445
2445
  #ifdef USE_MAP
@@ -2510,7 +2510,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rm=`#ifdef USE_TRANSMISS
2510
2510
  #endif
2511
2511
  #ifdef USE_THICKNESSMAP
2512
2512
  vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2513
- #endif`,hm=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2513
+ #endif`,F0=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2514
2514
  vec4 worldPosition = vec4( transformed, 1.0 );
2515
2515
  #ifdef USE_BATCHING
2516
2516
  worldPosition = batchingMatrix * worldPosition;
@@ -2519,12 +2519,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rm=`#ifdef USE_TRANSMISS
2519
2519
  worldPosition = instanceMatrix * worldPosition;
2520
2520
  #endif
2521
2521
  worldPosition = modelMatrix * worldPosition;
2522
- #endif`;const um=`varying vec2 vUv;
2522
+ #endif`;const O0=`varying vec2 vUv;
2523
2523
  uniform mat3 uvTransform;
2524
2524
  void main() {
2525
2525
  vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2526
2526
  gl_Position = vec4( position.xy, 1.0, 1.0 );
2527
- }`,dm=`uniform sampler2D t2D;
2527
+ }`,z0=`uniform sampler2D t2D;
2528
2528
  uniform float backgroundIntensity;
2529
2529
  varying vec2 vUv;
2530
2530
  void main() {
@@ -2536,14 +2536,14 @@ void main() {
2536
2536
  gl_FragColor = texColor;
2537
2537
  #include <tonemapping_fragment>
2538
2538
  #include <colorspace_fragment>
2539
- }`,fm=`varying vec3 vWorldDirection;
2539
+ }`,B0=`varying vec3 vWorldDirection;
2540
2540
  #include <common>
2541
2541
  void main() {
2542
2542
  vWorldDirection = transformDirection( position, modelMatrix );
2543
2543
  #include <begin_vertex>
2544
2544
  #include <project_vertex>
2545
2545
  gl_Position.z = gl_Position.w;
2546
- }`,pm=`#ifdef ENVMAP_TYPE_CUBE
2546
+ }`,k0=`#ifdef ENVMAP_TYPE_CUBE
2547
2547
  uniform samplerCube envMap;
2548
2548
  #elif defined( ENVMAP_TYPE_CUBE_UV )
2549
2549
  uniform sampler2D envMap;
@@ -2566,14 +2566,14 @@ void main() {
2566
2566
  gl_FragColor = texColor;
2567
2567
  #include <tonemapping_fragment>
2568
2568
  #include <colorspace_fragment>
2569
- }`,mm=`varying vec3 vWorldDirection;
2569
+ }`,V0=`varying vec3 vWorldDirection;
2570
2570
  #include <common>
2571
2571
  void main() {
2572
2572
  vWorldDirection = transformDirection( position, modelMatrix );
2573
2573
  #include <begin_vertex>
2574
2574
  #include <project_vertex>
2575
2575
  gl_Position.z = gl_Position.w;
2576
- }`,gm=`uniform samplerCube tCube;
2576
+ }`,H0=`uniform samplerCube tCube;
2577
2577
  uniform float tFlip;
2578
2578
  uniform float opacity;
2579
2579
  varying vec3 vWorldDirection;
@@ -2583,7 +2583,7 @@ void main() {
2583
2583
  gl_FragColor.a *= opacity;
2584
2584
  #include <tonemapping_fragment>
2585
2585
  #include <colorspace_fragment>
2586
- }`,_m=`#include <common>
2586
+ }`,G0=`#include <common>
2587
2587
  #include <batching_pars_vertex>
2588
2588
  #include <uv_pars_vertex>
2589
2589
  #include <displacementmap_pars_vertex>
@@ -2610,7 +2610,7 @@ void main() {
2610
2610
  #include <logdepthbuf_vertex>
2611
2611
  #include <clipping_planes_vertex>
2612
2612
  vHighPrecisionZW = gl_Position.zw;
2613
- }`,vm=`#if DEPTH_PACKING == 3200
2613
+ }`,W0=`#if DEPTH_PACKING == 3200
2614
2614
  uniform float opacity;
2615
2615
  #endif
2616
2616
  #include <common>
@@ -2644,7 +2644,7 @@ void main() {
2644
2644
  #elif DEPTH_PACKING == 3203
2645
2645
  gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2646
2646
  #endif
2647
- }`,xm=`#define DISTANCE
2647
+ }`,X0=`#define DISTANCE
2648
2648
  varying vec3 vWorldPosition;
2649
2649
  #include <common>
2650
2650
  #include <batching_pars_vertex>
@@ -2671,7 +2671,7 @@ void main() {
2671
2671
  #include <worldpos_vertex>
2672
2672
  #include <clipping_planes_vertex>
2673
2673
  vWorldPosition = worldPosition.xyz;
2674
- }`,ym=`#define DISTANCE
2674
+ }`,q0=`#define DISTANCE
2675
2675
  uniform vec3 referencePosition;
2676
2676
  uniform float nearDistance;
2677
2677
  uniform float farDistance;
@@ -2695,13 +2695,13 @@ void main () {
2695
2695
  dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2696
2696
  dist = saturate( dist );
2697
2697
  gl_FragColor = packDepthToRGBA( dist );
2698
- }`,Mm=`varying vec3 vWorldDirection;
2698
+ }`,j0=`varying vec3 vWorldDirection;
2699
2699
  #include <common>
2700
2700
  void main() {
2701
2701
  vWorldDirection = transformDirection( position, modelMatrix );
2702
2702
  #include <begin_vertex>
2703
2703
  #include <project_vertex>
2704
- }`,Sm=`uniform sampler2D tEquirect;
2704
+ }`,Y0=`uniform sampler2D tEquirect;
2705
2705
  varying vec3 vWorldDirection;
2706
2706
  #include <common>
2707
2707
  void main() {
@@ -2710,7 +2710,7 @@ void main() {
2710
2710
  gl_FragColor = texture2D( tEquirect, sampleUV );
2711
2711
  #include <tonemapping_fragment>
2712
2712
  #include <colorspace_fragment>
2713
- }`,bm=`uniform float scale;
2713
+ }`,$0=`uniform float scale;
2714
2714
  attribute float lineDistance;
2715
2715
  varying float vLineDistance;
2716
2716
  #include <common>
@@ -2732,7 +2732,7 @@ void main() {
2732
2732
  #include <logdepthbuf_vertex>
2733
2733
  #include <clipping_planes_vertex>
2734
2734
  #include <fog_vertex>
2735
- }`,Em=`uniform vec3 diffuse;
2735
+ }`,K0=`uniform vec3 diffuse;
2736
2736
  uniform float opacity;
2737
2737
  uniform float dashSize;
2738
2738
  uniform float totalSize;
@@ -2760,7 +2760,7 @@ void main() {
2760
2760
  #include <colorspace_fragment>
2761
2761
  #include <fog_fragment>
2762
2762
  #include <premultiplied_alpha_fragment>
2763
- }`,wm=`#include <common>
2763
+ }`,J0=`#include <common>
2764
2764
  #include <batching_pars_vertex>
2765
2765
  #include <uv_pars_vertex>
2766
2766
  #include <envmap_pars_vertex>
@@ -2792,7 +2792,7 @@ void main() {
2792
2792
  #include <worldpos_vertex>
2793
2793
  #include <envmap_vertex>
2794
2794
  #include <fog_vertex>
2795
- }`,Am=`uniform vec3 diffuse;
2795
+ }`,Z0=`uniform vec3 diffuse;
2796
2796
  uniform float opacity;
2797
2797
  #ifndef FLAT_SHADED
2798
2798
  varying vec3 vNormal;
@@ -2840,7 +2840,7 @@ void main() {
2840
2840
  #include <fog_fragment>
2841
2841
  #include <premultiplied_alpha_fragment>
2842
2842
  #include <dithering_fragment>
2843
- }`,Tm=`#define LAMBERT
2843
+ }`,Q0=`#define LAMBERT
2844
2844
  varying vec3 vViewPosition;
2845
2845
  #include <common>
2846
2846
  #include <batching_pars_vertex>
@@ -2879,7 +2879,7 @@ void main() {
2879
2879
  #include <envmap_vertex>
2880
2880
  #include <shadowmap_vertex>
2881
2881
  #include <fog_vertex>
2882
- }`,Rm=`#define LAMBERT
2882
+ }`,tm=`#define LAMBERT
2883
2883
  uniform vec3 diffuse;
2884
2884
  uniform vec3 emissive;
2885
2885
  uniform float opacity;
@@ -2936,7 +2936,7 @@ void main() {
2936
2936
  #include <fog_fragment>
2937
2937
  #include <premultiplied_alpha_fragment>
2938
2938
  #include <dithering_fragment>
2939
- }`,Cm=`#define MATCAP
2939
+ }`,em=`#define MATCAP
2940
2940
  varying vec3 vViewPosition;
2941
2941
  #include <common>
2942
2942
  #include <batching_pars_vertex>
@@ -2970,7 +2970,7 @@ void main() {
2970
2970
  #include <clipping_planes_vertex>
2971
2971
  #include <fog_vertex>
2972
2972
  vViewPosition = - mvPosition.xyz;
2973
- }`,Lm=`#define MATCAP
2973
+ }`,nm=`#define MATCAP
2974
2974
  uniform vec3 diffuse;
2975
2975
  uniform float opacity;
2976
2976
  uniform sampler2D matcap;
@@ -3016,7 +3016,7 @@ void main() {
3016
3016
  #include <fog_fragment>
3017
3017
  #include <premultiplied_alpha_fragment>
3018
3018
  #include <dithering_fragment>
3019
- }`,Pm=`#define NORMAL
3019
+ }`,im=`#define NORMAL
3020
3020
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3021
3021
  varying vec3 vViewPosition;
3022
3022
  #endif
@@ -3049,7 +3049,7 @@ void main() {
3049
3049
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3050
3050
  vViewPosition = - mvPosition.xyz;
3051
3051
  #endif
3052
- }`,Dm=`#define NORMAL
3052
+ }`,sm=`#define NORMAL
3053
3053
  uniform float opacity;
3054
3054
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3055
3055
  varying vec3 vViewPosition;
@@ -3071,7 +3071,7 @@ void main() {
3071
3071
  #ifdef OPAQUE
3072
3072
  gl_FragColor.a = 1.0;
3073
3073
  #endif
3074
- }`,Um=`#define PHONG
3074
+ }`,rm=`#define PHONG
3075
3075
  varying vec3 vViewPosition;
3076
3076
  #include <common>
3077
3077
  #include <batching_pars_vertex>
@@ -3110,7 +3110,7 @@ void main() {
3110
3110
  #include <envmap_vertex>
3111
3111
  #include <shadowmap_vertex>
3112
3112
  #include <fog_vertex>
3113
- }`,Im=`#define PHONG
3113
+ }`,am=`#define PHONG
3114
3114
  uniform vec3 diffuse;
3115
3115
  uniform vec3 emissive;
3116
3116
  uniform vec3 specular;
@@ -3169,7 +3169,7 @@ void main() {
3169
3169
  #include <fog_fragment>
3170
3170
  #include <premultiplied_alpha_fragment>
3171
3171
  #include <dithering_fragment>
3172
- }`,Nm=`#define STANDARD
3172
+ }`,om=`#define STANDARD
3173
3173
  varying vec3 vViewPosition;
3174
3174
  #ifdef USE_TRANSMISSION
3175
3175
  varying vec3 vWorldPosition;
@@ -3212,7 +3212,7 @@ void main() {
3212
3212
  #ifdef USE_TRANSMISSION
3213
3213
  vWorldPosition = worldPosition.xyz;
3214
3214
  #endif
3215
- }`,Fm=`#define STANDARD
3215
+ }`,lm=`#define STANDARD
3216
3216
  #ifdef PHYSICAL
3217
3217
  #define IOR
3218
3218
  #define USE_SPECULAR
@@ -3337,7 +3337,7 @@ void main() {
3337
3337
  #include <fog_fragment>
3338
3338
  #include <premultiplied_alpha_fragment>
3339
3339
  #include <dithering_fragment>
3340
- }`,Om=`#define TOON
3340
+ }`,cm=`#define TOON
3341
3341
  varying vec3 vViewPosition;
3342
3342
  #include <common>
3343
3343
  #include <batching_pars_vertex>
@@ -3374,7 +3374,7 @@ void main() {
3374
3374
  #include <worldpos_vertex>
3375
3375
  #include <shadowmap_vertex>
3376
3376
  #include <fog_vertex>
3377
- }`,zm=`#define TOON
3377
+ }`,hm=`#define TOON
3378
3378
  uniform vec3 diffuse;
3379
3379
  uniform vec3 emissive;
3380
3380
  uniform float opacity;
@@ -3427,7 +3427,7 @@ void main() {
3427
3427
  #include <fog_fragment>
3428
3428
  #include <premultiplied_alpha_fragment>
3429
3429
  #include <dithering_fragment>
3430
- }`,Bm=`uniform float size;
3430
+ }`,um=`uniform float size;
3431
3431
  uniform float scale;
3432
3432
  #include <common>
3433
3433
  #include <color_pars_vertex>
@@ -3458,7 +3458,7 @@ void main() {
3458
3458
  #include <clipping_planes_vertex>
3459
3459
  #include <worldpos_vertex>
3460
3460
  #include <fog_vertex>
3461
- }`,km=`uniform vec3 diffuse;
3461
+ }`,dm=`uniform vec3 diffuse;
3462
3462
  uniform float opacity;
3463
3463
  #include <common>
3464
3464
  #include <color_pars_fragment>
@@ -3483,7 +3483,7 @@ void main() {
3483
3483
  #include <colorspace_fragment>
3484
3484
  #include <fog_fragment>
3485
3485
  #include <premultiplied_alpha_fragment>
3486
- }`,Vm=`#include <common>
3486
+ }`,fm=`#include <common>
3487
3487
  #include <batching_pars_vertex>
3488
3488
  #include <fog_pars_vertex>
3489
3489
  #include <morphtarget_pars_vertex>
@@ -3506,7 +3506,7 @@ void main() {
3506
3506
  #include <worldpos_vertex>
3507
3507
  #include <shadowmap_vertex>
3508
3508
  #include <fog_vertex>
3509
- }`,Hm=`uniform vec3 color;
3509
+ }`,pm=`uniform vec3 color;
3510
3510
  uniform float opacity;
3511
3511
  #include <common>
3512
3512
  #include <packing>
@@ -3522,7 +3522,7 @@ void main() {
3522
3522
  #include <tonemapping_fragment>
3523
3523
  #include <colorspace_fragment>
3524
3524
  #include <fog_fragment>
3525
- }`,Gm=`uniform float rotation;
3525
+ }`,mm=`uniform float rotation;
3526
3526
  uniform vec2 center;
3527
3527
  #include <common>
3528
3528
  #include <uv_pars_vertex>
@@ -3546,7 +3546,7 @@ void main() {
3546
3546
  #include <logdepthbuf_vertex>
3547
3547
  #include <clipping_planes_vertex>
3548
3548
  #include <fog_vertex>
3549
- }`,Wm=`uniform vec3 diffuse;
3549
+ }`,gm=`uniform vec3 diffuse;
3550
3550
  uniform float opacity;
3551
3551
  #include <common>
3552
3552
  #include <uv_pars_fragment>
@@ -3571,7 +3571,7 @@ void main() {
3571
3571
  #include <tonemapping_fragment>
3572
3572
  #include <colorspace_fragment>
3573
3573
  #include <fog_fragment>
3574
- }`,fe={alphahash_fragment:dp,alphahash_pars_fragment:fp,alphamap_fragment:pp,alphamap_pars_fragment:mp,alphatest_fragment:gp,alphatest_pars_fragment:_p,aomap_fragment:vp,aomap_pars_fragment:xp,batching_pars_vertex:yp,batching_vertex:Mp,begin_vertex:Sp,beginnormal_vertex:bp,bsdfs:Ep,iridescence_fragment:wp,bumpmap_pars_fragment:Ap,clipping_planes_fragment:Tp,clipping_planes_pars_fragment:Rp,clipping_planes_pars_vertex:Cp,clipping_planes_vertex:Lp,color_fragment:Pp,color_pars_fragment:Dp,color_pars_vertex:Up,color_vertex:Ip,common:Np,cube_uv_reflection_fragment:Fp,defaultnormal_vertex:Op,displacementmap_pars_vertex:zp,displacementmap_vertex:Bp,emissivemap_fragment:kp,emissivemap_pars_fragment:Vp,colorspace_fragment:Hp,colorspace_pars_fragment:Gp,envmap_fragment:Wp,envmap_common_pars_fragment:Xp,envmap_pars_fragment:qp,envmap_pars_vertex:jp,envmap_physical_pars_fragment:s0,envmap_vertex:Yp,fog_vertex:Jp,fog_pars_vertex:$p,fog_fragment:Kp,fog_pars_fragment:Zp,gradientmap_pars_fragment:Qp,lightmap_pars_fragment:t0,lights_lambert_fragment:e0,lights_lambert_pars_fragment:n0,lights_pars_begin:i0,lights_toon_fragment:r0,lights_toon_pars_fragment:a0,lights_phong_fragment:o0,lights_phong_pars_fragment:l0,lights_physical_fragment:c0,lights_physical_pars_fragment:h0,lights_fragment_begin:u0,lights_fragment_maps:d0,lights_fragment_end:f0,logdepthbuf_fragment:p0,logdepthbuf_pars_fragment:m0,logdepthbuf_pars_vertex:g0,logdepthbuf_vertex:_0,map_fragment:v0,map_pars_fragment:x0,map_particle_fragment:y0,map_particle_pars_fragment:M0,metalnessmap_fragment:S0,metalnessmap_pars_fragment:b0,morphinstance_vertex:E0,morphcolor_vertex:w0,morphnormal_vertex:A0,morphtarget_pars_vertex:T0,morphtarget_vertex:R0,normal_fragment_begin:C0,normal_fragment_maps:L0,normal_pars_fragment:P0,normal_pars_vertex:D0,normal_vertex:U0,normalmap_pars_fragment:I0,clearcoat_normal_fragment_begin:N0,clearcoat_normal_fragment_maps:F0,clearcoat_pars_fragment:O0,iridescence_pars_fragment:z0,opaque_fragment:B0,packing:k0,premultiplied_alpha_fragment:V0,project_vertex:H0,dithering_fragment:G0,dithering_pars_fragment:W0,roughnessmap_fragment:X0,roughnessmap_pars_fragment:q0,shadowmap_pars_fragment:j0,shadowmap_pars_vertex:Y0,shadowmap_vertex:J0,shadowmask_pars_fragment:$0,skinbase_vertex:K0,skinning_pars_vertex:Z0,skinning_vertex:Q0,skinnormal_vertex:tm,specularmap_fragment:em,specularmap_pars_fragment:nm,tonemapping_fragment:im,tonemapping_pars_fragment:sm,transmission_fragment:rm,transmission_pars_fragment:am,uv_pars_fragment:om,uv_pars_vertex:lm,uv_vertex:cm,worldpos_vertex:hm,background_vert:um,background_frag:dm,backgroundCube_vert:fm,backgroundCube_frag:pm,cube_vert:mm,cube_frag:gm,depth_vert:_m,depth_frag:vm,distanceRGBA_vert:xm,distanceRGBA_frag:ym,equirect_vert:Mm,equirect_frag:Sm,linedashed_vert:bm,linedashed_frag:Em,meshbasic_vert:wm,meshbasic_frag:Am,meshlambert_vert:Tm,meshlambert_frag:Rm,meshmatcap_vert:Cm,meshmatcap_frag:Lm,meshnormal_vert:Pm,meshnormal_frag:Dm,meshphong_vert:Um,meshphong_frag:Im,meshphysical_vert:Nm,meshphysical_frag:Fm,meshtoon_vert:Om,meshtoon_frag:zm,points_vert:Bm,points_frag:km,shadow_vert:Vm,shadow_frag:Hm,sprite_vert:Gm,sprite_frag:Wm},xt={common:{diffuse:{value:new jt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ue}},envmap:{envMap:{value:null},envMapRotation:{value:new ue},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ue}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ue}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ue},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ue},normalScale:{value:new Dt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ue},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ue}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ue}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ue}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new jt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new jt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0},uvTransform:{value:new ue}},sprite:{diffuse:{value:new jt(16777215)},opacity:{value:1},center:{value:new Dt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}}},hn={basic:{uniforms:sn([xt.common,xt.specularmap,xt.envmap,xt.aomap,xt.lightmap,xt.fog]),vertexShader:fe.meshbasic_vert,fragmentShader:fe.meshbasic_frag},lambert:{uniforms:sn([xt.common,xt.specularmap,xt.envmap,xt.aomap,xt.lightmap,xt.emissivemap,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.fog,xt.lights,{emissive:{value:new jt(0)}}]),vertexShader:fe.meshlambert_vert,fragmentShader:fe.meshlambert_frag},phong:{uniforms:sn([xt.common,xt.specularmap,xt.envmap,xt.aomap,xt.lightmap,xt.emissivemap,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.fog,xt.lights,{emissive:{value:new jt(0)},specular:{value:new jt(1118481)},shininess:{value:30}}]),vertexShader:fe.meshphong_vert,fragmentShader:fe.meshphong_frag},standard:{uniforms:sn([xt.common,xt.envmap,xt.aomap,xt.lightmap,xt.emissivemap,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.roughnessmap,xt.metalnessmap,xt.fog,xt.lights,{emissive:{value:new jt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:fe.meshphysical_vert,fragmentShader:fe.meshphysical_frag},toon:{uniforms:sn([xt.common,xt.aomap,xt.lightmap,xt.emissivemap,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.gradientmap,xt.fog,xt.lights,{emissive:{value:new jt(0)}}]),vertexShader:fe.meshtoon_vert,fragmentShader:fe.meshtoon_frag},matcap:{uniforms:sn([xt.common,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.fog,{matcap:{value:null}}]),vertexShader:fe.meshmatcap_vert,fragmentShader:fe.meshmatcap_frag},points:{uniforms:sn([xt.points,xt.fog]),vertexShader:fe.points_vert,fragmentShader:fe.points_frag},dashed:{uniforms:sn([xt.common,xt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:fe.linedashed_vert,fragmentShader:fe.linedashed_frag},depth:{uniforms:sn([xt.common,xt.displacementmap]),vertexShader:fe.depth_vert,fragmentShader:fe.depth_frag},normal:{uniforms:sn([xt.common,xt.bumpmap,xt.normalmap,xt.displacementmap,{opacity:{value:1}}]),vertexShader:fe.meshnormal_vert,fragmentShader:fe.meshnormal_frag},sprite:{uniforms:sn([xt.sprite,xt.fog]),vertexShader:fe.sprite_vert,fragmentShader:fe.sprite_frag},background:{uniforms:{uvTransform:{value:new ue},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:fe.background_vert,fragmentShader:fe.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ue}},vertexShader:fe.backgroundCube_vert,fragmentShader:fe.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:fe.cube_vert,fragmentShader:fe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:fe.equirect_vert,fragmentShader:fe.equirect_frag},distanceRGBA:{uniforms:sn([xt.common,xt.displacementmap,{referencePosition:{value:new N},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:fe.distanceRGBA_vert,fragmentShader:fe.distanceRGBA_frag},shadow:{uniforms:sn([xt.lights,xt.fog,{color:{value:new jt(0)},opacity:{value:1}}]),vertexShader:fe.shadow_vert,fragmentShader:fe.shadow_frag}};hn.physical={uniforms:sn([hn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ue},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ue},clearcoatNormalScale:{value:new Dt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ue},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ue},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ue},sheen:{value:0},sheenColor:{value:new jt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ue},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ue},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ue},transmissionSamplerSize:{value:new Dt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ue},attenuationDistance:{value:0},attenuationColor:{value:new jt(0)},specularColor:{value:new jt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ue},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ue},anisotropyVector:{value:new Dt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ue}}]),vertexShader:fe.meshphysical_vert,fragmentShader:fe.meshphysical_frag};const Ur={r:0,b:0,g:0},Mi=new un,Xm=new Yt;function qm(s,t,e,n,i,r,a){const o=new jt(0);let l=r===!0?0:1,c,h,u=null,d=0,f=null;function m(b){let M=b.isScene===!0?b.background:null;return M&&M.isTexture&&(M=(b.backgroundBlurriness>0?e:t).get(M)),M}function _(b){let M=!1;const I=m(b);I===null?p(o,l):I&&I.isColor&&(p(I,1),M=!0);const C=s.xr.getEnvironmentBlendMode();C==="additive"?n.buffers.color.setClear(0,0,0,1,a):C==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(s.autoClear||M)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function g(b,M){const I=m(M);I&&(I.isCubeTexture||I.mapping===ha)?(h===void 0&&(h=new be(new _s(1,1,1),new ti({name:"BackgroundCubeMaterial",uniforms:ps(hn.backgroundCube.uniforms),vertexShader:hn.backgroundCube.vertexShader,fragmentShader:hn.backgroundCube.fragmentShader,side:rn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Mi.copy(M.backgroundRotation),Mi.x*=-1,Mi.y*=-1,Mi.z*=-1,I.isCubeTexture&&I.isRenderTargetTexture===!1&&(Mi.y*=-1,Mi.z*=-1),h.material.uniforms.envMap.value=I,h.material.uniforms.flipEnvMap.value=I.isCubeTexture&&I.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Xm.makeRotationFromEuler(Mi)),h.material.toneMapped=pe.getTransfer(I.colorSpace)!==Re,(u!==I||d!==I.version||f!==s.toneMapping)&&(h.material.needsUpdate=!0,u=I,d=I.version,f=s.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):I&&I.isTexture&&(c===void 0&&(c=new be(new Ys(2,2),new ti({name:"BackgroundMaterial",uniforms:ps(hn.background.uniforms),vertexShader:hn.background.vertexShader,fragmentShader:hn.background.fragmentShader,side:Cn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=I,c.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,c.material.toneMapped=pe.getTransfer(I.colorSpace)!==Re,I.matrixAutoUpdate===!0&&I.updateMatrix(),c.material.uniforms.uvTransform.value.copy(I.matrix),(u!==I||d!==I.version||f!==s.toneMapping)&&(c.material.needsUpdate=!0,u=I,d=I.version,f=s.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function p(b,M){b.getRGB(Ur,nu(s)),n.buffers.color.setClear(Ur.r,Ur.g,Ur.b,M,a)}function E(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(b,M=1){o.set(b),l=M,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,p(o,l)},render:_,addToRenderList:g,dispose:E}}function jm(s,t){const e=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},i=d(null);let r=i,a=!1;function o(y,U,B,k,q){let K=!1;const z=u(k,B,U);r!==z&&(r=z,c(r.object)),K=f(y,k,B,q),K&&m(y,k,B,q),q!==null&&t.update(q,s.ELEMENT_ARRAY_BUFFER),(K||a)&&(a=!1,M(y,U,B,k),q!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,t.get(q).buffer))}function l(){return s.createVertexArray()}function c(y){return s.bindVertexArray(y)}function h(y){return s.deleteVertexArray(y)}function u(y,U,B){const k=B.wireframe===!0;let q=n[y.id];q===void 0&&(q={},n[y.id]=q);let K=q[U.id];K===void 0&&(K={},q[U.id]=K);let z=K[k];return z===void 0&&(z=d(l()),K[k]=z),z}function d(y){const U=[],B=[],k=[];for(let q=0;q<e;q++)U[q]=0,B[q]=0,k[q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:U,enabledAttributes:B,attributeDivisors:k,object:y,attributes:{},index:null}}function f(y,U,B,k){const q=r.attributes,K=U.attributes;let z=0;const tt=B.getAttributes();for(const W in tt)if(tt[W].location>=0){const dt=q[W];let mt=K[W];if(mt===void 0&&(W==="instanceMatrix"&&y.instanceMatrix&&(mt=y.instanceMatrix),W==="instanceColor"&&y.instanceColor&&(mt=y.instanceColor)),dt===void 0||dt.attribute!==mt||mt&&dt.data!==mt.data)return!0;z++}return r.attributesNum!==z||r.index!==k}function m(y,U,B,k){const q={},K=U.attributes;let z=0;const tt=B.getAttributes();for(const W in tt)if(tt[W].location>=0){let dt=K[W];dt===void 0&&(W==="instanceMatrix"&&y.instanceMatrix&&(dt=y.instanceMatrix),W==="instanceColor"&&y.instanceColor&&(dt=y.instanceColor));const mt={};mt.attribute=dt,dt&&dt.data&&(mt.data=dt.data),q[W]=mt,z++}r.attributes=q,r.attributesNum=z,r.index=k}function _(){const y=r.newAttributes;for(let U=0,B=y.length;U<B;U++)y[U]=0}function g(y){p(y,0)}function p(y,U){const B=r.newAttributes,k=r.enabledAttributes,q=r.attributeDivisors;B[y]=1,k[y]===0&&(s.enableVertexAttribArray(y),k[y]=1),q[y]!==U&&(s.vertexAttribDivisor(y,U),q[y]=U)}function E(){const y=r.newAttributes,U=r.enabledAttributes;for(let B=0,k=U.length;B<k;B++)U[B]!==y[B]&&(s.disableVertexAttribArray(B),U[B]=0)}function b(y,U,B,k,q,K,z){z===!0?s.vertexAttribIPointer(y,U,B,q,K):s.vertexAttribPointer(y,U,B,k,q,K)}function M(y,U,B,k){_();const q=k.attributes,K=B.getAttributes(),z=U.defaultAttributeValues;for(const tt in K){const W=K[tt];if(W.location>=0){let at=q[tt];if(at===void 0&&(tt==="instanceMatrix"&&y.instanceMatrix&&(at=y.instanceMatrix),tt==="instanceColor"&&y.instanceColor&&(at=y.instanceColor)),at!==void 0){const dt=at.normalized,mt=at.itemSize,Rt=t.get(at);if(Rt===void 0)continue;const wt=Rt.buffer,X=Rt.type,Z=Rt.bytesPerElement,Q=X===s.INT||X===s.UNSIGNED_INT||at.gpuType===pl;if(at.isInterleavedBufferAttribute){const et=at.data,_t=et.stride,ot=at.offset;if(et.isInstancedInterleavedBuffer){for(let gt=0;gt<W.locationSize;gt++)p(W.location+gt,et.meshPerAttribute);y.isInstancedMesh!==!0&&k._maxInstanceCount===void 0&&(k._maxInstanceCount=et.meshPerAttribute*et.count)}else for(let gt=0;gt<W.locationSize;gt++)g(W.location+gt);s.bindBuffer(s.ARRAY_BUFFER,wt);for(let gt=0;gt<W.locationSize;gt++)b(W.location+gt,mt/W.locationSize,X,dt,_t*Z,(ot+mt/W.locationSize*gt)*Z,Q)}else{if(at.isInstancedBufferAttribute){for(let et=0;et<W.locationSize;et++)p(W.location+et,at.meshPerAttribute);y.isInstancedMesh!==!0&&k._maxInstanceCount===void 0&&(k._maxInstanceCount=at.meshPerAttribute*at.count)}else for(let et=0;et<W.locationSize;et++)g(W.location+et);s.bindBuffer(s.ARRAY_BUFFER,wt);for(let et=0;et<W.locationSize;et++)b(W.location+et,mt/W.locationSize,X,dt,mt*Z,mt/W.locationSize*et*Z,Q)}}else if(z!==void 0){const dt=z[tt];if(dt!==void 0)switch(dt.length){case 2:s.vertexAttrib2fv(W.location,dt);break;case 3:s.vertexAttrib3fv(W.location,dt);break;case 4:s.vertexAttrib4fv(W.location,dt);break;default:s.vertexAttrib1fv(W.location,dt)}}}}E()}function I(){D();for(const y in n){const U=n[y];for(const B in U){const k=U[B];for(const q in k)h(k[q].object),delete k[q];delete U[B]}delete n[y]}}function C(y){if(n[y.id]===void 0)return;const U=n[y.id];for(const B in U){const k=U[B];for(const q in k)h(k[q].object),delete k[q];delete U[B]}delete n[y.id]}function P(y){for(const U in n){const B=n[U];if(B[y.id]===void 0)continue;const k=B[y.id];for(const q in k)h(k[q].object),delete k[q];delete B[y.id]}}function D(){S(),a=!0,r!==i&&(r=i,c(r.object))}function S(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:D,resetDefaultState:S,dispose:I,releaseStatesOfGeometry:C,releaseStatesOfProgram:P,initAttributes:_,enableAttribute:g,disableUnusedAttributes:E}}function Ym(s,t,e){let n;function i(c){n=c}function r(c,h){s.drawArrays(n,c,h),e.update(h,n,1)}function a(c,h,u){u!==0&&(s.drawArraysInstanced(n,c,h,u),e.update(h,n,u))}function o(c,h,u){if(u===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,u);let f=0;for(let m=0;m<u;m++)f+=h[m];e.update(f,n,1)}function l(c,h,u,d){if(u===0)return;const f=t.get("WEBGL_multi_draw");if(f===null)for(let m=0;m<c.length;m++)a(c[m],h[m],d[m]);else{f.multiDrawArraysInstancedWEBGL(n,c,0,h,0,d,0,u);let m=0;for(let _=0;_<u;_++)m+=h[_]*d[_];e.update(m,n,1)}}this.setMode=i,this.render=r,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function Jm(s,t,e,n){let i;function r(){if(i!==void 0)return i;if(t.has("EXT_texture_filter_anisotropic")===!0){const P=t.get("EXT_texture_filter_anisotropic");i=s.getParameter(P.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(P){return!(P!==yn&&n.convert(P)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(P){const D=P===js&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(P!==zn&&n.convert(P)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&P!==Fn&&!D)}function l(P){if(P==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const u=e.logarithmicDepthBuffer===!0,d=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),f=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),m=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=s.getParameter(s.MAX_TEXTURE_SIZE),g=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),p=s.getParameter(s.MAX_VERTEX_ATTRIBS),E=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),b=s.getParameter(s.MAX_VARYING_VECTORS),M=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),I=m>0,C=s.getParameter(s.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:E,maxVaryings:b,maxFragmentUniforms:M,vertexTextures:I,maxSamples:C}}function $m(s){const t=this;let e=null,n=0,i=!1,r=!1;const a=new hi,o=new ue,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const f=u.length!==0||d||n!==0||i;return i=d,n=u.length,f},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,d){e=h(u,d,0)},this.setState=function(u,d,f){const m=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,p=s.get(u);if(!i||m===null||m.length===0||r&&!g)r?h(null):c();else{const E=r?0:n,b=E*4;let M=p.clippingState||null;l.value=M,M=h(m,d,b,f);for(let I=0;I!==b;++I)M[I]=e[I];p.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=E}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(u,d,f,m){const _=u!==null?u.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=f+_*4,E=d.matrixWorldInverse;o.getNormalMatrix(E),(g===null||g.length<p)&&(g=new Float32Array(p));for(let b=0,M=f;b!==_;++b,M+=4)a.copy(u[b]).applyMatrix4(E,o),a.normal.toArray(g,M),g[M+3]=a.constant}l.value=g,l.needsUpdate=!0}return t.numPlanes=_,t.numIntersection=0,g}}function Km(s){let t=new WeakMap;function e(a,o){return o===Ao?a.mapping=hs:o===To&&(a.mapping=us),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===Ao||o===To)if(t.has(a)){const l=t.get(a).texture;return e(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new uf(l.height);return c.fromEquirectangularTexture(s,a),t.set(a,c),a.addEventListener("dispose",i),e(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function r(){t=new WeakMap}return{get:n,dispose:r}}const ss=4,Gc=[.125,.215,.35,.446,.526,.582],Ri=20,no=new pa,Wc=new jt;let io=null,so=0,ro=0,ao=!1;const wi=(1+Math.sqrt(5))/2,es=1/wi,Xc=[new N(-wi,es,0),new N(wi,es,0),new N(-es,0,wi),new N(es,0,wi),new N(0,wi,-es),new N(0,wi,es),new N(-1,1,-1),new N(1,1,-1),new N(-1,1,1),new N(1,1,1)],Zm=new N;class qc{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100,r={}){const{size:a=256,position:o=Zm}=r;io=this._renderer.getRenderTarget(),so=this._renderer.getActiveCubeFace(),ro=this._renderer.getActiveMipmapLevel(),ao=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(t,n,i,l,o),e>0&&this._blur(l,0,0,e),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Jc(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Yc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(io,so,ro),this._renderer.xr.enabled=ao,t.scissorTest=!1,Ir(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===hs||t.mapping===us?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),io=this._renderer.getRenderTarget(),so=this._renderer.getActiveCubeFace(),ro=this._renderer.getActiveMipmapLevel(),ao=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:pn,minFilter:pn,generateMipmaps:!1,type:js,format:yn,colorSpace:ds,depthBuffer:!1},i=jc(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=jc(t,e,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Qm(r)),this._blurMaterial=t1(r,t,e)}return i}_compileMaterial(t){const e=new be(this._lodPlanes[0],t);this._renderer.compile(e,no)}_sceneToCubeUV(t,e,n,i,r){const l=new Je(90,1,e,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,f=u.toneMapping;u.getClearColor(Wc),u.toneMapping=fi,u.autoClear=!1;const m=new mi({name:"PMREM.Background",side:rn,depthWrite:!1,depthTest:!1}),_=new be(new _s,m);let g=!1;const p=t.background;p?p.isColor&&(m.color.copy(p),t.background=null,g=!0):(m.color.copy(Wc),g=!0);for(let E=0;E<6;E++){const b=E%3;b===0?(l.up.set(0,c[E],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x+h[E],r.y,r.z)):b===1?(l.up.set(0,0,c[E]),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y+h[E],r.z)):(l.up.set(0,c[E],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y,r.z+h[E]));const M=this._cubeSize;Ir(i,b*M,E>2?M:0,M,M),u.setRenderTarget(i),g&&u.render(_,l),u.render(t,l)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=f,u.autoClear=d,t.background=p}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===hs||t.mapping===us;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Jc()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Yc());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new be(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;const l=this._cubeSize;Ir(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,no)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const i=this._lodPlanes.length;for(let r=1;r<i;r++){const a=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=Xc[(i-r-1)%Xc.length];this._blur(t,r-1,r,a,o)}e.autoClear=n}_blur(t,e,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,i,"latitudinal",r),this._halfBlur(a,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,u=new be(this._lodPlanes[i],c),d=c.uniforms,f=this._sizeLods[n]-1,m=isFinite(r)?Math.PI/(2*f):2*Math.PI/(2*Ri-1),_=r/m,g=isFinite(r)?1+Math.floor(h*_):Ri;g>Ri&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Ri}`);const p=[];let E=0;for(let P=0;P<Ri;++P){const D=P/_,S=Math.exp(-D*D/2);p.push(S),P===0?E+=S:P<g&&(E+=2*S)}for(let P=0;P<p.length;P++)p[P]=p[P]/E;d.envMap.value=t.texture,d.samples.value=g,d.weights.value=p,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:b}=this;d.dTheta.value=m,d.mipInt.value=b-n;const M=this._sizeLods[i],I=3*M*(i>b-ss?i-b+ss:0),C=4*(this._cubeSize-M);Ir(e,I,C,3*M,2*M),l.setRenderTarget(e),l.render(u,no)}}function Qm(s){const t=[],e=[],n=[];let i=s;const r=s-ss+1+Gc.length;for(let a=0;a<r;a++){const o=Math.pow(2,i);e.push(o);let l=1/o;a>s-ss?l=Gc[a-s+ss-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,u=1+c,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,m=6,_=3,g=2,p=1,E=new Float32Array(_*m*f),b=new Float32Array(g*m*f),M=new Float32Array(p*m*f);for(let C=0;C<f;C++){const P=C%3*2/3-1,D=C>2?0:-1,S=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];E.set(S,_*m*C),b.set(d,g*m*C);const y=[C,C,C,C,C,C];M.set(y,p*m*C)}const I=new Ie;I.setAttribute("position",new Oe(E,_)),I.setAttribute("uv",new Oe(b,g)),I.setAttribute("faceIndex",new Oe(M,p)),t.push(I),i>ss&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function jc(s,t,e){const n=new Di(s,t,e);return n.texture.mapping=ha,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Ir(s,t,e,n,i){s.viewport.set(t,e,n,i),s.scissor.set(t,e,n,i)}function t1(s,t,e){const n=new Float32Array(Ri),i=new N(0,1,0);return new ti({name:"SphericalGaussianBlur",defines:{n:Ri,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ol(),fragmentShader:`
3574
+ }`,ue={alphahash_fragment:zf,alphahash_pars_fragment:Bf,alphamap_fragment:kf,alphamap_pars_fragment:Vf,alphatest_fragment:Hf,alphatest_pars_fragment:Gf,aomap_fragment:Wf,aomap_pars_fragment:Xf,batching_pars_vertex:qf,batching_vertex:jf,begin_vertex:Yf,beginnormal_vertex:$f,bsdfs:Kf,iridescence_fragment:Jf,bumpmap_pars_fragment:Zf,clipping_planes_fragment:Qf,clipping_planes_pars_fragment:tp,clipping_planes_pars_vertex:ep,clipping_planes_vertex:np,color_fragment:ip,color_pars_fragment:sp,color_pars_vertex:rp,color_vertex:ap,common:op,cube_uv_reflection_fragment:lp,defaultnormal_vertex:cp,displacementmap_pars_vertex:hp,displacementmap_vertex:up,emissivemap_fragment:dp,emissivemap_pars_fragment:fp,colorspace_fragment:pp,colorspace_pars_fragment:mp,envmap_fragment:gp,envmap_common_pars_fragment:_p,envmap_pars_fragment:vp,envmap_pars_vertex:xp,envmap_physical_pars_fragment:Lp,envmap_vertex:yp,fog_vertex:Mp,fog_pars_vertex:Sp,fog_fragment:bp,fog_pars_fragment:Ep,gradientmap_pars_fragment:wp,lightmap_pars_fragment:Tp,lights_lambert_fragment:Ap,lights_lambert_pars_fragment:Rp,lights_pars_begin:Cp,lights_toon_fragment:Pp,lights_toon_pars_fragment:Dp,lights_phong_fragment:Up,lights_phong_pars_fragment:Ip,lights_physical_fragment:Np,lights_physical_pars_fragment:Fp,lights_fragment_begin:Op,lights_fragment_maps:zp,lights_fragment_end:Bp,logdepthbuf_fragment:kp,logdepthbuf_pars_fragment:Vp,logdepthbuf_pars_vertex:Hp,logdepthbuf_vertex:Gp,map_fragment:Wp,map_pars_fragment:Xp,map_particle_fragment:qp,map_particle_pars_fragment:jp,metalnessmap_fragment:Yp,metalnessmap_pars_fragment:$p,morphinstance_vertex:Kp,morphcolor_vertex:Jp,morphnormal_vertex:Zp,morphtarget_pars_vertex:Qp,morphtarget_vertex:t0,normal_fragment_begin:e0,normal_fragment_maps:n0,normal_pars_fragment:i0,normal_pars_vertex:s0,normal_vertex:r0,normalmap_pars_fragment:a0,clearcoat_normal_fragment_begin:o0,clearcoat_normal_fragment_maps:l0,clearcoat_pars_fragment:c0,iridescence_pars_fragment:h0,opaque_fragment:u0,packing:d0,premultiplied_alpha_fragment:f0,project_vertex:p0,dithering_fragment:m0,dithering_pars_fragment:g0,roughnessmap_fragment:_0,roughnessmap_pars_fragment:v0,shadowmap_pars_fragment:x0,shadowmap_pars_vertex:y0,shadowmap_vertex:M0,shadowmask_pars_fragment:S0,skinbase_vertex:b0,skinning_pars_vertex:E0,skinning_vertex:w0,skinnormal_vertex:T0,specularmap_fragment:A0,specularmap_pars_fragment:R0,tonemapping_fragment:C0,tonemapping_pars_fragment:L0,transmission_fragment:P0,transmission_pars_fragment:D0,uv_pars_fragment:U0,uv_pars_vertex:I0,uv_vertex:N0,worldpos_vertex:F0,background_vert:O0,background_frag:z0,backgroundCube_vert:B0,backgroundCube_frag:k0,cube_vert:V0,cube_frag:H0,depth_vert:G0,depth_frag:W0,distanceRGBA_vert:X0,distanceRGBA_frag:q0,equirect_vert:j0,equirect_frag:Y0,linedashed_vert:$0,linedashed_frag:K0,meshbasic_vert:J0,meshbasic_frag:Z0,meshlambert_vert:Q0,meshlambert_frag:tm,meshmatcap_vert:em,meshmatcap_frag:nm,meshnormal_vert:im,meshnormal_frag:sm,meshphong_vert:rm,meshphong_frag:am,meshphysical_vert:om,meshphysical_frag:lm,meshtoon_vert:cm,meshtoon_frag:hm,points_vert:um,points_frag:dm,shadow_vert:fm,shadow_frag:pm,sprite_vert:mm,sprite_frag:gm},xt={common:{diffuse:{value:new qt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new he},alphaMap:{value:null},alphaMapTransform:{value:new he},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new he}},envmap:{envMap:{value:null},envMapRotation:{value:new he},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new he}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new he}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new he},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new he},normalScale:{value:new Qt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new he},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new he}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new he}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new he}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new qt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new qt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new he},alphaTest:{value:0},uvTransform:{value:new he}},sprite:{diffuse:{value:new qt(16777215)},opacity:{value:1},center:{value:new Qt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new he},alphaMap:{value:null},alphaMapTransform:{value:new he},alphaTest:{value:0}}},hn={basic:{uniforms:sn([xt.common,xt.specularmap,xt.envmap,xt.aomap,xt.lightmap,xt.fog]),vertexShader:ue.meshbasic_vert,fragmentShader:ue.meshbasic_frag},lambert:{uniforms:sn([xt.common,xt.specularmap,xt.envmap,xt.aomap,xt.lightmap,xt.emissivemap,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.fog,xt.lights,{emissive:{value:new qt(0)}}]),vertexShader:ue.meshlambert_vert,fragmentShader:ue.meshlambert_frag},phong:{uniforms:sn([xt.common,xt.specularmap,xt.envmap,xt.aomap,xt.lightmap,xt.emissivemap,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.fog,xt.lights,{emissive:{value:new qt(0)},specular:{value:new qt(1118481)},shininess:{value:30}}]),vertexShader:ue.meshphong_vert,fragmentShader:ue.meshphong_frag},standard:{uniforms:sn([xt.common,xt.envmap,xt.aomap,xt.lightmap,xt.emissivemap,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.roughnessmap,xt.metalnessmap,xt.fog,xt.lights,{emissive:{value:new qt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ue.meshphysical_vert,fragmentShader:ue.meshphysical_frag},toon:{uniforms:sn([xt.common,xt.aomap,xt.lightmap,xt.emissivemap,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.gradientmap,xt.fog,xt.lights,{emissive:{value:new qt(0)}}]),vertexShader:ue.meshtoon_vert,fragmentShader:ue.meshtoon_frag},matcap:{uniforms:sn([xt.common,xt.bumpmap,xt.normalmap,xt.displacementmap,xt.fog,{matcap:{value:null}}]),vertexShader:ue.meshmatcap_vert,fragmentShader:ue.meshmatcap_frag},points:{uniforms:sn([xt.points,xt.fog]),vertexShader:ue.points_vert,fragmentShader:ue.points_frag},dashed:{uniforms:sn([xt.common,xt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ue.linedashed_vert,fragmentShader:ue.linedashed_frag},depth:{uniforms:sn([xt.common,xt.displacementmap]),vertexShader:ue.depth_vert,fragmentShader:ue.depth_frag},normal:{uniforms:sn([xt.common,xt.bumpmap,xt.normalmap,xt.displacementmap,{opacity:{value:1}}]),vertexShader:ue.meshnormal_vert,fragmentShader:ue.meshnormal_frag},sprite:{uniforms:sn([xt.sprite,xt.fog]),vertexShader:ue.sprite_vert,fragmentShader:ue.sprite_frag},background:{uniforms:{uvTransform:{value:new he},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ue.background_vert,fragmentShader:ue.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new he}},vertexShader:ue.backgroundCube_vert,fragmentShader:ue.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ue.cube_vert,fragmentShader:ue.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ue.equirect_vert,fragmentShader:ue.equirect_frag},distanceRGBA:{uniforms:sn([xt.common,xt.displacementmap,{referencePosition:{value:new O},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ue.distanceRGBA_vert,fragmentShader:ue.distanceRGBA_frag},shadow:{uniforms:sn([xt.lights,xt.fog,{color:{value:new qt(0)},opacity:{value:1}}]),vertexShader:ue.shadow_vert,fragmentShader:ue.shadow_frag}};hn.physical={uniforms:sn([hn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new he},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new he},clearcoatNormalScale:{value:new Qt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new he},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new he},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new he},sheen:{value:0},sheenColor:{value:new qt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new he},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new he},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new he},transmissionSamplerSize:{value:new Qt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new he},attenuationDistance:{value:0},attenuationColor:{value:new qt(0)},specularColor:{value:new qt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new he},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new he},anisotropyVector:{value:new Qt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new he}}]),vertexShader:ue.meshphysical_vert,fragmentShader:ue.meshphysical_frag};const Cr={r:0,b:0,g:0},yi=new un,_m=new Zt;function vm(s,t,e,n,i,r,a){const o=new qt(0);let l=r===!0?0:1,c,h,u=null,d=0,p=null;function m(w){let S=w.isScene===!0?w.background:null;return S&&S.isTexture&&(S=(w.backgroundBlurriness>0?e:t).get(S)),S}function _(w){let S=!1;const I=m(w);I===null?f(o,l):I&&I.isColor&&(f(I,1),S=!0);const L=s.xr.getEnvironmentBlendMode();L==="additive"?n.buffers.color.setClear(0,0,0,1,a):L==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(s.autoClear||S)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function g(w,S){const I=m(S);I&&(I.isCubeTexture||I.mapping===aa)?(h===void 0&&(h=new be(new gs(1,1,1),new ti({name:"BackgroundCubeMaterial",uniforms:fs(hn.backgroundCube.uniforms),vertexShader:hn.backgroundCube.vertexShader,fragmentShader:hn.backgroundCube.fragmentShader,side:rn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(L,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),yi.copy(S.backgroundRotation),yi.x*=-1,yi.y*=-1,yi.z*=-1,I.isCubeTexture&&I.isRenderTargetTexture===!1&&(yi.y*=-1,yi.z*=-1),h.material.uniforms.envMap.value=I,h.material.uniforms.flipEnvMap.value=I.isCubeTexture&&I.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(_m.makeRotationFromEuler(yi)),h.material.toneMapped=fe.getTransfer(I.colorSpace)!==Re,(u!==I||d!==I.version||p!==s.toneMapping)&&(h.material.needsUpdate=!0,u=I,d=I.version,p=s.toneMapping),h.layers.enableAll(),w.unshift(h,h.geometry,h.material,0,0,null)):I&&I.isTexture&&(c===void 0&&(c=new be(new Xs(2,2),new ti({name:"BackgroundMaterial",uniforms:fs(hn.background.uniforms),vertexShader:hn.background.vertexShader,fragmentShader:hn.background.fragmentShader,side:Cn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=I,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=fe.getTransfer(I.colorSpace)!==Re,I.matrixAutoUpdate===!0&&I.updateMatrix(),c.material.uniforms.uvTransform.value.copy(I.matrix),(u!==I||d!==I.version||p!==s.toneMapping)&&(c.material.needsUpdate=!0,u=I,d=I.version,p=s.toneMapping),c.layers.enableAll(),w.unshift(c,c.geometry,c.material,0,0,null))}function f(w,S){w.getRGB(Cr,qh(s)),n.buffers.color.setClear(Cr.r,Cr.g,Cr.b,S,a)}function b(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(w,S=1){o.set(w),l=S,f(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(w){l=w,f(o,l)},render:_,addToRenderList:g,dispose:b}}function xm(s,t){const e=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},i=d(null);let r=i,a=!1;function o(y,U,B,k,q){let J=!1;const z=u(k,B,U);r!==z&&(r=z,c(r.object)),J=p(y,k,B,q),J&&m(y,k,B,q),q!==null&&t.update(q,s.ELEMENT_ARRAY_BUFFER),(J||a)&&(a=!1,S(y,U,B,k),q!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,t.get(q).buffer))}function l(){return s.createVertexArray()}function c(y){return s.bindVertexArray(y)}function h(y){return s.deleteVertexArray(y)}function u(y,U,B){const k=B.wireframe===!0;let q=n[y.id];q===void 0&&(q={},n[y.id]=q);let J=q[U.id];J===void 0&&(J={},q[U.id]=J);let z=J[k];return z===void 0&&(z=d(l()),J[k]=z),z}function d(y){const U=[],B=[],k=[];for(let q=0;q<e;q++)U[q]=0,B[q]=0,k[q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:U,enabledAttributes:B,attributeDivisors:k,object:y,attributes:{},index:null}}function p(y,U,B,k){const q=r.attributes,J=U.attributes;let z=0;const tt=B.getAttributes();for(const W in tt)if(tt[W].location>=0){const dt=q[W];let mt=J[W];if(mt===void 0&&(W==="instanceMatrix"&&y.instanceMatrix&&(mt=y.instanceMatrix),W==="instanceColor"&&y.instanceColor&&(mt=y.instanceColor)),dt===void 0||dt.attribute!==mt||mt&&dt.data!==mt.data)return!0;z++}return r.attributesNum!==z||r.index!==k}function m(y,U,B,k){const q={},J=U.attributes;let z=0;const tt=B.getAttributes();for(const W in tt)if(tt[W].location>=0){let dt=J[W];dt===void 0&&(W==="instanceMatrix"&&y.instanceMatrix&&(dt=y.instanceMatrix),W==="instanceColor"&&y.instanceColor&&(dt=y.instanceColor));const mt={};mt.attribute=dt,dt&&dt.data&&(mt.data=dt.data),q[W]=mt,z++}r.attributes=q,r.attributesNum=z,r.index=k}function _(){const y=r.newAttributes;for(let U=0,B=y.length;U<B;U++)y[U]=0}function g(y){f(y,0)}function f(y,U){const B=r.newAttributes,k=r.enabledAttributes,q=r.attributeDivisors;B[y]=1,k[y]===0&&(s.enableVertexAttribArray(y),k[y]=1),q[y]!==U&&(s.vertexAttribDivisor(y,U),q[y]=U)}function b(){const y=r.newAttributes,U=r.enabledAttributes;for(let B=0,k=U.length;B<k;B++)U[B]!==y[B]&&(s.disableVertexAttribArray(B),U[B]=0)}function w(y,U,B,k,q,J,z){z===!0?s.vertexAttribIPointer(y,U,B,q,J):s.vertexAttribPointer(y,U,B,k,q,J)}function S(y,U,B,k){_();const q=k.attributes,J=B.getAttributes(),z=U.defaultAttributeValues;for(const tt in J){const W=J[tt];if(W.location>=0){let at=q[tt];if(at===void 0&&(tt==="instanceMatrix"&&y.instanceMatrix&&(at=y.instanceMatrix),tt==="instanceColor"&&y.instanceColor&&(at=y.instanceColor)),at!==void 0){const dt=at.normalized,mt=at.itemSize,Rt=t.get(at);if(Rt===void 0)continue;const wt=Rt.buffer,X=Rt.type,Z=Rt.bytesPerElement,Q=X===s.INT||X===s.UNSIGNED_INT||at.gpuType===ol;if(at.isInterleavedBufferAttribute){const et=at.data,_t=et.stride,ot=at.offset;if(et.isInstancedInterleavedBuffer){for(let gt=0;gt<W.locationSize;gt++)f(W.location+gt,et.meshPerAttribute);y.isInstancedMesh!==!0&&k._maxInstanceCount===void 0&&(k._maxInstanceCount=et.meshPerAttribute*et.count)}else for(let gt=0;gt<W.locationSize;gt++)g(W.location+gt);s.bindBuffer(s.ARRAY_BUFFER,wt);for(let gt=0;gt<W.locationSize;gt++)w(W.location+gt,mt/W.locationSize,X,dt,_t*Z,(ot+mt/W.locationSize*gt)*Z,Q)}else{if(at.isInstancedBufferAttribute){for(let et=0;et<W.locationSize;et++)f(W.location+et,at.meshPerAttribute);y.isInstancedMesh!==!0&&k._maxInstanceCount===void 0&&(k._maxInstanceCount=at.meshPerAttribute*at.count)}else for(let et=0;et<W.locationSize;et++)g(W.location+et);s.bindBuffer(s.ARRAY_BUFFER,wt);for(let et=0;et<W.locationSize;et++)w(W.location+et,mt/W.locationSize,X,dt,mt*Z,mt/W.locationSize*et*Z,Q)}}else if(z!==void 0){const dt=z[tt];if(dt!==void 0)switch(dt.length){case 2:s.vertexAttrib2fv(W.location,dt);break;case 3:s.vertexAttrib3fv(W.location,dt);break;case 4:s.vertexAttrib4fv(W.location,dt);break;default:s.vertexAttrib1fv(W.location,dt)}}}}b()}function I(){D();for(const y in n){const U=n[y];for(const B in U){const k=U[B];for(const q in k)h(k[q].object),delete k[q];delete U[B]}delete n[y]}}function L(y){if(n[y.id]===void 0)return;const U=n[y.id];for(const B in U){const k=U[B];for(const q in k)h(k[q].object),delete k[q];delete U[B]}delete n[y.id]}function P(y){for(const U in n){const B=n[U];if(B[y.id]===void 0)continue;const k=B[y.id];for(const q in k)h(k[q].object),delete k[q];delete B[y.id]}}function D(){M(),a=!0,r!==i&&(r=i,c(r.object))}function M(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:D,resetDefaultState:M,dispose:I,releaseStatesOfGeometry:L,releaseStatesOfProgram:P,initAttributes:_,enableAttribute:g,disableUnusedAttributes:b}}function ym(s,t,e){let n;function i(c){n=c}function r(c,h){s.drawArrays(n,c,h),e.update(h,n,1)}function a(c,h,u){u!==0&&(s.drawArraysInstanced(n,c,h,u),e.update(h,n,u))}function o(c,h,u){if(u===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,u);let p=0;for(let m=0;m<u;m++)p+=h[m];e.update(p,n,1)}function l(c,h,u,d){if(u===0)return;const p=t.get("WEBGL_multi_draw");if(p===null)for(let m=0;m<c.length;m++)a(c[m],h[m],d[m]);else{p.multiDrawArraysInstancedWEBGL(n,c,0,h,0,d,0,u);let m=0;for(let _=0;_<u;_++)m+=h[_]*d[_];e.update(m,n,1)}}this.setMode=i,this.render=r,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function Mm(s,t,e,n){let i;function r(){if(i!==void 0)return i;if(t.has("EXT_texture_filter_anisotropic")===!0){const P=t.get("EXT_texture_filter_anisotropic");i=s.getParameter(P.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(P){return!(P!==yn&&n.convert(P)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(P){const D=P===Ws&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(P!==zn&&n.convert(P)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&P!==Fn&&!D)}function l(P){if(P==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const u=e.logarithmicDepthBuffer===!0,d=e.reverseDepthBuffer===!0&&t.has("EXT_clip_control"),p=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),m=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=s.getParameter(s.MAX_TEXTURE_SIZE),g=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),f=s.getParameter(s.MAX_VERTEX_ATTRIBS),b=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),w=s.getParameter(s.MAX_VARYING_VECTORS),S=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),I=m>0,L=s.getParameter(s.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:p,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:f,maxVertexUniforms:b,maxVaryings:w,maxFragmentUniforms:S,vertexTextures:I,maxSamples:L}}function Sm(s){const t=this;let e=null,n=0,i=!1,r=!1;const a=new ci,o=new he,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const p=u.length!==0||d||n!==0||i;return i=d,n=u.length,p},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,d){e=h(u,d,0)},this.setState=function(u,d,p){const m=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,f=s.get(u);if(!i||m===null||m.length===0||r&&!g)r?h(null):c();else{const b=r?0:n,w=b*4;let S=f.clippingState||null;l.value=S,S=h(m,d,w,p);for(let I=0;I!==w;++I)S[I]=e[I];f.clippingState=S,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(u,d,p,m){const _=u!==null?u.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const f=p+_*4,b=d.matrixWorldInverse;o.getNormalMatrix(b),(g===null||g.length<f)&&(g=new Float32Array(f));for(let w=0,S=p;w!==_;++w,S+=4)a.copy(u[w]).applyMatrix4(b,o),a.normal.toArray(g,S),g[S+3]=a.constant}l.value=g,l.needsUpdate=!0}return t.numPlanes=_,t.numIntersection=0,g}}function bm(s){let t=new WeakMap;function e(a,o){return o===xo?a.mapping=cs:o===yo&&(a.mapping=hs),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===xo||o===yo)if(t.has(a)){const l=t.get(a).texture;return e(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new Jd(l.height);return c.fromEquirectangularTexture(s,a),t.set(a,c),a.addEventListener("dispose",i),e(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function r(){t=new WeakMap}return{get:n,dispose:r}}const is=4,Uc=[.125,.215,.35,.446,.526,.582],Ai=20,$a=new ha,Ic=new qt;let Ka=null,Ja=0,Za=0,Qa=!1;const Ei=(1+Math.sqrt(5))/2,ts=1/Ei,Nc=[new O(-Ei,ts,0),new O(Ei,ts,0),new O(-ts,0,Ei),new O(ts,0,Ei),new O(0,Ei,-ts),new O(0,Ei,ts),new O(-1,1,-1),new O(1,1,-1),new O(-1,1,1),new O(1,1,1)],Em=new O;class Fc{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100,r={}){const{size:a=256,position:o=Em}=r;Ka=this._renderer.getRenderTarget(),Ja=this._renderer.getActiveCubeFace(),Za=this._renderer.getActiveMipmapLevel(),Qa=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(t,n,i,l,o),e>0&&this._blur(l,0,0,e),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Bc(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=zc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Ka,Ja,Za),this._renderer.xr.enabled=Qa,t.scissorTest=!1,Lr(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===cs||t.mapping===hs?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Ka=this._renderer.getRenderTarget(),Ja=this._renderer.getActiveCubeFace(),Za=this._renderer.getActiveMipmapLevel(),Qa=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:pn,minFilter:pn,generateMipmaps:!1,type:Ws,format:yn,colorSpace:us,depthBuffer:!1},i=Oc(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Oc(t,e,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=wm(r)),this._blurMaterial=Tm(r,t,e)}return i}_compileMaterial(t){const e=new be(this._lodPlanes[0],t);this._renderer.compile(e,$a)}_sceneToCubeUV(t,e,n,i,r){const l=new $e(90,1,e,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,p=u.toneMapping;u.getClearColor(Ic),u.toneMapping=di,u.autoClear=!1;const m=new pi({name:"PMREM.Background",side:rn,depthWrite:!1,depthTest:!1}),_=new be(new gs,m);let g=!1;const f=t.background;f?f.isColor&&(m.color.copy(f),t.background=null,g=!0):(m.color.copy(Ic),g=!0);for(let b=0;b<6;b++){const w=b%3;w===0?(l.up.set(0,c[b],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x+h[b],r.y,r.z)):w===1?(l.up.set(0,0,c[b]),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y+h[b],r.z)):(l.up.set(0,c[b],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y,r.z+h[b]));const S=this._cubeSize;Lr(i,w*S,b>2?S:0,S,S),u.setRenderTarget(i),g&&u.render(_,l),u.render(t,l)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=p,u.autoClear=d,t.background=f}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===cs||t.mapping===hs;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Bc()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=zc());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new be(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=t;const l=this._cubeSize;Lr(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,$a)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const i=this._lodPlanes.length;for(let r=1;r<i;r++){const a=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=Nc[(i-r-1)%Nc.length];this._blur(t,r-1,r,a,o)}e.autoClear=n}_blur(t,e,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,i,"latitudinal",r),this._halfBlur(a,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,u=new be(this._lodPlanes[i],c),d=c.uniforms,p=this._sizeLods[n]-1,m=isFinite(r)?Math.PI/(2*p):2*Math.PI/(2*Ai-1),_=r/m,g=isFinite(r)?1+Math.floor(h*_):Ai;g>Ai&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Ai}`);const f=[];let b=0;for(let P=0;P<Ai;++P){const D=P/_,M=Math.exp(-D*D/2);f.push(M),P===0?b+=M:P<g&&(b+=2*M)}for(let P=0;P<f.length;P++)f[P]=f[P]/b;d.envMap.value=t.texture,d.samples.value=g,d.weights.value=f,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:w}=this;d.dTheta.value=m,d.mipInt.value=w-n;const S=this._sizeLods[i],I=3*S*(i>w-is?i-w+is:0),L=4*(this._cubeSize-S);Lr(e,I,L,3*S,2*S),l.setRenderTarget(e),l.render(u,$a)}}function wm(s){const t=[],e=[],n=[];let i=s;const r=s-is+1+Uc.length;for(let a=0;a<r;a++){const o=Math.pow(2,i);e.push(o);let l=1/o;a>s-is?l=Uc[a-s+is-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,u=1+c,d=[h,h,u,h,u,u,h,h,u,u,h,u],p=6,m=6,_=3,g=2,f=1,b=new Float32Array(_*m*p),w=new Float32Array(g*m*p),S=new Float32Array(f*m*p);for(let L=0;L<p;L++){const P=L%3*2/3-1,D=L>2?0:-1,M=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];b.set(M,_*m*L),w.set(d,g*m*L);const y=[L,L,L,L,L,L];S.set(y,f*m*L)}const I=new Ne;I.setAttribute("position",new Oe(b,_)),I.setAttribute("uv",new Oe(w,g)),I.setAttribute("faceIndex",new Oe(S,f)),t.push(I),i>is&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Oc(s,t,e){const n=new Pi(s,t,e);return n.texture.mapping=aa,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Lr(s,t,e,n,i){s.viewport.set(t,e,n,i),s.scissor.set(t,e,n,i)}function Tm(s,t,e){const n=new Float32Array(Ai),i=new O(0,1,0);return new ti({name:"SphericalGaussianBlur",defines:{n:Ai,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Rl(),fragmentShader:`
3575
3575
 
3576
3576
  precision mediump float;
3577
3577
  precision mediump int;
@@ -3631,7 +3631,7 @@ void main() {
3631
3631
  }
3632
3632
 
3633
3633
  }
3634
- `,blending:di,depthTest:!1,depthWrite:!1})}function Yc(){return new ti({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ol(),fragmentShader:`
3634
+ `,blending:ui,depthTest:!1,depthWrite:!1})}function zc(){return new ti({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Rl(),fragmentShader:`
3635
3635
 
3636
3636
  precision mediump float;
3637
3637
  precision mediump int;
@@ -3650,7 +3650,7 @@ void main() {
3650
3650
  gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3651
3651
 
3652
3652
  }
3653
- `,blending:di,depthTest:!1,depthWrite:!1})}function Jc(){return new ti({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ol(),fragmentShader:`
3653
+ `,blending:ui,depthTest:!1,depthWrite:!1})}function Bc(){return new ti({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Rl(),fragmentShader:`
3654
3654
 
3655
3655
  precision mediump float;
3656
3656
  precision mediump int;
@@ -3666,7 +3666,7 @@ void main() {
3666
3666
  gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3667
3667
 
3668
3668
  }
3669
- `,blending:di,depthTest:!1,depthWrite:!1})}function Ol(){return`
3669
+ `,blending:ui,depthTest:!1,depthWrite:!1})}function Rl(){return`
3670
3670
 
3671
3671
  precision mediump float;
3672
3672
  precision mediump int;
@@ -3721,17 +3721,17 @@ void main() {
3721
3721
  gl_Position = vec4( position, 1.0 );
3722
3722
 
3723
3723
  }
3724
- `}function e1(s){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Ao||l===To,h=l===hs||l===us;if(c||h){let u=t.get(o);const d=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==d)return e===null&&(e=new qc(s)),u=c?e.fromEquirectangular(o,u):e.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),u.texture;if(u!==void 0)return u.texture;{const f=o.image;return c&&f&&f.height>0||h&&f&&i(f)?(e===null&&(e=new qc(s)),u=c?e.fromEquirectangular(o):e.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),o.addEventListener("dispose",r),u.texture):null}}}return o}function i(o){let l=0;const c=6;for(let h=0;h<c;h++)o[h]!==void 0&&l++;return l===c}function r(o){const l=o.target;l.removeEventListener("dispose",r);const c=t.get(l);c!==void 0&&(t.delete(l),c.dispose())}function a(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:a}}function n1(s){const t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=s.getExtension("WEBGL_depth_texture")||s.getExtension("MOZ_WEBGL_depth_texture")||s.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=s.getExtension("EXT_texture_filter_anisotropic")||s.getExtension("MOZ_EXT_texture_filter_anisotropic")||s.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=s.getExtension("WEBGL_compressed_texture_s3tc")||s.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=s.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(n){const i=e(n);return i===null&&os("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function i1(s,t,e,n){const i={},r=new WeakMap;function a(u){const d=u.target;d.index!==null&&t.remove(d.index);for(const m in d.attributes)t.remove(d.attributes[m]);d.removeEventListener("dispose",a),delete i[d.id];const f=r.get(d);f&&(t.remove(f),r.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,e.memory.geometries--}function o(u,d){return i[d.id]===!0||(d.addEventListener("dispose",a),i[d.id]=!0,e.memory.geometries++),d}function l(u){const d=u.attributes;for(const f in d)t.update(d[f],s.ARRAY_BUFFER)}function c(u){const d=[],f=u.index,m=u.attributes.position;let _=0;if(f!==null){const E=f.array;_=f.version;for(let b=0,M=E.length;b<M;b+=3){const I=E[b+0],C=E[b+1],P=E[b+2];d.push(I,C,C,P,P,I)}}else if(m!==void 0){const E=m.array;_=m.version;for(let b=0,M=E.length/3-1;b<M;b+=3){const I=b+0,C=b+1,P=b+2;d.push(I,C,C,P,P,I)}}else return;const g=new(Kh(d)?eu:tu)(d,1);g.version=_;const p=r.get(u);p&&t.remove(p),r.set(u,g)}function h(u){const d=r.get(u);if(d){const f=u.index;f!==null&&d.version<f.version&&c(u)}else c(u);return r.get(u)}return{get:o,update:l,getWireframeAttribute:h}}function s1(s,t,e){let n;function i(d){n=d}let r,a;function o(d){r=d.type,a=d.bytesPerElement}function l(d,f){s.drawElements(n,f,r,d*a),e.update(f,n,1)}function c(d,f,m){m!==0&&(s.drawElementsInstanced(n,f,r,d*a,m),e.update(f,n,m))}function h(d,f,m){if(m===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,r,d,0,m);let g=0;for(let p=0;p<m;p++)g+=f[p];e.update(g,n,1)}function u(d,f,m,_){if(m===0)return;const g=t.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<d.length;p++)c(d[p]/a,f[p],_[p]);else{g.multiDrawElementsInstancedWEBGL(n,f,0,r,d,0,_,0,m);let p=0;for(let E=0;E<m;E++)p+=f[E]*_[E];e.update(p,n,1)}}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function r1(s){const t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,o){switch(e.calls++,a){case s.TRIANGLES:e.triangles+=o*(r/3);break;case s.LINES:e.lines+=o*(r/2);break;case s.LINE_STRIP:e.lines+=o*(r-1);break;case s.LINE_LOOP:e.lines+=o*r;break;case s.POINTS:e.points+=o*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function a1(s,t,e){const n=new WeakMap,i=new me;function r(a,o,l){const c=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=h!==void 0?h.length:0;let d=n.get(o);if(d===void 0||d.count!==u){let S=function(){P.dispose(),n.delete(o),o.removeEventListener("dispose",S)};d!==void 0&&d.texture.dispose();const f=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,_=o.morphAttributes.color!==void 0,g=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],E=o.morphAttributes.color||[];let b=0;f===!0&&(b=1),m===!0&&(b=2),_===!0&&(b=3);let M=o.attributes.position.count*b,I=1;M>t.maxTextureSize&&(I=Math.ceil(M/t.maxTextureSize),M=t.maxTextureSize);const C=new Float32Array(M*I*4*u),P=new Zh(C,M,I,u);P.type=Fn,P.needsUpdate=!0;const D=b*4;for(let y=0;y<u;y++){const U=g[y],B=p[y],k=E[y],q=M*I*4*y;for(let K=0;K<U.count;K++){const z=K*D;f===!0&&(i.fromBufferAttribute(U,K),C[q+z+0]=i.x,C[q+z+1]=i.y,C[q+z+2]=i.z,C[q+z+3]=0),m===!0&&(i.fromBufferAttribute(B,K),C[q+z+4]=i.x,C[q+z+5]=i.y,C[q+z+6]=i.z,C[q+z+7]=0),_===!0&&(i.fromBufferAttribute(k,K),C[q+z+8]=i.x,C[q+z+9]=i.y,C[q+z+10]=i.z,C[q+z+11]=k.itemSize===4?i.w:1)}}d={count:u,texture:P,size:new Dt(M,I)},n.set(o,d),o.addEventListener("dispose",S)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(s,"morphTexture",a.morphTexture,e);else{let f=0;for(let _=0;_<c.length;_++)f+=c[_];const m=o.morphTargetsRelative?1:1-f;l.getUniforms().setValue(s,"morphTargetBaseInfluence",m),l.getUniforms().setValue(s,"morphTargetInfluences",c)}l.getUniforms().setValue(s,"morphTargetsTexture",d.texture,e),l.getUniforms().setValue(s,"morphTargetsTextureSize",d.size)}return{update:r}}function o1(s,t,e,n){let i=new WeakMap;function r(l){const c=n.render.frame,h=l.geometry,u=t.get(l,h);if(i.get(u)!==c&&(t.update(u),i.set(u,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==c&&(e.update(l.instanceMatrix,s.ARRAY_BUFFER),l.instanceColor!==null&&e.update(l.instanceColor,s.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){const d=l.skeleton;i.get(d)!==c&&(d.update(),i.set(d,c))}return u}function a(){i=new WeakMap}function o(l){const c=l.target;c.removeEventListener("dispose",o),e.remove(c.instanceMatrix),c.instanceColor!==null&&e.remove(c.instanceColor)}return{update:r,dispose:a}}const yu=new $e,$c=new cu(1,1),Mu=new Zh,Su=new jd,bu=new su,Kc=[],Zc=[],Qc=new Float32Array(16),th=new Float32Array(9),eh=new Float32Array(4);function Ms(s,t,e){const n=s[0];if(n<=0||n>0)return s;const i=t*e;let r=Kc[i];if(r===void 0&&(r=new Float32Array(i),Kc[i]=r),t!==0){n.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,s[a].toArray(r,o)}return r}function He(s,t){if(s.length!==t.length)return!1;for(let e=0,n=s.length;e<n;e++)if(s[e]!==t[e])return!1;return!0}function Ge(s,t){for(let e=0,n=t.length;e<n;e++)s[e]=t[e]}function ma(s,t){let e=Zc[t];e===void 0&&(e=new Int32Array(t),Zc[t]=e);for(let n=0;n!==t;++n)e[n]=s.allocateTextureUnit();return e}function l1(s,t){const e=this.cache;e[0]!==t&&(s.uniform1f(this.addr,t),e[0]=t)}function c1(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(s.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(He(e,t))return;s.uniform2fv(this.addr,t),Ge(e,t)}}function h1(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(s.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(s.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(He(e,t))return;s.uniform3fv(this.addr,t),Ge(e,t)}}function u1(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(s.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(He(e,t))return;s.uniform4fv(this.addr,t),Ge(e,t)}}function d1(s,t){const e=this.cache,n=t.elements;if(n===void 0){if(He(e,t))return;s.uniformMatrix2fv(this.addr,!1,t),Ge(e,t)}else{if(He(e,n))return;eh.set(n),s.uniformMatrix2fv(this.addr,!1,eh),Ge(e,n)}}function f1(s,t){const e=this.cache,n=t.elements;if(n===void 0){if(He(e,t))return;s.uniformMatrix3fv(this.addr,!1,t),Ge(e,t)}else{if(He(e,n))return;th.set(n),s.uniformMatrix3fv(this.addr,!1,th),Ge(e,n)}}function p1(s,t){const e=this.cache,n=t.elements;if(n===void 0){if(He(e,t))return;s.uniformMatrix4fv(this.addr,!1,t),Ge(e,t)}else{if(He(e,n))return;Qc.set(n),s.uniformMatrix4fv(this.addr,!1,Qc),Ge(e,n)}}function m1(s,t){const e=this.cache;e[0]!==t&&(s.uniform1i(this.addr,t),e[0]=t)}function g1(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(s.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(He(e,t))return;s.uniform2iv(this.addr,t),Ge(e,t)}}function _1(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(s.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(He(e,t))return;s.uniform3iv(this.addr,t),Ge(e,t)}}function v1(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(s.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(He(e,t))return;s.uniform4iv(this.addr,t),Ge(e,t)}}function x1(s,t){const e=this.cache;e[0]!==t&&(s.uniform1ui(this.addr,t),e[0]=t)}function y1(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(s.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(He(e,t))return;s.uniform2uiv(this.addr,t),Ge(e,t)}}function M1(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(s.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(He(e,t))return;s.uniform3uiv(this.addr,t),Ge(e,t)}}function S1(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(s.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(He(e,t))return;s.uniform4uiv(this.addr,t),Ge(e,t)}}function b1(s,t,e){const n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i);let r;this.type===s.SAMPLER_2D_SHADOW?($c.compareFunction=$h,r=$c):r=yu,e.setTexture2D(t||r,i)}function E1(s,t,e){const n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||Su,i)}function w1(s,t,e){const n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||bu,i)}function A1(s,t,e){const n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||Mu,i)}function T1(s){switch(s){case 5126:return l1;case 35664:return c1;case 35665:return h1;case 35666:return u1;case 35674:return d1;case 35675:return f1;case 35676:return p1;case 5124:case 35670:return m1;case 35667:case 35671:return g1;case 35668:case 35672:return _1;case 35669:case 35673:return v1;case 5125:return x1;case 36294:return y1;case 36295:return M1;case 36296:return S1;case 35678:case 36198:case 36298:case 36306:case 35682:return b1;case 35679:case 36299:case 36307:return E1;case 35680:case 36300:case 36308:case 36293:return w1;case 36289:case 36303:case 36311:case 36292:return A1}}function R1(s,t){s.uniform1fv(this.addr,t)}function C1(s,t){const e=Ms(t,this.size,2);s.uniform2fv(this.addr,e)}function L1(s,t){const e=Ms(t,this.size,3);s.uniform3fv(this.addr,e)}function P1(s,t){const e=Ms(t,this.size,4);s.uniform4fv(this.addr,e)}function D1(s,t){const e=Ms(t,this.size,4);s.uniformMatrix2fv(this.addr,!1,e)}function U1(s,t){const e=Ms(t,this.size,9);s.uniformMatrix3fv(this.addr,!1,e)}function I1(s,t){const e=Ms(t,this.size,16);s.uniformMatrix4fv(this.addr,!1,e)}function N1(s,t){s.uniform1iv(this.addr,t)}function F1(s,t){s.uniform2iv(this.addr,t)}function O1(s,t){s.uniform3iv(this.addr,t)}function z1(s,t){s.uniform4iv(this.addr,t)}function B1(s,t){s.uniform1uiv(this.addr,t)}function k1(s,t){s.uniform2uiv(this.addr,t)}function V1(s,t){s.uniform3uiv(this.addr,t)}function H1(s,t){s.uniform4uiv(this.addr,t)}function G1(s,t,e){const n=this.cache,i=t.length,r=ma(e,i);He(n,r)||(s.uniform1iv(this.addr,r),Ge(n,r));for(let a=0;a!==i;++a)e.setTexture2D(t[a]||yu,r[a])}function W1(s,t,e){const n=this.cache,i=t.length,r=ma(e,i);He(n,r)||(s.uniform1iv(this.addr,r),Ge(n,r));for(let a=0;a!==i;++a)e.setTexture3D(t[a]||Su,r[a])}function X1(s,t,e){const n=this.cache,i=t.length,r=ma(e,i);He(n,r)||(s.uniform1iv(this.addr,r),Ge(n,r));for(let a=0;a!==i;++a)e.setTextureCube(t[a]||bu,r[a])}function q1(s,t,e){const n=this.cache,i=t.length,r=ma(e,i);He(n,r)||(s.uniform1iv(this.addr,r),Ge(n,r));for(let a=0;a!==i;++a)e.setTexture2DArray(t[a]||Mu,r[a])}function j1(s){switch(s){case 5126:return R1;case 35664:return C1;case 35665:return L1;case 35666:return P1;case 35674:return D1;case 35675:return U1;case 35676:return I1;case 5124:case 35670:return N1;case 35667:case 35671:return F1;case 35668:case 35672:return O1;case 35669:case 35673:return z1;case 5125:return B1;case 36294:return k1;case 36295:return V1;case 36296:return H1;case 35678:case 36198:case 36298:case 36306:case 35682:return G1;case 35679:case 36299:case 36307:return W1;case 35680:case 36300:case 36308:case 36293:return X1;case 36289:case 36303:case 36311:case 36292:return q1}}class Y1{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=T1(e.type)}}class J1{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=j1(e.type)}}class $1{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const o=i[r];o.setValue(t,e[o.id],n)}}}const oo=/(\w+)(\])?(\[|\.)?/g;function nh(s,t){s.seq.push(t),s.map[t.id]=t}function K1(s,t,e){const n=s.name,i=n.length;for(oo.lastIndex=0;;){const r=oo.exec(n),a=oo.lastIndex;let o=r[1];const l=r[2]==="]",c=r[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){nh(e,c===void 0?new Y1(o,s,t):new J1(o,s,t));break}else{let u=e.map[o];u===void 0&&(u=new $1(o),nh(e,u)),e=u}}}class Kr{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const r=t.getActiveUniform(e,i),a=t.getUniformLocation(e,r.name);K1(r,a,this)}}setValue(t,e,n,i){const r=this.map[e];r!==void 0&&r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,a=e.length;r!==a;++r){const o=e[r],l=n[o.id];l.needsUpdate!==!1&&o.setValue(t,l.value,i)}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const a=t[i];a.id in e&&n.push(a)}return n}}function ih(s,t,e){const n=s.createShader(t);return s.shaderSource(n,e),s.compileShader(n),n}const Z1=37297;let Q1=0;function t2(s,t){const e=s.split(`
3724
+ `}function Am(s){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===xo||l===yo,h=l===cs||l===hs;if(c||h){let u=t.get(o);const d=u!==void 0?u.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==d)return e===null&&(e=new Fc(s)),u=c?e.fromEquirectangular(o,u):e.fromCubemap(o,u),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),u.texture;if(u!==void 0)return u.texture;{const p=o.image;return c&&p&&p.height>0||h&&p&&i(p)?(e===null&&(e=new Fc(s)),u=c?e.fromEquirectangular(o):e.fromCubemap(o),u.texture.pmremVersion=o.pmremVersion,t.set(o,u),o.addEventListener("dispose",r),u.texture):null}}}return o}function i(o){let l=0;const c=6;for(let h=0;h<c;h++)o[h]!==void 0&&l++;return l===c}function r(o){const l=o.target;l.removeEventListener("dispose",r);const c=t.get(l);c!==void 0&&(t.delete(l),c.dispose())}function a(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:a}}function Rm(s){const t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=s.getExtension("WEBGL_depth_texture")||s.getExtension("MOZ_WEBGL_depth_texture")||s.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=s.getExtension("EXT_texture_filter_anisotropic")||s.getExtension("MOZ_EXT_texture_filter_anisotropic")||s.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=s.getExtension("WEBGL_compressed_texture_s3tc")||s.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=s.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(n){const i=e(n);return i===null&&as("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function Cm(s,t,e,n){const i={},r=new WeakMap;function a(u){const d=u.target;d.index!==null&&t.remove(d.index);for(const m in d.attributes)t.remove(d.attributes[m]);d.removeEventListener("dispose",a),delete i[d.id];const p=r.get(d);p&&(t.remove(p),r.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,e.memory.geometries--}function o(u,d){return i[d.id]===!0||(d.addEventListener("dispose",a),i[d.id]=!0,e.memory.geometries++),d}function l(u){const d=u.attributes;for(const p in d)t.update(d[p],s.ARRAY_BUFFER)}function c(u){const d=[],p=u.index,m=u.attributes.position;let _=0;if(p!==null){const b=p.array;_=p.version;for(let w=0,S=b.length;w<S;w+=3){const I=b[w+0],L=b[w+1],P=b[w+2];d.push(I,L,L,P,P,I)}}else if(m!==void 0){const b=m.array;_=m.version;for(let w=0,S=b.length/3-1;w<S;w+=3){const I=w+0,L=w+1,P=w+2;d.push(I,L,L,P,P,I)}}else return;const g=new(Vh(d)?Xh:Wh)(d,1);g.version=_;const f=r.get(u);f&&t.remove(f),r.set(u,g)}function h(u){const d=r.get(u);if(d){const p=u.index;p!==null&&d.version<p.version&&c(u)}else c(u);return r.get(u)}return{get:o,update:l,getWireframeAttribute:h}}function Lm(s,t,e){let n;function i(d){n=d}let r,a;function o(d){r=d.type,a=d.bytesPerElement}function l(d,p){s.drawElements(n,p,r,d*a),e.update(p,n,1)}function c(d,p,m){m!==0&&(s.drawElementsInstanced(n,p,r,d*a,m),e.update(p,n,m))}function h(d,p,m){if(m===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,p,0,r,d,0,m);let g=0;for(let f=0;f<m;f++)g+=p[f];e.update(g,n,1)}function u(d,p,m,_){if(m===0)return;const g=t.get("WEBGL_multi_draw");if(g===null)for(let f=0;f<d.length;f++)c(d[f]/a,p[f],_[f]);else{g.multiDrawElementsInstancedWEBGL(n,p,0,r,d,0,_,0,m);let f=0;for(let b=0;b<m;b++)f+=p[b]*_[b];e.update(f,n,1)}}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function Pm(s){const t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,o){switch(e.calls++,a){case s.TRIANGLES:e.triangles+=o*(r/3);break;case s.LINES:e.lines+=o*(r/2);break;case s.LINE_STRIP:e.lines+=o*(r-1);break;case s.LINE_LOOP:e.lines+=o*r;break;case s.POINTS:e.points+=o*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function Dm(s,t,e){const n=new WeakMap,i=new me;function r(a,o,l){const c=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=h!==void 0?h.length:0;let d=n.get(o);if(d===void 0||d.count!==u){let M=function(){P.dispose(),n.delete(o),o.removeEventListener("dispose",M)};d!==void 0&&d.texture.dispose();const p=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,_=o.morphAttributes.color!==void 0,g=o.morphAttributes.position||[],f=o.morphAttributes.normal||[],b=o.morphAttributes.color||[];let w=0;p===!0&&(w=1),m===!0&&(w=2),_===!0&&(w=3);let S=o.attributes.position.count*w,I=1;S>t.maxTextureSize&&(I=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);const L=new Float32Array(S*I*4*u),P=new Hh(L,S,I,u);P.type=Fn,P.needsUpdate=!0;const D=w*4;for(let y=0;y<u;y++){const U=g[y],B=f[y],k=b[y],q=S*I*4*y;for(let J=0;J<U.count;J++){const z=J*D;p===!0&&(i.fromBufferAttribute(U,J),L[q+z+0]=i.x,L[q+z+1]=i.y,L[q+z+2]=i.z,L[q+z+3]=0),m===!0&&(i.fromBufferAttribute(B,J),L[q+z+4]=i.x,L[q+z+5]=i.y,L[q+z+6]=i.z,L[q+z+7]=0),_===!0&&(i.fromBufferAttribute(k,J),L[q+z+8]=i.x,L[q+z+9]=i.y,L[q+z+10]=i.z,L[q+z+11]=k.itemSize===4?i.w:1)}}d={count:u,texture:P,size:new Qt(S,I)},n.set(o,d),o.addEventListener("dispose",M)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(s,"morphTexture",a.morphTexture,e);else{let p=0;for(let _=0;_<c.length;_++)p+=c[_];const m=o.morphTargetsRelative?1:1-p;l.getUniforms().setValue(s,"morphTargetBaseInfluence",m),l.getUniforms().setValue(s,"morphTargetInfluences",c)}l.getUniforms().setValue(s,"morphTargetsTexture",d.texture,e),l.getUniforms().setValue(s,"morphTargetsTextureSize",d.size)}return{update:r}}function Um(s,t,e,n){let i=new WeakMap;function r(l){const c=n.render.frame,h=l.geometry,u=t.get(l,h);if(i.get(u)!==c&&(t.update(u),i.set(u,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==c&&(e.update(l.instanceMatrix,s.ARRAY_BUFFER),l.instanceColor!==null&&e.update(l.instanceColor,s.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){const d=l.skeleton;i.get(d)!==c&&(d.update(),i.set(d,c))}return u}function a(){i=new WeakMap}function o(l){const c=l.target;c.removeEventListener("dispose",o),e.remove(c.instanceMatrix),c.instanceColor!==null&&e.remove(c.instanceColor)}return{update:r,dispose:a}}const ou=new Ke,kc=new Qh(1,1),lu=new Hh,cu=new Id,hu=new Yh,Vc=[],Hc=[],Gc=new Float32Array(16),Wc=new Float32Array(9),Xc=new Float32Array(4);function ys(s,t,e){const n=s[0];if(n<=0||n>0)return s;const i=t*e;let r=Vc[i];if(r===void 0&&(r=new Float32Array(i),Vc[i]=r),t!==0){n.toArray(r,0);for(let a=1,o=0;a!==t;++a)o+=e,s[a].toArray(r,o)}return r}function He(s,t){if(s.length!==t.length)return!1;for(let e=0,n=s.length;e<n;e++)if(s[e]!==t[e])return!1;return!0}function Ge(s,t){for(let e=0,n=t.length;e<n;e++)s[e]=t[e]}function ua(s,t){let e=Hc[t];e===void 0&&(e=new Int32Array(t),Hc[t]=e);for(let n=0;n!==t;++n)e[n]=s.allocateTextureUnit();return e}function Im(s,t){const e=this.cache;e[0]!==t&&(s.uniform1f(this.addr,t),e[0]=t)}function Nm(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(s.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(He(e,t))return;s.uniform2fv(this.addr,t),Ge(e,t)}}function Fm(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(s.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(s.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(He(e,t))return;s.uniform3fv(this.addr,t),Ge(e,t)}}function Om(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(s.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(He(e,t))return;s.uniform4fv(this.addr,t),Ge(e,t)}}function zm(s,t){const e=this.cache,n=t.elements;if(n===void 0){if(He(e,t))return;s.uniformMatrix2fv(this.addr,!1,t),Ge(e,t)}else{if(He(e,n))return;Xc.set(n),s.uniformMatrix2fv(this.addr,!1,Xc),Ge(e,n)}}function Bm(s,t){const e=this.cache,n=t.elements;if(n===void 0){if(He(e,t))return;s.uniformMatrix3fv(this.addr,!1,t),Ge(e,t)}else{if(He(e,n))return;Wc.set(n),s.uniformMatrix3fv(this.addr,!1,Wc),Ge(e,n)}}function km(s,t){const e=this.cache,n=t.elements;if(n===void 0){if(He(e,t))return;s.uniformMatrix4fv(this.addr,!1,t),Ge(e,t)}else{if(He(e,n))return;Gc.set(n),s.uniformMatrix4fv(this.addr,!1,Gc),Ge(e,n)}}function Vm(s,t){const e=this.cache;e[0]!==t&&(s.uniform1i(this.addr,t),e[0]=t)}function Hm(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(s.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(He(e,t))return;s.uniform2iv(this.addr,t),Ge(e,t)}}function Gm(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(s.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(He(e,t))return;s.uniform3iv(this.addr,t),Ge(e,t)}}function Wm(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(s.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(He(e,t))return;s.uniform4iv(this.addr,t),Ge(e,t)}}function Xm(s,t){const e=this.cache;e[0]!==t&&(s.uniform1ui(this.addr,t),e[0]=t)}function qm(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(s.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(He(e,t))return;s.uniform2uiv(this.addr,t),Ge(e,t)}}function jm(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(s.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(He(e,t))return;s.uniform3uiv(this.addr,t),Ge(e,t)}}function Ym(s,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(s.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(He(e,t))return;s.uniform4uiv(this.addr,t),Ge(e,t)}}function $m(s,t,e){const n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i);let r;this.type===s.SAMPLER_2D_SHADOW?(kc.compareFunction=kh,r=kc):r=ou,e.setTexture2D(t||r,i)}function Km(s,t,e){const n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||cu,i)}function Jm(s,t,e){const n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||hu,i)}function Zm(s,t,e){const n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||lu,i)}function Qm(s){switch(s){case 5126:return Im;case 35664:return Nm;case 35665:return Fm;case 35666:return Om;case 35674:return zm;case 35675:return Bm;case 35676:return km;case 5124:case 35670:return Vm;case 35667:case 35671:return Hm;case 35668:case 35672:return Gm;case 35669:case 35673:return Wm;case 5125:return Xm;case 36294:return qm;case 36295:return jm;case 36296:return Ym;case 35678:case 36198:case 36298:case 36306:case 35682:return $m;case 35679:case 36299:case 36307:return Km;case 35680:case 36300:case 36308:case 36293:return Jm;case 36289:case 36303:case 36311:case 36292:return Zm}}function t1(s,t){s.uniform1fv(this.addr,t)}function e1(s,t){const e=ys(t,this.size,2);s.uniform2fv(this.addr,e)}function n1(s,t){const e=ys(t,this.size,3);s.uniform3fv(this.addr,e)}function i1(s,t){const e=ys(t,this.size,4);s.uniform4fv(this.addr,e)}function s1(s,t){const e=ys(t,this.size,4);s.uniformMatrix2fv(this.addr,!1,e)}function r1(s,t){const e=ys(t,this.size,9);s.uniformMatrix3fv(this.addr,!1,e)}function a1(s,t){const e=ys(t,this.size,16);s.uniformMatrix4fv(this.addr,!1,e)}function o1(s,t){s.uniform1iv(this.addr,t)}function l1(s,t){s.uniform2iv(this.addr,t)}function c1(s,t){s.uniform3iv(this.addr,t)}function h1(s,t){s.uniform4iv(this.addr,t)}function u1(s,t){s.uniform1uiv(this.addr,t)}function d1(s,t){s.uniform2uiv(this.addr,t)}function f1(s,t){s.uniform3uiv(this.addr,t)}function p1(s,t){s.uniform4uiv(this.addr,t)}function m1(s,t,e){const n=this.cache,i=t.length,r=ua(e,i);He(n,r)||(s.uniform1iv(this.addr,r),Ge(n,r));for(let a=0;a!==i;++a)e.setTexture2D(t[a]||ou,r[a])}function g1(s,t,e){const n=this.cache,i=t.length,r=ua(e,i);He(n,r)||(s.uniform1iv(this.addr,r),Ge(n,r));for(let a=0;a!==i;++a)e.setTexture3D(t[a]||cu,r[a])}function _1(s,t,e){const n=this.cache,i=t.length,r=ua(e,i);He(n,r)||(s.uniform1iv(this.addr,r),Ge(n,r));for(let a=0;a!==i;++a)e.setTextureCube(t[a]||hu,r[a])}function v1(s,t,e){const n=this.cache,i=t.length,r=ua(e,i);He(n,r)||(s.uniform1iv(this.addr,r),Ge(n,r));for(let a=0;a!==i;++a)e.setTexture2DArray(t[a]||lu,r[a])}function x1(s){switch(s){case 5126:return t1;case 35664:return e1;case 35665:return n1;case 35666:return i1;case 35674:return s1;case 35675:return r1;case 35676:return a1;case 5124:case 35670:return o1;case 35667:case 35671:return l1;case 35668:case 35672:return c1;case 35669:case 35673:return h1;case 5125:return u1;case 36294:return d1;case 36295:return f1;case 36296:return p1;case 35678:case 36198:case 36298:case 36306:case 35682:return m1;case 35679:case 36299:case 36307:return g1;case 35680:case 36300:case 36308:case 36293:return _1;case 36289:case 36303:case 36311:case 36292:return v1}}class y1{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=Qm(e.type)}}class M1{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=x1(e.type)}}class S1{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const o=i[r];o.setValue(t,e[o.id],n)}}}const to=/(\w+)(\])?(\[|\.)?/g;function qc(s,t){s.seq.push(t),s.map[t.id]=t}function b1(s,t,e){const n=s.name,i=n.length;for(to.lastIndex=0;;){const r=to.exec(n),a=to.lastIndex;let o=r[1];const l=r[2]==="]",c=r[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){qc(e,c===void 0?new y1(o,s,t):new M1(o,s,t));break}else{let u=e.map[o];u===void 0&&(u=new S1(o),qc(e,u)),e=u}}}class jr{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const r=t.getActiveUniform(e,i),a=t.getUniformLocation(e,r.name);b1(r,a,this)}}setValue(t,e,n,i){const r=this.map[e];r!==void 0&&r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,a=e.length;r!==a;++r){const o=e[r],l=n[o.id];l.needsUpdate!==!1&&o.setValue(t,l.value,i)}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const a=t[i];a.id in e&&n.push(a)}return n}}function jc(s,t,e){const n=s.createShader(t);return s.shaderSource(n,e),s.compileShader(n),n}const E1=37297;let w1=0;function T1(s,t){const e=s.split(`
3725
3725
  `),n=[],i=Math.max(t-6,0),r=Math.min(t+6,e.length);for(let a=i;a<r;a++){const o=a+1;n.push(`${o===t?">":" "} ${o}: ${e[a]}`)}return n.join(`
3726
- `)}const sh=new ue;function e2(s){pe._getMatrix(sh,pe.workingColorSpace,s);const t=`mat3( ${sh.elements.map(e=>e.toFixed(4))} )`;switch(pe.getTransfer(s)){case na:return[t,"LinearTransferOETF"];case Re:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",s),[t,"LinearTransferOETF"]}}function rh(s,t,e){const n=s.getShaderParameter(t,s.COMPILE_STATUS),i=s.getShaderInfoLog(t).trim();if(n&&i==="")return"";const r=/ERROR: 0:(\d+)/.exec(i);if(r){const a=parseInt(r[1]);return e.toUpperCase()+`
3726
+ `)}const Yc=new he;function A1(s){fe._getMatrix(Yc,fe.workingColorSpace,s);const t=`mat3( ${Yc.elements.map(e=>e.toFixed(4))} )`;switch(fe.getTransfer(s)){case Zr:return[t,"LinearTransferOETF"];case Re:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",s),[t,"LinearTransferOETF"]}}function $c(s,t,e){const n=s.getShaderParameter(t,s.COMPILE_STATUS),i=s.getShaderInfoLog(t).trim();if(n&&i==="")return"";const r=/ERROR: 0:(\d+)/.exec(i);if(r){const a=parseInt(r[1]);return e.toUpperCase()+`
3727
3727
 
3728
3728
  `+i+`
3729
3729
 
3730
- `+t2(s.getShaderSource(t),a)}else return i}function n2(s,t){const e=e2(t);return[`vec4 ${s}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(`
3731
- `)}function i2(s,t){let e;switch(t){case id:e="Linear";break;case sd:e="Reinhard";break;case rd:e="Cineon";break;case kh:e="ACESFilmic";break;case od:e="AgX";break;case ld:e="Neutral";break;case ad:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+s+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const Nr=new N;function s2(){pe.getLuminanceCoefficients(Nr);const s=Nr.x.toFixed(4),t=Nr.y.toFixed(4),e=Nr.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${s}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(`
3732
- `)}function r2(s){return[s.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",s.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ns).join(`
3733
- `)}function a2(s){const t=[];for(const e in s){const n=s[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(`
3734
- `)}function o2(s,t){const e={},n=s.getProgramParameter(t,s.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const r=s.getActiveAttrib(t,i),a=r.name;let o=1;r.type===s.FLOAT_MAT2&&(o=2),r.type===s.FLOAT_MAT3&&(o=3),r.type===s.FLOAT_MAT4&&(o=4),e[a]={type:r.type,location:s.getAttribLocation(t,a),locationSize:o}}return e}function Ns(s){return s!==""}function ah(s,t){const e=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return s.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,e).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function oh(s,t){return s.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const l2=/^[ \t]*#include +<([\w\d./]+)>/gm;function al(s){return s.replace(l2,h2)}const c2=new Map;function h2(s,t){let e=fe[t];if(e===void 0){const n=c2.get(t);if(n!==void 0)e=fe[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return al(e)}const u2=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function lh(s){return s.replace(u2,d2)}function d2(s,t,e,n){let i="";for(let r=parseInt(t);r<parseInt(e);r++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return i}function ch(s){let t=`precision ${s.precision} float;
3730
+ `+T1(s.getShaderSource(t),a)}else return i}function R1(s,t){const e=A1(t);return[`vec4 ${s}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(`
3731
+ `)}function C1(s,t){let e;switch(t){case Wu:e="Linear";break;case Xu:e="Reinhard";break;case qu:e="Cineon";break;case Lh:e="ACESFilmic";break;case Yu:e="AgX";break;case $u:e="Neutral";break;case ju:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+s+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const Pr=new O;function L1(){fe.getLuminanceCoefficients(Pr);const s=Pr.x.toFixed(4),t=Pr.y.toFixed(4),e=Pr.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${s}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(`
3732
+ `)}function P1(s){return[s.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",s.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Is).join(`
3733
+ `)}function D1(s){const t=[];for(const e in s){const n=s[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(`
3734
+ `)}function U1(s,t){const e={},n=s.getProgramParameter(t,s.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const r=s.getActiveAttrib(t,i),a=r.name;let o=1;r.type===s.FLOAT_MAT2&&(o=2),r.type===s.FLOAT_MAT3&&(o=3),r.type===s.FLOAT_MAT4&&(o=4),e[a]={type:r.type,location:s.getAttribLocation(t,a),locationSize:o}}return e}function Is(s){return s!==""}function Kc(s,t){const e=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return s.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,e).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Jc(s,t){return s.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const I1=/^[ \t]*#include +<([\w\d./]+)>/gm;function Qo(s){return s.replace(I1,F1)}const N1=new Map;function F1(s,t){let e=ue[t];if(e===void 0){const n=N1.get(t);if(n!==void 0)e=ue[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return Qo(e)}const O1=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Zc(s){return s.replace(O1,z1)}function z1(s,t,e,n){let i="";for(let r=parseInt(t);r<parseInt(e);r++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return i}function Qc(s){let t=`precision ${s.precision} float;
3735
3735
  precision ${s.precision} int;
3736
3736
  precision ${s.precision} sampler2D;
3737
3737
  precision ${s.precision} samplerCube;
@@ -3751,30 +3751,30 @@ void main() {
3751
3751
  `;return s.precision==="highp"?t+=`
3752
3752
  #define HIGH_PRECISION`:s.precision==="mediump"?t+=`
3753
3753
  #define MEDIUM_PRECISION`:s.precision==="lowp"&&(t+=`
3754
- #define LOW_PRECISION`),t}function f2(s){let t="SHADOWMAP_TYPE_BASIC";return s.shadowMapType===zh?t="SHADOWMAP_TYPE_PCF":s.shadowMapType===Bh?t="SHADOWMAP_TYPE_PCF_SOFT":s.shadowMapType===Jn&&(t="SHADOWMAP_TYPE_VSM"),t}function p2(s){let t="ENVMAP_TYPE_CUBE";if(s.envMap)switch(s.envMapMode){case hs:case us:t="ENVMAP_TYPE_CUBE";break;case ha:t="ENVMAP_TYPE_CUBE_UV";break}return t}function m2(s){let t="ENVMAP_MODE_REFLECTION";if(s.envMap)switch(s.envMapMode){case us:t="ENVMAP_MODE_REFRACTION";break}return t}function g2(s){let t="ENVMAP_BLENDING_NONE";if(s.envMap)switch(s.combine){case ca:t="ENVMAP_BLENDING_MULTIPLY";break;case ed:t="ENVMAP_BLENDING_MIX";break;case nd:t="ENVMAP_BLENDING_ADD";break}return t}function _2(s){const t=s.envMapCubeUVHeight;if(t===null)return null;const e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function v2(s,t,e,n){const i=s.getContext(),r=e.defines;let a=e.vertexShader,o=e.fragmentShader;const l=f2(e),c=p2(e),h=m2(e),u=g2(e),d=_2(e),f=r2(e),m=a2(r),_=i.createProgram();let g,p,E=e.glslVersion?"#version "+e.glslVersion+`
3755
- `:"";e.isRawShaderMaterial?(g=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m].filter(Ns).join(`
3754
+ #define LOW_PRECISION`),t}function B1(s){let t="SHADOWMAP_TYPE_BASIC";return s.shadowMapType===Rh?t="SHADOWMAP_TYPE_PCF":s.shadowMapType===Ch?t="SHADOWMAP_TYPE_PCF_SOFT":s.shadowMapType===$n&&(t="SHADOWMAP_TYPE_VSM"),t}function k1(s){let t="ENVMAP_TYPE_CUBE";if(s.envMap)switch(s.envMapMode){case cs:case hs:t="ENVMAP_TYPE_CUBE";break;case aa:t="ENVMAP_TYPE_CUBE_UV";break}return t}function V1(s){let t="ENVMAP_MODE_REFLECTION";if(s.envMap)switch(s.envMapMode){case hs:t="ENVMAP_MODE_REFRACTION";break}return t}function H1(s){let t="ENVMAP_BLENDING_NONE";if(s.envMap)switch(s.combine){case ra:t="ENVMAP_BLENDING_MULTIPLY";break;case Hu:t="ENVMAP_BLENDING_MIX";break;case Gu:t="ENVMAP_BLENDING_ADD";break}return t}function G1(s){const t=s.envMapCubeUVHeight;if(t===null)return null;const e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function W1(s,t,e,n){const i=s.getContext(),r=e.defines;let a=e.vertexShader,o=e.fragmentShader;const l=B1(e),c=k1(e),h=V1(e),u=H1(e),d=G1(e),p=P1(e),m=D1(r),_=i.createProgram();let g,f,b=e.glslVersion?"#version "+e.glslVersion+`
3755
+ `:"";e.isRawShaderMaterial?(g=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m].filter(Is).join(`
3756
3756
  `),g.length>0&&(g+=`
3757
- `),p=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m].filter(Ns).join(`
3758
- `),p.length>0&&(p+=`
3759
- `)):(g=[ch(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3760
- `].filter(Ns).join(`
3761
- `),p=[ch(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==fi?"#define TONE_MAPPING":"",e.toneMapping!==fi?fe.tonemapping_pars_fragment:"",e.toneMapping!==fi?i2("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",fe.colorspace_pars_fragment,n2("linearToOutputTexel",e.outputColorSpace),s2(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
3762
- `].filter(Ns).join(`
3763
- `)),a=al(a),a=ah(a,e),a=oh(a,e),o=al(o),o=ah(o,e),o=oh(o,e),a=lh(a),o=lh(o),e.isRawShaderMaterial!==!0&&(E=`#version 300 es
3764
- `,g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3757
+ `),f=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m].filter(Is).join(`
3758
+ `),f.length>0&&(f+=`
3759
+ `)):(g=[Qc(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3760
+ `].filter(Is).join(`
3761
+ `),f=[Qc(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,m,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==di?"#define TONE_MAPPING":"",e.toneMapping!==di?ue.tonemapping_pars_fragment:"",e.toneMapping!==di?C1("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",ue.colorspace_pars_fragment,R1("linearToOutputTexel",e.outputColorSpace),L1(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
3762
+ `].filter(Is).join(`
3763
+ `)),a=Qo(a),a=Kc(a,e),a=Jc(a,e),o=Qo(o),o=Kc(o,e),o=Jc(o,e),a=Zc(a),o=Zc(o),e.isRawShaderMaterial!==!0&&(b=`#version 300 es
3764
+ `,g=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3765
3765
  `)+`
3766
- `+g,p=["#define varying in",e.glslVersion===Kl?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Kl?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
3766
+ `+g,f=["#define varying in",e.glslVersion===Hl?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Hl?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
3767
3767
  `)+`
3768
- `+p);const b=E+g+a,M=E+p+o,I=ih(i,i.VERTEX_SHADER,b),C=ih(i,i.FRAGMENT_SHADER,M);i.attachShader(_,I),i.attachShader(_,C),e.index0AttributeName!==void 0?i.bindAttribLocation(_,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function P(U){if(s.debug.checkShaderErrors){const B=i.getProgramInfoLog(_).trim(),k=i.getShaderInfoLog(I).trim(),q=i.getShaderInfoLog(C).trim();let K=!0,z=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(K=!1,typeof s.debug.onShaderError=="function")s.debug.onShaderError(i,_,I,C);else{const tt=rh(i,I,"vertex"),W=rh(i,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+`
3768
+ `+f);const w=b+g+a,S=b+f+o,I=jc(i,i.VERTEX_SHADER,w),L=jc(i,i.FRAGMENT_SHADER,S);i.attachShader(_,I),i.attachShader(_,L),e.index0AttributeName!==void 0?i.bindAttribLocation(_,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function P(U){if(s.debug.checkShaderErrors){const B=i.getProgramInfoLog(_).trim(),k=i.getShaderInfoLog(I).trim(),q=i.getShaderInfoLog(L).trim();let J=!0,z=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(J=!1,typeof s.debug.onShaderError=="function")s.debug.onShaderError(i,_,I,L);else{const tt=$c(i,I,"vertex"),W=$c(i,L,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+`
3769
3769
 
3770
3770
  Material Name: `+U.name+`
3771
3771
  Material Type: `+U.type+`
3772
3772
 
3773
3773
  Program Info Log: `+B+`
3774
3774
  `+tt+`
3775
- `+W)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(k===""||q==="")&&(z=!1);z&&(U.diagnostics={runnable:K,programLog:B,vertexShader:{log:k,prefix:g},fragmentShader:{log:q,prefix:p}})}i.deleteShader(I),i.deleteShader(C),D=new Kr(i,_),S=o2(i,_)}let D;this.getUniforms=function(){return D===void 0&&P(this),D};let S;this.getAttributes=function(){return S===void 0&&P(this),S};let y=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=i.getProgramParameter(_,Z1)),y},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Q1++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=I,this.fragmentShader=C,this}let x2=0;class y2{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return n===void 0&&(n=new M2(t),e.set(t,n)),n}}class M2{constructor(t){this.id=x2++,this.code=t,this.usedTimes=0}}function S2(s,t,e,n,i,r,a){const o=new bl,l=new y2,c=new Set,h=[],u=i.logarithmicDepthBuffer,d=i.vertexTextures;let f=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(S){return c.add(S),S===0?"uv":`uv${S}`}function g(S,y,U,B,k){const q=B.fog,K=k.geometry,z=S.isMeshStandardMaterial?B.environment:null,tt=(S.isMeshStandardMaterial?e:t).get(S.envMap||z),W=tt&&tt.mapping===ha?tt.image.height:null,at=m[S.type];S.precision!==null&&(f=i.getMaxPrecision(S.precision),f!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",f,"instead."));const dt=K.morphAttributes.position||K.morphAttributes.normal||K.morphAttributes.color,mt=dt!==void 0?dt.length:0;let Rt=0;K.morphAttributes.position!==void 0&&(Rt=1),K.morphAttributes.normal!==void 0&&(Rt=2),K.morphAttributes.color!==void 0&&(Rt=3);let wt,X,Z,Q;if(at){const he=hn[at];wt=he.vertexShader,X=he.fragmentShader}else wt=S.vertexShader,X=S.fragmentShader,l.update(S),Z=l.getVertexShaderID(S),Q=l.getFragmentShaderID(S);const et=s.getRenderTarget(),_t=s.state.buffers.depth.getReversed(),ot=k.isInstancedMesh===!0,gt=k.isBatchedMesh===!0,te=!!S.map,ee=!!S.matcap,Jt=!!tt,O=!!S.aoMap,_e=!!S.lightMap,se=!!S.bumpMap,re=!!S.normalMap,Mt=!!S.displacementMap,ne=!!S.emissiveMap,yt=!!S.metalnessMap,oe=!!S.roughnessMap,Ee=S.anisotropy>0,F=S.clearcoat>0,w=S.dispersion>0,j=S.iridescence>0,st=S.sheen>0,lt=S.transmission>0,nt=Ee&&!!S.anisotropyMap,Bt=F&&!!S.clearcoatMap,bt=F&&!!S.clearcoatNormalMap,Ot=F&&!!S.clearcoatRoughnessMap,kt=j&&!!S.iridescenceMap,ct=j&&!!S.iridescenceThicknessMap,Ct=st&&!!S.sheenColorMap,$t=st&&!!S.sheenRoughnessMap,Xt=!!S.specularMap,St=!!S.specularColorMap,ie=!!S.specularIntensityMap,V=lt&&!!S.transmissionMap,At=lt&&!!S.thicknessMap,ht=!!S.gradientMap,Ut=!!S.alphaMap,ft=S.alphaTest>0,rt=!!S.alphaHash,It=!!S.extensions;let ae=fi;S.toneMapped&&(et===null||et.isXRRenderTarget===!0)&&(ae=s.toneMapping);const Le={shaderID:at,shaderType:S.type,shaderName:S.name,vertexShader:wt,fragmentShader:X,defines:S.defines,customVertexShaderID:Z,customFragmentShaderID:Q,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:f,batching:gt,batchingColor:gt&&k._colorsTexture!==null,instancing:ot,instancingColor:ot&&k.instanceColor!==null,instancingMorph:ot&&k.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:et===null?s.outputColorSpace:et.isXRRenderTarget===!0?et.texture.colorSpace:ds,alphaToCoverage:!!S.alphaToCoverage,map:te,matcap:ee,envMap:Jt,envMapMode:Jt&&tt.mapping,envMapCubeUVHeight:W,aoMap:O,lightMap:_e,bumpMap:se,normalMap:re,displacementMap:d&&Mt,emissiveMap:ne,normalMapObjectSpace:re&&S.normalMapType===pd,normalMapTangentSpace:re&&S.normalMapType===yl,metalnessMap:yt,roughnessMap:oe,anisotropy:Ee,anisotropyMap:nt,clearcoat:F,clearcoatMap:Bt,clearcoatNormalMap:bt,clearcoatRoughnessMap:Ot,dispersion:w,iridescence:j,iridescenceMap:kt,iridescenceThicknessMap:ct,sheen:st,sheenColorMap:Ct,sheenRoughnessMap:$t,specularMap:Xt,specularColorMap:St,specularIntensityMap:ie,transmission:lt,transmissionMap:V,thicknessMap:At,gradientMap:ht,opaque:S.transparent===!1&&S.blending===as&&S.alphaToCoverage===!1,alphaMap:Ut,alphaTest:ft,alphaHash:rt,combine:S.combine,mapUv:te&&_(S.map.channel),aoMapUv:O&&_(S.aoMap.channel),lightMapUv:_e&&_(S.lightMap.channel),bumpMapUv:se&&_(S.bumpMap.channel),normalMapUv:re&&_(S.normalMap.channel),displacementMapUv:Mt&&_(S.displacementMap.channel),emissiveMapUv:ne&&_(S.emissiveMap.channel),metalnessMapUv:yt&&_(S.metalnessMap.channel),roughnessMapUv:oe&&_(S.roughnessMap.channel),anisotropyMapUv:nt&&_(S.anisotropyMap.channel),clearcoatMapUv:Bt&&_(S.clearcoatMap.channel),clearcoatNormalMapUv:bt&&_(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ot&&_(S.clearcoatRoughnessMap.channel),iridescenceMapUv:kt&&_(S.iridescenceMap.channel),iridescenceThicknessMapUv:ct&&_(S.iridescenceThicknessMap.channel),sheenColorMapUv:Ct&&_(S.sheenColorMap.channel),sheenRoughnessMapUv:$t&&_(S.sheenRoughnessMap.channel),specularMapUv:Xt&&_(S.specularMap.channel),specularColorMapUv:St&&_(S.specularColorMap.channel),specularIntensityMapUv:ie&&_(S.specularIntensityMap.channel),transmissionMapUv:V&&_(S.transmissionMap.channel),thicknessMapUv:At&&_(S.thicknessMap.channel),alphaMapUv:Ut&&_(S.alphaMap.channel),vertexTangents:!!K.attributes.tangent&&(re||Ee),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!K.attributes.color&&K.attributes.color.itemSize===4,pointsUvs:k.isPoints===!0&&!!K.attributes.uv&&(te||Ut),fog:!!q,useFog:S.fog===!0,fogExp2:!!q&&q.isFogExp2,flatShading:S.flatShading===!0,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:_t,skinning:k.isSkinnedMesh===!0,morphTargets:K.morphAttributes.position!==void 0,morphNormals:K.morphAttributes.normal!==void 0,morphColors:K.morphAttributes.color!==void 0,morphTargetsCount:mt,morphTextureStride:Rt,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numSpotLightMaps:y.spotLightMap.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numSpotLightShadowsWithMaps:y.numSpotLightShadowsWithMaps,numLightProbes:y.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:S.dithering,shadowMapEnabled:s.shadowMap.enabled&&U.length>0,shadowMapType:s.shadowMap.type,toneMapping:ae,decodeVideoTexture:te&&S.map.isVideoTexture===!0&&pe.getTransfer(S.map.colorSpace)===Re,decodeVideoTextureEmissive:ne&&S.emissiveMap.isVideoTexture===!0&&pe.getTransfer(S.emissiveMap.colorSpace)===Re,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===tn,flipSided:S.side===rn,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:It&&S.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(It&&S.extensions.multiDraw===!0||gt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return Le.vertexUv1s=c.has(1),Le.vertexUv2s=c.has(2),Le.vertexUv3s=c.has(3),c.clear(),Le}function p(S){const y=[];if(S.shaderID?y.push(S.shaderID):(y.push(S.customVertexShaderID),y.push(S.customFragmentShaderID)),S.defines!==void 0)for(const U in S.defines)y.push(U),y.push(S.defines[U]);return S.isRawShaderMaterial===!1&&(E(y,S),b(y,S),y.push(s.outputColorSpace)),y.push(S.customProgramCacheKey),y.join()}function E(S,y){S.push(y.precision),S.push(y.outputColorSpace),S.push(y.envMapMode),S.push(y.envMapCubeUVHeight),S.push(y.mapUv),S.push(y.alphaMapUv),S.push(y.lightMapUv),S.push(y.aoMapUv),S.push(y.bumpMapUv),S.push(y.normalMapUv),S.push(y.displacementMapUv),S.push(y.emissiveMapUv),S.push(y.metalnessMapUv),S.push(y.roughnessMapUv),S.push(y.anisotropyMapUv),S.push(y.clearcoatMapUv),S.push(y.clearcoatNormalMapUv),S.push(y.clearcoatRoughnessMapUv),S.push(y.iridescenceMapUv),S.push(y.iridescenceThicknessMapUv),S.push(y.sheenColorMapUv),S.push(y.sheenRoughnessMapUv),S.push(y.specularMapUv),S.push(y.specularColorMapUv),S.push(y.specularIntensityMapUv),S.push(y.transmissionMapUv),S.push(y.thicknessMapUv),S.push(y.combine),S.push(y.fogExp2),S.push(y.sizeAttenuation),S.push(y.morphTargetsCount),S.push(y.morphAttributeCount),S.push(y.numDirLights),S.push(y.numPointLights),S.push(y.numSpotLights),S.push(y.numSpotLightMaps),S.push(y.numHemiLights),S.push(y.numRectAreaLights),S.push(y.numDirLightShadows),S.push(y.numPointLightShadows),S.push(y.numSpotLightShadows),S.push(y.numSpotLightShadowsWithMaps),S.push(y.numLightProbes),S.push(y.shadowMapType),S.push(y.toneMapping),S.push(y.numClippingPlanes),S.push(y.numClipIntersection),S.push(y.depthPacking)}function b(S,y){o.disableAll(),y.supportsVertexTextures&&o.enable(0),y.instancing&&o.enable(1),y.instancingColor&&o.enable(2),y.instancingMorph&&o.enable(3),y.matcap&&o.enable(4),y.envMap&&o.enable(5),y.normalMapObjectSpace&&o.enable(6),y.normalMapTangentSpace&&o.enable(7),y.clearcoat&&o.enable(8),y.iridescence&&o.enable(9),y.alphaTest&&o.enable(10),y.vertexColors&&o.enable(11),y.vertexAlphas&&o.enable(12),y.vertexUv1s&&o.enable(13),y.vertexUv2s&&o.enable(14),y.vertexUv3s&&o.enable(15),y.vertexTangents&&o.enable(16),y.anisotropy&&o.enable(17),y.alphaHash&&o.enable(18),y.batching&&o.enable(19),y.dispersion&&o.enable(20),y.batchingColor&&o.enable(21),S.push(o.mask),o.disableAll(),y.fog&&o.enable(0),y.useFog&&o.enable(1),y.flatShading&&o.enable(2),y.logarithmicDepthBuffer&&o.enable(3),y.reverseDepthBuffer&&o.enable(4),y.skinning&&o.enable(5),y.morphTargets&&o.enable(6),y.morphNormals&&o.enable(7),y.morphColors&&o.enable(8),y.premultipliedAlpha&&o.enable(9),y.shadowMapEnabled&&o.enable(10),y.doubleSided&&o.enable(11),y.flipSided&&o.enable(12),y.useDepthPacking&&o.enable(13),y.dithering&&o.enable(14),y.transmission&&o.enable(15),y.sheen&&o.enable(16),y.opaque&&o.enable(17),y.pointsUvs&&o.enable(18),y.decodeVideoTexture&&o.enable(19),y.decodeVideoTextureEmissive&&o.enable(20),y.alphaToCoverage&&o.enable(21),S.push(o.mask)}function M(S){const y=m[S.type];let U;if(y){const B=hn[y];U=El.clone(B.uniforms)}else U=S.uniforms;return U}function I(S,y){let U;for(let B=0,k=h.length;B<k;B++){const q=h[B];if(q.cacheKey===y){U=q,++U.usedTimes;break}}return U===void 0&&(U=new v2(s,y,S,r),h.push(U)),U}function C(S){if(--S.usedTimes===0){const y=h.indexOf(S);h[y]=h[h.length-1],h.pop(),S.destroy()}}function P(S){l.remove(S)}function D(){l.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:M,acquireProgram:I,releaseProgram:C,releaseShaderCache:P,programs:h,dispose:D}}function b2(){let s=new WeakMap;function t(a){return s.has(a)}function e(a){let o=s.get(a);return o===void 0&&(o={},s.set(a,o)),o}function n(a){s.delete(a)}function i(a,o,l){s.get(a)[o]=l}function r(){s=new WeakMap}return{has:t,get:e,remove:n,update:i,dispose:r}}function E2(s,t){return s.groupOrder!==t.groupOrder?s.groupOrder-t.groupOrder:s.renderOrder!==t.renderOrder?s.renderOrder-t.renderOrder:s.material.id!==t.material.id?s.material.id-t.material.id:s.z!==t.z?s.z-t.z:s.id-t.id}function hh(s,t){return s.groupOrder!==t.groupOrder?s.groupOrder-t.groupOrder:s.renderOrder!==t.renderOrder?s.renderOrder-t.renderOrder:s.z!==t.z?t.z-s.z:s.id-t.id}function uh(){const s=[];let t=0;const e=[],n=[],i=[];function r(){t=0,e.length=0,n.length=0,i.length=0}function a(u,d,f,m,_,g){let p=s[t];return p===void 0?(p={id:u.id,object:u,geometry:d,material:f,groupOrder:m,renderOrder:u.renderOrder,z:_,group:g},s[t]=p):(p.id=u.id,p.object=u,p.geometry=d,p.material=f,p.groupOrder=m,p.renderOrder=u.renderOrder,p.z=_,p.group=g),t++,p}function o(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.push(p):f.transparent===!0?i.push(p):e.push(p)}function l(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.unshift(p):f.transparent===!0?i.unshift(p):e.unshift(p)}function c(u,d){e.length>1&&e.sort(u||E2),n.length>1&&n.sort(d||hh),i.length>1&&i.sort(d||hh)}function h(){for(let u=t,d=s.length;u<d;u++){const f=s[u];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:e,transmissive:n,transparent:i,init:r,push:o,unshift:l,finish:h,sort:c}}function w2(){let s=new WeakMap;function t(n,i){const r=s.get(n);let a;return r===void 0?(a=new uh,s.set(n,[a])):i>=r.length?(a=new uh,r.push(a)):a=r[i],a}function e(){s=new WeakMap}return{get:t,dispose:e}}function A2(){const s={};return{get:function(t){if(s[t.id]!==void 0)return s[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new N,color:new jt};break;case"SpotLight":e={position:new N,direction:new N,color:new jt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new N,color:new jt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new N,skyColor:new jt,groundColor:new jt};break;case"RectAreaLight":e={color:new jt,position:new N,halfWidth:new N,halfHeight:new N};break}return s[t.id]=e,e}}}function T2(){const s={};return{get:function(t){if(s[t.id]!==void 0)return s[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Dt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Dt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Dt,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[t.id]=e,e}}}let R2=0;function C2(s,t){return(t.castShadow?2:0)-(s.castShadow?2:0)+(t.map?1:0)-(s.map?1:0)}function L2(s){const t=new A2,e=T2(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new N);const i=new N,r=new Yt,a=new Yt;function o(c){let h=0,u=0,d=0;for(let S=0;S<9;S++)n.probe[S].set(0,0,0);let f=0,m=0,_=0,g=0,p=0,E=0,b=0,M=0,I=0,C=0,P=0;c.sort(C2);for(let S=0,y=c.length;S<y;S++){const U=c[S],B=U.color,k=U.intensity,q=U.distance,K=U.shadow&&U.shadow.map?U.shadow.map.texture:null;if(U.isAmbientLight)h+=B.r*k,u+=B.g*k,d+=B.b*k;else if(U.isLightProbe){for(let z=0;z<9;z++)n.probe[z].addScaledVector(U.sh.coefficients[z],k);P++}else if(U.isDirectionalLight){const z=t.get(U);if(z.color.copy(U.color).multiplyScalar(U.intensity),U.castShadow){const tt=U.shadow,W=e.get(U);W.shadowIntensity=tt.intensity,W.shadowBias=tt.bias,W.shadowNormalBias=tt.normalBias,W.shadowRadius=tt.radius,W.shadowMapSize=tt.mapSize,n.directionalShadow[f]=W,n.directionalShadowMap[f]=K,n.directionalShadowMatrix[f]=U.shadow.matrix,E++}n.directional[f]=z,f++}else if(U.isSpotLight){const z=t.get(U);z.position.setFromMatrixPosition(U.matrixWorld),z.color.copy(B).multiplyScalar(k),z.distance=q,z.coneCos=Math.cos(U.angle),z.penumbraCos=Math.cos(U.angle*(1-U.penumbra)),z.decay=U.decay,n.spot[_]=z;const tt=U.shadow;if(U.map&&(n.spotLightMap[I]=U.map,I++,tt.updateMatrices(U),U.castShadow&&C++),n.spotLightMatrix[_]=tt.matrix,U.castShadow){const W=e.get(U);W.shadowIntensity=tt.intensity,W.shadowBias=tt.bias,W.shadowNormalBias=tt.normalBias,W.shadowRadius=tt.radius,W.shadowMapSize=tt.mapSize,n.spotShadow[_]=W,n.spotShadowMap[_]=K,M++}_++}else if(U.isRectAreaLight){const z=t.get(U);z.color.copy(B).multiplyScalar(k),z.halfWidth.set(U.width*.5,0,0),z.halfHeight.set(0,U.height*.5,0),n.rectArea[g]=z,g++}else if(U.isPointLight){const z=t.get(U);if(z.color.copy(U.color).multiplyScalar(U.intensity),z.distance=U.distance,z.decay=U.decay,U.castShadow){const tt=U.shadow,W=e.get(U);W.shadowIntensity=tt.intensity,W.shadowBias=tt.bias,W.shadowNormalBias=tt.normalBias,W.shadowRadius=tt.radius,W.shadowMapSize=tt.mapSize,W.shadowCameraNear=tt.camera.near,W.shadowCameraFar=tt.camera.far,n.pointShadow[m]=W,n.pointShadowMap[m]=K,n.pointShadowMatrix[m]=U.shadow.matrix,b++}n.point[m]=z,m++}else if(U.isHemisphereLight){const z=t.get(U);z.skyColor.copy(U.color).multiplyScalar(k),z.groundColor.copy(U.groundColor).multiplyScalar(k),n.hemi[p]=z,p++}}g>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=xt.LTC_FLOAT_1,n.rectAreaLTC2=xt.LTC_FLOAT_2):(n.rectAreaLTC1=xt.LTC_HALF_1,n.rectAreaLTC2=xt.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const D=n.hash;(D.directionalLength!==f||D.pointLength!==m||D.spotLength!==_||D.rectAreaLength!==g||D.hemiLength!==p||D.numDirectionalShadows!==E||D.numPointShadows!==b||D.numSpotShadows!==M||D.numSpotMaps!==I||D.numLightProbes!==P)&&(n.directional.length=f,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=E,n.directionalShadowMap.length=E,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=M,n.spotShadowMap.length=M,n.directionalShadowMatrix.length=E,n.pointShadowMatrix.length=b,n.spotLightMatrix.length=M+I-C,n.spotLightMap.length=I,n.numSpotLightShadowsWithMaps=C,n.numLightProbes=P,D.directionalLength=f,D.pointLength=m,D.spotLength=_,D.rectAreaLength=g,D.hemiLength=p,D.numDirectionalShadows=E,D.numPointShadows=b,D.numSpotShadows=M,D.numSpotMaps=I,D.numLightProbes=P,n.version=R2++)}function l(c,h){let u=0,d=0,f=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,E=c.length;p<E;p++){const b=c[p];if(b.isDirectionalLight){const M=n.directional[u];M.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(g),u++}else if(b.isSpotLight){const M=n.spot[f];M.position.setFromMatrixPosition(b.matrixWorld),M.position.applyMatrix4(g),M.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(g),f++}else if(b.isRectAreaLight){const M=n.rectArea[m];M.position.setFromMatrixPosition(b.matrixWorld),M.position.applyMatrix4(g),a.identity(),r.copy(b.matrixWorld),r.premultiply(g),a.extractRotation(r),M.halfWidth.set(b.width*.5,0,0),M.halfHeight.set(0,b.height*.5,0),M.halfWidth.applyMatrix4(a),M.halfHeight.applyMatrix4(a),m++}else if(b.isPointLight){const M=n.point[d];M.position.setFromMatrixPosition(b.matrixWorld),M.position.applyMatrix4(g),d++}else if(b.isHemisphereLight){const M=n.hemi[_];M.direction.setFromMatrixPosition(b.matrixWorld),M.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function dh(s){const t=new L2(s),e=[],n=[];function i(h){c.camera=h,e.length=0,n.length=0}function r(h){e.push(h)}function a(h){n.push(h)}function o(){t.setup(e)}function l(h){t.setupView(e,h)}const c={lightsArray:e,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:o,setupLightsView:l,pushLight:r,pushShadow:a}}function P2(s){let t=new WeakMap;function e(i,r=0){const a=t.get(i);let o;return a===void 0?(o=new dh(s),t.set(i,[o])):r>=a.length?(o=new dh(s),a.push(o)):o=a[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}const D2=`void main() {
3775
+ `+W)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(k===""||q==="")&&(z=!1);z&&(U.diagnostics={runnable:J,programLog:B,vertexShader:{log:k,prefix:g},fragmentShader:{log:q,prefix:f}})}i.deleteShader(I),i.deleteShader(L),D=new jr(i,_),M=U1(i,_)}let D;this.getUniforms=function(){return D===void 0&&P(this),D};let M;this.getAttributes=function(){return M===void 0&&P(this),M};let y=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=i.getProgramParameter(_,E1)),y},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=w1++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=I,this.fragmentShader=L,this}let X1=0;class q1{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return n===void 0&&(n=new j1(t),e.set(t,n)),n}}class j1{constructor(t){this.id=X1++,this.code=t,this.usedTimes=0}}function Y1(s,t,e,n,i,r,a){const o=new gl,l=new q1,c=new Set,h=[],u=i.logarithmicDepthBuffer,d=i.vertexTextures;let p=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(M){return c.add(M),M===0?"uv":`uv${M}`}function g(M,y,U,B,k){const q=B.fog,J=k.geometry,z=M.isMeshStandardMaterial?B.environment:null,tt=(M.isMeshStandardMaterial?e:t).get(M.envMap||z),W=tt&&tt.mapping===aa?tt.image.height:null,at=m[M.type];M.precision!==null&&(p=i.getMaxPrecision(M.precision),p!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",p,"instead."));const dt=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,mt=dt!==void 0?dt.length:0;let Rt=0;J.morphAttributes.position!==void 0&&(Rt=1),J.morphAttributes.normal!==void 0&&(Rt=2),J.morphAttributes.color!==void 0&&(Rt=3);let wt,X,Z,Q;if(at){const ce=hn[at];wt=ce.vertexShader,X=ce.fragmentShader}else wt=M.vertexShader,X=M.fragmentShader,l.update(M),Z=l.getVertexShaderID(M),Q=l.getFragmentShaderID(M);const et=s.getRenderTarget(),_t=s.state.buffers.depth.getReversed(),ot=k.isInstancedMesh===!0,gt=k.isBatchedMesh===!0,te=!!M.map,ee=!!M.matcap,jt=!!tt,F=!!M.aoMap,_e=!!M.lightMap,se=!!M.bumpMap,re=!!M.normalMap,Mt=!!M.displacementMap,ne=!!M.emissiveMap,yt=!!M.metalnessMap,oe=!!M.roughnessMap,Ee=M.anisotropy>0,N=M.clearcoat>0,E=M.dispersion>0,j=M.iridescence>0,st=M.sheen>0,lt=M.transmission>0,nt=Ee&&!!M.anisotropyMap,zt=N&&!!M.clearcoatMap,bt=N&&!!M.clearcoatNormalMap,Ft=N&&!!M.clearcoatRoughnessMap,Bt=j&&!!M.iridescenceMap,ct=j&&!!M.iridescenceThicknessMap,Ct=st&&!!M.sheenColorMap,Yt=st&&!!M.sheenRoughnessMap,Wt=!!M.specularMap,St=!!M.specularColorMap,ie=!!M.specularIntensityMap,V=lt&&!!M.transmissionMap,Tt=lt&&!!M.thicknessMap,ht=!!M.gradientMap,Dt=!!M.alphaMap,ft=M.alphaTest>0,rt=!!M.alphaHash,Ut=!!M.extensions;let ae=di;M.toneMapped&&(et===null||et.isXRRenderTarget===!0)&&(ae=s.toneMapping);const Le={shaderID:at,shaderType:M.type,shaderName:M.name,vertexShader:wt,fragmentShader:X,defines:M.defines,customVertexShaderID:Z,customFragmentShaderID:Q,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:p,batching:gt,batchingColor:gt&&k._colorsTexture!==null,instancing:ot,instancingColor:ot&&k.instanceColor!==null,instancingMorph:ot&&k.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:et===null?s.outputColorSpace:et.isXRRenderTarget===!0?et.texture.colorSpace:us,alphaToCoverage:!!M.alphaToCoverage,map:te,matcap:ee,envMap:jt,envMapMode:jt&&tt.mapping,envMapCubeUVHeight:W,aoMap:F,lightMap:_e,bumpMap:se,normalMap:re,displacementMap:d&&Mt,emissiveMap:ne,normalMapObjectSpace:re&&M.normalMapType===ed,normalMapTangentSpace:re&&M.normalMapType===fl,metalnessMap:yt,roughnessMap:oe,anisotropy:Ee,anisotropyMap:nt,clearcoat:N,clearcoatMap:zt,clearcoatNormalMap:bt,clearcoatRoughnessMap:Ft,dispersion:E,iridescence:j,iridescenceMap:Bt,iridescenceThicknessMap:ct,sheen:st,sheenColorMap:Ct,sheenRoughnessMap:Yt,specularMap:Wt,specularColorMap:St,specularIntensityMap:ie,transmission:lt,transmissionMap:V,thicknessMap:Tt,gradientMap:ht,opaque:M.transparent===!1&&M.blending===rs&&M.alphaToCoverage===!1,alphaMap:Dt,alphaTest:ft,alphaHash:rt,combine:M.combine,mapUv:te&&_(M.map.channel),aoMapUv:F&&_(M.aoMap.channel),lightMapUv:_e&&_(M.lightMap.channel),bumpMapUv:se&&_(M.bumpMap.channel),normalMapUv:re&&_(M.normalMap.channel),displacementMapUv:Mt&&_(M.displacementMap.channel),emissiveMapUv:ne&&_(M.emissiveMap.channel),metalnessMapUv:yt&&_(M.metalnessMap.channel),roughnessMapUv:oe&&_(M.roughnessMap.channel),anisotropyMapUv:nt&&_(M.anisotropyMap.channel),clearcoatMapUv:zt&&_(M.clearcoatMap.channel),clearcoatNormalMapUv:bt&&_(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ft&&_(M.clearcoatRoughnessMap.channel),iridescenceMapUv:Bt&&_(M.iridescenceMap.channel),iridescenceThicknessMapUv:ct&&_(M.iridescenceThicknessMap.channel),sheenColorMapUv:Ct&&_(M.sheenColorMap.channel),sheenRoughnessMapUv:Yt&&_(M.sheenRoughnessMap.channel),specularMapUv:Wt&&_(M.specularMap.channel),specularColorMapUv:St&&_(M.specularColorMap.channel),specularIntensityMapUv:ie&&_(M.specularIntensityMap.channel),transmissionMapUv:V&&_(M.transmissionMap.channel),thicknessMapUv:Tt&&_(M.thicknessMap.channel),alphaMapUv:Dt&&_(M.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(re||Ee),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,pointsUvs:k.isPoints===!0&&!!J.attributes.uv&&(te||Dt),fog:!!q,useFog:M.fog===!0,fogExp2:!!q&&q.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:_t,skinning:k.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:mt,morphTextureStride:Rt,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numSpotLightMaps:y.spotLightMap.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numSpotLightShadowsWithMaps:y.numSpotLightShadowsWithMaps,numLightProbes:y.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:M.dithering,shadowMapEnabled:s.shadowMap.enabled&&U.length>0,shadowMapType:s.shadowMap.type,toneMapping:ae,decodeVideoTexture:te&&M.map.isVideoTexture===!0&&fe.getTransfer(M.map.colorSpace)===Re,decodeVideoTextureEmissive:ne&&M.emissiveMap.isVideoTexture===!0&&fe.getTransfer(M.emissiveMap.colorSpace)===Re,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===tn,flipSided:M.side===rn,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:Ut&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ut&&M.extensions.multiDraw===!0||gt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return Le.vertexUv1s=c.has(1),Le.vertexUv2s=c.has(2),Le.vertexUv3s=c.has(3),c.clear(),Le}function f(M){const y=[];if(M.shaderID?y.push(M.shaderID):(y.push(M.customVertexShaderID),y.push(M.customFragmentShaderID)),M.defines!==void 0)for(const U in M.defines)y.push(U),y.push(M.defines[U]);return M.isRawShaderMaterial===!1&&(b(y,M),w(y,M),y.push(s.outputColorSpace)),y.push(M.customProgramCacheKey),y.join()}function b(M,y){M.push(y.precision),M.push(y.outputColorSpace),M.push(y.envMapMode),M.push(y.envMapCubeUVHeight),M.push(y.mapUv),M.push(y.alphaMapUv),M.push(y.lightMapUv),M.push(y.aoMapUv),M.push(y.bumpMapUv),M.push(y.normalMapUv),M.push(y.displacementMapUv),M.push(y.emissiveMapUv),M.push(y.metalnessMapUv),M.push(y.roughnessMapUv),M.push(y.anisotropyMapUv),M.push(y.clearcoatMapUv),M.push(y.clearcoatNormalMapUv),M.push(y.clearcoatRoughnessMapUv),M.push(y.iridescenceMapUv),M.push(y.iridescenceThicknessMapUv),M.push(y.sheenColorMapUv),M.push(y.sheenRoughnessMapUv),M.push(y.specularMapUv),M.push(y.specularColorMapUv),M.push(y.specularIntensityMapUv),M.push(y.transmissionMapUv),M.push(y.thicknessMapUv),M.push(y.combine),M.push(y.fogExp2),M.push(y.sizeAttenuation),M.push(y.morphTargetsCount),M.push(y.morphAttributeCount),M.push(y.numDirLights),M.push(y.numPointLights),M.push(y.numSpotLights),M.push(y.numSpotLightMaps),M.push(y.numHemiLights),M.push(y.numRectAreaLights),M.push(y.numDirLightShadows),M.push(y.numPointLightShadows),M.push(y.numSpotLightShadows),M.push(y.numSpotLightShadowsWithMaps),M.push(y.numLightProbes),M.push(y.shadowMapType),M.push(y.toneMapping),M.push(y.numClippingPlanes),M.push(y.numClipIntersection),M.push(y.depthPacking)}function w(M,y){o.disableAll(),y.supportsVertexTextures&&o.enable(0),y.instancing&&o.enable(1),y.instancingColor&&o.enable(2),y.instancingMorph&&o.enable(3),y.matcap&&o.enable(4),y.envMap&&o.enable(5),y.normalMapObjectSpace&&o.enable(6),y.normalMapTangentSpace&&o.enable(7),y.clearcoat&&o.enable(8),y.iridescence&&o.enable(9),y.alphaTest&&o.enable(10),y.vertexColors&&o.enable(11),y.vertexAlphas&&o.enable(12),y.vertexUv1s&&o.enable(13),y.vertexUv2s&&o.enable(14),y.vertexUv3s&&o.enable(15),y.vertexTangents&&o.enable(16),y.anisotropy&&o.enable(17),y.alphaHash&&o.enable(18),y.batching&&o.enable(19),y.dispersion&&o.enable(20),y.batchingColor&&o.enable(21),M.push(o.mask),o.disableAll(),y.fog&&o.enable(0),y.useFog&&o.enable(1),y.flatShading&&o.enable(2),y.logarithmicDepthBuffer&&o.enable(3),y.reverseDepthBuffer&&o.enable(4),y.skinning&&o.enable(5),y.morphTargets&&o.enable(6),y.morphNormals&&o.enable(7),y.morphColors&&o.enable(8),y.premultipliedAlpha&&o.enable(9),y.shadowMapEnabled&&o.enable(10),y.doubleSided&&o.enable(11),y.flipSided&&o.enable(12),y.useDepthPacking&&o.enable(13),y.dithering&&o.enable(14),y.transmission&&o.enable(15),y.sheen&&o.enable(16),y.opaque&&o.enable(17),y.pointsUvs&&o.enable(18),y.decodeVideoTexture&&o.enable(19),y.decodeVideoTextureEmissive&&o.enable(20),y.alphaToCoverage&&o.enable(21),M.push(o.mask)}function S(M){const y=m[M.type];let U;if(y){const B=hn[y];U=_l.clone(B.uniforms)}else U=M.uniforms;return U}function I(M,y){let U;for(let B=0,k=h.length;B<k;B++){const q=h[B];if(q.cacheKey===y){U=q,++U.usedTimes;break}}return U===void 0&&(U=new W1(s,y,M,r),h.push(U)),U}function L(M){if(--M.usedTimes===0){const y=h.indexOf(M);h[y]=h[h.length-1],h.pop(),M.destroy()}}function P(M){l.remove(M)}function D(){l.dispose()}return{getParameters:g,getProgramCacheKey:f,getUniforms:S,acquireProgram:I,releaseProgram:L,releaseShaderCache:P,programs:h,dispose:D}}function $1(){let s=new WeakMap;function t(a){return s.has(a)}function e(a){let o=s.get(a);return o===void 0&&(o={},s.set(a,o)),o}function n(a){s.delete(a)}function i(a,o,l){s.get(a)[o]=l}function r(){s=new WeakMap}return{has:t,get:e,remove:n,update:i,dispose:r}}function K1(s,t){return s.groupOrder!==t.groupOrder?s.groupOrder-t.groupOrder:s.renderOrder!==t.renderOrder?s.renderOrder-t.renderOrder:s.material.id!==t.material.id?s.material.id-t.material.id:s.z!==t.z?s.z-t.z:s.id-t.id}function th(s,t){return s.groupOrder!==t.groupOrder?s.groupOrder-t.groupOrder:s.renderOrder!==t.renderOrder?s.renderOrder-t.renderOrder:s.z!==t.z?t.z-s.z:s.id-t.id}function eh(){const s=[];let t=0;const e=[],n=[],i=[];function r(){t=0,e.length=0,n.length=0,i.length=0}function a(u,d,p,m,_,g){let f=s[t];return f===void 0?(f={id:u.id,object:u,geometry:d,material:p,groupOrder:m,renderOrder:u.renderOrder,z:_,group:g},s[t]=f):(f.id=u.id,f.object=u,f.geometry=d,f.material=p,f.groupOrder=m,f.renderOrder=u.renderOrder,f.z=_,f.group=g),t++,f}function o(u,d,p,m,_,g){const f=a(u,d,p,m,_,g);p.transmission>0?n.push(f):p.transparent===!0?i.push(f):e.push(f)}function l(u,d,p,m,_,g){const f=a(u,d,p,m,_,g);p.transmission>0?n.unshift(f):p.transparent===!0?i.unshift(f):e.unshift(f)}function c(u,d){e.length>1&&e.sort(u||K1),n.length>1&&n.sort(d||th),i.length>1&&i.sort(d||th)}function h(){for(let u=t,d=s.length;u<d;u++){const p=s[u];if(p.id===null)break;p.id=null,p.object=null,p.geometry=null,p.material=null,p.group=null}}return{opaque:e,transmissive:n,transparent:i,init:r,push:o,unshift:l,finish:h,sort:c}}function J1(){let s=new WeakMap;function t(n,i){const r=s.get(n);let a;return r===void 0?(a=new eh,s.set(n,[a])):i>=r.length?(a=new eh,r.push(a)):a=r[i],a}function e(){s=new WeakMap}return{get:t,dispose:e}}function Z1(){const s={};return{get:function(t){if(s[t.id]!==void 0)return s[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new O,color:new qt};break;case"SpotLight":e={position:new O,direction:new O,color:new qt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new O,color:new qt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new O,skyColor:new qt,groundColor:new qt};break;case"RectAreaLight":e={color:new qt,position:new O,halfWidth:new O,halfHeight:new O};break}return s[t.id]=e,e}}}function Q1(){const s={};return{get:function(t){if(s[t.id]!==void 0)return s[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qt};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qt};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qt,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[t.id]=e,e}}}let t2=0;function e2(s,t){return(t.castShadow?2:0)-(s.castShadow?2:0)+(t.map?1:0)-(s.map?1:0)}function n2(s){const t=new Z1,e=Q1(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new O);const i=new O,r=new Zt,a=new Zt;function o(c){let h=0,u=0,d=0;for(let M=0;M<9;M++)n.probe[M].set(0,0,0);let p=0,m=0,_=0,g=0,f=0,b=0,w=0,S=0,I=0,L=0,P=0;c.sort(e2);for(let M=0,y=c.length;M<y;M++){const U=c[M],B=U.color,k=U.intensity,q=U.distance,J=U.shadow&&U.shadow.map?U.shadow.map.texture:null;if(U.isAmbientLight)h+=B.r*k,u+=B.g*k,d+=B.b*k;else if(U.isLightProbe){for(let z=0;z<9;z++)n.probe[z].addScaledVector(U.sh.coefficients[z],k);P++}else if(U.isDirectionalLight){const z=t.get(U);if(z.color.copy(U.color).multiplyScalar(U.intensity),U.castShadow){const tt=U.shadow,W=e.get(U);W.shadowIntensity=tt.intensity,W.shadowBias=tt.bias,W.shadowNormalBias=tt.normalBias,W.shadowRadius=tt.radius,W.shadowMapSize=tt.mapSize,n.directionalShadow[p]=W,n.directionalShadowMap[p]=J,n.directionalShadowMatrix[p]=U.shadow.matrix,b++}n.directional[p]=z,p++}else if(U.isSpotLight){const z=t.get(U);z.position.setFromMatrixPosition(U.matrixWorld),z.color.copy(B).multiplyScalar(k),z.distance=q,z.coneCos=Math.cos(U.angle),z.penumbraCos=Math.cos(U.angle*(1-U.penumbra)),z.decay=U.decay,n.spot[_]=z;const tt=U.shadow;if(U.map&&(n.spotLightMap[I]=U.map,I++,tt.updateMatrices(U),U.castShadow&&L++),n.spotLightMatrix[_]=tt.matrix,U.castShadow){const W=e.get(U);W.shadowIntensity=tt.intensity,W.shadowBias=tt.bias,W.shadowNormalBias=tt.normalBias,W.shadowRadius=tt.radius,W.shadowMapSize=tt.mapSize,n.spotShadow[_]=W,n.spotShadowMap[_]=J,S++}_++}else if(U.isRectAreaLight){const z=t.get(U);z.color.copy(B).multiplyScalar(k),z.halfWidth.set(U.width*.5,0,0),z.halfHeight.set(0,U.height*.5,0),n.rectArea[g]=z,g++}else if(U.isPointLight){const z=t.get(U);if(z.color.copy(U.color).multiplyScalar(U.intensity),z.distance=U.distance,z.decay=U.decay,U.castShadow){const tt=U.shadow,W=e.get(U);W.shadowIntensity=tt.intensity,W.shadowBias=tt.bias,W.shadowNormalBias=tt.normalBias,W.shadowRadius=tt.radius,W.shadowMapSize=tt.mapSize,W.shadowCameraNear=tt.camera.near,W.shadowCameraFar=tt.camera.far,n.pointShadow[m]=W,n.pointShadowMap[m]=J,n.pointShadowMatrix[m]=U.shadow.matrix,w++}n.point[m]=z,m++}else if(U.isHemisphereLight){const z=t.get(U);z.skyColor.copy(U.color).multiplyScalar(k),z.groundColor.copy(U.groundColor).multiplyScalar(k),n.hemi[f]=z,f++}}g>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=xt.LTC_FLOAT_1,n.rectAreaLTC2=xt.LTC_FLOAT_2):(n.rectAreaLTC1=xt.LTC_HALF_1,n.rectAreaLTC2=xt.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const D=n.hash;(D.directionalLength!==p||D.pointLength!==m||D.spotLength!==_||D.rectAreaLength!==g||D.hemiLength!==f||D.numDirectionalShadows!==b||D.numPointShadows!==w||D.numSpotShadows!==S||D.numSpotMaps!==I||D.numLightProbes!==P)&&(n.directional.length=p,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=f,n.directionalShadow.length=b,n.directionalShadowMap.length=b,n.pointShadow.length=w,n.pointShadowMap.length=w,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=b,n.pointShadowMatrix.length=w,n.spotLightMatrix.length=S+I-L,n.spotLightMap.length=I,n.numSpotLightShadowsWithMaps=L,n.numLightProbes=P,D.directionalLength=p,D.pointLength=m,D.spotLength=_,D.rectAreaLength=g,D.hemiLength=f,D.numDirectionalShadows=b,D.numPointShadows=w,D.numSpotShadows=S,D.numSpotMaps=I,D.numLightProbes=P,n.version=t2++)}function l(c,h){let u=0,d=0,p=0,m=0,_=0;const g=h.matrixWorldInverse;for(let f=0,b=c.length;f<b;f++){const w=c[f];if(w.isDirectionalLight){const S=n.directional[u];S.direction.setFromMatrixPosition(w.matrixWorld),i.setFromMatrixPosition(w.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(g),u++}else if(w.isSpotLight){const S=n.spot[p];S.position.setFromMatrixPosition(w.matrixWorld),S.position.applyMatrix4(g),S.direction.setFromMatrixPosition(w.matrixWorld),i.setFromMatrixPosition(w.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(g),p++}else if(w.isRectAreaLight){const S=n.rectArea[m];S.position.setFromMatrixPosition(w.matrixWorld),S.position.applyMatrix4(g),a.identity(),r.copy(w.matrixWorld),r.premultiply(g),a.extractRotation(r),S.halfWidth.set(w.width*.5,0,0),S.halfHeight.set(0,w.height*.5,0),S.halfWidth.applyMatrix4(a),S.halfHeight.applyMatrix4(a),m++}else if(w.isPointLight){const S=n.point[d];S.position.setFromMatrixPosition(w.matrixWorld),S.position.applyMatrix4(g),d++}else if(w.isHemisphereLight){const S=n.hemi[_];S.direction.setFromMatrixPosition(w.matrixWorld),S.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function nh(s){const t=new n2(s),e=[],n=[];function i(h){c.camera=h,e.length=0,n.length=0}function r(h){e.push(h)}function a(h){n.push(h)}function o(){t.setup(e)}function l(h){t.setupView(e,h)}const c={lightsArray:e,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:o,setupLightsView:l,pushLight:r,pushShadow:a}}function i2(s){let t=new WeakMap;function e(i,r=0){const a=t.get(i);let o;return a===void 0?(o=new nh(s),t.set(i,[o])):r>=a.length?(o=new nh(s),a.push(o)):o=a[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}const s2=`void main() {
3776
3776
  gl_Position = vec4( position, 1.0 );
3777
- }`,U2=`uniform sampler2D shadow_pass;
3777
+ }`,r2=`uniform sampler2D shadow_pass;
3778
3778
  uniform vec2 resolution;
3779
3779
  uniform float radius;
3780
3780
  #include <packing>
@@ -3800,12 +3800,12 @@ void main() {
3800
3800
  squared_mean = squared_mean / samples;
3801
3801
  float std_dev = sqrt( squared_mean - mean * mean );
3802
3802
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3803
- }`;function I2(s,t,e){let n=new Rl;const i=new Dt,r=new Dt,a=new me,o=new zf({depthPacking:fd}),l=new Bf,c={},h=e.maxTextureSize,u={[Cn]:rn,[rn]:Cn,[tn]:tn},d=new ti({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Dt},radius:{value:4}},vertexShader:D2,fragmentShader:U2}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new Ie;m.setAttribute("position",new Oe(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new be(m,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=zh;let p=this.type;this.render=function(C,P,D){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||C.length===0)return;const S=s.getRenderTarget(),y=s.getActiveCubeFace(),U=s.getActiveMipmapLevel(),B=s.state;B.setBlending(di),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const k=p!==Jn&&this.type===Jn,q=p===Jn&&this.type!==Jn;for(let K=0,z=C.length;K<z;K++){const tt=C[K],W=tt.shadow;if(W===void 0){console.warn("THREE.WebGLShadowMap:",tt,"has no shadow.");continue}if(W.autoUpdate===!1&&W.needsUpdate===!1)continue;i.copy(W.mapSize);const at=W.getFrameExtents();if(i.multiply(at),r.copy(W.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/at.x),i.x=r.x*at.x,W.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/at.y),i.y=r.y*at.y,W.mapSize.y=r.y)),W.map===null||k===!0||q===!0){const mt=this.type!==Jn?{minFilter:mn,magFilter:mn}:{};W.map!==null&&W.map.dispose(),W.map=new Di(i.x,i.y,mt),W.map.texture.name=tt.name+".shadowMap",W.camera.updateProjectionMatrix()}s.setRenderTarget(W.map),s.clear();const dt=W.getViewportCount();for(let mt=0;mt<dt;mt++){const Rt=W.getViewport(mt);a.set(r.x*Rt.x,r.y*Rt.y,r.x*Rt.z,r.y*Rt.w),B.viewport(a),W.updateMatrices(tt,mt),n=W.getFrustum(),M(P,D,W.camera,tt,this.type)}W.isPointLightShadow!==!0&&this.type===Jn&&E(W,D),W.needsUpdate=!1}p=this.type,g.needsUpdate=!1,s.setRenderTarget(S,y,U)};function E(C,P){const D=t.update(_);d.defines.VSM_SAMPLES!==C.blurSamples&&(d.defines.VSM_SAMPLES=C.blurSamples,f.defines.VSM_SAMPLES=C.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),C.mapPass===null&&(C.mapPass=new Di(i.x,i.y)),d.uniforms.shadow_pass.value=C.map.texture,d.uniforms.resolution.value=C.mapSize,d.uniforms.radius.value=C.radius,s.setRenderTarget(C.mapPass),s.clear(),s.renderBufferDirect(P,null,D,d,_,null),f.uniforms.shadow_pass.value=C.mapPass.texture,f.uniforms.resolution.value=C.mapSize,f.uniforms.radius.value=C.radius,s.setRenderTarget(C.map),s.clear(),s.renderBufferDirect(P,null,D,f,_,null)}function b(C,P,D,S){let y=null;const U=D.isPointLight===!0?C.customDistanceMaterial:C.customDepthMaterial;if(U!==void 0)y=U;else if(y=D.isPointLight===!0?l:o,s.localClippingEnabled&&P.clipShadows===!0&&Array.isArray(P.clippingPlanes)&&P.clippingPlanes.length!==0||P.displacementMap&&P.displacementScale!==0||P.alphaMap&&P.alphaTest>0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const B=y.uuid,k=P.uuid;let q=c[B];q===void 0&&(q={},c[B]=q);let K=q[k];K===void 0&&(K=y.clone(),q[k]=K,P.addEventListener("dispose",I)),y=K}if(y.visible=P.visible,y.wireframe=P.wireframe,S===Jn?y.side=P.shadowSide!==null?P.shadowSide:P.side:y.side=P.shadowSide!==null?P.shadowSide:u[P.side],y.alphaMap=P.alphaMap,y.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,y.map=P.map,y.clipShadows=P.clipShadows,y.clippingPlanes=P.clippingPlanes,y.clipIntersection=P.clipIntersection,y.displacementMap=P.displacementMap,y.displacementScale=P.displacementScale,y.displacementBias=P.displacementBias,y.wireframeLinewidth=P.wireframeLinewidth,y.linewidth=P.linewidth,D.isPointLight===!0&&y.isMeshDistanceMaterial===!0){const B=s.properties.get(y);B.light=D}return y}function M(C,P,D,S,y){if(C.visible===!1)return;if(C.layers.test(P.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&y===Jn)&&(!C.frustumCulled||n.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,C.matrixWorld);const k=t.update(C),q=C.material;if(Array.isArray(q)){const K=k.groups;for(let z=0,tt=K.length;z<tt;z++){const W=K[z],at=q[W.materialIndex];if(at&&at.visible){const dt=b(C,at,S,y);C.onBeforeShadow(s,C,P,D,k,dt,W),s.renderBufferDirect(D,null,k,dt,C,W),C.onAfterShadow(s,C,P,D,k,dt,W)}}}else if(q.visible){const K=b(C,q,S,y);C.onBeforeShadow(s,C,P,D,k,K,null),s.renderBufferDirect(D,null,k,K,C,null),C.onAfterShadow(s,C,P,D,k,K,null)}}const B=C.children;for(let k=0,q=B.length;k<q;k++)M(B[k],P,D,S,y)}function I(C){C.target.removeEventListener("dispose",I);for(const D in c){const S=c[D],y=C.target.uuid;y in S&&(S[y].dispose(),delete S[y])}}}const N2={[xo]:yo,[Mo]:Eo,[So]:wo,[cs]:bo,[yo]:xo,[Eo]:Mo,[wo]:So,[bo]:cs};function F2(s,t){function e(){let V=!1;const At=new me;let ht=null;const Ut=new me(0,0,0,0);return{setMask:function(ft){ht!==ft&&!V&&(s.colorMask(ft,ft,ft,ft),ht=ft)},setLocked:function(ft){V=ft},setClear:function(ft,rt,It,ae,Le){Le===!0&&(ft*=ae,rt*=ae,It*=ae),At.set(ft,rt,It,ae),Ut.equals(At)===!1&&(s.clearColor(ft,rt,It,ae),Ut.copy(At))},reset:function(){V=!1,ht=null,Ut.set(-1,0,0,0)}}}function n(){let V=!1,At=!1,ht=null,Ut=null,ft=null;return{setReversed:function(rt){if(At!==rt){const It=t.get("EXT_clip_control");rt?It.clipControlEXT(It.LOWER_LEFT_EXT,It.ZERO_TO_ONE_EXT):It.clipControlEXT(It.LOWER_LEFT_EXT,It.NEGATIVE_ONE_TO_ONE_EXT),At=rt;const ae=ft;ft=null,this.setClear(ae)}},getReversed:function(){return At},setTest:function(rt){rt?et(s.DEPTH_TEST):_t(s.DEPTH_TEST)},setMask:function(rt){ht!==rt&&!V&&(s.depthMask(rt),ht=rt)},setFunc:function(rt){if(At&&(rt=N2[rt]),Ut!==rt){switch(rt){case xo:s.depthFunc(s.NEVER);break;case yo:s.depthFunc(s.ALWAYS);break;case Mo:s.depthFunc(s.LESS);break;case cs:s.depthFunc(s.LEQUAL);break;case So:s.depthFunc(s.EQUAL);break;case bo:s.depthFunc(s.GEQUAL);break;case Eo:s.depthFunc(s.GREATER);break;case wo:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}Ut=rt}},setLocked:function(rt){V=rt},setClear:function(rt){ft!==rt&&(At&&(rt=1-rt),s.clearDepth(rt),ft=rt)},reset:function(){V=!1,ht=null,Ut=null,ft=null,At=!1}}}function i(){let V=!1,At=null,ht=null,Ut=null,ft=null,rt=null,It=null,ae=null,Le=null;return{setTest:function(he){V||(he?et(s.STENCIL_TEST):_t(s.STENCIL_TEST))},setMask:function(he){At!==he&&!V&&(s.stencilMask(he),At=he)},setFunc:function(he,an,Sn){(ht!==he||Ut!==an||ft!==Sn)&&(s.stencilFunc(he,an,Sn),ht=he,Ut=an,ft=Sn)},setOp:function(he,an,Sn){(rt!==he||It!==an||ae!==Sn)&&(s.stencilOp(he,an,Sn),rt=he,It=an,ae=Sn)},setLocked:function(he){V=he},setClear:function(he){Le!==he&&(s.clearStencil(he),Le=he)},reset:function(){V=!1,At=null,ht=null,Ut=null,ft=null,rt=null,It=null,ae=null,Le=null}}}const r=new e,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,E=null,b=null,M=null,I=null,C=null,P=new jt(0,0,0),D=0,S=!1,y=null,U=null,B=null,k=null,q=null;const K=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let z=!1,tt=0;const W=s.getParameter(s.VERSION);W.indexOf("WebGL")!==-1?(tt=parseFloat(/^WebGL (\d)/.exec(W)[1]),z=tt>=1):W.indexOf("OpenGL ES")!==-1&&(tt=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),z=tt>=2);let at=null,dt={};const mt=s.getParameter(s.SCISSOR_BOX),Rt=s.getParameter(s.VIEWPORT),wt=new me().fromArray(mt),X=new me().fromArray(Rt);function Z(V,At,ht,Ut){const ft=new Uint8Array(4),rt=s.createTexture();s.bindTexture(V,rt),s.texParameteri(V,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(V,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let It=0;It<ht;It++)V===s.TEXTURE_3D||V===s.TEXTURE_2D_ARRAY?s.texImage3D(At,0,s.RGBA,1,1,Ut,0,s.RGBA,s.UNSIGNED_BYTE,ft):s.texImage2D(At+It,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,ft);return rt}const Q={};Q[s.TEXTURE_2D]=Z(s.TEXTURE_2D,s.TEXTURE_2D,1),Q[s.TEXTURE_CUBE_MAP]=Z(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),Q[s.TEXTURE_2D_ARRAY]=Z(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),Q[s.TEXTURE_3D]=Z(s.TEXTURE_3D,s.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),et(s.DEPTH_TEST),a.setFunc(cs),se(!1),re(Hl),et(s.CULL_FACE),O(di);function et(V){h[V]!==!0&&(s.enable(V),h[V]=!0)}function _t(V){h[V]!==!1&&(s.disable(V),h[V]=!1)}function ot(V,At){return u[V]!==At?(s.bindFramebuffer(V,At),u[V]=At,V===s.DRAW_FRAMEBUFFER&&(u[s.FRAMEBUFFER]=At),V===s.FRAMEBUFFER&&(u[s.DRAW_FRAMEBUFFER]=At),!0):!1}function gt(V,At){let ht=f,Ut=!1;if(V){ht=d.get(At),ht===void 0&&(ht=[],d.set(At,ht));const ft=V.textures;if(ht.length!==ft.length||ht[0]!==s.COLOR_ATTACHMENT0){for(let rt=0,It=ft.length;rt<It;rt++)ht[rt]=s.COLOR_ATTACHMENT0+rt;ht.length=ft.length,Ut=!0}}else ht[0]!==s.BACK&&(ht[0]=s.BACK,Ut=!0);Ut&&s.drawBuffers(ht)}function te(V){return m!==V?(s.useProgram(V),m=V,!0):!1}const ee={[Ai]:s.FUNC_ADD,[zu]:s.FUNC_SUBTRACT,[Bu]:s.FUNC_REVERSE_SUBTRACT};ee[ku]=s.MIN,ee[Vu]=s.MAX;const Jt={[Hu]:s.ZERO,[Gu]:s.ONE,[Wu]:s.SRC_COLOR,[_o]:s.SRC_ALPHA,[$u]:s.SRC_ALPHA_SATURATE,[Yu]:s.DST_COLOR,[qu]:s.DST_ALPHA,[Xu]:s.ONE_MINUS_SRC_COLOR,[vo]:s.ONE_MINUS_SRC_ALPHA,[Ju]:s.ONE_MINUS_DST_COLOR,[ju]:s.ONE_MINUS_DST_ALPHA,[Ku]:s.CONSTANT_COLOR,[Zu]:s.ONE_MINUS_CONSTANT_COLOR,[Qu]:s.CONSTANT_ALPHA,[td]:s.ONE_MINUS_CONSTANT_ALPHA};function O(V,At,ht,Ut,ft,rt,It,ae,Le,he){if(V===di){_===!0&&(_t(s.BLEND),_=!1);return}if(_===!1&&(et(s.BLEND),_=!0),V!==Ou){if(V!==g||he!==S){if((p!==Ai||M!==Ai)&&(s.blendEquation(s.FUNC_ADD),p=Ai,M=Ai),he)switch(V){case as:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Gl:s.blendFunc(s.ONE,s.ONE);break;case Wl:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Xl:s.blendFuncSeparate(s.ZERO,s.SRC_COLOR,s.ZERO,s.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",V);break}else switch(V){case as:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Gl:s.blendFunc(s.SRC_ALPHA,s.ONE);break;case Wl:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Xl:s.blendFunc(s.ZERO,s.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",V);break}E=null,b=null,I=null,C=null,P.set(0,0,0),D=0,g=V,S=he}return}ft=ft||At,rt=rt||ht,It=It||Ut,(At!==p||ft!==M)&&(s.blendEquationSeparate(ee[At],ee[ft]),p=At,M=ft),(ht!==E||Ut!==b||rt!==I||It!==C)&&(s.blendFuncSeparate(Jt[ht],Jt[Ut],Jt[rt],Jt[It]),E=ht,b=Ut,I=rt,C=It),(ae.equals(P)===!1||Le!==D)&&(s.blendColor(ae.r,ae.g,ae.b,Le),P.copy(ae),D=Le),g=V,S=!1}function _e(V,At){V.side===tn?_t(s.CULL_FACE):et(s.CULL_FACE);let ht=V.side===rn;At&&(ht=!ht),se(ht),V.blending===as&&V.transparent===!1?O(di):O(V.blending,V.blendEquation,V.blendSrc,V.blendDst,V.blendEquationAlpha,V.blendSrcAlpha,V.blendDstAlpha,V.blendColor,V.blendAlpha,V.premultipliedAlpha),a.setFunc(V.depthFunc),a.setTest(V.depthTest),a.setMask(V.depthWrite),r.setMask(V.colorWrite);const Ut=V.stencilWrite;o.setTest(Ut),Ut&&(o.setMask(V.stencilWriteMask),o.setFunc(V.stencilFunc,V.stencilRef,V.stencilFuncMask),o.setOp(V.stencilFail,V.stencilZFail,V.stencilZPass)),ne(V.polygonOffset,V.polygonOffsetFactor,V.polygonOffsetUnits),V.alphaToCoverage===!0?et(s.SAMPLE_ALPHA_TO_COVERAGE):_t(s.SAMPLE_ALPHA_TO_COVERAGE)}function se(V){y!==V&&(V?s.frontFace(s.CW):s.frontFace(s.CCW),y=V)}function re(V){V!==Nu?(et(s.CULL_FACE),V!==U&&(V===Hl?s.cullFace(s.BACK):V===Fu?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):_t(s.CULL_FACE),U=V}function Mt(V){V!==B&&(z&&s.lineWidth(V),B=V)}function ne(V,At,ht){V?(et(s.POLYGON_OFFSET_FILL),(k!==At||q!==ht)&&(s.polygonOffset(At,ht),k=At,q=ht)):_t(s.POLYGON_OFFSET_FILL)}function yt(V){V?et(s.SCISSOR_TEST):_t(s.SCISSOR_TEST)}function oe(V){V===void 0&&(V=s.TEXTURE0+K-1),at!==V&&(s.activeTexture(V),at=V)}function Ee(V,At,ht){ht===void 0&&(at===null?ht=s.TEXTURE0+K-1:ht=at);let Ut=dt[ht];Ut===void 0&&(Ut={type:void 0,texture:void 0},dt[ht]=Ut),(Ut.type!==V||Ut.texture!==At)&&(at!==ht&&(s.activeTexture(ht),at=ht),s.bindTexture(V,At||Q[V]),Ut.type=V,Ut.texture=At)}function F(){const V=dt[at];V!==void 0&&V.type!==void 0&&(s.bindTexture(V.type,null),V.type=void 0,V.texture=void 0)}function w(){try{s.compressedTexImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function j(){try{s.compressedTexImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function st(){try{s.texSubImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function lt(){try{s.texSubImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function nt(){try{s.compressedTexSubImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Bt(){try{s.compressedTexSubImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function bt(){try{s.texStorage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Ot(){try{s.texStorage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function kt(){try{s.texImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function ct(){try{s.texImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Ct(V){wt.equals(V)===!1&&(s.scissor(V.x,V.y,V.z,V.w),wt.copy(V))}function $t(V){X.equals(V)===!1&&(s.viewport(V.x,V.y,V.z,V.w),X.copy(V))}function Xt(V,At){let ht=c.get(At);ht===void 0&&(ht=new WeakMap,c.set(At,ht));let Ut=ht.get(V);Ut===void 0&&(Ut=s.getUniformBlockIndex(At,V.name),ht.set(V,Ut))}function St(V,At){const Ut=c.get(At).get(V);l.get(At)!==Ut&&(s.uniformBlockBinding(At,Ut,V.__bindingPointIndex),l.set(At,Ut))}function ie(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),a.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),h={},at=null,dt={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,E=null,b=null,M=null,I=null,C=null,P=new jt(0,0,0),D=0,S=!1,y=null,U=null,B=null,k=null,q=null,wt.set(0,0,s.canvas.width,s.canvas.height),X.set(0,0,s.canvas.width,s.canvas.height),r.reset(),a.reset(),o.reset()}return{buffers:{color:r,depth:a,stencil:o},enable:et,disable:_t,bindFramebuffer:ot,drawBuffers:gt,useProgram:te,setBlending:O,setMaterial:_e,setFlipSided:se,setCullFace:re,setLineWidth:Mt,setPolygonOffset:ne,setScissorTest:yt,activeTexture:oe,bindTexture:Ee,unbindTexture:F,compressedTexImage2D:w,compressedTexImage3D:j,texImage2D:kt,texImage3D:ct,updateUBOMapping:Xt,uniformBlockBinding:St,texStorage2D:bt,texStorage3D:Ot,texSubImage2D:st,texSubImage3D:lt,compressedTexSubImage2D:nt,compressedTexSubImage3D:Bt,scissor:Ct,viewport:$t,reset:ie}}function O2(s,t,e,n,i,r,a){const o=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Dt,h=new WeakMap;let u;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(F,w){return f?new OffscreenCanvas(F,w):Xs("canvas")}function _(F,w,j){let st=1;const lt=Ee(F);if((lt.width>j||lt.height>j)&&(st=j/Math.max(lt.width,lt.height)),st<1)if(typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&F instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&F instanceof ImageBitmap||typeof VideoFrame<"u"&&F instanceof VideoFrame){const nt=Math.floor(st*lt.width),Bt=Math.floor(st*lt.height);u===void 0&&(u=m(nt,Bt));const bt=w?m(nt,Bt):u;return bt.width=nt,bt.height=Bt,bt.getContext("2d").drawImage(F,0,0,nt,Bt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+lt.width+"x"+lt.height+") to ("+nt+"x"+Bt+")."),bt}else return"data"in F&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+lt.width+"x"+lt.height+")."),F;return F}function g(F){return F.generateMipmaps}function p(F){s.generateMipmap(F)}function E(F){return F.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:F.isWebGL3DRenderTarget?s.TEXTURE_3D:F.isWebGLArrayRenderTarget||F.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function b(F,w,j,st,lt=!1){if(F!==null){if(s[F]!==void 0)return s[F];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+F+"'")}let nt=w;if(w===s.RED&&(j===s.FLOAT&&(nt=s.R32F),j===s.HALF_FLOAT&&(nt=s.R16F),j===s.UNSIGNED_BYTE&&(nt=s.R8)),w===s.RED_INTEGER&&(j===s.UNSIGNED_BYTE&&(nt=s.R8UI),j===s.UNSIGNED_SHORT&&(nt=s.R16UI),j===s.UNSIGNED_INT&&(nt=s.R32UI),j===s.BYTE&&(nt=s.R8I),j===s.SHORT&&(nt=s.R16I),j===s.INT&&(nt=s.R32I)),w===s.RG&&(j===s.FLOAT&&(nt=s.RG32F),j===s.HALF_FLOAT&&(nt=s.RG16F),j===s.UNSIGNED_BYTE&&(nt=s.RG8)),w===s.RG_INTEGER&&(j===s.UNSIGNED_BYTE&&(nt=s.RG8UI),j===s.UNSIGNED_SHORT&&(nt=s.RG16UI),j===s.UNSIGNED_INT&&(nt=s.RG32UI),j===s.BYTE&&(nt=s.RG8I),j===s.SHORT&&(nt=s.RG16I),j===s.INT&&(nt=s.RG32I)),w===s.RGB_INTEGER&&(j===s.UNSIGNED_BYTE&&(nt=s.RGB8UI),j===s.UNSIGNED_SHORT&&(nt=s.RGB16UI),j===s.UNSIGNED_INT&&(nt=s.RGB32UI),j===s.BYTE&&(nt=s.RGB8I),j===s.SHORT&&(nt=s.RGB16I),j===s.INT&&(nt=s.RGB32I)),w===s.RGBA_INTEGER&&(j===s.UNSIGNED_BYTE&&(nt=s.RGBA8UI),j===s.UNSIGNED_SHORT&&(nt=s.RGBA16UI),j===s.UNSIGNED_INT&&(nt=s.RGBA32UI),j===s.BYTE&&(nt=s.RGBA8I),j===s.SHORT&&(nt=s.RGBA16I),j===s.INT&&(nt=s.RGBA32I)),w===s.RGB&&j===s.UNSIGNED_INT_5_9_9_9_REV&&(nt=s.RGB9_E5),w===s.RGBA){const Bt=lt?na:pe.getTransfer(st);j===s.FLOAT&&(nt=s.RGBA32F),j===s.HALF_FLOAT&&(nt=s.RGBA16F),j===s.UNSIGNED_BYTE&&(nt=Bt===Re?s.SRGB8_ALPHA8:s.RGBA8),j===s.UNSIGNED_SHORT_4_4_4_4&&(nt=s.RGBA4),j===s.UNSIGNED_SHORT_5_5_5_1&&(nt=s.RGB5_A1)}return(nt===s.R16F||nt===s.R32F||nt===s.RG16F||nt===s.RG32F||nt===s.RGBA16F||nt===s.RGBA32F)&&t.get("EXT_color_buffer_float"),nt}function M(F,w){let j;return F?w===null||w===Pi||w===Hs?j=s.DEPTH24_STENCIL8:w===Fn?j=s.DEPTH32F_STENCIL8:w===Vs&&(j=s.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):w===null||w===Pi||w===Hs?j=s.DEPTH_COMPONENT24:w===Fn?j=s.DEPTH_COMPONENT32F:w===Vs&&(j=s.DEPTH_COMPONENT16),j}function I(F,w){return g(F)===!0||F.isFramebufferTexture&&F.minFilter!==mn&&F.minFilter!==pn?Math.log2(Math.max(w.width,w.height))+1:F.mipmaps!==void 0&&F.mipmaps.length>0?F.mipmaps.length:F.isCompressedTexture&&Array.isArray(F.image)?w.mipmaps.length:1}function C(F){const w=F.target;w.removeEventListener("dispose",C),D(w),w.isVideoTexture&&h.delete(w)}function P(F){const w=F.target;w.removeEventListener("dispose",P),y(w)}function D(F){const w=n.get(F);if(w.__webglInit===void 0)return;const j=F.source,st=d.get(j);if(st){const lt=st[w.__cacheKey];lt.usedTimes--,lt.usedTimes===0&&S(F),Object.keys(st).length===0&&d.delete(j)}n.remove(F)}function S(F){const w=n.get(F);s.deleteTexture(w.__webglTexture);const j=F.source,st=d.get(j);delete st[w.__cacheKey],a.memory.textures--}function y(F){const w=n.get(F);if(F.depthTexture&&(F.depthTexture.dispose(),n.remove(F.depthTexture)),F.isWebGLCubeRenderTarget)for(let st=0;st<6;st++){if(Array.isArray(w.__webglFramebuffer[st]))for(let lt=0;lt<w.__webglFramebuffer[st].length;lt++)s.deleteFramebuffer(w.__webglFramebuffer[st][lt]);else s.deleteFramebuffer(w.__webglFramebuffer[st]);w.__webglDepthbuffer&&s.deleteRenderbuffer(w.__webglDepthbuffer[st])}else{if(Array.isArray(w.__webglFramebuffer))for(let st=0;st<w.__webglFramebuffer.length;st++)s.deleteFramebuffer(w.__webglFramebuffer[st]);else s.deleteFramebuffer(w.__webglFramebuffer);if(w.__webglDepthbuffer&&s.deleteRenderbuffer(w.__webglDepthbuffer),w.__webglMultisampledFramebuffer&&s.deleteFramebuffer(w.__webglMultisampledFramebuffer),w.__webglColorRenderbuffer)for(let st=0;st<w.__webglColorRenderbuffer.length;st++)w.__webglColorRenderbuffer[st]&&s.deleteRenderbuffer(w.__webglColorRenderbuffer[st]);w.__webglDepthRenderbuffer&&s.deleteRenderbuffer(w.__webglDepthRenderbuffer)}const j=F.textures;for(let st=0,lt=j.length;st<lt;st++){const nt=n.get(j[st]);nt.__webglTexture&&(s.deleteTexture(nt.__webglTexture),a.memory.textures--),n.remove(j[st])}n.remove(F)}let U=0;function B(){U=0}function k(){const F=U;return F>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+F+" texture units while this GPU supports only "+i.maxTextures),U+=1,F}function q(F){const w=[];return w.push(F.wrapS),w.push(F.wrapT),w.push(F.wrapR||0),w.push(F.magFilter),w.push(F.minFilter),w.push(F.anisotropy),w.push(F.internalFormat),w.push(F.format),w.push(F.type),w.push(F.generateMipmaps),w.push(F.premultiplyAlpha),w.push(F.flipY),w.push(F.unpackAlignment),w.push(F.colorSpace),w.join()}function K(F,w){const j=n.get(F);if(F.isVideoTexture&&yt(F),F.isRenderTargetTexture===!1&&F.version>0&&j.__version!==F.version){const st=F.image;if(st===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(st.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Q(j,F,w);return}}e.bindTexture(s.TEXTURE_2D,j.__webglTexture,s.TEXTURE0+w)}function z(F,w){const j=n.get(F);if(F.version>0&&j.__version!==F.version){Q(j,F,w);return}e.bindTexture(s.TEXTURE_2D_ARRAY,j.__webglTexture,s.TEXTURE0+w)}function tt(F,w){const j=n.get(F);if(F.version>0&&j.__version!==F.version){Q(j,F,w);return}e.bindTexture(s.TEXTURE_3D,j.__webglTexture,s.TEXTURE0+w)}function W(F,w){const j=n.get(F);if(F.version>0&&j.__version!==F.version){et(j,F,w);return}e.bindTexture(s.TEXTURE_CUBE_MAP,j.__webglTexture,s.TEXTURE0+w)}const at={[Nn]:s.REPEAT,[Tn]:s.CLAMP_TO_EDGE,[Ro]:s.MIRRORED_REPEAT},dt={[mn]:s.NEAREST,[hd]:s.NEAREST_MIPMAP_NEAREST,[ir]:s.NEAREST_MIPMAP_LINEAR,[pn]:s.LINEAR,[ba]:s.LINEAR_MIPMAP_NEAREST,[$n]:s.LINEAR_MIPMAP_LINEAR},mt={[md]:s.NEVER,[Md]:s.ALWAYS,[gd]:s.LESS,[$h]:s.LEQUAL,[_d]:s.EQUAL,[yd]:s.GEQUAL,[vd]:s.GREATER,[xd]:s.NOTEQUAL};function Rt(F,w){if(w.type===Fn&&t.has("OES_texture_float_linear")===!1&&(w.magFilter===pn||w.magFilter===ba||w.magFilter===ir||w.magFilter===$n||w.minFilter===pn||w.minFilter===ba||w.minFilter===ir||w.minFilter===$n)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(F,s.TEXTURE_WRAP_S,at[w.wrapS]),s.texParameteri(F,s.TEXTURE_WRAP_T,at[w.wrapT]),(F===s.TEXTURE_3D||F===s.TEXTURE_2D_ARRAY)&&s.texParameteri(F,s.TEXTURE_WRAP_R,at[w.wrapR]),s.texParameteri(F,s.TEXTURE_MAG_FILTER,dt[w.magFilter]),s.texParameteri(F,s.TEXTURE_MIN_FILTER,dt[w.minFilter]),w.compareFunction&&(s.texParameteri(F,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(F,s.TEXTURE_COMPARE_FUNC,mt[w.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(w.magFilter===mn||w.minFilter!==ir&&w.minFilter!==$n||w.type===Fn&&t.has("OES_texture_float_linear")===!1)return;if(w.anisotropy>1||n.get(w).__currentAnisotropy){const j=t.get("EXT_texture_filter_anisotropic");s.texParameterf(F,j.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,i.getMaxAnisotropy())),n.get(w).__currentAnisotropy=w.anisotropy}}}function wt(F,w){let j=!1;F.__webglInit===void 0&&(F.__webglInit=!0,w.addEventListener("dispose",C));const st=w.source;let lt=d.get(st);lt===void 0&&(lt={},d.set(st,lt));const nt=q(w);if(nt!==F.__cacheKey){lt[nt]===void 0&&(lt[nt]={texture:s.createTexture(),usedTimes:0},a.memory.textures++,j=!0),lt[nt].usedTimes++;const Bt=lt[F.__cacheKey];Bt!==void 0&&(lt[F.__cacheKey].usedTimes--,Bt.usedTimes===0&&S(w)),F.__cacheKey=nt,F.__webglTexture=lt[nt].texture}return j}function X(F,w,j){return Math.floor(Math.floor(F/j)/w)}function Z(F,w,j,st){const nt=F.updateRanges;if(nt.length===0)e.texSubImage2D(s.TEXTURE_2D,0,0,0,w.width,w.height,j,st,w.data);else{nt.sort((ct,Ct)=>ct.start-Ct.start);let Bt=0;for(let ct=1;ct<nt.length;ct++){const Ct=nt[Bt],$t=nt[ct],Xt=Ct.start+Ct.count,St=X($t.start,w.width,4),ie=X(Ct.start,w.width,4);$t.start<=Xt+1&&St===ie&&X($t.start+$t.count-1,w.width,4)===St?Ct.count=Math.max(Ct.count,$t.start+$t.count-Ct.start):(++Bt,nt[Bt]=$t)}nt.length=Bt+1;const bt=s.getParameter(s.UNPACK_ROW_LENGTH),Ot=s.getParameter(s.UNPACK_SKIP_PIXELS),kt=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,w.width);for(let ct=0,Ct=nt.length;ct<Ct;ct++){const $t=nt[ct],Xt=Math.floor($t.start/4),St=Math.ceil($t.count/4),ie=Xt%w.width,V=Math.floor(Xt/w.width),At=St,ht=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,ie),s.pixelStorei(s.UNPACK_SKIP_ROWS,V),e.texSubImage2D(s.TEXTURE_2D,0,ie,V,At,ht,j,st,w.data)}F.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,bt),s.pixelStorei(s.UNPACK_SKIP_PIXELS,Ot),s.pixelStorei(s.UNPACK_SKIP_ROWS,kt)}}function Q(F,w,j){let st=s.TEXTURE_2D;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&(st=s.TEXTURE_2D_ARRAY),w.isData3DTexture&&(st=s.TEXTURE_3D);const lt=wt(F,w),nt=w.source;e.bindTexture(st,F.__webglTexture,s.TEXTURE0+j);const Bt=n.get(nt);if(nt.version!==Bt.__version||lt===!0){e.activeTexture(s.TEXTURE0+j);const bt=pe.getPrimaries(pe.workingColorSpace),Ot=w.colorSpace===ui?null:pe.getPrimaries(w.colorSpace),kt=w.colorSpace===ui||bt===Ot?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,w.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,w.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,kt);let ct=_(w.image,!1,i.maxTextureSize);ct=oe(w,ct);const Ct=r.convert(w.format,w.colorSpace),$t=r.convert(w.type);let Xt=b(w.internalFormat,Ct,$t,w.colorSpace,w.isVideoTexture);Rt(st,w);let St;const ie=w.mipmaps,V=w.isVideoTexture!==!0,At=Bt.__version===void 0||lt===!0,ht=nt.dataReady,Ut=I(w,ct);if(w.isDepthTexture)Xt=M(w.format===Ws,w.type),At&&(V?e.texStorage2D(s.TEXTURE_2D,1,Xt,ct.width,ct.height):e.texImage2D(s.TEXTURE_2D,0,Xt,ct.width,ct.height,0,Ct,$t,null));else if(w.isDataTexture)if(ie.length>0){V&&At&&e.texStorage2D(s.TEXTURE_2D,Ut,Xt,ie[0].width,ie[0].height);for(let ft=0,rt=ie.length;ft<rt;ft++)St=ie[ft],V?ht&&e.texSubImage2D(s.TEXTURE_2D,ft,0,0,St.width,St.height,Ct,$t,St.data):e.texImage2D(s.TEXTURE_2D,ft,Xt,St.width,St.height,0,Ct,$t,St.data);w.generateMipmaps=!1}else V?(At&&e.texStorage2D(s.TEXTURE_2D,Ut,Xt,ct.width,ct.height),ht&&Z(w,ct,Ct,$t)):e.texImage2D(s.TEXTURE_2D,0,Xt,ct.width,ct.height,0,Ct,$t,ct.data);else if(w.isCompressedTexture)if(w.isCompressedArrayTexture){V&&At&&e.texStorage3D(s.TEXTURE_2D_ARRAY,Ut,Xt,ie[0].width,ie[0].height,ct.depth);for(let ft=0,rt=ie.length;ft<rt;ft++)if(St=ie[ft],w.format!==yn)if(Ct!==null)if(V){if(ht)if(w.layerUpdates.size>0){const It=Hc(St.width,St.height,w.format,w.type);for(const ae of w.layerUpdates){const Le=St.data.subarray(ae*It/St.data.BYTES_PER_ELEMENT,(ae+1)*It/St.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,ft,0,0,ae,St.width,St.height,1,Ct,Le)}w.clearLayerUpdates()}else e.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,ft,0,0,0,St.width,St.height,ct.depth,Ct,St.data)}else e.compressedTexImage3D(s.TEXTURE_2D_ARRAY,ft,Xt,St.width,St.height,ct.depth,0,St.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else V?ht&&e.texSubImage3D(s.TEXTURE_2D_ARRAY,ft,0,0,0,St.width,St.height,ct.depth,Ct,$t,St.data):e.texImage3D(s.TEXTURE_2D_ARRAY,ft,Xt,St.width,St.height,ct.depth,0,Ct,$t,St.data)}else{V&&At&&e.texStorage2D(s.TEXTURE_2D,Ut,Xt,ie[0].width,ie[0].height);for(let ft=0,rt=ie.length;ft<rt;ft++)St=ie[ft],w.format!==yn?Ct!==null?V?ht&&e.compressedTexSubImage2D(s.TEXTURE_2D,ft,0,0,St.width,St.height,Ct,St.data):e.compressedTexImage2D(s.TEXTURE_2D,ft,Xt,St.width,St.height,0,St.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):V?ht&&e.texSubImage2D(s.TEXTURE_2D,ft,0,0,St.width,St.height,Ct,$t,St.data):e.texImage2D(s.TEXTURE_2D,ft,Xt,St.width,St.height,0,Ct,$t,St.data)}else if(w.isDataArrayTexture)if(V){if(At&&e.texStorage3D(s.TEXTURE_2D_ARRAY,Ut,Xt,ct.width,ct.height,ct.depth),ht)if(w.layerUpdates.size>0){const ft=Hc(ct.width,ct.height,w.format,w.type);for(const rt of w.layerUpdates){const It=ct.data.subarray(rt*ft/ct.data.BYTES_PER_ELEMENT,(rt+1)*ft/ct.data.BYTES_PER_ELEMENT);e.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,rt,ct.width,ct.height,1,Ct,$t,It)}w.clearLayerUpdates()}else e.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,ct.width,ct.height,ct.depth,Ct,$t,ct.data)}else e.texImage3D(s.TEXTURE_2D_ARRAY,0,Xt,ct.width,ct.height,ct.depth,0,Ct,$t,ct.data);else if(w.isData3DTexture)V?(At&&e.texStorage3D(s.TEXTURE_3D,Ut,Xt,ct.width,ct.height,ct.depth),ht&&e.texSubImage3D(s.TEXTURE_3D,0,0,0,0,ct.width,ct.height,ct.depth,Ct,$t,ct.data)):e.texImage3D(s.TEXTURE_3D,0,Xt,ct.width,ct.height,ct.depth,0,Ct,$t,ct.data);else if(w.isFramebufferTexture){if(At)if(V)e.texStorage2D(s.TEXTURE_2D,Ut,Xt,ct.width,ct.height);else{let ft=ct.width,rt=ct.height;for(let It=0;It<Ut;It++)e.texImage2D(s.TEXTURE_2D,It,Xt,ft,rt,0,Ct,$t,null),ft>>=1,rt>>=1}}else if(ie.length>0){if(V&&At){const ft=Ee(ie[0]);e.texStorage2D(s.TEXTURE_2D,Ut,Xt,ft.width,ft.height)}for(let ft=0,rt=ie.length;ft<rt;ft++)St=ie[ft],V?ht&&e.texSubImage2D(s.TEXTURE_2D,ft,0,0,Ct,$t,St):e.texImage2D(s.TEXTURE_2D,ft,Xt,Ct,$t,St);w.generateMipmaps=!1}else if(V){if(At){const ft=Ee(ct);e.texStorage2D(s.TEXTURE_2D,Ut,Xt,ft.width,ft.height)}ht&&e.texSubImage2D(s.TEXTURE_2D,0,0,0,Ct,$t,ct)}else e.texImage2D(s.TEXTURE_2D,0,Xt,Ct,$t,ct);g(w)&&p(st),Bt.__version=nt.version,w.onUpdate&&w.onUpdate(w)}F.__version=w.version}function et(F,w,j){if(w.image.length!==6)return;const st=wt(F,w),lt=w.source;e.bindTexture(s.TEXTURE_CUBE_MAP,F.__webglTexture,s.TEXTURE0+j);const nt=n.get(lt);if(lt.version!==nt.__version||st===!0){e.activeTexture(s.TEXTURE0+j);const Bt=pe.getPrimaries(pe.workingColorSpace),bt=w.colorSpace===ui?null:pe.getPrimaries(w.colorSpace),Ot=w.colorSpace===ui||Bt===bt?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,w.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,w.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ot);const kt=w.isCompressedTexture||w.image[0].isCompressedTexture,ct=w.image[0]&&w.image[0].isDataTexture,Ct=[];for(let rt=0;rt<6;rt++)!kt&&!ct?Ct[rt]=_(w.image[rt],!0,i.maxCubemapSize):Ct[rt]=ct?w.image[rt].image:w.image[rt],Ct[rt]=oe(w,Ct[rt]);const $t=Ct[0],Xt=r.convert(w.format,w.colorSpace),St=r.convert(w.type),ie=b(w.internalFormat,Xt,St,w.colorSpace),V=w.isVideoTexture!==!0,At=nt.__version===void 0||st===!0,ht=lt.dataReady;let Ut=I(w,$t);Rt(s.TEXTURE_CUBE_MAP,w);let ft;if(kt){V&&At&&e.texStorage2D(s.TEXTURE_CUBE_MAP,Ut,ie,$t.width,$t.height);for(let rt=0;rt<6;rt++){ft=Ct[rt].mipmaps;for(let It=0;It<ft.length;It++){const ae=ft[It];w.format!==yn?Xt!==null?V?ht&&e.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,It,0,0,ae.width,ae.height,Xt,ae.data):e.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,It,ie,ae.width,ae.height,0,ae.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,It,0,0,ae.width,ae.height,Xt,St,ae.data):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,It,ie,ae.width,ae.height,0,Xt,St,ae.data)}}}else{if(ft=w.mipmaps,V&&At){ft.length>0&&Ut++;const rt=Ee(Ct[0]);e.texStorage2D(s.TEXTURE_CUBE_MAP,Ut,ie,rt.width,rt.height)}for(let rt=0;rt<6;rt++)if(ct){V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0,0,0,Ct[rt].width,Ct[rt].height,Xt,St,Ct[rt].data):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0,ie,Ct[rt].width,Ct[rt].height,0,Xt,St,Ct[rt].data);for(let It=0;It<ft.length;It++){const Le=ft[It].image[rt].image;V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,It+1,0,0,Le.width,Le.height,Xt,St,Le.data):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,It+1,ie,Le.width,Le.height,0,Xt,St,Le.data)}}else{V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0,0,0,Xt,St,Ct[rt]):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0,ie,Xt,St,Ct[rt]);for(let It=0;It<ft.length;It++){const ae=ft[It];V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,It+1,0,0,Xt,St,ae.image[rt]):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,It+1,ie,Xt,St,ae.image[rt])}}}g(w)&&p(s.TEXTURE_CUBE_MAP),nt.__version=lt.version,w.onUpdate&&w.onUpdate(w)}F.__version=w.version}function _t(F,w,j,st,lt,nt){const Bt=r.convert(j.format,j.colorSpace),bt=r.convert(j.type),Ot=b(j.internalFormat,Bt,bt,j.colorSpace),kt=n.get(w),ct=n.get(j);if(ct.__renderTarget=w,!kt.__hasExternalTextures){const Ct=Math.max(1,w.width>>nt),$t=Math.max(1,w.height>>nt);lt===s.TEXTURE_3D||lt===s.TEXTURE_2D_ARRAY?e.texImage3D(lt,nt,Ot,Ct,$t,w.depth,0,Bt,bt,null):e.texImage2D(lt,nt,Ot,Ct,$t,0,Bt,bt,null)}e.bindFramebuffer(s.FRAMEBUFFER,F),ne(w)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,st,lt,ct.__webglTexture,0,Mt(w)):(lt===s.TEXTURE_2D||lt>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&lt<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,st,lt,ct.__webglTexture,nt),e.bindFramebuffer(s.FRAMEBUFFER,null)}function ot(F,w,j){if(s.bindRenderbuffer(s.RENDERBUFFER,F),w.depthBuffer){const st=w.depthTexture,lt=st&&st.isDepthTexture?st.type:null,nt=M(w.stencilBuffer,lt),Bt=w.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,bt=Mt(w);ne(w)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,bt,nt,w.width,w.height):j?s.renderbufferStorageMultisample(s.RENDERBUFFER,bt,nt,w.width,w.height):s.renderbufferStorage(s.RENDERBUFFER,nt,w.width,w.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,Bt,s.RENDERBUFFER,F)}else{const st=w.textures;for(let lt=0;lt<st.length;lt++){const nt=st[lt],Bt=r.convert(nt.format,nt.colorSpace),bt=r.convert(nt.type),Ot=b(nt.internalFormat,Bt,bt,nt.colorSpace),kt=Mt(w);j&&ne(w)===!1?s.renderbufferStorageMultisample(s.RENDERBUFFER,kt,Ot,w.width,w.height):ne(w)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,kt,Ot,w.width,w.height):s.renderbufferStorage(s.RENDERBUFFER,Ot,w.width,w.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function gt(F,w){if(w&&w.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(s.FRAMEBUFFER,F),!(w.depthTexture&&w.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const st=n.get(w.depthTexture);st.__renderTarget=w,(!st.__webglTexture||w.depthTexture.image.width!==w.width||w.depthTexture.image.height!==w.height)&&(w.depthTexture.image.width=w.width,w.depthTexture.image.height=w.height,w.depthTexture.needsUpdate=!0),K(w.depthTexture,0);const lt=st.__webglTexture,nt=Mt(w);if(w.depthTexture.format===Gs)ne(w)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,lt,0,nt):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,lt,0);else if(w.depthTexture.format===Ws)ne(w)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,lt,0,nt):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,lt,0);else throw new Error("Unknown depthTexture format")}function te(F){const w=n.get(F),j=F.isWebGLCubeRenderTarget===!0;if(w.__boundDepthTexture!==F.depthTexture){const st=F.depthTexture;if(w.__depthDisposeCallback&&w.__depthDisposeCallback(),st){const lt=()=>{delete w.__boundDepthTexture,delete w.__depthDisposeCallback,st.removeEventListener("dispose",lt)};st.addEventListener("dispose",lt),w.__depthDisposeCallback=lt}w.__boundDepthTexture=st}if(F.depthTexture&&!w.__autoAllocateDepthBuffer){if(j)throw new Error("target.depthTexture not supported in Cube render targets");const st=F.texture.mipmaps;st&&st.length>0?gt(w.__webglFramebuffer[0],F):gt(w.__webglFramebuffer,F)}else if(j){w.__webglDepthbuffer=[];for(let st=0;st<6;st++)if(e.bindFramebuffer(s.FRAMEBUFFER,w.__webglFramebuffer[st]),w.__webglDepthbuffer[st]===void 0)w.__webglDepthbuffer[st]=s.createRenderbuffer(),ot(w.__webglDepthbuffer[st],F,!1);else{const lt=F.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,nt=w.__webglDepthbuffer[st];s.bindRenderbuffer(s.RENDERBUFFER,nt),s.framebufferRenderbuffer(s.FRAMEBUFFER,lt,s.RENDERBUFFER,nt)}}else{const st=F.texture.mipmaps;if(st&&st.length>0?e.bindFramebuffer(s.FRAMEBUFFER,w.__webglFramebuffer[0]):e.bindFramebuffer(s.FRAMEBUFFER,w.__webglFramebuffer),w.__webglDepthbuffer===void 0)w.__webglDepthbuffer=s.createRenderbuffer(),ot(w.__webglDepthbuffer,F,!1);else{const lt=F.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,nt=w.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,nt),s.framebufferRenderbuffer(s.FRAMEBUFFER,lt,s.RENDERBUFFER,nt)}}e.bindFramebuffer(s.FRAMEBUFFER,null)}function ee(F,w,j){const st=n.get(F);w!==void 0&&_t(st.__webglFramebuffer,F,F.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),j!==void 0&&te(F)}function Jt(F){const w=F.texture,j=n.get(F),st=n.get(w);F.addEventListener("dispose",P);const lt=F.textures,nt=F.isWebGLCubeRenderTarget===!0,Bt=lt.length>1;if(Bt||(st.__webglTexture===void 0&&(st.__webglTexture=s.createTexture()),st.__version=w.version,a.memory.textures++),nt){j.__webglFramebuffer=[];for(let bt=0;bt<6;bt++)if(w.mipmaps&&w.mipmaps.length>0){j.__webglFramebuffer[bt]=[];for(let Ot=0;Ot<w.mipmaps.length;Ot++)j.__webglFramebuffer[bt][Ot]=s.createFramebuffer()}else j.__webglFramebuffer[bt]=s.createFramebuffer()}else{if(w.mipmaps&&w.mipmaps.length>0){j.__webglFramebuffer=[];for(let bt=0;bt<w.mipmaps.length;bt++)j.__webglFramebuffer[bt]=s.createFramebuffer()}else j.__webglFramebuffer=s.createFramebuffer();if(Bt)for(let bt=0,Ot=lt.length;bt<Ot;bt++){const kt=n.get(lt[bt]);kt.__webglTexture===void 0&&(kt.__webglTexture=s.createTexture(),a.memory.textures++)}if(F.samples>0&&ne(F)===!1){j.__webglMultisampledFramebuffer=s.createFramebuffer(),j.__webglColorRenderbuffer=[],e.bindFramebuffer(s.FRAMEBUFFER,j.__webglMultisampledFramebuffer);for(let bt=0;bt<lt.length;bt++){const Ot=lt[bt];j.__webglColorRenderbuffer[bt]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,j.__webglColorRenderbuffer[bt]);const kt=r.convert(Ot.format,Ot.colorSpace),ct=r.convert(Ot.type),Ct=b(Ot.internalFormat,kt,ct,Ot.colorSpace,F.isXRRenderTarget===!0),$t=Mt(F);s.renderbufferStorageMultisample(s.RENDERBUFFER,$t,Ct,F.width,F.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+bt,s.RENDERBUFFER,j.__webglColorRenderbuffer[bt])}s.bindRenderbuffer(s.RENDERBUFFER,null),F.depthBuffer&&(j.__webglDepthRenderbuffer=s.createRenderbuffer(),ot(j.__webglDepthRenderbuffer,F,!0)),e.bindFramebuffer(s.FRAMEBUFFER,null)}}if(nt){e.bindTexture(s.TEXTURE_CUBE_MAP,st.__webglTexture),Rt(s.TEXTURE_CUBE_MAP,w);for(let bt=0;bt<6;bt++)if(w.mipmaps&&w.mipmaps.length>0)for(let Ot=0;Ot<w.mipmaps.length;Ot++)_t(j.__webglFramebuffer[bt][Ot],F,w,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+bt,Ot);else _t(j.__webglFramebuffer[bt],F,w,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0);g(w)&&p(s.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Bt){for(let bt=0,Ot=lt.length;bt<Ot;bt++){const kt=lt[bt],ct=n.get(kt);e.bindTexture(s.TEXTURE_2D,ct.__webglTexture),Rt(s.TEXTURE_2D,kt),_t(j.__webglFramebuffer,F,kt,s.COLOR_ATTACHMENT0+bt,s.TEXTURE_2D,0),g(kt)&&p(s.TEXTURE_2D)}e.unbindTexture()}else{let bt=s.TEXTURE_2D;if((F.isWebGL3DRenderTarget||F.isWebGLArrayRenderTarget)&&(bt=F.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),e.bindTexture(bt,st.__webglTexture),Rt(bt,w),w.mipmaps&&w.mipmaps.length>0)for(let Ot=0;Ot<w.mipmaps.length;Ot++)_t(j.__webglFramebuffer[Ot],F,w,s.COLOR_ATTACHMENT0,bt,Ot);else _t(j.__webglFramebuffer,F,w,s.COLOR_ATTACHMENT0,bt,0);g(w)&&p(bt),e.unbindTexture()}F.depthBuffer&&te(F)}function O(F){const w=F.textures;for(let j=0,st=w.length;j<st;j++){const lt=w[j];if(g(lt)){const nt=E(F),Bt=n.get(lt).__webglTexture;e.bindTexture(nt,Bt),p(nt),e.unbindTexture()}}}const _e=[],se=[];function re(F){if(F.samples>0){if(ne(F)===!1){const w=F.textures,j=F.width,st=F.height;let lt=s.COLOR_BUFFER_BIT;const nt=F.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Bt=n.get(F),bt=w.length>1;if(bt)for(let kt=0;kt<w.length;kt++)e.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+kt,s.RENDERBUFFER,null),e.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+kt,s.TEXTURE_2D,null,0);e.bindFramebuffer(s.READ_FRAMEBUFFER,Bt.__webglMultisampledFramebuffer);const Ot=F.texture.mipmaps;Ot&&Ot.length>0?e.bindFramebuffer(s.DRAW_FRAMEBUFFER,Bt.__webglFramebuffer[0]):e.bindFramebuffer(s.DRAW_FRAMEBUFFER,Bt.__webglFramebuffer);for(let kt=0;kt<w.length;kt++){if(F.resolveDepthBuffer&&(F.depthBuffer&&(lt|=s.DEPTH_BUFFER_BIT),F.stencilBuffer&&F.resolveStencilBuffer&&(lt|=s.STENCIL_BUFFER_BIT)),bt){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,Bt.__webglColorRenderbuffer[kt]);const ct=n.get(w[kt]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,ct,0)}s.blitFramebuffer(0,0,j,st,0,0,j,st,lt,s.NEAREST),l===!0&&(_e.length=0,se.length=0,_e.push(s.COLOR_ATTACHMENT0+kt),F.depthBuffer&&F.resolveDepthBuffer===!1&&(_e.push(nt),se.push(nt),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,se)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,_e))}if(e.bindFramebuffer(s.READ_FRAMEBUFFER,null),e.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),bt)for(let kt=0;kt<w.length;kt++){e.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+kt,s.RENDERBUFFER,Bt.__webglColorRenderbuffer[kt]);const ct=n.get(w[kt]).__webglTexture;e.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+kt,s.TEXTURE_2D,ct,0)}e.bindFramebuffer(s.DRAW_FRAMEBUFFER,Bt.__webglMultisampledFramebuffer)}else if(F.depthBuffer&&F.resolveDepthBuffer===!1&&l){const w=F.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[w])}}}function Mt(F){return Math.min(i.maxSamples,F.samples)}function ne(F){const w=n.get(F);return F.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function yt(F){const w=a.render.frame;h.get(F)!==w&&(h.set(F,w),F.update())}function oe(F,w){const j=F.colorSpace,st=F.format,lt=F.type;return F.isCompressedTexture===!0||F.isVideoTexture===!0||j!==ds&&j!==ui&&(pe.getTransfer(j)===Re?(st!==yn||lt!==zn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",j)),w}function Ee(F){return typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement?(c.width=F.naturalWidth||F.width,c.height=F.naturalHeight||F.height):typeof VideoFrame<"u"&&F instanceof VideoFrame?(c.width=F.displayWidth,c.height=F.displayHeight):(c.width=F.width,c.height=F.height),c}this.allocateTextureUnit=k,this.resetTextureUnits=B,this.setTexture2D=K,this.setTexture2DArray=z,this.setTexture3D=tt,this.setTextureCube=W,this.rebindTextures=ee,this.setupRenderTarget=Jt,this.updateRenderTargetMipmap=O,this.updateMultisampleRenderTarget=re,this.setupDepthRenderbuffer=te,this.setupFrameBufferTexture=_t,this.useMultisampledRTT=ne}function z2(s,t){function e(n,i=ui){let r;const a=pe.getTransfer(i);if(n===zn)return s.UNSIGNED_BYTE;if(n===ml)return s.UNSIGNED_SHORT_4_4_4_4;if(n===gl)return s.UNSIGNED_SHORT_5_5_5_1;if(n===Wh)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===Hh)return s.BYTE;if(n===Gh)return s.SHORT;if(n===Vs)return s.UNSIGNED_SHORT;if(n===pl)return s.INT;if(n===Pi)return s.UNSIGNED_INT;if(n===Fn)return s.FLOAT;if(n===js)return s.HALF_FLOAT;if(n===Xh)return s.ALPHA;if(n===qh)return s.RGB;if(n===yn)return s.RGBA;if(n===Gs)return s.DEPTH_COMPONENT;if(n===Ws)return s.DEPTH_STENCIL;if(n===jh)return s.RED;if(n===_l)return s.RED_INTEGER;if(n===Yh)return s.RG;if(n===vl)return s.RG_INTEGER;if(n===xl)return s.RGBA_INTEGER;if(n===qr||n===jr||n===Yr||n===Jr)if(a===Re)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===qr)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===jr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Yr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Jr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===qr)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===jr)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Yr)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Jr)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Co||n===Lo||n===Po||n===Do)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Co)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Lo)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Po)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Do)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Uo||n===Io||n===No)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Uo||n===Io)return a===Re?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===No)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Fo||n===Oo||n===zo||n===Bo||n===ko||n===Vo||n===Ho||n===Go||n===Wo||n===Xo||n===qo||n===jo||n===Yo||n===Jo)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Fo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Oo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===zo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Bo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===ko)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Vo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ho)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Go)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Wo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Xo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===qo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===jo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Yo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Jo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===$r||n===$o||n===Ko)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===$r)return a===Re?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===$o)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Ko)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Jh||n===Zo||n===Qo||n===tl)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===$r)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Zo)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Qo)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===tl)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Hs?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:e}}const B2=`
3803
+ }`;function a2(s,t,e){let n=new Ml;const i=new Qt,r=new Qt,a=new me,o=new hf({depthPacking:td}),l=new uf,c={},h=e.maxTextureSize,u={[Cn]:rn,[rn]:Cn,[tn]:tn},d=new ti({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Qt},radius:{value:4}},vertexShader:s2,fragmentShader:r2}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const m=new Ne;m.setAttribute("position",new Oe(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new be(m,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Rh;let f=this.type;this.render=function(L,P,D){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||L.length===0)return;const M=s.getRenderTarget(),y=s.getActiveCubeFace(),U=s.getActiveMipmapLevel(),B=s.state;B.setBlending(ui),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const k=f!==$n&&this.type===$n,q=f===$n&&this.type!==$n;for(let J=0,z=L.length;J<z;J++){const tt=L[J],W=tt.shadow;if(W===void 0){console.warn("THREE.WebGLShadowMap:",tt,"has no shadow.");continue}if(W.autoUpdate===!1&&W.needsUpdate===!1)continue;i.copy(W.mapSize);const at=W.getFrameExtents();if(i.multiply(at),r.copy(W.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/at.x),i.x=r.x*at.x,W.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/at.y),i.y=r.y*at.y,W.mapSize.y=r.y)),W.map===null||k===!0||q===!0){const mt=this.type!==$n?{minFilter:mn,magFilter:mn}:{};W.map!==null&&W.map.dispose(),W.map=new Pi(i.x,i.y,mt),W.map.texture.name=tt.name+".shadowMap",W.camera.updateProjectionMatrix()}s.setRenderTarget(W.map),s.clear();const dt=W.getViewportCount();for(let mt=0;mt<dt;mt++){const Rt=W.getViewport(mt);a.set(r.x*Rt.x,r.y*Rt.y,r.x*Rt.z,r.y*Rt.w),B.viewport(a),W.updateMatrices(tt,mt),n=W.getFrustum(),S(P,D,W.camera,tt,this.type)}W.isPointLightShadow!==!0&&this.type===$n&&b(W,D),W.needsUpdate=!1}f=this.type,g.needsUpdate=!1,s.setRenderTarget(M,y,U)};function b(L,P){const D=t.update(_);d.defines.VSM_SAMPLES!==L.blurSamples&&(d.defines.VSM_SAMPLES=L.blurSamples,p.defines.VSM_SAMPLES=L.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),L.mapPass===null&&(L.mapPass=new Pi(i.x,i.y)),d.uniforms.shadow_pass.value=L.map.texture,d.uniforms.resolution.value=L.mapSize,d.uniforms.radius.value=L.radius,s.setRenderTarget(L.mapPass),s.clear(),s.renderBufferDirect(P,null,D,d,_,null),p.uniforms.shadow_pass.value=L.mapPass.texture,p.uniforms.resolution.value=L.mapSize,p.uniforms.radius.value=L.radius,s.setRenderTarget(L.map),s.clear(),s.renderBufferDirect(P,null,D,p,_,null)}function w(L,P,D,M){let y=null;const U=D.isPointLight===!0?L.customDistanceMaterial:L.customDepthMaterial;if(U!==void 0)y=U;else if(y=D.isPointLight===!0?l:o,s.localClippingEnabled&&P.clipShadows===!0&&Array.isArray(P.clippingPlanes)&&P.clippingPlanes.length!==0||P.displacementMap&&P.displacementScale!==0||P.alphaMap&&P.alphaTest>0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const B=y.uuid,k=P.uuid;let q=c[B];q===void 0&&(q={},c[B]=q);let J=q[k];J===void 0&&(J=y.clone(),q[k]=J,P.addEventListener("dispose",I)),y=J}if(y.visible=P.visible,y.wireframe=P.wireframe,M===$n?y.side=P.shadowSide!==null?P.shadowSide:P.side:y.side=P.shadowSide!==null?P.shadowSide:u[P.side],y.alphaMap=P.alphaMap,y.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,y.map=P.map,y.clipShadows=P.clipShadows,y.clippingPlanes=P.clippingPlanes,y.clipIntersection=P.clipIntersection,y.displacementMap=P.displacementMap,y.displacementScale=P.displacementScale,y.displacementBias=P.displacementBias,y.wireframeLinewidth=P.wireframeLinewidth,y.linewidth=P.linewidth,D.isPointLight===!0&&y.isMeshDistanceMaterial===!0){const B=s.properties.get(y);B.light=D}return y}function S(L,P,D,M,y){if(L.visible===!1)return;if(L.layers.test(P.layers)&&(L.isMesh||L.isLine||L.isPoints)&&(L.castShadow||L.receiveShadow&&y===$n)&&(!L.frustumCulled||n.intersectsObject(L))){L.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,L.matrixWorld);const k=t.update(L),q=L.material;if(Array.isArray(q)){const J=k.groups;for(let z=0,tt=J.length;z<tt;z++){const W=J[z],at=q[W.materialIndex];if(at&&at.visible){const dt=w(L,at,M,y);L.onBeforeShadow(s,L,P,D,k,dt,W),s.renderBufferDirect(D,null,k,dt,L,W),L.onAfterShadow(s,L,P,D,k,dt,W)}}}else if(q.visible){const J=w(L,q,M,y);L.onBeforeShadow(s,L,P,D,k,J,null),s.renderBufferDirect(D,null,k,J,L,null),L.onAfterShadow(s,L,P,D,k,J,null)}}const B=L.children;for(let k=0,q=B.length;k<q;k++)S(B[k],P,D,M,y)}function I(L){L.target.removeEventListener("dispose",I);for(const D in c){const M=c[D],y=L.target.uuid;y in M&&(M[y].dispose(),delete M[y])}}}const o2={[uo]:fo,[po]:_o,[mo]:vo,[ls]:go,[fo]:uo,[_o]:po,[vo]:mo,[go]:ls};function l2(s,t){function e(){let V=!1;const Tt=new me;let ht=null;const Dt=new me(0,0,0,0);return{setMask:function(ft){ht!==ft&&!V&&(s.colorMask(ft,ft,ft,ft),ht=ft)},setLocked:function(ft){V=ft},setClear:function(ft,rt,Ut,ae,Le){Le===!0&&(ft*=ae,rt*=ae,Ut*=ae),Tt.set(ft,rt,Ut,ae),Dt.equals(Tt)===!1&&(s.clearColor(ft,rt,Ut,ae),Dt.copy(Tt))},reset:function(){V=!1,ht=null,Dt.set(-1,0,0,0)}}}function n(){let V=!1,Tt=!1,ht=null,Dt=null,ft=null;return{setReversed:function(rt){if(Tt!==rt){const Ut=t.get("EXT_clip_control");rt?Ut.clipControlEXT(Ut.LOWER_LEFT_EXT,Ut.ZERO_TO_ONE_EXT):Ut.clipControlEXT(Ut.LOWER_LEFT_EXT,Ut.NEGATIVE_ONE_TO_ONE_EXT),Tt=rt;const ae=ft;ft=null,this.setClear(ae)}},getReversed:function(){return Tt},setTest:function(rt){rt?et(s.DEPTH_TEST):_t(s.DEPTH_TEST)},setMask:function(rt){ht!==rt&&!V&&(s.depthMask(rt),ht=rt)},setFunc:function(rt){if(Tt&&(rt=o2[rt]),Dt!==rt){switch(rt){case uo:s.depthFunc(s.NEVER);break;case fo:s.depthFunc(s.ALWAYS);break;case po:s.depthFunc(s.LESS);break;case ls:s.depthFunc(s.LEQUAL);break;case mo:s.depthFunc(s.EQUAL);break;case go:s.depthFunc(s.GEQUAL);break;case _o:s.depthFunc(s.GREATER);break;case vo:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}Dt=rt}},setLocked:function(rt){V=rt},setClear:function(rt){ft!==rt&&(Tt&&(rt=1-rt),s.clearDepth(rt),ft=rt)},reset:function(){V=!1,ht=null,Dt=null,ft=null,Tt=!1}}}function i(){let V=!1,Tt=null,ht=null,Dt=null,ft=null,rt=null,Ut=null,ae=null,Le=null;return{setTest:function(ce){V||(ce?et(s.STENCIL_TEST):_t(s.STENCIL_TEST))},setMask:function(ce){Tt!==ce&&!V&&(s.stencilMask(ce),Tt=ce)},setFunc:function(ce,an,Sn){(ht!==ce||Dt!==an||ft!==Sn)&&(s.stencilFunc(ce,an,Sn),ht=ce,Dt=an,ft=Sn)},setOp:function(ce,an,Sn){(rt!==ce||Ut!==an||ae!==Sn)&&(s.stencilOp(ce,an,Sn),rt=ce,Ut=an,ae=Sn)},setLocked:function(ce){V=ce},setClear:function(ce){Le!==ce&&(s.clearStencil(ce),Le=ce)},reset:function(){V=!1,Tt=null,ht=null,Dt=null,ft=null,rt=null,Ut=null,ae=null,Le=null}}}const r=new e,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},u={},d=new WeakMap,p=[],m=null,_=!1,g=null,f=null,b=null,w=null,S=null,I=null,L=null,P=new qt(0,0,0),D=0,M=!1,y=null,U=null,B=null,k=null,q=null;const J=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let z=!1,tt=0;const W=s.getParameter(s.VERSION);W.indexOf("WebGL")!==-1?(tt=parseFloat(/^WebGL (\d)/.exec(W)[1]),z=tt>=1):W.indexOf("OpenGL ES")!==-1&&(tt=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),z=tt>=2);let at=null,dt={};const mt=s.getParameter(s.SCISSOR_BOX),Rt=s.getParameter(s.VIEWPORT),wt=new me().fromArray(mt),X=new me().fromArray(Rt);function Z(V,Tt,ht,Dt){const ft=new Uint8Array(4),rt=s.createTexture();s.bindTexture(V,rt),s.texParameteri(V,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(V,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let Ut=0;Ut<ht;Ut++)V===s.TEXTURE_3D||V===s.TEXTURE_2D_ARRAY?s.texImage3D(Tt,0,s.RGBA,1,1,Dt,0,s.RGBA,s.UNSIGNED_BYTE,ft):s.texImage2D(Tt+Ut,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,ft);return rt}const Q={};Q[s.TEXTURE_2D]=Z(s.TEXTURE_2D,s.TEXTURE_2D,1),Q[s.TEXTURE_CUBE_MAP]=Z(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),Q[s.TEXTURE_2D_ARRAY]=Z(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),Q[s.TEXTURE_3D]=Z(s.TEXTURE_3D,s.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),et(s.DEPTH_TEST),a.setFunc(ls),se(!1),re(Ul),et(s.CULL_FACE),F(ui);function et(V){h[V]!==!0&&(s.enable(V),h[V]=!0)}function _t(V){h[V]!==!1&&(s.disable(V),h[V]=!1)}function ot(V,Tt){return u[V]!==Tt?(s.bindFramebuffer(V,Tt),u[V]=Tt,V===s.DRAW_FRAMEBUFFER&&(u[s.FRAMEBUFFER]=Tt),V===s.FRAMEBUFFER&&(u[s.DRAW_FRAMEBUFFER]=Tt),!0):!1}function gt(V,Tt){let ht=p,Dt=!1;if(V){ht=d.get(Tt),ht===void 0&&(ht=[],d.set(Tt,ht));const ft=V.textures;if(ht.length!==ft.length||ht[0]!==s.COLOR_ATTACHMENT0){for(let rt=0,Ut=ft.length;rt<Ut;rt++)ht[rt]=s.COLOR_ATTACHMENT0+rt;ht.length=ft.length,Dt=!0}}else ht[0]!==s.BACK&&(ht[0]=s.BACK,Dt=!0);Dt&&s.drawBuffers(ht)}function te(V){return m!==V?(s.useProgram(V),m=V,!0):!1}const ee={[wi]:s.FUNC_ADD,[wu]:s.FUNC_SUBTRACT,[Tu]:s.FUNC_REVERSE_SUBTRACT};ee[Au]=s.MIN,ee[Ru]=s.MAX;const jt={[Cu]:s.ZERO,[Lu]:s.ONE,[Pu]:s.SRC_COLOR,[co]:s.SRC_ALPHA,[Ou]:s.SRC_ALPHA_SATURATE,[Nu]:s.DST_COLOR,[Uu]:s.DST_ALPHA,[Du]:s.ONE_MINUS_SRC_COLOR,[ho]:s.ONE_MINUS_SRC_ALPHA,[Fu]:s.ONE_MINUS_DST_COLOR,[Iu]:s.ONE_MINUS_DST_ALPHA,[zu]:s.CONSTANT_COLOR,[Bu]:s.ONE_MINUS_CONSTANT_COLOR,[ku]:s.CONSTANT_ALPHA,[Vu]:s.ONE_MINUS_CONSTANT_ALPHA};function F(V,Tt,ht,Dt,ft,rt,Ut,ae,Le,ce){if(V===ui){_===!0&&(_t(s.BLEND),_=!1);return}if(_===!1&&(et(s.BLEND),_=!0),V!==Eu){if(V!==g||ce!==M){if((f!==wi||S!==wi)&&(s.blendEquation(s.FUNC_ADD),f=wi,S=wi),ce)switch(V){case rs:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Il:s.blendFunc(s.ONE,s.ONE);break;case Nl:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Fl:s.blendFuncSeparate(s.ZERO,s.SRC_COLOR,s.ZERO,s.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",V);break}else switch(V){case rs:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Il:s.blendFunc(s.SRC_ALPHA,s.ONE);break;case Nl:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Fl:s.blendFunc(s.ZERO,s.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",V);break}b=null,w=null,I=null,L=null,P.set(0,0,0),D=0,g=V,M=ce}return}ft=ft||Tt,rt=rt||ht,Ut=Ut||Dt,(Tt!==f||ft!==S)&&(s.blendEquationSeparate(ee[Tt],ee[ft]),f=Tt,S=ft),(ht!==b||Dt!==w||rt!==I||Ut!==L)&&(s.blendFuncSeparate(jt[ht],jt[Dt],jt[rt],jt[Ut]),b=ht,w=Dt,I=rt,L=Ut),(ae.equals(P)===!1||Le!==D)&&(s.blendColor(ae.r,ae.g,ae.b,Le),P.copy(ae),D=Le),g=V,M=!1}function _e(V,Tt){V.side===tn?_t(s.CULL_FACE):et(s.CULL_FACE);let ht=V.side===rn;Tt&&(ht=!ht),se(ht),V.blending===rs&&V.transparent===!1?F(ui):F(V.blending,V.blendEquation,V.blendSrc,V.blendDst,V.blendEquationAlpha,V.blendSrcAlpha,V.blendDstAlpha,V.blendColor,V.blendAlpha,V.premultipliedAlpha),a.setFunc(V.depthFunc),a.setTest(V.depthTest),a.setMask(V.depthWrite),r.setMask(V.colorWrite);const Dt=V.stencilWrite;o.setTest(Dt),Dt&&(o.setMask(V.stencilWriteMask),o.setFunc(V.stencilFunc,V.stencilRef,V.stencilFuncMask),o.setOp(V.stencilFail,V.stencilZFail,V.stencilZPass)),ne(V.polygonOffset,V.polygonOffsetFactor,V.polygonOffsetUnits),V.alphaToCoverage===!0?et(s.SAMPLE_ALPHA_TO_COVERAGE):_t(s.SAMPLE_ALPHA_TO_COVERAGE)}function se(V){y!==V&&(V?s.frontFace(s.CW):s.frontFace(s.CCW),y=V)}function re(V){V!==Su?(et(s.CULL_FACE),V!==U&&(V===Ul?s.cullFace(s.BACK):V===bu?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):_t(s.CULL_FACE),U=V}function Mt(V){V!==B&&(z&&s.lineWidth(V),B=V)}function ne(V,Tt,ht){V?(et(s.POLYGON_OFFSET_FILL),(k!==Tt||q!==ht)&&(s.polygonOffset(Tt,ht),k=Tt,q=ht)):_t(s.POLYGON_OFFSET_FILL)}function yt(V){V?et(s.SCISSOR_TEST):_t(s.SCISSOR_TEST)}function oe(V){V===void 0&&(V=s.TEXTURE0+J-1),at!==V&&(s.activeTexture(V),at=V)}function Ee(V,Tt,ht){ht===void 0&&(at===null?ht=s.TEXTURE0+J-1:ht=at);let Dt=dt[ht];Dt===void 0&&(Dt={type:void 0,texture:void 0},dt[ht]=Dt),(Dt.type!==V||Dt.texture!==Tt)&&(at!==ht&&(s.activeTexture(ht),at=ht),s.bindTexture(V,Tt||Q[V]),Dt.type=V,Dt.texture=Tt)}function N(){const V=dt[at];V!==void 0&&V.type!==void 0&&(s.bindTexture(V.type,null),V.type=void 0,V.texture=void 0)}function E(){try{s.compressedTexImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function j(){try{s.compressedTexImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function st(){try{s.texSubImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function lt(){try{s.texSubImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function nt(){try{s.compressedTexSubImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function zt(){try{s.compressedTexSubImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function bt(){try{s.texStorage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Ft(){try{s.texStorage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Bt(){try{s.texImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function ct(){try{s.texImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Ct(V){wt.equals(V)===!1&&(s.scissor(V.x,V.y,V.z,V.w),wt.copy(V))}function Yt(V){X.equals(V)===!1&&(s.viewport(V.x,V.y,V.z,V.w),X.copy(V))}function Wt(V,Tt){let ht=c.get(Tt);ht===void 0&&(ht=new WeakMap,c.set(Tt,ht));let Dt=ht.get(V);Dt===void 0&&(Dt=s.getUniformBlockIndex(Tt,V.name),ht.set(V,Dt))}function St(V,Tt){const Dt=c.get(Tt).get(V);l.get(Tt)!==Dt&&(s.uniformBlockBinding(Tt,Dt,V.__bindingPointIndex),l.set(Tt,Dt))}function ie(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),a.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),h={},at=null,dt={},u={},d=new WeakMap,p=[],m=null,_=!1,g=null,f=null,b=null,w=null,S=null,I=null,L=null,P=new qt(0,0,0),D=0,M=!1,y=null,U=null,B=null,k=null,q=null,wt.set(0,0,s.canvas.width,s.canvas.height),X.set(0,0,s.canvas.width,s.canvas.height),r.reset(),a.reset(),o.reset()}return{buffers:{color:r,depth:a,stencil:o},enable:et,disable:_t,bindFramebuffer:ot,drawBuffers:gt,useProgram:te,setBlending:F,setMaterial:_e,setFlipSided:se,setCullFace:re,setLineWidth:Mt,setPolygonOffset:ne,setScissorTest:yt,activeTexture:oe,bindTexture:Ee,unbindTexture:N,compressedTexImage2D:E,compressedTexImage3D:j,texImage2D:Bt,texImage3D:ct,updateUBOMapping:Wt,uniformBlockBinding:St,texStorage2D:bt,texStorage3D:Ft,texSubImage2D:st,texSubImage3D:lt,compressedTexSubImage2D:nt,compressedTexSubImage3D:zt,scissor:Ct,viewport:Yt,reset:ie}}function c2(s,t,e,n,i,r,a){const o=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Qt,h=new WeakMap;let u;const d=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(N,E){return p?new OffscreenCanvas(N,E):Hs("canvas")}function _(N,E,j){let st=1;const lt=Ee(N);if((lt.width>j||lt.height>j)&&(st=j/Math.max(lt.width,lt.height)),st<1)if(typeof HTMLImageElement<"u"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&N instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&N instanceof ImageBitmap||typeof VideoFrame<"u"&&N instanceof VideoFrame){const nt=Math.floor(st*lt.width),zt=Math.floor(st*lt.height);u===void 0&&(u=m(nt,zt));const bt=E?m(nt,zt):u;return bt.width=nt,bt.height=zt,bt.getContext("2d").drawImage(N,0,0,nt,zt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+lt.width+"x"+lt.height+") to ("+nt+"x"+zt+")."),bt}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+lt.width+"x"+lt.height+")."),N;return N}function g(N){return N.generateMipmaps}function f(N){s.generateMipmap(N)}function b(N){return N.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:N.isWebGL3DRenderTarget?s.TEXTURE_3D:N.isWebGLArrayRenderTarget||N.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function w(N,E,j,st,lt=!1){if(N!==null){if(s[N]!==void 0)return s[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let nt=E;if(E===s.RED&&(j===s.FLOAT&&(nt=s.R32F),j===s.HALF_FLOAT&&(nt=s.R16F),j===s.UNSIGNED_BYTE&&(nt=s.R8)),E===s.RED_INTEGER&&(j===s.UNSIGNED_BYTE&&(nt=s.R8UI),j===s.UNSIGNED_SHORT&&(nt=s.R16UI),j===s.UNSIGNED_INT&&(nt=s.R32UI),j===s.BYTE&&(nt=s.R8I),j===s.SHORT&&(nt=s.R16I),j===s.INT&&(nt=s.R32I)),E===s.RG&&(j===s.FLOAT&&(nt=s.RG32F),j===s.HALF_FLOAT&&(nt=s.RG16F),j===s.UNSIGNED_BYTE&&(nt=s.RG8)),E===s.RG_INTEGER&&(j===s.UNSIGNED_BYTE&&(nt=s.RG8UI),j===s.UNSIGNED_SHORT&&(nt=s.RG16UI),j===s.UNSIGNED_INT&&(nt=s.RG32UI),j===s.BYTE&&(nt=s.RG8I),j===s.SHORT&&(nt=s.RG16I),j===s.INT&&(nt=s.RG32I)),E===s.RGB_INTEGER&&(j===s.UNSIGNED_BYTE&&(nt=s.RGB8UI),j===s.UNSIGNED_SHORT&&(nt=s.RGB16UI),j===s.UNSIGNED_INT&&(nt=s.RGB32UI),j===s.BYTE&&(nt=s.RGB8I),j===s.SHORT&&(nt=s.RGB16I),j===s.INT&&(nt=s.RGB32I)),E===s.RGBA_INTEGER&&(j===s.UNSIGNED_BYTE&&(nt=s.RGBA8UI),j===s.UNSIGNED_SHORT&&(nt=s.RGBA16UI),j===s.UNSIGNED_INT&&(nt=s.RGBA32UI),j===s.BYTE&&(nt=s.RGBA8I),j===s.SHORT&&(nt=s.RGBA16I),j===s.INT&&(nt=s.RGBA32I)),E===s.RGB&&j===s.UNSIGNED_INT_5_9_9_9_REV&&(nt=s.RGB9_E5),E===s.RGBA){const zt=lt?Zr:fe.getTransfer(st);j===s.FLOAT&&(nt=s.RGBA32F),j===s.HALF_FLOAT&&(nt=s.RGBA16F),j===s.UNSIGNED_BYTE&&(nt=zt===Re?s.SRGB8_ALPHA8:s.RGBA8),j===s.UNSIGNED_SHORT_4_4_4_4&&(nt=s.RGBA4),j===s.UNSIGNED_SHORT_5_5_5_1&&(nt=s.RGB5_A1)}return(nt===s.R16F||nt===s.R32F||nt===s.RG16F||nt===s.RG32F||nt===s.RGBA16F||nt===s.RGBA32F)&&t.get("EXT_color_buffer_float"),nt}function S(N,E){let j;return N?E===null||E===Li||E===Bs?j=s.DEPTH24_STENCIL8:E===Fn?j=s.DEPTH32F_STENCIL8:E===zs&&(j=s.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):E===null||E===Li||E===Bs?j=s.DEPTH_COMPONENT24:E===Fn?j=s.DEPTH_COMPONENT32F:E===zs&&(j=s.DEPTH_COMPONENT16),j}function I(N,E){return g(N)===!0||N.isFramebufferTexture&&N.minFilter!==mn&&N.minFilter!==pn?Math.log2(Math.max(E.width,E.height))+1:N.mipmaps!==void 0&&N.mipmaps.length>0?N.mipmaps.length:N.isCompressedTexture&&Array.isArray(N.image)?E.mipmaps.length:1}function L(N){const E=N.target;E.removeEventListener("dispose",L),D(E),E.isVideoTexture&&h.delete(E)}function P(N){const E=N.target;E.removeEventListener("dispose",P),y(E)}function D(N){const E=n.get(N);if(E.__webglInit===void 0)return;const j=N.source,st=d.get(j);if(st){const lt=st[E.__cacheKey];lt.usedTimes--,lt.usedTimes===0&&M(N),Object.keys(st).length===0&&d.delete(j)}n.remove(N)}function M(N){const E=n.get(N);s.deleteTexture(E.__webglTexture);const j=N.source,st=d.get(j);delete st[E.__cacheKey],a.memory.textures--}function y(N){const E=n.get(N);if(N.depthTexture&&(N.depthTexture.dispose(),n.remove(N.depthTexture)),N.isWebGLCubeRenderTarget)for(let st=0;st<6;st++){if(Array.isArray(E.__webglFramebuffer[st]))for(let lt=0;lt<E.__webglFramebuffer[st].length;lt++)s.deleteFramebuffer(E.__webglFramebuffer[st][lt]);else s.deleteFramebuffer(E.__webglFramebuffer[st]);E.__webglDepthbuffer&&s.deleteRenderbuffer(E.__webglDepthbuffer[st])}else{if(Array.isArray(E.__webglFramebuffer))for(let st=0;st<E.__webglFramebuffer.length;st++)s.deleteFramebuffer(E.__webglFramebuffer[st]);else s.deleteFramebuffer(E.__webglFramebuffer);if(E.__webglDepthbuffer&&s.deleteRenderbuffer(E.__webglDepthbuffer),E.__webglMultisampledFramebuffer&&s.deleteFramebuffer(E.__webglMultisampledFramebuffer),E.__webglColorRenderbuffer)for(let st=0;st<E.__webglColorRenderbuffer.length;st++)E.__webglColorRenderbuffer[st]&&s.deleteRenderbuffer(E.__webglColorRenderbuffer[st]);E.__webglDepthRenderbuffer&&s.deleteRenderbuffer(E.__webglDepthRenderbuffer)}const j=N.textures;for(let st=0,lt=j.length;st<lt;st++){const nt=n.get(j[st]);nt.__webglTexture&&(s.deleteTexture(nt.__webglTexture),a.memory.textures--),n.remove(j[st])}n.remove(N)}let U=0;function B(){U=0}function k(){const N=U;return N>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+i.maxTextures),U+=1,N}function q(N){const E=[];return E.push(N.wrapS),E.push(N.wrapT),E.push(N.wrapR||0),E.push(N.magFilter),E.push(N.minFilter),E.push(N.anisotropy),E.push(N.internalFormat),E.push(N.format),E.push(N.type),E.push(N.generateMipmaps),E.push(N.premultiplyAlpha),E.push(N.flipY),E.push(N.unpackAlignment),E.push(N.colorSpace),E.join()}function J(N,E){const j=n.get(N);if(N.isVideoTexture&&yt(N),N.isRenderTargetTexture===!1&&N.version>0&&j.__version!==N.version){const st=N.image;if(st===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(st.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Q(j,N,E);return}}e.bindTexture(s.TEXTURE_2D,j.__webglTexture,s.TEXTURE0+E)}function z(N,E){const j=n.get(N);if(N.version>0&&j.__version!==N.version){Q(j,N,E);return}e.bindTexture(s.TEXTURE_2D_ARRAY,j.__webglTexture,s.TEXTURE0+E)}function tt(N,E){const j=n.get(N);if(N.version>0&&j.__version!==N.version){Q(j,N,E);return}e.bindTexture(s.TEXTURE_3D,j.__webglTexture,s.TEXTURE0+E)}function W(N,E){const j=n.get(N);if(N.version>0&&j.__version!==N.version){et(j,N,E);return}e.bindTexture(s.TEXTURE_CUBE_MAP,j.__webglTexture,s.TEXTURE0+E)}const at={[Nn]:s.REPEAT,[An]:s.CLAMP_TO_EDGE,[Mo]:s.MIRRORED_REPEAT},dt={[mn]:s.NEAREST,[Ju]:s.NEAREST_MIPMAP_NEAREST,[tr]:s.NEAREST_MIPMAP_LINEAR,[pn]:s.LINEAR,[xa]:s.LINEAR_MIPMAP_NEAREST,[Kn]:s.LINEAR_MIPMAP_LINEAR},mt={[nd]:s.NEVER,[ld]:s.ALWAYS,[id]:s.LESS,[kh]:s.LEQUAL,[sd]:s.EQUAL,[od]:s.GEQUAL,[rd]:s.GREATER,[ad]:s.NOTEQUAL};function Rt(N,E){if(E.type===Fn&&t.has("OES_texture_float_linear")===!1&&(E.magFilter===pn||E.magFilter===xa||E.magFilter===tr||E.magFilter===Kn||E.minFilter===pn||E.minFilter===xa||E.minFilter===tr||E.minFilter===Kn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(N,s.TEXTURE_WRAP_S,at[E.wrapS]),s.texParameteri(N,s.TEXTURE_WRAP_T,at[E.wrapT]),(N===s.TEXTURE_3D||N===s.TEXTURE_2D_ARRAY)&&s.texParameteri(N,s.TEXTURE_WRAP_R,at[E.wrapR]),s.texParameteri(N,s.TEXTURE_MAG_FILTER,dt[E.magFilter]),s.texParameteri(N,s.TEXTURE_MIN_FILTER,dt[E.minFilter]),E.compareFunction&&(s.texParameteri(N,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(N,s.TEXTURE_COMPARE_FUNC,mt[E.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(E.magFilter===mn||E.minFilter!==tr&&E.minFilter!==Kn||E.type===Fn&&t.has("OES_texture_float_linear")===!1)return;if(E.anisotropy>1||n.get(E).__currentAnisotropy){const j=t.get("EXT_texture_filter_anisotropic");s.texParameterf(N,j.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy}}}function wt(N,E){let j=!1;N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",L));const st=E.source;let lt=d.get(st);lt===void 0&&(lt={},d.set(st,lt));const nt=q(E);if(nt!==N.__cacheKey){lt[nt]===void 0&&(lt[nt]={texture:s.createTexture(),usedTimes:0},a.memory.textures++,j=!0),lt[nt].usedTimes++;const zt=lt[N.__cacheKey];zt!==void 0&&(lt[N.__cacheKey].usedTimes--,zt.usedTimes===0&&M(E)),N.__cacheKey=nt,N.__webglTexture=lt[nt].texture}return j}function X(N,E,j){return Math.floor(Math.floor(N/j)/E)}function Z(N,E,j,st){const nt=N.updateRanges;if(nt.length===0)e.texSubImage2D(s.TEXTURE_2D,0,0,0,E.width,E.height,j,st,E.data);else{nt.sort((ct,Ct)=>ct.start-Ct.start);let zt=0;for(let ct=1;ct<nt.length;ct++){const Ct=nt[zt],Yt=nt[ct],Wt=Ct.start+Ct.count,St=X(Yt.start,E.width,4),ie=X(Ct.start,E.width,4);Yt.start<=Wt+1&&St===ie&&X(Yt.start+Yt.count-1,E.width,4)===St?Ct.count=Math.max(Ct.count,Yt.start+Yt.count-Ct.start):(++zt,nt[zt]=Yt)}nt.length=zt+1;const bt=s.getParameter(s.UNPACK_ROW_LENGTH),Ft=s.getParameter(s.UNPACK_SKIP_PIXELS),Bt=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,E.width);for(let ct=0,Ct=nt.length;ct<Ct;ct++){const Yt=nt[ct],Wt=Math.floor(Yt.start/4),St=Math.ceil(Yt.count/4),ie=Wt%E.width,V=Math.floor(Wt/E.width),Tt=St,ht=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,ie),s.pixelStorei(s.UNPACK_SKIP_ROWS,V),e.texSubImage2D(s.TEXTURE_2D,0,ie,V,Tt,ht,j,st,E.data)}N.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,bt),s.pixelStorei(s.UNPACK_SKIP_PIXELS,Ft),s.pixelStorei(s.UNPACK_SKIP_ROWS,Bt)}}function Q(N,E,j){let st=s.TEXTURE_2D;(E.isDataArrayTexture||E.isCompressedArrayTexture)&&(st=s.TEXTURE_2D_ARRAY),E.isData3DTexture&&(st=s.TEXTURE_3D);const lt=wt(N,E),nt=E.source;e.bindTexture(st,N.__webglTexture,s.TEXTURE0+j);const zt=n.get(nt);if(nt.version!==zt.__version||lt===!0){e.activeTexture(s.TEXTURE0+j);const bt=fe.getPrimaries(fe.workingColorSpace),Ft=E.colorSpace===hi?null:fe.getPrimaries(E.colorSpace),Bt=E.colorSpace===hi||bt===Ft?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,E.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,E.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Bt);let ct=_(E.image,!1,i.maxTextureSize);ct=oe(E,ct);const Ct=r.convert(E.format,E.colorSpace),Yt=r.convert(E.type);let Wt=w(E.internalFormat,Ct,Yt,E.colorSpace,E.isVideoTexture);Rt(st,E);let St;const ie=E.mipmaps,V=E.isVideoTexture!==!0,Tt=zt.__version===void 0||lt===!0,ht=nt.dataReady,Dt=I(E,ct);if(E.isDepthTexture)Wt=S(E.format===Vs,E.type),Tt&&(V?e.texStorage2D(s.TEXTURE_2D,1,Wt,ct.width,ct.height):e.texImage2D(s.TEXTURE_2D,0,Wt,ct.width,ct.height,0,Ct,Yt,null));else if(E.isDataTexture)if(ie.length>0){V&&Tt&&e.texStorage2D(s.TEXTURE_2D,Dt,Wt,ie[0].width,ie[0].height);for(let ft=0,rt=ie.length;ft<rt;ft++)St=ie[ft],V?ht&&e.texSubImage2D(s.TEXTURE_2D,ft,0,0,St.width,St.height,Ct,Yt,St.data):e.texImage2D(s.TEXTURE_2D,ft,Wt,St.width,St.height,0,Ct,Yt,St.data);E.generateMipmaps=!1}else V?(Tt&&e.texStorage2D(s.TEXTURE_2D,Dt,Wt,ct.width,ct.height),ht&&Z(E,ct,Ct,Yt)):e.texImage2D(s.TEXTURE_2D,0,Wt,ct.width,ct.height,0,Ct,Yt,ct.data);else if(E.isCompressedTexture)if(E.isCompressedArrayTexture){V&&Tt&&e.texStorage3D(s.TEXTURE_2D_ARRAY,Dt,Wt,ie[0].width,ie[0].height,ct.depth);for(let ft=0,rt=ie.length;ft<rt;ft++)if(St=ie[ft],E.format!==yn)if(Ct!==null)if(V){if(ht)if(E.layerUpdates.size>0){const Ut=Dc(St.width,St.height,E.format,E.type);for(const ae of E.layerUpdates){const Le=St.data.subarray(ae*Ut/St.data.BYTES_PER_ELEMENT,(ae+1)*Ut/St.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,ft,0,0,ae,St.width,St.height,1,Ct,Le)}E.clearLayerUpdates()}else e.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,ft,0,0,0,St.width,St.height,ct.depth,Ct,St.data)}else e.compressedTexImage3D(s.TEXTURE_2D_ARRAY,ft,Wt,St.width,St.height,ct.depth,0,St.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else V?ht&&e.texSubImage3D(s.TEXTURE_2D_ARRAY,ft,0,0,0,St.width,St.height,ct.depth,Ct,Yt,St.data):e.texImage3D(s.TEXTURE_2D_ARRAY,ft,Wt,St.width,St.height,ct.depth,0,Ct,Yt,St.data)}else{V&&Tt&&e.texStorage2D(s.TEXTURE_2D,Dt,Wt,ie[0].width,ie[0].height);for(let ft=0,rt=ie.length;ft<rt;ft++)St=ie[ft],E.format!==yn?Ct!==null?V?ht&&e.compressedTexSubImage2D(s.TEXTURE_2D,ft,0,0,St.width,St.height,Ct,St.data):e.compressedTexImage2D(s.TEXTURE_2D,ft,Wt,St.width,St.height,0,St.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):V?ht&&e.texSubImage2D(s.TEXTURE_2D,ft,0,0,St.width,St.height,Ct,Yt,St.data):e.texImage2D(s.TEXTURE_2D,ft,Wt,St.width,St.height,0,Ct,Yt,St.data)}else if(E.isDataArrayTexture)if(V){if(Tt&&e.texStorage3D(s.TEXTURE_2D_ARRAY,Dt,Wt,ct.width,ct.height,ct.depth),ht)if(E.layerUpdates.size>0){const ft=Dc(ct.width,ct.height,E.format,E.type);for(const rt of E.layerUpdates){const Ut=ct.data.subarray(rt*ft/ct.data.BYTES_PER_ELEMENT,(rt+1)*ft/ct.data.BYTES_PER_ELEMENT);e.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,rt,ct.width,ct.height,1,Ct,Yt,Ut)}E.clearLayerUpdates()}else e.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,ct.width,ct.height,ct.depth,Ct,Yt,ct.data)}else e.texImage3D(s.TEXTURE_2D_ARRAY,0,Wt,ct.width,ct.height,ct.depth,0,Ct,Yt,ct.data);else if(E.isData3DTexture)V?(Tt&&e.texStorage3D(s.TEXTURE_3D,Dt,Wt,ct.width,ct.height,ct.depth),ht&&e.texSubImage3D(s.TEXTURE_3D,0,0,0,0,ct.width,ct.height,ct.depth,Ct,Yt,ct.data)):e.texImage3D(s.TEXTURE_3D,0,Wt,ct.width,ct.height,ct.depth,0,Ct,Yt,ct.data);else if(E.isFramebufferTexture){if(Tt)if(V)e.texStorage2D(s.TEXTURE_2D,Dt,Wt,ct.width,ct.height);else{let ft=ct.width,rt=ct.height;for(let Ut=0;Ut<Dt;Ut++)e.texImage2D(s.TEXTURE_2D,Ut,Wt,ft,rt,0,Ct,Yt,null),ft>>=1,rt>>=1}}else if(ie.length>0){if(V&&Tt){const ft=Ee(ie[0]);e.texStorage2D(s.TEXTURE_2D,Dt,Wt,ft.width,ft.height)}for(let ft=0,rt=ie.length;ft<rt;ft++)St=ie[ft],V?ht&&e.texSubImage2D(s.TEXTURE_2D,ft,0,0,Ct,Yt,St):e.texImage2D(s.TEXTURE_2D,ft,Wt,Ct,Yt,St);E.generateMipmaps=!1}else if(V){if(Tt){const ft=Ee(ct);e.texStorage2D(s.TEXTURE_2D,Dt,Wt,ft.width,ft.height)}ht&&e.texSubImage2D(s.TEXTURE_2D,0,0,0,Ct,Yt,ct)}else e.texImage2D(s.TEXTURE_2D,0,Wt,Ct,Yt,ct);g(E)&&f(st),zt.__version=nt.version,E.onUpdate&&E.onUpdate(E)}N.__version=E.version}function et(N,E,j){if(E.image.length!==6)return;const st=wt(N,E),lt=E.source;e.bindTexture(s.TEXTURE_CUBE_MAP,N.__webglTexture,s.TEXTURE0+j);const nt=n.get(lt);if(lt.version!==nt.__version||st===!0){e.activeTexture(s.TEXTURE0+j);const zt=fe.getPrimaries(fe.workingColorSpace),bt=E.colorSpace===hi?null:fe.getPrimaries(E.colorSpace),Ft=E.colorSpace===hi||zt===bt?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,E.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,E.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ft);const Bt=E.isCompressedTexture||E.image[0].isCompressedTexture,ct=E.image[0]&&E.image[0].isDataTexture,Ct=[];for(let rt=0;rt<6;rt++)!Bt&&!ct?Ct[rt]=_(E.image[rt],!0,i.maxCubemapSize):Ct[rt]=ct?E.image[rt].image:E.image[rt],Ct[rt]=oe(E,Ct[rt]);const Yt=Ct[0],Wt=r.convert(E.format,E.colorSpace),St=r.convert(E.type),ie=w(E.internalFormat,Wt,St,E.colorSpace),V=E.isVideoTexture!==!0,Tt=nt.__version===void 0||st===!0,ht=lt.dataReady;let Dt=I(E,Yt);Rt(s.TEXTURE_CUBE_MAP,E);let ft;if(Bt){V&&Tt&&e.texStorage2D(s.TEXTURE_CUBE_MAP,Dt,ie,Yt.width,Yt.height);for(let rt=0;rt<6;rt++){ft=Ct[rt].mipmaps;for(let Ut=0;Ut<ft.length;Ut++){const ae=ft[Ut];E.format!==yn?Wt!==null?V?ht&&e.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,Ut,0,0,ae.width,ae.height,Wt,ae.data):e.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,Ut,ie,ae.width,ae.height,0,ae.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,Ut,0,0,ae.width,ae.height,Wt,St,ae.data):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,Ut,ie,ae.width,ae.height,0,Wt,St,ae.data)}}}else{if(ft=E.mipmaps,V&&Tt){ft.length>0&&Dt++;const rt=Ee(Ct[0]);e.texStorage2D(s.TEXTURE_CUBE_MAP,Dt,ie,rt.width,rt.height)}for(let rt=0;rt<6;rt++)if(ct){V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0,0,0,Ct[rt].width,Ct[rt].height,Wt,St,Ct[rt].data):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0,ie,Ct[rt].width,Ct[rt].height,0,Wt,St,Ct[rt].data);for(let Ut=0;Ut<ft.length;Ut++){const Le=ft[Ut].image[rt].image;V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,Ut+1,0,0,Le.width,Le.height,Wt,St,Le.data):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,Ut+1,ie,Le.width,Le.height,0,Wt,St,Le.data)}}else{V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0,0,0,Wt,St,Ct[rt]):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0,ie,Wt,St,Ct[rt]);for(let Ut=0;Ut<ft.length;Ut++){const ae=ft[Ut];V?ht&&e.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,Ut+1,0,0,Wt,St,ae.image[rt]):e.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+rt,Ut+1,ie,Wt,St,ae.image[rt])}}}g(E)&&f(s.TEXTURE_CUBE_MAP),nt.__version=lt.version,E.onUpdate&&E.onUpdate(E)}N.__version=E.version}function _t(N,E,j,st,lt,nt){const zt=r.convert(j.format,j.colorSpace),bt=r.convert(j.type),Ft=w(j.internalFormat,zt,bt,j.colorSpace),Bt=n.get(E),ct=n.get(j);if(ct.__renderTarget=E,!Bt.__hasExternalTextures){const Ct=Math.max(1,E.width>>nt),Yt=Math.max(1,E.height>>nt);lt===s.TEXTURE_3D||lt===s.TEXTURE_2D_ARRAY?e.texImage3D(lt,nt,Ft,Ct,Yt,E.depth,0,zt,bt,null):e.texImage2D(lt,nt,Ft,Ct,Yt,0,zt,bt,null)}e.bindFramebuffer(s.FRAMEBUFFER,N),ne(E)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,st,lt,ct.__webglTexture,0,Mt(E)):(lt===s.TEXTURE_2D||lt>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&lt<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,st,lt,ct.__webglTexture,nt),e.bindFramebuffer(s.FRAMEBUFFER,null)}function ot(N,E,j){if(s.bindRenderbuffer(s.RENDERBUFFER,N),E.depthBuffer){const st=E.depthTexture,lt=st&&st.isDepthTexture?st.type:null,nt=S(E.stencilBuffer,lt),zt=E.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,bt=Mt(E);ne(E)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,bt,nt,E.width,E.height):j?s.renderbufferStorageMultisample(s.RENDERBUFFER,bt,nt,E.width,E.height):s.renderbufferStorage(s.RENDERBUFFER,nt,E.width,E.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,zt,s.RENDERBUFFER,N)}else{const st=E.textures;for(let lt=0;lt<st.length;lt++){const nt=st[lt],zt=r.convert(nt.format,nt.colorSpace),bt=r.convert(nt.type),Ft=w(nt.internalFormat,zt,bt,nt.colorSpace),Bt=Mt(E);j&&ne(E)===!1?s.renderbufferStorageMultisample(s.RENDERBUFFER,Bt,Ft,E.width,E.height):ne(E)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Bt,Ft,E.width,E.height):s.renderbufferStorage(s.RENDERBUFFER,Ft,E.width,E.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function gt(N,E){if(E&&E.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(s.FRAMEBUFFER,N),!(E.depthTexture&&E.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const st=n.get(E.depthTexture);st.__renderTarget=E,(!st.__webglTexture||E.depthTexture.image.width!==E.width||E.depthTexture.image.height!==E.height)&&(E.depthTexture.image.width=E.width,E.depthTexture.image.height=E.height,E.depthTexture.needsUpdate=!0),J(E.depthTexture,0);const lt=st.__webglTexture,nt=Mt(E);if(E.depthTexture.format===ks)ne(E)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,lt,0,nt):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,lt,0);else if(E.depthTexture.format===Vs)ne(E)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,lt,0,nt):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,lt,0);else throw new Error("Unknown depthTexture format")}function te(N){const E=n.get(N),j=N.isWebGLCubeRenderTarget===!0;if(E.__boundDepthTexture!==N.depthTexture){const st=N.depthTexture;if(E.__depthDisposeCallback&&E.__depthDisposeCallback(),st){const lt=()=>{delete E.__boundDepthTexture,delete E.__depthDisposeCallback,st.removeEventListener("dispose",lt)};st.addEventListener("dispose",lt),E.__depthDisposeCallback=lt}E.__boundDepthTexture=st}if(N.depthTexture&&!E.__autoAllocateDepthBuffer){if(j)throw new Error("target.depthTexture not supported in Cube render targets");const st=N.texture.mipmaps;st&&st.length>0?gt(E.__webglFramebuffer[0],N):gt(E.__webglFramebuffer,N)}else if(j){E.__webglDepthbuffer=[];for(let st=0;st<6;st++)if(e.bindFramebuffer(s.FRAMEBUFFER,E.__webglFramebuffer[st]),E.__webglDepthbuffer[st]===void 0)E.__webglDepthbuffer[st]=s.createRenderbuffer(),ot(E.__webglDepthbuffer[st],N,!1);else{const lt=N.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,nt=E.__webglDepthbuffer[st];s.bindRenderbuffer(s.RENDERBUFFER,nt),s.framebufferRenderbuffer(s.FRAMEBUFFER,lt,s.RENDERBUFFER,nt)}}else{const st=N.texture.mipmaps;if(st&&st.length>0?e.bindFramebuffer(s.FRAMEBUFFER,E.__webglFramebuffer[0]):e.bindFramebuffer(s.FRAMEBUFFER,E.__webglFramebuffer),E.__webglDepthbuffer===void 0)E.__webglDepthbuffer=s.createRenderbuffer(),ot(E.__webglDepthbuffer,N,!1);else{const lt=N.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,nt=E.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,nt),s.framebufferRenderbuffer(s.FRAMEBUFFER,lt,s.RENDERBUFFER,nt)}}e.bindFramebuffer(s.FRAMEBUFFER,null)}function ee(N,E,j){const st=n.get(N);E!==void 0&&_t(st.__webglFramebuffer,N,N.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),j!==void 0&&te(N)}function jt(N){const E=N.texture,j=n.get(N),st=n.get(E);N.addEventListener("dispose",P);const lt=N.textures,nt=N.isWebGLCubeRenderTarget===!0,zt=lt.length>1;if(zt||(st.__webglTexture===void 0&&(st.__webglTexture=s.createTexture()),st.__version=E.version,a.memory.textures++),nt){j.__webglFramebuffer=[];for(let bt=0;bt<6;bt++)if(E.mipmaps&&E.mipmaps.length>0){j.__webglFramebuffer[bt]=[];for(let Ft=0;Ft<E.mipmaps.length;Ft++)j.__webglFramebuffer[bt][Ft]=s.createFramebuffer()}else j.__webglFramebuffer[bt]=s.createFramebuffer()}else{if(E.mipmaps&&E.mipmaps.length>0){j.__webglFramebuffer=[];for(let bt=0;bt<E.mipmaps.length;bt++)j.__webglFramebuffer[bt]=s.createFramebuffer()}else j.__webglFramebuffer=s.createFramebuffer();if(zt)for(let bt=0,Ft=lt.length;bt<Ft;bt++){const Bt=n.get(lt[bt]);Bt.__webglTexture===void 0&&(Bt.__webglTexture=s.createTexture(),a.memory.textures++)}if(N.samples>0&&ne(N)===!1){j.__webglMultisampledFramebuffer=s.createFramebuffer(),j.__webglColorRenderbuffer=[],e.bindFramebuffer(s.FRAMEBUFFER,j.__webglMultisampledFramebuffer);for(let bt=0;bt<lt.length;bt++){const Ft=lt[bt];j.__webglColorRenderbuffer[bt]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,j.__webglColorRenderbuffer[bt]);const Bt=r.convert(Ft.format,Ft.colorSpace),ct=r.convert(Ft.type),Ct=w(Ft.internalFormat,Bt,ct,Ft.colorSpace,N.isXRRenderTarget===!0),Yt=Mt(N);s.renderbufferStorageMultisample(s.RENDERBUFFER,Yt,Ct,N.width,N.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+bt,s.RENDERBUFFER,j.__webglColorRenderbuffer[bt])}s.bindRenderbuffer(s.RENDERBUFFER,null),N.depthBuffer&&(j.__webglDepthRenderbuffer=s.createRenderbuffer(),ot(j.__webglDepthRenderbuffer,N,!0)),e.bindFramebuffer(s.FRAMEBUFFER,null)}}if(nt){e.bindTexture(s.TEXTURE_CUBE_MAP,st.__webglTexture),Rt(s.TEXTURE_CUBE_MAP,E);for(let bt=0;bt<6;bt++)if(E.mipmaps&&E.mipmaps.length>0)for(let Ft=0;Ft<E.mipmaps.length;Ft++)_t(j.__webglFramebuffer[bt][Ft],N,E,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+bt,Ft);else _t(j.__webglFramebuffer[bt],N,E,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0);g(E)&&f(s.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(zt){for(let bt=0,Ft=lt.length;bt<Ft;bt++){const Bt=lt[bt],ct=n.get(Bt);e.bindTexture(s.TEXTURE_2D,ct.__webglTexture),Rt(s.TEXTURE_2D,Bt),_t(j.__webglFramebuffer,N,Bt,s.COLOR_ATTACHMENT0+bt,s.TEXTURE_2D,0),g(Bt)&&f(s.TEXTURE_2D)}e.unbindTexture()}else{let bt=s.TEXTURE_2D;if((N.isWebGL3DRenderTarget||N.isWebGLArrayRenderTarget)&&(bt=N.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),e.bindTexture(bt,st.__webglTexture),Rt(bt,E),E.mipmaps&&E.mipmaps.length>0)for(let Ft=0;Ft<E.mipmaps.length;Ft++)_t(j.__webglFramebuffer[Ft],N,E,s.COLOR_ATTACHMENT0,bt,Ft);else _t(j.__webglFramebuffer,N,E,s.COLOR_ATTACHMENT0,bt,0);g(E)&&f(bt),e.unbindTexture()}N.depthBuffer&&te(N)}function F(N){const E=N.textures;for(let j=0,st=E.length;j<st;j++){const lt=E[j];if(g(lt)){const nt=b(N),zt=n.get(lt).__webglTexture;e.bindTexture(nt,zt),f(nt),e.unbindTexture()}}}const _e=[],se=[];function re(N){if(N.samples>0){if(ne(N)===!1){const E=N.textures,j=N.width,st=N.height;let lt=s.COLOR_BUFFER_BIT;const nt=N.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,zt=n.get(N),bt=E.length>1;if(bt)for(let Bt=0;Bt<E.length;Bt++)e.bindFramebuffer(s.FRAMEBUFFER,zt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Bt,s.RENDERBUFFER,null),e.bindFramebuffer(s.FRAMEBUFFER,zt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Bt,s.TEXTURE_2D,null,0);e.bindFramebuffer(s.READ_FRAMEBUFFER,zt.__webglMultisampledFramebuffer);const Ft=N.texture.mipmaps;Ft&&Ft.length>0?e.bindFramebuffer(s.DRAW_FRAMEBUFFER,zt.__webglFramebuffer[0]):e.bindFramebuffer(s.DRAW_FRAMEBUFFER,zt.__webglFramebuffer);for(let Bt=0;Bt<E.length;Bt++){if(N.resolveDepthBuffer&&(N.depthBuffer&&(lt|=s.DEPTH_BUFFER_BIT),N.stencilBuffer&&N.resolveStencilBuffer&&(lt|=s.STENCIL_BUFFER_BIT)),bt){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,zt.__webglColorRenderbuffer[Bt]);const ct=n.get(E[Bt]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,ct,0)}s.blitFramebuffer(0,0,j,st,0,0,j,st,lt,s.NEAREST),l===!0&&(_e.length=0,se.length=0,_e.push(s.COLOR_ATTACHMENT0+Bt),N.depthBuffer&&N.resolveDepthBuffer===!1&&(_e.push(nt),se.push(nt),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,se)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,_e))}if(e.bindFramebuffer(s.READ_FRAMEBUFFER,null),e.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),bt)for(let Bt=0;Bt<E.length;Bt++){e.bindFramebuffer(s.FRAMEBUFFER,zt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Bt,s.RENDERBUFFER,zt.__webglColorRenderbuffer[Bt]);const ct=n.get(E[Bt]).__webglTexture;e.bindFramebuffer(s.FRAMEBUFFER,zt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Bt,s.TEXTURE_2D,ct,0)}e.bindFramebuffer(s.DRAW_FRAMEBUFFER,zt.__webglMultisampledFramebuffer)}else if(N.depthBuffer&&N.resolveDepthBuffer===!1&&l){const E=N.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[E])}}}function Mt(N){return Math.min(i.maxSamples,N.samples)}function ne(N){const E=n.get(N);return N.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&E.__useRenderToTexture!==!1}function yt(N){const E=a.render.frame;h.get(N)!==E&&(h.set(N,E),N.update())}function oe(N,E){const j=N.colorSpace,st=N.format,lt=N.type;return N.isCompressedTexture===!0||N.isVideoTexture===!0||j!==us&&j!==hi&&(fe.getTransfer(j)===Re?(st!==yn||lt!==zn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",j)),E}function Ee(N){return typeof HTMLImageElement<"u"&&N instanceof HTMLImageElement?(c.width=N.naturalWidth||N.width,c.height=N.naturalHeight||N.height):typeof VideoFrame<"u"&&N instanceof VideoFrame?(c.width=N.displayWidth,c.height=N.displayHeight):(c.width=N.width,c.height=N.height),c}this.allocateTextureUnit=k,this.resetTextureUnits=B,this.setTexture2D=J,this.setTexture2DArray=z,this.setTexture3D=tt,this.setTextureCube=W,this.rebindTextures=ee,this.setupRenderTarget=jt,this.updateRenderTargetMipmap=F,this.updateMultisampleRenderTarget=re,this.setupDepthRenderbuffer=te,this.setupFrameBufferTexture=_t,this.useMultisampledRTT=ne}function h2(s,t){function e(n,i=hi){let r;const a=fe.getTransfer(i);if(n===zn)return s.UNSIGNED_BYTE;if(n===ll)return s.UNSIGNED_SHORT_4_4_4_4;if(n===cl)return s.UNSIGNED_SHORT_5_5_5_1;if(n===Ih)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===Dh)return s.BYTE;if(n===Uh)return s.SHORT;if(n===zs)return s.UNSIGNED_SHORT;if(n===ol)return s.INT;if(n===Li)return s.UNSIGNED_INT;if(n===Fn)return s.FLOAT;if(n===Ws)return s.HALF_FLOAT;if(n===Nh)return s.ALPHA;if(n===Fh)return s.RGB;if(n===yn)return s.RGBA;if(n===ks)return s.DEPTH_COMPONENT;if(n===Vs)return s.DEPTH_STENCIL;if(n===Oh)return s.RED;if(n===hl)return s.RED_INTEGER;if(n===zh)return s.RG;if(n===ul)return s.RG_INTEGER;if(n===dl)return s.RGBA_INTEGER;if(n===Hr||n===Gr||n===Wr||n===Xr)if(a===Re)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Hr)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Gr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Wr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Xr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Hr)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Gr)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Wr)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Xr)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===So||n===bo||n===Eo||n===wo)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===So)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===bo)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Eo)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===wo)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===To||n===Ao||n===Ro)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===To||n===Ao)return a===Re?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Ro)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Co||n===Lo||n===Po||n===Do||n===Uo||n===Io||n===No||n===Fo||n===Oo||n===zo||n===Bo||n===ko||n===Vo||n===Ho)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Co)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Lo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Po)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Do)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Uo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Io)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===No)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Fo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Oo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===zo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Bo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===ko)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Vo)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Ho)return a===Re?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===qr||n===Go||n===Wo)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===qr)return a===Re?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Go)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Wo)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Bh||n===Xo||n===qo||n===jo)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===qr)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Xo)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===qo)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===jo)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Bs?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:e}}const u2=`
3804
3804
  void main() {
3805
3805
 
3806
3806
  gl_Position = vec4( position, 1.0 );
3807
3807
 
3808
- }`,k2=`
3808
+ }`,d2=`
3809
3809
  uniform sampler2DArray depthColor;
3810
3810
  uniform float depthWidth;
3811
3811
  uniform float depthHeight;
@@ -3824,7 +3824,7 @@ void main() {
3824
3824
 
3825
3825
  }
3826
3826
 
3827
- }`;class V2{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){const i=new $e,r=t.properties.get(i);r.__webglTexture=e.texture,(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,n=new ti({vertexShader:B2,fragmentShader:k2,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new be(new Ys(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class H2 extends Ui{constructor(t,e){super();const n=this;let i=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,f=null,m=null;const _=new V2,g=e.getContextAttributes();let p=null,E=null;const b=[],M=[],I=new Dt;let C=null;const P=new Je;P.viewport=new me;const D=new Je;D.viewport=new me;const S=[P,D],y=new sp;let U=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let Z=b[X];return Z===void 0&&(Z=new Xa,b[X]=Z),Z.getTargetRaySpace()},this.getControllerGrip=function(X){let Z=b[X];return Z===void 0&&(Z=new Xa,b[X]=Z),Z.getGripSpace()},this.getHand=function(X){let Z=b[X];return Z===void 0&&(Z=new Xa,b[X]=Z),Z.getHandSpace()};function k(X){const Z=M.indexOf(X.inputSource);if(Z===-1)return;const Q=b[Z];Q!==void 0&&(Q.update(X.inputSource,X.frame,c||a),Q.dispatchEvent({type:X.type,data:X.inputSource}))}function q(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",q),i.removeEventListener("inputsourceschange",K);for(let X=0;X<b.length;X++){const Z=M[X];Z!==null&&(M[X]=null,b[X].disconnect(Z))}U=null,B=null,_.reset(),t.setRenderTarget(p),f=null,d=null,u=null,i=null,E=null,wt.stop(),n.isPresenting=!1,t.setPixelRatio(C),t.setSize(I.width,I.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){r=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){o=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(X){c=X},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(X){if(i=X,i!==null){if(p=t.getRenderTarget(),i.addEventListener("select",k),i.addEventListener("selectstart",k),i.addEventListener("selectend",k),i.addEventListener("squeeze",k),i.addEventListener("squeezestart",k),i.addEventListener("squeezeend",k),i.addEventListener("end",q),i.addEventListener("inputsourceschange",K),g.xrCompatible!==!0&&await e.makeXRCompatible(),C=t.getPixelRatio(),t.getSize(I),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let Q=null,et=null,_t=null;g.depth&&(_t=g.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Q=g.stencil?Ws:Gs,et=g.stencil?Hs:Pi);const ot={colorFormat:e.RGBA8,depthFormat:_t,scaleFactor:r};u=new XRWebGLBinding(i,e),d=u.createProjectionLayer(ot),i.updateRenderState({layers:[d]}),t.setPixelRatio(1),t.setSize(d.textureWidth,d.textureHeight,!1),E=new Di(d.textureWidth,d.textureHeight,{format:yn,type:zn,depthTexture:new cu(d.textureWidth,d.textureHeight,et,void 0,void 0,void 0,void 0,void 0,void 0,Q),stencilBuffer:g.stencil,colorSpace:t.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const Q={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(i,e,Q),i.updateRenderState({baseLayer:f}),t.setPixelRatio(1),t.setSize(f.framebufferWidth,f.framebufferHeight,!1),E=new Di(f.framebufferWidth,f.framebufferHeight,{format:yn,type:zn,colorSpace:t.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}E.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),wt.setContext(i),wt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function K(X){for(let Z=0;Z<X.removed.length;Z++){const Q=X.removed[Z],et=M.indexOf(Q);et>=0&&(M[et]=null,b[et].disconnect(Q))}for(let Z=0;Z<X.added.length;Z++){const Q=X.added[Z];let et=M.indexOf(Q);if(et===-1){for(let ot=0;ot<b.length;ot++)if(ot>=M.length){M.push(Q),et=ot;break}else if(M[ot]===null){M[ot]=Q,et=ot;break}if(et===-1)break}const _t=b[et];_t&&_t.connect(Q)}}const z=new N,tt=new N;function W(X,Z,Q){z.setFromMatrixPosition(Z.matrixWorld),tt.setFromMatrixPosition(Q.matrixWorld);const et=z.distanceTo(tt),_t=Z.projectionMatrix.elements,ot=Q.projectionMatrix.elements,gt=_t[14]/(_t[10]-1),te=_t[14]/(_t[10]+1),ee=(_t[9]+1)/_t[5],Jt=(_t[9]-1)/_t[5],O=(_t[8]-1)/_t[0],_e=(ot[8]+1)/ot[0],se=gt*O,re=gt*_e,Mt=et/(-O+_e),ne=Mt*-O;if(Z.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(ne),X.translateZ(Mt),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert(),_t[10]===-1)X.projectionMatrix.copy(Z.projectionMatrix),X.projectionMatrixInverse.copy(Z.projectionMatrixInverse);else{const yt=gt+Mt,oe=te+Mt,Ee=se-ne,F=re+(et-ne),w=ee*te/oe*yt,j=Jt*te/oe*yt;X.projectionMatrix.makePerspective(Ee,F,w,j,yt,oe),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}}function at(X,Z){Z===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(Z.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(i===null)return;let Z=X.near,Q=X.far;_.texture!==null&&(_.depthNear>0&&(Z=_.depthNear),_.depthFar>0&&(Q=_.depthFar)),y.near=D.near=P.near=Z,y.far=D.far=P.far=Q,(U!==y.near||B!==y.far)&&(i.updateRenderState({depthNear:y.near,depthFar:y.far}),U=y.near,B=y.far),P.layers.mask=X.layers.mask|2,D.layers.mask=X.layers.mask|4,y.layers.mask=P.layers.mask|D.layers.mask;const et=X.parent,_t=y.cameras;at(y,et);for(let ot=0;ot<_t.length;ot++)at(_t[ot],et);_t.length===2?W(y,P,D):y.projectionMatrix.copy(P.projectionMatrix),dt(X,y,et)};function dt(X,Z,Q){Q===null?X.matrix.copy(Z.matrixWorld):(X.matrix.copy(Q.matrixWorld),X.matrix.invert(),X.matrix.multiply(Z.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(Z.projectionMatrix),X.projectionMatrixInverse.copy(Z.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=fs*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return y},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(X){l=X,d!==null&&(d.fixedFoveation=X),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=X)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(y)};let mt=null;function Rt(X,Z){if(h=Z.getViewerPose(c||a),m=Z,h!==null){const Q=h.views;f!==null&&(t.setRenderTargetFramebuffer(E,f.framebuffer),t.setRenderTarget(E));let et=!1;Q.length!==y.cameras.length&&(y.cameras.length=0,et=!0);for(let gt=0;gt<Q.length;gt++){const te=Q[gt];let ee=null;if(f!==null)ee=f.getViewport(te);else{const O=u.getViewSubImage(d,te);ee=O.viewport,gt===0&&(t.setRenderTargetTextures(E,O.colorTexture,O.depthStencilTexture),t.setRenderTarget(E))}let Jt=S[gt];Jt===void 0&&(Jt=new Je,Jt.layers.enable(gt),Jt.viewport=new me,S[gt]=Jt),Jt.matrix.fromArray(te.transform.matrix),Jt.matrix.decompose(Jt.position,Jt.quaternion,Jt.scale),Jt.projectionMatrix.fromArray(te.projectionMatrix),Jt.projectionMatrixInverse.copy(Jt.projectionMatrix).invert(),Jt.viewport.set(ee.x,ee.y,ee.width,ee.height),gt===0&&(y.matrix.copy(Jt.matrix),y.matrix.decompose(y.position,y.quaternion,y.scale)),et===!0&&y.cameras.push(Jt)}const _t=i.enabledFeatures;if(_t&&_t.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&u){const gt=u.getDepthInformation(Q[0]);gt&&gt.isValid&&gt.texture&&_.init(t,gt,i.renderState)}}for(let Q=0;Q<b.length;Q++){const et=M[Q],_t=b[Q];et!==null&&_t!==void 0&&_t.update(et,Z,c||a)}mt&&mt(X,Z),Z.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Z}),m=null}const wt=new xu;wt.setAnimationLoop(Rt),this.setAnimationLoop=function(X){mt=X},this.dispose=function(){}}}const Si=new un,G2=new Yt;function W2(s,t){function e(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function n(g,p){p.color.getRGB(g.fogColor.value,nu(s)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,E,b,M){p.isMeshBasicMaterial||p.isMeshLambertMaterial?r(g,p):p.isMeshToonMaterial?(r(g,p),u(g,p)):p.isMeshPhongMaterial?(r(g,p),h(g,p)):p.isMeshStandardMaterial?(r(g,p),d(g,p),p.isMeshPhysicalMaterial&&f(g,p,M)):p.isMeshMatcapMaterial?(r(g,p),m(g,p)):p.isMeshDepthMaterial?r(g,p):p.isMeshDistanceMaterial?(r(g,p),_(g,p)):p.isMeshNormalMaterial?r(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,E,b):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function r(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map,e(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,e(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===rn&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,e(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===rn&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,e(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,e(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,e(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);const E=t.get(p),b=E.envMap,M=E.envMapRotation;b&&(g.envMap.value=b,Si.copy(M),Si.x*=-1,Si.y*=-1,Si.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Si.y*=-1,Si.z*=-1),g.envMapRotation.value.setFromMatrix4(G2.makeRotationFromEuler(Si)),g.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap&&(g.lightMap.value=p.lightMap,g.lightMapIntensity.value=p.lightMapIntensity,e(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,e(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,e(p.map,g.mapTransform))}function o(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,E,b){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*E,g.scale.value=b*.5,p.map&&(g.map.value=p.map,e(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,e(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function d(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,e(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,e(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,E){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,e(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,e(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,e(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,e(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,e(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===rn&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,e(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,e(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=E.texture,g.transmissionSamplerSize.value.set(E.width,E.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,e(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,e(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,e(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,e(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,e(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const E=t.get(p).light;g.referencePosition.value.setFromMatrixPosition(E.matrixWorld),g.nearDistance.value=E.shadow.camera.near,g.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function X2(s,t,e,n){let i={},r={},a=[];const o=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function l(E,b){const M=b.program;n.uniformBlockBinding(E,M)}function c(E,b){let M=i[E.id];M===void 0&&(m(E),M=h(E),i[E.id]=M,E.addEventListener("dispose",g));const I=b.program;n.updateUBOMapping(E,I);const C=t.render.frame;r[E.id]!==C&&(d(E),r[E.id]=C)}function h(E){const b=u();E.__bindingPointIndex=b;const M=s.createBuffer(),I=E.__size,C=E.usage;return s.bindBuffer(s.UNIFORM_BUFFER,M),s.bufferData(s.UNIFORM_BUFFER,I,C),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,b,M),M}function u(){for(let E=0;E<o;E++)if(a.indexOf(E)===-1)return a.push(E),E;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(E){const b=i[E.id],M=E.uniforms,I=E.__cache;s.bindBuffer(s.UNIFORM_BUFFER,b);for(let C=0,P=M.length;C<P;C++){const D=Array.isArray(M[C])?M[C]:[M[C]];for(let S=0,y=D.length;S<y;S++){const U=D[S];if(f(U,C,S,I)===!0){const B=U.__offset,k=Array.isArray(U.value)?U.value:[U.value];let q=0;for(let K=0;K<k.length;K++){const z=k[K],tt=_(z);typeof z=="number"||typeof z=="boolean"?(U.__data[0]=z,s.bufferSubData(s.UNIFORM_BUFFER,B+q,U.__data)):z.isMatrix3?(U.__data[0]=z.elements[0],U.__data[1]=z.elements[1],U.__data[2]=z.elements[2],U.__data[3]=0,U.__data[4]=z.elements[3],U.__data[5]=z.elements[4],U.__data[6]=z.elements[5],U.__data[7]=0,U.__data[8]=z.elements[6],U.__data[9]=z.elements[7],U.__data[10]=z.elements[8],U.__data[11]=0):(z.toArray(U.__data,q),q+=tt.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,B,U.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function f(E,b,M,I){const C=E.value,P=b+"_"+M;if(I[P]===void 0)return typeof C=="number"||typeof C=="boolean"?I[P]=C:I[P]=C.clone(),!0;{const D=I[P];if(typeof C=="number"||typeof C=="boolean"){if(D!==C)return I[P]=C,!0}else if(D.equals(C)===!1)return D.copy(C),!0}return!1}function m(E){const b=E.uniforms;let M=0;const I=16;for(let P=0,D=b.length;P<D;P++){const S=Array.isArray(b[P])?b[P]:[b[P]];for(let y=0,U=S.length;y<U;y++){const B=S[y],k=Array.isArray(B.value)?B.value:[B.value];for(let q=0,K=k.length;q<K;q++){const z=k[q],tt=_(z),W=M%I,at=W%tt.boundary,dt=W+at;M+=at,dt!==0&&I-dt<tt.storage&&(M+=I-dt),B.__data=new Float32Array(tt.storage/Float32Array.BYTES_PER_ELEMENT),B.__offset=M,M+=tt.storage}}}const C=M%I;return C>0&&(M+=I-C),E.__size=M,E.__cache={},this}function _(E){const b={boundary:0,storage:0};return typeof E=="number"||typeof E=="boolean"?(b.boundary=4,b.storage=4):E.isVector2?(b.boundary=8,b.storage=8):E.isVector3||E.isColor?(b.boundary=16,b.storage=12):E.isVector4?(b.boundary=16,b.storage=16):E.isMatrix3?(b.boundary=48,b.storage=48):E.isMatrix4?(b.boundary=64,b.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),b}function g(E){const b=E.target;b.removeEventListener("dispose",g);const M=a.indexOf(b.__bindingPointIndex);a.splice(M,1),s.deleteBuffer(i[b.id]),delete i[b.id],delete r[b.id]}function p(){for(const E in i)s.deleteBuffer(i[E]);a=[],i={},r={}}return{bind:l,update:c,dispose:p}}class q2{constructor(t={}){const{canvas:e=zd(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!1}=t;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const E=[],b=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=fi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const M=this;let I=!1;this._outputColorSpace=Me;let C=0,P=0,D=null,S=-1,y=null;const U=new me,B=new me;let k=null;const q=new jt(0);let K=0,z=e.width,tt=e.height,W=1,at=null,dt=null;const mt=new me(0,0,z,tt),Rt=new me(0,0,z,tt);let wt=!1;const X=new Rl;let Z=!1,Q=!1;const et=new Yt,_t=new Yt,ot=new N,gt=new me,te={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ee=!1;function Jt(){return D===null?W:1}let O=n;function _e(T,H){return e.getContext(T,H)}try{const T={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${fl}`),e.addEventListener("webglcontextlost",Ut,!1),e.addEventListener("webglcontextrestored",ft,!1),e.addEventListener("webglcontextcreationerror",rt,!1),O===null){const H="webgl2";if(O=_e(H,T),O===null)throw _e(H)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(T){throw console.error("THREE.WebGLRenderer: "+T.message),T}let se,re,Mt,ne,yt,oe,Ee,F,w,j,st,lt,nt,Bt,bt,Ot,kt,ct,Ct,$t,Xt,St,ie,V;function At(){se=new n1(O),se.init(),St=new z2(O,se),re=new Jm(O,se,t,St),Mt=new F2(O,se),re.reverseDepthBuffer&&d&&Mt.buffers.depth.setReversed(!0),ne=new r1(O),yt=new b2,oe=new O2(O,se,Mt,yt,re,St,ne),Ee=new Km(M),F=new e1(M),w=new up(O),ie=new jm(O,w),j=new i1(O,w,ne,ie),st=new o1(O,j,w,ne),Ct=new a1(O,re,oe),Ot=new $m(yt),lt=new S2(M,Ee,F,se,re,ie,Ot),nt=new W2(M,yt),Bt=new w2,bt=new P2(se),ct=new qm(M,Ee,F,Mt,st,f,l),kt=new I2(M,st,re),V=new X2(O,ne,re,Mt),$t=new Ym(O,se,ne),Xt=new s1(O,se,ne),ne.programs=lt.programs,M.capabilities=re,M.extensions=se,M.properties=yt,M.renderLists=Bt,M.shadowMap=kt,M.state=Mt,M.info=ne}At();const ht=new H2(M,O);this.xr=ht,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){const T=se.get("WEBGL_lose_context");T&&T.loseContext()},this.forceContextRestore=function(){const T=se.get("WEBGL_lose_context");T&&T.restoreContext()},this.getPixelRatio=function(){return W},this.setPixelRatio=function(T){T!==void 0&&(W=T,this.setSize(z,tt,!1))},this.getSize=function(T){return T.set(z,tt)},this.setSize=function(T,H,Y=!0){if(ht.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}z=T,tt=H,e.width=Math.floor(T*W),e.height=Math.floor(H*W),Y===!0&&(e.style.width=T+"px",e.style.height=H+"px"),this.setViewport(0,0,T,H)},this.getDrawingBufferSize=function(T){return T.set(z*W,tt*W).floor()},this.setDrawingBufferSize=function(T,H,Y){z=T,tt=H,W=Y,e.width=Math.floor(T*Y),e.height=Math.floor(H*Y),this.setViewport(0,0,T,H)},this.getCurrentViewport=function(T){return T.copy(U)},this.getViewport=function(T){return T.copy(mt)},this.setViewport=function(T,H,Y,J){T.isVector4?mt.set(T.x,T.y,T.z,T.w):mt.set(T,H,Y,J),Mt.viewport(U.copy(mt).multiplyScalar(W).round())},this.getScissor=function(T){return T.copy(Rt)},this.setScissor=function(T,H,Y,J){T.isVector4?Rt.set(T.x,T.y,T.z,T.w):Rt.set(T,H,Y,J),Mt.scissor(B.copy(Rt).multiplyScalar(W).round())},this.getScissorTest=function(){return wt},this.setScissorTest=function(T){Mt.setScissorTest(wt=T)},this.setOpaqueSort=function(T){at=T},this.setTransparentSort=function(T){dt=T},this.getClearColor=function(T){return T.copy(ct.getClearColor())},this.setClearColor=function(){ct.setClearColor(...arguments)},this.getClearAlpha=function(){return ct.getClearAlpha()},this.setClearAlpha=function(){ct.setClearAlpha(...arguments)},this.clear=function(T=!0,H=!0,Y=!0){let J=0;if(T){let G=!1;if(D!==null){const pt=D.texture.format;G=pt===xl||pt===vl||pt===_l}if(G){const pt=D.texture.type,Et=pt===zn||pt===Pi||pt===Vs||pt===Hs||pt===ml||pt===gl,Nt=ct.getClearColor(),Lt=ct.getClearAlpha(),Kt=Nt.r,Zt=Nt.g,Ht=Nt.b;Et?(m[0]=Kt,m[1]=Zt,m[2]=Ht,m[3]=Lt,O.clearBufferuiv(O.COLOR,0,m)):(_[0]=Kt,_[1]=Zt,_[2]=Ht,_[3]=Lt,O.clearBufferiv(O.COLOR,0,_))}else J|=O.COLOR_BUFFER_BIT}H&&(J|=O.DEPTH_BUFFER_BIT),Y&&(J|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),O.clear(J)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Ut,!1),e.removeEventListener("webglcontextrestored",ft,!1),e.removeEventListener("webglcontextcreationerror",rt,!1),ct.dispose(),Bt.dispose(),bt.dispose(),yt.dispose(),Ee.dispose(),F.dispose(),st.dispose(),ie.dispose(),V.dispose(),lt.dispose(),ht.dispose(),ht.removeEventListener("sessionstart",Ks),ht.removeEventListener("sessionend",Zs),kn.stop()};function Ut(T){T.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function ft(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const T=ne.autoReset,H=kt.enabled,Y=kt.autoUpdate,J=kt.needsUpdate,G=kt.type;At(),ne.autoReset=T,kt.enabled=H,kt.autoUpdate=Y,kt.needsUpdate=J,kt.type=G}function rt(T){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",T.statusMessage)}function It(T){const H=T.target;H.removeEventListener("dispose",It),ae(H)}function ae(T){Le(T),yt.remove(T)}function Le(T){const H=yt.get(T).programs;H!==void 0&&(H.forEach(function(Y){lt.releaseProgram(Y)}),T.isShaderMaterial&&lt.releaseShaderCache(T))}this.renderBufferDirect=function(T,H,Y,J,G,pt){H===null&&(H=te);const Et=G.isMesh&&G.matrixWorld.determinant()<0,Nt=_a(T,H,Y,J,G);Mt.setMaterial(J,Et);let Lt=Y.index,Kt=1;if(J.wireframe===!0){if(Lt=j.getWireframeAttribute(Y),Lt===void 0)return;Kt=2}const Zt=Y.drawRange,Ht=Y.attributes.position;let ce=Zt.start*Kt,Se=(Zt.start+Zt.count)*Kt;pt!==null&&(ce=Math.max(ce,pt.start*Kt),Se=Math.min(Se,(pt.start+pt.count)*Kt)),Lt!==null?(ce=Math.max(ce,0),Se=Math.min(Se,Lt.count)):Ht!=null&&(ce=Math.max(ce,0),Se=Math.min(Se,Ht.count));const De=Se-ce;if(De<0||De===1/0)return;ie.setup(G,J,Nt,Y,Lt);let Ne,ge=$t;if(Lt!==null&&(Ne=w.get(Lt),ge=Xt,ge.setIndex(Ne)),G.isMesh)J.wireframe===!0?(Mt.setLineWidth(J.wireframeLinewidth*Jt()),ge.setMode(O.LINES)):ge.setMode(O.TRIANGLES);else if(G.isLine){let Wt=J.linewidth;Wt===void 0&&(Wt=1),Mt.setLineWidth(Wt*Jt()),G.isLineSegments?ge.setMode(O.LINES):G.isLineLoop?ge.setMode(O.LINE_LOOP):ge.setMode(O.LINE_STRIP)}else G.isPoints?ge.setMode(O.POINTS):G.isSprite&&ge.setMode(O.TRIANGLES);if(G.isBatchedMesh)if(G._multiDrawInstances!==null)os("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),ge.renderMultiDrawInstances(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount,G._multiDrawInstances);else if(se.get("WEBGL_multi_draw"))ge.renderMultiDraw(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount);else{const Wt=G._multiDrawStarts,ke=G._multiDrawCounts,ve=G._multiDrawCount,on=Lt?w.get(Lt).bytesPerElement:1,Ue=yt.get(J).currentProgram.getUniforms();for(let Xe=0;Xe<ve;Xe++)Ue.setValue(O,"_gl_DrawID",Xe),ge.render(Wt[Xe]/on,ke[Xe])}else if(G.isInstancedMesh)ge.renderInstances(ce,De,G.count);else if(Y.isInstancedBufferGeometry){const Wt=Y._maxInstanceCount!==void 0?Y._maxInstanceCount:1/0,ke=Math.min(Y.instanceCount,Wt);ge.renderInstances(ce,De,ke)}else ge.render(ce,De)};function he(T,H,Y){T.transparent===!0&&T.side===tn&&T.forceSinglePass===!1?(T.side=rn,T.needsUpdate=!0,Ni(T,H,Y),T.side=Cn,T.needsUpdate=!0,Ni(T,H,Y),T.side=tn):Ni(T,H,Y)}this.compile=function(T,H,Y=null){Y===null&&(Y=T),p=bt.get(Y),p.init(H),b.push(p),Y.traverseVisible(function(G){G.isLight&&G.layers.test(H.layers)&&(p.pushLight(G),G.castShadow&&p.pushShadow(G))}),T!==Y&&T.traverseVisible(function(G){G.isLight&&G.layers.test(H.layers)&&(p.pushLight(G),G.castShadow&&p.pushShadow(G))}),p.setupLights();const J=new Set;return T.traverse(function(G){if(!(G.isMesh||G.isPoints||G.isLine||G.isSprite))return;const pt=G.material;if(pt)if(Array.isArray(pt))for(let Et=0;Et<pt.length;Et++){const Nt=pt[Et];he(Nt,Y,G),J.add(Nt)}else he(pt,Y,G),J.add(pt)}),p=b.pop(),J},this.compileAsync=function(T,H,Y=null){const J=this.compile(T,H,Y);return new Promise(G=>{function pt(){if(J.forEach(function(Et){yt.get(Et).currentProgram.isReady()&&J.delete(Et)}),J.size===0){G(T);return}setTimeout(pt,10)}se.get("KHR_parallel_shader_compile")!==null?pt():setTimeout(pt,10)})};let an=null;function Sn(T){an&&an(T)}function Ks(){kn.stop()}function Zs(){kn.start()}const kn=new xu;kn.setAnimationLoop(Sn),typeof self<"u"&&kn.setContext(self),this.setAnimationLoop=function(T){an=T,ht.setAnimationLoop(T),T===null?kn.stop():kn.start()},ht.addEventListener("sessionstart",Ks),ht.addEventListener("sessionend",Zs),this.render=function(T,H){if(H!==void 0&&H.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;if(T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),H.parent===null&&H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),ht.enabled===!0&&ht.isPresenting===!0&&(ht.cameraAutoUpdate===!0&&ht.updateCamera(H),H=ht.getCamera()),T.isScene===!0&&T.onBeforeRender(M,T,H,D),p=bt.get(T,b.length),p.init(H),b.push(p),_t.multiplyMatrices(H.projectionMatrix,H.matrixWorldInverse),X.setFromProjectionMatrix(_t),Q=this.localClippingEnabled,Z=Ot.init(this.clippingPlanes,Q),g=Bt.get(T,E.length),g.init(),E.push(g),ht.enabled===!0&&ht.isPresenting===!0){const pt=M.xr.getDepthSensingMesh();pt!==null&&Ss(pt,H,-1/0,M.sortObjects)}Ss(T,H,0,M.sortObjects),g.finish(),M.sortObjects===!0&&g.sort(at,dt),ee=ht.enabled===!1||ht.isPresenting===!1||ht.hasDepthSensing()===!1,ee&&ct.addToRenderList(g,T),this.info.render.frame++,Z===!0&&Ot.beginShadows();const Y=p.state.shadowsArray;kt.render(Y,T,H),Z===!0&&Ot.endShadows(),this.info.autoReset===!0&&this.info.reset();const J=g.opaque,G=g.transmissive;if(p.setupLights(),H.isArrayCamera){const pt=H.cameras;if(G.length>0)for(let Et=0,Nt=pt.length;Et<Nt;Et++){const Lt=pt[Et];bs(J,G,T,Lt)}ee&&ct.render(T);for(let Et=0,Nt=pt.length;Et<Nt;Et++){const Lt=pt[Et];Qs(g,T,Lt,Lt.viewport)}}else G.length>0&&bs(J,G,T,H),ee&&ct.render(T),Qs(g,T,H);D!==null&&P===0&&(oe.updateMultisampleRenderTarget(D),oe.updateRenderTargetMipmap(D)),T.isScene===!0&&T.onAfterRender(M,T,H),ie.resetDefaultState(),S=-1,y=null,b.pop(),b.length>0?(p=b[b.length-1],Z===!0&&Ot.setGlobalState(M.clippingPlanes,p.state.camera)):p=null,E.pop(),E.length>0?g=E[E.length-1]:g=null};function Ss(T,H,Y,J){if(T.visible===!1)return;if(T.layers.test(H.layers)){if(T.isGroup)Y=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(H);else if(T.isLight)p.pushLight(T),T.castShadow&&p.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||X.intersectsSprite(T)){J&&gt.setFromMatrixPosition(T.matrixWorld).applyMatrix4(_t);const Et=st.update(T),Nt=T.material;Nt.visible&&g.push(T,Et,Nt,Y,gt.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(!T.frustumCulled||X.intersectsObject(T))){const Et=st.update(T),Nt=T.material;if(J&&(T.boundingSphere!==void 0?(T.boundingSphere===null&&T.computeBoundingSphere(),gt.copy(T.boundingSphere.center)):(Et.boundingSphere===null&&Et.computeBoundingSphere(),gt.copy(Et.boundingSphere.center)),gt.applyMatrix4(T.matrixWorld).applyMatrix4(_t)),Array.isArray(Nt)){const Lt=Et.groups;for(let Kt=0,Zt=Lt.length;Kt<Zt;Kt++){const Ht=Lt[Kt],ce=Nt[Ht.materialIndex];ce&&ce.visible&&g.push(T,Et,ce,Y,gt.z,Ht)}}else Nt.visible&&g.push(T,Et,Nt,Y,gt.z,null)}}const pt=T.children;for(let Et=0,Nt=pt.length;Et<Nt;Et++)Ss(pt[Et],H,Y,J)}function Qs(T,H,Y,J){const G=T.opaque,pt=T.transmissive,Et=T.transparent;p.setupLightsView(Y),Z===!0&&Ot.setGlobalState(M.clippingPlanes,Y),J&&Mt.viewport(U.copy(J)),G.length>0&&Ii(G,H,Y),pt.length>0&&Ii(pt,H,Y),Et.length>0&&Ii(Et,H,Y),Mt.buffers.depth.setTest(!0),Mt.buffers.depth.setMask(!0),Mt.buffers.color.setMask(!0),Mt.setPolygonOffset(!1)}function bs(T,H,Y,J){if((Y.isScene===!0?Y.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[J.id]===void 0&&(p.state.transmissionRenderTarget[J.id]=new Di(1,1,{generateMipmaps:!0,type:se.has("EXT_color_buffer_half_float")||se.has("EXT_color_buffer_float")?js:zn,minFilter:$n,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:pe.workingColorSpace}));const pt=p.state.transmissionRenderTarget[J.id],Et=J.viewport||U;pt.setSize(Et.z*M.transmissionResolutionScale,Et.w*M.transmissionResolutionScale);const Nt=M.getRenderTarget();M.setRenderTarget(pt),M.getClearColor(q),K=M.getClearAlpha(),K<1&&M.setClearColor(16777215,.5),M.clear(),ee&&ct.render(Y);const Lt=M.toneMapping;M.toneMapping=fi;const Kt=J.viewport;if(J.viewport!==void 0&&(J.viewport=void 0),p.setupLightsView(J),Z===!0&&Ot.setGlobalState(M.clippingPlanes,J),Ii(T,Y,J),oe.updateMultisampleRenderTarget(pt),oe.updateRenderTargetMipmap(pt),se.has("WEBGL_multisampled_render_to_texture")===!1){let Zt=!1;for(let Ht=0,ce=H.length;Ht<ce;Ht++){const Se=H[Ht],De=Se.object,Ne=Se.geometry,ge=Se.material,Wt=Se.group;if(ge.side===tn&&De.layers.test(J.layers)){const ke=ge.side;ge.side=rn,ge.needsUpdate=!0,Es(De,Y,J,Ne,ge,Wt),ge.side=ke,ge.needsUpdate=!0,Zt=!0}}Zt===!0&&(oe.updateMultisampleRenderTarget(pt),oe.updateRenderTargetMipmap(pt))}M.setRenderTarget(Nt),M.setClearColor(q,K),Kt!==void 0&&(J.viewport=Kt),M.toneMapping=Lt}function Ii(T,H,Y){const J=H.isScene===!0?H.overrideMaterial:null;for(let G=0,pt=T.length;G<pt;G++){const Et=T[G],Nt=Et.object,Lt=Et.geometry,Kt=Et.group;let Zt=Et.material;Zt.allowOverride===!0&&J!==null&&(Zt=J),Nt.layers.test(Y.layers)&&Es(Nt,H,Y,Lt,Zt,Kt)}}function Es(T,H,Y,J,G,pt){T.onBeforeRender(M,H,Y,J,G,pt),T.modelViewMatrix.multiplyMatrices(Y.matrixWorldInverse,T.matrixWorld),T.normalMatrix.getNormalMatrix(T.modelViewMatrix),G.onBeforeRender(M,H,Y,J,T,pt),G.transparent===!0&&G.side===tn&&G.forceSinglePass===!1?(G.side=rn,G.needsUpdate=!0,M.renderBufferDirect(Y,H,J,G,T,pt),G.side=Cn,G.needsUpdate=!0,M.renderBufferDirect(Y,H,J,G,T,pt),G.side=tn):M.renderBufferDirect(Y,H,J,G,T,pt),T.onAfterRender(M,H,Y,J,G,pt)}function Ni(T,H,Y){H.isScene!==!0&&(H=te);const J=yt.get(T),G=p.state.lights,pt=p.state.shadowsArray,Et=G.state.version,Nt=lt.getParameters(T,G.state,pt,H,Y),Lt=lt.getProgramCacheKey(Nt);let Kt=J.programs;J.environment=T.isMeshStandardMaterial?H.environment:null,J.fog=H.fog,J.envMap=(T.isMeshStandardMaterial?F:Ee).get(T.envMap||J.environment),J.envMapRotation=J.environment!==null&&T.envMap===null?H.environmentRotation:T.envMapRotation,Kt===void 0&&(T.addEventListener("dispose",It),Kt=new Map,J.programs=Kt);let Zt=Kt.get(Lt);if(Zt!==void 0){if(J.currentProgram===Zt&&J.lightsStateVersion===Et)return er(T,Nt),Zt}else Nt.uniforms=lt.getUniforms(T),T.onBeforeCompile(Nt,M),Zt=lt.acquireProgram(Nt,Lt),Kt.set(Lt,Zt),J.uniforms=Nt.uniforms;const Ht=J.uniforms;return(!T.isShaderMaterial&&!T.isRawShaderMaterial||T.clipping===!0)&&(Ht.clippingPlanes=Ot.uniform),er(T,Nt),J.needsLights=xa(T),J.lightsStateVersion=Et,J.needsLights&&(Ht.ambientLightColor.value=G.state.ambient,Ht.lightProbe.value=G.state.probe,Ht.directionalLights.value=G.state.directional,Ht.directionalLightShadows.value=G.state.directionalShadow,Ht.spotLights.value=G.state.spot,Ht.spotLightShadows.value=G.state.spotShadow,Ht.rectAreaLights.value=G.state.rectArea,Ht.ltc_1.value=G.state.rectAreaLTC1,Ht.ltc_2.value=G.state.rectAreaLTC2,Ht.pointLights.value=G.state.point,Ht.pointLightShadows.value=G.state.pointShadow,Ht.hemisphereLights.value=G.state.hemi,Ht.directionalShadowMap.value=G.state.directionalShadowMap,Ht.directionalShadowMatrix.value=G.state.directionalShadowMatrix,Ht.spotShadowMap.value=G.state.spotShadowMap,Ht.spotLightMatrix.value=G.state.spotLightMatrix,Ht.spotLightMap.value=G.state.spotLightMap,Ht.pointShadowMap.value=G.state.pointShadowMap,Ht.pointShadowMatrix.value=G.state.pointShadowMatrix),J.currentProgram=Zt,J.uniformsList=null,Zt}function tr(T){if(T.uniformsList===null){const H=T.currentProgram.getUniforms();T.uniformsList=Kr.seqWithValue(H.seq,T.uniforms)}return T.uniformsList}function er(T,H){const Y=yt.get(T);Y.outputColorSpace=H.outputColorSpace,Y.batching=H.batching,Y.batchingColor=H.batchingColor,Y.instancing=H.instancing,Y.instancingColor=H.instancingColor,Y.instancingMorph=H.instancingMorph,Y.skinning=H.skinning,Y.morphTargets=H.morphTargets,Y.morphNormals=H.morphNormals,Y.morphColors=H.morphColors,Y.morphTargetsCount=H.morphTargetsCount,Y.numClippingPlanes=H.numClippingPlanes,Y.numIntersection=H.numClipIntersection,Y.vertexAlphas=H.vertexAlphas,Y.vertexTangents=H.vertexTangents,Y.toneMapping=H.toneMapping}function _a(T,H,Y,J,G){H.isScene!==!0&&(H=te),oe.resetTextureUnits();const pt=H.fog,Et=J.isMeshStandardMaterial?H.environment:null,Nt=D===null?M.outputColorSpace:D.isXRRenderTarget===!0?D.texture.colorSpace:ds,Lt=(J.isMeshStandardMaterial?F:Ee).get(J.envMap||Et),Kt=J.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,Zt=!!Y.attributes.tangent&&(!!J.normalMap||J.anisotropy>0),Ht=!!Y.morphAttributes.position,ce=!!Y.morphAttributes.normal,Se=!!Y.morphAttributes.color;let De=fi;J.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(De=M.toneMapping);const Ne=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,ge=Ne!==void 0?Ne.length:0,Wt=yt.get(J),ke=p.state.lights;if(Z===!0&&(Q===!0||T!==y)){const ze=T===y&&J.id===S;Ot.setState(J,T,ze)}let ve=!1;J.version===Wt.__version?(Wt.needsLights&&Wt.lightsStateVersion!==ke.state.version||Wt.outputColorSpace!==Nt||G.isBatchedMesh&&Wt.batching===!1||!G.isBatchedMesh&&Wt.batching===!0||G.isBatchedMesh&&Wt.batchingColor===!0&&G.colorTexture===null||G.isBatchedMesh&&Wt.batchingColor===!1&&G.colorTexture!==null||G.isInstancedMesh&&Wt.instancing===!1||!G.isInstancedMesh&&Wt.instancing===!0||G.isSkinnedMesh&&Wt.skinning===!1||!G.isSkinnedMesh&&Wt.skinning===!0||G.isInstancedMesh&&Wt.instancingColor===!0&&G.instanceColor===null||G.isInstancedMesh&&Wt.instancingColor===!1&&G.instanceColor!==null||G.isInstancedMesh&&Wt.instancingMorph===!0&&G.morphTexture===null||G.isInstancedMesh&&Wt.instancingMorph===!1&&G.morphTexture!==null||Wt.envMap!==Lt||J.fog===!0&&Wt.fog!==pt||Wt.numClippingPlanes!==void 0&&(Wt.numClippingPlanes!==Ot.numPlanes||Wt.numIntersection!==Ot.numIntersection)||Wt.vertexAlphas!==Kt||Wt.vertexTangents!==Zt||Wt.morphTargets!==Ht||Wt.morphNormals!==ce||Wt.morphColors!==Se||Wt.toneMapping!==De||Wt.morphTargetsCount!==ge)&&(ve=!0):(ve=!0,Wt.__version=J.version);let on=Wt.currentProgram;ve===!0&&(on=Ni(J,H,G));let Ue=!1,Xe=!1,gi=!1;const Pe=on.getUniforms(),en=Wt.uniforms;if(Mt.useProgram(on.program)&&(Ue=!0,Xe=!0,gi=!0),J.id!==S&&(S=J.id,Xe=!0),Ue||y!==T){Mt.buffers.depth.getReversed()?(et.copy(T.projectionMatrix),kd(et),Vd(et),Pe.setValue(O,"projectionMatrix",et)):Pe.setValue(O,"projectionMatrix",T.projectionMatrix),Pe.setValue(O,"viewMatrix",T.matrixWorldInverse);const Ve=Pe.map.cameraPosition;Ve!==void 0&&Ve.setValue(O,ot.setFromMatrixPosition(T.matrixWorld)),re.logarithmicDepthBuffer&&Pe.setValue(O,"logDepthBufFC",2/(Math.log(T.far+1)/Math.LN2)),(J.isMeshPhongMaterial||J.isMeshToonMaterial||J.isMeshLambertMaterial||J.isMeshBasicMaterial||J.isMeshStandardMaterial||J.isShaderMaterial)&&Pe.setValue(O,"isOrthographic",T.isOrthographicCamera===!0),y!==T&&(y=T,Xe=!0,gi=!0)}if(G.isSkinnedMesh){Pe.setOptional(O,G,"bindMatrix"),Pe.setOptional(O,G,"bindMatrixInverse");const ze=G.skeleton;ze&&(ze.boneTexture===null&&ze.computeBoneTexture(),Pe.setValue(O,"boneTexture",ze.boneTexture,oe))}G.isBatchedMesh&&(Pe.setOptional(O,G,"batchingTexture"),Pe.setValue(O,"batchingTexture",G._matricesTexture,oe),Pe.setOptional(O,G,"batchingIdTexture"),Pe.setValue(O,"batchingIdTexture",G._indirectTexture,oe),Pe.setOptional(O,G,"batchingColorTexture"),G._colorsTexture!==null&&Pe.setValue(O,"batchingColorTexture",G._colorsTexture,oe));const Ke=Y.morphAttributes;if((Ke.position!==void 0||Ke.normal!==void 0||Ke.color!==void 0)&&Ct.update(G,Y,on),(Xe||Wt.receiveShadow!==G.receiveShadow)&&(Wt.receiveShadow=G.receiveShadow,Pe.setValue(O,"receiveShadow",G.receiveShadow)),J.isMeshGouraudMaterial&&J.envMap!==null&&(en.envMap.value=Lt,en.flipEnvMap.value=Lt.isCubeTexture&&Lt.isRenderTargetTexture===!1?-1:1),J.isMeshStandardMaterial&&J.envMap===null&&H.environment!==null&&(en.envMapIntensity.value=H.environmentIntensity),Xe&&(Pe.setValue(O,"toneMappingExposure",M.toneMappingExposure),Wt.needsLights&&va(en,gi),pt&&J.fog===!0&&nt.refreshFogUniforms(en,pt),nt.refreshMaterialUniforms(en,J,W,tt,p.state.transmissionRenderTarget[T.id]),Kr.upload(O,tr(Wt),en,oe)),J.isShaderMaterial&&J.uniformsNeedUpdate===!0&&(Kr.upload(O,tr(Wt),en,oe),J.uniformsNeedUpdate=!1),J.isSpriteMaterial&&Pe.setValue(O,"center",G.center),Pe.setValue(O,"modelViewMatrix",G.modelViewMatrix),Pe.setValue(O,"normalMatrix",G.normalMatrix),Pe.setValue(O,"modelMatrix",G.matrixWorld),J.isShaderMaterial||J.isRawShaderMaterial){const ze=J.uniformsGroups;for(let Ve=0,Fi=ze.length;Ve<Fi;Ve++){const Vn=ze[Ve];V.update(Vn,on),V.bind(Vn,on)}}return on}function va(T,H){T.ambientLightColor.needsUpdate=H,T.lightProbe.needsUpdate=H,T.directionalLights.needsUpdate=H,T.directionalLightShadows.needsUpdate=H,T.pointLights.needsUpdate=H,T.pointLightShadows.needsUpdate=H,T.spotLights.needsUpdate=H,T.spotLightShadows.needsUpdate=H,T.rectAreaLights.needsUpdate=H,T.hemisphereLights.needsUpdate=H}function xa(T){return T.isMeshLambertMaterial||T.isMeshToonMaterial||T.isMeshPhongMaterial||T.isMeshStandardMaterial||T.isShadowMaterial||T.isShaderMaterial&&T.lights===!0}this.getActiveCubeFace=function(){return C},this.getActiveMipmapLevel=function(){return P},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(T,H,Y){const J=yt.get(T);J.__autoAllocateDepthBuffer=T.resolveDepthBuffer===!1,J.__autoAllocateDepthBuffer===!1&&(J.__useRenderToTexture=!1),yt.get(T.texture).__webglTexture=H,yt.get(T.depthTexture).__webglTexture=J.__autoAllocateDepthBuffer?void 0:Y,J.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(T,H){const Y=yt.get(T);Y.__webglFramebuffer=H,Y.__useDefaultFramebuffer=H===void 0};const ya=O.createFramebuffer();this.setRenderTarget=function(T,H=0,Y=0){D=T,C=H,P=Y;let J=!0,G=null,pt=!1,Et=!1;if(T){const Lt=yt.get(T);if(Lt.__useDefaultFramebuffer!==void 0)Mt.bindFramebuffer(O.FRAMEBUFFER,null),J=!1;else if(Lt.__webglFramebuffer===void 0)oe.setupRenderTarget(T);else if(Lt.__hasExternalTextures)oe.rebindTextures(T,yt.get(T.texture).__webglTexture,yt.get(T.depthTexture).__webglTexture);else if(T.depthBuffer){const Ht=T.depthTexture;if(Lt.__boundDepthTexture!==Ht){if(Ht!==null&&yt.has(Ht)&&(T.width!==Ht.image.width||T.height!==Ht.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");oe.setupDepthRenderbuffer(T)}}const Kt=T.texture;(Kt.isData3DTexture||Kt.isDataArrayTexture||Kt.isCompressedArrayTexture)&&(Et=!0);const Zt=yt.get(T).__webglFramebuffer;T.isWebGLCubeRenderTarget?(Array.isArray(Zt[H])?G=Zt[H][Y]:G=Zt[H],pt=!0):T.samples>0&&oe.useMultisampledRTT(T)===!1?G=yt.get(T).__webglMultisampledFramebuffer:Array.isArray(Zt)?G=Zt[Y]:G=Zt,U.copy(T.viewport),B.copy(T.scissor),k=T.scissorTest}else U.copy(mt).multiplyScalar(W).floor(),B.copy(Rt).multiplyScalar(W).floor(),k=wt;if(Y!==0&&(G=ya),Mt.bindFramebuffer(O.FRAMEBUFFER,G)&&J&&Mt.drawBuffers(T,G),Mt.viewport(U),Mt.scissor(B),Mt.setScissorTest(k),pt){const Lt=yt.get(T.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+H,Lt.__webglTexture,Y)}else if(Et){const Lt=yt.get(T.texture),Kt=H;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,Lt.__webglTexture,Y,Kt)}else if(T!==null&&Y!==0){const Lt=yt.get(T.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,Lt.__webglTexture,Y)}S=-1},this.readRenderTargetPixels=function(T,H,Y,J,G,pt,Et,Nt=0){if(!(T&&T.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Lt=yt.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&Et!==void 0&&(Lt=Lt[Et]),Lt){Mt.bindFramebuffer(O.FRAMEBUFFER,Lt);try{const Kt=T.textures[Nt],Zt=Kt.format,Ht=Kt.type;if(!re.textureFormatReadable(Zt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!re.textureTypeReadable(Ht)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}H>=0&&H<=T.width-J&&Y>=0&&Y<=T.height-G&&(T.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Nt),O.readPixels(H,Y,J,G,St.convert(Zt),St.convert(Ht),pt))}finally{const Kt=D!==null?yt.get(D).__webglFramebuffer:null;Mt.bindFramebuffer(O.FRAMEBUFFER,Kt)}}},this.readRenderTargetPixelsAsync=async function(T,H,Y,J,G,pt,Et,Nt=0){if(!(T&&T.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Lt=yt.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&Et!==void 0&&(Lt=Lt[Et]),Lt)if(H>=0&&H<=T.width-J&&Y>=0&&Y<=T.height-G){Mt.bindFramebuffer(O.FRAMEBUFFER,Lt);const Kt=T.textures[Nt],Zt=Kt.format,Ht=Kt.type;if(!re.textureFormatReadable(Zt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!re.textureTypeReadable(Ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const ce=O.createBuffer();O.bindBuffer(O.PIXEL_PACK_BUFFER,ce),O.bufferData(O.PIXEL_PACK_BUFFER,pt.byteLength,O.STREAM_READ),T.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Nt),O.readPixels(H,Y,J,G,St.convert(Zt),St.convert(Ht),0);const Se=D!==null?yt.get(D).__webglFramebuffer:null;Mt.bindFramebuffer(O.FRAMEBUFFER,Se);const De=O.fenceSync(O.SYNC_GPU_COMMANDS_COMPLETE,0);return O.flush(),await Bd(O,De,4),O.bindBuffer(O.PIXEL_PACK_BUFFER,ce),O.getBufferSubData(O.PIXEL_PACK_BUFFER,0,pt),O.deleteBuffer(ce),O.deleteSync(De),pt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(T,H=null,Y=0){const J=Math.pow(2,-Y),G=Math.floor(T.image.width*J),pt=Math.floor(T.image.height*J),Et=H!==null?H.x:0,Nt=H!==null?H.y:0;oe.setTexture2D(T,0),O.copyTexSubImage2D(O.TEXTURE_2D,Y,0,0,Et,Nt,G,pt),Mt.unbindTexture()};const Ma=O.createFramebuffer(),Sa=O.createFramebuffer();this.copyTextureToTexture=function(T,H,Y=null,J=null,G=0,pt=null){pt===null&&(G!==0?(os("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),pt=G,G=0):pt=0);let Et,Nt,Lt,Kt,Zt,Ht,ce,Se,De;const Ne=T.isCompressedTexture?T.mipmaps[pt]:T.image;if(Y!==null)Et=Y.max.x-Y.min.x,Nt=Y.max.y-Y.min.y,Lt=Y.isBox3?Y.max.z-Y.min.z:1,Kt=Y.min.x,Zt=Y.min.y,Ht=Y.isBox3?Y.min.z:0;else{const Ke=Math.pow(2,-G);Et=Math.floor(Ne.width*Ke),Nt=Math.floor(Ne.height*Ke),T.isDataArrayTexture?Lt=Ne.depth:T.isData3DTexture?Lt=Math.floor(Ne.depth*Ke):Lt=1,Kt=0,Zt=0,Ht=0}J!==null?(ce=J.x,Se=J.y,De=J.z):(ce=0,Se=0,De=0);const ge=St.convert(H.format),Wt=St.convert(H.type);let ke;H.isData3DTexture?(oe.setTexture3D(H,0),ke=O.TEXTURE_3D):H.isDataArrayTexture||H.isCompressedArrayTexture?(oe.setTexture2DArray(H,0),ke=O.TEXTURE_2D_ARRAY):(oe.setTexture2D(H,0),ke=O.TEXTURE_2D),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,H.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,H.unpackAlignment);const ve=O.getParameter(O.UNPACK_ROW_LENGTH),on=O.getParameter(O.UNPACK_IMAGE_HEIGHT),Ue=O.getParameter(O.UNPACK_SKIP_PIXELS),Xe=O.getParameter(O.UNPACK_SKIP_ROWS),gi=O.getParameter(O.UNPACK_SKIP_IMAGES);O.pixelStorei(O.UNPACK_ROW_LENGTH,Ne.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,Ne.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,Kt),O.pixelStorei(O.UNPACK_SKIP_ROWS,Zt),O.pixelStorei(O.UNPACK_SKIP_IMAGES,Ht);const Pe=T.isDataArrayTexture||T.isData3DTexture,en=H.isDataArrayTexture||H.isData3DTexture;if(T.isDepthTexture){const Ke=yt.get(T),ze=yt.get(H),Ve=yt.get(Ke.__renderTarget),Fi=yt.get(ze.__renderTarget);Mt.bindFramebuffer(O.READ_FRAMEBUFFER,Ve.__webglFramebuffer),Mt.bindFramebuffer(O.DRAW_FRAMEBUFFER,Fi.__webglFramebuffer);for(let Vn=0;Vn<Lt;Vn++)Pe&&(O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,yt.get(T).__webglTexture,G,Ht+Vn),O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,yt.get(H).__webglTexture,pt,De+Vn)),O.blitFramebuffer(Kt,Zt,Et,Nt,ce,Se,Et,Nt,O.DEPTH_BUFFER_BIT,O.NEAREST);Mt.bindFramebuffer(O.READ_FRAMEBUFFER,null),Mt.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else if(G!==0||T.isRenderTargetTexture||yt.has(T)){const Ke=yt.get(T),ze=yt.get(H);Mt.bindFramebuffer(O.READ_FRAMEBUFFER,Ma),Mt.bindFramebuffer(O.DRAW_FRAMEBUFFER,Sa);for(let Ve=0;Ve<Lt;Ve++)Pe?O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,Ke.__webglTexture,G,Ht+Ve):O.framebufferTexture2D(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,Ke.__webglTexture,G),en?O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,ze.__webglTexture,pt,De+Ve):O.framebufferTexture2D(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,ze.__webglTexture,pt),G!==0?O.blitFramebuffer(Kt,Zt,Et,Nt,ce,Se,Et,Nt,O.COLOR_BUFFER_BIT,O.NEAREST):en?O.copyTexSubImage3D(ke,pt,ce,Se,De+Ve,Kt,Zt,Et,Nt):O.copyTexSubImage2D(ke,pt,ce,Se,Kt,Zt,Et,Nt);Mt.bindFramebuffer(O.READ_FRAMEBUFFER,null),Mt.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else en?T.isDataTexture||T.isData3DTexture?O.texSubImage3D(ke,pt,ce,Se,De,Et,Nt,Lt,ge,Wt,Ne.data):H.isCompressedArrayTexture?O.compressedTexSubImage3D(ke,pt,ce,Se,De,Et,Nt,Lt,ge,Ne.data):O.texSubImage3D(ke,pt,ce,Se,De,Et,Nt,Lt,ge,Wt,Ne):T.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,pt,ce,Se,Et,Nt,ge,Wt,Ne.data):T.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,pt,ce,Se,Ne.width,Ne.height,ge,Ne.data):O.texSubImage2D(O.TEXTURE_2D,pt,ce,Se,Et,Nt,ge,Wt,Ne);O.pixelStorei(O.UNPACK_ROW_LENGTH,ve),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,on),O.pixelStorei(O.UNPACK_SKIP_PIXELS,Ue),O.pixelStorei(O.UNPACK_SKIP_ROWS,Xe),O.pixelStorei(O.UNPACK_SKIP_IMAGES,gi),pt===0&&H.generateMipmaps&&O.generateMipmap(ke),Mt.unbindTexture()},this.copyTextureToTexture3D=function(T,H,Y=null,J=null,G=0){return os('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(T,H,Y,J,G)},this.initRenderTarget=function(T){yt.get(T).__webglFramebuffer===void 0&&oe.setupRenderTarget(T)},this.initTexture=function(T){T.isCubeTexture?oe.setTextureCube(T,0):T.isData3DTexture?oe.setTexture3D(T,0):T.isDataArrayTexture||T.isCompressedArrayTexture?oe.setTexture2DArray(T,0):oe.setTexture2D(T,0),Mt.unbindTexture()},this.resetState=function(){C=0,P=0,D=null,Mt.reset(),ie.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Kn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=pe._getDrawingBufferColorSpace(t),e.unpackColorSpace=pe._getUnpackColorSpace()}}var j2=Object.defineProperty,Y2=(s,t,e)=>t in s?j2(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,we=(s,t,e)=>Y2(s,typeof t!="symbol"?t+"":t,e);const Eu=(s,t)=>{const[e,n]=t.split("-");return Object.assign(s.style,{left:n==="left"?"0":n==="center"?"50%":"",right:n==="right"?"0":"",top:e==="top"?"0":e==="bottom"?"":"50%",bottom:e==="bottom"?"0":"",transform:`${n==="center"?"translateX(-50%)":""} ${e==="center"?"translateY(-50%)":""}`}),t},J2=({placement:s,size:t,offset:e,id:n,className:i})=>{const r=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=e;return Object.assign(r.style,{id:n,position:"absolute",zIndex:"1000",height:`${t}px`,width:`${t}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),Eu(r,s),n&&(r.id=n),i&&(r.className=i),r},$2=s=>{const t=typeof s=="string"?document.querySelector(s):s;if(!t)throw Error("Invalid DOM element");return t};function ol(s,t,e){return Math.max(t,Math.min(e,s))}const K2=[["x",0,3],["y",1,4],["z",2,5]],fh=new N;function ph({isSphere:s},t,e){s&&(fh.set(0,0,1).applyQuaternion(e.quaternion),K2.forEach(([n,i,r])=>{const a=fh[n];let o=t[i],l=o.userData.opacity;o.material.opacity=ol(a>=0?l:l/2,0,1),o=t[r],l=o.userData.opacity,o.material.opacity=ol(a>=0?l/2:l,0,1)}))}const Z2=(s,t,e=10)=>Math.abs(s.clientX-t.x)<e&&Math.abs(s.clientY-t.y)<e,mh=new ap,gh=new Dt,_h=(s,t,e,n)=>{gh.set((s.clientX-t.left)/t.width*2-1,-((s.clientY-t.top)/t.height)*2+1),mh.setFromCamera(gh,e);const i=mh.intersectObjects(n,!1),r=i.length?i[0]:null;return!r||!r.object.visible?null:r},lo=1e-6,Q2=2*Math.PI,wu=["x","y","z"],qs=[...wu,"nx","ny","nz"],tg=["x","z","y","nx","nz","ny"],eg=["z","x","y","nz","nx","ny"],ll="Right",Zr="Top",cl="Front",hl="Left",Qr="Bottom",ul="Back",ng=[ll,Zr,cl,hl,Qr,ul].map(s=>s.toLocaleLowerCase()),Au=1.3,vh=(s,t=!0)=>{const{material:e,userData:n}=s,{color:i,opacity:r}=t?n.hover:n;e.color.set(i),e.opacity=r},bi=s=>JSON.parse(JSON.stringify(s)),ig=s=>{const t=s.type||"sphere",e=t==="sphere",n=s.resolution||e?64:128,i=Ce.DEFAULT_UP,r=i.z===1,a=i.x===1,{container:o}=s;s.container=void 0,s=JSON.parse(JSON.stringify(s)),s.container=o;const l=r?tg:a?eg:qs;ng.forEach((d,f)=>{s[d]&&(s[l[f]]=s[d])});const c={enabled:!0,color:16777215,opacity:1,scale:.7,labelColor:2236962,line:!1,border:{size:0,color:14540253},hover:{color:e?16777215:9688043,labelColor:2236962,opacity:1,scale:.7,border:{size:0,color:14540253}}},h={line:!1,scale:e?.45:.7,hover:{scale:e?.5:.7}},u={type:t,container:document.body,size:128,placement:"top-right",resolution:n,lineWidth:4,radius:e?1:.2,smoothness:18,animated:!0,speed:1,background:{enabled:!0,color:e?16777215:14739180,opacity:e?0:1,hover:{color:e?16777215:14739180,opacity:e?.2:1}},font:{family:"sans-serif",weight:900},offset:{top:10,left:10,bottom:10,right:10},corners:{enabled:!e,color:e?15915362:16777215,opacity:1,scale:e?.15:.2,radius:1,smoothness:18,hover:{color:e?16777215:9688043,opacity:1,scale:e?.2:.225}},edges:{enabled:!e,color:e?15915362:16777215,opacity:e?1:0,radius:e?1:.125,smoothness:18,scale:e?.15:1,hover:{color:e?16777215:9688043,opacity:1,scale:e?.2:1}},x:{...bi(c),...e?{label:"X",color:16725587,line:!0}:{label:a?Zr:ll}},y:{...bi(c),...e?{label:"Y",color:9100032,line:!0}:{label:r||a?cl:Zr}},z:{...bi(c),...e?{label:"Z",color:2920447,line:!0}:{label:r?Zr:a?ll:cl}},nx:{...bi(h),label:e?"":a?Qr:hl},ny:{...bi(h),label:e?"":r||a?ul:Qr},nz:{...bi(h),label:e?"":r?Qr:a?hl:ul}};return dl(s,u),wu.forEach(d=>dl(s[`n${d}`],bi(s[d]))),{...s,isSphere:e}};function dl(s,...t){if(s instanceof HTMLElement||typeof s!="object"||s===null)return s;for(const e of t)for(const n in e)n!=="container"&&n in e&&(s[n]===void 0?s[n]=e[n]:typeof e[n]=="object"&&!Array.isArray(e[n])&&(s[n]=dl(s[n]||{},e[n])));return s}const sg=(s,t=2)=>{const e=new jt,n=t*2,{isSphere:i,resolution:r,radius:a,font:o,corners:l,edges:c}=s,h=qs.map(P=>({...s[P],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const u=document.createElement("canvas"),d=u.getContext("2d");u.width=r*2+n*2,u.height=r*h.length+n*h.length;const[f,m]=I(h,r,o);h.forEach(({radius:P,label:D,color:S,labelColor:y,border:U,hover:{color:B,labelColor:k,border:q}},K)=>{const z=r*K+K*n+t;M(t,z,t,r,P,D,U,S,y),M(r+t*3,z,t,r,P,D,q??U,B??S,k??y)});const _=h.length,g=t/(r*2),p=t/(r*6),E=1/_,b=new xf(u);return b.repeat.set(.5-2*g,E-2*p),b.offset.set(g,1-p),Object.assign(b,{colorSpace:Me,wrapS:Nn,wrapT:Nn,userData:{offsetX:g,offsetY:p,cellHeight:E}}),b;function M(P,D,S,y,U,B,k,q,K){if(U=U*(y/2),q!=null&&q!==""&&(z(),d.fillStyle=e.set(q).getStyle(),d.fill()),k&&k.size){const tt=k.size*y/2;P+=tt,D+=tt,y-=k.size*y,U=Math.max(0,U-tt),z(),d.strokeStyle=e.set(k.color).getStyle(),d.lineWidth=k.size*y,d.stroke()}B&&C(d,P+y/2,D+(y+S)/2,B,e.set(K).getStyle());function z(){d.beginPath(),d.moveTo(P+U,D),d.lineTo(P+y-U,D),d.arcTo(P+y,D,P+y,D+U,U),d.lineTo(P+y,D+y-U),d.arcTo(P+y,D+y,P+y-U,D+y,U),d.lineTo(P+U,D+y),d.arcTo(P,D+y,P,D+y-U,U),d.lineTo(P,D+U),d.arcTo(P,D,P+U,D,U),d.closePath()}}function I(P,D,S){const y=[...P].sort((dt,mt)=>{var Rt,wt;return(((Rt=dt.label)==null?void 0:Rt.length)||0)-(((wt=mt.label)==null?void 0:wt.length)||0)}).pop().label,{family:U,weight:B}=S,k=i?Math.sqrt(Math.pow(D*.7,2)/2):D;let q=k,K=0,z=0;do{d.font=`${B} ${q}px ${U}`;const dt=d.measureText(y);K=dt.width,z=dt.fontBoundingBoxDescent,q--}while(K>k&&q>0);const tt=k/z,W=Math.min(k/K,tt),at=Math.floor(q*W);return[`${B} ${at}px ${U}`,tt]}function C(P,D,S,y,U){P.font=f,P.textAlign="center",P.textBaseline="middle",P.fillStyle=U,P.fillText(y,D,S+(i?m:0))}},rg=(s,t)=>s.offset.x=(t?.5:0)+s.userData.offsetX,zl=(s,t)=>{const{offset:e,userData:{offsetY:n,cellHeight:i}}=s;e.y=1-(t+1)*i+n};function Bl(s,t,e=2,n=2){const i=e/2-s,r=n/2-s,a=s/e,o=(e-s)/e,l=s/n,c=(n-s)/n,h=[i,r,0,-i,r,0,-i,-r,0,i,-r,0],u=[o,c,a,c,a,l,o,l],d=[3*(t+1)+3,3*(t+1)+4,t+4,t+5,2*(t+1)+4,2,1,2*(t+1)+3,3,4*(t+1)+3,4,0],f=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11].map(C=>d[C]);let m,_,g,p,E,b,M,I;for(let C=0;C<4;C++){p=C<1||C>2?i:-i,E=C<2?r:-r,b=C<1||C>2?o:a,M=C<2?c:l;for(let P=0;P<=t;P++)m=Math.PI/2*(C+P/t),_=Math.cos(m),g=Math.sin(m),h.push(p+s*_,E+s*g,0),u.push(b+a*_,M+l*g),P<t&&(I=(t+1)*C+P+4,f.push(C,I,I+1))}return new Ie().setIndex(new Oe(new Uint32Array(f),1)).setAttribute("position",new Oe(new Float32Array(h),3)).setAttribute("uv",new Oe(new Float32Array(u),2))}const ag=(s,t)=>{const e=new N,{isSphere:n,radius:i,smoothness:r}=s,a=Bl(i,r);return qs.map((o,l)=>{const c=l<3,h=qs[l],u=l?t.clone():t;zl(u,l);const{enabled:d,scale:f,opacity:m,hover:_}=s[h],g={map:u,opacity:m,transparent:!0},p=n?new Al(new ua(g)):new be(a,new mi(g)),E=c?h:h[1];return p.position[E]=(c?1:-1)*(n?Au:1),n||p.lookAt(e.copy(p.position).multiplyScalar(1.7)),p.scale.setScalar(f),p.renderOrder=1,p.visible=d,p.userData={scale:f,opacity:m,hover:_},p})},og=(s,t)=>{const{isSphere:e,corners:n}=s;if(!n.enabled)return[];const{color:i,opacity:r,scale:a,radius:o,smoothness:l,hover:c}=n,h=e?null:Bl(o,l),u={transparent:!0,opacity:r},d=[1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,-1,-1].map(m=>m*.85),f=new N;return Array(d.length/3).fill(0).map((m,_)=>{if(e){const E=t.clone();zl(E,6),u.map=E}else u.color=i;const g=e?new Al(new ua(u)):new be(h,new mi(u)),p=_*3;return g.position.set(d[p],d[p+1],d[p+2]),e&&g.position.normalize().multiplyScalar(1.7),g.scale.setScalar(a),g.lookAt(f.copy(g.position).multiplyScalar(2)),g.renderOrder=1,g.userData={color:i,opacity:r,scale:a,hover:c},g})},lg=(s,t,e)=>{const{isSphere:n,edges:i}=s;if(!i.enabled)return[];const{color:r,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,u=n?null:Bl(c,h,1.2,.25),d={transparent:!0,opacity:a},f=[0,1,1,0,-1,1,1,0,1,-1,0,1,0,1,-1,0,-1,-1,1,0,-1,-1,0,-1,1,1,0,1,-1,0,-1,1,0,-1,-1,0].map(g=>g*.925),m=new N,_=new N(0,1,0);return Array(f.length/3).fill(0).map((g,p)=>{if(n){const M=t.clone();zl(M,e),d.map=M}else d.color=r;const E=n?new Al(new ua(d)):new be(u,new mi(d)),b=p*3;return E.position.set(f[b],f[b+1],f[b+2]),n&&E.position.normalize().multiplyScalar(1.7),E.scale.setScalar(o),E.up.copy(_),E.lookAt(m.copy(E.position).multiplyScalar(2)),!n&&!E.position.y&&(E.rotation.z=Math.PI/2),E.renderOrder=1,E.userData={color:r,opacity:a,scale:o,hover:l},E})};function cg(s,t=!1){const e=s[0].index!==null,n=new Set(Object.keys(s[0].attributes)),i=new Set(Object.keys(s[0].morphAttributes)),r={},a={},o=s[0].morphTargetsRelative,l=new Ie;let c=0;for(let h=0;h<s.length;++h){const u=s[h];let d=0;if(e!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const f in u.attributes){if(!n.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;r[f]===void 0&&(r[f]=[]),r[f].push(u.attributes[f]),d++}if(d!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const f in u.morphAttributes){if(!i.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[f]===void 0&&(a[f]=[]),a[f].push(u.morphAttributes[f])}if(t){let f;if(e)f=u.index.count;else if(u.attributes.position!==void 0)f=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,f,h),c+=f}}if(e){let h=0;const u=[];for(let d=0;d<s.length;++d){const f=s[d].index;for(let m=0;m<f.count;++m)u.push(f.getX(m)+h);h+=s[d].attributes.position.count}l.setIndex(u)}for(const h in r){const u=xh(r[h]);if(!u)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,u)}for(const h in a){const u=a[h][0].length;if(u===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let d=0;d<u;++d){const f=[];for(let _=0;_<a[h].length;++_)f.push(a[h][_][d]);const m=xh(f);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(m)}}return l}function xh(s){let t,e,n,i=-1,r=0;for(let c=0;c<s.length;++c){const h=s[c];if(t===void 0&&(t=h.array.constructor),t!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(e===void 0&&(e=h.itemSize),e!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=h.normalized),n!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=h.gpuType),i!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;r+=h.count*e}const a=new t(r),o=new Oe(a,e,n);let l=0;for(let c=0;c<s.length;++c){const h=s[c];if(h.isInterleavedBufferAttribute){const u=l/e;for(let d=0,f=h.count;d<f;d++)for(let m=0;m<e;m++){const _=h.getComponent(d,m);o.setComponent(d+u,m,_)}}else a.set(h.array,l);l+=h.count*e}return i!==void 0&&(o.gpuType=i),o}const hg=(s,t)=>{const{isSphere:e,background:{enabled:n,color:i,opacity:r,hover:a}}=t;let o;const l=new mi({color:i,side:rn,opacity:r,transparent:!0,depthWrite:!1});if(!n)return null;if(e)o=new be(new da(1.8,64,64),l);else{let c;s.forEach(h=>{const u=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const d=h.geometry.clone();d.applyMatrix4(h.matrix),c=c?cg([c,d]):d,h.scale.setScalar(u)}),o=new be(c,l)}return o.userData={color:i,opacity:r,hover:a},o},yh=new Bn,Fr=new N;class Tu extends ip{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new le(t,3)),this.setAttribute("uv",new le(e,2))}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new sl(e,6,1);return this.setAttribute("instanceStart",new On(n,3,0)),this.setAttribute("instanceEnd",new On(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new sl(e,6,1);return this.setAttribute("instanceColorStart",new On(n,3,0)),this.setAttribute("instanceColorEnd",new On(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Nf(t.geometry)),this}fromLineSegments(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Bn);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),yh.setFromBufferAttribute(e),this.boundingBox.union(yh))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ei),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let r=0,a=t.count;r<a;r++)Fr.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(Fr)),Fr.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(Fr));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}xt.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Dt(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};hn.line={uniforms:El.merge([xt.common,xt.fog,xt.line]),vertexShader:`
3827
+ }`;class f2{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){const i=new Ke,r=t.properties.get(i);r.__webglTexture=e.texture,(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,n=new ti({vertexShader:u2,fragmentShader:d2,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new be(new Xs(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class p2 extends Di{constructor(t,e){super();const n=this;let i=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,p=null,m=null;const _=new f2,g=e.getContextAttributes();let f=null,b=null;const w=[],S=[],I=new Qt;let L=null;const P=new $e;P.viewport=new me;const D=new $e;D.viewport=new me;const M=[P,D],y=new Lf;let U=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let Z=w[X];return Z===void 0&&(Z=new Va,w[X]=Z),Z.getTargetRaySpace()},this.getControllerGrip=function(X){let Z=w[X];return Z===void 0&&(Z=new Va,w[X]=Z),Z.getGripSpace()},this.getHand=function(X){let Z=w[X];return Z===void 0&&(Z=new Va,w[X]=Z),Z.getHandSpace()};function k(X){const Z=S.indexOf(X.inputSource);if(Z===-1)return;const Q=w[Z];Q!==void 0&&(Q.update(X.inputSource,X.frame,c||a),Q.dispatchEvent({type:X.type,data:X.inputSource}))}function q(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",q),i.removeEventListener("inputsourceschange",J);for(let X=0;X<w.length;X++){const Z=S[X];Z!==null&&(S[X]=null,w[X].disconnect(Z))}U=null,B=null,_.reset(),t.setRenderTarget(f),p=null,d=null,u=null,i=null,b=null,wt.stop(),n.isPresenting=!1,t.setPixelRatio(L),t.setSize(I.width,I.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){r=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){o=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(X){c=X},this.getBaseLayer=function(){return d!==null?d:p},this.getBinding=function(){return u},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(X){if(i=X,i!==null){if(f=t.getRenderTarget(),i.addEventListener("select",k),i.addEventListener("selectstart",k),i.addEventListener("selectend",k),i.addEventListener("squeeze",k),i.addEventListener("squeezestart",k),i.addEventListener("squeezeend",k),i.addEventListener("end",q),i.addEventListener("inputsourceschange",J),g.xrCompatible!==!0&&await e.makeXRCompatible(),L=t.getPixelRatio(),t.getSize(I),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let Q=null,et=null,_t=null;g.depth&&(_t=g.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Q=g.stencil?Vs:ks,et=g.stencil?Bs:Li);const ot={colorFormat:e.RGBA8,depthFormat:_t,scaleFactor:r};u=new XRWebGLBinding(i,e),d=u.createProjectionLayer(ot),i.updateRenderState({layers:[d]}),t.setPixelRatio(1),t.setSize(d.textureWidth,d.textureHeight,!1),b=new Pi(d.textureWidth,d.textureHeight,{format:yn,type:zn,depthTexture:new Qh(d.textureWidth,d.textureHeight,et,void 0,void 0,void 0,void 0,void 0,void 0,Q),stencilBuffer:g.stencil,colorSpace:t.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const Q={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};p=new XRWebGLLayer(i,e,Q),i.updateRenderState({baseLayer:p}),t.setPixelRatio(1),t.setSize(p.framebufferWidth,p.framebufferHeight,!1),b=new Pi(p.framebufferWidth,p.framebufferHeight,{format:yn,type:zn,colorSpace:t.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),wt.setContext(i),wt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function J(X){for(let Z=0;Z<X.removed.length;Z++){const Q=X.removed[Z],et=S.indexOf(Q);et>=0&&(S[et]=null,w[et].disconnect(Q))}for(let Z=0;Z<X.added.length;Z++){const Q=X.added[Z];let et=S.indexOf(Q);if(et===-1){for(let ot=0;ot<w.length;ot++)if(ot>=S.length){S.push(Q),et=ot;break}else if(S[ot]===null){S[ot]=Q,et=ot;break}if(et===-1)break}const _t=w[et];_t&&_t.connect(Q)}}const z=new O,tt=new O;function W(X,Z,Q){z.setFromMatrixPosition(Z.matrixWorld),tt.setFromMatrixPosition(Q.matrixWorld);const et=z.distanceTo(tt),_t=Z.projectionMatrix.elements,ot=Q.projectionMatrix.elements,gt=_t[14]/(_t[10]-1),te=_t[14]/(_t[10]+1),ee=(_t[9]+1)/_t[5],jt=(_t[9]-1)/_t[5],F=(_t[8]-1)/_t[0],_e=(ot[8]+1)/ot[0],se=gt*F,re=gt*_e,Mt=et/(-F+_e),ne=Mt*-F;if(Z.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(ne),X.translateZ(Mt),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert(),_t[10]===-1)X.projectionMatrix.copy(Z.projectionMatrix),X.projectionMatrixInverse.copy(Z.projectionMatrixInverse);else{const yt=gt+Mt,oe=te+Mt,Ee=se-ne,N=re+(et-ne),E=ee*te/oe*yt,j=jt*te/oe*yt;X.projectionMatrix.makePerspective(Ee,N,E,j,yt,oe),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}}function at(X,Z){Z===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(Z.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(i===null)return;let Z=X.near,Q=X.far;_.texture!==null&&(_.depthNear>0&&(Z=_.depthNear),_.depthFar>0&&(Q=_.depthFar)),y.near=D.near=P.near=Z,y.far=D.far=P.far=Q,(U!==y.near||B!==y.far)&&(i.updateRenderState({depthNear:y.near,depthFar:y.far}),U=y.near,B=y.far),P.layers.mask=X.layers.mask|2,D.layers.mask=X.layers.mask|4,y.layers.mask=P.layers.mask|D.layers.mask;const et=X.parent,_t=y.cameras;at(y,et);for(let ot=0;ot<_t.length;ot++)at(_t[ot],et);_t.length===2?W(y,P,D):y.projectionMatrix.copy(P.projectionMatrix),dt(X,y,et)};function dt(X,Z,Q){Q===null?X.matrix.copy(Z.matrixWorld):(X.matrix.copy(Q.matrixWorld),X.matrix.invert(),X.matrix.multiply(Z.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(Z.projectionMatrix),X.projectionMatrixInverse.copy(Z.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=ds*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return y},this.getFoveation=function(){if(!(d===null&&p===null))return l},this.setFoveation=function(X){l=X,d!==null&&(d.fixedFoveation=X),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=X)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(y)};let mt=null;function Rt(X,Z){if(h=Z.getViewerPose(c||a),m=Z,h!==null){const Q=h.views;p!==null&&(t.setRenderTargetFramebuffer(b,p.framebuffer),t.setRenderTarget(b));let et=!1;Q.length!==y.cameras.length&&(y.cameras.length=0,et=!0);for(let gt=0;gt<Q.length;gt++){const te=Q[gt];let ee=null;if(p!==null)ee=p.getViewport(te);else{const F=u.getViewSubImage(d,te);ee=F.viewport,gt===0&&(t.setRenderTargetTextures(b,F.colorTexture,F.depthStencilTexture),t.setRenderTarget(b))}let jt=M[gt];jt===void 0&&(jt=new $e,jt.layers.enable(gt),jt.viewport=new me,M[gt]=jt),jt.matrix.fromArray(te.transform.matrix),jt.matrix.decompose(jt.position,jt.quaternion,jt.scale),jt.projectionMatrix.fromArray(te.projectionMatrix),jt.projectionMatrixInverse.copy(jt.projectionMatrix).invert(),jt.viewport.set(ee.x,ee.y,ee.width,ee.height),gt===0&&(y.matrix.copy(jt.matrix),y.matrix.decompose(y.position,y.quaternion,y.scale)),et===!0&&y.cameras.push(jt)}const _t=i.enabledFeatures;if(_t&&_t.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&u){const gt=u.getDepthInformation(Q[0]);gt&&gt.isValid&&gt.texture&&_.init(t,gt,i.renderState)}}for(let Q=0;Q<w.length;Q++){const et=S[Q],_t=w[Q];et!==null&&_t!==void 0&&_t.update(et,Z,c||a)}mt&&mt(X,Z),Z.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Z}),m=null}const wt=new au;wt.setAnimationLoop(Rt),this.setAnimationLoop=function(X){mt=X},this.dispose=function(){}}}const Mi=new un,m2=new Zt;function g2(s,t){function e(g,f){g.matrixAutoUpdate===!0&&g.updateMatrix(),f.value.copy(g.matrix)}function n(g,f){f.color.getRGB(g.fogColor.value,qh(s)),f.isFog?(g.fogNear.value=f.near,g.fogFar.value=f.far):f.isFogExp2&&(g.fogDensity.value=f.density)}function i(g,f,b,w,S){f.isMeshBasicMaterial||f.isMeshLambertMaterial?r(g,f):f.isMeshToonMaterial?(r(g,f),u(g,f)):f.isMeshPhongMaterial?(r(g,f),h(g,f)):f.isMeshStandardMaterial?(r(g,f),d(g,f),f.isMeshPhysicalMaterial&&p(g,f,S)):f.isMeshMatcapMaterial?(r(g,f),m(g,f)):f.isMeshDepthMaterial?r(g,f):f.isMeshDistanceMaterial?(r(g,f),_(g,f)):f.isMeshNormalMaterial?r(g,f):f.isLineBasicMaterial?(a(g,f),f.isLineDashedMaterial&&o(g,f)):f.isPointsMaterial?l(g,f,b,w):f.isSpriteMaterial?c(g,f):f.isShadowMaterial?(g.color.value.copy(f.color),g.opacity.value=f.opacity):f.isShaderMaterial&&(f.uniformsNeedUpdate=!1)}function r(g,f){g.opacity.value=f.opacity,f.color&&g.diffuse.value.copy(f.color),f.emissive&&g.emissive.value.copy(f.emissive).multiplyScalar(f.emissiveIntensity),f.map&&(g.map.value=f.map,e(f.map,g.mapTransform)),f.alphaMap&&(g.alphaMap.value=f.alphaMap,e(f.alphaMap,g.alphaMapTransform)),f.bumpMap&&(g.bumpMap.value=f.bumpMap,e(f.bumpMap,g.bumpMapTransform),g.bumpScale.value=f.bumpScale,f.side===rn&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,e(f.normalMap,g.normalMapTransform),g.normalScale.value.copy(f.normalScale),f.side===rn&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,e(f.displacementMap,g.displacementMapTransform),g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias),f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap,e(f.emissiveMap,g.emissiveMapTransform)),f.specularMap&&(g.specularMap.value=f.specularMap,e(f.specularMap,g.specularMapTransform)),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest);const b=t.get(f),w=b.envMap,S=b.envMapRotation;w&&(g.envMap.value=w,Mi.copy(S),Mi.x*=-1,Mi.y*=-1,Mi.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Mi.y*=-1,Mi.z*=-1),g.envMapRotation.value.setFromMatrix4(m2.makeRotationFromEuler(Mi)),g.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=f.reflectivity,g.ior.value=f.ior,g.refractionRatio.value=f.refractionRatio),f.lightMap&&(g.lightMap.value=f.lightMap,g.lightMapIntensity.value=f.lightMapIntensity,e(f.lightMap,g.lightMapTransform)),f.aoMap&&(g.aoMap.value=f.aoMap,g.aoMapIntensity.value=f.aoMapIntensity,e(f.aoMap,g.aoMapTransform))}function a(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,f.map&&(g.map.value=f.map,e(f.map,g.mapTransform))}function o(g,f){g.dashSize.value=f.dashSize,g.totalSize.value=f.dashSize+f.gapSize,g.scale.value=f.scale}function l(g,f,b,w){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.size.value=f.size*b,g.scale.value=w*.5,f.map&&(g.map.value=f.map,e(f.map,g.uvTransform)),f.alphaMap&&(g.alphaMap.value=f.alphaMap,e(f.alphaMap,g.alphaMapTransform)),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest)}function c(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.rotation.value=f.rotation,f.map&&(g.map.value=f.map,e(f.map,g.mapTransform)),f.alphaMap&&(g.alphaMap.value=f.alphaMap,e(f.alphaMap,g.alphaMapTransform)),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest)}function h(g,f){g.specular.value.copy(f.specular),g.shininess.value=Math.max(f.shininess,1e-4)}function u(g,f){f.gradientMap&&(g.gradientMap.value=f.gradientMap)}function d(g,f){g.metalness.value=f.metalness,f.metalnessMap&&(g.metalnessMap.value=f.metalnessMap,e(f.metalnessMap,g.metalnessMapTransform)),g.roughness.value=f.roughness,f.roughnessMap&&(g.roughnessMap.value=f.roughnessMap,e(f.roughnessMap,g.roughnessMapTransform)),f.envMap&&(g.envMapIntensity.value=f.envMapIntensity)}function p(g,f,b){g.ior.value=f.ior,f.sheen>0&&(g.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),g.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(g.sheenColorMap.value=f.sheenColorMap,e(f.sheenColorMap,g.sheenColorMapTransform)),f.sheenRoughnessMap&&(g.sheenRoughnessMap.value=f.sheenRoughnessMap,e(f.sheenRoughnessMap,g.sheenRoughnessMapTransform))),f.clearcoat>0&&(g.clearcoat.value=f.clearcoat,g.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(g.clearcoatMap.value=f.clearcoatMap,e(f.clearcoatMap,g.clearcoatMapTransform)),f.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap,e(f.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),f.clearcoatNormalMap&&(g.clearcoatNormalMap.value=f.clearcoatNormalMap,e(f.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),f.side===rn&&g.clearcoatNormalScale.value.negate())),f.dispersion>0&&(g.dispersion.value=f.dispersion),f.iridescence>0&&(g.iridescence.value=f.iridescence,g.iridescenceIOR.value=f.iridescenceIOR,g.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(g.iridescenceMap.value=f.iridescenceMap,e(f.iridescenceMap,g.iridescenceMapTransform)),f.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=f.iridescenceThicknessMap,e(f.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),f.transmission>0&&(g.transmission.value=f.transmission,g.transmissionSamplerMap.value=b.texture,g.transmissionSamplerSize.value.set(b.width,b.height),f.transmissionMap&&(g.transmissionMap.value=f.transmissionMap,e(f.transmissionMap,g.transmissionMapTransform)),g.thickness.value=f.thickness,f.thicknessMap&&(g.thicknessMap.value=f.thicknessMap,e(f.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=f.attenuationDistance,g.attenuationColor.value.copy(f.attenuationColor)),f.anisotropy>0&&(g.anisotropyVector.value.set(f.anisotropy*Math.cos(f.anisotropyRotation),f.anisotropy*Math.sin(f.anisotropyRotation)),f.anisotropyMap&&(g.anisotropyMap.value=f.anisotropyMap,e(f.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=f.specularIntensity,g.specularColor.value.copy(f.specularColor),f.specularColorMap&&(g.specularColorMap.value=f.specularColorMap,e(f.specularColorMap,g.specularColorMapTransform)),f.specularIntensityMap&&(g.specularIntensityMap.value=f.specularIntensityMap,e(f.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,f){f.matcap&&(g.matcap.value=f.matcap)}function _(g,f){const b=t.get(f).light;g.referencePosition.value.setFromMatrixPosition(b.matrixWorld),g.nearDistance.value=b.shadow.camera.near,g.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function _2(s,t,e,n){let i={},r={},a=[];const o=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,w){const S=w.program;n.uniformBlockBinding(b,S)}function c(b,w){let S=i[b.id];S===void 0&&(m(b),S=h(b),i[b.id]=S,b.addEventListener("dispose",g));const I=w.program;n.updateUBOMapping(b,I);const L=t.render.frame;r[b.id]!==L&&(d(b),r[b.id]=L)}function h(b){const w=u();b.__bindingPointIndex=w;const S=s.createBuffer(),I=b.__size,L=b.usage;return s.bindBuffer(s.UNIFORM_BUFFER,S),s.bufferData(s.UNIFORM_BUFFER,I,L),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,w,S),S}function u(){for(let b=0;b<o;b++)if(a.indexOf(b)===-1)return a.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(b){const w=i[b.id],S=b.uniforms,I=b.__cache;s.bindBuffer(s.UNIFORM_BUFFER,w);for(let L=0,P=S.length;L<P;L++){const D=Array.isArray(S[L])?S[L]:[S[L]];for(let M=0,y=D.length;M<y;M++){const U=D[M];if(p(U,L,M,I)===!0){const B=U.__offset,k=Array.isArray(U.value)?U.value:[U.value];let q=0;for(let J=0;J<k.length;J++){const z=k[J],tt=_(z);typeof z=="number"||typeof z=="boolean"?(U.__data[0]=z,s.bufferSubData(s.UNIFORM_BUFFER,B+q,U.__data)):z.isMatrix3?(U.__data[0]=z.elements[0],U.__data[1]=z.elements[1],U.__data[2]=z.elements[2],U.__data[3]=0,U.__data[4]=z.elements[3],U.__data[5]=z.elements[4],U.__data[6]=z.elements[5],U.__data[7]=0,U.__data[8]=z.elements[6],U.__data[9]=z.elements[7],U.__data[10]=z.elements[8],U.__data[11]=0):(z.toArray(U.__data,q),q+=tt.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,B,U.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function p(b,w,S,I){const L=b.value,P=w+"_"+S;if(I[P]===void 0)return typeof L=="number"||typeof L=="boolean"?I[P]=L:I[P]=L.clone(),!0;{const D=I[P];if(typeof L=="number"||typeof L=="boolean"){if(D!==L)return I[P]=L,!0}else if(D.equals(L)===!1)return D.copy(L),!0}return!1}function m(b){const w=b.uniforms;let S=0;const I=16;for(let P=0,D=w.length;P<D;P++){const M=Array.isArray(w[P])?w[P]:[w[P]];for(let y=0,U=M.length;y<U;y++){const B=M[y],k=Array.isArray(B.value)?B.value:[B.value];for(let q=0,J=k.length;q<J;q++){const z=k[q],tt=_(z),W=S%I,at=W%tt.boundary,dt=W+at;S+=at,dt!==0&&I-dt<tt.storage&&(S+=I-dt),B.__data=new Float32Array(tt.storage/Float32Array.BYTES_PER_ELEMENT),B.__offset=S,S+=tt.storage}}}const L=S%I;return L>0&&(S+=I-L),b.__size=S,b.__cache={},this}function _(b){const w={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(w.boundary=4,w.storage=4):b.isVector2?(w.boundary=8,w.storage=8):b.isVector3||b.isColor?(w.boundary=16,w.storage=12):b.isVector4?(w.boundary=16,w.storage=16):b.isMatrix3?(w.boundary=48,w.storage=48):b.isMatrix4?(w.boundary=64,w.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),w}function g(b){const w=b.target;w.removeEventListener("dispose",g);const S=a.indexOf(w.__bindingPointIndex);a.splice(S,1),s.deleteBuffer(i[w.id]),delete i[w.id],delete r[w.id]}function f(){for(const b in i)s.deleteBuffer(i[b]);a=[],i={},r={}}return{bind:l,update:c,dispose:f}}class v2{constructor(t={}){const{canvas:e=wd(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!1}=t;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,f=null;const b=[],w=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=di,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let I=!1;this._outputColorSpace=Me;let L=0,P=0,D=null,M=-1,y=null;const U=new me,B=new me;let k=null;const q=new qt(0);let J=0,z=e.width,tt=e.height,W=1,at=null,dt=null;const mt=new me(0,0,z,tt),Rt=new me(0,0,z,tt);let wt=!1;const X=new Ml;let Z=!1,Q=!1;const et=new Zt,_t=new Zt,ot=new O,gt=new me,te={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ee=!1;function jt(){return D===null?W:1}let F=n;function _e(A,H){return e.getContext(A,H)}try{const A={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${al}`),e.addEventListener("webglcontextlost",Dt,!1),e.addEventListener("webglcontextrestored",ft,!1),e.addEventListener("webglcontextcreationerror",rt,!1),F===null){const H="webgl2";if(F=_e(H,A),F===null)throw _e(H)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(A){throw console.error("THREE.WebGLRenderer: "+A.message),A}let se,re,Mt,ne,yt,oe,Ee,N,E,j,st,lt,nt,zt,bt,Ft,Bt,ct,Ct,Yt,Wt,St,ie,V;function Tt(){se=new Rm(F),se.init(),St=new h2(F,se),re=new Mm(F,se,t,St),Mt=new l2(F,se),re.reverseDepthBuffer&&d&&Mt.buffers.depth.setReversed(!0),ne=new Pm(F),yt=new $1,oe=new c2(F,se,Mt,yt,re,St,ne),Ee=new bm(S),N=new Am(S),E=new Of(F),ie=new xm(F,E),j=new Cm(F,E,ne,ie),st=new Um(F,j,E,ne),Ct=new Dm(F,re,oe),Ft=new Sm(yt),lt=new Y1(S,Ee,N,se,re,ie,Ft),nt=new g2(S,yt),zt=new J1,bt=new i2(se),ct=new vm(S,Ee,N,Mt,st,p,l),Bt=new a2(S,st,re),V=new _2(F,ne,re,Mt),Yt=new ym(F,se,ne),Wt=new Lm(F,se,ne),ne.programs=lt.programs,S.capabilities=re,S.extensions=se,S.properties=yt,S.renderLists=zt,S.shadowMap=Bt,S.state=Mt,S.info=ne}Tt();const ht=new p2(S,F);this.xr=ht,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){const A=se.get("WEBGL_lose_context");A&&A.loseContext()},this.forceContextRestore=function(){const A=se.get("WEBGL_lose_context");A&&A.restoreContext()},this.getPixelRatio=function(){return W},this.setPixelRatio=function(A){A!==void 0&&(W=A,this.setSize(z,tt,!1))},this.getSize=function(A){return A.set(z,tt)},this.setSize=function(A,H,Y=!0){if(ht.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}z=A,tt=H,e.width=Math.floor(A*W),e.height=Math.floor(H*W),Y===!0&&(e.style.width=A+"px",e.style.height=H+"px"),this.setViewport(0,0,A,H)},this.getDrawingBufferSize=function(A){return A.set(z*W,tt*W).floor()},this.setDrawingBufferSize=function(A,H,Y){z=A,tt=H,W=Y,e.width=Math.floor(A*Y),e.height=Math.floor(H*Y),this.setViewport(0,0,A,H)},this.getCurrentViewport=function(A){return A.copy(U)},this.getViewport=function(A){return A.copy(mt)},this.setViewport=function(A,H,Y,$){A.isVector4?mt.set(A.x,A.y,A.z,A.w):mt.set(A,H,Y,$),Mt.viewport(U.copy(mt).multiplyScalar(W).round())},this.getScissor=function(A){return A.copy(Rt)},this.setScissor=function(A,H,Y,$){A.isVector4?Rt.set(A.x,A.y,A.z,A.w):Rt.set(A,H,Y,$),Mt.scissor(B.copy(Rt).multiplyScalar(W).round())},this.getScissorTest=function(){return wt},this.setScissorTest=function(A){Mt.setScissorTest(wt=A)},this.setOpaqueSort=function(A){at=A},this.setTransparentSort=function(A){dt=A},this.getClearColor=function(A){return A.copy(ct.getClearColor())},this.setClearColor=function(){ct.setClearColor(...arguments)},this.getClearAlpha=function(){return ct.getClearAlpha()},this.setClearAlpha=function(){ct.setClearAlpha(...arguments)},this.clear=function(A=!0,H=!0,Y=!0){let $=0;if(A){let G=!1;if(D!==null){const pt=D.texture.format;G=pt===dl||pt===ul||pt===hl}if(G){const pt=D.texture.type,Et=pt===zn||pt===Li||pt===zs||pt===Bs||pt===ll||pt===cl,It=ct.getClearColor(),Lt=ct.getClearAlpha(),$t=It.r,Kt=It.g,Vt=It.b;Et?(m[0]=$t,m[1]=Kt,m[2]=Vt,m[3]=Lt,F.clearBufferuiv(F.COLOR,0,m)):(_[0]=$t,_[1]=Kt,_[2]=Vt,_[3]=Lt,F.clearBufferiv(F.COLOR,0,_))}else $|=F.COLOR_BUFFER_BIT}H&&($|=F.DEPTH_BUFFER_BIT),Y&&($|=F.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),F.clear($)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Dt,!1),e.removeEventListener("webglcontextrestored",ft,!1),e.removeEventListener("webglcontextcreationerror",rt,!1),ct.dispose(),zt.dispose(),bt.dispose(),yt.dispose(),Ee.dispose(),N.dispose(),st.dispose(),ie.dispose(),V.dispose(),lt.dispose(),ht.dispose(),ht.removeEventListener("sessionstart",Ys),ht.removeEventListener("sessionend",$s),kn.stop()};function Dt(A){A.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function ft(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const A=ne.autoReset,H=Bt.enabled,Y=Bt.autoUpdate,$=Bt.needsUpdate,G=Bt.type;Tt(),ne.autoReset=A,Bt.enabled=H,Bt.autoUpdate=Y,Bt.needsUpdate=$,Bt.type=G}function rt(A){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",A.statusMessage)}function Ut(A){const H=A.target;H.removeEventListener("dispose",Ut),ae(H)}function ae(A){Le(A),yt.remove(A)}function Le(A){const H=yt.get(A).programs;H!==void 0&&(H.forEach(function(Y){lt.releaseProgram(Y)}),A.isShaderMaterial&&lt.releaseShaderCache(A))}this.renderBufferDirect=function(A,H,Y,$,G,pt){H===null&&(H=te);const Et=G.isMesh&&G.matrixWorld.determinant()<0,It=fa(A,H,Y,$,G);Mt.setMaterial($,Et);let Lt=Y.index,$t=1;if($.wireframe===!0){if(Lt=j.getWireframeAttribute(Y),Lt===void 0)return;$t=2}const Kt=Y.drawRange,Vt=Y.attributes.position;let le=Kt.start*$t,Se=(Kt.start+Kt.count)*$t;pt!==null&&(le=Math.max(le,pt.start*$t),Se=Math.min(Se,(pt.start+pt.count)*$t)),Lt!==null?(le=Math.max(le,0),Se=Math.min(Se,Lt.count)):Vt!=null&&(le=Math.max(le,0),Se=Math.min(Se,Vt.count));const De=Se-le;if(De<0||De===1/0)return;ie.setup(G,$,It,Y,Lt);let Ie,ge=Yt;if(Lt!==null&&(Ie=E.get(Lt),ge=Wt,ge.setIndex(Ie)),G.isMesh)$.wireframe===!0?(Mt.setLineWidth($.wireframeLinewidth*jt()),ge.setMode(F.LINES)):ge.setMode(F.TRIANGLES);else if(G.isLine){let Gt=$.linewidth;Gt===void 0&&(Gt=1),Mt.setLineWidth(Gt*jt()),G.isLineSegments?ge.setMode(F.LINES):G.isLineLoop?ge.setMode(F.LINE_LOOP):ge.setMode(F.LINE_STRIP)}else G.isPoints?ge.setMode(F.POINTS):G.isSprite&&ge.setMode(F.TRIANGLES);if(G.isBatchedMesh)if(G._multiDrawInstances!==null)as("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),ge.renderMultiDrawInstances(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount,G._multiDrawInstances);else if(se.get("WEBGL_multi_draw"))ge.renderMultiDraw(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount);else{const Gt=G._multiDrawStarts,ke=G._multiDrawCounts,ve=G._multiDrawCount,on=Lt?E.get(Lt).bytesPerElement:1,Ue=yt.get($).currentProgram.getUniforms();for(let Xe=0;Xe<ve;Xe++)Ue.setValue(F,"_gl_DrawID",Xe),ge.render(Gt[Xe]/on,ke[Xe])}else if(G.isInstancedMesh)ge.renderInstances(le,De,G.count);else if(Y.isInstancedBufferGeometry){const Gt=Y._maxInstanceCount!==void 0?Y._maxInstanceCount:1/0,ke=Math.min(Y.instanceCount,Gt);ge.renderInstances(le,De,ke)}else ge.render(le,De)};function ce(A,H,Y){A.transparent===!0&&A.side===tn&&A.forceSinglePass===!1?(A.side=rn,A.needsUpdate=!0,Ii(A,H,Y),A.side=Cn,A.needsUpdate=!0,Ii(A,H,Y),A.side=tn):Ii(A,H,Y)}this.compile=function(A,H,Y=null){Y===null&&(Y=A),f=bt.get(Y),f.init(H),w.push(f),Y.traverseVisible(function(G){G.isLight&&G.layers.test(H.layers)&&(f.pushLight(G),G.castShadow&&f.pushShadow(G))}),A!==Y&&A.traverseVisible(function(G){G.isLight&&G.layers.test(H.layers)&&(f.pushLight(G),G.castShadow&&f.pushShadow(G))}),f.setupLights();const $=new Set;return A.traverse(function(G){if(!(G.isMesh||G.isPoints||G.isLine||G.isSprite))return;const pt=G.material;if(pt)if(Array.isArray(pt))for(let Et=0;Et<pt.length;Et++){const It=pt[Et];ce(It,Y,G),$.add(It)}else ce(pt,Y,G),$.add(pt)}),f=w.pop(),$},this.compileAsync=function(A,H,Y=null){const $=this.compile(A,H,Y);return new Promise(G=>{function pt(){if($.forEach(function(Et){yt.get(Et).currentProgram.isReady()&&$.delete(Et)}),$.size===0){G(A);return}setTimeout(pt,10)}se.get("KHR_parallel_shader_compile")!==null?pt():setTimeout(pt,10)})};let an=null;function Sn(A){an&&an(A)}function Ys(){kn.stop()}function $s(){kn.start()}const kn=new au;kn.setAnimationLoop(Sn),typeof self<"u"&&kn.setContext(self),this.setAnimationLoop=function(A){an=A,ht.setAnimationLoop(A),A===null?kn.stop():kn.start()},ht.addEventListener("sessionstart",Ys),ht.addEventListener("sessionend",$s),this.render=function(A,H){if(H!==void 0&&H.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;if(A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld(),H.parent===null&&H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),ht.enabled===!0&&ht.isPresenting===!0&&(ht.cameraAutoUpdate===!0&&ht.updateCamera(H),H=ht.getCamera()),A.isScene===!0&&A.onBeforeRender(S,A,H,D),f=bt.get(A,w.length),f.init(H),w.push(f),_t.multiplyMatrices(H.projectionMatrix,H.matrixWorldInverse),X.setFromProjectionMatrix(_t),Q=this.localClippingEnabled,Z=Ft.init(this.clippingPlanes,Q),g=zt.get(A,b.length),g.init(),b.push(g),ht.enabled===!0&&ht.isPresenting===!0){const pt=S.xr.getDepthSensingMesh();pt!==null&&Ms(pt,H,-1/0,S.sortObjects)}Ms(A,H,0,S.sortObjects),g.finish(),S.sortObjects===!0&&g.sort(at,dt),ee=ht.enabled===!1||ht.isPresenting===!1||ht.hasDepthSensing()===!1,ee&&ct.addToRenderList(g,A),this.info.render.frame++,Z===!0&&Ft.beginShadows();const Y=f.state.shadowsArray;Bt.render(Y,A,H),Z===!0&&Ft.endShadows(),this.info.autoReset===!0&&this.info.reset();const $=g.opaque,G=g.transmissive;if(f.setupLights(),H.isArrayCamera){const pt=H.cameras;if(G.length>0)for(let Et=0,It=pt.length;Et<It;Et++){const Lt=pt[Et];Ss($,G,A,Lt)}ee&&ct.render(A);for(let Et=0,It=pt.length;Et<It;Et++){const Lt=pt[Et];Ks(g,A,Lt,Lt.viewport)}}else G.length>0&&Ss($,G,A,H),ee&&ct.render(A),Ks(g,A,H);D!==null&&P===0&&(oe.updateMultisampleRenderTarget(D),oe.updateRenderTargetMipmap(D)),A.isScene===!0&&A.onAfterRender(S,A,H),ie.resetDefaultState(),M=-1,y=null,w.pop(),w.length>0?(f=w[w.length-1],Z===!0&&Ft.setGlobalState(S.clippingPlanes,f.state.camera)):f=null,b.pop(),b.length>0?g=b[b.length-1]:g=null};function Ms(A,H,Y,$){if(A.visible===!1)return;if(A.layers.test(H.layers)){if(A.isGroup)Y=A.renderOrder;else if(A.isLOD)A.autoUpdate===!0&&A.update(H);else if(A.isLight)f.pushLight(A),A.castShadow&&f.pushShadow(A);else if(A.isSprite){if(!A.frustumCulled||X.intersectsSprite(A)){$&&gt.setFromMatrixPosition(A.matrixWorld).applyMatrix4(_t);const Et=st.update(A),It=A.material;It.visible&&g.push(A,Et,It,Y,gt.z,null)}}else if((A.isMesh||A.isLine||A.isPoints)&&(!A.frustumCulled||X.intersectsObject(A))){const Et=st.update(A),It=A.material;if($&&(A.boundingSphere!==void 0?(A.boundingSphere===null&&A.computeBoundingSphere(),gt.copy(A.boundingSphere.center)):(Et.boundingSphere===null&&Et.computeBoundingSphere(),gt.copy(Et.boundingSphere.center)),gt.applyMatrix4(A.matrixWorld).applyMatrix4(_t)),Array.isArray(It)){const Lt=Et.groups;for(let $t=0,Kt=Lt.length;$t<Kt;$t++){const Vt=Lt[$t],le=It[Vt.materialIndex];le&&le.visible&&g.push(A,Et,le,Y,gt.z,Vt)}}else It.visible&&g.push(A,Et,It,Y,gt.z,null)}}const pt=A.children;for(let Et=0,It=pt.length;Et<It;Et++)Ms(pt[Et],H,Y,$)}function Ks(A,H,Y,$){const G=A.opaque,pt=A.transmissive,Et=A.transparent;f.setupLightsView(Y),Z===!0&&Ft.setGlobalState(S.clippingPlanes,Y),$&&Mt.viewport(U.copy($)),G.length>0&&Ui(G,H,Y),pt.length>0&&Ui(pt,H,Y),Et.length>0&&Ui(Et,H,Y),Mt.buffers.depth.setTest(!0),Mt.buffers.depth.setMask(!0),Mt.buffers.color.setMask(!0),Mt.setPolygonOffset(!1)}function Ss(A,H,Y,$){if((Y.isScene===!0?Y.overrideMaterial:null)!==null)return;f.state.transmissionRenderTarget[$.id]===void 0&&(f.state.transmissionRenderTarget[$.id]=new Pi(1,1,{generateMipmaps:!0,type:se.has("EXT_color_buffer_half_float")||se.has("EXT_color_buffer_float")?Ws:zn,minFilter:Kn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:fe.workingColorSpace}));const pt=f.state.transmissionRenderTarget[$.id],Et=$.viewport||U;pt.setSize(Et.z*S.transmissionResolutionScale,Et.w*S.transmissionResolutionScale);const It=S.getRenderTarget();S.setRenderTarget(pt),S.getClearColor(q),J=S.getClearAlpha(),J<1&&S.setClearColor(16777215,.5),S.clear(),ee&&ct.render(Y);const Lt=S.toneMapping;S.toneMapping=di;const $t=$.viewport;if($.viewport!==void 0&&($.viewport=void 0),f.setupLightsView($),Z===!0&&Ft.setGlobalState(S.clippingPlanes,$),Ui(A,Y,$),oe.updateMultisampleRenderTarget(pt),oe.updateRenderTargetMipmap(pt),se.has("WEBGL_multisampled_render_to_texture")===!1){let Kt=!1;for(let Vt=0,le=H.length;Vt<le;Vt++){const Se=H[Vt],De=Se.object,Ie=Se.geometry,ge=Se.material,Gt=Se.group;if(ge.side===tn&&De.layers.test($.layers)){const ke=ge.side;ge.side=rn,ge.needsUpdate=!0,bs(De,Y,$,Ie,ge,Gt),ge.side=ke,ge.needsUpdate=!0,Kt=!0}}Kt===!0&&(oe.updateMultisampleRenderTarget(pt),oe.updateRenderTargetMipmap(pt))}S.setRenderTarget(It),S.setClearColor(q,J),$t!==void 0&&($.viewport=$t),S.toneMapping=Lt}function Ui(A,H,Y){const $=H.isScene===!0?H.overrideMaterial:null;for(let G=0,pt=A.length;G<pt;G++){const Et=A[G],It=Et.object,Lt=Et.geometry,$t=Et.group;let Kt=Et.material;Kt.allowOverride===!0&&$!==null&&(Kt=$),It.layers.test(Y.layers)&&bs(It,H,Y,Lt,Kt,$t)}}function bs(A,H,Y,$,G,pt){A.onBeforeRender(S,H,Y,$,G,pt),A.modelViewMatrix.multiplyMatrices(Y.matrixWorldInverse,A.matrixWorld),A.normalMatrix.getNormalMatrix(A.modelViewMatrix),G.onBeforeRender(S,H,Y,$,A,pt),G.transparent===!0&&G.side===tn&&G.forceSinglePass===!1?(G.side=rn,G.needsUpdate=!0,S.renderBufferDirect(Y,H,$,G,A,pt),G.side=Cn,G.needsUpdate=!0,S.renderBufferDirect(Y,H,$,G,A,pt),G.side=tn):S.renderBufferDirect(Y,H,$,G,A,pt),A.onAfterRender(S,H,Y,$,G,pt)}function Ii(A,H,Y){H.isScene!==!0&&(H=te);const $=yt.get(A),G=f.state.lights,pt=f.state.shadowsArray,Et=G.state.version,It=lt.getParameters(A,G.state,pt,H,Y),Lt=lt.getProgramCacheKey(It);let $t=$.programs;$.environment=A.isMeshStandardMaterial?H.environment:null,$.fog=H.fog,$.envMap=(A.isMeshStandardMaterial?N:Ee).get(A.envMap||$.environment),$.envMapRotation=$.environment!==null&&A.envMap===null?H.environmentRotation:A.envMapRotation,$t===void 0&&(A.addEventListener("dispose",Ut),$t=new Map,$.programs=$t);let Kt=$t.get(Lt);if(Kt!==void 0){if($.currentProgram===Kt&&$.lightsStateVersion===Et)return Zs(A,It),Kt}else It.uniforms=lt.getUniforms(A),A.onBeforeCompile(It,S),Kt=lt.acquireProgram(It,Lt),$t.set(Lt,Kt),$.uniforms=It.uniforms;const Vt=$.uniforms;return(!A.isShaderMaterial&&!A.isRawShaderMaterial||A.clipping===!0)&&(Vt.clippingPlanes=Ft.uniform),Zs(A,It),$.needsLights=ma(A),$.lightsStateVersion=Et,$.needsLights&&(Vt.ambientLightColor.value=G.state.ambient,Vt.lightProbe.value=G.state.probe,Vt.directionalLights.value=G.state.directional,Vt.directionalLightShadows.value=G.state.directionalShadow,Vt.spotLights.value=G.state.spot,Vt.spotLightShadows.value=G.state.spotShadow,Vt.rectAreaLights.value=G.state.rectArea,Vt.ltc_1.value=G.state.rectAreaLTC1,Vt.ltc_2.value=G.state.rectAreaLTC2,Vt.pointLights.value=G.state.point,Vt.pointLightShadows.value=G.state.pointShadow,Vt.hemisphereLights.value=G.state.hemi,Vt.directionalShadowMap.value=G.state.directionalShadowMap,Vt.directionalShadowMatrix.value=G.state.directionalShadowMatrix,Vt.spotShadowMap.value=G.state.spotShadowMap,Vt.spotLightMatrix.value=G.state.spotLightMatrix,Vt.spotLightMap.value=G.state.spotLightMap,Vt.pointShadowMap.value=G.state.pointShadowMap,Vt.pointShadowMatrix.value=G.state.pointShadowMatrix),$.currentProgram=Kt,$.uniformsList=null,Kt}function Js(A){if(A.uniformsList===null){const H=A.currentProgram.getUniforms();A.uniformsList=jr.seqWithValue(H.seq,A.uniforms)}return A.uniformsList}function Zs(A,H){const Y=yt.get(A);Y.outputColorSpace=H.outputColorSpace,Y.batching=H.batching,Y.batchingColor=H.batchingColor,Y.instancing=H.instancing,Y.instancingColor=H.instancingColor,Y.instancingMorph=H.instancingMorph,Y.skinning=H.skinning,Y.morphTargets=H.morphTargets,Y.morphNormals=H.morphNormals,Y.morphColors=H.morphColors,Y.morphTargetsCount=H.morphTargetsCount,Y.numClippingPlanes=H.numClippingPlanes,Y.numIntersection=H.numClipIntersection,Y.vertexAlphas=H.vertexAlphas,Y.vertexTangents=H.vertexTangents,Y.toneMapping=H.toneMapping}function fa(A,H,Y,$,G){H.isScene!==!0&&(H=te),oe.resetTextureUnits();const pt=H.fog,Et=$.isMeshStandardMaterial?H.environment:null,It=D===null?S.outputColorSpace:D.isXRRenderTarget===!0?D.texture.colorSpace:us,Lt=($.isMeshStandardMaterial?N:Ee).get($.envMap||Et),$t=$.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,Kt=!!Y.attributes.tangent&&(!!$.normalMap||$.anisotropy>0),Vt=!!Y.morphAttributes.position,le=!!Y.morphAttributes.normal,Se=!!Y.morphAttributes.color;let De=di;$.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(De=S.toneMapping);const Ie=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,ge=Ie!==void 0?Ie.length:0,Gt=yt.get($),ke=f.state.lights;if(Z===!0&&(Q===!0||A!==y)){const ze=A===y&&$.id===M;Ft.setState($,A,ze)}let ve=!1;$.version===Gt.__version?(Gt.needsLights&&Gt.lightsStateVersion!==ke.state.version||Gt.outputColorSpace!==It||G.isBatchedMesh&&Gt.batching===!1||!G.isBatchedMesh&&Gt.batching===!0||G.isBatchedMesh&&Gt.batchingColor===!0&&G.colorTexture===null||G.isBatchedMesh&&Gt.batchingColor===!1&&G.colorTexture!==null||G.isInstancedMesh&&Gt.instancing===!1||!G.isInstancedMesh&&Gt.instancing===!0||G.isSkinnedMesh&&Gt.skinning===!1||!G.isSkinnedMesh&&Gt.skinning===!0||G.isInstancedMesh&&Gt.instancingColor===!0&&G.instanceColor===null||G.isInstancedMesh&&Gt.instancingColor===!1&&G.instanceColor!==null||G.isInstancedMesh&&Gt.instancingMorph===!0&&G.morphTexture===null||G.isInstancedMesh&&Gt.instancingMorph===!1&&G.morphTexture!==null||Gt.envMap!==Lt||$.fog===!0&&Gt.fog!==pt||Gt.numClippingPlanes!==void 0&&(Gt.numClippingPlanes!==Ft.numPlanes||Gt.numIntersection!==Ft.numIntersection)||Gt.vertexAlphas!==$t||Gt.vertexTangents!==Kt||Gt.morphTargets!==Vt||Gt.morphNormals!==le||Gt.morphColors!==Se||Gt.toneMapping!==De||Gt.morphTargetsCount!==ge)&&(ve=!0):(ve=!0,Gt.__version=$.version);let on=Gt.currentProgram;ve===!0&&(on=Ii($,H,G));let Ue=!1,Xe=!1,mi=!1;const Pe=on.getUniforms(),en=Gt.uniforms;if(Mt.useProgram(on.program)&&(Ue=!0,Xe=!0,mi=!0),$.id!==M&&(M=$.id,Xe=!0),Ue||y!==A){Mt.buffers.depth.getReversed()?(et.copy(A.projectionMatrix),Ad(et),Rd(et),Pe.setValue(F,"projectionMatrix",et)):Pe.setValue(F,"projectionMatrix",A.projectionMatrix),Pe.setValue(F,"viewMatrix",A.matrixWorldInverse);const Ve=Pe.map.cameraPosition;Ve!==void 0&&Ve.setValue(F,ot.setFromMatrixPosition(A.matrixWorld)),re.logarithmicDepthBuffer&&Pe.setValue(F,"logDepthBufFC",2/(Math.log(A.far+1)/Math.LN2)),($.isMeshPhongMaterial||$.isMeshToonMaterial||$.isMeshLambertMaterial||$.isMeshBasicMaterial||$.isMeshStandardMaterial||$.isShaderMaterial)&&Pe.setValue(F,"isOrthographic",A.isOrthographicCamera===!0),y!==A&&(y=A,Xe=!0,mi=!0)}if(G.isSkinnedMesh){Pe.setOptional(F,G,"bindMatrix"),Pe.setOptional(F,G,"bindMatrixInverse");const ze=G.skeleton;ze&&(ze.boneTexture===null&&ze.computeBoneTexture(),Pe.setValue(F,"boneTexture",ze.boneTexture,oe))}G.isBatchedMesh&&(Pe.setOptional(F,G,"batchingTexture"),Pe.setValue(F,"batchingTexture",G._matricesTexture,oe),Pe.setOptional(F,G,"batchingIdTexture"),Pe.setValue(F,"batchingIdTexture",G._indirectTexture,oe),Pe.setOptional(F,G,"batchingColorTexture"),G._colorsTexture!==null&&Pe.setValue(F,"batchingColorTexture",G._colorsTexture,oe));const Je=Y.morphAttributes;if((Je.position!==void 0||Je.normal!==void 0||Je.color!==void 0)&&Ct.update(G,Y,on),(Xe||Gt.receiveShadow!==G.receiveShadow)&&(Gt.receiveShadow=G.receiveShadow,Pe.setValue(F,"receiveShadow",G.receiveShadow)),$.isMeshGouraudMaterial&&$.envMap!==null&&(en.envMap.value=Lt,en.flipEnvMap.value=Lt.isCubeTexture&&Lt.isRenderTargetTexture===!1?-1:1),$.isMeshStandardMaterial&&$.envMap===null&&H.environment!==null&&(en.envMapIntensity.value=H.environmentIntensity),Xe&&(Pe.setValue(F,"toneMappingExposure",S.toneMappingExposure),Gt.needsLights&&pa(en,mi),pt&&$.fog===!0&&nt.refreshFogUniforms(en,pt),nt.refreshMaterialUniforms(en,$,W,tt,f.state.transmissionRenderTarget[A.id]),jr.upload(F,Js(Gt),en,oe)),$.isShaderMaterial&&$.uniformsNeedUpdate===!0&&(jr.upload(F,Js(Gt),en,oe),$.uniformsNeedUpdate=!1),$.isSpriteMaterial&&Pe.setValue(F,"center",G.center),Pe.setValue(F,"modelViewMatrix",G.modelViewMatrix),Pe.setValue(F,"normalMatrix",G.normalMatrix),Pe.setValue(F,"modelMatrix",G.matrixWorld),$.isShaderMaterial||$.isRawShaderMaterial){const ze=$.uniformsGroups;for(let Ve=0,Ni=ze.length;Ve<Ni;Ve++){const Vn=ze[Ve];V.update(Vn,on),V.bind(Vn,on)}}return on}function pa(A,H){A.ambientLightColor.needsUpdate=H,A.lightProbe.needsUpdate=H,A.directionalLights.needsUpdate=H,A.directionalLightShadows.needsUpdate=H,A.pointLights.needsUpdate=H,A.pointLightShadows.needsUpdate=H,A.spotLights.needsUpdate=H,A.spotLightShadows.needsUpdate=H,A.rectAreaLights.needsUpdate=H,A.hemisphereLights.needsUpdate=H}function ma(A){return A.isMeshLambertMaterial||A.isMeshToonMaterial||A.isMeshPhongMaterial||A.isMeshStandardMaterial||A.isShadowMaterial||A.isShaderMaterial&&A.lights===!0}this.getActiveCubeFace=function(){return L},this.getActiveMipmapLevel=function(){return P},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(A,H,Y){const $=yt.get(A);$.__autoAllocateDepthBuffer=A.resolveDepthBuffer===!1,$.__autoAllocateDepthBuffer===!1&&($.__useRenderToTexture=!1),yt.get(A.texture).__webglTexture=H,yt.get(A.depthTexture).__webglTexture=$.__autoAllocateDepthBuffer?void 0:Y,$.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(A,H){const Y=yt.get(A);Y.__webglFramebuffer=H,Y.__useDefaultFramebuffer=H===void 0};const ga=F.createFramebuffer();this.setRenderTarget=function(A,H=0,Y=0){D=A,L=H,P=Y;let $=!0,G=null,pt=!1,Et=!1;if(A){const Lt=yt.get(A);if(Lt.__useDefaultFramebuffer!==void 0)Mt.bindFramebuffer(F.FRAMEBUFFER,null),$=!1;else if(Lt.__webglFramebuffer===void 0)oe.setupRenderTarget(A);else if(Lt.__hasExternalTextures)oe.rebindTextures(A,yt.get(A.texture).__webglTexture,yt.get(A.depthTexture).__webglTexture);else if(A.depthBuffer){const Vt=A.depthTexture;if(Lt.__boundDepthTexture!==Vt){if(Vt!==null&&yt.has(Vt)&&(A.width!==Vt.image.width||A.height!==Vt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");oe.setupDepthRenderbuffer(A)}}const $t=A.texture;($t.isData3DTexture||$t.isDataArrayTexture||$t.isCompressedArrayTexture)&&(Et=!0);const Kt=yt.get(A).__webglFramebuffer;A.isWebGLCubeRenderTarget?(Array.isArray(Kt[H])?G=Kt[H][Y]:G=Kt[H],pt=!0):A.samples>0&&oe.useMultisampledRTT(A)===!1?G=yt.get(A).__webglMultisampledFramebuffer:Array.isArray(Kt)?G=Kt[Y]:G=Kt,U.copy(A.viewport),B.copy(A.scissor),k=A.scissorTest}else U.copy(mt).multiplyScalar(W).floor(),B.copy(Rt).multiplyScalar(W).floor(),k=wt;if(Y!==0&&(G=ga),Mt.bindFramebuffer(F.FRAMEBUFFER,G)&&$&&Mt.drawBuffers(A,G),Mt.viewport(U),Mt.scissor(B),Mt.setScissorTest(k),pt){const Lt=yt.get(A.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+H,Lt.__webglTexture,Y)}else if(Et){const Lt=yt.get(A.texture),$t=H;F.framebufferTextureLayer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,Lt.__webglTexture,Y,$t)}else if(A!==null&&Y!==0){const Lt=yt.get(A.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,Lt.__webglTexture,Y)}M=-1},this.readRenderTargetPixels=function(A,H,Y,$,G,pt,Et,It=0){if(!(A&&A.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Lt=yt.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&Et!==void 0&&(Lt=Lt[Et]),Lt){Mt.bindFramebuffer(F.FRAMEBUFFER,Lt);try{const $t=A.textures[It],Kt=$t.format,Vt=$t.type;if(!re.textureFormatReadable(Kt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!re.textureTypeReadable(Vt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}H>=0&&H<=A.width-$&&Y>=0&&Y<=A.height-G&&(A.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+It),F.readPixels(H,Y,$,G,St.convert(Kt),St.convert(Vt),pt))}finally{const $t=D!==null?yt.get(D).__webglFramebuffer:null;Mt.bindFramebuffer(F.FRAMEBUFFER,$t)}}},this.readRenderTargetPixelsAsync=async function(A,H,Y,$,G,pt,Et,It=0){if(!(A&&A.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Lt=yt.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&Et!==void 0&&(Lt=Lt[Et]),Lt)if(H>=0&&H<=A.width-$&&Y>=0&&Y<=A.height-G){Mt.bindFramebuffer(F.FRAMEBUFFER,Lt);const $t=A.textures[It],Kt=$t.format,Vt=$t.type;if(!re.textureFormatReadable(Kt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!re.textureTypeReadable(Vt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const le=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,le),F.bufferData(F.PIXEL_PACK_BUFFER,pt.byteLength,F.STREAM_READ),A.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+It),F.readPixels(H,Y,$,G,St.convert(Kt),St.convert(Vt),0);const Se=D!==null?yt.get(D).__webglFramebuffer:null;Mt.bindFramebuffer(F.FRAMEBUFFER,Se);const De=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);return F.flush(),await Td(F,De,4),F.bindBuffer(F.PIXEL_PACK_BUFFER,le),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,pt),F.deleteBuffer(le),F.deleteSync(De),pt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(A,H=null,Y=0){const $=Math.pow(2,-Y),G=Math.floor(A.image.width*$),pt=Math.floor(A.image.height*$),Et=H!==null?H.x:0,It=H!==null?H.y:0;oe.setTexture2D(A,0),F.copyTexSubImage2D(F.TEXTURE_2D,Y,0,0,Et,It,G,pt),Mt.unbindTexture()};const _a=F.createFramebuffer(),va=F.createFramebuffer();this.copyTextureToTexture=function(A,H,Y=null,$=null,G=0,pt=null){pt===null&&(G!==0?(as("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),pt=G,G=0):pt=0);let Et,It,Lt,$t,Kt,Vt,le,Se,De;const Ie=A.isCompressedTexture?A.mipmaps[pt]:A.image;if(Y!==null)Et=Y.max.x-Y.min.x,It=Y.max.y-Y.min.y,Lt=Y.isBox3?Y.max.z-Y.min.z:1,$t=Y.min.x,Kt=Y.min.y,Vt=Y.isBox3?Y.min.z:0;else{const Je=Math.pow(2,-G);Et=Math.floor(Ie.width*Je),It=Math.floor(Ie.height*Je),A.isDataArrayTexture?Lt=Ie.depth:A.isData3DTexture?Lt=Math.floor(Ie.depth*Je):Lt=1,$t=0,Kt=0,Vt=0}$!==null?(le=$.x,Se=$.y,De=$.z):(le=0,Se=0,De=0);const ge=St.convert(H.format),Gt=St.convert(H.type);let ke;H.isData3DTexture?(oe.setTexture3D(H,0),ke=F.TEXTURE_3D):H.isDataArrayTexture||H.isCompressedArrayTexture?(oe.setTexture2DArray(H,0),ke=F.TEXTURE_2D_ARRAY):(oe.setTexture2D(H,0),ke=F.TEXTURE_2D),F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,H.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,H.unpackAlignment);const ve=F.getParameter(F.UNPACK_ROW_LENGTH),on=F.getParameter(F.UNPACK_IMAGE_HEIGHT),Ue=F.getParameter(F.UNPACK_SKIP_PIXELS),Xe=F.getParameter(F.UNPACK_SKIP_ROWS),mi=F.getParameter(F.UNPACK_SKIP_IMAGES);F.pixelStorei(F.UNPACK_ROW_LENGTH,Ie.width),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Ie.height),F.pixelStorei(F.UNPACK_SKIP_PIXELS,$t),F.pixelStorei(F.UNPACK_SKIP_ROWS,Kt),F.pixelStorei(F.UNPACK_SKIP_IMAGES,Vt);const Pe=A.isDataArrayTexture||A.isData3DTexture,en=H.isDataArrayTexture||H.isData3DTexture;if(A.isDepthTexture){const Je=yt.get(A),ze=yt.get(H),Ve=yt.get(Je.__renderTarget),Ni=yt.get(ze.__renderTarget);Mt.bindFramebuffer(F.READ_FRAMEBUFFER,Ve.__webglFramebuffer),Mt.bindFramebuffer(F.DRAW_FRAMEBUFFER,Ni.__webglFramebuffer);for(let Vn=0;Vn<Lt;Vn++)Pe&&(F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,yt.get(A).__webglTexture,G,Vt+Vn),F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,yt.get(H).__webglTexture,pt,De+Vn)),F.blitFramebuffer($t,Kt,Et,It,le,Se,Et,It,F.DEPTH_BUFFER_BIT,F.NEAREST);Mt.bindFramebuffer(F.READ_FRAMEBUFFER,null),Mt.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else if(G!==0||A.isRenderTargetTexture||yt.has(A)){const Je=yt.get(A),ze=yt.get(H);Mt.bindFramebuffer(F.READ_FRAMEBUFFER,_a),Mt.bindFramebuffer(F.DRAW_FRAMEBUFFER,va);for(let Ve=0;Ve<Lt;Ve++)Pe?F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,Je.__webglTexture,G,Vt+Ve):F.framebufferTexture2D(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,Je.__webglTexture,G),en?F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,ze.__webglTexture,pt,De+Ve):F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,ze.__webglTexture,pt),G!==0?F.blitFramebuffer($t,Kt,Et,It,le,Se,Et,It,F.COLOR_BUFFER_BIT,F.NEAREST):en?F.copyTexSubImage3D(ke,pt,le,Se,De+Ve,$t,Kt,Et,It):F.copyTexSubImage2D(ke,pt,le,Se,$t,Kt,Et,It);Mt.bindFramebuffer(F.READ_FRAMEBUFFER,null),Mt.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else en?A.isDataTexture||A.isData3DTexture?F.texSubImage3D(ke,pt,le,Se,De,Et,It,Lt,ge,Gt,Ie.data):H.isCompressedArrayTexture?F.compressedTexSubImage3D(ke,pt,le,Se,De,Et,It,Lt,ge,Ie.data):F.texSubImage3D(ke,pt,le,Se,De,Et,It,Lt,ge,Gt,Ie):A.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,pt,le,Se,Et,It,ge,Gt,Ie.data):A.isCompressedTexture?F.compressedTexSubImage2D(F.TEXTURE_2D,pt,le,Se,Ie.width,Ie.height,ge,Ie.data):F.texSubImage2D(F.TEXTURE_2D,pt,le,Se,Et,It,ge,Gt,Ie);F.pixelStorei(F.UNPACK_ROW_LENGTH,ve),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,on),F.pixelStorei(F.UNPACK_SKIP_PIXELS,Ue),F.pixelStorei(F.UNPACK_SKIP_ROWS,Xe),F.pixelStorei(F.UNPACK_SKIP_IMAGES,mi),pt===0&&H.generateMipmaps&&F.generateMipmap(ke),Mt.unbindTexture()},this.copyTextureToTexture3D=function(A,H,Y=null,$=null,G=0){return as('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(A,H,Y,$,G)},this.initRenderTarget=function(A){yt.get(A).__webglFramebuffer===void 0&&oe.setupRenderTarget(A)},this.initTexture=function(A){A.isCubeTexture?oe.setTextureCube(A,0):A.isData3DTexture?oe.setTexture3D(A,0):A.isDataArrayTexture||A.isCompressedArrayTexture?oe.setTexture2DArray(A,0):oe.setTexture2D(A,0),Mt.unbindTexture()},this.resetState=function(){L=0,P=0,D=null,Mt.reset(),ie.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Jn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=fe._getDrawingBufferColorSpace(t),e.unpackColorSpace=fe._getUnpackColorSpace()}}var x2=Object.defineProperty,y2=(s,t,e)=>t in s?x2(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,we=(s,t,e)=>y2(s,typeof t!="symbol"?t+"":t,e);const uu=(s,t)=>{const[e,n]=t.split("-");return Object.assign(s.style,{left:n==="left"?"0":n==="center"?"50%":"",right:n==="right"?"0":"",top:e==="top"?"0":e==="bottom"?"":"50%",bottom:e==="bottom"?"0":"",transform:`${n==="center"?"translateX(-50%)":""} ${e==="center"?"translateY(-50%)":""}`}),t},M2=({placement:s,size:t,offset:e,id:n,className:i})=>{const r=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=e;return Object.assign(r.style,{id:n,position:"absolute",zIndex:"1000",height:`${t}px`,width:`${t}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),uu(r,s),n&&(r.id=n),i&&(r.className=i),r},S2=s=>{const t=typeof s=="string"?document.querySelector(s):s;if(!t)throw Error("Invalid DOM element");return t};function tl(s,t,e){return Math.max(t,Math.min(e,s))}const b2=[["x",0,3],["y",1,4],["z",2,5]],ih=new O;function sh({isSphere:s},t,e){s&&(ih.set(0,0,1).applyQuaternion(e.quaternion),b2.forEach(([n,i,r])=>{const a=ih[n];let o=t[i],l=o.userData.opacity;o.material.opacity=tl(a>=0?l:l/2,0,1),o=t[r],l=o.userData.opacity,o.material.opacity=tl(a>=0?l/2:l,0,1)}))}const E2=(s,t,e=10)=>Math.abs(s.clientX-t.x)<e&&Math.abs(s.clientY-t.y)<e,rh=new Df,ah=new Qt,oh=(s,t,e,n)=>{ah.set((s.clientX-t.left)/t.width*2-1,-((s.clientY-t.top)/t.height)*2+1),rh.setFromCamera(ah,e);const i=rh.intersectObjects(n,!1),r=i.length?i[0]:null;return!r||!r.object.visible?null:r},eo=1e-6,w2=2*Math.PI,du=["x","y","z"],Gs=[...du,"nx","ny","nz"],T2=["x","z","y","nx","nz","ny"],A2=["z","x","y","nz","nx","ny"],el="Right",Yr="Top",nl="Front",il="Left",$r="Bottom",sl="Back",R2=[el,Yr,nl,il,$r,sl].map(s=>s.toLocaleLowerCase()),fu=1.3,lh=(s,t=!0)=>{const{material:e,userData:n}=s,{color:i,opacity:r}=t?n.hover:n;e.color.set(i),e.opacity=r},Si=s=>JSON.parse(JSON.stringify(s)),C2=s=>{const t=s.type||"sphere",e=t==="sphere",n=s.resolution||e?64:128,i=Ce.DEFAULT_UP,r=i.z===1,a=i.x===1,{container:o}=s;s.container=void 0,s=JSON.parse(JSON.stringify(s)),s.container=o;const l=r?T2:a?A2:Gs;R2.forEach((d,p)=>{s[d]&&(s[l[p]]=s[d])});const c={enabled:!0,color:16777215,opacity:1,scale:.7,labelColor:2236962,line:!1,border:{size:0,color:14540253},hover:{color:e?16777215:9688043,labelColor:2236962,opacity:1,scale:.7,border:{size:0,color:14540253}}},h={line:!1,scale:e?.45:.7,hover:{scale:e?.5:.7}},u={type:t,container:document.body,size:128,placement:"top-right",resolution:n,lineWidth:4,radius:e?1:.2,smoothness:18,animated:!0,speed:1,background:{enabled:!0,color:e?16777215:14739180,opacity:e?0:1,hover:{color:e?16777215:14739180,opacity:e?.2:1}},font:{family:"sans-serif",weight:900},offset:{top:10,left:10,bottom:10,right:10},corners:{enabled:!e,color:e?15915362:16777215,opacity:1,scale:e?.15:.2,radius:1,smoothness:18,hover:{color:e?16777215:9688043,opacity:1,scale:e?.2:.225}},edges:{enabled:!e,color:e?15915362:16777215,opacity:e?1:0,radius:e?1:.125,smoothness:18,scale:e?.15:1,hover:{color:e?16777215:9688043,opacity:1,scale:e?.2:1}},x:{...Si(c),...e?{label:"X",color:16725587,line:!0}:{label:a?Yr:el}},y:{...Si(c),...e?{label:"Y",color:9100032,line:!0}:{label:r||a?nl:Yr}},z:{...Si(c),...e?{label:"Z",color:2920447,line:!0}:{label:r?Yr:a?el:nl}},nx:{...Si(h),label:e?"":a?$r:il},ny:{...Si(h),label:e?"":r||a?sl:$r},nz:{...Si(h),label:e?"":r?$r:a?il:sl}};return rl(s,u),du.forEach(d=>rl(s[`n${d}`],Si(s[d]))),{...s,isSphere:e}};function rl(s,...t){if(s instanceof HTMLElement||typeof s!="object"||s===null)return s;for(const e of t)for(const n in e)n!=="container"&&n in e&&(s[n]===void 0?s[n]=e[n]:typeof e[n]=="object"&&!Array.isArray(e[n])&&(s[n]=rl(s[n]||{},e[n])));return s}const L2=(s,t=2)=>{const e=new qt,n=t*2,{isSphere:i,resolution:r,radius:a,font:o,corners:l,edges:c}=s,h=Gs.map(P=>({...s[P],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const u=document.createElement("canvas"),d=u.getContext("2d");u.width=r*2+n*2,u.height=r*h.length+n*h.length;const[p,m]=I(h,r,o);h.forEach(({radius:P,label:D,color:M,labelColor:y,border:U,hover:{color:B,labelColor:k,border:q}},J)=>{const z=r*J+J*n+t;S(t,z,t,r,P,D,U,M,y),S(r+t*3,z,t,r,P,D,q??U,B??M,k??y)});const _=h.length,g=t/(r*2),f=t/(r*6),b=1/_,w=new af(u);return w.repeat.set(.5-2*g,b-2*f),w.offset.set(g,1-f),Object.assign(w,{colorSpace:Me,wrapS:Nn,wrapT:Nn,userData:{offsetX:g,offsetY:f,cellHeight:b}}),w;function S(P,D,M,y,U,B,k,q,J){if(U=U*(y/2),q!=null&&q!==""&&(z(),d.fillStyle=e.set(q).getStyle(),d.fill()),k&&k.size){const tt=k.size*y/2;P+=tt,D+=tt,y-=k.size*y,U=Math.max(0,U-tt),z(),d.strokeStyle=e.set(k.color).getStyle(),d.lineWidth=k.size*y,d.stroke()}B&&L(d,P+y/2,D+(y+M)/2,B,e.set(J).getStyle());function z(){d.beginPath(),d.moveTo(P+U,D),d.lineTo(P+y-U,D),d.arcTo(P+y,D,P+y,D+U,U),d.lineTo(P+y,D+y-U),d.arcTo(P+y,D+y,P+y-U,D+y,U),d.lineTo(P+U,D+y),d.arcTo(P,D+y,P,D+y-U,U),d.lineTo(P,D+U),d.arcTo(P,D,P+U,D,U),d.closePath()}}function I(P,D,M){const y=[...P].sort((dt,mt)=>{var Rt,wt;return(((Rt=dt.label)==null?void 0:Rt.length)||0)-(((wt=mt.label)==null?void 0:wt.length)||0)}).pop().label,{family:U,weight:B}=M,k=i?Math.sqrt(Math.pow(D*.7,2)/2):D;let q=k,J=0,z=0;do{d.font=`${B} ${q}px ${U}`;const dt=d.measureText(y);J=dt.width,z=dt.fontBoundingBoxDescent,q--}while(J>k&&q>0);const tt=k/z,W=Math.min(k/J,tt),at=Math.floor(q*W);return[`${B} ${at}px ${U}`,tt]}function L(P,D,M,y,U){P.font=p,P.textAlign="center",P.textBaseline="middle",P.fillStyle=U,P.fillText(y,D,M+(i?m:0))}},P2=(s,t)=>s.offset.x=(t?.5:0)+s.userData.offsetX,Cl=(s,t)=>{const{offset:e,userData:{offsetY:n,cellHeight:i}}=s;e.y=1-(t+1)*i+n};function Ll(s,t,e=2,n=2){const i=e/2-s,r=n/2-s,a=s/e,o=(e-s)/e,l=s/n,c=(n-s)/n,h=[i,r,0,-i,r,0,-i,-r,0,i,-r,0],u=[o,c,a,c,a,l,o,l],d=[3*(t+1)+3,3*(t+1)+4,t+4,t+5,2*(t+1)+4,2,1,2*(t+1)+3,3,4*(t+1)+3,4,0],p=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11].map(L=>d[L]);let m,_,g,f,b,w,S,I;for(let L=0;L<4;L++){f=L<1||L>2?i:-i,b=L<2?r:-r,w=L<1||L>2?o:a,S=L<2?c:l;for(let P=0;P<=t;P++)m=Math.PI/2*(L+P/t),_=Math.cos(m),g=Math.sin(m),h.push(f+s*_,b+s*g,0),u.push(w+a*_,S+l*g),P<t&&(I=(t+1)*L+P+4,p.push(L,I,I+1))}return new Ne().setIndex(new Oe(new Uint32Array(p),1)).setAttribute("position",new Oe(new Float32Array(h),3)).setAttribute("uv",new Oe(new Float32Array(u),2))}const D2=(s,t)=>{const e=new O,{isSphere:n,radius:i,smoothness:r}=s,a=Ll(i,r);return Gs.map((o,l)=>{const c=l<3,h=Gs[l],u=l?t.clone():t;Cl(u,l);const{enabled:d,scale:p,opacity:m,hover:_}=s[h],g={map:u,opacity:m,transparent:!0},f=n?new xl(new oa(g)):new be(a,new pi(g)),b=c?h:h[1];return f.position[b]=(c?1:-1)*(n?fu:1),n||f.lookAt(e.copy(f.position).multiplyScalar(1.7)),f.scale.setScalar(p),f.renderOrder=1,f.visible=d,f.userData={scale:p,opacity:m,hover:_},f})},U2=(s,t)=>{const{isSphere:e,corners:n}=s;if(!n.enabled)return[];const{color:i,opacity:r,scale:a,radius:o,smoothness:l,hover:c}=n,h=e?null:Ll(o,l),u={transparent:!0,opacity:r},d=[1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,-1,-1].map(m=>m*.85),p=new O;return Array(d.length/3).fill(0).map((m,_)=>{if(e){const b=t.clone();Cl(b,6),u.map=b}else u.color=i;const g=e?new xl(new oa(u)):new be(h,new pi(u)),f=_*3;return g.position.set(d[f],d[f+1],d[f+2]),e&&g.position.normalize().multiplyScalar(1.7),g.scale.setScalar(a),g.lookAt(p.copy(g.position).multiplyScalar(2)),g.renderOrder=1,g.userData={color:i,opacity:r,scale:a,hover:c},g})},I2=(s,t,e)=>{const{isSphere:n,edges:i}=s;if(!i.enabled)return[];const{color:r,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,u=n?null:Ll(c,h,1.2,.25),d={transparent:!0,opacity:a},p=[0,1,1,0,-1,1,1,0,1,-1,0,1,0,1,-1,0,-1,-1,1,0,-1,-1,0,-1,1,1,0,1,-1,0,-1,1,0,-1,-1,0].map(g=>g*.925),m=new O,_=new O(0,1,0);return Array(p.length/3).fill(0).map((g,f)=>{if(n){const S=t.clone();Cl(S,e),d.map=S}else d.color=r;const b=n?new xl(new oa(d)):new be(u,new pi(d)),w=f*3;return b.position.set(p[w],p[w+1],p[w+2]),n&&b.position.normalize().multiplyScalar(1.7),b.scale.setScalar(o),b.up.copy(_),b.lookAt(m.copy(b.position).multiplyScalar(2)),!n&&!b.position.y&&(b.rotation.z=Math.PI/2),b.renderOrder=1,b.userData={color:r,opacity:a,scale:o,hover:l},b})};function N2(s,t=!1){const e=s[0].index!==null,n=new Set(Object.keys(s[0].attributes)),i=new Set(Object.keys(s[0].morphAttributes)),r={},a={},o=s[0].morphTargetsRelative,l=new Ne;let c=0;for(let h=0;h<s.length;++h){const u=s[h];let d=0;if(e!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const p in u.attributes){if(!n.has(p))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+p+'" attribute exists among all geometries, or in none of them.'),null;r[p]===void 0&&(r[p]=[]),r[p].push(u.attributes[p]),d++}if(d!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const p in u.morphAttributes){if(!i.has(p))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[p]===void 0&&(a[p]=[]),a[p].push(u.morphAttributes[p])}if(t){let p;if(e)p=u.index.count;else if(u.attributes.position!==void 0)p=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,p,h),c+=p}}if(e){let h=0;const u=[];for(let d=0;d<s.length;++d){const p=s[d].index;for(let m=0;m<p.count;++m)u.push(p.getX(m)+h);h+=s[d].attributes.position.count}l.setIndex(u)}for(const h in r){const u=ch(r[h]);if(!u)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,u)}for(const h in a){const u=a[h][0].length;if(u===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let d=0;d<u;++d){const p=[];for(let _=0;_<a[h].length;++_)p.push(a[h][_][d]);const m=ch(p);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(m)}}return l}function ch(s){let t,e,n,i=-1,r=0;for(let c=0;c<s.length;++c){const h=s[c];if(t===void 0&&(t=h.array.constructor),t!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(e===void 0&&(e=h.itemSize),e!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=h.normalized),n!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=h.gpuType),i!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;r+=h.count*e}const a=new t(r),o=new Oe(a,e,n);let l=0;for(let c=0;c<s.length;++c){const h=s[c];if(h.isInterleavedBufferAttribute){const u=l/e;for(let d=0,p=h.count;d<p;d++)for(let m=0;m<e;m++){const _=h.getComponent(d,m);o.setComponent(d+u,m,_)}}else a.set(h.array,l);l+=h.count*e}return i!==void 0&&(o.gpuType=i),o}const F2=(s,t)=>{const{isSphere:e,background:{enabled:n,color:i,opacity:r,hover:a}}=t;let o;const l=new pi({color:i,side:rn,opacity:r,transparent:!0,depthWrite:!1});if(!n)return null;if(e)o=new be(new la(1.8,64,64),l);else{let c;s.forEach(h=>{const u=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const d=h.geometry.clone();d.applyMatrix4(h.matrix),c=c?N2([c,d]):d,h.scale.setScalar(u)}),o=new be(c,l)}return o.userData={color:i,opacity:r,hover:a},o},hh=new Bn,Dr=new O;class pu extends Cf{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new de(t,3)),this.setAttribute("uv",new de(e,2))}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Jo(e,6,1);return this.setAttribute("instanceStart",new On(n,3,0)),this.setAttribute("instanceEnd",new On(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Jo(e,6,1);return this.setAttribute("instanceColorStart",new On(n,3,0)),this.setAttribute("instanceColorEnd",new On(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new of(t.geometry)),this}fromLineSegments(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Bn);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),hh.setFromBufferAttribute(e),this.boundingBox.union(hh))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ei),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let r=0,a=t.count;r<a;r++)Dr.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(Dr)),Dr.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(Dr));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}xt.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Qt(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};hn.line={uniforms:_l.merge([xt.common,xt.fog,xt.line]),vertexShader:`
3828
3828
  #include <common>
3829
3829
  #include <color_pars_vertex>
3830
3830
  #include <fog_pars_vertex>
@@ -4194,14 +4194,14 @@ void main() {
4194
4194
  #include <premultiplied_alpha_fragment>
4195
4195
 
4196
4196
  }
4197
- `};class kl extends ti{constructor(t){super({type:"LineMaterial",uniforms:El.clone(hn.line.uniforms),vertexShader:hn.line.vertexShader,fragmentShader:hn.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){t===!0!==this.dashed&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(t===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),t===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const co=new me,Mh=new N,Sh=new N,qe=new me,je=new me,Dn=new me,ho=new N,uo=new Yt,Ye=new op,bh=new N,Or=new Bn,zr=new ei,Un=new me;let In,Li;function Eh(s,t,e){return Un.set(0,0,-t,1).applyMatrix4(s.projectionMatrix),Un.multiplyScalar(1/Un.w),Un.x=Li/e.width,Un.y=Li/e.height,Un.applyMatrix4(s.projectionMatrixInverse),Un.multiplyScalar(1/Un.w),Math.abs(Math.max(Un.x,Un.y))}function ug(s,t){const e=s.matrixWorld,n=s.geometry,i=n.attributes.instanceStart,r=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let o=0,l=a;o<l;o++){Ye.start.fromBufferAttribute(i,o),Ye.end.fromBufferAttribute(r,o),Ye.applyMatrix4(e);const c=new N,h=new N;In.distanceSqToSegment(Ye.start,Ye.end,h,c),h.distanceTo(c)<Li*.5&&t.push({point:h,pointOnLine:c,distance:In.origin.distanceTo(h),object:s,face:null,faceIndex:o,uv:null,uv1:null})}}function dg(s,t,e){const n=t.projectionMatrix,i=s.material.resolution,r=s.matrixWorld,a=s.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,c=Math.min(a.instanceCount,o.count),h=-t.near;In.at(1,Dn),Dn.w=1,Dn.applyMatrix4(t.matrixWorldInverse),Dn.applyMatrix4(n),Dn.multiplyScalar(1/Dn.w),Dn.x*=i.x/2,Dn.y*=i.y/2,Dn.z=0,ho.copy(Dn),uo.multiplyMatrices(t.matrixWorldInverse,r);for(let u=0,d=c;u<d;u++){if(qe.fromBufferAttribute(o,u),je.fromBufferAttribute(l,u),qe.w=1,je.w=1,qe.applyMatrix4(uo),je.applyMatrix4(uo),qe.z>h&&je.z>h)continue;if(qe.z>h){const p=qe.z-je.z,E=(qe.z-h)/p;qe.lerp(je,E)}else if(je.z>h){const p=je.z-qe.z,E=(je.z-h)/p;je.lerp(qe,E)}qe.applyMatrix4(n),je.applyMatrix4(n),qe.multiplyScalar(1/qe.w),je.multiplyScalar(1/je.w),qe.x*=i.x/2,qe.y*=i.y/2,je.x*=i.x/2,je.y*=i.y/2,Ye.start.copy(qe),Ye.start.z=0,Ye.end.copy(je),Ye.end.z=0;const f=Ye.closestPointToPointParameter(ho,!0);Ye.at(f,bh);const m=Ti.lerp(qe.z,je.z,f),_=m>=-1&&m<=1,g=ho.distanceTo(bh)<Li*.5;if(_&&g){Ye.start.fromBufferAttribute(o,u),Ye.end.fromBufferAttribute(l,u),Ye.start.applyMatrix4(r),Ye.end.applyMatrix4(r);const p=new N,E=new N;In.distanceSqToSegment(Ye.start,Ye.end,E,p),e.push({point:E,pointOnLine:p,distance:In.origin.distanceTo(E),object:s,face:null,faceIndex:u,uv:null,uv1:null})}}}class fg extends be{constructor(t=new Tu,e=new kl({color:Math.random()*16777215})){super(t,e),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count);for(let a=0,o=0,l=e.count;a<l;a++,o+=2)Mh.fromBufferAttribute(e,a),Sh.fromBufferAttribute(n,a),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+Mh.distanceTo(Sh);const r=new sl(i,2,1);return t.setAttribute("instanceDistanceStart",new On(r,1,0)),t.setAttribute("instanceDistanceEnd",new On(r,1,1)),this}raycast(t,e){const n=this.material.worldUnits,i=t.camera;i===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const r=t.params.Line2!==void 0&&t.params.Line2.threshold||0;In=t.ray;const a=this.matrixWorld,o=this.geometry,l=this.material;Li=l.linewidth+r,o.boundingSphere===null&&o.computeBoundingSphere(),zr.copy(o.boundingSphere).applyMatrix4(a);let c;if(n)c=Li*.5;else{const u=Math.max(i.near,zr.distanceToPoint(In.origin));c=Eh(i,u,l.resolution)}if(zr.radius+=c,In.intersectsSphere(zr)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),Or.copy(o.boundingBox).applyMatrix4(a);let h;if(n)h=Li*.5;else{const u=Math.max(i.near,Or.distanceToPoint(In.origin));h=Eh(i,u,l.resolution)}Or.expandByScalar(h),In.intersectsBox(Or)!==!1&&(n?ug(this,e):dg(this,i,e))}onBeforeRender(t){const e=this.material.uniforms;e&&e.resolution&&(t.getViewport(co),this.material.uniforms.resolution.value.set(co.z,co.w))}}class Ru extends Tu{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setPositions(n),this}setColors(t){const e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setColors(n),this}setFromPoints(t){const e=t.length-1,n=new Float32Array(6*e);for(let i=0;i<e;i++)n[6*i]=t[i].x,n[6*i+1]=t[i].y,n[6*i+2]=t[i].z||0,n[6*i+3]=t[i+1].x,n[6*i+4]=t[i+1].y,n[6*i+5]=t[i+1].z||0;return super.setPositions(n),this}fromLine(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}}class pg extends fg{constructor(t=new Ru,e=new kl({color:Math.random()*16777215})){super(t,e),this.isLine2=!0,this.type="Line2"}}const mg=s=>{const t=new jt,e=[],n=[],{isSphere:i}=s;if(qs.forEach((o,l)=>{const{enabled:c,line:h,scale:u,color:d}=s[o];if(!c||!h)return;const f=l<3?1:-1,m=(i?Au-u/2:.975)*f;e.push(o.includes("x")?m:0,o.includes("y")?m:0,o.includes("z")?m:0,0,0,0);const _=t.set(d).toArray();n.push(..._,..._)}),!e.length)return null;const r=new Ru().setPositions(e).setColors(n),a=new kl({linewidth:s.lineWidth,vertexColors:!0,resolution:new Dt(window.innerWidth,window.innerHeight)});return new pg(r,a).computeLineDistances()},gg=s=>{const{corners:t,edges:e}=s,n=[],i=sg(s),r=ag(s,i);n.push(...r),t.enabled&&n.push(...og(s,i)),e.enabled&&n.push(...lg(s,i,t.enabled?7:6));const a=hg(r,s),o=mg(s);return[n,a,o]},Is=(s,t=!0)=>{const{material:e,userData:n}=s,{opacity:i,color:r,scale:a}=t?n.hover:n;s.scale.setScalar(a),e.opacity=i,e.map?rg(e.map,t):e.color.set(r)},ns=new Yt,wh=new vu,_g=new Dt,Ei=new N,Ah=new me;class vg extends Ce{constructor(t,e,n={}){super(),we(this,"enabled",!0),we(this,"camera"),we(this,"renderer"),we(this,"options"),we(this,"target",new N),we(this,"animated",!0),we(this,"speed",1),we(this,"animating",!1),we(this,"_options"),we(this,"_intersections"),we(this,"_background",null),we(this,"_viewport",[0,0,0,0]),we(this,"_originalViewport",[0,0,0,0]),we(this,"_originalScissor",[0,0,0,0]),we(this,"_scene"),we(this,"_camera"),we(this,"_container"),we(this,"_domElement"),we(this,"_domRect"),we(this,"_dragging",!1),we(this,"_distance",0),we(this,"_clock",new rp),we(this,"_targetQuaternion",new gn),we(this,"_quaternionStart",new gn),we(this,"_quaternionEnd",new gn),we(this,"_pointerStart",new Dt),we(this,"_focus",null),we(this,"_placement"),we(this,"_controls"),we(this,"_controlsListeners"),this.camera=t,this.renderer=e,this._scene=new wl().add(this),this.set(n)}get placement(){return this._placement}set placement(t){this._placement=Eu(this._domElement,t),this.domUpdate()}set(t={}){this.dispose(),this.options=t,this._options=ig(t),this._camera=this._options.isSphere?new pa(-1.8,1.8,1.8,-1.8,5,10):new Je(26,1,5,10),this._camera.position.set(0,0,7);const[e,n,i]=gg(this._options);n&&this.add(n),i&&this.add(i),this.add(...e),this._background=n,this._intersections=e;const{container:r,animated:a,speed:o}=this._options;return this.animated=a,this.speed=o,this._container=r?$2(r):document.body,this._domElement=J2(this._options),this._domElement.onpointerdown=l=>this._onPointerDown(l),this._domElement.onpointermove=l=>this._onPointerMove(l),this._domElement.onpointerleave=()=>this._onPointerLeave(),this._container.appendChild(this._domElement),this._controls&&this.attachControls(this._controls),this.update(),this._updateOrientation(!0),this}render(){this.animating&&this._animate();const{renderer:t,_viewport:e}=this,n=t.getScissorTest(),i=t.autoClear;return t.autoClear=!1,t.setViewport(...e),n&&t.setScissor(...e),t.clear(!1,!0,!1),t.render(this._scene,this._camera),t.setViewport(...this._originalViewport),n&&t.setScissor(...this._originalScissor),t.autoClear=i,this}domUpdate(){this._domRect=this._domElement.getBoundingClientRect();const t=this.renderer,e=this._domRect,n=t.domElement.getBoundingClientRect();return this._viewport.splice(0,4,e.left-n.left,t.domElement.clientHeight-(e.top-n.top+e.height),e.width,e.height),t.getViewport(Ah).toArray(this._originalViewport),t.getScissorTest()&&t.getScissor(Ah).toArray(this._originalScissor),this}cameraUpdate(){return this._updateOrientation(),this}update(t=!0){return t&&this._controls&&this._controls.update(),this.domUpdate().cameraUpdate()}attachControls(t){return this.detachControls(),this.target=t.target,this._controlsListeners={start:()=>t.enabled=!1,end:()=>t.enabled=!0,change:()=>this.update(!1)},this.addEventListener("start",this._controlsListeners.start),this.addEventListener("end",this._controlsListeners.end),t.addEventListener("change",this._controlsListeners.change),this._controls=t,this}detachControls(){if(!(!this._controlsListeners||!this._controls))return this.target=new N().copy(this._controls.target),this.removeEventListener("start",this._controlsListeners.start),this.removeEventListener("end",this._controlsListeners.end),this._controls.removeEventListener("change",this._controlsListeners.change),this._controlsListeners=void 0,this._controls=void 0,this}dispose(){var t;this.detachControls(),this.children.forEach(e=>{var n,i,r,a;this.remove(e);const o=e;(n=o.material)==null||n.dispose(),(r=(i=o.material)==null?void 0:i.map)==null||r.dispose(),(a=o.geometry)==null||a.dispose()}),(t=this._domElement)==null||t.remove()}_updateOrientation(t=!0){t&&(this.quaternion.copy(this.camera.quaternion).invert(),this.updateMatrixWorld()),ph(this._options,this._intersections,this.camera)}_animate(){const{position:t,quaternion:e}=this.camera;if(t.set(0,0,1),!this.animated){t.applyQuaternion(this._quaternionEnd).multiplyScalar(this._distance).add(this.target),e.copy(this._targetQuaternion),this._updateOrientation(),this.animating=!1,this.dispatchEvent({type:"change"}),this.dispatchEvent({type:"end"});return}this._controls&&(this._controls.enabled=!1);const n=this._clock.getDelta()*Q2*this.speed;this._quaternionStart.rotateTowards(this._quaternionEnd,n),t.applyQuaternion(this._quaternionStart).multiplyScalar(this._distance).add(this.target),e.rotateTowards(this._targetQuaternion,n),this._updateOrientation(),requestAnimationFrame(()=>this.dispatchEvent({type:"change"})),this._quaternionStart.angleTo(this._quaternionEnd)<lo&&(this._controls&&(this._controls.enabled=!0),this.animating=!1,this.dispatchEvent({type:"end"}))}_setOrientation(t){const e=this.camera,n=this.target;Ei.copy(t).multiplyScalar(this._distance),ns.setPosition(Ei).lookAt(Ei,this.position,this.up),this._targetQuaternion.setFromRotationMatrix(ns),Ei.add(n),ns.lookAt(Ei,n,this.up),this._quaternionEnd.setFromRotationMatrix(ns),ns.setPosition(e.position).lookAt(e.position,n,this.up),this._quaternionStart.setFromRotationMatrix(ns),this.animating=!0,this._clock.start(),this.dispatchEvent({type:"start"})}_onPointerDown(t){if(!this.enabled)return;const e=l=>{if(!this._dragging){if(Z2(l,this._pointerStart))return;this._dragging=!0}const c=_g.set(l.clientX,l.clientY).sub(this._pointerStart).multiplyScalar(1/this._domRect.width*Math.PI),h=this.coordinateConversion(Ei.subVectors(this.camera.position,this.target)),u=wh.setFromVector3(h);u.theta=a-c.x,u.phi=ol(o-c.y,lo,Math.PI-lo),this.coordinateConversion(this.camera.position.setFromSpherical(u),!0).add(this.target),this.camera.lookAt(this.target),this.quaternion.copy(this.camera.quaternion).invert(),this._updateOrientation(!1),this.dispatchEvent({type:"change"})},n=()=>{if(document.removeEventListener("pointermove",e,!1),document.removeEventListener("pointerup",n,!1),!this._dragging)return this._handleClick(t);this._focus&&(Is(this._focus,!1),this._focus=null),this._dragging=!1,this.dispatchEvent({type:"end"})};if(this.animating)return;t.preventDefault(),this._pointerStart.set(t.clientX,t.clientY);const i=this.coordinateConversion(Ei.subVectors(this.camera.position,this.target)),r=wh.setFromVector3(i),a=r.theta,o=r.phi;this._distance=r.radius,document.addEventListener("pointermove",e,!1),document.addEventListener("pointerup",n,!1),this.dispatchEvent({type:"start"})}coordinateConversion(t,e=!1){const{x:n,y:i,z:r}=t,a=Ce.DEFAULT_UP;return a.x===1?e?t.set(i,r,n):t.set(r,n,i):a.z===1?e?t.set(r,n,i):t.set(i,r,n):t}_onPointerMove(t){!this.enabled||this._dragging||(this._background&&vh(this._background,!0),this._handleHover(t))}_onPointerLeave(){!this.enabled||this._dragging||(this._background&&vh(this._background,!1),this._focus&&Is(this._focus,!1),this._domElement.style.cursor="")}_handleClick(t){const e=_h(t,this._domRect,this._camera,this._intersections);this._focus&&(Is(this._focus,!1),this._focus=null),e&&(this._setOrientation(e.object.position),this.dispatchEvent({type:"change"}))}_handleHover(t){const e=_h(t,this._domRect,this._camera,this._intersections),n=(e==null?void 0:e.object)||null;this._focus!==n&&(this._domElement.style.cursor=n?"pointer":"",this._focus&&Is(this._focus,!1),(this._focus=n)?Is(n,!0):ph(this._options,this._intersections,this.camera))}}const xg=/^[og]\s*(.+)?/,yg=/^mtllib /,Mg=/^usemtl /,Sg=/^usemap /,Th=/\s+/,Rh=new N,fo=new N,Ch=new N,Lh=new N,vn=new N,Br=new jt;function bg(){const s={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=e!==!1;return}const n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,r){const a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);const o={index:this.materials.length,name:i||"",mtllib:Array.isArray(r)&&r.length>0?r[r.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(o),o},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const r=this.currentMaterial();if(r&&r.groupEnd===-1&&(r.groupEnd=this.geometry.vertices.length/3,r.groupCount=r.groupEnd-r.groupStart,r.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),r}},n&&n.name&&typeof n.clone=="function"){const i=n.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(t,e){const n=parseInt(t,10);return(n>=0?n-1:n+e/3)*3},parseNormalIndex:function(t,e){const n=parseInt(t,10);return(n>=0?n-1:n+e/3)*3},parseUVIndex:function(t,e){const n=parseInt(t,10);return(n>=0?n-1:n+e/2)*2},addVertex:function(t,e,n){const i=this.vertices,r=this.object.geometry.vertices;r.push(i[t+0],i[t+1],i[t+2]),r.push(i[e+0],i[e+1],i[e+2]),r.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,n){const i=this.normals,r=this.object.geometry.normals;r.push(i[t+0],i[t+1],i[t+2]),r.push(i[e+0],i[e+1],i[e+2]),r.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(t,e,n){const i=this.vertices,r=this.object.geometry.normals;Rh.fromArray(i,t),fo.fromArray(i,e),Ch.fromArray(i,n),vn.subVectors(Ch,fo),Lh.subVectors(Rh,fo),vn.cross(Lh),vn.normalize(),r.push(vn.x,vn.y,vn.z),r.push(vn.x,vn.y,vn.z),r.push(vn.x,vn.y,vn.z)},addColor:function(t,e,n){const i=this.colors,r=this.object.geometry.colors;i[t]!==void 0&&r.push(i[t+0],i[t+1],i[t+2]),i[e]!==void 0&&r.push(i[e+0],i[e+1],i[e+2]),i[n]!==void 0&&r.push(i[n+0],i[n+1],i[n+2])},addUV:function(t,e,n){const i=this.uvs,r=this.object.geometry.uvs;r.push(i[t+0],i[t+1]),r.push(i[e+0],i[e+1]),r.push(i[n+0],i[n+1])},addDefaultUV:function(){const t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){const e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,n,i,r,a,o,l,c){const h=this.vertices.length;let u=this.parseVertexIndex(t,h),d=this.parseVertexIndex(e,h),f=this.parseVertexIndex(n,h);if(this.addVertex(u,d,f),this.addColor(u,d,f),o!==void 0&&o!==""){const m=this.normals.length;u=this.parseNormalIndex(o,m),d=this.parseNormalIndex(l,m),f=this.parseNormalIndex(c,m),this.addNormal(u,d,f)}else this.addFaceNormal(u,d,f);if(i!==void 0&&i!==""){const m=this.uvs.length;u=this.parseUVIndex(i,m),d=this.parseUVIndex(r,m),f=this.parseUVIndex(a,m),this.addUV(u,d,f),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";const e=this.vertices.length;for(let n=0,i=t.length;n<i;n++){const r=this.parseVertexIndex(t[n],e);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(t,e){this.object.geometry.type="Line";const n=this.vertices.length,i=this.uvs.length;for(let r=0,a=t.length;r<a;r++)this.addVertexLine(this.parseVertexIndex(t[r],n));for(let r=0,a=e.length;r<a;r++)this.addUVLine(this.parseUVIndex(e[r],i))}};return s.startObject("",!1),s}class po extends Ln{constructor(t){super(t),this.materials=null}load(t,e,n,i){const r=this,a=new ys(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(o){try{e(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(t)}},n,i)}setMaterials(t){return this.materials=t,this}parse(t){const e=new bg;t.indexOf(`\r
4197
+ `};class Pl extends ti{constructor(t){super({type:"LineMaterial",uniforms:_l.clone(hn.line.uniforms),vertexShader:hn.line.vertexShader,fragmentShader:hn.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){t===!0!==this.dashed&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(t===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),t===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const no=new me,uh=new O,dh=new O,qe=new me,je=new me,Dn=new me,io=new O,so=new Zt,Ye=new Uf,fh=new O,Ur=new Bn,Ir=new ei,Un=new me;let In,Ci;function ph(s,t,e){return Un.set(0,0,-t,1).applyMatrix4(s.projectionMatrix),Un.multiplyScalar(1/Un.w),Un.x=Ci/e.width,Un.y=Ci/e.height,Un.applyMatrix4(s.projectionMatrixInverse),Un.multiplyScalar(1/Un.w),Math.abs(Math.max(Un.x,Un.y))}function O2(s,t){const e=s.matrixWorld,n=s.geometry,i=n.attributes.instanceStart,r=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let o=0,l=a;o<l;o++){Ye.start.fromBufferAttribute(i,o),Ye.end.fromBufferAttribute(r,o),Ye.applyMatrix4(e);const c=new O,h=new O;In.distanceSqToSegment(Ye.start,Ye.end,h,c),h.distanceTo(c)<Ci*.5&&t.push({point:h,pointOnLine:c,distance:In.origin.distanceTo(h),object:s,face:null,faceIndex:o,uv:null,uv1:null})}}function z2(s,t,e){const n=t.projectionMatrix,i=s.material.resolution,r=s.matrixWorld,a=s.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,c=Math.min(a.instanceCount,o.count),h=-t.near;In.at(1,Dn),Dn.w=1,Dn.applyMatrix4(t.matrixWorldInverse),Dn.applyMatrix4(n),Dn.multiplyScalar(1/Dn.w),Dn.x*=i.x/2,Dn.y*=i.y/2,Dn.z=0,io.copy(Dn),so.multiplyMatrices(t.matrixWorldInverse,r);for(let u=0,d=c;u<d;u++){if(qe.fromBufferAttribute(o,u),je.fromBufferAttribute(l,u),qe.w=1,je.w=1,qe.applyMatrix4(so),je.applyMatrix4(so),qe.z>h&&je.z>h)continue;if(qe.z>h){const f=qe.z-je.z,b=(qe.z-h)/f;qe.lerp(je,b)}else if(je.z>h){const f=je.z-qe.z,b=(je.z-h)/f;je.lerp(qe,b)}qe.applyMatrix4(n),je.applyMatrix4(n),qe.multiplyScalar(1/qe.w),je.multiplyScalar(1/je.w),qe.x*=i.x/2,qe.y*=i.y/2,je.x*=i.x/2,je.y*=i.y/2,Ye.start.copy(qe),Ye.start.z=0,Ye.end.copy(je),Ye.end.z=0;const p=Ye.closestPointToPointParameter(io,!0);Ye.at(p,fh);const m=Ti.lerp(qe.z,je.z,p),_=m>=-1&&m<=1,g=io.distanceTo(fh)<Ci*.5;if(_&&g){Ye.start.fromBufferAttribute(o,u),Ye.end.fromBufferAttribute(l,u),Ye.start.applyMatrix4(r),Ye.end.applyMatrix4(r);const f=new O,b=new O;In.distanceSqToSegment(Ye.start,Ye.end,b,f),e.push({point:b,pointOnLine:f,distance:In.origin.distanceTo(b),object:s,face:null,faceIndex:u,uv:null,uv1:null})}}}class B2 extends be{constructor(t=new pu,e=new Pl({color:Math.random()*16777215})){super(t,e),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count);for(let a=0,o=0,l=e.count;a<l;a++,o+=2)uh.fromBufferAttribute(e,a),dh.fromBufferAttribute(n,a),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+uh.distanceTo(dh);const r=new Jo(i,2,1);return t.setAttribute("instanceDistanceStart",new On(r,1,0)),t.setAttribute("instanceDistanceEnd",new On(r,1,1)),this}raycast(t,e){const n=this.material.worldUnits,i=t.camera;i===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const r=t.params.Line2!==void 0&&t.params.Line2.threshold||0;In=t.ray;const a=this.matrixWorld,o=this.geometry,l=this.material;Ci=l.linewidth+r,o.boundingSphere===null&&o.computeBoundingSphere(),Ir.copy(o.boundingSphere).applyMatrix4(a);let c;if(n)c=Ci*.5;else{const u=Math.max(i.near,Ir.distanceToPoint(In.origin));c=ph(i,u,l.resolution)}if(Ir.radius+=c,In.intersectsSphere(Ir)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),Ur.copy(o.boundingBox).applyMatrix4(a);let h;if(n)h=Ci*.5;else{const u=Math.max(i.near,Ur.distanceToPoint(In.origin));h=ph(i,u,l.resolution)}Ur.expandByScalar(h),In.intersectsBox(Ur)!==!1&&(n?O2(this,e):z2(this,i,e))}onBeforeRender(t){const e=this.material.uniforms;e&&e.resolution&&(t.getViewport(no),this.material.uniforms.resolution.value.set(no.z,no.w))}}class mu extends pu{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setPositions(n),this}setColors(t){const e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setColors(n),this}setFromPoints(t){const e=t.length-1,n=new Float32Array(6*e);for(let i=0;i<e;i++)n[6*i]=t[i].x,n[6*i+1]=t[i].y,n[6*i+2]=t[i].z||0,n[6*i+3]=t[i+1].x,n[6*i+4]=t[i+1].y,n[6*i+5]=t[i+1].z||0;return super.setPositions(n),this}fromLine(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}}class k2 extends B2{constructor(t=new mu,e=new Pl({color:Math.random()*16777215})){super(t,e),this.isLine2=!0,this.type="Line2"}}const V2=s=>{const t=new qt,e=[],n=[],{isSphere:i}=s;if(Gs.forEach((o,l)=>{const{enabled:c,line:h,scale:u,color:d}=s[o];if(!c||!h)return;const p=l<3?1:-1,m=(i?fu-u/2:.975)*p;e.push(o.includes("x")?m:0,o.includes("y")?m:0,o.includes("z")?m:0,0,0,0);const _=t.set(d).toArray();n.push(..._,..._)}),!e.length)return null;const r=new mu().setPositions(e).setColors(n),a=new Pl({linewidth:s.lineWidth,vertexColors:!0,resolution:new Qt(window.innerWidth,window.innerHeight)});return new k2(r,a).computeLineDistances()},H2=s=>{const{corners:t,edges:e}=s,n=[],i=L2(s),r=D2(s,i);n.push(...r),t.enabled&&n.push(...U2(s,i)),e.enabled&&n.push(...I2(s,i,t.enabled?7:6));const a=F2(r,s),o=V2(s);return[n,a,o]},Us=(s,t=!0)=>{const{material:e,userData:n}=s,{opacity:i,color:r,scale:a}=t?n.hover:n;s.scale.setScalar(a),e.opacity=i,e.map?P2(e.map,t):e.color.set(r)},es=new Zt,mh=new ru,G2=new Qt,bi=new O,gh=new me;class W2 extends Ce{constructor(t,e,n={}){super(),we(this,"enabled",!0),we(this,"camera"),we(this,"renderer"),we(this,"options"),we(this,"target",new O),we(this,"animated",!0),we(this,"speed",1),we(this,"animating",!1),we(this,"_options"),we(this,"_intersections"),we(this,"_background",null),we(this,"_viewport",[0,0,0,0]),we(this,"_originalViewport",[0,0,0,0]),we(this,"_originalScissor",[0,0,0,0]),we(this,"_scene"),we(this,"_camera"),we(this,"_container"),we(this,"_domElement"),we(this,"_domRect"),we(this,"_dragging",!1),we(this,"_distance",0),we(this,"_clock",new Pf),we(this,"_targetQuaternion",new gn),we(this,"_quaternionStart",new gn),we(this,"_quaternionEnd",new gn),we(this,"_pointerStart",new Qt),we(this,"_focus",null),we(this,"_placement"),we(this,"_controls"),we(this,"_controlsListeners"),this.camera=t,this.renderer=e,this._scene=new vl().add(this),this.set(n)}get placement(){return this._placement}set placement(t){this._placement=uu(this._domElement,t),this.domUpdate()}set(t={}){this.dispose(),this.options=t,this._options=C2(t),this._camera=this._options.isSphere?new ha(-1.8,1.8,1.8,-1.8,5,10):new $e(26,1,5,10),this._camera.position.set(0,0,7);const[e,n,i]=H2(this._options);n&&this.add(n),i&&this.add(i),this.add(...e),this._background=n,this._intersections=e;const{container:r,animated:a,speed:o}=this._options;return this.animated=a,this.speed=o,this._container=r?S2(r):document.body,this._domElement=M2(this._options),this._domElement.onpointerdown=l=>this._onPointerDown(l),this._domElement.onpointermove=l=>this._onPointerMove(l),this._domElement.onpointerleave=()=>this._onPointerLeave(),this._container.appendChild(this._domElement),this._controls&&this.attachControls(this._controls),this.update(),this._updateOrientation(!0),this}render(){this.animating&&this._animate();const{renderer:t,_viewport:e}=this,n=t.getScissorTest(),i=t.autoClear;return t.autoClear=!1,t.setViewport(...e),n&&t.setScissor(...e),t.clear(!1,!0,!1),t.render(this._scene,this._camera),t.setViewport(...this._originalViewport),n&&t.setScissor(...this._originalScissor),t.autoClear=i,this}domUpdate(){this._domRect=this._domElement.getBoundingClientRect();const t=this.renderer,e=this._domRect,n=t.domElement.getBoundingClientRect();return this._viewport.splice(0,4,e.left-n.left,t.domElement.clientHeight-(e.top-n.top+e.height),e.width,e.height),t.getViewport(gh).toArray(this._originalViewport),t.getScissorTest()&&t.getScissor(gh).toArray(this._originalScissor),this}cameraUpdate(){return this._updateOrientation(),this}update(t=!0){return t&&this._controls&&this._controls.update(),this.domUpdate().cameraUpdate()}attachControls(t){return this.detachControls(),this.target=t.target,this._controlsListeners={start:()=>t.enabled=!1,end:()=>t.enabled=!0,change:()=>this.update(!1)},this.addEventListener("start",this._controlsListeners.start),this.addEventListener("end",this._controlsListeners.end),t.addEventListener("change",this._controlsListeners.change),this._controls=t,this}detachControls(){if(!(!this._controlsListeners||!this._controls))return this.target=new O().copy(this._controls.target),this.removeEventListener("start",this._controlsListeners.start),this.removeEventListener("end",this._controlsListeners.end),this._controls.removeEventListener("change",this._controlsListeners.change),this._controlsListeners=void 0,this._controls=void 0,this}dispose(){var t;this.detachControls(),this.children.forEach(e=>{var n,i,r,a;this.remove(e);const o=e;(n=o.material)==null||n.dispose(),(r=(i=o.material)==null?void 0:i.map)==null||r.dispose(),(a=o.geometry)==null||a.dispose()}),(t=this._domElement)==null||t.remove()}_updateOrientation(t=!0){t&&(this.quaternion.copy(this.camera.quaternion).invert(),this.updateMatrixWorld()),sh(this._options,this._intersections,this.camera)}_animate(){const{position:t,quaternion:e}=this.camera;if(t.set(0,0,1),!this.animated){t.applyQuaternion(this._quaternionEnd).multiplyScalar(this._distance).add(this.target),e.copy(this._targetQuaternion),this._updateOrientation(),this.animating=!1,this.dispatchEvent({type:"change"}),this.dispatchEvent({type:"end"});return}this._controls&&(this._controls.enabled=!1);const n=this._clock.getDelta()*w2*this.speed;this._quaternionStart.rotateTowards(this._quaternionEnd,n),t.applyQuaternion(this._quaternionStart).multiplyScalar(this._distance).add(this.target),e.rotateTowards(this._targetQuaternion,n),this._updateOrientation(),requestAnimationFrame(()=>this.dispatchEvent({type:"change"})),this._quaternionStart.angleTo(this._quaternionEnd)<eo&&(this._controls&&(this._controls.enabled=!0),this.animating=!1,this.dispatchEvent({type:"end"}))}_setOrientation(t){const e=this.camera,n=this.target;bi.copy(t).multiplyScalar(this._distance),es.setPosition(bi).lookAt(bi,this.position,this.up),this._targetQuaternion.setFromRotationMatrix(es),bi.add(n),es.lookAt(bi,n,this.up),this._quaternionEnd.setFromRotationMatrix(es),es.setPosition(e.position).lookAt(e.position,n,this.up),this._quaternionStart.setFromRotationMatrix(es),this.animating=!0,this._clock.start(),this.dispatchEvent({type:"start"})}_onPointerDown(t){if(!this.enabled)return;const e=l=>{if(!this._dragging){if(E2(l,this._pointerStart))return;this._dragging=!0}const c=G2.set(l.clientX,l.clientY).sub(this._pointerStart).multiplyScalar(1/this._domRect.width*Math.PI),h=this.coordinateConversion(bi.subVectors(this.camera.position,this.target)),u=mh.setFromVector3(h);u.theta=a-c.x,u.phi=tl(o-c.y,eo,Math.PI-eo),this.coordinateConversion(this.camera.position.setFromSpherical(u),!0).add(this.target),this.camera.lookAt(this.target),this.quaternion.copy(this.camera.quaternion).invert(),this._updateOrientation(!1),this.dispatchEvent({type:"change"})},n=()=>{if(document.removeEventListener("pointermove",e,!1),document.removeEventListener("pointerup",n,!1),!this._dragging)return this._handleClick(t);this._focus&&(Us(this._focus,!1),this._focus=null),this._dragging=!1,this.dispatchEvent({type:"end"})};if(this.animating)return;t.preventDefault(),this._pointerStart.set(t.clientX,t.clientY);const i=this.coordinateConversion(bi.subVectors(this.camera.position,this.target)),r=mh.setFromVector3(i),a=r.theta,o=r.phi;this._distance=r.radius,document.addEventListener("pointermove",e,!1),document.addEventListener("pointerup",n,!1),this.dispatchEvent({type:"start"})}coordinateConversion(t,e=!1){const{x:n,y:i,z:r}=t,a=Ce.DEFAULT_UP;return a.x===1?e?t.set(i,r,n):t.set(r,n,i):a.z===1?e?t.set(r,n,i):t.set(i,r,n):t}_onPointerMove(t){!this.enabled||this._dragging||(this._background&&lh(this._background,!0),this._handleHover(t))}_onPointerLeave(){!this.enabled||this._dragging||(this._background&&lh(this._background,!1),this._focus&&Us(this._focus,!1),this._domElement.style.cursor="")}_handleClick(t){const e=oh(t,this._domRect,this._camera,this._intersections);this._focus&&(Us(this._focus,!1),this._focus=null),e&&(this._setOrientation(e.object.position),this.dispatchEvent({type:"change"}))}_handleHover(t){const e=oh(t,this._domRect,this._camera,this._intersections),n=(e==null?void 0:e.object)||null;this._focus!==n&&(this._domElement.style.cursor=n?"pointer":"",this._focus&&Us(this._focus,!1),(this._focus=n)?Us(n,!0):sh(this._options,this._intersections,this.camera))}}const X2=/^[og]\s*(.+)?/,q2=/^mtllib /,j2=/^usemtl /,Y2=/^usemap /,_h=/\s+/,vh=new O,ro=new O,xh=new O,yh=new O,vn=new O,Nr=new qt;function $2(){const s={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=e!==!1;return}const n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,r){const a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);const o={index:this.materials.length,name:i||"",mtllib:Array.isArray(r)&&r.length>0?r[r.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(o),o},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const r=this.currentMaterial();if(r&&r.groupEnd===-1&&(r.groupEnd=this.geometry.vertices.length/3,r.groupCount=r.groupEnd-r.groupStart,r.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),r}},n&&n.name&&typeof n.clone=="function"){const i=n.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(t,e){const n=parseInt(t,10);return(n>=0?n-1:n+e/3)*3},parseNormalIndex:function(t,e){const n=parseInt(t,10);return(n>=0?n-1:n+e/3)*3},parseUVIndex:function(t,e){const n=parseInt(t,10);return(n>=0?n-1:n+e/2)*2},addVertex:function(t,e,n){const i=this.vertices,r=this.object.geometry.vertices;r.push(i[t+0],i[t+1],i[t+2]),r.push(i[e+0],i[e+1],i[e+2]),r.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,n){const i=this.normals,r=this.object.geometry.normals;r.push(i[t+0],i[t+1],i[t+2]),r.push(i[e+0],i[e+1],i[e+2]),r.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(t,e,n){const i=this.vertices,r=this.object.geometry.normals;vh.fromArray(i,t),ro.fromArray(i,e),xh.fromArray(i,n),vn.subVectors(xh,ro),yh.subVectors(vh,ro),vn.cross(yh),vn.normalize(),r.push(vn.x,vn.y,vn.z),r.push(vn.x,vn.y,vn.z),r.push(vn.x,vn.y,vn.z)},addColor:function(t,e,n){const i=this.colors,r=this.object.geometry.colors;i[t]!==void 0&&r.push(i[t+0],i[t+1],i[t+2]),i[e]!==void 0&&r.push(i[e+0],i[e+1],i[e+2]),i[n]!==void 0&&r.push(i[n+0],i[n+1],i[n+2])},addUV:function(t,e,n){const i=this.uvs,r=this.object.geometry.uvs;r.push(i[t+0],i[t+1]),r.push(i[e+0],i[e+1]),r.push(i[n+0],i[n+1])},addDefaultUV:function(){const t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){const e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,n,i,r,a,o,l,c){const h=this.vertices.length;let u=this.parseVertexIndex(t,h),d=this.parseVertexIndex(e,h),p=this.parseVertexIndex(n,h);if(this.addVertex(u,d,p),this.addColor(u,d,p),o!==void 0&&o!==""){const m=this.normals.length;u=this.parseNormalIndex(o,m),d=this.parseNormalIndex(l,m),p=this.parseNormalIndex(c,m),this.addNormal(u,d,p)}else this.addFaceNormal(u,d,p);if(i!==void 0&&i!==""){const m=this.uvs.length;u=this.parseUVIndex(i,m),d=this.parseUVIndex(r,m),p=this.parseUVIndex(a,m),this.addUV(u,d,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";const e=this.vertices.length;for(let n=0,i=t.length;n<i;n++){const r=this.parseVertexIndex(t[n],e);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(t,e){this.object.geometry.type="Line";const n=this.vertices.length,i=this.uvs.length;for(let r=0,a=t.length;r<a;r++)this.addVertexLine(this.parseVertexIndex(t[r],n));for(let r=0,a=e.length;r<a;r++)this.addUVLine(this.parseUVIndex(e[r],i))}};return s.startObject("",!1),s}class ao extends Ln{constructor(t){super(t),this.materials=null}load(t,e,n,i){const r=this,a=new xs(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(o){try{e(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(t)}},n,i)}setMaterials(t){return this.materials=t,this}parse(t){const e=new $2;t.indexOf(`\r
4198
4198
  `)!==-1&&(t=t.replace(/\r\n/g,`
4199
4199
  `)),t.indexOf(`\\
4200
4200
  `)!==-1&&(t=t.replace(/\\\n/g,""));const n=t.split(`
4201
- `);let i=[];for(let o=0,l=n.length;o<l;o++){const c=n[o].trimStart();if(c.length===0)continue;const h=c.charAt(0);if(h!=="#")if(h==="v"){const u=c.split(Th);switch(u[0]){case"v":e.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Br.setRGB(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),Me),e.colors.push(Br.r,Br.g,Br.b)):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":e.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(h==="f"){const d=c.slice(1).trim().split(Th),f=[];for(let _=0,g=d.length;_<g;_++){const p=d[_];if(p.length>0){const E=p.split("/");f.push(E)}}const m=f[0];for(let _=1,g=f.length-1;_<g;_++){const p=f[_],E=f[_+1];e.addFace(m[0],p[0],E[0],m[1],p[1],E[1],m[2],p[2],E[2])}}else if(h==="l"){const u=c.substring(1).trim().split(" ");let d=[];const f=[];if(c.indexOf("/")===-1)d=u;else for(let m=0,_=u.length;m<_;m++){const g=u[m].split("/");g[0]!==""&&d.push(g[0]),g[1]!==""&&f.push(g[1])}e.addLineGeometry(d,f)}else if(h==="p"){const d=c.slice(1).trim().split(" ");e.addPointGeometry(d)}else if((i=xg.exec(c))!==null){const u=(" "+i[0].slice(1).trim()).slice(1);e.startObject(u)}else if(Mg.test(c))e.object.startMaterial(c.substring(7).trim(),e.materialLibraries);else if(yg.test(c))e.materialLibraries.push(c.substring(7).trim());else if(Sg.test(c))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(h==="s"){if(i=c.split(" "),i.length>1){const d=i[1].trim().toLowerCase();e.object.smooth=d!=="0"&&d!=="off"}else e.object.smooth=!0;const u=e.object.currentMaterial();u&&(u.smooth=e.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}e.finalize();const r=new Zn;if(r.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let o=0,l=e.objects.length;o<l;o++){const c=e.objects[o],h=c.geometry,u=c.materials,d=h.type==="Line",f=h.type==="Points";let m=!1;if(h.vertices.length===0)continue;const _=new Ie;_.setAttribute("position",new le(h.vertices,3)),h.normals.length>0&&_.setAttribute("normal",new le(h.normals,3)),h.colors.length>0&&(m=!0,_.setAttribute("color",new le(h.colors,3))),h.hasUVIndices===!0&&_.setAttribute("uv",new le(h.uvs,2));const g=[];for(let E=0,b=u.length;E<b;E++){const M=u[E],I=M.name+"_"+M.smooth+"_"+m;let C=e.materials[I];if(this.materials!==null){if(C=this.materials.create(M.name),d&&C&&!(C instanceof pi)){const P=new pi;Mn.prototype.copy.call(P,C),P.color.copy(C.color),C=P}else if(f&&C&&!(C instanceof Ci)){const P=new Ci({size:10,sizeAttenuation:!1});Mn.prototype.copy.call(P,C),P.color.copy(C.color),P.map=C.map,C=P}}C===void 0&&(d?C=new pi:f?C=new Ci({size:1,sizeAttenuation:!1}):C=new cn,C.name=M.name,C.flatShading=!M.smooth,C.vertexColors=m,e.materials[I]=C),g.push(C)}let p;if(g.length>1){for(let E=0,b=u.length;E<b;E++){const M=u[E];_.addGroup(M.groupStart,M.groupCount,E)}d?p=new aa(_,g):f?p=new zs(_,g):p=new be(_,g)}else d?p=new aa(_,g[0]):f?p=new zs(_,g[0]):p=new be(_,g[0]);p.name=c.name,r.add(p)}else if(e.vertices.length>0){const o=new Ci({size:1,sizeAttenuation:!1}),l=new Ie;l.setAttribute("position",new le(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(l.setAttribute("color",new le(e.colors,3)),o.vertexColors=!0);const c=new zs(l,o);r.add(c)}return r}}class mo extends Ln{constructor(t){super(t)}load(t,e,n,i){const r=this,a=this.path===""?Fl.extractUrlBase(t):this.path,o=new ys(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(l){try{e(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(t)}},n,i)}setMaterialOptions(t){return this.materialOptions=t,this}parse(t,e){const n=t.split(`
4202
- `);let i={};const r=/\s+/,a={};for(let l=0;l<n.length;l++){let c=n[l];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const h=c.indexOf(" ");let u=h>=0?c.substring(0,h):c;u=u.toLowerCase();let d=h>=0?c.substring(h+1):"";if(d=d.trim(),u==="newmtl")i={name:d},a[d]=i;else if(u==="ka"||u==="kd"||u==="ks"||u==="ke"){const f=d.split(r,3);i[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else i[u]=d}const o=new Eg(this.resourcePath||e,this.materialOptions);return o.setCrossOrigin(this.crossOrigin),o.setManager(this.manager),o.setMaterials(a),o}}class Eg{constructor(t="",e={}){this.baseUrl=t,this.options=e,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:Cn,this.wrap=this.options.wrap!==void 0?this.options.wrap:Nn}setCrossOrigin(t){return this.crossOrigin=t,this}setManager(t){this.manager=t}setMaterials(t){this.materialsInfo=this.convert(t),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(t){if(!this.options)return t;const e={};for(const n in t){const i=t[n],r={};e[n]=r;for(const a in i){let o=!0,l=i[a];const c=a.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(l=[l[0]/255,l[1]/255,l[2]/255]),this.options&&this.options.ignoreZeroRGBs&&l[0]===0&&l[1]===0&&l[2]===0&&(o=!1);break}o&&(r[c]=l)}}return e}preload(){for(const t in this.materialsInfo)this.create(t)}getIndex(t){return this.nameLookup[t]}getAsArray(){let t=0;for(const e in this.materialsInfo)this.materialsArray[t]=this.create(e),this.nameLookup[e]=t,t++;return this.materialsArray}create(t){return this.materials[t]===void 0&&this.createMaterial_(t),this.materials[t]}createMaterial_(t){const e=this,n=this.materialsInfo[t],i={name:t,side:this.side};function r(o,l){return typeof l!="string"||l===""?"":/^https?:\/\//i.test(l)?l:o+l}function a(o,l){if(i[o])return;const c=e.getTextureParams(l,i),h=e.loadTexture(r(e.baseUrl,c.url));h.repeat.copy(c.scale),h.offset.copy(c.offset),h.wrapS=e.wrap,h.wrapT=e.wrap,(o==="map"||o==="emissiveMap")&&(h.colorSpace=Me),i[o]=h}for(const o in n){const l=n[o];let c;if(l!=="")switch(o.toLowerCase()){case"kd":i.color=pe.colorSpaceToWorking(new jt().fromArray(l),Me);break;case"ks":i.specular=pe.colorSpaceToWorking(new jt().fromArray(l),Me);break;case"ke":i.emissive=pe.colorSpaceToWorking(new jt().fromArray(l),Me);break;case"map_kd":a("map",l);break;case"map_ks":a("specularMap",l);break;case"map_ke":a("emissiveMap",l);break;case"norm":a("normalMap",l);break;case"map_bump":case"bump":a("bumpMap",l);break;case"disp":a("displacementMap",l);break;case"map_d":a("alphaMap",l),i.transparent=!0;break;case"ns":i.shininess=parseFloat(l);break;case"d":c=parseFloat(l),c<1&&(i.opacity=c,i.transparent=!0);break;case"tr":c=parseFloat(l),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(i.opacity=1-c,i.transparent=!0);break}}return this.materials[t]=new cn(i),this.materials[t]}getTextureParams(t,e){const n={scale:new Dt(1,1),offset:new Dt(0,0)},i=t.split(/\s+/);let r;return r=i.indexOf("-bm"),r>=0&&(e.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),r=i.indexOf("-mm"),r>=0&&(e.displacementBias=parseFloat(i[r+1]),e.displacementScale=parseFloat(i[r+2]),i.splice(r,3)),r=i.indexOf("-s"),r>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),r=i.indexOf("-o"),r>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n}loadTexture(t,e,n,i,r){const a=this.manager!==void 0?this.manager:Ul;let o=a.getHandler(t);o===null&&(o=new Il(a)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const l=o.load(t,n,i,r);return e!==void 0&&(l.mapping=e),l}}class ta extends Ln{constructor(t){super(t)}load(t,e,n,i){const r=this,a=new ys(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(o){try{e(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(t)}},n,i)}parse(t){function e(c){const h=new DataView(c),u=32/8*3+32/8*3*3+16/8,d=h.getUint32(80,!0);if(80+32/8+d*u===h.byteLength)return!0;const m=[115,111,108,105,100];for(let _=0;_<5;_++)if(n(m,h,_))return!1;return!0}function n(c,h,u){for(let d=0,f=c.length;d<f;d++)if(c[d]!==h.getUint8(u+d))return!1;return!0}function i(c){const h=new DataView(c),u=h.getUint32(80,!0);let d,f,m,_=!1,g,p,E,b,M;for(let U=0;U<70;U++)h.getUint32(U,!1)==1129270351&&h.getUint8(U+4)==82&&h.getUint8(U+5)==61&&(_=!0,g=new Float32Array(u*3*3),p=h.getUint8(U+6)/255,E=h.getUint8(U+7)/255,b=h.getUint8(U+8)/255,M=h.getUint8(U+9)/255);const I=84,C=12*4+2,P=new Ie,D=new Float32Array(u*3*3),S=new Float32Array(u*3*3),y=new jt;for(let U=0;U<u;U++){const B=I+U*C,k=h.getFloat32(B,!0),q=h.getFloat32(B+4,!0),K=h.getFloat32(B+8,!0);if(_){const z=h.getUint16(B+48,!0);(z&32768)===0?(d=(z&31)/31,f=(z>>5&31)/31,m=(z>>10&31)/31):(d=p,f=E,m=b)}for(let z=1;z<=3;z++){const tt=B+z*12,W=U*3*3+(z-1)*3;D[W]=h.getFloat32(tt,!0),D[W+1]=h.getFloat32(tt+4,!0),D[W+2]=h.getFloat32(tt+8,!0),S[W]=k,S[W+1]=q,S[W+2]=K,_&&(y.setRGB(d,f,m,Me),g[W]=y.r,g[W+1]=y.g,g[W+2]=y.b)}}return P.setAttribute("position",new Oe(D,3)),P.setAttribute("normal",new Oe(S,3)),_&&(P.setAttribute("color",new Oe(g,3)),P.hasColors=!0,P.alpha=M),P}function r(c){const h=new Ie,u=/solid([\s\S]*?)endsolid/g,d=/facet([\s\S]*?)endfacet/g,f=/solid\s(.+)/;let m=0;const _=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+_+_+_,"g"),p=new RegExp("normal"+_+_+_,"g"),E=[],b=[],M=[],I=new N;let C,P=0,D=0,S=0;for(;(C=u.exec(c))!==null;){D=S;const y=C[0],U=(C=f.exec(y))!==null?C[1]:"";for(M.push(U);(C=d.exec(y))!==null;){let q=0,K=0;const z=C[0];for(;(C=p.exec(z))!==null;)I.x=parseFloat(C[1]),I.y=parseFloat(C[2]),I.z=parseFloat(C[3]),K++;for(;(C=g.exec(z))!==null;)E.push(parseFloat(C[1]),parseFloat(C[2]),parseFloat(C[3])),b.push(I.x,I.y,I.z),q++,S++;K!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+m),q!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+m),m++}const B=D,k=S-D;h.userData.groupNames=M,h.addGroup(B,k,P),P++}return h.setAttribute("position",new le(E,3)),h.setAttribute("normal",new le(b,3)),h}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function o(c){if(typeof c=="string"){const h=new Uint8Array(c.length);for(let u=0;u<c.length;u++)h[u]=c.charCodeAt(u)&255;return h.buffer||h}else return c}const l=o(t);return e(l)?i(l):r(a(t))}}class wg extends Ln{constructor(t){super(t),this.littleEndian=!0}load(t,e,n,i){const r=this,a=new ys(r.manager);a.setPath(r.path),a.setResponseType("arraybuffer"),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(t,function(o){try{e(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(t)}},n,i)}_getDataView(t,e,n,i){switch(n){case"F":return i===8?t.getFloat64(e,this.littleEndian):t.getFloat32(e,this.littleEndian);case"I":return i===1?t.getInt8(e):i===2?t.getInt16(e,this.littleEndian):t.getInt32(e,this.littleEndian);case"U":return i===1?t.getUint8(e):i===2?t.getUint16(e,this.littleEndian):t.getUint32(e,this.littleEndian)}}parse(t){function e(f,m){const _=f.length,g=new Uint8Array(m);let p=0,E=0,b,M,I;do if(b=f[p++],b<32){if(b++,E+b>m)throw new Error("Output buffer is not large enough");if(p+b>_)throw new Error("Invalid compressed data");do g[E++]=f[p++];while(--b)}else{if(M=b>>5,I=E-((b&31)<<8)-1,p>=_)throw new Error("Invalid compressed data");if(M===7&&(M+=f[p++],p>=_))throw new Error("Invalid compressed data");if(I-=f[p++],E+M+2>m)throw new Error("Output buffer is not large enough");if(I<0)throw new Error("Invalid compressed data");if(I>=E)throw new Error("Invalid compressed data");do g[E++]=g[I++];while(--M+2)}while(p<_);return g}function n(f){const m={},_=new Uint8Array(f);let g="",p="",E=0,b=!1;const M=_.length;for(;E<M&&b===!1;){const D=String.fromCharCode(_[E++]);D===`
4203
- `||D==="\r"?(p.trim().toLowerCase().startsWith("data")&&(b=!0),p=""):p+=D,g+=D}const I=g.search(/[\r\n]DATA\s(\S*)\s/i),C=/[\r\n]DATA\s(\S*)\s/i.exec(g.slice(I-1));if(m.data=C[1],m.headerLen=C[0].length+I,m.str=g.slice(0,m.headerLen),m.str=m.str.replace(/#.*/gi,""),m.version=/^VERSION (.*)/im.exec(m.str),m.fields=/^FIELDS (.*)/im.exec(m.str),m.size=/^SIZE (.*)/im.exec(m.str),m.type=/^TYPE (.*)/im.exec(m.str),m.count=/^COUNT (.*)/im.exec(m.str),m.width=/^WIDTH (.*)/im.exec(m.str),m.height=/^HEIGHT (.*)/im.exec(m.str),m.viewpoint=/^VIEWPOINT (.*)/im.exec(m.str),m.points=/^POINTS (.*)/im.exec(m.str),m.version!==null&&(m.version=parseFloat(m.version[1])),m.fields=m.fields!==null?m.fields[1].split(" "):[],m.type!==null&&(m.type=m.type[1].split(" ")),m.width!==null&&(m.width=parseInt(m.width[1])),m.height!==null&&(m.height=parseInt(m.height[1])),m.viewpoint!==null&&(m.viewpoint=m.viewpoint[1]),m.points!==null&&(m.points=parseInt(m.points[1],10)),m.points===null&&(m.points=m.width*m.height),m.size!==null&&(m.size=m.size[1].split(" ").map(function(D){return parseInt(D,10)})),m.count!==null)m.count=m.count[1].split(" ").map(function(D){return parseInt(D,10)});else{m.count=[];for(let D=0,S=m.fields.length;D<S;D++)m.count.push(1)}m.offset={};let P=0;for(let D=0,S=m.fields.length;D<S;D++)m.data==="ascii"?m.offset[m.fields[D]]=D:(m.offset[m.fields[D]]=P,P+=m.size[D]*m.count[D]);return m.rowSize=P,m}const i=n(t),r=[],a=[],o=[],l=[],c=[],h=new jt;if(i.data==="ascii"){const f=i.offset,g=new TextDecoder().decode(t).slice(i.headerLen).split(`
4204
- `);for(let p=0,E=g.length;p<E;p++){if(g[p]==="")continue;const b=g[p].split(" ");if(f.x!==void 0&&(r.push(parseFloat(b[f.x])),r.push(parseFloat(b[f.y])),r.push(parseFloat(b[f.z]))),f.rgb!==void 0){const M=i.fields.findIndex(U=>U==="rgb"),I=i.type[M],C=parseFloat(b[f.rgb]);let P=C;if(I==="F"){const U=new Float32Array(1);U[0]=C,P=new Int32Array(U.buffer)[0]}const D=(P>>16&255)/255,S=(P>>8&255)/255,y=(P>>0&255)/255;h.setRGB(D,S,y,Me),o.push(h.r,h.g,h.b)}f.normal_x!==void 0&&(a.push(parseFloat(b[f.normal_x])),a.push(parseFloat(b[f.normal_y])),a.push(parseFloat(b[f.normal_z]))),f.intensity!==void 0&&l.push(parseFloat(b[f.intensity])),f.label!==void 0&&c.push(parseInt(b[f.label]))}}if(i.data==="binary_compressed"){const f=new Uint32Array(t.slice(i.headerLen,i.headerLen+8)),m=f[0],_=f[1],g=e(new Uint8Array(t,i.headerLen+8,m),_),p=new DataView(g.buffer),E=i.offset;for(let b=0;b<i.points;b++){if(E.x!==void 0){const M=i.fields.indexOf("x"),I=i.fields.indexOf("y"),C=i.fields.indexOf("z");r.push(this._getDataView(p,i.points*E.x+i.size[M]*b,i.type[M],i.size[M])),r.push(this._getDataView(p,i.points*E.y+i.size[I]*b,i.type[I],i.size[I])),r.push(this._getDataView(p,i.points*E.z+i.size[C]*b,i.type[C],i.size[C]))}if(E.rgb!==void 0){const M=i.fields.indexOf("rgb"),I=p.getUint8(i.points*E.rgb+i.size[M]*b+2)/255,C=p.getUint8(i.points*E.rgb+i.size[M]*b+1)/255,P=p.getUint8(i.points*E.rgb+i.size[M]*b+0)/255;h.setRGB(I,C,P,Me),o.push(h.r,h.g,h.b)}if(E.normal_x!==void 0){const M=i.fields.indexOf("normal_x"),I=i.fields.indexOf("normal_y"),C=i.fields.indexOf("normal_z");a.push(this._getDataView(p,i.points*E.normal_x+i.size[M]*b,i.type[M],i.size[M])),a.push(this._getDataView(p,i.points*E.normal_y+i.size[I]*b,i.type[I],i.size[I])),a.push(this._getDataView(p,i.points*E.normal_z+i.size[C]*b,i.type[C],i.size[C]))}if(E.intensity!==void 0){const M=i.fields.indexOf("intensity");l.push(this._getDataView(p,i.points*E.intensity+i.size[M]*b,i.type[M],i.size[M]))}if(E.label!==void 0){const M=i.fields.indexOf("label");c.push(p.getInt32(i.points*E.label+i.size[M]*b,this.littleEndian))}}}if(i.data==="binary"){const f=new DataView(t,i.headerLen),m=i.offset;for(let _=0,g=0;_<i.points;_++,g+=i.rowSize){if(m.x!==void 0){const p=i.fields.indexOf("x"),E=i.fields.indexOf("y"),b=i.fields.indexOf("z");r.push(this._getDataView(f,g+m.x,i.type[p],i.size[p])),r.push(this._getDataView(f,g+m.y,i.type[E],i.size[E])),r.push(this._getDataView(f,g+m.z,i.type[b],i.size[b]))}if(m.rgb!==void 0){const p=f.getUint8(g+m.rgb+2)/255,E=f.getUint8(g+m.rgb+1)/255,b=f.getUint8(g+m.rgb+0)/255;h.setRGB(p,E,b,Me),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const p=i.fields.indexOf("normal_x"),E=i.fields.indexOf("normal_y"),b=i.fields.indexOf("normal_z");a.push(this._getDataView(f,g+m.normal_x,i.type[p],i.size[p])),a.push(this._getDataView(f,g+m.normal_y,i.type[E],i.size[E])),a.push(this._getDataView(f,g+m.normal_z,i.type[b],i.size[b]))}if(m.intensity!==void 0){const p=i.fields.indexOf("intensity");l.push(this._getDataView(f,g+m.intensity,i.type[p],i.size[p]))}m.label!==void 0&&c.push(f.getInt32(g+m.label,this.littleEndian))}}const u=new Ie;r.length>0&&u.setAttribute("position",new le(r,3)),a.length>0&&u.setAttribute("normal",new le(a,3)),o.length>0&&u.setAttribute("color",new le(o,3)),l.length>0&&u.setAttribute("intensity",new le(l,1)),c.length>0&&u.setAttribute("label",new sf(c,1)),u.computeBoundingSphere();const d=new Ci({size:.005});return o.length>0&&(d.vertexColors=!0),new zs(u,d)}}class Ph extends Kf{constructor(t){super(t)}parse(t){function e(z){switch(z.image_type){case d:case _:if(z.colormap_length>256||z.colormap_size!==24||z.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case f:case m:case g:case p:if(z.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case u:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+z.image_type)}if(z.width<=0||z.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(z.pixel_size!==8&&z.pixel_size!==16&&z.pixel_size!==24&&z.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+z.pixel_size)}function n(z,tt,W,at,dt){let mt,Rt;const wt=W.pixel_size>>3,X=W.width*W.height*wt;if(tt&&(Rt=dt.subarray(at,at+=W.colormap_length*(W.colormap_size>>3))),z){mt=new Uint8Array(X);let Z,Q,et,_t=0;const ot=new Uint8Array(wt);for(;_t<X;)if(Z=dt[at++],Q=(Z&127)+1,Z&128){for(et=0;et<wt;++et)ot[et]=dt[at++];for(et=0;et<Q;++et)mt.set(ot,_t+et*wt);_t+=wt*Q}else{for(Q*=wt,et=0;et<Q;++et)mt[_t+et]=dt[at++];_t+=Q}}else mt=dt.subarray(at,at+=tt?W.width*W.height:X);return{pixel_data:mt,palettes:Rt}}function i(z,tt,W,at,dt,mt,Rt,wt,X){const Z=X;let Q,et=0,_t,ot;const gt=y.width;for(ot=tt;ot!==at;ot+=W)for(_t=dt;_t!==Rt;_t+=mt,et++)Q=wt[et],z[(_t+gt*ot)*4+3]=255,z[(_t+gt*ot)*4+2]=Z[Q*3+0],z[(_t+gt*ot)*4+1]=Z[Q*3+1],z[(_t+gt*ot)*4+0]=Z[Q*3+2];return z}function r(z,tt,W,at,dt,mt,Rt,wt){let X,Z=0,Q,et;const _t=y.width;for(et=tt;et!==at;et+=W)for(Q=dt;Q!==Rt;Q+=mt,Z+=2)X=wt[Z+0]+(wt[Z+1]<<8),z[(Q+_t*et)*4+0]=(X&31744)>>7,z[(Q+_t*et)*4+1]=(X&992)>>2,z[(Q+_t*et)*4+2]=(X&31)<<3,z[(Q+_t*et)*4+3]=X&32768?0:255;return z}function a(z,tt,W,at,dt,mt,Rt,wt){let X=0,Z,Q;const et=y.width;for(Q=tt;Q!==at;Q+=W)for(Z=dt;Z!==Rt;Z+=mt,X+=3)z[(Z+et*Q)*4+3]=255,z[(Z+et*Q)*4+2]=wt[X+0],z[(Z+et*Q)*4+1]=wt[X+1],z[(Z+et*Q)*4+0]=wt[X+2];return z}function o(z,tt,W,at,dt,mt,Rt,wt){let X=0,Z,Q;const et=y.width;for(Q=tt;Q!==at;Q+=W)for(Z=dt;Z!==Rt;Z+=mt,X+=4)z[(Z+et*Q)*4+2]=wt[X+0],z[(Z+et*Q)*4+1]=wt[X+1],z[(Z+et*Q)*4+0]=wt[X+2],z[(Z+et*Q)*4+3]=wt[X+3];return z}function l(z,tt,W,at,dt,mt,Rt,wt){let X,Z=0,Q,et;const _t=y.width;for(et=tt;et!==at;et+=W)for(Q=dt;Q!==Rt;Q+=mt,Z++)X=wt[Z],z[(Q+_t*et)*4+0]=X,z[(Q+_t*et)*4+1]=X,z[(Q+_t*et)*4+2]=X,z[(Q+_t*et)*4+3]=255;return z}function c(z,tt,W,at,dt,mt,Rt,wt){let X=0,Z,Q;const et=y.width;for(Q=tt;Q!==at;Q+=W)for(Z=dt;Z!==Rt;Z+=mt,X+=2)z[(Z+et*Q)*4+0]=wt[X+0],z[(Z+et*Q)*4+1]=wt[X+0],z[(Z+et*Q)*4+2]=wt[X+0],z[(Z+et*Q)*4+3]=wt[X+1];return z}function h(z,tt,W,at,dt){let mt,Rt,wt,X,Z,Q;switch((y.flags&E)>>b){default:case C:mt=0,wt=1,Z=tt,Rt=0,X=1,Q=W;break;case M:mt=0,wt=1,Z=tt,Rt=W-1,X=-1,Q=-1;break;case P:mt=tt-1,wt=-1,Z=-1,Rt=0,X=1,Q=W;break;case I:mt=tt-1,wt=-1,Z=-1,Rt=W-1,X=-1,Q=-1;break}if(k)switch(y.pixel_size){case 8:l(z,Rt,X,Q,mt,wt,Z,at);break;case 16:c(z,Rt,X,Q,mt,wt,Z,at);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(y.pixel_size){case 8:i(z,Rt,X,Q,mt,wt,Z,at,dt);break;case 16:r(z,Rt,X,Q,mt,wt,Z,at);break;case 24:a(z,Rt,X,Q,mt,wt,Z,at);break;case 32:o(z,Rt,X,Q,mt,wt,Z,at);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return z}const u=0,d=1,f=2,m=3,_=9,g=10,p=11,E=48,b=4,M=0,I=1,C=2,P=3;if(t.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let D=0;const S=new Uint8Array(t),y={id_length:S[D++],colormap_type:S[D++],image_type:S[D++],colormap_index:S[D++]|S[D++]<<8,colormap_length:S[D++]|S[D++]<<8,colormap_size:S[D++],origin:[S[D++]|S[D++]<<8,S[D++]|S[D++]<<8],width:S[D++]|S[D++]<<8,height:S[D++]|S[D++]<<8,pixel_size:S[D++],flags:S[D++]};if(e(y),y.id_length+D>t.length)throw new Error("THREE.TGALoader: No data.");D+=y.id_length;let U=!1,B=!1,k=!1;switch(y.image_type){case _:U=!0,B=!0;break;case d:B=!0;break;case g:U=!0;break;case f:break;case p:U=!0,k=!0;break;case m:k=!0;break}const q=new Uint8Array(y.width*y.height*4),K=n(U,B,y,D,S);return h(q,y.width,y.height,K.pixel_data,K.palettes),{data:q,width:y.width,height:y.height,flipY:!0,generateMipmaps:!0,minFilter:$n}}}class Ag extends Ln{load(t,e,n,i){const r=this,a=r.path===""?Fl.extractUrlBase(t):r.path,o=new ys(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(t,function(l){try{e(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(t)}},n,i)}parse(t,e){function n(x,v){const R=[],A=x.childNodes;for(let L=0,$=A.length;L<$;L++){const it=A[L];it.nodeName===v&&R.push(it)}return R}function i(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let A=0,L=v.length;A<L;A++)R[A]=v[A];return R}function r(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let A=0,L=v.length;A<L;A++)R[A]=parseFloat(v[A]);return R}function a(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let A=0,L=v.length;A<L;A++)R[A]=parseInt(v[A]);return R}function o(x){return x.substring(1)}function l(){return"three_default_"+Vn++}function c(x){return Object.keys(x).length===0}function h(x){return{unit:u(n(x,"unit")[0]),upAxis:d(n(x,"up_axis")[0])}}function u(x){return x!==void 0&&x.hasAttribute("meter")===!0?parseFloat(x.getAttribute("meter")):1}function d(x){return x!==void 0?x.textContent:"Y_UP"}function f(x,v,R,A){const L=n(x,v)[0];if(L!==void 0){const $=n(L,R);for(let it=0;it<$.length;it++)A($[it])}}function m(x,v){for(const R in x){const A=x[R];A.build=v(x[R])}}function _(x,v){return x.build!==void 0||(x.build=v(x)),x.build}function g(x){const v={sources:{},samplers:{},channels:{}};let R=!1;for(let A=0,L=x.childNodes.length;A<L;A++){const $=x.childNodes[A];if($.nodeType!==1)continue;let it;switch($.nodeName){case"source":it=$.getAttribute("id"),v.sources[it]=ht($);break;case"sampler":it=$.getAttribute("id"),v.samplers[it]=p($);break;case"channel":it=$.getAttribute("target"),v.channels[it]=E($);break;case"animation":g($),R=!0;break;default:console.log($)}}R===!1&&(Qt.animations[x.getAttribute("id")||Ti.generateUUID()]=v)}function p(x){const v={inputs:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"input":const $=o(L.getAttribute("source")),it=L.getAttribute("semantic");v.inputs[it]=$;break}}return v}function E(x){const v={};let A=x.getAttribute("target").split("/");const L=A.shift();let $=A.shift();const it=$.indexOf("(")!==-1,Pt=$.indexOf(".")!==-1;if(Pt)A=$.split("."),$=A.shift(),v.member=A.shift();else if(it){const vt=$.split("(");$=vt.shift();for(let Tt=0;Tt<vt.length;Tt++)vt[Tt]=parseInt(vt[Tt].replace(/\)/,""));v.indices=vt}return v.id=L,v.sid=$,v.arraySyntax=it,v.memberSyntax=Pt,v.sampler=o(x.getAttribute("source")),v}function b(x){const v=[],R=x.channels,A=x.samplers,L=x.sources;for(const $ in R)if(R.hasOwnProperty($)){const it=R[$],Pt=A[it.sampler],vt=Pt.inputs.INPUT,Tt=Pt.inputs.OUTPUT,Vt=L[vt],ut=L[Tt],zt=I(it,Vt,ut);y(zt,v)}return v}function M(x){return _(Qt.animations[x],b)}function I(x,v,R){const A=Qt.nodes[x.id],L=ce(A.id),$=A.transforms[x.sid],it=A.matrix.clone().transpose();let Pt,vt,Tt,Vt,ut,zt;const Ft={};switch($){case"matrix":for(Tt=0,Vt=v.array.length;Tt<Vt;Tt++)if(Pt=v.array[Tt],vt=Tt*R.stride,Ft[Pt]===void 0&&(Ft[Pt]={}),x.arraySyntax===!0){const Fe=R.array[vt],Ae=x.indices[0]+4*x.indices[1];Ft[Pt][Ae]=Fe}else for(ut=0,zt=R.stride;ut<zt;ut++)Ft[Pt][ut]=R.array[vt+ut];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',$);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',$);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',$);break}const qt=C(Ft,it);return{name:L.uuid,keyframes:qt}}function C(x,v){const R=[];for(const L in x)R.push({time:parseFloat(L),value:x[L]});R.sort(A);for(let L=0;L<16;L++)U(R,L,v.elements[L]);return R;function A(L,$){return L.time-$.time}}const P=new N,D=new N,S=new gn;function y(x,v){const R=x.keyframes,A=x.name,L=[],$=[],it=[],Pt=[];for(let vt=0,Tt=R.length;vt<Tt;vt++){const Vt=R[vt],ut=Vt.time,zt=Vt.value;H.fromArray(zt).transpose(),H.decompose(P,S,D),L.push(ut),$.push(P.x,P.y,P.z),it.push(S.x,S.y,S.z,S.w),Pt.push(D.x,D.y,D.z)}return $.length>0&&v.push(new ms(A+".position",L,$)),it.length>0&&v.push(new Js(A+".quaternion",L,it)),Pt.length>0&&v.push(new ms(A+".scale",L,Pt)),v}function U(x,v,R){let A,L=!0,$,it;for($=0,it=x.length;$<it;$++)A=x[$],A.value[v]===void 0?A.value[v]=null:L=!1;if(L===!0)for($=0,it=x.length;$<it;$++)A=x[$],A.value[v]=R;else B(x,v)}function B(x,v){let R,A;for(let L=0,$=x.length;L<$;L++){const it=x[L];if(it.value[v]===null){if(R=k(x,L,v),A=q(x,L,v),R===null){it.value[v]=A.value[v];continue}if(A===null){it.value[v]=R.value[v];continue}K(it,R,A,v)}}}function k(x,v,R){for(;v>=0;){const A=x[v];if(A.value[R]!==null)return A;v--}return null}function q(x,v,R){for(;v<x.length;){const A=x[v];if(A.value[R]!==null)return A;v++}return null}function K(x,v,R,A){if(R.time-v.time===0){x.value[A]=v.value[A];return}x.value[A]=(x.time-v.time)*(R.value[A]-v.value[A])/(R.time-v.time)+v.value[A]}function z(x){const v={name:x.getAttribute("id")||"default",start:parseFloat(x.getAttribute("start")||0),end:parseFloat(x.getAttribute("end")||0),animations:[]};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"instance_animation":v.animations.push(o(L.getAttribute("url")));break}}Qt.clips[x.getAttribute("id")]=v}function tt(x){const v=[],R=x.name,A=x.end-x.start||-1,L=x.animations;for(let $=0,it=L.length;$<it;$++){const Pt=M(L[$]);for(let vt=0,Tt=Pt.length;vt<Tt;vt++)v.push(Pt[vt])}return new Ic(R,A,v)}function W(x){return _(Qt.clips[x],tt)}function at(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"skin":v.id=o(L.getAttribute("source")),v.skin=dt(L);break;case"morph":v.id=o(L.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}Qt.controllers[x.getAttribute("id")]=v}function dt(x){const v={sources:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"bind_shape_matrix":v.bindShapeMatrix=r(L.textContent);break;case"source":const $=L.getAttribute("id");v.sources[$]=ht(L);break;case"joints":v.joints=mt(L);break;case"vertex_weights":v.vertexWeights=Rt(L);break}}return v}function mt(x){const v={inputs:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"input":const $=L.getAttribute("semantic"),it=o(L.getAttribute("source"));v.inputs[$]=it;break}}return v}function Rt(x){const v={inputs:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"input":const $=L.getAttribute("semantic"),it=o(L.getAttribute("source")),Pt=parseInt(L.getAttribute("offset"));v.inputs[$]={id:it,offset:Pt};break;case"vcount":v.vcount=a(L.textContent);break;case"v":v.v=a(L.textContent);break}}return v}function wt(x){const v={id:x.id},R=Qt.geometries[v.id];return x.skin!==void 0&&(v.skin=X(x.skin),R.sources.skinIndices=v.skin.indices,R.sources.skinWeights=v.skin.weights),v}function X(x){const R={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},A=x.sources,L=x.vertexWeights,$=L.vcount,it=L.v,Pt=L.inputs.JOINT.offset,vt=L.inputs.WEIGHT.offset,Tt=x.sources[x.joints.inputs.JOINT],Vt=x.sources[x.joints.inputs.INV_BIND_MATRIX],ut=A[L.inputs.WEIGHT.id].array;let zt=0,Ft,qt,Gt;for(Ft=0,Gt=$.length;Ft<Gt;Ft++){const Ae=$[Ft],xe=[];for(qt=0;qt<Ae;qt++){const ye=it[zt+Pt],Hn=it[zt+vt],ln=ut[Hn];xe.push({index:ye,weight:ln}),zt+=2}for(xe.sort(Fe),qt=0;qt<4;qt++){const ye=xe[qt];ye!==void 0?(R.indices.array.push(ye.index),R.weights.array.push(ye.weight)):(R.indices.array.push(0),R.weights.array.push(0))}}for(x.bindShapeMatrix?R.bindMatrix=new Yt().fromArray(x.bindShapeMatrix).transpose():R.bindMatrix=new Yt().identity(),Ft=0,Gt=Tt.array.length;Ft<Gt;Ft++){const Ae=Tt.array[Ft],xe=new Yt().fromArray(Vt.array,Ft*Vt.stride).transpose();R.joints.push({name:Ae,boneInverse:xe})}return R;function Fe(Ae,xe){return xe.weight-Ae.weight}}function Z(x){return _(Qt.controllers[x],wt)}function Q(x){const v={init_from:n(x,"init_from")[0].textContent};Qt.images[x.getAttribute("id")]=v}function et(x){return x.build!==void 0?x.build:x.init_from}function _t(x){const v=Qt.images[x];return v!==void 0?_(v,et):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",x),null)}function ot(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"profile_COMMON":v.profile=gt(L);break}}Qt.effects[x.getAttribute("id")]=v}function gt(x){const v={surfaces:{},samplers:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"newparam":te(L,v);break;case"technique":v.technique=O(L);break;case"extra":v.extra=yt(L);break}}return v}function te(x,v){const R=x.getAttribute("sid");for(let A=0,L=x.childNodes.length;A<L;A++){const $=x.childNodes[A];if($.nodeType===1)switch($.nodeName){case"surface":v.surfaces[R]=ee($);break;case"sampler2D":v.samplers[R]=Jt($);break}}}function ee(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"init_from":v.init_from=L.textContent;break}}return v}function Jt(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"source":v.source=L.textContent;break}}return v}function O(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"constant":case"lambert":case"blinn":case"phong":v.type=L.nodeName,v.parameters=_e(L);break;case"extra":v.extra=yt(L);break}}return v}function _e(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":v[L.nodeName]=se(L);break;case"transparent":v[L.nodeName]={opaque:L.hasAttribute("opaque")?L.getAttribute("opaque"):"A_ONE",data:se(L)};break}}return v}function se(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"color":v[L.nodeName]=r(L.textContent);break;case"float":v[L.nodeName]=parseFloat(L.textContent);break;case"texture":v[L.nodeName]={id:L.getAttribute("texture"),extra:re(L)};break}}return v}function re(x){const v={technique:{}};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"extra":Mt(L,v);break}}return v}function Mt(x,v){for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"technique":ne(L,v);break}}}function ne(x,v){for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":v.technique[L.nodeName]=parseFloat(L.textContent);break;case"wrapU":case"wrapV":L.textContent.toUpperCase()==="TRUE"?v.technique[L.nodeName]=1:L.textContent.toUpperCase()==="FALSE"?v.technique[L.nodeName]=0:v.technique[L.nodeName]=parseInt(L.textContent);break;case"bump":v[L.nodeName]=Ee(L);break}}}function yt(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"technique":v.technique=oe(L);break}}return v}function oe(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"double_sided":v[L.nodeName]=parseInt(L.textContent);break;case"bump":v[L.nodeName]=Ee(L);break}}return v}function Ee(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"texture":v[L.nodeName]={id:L.getAttribute("texture"),texcoord:L.getAttribute("texcoord"),extra:re(L)};break}}return v}function F(x){return x}function w(x){return _(Qt.effects[x],F)}function j(x){const v={name:x.getAttribute("name")};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"instance_effect":v.url=o(L.getAttribute("url"));break}}Qt.materials[x.getAttribute("id")]=v}function st(x){let v,R=x.slice((x.lastIndexOf(".")-1>>>0)+2);switch(R=R.toLowerCase(),R){case"tga":v=Ke;break;default:v=en}return v}function lt(x){const v=w(x.url),R=v.profile.technique;let A;switch(R.type){case"phong":case"blinn":A=new cn;break;case"lambert":A=new Of;break;default:A=new mi;break}A.name=x.name||"";function L(vt,Tt=null){const Vt=v.profile.samplers[vt.id];let ut=null;if(Vt!==void 0){const zt=v.profile.surfaces[Vt.source];ut=_t(zt.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),ut=_t(vt.id);if(ut!==null){const zt=st(ut);if(zt!==void 0){const Ft=zt.load(ut),qt=vt.extra;if(qt!==void 0&&qt.technique!==void 0&&c(qt.technique)===!1){const Gt=qt.technique;Ft.wrapS=Gt.wrapU?Nn:Tn,Ft.wrapT=Gt.wrapV?Nn:Tn,Ft.offset.set(Gt.offsetU||0,Gt.offsetV||0),Ft.repeat.set(Gt.repeatU||1,Gt.repeatV||1)}else Ft.wrapS=Nn,Ft.wrapT=Nn;return Tt!==null&&(Ft.colorSpace=Tt),Ft}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",ut),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",vt.id),null}const $=R.parameters;for(const vt in $){const Tt=$[vt];switch(vt){case"diffuse":Tt.color&&A.color.fromArray(Tt.color),Tt.texture&&(A.map=L(Tt.texture,Me));break;case"specular":Tt.color&&A.specular&&A.specular.fromArray(Tt.color),Tt.texture&&(A.specularMap=L(Tt.texture));break;case"bump":Tt.texture&&(A.normalMap=L(Tt.texture));break;case"ambient":Tt.texture&&(A.lightMap=L(Tt.texture,Me));break;case"shininess":Tt.float&&A.shininess&&(A.shininess=Tt.float);break;case"emission":Tt.color&&A.emissive&&A.emissive.fromArray(Tt.color),Tt.texture&&(A.emissiveMap=L(Tt.texture,Me));break}}pe.colorSpaceToWorking(A.color,Me),A.specular&&pe.colorSpaceToWorking(A.specular,Me),A.emissive&&pe.colorSpaceToWorking(A.emissive,Me);let it=$.transparent,Pt=$.transparency;if(Pt===void 0&&it&&(Pt={float:1}),it===void 0&&Pt&&(it={opaque:"A_ONE",data:{color:[1,1,1,1]}}),it&&Pt)if(it.data.texture)A.transparent=!0;else{const vt=it.data.color;switch(it.opaque){case"A_ONE":A.opacity=vt[3]*Pt.float;break;case"RGB_ZERO":A.opacity=1-vt[0]*Pt.float;break;case"A_ZERO":A.opacity=1-vt[3]*Pt.float;break;case"RGB_ONE":A.opacity=vt[0]*Pt.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',it.opaque)}A.opacity<1&&(A.transparent=!0)}if(R.extra!==void 0&&R.extra.technique!==void 0){const vt=R.extra.technique;for(const Tt in vt){const Vt=vt[Tt];switch(Tt){case"double_sided":A.side=Vt===1?tn:Cn;break;case"bump":A.normalMap=L(Vt.texture),A.normalScale=new Dt(1,1);break}}}return A}function nt(x){return _(Qt.materials[x],lt)}function Bt(x){const v={name:x.getAttribute("name")};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"optics":v.optics=bt(L);break}}Qt.cameras[x.getAttribute("id")]=v}function bt(x){for(let v=0;v<x.childNodes.length;v++){const R=x.childNodes[v];switch(R.nodeName){case"technique_common":return Ot(R)}}return{}}function Ot(x){const v={};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];switch(A.nodeName){case"perspective":case"orthographic":v.technique=A.nodeName,v.parameters=kt(A);break}}return v}function kt(x){const v={};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];switch(A.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":v[A.nodeName]=parseFloat(A.textContent);break}}return v}function ct(x){let v;switch(x.optics.technique){case"perspective":v=new Je(x.optics.parameters.yfov,x.optics.parameters.aspect_ratio,x.optics.parameters.znear,x.optics.parameters.zfar);break;case"orthographic":let R=x.optics.parameters.ymag,A=x.optics.parameters.xmag;const L=x.optics.parameters.aspect_ratio;A=A===void 0?R*L:A,R=R===void 0?A/L:R,A*=.5,R*=.5,v=new pa(-A,A,R,-R,x.optics.parameters.znear,x.optics.parameters.zfar);break;default:v=new Je;break}return v.name=x.name||"",v}function Ct(x){const v=Qt.cameras[x];return v!==void 0?_(v,ct):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",x),null)}function $t(x){let v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"technique_common":v=Xt(L);break}}Qt.lights[x.getAttribute("id")]=v}function Xt(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"directional":case"point":case"spot":case"ambient":v.technique=L.nodeName,v.parameters=St(L)}}return v}function St(x){const v={};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"color":const $=r(L.textContent);v.color=new jt().fromArray($),pe.colorSpaceToWorking(v.color,Me);break;case"falloff_angle":v.falloffAngle=parseFloat(L.textContent);break;case"quadratic_attenuation":const it=parseFloat(L.textContent);v.distance=it?Math.sqrt(1/it):0;break}}return v}function ie(x){let v;switch(x.technique){case"directional":v=new gu;break;case"point":v=new mu;break;case"spot":v=new tp;break;case"ambient":v=new _u;break}return x.parameters.color&&v.color.copy(x.parameters.color),x.parameters.distance&&(v.distance=x.parameters.distance),v}function V(x){const v=Qt.lights[x];return v!==void 0?_(v,ie):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",x),null)}function At(x){const v={name:x.getAttribute("name"),sources:{},vertices:{},primitives:[]},R=n(x,"mesh")[0];if(R!==void 0){for(let A=0;A<R.childNodes.length;A++){const L=R.childNodes[A];if(L.nodeType!==1)continue;const $=L.getAttribute("id");switch(L.nodeName){case"source":v.sources[$]=ht(L);break;case"vertices":v.vertices=Ut(L);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",L.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":v.primitives.push(ft(L));break;default:console.log(L)}}Qt.geometries[x.getAttribute("id")]=v}}function ht(x){const v={array:[],stride:3};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"float_array":v.array=r(A.textContent);break;case"Name_array":v.array=i(A.textContent);break;case"technique_common":const L=n(A,"accessor")[0];L!==void 0&&(v.stride=parseInt(L.getAttribute("stride")));break}}return v}function Ut(x){const v={};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];A.nodeType===1&&(v[A.getAttribute("semantic")]=o(A.getAttribute("source")))}return v}function ft(x){const v={type:x.nodeName,material:x.getAttribute("material"),count:parseInt(x.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let R=0,A=x.childNodes.length;R<A;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"input":const $=o(L.getAttribute("source")),it=L.getAttribute("semantic"),Pt=parseInt(L.getAttribute("offset")),vt=parseInt(L.getAttribute("set")),Tt=vt>0?it+vt:it;v.inputs[Tt]={id:$,offset:Pt},v.stride=Math.max(v.stride,Pt+1),it==="TEXCOORD"&&(v.hasUV=!0);break;case"vcount":v.vcount=a(L.textContent);break;case"p":v.p=a(L.textContent);break}}return v}function rt(x){const v={};for(let R=0;R<x.length;R++){const A=x[R];v[A.type]===void 0&&(v[A.type]=[]),v[A.type].push(A)}return v}function It(x){let v=0;for(let R=0,A=x.length;R<A;R++)x[R].hasUV===!0&&v++;v>0&&v<x.length&&(x.uvsNeedsFix=!0)}function ae(x){const v={},R=x.sources,A=x.vertices,L=x.primitives;if(L.length===0)return{};const $=rt(L);for(const it in $){const Pt=$[it];It(Pt),v[it]=Le(Pt,R,A)}return v}function Le(x,v,R){const A={},L={array:[],stride:0},$={array:[],stride:0},it={array:[],stride:0},Pt={array:[],stride:0},vt={array:[],stride:0},Tt={array:[],stride:4},Vt={array:[],stride:4},ut=new Ie,zt=[];let Ft=0;for(let qt=0;qt<x.length;qt++){const Gt=x[qt],Fe=Gt.inputs;let Ae=0;switch(Gt.type){case"lines":case"linestrips":Ae=Gt.count*2;break;case"triangles":Ae=Gt.count*3;break;case"polylist":for(let xe=0;xe<Gt.count;xe++){const ye=Gt.vcount[xe];switch(ye){case 3:Ae+=3;break;case 4:Ae+=6;break;default:Ae+=(ye-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",Gt.type)}ut.addGroup(Ft,Ae,qt),Ft+=Ae,Gt.material&&zt.push(Gt.material);for(const xe in Fe){const ye=Fe[xe];switch(xe){case"VERTEX":for(const Hn in R){const ln=R[Hn];switch(Hn){case"POSITION":const Oi=L.array.length;if(he(Gt,v[ln],ye.offset,L.array),L.stride=v[ln].stride,v.skinWeights&&v.skinIndices&&(he(Gt,v.skinIndices,ye.offset,Tt.array),he(Gt,v.skinWeights,ye.offset,Vt.array)),Gt.hasUV===!1&&x.uvsNeedsFix===!0){const Pu=(L.array.length-Oi)/L.stride;for(let Vl=0;Vl<Pu;Vl++)it.array.push(0,0)}break;case"NORMAL":he(Gt,v[ln],ye.offset,$.array),$.stride=v[ln].stride;break;case"COLOR":he(Gt,v[ln],ye.offset,vt.array),vt.stride=v[ln].stride;break;case"TEXCOORD":he(Gt,v[ln],ye.offset,it.array),it.stride=v[ln].stride;break;case"TEXCOORD1":he(Gt,v[ln],ye.offset,Pt.array),it.stride=v[ln].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',Hn)}}break;case"NORMAL":he(Gt,v[ye.id],ye.offset,$.array),$.stride=v[ye.id].stride;break;case"COLOR":he(Gt,v[ye.id],ye.offset,vt.array,!0),vt.stride=v[ye.id].stride;break;case"TEXCOORD":he(Gt,v[ye.id],ye.offset,it.array),it.stride=v[ye.id].stride;break;case"TEXCOORD1":he(Gt,v[ye.id],ye.offset,Pt.array),Pt.stride=v[ye.id].stride;break}}}return L.array.length>0&&ut.setAttribute("position",new le(L.array,L.stride)),$.array.length>0&&ut.setAttribute("normal",new le($.array,$.stride)),vt.array.length>0&&ut.setAttribute("color",new le(vt.array,vt.stride)),it.array.length>0&&ut.setAttribute("uv",new le(it.array,it.stride)),Pt.array.length>0&&ut.setAttribute("uv1",new le(Pt.array,Pt.stride)),Tt.array.length>0&&ut.setAttribute("skinIndex",new le(Tt.array,Tt.stride)),Vt.array.length>0&&ut.setAttribute("skinWeight",new le(Vt.array,Vt.stride)),A.data=ut,A.type=x[0].type,A.materialKeys=zt,A}function he(x,v,R,A,L=!1){const $=x.p,it=x.stride,Pt=x.vcount;function vt(ut){let zt=$[ut+R]*Vt;const Ft=zt+Vt;for(;zt<Ft;zt++)A.push(Tt[zt]);if(L){const qt=A.length-Vt-1;ze.setRGB(A[qt+0],A[qt+1],A[qt+2],Me),A[qt+0]=ze.r,A[qt+1]=ze.g,A[qt+2]=ze.b}}const Tt=v.array,Vt=v.stride;if(x.vcount!==void 0){let ut=0;for(let zt=0,Ft=Pt.length;zt<Ft;zt++){const qt=Pt[zt];if(qt===4){const Gt=ut+it*0,Fe=ut+it*1,Ae=ut+it*2,xe=ut+it*3;vt(Gt),vt(Fe),vt(xe),vt(Fe),vt(Ae),vt(xe)}else if(qt===3){const Gt=ut+it*0,Fe=ut+it*1,Ae=ut+it*2;vt(Gt),vt(Fe),vt(Ae)}else if(qt>4)for(let Gt=1,Fe=qt-2;Gt<=Fe;Gt++){const Ae=ut+it*0,xe=ut+it*Gt,ye=ut+it*(Gt+1);vt(Ae),vt(xe),vt(ye)}ut+=it*qt}}else for(let ut=0,zt=$.length;ut<zt;ut+=it)vt(ut)}function an(x){return _(Qt.geometries[x],ae)}function Sn(x){const v={name:x.getAttribute("name")||"",joints:{},links:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"technique_common":kn(A,v);break}}Qt.kinematicsModels[x.getAttribute("id")]=v}function Ks(x){return x.build!==void 0?x.build:x}function Zs(x){return _(Qt.kinematicsModels[x],Ks)}function kn(x,v){for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"joint":v.joints[A.getAttribute("sid")]=Ss(A);break;case"link":v.links.push(bs(A));break}}}function Ss(x){let v;for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"prismatic":case"revolute":v=Qs(A);break}}return v}function Qs(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",axis:new N,limits:{min:0,max:0},type:x.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"axis":const L=r(A.textContent);v.axis.fromArray(L);break;case"limits":const $=A.getElementsByTagName("max")[0],it=A.getElementsByTagName("min")[0];v.limits.max=parseFloat($.textContent),v.limits.min=parseFloat(it.textContent);break}}return v.limits.min>=v.limits.max&&(v.static=!0),v.middlePosition=(v.limits.min+v.limits.max)/2,v}function bs(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",attachments:[],transforms:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"attachment_full":v.attachments.push(Ii(A));break;case"matrix":case"translate":case"rotate":v.transforms.push(Es(A));break}}return v}function Ii(x){const v={joint:x.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"link":v.links.push(bs(A));break;case"matrix":case"translate":case"rotate":v.transforms.push(Es(A));break}}return v}function Es(x){const v={type:x.nodeName},R=r(x.textContent);switch(v.type){case"matrix":v.obj=new Yt,v.obj.fromArray(R).transpose();break;case"translate":v.obj=new N,v.obj.fromArray(R);break;case"rotate":v.obj=new N,v.obj.fromArray(R),v.angle=Ti.degToRad(R[3]);break}return v}function Ni(x){const v={name:x.getAttribute("name")||"",rigidBodies:{}};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"rigid_body":v.rigidBodies[A.getAttribute("name")]={},tr(A,v.rigidBodies[A.getAttribute("name")]);break}}Qt.physicsModels[x.getAttribute("id")]=v}function tr(x,v){for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"technique_common":er(A,v);break}}}function er(x,v){for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"inertia":v.inertia=r(A.textContent);break;case"mass":v.mass=r(A.textContent)[0];break}}}function _a(x){const v={bindJointAxis:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"bind_joint_axis":v.bindJointAxis.push(va(A));break}}Qt.kinematicsScenes[o(x.getAttribute("url"))]=v}function va(x){const v={target:x.getAttribute("target").split("/").pop()};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType===1)switch(A.nodeName){case"axis":const L=A.getElementsByTagName("param")[0];v.axis=L.textContent;const $=v.axis.split("inst_").pop().split("axis")[0];v.jointIndex=$.substring(0,$.length-1);break}}return v}function xa(x){return x.build!==void 0?x.build:x}function ya(x){return _(Qt.kinematicsScenes[x],xa)}function Ma(){const x=Object.keys(Qt.kinematicsModels)[0],v=Object.keys(Qt.kinematicsScenes)[0],R=Object.keys(Qt.visualScenes)[0];if(x===void 0||v===void 0)return;const A=Zs(x),L=ya(v),$=ge(R),it=L.bindJointAxis,Pt={};for(let Vt=0,ut=it.length;Vt<ut;Vt++){const zt=it[Vt],Ft=Ue.querySelector('[sid="'+zt.target+'"]');if(Ft){const qt=Ft.parentElement;vt(zt.jointIndex,qt)}}function vt(Vt,ut){const zt=ut.getAttribute("name"),Ft=A.joints[Vt];$.traverse(function(qt){qt.name===zt&&(Pt[Vt]={object:qt,transforms:Sa(ut),joint:Ft,position:Ft.zeroPosition})})}const Tt=new Yt;Fi={joints:A&&A.joints,getJointValue:function(Vt){const ut=Pt[Vt];if(ut)return ut.position;console.warn("THREE.ColladaLoader: Joint "+Vt+" doesn't exist.")},setJointValue:function(Vt,ut){const zt=Pt[Vt];if(zt){const Ft=zt.joint;if(ut>Ft.limits.max||ut<Ft.limits.min)console.warn("THREE.ColladaLoader: Joint "+Vt+" value "+ut+" outside of limits (min: "+Ft.limits.min+", max: "+Ft.limits.max+").");else if(Ft.static)console.warn("THREE.ColladaLoader: Joint "+Vt+" is static.");else{const qt=zt.object,Gt=Ft.axis,Fe=zt.transforms;H.identity();for(let Ae=0;Ae<Fe.length;Ae++){const xe=Fe[Ae];if(xe.sid&&xe.sid.indexOf(Vt)!==-1)switch(Ft.type){case"revolute":H.multiply(Tt.makeRotationAxis(Gt,Ti.degToRad(ut)));break;case"prismatic":H.multiply(Tt.makeTranslation(Gt.x*ut,Gt.y*ut,Gt.z*ut));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+Ft.type);break}else switch(xe.type){case"matrix":H.multiply(xe.obj);break;case"translate":H.multiply(Tt.makeTranslation(xe.obj.x,xe.obj.y,xe.obj.z));break;case"scale":H.scale(xe.obj);break;case"rotate":H.multiply(Tt.makeRotationAxis(xe.obj,xe.angle));break}}qt.matrix.copy(H),qt.matrix.decompose(qt.position,qt.quaternion,qt.scale),Pt[Vt].position=ut}}else console.log("THREE.ColladaLoader: "+Vt+" does not exist.")}}}function Sa(x){const v=[],R=Ue.querySelector('[id="'+x.id+'"]');for(let A=0;A<R.childNodes.length;A++){const L=R.childNodes[A];if(L.nodeType!==1)continue;let $,it;switch(L.nodeName){case"matrix":$=r(L.textContent);const Pt=new Yt().fromArray($).transpose();v.push({sid:L.getAttribute("sid"),type:L.nodeName,obj:Pt});break;case"translate":case"scale":$=r(L.textContent),it=new N().fromArray($),v.push({sid:L.getAttribute("sid"),type:L.nodeName,obj:it});break;case"rotate":$=r(L.textContent),it=new N().fromArray($);const vt=Ti.degToRad($[3]);v.push({sid:L.getAttribute("sid"),type:L.nodeName,obj:it,angle:vt});break}}return v}function T(x){const v=x.getElementsByTagName("node");for(let R=0;R<v.length;R++){const A=v[R];A.hasAttribute("id")===!1&&A.setAttribute("id",l())}}const H=new Yt,Y=new N;function J(x){const v={name:x.getAttribute("name")||"",type:x.getAttribute("type"),id:x.getAttribute("id"),sid:x.getAttribute("sid"),matrix:new Yt,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];if(A.nodeType!==1)continue;let L;switch(A.nodeName){case"node":v.nodes.push(A.getAttribute("id")),J(A);break;case"instance_camera":v.instanceCameras.push(o(A.getAttribute("url")));break;case"instance_controller":v.instanceControllers.push(G(A));break;case"instance_light":v.instanceLights.push(o(A.getAttribute("url")));break;case"instance_geometry":v.instanceGeometries.push(G(A));break;case"instance_node":v.instanceNodes.push(o(A.getAttribute("url")));break;case"matrix":L=r(A.textContent),v.matrix.multiply(H.fromArray(L).transpose()),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"translate":L=r(A.textContent),Y.fromArray(L),v.matrix.multiply(H.makeTranslation(Y.x,Y.y,Y.z)),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"rotate":L=r(A.textContent);const $=Ti.degToRad(L[3]);v.matrix.multiply(H.makeRotationAxis(Y.fromArray(L),$)),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"scale":L=r(A.textContent),v.matrix.scale(Y.fromArray(L)),v.transforms[A.getAttribute("sid")]=A.nodeName;break;case"extra":break;default:console.log(A)}}return Ht(v.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",v.id):Qt.nodes[v.id]=v,v}function G(x){const v={id:o(x.getAttribute("url")),materials:{},skeletons:[]};for(let R=0;R<x.childNodes.length;R++){const A=x.childNodes[R];switch(A.nodeName){case"bind_material":const L=A.getElementsByTagName("instance_material");for(let $=0;$<L.length;$++){const it=L[$],Pt=it.getAttribute("symbol"),vt=it.getAttribute("target");v.materials[Pt]=o(vt)}break;case"skeleton":v.skeletons.push(o(A.textContent));break}}return v}function pt(x,v){const R=[],A=[];let L,$,it;for(L=0;L<x.length;L++){const Tt=x[L];let Vt;if(Ht(Tt))Vt=ce(Tt),Et(Vt,v,R);else if(Ne(Tt)){const zt=Qt.visualScenes[Tt].children;for(let Ft=0;Ft<zt.length;Ft++){const qt=zt[Ft];if(qt.type==="JOINT"){const Gt=ce(qt.id);Et(Gt,v,R)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",Tt)}for(L=0;L<v.length;L++)for($=0;$<R.length;$++)if(it=R[$],it.bone.name===v[L].name){A[L]=it,it.processed=!0;break}for(L=0;L<R.length;L++)it=R[L],it.processed===!1&&(A.push(it),it.processed=!0);const Pt=[],vt=[];for(L=0;L<A.length;L++)it=A[L],Pt.push(it.bone),vt.push(it.boneInverse);return new Tl(Pt,vt)}function Et(x,v,R){x.traverse(function(A){if(A.isBone===!0){let L;for(let $=0;$<v.length;$++){const it=v[$];if(it.name===A.name){L=it.boneInverse;break}}L===void 0&&(L=new Yt),R.push({bone:A,boneInverse:L,processed:!1})}})}function Nt(x){const v=[],R=x.matrix,A=x.nodes,L=x.type,$=x.instanceCameras,it=x.instanceControllers,Pt=x.instanceLights,vt=x.instanceGeometries,Tt=x.instanceNodes;for(let ut=0,zt=A.length;ut<zt;ut++)v.push(ce(A[ut]));for(let ut=0,zt=$.length;ut<zt;ut++){const Ft=Ct($[ut]);Ft!==null&&v.push(Ft.clone())}for(let ut=0,zt=it.length;ut<zt;ut++){const Ft=it[ut],qt=Z(Ft.id),Gt=an(qt.id),Fe=Zt(Gt,Ft.materials),Ae=Ft.skeletons,xe=qt.skin.joints,ye=pt(Ae,xe);for(let Hn=0,ln=Fe.length;Hn<ln;Hn++){const Oi=Fe[Hn];Oi.isSkinnedMesh&&(Oi.bind(ye,qt.skin.bindMatrix),Oi.normalizeSkinWeights()),v.push(Oi)}}for(let ut=0,zt=Pt.length;ut<zt;ut++){const Ft=V(Pt[ut]);Ft!==null&&v.push(Ft.clone())}for(let ut=0,zt=vt.length;ut<zt;ut++){const Ft=vt[ut],qt=an(Ft.id),Gt=Zt(qt,Ft.materials);for(let Fe=0,Ae=Gt.length;Fe<Ae;Fe++)v.push(Gt[Fe])}for(let ut=0,zt=Tt.length;ut<zt;ut++)v.push(ce(Tt[ut]).clone());let Vt;if(A.length===0&&v.length===1)Vt=v[0];else{Vt=L==="JOINT"?new ou:new Zn;for(let ut=0;ut<v.length;ut++)Vt.add(v[ut])}return Vt.name=L==="JOINT"?x.sid:x.name,Vt.matrix.copy(R),Vt.matrix.decompose(Vt.position,Vt.quaternion,Vt.scale),Vt}const Lt=new mi({name:Ln.DEFAULT_MATERIAL_NAME,color:16711935});function Kt(x,v){const R=[];for(let A=0,L=x.length;A<L;A++){const $=v[x[A]];$===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",x[A]),R.push(Lt)):R.push(nt($))}return R}function Zt(x,v){const R=[];for(const A in x){const L=x[A],$=Kt(L.materialKeys,v);if($.length===0&&(A==="lines"||A==="linestrips"?$.push(new pi):$.push(new cn)),A==="lines"||A==="linestrips")for(let Tt=0,Vt=$.length;Tt<Vt;Tt++){const ut=$[Tt];if(ut.isMeshPhongMaterial===!0||ut.isMeshLambertMaterial===!0){const zt=new pi;zt.color.copy(ut.color),zt.opacity=ut.opacity,zt.transparent=ut.transparent,$[Tt]=zt}}const it=L.data.attributes.skinIndex!==void 0,Pt=$.length===1?$[0]:$;let vt;switch(A){case"lines":vt=new aa(L.data,Pt);break;case"linestrips":vt=new Cl(L.data,Pt);break;case"triangles":case"polylist":it?vt=new mf(L.data,Pt):vt=new be(L.data,Pt);break}R.push(vt)}return R}function Ht(x){return Qt.nodes[x]!==void 0}function ce(x){return _(Qt.nodes[x],Nt)}function Se(x){const v={name:x.getAttribute("name"),children:[]};T(x);const R=n(x,"node");for(let A=0;A<R.length;A++)v.children.push(J(R[A]));Qt.visualScenes[x.getAttribute("id")]=v}function De(x){const v=new Zn;v.name=x.name;const R=x.children;for(let A=0;A<R.length;A++){const L=R[A];v.add(ce(L.id))}return v}function Ne(x){return Qt.visualScenes[x]!==void 0}function ge(x){return _(Qt.visualScenes[x],De)}function Wt(x){const v=n(x,"instance_visual_scene")[0];return ge(o(v.getAttribute("url")))}function ke(){const x=Qt.clips;if(c(x)===!0){if(c(Qt.animations)===!1){const v=[];for(const R in Qt.animations){const A=M(R);for(let L=0,$=A.length;L<$;L++)v.push(A[L])}Ve.push(new Ic("default",-1,v))}}else for(const v in x)Ve.push(W(v))}function ve(x){let v="";const R=[x];for(;R.length;){const A=R.shift();A.nodeType===Node.TEXT_NODE?v+=A.textContent:(v+=`
4205
- `,R.push(...A.childNodes))}return v.trim()}if(t.length===0)return{scene:new wl};const on=new DOMParser().parseFromString(t,"application/xml"),Ue=n(on,"COLLADA")[0],Xe=on.getElementsByTagName("parsererror")[0];if(Xe!==void 0){const x=n(Xe,"div")[0];let v;return x?v=x.textContent:v=ve(Xe),console.error(`THREE.ColladaLoader: Failed to parse collada file.
4206
- `,v),null}const gi=Ue.getAttribute("version");console.debug("THREE.ColladaLoader: File version",gi);const Pe=h(n(Ue,"asset")[0]),en=new Il(this.manager);en.setPath(this.resourcePath||e).setCrossOrigin(this.crossOrigin);let Ke;Ph&&(Ke=new Ph(this.manager),Ke.setPath(this.resourcePath||e));const ze=new jt,Ve=[];let Fi={},Vn=0;const Qt={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};f(Ue,"library_animations","animation",g),f(Ue,"library_animation_clips","animation_clip",z),f(Ue,"library_controllers","controller",at),f(Ue,"library_images","image",Q),f(Ue,"library_effects","effect",ot),f(Ue,"library_materials","material",j),f(Ue,"library_cameras","camera",Bt),f(Ue,"library_lights","light",$t),f(Ue,"library_geometries","geometry",At),f(Ue,"library_nodes","node",J),f(Ue,"library_visual_scenes","visual_scene",Se),f(Ue,"library_kinematics_models","kinematics_model",Sn),f(Ue,"library_physics_models","physics_model",Ni),f(Ue,"scene","instance_kinematics_scene",_a),m(Qt.animations,b),m(Qt.clips,tt),m(Qt.controllers,wt),m(Qt.images,et),m(Qt.effects,F),m(Qt.materials,lt),m(Qt.cameras,ct),m(Qt.lights,ie),m(Qt.geometries,ae),m(Qt.visualScenes,De),ke(),Ma();const nr=Wt(n(Ue,"scene")[0]);return nr.animations=Ve,Pe.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),nr.rotation.set(-Math.PI/2,0,0)),nr.scale.multiplyScalar(Pe.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),Ve},kinematics:Fi,library:Qt,scene:nr}}}const Dh=new N,Tg=new un,kr=new Yt,ci=new Yt,Vr=new gn,Hr=new N(1,1,1),Gr=new N;class ga extends Ce{constructor(...t){super(...t),this.urdfNode=null,this.urdfName=""}copy(t,e){return super.copy(t,e),this.urdfNode=t.urdfNode,this.urdfName=t.urdfName,this}}class Rg extends ga{constructor(...t){super(...t),this.isURDFCollider=!0,this.type="URDFCollider"}}class Cg extends ga{constructor(...t){super(...t),this.isURDFVisual=!0,this.type="URDFVisual"}}class Cu extends ga{constructor(...t){super(...t),this.isURDFLink=!0,this.type="URDFLink"}}class Lu extends ga{get jointType(){return this._jointType}set jointType(t){if(this.jointType!==t)switch(this._jointType=t,this.matrixWorldNeedsUpdate=!0,t){case"fixed":this.jointValue=[];break;case"continuous":case"revolute":case"prismatic":this.jointValue=new Array(1).fill(0);break;case"planar":this.jointValue=new Array(3).fill(0),this.axis=new N(0,0,1);break;case"floating":this.jointValue=new Array(6).fill(0);break}}get angle(){return this.jointValue[0]}constructor(...t){super(...t),this.isURDFJoint=!0,this.type="URDFJoint",this.jointValue=null,this.jointType="fixed",this.axis=new N(1,0,0),this.limit={lower:0,upper:0},this.ignoreLimits=!1,this.origPosition=null,this.origQuaternion=null,this.mimicJoints=[]}copy(t,e){return super.copy(t,e),this.jointType=t.jointType,this.axis=t.axis.clone(),this.limit.lower=t.limit.lower,this.limit.upper=t.limit.upper,this.ignoreLimits=!1,this.jointValue=[...t.jointValue],this.origPosition=t.origPosition?t.origPosition.clone():null,this.origQuaternion=t.origQuaternion?t.origQuaternion.clone():null,this.mimicJoints=[...t.mimicJoints],this}setJointValue(...t){t=t.map(n=>n===null?null:parseFloat(n)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let e=!1;switch(this.mimicJoints.forEach(n=>{e=n.updateFromMimickedJoint(...t)||e}),this.jointType){case"fixed":return e;case"continuous":case"revolute":{let n=t[0];return n==null||n===this.jointValue[0]?e:(!this.ignoreLimits&&this.jointType==="revolute"&&(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.quaternion.setFromAxisAngle(this.axis,n).premultiply(this.origQuaternion),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):e)}case"prismatic":{let n=t[0];return n==null||n===this.jointValue[0]?e:(this.ignoreLimits||(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.position.copy(this.origPosition),Dh.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Dh,n),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):e)}case"floating":return this.jointValue.every((n,i)=>t[i]===n||t[i]===null)?e:(this.jointValue[0]=t[0]!==null?t[0]:this.jointValue[0],this.jointValue[1]=t[1]!==null?t[1]:this.jointValue[1],this.jointValue[2]=t[2]!==null?t[2]:this.jointValue[2],this.jointValue[3]=t[3]!==null?t[3]:this.jointValue[3],this.jointValue[4]=t[4]!==null?t[4]:this.jointValue[4],this.jointValue[5]=t[5]!==null?t[5]:this.jointValue[5],ci.compose(this.origPosition,this.origQuaternion,Hr),Vr.setFromEuler(Tg.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),Gr.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),kr.compose(Gr,Vr,Hr),ci.premultiply(kr),this.position.setFromMatrixPosition(ci),this.rotation.setFromRotationMatrix(ci),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((n,i)=>t[i]===n||t[i]===null)?e:(this.jointValue[0]=t[0]!==null?t[0]:this.jointValue[0],this.jointValue[1]=t[1]!==null?t[1]:this.jointValue[1],this.jointValue[2]=t[2]!==null?t[2]:this.jointValue[2],ci.compose(this.origPosition,this.origQuaternion,Hr),Vr.setFromAxisAngle(this.axis,this.jointValue[2]),Gr.set(this.jointValue[0],this.jointValue[1],0),kr.compose(Gr,Vr,Hr),ci.premultiply(kr),this.position.setFromMatrixPosition(ci),this.rotation.setFromRotationMatrix(ci),this.matrixWorldNeedsUpdate=!0,!0)}return e}}class Uh extends Lu{constructor(...t){super(...t),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...t){const e=t.map(n=>n*this.multiplier+this.offset);return super.setJointValue(...e)}copy(t,e){return super.copy(t,e),this.mimicJoint=t.mimicJoint,this.offset=t.offset,this.multiplier=t.multiplier,this}}class Lg extends Cu{constructor(...t){super(...t),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(t,e){super.copy(t,e),this.urdfRobotNode=t.urdfRobotNode,this.robotName=t.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(n=>{n.isURDFJoint&&n.urdfName in t.joints&&(this.joints[n.urdfName]=n),n.isURDFLink&&n.urdfName in t.links&&(this.links[n.urdfName]=n),n.isURDFCollider&&n.urdfName in t.colliders&&(this.colliders[n.urdfName]=n),n.isURDFVisual&&n.urdfName in t.visual&&(this.visual[n.urdfName]=n)});for(const n in this.joints)this.joints[n].mimicJoints=this.joints[n].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(t){return this.frames[t]}setJointValue(t,...e){const n=this.joints[t];return n?n.setJointValue(...e):!1}setJointValues(t){let e=!1;for(const n in t){const i=t[n];Array.isArray(i)?e=this.setJointValue(n,...i)||e:e=this.setJointValue(n,i)||e}return e}}const go=new gn,Ih=new un;function is(s){return s?s.trim().split(/\s+/g).map(t=>parseFloat(t)):[0,0,0]}function Nh(s,t,e=!1){e||s.rotation.set(0,0,0),Ih.set(t[0],t[1],t[2],"ZYX"),go.setFromEuler(Ih),go.multiply(s.quaternion),s.quaternion.copy(go)}class Pg{constructor(t){this.manager=t||Ul,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(t){return new Promise((e,n)=>{this.load(t,e,null,n)})}load(t,e,n,i){const r=this.manager,a=Fl.extractUrlBase(t),o=this.manager.resolveURL(t);r.itemStart(o),fetch(o,this.fetchOptions).then(l=>{if(l.ok)return n&&n(null),l.text();throw new Error(`URDFLoader: Failed to load url '${o}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);e(c),r.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),r.itemError(o),r.itemEnd(o)})}parse(t,e=this.workingPath){const n=this.packages,i=this.loadMeshCb,r=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function u(E){if(!/^package:\/\//.test(E))return e?e+E:E;const[b,M]=E.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(b)?n+"/"+M:n+"/"+b+"/"+M;if(n instanceof Function)return n(b)+"/"+M;if(typeof n=="object")return b in n?n[b]+"/"+M:(console.error(`URDFLoader : ${b} not found in provided package list.`),null)}function d(E){let b;E instanceof Document?b=[...E.children]:E instanceof Element?b=[E]:b=[...new DOMParser().parseFromString(E,"text/xml").children];const M=b.filter(I=>I.nodeName==="robot").pop();return f(M)}function f(E){const b=[...E.children],M=b.filter(U=>U.nodeName.toLowerCase()==="link"),I=b.filter(U=>U.nodeName.toLowerCase()==="joint"),C=b.filter(U=>U.nodeName.toLowerCase()==="material"),P=new Lg;P.robotName=E.getAttribute("name"),P.urdfRobotNode=E,C.forEach(U=>{const B=U.getAttribute("name");h[B]=g(U)});const D={},S={};M.forEach(U=>{const B=U.getAttribute("name"),k=E.querySelector(`child[link="${B}"]`)===null;l[B]=_(U,D,S,k?P:null)}),I.forEach(U=>{const B=U.getAttribute("name");c[B]=m(U)}),P.joints=c,P.links=l,P.colliders=S,P.visual=D;const y=Object.values(c);return y.forEach(U=>{U instanceof Uh&&c[U.mimicJoint].mimicJoints.push(U)}),y.forEach(U=>{const B=new Set,k=q=>{if(B.has(q))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");B.add(q),q.mimicJoints.forEach(K=>{k(K)})};k(U)}),P.frames={...S,...D,...l,...c},P}function m(E){const b=[...E.children],M=E.getAttribute("type");let I;const C=b.find(B=>B.nodeName.toLowerCase()==="mimic");C?(I=new Uh,I.mimicJoint=C.getAttribute("joint"),I.multiplier=parseFloat(C.getAttribute("multiplier")||1),I.offset=parseFloat(C.getAttribute("offset")||0)):I=new Lu,I.urdfNode=E,I.name=E.getAttribute("name"),I.urdfName=I.name,I.jointType=M;let P=null,D=null,S=[0,0,0],y=[0,0,0];b.forEach(B=>{const k=B.nodeName.toLowerCase();k==="origin"?(S=is(B.getAttribute("xyz")),y=is(B.getAttribute("rpy"))):k==="child"?D=l[B.getAttribute("link")]:k==="parent"?P=l[B.getAttribute("link")]:k==="limit"&&(I.limit.lower=parseFloat(B.getAttribute("lower")||I.limit.lower),I.limit.upper=parseFloat(B.getAttribute("upper")||I.limit.upper))}),P.add(I),I.add(D),Nh(I,y),I.position.set(S[0],S[1],S[2]);const U=b.filter(B=>B.nodeName.toLowerCase()==="axis")[0];if(U){const B=U.getAttribute("xyz").split(/\s+/g).map(k=>parseFloat(k));I.axis=new N(B[0],B[1],B[2]),I.axis.normalize()}return I}function _(E,b,M,I=null){I===null&&(I=new Cu);const C=[...E.children];return I.name=E.getAttribute("name"),I.urdfName=I.name,I.urdfNode=E,r&&C.filter(D=>D.nodeName.toLowerCase()==="visual").forEach(D=>{const S=p(D,h);if(I.add(S),D.hasAttribute("name")){const y=D.getAttribute("name");S.name=y,S.urdfName=y,b[y]=S}}),a&&C.filter(D=>D.nodeName.toLowerCase()==="collision").forEach(D=>{const S=p(D);if(I.add(S),D.hasAttribute("name")){const y=D.getAttribute("name");S.name=y,S.urdfName=y,M[y]=S}}),I}function g(E){const b=[...E.children],M=new cn;return M.name=E.getAttribute("name")||"",b.forEach(I=>{const C=I.nodeName.toLowerCase();if(C==="color"){const P=I.getAttribute("rgba").split(/\s/g).map(D=>parseFloat(D));M.color.setRGB(P[0],P[1],P[2]),M.opacity=P[3],M.transparent=P[3]<1,M.depthWrite=!M.transparent}else if(C==="texture"){const P=I.getAttribute("filename");if(P){const D=new Il(o),S=u(P);M.map=D.load(S),M.map.colorSpace=Me}}}),M}function p(E,b={}){const M=E.nodeName.toLowerCase()==="collision",I=[...E.children];let C=null;const P=I.filter(S=>S.nodeName.toLowerCase()==="material")[0];if(P){const S=P.getAttribute("name");S&&S in b?C=b[S]:C=g(P)}else C=new cn;const D=M?new Rg:new Cg;return D.urdfNode=E,I.forEach(S=>{const y=S.nodeName.toLowerCase();if(y==="geometry"){const U=S.children[0].nodeName.toLowerCase();if(U==="mesh"){const B=S.children[0].getAttribute("filename"),k=u(B);if(k!==null){const q=S.children[0].getAttribute("scale");if(q){const K=is(q);D.scale.set(K[0],K[1],K[2])}i(k,o,(K,z)=>{z?console.error("URDFLoader: Error loading mesh.",z):K&&(K instanceof be&&(K.material=C),K.position.set(0,0,0),K.quaternion.identity(),D.add(K))})}}else if(U==="box"){const B=new be;B.geometry=new _s(1,1,1),B.material=C;const k=is(S.children[0].getAttribute("size"));B.scale.set(k[0],k[1],k[2]),D.add(B)}else if(U==="sphere"){const B=new be;B.geometry=new da(1,30,30),B.material=C;const k=parseFloat(S.children[0].getAttribute("radius"))||0;B.scale.set(k,k,k),D.add(B)}else if(U==="cylinder"){const B=new be;B.geometry=new Ll(1,1,1,30),B.material=C;const k=parseFloat(S.children[0].getAttribute("radius"))||0,q=parseFloat(S.children[0].getAttribute("length"))||0;B.scale.set(k,q,k),B.rotation.set(Math.PI/2,0,0),D.add(B)}}else if(y==="origin"){const U=is(S.getAttribute("xyz")),B=is(S.getAttribute("rpy"));D.position.set(U[0],U[1],U[2]),D.rotation.set(0,0,0),Nh(D,B)}}),D}return d(t)}defaultMeshLoader(t,e,n){/\.stl$/i.test(t)?new ta(e).load(t,r=>{const a=new be(r,new cn);n(a)}):/\.dae$/i.test(t)?new Ag(e).load(t,r=>n(r.scene)):console.warn(`URDFLoader: Could not load model at ${t}.
4207
- No loader available`)}}const Dg=Oh(rs.pinia),{systemPath:Fh}=rs.storeToRefs(Dg),Wr=Xr.ref();function Ug(s,t,e,n,i){const r=async d=>{try{const f=await Du.downloadAvatarApi({url:d});if(f.status!==200)throw new Error(`下载失败: ${f.status}`);return f.data}catch(f){throw console.error("addModelFromUrl失败:",f),f}},a=d=>new Promise((f,m)=>{const _=new FileReader;_.onload=g=>{try{const p=g.target.result,b=new mo().parse(p);b.preload(),f(b)}catch(p){m(p)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(d)}),o=async d=>{const f={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new cn({color:8947848,side:tn}))},getAsArray:function(){const m=[];for(const _ in this.materials)m.push(this.materials[_]);return m},preload:function(){for(const m in this.materials)this.materials[m].map&&(this.materials[m].map.needsUpdate=!0)}};for(const m of d){const _=await a(m);Object.assign(f.materials,_.materials)}return f.preload(),f},l=async(d,f=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async p=>{try{const E=p.target.result;let b=null;f&&f.length>0&&(f.length===1?b=await a(f[0]):b=await o(f));const M=new po;b&&M.setMaterials(b);const I=M.parse(E);b||I.traverse(C=>{C.isMesh&&(C.material=new cn({color:8947848,side:tn}))}),m(I)}catch(E){_(E)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(d)}),c=async d=>{var f;try{e.value=!0;const{scene:m}=s();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<d.length;g++){const p=d[g];n.value=`正在加载模型 ${g+1}/${d.length}...`;const E=await r(p.objUrl),b=((f=p.objUrl)==null?void 0:f.split("/").pop())||`model_${g}.obj`,M=new File([E],b,{type:E.type});let I=[];if(p.mtlUrls){const P=Array.isArray(p.mtlUrls)?p.mtlUrls:[p.mtlUrls];for(let D=0;D<P.length;D++){const S=P[D],y=await r(S),U=(S==null?void 0:S.split("/").pop())||`material_${g}_${D}.mtl`,B=new File([y],U,{type:y.type});I.push(B)}}const C=await l(M,I);m.add(C),t.value.push(C),_.push(C)}return e.value=!1,_}catch(m){throw console.error("加载模型失败:",m),e.value=!1,m}},h=async(d,f,m=[],_=[])=>{let g;const p=d.toLowerCase();switch(p){case".txt":case".cpt":case".obj":const E=await f.text();if(p===".txt"||p===".cpt"){const ot=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,te=[...E.matchAll(ot)].map(O=>({x:parseFloat(O[1]),y:parseFloat(O[2]),z:parseFloat(O[3])})),ee=new Ie,Jt=te.flatMap(O=>[O.x,O.y,O.z]);if(ee.setAttribute("position",new le(Jt,3)),p===".txt"){const O=new Ci({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new zs(ee,O)}else if(p===".cpt"){const O=new pi({color:"#5B5C99",linewidth:100});g=new Cl(ee,O)}}else if(p===".obj"){const ot=new po;if(m&&m.length>0){const gt=new mo;for(const te of m){const ee=await te.text(),Jt=gt.parse(ee);Jt.preload(),ot.setMaterials(Jt);break}}g=ot.parse(E),(!m||m.length===0)&&g.traverse(gt=>{gt.isMesh&&(gt.material=new cn({color:"#B3B3D4"})),gt instanceof be&&(gt.material.side=tn)})}break;case".stl":const b=await f.arrayBuffer(),I=new ta().parse(b),C=new cn({color:"#B3B3D4",side:tn});g=new be(I,C);break;case".nc":const P=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],D={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},S=new Zn,y=P.map(ot=>new Promise((gt,te)=>{new ta().load(Fh.value===""?`/model/${ot}`:`${Fh.value}\\${ot}`,Jt=>{const O=new cn({color:D[ot]||"#B3B3D4",side:tn}),_e=new be(Jt,O);gt(_e)},void 0,te)}));try{(await Promise.all(y)).forEach(gt=>S.add(gt)),g=S}catch(ot){throw console.error("加载NC文件对应的STL文件失败:",ot),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const U=new wg,B=new Zn;try{const ot=await rs.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),gt=new Blob([ot.data],{type:"application/octet-stream;charset=UTF-8"}),te=await rs.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),ee=new Blob([te.data],{type:"application/octet-stream;charset=UTF-8"}),Jt=await new Promise((_e,se)=>{const re=URL.createObjectURL(gt);U.load(re,Mt=>{const ne=new Float32Array(Mt.geometry.attributes.position.count*3);for(let yt=0;yt<Mt.geometry.attributes.position.count;yt++)ne[yt*3]=1,ne[yt*3+1]=0,ne[yt*3+2]=0;Mt.geometry.setAttribute("color",new Oe(ne,3)),Mt.material.vertexColors=!0,Mt.scale.set(.3,.3,.3),URL.revokeObjectURL(re),_e(Mt)},void 0,se)}),O=await new Promise((_e,se)=>{const re=URL.createObjectURL(ee);U.load(re,Mt=>{const ne=new Float32Array(Mt.geometry.attributes.position.count*3);for(let yt=0;yt<Mt.geometry.attributes.position.count;yt++)ne[yt*3]=0,ne[yt*3+1]=1,ne[yt*3+2]=0;Mt.geometry.setAttribute("color",new Oe(ne,3)),Mt.material.vertexColors=!0,Mt.scale.set(.3,.3,.3),URL.revokeObjectURL(re),_e(Mt)},void 0,se)});B.add(Jt),B.add(O),g=B}catch(ot){throw console.error("PCD文件加载失败:",ot),new Error("无法加载PCD文件")}break;case".urdf":const k=URL.createObjectURL(f),q=new Pg,K="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",z={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},tt=new Map,W=new Map,at=new Map,dt=async ot=>{if(tt.has(ot))return console.log(`从缓存加载: ${ot}`),tt.get(ot);try{const gt=await rs.axios.get(`${K}/${ot}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),te=new Blob([gt.data],{type:"application/octet-stream;charset=UTF-8"});return z.enableCache&&tt.set(ot,te),te}catch(gt){throw console.error(`加载文件失败: ${ot}`,gt),new Error(`无法加载文件: ${ot}`)}},mt=(ot="default")=>{if(W.has(ot))return W.get(ot);const gt=new cn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Cn});return W.set(ot,gt),gt},Rt=ot=>{try{ot.isBufferGeometry&&ot.mergeVertices&&ot.mergeVertices(),ot.computeVertexNormals&&ot.computeVertexNormals(),ot.computeBoundingSphere&&ot.computeBoundingSphere(),ot.deleteAttribute&&ot.deleteAttribute("uv2")}catch(gt){console.warn("几何体优化失败,使用原始几何体:",gt)}return ot},wt=async(ot,gt,te)=>{const ee=`stl_${gt}`;if(at.has(ee)){const se=at.get(ee);return new be(se,mt())}const Jt=await ot.arrayBuffer();let _e=new ta(te).parse(Jt);return _e=Rt(_e),at.set(ee,_e),new be(_e,mt())},X=async(ot,gt,te)=>{const ee=`obj_${gt}`;if(tt.has(ee))return tt.get(ee).clone();const Jt=await ot.text(),O=new po(te),_e=gt.replace(".obj",".mtl");try{const Mt=await(await dt(_e)).text(),yt=new mo(te).parse(Mt);yt.preload(),O.setMaterials(yt)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${_e}`)}const se=O.parse(Jt);return se.traverse(re=>{re.isMesh&&(re.geometry=Rt(re.geometry),re.castShadow=!0,re.receiveShadow=!0,re.renderOrder=1)}),tt.set(ee,se),se},Z=(ot,gt)=>{const te=new ff;if(te.addLevel(ot,0),ot.geometry){const ee=ot.geometry.clone(),Jt=new be(ee,ot.material);te.addLevel(Jt,50)}return te};let Q=0,et=0;const _t=[];q.loadMeshCb=async(ot,gt,te,ee,Jt)=>{const O=ot.split("/").pop(),_e=te||(()=>{}),se=Jt||(()=>{});Q++;const re=new Promise(async(Mt,ne)=>{try{const yt=await dt(O);if(!yt||yt.size===0)throw new Error(`文件为空: ${O}`);const oe=O.split(".").pop().toLowerCase();let Ee;switch(oe){case"stl":Ee=await wt(yt,O,gt);break;case"obj":Ee=await X(yt,O,gt);break;default:throw new Error(`不支持的文件格式: ${oe}`)}z.enableLOD&&Ee.isMesh&&(Ee=Z(Ee,O)),_e(Ee),et++,ee&&ee({loaded:et,total:Q,progress:et/Q}),Mt(Ee)}catch(yt){console.error(`mesh文件加载失败: ${O}`,yt),se(yt),ne(yt)}});_t.push(re)};try{if(!k){Wr.value=void 0;break}if(g=await q.loadAsync(k),console.log(`URDF文件加载完成,等待${Q}个mesh文件加载...`),_t.length>0)try{await Promise.allSettled(_t),console.log(`所有mesh文件处理完成,成功加载: ${et}/${Q}`)}catch(ot){console.warn("部分mesh文件加载失败,但继续显示模型",ot)}g.traverse(ot=>{ot.isMesh&&(ot.castShadow=!0,ot.receiveShadow=!0,ot.renderOrder=1,ot.material&&(ot.material.needsUpdate=!0))}),Wr.value=g,console.log("URDF模型加载完成并优化")}catch(ot){console.error("URDF加载失败:",ot),Wr.value=void 0}finally{k&&URL.revokeObjectURL(k)}break;default:throw new Error(`不支持的文件格式: ${d}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async d=>{console.log(d);try{e.value=!0,n.value="正在加载模型...";const{scene:f}=s();if(!f)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<d.length;_++){const g=d[_],p=await h(g.suffix,g.blob,g.mtlBlobs||[],g.meshFiles||[]);p&&(f.add(p),t.value.push(p),m.push(p))}return e.value=!1,n.value="",m}catch(f){throw console.error("加载模型失败:",f),e.value=!1,n.value="",f}},urdfModel:Wr}}const Ig=Xr.defineComponent({name:"SvgIcon",props:{prefix:{type:String,default:"icon"},name:{type:String,required:!0},size:{type:[Number,String],default:16},spin:{type:Boolean,default:!1}},setup(s){const t=Xr.computed(()=>`#${s.prefix}-${s.name}`),e=Xr.computed(()=>{const{size:n}=s;let i=`${n}`;return i=`${i.replace("px","")}px`,{width:i,height:i}});return{symbolId:t,getStyle:e}}});window._iconfont_svg_string_4634042='<svg><symbol id="icon-donghuafangzhen" viewBox="0 0 1024 1024"><path d="M868.864 228.864c-19.968 0-38.912 7.68-53.248 20.992l-291.328-170.496c-7.168-5.12-16.896-5.12-24.064 0L208.896 248.832c-14.336-12.8-33.28-20.48-53.76-20.48-43.52 0-79.872 36.864-79.872 80.896 0 33.792 21.504 63.488 53.248 74.24v318.976c0 9.216 4.608 17.408 12.288 22.016L437.248 896c11.776 30.72 41.472 51.712 74.752 52.224 33.28-0.512 62.464-20.992 74.752-52.224l296.448-171.52c7.68-4.608 12.288-13.312 12.288-22.016V386.048c31.744-11.776 53.248-42.496 53.248-76.288 0-44.032-36.352-80.896-79.872-80.896zM155.136 339.456c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 15.872-12.8 28.672-29.184 29.184zM512 897.024c-16.896 0-29.184-12.288-29.184-29.696 0-14.848 12.288-29.696 29.184-29.696h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 14.848-14.848 29.696-29.184 29.696z m74.752-58.368c-11.776-30.208-40.96-51.712-74.752-51.712-27.136 0-52.224 14.336-67.072 37.376l-3.072 1.024c-4.608 2.048-8.704 5.632-9.728 10.752l-252.416-146.944V384.512C212.48 373.76 234.496 343.04 235.52 308.736l3.072 0.512h2.048c3.584 0 7.168-1.536 10.24-3.584 7.168-5.632 8.192-16.384 2.048-23.552L512 130.56l278.528 162.816c-7.68 36.864 11.264 74.24 45.568 90.624 0.512 5.632 3.584 10.24 8.704 13.312v291.328l-258.048 150.016z m282.112-499.2c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696v2.56c-1.024 14.848-13.824 27.136-29.184 26.624z" fill="#AAAAAA" ></path><path d="M422.912 724.992c-3.072-8.704-12.288-12.8-20.992-9.728-8.704 3.072-12.8 12.8-9.728 21.504l19.968 54.784c2.56 6.656 8.192 10.752 15.36 10.752 2.048 0 3.584-0.512 5.12-1.024 8.704-3.072 12.8-12.8 9.728-21.504l-19.456-54.784zM706.048 507.392c0-107.52-86.016-195.072-192-196.096-2.048-1.536-4.608-2.56-7.68-3.072l-24.064-3.072c-8.192-1.024-15.872 4.096-17.92 11.776-5.632 1.536-11.776 3.584-16.896 5.632 0.512-1.536 1.024-3.072 1.536-5.12 1.024-9.216-5.12-17.408-14.336-18.432l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.608 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l44.032 5.12C384 353.28 351.232 388.608 333.312 432.64c-25.088 60.928-17.92 130.048 18.432 184.832-1.024 3.584-1.024 7.168 0.512 10.24l19.968 54.784c1.024 3.072 3.072 5.632 6.144 7.68 7.168 5.12 17.408 3.072 22.528-4.096 3.072-4.608 3.584-10.24 2.048-15.36l-0.512-1.536c53.76 37.888 123.392 45.568 184.32 19.968 46.08-19.456 82.944-55.808 102.912-101.376l12.8-14.336c6.144-6.656 5.632-17.408-0.512-23.04 2.56-14.336 4.096-28.672 4.096-43.008z m-193.536 156.16C427.52 663.552 358.4 593.92 358.4 507.392c0-86.016 69.12-156.16 154.112-156.16s154.112 69.632 154.112 156.16c0 86.016-69.12 156.16-154.112 156.16z" fill="#72B02D" ></path><path d="M765.44 478.72c-6.144-5.632-15.872-5.632-22.016 0l-32.256 35.84c-4.096 4.608-5.632 11.776-3.072 17.92 2.56 6.144 8.192 9.728 14.848 9.728 4.608 0 8.704-2.048 11.776-5.12l32.256-35.84c5.12-7.168 4.608-16.896-1.536-22.528zM823.296 401.92c-5.632-1.024-11.776 0.512-15.872 5.12l-32.256 35.84c-4.608 4.608-5.632 11.776-3.072 17.92 1.024 2.048 2.56 4.096 4.096 5.632 6.656 6.144 16.896 5.632 23.04-1.536l32.256-35.84c4.096-4.096 5.632-10.752 3.584-16.384-1.024-5.632-5.632-9.728-11.776-10.752zM336.384 321.024c8.704 0 15.872-6.656 16.384-15.36 0.512-8.704-5.632-16.384-14.336-17.408l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.096 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l48.128 5.632h2.048z" fill="#72B02D" ></path></symbol><symbol id="icon-guanjianjiexi" viewBox="0 0 1024 1024"><path d="M298.496 200.704v83.456h-39.936v177.664h137.728V389.12h47.104v245.76h-47.104v-79.872H211.456c-10.752-3.584-54.272-14.336-54.272-57.856V280.064h-32.768V200.704h174.08m47.104-47.104H77.824v177.152h36.352v169.984c0 68.608 61.44 97.792 97.792 104.96H353.28v79.872h141.312V342.016H349.184v72.192h-43.52v-87.04h39.936V153.6zM627.712 389.12v79.872H812.544c10.752 3.584 54.272 14.336 54.272 54.272V740.352h32.768v83.456h-173.568v-83.456h39.936v-177.664h-137.728V634.88h-47.104V389.12h46.592m47.104-47.104h-141.312v340.48h141.312v-72.192h43.52v83.456h-39.936V870.4h267.776v-177.152h-36.352v-169.984c0-68.608-61.44-97.792-97.792-104.96H670.72V342.528h4.096z" fill="#AAAAAA" ></path></symbol><symbol id="icon-gongyishengcheng" viewBox="0 0 1024 1024"><path d="M889.344 391.68h29.696v-43.008h-208.896l1.024 45.056 28.16 3.072v20.992c55.808 5.632 108.032 28.672 150.016 66.56-0.512 0 0-92.672 0-92.672z m-366.592 102.912c13.312-13.312 27.648-24.576 43.008-34.816-2.048-70.144-5.632-153.088-8.704-179.712-5.632-48.64-34.816-204.288-226.816-202.752-191.488 1.536-223.744 164.864-230.912 207.36s-11.776 197.632-11.776 197.632h-24.576v43.008l208.896 1.024v-40.96h-24.064V316.928S245.76 230.912 335.36 231.424C424.448 232.448 415.232 327.68 414.72 327.68v313.856c4.608 0 6.144 77.824 50.176 144.896-13.312-32.256-20.48-67.072-20.48-102.912 0-71.168 27.648-138.24 78.336-188.928z" fill="#AAAAAA" ></path><path d="M75.264 601.6h31.232v281.088s41.984 29.184 141.824 0v-274.944l29.184-2.56v-44.032H75.264v40.448zM906.24 263.168h-29.184l1.024-188.416s-53.76-27.648-144.384 0l1.024 192-31.744 1.024V307.2h203.776l-0.512-44.032z" fill="#AAAAAA" ></path><path d="M934.912 627.712c-9.216-4.608-20.48-2.048-29.184 6.656l-21.504 21.504c-9.216 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l21.504-21.504c8.704-8.704 11.264-19.968 6.656-29.184-5.632-10.752-18.432-15.36-34.304-13.312-25.6 4.096-48.64 15.36-66.56 33.792-27.136 27.136-39.424 65.536-33.792 103.936l-178.176 178.176c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l178.176-178.176c37.888 6.144 76.288-6.656 103.936-33.792 17.92-17.92 29.696-41.472 33.792-66.56 2.048-15.872-2.56-28.672-13.312-34.304z m-9.728 30.72c-3.072 20.48-12.8 38.912-27.136 53.76-23.04 23.04-56.32 33.28-89.088 26.624l-6.144-1.536-186.88 186.88c-8.704 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l186.88-186.88-1.536-6.144c-6.656-32.256 3.072-65.536 26.624-89.088 14.848-14.848 33.28-24.064 53.76-27.136 1.536-0.512 3.072-0.512 4.608-0.512 2.56 0 4.608 0.512 5.12 1.024-0.512 0.512-1.024 1.536-2.048 2.56l-21.504 21.504c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l21.504-21.504c1.024-1.024 2.048-1.536 2.56-2.048 0.512 1.536 1.024 4.608 0.512 9.728z" fill="#72B02D" ></path><path d="M560.64 870.912c-12.8 12.8-12.8 33.28 0 45.568 6.144 6.144 14.336 9.216 23.04 9.216s16.896-3.072 23.04-9.216c6.144-6.144 9.728-14.336 9.728-23.04 0-8.704-3.584-16.896-9.728-23.04-12.8-12.288-33.792-12.288-46.08 0.512z m28.672 28.672c-3.072 3.072-8.704 3.072-11.776 0-3.072-3.072-3.072-8.704 0-11.776 1.536-1.536 3.584-2.56 6.144-2.56 2.048 0 4.096 1.024 6.144 2.56 1.536 1.536 2.56 3.584 2.56 6.144-0.512 2.048-1.536 4.096-3.072 5.632z m225.28-107.008c-4.096-4.096-10.24-4.096-14.336 0l-43.52 43.52c-4.096 4.096-4.096 10.24 0 14.336l102.4 102.4c15.872 15.872 41.984 15.872 57.856 0 15.872-15.872 15.872-41.984 0-57.856l-102.4-102.4z m-237.056-150.528l70.656 70.656 28.672-28.672-70.656-70.656-15.872-30.208-50.688-36.352-28.672 28.672 36.352 50.688 30.208 15.872z" fill="#72B02D" ></path></symbol><symbol id="icon-mojupipei" viewBox="0 0 1024 1024"><path d="M880.64 117.248c32.768 0 58.88 23.04 64.512 54.784l1.024 7.68v663.04c0.512 31.744-22.528 58.368-53.76 62.464l-7.68 1.024H151.552c-34.816 0-66.048-22.528-72.192-53.248l-1.024-6.656V183.296c0-31.744 27.648-59.904 61.952-65.024l7.168-1.024h142.848c24.064 0 44.032 16.896 48.64 39.936l1.024 6.656V406.528c0 7.68 5.12 14.848 12.288 16.896l3.584 0.512H424.96c13.312 0 25.088 9.216 29.184 22.528 6.144 23.552 33.792 46.08 58.368 46.08 22.528 0 48.128-19.456 55.808-39.424l2.048-5.632c2.048-10.24 9.216-18.432 19.456-21.504l5.12-1.024 3.072-0.512h71.168c6.144 0 11.776-3.584 14.336-9.728l1.024-3.584V164.864c0-23.04 15.872-41.984 37.888-46.592l6.144-1.024H880.64zM273.92 184.32H151.552l-2.048 0.512-2.048 0.512-2.56 1.536-1.536 649.728 3.072 1.536 3.072 1.024h1.024l328.192 3.072 2.048-286.72-2.048-0.512-10.24-3.584c-24.576-10.24-45.568-27.136-60.928-49.152l-6.144-9.216 1.024-1.536H349.184c-37.888-4.096-68.608-33.792-74.24-71.68l-1.024-8.192v-4.096V184.32z m476.16-3.072V409.6l-0.512 8.704c-3.584 36.864-32.256 66.56-68.608 72.192l-8.192 1.024h-4.096l-45.568-1.536-6.144 9.728c-14.848 22.528-36.352 40.448-61.44 51.2l-10.752 4.096-3.072 284.16h337.408v-655.36l-129.024-2.56z" fill="#AAAAAA" ></path></symbol><symbol id="icon-buchangshezhi" viewBox="0 0 1024 1024"><path d="M792.576 75.264h-686.08c-17.408 0-31.232 13.824-31.232 31.232v686.08c0 17.408 13.824 31.232 31.232 31.232h436.736c17.408 0 31.232-13.824 31.232-31.232s-13.824-31.232-31.232-31.232H137.728V262.656h624.128v280.576c0 17.408 13.824 31.232 31.232 31.232s31.232-13.824 31.232-31.232V106.496c-0.512-17.408-14.336-31.232-31.744-31.232z" fill="#AAAAAA" ></path><path d="M792.576 948.736c-17.408 0-31.232-13.824-31.232-31.232v-93.696h-93.696c-17.408 0-31.232-13.824-31.232-31.232 0-17.408 13.824-31.232 31.232-31.232h93.696v-93.696c0-17.408 13.824-31.232 31.232-31.232 17.408 0 31.232 13.824 31.232 31.232v93.696h93.696c17.408 0 31.232 13.824 31.232 31.232 0 17.408-13.824 31.232-31.232 31.232h-93.696v93.696c0 17.408-13.824 31.232-31.232 31.232z" fill="#72B02D" ></path><path d="M372.224 518.144l-110.08 110.08c-20.992 20.992-20.992 55.296 0 76.288s55.296 20.992 76.288 0l110.08-110.08c-16.896-6.144-32.768-15.872-46.592-29.696-13.824-13.312-23.552-29.696-29.696-46.592z m-57.856 162.304c-7.68 7.68-20.48 7.68-28.672 0-7.68-7.68-7.68-20.48 0-28.672 7.68-7.68 20.48-7.68 28.672 0 7.68 8.192 7.68 20.992 0 28.672z m340.48-292.864L592.384 450.56c-20.992 20.992-55.296 20.992-76.288 0s-20.992-55.296 0-76.288l62.976-62.976c-51.712-8.704-116.224 14.848-151.552 50.176-49.152 49.152-49.152 128.512 0 177.664s129.024 49.152 177.664 0c35.328-35.328 58.368-99.84 49.664-151.552z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shuchujiagongchengxu" viewBox="0 0 1024 1024"><path d="M876.544 473.6v374.272c0 16.384-13.312 29.696-29.696 29.696h-522.24c-16.384 0-29.696-13.312-29.696-29.696V503.296c0-16.384 13.312-29.696 29.696-29.696h551.936m40.96-70.656H253.952c-16.384 0-29.696 13.312-29.696 29.696v486.4c0 16.384 13.312 29.696 29.696 29.696h663.552c16.384 0 29.696-13.312 29.696-29.696v-486.4c0-16.384-13.312-29.696-29.696-29.696z" fill="#AAAAAA" ></path><path d="M489.984 211.968H814.08l-41.984-41.984c-13.824-13.824-13.824-36.352 0-50.176 13.824-13.824 36.352-13.824 50.176 0L947.712 245.76l-0.512 0.512 0.512 0.512-125.952 125.952c-13.824 13.824-36.352 13.824-50.176 0-13.824-13.824-13.824-36.352 0-50.176l38.912-38.912H489.472c-19.456 0-35.328-15.872-35.328-35.328 0.512-20.48 16.384-36.352 35.84-36.352z" fill="#72B02D" ></path><path d="M531.456 717.824c0-11.776-7.68-22.016-18.944-25.6l-55.808-16.896-14.848-4.608 14.848-4.608 55.808-16.896c11.264-3.584 18.944-13.824 18.944-25.6v-2.048c0-18.432-17.92-31.232-35.328-25.088L363.52 641.024c-10.752 3.584-17.92 13.824-17.92 25.088v8.192c0 11.264 7.168 21.504 17.92 25.088l132.608 45.568c17.408 6.144 35.328-7.168 35.328-25.088v-2.048z m123.392-96.768v2.048c0 11.776 7.68 22.016 18.944 25.6l56.32 16.896 14.848 4.608-14.848 4.608-56.32 16.896c-11.264 3.584-18.944 13.824-18.944 25.6v2.56c0 18.432 17.92 31.232 35.328 25.088l132.608-45.568c10.752-3.584 17.92-13.824 17.92-25.088v-8.192c0-11.264-7.168-21.504-17.92-25.088l-132.608-45.568c-17.408-6.144-35.328 7.168-35.328 25.6z m-54.784-64l-70.144 248.32c-4.608 16.896 8.192 33.792 25.6 33.792 11.776 0 22.528-8.192 25.6-19.456l70.144-248.32c4.608-16.896-8.192-33.792-25.6-33.792-11.776 0-22.016 8.192-25.6 19.456zM147.456 814.08V173.056c0-14.848 11.776-26.624 26.624-26.624h463.872c19.456 0 35.328-15.872 35.328-35.328 0-19.456-15.872-35.328-35.328-35.328H107.008c-16.896 0-30.72 13.824-30.72 30.72v748.032c0 16.896 13.824 30.72 30.72 30.72h40.448c19.456 0 35.328-15.872 35.328-35.328 0.512-19.968-15.36-35.84-35.328-35.84z" fill="#AAAAAA" ></path></symbol><symbol id="icon-guanjiekongzhi" viewBox="0 0 1024 1024"><path d="M648.192 377.344h-71.68c-18.432 0-33.792-14.848-33.792-33.792H366.592c12.288-30.72 25.088-80.896 0-134.656H542.72c0-18.432 15.36-33.792 33.792-33.792h67.584c1.536 0 2.56 0 4.096 0.512L719.36 87.04c10.752-13.312 29.184-16.384 44.032-7.68l168.96 100.864c15.872 9.728 20.992 30.208 11.776 46.08-9.728 15.872-30.208 20.992-46.592 11.264l-143.872-85.504L677.888 245.76v61.44l75.776 93.696 143.872-85.504c15.872-9.728 36.864-4.608 46.592 11.776 9.728 15.872 4.608 36.352-11.264 46.08h-0.512l-168.96 100.864c-14.336 8.704-33.28 5.12-44.032-7.68l-71.168-89.088zM319.488 780.8L102.912 415.744c76.8 69.632 185.344 48.64 231.424-13.312l222.72 378.368H711.68c18.432 0 33.792 14.848 33.792 33.792v100.864c0 18.432-15.36 33.792-33.792 33.792H170.496c-18.432 0-33.792-14.848-33.792-33.792v-100.864c0-18.432 15.36-33.792 33.792-33.792h148.992z" fill="#AAAAAA" ></path><path d="M204.288 148.48C133.12 148.48 75.264 205.824 75.264 276.48S133.12 404.48 204.288 404.48c71.168 0 129.024-57.344 129.024-128S275.456 148.48 204.288 148.48z m0 202.752c-41.472 0-74.752-33.28-74.752-74.752 0-40.96 33.792-74.24 74.752-74.24C245.76 202.24 279.04 235.52 279.04 276.48c0 41.472-33.792 75.264-74.752 74.752z" fill="#72B02D" ></path></symbol><symbol id="icon-jiegoushu" viewBox="0 0 1024 1024"><path d="M233.984 472.064h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44v238.08h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V233.984h-39.936c-22.016 0-39.936-17.92-39.936-39.936V115.2c0-22.016 17.92-39.936 39.936-39.936h158.72c22.016 0 39.936 17.92 39.936 39.936V194.56c0 22.016-17.92 39.936-39.936 39.936h-39.936v237.568z" fill="#AAAAAA" ></path><path d="M551.936 75.264h317.44c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V154.624c-0.512-44.032 35.328-79.36 79.36-79.36z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaitui" viewBox="0 0 1024 1024"><path d="M512 148.992c199.68 0 361.984 162.304 361.984 361.984S711.68 872.448 512 872.448s-361.984-162.304-361.984-361.984S312.32 148.992 512 148.992m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M670.72 456.192v109.056l-75.264-54.784L670.72 456.192m25.6-102.912c-10.24 0-20.992 3.072-30.208 10.24l-144.896 105.472c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-52.224-52.224z" fill="#72B02D" ></path><path d="M499.712 456.192v109.056L424.96 510.976l74.752-54.784m26.112-102.912c-10.24 0-20.992 3.072-30.208 10.24L350.208 468.992c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-51.712-52.224z" fill="#72B02D" ></path><path d="M314.368 381.44c-21.504 0-38.912 17.408-38.912 38.912v181.248c0 21.504 17.408 38.912 38.912 38.912s38.912-17.408 38.912-38.912V420.352c0-21.504-17.408-38.912-38.912-38.912z" fill="#72B02D" ></path></symbol><symbol id="icon-bofang" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M491.008 445.952l115.712 66.048-115.712 66.048V445.952m-23.552-87.04c-24.576 0-46.592 19.456-46.592 46.592v212.48c0 27.136 22.528 46.592 46.592 46.592 7.68 0 15.36-2.048 23.04-6.144l185.856-106.496c31.232-17.92 31.232-62.976 0-80.896L490.496 365.056c-7.168-4.096-15.36-6.144-23.04-6.144z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaijin" viewBox="0 0 1024 1024"><path d="M515.584 151.04c199.168 0 360.96 161.792 360.96 360.96s-161.792 360.96-360.96 360.96-360.96-161.792-360.96-360.96 161.792-360.96 360.96-360.96m0-74.752c-240.64 0-435.712 195.072-435.712 435.712s195.072 435.712 435.712 435.712 435.712-195.072 435.712-435.712-195.072-435.712-435.712-435.712z" fill="#AAAAAA" ></path><path d="M358.912 458.24L433.152 512l-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432L363.52 366.592c-9.216-6.656-19.456-9.728-29.696-9.728z" fill="#72B02D" ></path><path d="M527.36 458.24l74.24 53.76-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432l-142.848-103.936c-9.216-7.168-19.968-10.24-29.696-10.24z" fill="#72B02D" ></path><path d="M710.144 384.512c-20.992 0-38.4 17.408-38.4 38.4v178.688c0 20.992 17.408 38.4 38.4 38.4s38.4-17.408 38.4-38.4V422.912c0-21.504-17.408-38.4-38.4-38.4z" fill="#72B02D" ></path></symbol><symbol id="icon-zanting" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M416.768 353.28c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c-0.512-21.504-17.92-39.424-39.936-39.424z m190.464 0c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c0-21.504-17.92-39.424-39.936-39.424z" fill="#72B02D" ></path></symbol><symbol id="icon-zhongzhi" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M580.096 421.376c12.288 0 22.528 10.24 22.528 22.528v136.192c0 12.288-10.24 22.528-22.528 22.528H443.904c-12.288 0-22.528-10.24-22.528-22.528V443.904c0-12.288 10.24-22.528 22.528-22.528h136.192m0-68.096H443.904C393.728 353.28 353.28 393.728 353.28 443.904v136.192c0 50.176 40.448 90.624 90.624 90.624h136.192c50.176 0 90.624-40.448 90.624-90.624V443.904c0-50.176-40.448-90.624-90.624-90.624z" fill="#72B02D" ></path></symbol><symbol id="icon-suoxiao" viewBox="0 0 1024 1024"><path d="M491.008 463.36c32.256 0 58.88-26.112 58.88-58.88s-26.112-58.88-58.88-58.88H285.696c-32.256 0-58.88 26.112-58.88 58.88s26.112 58.88 58.88 58.88h205.312z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848 13.312 0 26.112-5.12 36.352-14.848 19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangda" viewBox="0 0 1024 1024"><path d="M488.96 333.824h-47.104V286.72c0-34.816-28.16-62.976-62.976-62.976-34.816 0-62.976 28.16-62.976 62.976v47.104h-47.104c-34.816 0-62.976 28.16-62.976 62.976s28.16 62.976 62.976 62.976h47.104V506.88c0 34.816 28.16 62.976 62.976 62.976 34.816 0 62.976-28.16 62.976-62.976v-47.104h47.104c34.816 0 62.976-28.16 62.976-62.976 0-34.304-28.16-62.976-62.976-62.976z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangdazhichuangkou" viewBox="0 0 1024 1024"><path d="M949.248 858.624l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 142.848-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.616-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-96.768 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M216.576 919.04h109.056v-102.912H216.576c-29.696 0-53.76-24.064-53.76-53.76V233.984c0-29.696 24.064-53.76 53.76-53.76H798.72c29.696 0 53.76 24.064 53.76 53.76v81.92h102.912v-81.92c0-86.528-70.144-156.672-156.672-156.672H216.576c-86.528 0-156.672 70.144-156.672 156.672v528.384c0 86.528 70.144 156.672 156.672 156.672z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shiyingpingmu" viewBox="0 0 1024 1024"><path d="M876.032 75.264H147.968c-39.936 0-72.704 32.768-72.704 72.704v728.064c0 39.936 32.768 72.704 72.704 72.704h728.064c39.936 0 72.704-32.768 72.704-72.704V147.968c0-39.936-32.768-72.704-72.704-72.704z m0 764.416c0 22.016-14.336 36.352-36.352 36.352H184.32c-22.016 0-36.352-14.336-36.352-36.352V184.32c0-22.016 14.336-36.352 36.352-36.352h655.36c22.016 0 36.352 14.336 36.352 36.352v655.36z" fill="#AAAAAA" ></path><path d="M329.728 184.32H220.672c-3.584 0-10.752 0-14.336 3.584-7.168 3.584-14.336 10.752-18.432 18.432-3.584 3.584-3.584 10.752-3.584 14.336v109.056c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352v-22.016l47.104 47.104c7.168 7.168 14.336 10.752 25.6 10.752 10.752 0 18.432-3.584 25.6-10.752 14.336-14.336 14.336-36.352 0-51.2l-47.104-47.104h22.016c22.016 0 36.352-14.336 36.352-36.352 0-21.504-14.848-35.84-36.864-35.84zM329.728 766.976h-22.016l47.104-47.104c14.336-14.336 14.336-36.352 0-51.2-14.336-14.336-36.352-14.336-51.2 0l-47.104 47.104v-22.016c0-22.016-14.336-36.352-36.352-36.352s-36.352 14.336-36.352 36.352v109.056c0 3.584 0 10.752 3.584 14.336 3.584 7.168 10.752 14.336 18.432 18.432 3.584 3.584 10.752 3.584 14.336 3.584h109.056c22.016 0 36.352-14.336 36.352-36.352s-13.824-35.84-35.84-35.84zM817.664 187.904c-3.584-3.584-10.752-3.584-14.336-3.584h-109.056c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h22.016l-47.104 47.104c-14.336 14.336-14.336 36.352 0 51.2 7.168 7.168 14.336 10.752 25.6 10.752s18.432-3.584 25.6-10.752l47.104-47.104v22.016c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352V220.672c0-3.584 0-10.752-3.584-14.336-4.096-7.68-11.264-14.848-18.944-18.432zM803.328 657.408c-22.016 0-36.352 14.336-36.352 36.352v22.016l-47.104-47.104c-14.336-14.336-36.352-14.336-51.2 0-14.336 14.336-14.336 36.352 0 51.2l47.104 47.104h-22.016c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h109.056c3.584 0 10.752 0 14.336-3.584 7.168-3.584 14.336-10.752 18.432-18.432 3.584-3.584 3.584-10.752 3.584-14.336v-109.056c0.512-22.016-13.824-36.864-35.84-36.864z" fill="#72B02D" ></path></symbol><symbol id="icon-yangshitu-01" viewBox="0 0 1024 1024"><path d="M645.632 882.688H150.528l252.928-204.8 477.696 0.512z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512z m-542.72 23.552H880.64l-234.496 203.264-228.864 0.512V140.8z m0 247.296l217.088-0.512-1.024 247.296H417.28V388.096z m-43.008-223.744v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m532.48 493.568H150.528l252.928-204.288 477.696 0.512-235.52 203.776z m271.36-247.808h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-zuoshitu-01" viewBox="0 0 1024 1024"><path d="M374.272 644.096l-262.656 211.968L112.64 373.76l261.632-209.408z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM112.64 373.76l261.632-209.408v479.744l-263.168 211.968L112.64 373.76z m520.192 507.904l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-qianshitu-01" viewBox="0 0 1024 1024"><path d="M112.64 389.12h520.704v493.056H112.64z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m259.584 717.824H112.64V389.12h520.704v493.056z m12.288-537.6l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-youshitu-01" viewBox="0 0 1024 1024"><path d="M916.992 659.456l-239.616 196.096V375.808l239.616-208.896z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m270.848 314.88l-239.104 196.096V375.808l239.104-208.896v492.544z" fill="#AAAAAA" ></path></symbol><symbol id="icon-houshitu-01" viewBox="0 0 1024 1024"><path d="M960 118.784V117.76v-1.024-1.024-1.024-0.512-0.512c1.536 7.68-1.024 15.872-6.656 20.992L677.376 373.76v299.52h-43.008V389.12H374.272v254.976l-262.656 211.968L112.64 389.12l261.632-0.512v-42.496h269.824l280.064-243.2c3.072-2.56 6.656-4.096 10.752-5.12H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c-0.512 0.512-0.512 1.024-1.024 2.048 0 0.512 0 0.512-0.512 1.024 0 0.512 0 0.512-0.512 1.024 0 0.512 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V907.264c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024c0 0.512 0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024s0 0.512 0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-242.176 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V658.944v-2.048V118.272c1.536 1.024 1.536 1.024 1.536 0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m258.56 717.312l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m44.544-26.112v-177.664H880.64l-203.264 177.664z m281.6-741.376v-0.512-0.512 1.024z" fill="#AAAAAA" ></path><path d="M916.992 634.88h-239.616V375.808l239.616-211.456zM644.096 346.112H417.28V141.824h462.336zM417.28 389.12H634.88v245.76H417.28z" fill="#72B02D" ></path><path d="M958.976 114.176c0 0.512 0.512 0.512 0 0z m-20.48-16.384H945.152l0.512 0.512 0.512 0.512h1.024l0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512c0 0.512 0.512 0.512 0.512 1.024s0 0.512 0.512 0.512c0 0.512 0.512 1.024 0.512 1.536 0 0.512 0.512 1.024 0.512 1.024-3.072-10.24-13.312-16.896-24.064-14.848h4.608v1.024z" fill="#C1272D" ></path></symbol><symbol id="icon-dingshitu-01" viewBox="0 0 1024 1024"><path d="M880.64 140.8l-234.496 203.776-497.664 1.536 256-206.336z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-497.664 1.536 256-205.824 476.16 1.024-234.496 203.264z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-toushitu-01" viewBox="0 0 1024 1024"><path d="M965.632 114.176V112.64v-1.024-0.512-1.024-0.512s0-0.512-0.512-1.024v-0.512c-0.512-1.024-0.512-2.048-1.024-3.072v-0.512c0-0.512-0.512-0.512-0.512-1.024s0-0.512-0.512-0.512l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512s-0.512-1.024-1.024-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024s-0.512 0-0.512-0.512c0 0-0.512 0-0.512-0.512H950.784h-0.512H392.704c-5.12 0-9.728 1.536-13.312 4.608l-312.32 251.392-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536 0 0 0 0.512-0.512 0.512 0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024c0 0.512 0 0.512-0.512 1.024s0 0.512 0 1.024 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V912.896c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024l0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512 0 0.512 0.512 0.512 1.024 1.024l0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512h583.168c7.68 0 14.848-4.096 18.432-10.752L957.44 675.84l1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V661.504v-1.536V658.432l1.024-544.256zM372.736 343.04l-229.888 0.512L372.736 158.72v184.32z m43.008 43.008l220.672-0.512-0.512 251.392h-220.16v-250.88z m-43.008 0v260.096l-267.264 215.552 1.536-474.624 265.728-1.024z m-227.84 502.272l257.024-208.384h233.984l-0.512 206.848-490.496 1.536z m503.296-545.792l-172.544 0.512H415.232V135.68h471.04l-238.08 206.848z m31.232 337.408h207.36l-207.36 181.248v-181.248z m0-43.008V373.76l243.2-212.48v475.648h-243.2z" fill="#AAAAAA" ></path></symbol><symbol id="icon-a-jixiebi3" viewBox="0 0 1024 1024"><path d="M483.386004 821.695719H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M483.386004 776.399147H164.779715l29.075502 22.648286h260.455285l29.075502-22.648286z" fill="#7A807D" ></path><path d="M483.386004 776.399147H164.779715l29.075502-22.648285h260.455285l29.075502 22.648285z" fill="#3F3F3F" ></path><path d="M483.386004 730.796518H164.779715l29.075502 22.954344h260.455285l29.075502-22.954344zM483.386004 685.499947H164.779715l29.075502 22.648285h260.455285l29.075502-22.648285z" fill="#7A807D" ></path><path d="M483.386004 730.796518H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M150.701051 623.064132h339.418227v62.435815H150.701051z" fill="#F7A53F" ></path><path d="M150.701051 821.695719h339.418227v31.217907H150.701051z" fill="#FFFFFF" ></path><path d="M607.951575 339.654504a74.984189 74.984189 0 0 1-23.872517 103.447575 75.290247 75.290247 0 0 1-103.753633-23.872518L293.324039 120.823095A75.290247 75.290247 0 0 1 317.196557 17.069462a75.290247 75.290247 0 0 1 103.753633 23.872517zM441.762128 517.474152v105.58998H198.752144v-105.58998a122.423166 122.423166 0 1 1 244.846331 0z" fill="#FFC200" ></path><path d="M627.233224 377.605685a103.141517 103.141517 0 0 1-52.948019 82.635637l-165.88339 118.750471-2.448463 1.836347a112.93537 112.93537 0 1 1-112.017197-194.346775l195.571007-84.471985a132.523077 132.523077 0 0 1 48.357151-12.854432A89.062853 89.062853 0 0 1 627.233224 377.605685z" fill="#FFE610" ></path><path d="M401.056425 493.601635a71.005436 71.005436 0 1 1-71.005436-71.311494 71.005436 71.005436 0 0 1 71.005436 71.311494z" fill="#FFFFFF" ></path><path d="M375.34756 493.601635a45.296571 45.296571 0 1 1-45.296571-45.60263 45.296571 45.296571 0 0 1 45.296571 45.60263z" fill="#48B8BF" ></path><path d="M592.342622 376.381453a49.88744 49.88744 0 1 1-49.581382-49.88744 49.88744 49.88744 0 0 1 49.581382 49.88744z" fill="#FFFFFF" ></path><path d="M574.285205 376.381453a30.605791 30.605791 0 1 1-30.605792-30.605791 30.605791 30.605791 0 0 1 30.605792 30.605791z" fill="#48B8BF" ></path><path d="M731.048068 230.789704l165.975207-62.099151 18.883774 50.46895-165.975207 62.068545z" fill="#FFE610" ></path><path d="M734.047436 202.785404l145.836596-54.294674 9.426584 25.31099-145.867202 54.294674z" fill="#F7A53F" ></path><path d="M808.419509 259.161272l23.872517 63.353988 31.523966 35.808776-19.893765 18.057417-48.051092-38.257239-27.851271-63.660046 40.399645-15.302896zM854.940312 242.022029l23.56646 63.04793-0.306058 47.745035 26.627038 0.612116 11.324143-60.293409-20.811938-66.414568-40.399645 15.302896zM716.173654 94.379691l102.345766-38.257239 37.216643 99.468822-102.345767 38.257239z" fill="#7A807D" ></path><path d="M841.473764 83.790087a66.108509 66.108509 0 0 1-65.802452 66.10851l-407.669142 15.608953a67.944857 67.944857 0 0 1-11.324142 0 82.635637 82.635637 0 0 1 0-165.271273 67.944857 67.944857 0 0 1 11.324142 0l407.669142 17.445301A66.108509 66.108509 0 0 1 841.473764 83.790087z" fill="#FFE610" ></path><path d="M402.892773 83.790087a46.520803 46.520803 0 1 1-46.520803-46.214745A46.520803 46.520803 0 0 1 402.892773 83.790087z" fill="#FFFFFF" ></path><path d="M386.059587 83.790087a30.605791 30.605791 0 1 1-30.605791-30.605791 30.605791 30.605791 0 0 1 30.605791 30.605791z" fill="#48B8BF" ></path><path d="M810.867972 83.790087a38.257239 38.257239 0 1 1-39.787528-38.257239A38.257239 38.257239 0 0 1 810.867972 83.790087z" fill="#FFFFFF" ></path><path d="M795.565077 83.790087a24.484633 24.484633 0 1 1-24.484633-24.484633 24.484633 24.484633 0 0 1 24.484633 24.484633z" fill="#48B8BF" ></path><path d="M106.93477 852.913626h639.66104v171.086374H106.93477z" fill="#FFE610" ></path><path d="M383.305066 709.678522h337.275822v207.201208H383.305066z" fill="#4D4D4D" ></path><path d="M407.177584 732.02075h291.061076v161.904636H407.177584z" fill="#FFFFFF" ></path><path d="M429.825869 755.893267h159.150116v16.22107h-159.150116zM429.825869 784.356653h131.604903v16.22107h-131.604903zM429.825869 812.820039h199.855818v16.22107h-199.855818zM429.825869 841.283425h146.601741v16.22107h-146.601741z" fill="#92D5D2" ></path><path d="M507.564579 732.326808l-31.830023 161.904636H407.177584v-161.904636h100.386995z" fill="#F5F5F5" opacity=".5" ></path><path d="M474.816383 916.87973h155.783478v31.830023h-155.783478z" fill="#7A807D" ></path><path d="M106.93477 977.173139h639.66104v46.826861H106.93477z" fill="#F7A53F" ></path><path d="M252.006221 899.740487h66.414567v48.969266H252.006221z" fill="#7A807D" ></path><path d="M319.64502 817.716966l-3.672695 11.324143-21.730112 70.699378h-21.730112l23.872518-76.820537 3.366637-11.324143 19.893764 6.121159z" fill="#999999" ></path><path d="M341.069074 809.147344A28.463386 28.463386 0 1 1 321.17531 773.950684a28.463386 28.463386 0 0 1 19.893764 35.19666z" fill="#48B8BF" ></path><path d="M322.705599 793.538391a13.16049 13.16049 0 1 1-26.014923 0 13.16049 13.16049 0 0 1 26.014923 0z" fill="#FFFFFF" ></path><path d="M165.085773 899.740487h66.414568v49.275324H165.085773z" fill="#7A807D" ></path><path d="M163.861542 817.716966l3.366637 11.324143 22.03617 70.699378h21.730111l-23.872517-76.820537-3.672695-11.324143-19.587706 6.121159z" fill="#999999" ></path><path d="M142.437488 809.147344a28.157328 28.157328 0 1 0 18.669532-35.19666 28.157328 28.157328 0 0 0-18.669532 35.19666z" fill="#F7A53F" ></path><path d="M160.800963 793.538391a13.16049 13.16049 0 1 0 12.854432-12.854433 12.854432 12.854432 0 0 0-12.854432 12.854433z" fill="#FFFFFF" ></path></symbol><symbol id="icon-jixiebi2" viewBox="0 0 1164 1024"><path d="M848.55632 485.108049h233.370249v430.146938h-233.370249z" fill="#FFE610" ></path><path d="M974.217224 605.245396h154.314351v64.211341h-154.314351zM974.217224 689.82485h154.314351v64.211341h-154.314351zM974.217224 774.749527h154.314351v64.211341h-154.314351z" fill="#54D9D9" ></path><path d="M306.557369 245.869021l99.078789 31.760448 69.389675 22.094225 145.683794 46.259783 69.734897 22.094225 119.101681 37.974449 66.627896 21.058558 1.035667-2.761778 21.749003-69.044453 23.129891-72.151453-22.784669-7.249667-79.746343-25.201225-20.368113-6.559223-337.972595-107.364124-21.40378-6.904445-87.686455-27.617781-45.224116 142.576794-0.345222 1.035667z" fill="#FFE610" ></path><path d="M412.33347 357.755556l10.70189-33.555604 441.470229 140.401894-10.667368 33.555604z" fill="#A3A3A3" ></path><path d="M380.331366 357.686512l25.408359-79.953476 69.424197 22.094225-25.408359 79.918953zM595.508402 425.626253l25.408359-79.953476 69.389674 22.059703-25.373836 79.953476z" fill="#3F3F3F" ></path><path d="M809.200982 411.575707a144.302906 144.302906 0 0 0 4.833112 37.284004 138.088905 138.088905 0 0 0 18.987224 43.152783 144.302906 144.302906 0 0 0 15.535002 19.677669 146.719461 146.719461 0 0 0 256.154919-100.114456 144.648128 144.648128 0 0 0-34.522226-94.5909 180.206021 180.206021 0 0 0-15.880224-16.570668 146.719461 146.719461 0 0 0-96.317012-34.522227 148.445573 148.445573 0 0 0-58.687784 10.356668 146.719461 146.719461 0 0 0-89.757788 129.803571 34.522226 34.522226 0 0 0-0.345223 5.523556z" fill="#FFC200" ></path><path d="M876.174101 411.575707A80.091565 80.091565 0 1 0 956.265666 331.484142a80.091565 80.091565 0 0 0-80.091565 80.091565z" fill="#FFFFFF" ></path><path d="M904.827549 411.575707a51.438117 51.438117 0 1 0 51.438117-51.092895 51.438117 51.438117 0 0 0-51.438117 51.092895z" fill="#54D9D9" ></path><path d="M218.076903 216.594173l37.007826-117.202958 88.894733 28.06657L306.902591 244.660743zM86.512699 119.345062l92.450522-16.467102 19.401491 108.745013-92.450522 16.467102z" fill="#8A8A8A" ></path><path d="M0 65.317778l45.224116 254.083585 21.058558-3.797445 31.415226-5.523556 22.094225-4.142667-13.808891-77.675009-19.332446-109.090235-12.082779-67.318341-14.499335 2.761778-21.403781 3.797445-38.664893 6.904445z" fill="#292929" ></path><path d="M95.626567 436.43171l16.570668-3.107-14.499335-123.244348-31.415226 5.523556 29.343893 120.827792z" fill="#7A807D" ></path><path d="M138.088905 153.349455a80.782009 80.782009 0 0 0 31.070003 63.520896 79.40112 79.40112 0 0 0 49.021562 16.915891 75.258453 75.258453 0 0 0 32.10567-6.904445 80.091565 80.091565 0 0 0 48.331117-73.532342 78.710676 78.710676 0 0 0-13.808891-44.18845 76.984564 76.984564 0 0 0-31.760448-27.617781l-7.59489-3.452222a83.543787 83.543787 0 0 0-12.428001-3.452223H217.835247A80.091565 80.091565 0 0 0 138.088905 153.349455z" fill="#FFC200" ></path><path d="M167.087575 153.694677A51.092895 51.092895 0 1 0 217.835247 103.637449a50.747673 50.747673 0 0 0-50.747672 50.057228z" fill="#FFFFFF" ></path><path d="M185.384355 153.694677a32.450893 32.450893 0 1 0 32.450892-34.522226 32.450893 32.450893 0 0 0-32.450892 34.522226z" fill="#54D9D9" ></path><path d="M38.664893 58.413333l21.403781-3.797445C66.627897 19.74844 108.745013 11.117883 141.88635 14.915328a89.757788 89.757788 0 0 1 81.472454 58.687784h9.321001a83.543787 83.543787 0 0 1 12.428001 3.452223l7.59489 3.452223c53.854673-42.807561 165.016241-17.951558 187.110466 48.331116l21.40378 6.904446C439.813162 59.449 307.593036 24.581551 241.655583 69.115223a113.923346 113.923346 0 0 0-108.745012-69.044452C90.793455 0.070771 41.081449 10.772661 38.664893 58.413333zM799.189537 244.14291l20.368113 6.559223a345.222262 345.222262 0 0 0 89.412566-34.522226c48.331117-22.784669 133.601015-34.522226 144.99335 34.522226a114.613791 114.613791 0 0 1 0 48.676339 180.206021 180.206021 0 0 1 15.880224 16.570668c15.880224-50.057228 3.797445-107.364124-54.545117-124.280014-83.198565-22.439447-141.541127 45.569339-216.109136 52.473784z" fill="#3F3F3F" ></path><path d="M44.18845 731.251522a105.638012 105.638012 0 0 0 105.638012 105.638012h698.729858v-31.415226H149.826462a74.222786 74.222786 0 0 1 0-148.445573h698.729858v-31.415225H149.826462a105.638012 105.638012 0 0 0-105.638012 105.638012z" fill="#8A8A8A" ></path><path d="M75.603675 731.251522a74.222786 74.222786 0 0 0 74.222787 74.222786h698.729858V655.993069H149.826462a74.222786 74.222786 0 0 0-74.222787 75.258453z" fill="#FFE610" ></path><path d="M103.566679 731.251522a51.092895 51.092895 0 1 0 50.747672-50.747673A50.747673 50.747673 0 0 0 103.566679 731.251522z" fill="#FFFFFF" ></path><path d="M121.863459 731.251522a32.450893 32.450893 0 1 0 32.450892-32.450893 32.450893 32.450893 0 0 0-32.450892 32.450893zM290.331922 731.251522a34.522226 34.522226 0 0 0 34.522227 34.522226h414.266714a34.522226 34.522226 0 0 0 34.522226-34.522226 34.522226 34.522226 0 0 0-34.522226-34.522226h-414.266714a34.522226 34.522226 0 0 0-34.522227 34.522226z" fill="#54D9D9" ></path><path d="M827.15254 877.625761h276.523032v61.794785h-276.523032z" fill="#F7A53F" ></path><path d="M839.925764 939.765768h250.976584v31.070004h-250.976584z" fill="#707070" ></path><path d="M747.75142 657.028735v148.445573h43.152783v31.415226h57.652117v-211.276024h-57.652117v31.415225h-43.152783z" fill="#B3B3B3" opacity=".76" ></path><path d="M14.499335 970.490549h1149.590133v53.509451H14.499335z" fill="#B86805" ></path><path d="M154.314351 836.889534H272.725587v133.601015H154.314351zM614.150404 836.889534h118.411236v133.601015h-118.411236z" fill="#F7A53F" ></path><path d="M614.150404 836.889534h118.411236v78.365453h-118.411236zM154.314351 836.889534H272.725587v78.365453H154.314351z" fill="#B3B3B3" opacity=".76" ></path></symbol><symbol id="icon-jixiebi4" viewBox="0 0 1123 1024"><path d="M502.569098 505.335276h543.234824v85.15391H502.569098z" fill="#FFE610" ></path><path d="M483.047648 203.089382a81.451566 81.451566 0 0 1-41.06236 73.373725l-302.919047 173.33701a82.124719 82.124719 0 0 1-81.788143-143.045105l302.919047-173.33701a82.124719 82.124719 0 0 1 83.807603 0 79.768682 79.768682 0 0 1 27.935868 28.945597A77.412645 77.412645 0 0 1 483.047648 203.089382z" fill="#FFC200" ></path><path d="M39.776109 803.542249h1082.094151v220.121174H39.776109z" fill="#FFE610" ></path><path d="M39.776109 971.830609h1082.094151v52.169391H39.776109zM466.218812 723.43699v146.747449H219.844654v-146.747449a123.187079 123.187079 0 0 1 246.374158 0z" fill="#FFC200" ></path><path d="M396.210854 790.415757a100.973016 100.973016 0 0 1-141.698798-23.896947l-235.603704-331.864645a100.973016 100.973016 0 0 1 23.896947-141.362222 100.973016 100.973016 0 0 1 141.698799 23.896947l235.603703 331.528068a100.973016 100.973016 0 0 1-24.233523 141.698799z" fill="#FFE610" ></path><path d="M146.470929 451.146424a86.16364 86.16364 0 1 1 29.282174-118.138428 86.16364 86.16364 0 0 1-29.282174 118.138428z" fill="#B8B8B8" ></path><path d="M131.661553 424.556864a56.881466 56.881466 0 1 1 19.52145-78.085799 56.544889 56.544889 0 0 1-19.52145 78.085799z" fill="#B8B8B8" ></path><path d="M120.554522 405.035414a35.677132 35.677132 0 0 1-36.686863-60.920386A35.677132 35.677132 0 1 1 120.554522 405.035414z" fill="#FFFFFF" ></path><path d="M370.9676 757.767815a56.881466 56.881466 0 1 1 19.184873-78.085798 56.881466 56.881466 0 0 1-19.184873 78.085798z" fill="#B8B8B8" ></path><path d="M358.850839 739.592672a35.677132 35.677132 0 1 1 12.116761-48.803624 35.677132 35.677132 0 0 1-12.116761 48.803624z" fill="#FFFFFF" ></path><path d="M423.136992 384.167657l-112.416624 66.305614-32.984519-55.871735 112.753201-65.969037 9.760725 16.492259 13.463069 22.887217 9.424148 16.155682z" fill="#8A8A8A" ></path><path d="M400.18246 345.023785l70.512822-41.398937 13.463069 22.887217-70.512823 41.432594z" fill="#C4C4C4" ></path><path d="M489.442606 313.823123a21.877487 21.877487 0 0 1-11.780186 27.935868 21.54091 21.54091 0 0 1-27.935867-12.116762l-29.955328-73.373725a21.54091 21.54091 0 0 1 12.116762-27.935868 21.204333 21.204333 0 0 1 27.599291 11.780186z" fill="#F7A53F" ></path><path d="M482.037918 318.19862a12.453339 12.453339 0 0 1-9.424148 14.809376 12.789915 12.789915 0 0 1-14.809376-9.424148 12.789915 12.789915 0 0 1 9.424148-14.809376 12.453339 12.453339 0 0 1 14.809376 9.424148z" fill="#707070" ></path><path d="M303.652257 388.543155a24.5701 24.5701 0 0 0-7.404688 8.077841l-24.906677 45.10128 32.311365 44.764704 36.350285-65.63246a24.906677 24.906677 0 0 0-36.013709-33.657672z m12.453338 6.394957a14.472799 14.472799 0 0 1 16.155683 12.116762 14.136222 14.136222 0 0 1-12.116762 16.155683 13.799645 13.799645 0 0 1-16.155683-11.780185 14.136222 14.136222 0 0 1 13.463069-16.49226z" fill="#B86805" ></path><path d="M305.33514 411.430372a13.799645 13.799645 0 0 0 16.155683 11.780185 14.136222 14.136222 0 0 0 12.116762-16.155683 14.472799 14.472799 0 0 0-16.155683-12.116762 14.136222 14.136222 0 0 0-12.116762 16.49226z" fill="#5E5E5E" ></path><path d="M625.4196 163.709906l-19.858026 12.116762-37.360016 22.55064-19.858027 12.116762-20.867756-34.667402-40.389207-66.64219-19.184872-31.301635 9.424148-5.721804 58.227772-35.340556 9.424148-5.385227 80.441836 132.27465z" fill="#8A8A8A" ></path><path d="M568.066927 198.276335l37.124412-22.516982 36.484917 60.14626-37.15807 22.55064z" fill="#4D4D4D" ></path><path d="M931.031261 336.373763l-85.15391 217.765137h-128.572307l-46.447587-118.811581-30.965058-79.768683-7.404688-19.184873 46.111011-46.447587h205.648375l46.784164 46.447587z" fill="#AEBABD" ></path><path d="M744.668732 483.861681l105.954351-43.182793 2.423352 5.890093-105.988009 43.182793zM840.8287 361.953594l-120.157889-26.252984 1.682884-6.058381 119.821312 26.252984-1.346307 6.058381zM683.916634 363.838423l6.125696-1.851172 32.984518 109.252803-6.159353 1.851172z" fill="#6A5060" ></path><path d="M880.544753 403.015954a49.813354 49.813354 0 1 1-49.813354-49.813355 50.149931 50.149931 0 0 1 49.813354 49.813355zM746.923796 359.597557a33.657672 33.657672 0 1 1-33.657672-33.657672 33.657672 33.657672 0 0 1 33.657672 33.657672zM767.454975 465.282647a26.589561 26.589561 0 0 1-26.58956 26.252984A26.252984 26.252984 0 0 1 741.201991 438.693086a26.589561 26.589561 0 0 1 26.252984 26.589561z" fill="#FFFFFF" ></path><path d="M846.887081 403.015954a16.155683 16.155683 0 1 1-16.155682-16.155683 16.155683 16.155683 0 0 1 16.155682 16.155683zM724.709732 359.597557a10.097302 10.097302 0 0 1-10.097302 9.760725 9.760725 9.760725 0 1 1 0-19.52145 10.097302 10.097302 0 0 1 10.097302 9.760725zM748.943256 465.282647A7.741265 7.741265 0 0 1 741.201991 472.350758a8.077841 8.077841 0 0 1-8.077841-8.077842 8.077841 8.077841 0 0 1 8.077841-8.077841 8.077841 8.077841 0 0 1 7.741265 9.087572z" fill="#788B90" opacity=".37" ></path><path d="M698.456748 219.581642h166.268899v46.11101h-166.268899z" fill="#F7A53F" ></path><path d="M702.159092 223.620562h5.048651v38.03317h-5.048651zM711.246663 223.620562h5.048651v38.03317h-5.048651zM720.334235 223.620562h5.048651v38.03317h-5.048651zM729.421806 223.620562h5.048651v38.03317h-5.048651zM738.509378 223.620562h5.04865v38.03317h-5.04865zM747.596949 223.620562h5.048651v38.03317h-5.048651zM756.68452 223.620562h5.048651v38.03317h-5.048651zM765.772092 223.620562h5.048651v38.03317h-5.048651zM774.859663 223.620562h5.048651v38.03317H774.859663zM783.610658 223.620562h5.048651v38.03317h-5.048651zM792.698229 223.620562h5.048651v38.03317h-5.048651zM801.785801 223.620562h5.04865v38.03317h-5.04865zM810.873372 223.620562h5.048651v38.03317h-5.048651zM819.960944 223.620562h5.04865v38.03317h-5.04865zM829.048515 223.620562h5.048651v38.03317h-5.048651zM838.136086 223.620562h5.048651v38.03317h-5.048651zM847.223658 223.620562h5.048651v38.03317h-5.048651zM856.311229 223.620562h5.048651v38.03317h-5.048651z" fill="#788B90" opacity=".38" ></path><path d="M738.845954 265.692652h85.490487v23.896947h-85.490487z" fill="#707070" ></path><path d="M735.816764 288.916446h-1.682884L640.228976 355.558636l-39.0429 26.926138-4.712074 3.365767-16.492259-23.896947a25.916407 25.916407 0 0 1 6.731534-36.013709l97.270672-67.315344a25.916407 25.916407 0 0 1 36.013709 6.731534z" fill="#58BFD2" ></path><path d="M670.857457 435.327319h-33.657672a12.116762 12.116762 0 0 1-10.433878-8.414418l-24.906677-44.428127 39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M827.365631 288.916446h1.682884l94.241481 65.63246 39.0429 26.926138 4.712074 3.365767 16.492259-23.896947a25.916407 25.916407 0 0 0-6.731534-35.003979l-97.270672-67.315344a25.916407 25.916407 0 0 0-36.013709 6.731534z" fill="#58BFD2" ></path><path d="M892.324938 435.327319h33.657672a12.116762 12.116762 0 0 0 10.433878-8.414418l24.906677-44.428127-39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M738.845954 265.692652h85.490487v12.116762h-85.490487zM922.95342 355.558636l-31.301635 79.768683-46.447588 118.811581 49.140201-194.541343-70.007957-69.671381h4.038921l94.578058 65.63246z" fill="#848484" opacity=".25" ></path><path d="M661.433309 321.900964l-48.467048-67.988497 21.204334-12.789915 38.033169 74.383455-10.770455 6.394957z" fill="#7A807D" ></path><path d="M535.553616 36.820483l-58.227772 33.657672-11.780186-19.184873A33.657672 33.657672 0 0 1 502.905674 1.143351a33.657672 33.657672 0 0 1 21.204334 15.482529z" fill="#F7A53F" ></path><path d="M527.475775 175.826668L483.047648 203.089382A77.412645 77.412645 0 0 0 471.940616 164.046483a79.768682 79.768682 0 0 0-27.599291-28.272444l42.745243-25.916408zM527.475775 175.826668l-40.389207-66.64219 40.389207 66.64219z" fill="#C4C4C4" ></path><path d="M956.274515 854.028757H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M650.999431 304.062398l-70.007958 14.809376 69.671381 8.414418-4.712074 38.033169 25.243254-25.243254 22.887217 25.243254-3.702344-36.350286 35.003979-1.682883-31.974789-19.52145 14.809376-35.677132-33.657672 24.906677-26.252984-43.754973 2.692614 50.823084z" fill="#FFFFFF" ></path><path d="M956.274515 803.542249H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 803.542249H600.512923l32.311365-25.579831h290.802285l32.647942 25.579831z" fill="#999999" ></path><path d="M956.274515 752.719165H600.512923l32.311365 25.243253h290.802285l32.647942-25.243253zM956.274515 702.232657H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 752.719165H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M584.693817 632.561276h378.985386v69.671381H584.693817zM584.693817 854.028757h378.985386v34.667402H584.693817z" fill="#FFC200" ></path><path d="M502.569098 590.489186h543.234824v42.07209H502.569098z" fill="#F7A53F" ></path><path d="M273.696929 882.637778h80.441836v59.574079H273.696929z" fill="#7A807D" ></path><path d="M355.821648 783.011069l-4.375497 13.799646-26.589561 85.827063h-26.252984l28.945598-93.231751 4.375497-13.799646 23.896947 7.404688z" fill="#999999" ></path><path d="M381.738055 772.913768a33.657672 33.657672 0 1 1-22.55064-43.08182 33.657672 33.657672 0 0 1 22.55064 43.08182z" fill="#F7A53F" ></path><path d="M359.523992 753.728895a15.819106 15.819106 0 1 1-15.819106-15.819106 15.819106 15.819106 0 0 1 15.819106 15.819106z" fill="#FFFFFF" ></path><path d="M168.348416 882.637778h80.441835v59.574079H168.348416z" fill="#7A807D" ></path><path d="M166.665532 783.011069l4.375497 13.799646 26.589561 85.827063h26.252984l-28.945598-93.231751-4.03892-13.799646-24.233524 7.404688z" fill="#999999" ></path><path d="M140.749125 772.913768a33.657672 33.657672 0 1 0 67.315343-20.53118 33.657672 33.657672 0 0 0-43.08182-22.55064 33.657672 33.657672 0 0 0-24.233523 43.08182z" fill="#68FF4B" ></path><path d="M162.963188 753.728895a15.819106 15.819106 0 1 0 15.819106-15.819106 15.819106 15.819106 0 0 0-15.819106 15.819106z" fill="#FFFFFF" ></path></symbol></svg>',(s=>{var t=(e=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute("data-injectcss"),e=e.getAttribute("data-disable-injectsvg");if(!e){var n,i,r,a,o,l=function(u,d){d.parentNode.insertBefore(u,d)};if(t&&!s.__iconfont__svg__cssinject__){s.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(u){console&&console.log(u)}}n=function(){var u,d=document.createElement("div");d.innerHTML=s._iconfont_svg_string_4634042,(d=d.getElementsByTagName("svg")[0])&&(d.setAttribute("aria-hidden","true"),d.style.position="absolute",d.style.width=0,d.style.height=0,d.style.overflow="hidden",d=d,(u=document.body).firstChild?l(d,u.firstChild):u.appendChild(d))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(r=n,a=s.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,r())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);exports.ACESFilmicToneMapping=kh;exports.AmbientLight=_u;exports.Box3=Bn;exports.CatmullRomCurve3=uu;exports.Color=jt;exports.Controls=cp;exports.DirectionalLight=gu;exports.DoubleSide=tn;exports.Euler=un;exports.GridHelper=lp;exports.HemisphereLight=Zf;exports.MOUSE=Uu;exports.MathUtils=Ti;exports.Matrix4=Yt;exports.Mesh=be;exports.MeshPhongMaterial=cn;exports.PCFSoftShadowMap=Bh;exports.PerspectiveCamera=Je;exports.Plane=hi;exports.PlaneGeometry=Ys;exports.PointLight=mu;exports.Quaternion=gn;exports.Ray=gs;exports.SRGBColorSpace=Me;exports.Scene=wl;exports.ShadowMaterial=Ff;exports.Spherical=vu;exports.TOUCH=Iu;exports.TubeGeometry=Dl;exports.Vector2=Dt;exports.Vector3=N;exports.WebGLRenderer=q2;exports.Xe=vg;exports._sfc_main=Ig;exports.useModelComp=Oh;exports.useModelLoader=Ug;
4201
+ `);let i=[];for(let o=0,l=n.length;o<l;o++){const c=n[o].trimStart();if(c.length===0)continue;const h=c.charAt(0);if(h!=="#")if(h==="v"){const u=c.split(_h);switch(u[0]){case"v":e.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Nr.setRGB(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),Me),e.colors.push(Nr.r,Nr.g,Nr.b)):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":e.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(h==="f"){const d=c.slice(1).trim().split(_h),p=[];for(let _=0,g=d.length;_<g;_++){const f=d[_];if(f.length>0){const b=f.split("/");p.push(b)}}const m=p[0];for(let _=1,g=p.length-1;_<g;_++){const f=p[_],b=p[_+1];e.addFace(m[0],f[0],b[0],m[1],f[1],b[1],m[2],f[2],b[2])}}else if(h==="l"){const u=c.substring(1).trim().split(" ");let d=[];const p=[];if(c.indexOf("/")===-1)d=u;else for(let m=0,_=u.length;m<_;m++){const g=u[m].split("/");g[0]!==""&&d.push(g[0]),g[1]!==""&&p.push(g[1])}e.addLineGeometry(d,p)}else if(h==="p"){const d=c.slice(1).trim().split(" ");e.addPointGeometry(d)}else if((i=X2.exec(c))!==null){const u=(" "+i[0].slice(1).trim()).slice(1);e.startObject(u)}else if(j2.test(c))e.object.startMaterial(c.substring(7).trim(),e.materialLibraries);else if(q2.test(c))e.materialLibraries.push(c.substring(7).trim());else if(Y2.test(c))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(h==="s"){if(i=c.split(" "),i.length>1){const d=i[1].trim().toLowerCase();e.object.smooth=d!=="0"&&d!=="off"}else e.object.smooth=!0;const u=e.object.currentMaterial();u&&(u.smooth=e.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}e.finalize();const r=new Zn;if(r.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let o=0,l=e.objects.length;o<l;o++){const c=e.objects[o],h=c.geometry,u=c.materials,d=h.type==="Line",p=h.type==="Points";let m=!1;if(h.vertices.length===0)continue;const _=new Ne;_.setAttribute("position",new de(h.vertices,3)),h.normals.length>0&&_.setAttribute("normal",new de(h.normals,3)),h.colors.length>0&&(m=!0,_.setAttribute("color",new de(h.colors,3))),h.hasUVIndices===!0&&_.setAttribute("uv",new de(h.uvs,2));const g=[];for(let b=0,w=u.length;b<w;b++){const S=u[b],I=S.name+"_"+S.smooth+"_"+m;let L=e.materials[I];if(this.materials!==null){if(L=this.materials.create(S.name),d&&L&&!(L instanceof fi)){const P=new fi;Mn.prototype.copy.call(P,L),P.color.copy(L.color),L=P}else if(p&&L&&!(L instanceof Ri)){const P=new Ri({size:10,sizeAttenuation:!1});Mn.prototype.copy.call(P,L),P.color.copy(L.color),P.map=L.map,L=P}}L===void 0&&(d?L=new fi:p?L=new Ri({size:1,sizeAttenuation:!1}):L=new cn,L.name=S.name,L.flatShading=!S.smooth,L.vertexColors=m,e.materials[I]=L),g.push(L)}let f;if(g.length>1){for(let b=0,w=u.length;b<w;b++){const S=u[b];_.addGroup(S.groupStart,S.groupCount,b)}d?f=new na(_,g):p?f=new Os(_,g):f=new be(_,g)}else d?f=new na(_,g[0]):p?f=new Os(_,g[0]):f=new be(_,g[0]);f.name=c.name,r.add(f)}else if(e.vertices.length>0){const o=new Ri({size:1,sizeAttenuation:!1}),l=new Ne;l.setAttribute("position",new de(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(l.setAttribute("color",new de(e.colors,3)),o.vertexColors=!0);const c=new Os(l,o);r.add(c)}return r}}class oo extends Ln{constructor(t){super(t)}load(t,e,n,i){const r=this,a=this.path===""?Al.extractUrlBase(t):this.path,o=new xs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(l){try{e(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(t)}},n,i)}setMaterialOptions(t){return this.materialOptions=t,this}parse(t,e){const n=t.split(`
4202
+ `);let i={};const r=/\s+/,a={};for(let l=0;l<n.length;l++){let c=n[l];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const h=c.indexOf(" ");let u=h>=0?c.substring(0,h):c;u=u.toLowerCase();let d=h>=0?c.substring(h+1):"";if(d=d.trim(),u==="newmtl")i={name:d},a[d]=i;else if(u==="ka"||u==="kd"||u==="ks"||u==="ke"){const p=d.split(r,3);i[u]=[parseFloat(p[0]),parseFloat(p[1]),parseFloat(p[2])]}else i[u]=d}const o=new K2(this.resourcePath||e,this.materialOptions);return o.setCrossOrigin(this.crossOrigin),o.setManager(this.manager),o.setMaterials(a),o}}class K2{constructor(t="",e={}){this.baseUrl=t,this.options=e,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:Cn,this.wrap=this.options.wrap!==void 0?this.options.wrap:Nn}setCrossOrigin(t){return this.crossOrigin=t,this}setManager(t){this.manager=t}setMaterials(t){this.materialsInfo=this.convert(t),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(t){if(!this.options)return t;const e={};for(const n in t){const i=t[n],r={};e[n]=r;for(const a in i){let o=!0,l=i[a];const c=a.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(l=[l[0]/255,l[1]/255,l[2]/255]),this.options&&this.options.ignoreZeroRGBs&&l[0]===0&&l[1]===0&&l[2]===0&&(o=!1);break}o&&(r[c]=l)}}return e}preload(){for(const t in this.materialsInfo)this.create(t)}getIndex(t){return this.nameLookup[t]}getAsArray(){let t=0;for(const e in this.materialsInfo)this.materialsArray[t]=this.create(e),this.nameLookup[e]=t,t++;return this.materialsArray}create(t){return this.materials[t]===void 0&&this.createMaterial_(t),this.materials[t]}createMaterial_(t){const e=this,n=this.materialsInfo[t],i={name:t,side:this.side};function r(o,l){return typeof l!="string"||l===""?"":/^https?:\/\//i.test(l)?l:o+l}function a(o,l){if(i[o])return;const c=e.getTextureParams(l,i),h=e.loadTexture(r(e.baseUrl,c.url));h.repeat.copy(c.scale),h.offset.copy(c.offset),h.wrapS=e.wrap,h.wrapT=e.wrap,(o==="map"||o==="emissiveMap")&&(h.colorSpace=Me),i[o]=h}for(const o in n){const l=n[o];let c;if(l!=="")switch(o.toLowerCase()){case"kd":i.color=fe.colorSpaceToWorking(new qt().fromArray(l),Me);break;case"ks":i.specular=fe.colorSpaceToWorking(new qt().fromArray(l),Me);break;case"ke":i.emissive=fe.colorSpaceToWorking(new qt().fromArray(l),Me);break;case"map_kd":a("map",l);break;case"map_ks":a("specularMap",l);break;case"map_ke":a("emissiveMap",l);break;case"norm":a("normalMap",l);break;case"map_bump":case"bump":a("bumpMap",l);break;case"disp":a("displacementMap",l);break;case"map_d":a("alphaMap",l),i.transparent=!0;break;case"ns":i.shininess=parseFloat(l);break;case"d":c=parseFloat(l),c<1&&(i.opacity=c,i.transparent=!0);break;case"tr":c=parseFloat(l),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(i.opacity=1-c,i.transparent=!0);break}}return this.materials[t]=new cn(i),this.materials[t]}getTextureParams(t,e){const n={scale:new Qt(1,1),offset:new Qt(0,0)},i=t.split(/\s+/);let r;return r=i.indexOf("-bm"),r>=0&&(e.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),r=i.indexOf("-mm"),r>=0&&(e.displacementBias=parseFloat(i[r+1]),e.displacementScale=parseFloat(i[r+2]),i.splice(r,3)),r=i.indexOf("-s"),r>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),r=i.indexOf("-o"),r>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n}loadTexture(t,e,n,i,r){const a=this.manager!==void 0?this.manager:El;let o=a.getHandler(t);o===null&&(o=new wl(a)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const l=o.load(t,n,i,r);return e!==void 0&&(l.mapping=e),l}}class Kr extends Ln{constructor(t){super(t)}load(t,e,n,i){const r=this,a=new xs(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(o){try{e(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(t)}},n,i)}parse(t){function e(c){const h=new DataView(c),u=32/8*3+32/8*3*3+16/8,d=h.getUint32(80,!0);if(80+32/8+d*u===h.byteLength)return!0;const m=[115,111,108,105,100];for(let _=0;_<5;_++)if(n(m,h,_))return!1;return!0}function n(c,h,u){for(let d=0,p=c.length;d<p;d++)if(c[d]!==h.getUint8(u+d))return!1;return!0}function i(c){const h=new DataView(c),u=h.getUint32(80,!0);let d,p,m,_=!1,g,f,b,w,S;for(let U=0;U<70;U++)h.getUint32(U,!1)==1129270351&&h.getUint8(U+4)==82&&h.getUint8(U+5)==61&&(_=!0,g=new Float32Array(u*3*3),f=h.getUint8(U+6)/255,b=h.getUint8(U+7)/255,w=h.getUint8(U+8)/255,S=h.getUint8(U+9)/255);const I=84,L=12*4+2,P=new Ne,D=new Float32Array(u*3*3),M=new Float32Array(u*3*3),y=new qt;for(let U=0;U<u;U++){const B=I+U*L,k=h.getFloat32(B,!0),q=h.getFloat32(B+4,!0),J=h.getFloat32(B+8,!0);if(_){const z=h.getUint16(B+48,!0);(z&32768)===0?(d=(z&31)/31,p=(z>>5&31)/31,m=(z>>10&31)/31):(d=f,p=b,m=w)}for(let z=1;z<=3;z++){const tt=B+z*12,W=U*3*3+(z-1)*3;D[W]=h.getFloat32(tt,!0),D[W+1]=h.getFloat32(tt+4,!0),D[W+2]=h.getFloat32(tt+8,!0),M[W]=k,M[W+1]=q,M[W+2]=J,_&&(y.setRGB(d,p,m,Me),g[W]=y.r,g[W+1]=y.g,g[W+2]=y.b)}}return P.setAttribute("position",new Oe(D,3)),P.setAttribute("normal",new Oe(M,3)),_&&(P.setAttribute("color",new Oe(g,3)),P.hasColors=!0,P.alpha=S),P}function r(c){const h=new Ne,u=/solid([\s\S]*?)endsolid/g,d=/facet([\s\S]*?)endfacet/g,p=/solid\s(.+)/;let m=0;const _=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+_+_+_,"g"),f=new RegExp("normal"+_+_+_,"g"),b=[],w=[],S=[],I=new O;let L,P=0,D=0,M=0;for(;(L=u.exec(c))!==null;){D=M;const y=L[0],U=(L=p.exec(y))!==null?L[1]:"";for(S.push(U);(L=d.exec(y))!==null;){let q=0,J=0;const z=L[0];for(;(L=f.exec(z))!==null;)I.x=parseFloat(L[1]),I.y=parseFloat(L[2]),I.z=parseFloat(L[3]),J++;for(;(L=g.exec(z))!==null;)b.push(parseFloat(L[1]),parseFloat(L[2]),parseFloat(L[3])),w.push(I.x,I.y,I.z),q++,M++;J!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+m),q!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+m),m++}const B=D,k=M-D;h.userData.groupNames=S,h.addGroup(B,k,P),P++}return h.setAttribute("position",new de(b,3)),h.setAttribute("normal",new de(w,3)),h}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function o(c){if(typeof c=="string"){const h=new Uint8Array(c.length);for(let u=0;u<c.length;u++)h[u]=c.charCodeAt(u)&255;return h.buffer||h}else return c}const l=o(t);return e(l)?i(l):r(a(t))}}class J2 extends Ln{constructor(t){super(t),this.littleEndian=!0}load(t,e,n,i){const r=this,a=new xs(r.manager);a.setPath(r.path),a.setResponseType("arraybuffer"),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(t,function(o){try{e(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(t)}},n,i)}_getDataView(t,e,n,i){switch(n){case"F":return i===8?t.getFloat64(e,this.littleEndian):t.getFloat32(e,this.littleEndian);case"I":return i===1?t.getInt8(e):i===2?t.getInt16(e,this.littleEndian):t.getInt32(e,this.littleEndian);case"U":return i===1?t.getUint8(e):i===2?t.getUint16(e,this.littleEndian):t.getUint32(e,this.littleEndian)}}parse(t){function e(p,m){const _=p.length,g=new Uint8Array(m);let f=0,b=0,w,S,I;do if(w=p[f++],w<32){if(w++,b+w>m)throw new Error("Output buffer is not large enough");if(f+w>_)throw new Error("Invalid compressed data");do g[b++]=p[f++];while(--w)}else{if(S=w>>5,I=b-((w&31)<<8)-1,f>=_)throw new Error("Invalid compressed data");if(S===7&&(S+=p[f++],f>=_))throw new Error("Invalid compressed data");if(I-=p[f++],b+S+2>m)throw new Error("Output buffer is not large enough");if(I<0)throw new Error("Invalid compressed data");if(I>=b)throw new Error("Invalid compressed data");do g[b++]=g[I++];while(--S+2)}while(f<_);return g}function n(p){const m={},_=new Uint8Array(p);let g="",f="",b=0,w=!1;const S=_.length;for(;b<S&&w===!1;){const D=String.fromCharCode(_[b++]);D===`
4203
+ `||D==="\r"?(f.trim().toLowerCase().startsWith("data")&&(w=!0),f=""):f+=D,g+=D}const I=g.search(/[\r\n]DATA\s(\S*)\s/i),L=/[\r\n]DATA\s(\S*)\s/i.exec(g.slice(I-1));if(m.data=L[1],m.headerLen=L[0].length+I,m.str=g.slice(0,m.headerLen),m.str=m.str.replace(/#.*/gi,""),m.version=/^VERSION (.*)/im.exec(m.str),m.fields=/^FIELDS (.*)/im.exec(m.str),m.size=/^SIZE (.*)/im.exec(m.str),m.type=/^TYPE (.*)/im.exec(m.str),m.count=/^COUNT (.*)/im.exec(m.str),m.width=/^WIDTH (.*)/im.exec(m.str),m.height=/^HEIGHT (.*)/im.exec(m.str),m.viewpoint=/^VIEWPOINT (.*)/im.exec(m.str),m.points=/^POINTS (.*)/im.exec(m.str),m.version!==null&&(m.version=parseFloat(m.version[1])),m.fields=m.fields!==null?m.fields[1].split(" "):[],m.type!==null&&(m.type=m.type[1].split(" ")),m.width!==null&&(m.width=parseInt(m.width[1])),m.height!==null&&(m.height=parseInt(m.height[1])),m.viewpoint!==null&&(m.viewpoint=m.viewpoint[1]),m.points!==null&&(m.points=parseInt(m.points[1],10)),m.points===null&&(m.points=m.width*m.height),m.size!==null&&(m.size=m.size[1].split(" ").map(function(D){return parseInt(D,10)})),m.count!==null)m.count=m.count[1].split(" ").map(function(D){return parseInt(D,10)});else{m.count=[];for(let D=0,M=m.fields.length;D<M;D++)m.count.push(1)}m.offset={};let P=0;for(let D=0,M=m.fields.length;D<M;D++)m.data==="ascii"?m.offset[m.fields[D]]=D:(m.offset[m.fields[D]]=P,P+=m.size[D]*m.count[D]);return m.rowSize=P,m}const i=n(t),r=[],a=[],o=[],l=[],c=[],h=new qt;if(i.data==="ascii"){const p=i.offset,g=new TextDecoder().decode(t).slice(i.headerLen).split(`
4204
+ `);for(let f=0,b=g.length;f<b;f++){if(g[f]==="")continue;const w=g[f].split(" ");if(p.x!==void 0&&(r.push(parseFloat(w[p.x])),r.push(parseFloat(w[p.y])),r.push(parseFloat(w[p.z]))),p.rgb!==void 0){const S=i.fields.findIndex(U=>U==="rgb"),I=i.type[S],L=parseFloat(w[p.rgb]);let P=L;if(I==="F"){const U=new Float32Array(1);U[0]=L,P=new Int32Array(U.buffer)[0]}const D=(P>>16&255)/255,M=(P>>8&255)/255,y=(P>>0&255)/255;h.setRGB(D,M,y,Me),o.push(h.r,h.g,h.b)}p.normal_x!==void 0&&(a.push(parseFloat(w[p.normal_x])),a.push(parseFloat(w[p.normal_y])),a.push(parseFloat(w[p.normal_z]))),p.intensity!==void 0&&l.push(parseFloat(w[p.intensity])),p.label!==void 0&&c.push(parseInt(w[p.label]))}}if(i.data==="binary_compressed"){const p=new Uint32Array(t.slice(i.headerLen,i.headerLen+8)),m=p[0],_=p[1],g=e(new Uint8Array(t,i.headerLen+8,m),_),f=new DataView(g.buffer),b=i.offset;for(let w=0;w<i.points;w++){if(b.x!==void 0){const S=i.fields.indexOf("x"),I=i.fields.indexOf("y"),L=i.fields.indexOf("z");r.push(this._getDataView(f,i.points*b.x+i.size[S]*w,i.type[S],i.size[S])),r.push(this._getDataView(f,i.points*b.y+i.size[I]*w,i.type[I],i.size[I])),r.push(this._getDataView(f,i.points*b.z+i.size[L]*w,i.type[L],i.size[L]))}if(b.rgb!==void 0){const S=i.fields.indexOf("rgb"),I=f.getUint8(i.points*b.rgb+i.size[S]*w+2)/255,L=f.getUint8(i.points*b.rgb+i.size[S]*w+1)/255,P=f.getUint8(i.points*b.rgb+i.size[S]*w+0)/255;h.setRGB(I,L,P,Me),o.push(h.r,h.g,h.b)}if(b.normal_x!==void 0){const S=i.fields.indexOf("normal_x"),I=i.fields.indexOf("normal_y"),L=i.fields.indexOf("normal_z");a.push(this._getDataView(f,i.points*b.normal_x+i.size[S]*w,i.type[S],i.size[S])),a.push(this._getDataView(f,i.points*b.normal_y+i.size[I]*w,i.type[I],i.size[I])),a.push(this._getDataView(f,i.points*b.normal_z+i.size[L]*w,i.type[L],i.size[L]))}if(b.intensity!==void 0){const S=i.fields.indexOf("intensity");l.push(this._getDataView(f,i.points*b.intensity+i.size[S]*w,i.type[S],i.size[S]))}if(b.label!==void 0){const S=i.fields.indexOf("label");c.push(f.getInt32(i.points*b.label+i.size[S]*w,this.littleEndian))}}}if(i.data==="binary"){const p=new DataView(t,i.headerLen),m=i.offset;for(let _=0,g=0;_<i.points;_++,g+=i.rowSize){if(m.x!==void 0){const f=i.fields.indexOf("x"),b=i.fields.indexOf("y"),w=i.fields.indexOf("z");r.push(this._getDataView(p,g+m.x,i.type[f],i.size[f])),r.push(this._getDataView(p,g+m.y,i.type[b],i.size[b])),r.push(this._getDataView(p,g+m.z,i.type[w],i.size[w]))}if(m.rgb!==void 0){const f=p.getUint8(g+m.rgb+2)/255,b=p.getUint8(g+m.rgb+1)/255,w=p.getUint8(g+m.rgb+0)/255;h.setRGB(f,b,w,Me),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const f=i.fields.indexOf("normal_x"),b=i.fields.indexOf("normal_y"),w=i.fields.indexOf("normal_z");a.push(this._getDataView(p,g+m.normal_x,i.type[f],i.size[f])),a.push(this._getDataView(p,g+m.normal_y,i.type[b],i.size[b])),a.push(this._getDataView(p,g+m.normal_z,i.type[w],i.size[w]))}if(m.intensity!==void 0){const f=i.fields.indexOf("intensity");l.push(this._getDataView(p,g+m.intensity,i.type[f],i.size[f]))}m.label!==void 0&&c.push(p.getInt32(g+m.label,this.littleEndian))}}const u=new Ne;r.length>0&&u.setAttribute("position",new de(r,3)),a.length>0&&u.setAttribute("normal",new de(a,3)),o.length>0&&u.setAttribute("color",new de(o,3)),l.length>0&&u.setAttribute("intensity",new de(l,1)),c.length>0&&u.setAttribute("label",new Wd(c,1)),u.computeBoundingSphere();const d=new Ri({size:.005});return o.length>0&&(d.vertexColors=!0),new Os(u,d)}}class Mh extends bf{constructor(t){super(t)}parse(t){function e(z){switch(z.image_type){case d:case _:if(z.colormap_length>256||z.colormap_size!==24||z.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case p:case m:case g:case f:if(z.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case u:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+z.image_type)}if(z.width<=0||z.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(z.pixel_size!==8&&z.pixel_size!==16&&z.pixel_size!==24&&z.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+z.pixel_size)}function n(z,tt,W,at,dt){let mt,Rt;const wt=W.pixel_size>>3,X=W.width*W.height*wt;if(tt&&(Rt=dt.subarray(at,at+=W.colormap_length*(W.colormap_size>>3))),z){mt=new Uint8Array(X);let Z,Q,et,_t=0;const ot=new Uint8Array(wt);for(;_t<X;)if(Z=dt[at++],Q=(Z&127)+1,Z&128){for(et=0;et<wt;++et)ot[et]=dt[at++];for(et=0;et<Q;++et)mt.set(ot,_t+et*wt);_t+=wt*Q}else{for(Q*=wt,et=0;et<Q;++et)mt[_t+et]=dt[at++];_t+=Q}}else mt=dt.subarray(at,at+=tt?W.width*W.height:X);return{pixel_data:mt,palettes:Rt}}function i(z,tt,W,at,dt,mt,Rt,wt,X){const Z=X;let Q,et=0,_t,ot;const gt=y.width;for(ot=tt;ot!==at;ot+=W)for(_t=dt;_t!==Rt;_t+=mt,et++)Q=wt[et],z[(_t+gt*ot)*4+3]=255,z[(_t+gt*ot)*4+2]=Z[Q*3+0],z[(_t+gt*ot)*4+1]=Z[Q*3+1],z[(_t+gt*ot)*4+0]=Z[Q*3+2];return z}function r(z,tt,W,at,dt,mt,Rt,wt){let X,Z=0,Q,et;const _t=y.width;for(et=tt;et!==at;et+=W)for(Q=dt;Q!==Rt;Q+=mt,Z+=2)X=wt[Z+0]+(wt[Z+1]<<8),z[(Q+_t*et)*4+0]=(X&31744)>>7,z[(Q+_t*et)*4+1]=(X&992)>>2,z[(Q+_t*et)*4+2]=(X&31)<<3,z[(Q+_t*et)*4+3]=X&32768?0:255;return z}function a(z,tt,W,at,dt,mt,Rt,wt){let X=0,Z,Q;const et=y.width;for(Q=tt;Q!==at;Q+=W)for(Z=dt;Z!==Rt;Z+=mt,X+=3)z[(Z+et*Q)*4+3]=255,z[(Z+et*Q)*4+2]=wt[X+0],z[(Z+et*Q)*4+1]=wt[X+1],z[(Z+et*Q)*4+0]=wt[X+2];return z}function o(z,tt,W,at,dt,mt,Rt,wt){let X=0,Z,Q;const et=y.width;for(Q=tt;Q!==at;Q+=W)for(Z=dt;Z!==Rt;Z+=mt,X+=4)z[(Z+et*Q)*4+2]=wt[X+0],z[(Z+et*Q)*4+1]=wt[X+1],z[(Z+et*Q)*4+0]=wt[X+2],z[(Z+et*Q)*4+3]=wt[X+3];return z}function l(z,tt,W,at,dt,mt,Rt,wt){let X,Z=0,Q,et;const _t=y.width;for(et=tt;et!==at;et+=W)for(Q=dt;Q!==Rt;Q+=mt,Z++)X=wt[Z],z[(Q+_t*et)*4+0]=X,z[(Q+_t*et)*4+1]=X,z[(Q+_t*et)*4+2]=X,z[(Q+_t*et)*4+3]=255;return z}function c(z,tt,W,at,dt,mt,Rt,wt){let X=0,Z,Q;const et=y.width;for(Q=tt;Q!==at;Q+=W)for(Z=dt;Z!==Rt;Z+=mt,X+=2)z[(Z+et*Q)*4+0]=wt[X+0],z[(Z+et*Q)*4+1]=wt[X+0],z[(Z+et*Q)*4+2]=wt[X+0],z[(Z+et*Q)*4+3]=wt[X+1];return z}function h(z,tt,W,at,dt){let mt,Rt,wt,X,Z,Q;switch((y.flags&b)>>w){default:case L:mt=0,wt=1,Z=tt,Rt=0,X=1,Q=W;break;case S:mt=0,wt=1,Z=tt,Rt=W-1,X=-1,Q=-1;break;case P:mt=tt-1,wt=-1,Z=-1,Rt=0,X=1,Q=W;break;case I:mt=tt-1,wt=-1,Z=-1,Rt=W-1,X=-1,Q=-1;break}if(k)switch(y.pixel_size){case 8:l(z,Rt,X,Q,mt,wt,Z,at);break;case 16:c(z,Rt,X,Q,mt,wt,Z,at);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(y.pixel_size){case 8:i(z,Rt,X,Q,mt,wt,Z,at,dt);break;case 16:r(z,Rt,X,Q,mt,wt,Z,at);break;case 24:a(z,Rt,X,Q,mt,wt,Z,at);break;case 32:o(z,Rt,X,Q,mt,wt,Z,at);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return z}const u=0,d=1,p=2,m=3,_=9,g=10,f=11,b=48,w=4,S=0,I=1,L=2,P=3;if(t.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let D=0;const M=new Uint8Array(t),y={id_length:M[D++],colormap_type:M[D++],image_type:M[D++],colormap_index:M[D++]|M[D++]<<8,colormap_length:M[D++]|M[D++]<<8,colormap_size:M[D++],origin:[M[D++]|M[D++]<<8,M[D++]|M[D++]<<8],width:M[D++]|M[D++]<<8,height:M[D++]|M[D++]<<8,pixel_size:M[D++],flags:M[D++]};if(e(y),y.id_length+D>t.length)throw new Error("THREE.TGALoader: No data.");D+=y.id_length;let U=!1,B=!1,k=!1;switch(y.image_type){case _:U=!0,B=!0;break;case d:B=!0;break;case g:U=!0;break;case p:break;case f:U=!0,k=!0;break;case m:k=!0;break}const q=new Uint8Array(y.width*y.height*4),J=n(U,B,y,D,M);return h(q,y.width,y.height,J.pixel_data,J.palettes),{data:q,width:y.width,height:y.height,flipY:!0,generateMipmaps:!0,minFilter:Kn}}}class Z2 extends Ln{load(t,e,n,i){const r=this,a=r.path===""?Al.extractUrlBase(t):r.path,o=new xs(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(t,function(l){try{e(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(t)}},n,i)}parse(t,e){function n(x,v){const R=[],T=x.childNodes;for(let C=0,K=T.length;C<K;C++){const it=T[C];it.nodeName===v&&R.push(it)}return R}function i(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let T=0,C=v.length;T<C;T++)R[T]=v[T];return R}function r(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let T=0,C=v.length;T<C;T++)R[T]=parseFloat(v[T]);return R}function a(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let T=0,C=v.length;T<C;T++)R[T]=parseInt(v[T]);return R}function o(x){return x.substring(1)}function l(){return"three_default_"+Vn++}function c(x){return Object.keys(x).length===0}function h(x){return{unit:u(n(x,"unit")[0]),upAxis:d(n(x,"up_axis")[0])}}function u(x){return x!==void 0&&x.hasAttribute("meter")===!0?parseFloat(x.getAttribute("meter")):1}function d(x){return x!==void 0?x.textContent:"Y_UP"}function p(x,v,R,T){const C=n(x,v)[0];if(C!==void 0){const K=n(C,R);for(let it=0;it<K.length;it++)T(K[it])}}function m(x,v){for(const R in x){const T=x[R];T.build=v(x[R])}}function _(x,v){return x.build!==void 0||(x.build=v(x)),x.build}function g(x){const v={sources:{},samplers:{},channels:{}};let R=!1;for(let T=0,C=x.childNodes.length;T<C;T++){const K=x.childNodes[T];if(K.nodeType!==1)continue;let it;switch(K.nodeName){case"source":it=K.getAttribute("id"),v.sources[it]=ht(K);break;case"sampler":it=K.getAttribute("id"),v.samplers[it]=f(K);break;case"channel":it=K.getAttribute("target"),v.channels[it]=b(K);break;case"animation":g(K),R=!0;break;default:console.log(K)}}R===!1&&(Jt.animations[x.getAttribute("id")||Ti.generateUUID()]=v)}function f(x){const v={inputs:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"input":const K=o(C.getAttribute("source")),it=C.getAttribute("semantic");v.inputs[it]=K;break}}return v}function b(x){const v={};let T=x.getAttribute("target").split("/");const C=T.shift();let K=T.shift();const it=K.indexOf("(")!==-1,Pt=K.indexOf(".")!==-1;if(Pt)T=K.split("."),K=T.shift(),v.member=T.shift();else if(it){const vt=K.split("(");K=vt.shift();for(let At=0;At<vt.length;At++)vt[At]=parseInt(vt[At].replace(/\)/,""));v.indices=vt}return v.id=C,v.sid=K,v.arraySyntax=it,v.memberSyntax=Pt,v.sampler=o(x.getAttribute("source")),v}function w(x){const v=[],R=x.channels,T=x.samplers,C=x.sources;for(const K in R)if(R.hasOwnProperty(K)){const it=R[K],Pt=T[it.sampler],vt=Pt.inputs.INPUT,At=Pt.inputs.OUTPUT,kt=C[vt],ut=C[At],Ot=I(it,kt,ut);y(Ot,v)}return v}function S(x){return _(Jt.animations[x],w)}function I(x,v,R){const T=Jt.nodes[x.id],C=le(T.id),K=T.transforms[x.sid],it=T.matrix.clone().transpose();let Pt,vt,At,kt,ut,Ot;const Nt={};switch(K){case"matrix":for(At=0,kt=v.array.length;At<kt;At++)if(Pt=v.array[At],vt=At*R.stride,Nt[Pt]===void 0&&(Nt[Pt]={}),x.arraySyntax===!0){const Fe=R.array[vt],Te=x.indices[0]+4*x.indices[1];Nt[Pt][Te]=Fe}else for(ut=0,Ot=R.stride;ut<Ot;ut++)Nt[Pt][ut]=R.array[vt+ut];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',K);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',K);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',K);break}const Xt=L(Nt,it);return{name:C.uuid,keyframes:Xt}}function L(x,v){const R=[];for(const C in x)R.push({time:parseFloat(C),value:x[C]});R.sort(T);for(let C=0;C<16;C++)U(R,C,v.elements[C]);return R;function T(C,K){return C.time-K.time}}const P=new O,D=new O,M=new gn;function y(x,v){const R=x.keyframes,T=x.name,C=[],K=[],it=[],Pt=[];for(let vt=0,At=R.length;vt<At;vt++){const kt=R[vt],ut=kt.time,Ot=kt.value;H.fromArray(Ot).transpose(),H.decompose(P,M,D),C.push(ut),K.push(P.x,P.y,P.z),it.push(M.x,M.y,M.z,M.w),Pt.push(D.x,D.y,D.z)}return K.length>0&&v.push(new ps(T+".position",C,K)),it.length>0&&v.push(new qs(T+".quaternion",C,it)),Pt.length>0&&v.push(new ps(T+".scale",C,Pt)),v}function U(x,v,R){let T,C=!0,K,it;for(K=0,it=x.length;K<it;K++)T=x[K],T.value[v]===void 0?T.value[v]=null:C=!1;if(C===!0)for(K=0,it=x.length;K<it;K++)T=x[K],T.value[v]=R;else B(x,v)}function B(x,v){let R,T;for(let C=0,K=x.length;C<K;C++){const it=x[C];if(it.value[v]===null){if(R=k(x,C,v),T=q(x,C,v),R===null){it.value[v]=T.value[v];continue}if(T===null){it.value[v]=R.value[v];continue}J(it,R,T,v)}}}function k(x,v,R){for(;v>=0;){const T=x[v];if(T.value[R]!==null)return T;v--}return null}function q(x,v,R){for(;v<x.length;){const T=x[v];if(T.value[R]!==null)return T;v++}return null}function J(x,v,R,T){if(R.time-v.time===0){x.value[T]=v.value[T];return}x.value[T]=(x.time-v.time)*(R.value[T]-v.value[T])/(R.time-v.time)+v.value[T]}function z(x){const v={name:x.getAttribute("id")||"default",start:parseFloat(x.getAttribute("start")||0),end:parseFloat(x.getAttribute("end")||0),animations:[]};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"instance_animation":v.animations.push(o(C.getAttribute("url")));break}}Jt.clips[x.getAttribute("id")]=v}function tt(x){const v=[],R=x.name,T=x.end-x.start||-1,C=x.animations;for(let K=0,it=C.length;K<it;K++){const Pt=S(C[K]);for(let vt=0,At=Pt.length;vt<At;vt++)v.push(Pt[vt])}return new Ec(R,T,v)}function W(x){return _(Jt.clips[x],tt)}function at(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"skin":v.id=o(C.getAttribute("source")),v.skin=dt(C);break;case"morph":v.id=o(C.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}Jt.controllers[x.getAttribute("id")]=v}function dt(x){const v={sources:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"bind_shape_matrix":v.bindShapeMatrix=r(C.textContent);break;case"source":const K=C.getAttribute("id");v.sources[K]=ht(C);break;case"joints":v.joints=mt(C);break;case"vertex_weights":v.vertexWeights=Rt(C);break}}return v}function mt(x){const v={inputs:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"input":const K=C.getAttribute("semantic"),it=o(C.getAttribute("source"));v.inputs[K]=it;break}}return v}function Rt(x){const v={inputs:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"input":const K=C.getAttribute("semantic"),it=o(C.getAttribute("source")),Pt=parseInt(C.getAttribute("offset"));v.inputs[K]={id:it,offset:Pt};break;case"vcount":v.vcount=a(C.textContent);break;case"v":v.v=a(C.textContent);break}}return v}function wt(x){const v={id:x.id},R=Jt.geometries[v.id];return x.skin!==void 0&&(v.skin=X(x.skin),R.sources.skinIndices=v.skin.indices,R.sources.skinWeights=v.skin.weights),v}function X(x){const R={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},T=x.sources,C=x.vertexWeights,K=C.vcount,it=C.v,Pt=C.inputs.JOINT.offset,vt=C.inputs.WEIGHT.offset,At=x.sources[x.joints.inputs.JOINT],kt=x.sources[x.joints.inputs.INV_BIND_MATRIX],ut=T[C.inputs.WEIGHT.id].array;let Ot=0,Nt,Xt,Ht;for(Nt=0,Ht=K.length;Nt<Ht;Nt++){const Te=K[Nt],xe=[];for(Xt=0;Xt<Te;Xt++){const ye=it[Ot+Pt],Hn=it[Ot+vt],ln=ut[Hn];xe.push({index:ye,weight:ln}),Ot+=2}for(xe.sort(Fe),Xt=0;Xt<4;Xt++){const ye=xe[Xt];ye!==void 0?(R.indices.array.push(ye.index),R.weights.array.push(ye.weight)):(R.indices.array.push(0),R.weights.array.push(0))}}for(x.bindShapeMatrix?R.bindMatrix=new Zt().fromArray(x.bindShapeMatrix).transpose():R.bindMatrix=new Zt().identity(),Nt=0,Ht=At.array.length;Nt<Ht;Nt++){const Te=At.array[Nt],xe=new Zt().fromArray(kt.array,Nt*kt.stride).transpose();R.joints.push({name:Te,boneInverse:xe})}return R;function Fe(Te,xe){return xe.weight-Te.weight}}function Z(x){return _(Jt.controllers[x],wt)}function Q(x){const v={init_from:n(x,"init_from")[0].textContent};Jt.images[x.getAttribute("id")]=v}function et(x){return x.build!==void 0?x.build:x.init_from}function _t(x){const v=Jt.images[x];return v!==void 0?_(v,et):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",x),null)}function ot(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"profile_COMMON":v.profile=gt(C);break}}Jt.effects[x.getAttribute("id")]=v}function gt(x){const v={surfaces:{},samplers:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"newparam":te(C,v);break;case"technique":v.technique=F(C);break;case"extra":v.extra=yt(C);break}}return v}function te(x,v){const R=x.getAttribute("sid");for(let T=0,C=x.childNodes.length;T<C;T++){const K=x.childNodes[T];if(K.nodeType===1)switch(K.nodeName){case"surface":v.surfaces[R]=ee(K);break;case"sampler2D":v.samplers[R]=jt(K);break}}}function ee(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"init_from":v.init_from=C.textContent;break}}return v}function jt(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"source":v.source=C.textContent;break}}return v}function F(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"constant":case"lambert":case"blinn":case"phong":v.type=C.nodeName,v.parameters=_e(C);break;case"extra":v.extra=yt(C);break}}return v}function _e(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":v[C.nodeName]=se(C);break;case"transparent":v[C.nodeName]={opaque:C.hasAttribute("opaque")?C.getAttribute("opaque"):"A_ONE",data:se(C)};break}}return v}function se(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"color":v[C.nodeName]=r(C.textContent);break;case"float":v[C.nodeName]=parseFloat(C.textContent);break;case"texture":v[C.nodeName]={id:C.getAttribute("texture"),extra:re(C)};break}}return v}function re(x){const v={technique:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"extra":Mt(C,v);break}}return v}function Mt(x,v){for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"technique":ne(C,v);break}}}function ne(x,v){for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":v.technique[C.nodeName]=parseFloat(C.textContent);break;case"wrapU":case"wrapV":C.textContent.toUpperCase()==="TRUE"?v.technique[C.nodeName]=1:C.textContent.toUpperCase()==="FALSE"?v.technique[C.nodeName]=0:v.technique[C.nodeName]=parseInt(C.textContent);break;case"bump":v[C.nodeName]=Ee(C);break}}}function yt(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"technique":v.technique=oe(C);break}}return v}function oe(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"double_sided":v[C.nodeName]=parseInt(C.textContent);break;case"bump":v[C.nodeName]=Ee(C);break}}return v}function Ee(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"texture":v[C.nodeName]={id:C.getAttribute("texture"),texcoord:C.getAttribute("texcoord"),extra:re(C)};break}}return v}function N(x){return x}function E(x){return _(Jt.effects[x],N)}function j(x){const v={name:x.getAttribute("name")};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"instance_effect":v.url=o(C.getAttribute("url"));break}}Jt.materials[x.getAttribute("id")]=v}function st(x){let v,R=x.slice((x.lastIndexOf(".")-1>>>0)+2);switch(R=R.toLowerCase(),R){case"tga":v=Je;break;default:v=en}return v}function lt(x){const v=E(x.url),R=v.profile.technique;let T;switch(R.type){case"phong":case"blinn":T=new cn;break;case"lambert":T=new cf;break;default:T=new pi;break}T.name=x.name||"";function C(vt,At=null){const kt=v.profile.samplers[vt.id];let ut=null;if(kt!==void 0){const Ot=v.profile.surfaces[kt.source];ut=_t(Ot.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),ut=_t(vt.id);if(ut!==null){const Ot=st(ut);if(Ot!==void 0){const Nt=Ot.load(ut),Xt=vt.extra;if(Xt!==void 0&&Xt.technique!==void 0&&c(Xt.technique)===!1){const Ht=Xt.technique;Nt.wrapS=Ht.wrapU?Nn:An,Nt.wrapT=Ht.wrapV?Nn:An,Nt.offset.set(Ht.offsetU||0,Ht.offsetV||0),Nt.repeat.set(Ht.repeatU||1,Ht.repeatV||1)}else Nt.wrapS=Nn,Nt.wrapT=Nn;return At!==null&&(Nt.colorSpace=At),Nt}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",ut),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",vt.id),null}const K=R.parameters;for(const vt in K){const At=K[vt];switch(vt){case"diffuse":At.color&&T.color.fromArray(At.color),At.texture&&(T.map=C(At.texture,Me));break;case"specular":At.color&&T.specular&&T.specular.fromArray(At.color),At.texture&&(T.specularMap=C(At.texture));break;case"bump":At.texture&&(T.normalMap=C(At.texture));break;case"ambient":At.texture&&(T.lightMap=C(At.texture,Me));break;case"shininess":At.float&&T.shininess&&(T.shininess=At.float);break;case"emission":At.color&&T.emissive&&T.emissive.fromArray(At.color),At.texture&&(T.emissiveMap=C(At.texture,Me));break}}fe.colorSpaceToWorking(T.color,Me),T.specular&&fe.colorSpaceToWorking(T.specular,Me),T.emissive&&fe.colorSpaceToWorking(T.emissive,Me);let it=K.transparent,Pt=K.transparency;if(Pt===void 0&&it&&(Pt={float:1}),it===void 0&&Pt&&(it={opaque:"A_ONE",data:{color:[1,1,1,1]}}),it&&Pt)if(it.data.texture)T.transparent=!0;else{const vt=it.data.color;switch(it.opaque){case"A_ONE":T.opacity=vt[3]*Pt.float;break;case"RGB_ZERO":T.opacity=1-vt[0]*Pt.float;break;case"A_ZERO":T.opacity=1-vt[3]*Pt.float;break;case"RGB_ONE":T.opacity=vt[0]*Pt.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',it.opaque)}T.opacity<1&&(T.transparent=!0)}if(R.extra!==void 0&&R.extra.technique!==void 0){const vt=R.extra.technique;for(const At in vt){const kt=vt[At];switch(At){case"double_sided":T.side=kt===1?tn:Cn;break;case"bump":T.normalMap=C(kt.texture),T.normalScale=new Qt(1,1);break}}}return T}function nt(x){return _(Jt.materials[x],lt)}function zt(x){const v={name:x.getAttribute("name")};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"optics":v.optics=bt(C);break}}Jt.cameras[x.getAttribute("id")]=v}function bt(x){for(let v=0;v<x.childNodes.length;v++){const R=x.childNodes[v];switch(R.nodeName){case"technique_common":return Ft(R)}}return{}}function Ft(x){const v={};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];switch(T.nodeName){case"perspective":case"orthographic":v.technique=T.nodeName,v.parameters=Bt(T);break}}return v}function Bt(x){const v={};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];switch(T.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":v[T.nodeName]=parseFloat(T.textContent);break}}return v}function ct(x){let v;switch(x.optics.technique){case"perspective":v=new $e(x.optics.parameters.yfov,x.optics.parameters.aspect_ratio,x.optics.parameters.znear,x.optics.parameters.zfar);break;case"orthographic":let R=x.optics.parameters.ymag,T=x.optics.parameters.xmag;const C=x.optics.parameters.aspect_ratio;T=T===void 0?R*C:T,R=R===void 0?T/C:R,T*=.5,R*=.5,v=new ha(-T,T,R,-R,x.optics.parameters.znear,x.optics.parameters.zfar);break;default:v=new $e;break}return v.name=x.name||"",v}function Ct(x){const v=Jt.cameras[x];return v!==void 0?_(v,ct):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",x),null)}function Yt(x){let v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"technique_common":v=Wt(C);break}}Jt.lights[x.getAttribute("id")]=v}function Wt(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"directional":case"point":case"spot":case"ambient":v.technique=C.nodeName,v.parameters=St(C)}}return v}function St(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"color":const K=r(C.textContent);v.color=new qt().fromArray(K),fe.colorSpaceToWorking(v.color,Me);break;case"falloff_angle":v.falloffAngle=parseFloat(C.textContent);break;case"quadratic_attenuation":const it=parseFloat(C.textContent);v.distance=it?Math.sqrt(1/it):0;break}}return v}function ie(x){let v;switch(x.technique){case"directional":v=new iu;break;case"point":v=new nu;break;case"spot":v=new Tf;break;case"ambient":v=new su;break}return x.parameters.color&&v.color.copy(x.parameters.color),x.parameters.distance&&(v.distance=x.parameters.distance),v}function V(x){const v=Jt.lights[x];return v!==void 0?_(v,ie):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",x),null)}function Tt(x){const v={name:x.getAttribute("name"),sources:{},vertices:{},primitives:[]},R=n(x,"mesh")[0];if(R!==void 0){for(let T=0;T<R.childNodes.length;T++){const C=R.childNodes[T];if(C.nodeType!==1)continue;const K=C.getAttribute("id");switch(C.nodeName){case"source":v.sources[K]=ht(C);break;case"vertices":v.vertices=Dt(C);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",C.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":v.primitives.push(ft(C));break;default:console.log(C)}}Jt.geometries[x.getAttribute("id")]=v}}function ht(x){const v={array:[],stride:3};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"float_array":v.array=r(T.textContent);break;case"Name_array":v.array=i(T.textContent);break;case"technique_common":const C=n(T,"accessor")[0];C!==void 0&&(v.stride=parseInt(C.getAttribute("stride")));break}}return v}function Dt(x){const v={};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];T.nodeType===1&&(v[T.getAttribute("semantic")]=o(T.getAttribute("source")))}return v}function ft(x){const v={type:x.nodeName,material:x.getAttribute("material"),count:parseInt(x.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let R=0,T=x.childNodes.length;R<T;R++){const C=x.childNodes[R];if(C.nodeType===1)switch(C.nodeName){case"input":const K=o(C.getAttribute("source")),it=C.getAttribute("semantic"),Pt=parseInt(C.getAttribute("offset")),vt=parseInt(C.getAttribute("set")),At=vt>0?it+vt:it;v.inputs[At]={id:K,offset:Pt},v.stride=Math.max(v.stride,Pt+1),it==="TEXCOORD"&&(v.hasUV=!0);break;case"vcount":v.vcount=a(C.textContent);break;case"p":v.p=a(C.textContent);break}}return v}function rt(x){const v={};for(let R=0;R<x.length;R++){const T=x[R];v[T.type]===void 0&&(v[T.type]=[]),v[T.type].push(T)}return v}function Ut(x){let v=0;for(let R=0,T=x.length;R<T;R++)x[R].hasUV===!0&&v++;v>0&&v<x.length&&(x.uvsNeedsFix=!0)}function ae(x){const v={},R=x.sources,T=x.vertices,C=x.primitives;if(C.length===0)return{};const K=rt(C);for(const it in K){const Pt=K[it];Ut(Pt),v[it]=Le(Pt,R,T)}return v}function Le(x,v,R){const T={},C={array:[],stride:0},K={array:[],stride:0},it={array:[],stride:0},Pt={array:[],stride:0},vt={array:[],stride:0},At={array:[],stride:4},kt={array:[],stride:4},ut=new Ne,Ot=[];let Nt=0;for(let Xt=0;Xt<x.length;Xt++){const Ht=x[Xt],Fe=Ht.inputs;let Te=0;switch(Ht.type){case"lines":case"linestrips":Te=Ht.count*2;break;case"triangles":Te=Ht.count*3;break;case"polylist":for(let xe=0;xe<Ht.count;xe++){const ye=Ht.vcount[xe];switch(ye){case 3:Te+=3;break;case 4:Te+=6;break;default:Te+=(ye-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",Ht.type)}ut.addGroup(Nt,Te,Xt),Nt+=Te,Ht.material&&Ot.push(Ht.material);for(const xe in Fe){const ye=Fe[xe];switch(xe){case"VERTEX":for(const Hn in R){const ln=R[Hn];switch(Hn){case"POSITION":const Fi=C.array.length;if(ce(Ht,v[ln],ye.offset,C.array),C.stride=v[ln].stride,v.skinWeights&&v.skinIndices&&(ce(Ht,v.skinIndices,ye.offset,At.array),ce(Ht,v.skinWeights,ye.offset,kt.array)),Ht.hasUV===!1&&x.uvsNeedsFix===!0){const vu=(C.array.length-Fi)/C.stride;for(let Dl=0;Dl<vu;Dl++)it.array.push(0,0)}break;case"NORMAL":ce(Ht,v[ln],ye.offset,K.array),K.stride=v[ln].stride;break;case"COLOR":ce(Ht,v[ln],ye.offset,vt.array),vt.stride=v[ln].stride;break;case"TEXCOORD":ce(Ht,v[ln],ye.offset,it.array),it.stride=v[ln].stride;break;case"TEXCOORD1":ce(Ht,v[ln],ye.offset,Pt.array),it.stride=v[ln].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',Hn)}}break;case"NORMAL":ce(Ht,v[ye.id],ye.offset,K.array),K.stride=v[ye.id].stride;break;case"COLOR":ce(Ht,v[ye.id],ye.offset,vt.array,!0),vt.stride=v[ye.id].stride;break;case"TEXCOORD":ce(Ht,v[ye.id],ye.offset,it.array),it.stride=v[ye.id].stride;break;case"TEXCOORD1":ce(Ht,v[ye.id],ye.offset,Pt.array),Pt.stride=v[ye.id].stride;break}}}return C.array.length>0&&ut.setAttribute("position",new de(C.array,C.stride)),K.array.length>0&&ut.setAttribute("normal",new de(K.array,K.stride)),vt.array.length>0&&ut.setAttribute("color",new de(vt.array,vt.stride)),it.array.length>0&&ut.setAttribute("uv",new de(it.array,it.stride)),Pt.array.length>0&&ut.setAttribute("uv1",new de(Pt.array,Pt.stride)),At.array.length>0&&ut.setAttribute("skinIndex",new de(At.array,At.stride)),kt.array.length>0&&ut.setAttribute("skinWeight",new de(kt.array,kt.stride)),T.data=ut,T.type=x[0].type,T.materialKeys=Ot,T}function ce(x,v,R,T,C=!1){const K=x.p,it=x.stride,Pt=x.vcount;function vt(ut){let Ot=K[ut+R]*kt;const Nt=Ot+kt;for(;Ot<Nt;Ot++)T.push(At[Ot]);if(C){const Xt=T.length-kt-1;ze.setRGB(T[Xt+0],T[Xt+1],T[Xt+2],Me),T[Xt+0]=ze.r,T[Xt+1]=ze.g,T[Xt+2]=ze.b}}const At=v.array,kt=v.stride;if(x.vcount!==void 0){let ut=0;for(let Ot=0,Nt=Pt.length;Ot<Nt;Ot++){const Xt=Pt[Ot];if(Xt===4){const Ht=ut+it*0,Fe=ut+it*1,Te=ut+it*2,xe=ut+it*3;vt(Ht),vt(Fe),vt(xe),vt(Fe),vt(Te),vt(xe)}else if(Xt===3){const Ht=ut+it*0,Fe=ut+it*1,Te=ut+it*2;vt(Ht),vt(Fe),vt(Te)}else if(Xt>4)for(let Ht=1,Fe=Xt-2;Ht<=Fe;Ht++){const Te=ut+it*0,xe=ut+it*Ht,ye=ut+it*(Ht+1);vt(Te),vt(xe),vt(ye)}ut+=it*Xt}}else for(let ut=0,Ot=K.length;ut<Ot;ut+=it)vt(ut)}function an(x){return _(Jt.geometries[x],ae)}function Sn(x){const v={name:x.getAttribute("name")||"",joints:{},links:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"technique_common":kn(T,v);break}}Jt.kinematicsModels[x.getAttribute("id")]=v}function Ys(x){return x.build!==void 0?x.build:x}function $s(x){return _(Jt.kinematicsModels[x],Ys)}function kn(x,v){for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"joint":v.joints[T.getAttribute("sid")]=Ms(T);break;case"link":v.links.push(Ss(T));break}}}function Ms(x){let v;for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"prismatic":case"revolute":v=Ks(T);break}}return v}function Ks(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",axis:new O,limits:{min:0,max:0},type:x.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"axis":const C=r(T.textContent);v.axis.fromArray(C);break;case"limits":const K=T.getElementsByTagName("max")[0],it=T.getElementsByTagName("min")[0];v.limits.max=parseFloat(K.textContent),v.limits.min=parseFloat(it.textContent);break}}return v.limits.min>=v.limits.max&&(v.static=!0),v.middlePosition=(v.limits.min+v.limits.max)/2,v}function Ss(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",attachments:[],transforms:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"attachment_full":v.attachments.push(Ui(T));break;case"matrix":case"translate":case"rotate":v.transforms.push(bs(T));break}}return v}function Ui(x){const v={joint:x.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"link":v.links.push(Ss(T));break;case"matrix":case"translate":case"rotate":v.transforms.push(bs(T));break}}return v}function bs(x){const v={type:x.nodeName},R=r(x.textContent);switch(v.type){case"matrix":v.obj=new Zt,v.obj.fromArray(R).transpose();break;case"translate":v.obj=new O,v.obj.fromArray(R);break;case"rotate":v.obj=new O,v.obj.fromArray(R),v.angle=Ti.degToRad(R[3]);break}return v}function Ii(x){const v={name:x.getAttribute("name")||"",rigidBodies:{}};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"rigid_body":v.rigidBodies[T.getAttribute("name")]={},Js(T,v.rigidBodies[T.getAttribute("name")]);break}}Jt.physicsModels[x.getAttribute("id")]=v}function Js(x,v){for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"technique_common":Zs(T,v);break}}}function Zs(x,v){for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"inertia":v.inertia=r(T.textContent);break;case"mass":v.mass=r(T.textContent)[0];break}}}function fa(x){const v={bindJointAxis:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"bind_joint_axis":v.bindJointAxis.push(pa(T));break}}Jt.kinematicsScenes[o(x.getAttribute("url"))]=v}function pa(x){const v={target:x.getAttribute("target").split("/").pop()};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"axis":const C=T.getElementsByTagName("param")[0];v.axis=C.textContent;const K=v.axis.split("inst_").pop().split("axis")[0];v.jointIndex=K.substring(0,K.length-1);break}}return v}function ma(x){return x.build!==void 0?x.build:x}function ga(x){return _(Jt.kinematicsScenes[x],ma)}function _a(){const x=Object.keys(Jt.kinematicsModels)[0],v=Object.keys(Jt.kinematicsScenes)[0],R=Object.keys(Jt.visualScenes)[0];if(x===void 0||v===void 0)return;const T=$s(x),C=ga(v),K=ge(R),it=C.bindJointAxis,Pt={};for(let kt=0,ut=it.length;kt<ut;kt++){const Ot=it[kt],Nt=Ue.querySelector('[sid="'+Ot.target+'"]');if(Nt){const Xt=Nt.parentElement;vt(Ot.jointIndex,Xt)}}function vt(kt,ut){const Ot=ut.getAttribute("name"),Nt=T.joints[kt];K.traverse(function(Xt){Xt.name===Ot&&(Pt[kt]={object:Xt,transforms:va(ut),joint:Nt,position:Nt.zeroPosition})})}const At=new Zt;Ni={joints:T&&T.joints,getJointValue:function(kt){const ut=Pt[kt];if(ut)return ut.position;console.warn("THREE.ColladaLoader: Joint "+kt+" doesn't exist.")},setJointValue:function(kt,ut){const Ot=Pt[kt];if(Ot){const Nt=Ot.joint;if(ut>Nt.limits.max||ut<Nt.limits.min)console.warn("THREE.ColladaLoader: Joint "+kt+" value "+ut+" outside of limits (min: "+Nt.limits.min+", max: "+Nt.limits.max+").");else if(Nt.static)console.warn("THREE.ColladaLoader: Joint "+kt+" is static.");else{const Xt=Ot.object,Ht=Nt.axis,Fe=Ot.transforms;H.identity();for(let Te=0;Te<Fe.length;Te++){const xe=Fe[Te];if(xe.sid&&xe.sid.indexOf(kt)!==-1)switch(Nt.type){case"revolute":H.multiply(At.makeRotationAxis(Ht,Ti.degToRad(ut)));break;case"prismatic":H.multiply(At.makeTranslation(Ht.x*ut,Ht.y*ut,Ht.z*ut));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+Nt.type);break}else switch(xe.type){case"matrix":H.multiply(xe.obj);break;case"translate":H.multiply(At.makeTranslation(xe.obj.x,xe.obj.y,xe.obj.z));break;case"scale":H.scale(xe.obj);break;case"rotate":H.multiply(At.makeRotationAxis(xe.obj,xe.angle));break}}Xt.matrix.copy(H),Xt.matrix.decompose(Xt.position,Xt.quaternion,Xt.scale),Pt[kt].position=ut}}else console.log("THREE.ColladaLoader: "+kt+" does not exist.")}}}function va(x){const v=[],R=Ue.querySelector('[id="'+x.id+'"]');for(let T=0;T<R.childNodes.length;T++){const C=R.childNodes[T];if(C.nodeType!==1)continue;let K,it;switch(C.nodeName){case"matrix":K=r(C.textContent);const Pt=new Zt().fromArray(K).transpose();v.push({sid:C.getAttribute("sid"),type:C.nodeName,obj:Pt});break;case"translate":case"scale":K=r(C.textContent),it=new O().fromArray(K),v.push({sid:C.getAttribute("sid"),type:C.nodeName,obj:it});break;case"rotate":K=r(C.textContent),it=new O().fromArray(K);const vt=Ti.degToRad(K[3]);v.push({sid:C.getAttribute("sid"),type:C.nodeName,obj:it,angle:vt});break}}return v}function A(x){const v=x.getElementsByTagName("node");for(let R=0;R<v.length;R++){const T=v[R];T.hasAttribute("id")===!1&&T.setAttribute("id",l())}}const H=new Zt,Y=new O;function $(x){const v={name:x.getAttribute("name")||"",type:x.getAttribute("type"),id:x.getAttribute("id"),sid:x.getAttribute("sid"),matrix:new Zt,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType!==1)continue;let C;switch(T.nodeName){case"node":v.nodes.push(T.getAttribute("id")),$(T);break;case"instance_camera":v.instanceCameras.push(o(T.getAttribute("url")));break;case"instance_controller":v.instanceControllers.push(G(T));break;case"instance_light":v.instanceLights.push(o(T.getAttribute("url")));break;case"instance_geometry":v.instanceGeometries.push(G(T));break;case"instance_node":v.instanceNodes.push(o(T.getAttribute("url")));break;case"matrix":C=r(T.textContent),v.matrix.multiply(H.fromArray(C).transpose()),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"translate":C=r(T.textContent),Y.fromArray(C),v.matrix.multiply(H.makeTranslation(Y.x,Y.y,Y.z)),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"rotate":C=r(T.textContent);const K=Ti.degToRad(C[3]);v.matrix.multiply(H.makeRotationAxis(Y.fromArray(C),K)),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"scale":C=r(T.textContent),v.matrix.scale(Y.fromArray(C)),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"extra":break;default:console.log(T)}}return Vt(v.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",v.id):Jt.nodes[v.id]=v,v}function G(x){const v={id:o(x.getAttribute("url")),materials:{},skeletons:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];switch(T.nodeName){case"bind_material":const C=T.getElementsByTagName("instance_material");for(let K=0;K<C.length;K++){const it=C[K],Pt=it.getAttribute("symbol"),vt=it.getAttribute("target");v.materials[Pt]=o(vt)}break;case"skeleton":v.skeletons.push(o(T.textContent));break}}return v}function pt(x,v){const R=[],T=[];let C,K,it;for(C=0;C<x.length;C++){const At=x[C];let kt;if(Vt(At))kt=le(At),Et(kt,v,R);else if(Ie(At)){const Ot=Jt.visualScenes[At].children;for(let Nt=0;Nt<Ot.length;Nt++){const Xt=Ot[Nt];if(Xt.type==="JOINT"){const Ht=le(Xt.id);Et(Ht,v,R)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",At)}for(C=0;C<v.length;C++)for(K=0;K<R.length;K++)if(it=R[K],it.bone.name===v[C].name){T[C]=it,it.processed=!0;break}for(C=0;C<R.length;C++)it=R[C],it.processed===!1&&(T.push(it),it.processed=!0);const Pt=[],vt=[];for(C=0;C<T.length;C++)it=T[C],Pt.push(it.bone),vt.push(it.boneInverse);return new yl(Pt,vt)}function Et(x,v,R){x.traverse(function(T){if(T.isBone===!0){let C;for(let K=0;K<v.length;K++){const it=v[K];if(it.name===T.name){C=it.boneInverse;break}}C===void 0&&(C=new Zt),R.push({bone:T,boneInverse:C,processed:!1})}})}function It(x){const v=[],R=x.matrix,T=x.nodes,C=x.type,K=x.instanceCameras,it=x.instanceControllers,Pt=x.instanceLights,vt=x.instanceGeometries,At=x.instanceNodes;for(let ut=0,Ot=T.length;ut<Ot;ut++)v.push(le(T[ut]));for(let ut=0,Ot=K.length;ut<Ot;ut++){const Nt=Ct(K[ut]);Nt!==null&&v.push(Nt.clone())}for(let ut=0,Ot=it.length;ut<Ot;ut++){const Nt=it[ut],Xt=Z(Nt.id),Ht=an(Xt.id),Fe=Kt(Ht,Nt.materials),Te=Nt.skeletons,xe=Xt.skin.joints,ye=pt(Te,xe);for(let Hn=0,ln=Fe.length;Hn<ln;Hn++){const Fi=Fe[Hn];Fi.isSkinnedMesh&&(Fi.bind(ye,Xt.skin.bindMatrix),Fi.normalizeSkinWeights()),v.push(Fi)}}for(let ut=0,Ot=Pt.length;ut<Ot;ut++){const Nt=V(Pt[ut]);Nt!==null&&v.push(Nt.clone())}for(let ut=0,Ot=vt.length;ut<Ot;ut++){const Nt=vt[ut],Xt=an(Nt.id),Ht=Kt(Xt,Nt.materials);for(let Fe=0,Te=Ht.length;Fe<Te;Fe++)v.push(Ht[Fe])}for(let ut=0,Ot=At.length;ut<Ot;ut++)v.push(le(At[ut]).clone());let kt;if(T.length===0&&v.length===1)kt=v[0];else{kt=C==="JOINT"?new Jh:new Zn;for(let ut=0;ut<v.length;ut++)kt.add(v[ut])}return kt.name=C==="JOINT"?x.sid:x.name,kt.matrix.copy(R),kt.matrix.decompose(kt.position,kt.quaternion,kt.scale),kt}const Lt=new pi({name:Ln.DEFAULT_MATERIAL_NAME,color:16711935});function $t(x,v){const R=[];for(let T=0,C=x.length;T<C;T++){const K=v[x[T]];K===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",x[T]),R.push(Lt)):R.push(nt(K))}return R}function Kt(x,v){const R=[];for(const T in x){const C=x[T],K=$t(C.materialKeys,v);if(K.length===0&&(T==="lines"||T==="linestrips"?K.push(new fi):K.push(new cn)),T==="lines"||T==="linestrips")for(let At=0,kt=K.length;At<kt;At++){const ut=K[At];if(ut.isMeshPhongMaterial===!0||ut.isMeshLambertMaterial===!0){const Ot=new fi;Ot.color.copy(ut.color),Ot.opacity=ut.opacity,Ot.transparent=ut.transparent,K[At]=Ot}}const it=C.data.attributes.skinIndex!==void 0,Pt=K.length===1?K[0]:K;let vt;switch(T){case"lines":vt=new na(C.data,Pt);break;case"linestrips":vt=new Sl(C.data,Pt);break;case"triangles":case"polylist":it?vt=new ef(C.data,Pt):vt=new be(C.data,Pt);break}R.push(vt)}return R}function Vt(x){return Jt.nodes[x]!==void 0}function le(x){return _(Jt.nodes[x],It)}function Se(x){const v={name:x.getAttribute("name"),children:[]};A(x);const R=n(x,"node");for(let T=0;T<R.length;T++)v.children.push($(R[T]));Jt.visualScenes[x.getAttribute("id")]=v}function De(x){const v=new Zn;v.name=x.name;const R=x.children;for(let T=0;T<R.length;T++){const C=R[T];v.add(le(C.id))}return v}function Ie(x){return Jt.visualScenes[x]!==void 0}function ge(x){return _(Jt.visualScenes[x],De)}function Gt(x){const v=n(x,"instance_visual_scene")[0];return ge(o(v.getAttribute("url")))}function ke(){const x=Jt.clips;if(c(x)===!0){if(c(Jt.animations)===!1){const v=[];for(const R in Jt.animations){const T=S(R);for(let C=0,K=T.length;C<K;C++)v.push(T[C])}Ve.push(new Ec("default",-1,v))}}else for(const v in x)Ve.push(W(v))}function ve(x){let v="";const R=[x];for(;R.length;){const T=R.shift();T.nodeType===Node.TEXT_NODE?v+=T.textContent:(v+=`
4205
+ `,R.push(...T.childNodes))}return v.trim()}if(t.length===0)return{scene:new vl};const on=new DOMParser().parseFromString(t,"application/xml"),Ue=n(on,"COLLADA")[0],Xe=on.getElementsByTagName("parsererror")[0];if(Xe!==void 0){const x=n(Xe,"div")[0];let v;return x?v=x.textContent:v=ve(Xe),console.error(`THREE.ColladaLoader: Failed to parse collada file.
4206
+ `,v),null}const mi=Ue.getAttribute("version");console.debug("THREE.ColladaLoader: File version",mi);const Pe=h(n(Ue,"asset")[0]),en=new wl(this.manager);en.setPath(this.resourcePath||e).setCrossOrigin(this.crossOrigin);let Je;Mh&&(Je=new Mh(this.manager),Je.setPath(this.resourcePath||e));const ze=new qt,Ve=[];let Ni={},Vn=0;const Jt={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};p(Ue,"library_animations","animation",g),p(Ue,"library_animation_clips","animation_clip",z),p(Ue,"library_controllers","controller",at),p(Ue,"library_images","image",Q),p(Ue,"library_effects","effect",ot),p(Ue,"library_materials","material",j),p(Ue,"library_cameras","camera",zt),p(Ue,"library_lights","light",Yt),p(Ue,"library_geometries","geometry",Tt),p(Ue,"library_nodes","node",$),p(Ue,"library_visual_scenes","visual_scene",Se),p(Ue,"library_kinematics_models","kinematics_model",Sn),p(Ue,"library_physics_models","physics_model",Ii),p(Ue,"scene","instance_kinematics_scene",fa),m(Jt.animations,w),m(Jt.clips,tt),m(Jt.controllers,wt),m(Jt.images,et),m(Jt.effects,N),m(Jt.materials,lt),m(Jt.cameras,ct),m(Jt.lights,ie),m(Jt.geometries,ae),m(Jt.visualScenes,De),ke(),_a();const Qs=Gt(n(Ue,"scene")[0]);return Qs.animations=Ve,Pe.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),Qs.rotation.set(-Math.PI/2,0,0)),Qs.scale.multiplyScalar(Pe.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),Ve},kinematics:Ni,library:Jt,scene:Qs}}}const Sh=new O,Q2=new un,Fr=new Zt,li=new Zt,Or=new gn,zr=new O(1,1,1),Br=new O;class da extends Ce{constructor(...t){super(...t),this.urdfNode=null,this.urdfName=""}copy(t,e){return super.copy(t,e),this.urdfNode=t.urdfNode,this.urdfName=t.urdfName,this}}class tg extends da{constructor(...t){super(...t),this.isURDFCollider=!0,this.type="URDFCollider"}}class eg extends da{constructor(...t){super(...t),this.isURDFVisual=!0,this.type="URDFVisual"}}class gu extends da{constructor(...t){super(...t),this.isURDFLink=!0,this.type="URDFLink"}}class _u extends da{get jointType(){return this._jointType}set jointType(t){if(this.jointType!==t)switch(this._jointType=t,this.matrixWorldNeedsUpdate=!0,t){case"fixed":this.jointValue=[];break;case"continuous":case"revolute":case"prismatic":this.jointValue=new Array(1).fill(0);break;case"planar":this.jointValue=new Array(3).fill(0),this.axis=new O(0,0,1);break;case"floating":this.jointValue=new Array(6).fill(0);break}}get angle(){return this.jointValue[0]}constructor(...t){super(...t),this.isURDFJoint=!0,this.type="URDFJoint",this.jointValue=null,this.jointType="fixed",this.axis=new O(1,0,0),this.limit={lower:0,upper:0},this.ignoreLimits=!1,this.origPosition=null,this.origQuaternion=null,this.mimicJoints=[]}copy(t,e){return super.copy(t,e),this.jointType=t.jointType,this.axis=t.axis.clone(),this.limit.lower=t.limit.lower,this.limit.upper=t.limit.upper,this.ignoreLimits=!1,this.jointValue=[...t.jointValue],this.origPosition=t.origPosition?t.origPosition.clone():null,this.origQuaternion=t.origQuaternion?t.origQuaternion.clone():null,this.mimicJoints=[...t.mimicJoints],this}setJointValue(...t){t=t.map(n=>n===null?null:parseFloat(n)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let e=!1;switch(this.mimicJoints.forEach(n=>{e=n.updateFromMimickedJoint(...t)||e}),this.jointType){case"fixed":return e;case"continuous":case"revolute":{let n=t[0];return n==null||n===this.jointValue[0]?e:(!this.ignoreLimits&&this.jointType==="revolute"&&(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.quaternion.setFromAxisAngle(this.axis,n).premultiply(this.origQuaternion),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):e)}case"prismatic":{let n=t[0];return n==null||n===this.jointValue[0]?e:(this.ignoreLimits||(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.position.copy(this.origPosition),Sh.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Sh,n),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):e)}case"floating":return this.jointValue.every((n,i)=>t[i]===n||t[i]===null)?e:(this.jointValue[0]=t[0]!==null?t[0]:this.jointValue[0],this.jointValue[1]=t[1]!==null?t[1]:this.jointValue[1],this.jointValue[2]=t[2]!==null?t[2]:this.jointValue[2],this.jointValue[3]=t[3]!==null?t[3]:this.jointValue[3],this.jointValue[4]=t[4]!==null?t[4]:this.jointValue[4],this.jointValue[5]=t[5]!==null?t[5]:this.jointValue[5],li.compose(this.origPosition,this.origQuaternion,zr),Or.setFromEuler(Q2.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),Br.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),Fr.compose(Br,Or,zr),li.premultiply(Fr),this.position.setFromMatrixPosition(li),this.rotation.setFromRotationMatrix(li),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((n,i)=>t[i]===n||t[i]===null)?e:(this.jointValue[0]=t[0]!==null?t[0]:this.jointValue[0],this.jointValue[1]=t[1]!==null?t[1]:this.jointValue[1],this.jointValue[2]=t[2]!==null?t[2]:this.jointValue[2],li.compose(this.origPosition,this.origQuaternion,zr),Or.setFromAxisAngle(this.axis,this.jointValue[2]),Br.set(this.jointValue[0],this.jointValue[1],0),Fr.compose(Br,Or,zr),li.premultiply(Fr),this.position.setFromMatrixPosition(li),this.rotation.setFromRotationMatrix(li),this.matrixWorldNeedsUpdate=!0,!0)}return e}}class bh extends _u{constructor(...t){super(...t),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...t){const e=t.map(n=>n*this.multiplier+this.offset);return super.setJointValue(...e)}copy(t,e){return super.copy(t,e),this.mimicJoint=t.mimicJoint,this.offset=t.offset,this.multiplier=t.multiplier,this}}class ng extends gu{constructor(...t){super(...t),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(t,e){super.copy(t,e),this.urdfRobotNode=t.urdfRobotNode,this.robotName=t.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(n=>{n.isURDFJoint&&n.urdfName in t.joints&&(this.joints[n.urdfName]=n),n.isURDFLink&&n.urdfName in t.links&&(this.links[n.urdfName]=n),n.isURDFCollider&&n.urdfName in t.colliders&&(this.colliders[n.urdfName]=n),n.isURDFVisual&&n.urdfName in t.visual&&(this.visual[n.urdfName]=n)});for(const n in this.joints)this.joints[n].mimicJoints=this.joints[n].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(t){return this.frames[t]}setJointValue(t,...e){const n=this.joints[t];return n?n.setJointValue(...e):!1}setJointValues(t){let e=!1;for(const n in t){const i=t[n];Array.isArray(i)?e=this.setJointValue(n,...i)||e:e=this.setJointValue(n,i)||e}return e}}const lo=new gn,Eh=new un;function ns(s){return s?s.trim().split(/\s+/g).map(t=>parseFloat(t)):[0,0,0]}function wh(s,t,e=!1){e||s.rotation.set(0,0,0),Eh.set(t[0],t[1],t[2],"ZYX"),lo.setFromEuler(Eh),lo.multiply(s.quaternion),s.quaternion.copy(lo)}class ig{constructor(t){this.manager=t||El,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(t){return new Promise((e,n)=>{this.load(t,e,null,n)})}load(t,e,n,i){const r=this.manager,a=Al.extractUrlBase(t),o=this.manager.resolveURL(t);r.itemStart(o),fetch(o,this.fetchOptions).then(l=>{if(l.ok)return n&&n(null),l.text();throw new Error(`URDFLoader: Failed to load url '${o}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);e(c),r.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),r.itemError(o),r.itemEnd(o)})}parse(t,e=this.workingPath){const n=this.packages,i=this.loadMeshCb,r=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function u(b){if(!/^package:\/\//.test(b))return e?e+b:b;const[w,S]=b.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(w)?n+"/"+S:n+"/"+w+"/"+S;if(n instanceof Function)return n(w)+"/"+S;if(typeof n=="object")return w in n?n[w]+"/"+S:(console.error(`URDFLoader : ${w} not found in provided package list.`),null)}function d(b){let w;b instanceof Document?w=[...b.children]:b instanceof Element?w=[b]:w=[...new DOMParser().parseFromString(b,"text/xml").children];const S=w.filter(I=>I.nodeName==="robot").pop();return p(S)}function p(b){const w=[...b.children],S=w.filter(U=>U.nodeName.toLowerCase()==="link"),I=w.filter(U=>U.nodeName.toLowerCase()==="joint"),L=w.filter(U=>U.nodeName.toLowerCase()==="material"),P=new ng;P.robotName=b.getAttribute("name"),P.urdfRobotNode=b,L.forEach(U=>{const B=U.getAttribute("name");h[B]=g(U)});const D={},M={};S.forEach(U=>{const B=U.getAttribute("name"),k=b.querySelector(`child[link="${B}"]`)===null;l[B]=_(U,D,M,k?P:null)}),I.forEach(U=>{const B=U.getAttribute("name");c[B]=m(U)}),P.joints=c,P.links=l,P.colliders=M,P.visual=D;const y=Object.values(c);return y.forEach(U=>{U instanceof bh&&c[U.mimicJoint].mimicJoints.push(U)}),y.forEach(U=>{const B=new Set,k=q=>{if(B.has(q))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");B.add(q),q.mimicJoints.forEach(J=>{k(J)})};k(U)}),P.frames={...M,...D,...l,...c},P}function m(b){const w=[...b.children],S=b.getAttribute("type");let I;const L=w.find(B=>B.nodeName.toLowerCase()==="mimic");L?(I=new bh,I.mimicJoint=L.getAttribute("joint"),I.multiplier=parseFloat(L.getAttribute("multiplier")||1),I.offset=parseFloat(L.getAttribute("offset")||0)):I=new _u,I.urdfNode=b,I.name=b.getAttribute("name"),I.urdfName=I.name,I.jointType=S;let P=null,D=null,M=[0,0,0],y=[0,0,0];w.forEach(B=>{const k=B.nodeName.toLowerCase();k==="origin"?(M=ns(B.getAttribute("xyz")),y=ns(B.getAttribute("rpy"))):k==="child"?D=l[B.getAttribute("link")]:k==="parent"?P=l[B.getAttribute("link")]:k==="limit"&&(I.limit.lower=parseFloat(B.getAttribute("lower")||I.limit.lower),I.limit.upper=parseFloat(B.getAttribute("upper")||I.limit.upper))}),P.add(I),I.add(D),wh(I,y),I.position.set(M[0],M[1],M[2]);const U=w.filter(B=>B.nodeName.toLowerCase()==="axis")[0];if(U){const B=U.getAttribute("xyz").split(/\s+/g).map(k=>parseFloat(k));I.axis=new O(B[0],B[1],B[2]),I.axis.normalize()}return I}function _(b,w,S,I=null){I===null&&(I=new gu);const L=[...b.children];return I.name=b.getAttribute("name"),I.urdfName=I.name,I.urdfNode=b,r&&L.filter(D=>D.nodeName.toLowerCase()==="visual").forEach(D=>{const M=f(D,h);if(I.add(M),D.hasAttribute("name")){const y=D.getAttribute("name");M.name=y,M.urdfName=y,w[y]=M}}),a&&L.filter(D=>D.nodeName.toLowerCase()==="collision").forEach(D=>{const M=f(D);if(I.add(M),D.hasAttribute("name")){const y=D.getAttribute("name");M.name=y,M.urdfName=y,S[y]=M}}),I}function g(b){const w=[...b.children],S=new cn;return S.name=b.getAttribute("name")||"",w.forEach(I=>{const L=I.nodeName.toLowerCase();if(L==="color"){const P=I.getAttribute("rgba").split(/\s/g).map(D=>parseFloat(D));S.color.setRGB(P[0],P[1],P[2]),S.opacity=P[3],S.transparent=P[3]<1,S.depthWrite=!S.transparent}else if(L==="texture"){const P=I.getAttribute("filename");if(P){const D=new wl(o),M=u(P);S.map=D.load(M),S.map.colorSpace=Me}}}),S}function f(b,w={}){const S=b.nodeName.toLowerCase()==="collision",I=[...b.children];let L=null;const P=I.filter(M=>M.nodeName.toLowerCase()==="material")[0];if(P){const M=P.getAttribute("name");M&&M in w?L=w[M]:L=g(P)}else L=new cn;const D=S?new tg:new eg;return D.urdfNode=b,I.forEach(M=>{const y=M.nodeName.toLowerCase();if(y==="geometry"){const U=M.children[0].nodeName.toLowerCase();if(U==="mesh"){const B=M.children[0].getAttribute("filename"),k=u(B);if(k!==null){const q=M.children[0].getAttribute("scale");if(q){const J=ns(q);D.scale.set(J[0],J[1],J[2])}i(k,o,(J,z)=>{z?console.error("URDFLoader: Error loading mesh.",z):J&&(J instanceof be&&(J.material=L),J.position.set(0,0,0),J.quaternion.identity(),D.add(J))})}}else if(U==="box"){const B=new be;B.geometry=new gs(1,1,1),B.material=L;const k=ns(M.children[0].getAttribute("size"));B.scale.set(k[0],k[1],k[2]),D.add(B)}else if(U==="sphere"){const B=new be;B.geometry=new la(1,30,30),B.material=L;const k=parseFloat(M.children[0].getAttribute("radius"))||0;B.scale.set(k,k,k),D.add(B)}else if(U==="cylinder"){const B=new be;B.geometry=new bl(1,1,1,30),B.material=L;const k=parseFloat(M.children[0].getAttribute("radius"))||0,q=parseFloat(M.children[0].getAttribute("length"))||0;B.scale.set(k,q,k),B.rotation.set(Math.PI/2,0,0),D.add(B)}}else if(y==="origin"){const U=ns(M.getAttribute("xyz")),B=ns(M.getAttribute("rpy"));D.position.set(U[0],U[1],U[2]),D.rotation.set(0,0,0),wh(D,B)}}),D}return d(t)}defaultMeshLoader(t,e,n){/\.stl$/i.test(t)?new Kr(e).load(t,r=>{const a=new be(r,new cn);n(a)}):/\.dae$/i.test(t)?new Z2(e).load(t,r=>n(r.scene)):console.warn(`URDFLoader: Could not load model at ${t}.
4207
+ No loader available`)}}const sg=Ah(ss.pinia),{systemPath:Th}=ss.storeToRefs(sg),kr=Vr.ref();function rg(s,t,e,n,i){const r=async d=>{try{const p=await xu.downloadAvatarApi({url:d});if(p.status!==200)throw new Error(`下载失败: ${p.status}`);return p.data}catch(p){throw console.error("addModelFromUrl失败:",p),p}},a=d=>new Promise((p,m)=>{const _=new FileReader;_.onload=g=>{try{const f=g.target.result,w=new oo().parse(f);w.preload(),p(w)}catch(f){m(f)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(d)}),o=async d=>{const p={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new cn({color:8947848,side:tn}))},getAsArray:function(){const m=[];for(const _ in this.materials)m.push(this.materials[_]);return m},preload:function(){for(const m in this.materials)this.materials[m].map&&(this.materials[m].map.needsUpdate=!0)}};for(const m of d){const _=await a(m);Object.assign(p.materials,_.materials)}return p.preload(),p},l=async(d,p=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async f=>{try{const b=f.target.result;let w=null;p&&p.length>0&&(p.length===1?w=await a(p[0]):w=await o(p));const S=new ao;w&&S.setMaterials(w);const I=S.parse(b);w||I.traverse(L=>{L.isMesh&&(L.material=new cn({color:8947848,side:tn}))}),m(I)}catch(b){_(b)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(d)}),c=async d=>{var p;try{e.value=!0;const{scene:m}=s();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<d.length;g++){const f=d[g];n.value=`正在加载模型 ${g+1}/${d.length}...`;const b=await r(f.objUrl),w=((p=f.objUrl)==null?void 0:p.split("/").pop())||`model_${g}.obj`,S=new File([b],w,{type:b.type});let I=[];if(f.mtlUrls){const P=Array.isArray(f.mtlUrls)?f.mtlUrls:[f.mtlUrls];for(let D=0;D<P.length;D++){const M=P[D],y=await r(M),U=(M==null?void 0:M.split("/").pop())||`material_${g}_${D}.mtl`,B=new File([y],U,{type:y.type});I.push(B)}}const L=await l(S,I);m.add(L),t.value.push(L),_.push(L)}return e.value=!1,_}catch(m){throw console.error("加载模型失败:",m),e.value=!1,m}},h=async(d,p,m=[],_=[])=>{let g;const f=d.toLowerCase();switch(f){case".txt":case".cpt":case".obj":const b=await p.text();if(f===".txt"||f===".cpt"){const ot=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,te=[...b.matchAll(ot)].map(F=>({x:parseFloat(F[1]),y:parseFloat(F[2]),z:parseFloat(F[3])})),ee=new Ne,jt=te.flatMap(F=>[F.x,F.y,F.z]);if(ee.setAttribute("position",new de(jt,3)),f===".txt"){const F=new Ri({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new Os(ee,F)}else if(f===".cpt"){const F=new fi({color:"#5B5C99",linewidth:100});g=new Sl(ee,F)}}else if(f===".obj"){const ot=new ao;if(m&&m.length>0){const gt=new oo;for(const te of m){const ee=await te.text(),jt=gt.parse(ee);jt.preload(),ot.setMaterials(jt);break}}g=ot.parse(b),(!m||m.length===0)&&g.traverse(gt=>{gt.isMesh&&(gt.material=new cn({color:"#B3B3D4"})),gt instanceof be&&(gt.material.side=tn)})}break;case".stl":const w=await p.arrayBuffer(),I=new Kr().parse(w),L=new cn({color:"#B3B3D4",side:tn});g=new be(I,L);break;case".nc":const P=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],D={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},M=new Zn,y=P.map(ot=>new Promise((gt,te)=>{new Kr().load(Th.value===""?`/model/${ot}`:`${Th.value}\\${ot}`,jt=>{const F=new cn({color:D[ot]||"#B3B3D4",side:tn}),_e=new be(jt,F);gt(_e)},void 0,te)}));try{(await Promise.all(y)).forEach(gt=>M.add(gt)),g=M}catch(ot){throw console.error("加载NC文件对应的STL文件失败:",ot),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const U=new J2,B=new Zn;try{const ot=await ss.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),gt=new Blob([ot.data],{type:"application/octet-stream;charset=UTF-8"}),te=await ss.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),ee=new Blob([te.data],{type:"application/octet-stream;charset=UTF-8"}),jt=await new Promise((_e,se)=>{const re=URL.createObjectURL(gt);U.load(re,Mt=>{const ne=new Float32Array(Mt.geometry.attributes.position.count*3);for(let yt=0;yt<Mt.geometry.attributes.position.count;yt++)ne[yt*3]=1,ne[yt*3+1]=0,ne[yt*3+2]=0;Mt.geometry.setAttribute("color",new Oe(ne,3)),Mt.material.vertexColors=!0,Mt.scale.set(.3,.3,.3),URL.revokeObjectURL(re),_e(Mt)},void 0,se)}),F=await new Promise((_e,se)=>{const re=URL.createObjectURL(ee);U.load(re,Mt=>{const ne=new Float32Array(Mt.geometry.attributes.position.count*3);for(let yt=0;yt<Mt.geometry.attributes.position.count;yt++)ne[yt*3]=0,ne[yt*3+1]=1,ne[yt*3+2]=0;Mt.geometry.setAttribute("color",new Oe(ne,3)),Mt.material.vertexColors=!0,Mt.scale.set(.3,.3,.3),URL.revokeObjectURL(re),_e(Mt)},void 0,se)});B.add(jt),B.add(F),g=B}catch(ot){throw console.error("PCD文件加载失败:",ot),new Error("无法加载PCD文件")}break;case".urdf":const k=URL.createObjectURL(p),q=new ig,J="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",z={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},tt=new Map,W=new Map,at=new Map,dt=async ot=>{if(tt.has(ot))return console.log(`从缓存加载: ${ot}`),tt.get(ot);try{const gt=await ss.axios.get(`${J}/${ot}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),te=new Blob([gt.data],{type:"application/octet-stream;charset=UTF-8"});return z.enableCache&&tt.set(ot,te),te}catch(gt){throw console.error(`加载文件失败: ${ot}`,gt),new Error(`无法加载文件: ${ot}`)}},mt=(ot="default")=>{if(W.has(ot))return W.get(ot);const gt=new cn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Cn});return W.set(ot,gt),gt},Rt=ot=>{try{ot.isBufferGeometry&&ot.mergeVertices&&ot.mergeVertices(),ot.computeVertexNormals&&ot.computeVertexNormals(),ot.computeBoundingSphere&&ot.computeBoundingSphere(),ot.deleteAttribute&&ot.deleteAttribute("uv2")}catch(gt){console.warn("几何体优化失败,使用原始几何体:",gt)}return ot},wt=async(ot,gt,te)=>{const ee=`stl_${gt}`;if(at.has(ee)){const se=at.get(ee);return new be(se,mt())}const jt=await ot.arrayBuffer();let _e=new Kr(te).parse(jt);return _e=Rt(_e),at.set(ee,_e),new be(_e,mt())},X=async(ot,gt,te)=>{const ee=`obj_${gt}`;if(tt.has(ee))return tt.get(ee).clone();const jt=await ot.text(),F=new ao(te),_e=gt.replace(".obj",".mtl");try{const Mt=await(await dt(_e)).text(),yt=new oo(te).parse(Mt);yt.preload(),F.setMaterials(yt)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${_e}`)}const se=F.parse(jt);return se.traverse(re=>{re.isMesh&&(re.geometry=Rt(re.geometry),re.castShadow=!0,re.receiveShadow=!0,re.renderOrder=1)}),tt.set(ee,se),se},Z=(ot,gt)=>{const te=new Qd;if(te.addLevel(ot,0),ot.geometry){const ee=ot.geometry.clone(),jt=new be(ee,ot.material);te.addLevel(jt,50)}return te};let Q=0,et=0;const _t=[];q.loadMeshCb=async(ot,gt,te,ee,jt)=>{const F=ot.split("/").pop(),_e=te||(()=>{}),se=jt||(()=>{});Q++;const re=new Promise(async(Mt,ne)=>{try{const yt=await dt(F);if(!yt||yt.size===0)throw new Error(`文件为空: ${F}`);const oe=F.split(".").pop().toLowerCase();let Ee;switch(oe){case"stl":Ee=await wt(yt,F,gt);break;case"obj":Ee=await X(yt,F,gt);break;default:throw new Error(`不支持的文件格式: ${oe}`)}z.enableLOD&&Ee.isMesh&&(Ee=Z(Ee,F)),_e(Ee),et++,ee&&ee({loaded:et,total:Q,progress:et/Q}),Mt(Ee)}catch(yt){console.error(`mesh文件加载失败: ${F}`,yt),se(yt),ne(yt)}});_t.push(re)};try{if(!k){kr.value=void 0;break}if(g=await q.loadAsync(k),console.log(`URDF文件加载完成,等待${Q}个mesh文件加载...`),_t.length>0)try{await Promise.allSettled(_t),console.log(`所有mesh文件处理完成,成功加载: ${et}/${Q}`)}catch(ot){console.warn("部分mesh文件加载失败,但继续显示模型",ot)}g.traverse(ot=>{ot.isMesh&&(ot.castShadow=!0,ot.receiveShadow=!0,ot.renderOrder=1,ot.material&&(ot.material.needsUpdate=!0))}),kr.value=g,console.log("URDF模型加载完成并优化")}catch(ot){console.error("URDF加载失败:",ot),kr.value=void 0}finally{k&&URL.revokeObjectURL(k)}break;default:throw new Error(`不支持的文件格式: ${d}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async d=>{console.log(d);try{e.value=!0,n.value="正在加载模型...";const{scene:p}=s();if(!p)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<d.length;_++){const g=d[_],f=await h(g.suffix,g.blob,g.mtlBlobs||[],g.meshFiles||[]);f&&(p.add(f),t.value.push(f),m.push(f))}return e.value=!1,n.value="",m}catch(p){throw console.error("加载模型失败:",p),e.value=!1,n.value="",p}},urdfModel:kr}}const ag=Vr.defineComponent({name:"SvgIcon",props:{prefix:{type:String,default:"icon"},name:{type:String,required:!0},size:{type:[Number,String],default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(s){const t=Vr.computed(()=>`#${s.prefix}-${s.name}`),e=Vr.computed(()=>{const{size:n}=s;let i=`${n}`;return i=`${i.replace("px","")}px`,{width:i,height:i}});return{symbolId:t,getStyle:e}}});window._iconfont_svg_string_4634042='<svg><symbol id="icon-donghuafangzhen" viewBox="0 0 1024 1024"><path d="M868.864 228.864c-19.968 0-38.912 7.68-53.248 20.992l-291.328-170.496c-7.168-5.12-16.896-5.12-24.064 0L208.896 248.832c-14.336-12.8-33.28-20.48-53.76-20.48-43.52 0-79.872 36.864-79.872 80.896 0 33.792 21.504 63.488 53.248 74.24v318.976c0 9.216 4.608 17.408 12.288 22.016L437.248 896c11.776 30.72 41.472 51.712 74.752 52.224 33.28-0.512 62.464-20.992 74.752-52.224l296.448-171.52c7.68-4.608 12.288-13.312 12.288-22.016V386.048c31.744-11.776 53.248-42.496 53.248-76.288 0-44.032-36.352-80.896-79.872-80.896zM155.136 339.456c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 15.872-12.8 28.672-29.184 29.184zM512 897.024c-16.896 0-29.184-12.288-29.184-29.696 0-14.848 12.288-29.696 29.184-29.696h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 14.848-14.848 29.696-29.184 29.696z m74.752-58.368c-11.776-30.208-40.96-51.712-74.752-51.712-27.136 0-52.224 14.336-67.072 37.376l-3.072 1.024c-4.608 2.048-8.704 5.632-9.728 10.752l-252.416-146.944V384.512C212.48 373.76 234.496 343.04 235.52 308.736l3.072 0.512h2.048c3.584 0 7.168-1.536 10.24-3.584 7.168-5.632 8.192-16.384 2.048-23.552L512 130.56l278.528 162.816c-7.68 36.864 11.264 74.24 45.568 90.624 0.512 5.632 3.584 10.24 8.704 13.312v291.328l-258.048 150.016z m282.112-499.2c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696v2.56c-1.024 14.848-13.824 27.136-29.184 26.624z" fill="#AAAAAA" ></path><path d="M422.912 724.992c-3.072-8.704-12.288-12.8-20.992-9.728-8.704 3.072-12.8 12.8-9.728 21.504l19.968 54.784c2.56 6.656 8.192 10.752 15.36 10.752 2.048 0 3.584-0.512 5.12-1.024 8.704-3.072 12.8-12.8 9.728-21.504l-19.456-54.784zM706.048 507.392c0-107.52-86.016-195.072-192-196.096-2.048-1.536-4.608-2.56-7.68-3.072l-24.064-3.072c-8.192-1.024-15.872 4.096-17.92 11.776-5.632 1.536-11.776 3.584-16.896 5.632 0.512-1.536 1.024-3.072 1.536-5.12 1.024-9.216-5.12-17.408-14.336-18.432l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.608 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l44.032 5.12C384 353.28 351.232 388.608 333.312 432.64c-25.088 60.928-17.92 130.048 18.432 184.832-1.024 3.584-1.024 7.168 0.512 10.24l19.968 54.784c1.024 3.072 3.072 5.632 6.144 7.68 7.168 5.12 17.408 3.072 22.528-4.096 3.072-4.608 3.584-10.24 2.048-15.36l-0.512-1.536c53.76 37.888 123.392 45.568 184.32 19.968 46.08-19.456 82.944-55.808 102.912-101.376l12.8-14.336c6.144-6.656 5.632-17.408-0.512-23.04 2.56-14.336 4.096-28.672 4.096-43.008z m-193.536 156.16C427.52 663.552 358.4 593.92 358.4 507.392c0-86.016 69.12-156.16 154.112-156.16s154.112 69.632 154.112 156.16c0 86.016-69.12 156.16-154.112 156.16z" fill="#72B02D" ></path><path d="M765.44 478.72c-6.144-5.632-15.872-5.632-22.016 0l-32.256 35.84c-4.096 4.608-5.632 11.776-3.072 17.92 2.56 6.144 8.192 9.728 14.848 9.728 4.608 0 8.704-2.048 11.776-5.12l32.256-35.84c5.12-7.168 4.608-16.896-1.536-22.528zM823.296 401.92c-5.632-1.024-11.776 0.512-15.872 5.12l-32.256 35.84c-4.608 4.608-5.632 11.776-3.072 17.92 1.024 2.048 2.56 4.096 4.096 5.632 6.656 6.144 16.896 5.632 23.04-1.536l32.256-35.84c4.096-4.096 5.632-10.752 3.584-16.384-1.024-5.632-5.632-9.728-11.776-10.752zM336.384 321.024c8.704 0 15.872-6.656 16.384-15.36 0.512-8.704-5.632-16.384-14.336-17.408l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.096 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l48.128 5.632h2.048z" fill="#72B02D" ></path></symbol><symbol id="icon-guanjianjiexi" viewBox="0 0 1024 1024"><path d="M298.496 200.704v83.456h-39.936v177.664h137.728V389.12h47.104v245.76h-47.104v-79.872H211.456c-10.752-3.584-54.272-14.336-54.272-57.856V280.064h-32.768V200.704h174.08m47.104-47.104H77.824v177.152h36.352v169.984c0 68.608 61.44 97.792 97.792 104.96H353.28v79.872h141.312V342.016H349.184v72.192h-43.52v-87.04h39.936V153.6zM627.712 389.12v79.872H812.544c10.752 3.584 54.272 14.336 54.272 54.272V740.352h32.768v83.456h-173.568v-83.456h39.936v-177.664h-137.728V634.88h-47.104V389.12h46.592m47.104-47.104h-141.312v340.48h141.312v-72.192h43.52v83.456h-39.936V870.4h267.776v-177.152h-36.352v-169.984c0-68.608-61.44-97.792-97.792-104.96H670.72V342.528h4.096z" fill="#AAAAAA" ></path></symbol><symbol id="icon-gongyishengcheng" viewBox="0 0 1024 1024"><path d="M889.344 391.68h29.696v-43.008h-208.896l1.024 45.056 28.16 3.072v20.992c55.808 5.632 108.032 28.672 150.016 66.56-0.512 0 0-92.672 0-92.672z m-366.592 102.912c13.312-13.312 27.648-24.576 43.008-34.816-2.048-70.144-5.632-153.088-8.704-179.712-5.632-48.64-34.816-204.288-226.816-202.752-191.488 1.536-223.744 164.864-230.912 207.36s-11.776 197.632-11.776 197.632h-24.576v43.008l208.896 1.024v-40.96h-24.064V316.928S245.76 230.912 335.36 231.424C424.448 232.448 415.232 327.68 414.72 327.68v313.856c4.608 0 6.144 77.824 50.176 144.896-13.312-32.256-20.48-67.072-20.48-102.912 0-71.168 27.648-138.24 78.336-188.928z" fill="#AAAAAA" ></path><path d="M75.264 601.6h31.232v281.088s41.984 29.184 141.824 0v-274.944l29.184-2.56v-44.032H75.264v40.448zM906.24 263.168h-29.184l1.024-188.416s-53.76-27.648-144.384 0l1.024 192-31.744 1.024V307.2h203.776l-0.512-44.032z" fill="#AAAAAA" ></path><path d="M934.912 627.712c-9.216-4.608-20.48-2.048-29.184 6.656l-21.504 21.504c-9.216 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l21.504-21.504c8.704-8.704 11.264-19.968 6.656-29.184-5.632-10.752-18.432-15.36-34.304-13.312-25.6 4.096-48.64 15.36-66.56 33.792-27.136 27.136-39.424 65.536-33.792 103.936l-178.176 178.176c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l178.176-178.176c37.888 6.144 76.288-6.656 103.936-33.792 17.92-17.92 29.696-41.472 33.792-66.56 2.048-15.872-2.56-28.672-13.312-34.304z m-9.728 30.72c-3.072 20.48-12.8 38.912-27.136 53.76-23.04 23.04-56.32 33.28-89.088 26.624l-6.144-1.536-186.88 186.88c-8.704 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l186.88-186.88-1.536-6.144c-6.656-32.256 3.072-65.536 26.624-89.088 14.848-14.848 33.28-24.064 53.76-27.136 1.536-0.512 3.072-0.512 4.608-0.512 2.56 0 4.608 0.512 5.12 1.024-0.512 0.512-1.024 1.536-2.048 2.56l-21.504 21.504c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l21.504-21.504c1.024-1.024 2.048-1.536 2.56-2.048 0.512 1.536 1.024 4.608 0.512 9.728z" fill="#72B02D" ></path><path d="M560.64 870.912c-12.8 12.8-12.8 33.28 0 45.568 6.144 6.144 14.336 9.216 23.04 9.216s16.896-3.072 23.04-9.216c6.144-6.144 9.728-14.336 9.728-23.04 0-8.704-3.584-16.896-9.728-23.04-12.8-12.288-33.792-12.288-46.08 0.512z m28.672 28.672c-3.072 3.072-8.704 3.072-11.776 0-3.072-3.072-3.072-8.704 0-11.776 1.536-1.536 3.584-2.56 6.144-2.56 2.048 0 4.096 1.024 6.144 2.56 1.536 1.536 2.56 3.584 2.56 6.144-0.512 2.048-1.536 4.096-3.072 5.632z m225.28-107.008c-4.096-4.096-10.24-4.096-14.336 0l-43.52 43.52c-4.096 4.096-4.096 10.24 0 14.336l102.4 102.4c15.872 15.872 41.984 15.872 57.856 0 15.872-15.872 15.872-41.984 0-57.856l-102.4-102.4z m-237.056-150.528l70.656 70.656 28.672-28.672-70.656-70.656-15.872-30.208-50.688-36.352-28.672 28.672 36.352 50.688 30.208 15.872z" fill="#72B02D" ></path></symbol><symbol id="icon-mojupipei" viewBox="0 0 1024 1024"><path d="M880.64 117.248c32.768 0 58.88 23.04 64.512 54.784l1.024 7.68v663.04c0.512 31.744-22.528 58.368-53.76 62.464l-7.68 1.024H151.552c-34.816 0-66.048-22.528-72.192-53.248l-1.024-6.656V183.296c0-31.744 27.648-59.904 61.952-65.024l7.168-1.024h142.848c24.064 0 44.032 16.896 48.64 39.936l1.024 6.656V406.528c0 7.68 5.12 14.848 12.288 16.896l3.584 0.512H424.96c13.312 0 25.088 9.216 29.184 22.528 6.144 23.552 33.792 46.08 58.368 46.08 22.528 0 48.128-19.456 55.808-39.424l2.048-5.632c2.048-10.24 9.216-18.432 19.456-21.504l5.12-1.024 3.072-0.512h71.168c6.144 0 11.776-3.584 14.336-9.728l1.024-3.584V164.864c0-23.04 15.872-41.984 37.888-46.592l6.144-1.024H880.64zM273.92 184.32H151.552l-2.048 0.512-2.048 0.512-2.56 1.536-1.536 649.728 3.072 1.536 3.072 1.024h1.024l328.192 3.072 2.048-286.72-2.048-0.512-10.24-3.584c-24.576-10.24-45.568-27.136-60.928-49.152l-6.144-9.216 1.024-1.536H349.184c-37.888-4.096-68.608-33.792-74.24-71.68l-1.024-8.192v-4.096V184.32z m476.16-3.072V409.6l-0.512 8.704c-3.584 36.864-32.256 66.56-68.608 72.192l-8.192 1.024h-4.096l-45.568-1.536-6.144 9.728c-14.848 22.528-36.352 40.448-61.44 51.2l-10.752 4.096-3.072 284.16h337.408v-655.36l-129.024-2.56z" fill="#AAAAAA" ></path></symbol><symbol id="icon-buchangshezhi" viewBox="0 0 1024 1024"><path d="M792.576 75.264h-686.08c-17.408 0-31.232 13.824-31.232 31.232v686.08c0 17.408 13.824 31.232 31.232 31.232h436.736c17.408 0 31.232-13.824 31.232-31.232s-13.824-31.232-31.232-31.232H137.728V262.656h624.128v280.576c0 17.408 13.824 31.232 31.232 31.232s31.232-13.824 31.232-31.232V106.496c-0.512-17.408-14.336-31.232-31.744-31.232z" fill="#AAAAAA" ></path><path d="M792.576 948.736c-17.408 0-31.232-13.824-31.232-31.232v-93.696h-93.696c-17.408 0-31.232-13.824-31.232-31.232 0-17.408 13.824-31.232 31.232-31.232h93.696v-93.696c0-17.408 13.824-31.232 31.232-31.232 17.408 0 31.232 13.824 31.232 31.232v93.696h93.696c17.408 0 31.232 13.824 31.232 31.232 0 17.408-13.824 31.232-31.232 31.232h-93.696v93.696c0 17.408-13.824 31.232-31.232 31.232z" fill="#72B02D" ></path><path d="M372.224 518.144l-110.08 110.08c-20.992 20.992-20.992 55.296 0 76.288s55.296 20.992 76.288 0l110.08-110.08c-16.896-6.144-32.768-15.872-46.592-29.696-13.824-13.312-23.552-29.696-29.696-46.592z m-57.856 162.304c-7.68 7.68-20.48 7.68-28.672 0-7.68-7.68-7.68-20.48 0-28.672 7.68-7.68 20.48-7.68 28.672 0 7.68 8.192 7.68 20.992 0 28.672z m340.48-292.864L592.384 450.56c-20.992 20.992-55.296 20.992-76.288 0s-20.992-55.296 0-76.288l62.976-62.976c-51.712-8.704-116.224 14.848-151.552 50.176-49.152 49.152-49.152 128.512 0 177.664s129.024 49.152 177.664 0c35.328-35.328 58.368-99.84 49.664-151.552z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shuchujiagongchengxu" viewBox="0 0 1024 1024"><path d="M876.544 473.6v374.272c0 16.384-13.312 29.696-29.696 29.696h-522.24c-16.384 0-29.696-13.312-29.696-29.696V503.296c0-16.384 13.312-29.696 29.696-29.696h551.936m40.96-70.656H253.952c-16.384 0-29.696 13.312-29.696 29.696v486.4c0 16.384 13.312 29.696 29.696 29.696h663.552c16.384 0 29.696-13.312 29.696-29.696v-486.4c0-16.384-13.312-29.696-29.696-29.696z" fill="#AAAAAA" ></path><path d="M489.984 211.968H814.08l-41.984-41.984c-13.824-13.824-13.824-36.352 0-50.176 13.824-13.824 36.352-13.824 50.176 0L947.712 245.76l-0.512 0.512 0.512 0.512-125.952 125.952c-13.824 13.824-36.352 13.824-50.176 0-13.824-13.824-13.824-36.352 0-50.176l38.912-38.912H489.472c-19.456 0-35.328-15.872-35.328-35.328 0.512-20.48 16.384-36.352 35.84-36.352z" fill="#72B02D" ></path><path d="M531.456 717.824c0-11.776-7.68-22.016-18.944-25.6l-55.808-16.896-14.848-4.608 14.848-4.608 55.808-16.896c11.264-3.584 18.944-13.824 18.944-25.6v-2.048c0-18.432-17.92-31.232-35.328-25.088L363.52 641.024c-10.752 3.584-17.92 13.824-17.92 25.088v8.192c0 11.264 7.168 21.504 17.92 25.088l132.608 45.568c17.408 6.144 35.328-7.168 35.328-25.088v-2.048z m123.392-96.768v2.048c0 11.776 7.68 22.016 18.944 25.6l56.32 16.896 14.848 4.608-14.848 4.608-56.32 16.896c-11.264 3.584-18.944 13.824-18.944 25.6v2.56c0 18.432 17.92 31.232 35.328 25.088l132.608-45.568c10.752-3.584 17.92-13.824 17.92-25.088v-8.192c0-11.264-7.168-21.504-17.92-25.088l-132.608-45.568c-17.408-6.144-35.328 7.168-35.328 25.6z m-54.784-64l-70.144 248.32c-4.608 16.896 8.192 33.792 25.6 33.792 11.776 0 22.528-8.192 25.6-19.456l70.144-248.32c4.608-16.896-8.192-33.792-25.6-33.792-11.776 0-22.016 8.192-25.6 19.456zM147.456 814.08V173.056c0-14.848 11.776-26.624 26.624-26.624h463.872c19.456 0 35.328-15.872 35.328-35.328 0-19.456-15.872-35.328-35.328-35.328H107.008c-16.896 0-30.72 13.824-30.72 30.72v748.032c0 16.896 13.824 30.72 30.72 30.72h40.448c19.456 0 35.328-15.872 35.328-35.328 0.512-19.968-15.36-35.84-35.328-35.84z" fill="#AAAAAA" ></path></symbol><symbol id="icon-guanjiekongzhi" viewBox="0 0 1024 1024"><path d="M648.192 377.344h-71.68c-18.432 0-33.792-14.848-33.792-33.792H366.592c12.288-30.72 25.088-80.896 0-134.656H542.72c0-18.432 15.36-33.792 33.792-33.792h67.584c1.536 0 2.56 0 4.096 0.512L719.36 87.04c10.752-13.312 29.184-16.384 44.032-7.68l168.96 100.864c15.872 9.728 20.992 30.208 11.776 46.08-9.728 15.872-30.208 20.992-46.592 11.264l-143.872-85.504L677.888 245.76v61.44l75.776 93.696 143.872-85.504c15.872-9.728 36.864-4.608 46.592 11.776 9.728 15.872 4.608 36.352-11.264 46.08h-0.512l-168.96 100.864c-14.336 8.704-33.28 5.12-44.032-7.68l-71.168-89.088zM319.488 780.8L102.912 415.744c76.8 69.632 185.344 48.64 231.424-13.312l222.72 378.368H711.68c18.432 0 33.792 14.848 33.792 33.792v100.864c0 18.432-15.36 33.792-33.792 33.792H170.496c-18.432 0-33.792-14.848-33.792-33.792v-100.864c0-18.432 15.36-33.792 33.792-33.792h148.992z" fill="#AAAAAA" ></path><path d="M204.288 148.48C133.12 148.48 75.264 205.824 75.264 276.48S133.12 404.48 204.288 404.48c71.168 0 129.024-57.344 129.024-128S275.456 148.48 204.288 148.48z m0 202.752c-41.472 0-74.752-33.28-74.752-74.752 0-40.96 33.792-74.24 74.752-74.24C245.76 202.24 279.04 235.52 279.04 276.48c0 41.472-33.792 75.264-74.752 74.752z" fill="#72B02D" ></path></symbol><symbol id="icon-jiegoushu" viewBox="0 0 1024 1024"><path d="M233.984 472.064h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44v238.08h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V233.984h-39.936c-22.016 0-39.936-17.92-39.936-39.936V115.2c0-22.016 17.92-39.936 39.936-39.936h158.72c22.016 0 39.936 17.92 39.936 39.936V194.56c0 22.016-17.92 39.936-39.936 39.936h-39.936v237.568z" fill="#AAAAAA" ></path><path d="M551.936 75.264h317.44c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V154.624c-0.512-44.032 35.328-79.36 79.36-79.36z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaitui" viewBox="0 0 1024 1024"><path d="M512 148.992c199.68 0 361.984 162.304 361.984 361.984S711.68 872.448 512 872.448s-361.984-162.304-361.984-361.984S312.32 148.992 512 148.992m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M670.72 456.192v109.056l-75.264-54.784L670.72 456.192m25.6-102.912c-10.24 0-20.992 3.072-30.208 10.24l-144.896 105.472c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-52.224-52.224z" fill="#72B02D" ></path><path d="M499.712 456.192v109.056L424.96 510.976l74.752-54.784m26.112-102.912c-10.24 0-20.992 3.072-30.208 10.24L350.208 468.992c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-51.712-52.224z" fill="#72B02D" ></path><path d="M314.368 381.44c-21.504 0-38.912 17.408-38.912 38.912v181.248c0 21.504 17.408 38.912 38.912 38.912s38.912-17.408 38.912-38.912V420.352c0-21.504-17.408-38.912-38.912-38.912z" fill="#72B02D" ></path></symbol><symbol id="icon-bofang" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M491.008 445.952l115.712 66.048-115.712 66.048V445.952m-23.552-87.04c-24.576 0-46.592 19.456-46.592 46.592v212.48c0 27.136 22.528 46.592 46.592 46.592 7.68 0 15.36-2.048 23.04-6.144l185.856-106.496c31.232-17.92 31.232-62.976 0-80.896L490.496 365.056c-7.168-4.096-15.36-6.144-23.04-6.144z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaijin" viewBox="0 0 1024 1024"><path d="M515.584 151.04c199.168 0 360.96 161.792 360.96 360.96s-161.792 360.96-360.96 360.96-360.96-161.792-360.96-360.96 161.792-360.96 360.96-360.96m0-74.752c-240.64 0-435.712 195.072-435.712 435.712s195.072 435.712 435.712 435.712 435.712-195.072 435.712-435.712-195.072-435.712-435.712-435.712z" fill="#AAAAAA" ></path><path d="M358.912 458.24L433.152 512l-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432L363.52 366.592c-9.216-6.656-19.456-9.728-29.696-9.728z" fill="#72B02D" ></path><path d="M527.36 458.24l74.24 53.76-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432l-142.848-103.936c-9.216-7.168-19.968-10.24-29.696-10.24z" fill="#72B02D" ></path><path d="M710.144 384.512c-20.992 0-38.4 17.408-38.4 38.4v178.688c0 20.992 17.408 38.4 38.4 38.4s38.4-17.408 38.4-38.4V422.912c0-21.504-17.408-38.4-38.4-38.4z" fill="#72B02D" ></path></symbol><symbol id="icon-zanting" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M416.768 353.28c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c-0.512-21.504-17.92-39.424-39.936-39.424z m190.464 0c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c0-21.504-17.92-39.424-39.936-39.424z" fill="#72B02D" ></path></symbol><symbol id="icon-zhongzhi" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M580.096 421.376c12.288 0 22.528 10.24 22.528 22.528v136.192c0 12.288-10.24 22.528-22.528 22.528H443.904c-12.288 0-22.528-10.24-22.528-22.528V443.904c0-12.288 10.24-22.528 22.528-22.528h136.192m0-68.096H443.904C393.728 353.28 353.28 393.728 353.28 443.904v136.192c0 50.176 40.448 90.624 90.624 90.624h136.192c50.176 0 90.624-40.448 90.624-90.624V443.904c0-50.176-40.448-90.624-90.624-90.624z" fill="#72B02D" ></path></symbol><symbol id="icon-suoxiao" viewBox="0 0 1024 1024"><path d="M491.008 463.36c32.256 0 58.88-26.112 58.88-58.88s-26.112-58.88-58.88-58.88H285.696c-32.256 0-58.88 26.112-58.88 58.88s26.112 58.88 58.88 58.88h205.312z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848 13.312 0 26.112-5.12 36.352-14.848 19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangda" viewBox="0 0 1024 1024"><path d="M488.96 333.824h-47.104V286.72c0-34.816-28.16-62.976-62.976-62.976-34.816 0-62.976 28.16-62.976 62.976v47.104h-47.104c-34.816 0-62.976 28.16-62.976 62.976s28.16 62.976 62.976 62.976h47.104V506.88c0 34.816 28.16 62.976 62.976 62.976 34.816 0 62.976-28.16 62.976-62.976v-47.104h47.104c34.816 0 62.976-28.16 62.976-62.976 0-34.304-28.16-62.976-62.976-62.976z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangdazhichuangkou" viewBox="0 0 1024 1024"><path d="M949.248 858.624l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 142.848-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.616-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-96.768 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M216.576 919.04h109.056v-102.912H216.576c-29.696 0-53.76-24.064-53.76-53.76V233.984c0-29.696 24.064-53.76 53.76-53.76H798.72c29.696 0 53.76 24.064 53.76 53.76v81.92h102.912v-81.92c0-86.528-70.144-156.672-156.672-156.672H216.576c-86.528 0-156.672 70.144-156.672 156.672v528.384c0 86.528 70.144 156.672 156.672 156.672z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shiyingpingmu" viewBox="0 0 1024 1024"><path d="M876.032 75.264H147.968c-39.936 0-72.704 32.768-72.704 72.704v728.064c0 39.936 32.768 72.704 72.704 72.704h728.064c39.936 0 72.704-32.768 72.704-72.704V147.968c0-39.936-32.768-72.704-72.704-72.704z m0 764.416c0 22.016-14.336 36.352-36.352 36.352H184.32c-22.016 0-36.352-14.336-36.352-36.352V184.32c0-22.016 14.336-36.352 36.352-36.352h655.36c22.016 0 36.352 14.336 36.352 36.352v655.36z" fill="#AAAAAA" ></path><path d="M329.728 184.32H220.672c-3.584 0-10.752 0-14.336 3.584-7.168 3.584-14.336 10.752-18.432 18.432-3.584 3.584-3.584 10.752-3.584 14.336v109.056c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352v-22.016l47.104 47.104c7.168 7.168 14.336 10.752 25.6 10.752 10.752 0 18.432-3.584 25.6-10.752 14.336-14.336 14.336-36.352 0-51.2l-47.104-47.104h22.016c22.016 0 36.352-14.336 36.352-36.352 0-21.504-14.848-35.84-36.864-35.84zM329.728 766.976h-22.016l47.104-47.104c14.336-14.336 14.336-36.352 0-51.2-14.336-14.336-36.352-14.336-51.2 0l-47.104 47.104v-22.016c0-22.016-14.336-36.352-36.352-36.352s-36.352 14.336-36.352 36.352v109.056c0 3.584 0 10.752 3.584 14.336 3.584 7.168 10.752 14.336 18.432 18.432 3.584 3.584 10.752 3.584 14.336 3.584h109.056c22.016 0 36.352-14.336 36.352-36.352s-13.824-35.84-35.84-35.84zM817.664 187.904c-3.584-3.584-10.752-3.584-14.336-3.584h-109.056c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h22.016l-47.104 47.104c-14.336 14.336-14.336 36.352 0 51.2 7.168 7.168 14.336 10.752 25.6 10.752s18.432-3.584 25.6-10.752l47.104-47.104v22.016c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352V220.672c0-3.584 0-10.752-3.584-14.336-4.096-7.68-11.264-14.848-18.944-18.432zM803.328 657.408c-22.016 0-36.352 14.336-36.352 36.352v22.016l-47.104-47.104c-14.336-14.336-36.352-14.336-51.2 0-14.336 14.336-14.336 36.352 0 51.2l47.104 47.104h-22.016c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h109.056c3.584 0 10.752 0 14.336-3.584 7.168-3.584 14.336-10.752 18.432-18.432 3.584-3.584 3.584-10.752 3.584-14.336v-109.056c0.512-22.016-13.824-36.864-35.84-36.864z" fill="#72B02D" ></path></symbol><symbol id="icon-yangshitu-01" viewBox="0 0 1024 1024"><path d="M645.632 882.688H150.528l252.928-204.8 477.696 0.512z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512z m-542.72 23.552H880.64l-234.496 203.264-228.864 0.512V140.8z m0 247.296l217.088-0.512-1.024 247.296H417.28V388.096z m-43.008-223.744v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m532.48 493.568H150.528l252.928-204.288 477.696 0.512-235.52 203.776z m271.36-247.808h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-zuoshitu-01" viewBox="0 0 1024 1024"><path d="M374.272 644.096l-262.656 211.968L112.64 373.76l261.632-209.408z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM112.64 373.76l261.632-209.408v479.744l-263.168 211.968L112.64 373.76z m520.192 507.904l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-qianshitu-01" viewBox="0 0 1024 1024"><path d="M112.64 389.12h520.704v493.056H112.64z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m259.584 717.824H112.64V389.12h520.704v493.056z m12.288-537.6l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-youshitu-01" viewBox="0 0 1024 1024"><path d="M916.992 659.456l-239.616 196.096V375.808l239.616-208.896z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m270.848 314.88l-239.104 196.096V375.808l239.104-208.896v492.544z" fill="#AAAAAA" ></path></symbol><symbol id="icon-houshitu-01" viewBox="0 0 1024 1024"><path d="M960 118.784V117.76v-1.024-1.024-1.024-0.512-0.512c1.536 7.68-1.024 15.872-6.656 20.992L677.376 373.76v299.52h-43.008V389.12H374.272v254.976l-262.656 211.968L112.64 389.12l261.632-0.512v-42.496h269.824l280.064-243.2c3.072-2.56 6.656-4.096 10.752-5.12H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c-0.512 0.512-0.512 1.024-1.024 2.048 0 0.512 0 0.512-0.512 1.024 0 0.512 0 0.512-0.512 1.024 0 0.512 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V907.264c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024c0 0.512 0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024s0 0.512 0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-242.176 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V658.944v-2.048V118.272c1.536 1.024 1.536 1.024 1.536 0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m258.56 717.312l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m44.544-26.112v-177.664H880.64l-203.264 177.664z m281.6-741.376v-0.512-0.512 1.024z" fill="#AAAAAA" ></path><path d="M916.992 634.88h-239.616V375.808l239.616-211.456zM644.096 346.112H417.28V141.824h462.336zM417.28 389.12H634.88v245.76H417.28z" fill="#72B02D" ></path><path d="M958.976 114.176c0 0.512 0.512 0.512 0 0z m-20.48-16.384H945.152l0.512 0.512 0.512 0.512h1.024l0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512c0 0.512 0.512 0.512 0.512 1.024s0 0.512 0.512 0.512c0 0.512 0.512 1.024 0.512 1.536 0 0.512 0.512 1.024 0.512 1.024-3.072-10.24-13.312-16.896-24.064-14.848h4.608v1.024z" fill="#C1272D" ></path></symbol><symbol id="icon-dingshitu-01" viewBox="0 0 1024 1024"><path d="M880.64 140.8l-234.496 203.776-497.664 1.536 256-206.336z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-497.664 1.536 256-205.824 476.16 1.024-234.496 203.264z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-toushitu-01" viewBox="0 0 1024 1024"><path d="M965.632 114.176V112.64v-1.024-0.512-1.024-0.512s0-0.512-0.512-1.024v-0.512c-0.512-1.024-0.512-2.048-1.024-3.072v-0.512c0-0.512-0.512-0.512-0.512-1.024s0-0.512-0.512-0.512l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512s-0.512-1.024-1.024-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024s-0.512 0-0.512-0.512c0 0-0.512 0-0.512-0.512H950.784h-0.512H392.704c-5.12 0-9.728 1.536-13.312 4.608l-312.32 251.392-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536 0 0 0 0.512-0.512 0.512 0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024c0 0.512 0 0.512-0.512 1.024s0 0.512 0 1.024 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V912.896c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024l0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512 0 0.512 0.512 0.512 1.024 1.024l0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512h583.168c7.68 0 14.848-4.096 18.432-10.752L957.44 675.84l1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V661.504v-1.536V658.432l1.024-544.256zM372.736 343.04l-229.888 0.512L372.736 158.72v184.32z m43.008 43.008l220.672-0.512-0.512 251.392h-220.16v-250.88z m-43.008 0v260.096l-267.264 215.552 1.536-474.624 265.728-1.024z m-227.84 502.272l257.024-208.384h233.984l-0.512 206.848-490.496 1.536z m503.296-545.792l-172.544 0.512H415.232V135.68h471.04l-238.08 206.848z m31.232 337.408h207.36l-207.36 181.248v-181.248z m0-43.008V373.76l243.2-212.48v475.648h-243.2z" fill="#AAAAAA" ></path></symbol><symbol id="icon-a-jixiebi3" viewBox="0 0 1024 1024"><path d="M483.386004 821.695719H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M483.386004 776.399147H164.779715l29.075502 22.648286h260.455285l29.075502-22.648286z" fill="#7A807D" ></path><path d="M483.386004 776.399147H164.779715l29.075502-22.648285h260.455285l29.075502 22.648285z" fill="#3F3F3F" ></path><path d="M483.386004 730.796518H164.779715l29.075502 22.954344h260.455285l29.075502-22.954344zM483.386004 685.499947H164.779715l29.075502 22.648285h260.455285l29.075502-22.648285z" fill="#7A807D" ></path><path d="M483.386004 730.796518H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M150.701051 623.064132h339.418227v62.435815H150.701051z" fill="#F7A53F" ></path><path d="M150.701051 821.695719h339.418227v31.217907H150.701051z" fill="#FFFFFF" ></path><path d="M607.951575 339.654504a74.984189 74.984189 0 0 1-23.872517 103.447575 75.290247 75.290247 0 0 1-103.753633-23.872518L293.324039 120.823095A75.290247 75.290247 0 0 1 317.196557 17.069462a75.290247 75.290247 0 0 1 103.753633 23.872517zM441.762128 517.474152v105.58998H198.752144v-105.58998a122.423166 122.423166 0 1 1 244.846331 0z" fill="#FFC200" ></path><path d="M627.233224 377.605685a103.141517 103.141517 0 0 1-52.948019 82.635637l-165.88339 118.750471-2.448463 1.836347a112.93537 112.93537 0 1 1-112.017197-194.346775l195.571007-84.471985a132.523077 132.523077 0 0 1 48.357151-12.854432A89.062853 89.062853 0 0 1 627.233224 377.605685z" fill="#FFE610" ></path><path d="M401.056425 493.601635a71.005436 71.005436 0 1 1-71.005436-71.311494 71.005436 71.005436 0 0 1 71.005436 71.311494z" fill="#FFFFFF" ></path><path d="M375.34756 493.601635a45.296571 45.296571 0 1 1-45.296571-45.60263 45.296571 45.296571 0 0 1 45.296571 45.60263z" fill="#48B8BF" ></path><path d="M592.342622 376.381453a49.88744 49.88744 0 1 1-49.581382-49.88744 49.88744 49.88744 0 0 1 49.581382 49.88744z" fill="#FFFFFF" ></path><path d="M574.285205 376.381453a30.605791 30.605791 0 1 1-30.605792-30.605791 30.605791 30.605791 0 0 1 30.605792 30.605791z" fill="#48B8BF" ></path><path d="M731.048068 230.789704l165.975207-62.099151 18.883774 50.46895-165.975207 62.068545z" fill="#FFE610" ></path><path d="M734.047436 202.785404l145.836596-54.294674 9.426584 25.31099-145.867202 54.294674z" fill="#F7A53F" ></path><path d="M808.419509 259.161272l23.872517 63.353988 31.523966 35.808776-19.893765 18.057417-48.051092-38.257239-27.851271-63.660046 40.399645-15.302896zM854.940312 242.022029l23.56646 63.04793-0.306058 47.745035 26.627038 0.612116 11.324143-60.293409-20.811938-66.414568-40.399645 15.302896zM716.173654 94.379691l102.345766-38.257239 37.216643 99.468822-102.345767 38.257239z" fill="#7A807D" ></path><path d="M841.473764 83.790087a66.108509 66.108509 0 0 1-65.802452 66.10851l-407.669142 15.608953a67.944857 67.944857 0 0 1-11.324142 0 82.635637 82.635637 0 0 1 0-165.271273 67.944857 67.944857 0 0 1 11.324142 0l407.669142 17.445301A66.108509 66.108509 0 0 1 841.473764 83.790087z" fill="#FFE610" ></path><path d="M402.892773 83.790087a46.520803 46.520803 0 1 1-46.520803-46.214745A46.520803 46.520803 0 0 1 402.892773 83.790087z" fill="#FFFFFF" ></path><path d="M386.059587 83.790087a30.605791 30.605791 0 1 1-30.605791-30.605791 30.605791 30.605791 0 0 1 30.605791 30.605791z" fill="#48B8BF" ></path><path d="M810.867972 83.790087a38.257239 38.257239 0 1 1-39.787528-38.257239A38.257239 38.257239 0 0 1 810.867972 83.790087z" fill="#FFFFFF" ></path><path d="M795.565077 83.790087a24.484633 24.484633 0 1 1-24.484633-24.484633 24.484633 24.484633 0 0 1 24.484633 24.484633z" fill="#48B8BF" ></path><path d="M106.93477 852.913626h639.66104v171.086374H106.93477z" fill="#FFE610" ></path><path d="M383.305066 709.678522h337.275822v207.201208H383.305066z" fill="#4D4D4D" ></path><path d="M407.177584 732.02075h291.061076v161.904636H407.177584z" fill="#FFFFFF" ></path><path d="M429.825869 755.893267h159.150116v16.22107h-159.150116zM429.825869 784.356653h131.604903v16.22107h-131.604903zM429.825869 812.820039h199.855818v16.22107h-199.855818zM429.825869 841.283425h146.601741v16.22107h-146.601741z" fill="#92D5D2" ></path><path d="M507.564579 732.326808l-31.830023 161.904636H407.177584v-161.904636h100.386995z" fill="#F5F5F5" opacity=".5" ></path><path d="M474.816383 916.87973h155.783478v31.830023h-155.783478z" fill="#7A807D" ></path><path d="M106.93477 977.173139h639.66104v46.826861H106.93477z" fill="#F7A53F" ></path><path d="M252.006221 899.740487h66.414567v48.969266H252.006221z" fill="#7A807D" ></path><path d="M319.64502 817.716966l-3.672695 11.324143-21.730112 70.699378h-21.730112l23.872518-76.820537 3.366637-11.324143 19.893764 6.121159z" fill="#999999" ></path><path d="M341.069074 809.147344A28.463386 28.463386 0 1 1 321.17531 773.950684a28.463386 28.463386 0 0 1 19.893764 35.19666z" fill="#48B8BF" ></path><path d="M322.705599 793.538391a13.16049 13.16049 0 1 1-26.014923 0 13.16049 13.16049 0 0 1 26.014923 0z" fill="#FFFFFF" ></path><path d="M165.085773 899.740487h66.414568v49.275324H165.085773z" fill="#7A807D" ></path><path d="M163.861542 817.716966l3.366637 11.324143 22.03617 70.699378h21.730111l-23.872517-76.820537-3.672695-11.324143-19.587706 6.121159z" fill="#999999" ></path><path d="M142.437488 809.147344a28.157328 28.157328 0 1 0 18.669532-35.19666 28.157328 28.157328 0 0 0-18.669532 35.19666z" fill="#F7A53F" ></path><path d="M160.800963 793.538391a13.16049 13.16049 0 1 0 12.854432-12.854433 12.854432 12.854432 0 0 0-12.854432 12.854433z" fill="#FFFFFF" ></path></symbol><symbol id="icon-jixiebi2" viewBox="0 0 1164 1024"><path d="M848.55632 485.108049h233.370249v430.146938h-233.370249z" fill="#FFE610" ></path><path d="M974.217224 605.245396h154.314351v64.211341h-154.314351zM974.217224 689.82485h154.314351v64.211341h-154.314351zM974.217224 774.749527h154.314351v64.211341h-154.314351z" fill="#54D9D9" ></path><path d="M306.557369 245.869021l99.078789 31.760448 69.389675 22.094225 145.683794 46.259783 69.734897 22.094225 119.101681 37.974449 66.627896 21.058558 1.035667-2.761778 21.749003-69.044453 23.129891-72.151453-22.784669-7.249667-79.746343-25.201225-20.368113-6.559223-337.972595-107.364124-21.40378-6.904445-87.686455-27.617781-45.224116 142.576794-0.345222 1.035667z" fill="#FFE610" ></path><path d="M412.33347 357.755556l10.70189-33.555604 441.470229 140.401894-10.667368 33.555604z" fill="#A3A3A3" ></path><path d="M380.331366 357.686512l25.408359-79.953476 69.424197 22.094225-25.408359 79.918953zM595.508402 425.626253l25.408359-79.953476 69.389674 22.059703-25.373836 79.953476z" fill="#3F3F3F" ></path><path d="M809.200982 411.575707a144.302906 144.302906 0 0 0 4.833112 37.284004 138.088905 138.088905 0 0 0 18.987224 43.152783 144.302906 144.302906 0 0 0 15.535002 19.677669 146.719461 146.719461 0 0 0 256.154919-100.114456 144.648128 144.648128 0 0 0-34.522226-94.5909 180.206021 180.206021 0 0 0-15.880224-16.570668 146.719461 146.719461 0 0 0-96.317012-34.522227 148.445573 148.445573 0 0 0-58.687784 10.356668 146.719461 146.719461 0 0 0-89.757788 129.803571 34.522226 34.522226 0 0 0-0.345223 5.523556z" fill="#FFC200" ></path><path d="M876.174101 411.575707A80.091565 80.091565 0 1 0 956.265666 331.484142a80.091565 80.091565 0 0 0-80.091565 80.091565z" fill="#FFFFFF" ></path><path d="M904.827549 411.575707a51.438117 51.438117 0 1 0 51.438117-51.092895 51.438117 51.438117 0 0 0-51.438117 51.092895z" fill="#54D9D9" ></path><path d="M218.076903 216.594173l37.007826-117.202958 88.894733 28.06657L306.902591 244.660743zM86.512699 119.345062l92.450522-16.467102 19.401491 108.745013-92.450522 16.467102z" fill="#8A8A8A" ></path><path d="M0 65.317778l45.224116 254.083585 21.058558-3.797445 31.415226-5.523556 22.094225-4.142667-13.808891-77.675009-19.332446-109.090235-12.082779-67.318341-14.499335 2.761778-21.403781 3.797445-38.664893 6.904445z" fill="#292929" ></path><path d="M95.626567 436.43171l16.570668-3.107-14.499335-123.244348-31.415226 5.523556 29.343893 120.827792z" fill="#7A807D" ></path><path d="M138.088905 153.349455a80.782009 80.782009 0 0 0 31.070003 63.520896 79.40112 79.40112 0 0 0 49.021562 16.915891 75.258453 75.258453 0 0 0 32.10567-6.904445 80.091565 80.091565 0 0 0 48.331117-73.532342 78.710676 78.710676 0 0 0-13.808891-44.18845 76.984564 76.984564 0 0 0-31.760448-27.617781l-7.59489-3.452222a83.543787 83.543787 0 0 0-12.428001-3.452223H217.835247A80.091565 80.091565 0 0 0 138.088905 153.349455z" fill="#FFC200" ></path><path d="M167.087575 153.694677A51.092895 51.092895 0 1 0 217.835247 103.637449a50.747673 50.747673 0 0 0-50.747672 50.057228z" fill="#FFFFFF" ></path><path d="M185.384355 153.694677a32.450893 32.450893 0 1 0 32.450892-34.522226 32.450893 32.450893 0 0 0-32.450892 34.522226z" fill="#54D9D9" ></path><path d="M38.664893 58.413333l21.403781-3.797445C66.627897 19.74844 108.745013 11.117883 141.88635 14.915328a89.757788 89.757788 0 0 1 81.472454 58.687784h9.321001a83.543787 83.543787 0 0 1 12.428001 3.452223l7.59489 3.452223c53.854673-42.807561 165.016241-17.951558 187.110466 48.331116l21.40378 6.904446C439.813162 59.449 307.593036 24.581551 241.655583 69.115223a113.923346 113.923346 0 0 0-108.745012-69.044452C90.793455 0.070771 41.081449 10.772661 38.664893 58.413333zM799.189537 244.14291l20.368113 6.559223a345.222262 345.222262 0 0 0 89.412566-34.522226c48.331117-22.784669 133.601015-34.522226 144.99335 34.522226a114.613791 114.613791 0 0 1 0 48.676339 180.206021 180.206021 0 0 1 15.880224 16.570668c15.880224-50.057228 3.797445-107.364124-54.545117-124.280014-83.198565-22.439447-141.541127 45.569339-216.109136 52.473784z" fill="#3F3F3F" ></path><path d="M44.18845 731.251522a105.638012 105.638012 0 0 0 105.638012 105.638012h698.729858v-31.415226H149.826462a74.222786 74.222786 0 0 1 0-148.445573h698.729858v-31.415225H149.826462a105.638012 105.638012 0 0 0-105.638012 105.638012z" fill="#8A8A8A" ></path><path d="M75.603675 731.251522a74.222786 74.222786 0 0 0 74.222787 74.222786h698.729858V655.993069H149.826462a74.222786 74.222786 0 0 0-74.222787 75.258453z" fill="#FFE610" ></path><path d="M103.566679 731.251522a51.092895 51.092895 0 1 0 50.747672-50.747673A50.747673 50.747673 0 0 0 103.566679 731.251522z" fill="#FFFFFF" ></path><path d="M121.863459 731.251522a32.450893 32.450893 0 1 0 32.450892-32.450893 32.450893 32.450893 0 0 0-32.450892 32.450893zM290.331922 731.251522a34.522226 34.522226 0 0 0 34.522227 34.522226h414.266714a34.522226 34.522226 0 0 0 34.522226-34.522226 34.522226 34.522226 0 0 0-34.522226-34.522226h-414.266714a34.522226 34.522226 0 0 0-34.522227 34.522226z" fill="#54D9D9" ></path><path d="M827.15254 877.625761h276.523032v61.794785h-276.523032z" fill="#F7A53F" ></path><path d="M839.925764 939.765768h250.976584v31.070004h-250.976584z" fill="#707070" ></path><path d="M747.75142 657.028735v148.445573h43.152783v31.415226h57.652117v-211.276024h-57.652117v31.415225h-43.152783z" fill="#B3B3B3" opacity=".76" ></path><path d="M14.499335 970.490549h1149.590133v53.509451H14.499335z" fill="#B86805" ></path><path d="M154.314351 836.889534H272.725587v133.601015H154.314351zM614.150404 836.889534h118.411236v133.601015h-118.411236z" fill="#F7A53F" ></path><path d="M614.150404 836.889534h118.411236v78.365453h-118.411236zM154.314351 836.889534H272.725587v78.365453H154.314351z" fill="#B3B3B3" opacity=".76" ></path></symbol><symbol id="icon-jixiebi4" viewBox="0 0 1123 1024"><path d="M502.569098 505.335276h543.234824v85.15391H502.569098z" fill="#FFE610" ></path><path d="M483.047648 203.089382a81.451566 81.451566 0 0 1-41.06236 73.373725l-302.919047 173.33701a82.124719 82.124719 0 0 1-81.788143-143.045105l302.919047-173.33701a82.124719 82.124719 0 0 1 83.807603 0 79.768682 79.768682 0 0 1 27.935868 28.945597A77.412645 77.412645 0 0 1 483.047648 203.089382z" fill="#FFC200" ></path><path d="M39.776109 803.542249h1082.094151v220.121174H39.776109z" fill="#FFE610" ></path><path d="M39.776109 971.830609h1082.094151v52.169391H39.776109zM466.218812 723.43699v146.747449H219.844654v-146.747449a123.187079 123.187079 0 0 1 246.374158 0z" fill="#FFC200" ></path><path d="M396.210854 790.415757a100.973016 100.973016 0 0 1-141.698798-23.896947l-235.603704-331.864645a100.973016 100.973016 0 0 1 23.896947-141.362222 100.973016 100.973016 0 0 1 141.698799 23.896947l235.603703 331.528068a100.973016 100.973016 0 0 1-24.233523 141.698799z" fill="#FFE610" ></path><path d="M146.470929 451.146424a86.16364 86.16364 0 1 1 29.282174-118.138428 86.16364 86.16364 0 0 1-29.282174 118.138428z" fill="#B8B8B8" ></path><path d="M131.661553 424.556864a56.881466 56.881466 0 1 1 19.52145-78.085799 56.544889 56.544889 0 0 1-19.52145 78.085799z" fill="#B8B8B8" ></path><path d="M120.554522 405.035414a35.677132 35.677132 0 0 1-36.686863-60.920386A35.677132 35.677132 0 1 1 120.554522 405.035414z" fill="#FFFFFF" ></path><path d="M370.9676 757.767815a56.881466 56.881466 0 1 1 19.184873-78.085798 56.881466 56.881466 0 0 1-19.184873 78.085798z" fill="#B8B8B8" ></path><path d="M358.850839 739.592672a35.677132 35.677132 0 1 1 12.116761-48.803624 35.677132 35.677132 0 0 1-12.116761 48.803624z" fill="#FFFFFF" ></path><path d="M423.136992 384.167657l-112.416624 66.305614-32.984519-55.871735 112.753201-65.969037 9.760725 16.492259 13.463069 22.887217 9.424148 16.155682z" fill="#8A8A8A" ></path><path d="M400.18246 345.023785l70.512822-41.398937 13.463069 22.887217-70.512823 41.432594z" fill="#C4C4C4" ></path><path d="M489.442606 313.823123a21.877487 21.877487 0 0 1-11.780186 27.935868 21.54091 21.54091 0 0 1-27.935867-12.116762l-29.955328-73.373725a21.54091 21.54091 0 0 1 12.116762-27.935868 21.204333 21.204333 0 0 1 27.599291 11.780186z" fill="#F7A53F" ></path><path d="M482.037918 318.19862a12.453339 12.453339 0 0 1-9.424148 14.809376 12.789915 12.789915 0 0 1-14.809376-9.424148 12.789915 12.789915 0 0 1 9.424148-14.809376 12.453339 12.453339 0 0 1 14.809376 9.424148z" fill="#707070" ></path><path d="M303.652257 388.543155a24.5701 24.5701 0 0 0-7.404688 8.077841l-24.906677 45.10128 32.311365 44.764704 36.350285-65.63246a24.906677 24.906677 0 0 0-36.013709-33.657672z m12.453338 6.394957a14.472799 14.472799 0 0 1 16.155683 12.116762 14.136222 14.136222 0 0 1-12.116762 16.155683 13.799645 13.799645 0 0 1-16.155683-11.780185 14.136222 14.136222 0 0 1 13.463069-16.49226z" fill="#B86805" ></path><path d="M305.33514 411.430372a13.799645 13.799645 0 0 0 16.155683 11.780185 14.136222 14.136222 0 0 0 12.116762-16.155683 14.472799 14.472799 0 0 0-16.155683-12.116762 14.136222 14.136222 0 0 0-12.116762 16.49226z" fill="#5E5E5E" ></path><path d="M625.4196 163.709906l-19.858026 12.116762-37.360016 22.55064-19.858027 12.116762-20.867756-34.667402-40.389207-66.64219-19.184872-31.301635 9.424148-5.721804 58.227772-35.340556 9.424148-5.385227 80.441836 132.27465z" fill="#8A8A8A" ></path><path d="M568.066927 198.276335l37.124412-22.516982 36.484917 60.14626-37.15807 22.55064z" fill="#4D4D4D" ></path><path d="M931.031261 336.373763l-85.15391 217.765137h-128.572307l-46.447587-118.811581-30.965058-79.768683-7.404688-19.184873 46.111011-46.447587h205.648375l46.784164 46.447587z" fill="#AEBABD" ></path><path d="M744.668732 483.861681l105.954351-43.182793 2.423352 5.890093-105.988009 43.182793zM840.8287 361.953594l-120.157889-26.252984 1.682884-6.058381 119.821312 26.252984-1.346307 6.058381zM683.916634 363.838423l6.125696-1.851172 32.984518 109.252803-6.159353 1.851172z" fill="#6A5060" ></path><path d="M880.544753 403.015954a49.813354 49.813354 0 1 1-49.813354-49.813355 50.149931 50.149931 0 0 1 49.813354 49.813355zM746.923796 359.597557a33.657672 33.657672 0 1 1-33.657672-33.657672 33.657672 33.657672 0 0 1 33.657672 33.657672zM767.454975 465.282647a26.589561 26.589561 0 0 1-26.58956 26.252984A26.252984 26.252984 0 0 1 741.201991 438.693086a26.589561 26.589561 0 0 1 26.252984 26.589561z" fill="#FFFFFF" ></path><path d="M846.887081 403.015954a16.155683 16.155683 0 1 1-16.155682-16.155683 16.155683 16.155683 0 0 1 16.155682 16.155683zM724.709732 359.597557a10.097302 10.097302 0 0 1-10.097302 9.760725 9.760725 9.760725 0 1 1 0-19.52145 10.097302 10.097302 0 0 1 10.097302 9.760725zM748.943256 465.282647A7.741265 7.741265 0 0 1 741.201991 472.350758a8.077841 8.077841 0 0 1-8.077841-8.077842 8.077841 8.077841 0 0 1 8.077841-8.077841 8.077841 8.077841 0 0 1 7.741265 9.087572z" fill="#788B90" opacity=".37" ></path><path d="M698.456748 219.581642h166.268899v46.11101h-166.268899z" fill="#F7A53F" ></path><path d="M702.159092 223.620562h5.048651v38.03317h-5.048651zM711.246663 223.620562h5.048651v38.03317h-5.048651zM720.334235 223.620562h5.048651v38.03317h-5.048651zM729.421806 223.620562h5.048651v38.03317h-5.048651zM738.509378 223.620562h5.04865v38.03317h-5.04865zM747.596949 223.620562h5.048651v38.03317h-5.048651zM756.68452 223.620562h5.048651v38.03317h-5.048651zM765.772092 223.620562h5.048651v38.03317h-5.048651zM774.859663 223.620562h5.048651v38.03317H774.859663zM783.610658 223.620562h5.048651v38.03317h-5.048651zM792.698229 223.620562h5.048651v38.03317h-5.048651zM801.785801 223.620562h5.04865v38.03317h-5.04865zM810.873372 223.620562h5.048651v38.03317h-5.048651zM819.960944 223.620562h5.04865v38.03317h-5.04865zM829.048515 223.620562h5.048651v38.03317h-5.048651zM838.136086 223.620562h5.048651v38.03317h-5.048651zM847.223658 223.620562h5.048651v38.03317h-5.048651zM856.311229 223.620562h5.048651v38.03317h-5.048651z" fill="#788B90" opacity=".38" ></path><path d="M738.845954 265.692652h85.490487v23.896947h-85.490487z" fill="#707070" ></path><path d="M735.816764 288.916446h-1.682884L640.228976 355.558636l-39.0429 26.926138-4.712074 3.365767-16.492259-23.896947a25.916407 25.916407 0 0 1 6.731534-36.013709l97.270672-67.315344a25.916407 25.916407 0 0 1 36.013709 6.731534z" fill="#58BFD2" ></path><path d="M670.857457 435.327319h-33.657672a12.116762 12.116762 0 0 1-10.433878-8.414418l-24.906677-44.428127 39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M827.365631 288.916446h1.682884l94.241481 65.63246 39.0429 26.926138 4.712074 3.365767 16.492259-23.896947a25.916407 25.916407 0 0 0-6.731534-35.003979l-97.270672-67.315344a25.916407 25.916407 0 0 0-36.013709 6.731534z" fill="#58BFD2" ></path><path d="M892.324938 435.327319h33.657672a12.116762 12.116762 0 0 0 10.433878-8.414418l24.906677-44.428127-39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M738.845954 265.692652h85.490487v12.116762h-85.490487zM922.95342 355.558636l-31.301635 79.768683-46.447588 118.811581 49.140201-194.541343-70.007957-69.671381h4.038921l94.578058 65.63246z" fill="#848484" opacity=".25" ></path><path d="M661.433309 321.900964l-48.467048-67.988497 21.204334-12.789915 38.033169 74.383455-10.770455 6.394957z" fill="#7A807D" ></path><path d="M535.553616 36.820483l-58.227772 33.657672-11.780186-19.184873A33.657672 33.657672 0 0 1 502.905674 1.143351a33.657672 33.657672 0 0 1 21.204334 15.482529z" fill="#F7A53F" ></path><path d="M527.475775 175.826668L483.047648 203.089382A77.412645 77.412645 0 0 0 471.940616 164.046483a79.768682 79.768682 0 0 0-27.599291-28.272444l42.745243-25.916408zM527.475775 175.826668l-40.389207-66.64219 40.389207 66.64219z" fill="#C4C4C4" ></path><path d="M956.274515 854.028757H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M650.999431 304.062398l-70.007958 14.809376 69.671381 8.414418-4.712074 38.033169 25.243254-25.243254 22.887217 25.243254-3.702344-36.350286 35.003979-1.682883-31.974789-19.52145 14.809376-35.677132-33.657672 24.906677-26.252984-43.754973 2.692614 50.823084z" fill="#FFFFFF" ></path><path d="M956.274515 803.542249H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 803.542249H600.512923l32.311365-25.579831h290.802285l32.647942 25.579831z" fill="#999999" ></path><path d="M956.274515 752.719165H600.512923l32.311365 25.243253h290.802285l32.647942-25.243253zM956.274515 702.232657H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 752.719165H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M584.693817 632.561276h378.985386v69.671381H584.693817zM584.693817 854.028757h378.985386v34.667402H584.693817z" fill="#FFC200" ></path><path d="M502.569098 590.489186h543.234824v42.07209H502.569098z" fill="#F7A53F" ></path><path d="M273.696929 882.637778h80.441836v59.574079H273.696929z" fill="#7A807D" ></path><path d="M355.821648 783.011069l-4.375497 13.799646-26.589561 85.827063h-26.252984l28.945598-93.231751 4.375497-13.799646 23.896947 7.404688z" fill="#999999" ></path><path d="M381.738055 772.913768a33.657672 33.657672 0 1 1-22.55064-43.08182 33.657672 33.657672 0 0 1 22.55064 43.08182z" fill="#F7A53F" ></path><path d="M359.523992 753.728895a15.819106 15.819106 0 1 1-15.819106-15.819106 15.819106 15.819106 0 0 1 15.819106 15.819106z" fill="#FFFFFF" ></path><path d="M168.348416 882.637778h80.441835v59.574079H168.348416z" fill="#7A807D" ></path><path d="M166.665532 783.011069l4.375497 13.799646 26.589561 85.827063h26.252984l-28.945598-93.231751-4.03892-13.799646-24.233524 7.404688z" fill="#999999" ></path><path d="M140.749125 772.913768a33.657672 33.657672 0 1 0 67.315343-20.53118 33.657672 33.657672 0 0 0-43.08182-22.55064 33.657672 33.657672 0 0 0-24.233523 43.08182z" fill="#68FF4B" ></path><path d="M162.963188 753.728895a15.819106 15.819106 0 1 0 15.819106-15.819106 15.819106 15.819106 0 0 0-15.819106 15.819106z" fill="#FFFFFF" ></path></symbol></svg>',(s=>{var t=(e=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute("data-injectcss"),e=e.getAttribute("data-disable-injectsvg");if(!e){var n,i,r,a,o,l=function(u,d){d.parentNode.insertBefore(u,d)};if(t&&!s.__iconfont__svg__cssinject__){s.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(u){console&&console.log(u)}}n=function(){var u,d=document.createElement("div");d.innerHTML=s._iconfont_svg_string_4634042,(d=d.getElementsByTagName("svg")[0])&&(d.setAttribute("aria-hidden","true"),d.style.position="absolute",d.style.width=0,d.style.height=0,d.style.overflow="hidden",d=d,(u=document.body).firstChild?l(d,u.firstChild):u.appendChild(d))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(r=n,a=s.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,r())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);exports.ACESFilmicToneMapping=Lh;exports.AmbientLight=su;exports.Box3=Bn;exports.Color=qt;exports.Controls=Nf;exports.DirectionalLight=iu;exports.DoubleSide=tn;exports.Euler=un;exports.GridHelper=If;exports.HemisphereLight=Ef;exports.MOUSE=yu;exports.MathUtils=Ti;exports.Mesh=be;exports.MeshPhongMaterial=cn;exports.PCFSoftShadowMap=Ch;exports.PerspectiveCamera=$e;exports.Plane=ci;exports.PlaneGeometry=Xs;exports.PointLight=nu;exports.Quaternion=gn;exports.Ray=ms;exports.SRGBColorSpace=Me;exports.Scene=vl;exports.ShadowMaterial=lf;exports.Spherical=ru;exports.TOUCH=Mu;exports.Vector2=Qt;exports.Vector3=O;exports.WebGLRenderer=v2;exports.Xe=W2;exports._sfc_main=ag;exports.useModelComp=Ah;exports.useModelLoader=rg;