diff --git a/build/.DS_Store b/build/.DS_Store new file mode 100644 index 0000000..3cfa6ac Binary files /dev/null and b/build/.DS_Store differ diff --git a/build/assets/.DS_Store b/build/assets/.DS_Store new file mode 100644 index 0000000..04c7d80 Binary files /dev/null and b/build/assets/.DS_Store differ diff --git a/build/models/.DS_Store b/build/models/.DS_Store new file mode 100644 index 0000000..45b8320 Binary files /dev/null and b/build/models/.DS_Store differ diff --git a/build/models/Hybopsis.glb b/build/models/Hybopsis.glb new file mode 100644 index 0000000..ac7e54b Binary files /dev/null and b/build/models/Hybopsis.glb differ diff --git a/build/models/another.glb b/build/models/another.glb new file mode 100644 index 0000000..ac7e54b Binary files /dev/null and b/build/models/another.glb differ diff --git a/build/models/fish1.glb b/build/models/fish1.glb new file mode 100644 index 0000000..ac79ff6 Binary files /dev/null and b/build/models/fish1.glb differ diff --git a/build/models/hook1.glb b/build/models/hook1.glb new file mode 100644 index 0000000..216c89e Binary files /dev/null and b/build/models/hook1.glb differ diff --git a/build/models/hook_.glb b/build/models/hook_.glb new file mode 100644 index 0000000..bf83935 Binary files /dev/null and b/build/models/hook_.glb differ diff --git a/build/models/largerfish.glb b/build/models/largerfish.glb new file mode 100644 index 0000000..ac79ff6 Binary files /dev/null and b/build/models/largerfish.glb differ diff --git a/build/models/line.glb b/build/models/line.glb new file mode 100644 index 0000000..5a426bf Binary files /dev/null and b/build/models/line.glb differ diff --git a/build/models/redfish.glb b/build/models/redfish.glb new file mode 100644 index 0000000..0bca7e9 Binary files /dev/null and b/build/models/redfish.glb differ diff --git a/build/models/shark.glb b/build/models/shark.glb new file mode 100644 index 0000000..3828ef1 Binary files /dev/null and b/build/models/shark.glb differ diff --git a/build/static/css/main.1b762230.chunk.css b/build/static/css/main.1b762230.chunk.css new file mode 100644 index 0000000..73b442b --- /dev/null +++ b/build/static/css/main.1b762230.chunk.css @@ -0,0 +1,2 @@ +body{margin:0;height:100vh;width:100vw;background-color:#000}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.container,html{background-color:#000}.map{background-image:url(/static/media/underwater.30f6d9e9.gif);height:100vh;background-position:50%;background-repeat:no-repeat;background-size:cover}.formStyling{width:25%;height:35px;background-color:#000;color:#fff;border:1px solid #fff;border-radius:5px;margin-top:10px;padding:5px}.royce{width:700px;position:absolute;left:40%;margin-left:-220px;margin-top:-350px;z-index:-1}.header{font-size:22px}::-webkit-input-placeholder{color:#fff;opacity:1}:-ms-input-placeholder{opacity:1}::-ms-input-placeholder{opacity:1}::placeholder{color:#fff;opacity:1}:-ms-input-placeholder{color:#fff}::-ms-input-placeholder{color:#fff}.parent{margin-left:80px;margin-top:150px}.submitForm{width:26%;margin-top:10px;height:38px;border-radius:5px;border:1px solid #fff;cursor:pointer}.logo{position:absolute;width:470px;z-index:2;margin-left:-120px;margin-top:-90px}.right{margin-left:70%;top:0;margin-top:-380px}.description{color:#fff;position:absolute;margin-top:150px;text-align:center;font-weight:800;font-size:22px;left:60%;margin-right:20px}.googleform{margin-top:100px;width:25%;height:38px;border-radius:5px;cursor:pointer;color:#fff;background-color:#000;border:1px solid #fff}@media only screen and (max-width:600px){.header{font-size:14px}.formStyling{width:75%;height:35px;background-color:#000;color:#fff;border:1px solid #fff;border-radius:5px;margin-top:10px}.googleform,.submitForm{width:80%;margin-left:1px}.royce{width:300px;position:relative;z-index:-1;left:50%}.logo{width:300px;margin-top:-170px;margin-left:-55px}.right{margin-left:22%;top:0;margin-top:-320px}.description{color:#fff;margin-top:350px;text-align:center;font-weight:800;font-size:22px;max-width:70%;margin-left:10%;left:0}.logo{padding-left:10px;padding-right:10px}}@media only screen and (min-width:1800px){.royce{width:1000px;margin-left:-300px}}#canvas{background-image:url(/static/media/Royce_mockup.4bcce7cc.svg);height:100vh;background-position:50%;background-repeat:no-repeat;background-size:cover}.containerchat{display:flex;flex-direction:column;height:400px;width:400px}.title{display:flex;justify-content:center;align-items:center;height:40px;box-sizing:border-box;margin:0;padding:0;text-align:center;color:#000;background-color:#add8e6}.message{margin:15px 0}.message-username{padding:4px;color:#00f}.message-text{display:inline;padding:4px 8px;border-radius:8px;color:#000;background-color:#add8e6}.message-time{font-size:11px;padding:2px;color:#3d3d3d}.message-list{flex-grow:1;box-sizing:border-box;padding:0 0 0 6px;margin:0;width:100%;overflow-y:auto;background-color:#fff}.send-message-form{width:100%;display:flex;box-sizing:border-box;height:60px;background-color:#d8d8d8}.send-message-form input{width:100%;padding:15px 10px;border:none;margin:0;background:#d8d8d8;color:#000;font-weight:200}.send-message-form input:focus{outline-width:0}.send-message-form input::-webkit-input-placeholder{color:#000}.send-message-form input:-ms-input-placeholder{color:#000}.send-message-form input::-ms-input-placeholder{color:#000}.send-message-form input::placeholder{color:#000}.containerlogin{background-color:#000;height:100vh}.containerlogin,.loginContainer{display:flex;justify-content:center;align-items:center}.loginContainer{background-color:#424242;flex-direction:column;padding:50px}.header{color:#fff;font-size:30px;padding:4px}.userSuccess{color:green;margin:10px 0}.userError,.userSuccess{display:flex;justify-content:center}.userError{color:red;margin-top:8px}.form{display:flex;justify-content:center}.logininput{display:flex;flex-direction:column;height:35px;background-color:#000;color:#fff;border:1px solid #fff;border-radius:5px;margin-top:10px;padding:5px;width:300px}.submitButton{display:flex;justify-content:center}.loginbutton{background-color:#000;color:#fff;padding:5px;margin-top:10px;height:38px;border-radius:5px;border:1px solid #fff;cursor:pointer;width:275px} +/*# sourceMappingURL=main.1b762230.chunk.css.map */ \ No newline at end of file diff --git a/build/static/css/main.1b762230.chunk.css.map b/build/static/css/main.1b762230.chunk.css.map new file mode 100644 index 0000000..ae35109 --- /dev/null +++ b/build/static/css/main.1b762230.chunk.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://src/index.css","webpack://src/Components/FishGame/index.css","webpack://src/Components/Map/Scene.css","webpack://src/Components/ChatApp/index.css","webpack://src/Components/Login/index.css"],"names":[],"mappings":"AAAA,KACE,QAAS,CACT,YAAa,CACb,WAAY,CACZ,qBACF,CAEA,KACE,yEAEF,CCVA,gBACE,qBACF,CAEA,KACE,2DAAoD,CACpD,YAAa,CACb,uBAA2B,CAC3B,2BAA4B,CAC5B,qBAMF,CAGA,aACE,SAAU,CACV,WAAY,CACZ,qBAAuB,CACvB,UAAY,CACZ,qBAAuB,CACvB,iBAAkB,CAClB,eAAgB,CAChB,WACF,CAEA,OACE,WAAY,CACZ,iBAAkB,CAClB,QAAS,CACT,kBAAmB,CACnB,iBAAkB,CAClB,UACF,CAEA,QAEE,cACF,CAEA,4BACE,UAAY,CACZ,SACF,CAHA,uBAEE,SACF,CAHA,wBAEE,SACF,CAHA,cACE,UAAY,CACZ,SACF,CAEA,uBACE,UACF,CAEA,wBACE,UACF,CAEA,QACE,gBAAiB,CACjB,gBACF,CAEA,YACE,SAAU,CACV,eAAgB,CAChB,WAAY,CACZ,iBAAkB,CAClB,qBAAuB,CACvB,cACF,CAEA,MACE,iBAAkB,CAClB,WAAY,CACZ,SAAU,CACV,kBAAmB,CACnB,gBACF,CAEA,OACE,eAAgB,CAChB,KAAO,CACP,iBACF,CAEA,aACE,UAAY,CACZ,iBAAkB,CAClB,gBAAiB,CACjB,iBAAkB,CAClB,eAAgB,CAChB,cAAe,CACf,QAAQ,CACR,iBACF,CAEA,YACE,gBAAiB,CACjB,SAAU,CACV,WAAY,CACZ,iBAAkB,CAClB,cAAe,CACf,UAAY,CACZ,qBAAuB,CACvB,qBACF,CAEA,yCAGE,QACE,cAEF,CACA,aACE,SAAU,CACV,WAAY,CACZ,qBAAuB,CACvB,UAAY,CACZ,qBAAuB,CACvB,iBAAkB,CAClB,eACF,CAOA,wBACE,SAAU,CACV,eACF,CAEA,OACE,WAAY,CACZ,iBAAkB,CAClB,UAAW,CACX,QACA,CAEF,MACE,WAAY,CACZ,iBAAkB,CAClB,iBACF,CAGA,OACE,eAAgB,CAChB,KAAO,CACP,iBACF,CAEA,aACE,UAAY,CACZ,gBAAiB,CACjB,iBAAkB,CAClB,eAAgB,CAChB,cAAe,CACf,aAAc,CACd,eAAgB,CAChB,MACA,CAEA,MACE,iBAAkB,CAClB,kBACF,CAEF,CAEA,0CACE,OACE,YAAa,CACb,kBACF,CACF,CChLF,QACC,6DAA6D,CAC7D,YAAa,CACb,uBAA2B,CAC3B,2BAA4B,CAC5B,qBACD,CCNA,eACC,YAAa,CACb,qBAAsB,CACtB,YAAa,CACb,WACD,CAEA,OACC,YAAa,CACb,sBAAuB,CACvB,kBAAmB,CACnB,WAAY,CACZ,qBAAsB,CACtB,QAAS,CACT,SAAU,CACV,iBAAkB,CAClB,UAAY,CACZ,wBACD,CAEA,SACC,aACD,CAEA,kBACC,WAAY,CACZ,UACD,CAEA,cACC,cAAe,CACf,eAAgB,CAChB,iBAAkB,CAClB,UAAY,CACZ,wBACD,CAEA,cACC,cAAe,CACf,WAAY,CACZ,aACD,CAEA,cACC,WAAY,CACZ,qBAAsB,CACtB,iBAAkB,CAClB,QAAS,CACT,UAAW,CACX,eAAgB,CAChB,qBACD,CAEA,mBAGC,UAAW,CACX,YAAa,CACb,qBAAsB,CACtB,WAAY,CACZ,wBACD,CAEA,yBACC,UAAW,CACX,iBAAkB,CAClB,WAAY,CACZ,QAAS,CACT,kBAA8B,CAC9B,UAAY,CACZ,eACD,CAEA,+BACC,eACD,CAEA,oDACC,UACD,CAFA,+CACC,UACD,CAFA,gDACC,UACD,CAFA,sCACC,UACD,CC/EA,gBACI,qBAAuB,CAEvB,YAGJ,CAEA,gCANI,YAAa,CAEb,sBAAuB,CACvB,kBAUJ,CAPA,gBACI,wBAAiC,CAEjC,qBAAsB,CAGtB,YACJ,CAEA,QACI,UAAY,CACZ,cAAe,CACf,WACJ,CAEA,aAGI,WAAY,CACZ,aACJ,CAEA,wBANI,YAAa,CACb,sBAUJ,CALA,WAGI,SAAU,CACV,cACJ,CAEA,MACI,YAAa,CACb,sBACJ,CAEA,YACI,YAAa,CACb,qBAAsB,CACtB,WAAY,CACZ,qBAAuB,CACvB,UAAY,CACZ,qBAAuB,CACvB,iBAAkB,CAClB,eAAgB,CAChB,WAAgB,CAChB,WACF,CAEA,cACE,YAAa,CACb,sBACF,CAEA,aACE,qBAAuB,CACvB,UAAY,CACZ,WAAgB,CAChB,eAAgB,CAChB,WAAY,CACZ,iBAAkB,CAClB,qBAAuB,CACvB,cAAe,CACf,WACF","file":"main.1b762230.chunk.css","sourcesContent":["body {\n margin: 0;\n height: 100vh;\n width: 100vw;\n background-color: black;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n","html {\n background-color: black;\n}\n\n.map {\n background-image: url('/src/Sprites/underwater.gif');\n height: 100vh;\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n /* background-color: skyblue; */\n /* -moz-background-size: cover;\n -webkit-background-size: cover;\n -o-background-size: cover;\n background-size: cover; */\n}\n\n\n.formStyling {\n width: 25%;\n height: 35px;\n background-color: black;\n color: white;\n border: 1px solid white;\n border-radius: 5px;\n margin-top: 10px;\n padding: 5px 5px;\n}\n\n.royce {\n width: 700px;\n position: absolute;\n left: 40%;\n margin-left: -220px;\n margin-top: -350px;\n z-index: -1;\n}\n\n.header {\n color: white;\n font-size: 22px;\n}\n\n::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: white;\n opacity: 1; /* Firefox */\n}\n\n:-ms-input-placeholder { /* Internet Explorer 10-11 */\n color: white;\n}\n\n::-ms-input-placeholder { /* Microsoft Edge */\n color: white;\n}\n\n.parent {\n margin-left: 80px;\n margin-top: 150px;\n}\n\n.submitForm {\n width: 26%;\n margin-top: 10px;\n height: 38px;\n border-radius: 5px;\n border: 1px solid white;\n cursor: pointer;\n}\n\n.logo {\n position: absolute;\n width: 470px;\n z-index: 2;\n margin-left: -120px;\n margin-top: -90px;\n}\n\n.right {\n margin-left: 70%;\n top: 0%;\n margin-top: -380px;\n}\n\n.description {\n color: white;\n position: absolute;\n margin-top: 150px;\n text-align: center;\n font-weight: 800;\n font-size: 22px;\n left:60%;\n margin-right: 20px;\n}\n\n.googleform {\n margin-top: 100px;\n width: 25%;\n height: 38px;\n border-radius: 5px;\n cursor: pointer;\n color: white;\n background-color: black;\n border: 1px solid white;\n}\n\n@media only screen and (max-width: 600px) {\n\n\n .header {\n font-size: 14px;\n /* margin-left: 15px; */\n }\n .formStyling {\n width: 75%;\n height: 35px;\n background-color: black;\n color: white;\n border: 1px solid white;\n border-radius: 5px;\n margin-top: 10px;\n }\n\n .submitForm {\n width:80%;\n margin-left: 1px;\n }\n\n .googleform {\n width: 80%;\n margin-left: 1px;\n }\n\n .royce {\n width: 300px;\n position: relative;\n z-index: -1;\n left: 50%;\n }\n\n .logo {\n width: 300px;\n margin-top: -170px;\n margin-left: -55px;\n }\n\n\n .right {\n margin-left: 22%;\n top: 0%;\n margin-top: -320px;\n }\n\n .description {\n color: white;\n margin-top: 350px;\n text-align: center;\n font-weight: 800;\n font-size: 22px;\n max-width: 70%;\n margin-left: 10%;\n left:0%\n }\n\n .logo {\n padding-left: 10px;\n padding-right: 10px;\n }\n \n }\n\n @media only screen and (min-width: 1800px) {\n .royce {\n width: 1000px;\n margin-left: -300px;\n }\n }\n\n","#canvas {\n\tbackground-image: url('../../../src/Images/Royce_mockup.svg');\n\theight: 100vh;\n\tbackground-position: center;\n\tbackground-repeat: no-repeat;\n\tbackground-size: cover;\n}\n",".containerchat {\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 400px;\n\twidth: 400px;\n}\n\n.title {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\theight: 40px;\n\tbox-sizing: border-box;\n\tmargin: 0;\n\tpadding: 0;\n\ttext-align: center;\n\tcolor: black;\n\tbackground-color: lightblue;\n}\n\n.message {\n\tmargin: 15px 0;\n}\n\n.message-username {\n\tpadding: 4px;\n\tcolor: blue;\n}\n\n.message-text {\n\tdisplay: inline;\n\tpadding: 4px 8px;\n\tborder-radius: 8px;\n\tcolor: black;\n\tbackground-color: lightblue;\n}\n\n.message-time {\n\tfont-size: 11px;\n\tpadding: 2px;\n\tcolor: rgb(61, 61, 61);\n}\n\n.message-list {\n\tflex-grow: 1;\n\tbox-sizing: border-box;\n\tpadding: 0 0 0 6px;\n\tmargin: 0;\n\twidth: 100%;\n\toverflow-y: auto;\n\tbackground-color: white;\n}\n\n.send-message-form {\n\t/*position: fixed;\n bottom: 0px;*/\n\twidth: 100%;\n\tdisplay: flex;\n\tbox-sizing: border-box;\n\theight: 60px;\n\tbackground-color: rgb(216, 216, 216);\n}\n\n.send-message-form input {\n\twidth: 100%;\n\tpadding: 15px 10px;\n\tborder: none;\n\tmargin: 0;\n\tbackground: rgb(216, 216, 216);\n\tcolor: black;\n\tfont-weight: 200;\n}\n\n.send-message-form input:focus {\n\toutline-width: 0;\n}\n\n.send-message-form input::placeholder {\n\tcolor: black;\n}\n",".containerlogin {\r\n background-color: black;\r\n display: flex;\r\n height: 100vh;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\n.loginContainer {\r\n background-color: rgb(66, 66, 66);\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n padding: 50px;\r\n}\r\n\r\n.header {\r\n color: white;\r\n font-size: 30px;\r\n padding: 4px;\r\n}\r\n\r\n.userSuccess {\r\n display: flex;\r\n justify-content: center;\r\n color: green;\r\n margin: 10px 0px;\r\n}\r\n\r\n.userError {\r\n display: flex;\r\n justify-content: center;\r\n color: red;\r\n margin-top: 8px;\r\n}\r\n\r\n.form {\r\n display: flex;\r\n justify-content: center;\r\n}\r\n\r\n.logininput {\r\n display: flex;\r\n flex-direction: column;\r\n height: 35px;\r\n background-color: black;\r\n color: white;\r\n border: 1px solid white;\r\n border-radius: 5px;\r\n margin-top: 10px;\r\n padding: 5px 5px;\r\n width: 300px;\r\n }\r\n\r\n .submitButton {\r\n display: flex;\r\n justify-content: center;\r\n }\r\n\r\n .loginbutton {\r\n background-color: black;\r\n color: white;\r\n padding: 5px 5px;\r\n margin-top: 10px;\r\n height: 38px;\r\n border-radius: 5px;\r\n border: 1px solid white;\r\n cursor: pointer;\r\n width: 275px;\r\n }\r\n"]} \ No newline at end of file diff --git a/build/static/js/2.925e49c8.chunk.js b/build/static/js/2.925e49c8.chunk.js new file mode 100644 index 0000000..91bb3b3 --- /dev/null +++ b/build/static/js/2.925e49c8.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.925e49c8.chunk.js.LICENSE.txt */ +(this["webpackJsonpclubbruin-frontend"]=this["webpackJsonpclubbruin-frontend"]||[]).push([[2],[function(e,t,n){"use strict";n.r(t),n.d(t,"ACESFilmicToneMapping",(function(){return he})),n.d(t,"AddEquation",(function(){return D})),n.d(t,"AddOperation",(function(){return se})),n.d(t,"AdditiveAnimationBlendMode",(function(){return nn})),n.d(t,"AdditiveBlending",(function(){return O})),n.d(t,"AlphaFormat",(function(){return Xe})),n.d(t,"AlwaysDepth",(function(){return Z})),n.d(t,"AlwaysStencilFunc",(function(){return Ln})),n.d(t,"AmbientLight",(function(){return Ff})),n.d(t,"AmbientLightProbe",(function(){return ah})),n.d(t,"AnimationClip",(function(){return Vl})),n.d(t,"AnimationLoader",(function(){return Kl})),n.d(t,"AnimationMixer",(function(){return jh})),n.d(t,"AnimationObjectGroup",(function(){return Nh})),n.d(t,"AnimationUtils",(function(){return Rl})),n.d(t,"ArcCurve",(function(){return af})),n.d(t,"ArrayCamera",(function(){return js})),n.d(t,"ArrowHelper",(function(){return kd})),n.d(t,"Audio",(function(){return mh})),n.d(t,"AudioAnalyser",(function(){return xh})),n.d(t,"AudioContext",(function(){return rh})),n.d(t,"AudioListener",(function(){return vh})),n.d(t,"AudioLoader",(function(){return ih})),n.d(t,"AxesHelper",(function(){return Cd})),n.d(t,"AxisHelper",(function(){return Ep})),n.d(t,"BackSide",(function(){return E})),n.d(t,"BasicDepthPacking",(function(){return vn})),n.d(t,"BasicShadowMap",(function(){return w})),n.d(t,"BinaryTextureLoader",(function(){return Rp})),n.d(t,"Bone",(function(){return wu})),n.d(t,"BooleanKeyframeTrack",(function(){return Nl})),n.d(t,"BoundingBoxHelper",(function(){return Tp})),n.d(t,"Box2",(function(){return Yh})),n.d(t,"Box3",(function(){return lr})),n.d(t,"Box3Helper",(function(){return Ed})),n.d(t,"BoxBufferGeometry",(function(){return xo})),n.d(t,"BoxGeometry",(function(){return Ju})),n.d(t,"BoxHelper",(function(){return Sd})),n.d(t,"BufferAttribute",(function(){return Di})),n.d(t,"BufferGeometry",(function(){return eo})),n.d(t,"BufferGeometryLoader",(function(){return Wf})),n.d(t,"ByteType",(function(){return De})),n.d(t,"Cache",(function(){return Wl})),n.d(t,"Camera",(function(){return Ao})),n.d(t,"CameraHelper",(function(){return bd})),n.d(t,"CanvasRenderer",(function(){return Ip})),n.d(t,"CanvasTexture",(function(){return Xu})),n.d(t,"CatmullRomCurve3",(function(){return hf})),n.d(t,"CineonToneMapping",(function(){return fe})),n.d(t,"CircleBufferGeometry",(function(){return ec})),n.d(t,"CircleGeometry",(function(){return tc})),n.d(t,"ClampToEdgeWrapping",(function(){return xe})),n.d(t,"Clock",(function(){return lh})),n.d(t,"ClosedSplineCurve3",(function(){return xp})),n.d(t,"Color",(function(){return ki})),n.d(t,"ColorKeyframeTrack",(function(){return Fl})),n.d(t,"CompressedTexture",(function(){return Wu})),n.d(t,"CompressedTextureLoader",(function(){return Zl})),n.d(t,"ConeBufferGeometry",(function(){return oc})),n.d(t,"ConeGeometry",(function(){return ic})),n.d(t,"CubeCamera",(function(){return Ro})),n.d(t,"CubeGeometry",(function(){return Ju})),n.d(t,"CubeReflectionMapping",(function(){return ve})),n.d(t,"CubeRefractionMapping",(function(){return me})),n.d(t,"CubeTexture",(function(){return Oo})),n.d(t,"CubeTextureLoader",(function(){return ef})),n.d(t,"CubeUVReflectionMapping",(function(){return be})),n.d(t,"CubeUVRefractionMapping",(function(){return we})),n.d(t,"CubicBezierCurve",(function(){return mf})),n.d(t,"CubicBezierCurve3",(function(){return gf})),n.d(t,"CubicInterpolant",(function(){return Pl})),n.d(t,"CullFaceBack",(function(){return g})),n.d(t,"CullFaceFront",(function(){return y})),n.d(t,"CullFaceFrontBack",(function(){return b})),n.d(t,"CullFaceNone",(function(){return m})),n.d(t,"Curve",(function(){return rf})),n.d(t,"CurvePath",(function(){return Sf})),n.d(t,"CustomBlending",(function(){return L})),n.d(t,"CustomToneMapping",(function(){return de})),n.d(t,"CylinderBufferGeometry",(function(){return nc})),n.d(t,"CylinderGeometry",(function(){return rc})),n.d(t,"Cylindrical",(function(){return Xh})),n.d(t,"DataTexture",(function(){return Io})),n.d(t,"DataTexture2DArray",(function(){return ra})),n.d(t,"DataTexture3D",(function(){return ia})),n.d(t,"DataTextureLoader",(function(){return tf})),n.d(t,"DecrementStencilOp",(function(){return Mn})),n.d(t,"DecrementWrapStencilOp",(function(){return En})),n.d(t,"DefaultLoadingManager",(function(){return ql})),n.d(t,"DepthFormat",(function(){return Ze})),n.d(t,"DepthStencilFormat",(function(){return Je})),n.d(t,"DepthTexture",(function(){return qu})),n.d(t,"DirectionalLight",(function(){return Nf})),n.d(t,"DirectionalLightHelper",(function(){return md})),n.d(t,"DiscreteInterpolant",(function(){return Ll})),n.d(t,"DodecahedronBufferGeometry",(function(){return sc})),n.d(t,"DodecahedronGeometry",(function(){return uc})),n.d(t,"DoubleSide",(function(){return T})),n.d(t,"DstAlphaFactor",(function(){return X})),n.d(t,"DstColorFactor",(function(){return Y})),n.d(t,"DynamicBufferAttribute",(function(){return hp})),n.d(t,"DynamicCopyUsage",(function(){return zn})),n.d(t,"DynamicDrawUsage",(function(){return Nn})),n.d(t,"DynamicReadUsage",(function(){return Un})),n.d(t,"EdgesGeometry",(function(){return dc})),n.d(t,"EdgesHelper",(function(){return Ap})),n.d(t,"EllipseCurve",(function(){return of})),n.d(t,"EqualDepth",(function(){return te})),n.d(t,"EqualStencilFunc",(function(){return Cn})),n.d(t,"EquirectangularReflectionMapping",(function(){return ge})),n.d(t,"EquirectangularRefractionMapping",(function(){return ye})),n.d(t,"Euler",(function(){return Vr})),n.d(t,"EventDispatcher",(function(){return Xn})),n.d(t,"ExtrudeBufferGeometry",(function(){return zc})),n.d(t,"ExtrudeGeometry",(function(){return Hc})),n.d(t,"Face3",(function(){return Ci})),n.d(t,"Face4",(function(){return Kd})),n.d(t,"FaceColors",(function(){return tp})),n.d(t,"FileLoader",(function(){return Ql})),n.d(t,"FlatShading",(function(){return A})),n.d(t,"Float32Attribute",(function(){return wp})),n.d(t,"Float32BufferAttribute",(function(){return Vi})),n.d(t,"Float64Attribute",(function(){return _p})),n.d(t,"Float64BufferAttribute",(function(){return Hi})),n.d(t,"FloatType",(function(){return Be})),n.d(t,"Fog",(function(){return Xs})),n.d(t,"FogExp2",(function(){return Ws})),n.d(t,"Font",(function(){return eh})),n.d(t,"FontLoader",(function(){return nh})),n.d(t,"FrontSide",(function(){return S})),n.d(t,"Frustum",(function(){return No})),n.d(t,"GLBufferAttribute",(function(){return Gh})),n.d(t,"GLSL1",(function(){return Hn})),n.d(t,"GLSL3",(function(){return Wn})),n.d(t,"GammaEncoding",(function(){return cn})),n.d(t,"Geometry",(function(){return Zu})),n.d(t,"GeometryUtils",(function(){return Pp})),n.d(t,"GreaterDepth",(function(){return re})),n.d(t,"GreaterEqualDepth",(function(){return ne})),n.d(t,"GreaterEqualStencilFunc",(function(){return In})),n.d(t,"GreaterStencilFunc",(function(){return On})),n.d(t,"GridHelper",(function(){return fd})),n.d(t,"Group",(function(){return Us})),n.d(t,"HalfFloatType",(function(){return Ge})),n.d(t,"HemisphereLight",(function(){return kf})),n.d(t,"HemisphereLightHelper",(function(){return ld})),n.d(t,"HemisphereLightProbe",(function(){return oh})),n.d(t,"IcosahedronBufferGeometry",(function(){return Wc})),n.d(t,"IcosahedronGeometry",(function(){return Xc})),n.d(t,"ImageBitmapLoader",(function(){return Zf})),n.d(t,"ImageLoader",(function(){return Jl})),n.d(t,"ImageUtils",(function(){return er})),n.d(t,"ImmediateRenderObject",(function(){return Zh})),n.d(t,"IncrementStencilOp",(function(){return xn})),n.d(t,"IncrementWrapStencilOp",(function(){return Sn})),n.d(t,"InstancedBufferAttribute",(function(){return Hf})),n.d(t,"InstancedBufferGeometry",(function(){return Vf})),n.d(t,"InstancedInterleavedBuffer",(function(){return Bh})),n.d(t,"InstancedMesh",(function(){return Eu})),n.d(t,"Int16Attribute",(function(){return mp})),n.d(t,"Int16BufferAttribute",(function(){return Ui})),n.d(t,"Int32Attribute",(function(){return yp})),n.d(t,"Int32BufferAttribute",(function(){return Gi})),n.d(t,"Int8Attribute",(function(){return dp})),n.d(t,"Int8BufferAttribute",(function(){return Ni})),n.d(t,"IntType",(function(){return je})),n.d(t,"InterleavedBuffer",(function(){return Ys})),n.d(t,"InterleavedBufferAttribute",(function(){return Ks})),n.d(t,"Interpolant",(function(){return Ol})),n.d(t,"InterpolateDiscrete",(function(){return $t})),n.d(t,"InterpolateLinear",(function(){return Qt})),n.d(t,"InterpolateSmooth",(function(){return Kt})),n.d(t,"InvertStencilOp",(function(){return Tn})),n.d(t,"JSONLoader",(function(){return Lp})),n.d(t,"KeepStencilOp",(function(){return wn})),n.d(t,"KeyframeTrack",(function(){return Dl})),n.d(t,"LOD",(function(){return vu})),n.d(t,"LatheBufferGeometry",(function(){return qc})),n.d(t,"LatheGeometry",(function(){return Yc})),n.d(t,"Layers",(function(){return Xr})),n.d(t,"LensFlare",(function(){return Np})),n.d(t,"LessDepth",(function(){return J})),n.d(t,"LessEqualDepth",(function(){return ee})),n.d(t,"LessEqualStencilFunc",(function(){return Rn})),n.d(t,"LessStencilFunc",(function(){return kn})),n.d(t,"Light",(function(){return Af})),n.d(t,"LightProbe",(function(){return Bf})),n.d(t,"Line",(function(){return Pu})),n.d(t,"Line3",(function(){return Kh})),n.d(t,"LineBasicMaterial",(function(){return Tu})),n.d(t,"LineCurve",(function(){return yf})),n.d(t,"LineCurve3",(function(){return bf})),n.d(t,"LineDashedMaterial",(function(){return kl})),n.d(t,"LineLoop",(function(){return Nu})),n.d(t,"LinePieces",(function(){return Jd})),n.d(t,"LineSegments",(function(){return Du})),n.d(t,"LineStrip",(function(){return Zd})),n.d(t,"LinearEncoding",(function(){return sn})),n.d(t,"LinearFilter",(function(){return Ce})),n.d(t,"LinearInterpolant",(function(){return Il})),n.d(t,"LinearMipMapLinearFilter",(function(){return Ie})),n.d(t,"LinearMipMapNearestFilter",(function(){return Oe})),n.d(t,"LinearMipmapLinearFilter",(function(){return Pe})),n.d(t,"LinearMipmapNearestFilter",(function(){return Re})),n.d(t,"LinearToneMapping",(function(){return ce})),n.d(t,"Loader",(function(){return Yl})),n.d(t,"LoaderUtils",(function(){return zf})),n.d(t,"LoadingManager",(function(){return Xl})),n.d(t,"LogLuvEncoding",(function(){return fn})),n.d(t,"LoopOnce",(function(){return Xt})),n.d(t,"LoopPingPong",(function(){return Yt})),n.d(t,"LoopRepeat",(function(){return qt})),n.d(t,"LuminanceAlphaFormat",(function(){return Qe})),n.d(t,"LuminanceFormat",(function(){return $e})),n.d(t,"MOUSE",(function(){return p})),n.d(t,"Material",(function(){return Oi})),n.d(t,"MaterialLoader",(function(){return Gf})),n.d(t,"Math",(function(){return Kn})),n.d(t,"MathUtils",(function(){return Kn})),n.d(t,"Matrix3",(function(){return Jn})),n.d(t,"Matrix4",(function(){return Dr})),n.d(t,"MaxEquation",(function(){return U})),n.d(t,"Mesh",(function(){return bo})),n.d(t,"MeshBasicMaterial",(function(){return Pi})),n.d(t,"MeshDepthMaterial",(function(){return Ps})),n.d(t,"MeshDistanceMaterial",(function(){return Is})),n.d(t,"MeshFaceMaterial",(function(){return rp})),n.d(t,"MeshLambertMaterial",(function(){return Tl})),n.d(t,"MeshMatcapMaterial",(function(){return Al})),n.d(t,"MeshNormalMaterial",(function(){return El})),n.d(t,"MeshPhongMaterial",(function(){return Ml})),n.d(t,"MeshPhysicalMaterial",(function(){return xl})),n.d(t,"MeshStandardMaterial",(function(){return _l})),n.d(t,"MeshToonMaterial",(function(){return Sl})),n.d(t,"MinEquation",(function(){return j})),n.d(t,"MirroredRepeatWrapping",(function(){return Me})),n.d(t,"MixOperation",(function(){return ae})),n.d(t,"MultiMaterial",(function(){return ip})),n.d(t,"MultiplyBlending",(function(){return I})),n.d(t,"MultiplyOperation",(function(){return oe})),n.d(t,"NearestFilter",(function(){return Se})),n.d(t,"NearestMipMapLinearFilter",(function(){return ke})),n.d(t,"NearestMipMapNearestFilter",(function(){return Te})),n.d(t,"NearestMipmapLinearFilter",(function(){return Ae})),n.d(t,"NearestMipmapNearestFilter",(function(){return Ee})),n.d(t,"NeverDepth",(function(){return K})),n.d(t,"NeverStencilFunc",(function(){return An})),n.d(t,"NoBlending",(function(){return C})),n.d(t,"NoColors",(function(){return ep})),n.d(t,"NoToneMapping",(function(){return ue})),n.d(t,"NormalAnimationBlendMode",(function(){return tn})),n.d(t,"NormalBlending",(function(){return R})),n.d(t,"NotEqualDepth",(function(){return ie})),n.d(t,"NotEqualStencilFunc",(function(){return Pn})),n.d(t,"NumberKeyframeTrack",(function(){return jl})),n.d(t,"Object3D",(function(){return ai})),n.d(t,"ObjectLoader",(function(){return Yf})),n.d(t,"ObjectSpaceNormalMap",(function(){return yn})),n.d(t,"OctahedronBufferGeometry",(function(){return $c})),n.d(t,"OctahedronGeometry",(function(){return Qc})),n.d(t,"OneFactor",(function(){return G})),n.d(t,"OneMinusDstAlphaFactor",(function(){return q})),n.d(t,"OneMinusDstColorFactor",(function(){return $})),n.d(t,"OneMinusSrcAlphaFactor",(function(){return W})),n.d(t,"OneMinusSrcColorFactor",(function(){return V})),n.d(t,"OrthographicCamera",(function(){return Lf})),n.d(t,"PCFShadowMap",(function(){return _})),n.d(t,"PCFSoftShadowMap",(function(){return x})),n.d(t,"PMREMGenerator",(function(){return Hd})),n.d(t,"ParametricBufferGeometry",(function(){return Kc})),n.d(t,"ParametricGeometry",(function(){return Zc})),n.d(t,"Particle",(function(){return ap})),n.d(t,"ParticleBasicMaterial",(function(){return cp})),n.d(t,"ParticleSystem",(function(){return sp})),n.d(t,"ParticleSystemMaterial",(function(){return lp})),n.d(t,"Path",(function(){return Ef})),n.d(t,"PerspectiveCamera",(function(){return ko})),n.d(t,"Plane",(function(){return li})),n.d(t,"PlaneBufferGeometry",(function(){return Uo})),n.d(t,"PlaneGeometry",(function(){return Jc})),n.d(t,"PlaneHelper",(function(){return Td})),n.d(t,"PointCloud",(function(){return op})),n.d(t,"PointCloudMaterial",(function(){return up})),n.d(t,"PointLight",(function(){return If})),n.d(t,"PointLightHelper",(function(){return ad})),n.d(t,"Points",(function(){return zu})),n.d(t,"PointsMaterial",(function(){return Fu})),n.d(t,"PolarGridHelper",(function(){return hd})),n.d(t,"PolyhedronBufferGeometry",(function(){return ac})),n.d(t,"PolyhedronGeometry",(function(){return el})),n.d(t,"PositionalAudio",(function(){return _h})),n.d(t,"PropertyBinding",(function(){return Dh})),n.d(t,"PropertyMixer",(function(){return Mh})),n.d(t,"QuadraticBezierCurve",(function(){return wf})),n.d(t,"QuadraticBezierCurve3",(function(){return _f})),n.d(t,"Quaternion",(function(){return ar})),n.d(t,"QuaternionKeyframeTrack",(function(){return Bl})),n.d(t,"QuaternionLinearInterpolant",(function(){return Ul})),n.d(t,"REVISION",(function(){return d})),n.d(t,"RGBADepthPacking",(function(){return mn})),n.d(t,"RGBAFormat",(function(){return Ye})),n.d(t,"RGBAIntegerFormat",(function(){return ot})),n.d(t,"RGBA_ASTC_10x10_Format",(function(){return kt})),n.d(t,"RGBA_ASTC_10x5_Format",(function(){return Et})),n.d(t,"RGBA_ASTC_10x6_Format",(function(){return Tt})),n.d(t,"RGBA_ASTC_10x8_Format",(function(){return At})),n.d(t,"RGBA_ASTC_12x10_Format",(function(){return Ct})),n.d(t,"RGBA_ASTC_12x12_Format",(function(){return Rt})),n.d(t,"RGBA_ASTC_4x4_Format",(function(){return gt})),n.d(t,"RGBA_ASTC_5x4_Format",(function(){return yt})),n.d(t,"RGBA_ASTC_5x5_Format",(function(){return bt})),n.d(t,"RGBA_ASTC_6x5_Format",(function(){return wt})),n.d(t,"RGBA_ASTC_6x6_Format",(function(){return _t})),n.d(t,"RGBA_ASTC_8x5_Format",(function(){return xt})),n.d(t,"RGBA_ASTC_8x6_Format",(function(){return Mt})),n.d(t,"RGBA_ASTC_8x8_Format",(function(){return St})),n.d(t,"RGBA_BPTC_Format",(function(){return Ot})),n.d(t,"RGBA_ETC2_EAC_Format",(function(){return mt})),n.d(t,"RGBA_PVRTC_2BPPV1_Format",(function(){return dt})),n.d(t,"RGBA_PVRTC_4BPPV1_Format",(function(){return ht})),n.d(t,"RGBA_S3TC_DXT1_Format",(function(){return st})),n.d(t,"RGBA_S3TC_DXT3_Format",(function(){return ut})),n.d(t,"RGBA_S3TC_DXT5_Format",(function(){return ct})),n.d(t,"RGBDEncoding",(function(){return pn})),n.d(t,"RGBEEncoding",(function(){return ln})),n.d(t,"RGBEFormat",(function(){return Ke})),n.d(t,"RGBFormat",(function(){return qe})),n.d(t,"RGBIntegerFormat",(function(){return it})),n.d(t,"RGBM16Encoding",(function(){return dn})),n.d(t,"RGBM7Encoding",(function(){return hn})),n.d(t,"RGB_ETC1_Format",(function(){return pt})),n.d(t,"RGB_ETC2_Format",(function(){return vt})),n.d(t,"RGB_PVRTC_2BPPV1_Format",(function(){return ft})),n.d(t,"RGB_PVRTC_4BPPV1_Format",(function(){return lt})),n.d(t,"RGB_S3TC_DXT1_Format",(function(){return at})),n.d(t,"RGFormat",(function(){return nt})),n.d(t,"RGIntegerFormat",(function(){return rt})),n.d(t,"RawShaderMaterial",(function(){return wl})),n.d(t,"Ray",(function(){return Lr})),n.d(t,"Raycaster",(function(){return zh})),n.d(t,"RectAreaLight",(function(){return jf})),n.d(t,"RedFormat",(function(){return et})),n.d(t,"RedIntegerFormat",(function(){return tt})),n.d(t,"ReinhardToneMapping",(function(){return le})),n.d(t,"RepeatWrapping",(function(){return _e})),n.d(t,"ReplaceStencilOp",(function(){return _n})),n.d(t,"ReverseSubtractEquation",(function(){return F})),n.d(t,"RingBufferGeometry",(function(){return tl})),n.d(t,"RingGeometry",(function(){return nl})),n.d(t,"SRGB8_ALPHA8_ASTC_10x10_Format",(function(){return Vt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x5_Format",(function(){return Bt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x6_Format",(function(){return Gt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x8_Format",(function(){return zt})),n.d(t,"SRGB8_ALPHA8_ASTC_12x10_Format",(function(){return Ht})),n.d(t,"SRGB8_ALPHA8_ASTC_12x12_Format",(function(){return Wt})),n.d(t,"SRGB8_ALPHA8_ASTC_4x4_Format",(function(){return Pt})),n.d(t,"SRGB8_ALPHA8_ASTC_5x4_Format",(function(){return It})),n.d(t,"SRGB8_ALPHA8_ASTC_5x5_Format",(function(){return Lt})),n.d(t,"SRGB8_ALPHA8_ASTC_6x5_Format",(function(){return Dt})),n.d(t,"SRGB8_ALPHA8_ASTC_6x6_Format",(function(){return Nt})),n.d(t,"SRGB8_ALPHA8_ASTC_8x5_Format",(function(){return Ft})),n.d(t,"SRGB8_ALPHA8_ASTC_8x6_Format",(function(){return jt})),n.d(t,"SRGB8_ALPHA8_ASTC_8x8_Format",(function(){return Ut})),n.d(t,"Scene",(function(){return qs})),n.d(t,"SceneUtils",(function(){return Dp})),n.d(t,"ShaderChunk",(function(){return Bo})),n.d(t,"ShaderLib",(function(){return zo})),n.d(t,"ShaderMaterial",(function(){return To})),n.d(t,"ShadowMaterial",(function(){return bl})),n.d(t,"Shape",(function(){return Tf})),n.d(t,"ShapeBufferGeometry",(function(){return rl})),n.d(t,"ShapeGeometry",(function(){return il})),n.d(t,"ShapePath",(function(){return Jf})),n.d(t,"ShapeUtils",(function(){return Uc})),n.d(t,"ShortType",(function(){return Ne})),n.d(t,"Skeleton",(function(){return bu})),n.d(t,"SkeletonHelper",(function(){return id})),n.d(t,"SkinnedMesh",(function(){return mu})),n.d(t,"SmoothShading",(function(){return k})),n.d(t,"Sphere",(function(){return Tr})),n.d(t,"SphereBufferGeometry",(function(){return ol})),n.d(t,"SphereGeometry",(function(){return al})),n.d(t,"Spherical",(function(){return Wh})),n.d(t,"SphericalHarmonics3",(function(){return Uf})),n.d(t,"Spline",(function(){return Sp})),n.d(t,"SplineCurve",(function(){return xf})),n.d(t,"SplineCurve3",(function(){return Mp})),n.d(t,"SpotLight",(function(){return Of})),n.d(t,"SpotLightHelper",(function(){return ed})),n.d(t,"Sprite",(function(){return fu})),n.d(t,"SpriteMaterial",(function(){return Zs})),n.d(t,"SrcAlphaFactor",(function(){return H})),n.d(t,"SrcAlphaSaturateFactor",(function(){return Q})),n.d(t,"SrcColorFactor",(function(){return z})),n.d(t,"StaticCopyUsage",(function(){return Gn})),n.d(t,"StaticDrawUsage",(function(){return Dn})),n.d(t,"StaticReadUsage",(function(){return jn})),n.d(t,"StereoCamera",(function(){return ch})),n.d(t,"StreamCopyUsage",(function(){return Vn})),n.d(t,"StreamDrawUsage",(function(){return Fn})),n.d(t,"StreamReadUsage",(function(){return Bn})),n.d(t,"StringKeyframeTrack",(function(){return Gl})),n.d(t,"SubtractEquation",(function(){return N})),n.d(t,"SubtractiveBlending",(function(){return P})),n.d(t,"TOUCH",(function(){return v})),n.d(t,"TangentSpaceNormalMap",(function(){return gn})),n.d(t,"TetrahedronBufferGeometry",(function(){return sl})),n.d(t,"TetrahedronGeometry",(function(){return ul})),n.d(t,"TextBufferGeometry",(function(){return cl})),n.d(t,"TextGeometry",(function(){return ll})),n.d(t,"Texture",(function(){return nr})),n.d(t,"TextureLoader",(function(){return nf})),n.d(t,"TorusBufferGeometry",(function(){return fl})),n.d(t,"TorusGeometry",(function(){return hl})),n.d(t,"TorusKnotBufferGeometry",(function(){return dl})),n.d(t,"TorusKnotGeometry",(function(){return pl})),n.d(t,"Triangle",(function(){return _i})),n.d(t,"TriangleFanDrawMode",(function(){return an})),n.d(t,"TriangleStripDrawMode",(function(){return on})),n.d(t,"TrianglesDrawMode",(function(){return rn})),n.d(t,"TubeBufferGeometry",(function(){return vl})),n.d(t,"TubeGeometry",(function(){return ml})),n.d(t,"UVMapping",(function(){return pe})),n.d(t,"Uint16Attribute",(function(){return gp})),n.d(t,"Uint16BufferAttribute",(function(){return Bi})),n.d(t,"Uint32Attribute",(function(){return bp})),n.d(t,"Uint32BufferAttribute",(function(){return zi})),n.d(t,"Uint8Attribute",(function(){return pp})),n.d(t,"Uint8BufferAttribute",(function(){return Fi})),n.d(t,"Uint8ClampedAttribute",(function(){return vp})),n.d(t,"Uint8ClampedBufferAttribute",(function(){return ji})),n.d(t,"Uniform",(function(){return Uh})),n.d(t,"UniformsLib",(function(){return Go})),n.d(t,"UniformsUtils",(function(){return Eo})),n.d(t,"UnsignedByteType",(function(){return Le})),n.d(t,"UnsignedInt248Type",(function(){return We})),n.d(t,"UnsignedIntType",(function(){return Ue})),n.d(t,"UnsignedShort4444Type",(function(){return ze})),n.d(t,"UnsignedShort5551Type",(function(){return Ve})),n.d(t,"UnsignedShort565Type",(function(){return He})),n.d(t,"UnsignedShortType",(function(){return Fe})),n.d(t,"VSMShadowMap",(function(){return M})),n.d(t,"Vector2",(function(){return Zn})),n.d(t,"Vector3",(function(){return sr})),n.d(t,"Vector4",(function(){return rr})),n.d(t,"VectorKeyframeTrack",(function(){return zl})),n.d(t,"Vertex",(function(){return fp})),n.d(t,"VertexColors",(function(){return np})),n.d(t,"VideoTexture",(function(){return Hu})),n.d(t,"WebGL1Renderer",(function(){return Hs})),n.d(t,"WebGLCubeRenderTarget",(function(){return Po})),n.d(t,"WebGLMultisampleRenderTarget",(function(){return or})),n.d(t,"WebGLRenderTarget",(function(){return ir})),n.d(t,"WebGLRenderTargetCube",(function(){return Op})),n.d(t,"WebGLRenderer",(function(){return Vs})),n.d(t,"WebGLUtils",(function(){return Fs})),n.d(t,"WireframeGeometry",(function(){return gl})),n.d(t,"WireframeHelper",(function(){return kp})),n.d(t,"WrapAroundEnding",(function(){return en})),n.d(t,"XHRLoader",(function(){return Cp})),n.d(t,"ZeroCurvatureEnding",(function(){return Zt})),n.d(t,"ZeroFactor",(function(){return B})),n.d(t,"ZeroSlopeEnding",(function(){return Jt})),n.d(t,"ZeroStencilOp",(function(){return bn})),n.d(t,"sRGBEncoding",(function(){return un}));var r,i=n(77),o=n(19),a=n(15),s=n(12),u=n(22),c=n(7),l=n(8),f=n(4),h=n(10),d="122",p={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},v={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},m=0,g=1,y=2,b=3,w=0,_=1,x=2,M=3,S=0,E=1,T=2,A=1,k=2,C=0,R=1,O=2,P=3,I=4,L=5,D=100,N=101,F=102,j=103,U=104,B=200,G=201,z=202,V=203,H=204,W=205,X=206,q=207,Y=208,$=209,Q=210,K=0,Z=1,J=2,ee=3,te=4,ne=5,re=6,ie=7,oe=0,ae=1,se=2,ue=0,ce=1,le=2,fe=3,he=4,de=5,pe=300,ve=301,me=302,ge=303,ye=304,be=306,we=307,_e=1e3,xe=1001,Me=1002,Se=1003,Ee=1004,Te=1004,Ae=1005,ke=1005,Ce=1006,Re=1007,Oe=1007,Pe=1008,Ie=1008,Le=1009,De=1010,Ne=1011,Fe=1012,je=1013,Ue=1014,Be=1015,Ge=1016,ze=1017,Ve=1018,He=1019,We=1020,Xe=1021,qe=1022,Ye=1023,$e=1024,Qe=1025,Ke=Ye,Ze=1026,Je=1027,et=1028,tt=1029,nt=1030,rt=1031,it=1032,ot=1033,at=33776,st=33777,ut=33778,ct=33779,lt=35840,ft=35841,ht=35842,dt=35843,pt=36196,vt=37492,mt=37496,gt=37808,yt=37809,bt=37810,wt=37811,_t=37812,xt=37813,Mt=37814,St=37815,Et=37816,Tt=37817,At=37818,kt=37819,Ct=37820,Rt=37821,Ot=36492,Pt=37840,It=37841,Lt=37842,Dt=37843,Nt=37844,Ft=37845,jt=37846,Ut=37847,Bt=37848,Gt=37849,zt=37850,Vt=37851,Ht=37852,Wt=37853,Xt=2200,qt=2201,Yt=2202,$t=2300,Qt=2301,Kt=2302,Zt=2400,Jt=2401,en=2402,tn=2500,nn=2501,rn=0,on=1,an=2,sn=3e3,un=3001,cn=3007,ln=3002,fn=3003,hn=3004,dn=3005,pn=3006,vn=3200,mn=3201,gn=0,yn=1,bn=0,wn=7680,_n=7681,xn=7682,Mn=7683,Sn=34055,En=34056,Tn=5386,An=512,kn=513,Cn=514,Rn=515,On=516,Pn=517,In=518,Ln=519,Dn=35044,Nn=35048,Fn=35040,jn=35045,Un=35049,Bn=35041,Gn=35046,zn=35050,Vn=35042,Hn="100",Wn="300 es";function Xn(){}Object.assign(Xn.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r>8&255]+qn[e>>16&255]+qn[e>>24&255]+"-"+qn[255&t]+qn[t>>8&255]+"-"+qn[t>>16&15|64]+qn[t>>24&255]+"-"+qn[63&n|128]+qn[n>>8&255]+"-"+qn[n>>16&255]+qn[n>>24&255]+qn[255&r]+qn[r>>8&255]+qn[r>>16&255]+qn[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(Qn=e%2147483647),((Qn=16807*Qn%2147483647)-1)/2147483646},degToRad:function(e){return e*Kn.DEG2RAD},radToDeg:function(e){return e*Kn.RAD2DEG},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),u=a(n/2),c=o((t+r)/2),l=a((t+r)/2),f=o((t-r)/2),h=a((t-r)/2),d=o((r-t)/2),p=a((r-t)/2);switch(i){case"XYX":e.set(s*l,u*f,u*h,s*c);break;case"YZY":e.set(u*h,s*l,u*f,s*c);break;case"ZXZ":e.set(u*f,u*h,s*l,s*c);break;case"XZX":e.set(s*l,u*p,u*d,s*c);break;case"YXY":e.set(u*d,s*l,u*p,s*c);break;case"ZYZ":e.set(u*p,u*d,s*l,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}},Zn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(f.a)(this,e),Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=n}return Object(h.a)(e,[{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}}]),e}(),Jn=function(){function e(){Object(f.a)(this,e),Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}return Object(h.a)(e,[{key:"set",value:function(e,t,n,r,i,o,a,s,u){var c=this.elements;return c[0]=e,c[1]=r,c[2]=a,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=o,c[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],u=n[1],c=n[4],l=n[7],f=n[2],h=n[5],d=n[8],p=r[0],v=r[3],m=r[6],g=r[1],y=r[4],b=r[7],w=r[2],_=r[5],x=r[8];return i[0]=o*p+a*g+s*w,i[3]=o*v+a*y+s*_,i[6]=o*m+a*b+s*x,i[1]=u*p+c*g+l*w,i[4]=u*v+c*y+l*_,i[7]=u*m+c*b+l*x,i[2]=f*p+h*g+d*w,i[5]=f*v+h*y+d*_,i[8]=f*m+h*b+d*x,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8];return t*o*c-t*a*u-n*i*c+n*a*s+r*i*u-r*o*s}},{key:"getInverse",value:function(e,t){void 0!==t&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=e.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5],l=n[6],f=n[7],h=n[8],d=h*u-c*f,p=c*l-h*s,v=f*s-u*l,m=i*d+o*p+a*v;if(0===m)return this.set(0,0,0,0,0,0,0,0,0);var g=1/m;return r[0]=d*g,r[1]=(a*f-h*o)*g,r[2]=(c*o-a*u)*g,r[3]=p*g,r[4]=(h*i-a*l)*g,r[5]=(a*s-c*i)*g,r[6]=v*g,r[7]=(o*l-f*i)*g,r[8]=(u*i-o*s)*g,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,n,r,i,o,a){var s=Math.cos(i),u=Math.sin(i);this.set(n*s,n*u,-n*(s*o+u*a)+o+e,-r*u,r*s,-r*(-u*o+s*a)+a+t,0,0,1)}},{key:"scale",value:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],u=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*u,r[6]=t*a+n*c,r[1]=-n*i+t*s,r[4]=-n*o+t*u,r[7]=-n*a+t*c,this}},{key:"translate",value:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}]),e}(),er={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===$n&&($n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),$n.width=e.width,$n.height=e.height;var n=$n.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=$n}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},tr=0;function nr(e,t,n,r,i,o,a,s,u,c){Object.defineProperty(this,"id",{value:tr++}),this.uuid=Kn.generateUUID(),this.name="",this.image=void 0!==e?e:nr.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:nr.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:xe,this.wrapT=void 0!==r?r:xe,this.magFilter=void 0!==i?i:Ce,this.minFilter=void 0!==o?o:Pe,this.anisotropy=void 0!==u?u:1,this.format=void 0!==a?a:Ye,this.internalFormat=null,this.type=void 0!==s?s:Le,this.offset=new Zn(0,0),this.repeat=new Zn(1,1),this.center=new Zn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Jn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:sn,this.version=0,this.onUpdate=null}nr.DEFAULT_IMAGE=void 0,nr.DEFAULT_MAPPING=pe,nr.prototype=Object.assign(Object.create(Xn.prototype),{constructor:nr,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=Kn.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o1)switch(this.wrapS){case _e:e.x=e.x-Math.floor(e.x);break;case xe:e.x=e.x<0?0:1;break;case Me:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case _e:e.y=e.y-Math.floor(e.y);break;case xe:e.y=e.y<0?0:1;break;case Me:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(nr.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});var rr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object(f.a)(this,e),Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=n,this.z=r,this.w=i}return Object(h.a)(e,[{key:"set",value:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,r,i,o=.01,a=.1,s=e.elements,u=s[0],c=s[4],l=s[8],f=s[1],h=s[5],d=s[9],p=s[2],v=s[6],m=s[10];if(Math.abs(c-f)y&&g>b?gb?y1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}}]),e}();function ir(e,t,n){this.width=e,this.height=t,this.scissor=new rr(0,0,e,t),this.scissorTest=!1,this.viewport=new rr(0,0,e,t),n=n||{},this.texture=new nr(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Ce,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function or(e,t,n){ir.call(this,e,t,n),this.samples=4}ir.prototype=Object.assign(Object.create(Xn.prototype),{constructor:ir,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),or.prototype=Object.assign(Object.create(ir.prototype),{constructor:or,isWebGLMultisampleRenderTarget:!0,copy:function(e){return ir.prototype.copy.call(this,e),this.samples=e.samples,this}});var ar=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object(f.a)(this,e),Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=n,this._z=r,this._w=i}return Object(h.a)(e,[{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,u=a(n/2),c=a(r/2),l=a(i/2),f=s(n/2),h=s(r/2),d=s(i/2);switch(o){case"XYZ":this._x=f*c*l+u*h*d,this._y=u*h*l-f*c*d,this._z=u*c*d+f*h*l,this._w=u*c*l-f*h*d;break;case"YXZ":this._x=f*c*l+u*h*d,this._y=u*h*l-f*c*d,this._z=u*c*d-f*h*l,this._w=u*c*l+f*h*d;break;case"ZXY":this._x=f*c*l-u*h*d,this._y=u*h*l+f*c*d,this._z=u*c*d+f*h*l,this._w=u*c*l-f*h*d;break;case"ZYX":this._x=f*c*l-u*h*d,this._y=u*h*l+f*c*d,this._z=u*c*d-f*h*l,this._w=u*c*l+f*h*d;break;case"YZX":this._x=f*c*l+u*h*d,this._y=u*h*l+f*c*d,this._z=u*c*d-f*h*l,this._w=u*c*l-f*h*d;break;case"XZY":this._x=f*c*l-u*h*d,this._y=u*h*l-f*c*d,this._z=u*c*d+f*h*l,this._w=u*c*l+f*h*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],a=t[5],s=t[9],u=t[2],c=t[6],l=t[10],f=n+a+l;if(f>0){var h=.5/Math.sqrt(f+1);this._w=.25/h,this._x=(c-s)*h,this._y=(i-u)*h,this._z=(o-r)*h}else if(n>a&&n>l){var d=2*Math.sqrt(1+n-a-l);this._w=(c-s)/d,this._x=.25*d,this._y=(r+o)/d,this._z=(i+u)/d}else if(a>l){var p=2*Math.sqrt(1+a-n-l);this._w=(i-u)/p,this._x=(r+o)/p,this._y=.25*p,this._z=(s+c)/p}else{var v=2*Math.sqrt(1+l-n-a);this._w=(o-r)/v,this._x=(i+u)/v,this._y=(s+c)/v,this._z=.25*v}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(Kn.clamp(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"inverse",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,u=t._z,c=t._w;return this._x=n*c+o*a+r*u-i*s,this._y=r*c+o*s+i*a-n*u,this._z=i*c+o*u+n*s-r*a,this._w=o*c-n*a-r*s-i*u,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-t;return this._w=u*o+t*this._w,this._x=u*n+t*this._x,this._y=u*r+t*this._y,this._z=u*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),l=Math.atan2(c,a),f=Math.sin((1-t)*l)/c,h=Math.sin(t*l)/c;return this._w=o*f+this._w*h,this._x=n*f+this._x*h,this._y=r*f+this._y*h,this._z=i*f+this._z*h,this._onChangeCallback(),this}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}],[{key:"slerp",value:function(e,t,n,r){return n.copy(e).slerp(t,r)}},{key:"slerpFlat",value:function(e,t,n,r,i,o,a){var s=n[r+0],u=n[r+1],c=n[r+2],l=n[r+3],f=i[o+0],h=i[o+1],d=i[o+2],p=i[o+3];if(l!==p||s!==f||u!==h||c!==d){var v=1-a,m=s*f+u*h+c*d+l*p,g=m>=0?1:-1,y=1-m*m;if(y>Number.EPSILON){var b=Math.sqrt(y),w=Math.atan2(b,m*g);v=Math.sin(v*w)/b,a=Math.sin(a*w)/b}var _=a*g;if(s=s*v+f*_,u=u*v+h*_,c=c*v+d*_,l=l*v+p*_,v===1-a){var x=1/Math.sqrt(s*s+u*u+c*c+l*l);s*=x,u*=x,c*=x,l*=x}}e[t]=s,e[t+1]=u,e[t+2]=c,e[t+3]=l}},{key:"multiplyQuaternionsFlat",value:function(e,t,n,r,i,o){var a=n[r],s=n[r+1],u=n[r+2],c=n[r+3],l=i[o],f=i[o+1],h=i[o+2],d=i[o+3];return e[t]=a*d+c*l+s*h-u*f,e[t+1]=s*d+c*f+u*l-a*h,e[t+2]=u*d+c*h+a*f-s*l,e[t+3]=c*d-a*l-s*f-u*h,e}}]),e}(),sr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(f.a)(this,e),Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=n,this.z=r}return Object(h.a)(e,[{key:"set",value:function(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(cr.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(cr.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this}},{key:"applyQuaternion",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,u=s*t+o*r-a*n,c=s*n+a*t-i*r,l=s*r+i*n-o*t,f=-i*t-o*n-a*r;return this.x=u*s+f*-i+c*-a-l*-o,this.y=c*s+f*-o+l*-i-u*-a,this.z=l*s+f*-a+u*-o-c*-i,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}},{key:"cross",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(e){return ur.copy(this).projectOnVector(e),this.sub(ur)}},{key:"reflect",value:function(e){return this.sub(ur.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(Kn.clamp(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}]),e}(),ur=new sr,cr=new ar,lr=function(){function e(t,n){Object(f.a)(this,e),Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new sr(1/0,1/0,1/0),this.max=void 0!==n?n:new sr(-1/0,-1/0,-1/0)}return Object(h.a)(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.length;si&&(i=c),l>o&&(o=l),f>a&&(a=f)}return this.min.set(t,n,r),this.max.set(i,o,a),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.count;si&&(i=c),l>o&&(o=l),f>a&&(a=f)}return this.min.set(t,n,r),this.max.set(i,o,a),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new sr),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,dr),dr.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(_r),xr.subVectors(this.max,_r),vr.subVectors(e.a,_r),mr.subVectors(e.b,_r),gr.subVectors(e.c,_r),yr.subVectors(mr,vr),br.subVectors(gr,mr),wr.subVectors(vr,gr);var t=[0,-yr.z,yr.y,0,-br.z,br.y,0,-wr.z,wr.y,yr.z,0,-yr.x,br.z,0,-br.x,wr.z,0,-wr.x,-yr.y,yr.x,0,-br.y,br.x,0,-wr.y,wr.x,0];return!!fr(t,vr,mr,gr,xr)&&(!!fr(t=[1,0,0,0,1,0,0,0,1],vr,mr,gr,xr)&&(Mr.crossVectors(yr,br),fr(t=[Mr.x,Mr.y,Mr.z],vr,mr,gr,xr)))}},{key:"clampPoint",value:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new sr),t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return dr.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"getBoundingSphere",value:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(dr).length(),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(hr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),hr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),hr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),hr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),hr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),hr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),hr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),hr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(hr)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}();function fr(e,t,n,r,i){for(var o=0,a=e.length-3;o<=a;o+=3){Sr.fromArray(e,o);var s=i.x*Math.abs(Sr.x)+i.y*Math.abs(Sr.y)+i.z*Math.abs(Sr.z),u=t.dot(Sr),c=n.dot(Sr),l=r.dot(Sr);if(Math.max(-Math.max(u,c,l),Math.min(u,c,l))>s)return!1}return!0}var hr=[new sr,new sr,new sr,new sr,new sr,new sr,new sr,new sr],dr=new sr,pr=new lr,vr=new sr,mr=new sr,gr=new sr,yr=new sr,br=new sr,wr=new sr,_r=new sr,xr=new sr,Mr=new sr,Sr=new sr,Er=new lr,Tr=function(){function e(t,n){Object(f.a)(this,e),this.center=void 0!==t?t:new sr,this.radius=void 0!==n?n:-1}return Object(h.a)(e,[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var n=this.center;void 0!==t?n.copy(t):Er.setFromPoints(e).getCenter(n);for(var r=0,i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new lr),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}]),e}(),Ar=new sr,kr=new sr,Cr=new sr,Rr=new sr,Or=new sr,Pr=new sr,Ir=new sr,Lr=function(){function e(t,n){Object(f.a)(this,e),this.origin=void 0!==t?t:new sr,this.direction=void 0!==n?n:new sr(0,0,-1)}return Object(h.a)(e,[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new sr),t.copy(this.direction).multiplyScalar(e).add(this.origin)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,Ar)),this}},{key:"closestPointToPoint",value:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new sr),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=Ar.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ar.copy(this.direction).multiplyScalar(t).add(this.origin),Ar.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,n,r){kr.copy(e).add(t).multiplyScalar(.5),Cr.copy(t).sub(e).normalize(),Rr.copy(this.origin).sub(kr);var i,o,a,s,u=.5*e.distanceTo(t),c=-this.direction.dot(Cr),l=Rr.dot(this.direction),f=-Rr.dot(Cr),h=Rr.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(o=c*l-f,s=u*d,(i=c*f-l)>=0)if(o>=-s)if(o<=s){var p=1/d;a=(i*=p)*(i+c*(o*=p)+2*l)+o*(c*i+o+2*f)+h}else o=u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*f)+h;else o=-u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*f)+h;else o<=-s?a=-(i=Math.max(0,-(-c*u+l)))*i+(o=i>0?-u:Math.min(Math.max(-u,-f),u))*(o+2*f)+h:o<=s?(i=0,a=(o=Math.min(Math.max(-u,-f),u))*(o+2*f)+h):a=-(i=Math.max(0,-(c*u+l)))*i+(o=i>0?u:Math.min(Math.max(-u,-f),u))*(o+2*f)+h;else o=c>0?-u:u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*f)+h;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Cr).multiplyScalar(o).add(kr),a}},{key:"intersectSphere",value:function(e,t){Ar.subVectors(e.center,this.origin);var n=Ar.dot(this.direction),r=Ar.dot(Ar)-n*n,i=e.radius*e.radius;if(r>i)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}},{key:"intersectPlane",value:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var n,r,i,o,a,s,u=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,f=this.origin;return u>=0?(n=(e.min.x-f.x)*u,r=(e.max.x-f.x)*u):(n=(e.max.x-f.x)*u,r=(e.min.x-f.x)*u),c>=0?(i=(e.min.y-f.y)*c,o=(e.max.y-f.y)*c):(i=(e.max.y-f.y)*c,o=(e.min.y-f.y)*c),n>o||i>r?null:((i>n||n!==n)&&(n=i),(o=0?(a=(e.min.z-f.z)*l,s=(e.max.z-f.z)*l):(a=(e.max.z-f.z)*l,s=(e.min.z-f.z)*l),n>s||a>r?null:((a>n||n!==n)&&(n=a),(s=0?n:r,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,Ar)}},{key:"intersectTriangle",value:function(e,t,n,r,i){Or.subVectors(t,e),Pr.subVectors(n,e),Ir.crossVectors(Or,Pr);var o,a=this.direction.dot(Ir);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Rr.subVectors(this.origin,e);var s=o*this.direction.dot(Pr.crossVectors(Rr,Pr));if(s<0)return null;var u=o*this.direction.dot(Or.cross(Rr));if(u<0)return null;if(s+u>a)return null;var c=-o*Rr.dot(Ir);return c<0?null:this.at(c/a,i)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}]),e}(),Dr=function(){function e(){Object(f.a)(this,e),Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}return Object(h.a)(e,[{key:"set",value:function(e,t,n,r,i,o,a,s,u,c,l,f,h,d,p,v){var m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=i,m[5]=o,m[9]=a,m[13]=s,m[2]=u,m[6]=c,m[10]=l,m[14]=f,m[3]=h,m[7]=d,m[11]=p,m[15]=v,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,n=e.elements,r=1/Nr.setFromMatrixColumn(e,0).length(),i=1/Nr.setFromMatrixColumn(e,1).length(),o=1/Nr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),u=Math.sin(r),c=Math.cos(i),l=Math.sin(i);if("XYZ"===e.order){var f=o*c,h=o*l,d=a*c,p=a*l;t[0]=s*c,t[4]=-s*l,t[8]=u,t[1]=h+d*u,t[5]=f-p*u,t[9]=-a*s,t[2]=p-f*u,t[6]=d+h*u,t[10]=o*s}else if("YXZ"===e.order){var v=s*c,m=s*l,g=u*c,y=u*l;t[0]=v+y*a,t[4]=g*a-m,t[8]=o*u,t[1]=o*l,t[5]=o*c,t[9]=-a,t[2]=m*a-g,t[6]=y+v*a,t[10]=o*s}else if("ZXY"===e.order){var b=s*c,w=s*l,_=u*c,x=u*l;t[0]=b-x*a,t[4]=-o*l,t[8]=_+w*a,t[1]=w+_*a,t[5]=o*c,t[9]=x-b*a,t[2]=-o*u,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){var M=o*c,S=o*l,E=a*c,T=a*l;t[0]=s*c,t[4]=E*u-S,t[8]=M*u+T,t[1]=s*l,t[5]=T*u+M,t[9]=S*u-E,t[2]=-u,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var A=o*s,k=o*u,C=a*s,R=a*u;t[0]=s*c,t[4]=R-A*l,t[8]=C*l+k,t[1]=l,t[5]=o*c,t[9]=-a*c,t[2]=-u*c,t[6]=k*l+C,t[10]=A-R*l}else if("XZY"===e.order){var O=o*s,P=o*u,I=a*s,L=a*u;t[0]=s*c,t[4]=-l,t[8]=u*c,t[1]=O*l+L,t[5]=o*c,t[9]=P*l-I,t[2]=I*l-P,t[6]=a*c,t[10]=L*l+O}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(jr,e,Ur)}},{key:"lookAt",value:function(e,t,n){var r=this.elements;return zr.subVectors(e,t),0===zr.lengthSq()&&(zr.z=1),zr.normalize(),Br.crossVectors(n,zr),0===Br.lengthSq()&&(1===Math.abs(n.z)?zr.x+=1e-4:zr.z+=1e-4,zr.normalize(),Br.crossVectors(n,zr)),Br.normalize(),Gr.crossVectors(zr,Br),r[0]=Br.x,r[4]=Gr.x,r[8]=zr.x,r[1]=Br.y,r[5]=Gr.y,r[9]=zr.y,r[2]=Br.z,r[6]=Gr.z,r[10]=zr.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],u=n[12],c=n[1],l=n[5],f=n[9],h=n[13],d=n[2],p=n[6],v=n[10],m=n[14],g=n[3],y=n[7],b=n[11],w=n[15],_=r[0],x=r[4],M=r[8],S=r[12],E=r[1],T=r[5],A=r[9],k=r[13],C=r[2],R=r[6],O=r[10],P=r[14],I=r[3],L=r[7],D=r[11],N=r[15];return i[0]=o*_+a*E+s*C+u*I,i[4]=o*x+a*T+s*R+u*L,i[8]=o*M+a*A+s*O+u*D,i[12]=o*S+a*k+s*P+u*N,i[1]=c*_+l*E+f*C+h*I,i[5]=c*x+l*T+f*R+h*L,i[9]=c*M+l*A+f*O+h*D,i[13]=c*S+l*k+f*P+h*N,i[2]=d*_+p*E+v*C+m*I,i[6]=d*x+p*T+v*R+m*L,i[10]=d*M+p*A+v*O+m*D,i[14]=d*S+p*k+v*P+m*N,i[3]=g*_+y*E+b*C+w*I,i[7]=g*x+y*T+b*R+w*L,i[11]=g*M+y*A+b*O+w*D,i[15]=g*S+y*k+b*P+w*N,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],u=e[13],c=e[2],l=e[6],f=e[10],h=e[14];return e[3]*(+i*s*l-r*u*l-i*a*f+n*u*f+r*a*h-n*s*h)+e[7]*(+t*s*h-t*u*f+i*o*f-r*o*h+r*u*c-i*s*c)+e[11]*(+t*u*l-t*a*h-i*o*l+n*o*h+i*a*c-n*u*c)+e[15]*(-r*a*c-t*s*l+t*a*f+r*o*l-n*o*f+n*s*c)}},{key:"transpose",value:function(){var e,t=this.elements;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}},{key:"setPosition",value:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}},{key:"getInverse",value:function(e,t){void 0!==t&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=e.elements,i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],c=r[5],l=r[6],f=r[7],h=r[8],d=r[9],p=r[10],v=r[11],m=r[12],g=r[13],y=r[14],b=r[15],w=d*y*f-g*p*f+g*l*v-c*y*v-d*l*b+c*p*b,_=m*p*f-h*y*f-m*l*v+u*y*v+h*l*b-u*p*b,x=h*g*f-m*d*f+m*c*v-u*g*v-h*c*b+u*d*b,M=m*d*l-h*g*l-m*c*p+u*g*p+h*c*y-u*d*y,S=i*w+o*_+a*x+s*M;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var E=1/S;return n[0]=w*E,n[1]=(g*p*s-d*y*s-g*a*v+o*y*v+d*a*b-o*p*b)*E,n[2]=(c*y*s-g*l*s+g*a*f-o*y*f-c*a*b+o*l*b)*E,n[3]=(d*l*s-c*p*s-d*a*f+o*p*f+c*a*v-o*l*v)*E,n[4]=_*E,n[5]=(h*y*s-m*p*s+m*a*v-i*y*v-h*a*b+i*p*b)*E,n[6]=(m*l*s-u*y*s-m*a*f+i*y*f+u*a*b-i*l*b)*E,n[7]=(u*p*s-h*l*s+h*a*f-i*p*f-u*a*v+i*l*v)*E,n[8]=x*E,n[9]=(m*d*s-h*g*s-m*o*v+i*g*v+h*o*b-i*d*b)*E,n[10]=(u*g*s-m*c*s+m*o*f-i*g*f-u*o*b+i*c*b)*E,n[11]=(h*c*s-u*d*s-h*o*f+i*d*f+u*o*v-i*c*v)*E,n[12]=M*E,n[13]=(h*g*a-m*d*a+m*o*p-i*g*p-h*o*y+i*d*y)*E,n[14]=(m*c*a-u*g*a-m*o*l+i*g*l+u*o*y-i*c*y)*E,n[15]=(u*d*a-h*c*a+h*o*l-i*d*l-u*o*p+i*c*p)*E,this}},{key:"scale",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}},{key:"makeTranslation",value:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,u=i*o,c=i*a;return this.set(u*o+n,u*a-r*s,u*s+r*a,0,u*a+r*s,c*a+n,c*s-r*o,0,u*s-r*a,c*s+r*o,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,n){var r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,u=i+i,c=o+o,l=a+a,f=i*u,h=i*c,d=i*l,p=o*c,v=o*l,m=a*l,g=s*u,y=s*c,b=s*l,w=n.x,_=n.y,x=n.z;return r[0]=(1-(p+m))*w,r[1]=(h+b)*w,r[2]=(d-y)*w,r[3]=0,r[4]=(h-b)*_,r[5]=(1-(f+m))*_,r[6]=(v+g)*_,r[7]=0,r[8]=(d+y)*x,r[9]=(v-g)*x,r[10]=(1-(f+p))*x,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"decompose",value:function(e,t,n){var r=this.elements,i=Nr.set(r[0],r[1],r[2]).length(),o=Nr.set(r[4],r[5],r[6]).length(),a=Nr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Fr.copy(this);var s=1/i,u=1/o,c=1/a;return Fr.elements[0]*=s,Fr.elements[1]*=s,Fr.elements[2]*=s,Fr.elements[4]*=u,Fr.elements[5]*=u,Fr.elements[6]*=u,Fr.elements[8]*=c,Fr.elements[9]*=c,Fr.elements[10]*=c,t.setFromRotationMatrix(Fr),n.x=i,n.y=o,n.z=a,this}},{key:"makePerspective",value:function(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),u=2*i/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(o+i)/(o-i),h=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=u,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=f,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}},{key:"makeOrthographic",value:function(e,t,n,r,i,o){var a=this.elements,s=1/(t-e),u=1/(n-r),c=1/(o-i),l=(t+e)*s,f=(n+r)*u,h=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-f,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}]),e}(),Nr=new sr,Fr=new Dr,jr=new sr(0,0,0),Ur=new sr(1,1,1),Br=new sr,Gr=new sr,zr=new sr,Vr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;Object(f.a)(this,e),Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=n,this._z=r,this._order=i}return Object(h.a)(e,[{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e,t,n){var r=Kn.clamp,i=e.elements,o=i[0],a=i[4],s=i[8],u=i[1],c=i[5],l=i[9],f=i[2],h=i[6],d=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-r(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(r(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,n){return Hr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Hr,t,n)}},{key:"setFromVector3",value:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)}},{key:"reorder",value:function(e){return Wr.setFromEuler(this),this.setFromQuaternion(Wr,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}},{key:"toVector3",value:function(e){return e?e.set(this._x,this._y,this._z):new sr(this._x,this._y,this._z)}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}]),e}();Vr.DefaultOrder="XYZ",Vr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Hr=new Dr,Wr=new ar,Xr=function(){function e(){Object(f.a)(this,e),this.mask=1}return Object(h.a)(e,[{key:"set",value:function(e){this.mask=1<1){for(var t=0;t1){for(var t=0;t0){r.children=[];for(var d=0;d0&&(n.geometries=p),v.length>0&&(n.materials=v),m.length>0&&(n.textures=m),g.length>0&&(n.images=g),y.length>0&&(n.shapes=y)}return n.object=r,n;function b(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n1?void 0:t.copy(n).multiplyScalar(i).add(e.start)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new sr),e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var n=t||ci.getNormalMatrix(e),r=this.coplanarPoint(si).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}]),e}(),fi=new sr,hi=new sr,di=new sr,pi=new sr,vi=new sr,mi=new sr,gi=new sr,yi=new sr,bi=new sr,wi=new sr,_i=function(){function e(t,n,r){Object(f.a)(this,e),this.a=void 0!==t?t:new sr,this.b=void 0!==n?n:new sr,this.c=void 0!==r?r:new sr}return Object(h.a)(e,[{key:"set",value:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}},{key:"setFromPointsAndIndices",value:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return fi.subVectors(this.c,this.b),hi.subVectors(this.a,this.b),.5*fi.cross(hi).length()}},{key:"getMidpoint",value:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new sr),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new li),e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}},{key:"getUV",value:function(t,n,r,i,o){return e.getUV(t,this.a,this.b,this.c,n,r,i,o)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new sr);var n,r,i=this.a,o=this.b,a=this.c;vi.subVectors(o,i),mi.subVectors(a,i),yi.subVectors(e,i);var s=vi.dot(yi),u=mi.dot(yi);if(s<=0&&u<=0)return t.copy(i);bi.subVectors(e,o);var c=vi.dot(bi),l=mi.dot(bi);if(c>=0&&l<=c)return t.copy(o);var f=s*l-c*u;if(f<=0&&s>=0&&c<=0)return n=s/(s-c),t.copy(i).addScaledVector(vi,n);wi.subVectors(e,a);var h=vi.dot(wi),d=mi.dot(wi);if(d>=0&&h<=d)return t.copy(a);var p=h*u-s*d;if(p<=0&&u>=0&&d<=0)return r=u/(u-d),t.copy(i).addScaledVector(mi,r);var v=c*d-h*l;if(v<=0&&l-c>=0&&h-d>=0)return gi.subVectors(a,o),r=(l-c)/(l-c+(h-d)),t.copy(o).addScaledVector(gi,r);var m=1/(v+p+f);return n=p*m,r=f*m,t.copy(i).addScaledVector(vi,n).addScaledVector(mi,r)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new sr),r.subVectors(n,t),fi.subVectors(e,t),r.cross(fi);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,n,r,i){fi.subVectors(r,t),hi.subVectors(n,t),di.subVectors(e,t);var o=fi.dot(fi),a=fi.dot(hi),s=fi.dot(di),u=hi.dot(hi),c=hi.dot(di),l=o*u-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new sr),0===l)return i.set(-2,-1,-1);var f=1/l,h=(u*s-a*c)*f,d=(o*c-a*s)*f;return i.set(1-h-d,d,h)}},{key:"containsPoint",value:function(e,t,n,r){return this.getBarycoord(e,t,n,r,pi),pi.x>=0&&pi.y>=0&&pi.x+pi.y<=1}},{key:"getUV",value:function(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,pi),s.set(0,0),s.addScaledVector(i,pi.x),s.addScaledVector(o,pi.y),s.addScaledVector(a,pi.z),s}},{key:"isFrontFacing",value:function(e,t,n,r){return fi.subVectors(n,t),hi.subVectors(e,t),fi.cross(hi).dot(r)<0}}]),e}(),xi={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},Mi={h:0,s:0,l:0},Si={h:0,s:0,l:0};function Ei(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Ti(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Ai(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var ki=function(){function e(t,n,r){return Object(f.a)(this,e),Object.defineProperty(this,"isColor",{value:!0}),void 0===n&&void 0===r?this.set(t):this.setRGB(t,n,r)}return Object(h.a)(e,[{key:"set",value:function(e){return e&&e.isColor?this.copy(e):"number"===typeof e?this.setHex(e):"string"===typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,n){return this.r=e,this.g=t,this.b=n,this}},{key:"setHSL",value:function(e,t,n){if(e=Kn.euclideanModulo(e,1),t=Kn.clamp(t,0,1),n=Kn.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ei(i,r,e+1/3),this.g=Ei(i,r,e),this.b=Ei(i,r,e-1/3)}return this}},{key:"setStyle",value:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(a,s,u)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c=n[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}},{key:"setColorName",value:function(e){var t=xi[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}},{key:"copyLinearToGamma",value:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(e){return this.r=Ti(e.r),this.g=Ti(e.g),this.b=Ti(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=Ai(e.r),this.g=Ai(e.g),this.b=Ai(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}},{key:"getHexString",value:function(){return("000000"+this.getHex().toString(16)).slice(-6)}},{key:"getHSL",value:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),u=(s+a)/2;if(s===a)t=0,n=0;else{var c=a-s;switch(n=u<=.5?c/(a+s):c/(2-a-s),a){case r:t=(i-o)/c+(i1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}}]),e}();ki.NAMES=xi,ki.prototype.r=1,ki.prototype.g=1,ki.prototype.b=1;var Ci=function(){function e(t,n,r,i,o,a){Object(f.a)(this,e),this.a=t,this.b=n,this.c=r,this.normal=i&&i.isVector3?i:new sr,this.vertexNormals=Array.isArray(i)?i:[],this.color=o&&o.isColor?o:new ki,this.vertexColors=Array.isArray(o)?o:[],this.materialIndex=void 0!==a?a:0}return Object(h.a)(e,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),o=r(e.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Oi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Pi.prototype=Object.create(Oi.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isMeshBasicMaterial=!0,Pi.prototype.copy=function(e){return Oi.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var Ii=new sr,Li=new Zn;function Di(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=Dn,this.updateRange={offset:0,count:-1},this.version=0}function Ni(e,t,n){Di.call(this,new Int8Array(e),t,n)}function Fi(e,t,n){Di.call(this,new Uint8Array(e),t,n)}function ji(e,t,n){Di.call(this,new Uint8ClampedArray(e),t,n)}function Ui(e,t,n){Di.call(this,new Int16Array(e),t,n)}function Bi(e,t,n){Di.call(this,new Uint16Array(e),t,n)}function Gi(e,t,n){Di.call(this,new Int32Array(e),t,n)}function zi(e,t,n){Di.call(this,new Uint32Array(e),t,n)}function Vi(e,t,n){Di.call(this,new Float32Array(e),t,n)}function Hi(e,t,n){Di.call(this,new Float64Array(e),t,n)}Object.defineProperty(Di.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Di.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r0,a=i[1]&&i[1].length>0,s=e.morphTargets,u=s.length;if(u>0){t=[];for(var c=0;c0){l=[];for(var d=0;d0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var y=0;yt&&(t=e[n]);return t}var qi=1,Yi=new Dr,$i=new ai,Qi=new sr,Ki=new lr,Zi=new lr,Ji=new sr;function eo(){Object.defineProperty(this,"id",{value:qi+=2}),this.uuid=Kn.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}eo.prototype=Object.assign(Object.create(Xn.prototype),{constructor:eo,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){return Array.isArray(e)?this.index=new(Xi(e)>65535?zi:Bi)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new Jn).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Yi.makeRotationX(e),this.applyMatrix4(Yi),this},rotateY:function(e){return Yi.makeRotationY(e),this.applyMatrix4(Yi),this},rotateZ:function(e){return Yi.makeRotationZ(e),this.applyMatrix4(Yi),this},translate:function(e,t,n){return Yi.makeTranslation(e,t,n),this.applyMatrix4(Yi),this},scale:function(e,t,n){return Yi.makeScale(e,t,n),this.applyMatrix4(Yi),this},lookAt:function(e){return $i.lookAt(e),$i.updateMatrix(),this.applyMatrix4($i.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qi).negate(),this.translate(Qi.x,Qi.y,Qi.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new Vi(3*t.vertices.length,3),r=new Vi(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new Vi(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Di(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.setAttribute("color",new Di(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Di(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var o=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new Di(o,2).copyVector2sArray(e.uvs2))}for(var a in this.groups=e.groups,e.morphTargets){for(var s=[],u=e.morphTargets[a],c=0,l=u.length;c0){var d=new Vi(4*e.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var p=new Vi(4*e.skinWeights.length,4);this.setAttribute("skinWeight",p.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new lr);var e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new sr(-1/0,-1/0,-1/0),new sr(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var o in i){var a=i[o],s=a.toJSON(e.data);""!==a.name&&(s.name=a.name),e.data.attributes[o]=s}var u={},c=!1;for(var l in this.morphAttributes){for(var f=this.morphAttributes[l],h=[],d=0,p=f.length;d0&&(u[l]=h,c=!0)}c&&(e.data.morphAttributes=u,e.data.morphTargetsRelative=this.morphTargetsRelative);var g=this.groups;g.length>0&&(e.data.groups=JSON.parse(JSON.stringify(g)));var y=this.boundingSphere;return null!==y&&(e.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),e},clone:function(){return(new eo).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone(t));var r=e.attributes;for(var i in r){var o=r[i];this.setAttribute(i,o.clone(t))}var a=e.morphAttributes;for(var s in a){for(var u=[],c=a[s],l=0,f=c.length;ln.far?null:{distance:u,point:yo.clone(),object:e}}function _o(e,t,n,r,i,o,a,s,u,c,l,f){io.fromBufferAttribute(i,c),oo.fromBufferAttribute(i,l),ao.fromBufferAttribute(i,f);var h=e.morphTargetInfluences;if(t.morphTargets&&o&&h){lo.set(0,0,0),fo.set(0,0,0),ho.set(0,0,0);for(var d=0,p=o.length;d0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),ro.copy(r.boundingSphere),ro.applyMatrix4(o),!1!==e.ray.intersectsSphere(ro)&&(to.getInverse(o),no.copy(e.ray).applyMatrix4(to),null===r.boundingBox||!1!==no.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a=r.index,s=r.attributes.position,u=r.morphAttributes.position,c=r.morphTargetsRelative,l=r.attributes.uv,f=r.attributes.uv2,h=r.groups,d=r.drawRange;if(null!==a)if(Array.isArray(i))for(var p=0,v=h.length;p0&&(N=B);for(var G=0,z=U.length;G0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;Object(f.a)(this,n),(e=t.call(this)).type="BoxBufferGeometry",e.parameters={width:r,height:i,depth:o,widthSegments:a,heightSegments:s,depthSegments:c};var l=Object(u.a)(e);a=Math.floor(a),s=Math.floor(s),c=Math.floor(c);var h=[],d=[],p=[],v=[],m=0,g=0;function y(e,t,n,r,i,o,a,s,u,c,f){for(var y=o/u,b=a/c,w=o/2,_=a/2,x=s/2,M=u+1,S=c+1,E=0,T=0,A=new sr,k=0;k0?1:-1,p.push(A.x,A.y,A.z),v.push(R/u),v.push(1-k/c),E+=1}for(var P=0;P0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},Ao.prototype=Object.assign(Object.create(ai.prototype),{constructor:Ao,isCamera:!0,copy:function(e,t){return ai.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new sr),this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){ai.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){ai.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),ko.prototype=Object.assign(Object.create(Ao.prototype),{constructor:ko,isPerspectiveCamera:!0,copy:function(e,t){return Ao.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Kn.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Kn.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Kn.RAD2DEG*Math.atan(Math.tan(.5*Kn.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*Kn.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,t-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var u=this.filmOffset;0!==u&&(i+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=ai.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var Co=90;function Ro(e,t,n){if(ai.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var r=new ko(Co,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new sr(1,0,0)),this.add(r);var i=new ko(Co,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new sr(-1,0,0)),this.add(i);var o=new ko(Co,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new sr(0,1,0)),this.add(o);var a=new ko(Co,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new sr(0,-1,0)),this.add(a);var s=new ko(Co,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new sr(0,0,1)),this.add(s);var u=new ko(Co,1,e,t);u.layers=this.layers,u.up.set(0,-1,0),u.lookAt(new sr(0,0,-1)),this.add(u),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var c=e.xr.enabled,l=e.getRenderTarget();e.xr.enabled=!1;var f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=f,e.setRenderTarget(n,5),e.render(t,u),e.setRenderTarget(l),e.xr.enabled=c}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function Oo(e,t,n,r,i,o,a,s,u,c){e=void 0!==e?e:[],t=void 0!==t?t:ve,a=void 0!==a?a:qe,nr.call(this,e,t,n,r,i,o,a,s,u,c),this.flipY=!1,this._needsFlipEnvMap=!0}function Po(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),ir.call(this,e,e,t),t=t||{},this.texture=new Oo(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture._needsFlipEnvMap=!1}function Io(e,t,n,r,i,o,a,s,u,c,l,f){nr.call(this,null,o,a,s,u,c,r,i,l,f),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==u?u:Se,this.minFilter=void 0!==c?c:Se,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Ro.prototype=Object.create(ai.prototype),Ro.prototype.constructor=Ro,Oo.prototype=Object.create(nr.prototype),Oo.prototype.constructor=Oo,Oo.prototype.isCubeTexture=!0,Object.defineProperty(Oo.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),Po.prototype=Object.create(ir.prototype),Po.prototype.constructor=Po,Po.prototype.isWebGLCubeRenderTarget=!0,Po.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=Ye,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var n={tEquirect:{value:null}},r="\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t#include \n\t\t\t\t#include \n\n\t\t\t}\n\t\t",i="\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t",o=new xo(5,5,5),a=new To({name:"CubemapFromEquirect",uniforms:Mo(n),vertexShader:r,fragmentShader:i,side:E,blending:C});a.uniforms.tEquirect.value=t;var s=new bo(o,a),u=t.minFilter;return t.minFilter===Pe&&(t.minFilter=Ce),new Ro(1,10,this).update(e,s),t.minFilter=u,s.geometry.dispose(),s.material.dispose(),this},Po.prototype.clear=function(e,t,n,r){for(var i=e.getRenderTarget(),o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,r);e.setRenderTarget(i)},Io.prototype=Object.create(nr.prototype),Io.prototype.constructor=Io,Io.prototype.isDataTexture=!0;var Lo=new Tr,Do=new sr,No=function(){function e(t,n,r,i,o,a){Object(f.a)(this,e),this.planes=[void 0!==t?t:new li,void 0!==n?n:new li,void 0!==r?r:new li,void 0!==i?i:new li,void 0!==o?o:new li,void 0!==a?a:new li]}return Object(h.a)(e,[{key:"set",value:function(e,t,n,r,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],c=n[6],l=n[7],f=n[8],h=n[9],d=n[10],p=n[11],v=n[12],m=n[13],g=n[14],y=n[15];return t[0].setComponents(a-r,l-s,p-f,y-v).normalize(),t[1].setComponents(a+r,l+s,p+f,y+v).normalize(),t[2].setComponents(a+i,l+u,p+h,y+m).normalize(),t[3].setComponents(a-i,l-u,p-h,y-m).normalize(),t[4].setComponents(a-o,l-c,p-d,y-g).normalize(),t[5].setComponents(a+o,l+c,p+d,y+g).normalize(),this}},{key:"intersectsObject",value:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Lo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Lo)}},{key:"intersectsSprite",value:function(e){return Lo.center.set(0,0,0),Lo.radius=.7071067811865476,Lo.applyMatrix4(e.matrixWorld),this.intersectsSphere(Lo)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)0?e.max.x:e.min.x,Do.y=r.normal.y>0?e.max.y:e.min.y,Do.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Do)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}]),e}();function Fo(){var e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function jo(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var o=r.get(t);(!o||o.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},Go={common:{diffuse:{value:new ki(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Jn},uv2Transform:{value:new Jn},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Zn(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ki(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 ki(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Jn}},sprite:{diffuse:{value:new ki(15658734)},opacity:{value:1},center:{value:new Zn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Jn}}},zo={basic:{uniforms:So([Go.common,Go.specularmap,Go.envmap,Go.aomap,Go.lightmap,Go.fog]),vertexShader:Bo.meshbasic_vert,fragmentShader:Bo.meshbasic_frag},lambert:{uniforms:So([Go.common,Go.specularmap,Go.envmap,Go.aomap,Go.lightmap,Go.emissivemap,Go.fog,Go.lights,{emissive:{value:new ki(0)}}]),vertexShader:Bo.meshlambert_vert,fragmentShader:Bo.meshlambert_frag},phong:{uniforms:So([Go.common,Go.specularmap,Go.envmap,Go.aomap,Go.lightmap,Go.emissivemap,Go.bumpmap,Go.normalmap,Go.displacementmap,Go.fog,Go.lights,{emissive:{value:new ki(0)},specular:{value:new ki(1118481)},shininess:{value:30}}]),vertexShader:Bo.meshphong_vert,fragmentShader:Bo.meshphong_frag},standard:{uniforms:So([Go.common,Go.envmap,Go.aomap,Go.lightmap,Go.emissivemap,Go.bumpmap,Go.normalmap,Go.displacementmap,Go.roughnessmap,Go.metalnessmap,Go.fog,Go.lights,{emissive:{value:new ki(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Bo.meshphysical_vert,fragmentShader:Bo.meshphysical_frag},toon:{uniforms:So([Go.common,Go.aomap,Go.lightmap,Go.emissivemap,Go.bumpmap,Go.normalmap,Go.displacementmap,Go.gradientmap,Go.fog,Go.lights,{emissive:{value:new ki(0)}}]),vertexShader:Bo.meshtoon_vert,fragmentShader:Bo.meshtoon_frag},matcap:{uniforms:So([Go.common,Go.bumpmap,Go.normalmap,Go.displacementmap,Go.fog,{matcap:{value:null}}]),vertexShader:Bo.meshmatcap_vert,fragmentShader:Bo.meshmatcap_frag},points:{uniforms:So([Go.points,Go.fog]),vertexShader:Bo.points_vert,fragmentShader:Bo.points_frag},dashed:{uniforms:So([Go.common,Go.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Bo.linedashed_vert,fragmentShader:Bo.linedashed_frag},depth:{uniforms:So([Go.common,Go.displacementmap]),vertexShader:Bo.depth_vert,fragmentShader:Bo.depth_frag},normal:{uniforms:So([Go.common,Go.bumpmap,Go.normalmap,Go.displacementmap,{opacity:{value:1}}]),vertexShader:Bo.normal_vert,fragmentShader:Bo.normal_frag},sprite:{uniforms:So([Go.sprite,Go.fog]),vertexShader:Bo.sprite_vert,fragmentShader:Bo.sprite_frag},background:{uniforms:{uvTransform:{value:new Jn},t2D:{value:null}},vertexShader:Bo.background_vert,fragmentShader:Bo.background_frag},cube:{uniforms:So([Go.envmap,{opacity:{value:1}}]),vertexShader:Bo.cube_vert,fragmentShader:Bo.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Bo.equirect_vert,fragmentShader:Bo.equirect_frag},distanceRGBA:{uniforms:So([Go.common,Go.displacementmap,{referencePosition:{value:new sr},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Bo.distanceRGBA_vert,fragmentShader:Bo.distanceRGBA_frag},shadow:{uniforms:So([Go.lights,Go.fog,{color:{value:new ki(0)},opacity:{value:1}}]),vertexShader:Bo.shadow_vert,fragmentShader:Bo.shadow_frag}};function Vo(e,t,n,r,i){var o,a,s=new ki(0),u=0,c=null,l=0,f=null;function h(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),h(s,u=void 0!==t?t:1)},getClearAlpha:function(){return u},setClearAlpha:function(e){h(s,u=e)},render:function(n,i,d,p){var v=!0===i.isScene?i.background:null;v&&v.isTexture&&(v=t.get(v));var m=e.xr,g=m.getSession&&m.getSession();g&&"additive"===g.environmentBlendMode&&(v=null),null===v?h(s,u):v&&v.isColor&&(h(v,1),p=!0),(e.autoClear||p)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),v&&(v.isCubeTexture||v.isWebGLCubeRenderTarget||v.mapping===be)?(void 0===a&&((a=new bo(new xo(1,1,1),new To({name:"BackgroundCubeMaterial",uniforms:Mo(zo.cube.uniforms),vertexShader:zo.cube.vertexShader,fragmentShader:zo.cube.fragmentShader,side:E,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(a)),v.isWebGLCubeRenderTarget&&(v=v.texture),a.material.uniforms.envMap.value=v,a.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,c===v&&l===v.version&&f===e.toneMapping||(a.material.needsUpdate=!0,c=v,l=v.version,f=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):v&&v.isTexture&&(void 0===o&&((o=new bo(new Uo(2,2),new To({name:"BackgroundMaterial",uniforms:Mo(zo.background.uniforms),vertexShader:zo.background.vertexShader,fragmentShader:zo.background.fragmentShader,side:S,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=v,!0===v.matrixAutoUpdate&&v.updateMatrix(),o.material.uniforms.uvTransform.value.copy(v.matrix),c===v&&l===v.version&&f===e.toneMapping||(o.material.needsUpdate=!0,c=v,l=v.version,f=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function Ho(e,t,n,r){var i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},u=h(null),c=u;function l(t){return r.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function f(t){return r.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function h(e){for(var t=[],n=[],r=[],o=0;o=0){var y=u[f];if(void 0!==y){var b=y.normalized,w=y.itemSize,_=n.get(y);if(void 0===_)continue;var x=_.buffer,M=_.type,S=_.bytesPerElement;if(y.isInterleavedBufferAttribute){var E=y.data,T=E.stride,A=y.offset;E&&E.isInstancedInterleavedBuffer?(v(h,E.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=E.meshPerAttribute*E.count)):p(h),e.bindBuffer(34962,x),g(h,w,M,b,T*S,A*S)}else y.isInstancedBufferAttribute?(v(h,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):p(h),e.bindBuffer(34962,x),g(h,w,M,b,0,0)}else if("instanceMatrix"===f){var k=n.get(i.instanceMatrix);if(void 0===k)continue;var C=k.buffer,R=k.type;v(h+0,1),v(h+1,1),v(h+2,1),v(h+3,1),e.bindBuffer(34962,C),e.vertexAttribPointer(h+0,4,R,!1,64,0),e.vertexAttribPointer(h+1,4,R,!1,64,16),e.vertexAttribPointer(h+2,4,R,!1,64,32),e.vertexAttribPointer(h+3,4,R,!1,64,48)}else if("instanceColor"===f){var O=n.get(i.instanceColor);if(void 0===O)continue;var P=O.buffer,I=O.type;v(h,1),e.bindBuffer(34962,P),e.vertexAttribPointer(h,3,I,!1,12,0)}else if(void 0!==l){var L=l[f];if(void 0!==L)switch(L.length){case 2:e.vertexAttrib2fv(h,L);break;case 3:e.vertexAttrib3fv(h,L);break;case 4:e.vertexAttrib4fv(h,L);break;default:e.vertexAttrib1fv(h,L)}}}}m()}(i,u,f,y),null!==b&&e.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){for(var e in y(),s){var t=s[e];for(var n in t){var r=t[n];for(var i in r)f(r[i].object),delete r[i];delete t[n]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var n in t){var r=t[n];for(var i in r)f(r[i].object),delete r[i];delete t[n]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var n=s[t];if(void 0!==n[e.id]){var r=n[e.id];for(var i in r)f(r[i].object),delete r[i];delete n[e.id]}}},initAttributes:d,enableAttribute:p,disableUnusedAttributes:m}}function Wo(e,t,n,r){var i,o=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=function(r,a,s){if(0!==s){var u,c;if(o)u=e,c="drawArraysInstanced";else if(c="drawArraysInstancedANGLE",null===(u=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[c](i,r,a,s),n.update(a,i,s)}}}function Xo(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!==typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var u=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),l=e.getParameter(35660),f=e.getParameter(3379),h=e.getParameter(34076),d=e.getParameter(34921),p=e.getParameter(36347),v=e.getParameter(36348),m=e.getParameter(36349),g=l>0,y=o||!!t.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:l,maxTextureSize:f,maxCubemapSize:h,maxAttributes:d,maxVertexUniforms:p,maxVaryings:v,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:o?e.getParameter(36183):0}}function qo(e){var t=this,n=null,r=0,i=!1,o=!1,a=new li,s=new Jn,u={value:null,needsUpdate:!1};function c(){u.value!==n&&(u.value=n,u.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function l(e,n,r,i){var o=null!==e?e.length:0,c=null;if(0!==o){if(c=u.value,!0!==i||null===c){var l=r+4*o,f=n.matrixWorldInverse;s.getNormalMatrix(f),(null===c||c.length0){var s=e.getRenderList(),u=e.getRenderTarget(),c=e.getRenderState(),l=new Po(a.height/2);return l.fromEquirectangularTexture(e,i),t.set(i,l),e.setRenderTarget(u),e.setRenderList(s),e.setRenderState(c),i.addEventListener("dispose",r),n(l.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}function $o(e){var t={};return{has:function(n){if(void 0!==t[n])return null!==t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,null!==r},get:function(e){return this.has(e)||console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t[e]}}}function Qo(e,t,n,r){var i=new WeakMap,o=new WeakMap;function a(e){var s=e.target,u=i.get(s);for(var c in null!==u.index&&t.remove(u.index),u.attributes)t.remove(u.attributes[c]);s.removeEventListener("dispose",a),i.delete(s);var l=o.get(u);l&&(t.remove(l),o.delete(u)),r.releaseStatesOfGeometry(u),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){var n=[],r=e.index,i=e.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var u=0,c=s.length;u65535?zi:Bi)(n,1);b.version=a;var w=o.get(e);w&&t.remove(w),o.set(e,b)}return{get:function(e,t){var r=i.get(t);return r||(t.addEventListener("dispose",a),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new eo).setFromObject(e)),r=t._bufferGeometry),i.set(t,r),n.memory.geometries++,r)},update:function(e){var n=e.attributes;for(var r in n)t.update(n[r],34962);var i=e.morphAttributes;for(var o in i)for(var a=i[o],s=0,u=a.length;s0)return e;var i=t*n,o=ca[i];if(void 0===o&&(o=new Float32Array(i),ca[i]=o),0!==t){r.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=n,e[a].toArray(o,s)}return o}function va(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n/gm;function fs(e){return e.replace(ls,hs)}function hs(e,t){var n=Bo[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return fs(n)}var ds=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ps=/#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 vs(e){return e.replace(ps,gs).replace(ds,ms)}function ms(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),gs(e,t,n,r)}function gs(e,t,n,r){for(var i="",o=parseInt(t);o0?e.gammaFactor:1,v=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ss).join("\n")}(n),m=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),g=a.createProgram(),y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=[m].filter(ss).join("\n")).length>0&&(i+="\n"),(o=[v,m].filter(ss).join("\n")).length>0&&(o+="\n")):(i=[ys(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ss).join("\n"),o=[v,ys(n),"#define SHADER_NAME "+n.shaderName,m,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==ue?"#define TONE_MAPPING":"",n.toneMapping!==ue?Bo.tonemapping_pars_fragment:"",n.toneMapping!==ue?as("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Bo.encodings_pars_fragment,n.map?is("mapTexelToLinear",n.mapEncoding):"",n.matcap?is("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?is("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?is("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?is("lightMapTexelToLinear",n.lightMapEncoding):"",os("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(ss).join("\n")),u=cs(u=us(u=fs(u),n),n),c=cs(c=us(c=fs(c),n),n),u=vs(u),c=vs(c),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,o=["#define varying in",n.glslVersion===Wn?"":"out highp vec4 pc_fragColor;",n.glslVersion===Wn?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var b,w,S=y+o+c,E=es(a,35633,y+i+u),T=es(a,35632,S);if(a.attachShader(g,E),a.attachShader(g,T),void 0!==n.index0AttributeName?a.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&a.bindAttribLocation(g,0,"position"),a.linkProgram(g),e.debug.checkShaderErrors){var A=a.getProgramInfoLog(g).trim(),k=a.getShaderInfoLog(E).trim(),C=a.getShaderInfoLog(T).trim(),R=!0,O=!0;if(!1===a.getProgramParameter(g,35714)){R=!1;var P=rs(a,E,"vertex"),I=rs(a,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(g,35715),"gl.getProgramInfoLog",A,P,I)}else""!==A?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",A):""!==k&&""!==C||(O=!1);O&&(this.diagnostics={runnable:R,programLog:A,vertexShader:{log:k,prefix:i},fragmentShader:{log:C,prefix:o}})}return a.deleteShader(E),a.deleteShader(T),this.getUniforms=function(){return void 0===b&&(b=new Ja(a,g)),b},this.getAttributes=function(){return void 0===w&&(w=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i0,maxBones:S,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:ue,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===T,flipSided:i.side===E,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(!1===t.isRawShaderMaterial){for(var i=0;i1&&r.sort(e||xs),i.length>1&&i.sort(t||Ms)}}}function Es(e){var t=new WeakMap;return{get:function(n,r){var i,o=t.get(n);return void 0===o?(i=new Ss(e),t.set(n,new WeakMap),t.get(n).set(r,i)):void 0===(i=o.get(r))&&(i=new Ss(e),o.set(r,i)),i},dispose:function(){t=new WeakMap}}}function Ts(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new sr,color:new ki};break;case"SpotLight":n={position:new sr,direction:new sr,color:new ki,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new sr,color:new ki,distance:0,decay:0};break;case"HemisphereLight":n={direction:new sr,skyColor:new ki,groundColor:new ki};break;case"RectAreaLight":n={color:new ki,position:new sr,halfWidth:new sr,halfHeight:new sr}}return e[t.id]=n,n}}}var As=0;function ks(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Cs(e,t){for(var n=new Ts,r=function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Zn};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Zn,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},o=0;o<9;o++)i.probe.push(new sr);var a=new sr,s=new Dr,u=new Dr;return{setup:function(o,c,l){for(var f=0,h=0,d=0,p=0;p<9;p++)i.probe[p].set(0,0,0);var v=0,m=0,g=0,y=0,b=0,w=0,_=0,x=0,M=l.matrixWorldInverse;o.sort(ks);for(var S=0,E=o.length;S0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Go.LTC_FLOAT_1,i.rectAreaLTC2=Go.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Go.LTC_HALF_1,i.rectAreaLTC2=Go.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=f,i.ambient[1]=h,i.ambient[2]=d;var V=i.hash;V.directionalLength===v&&V.pointLength===m&&V.spotLength===g&&V.rectAreaLength===y&&V.hemiLength===b&&V.numDirectionalShadows===w&&V.numPointShadows===_&&V.numSpotShadows===x||(i.directional.length=v,i.spot.length=g,i.rectArea.length=y,i.point.length=m,i.hemi.length=b,i.directionalShadow.length=w,i.directionalShadowMap.length=w,i.pointShadow.length=_,i.pointShadowMap.length=_,i.spotShadow.length=x,i.spotShadowMap.length=x,i.directionalShadowMatrix.length=w,i.pointShadowMatrix.length=_,i.spotShadowMatrix.length=x,V.directionalLength=v,V.pointLength=m,V.spotLength=g,V.rectAreaLength=y,V.hemiLength=b,V.numDirectionalShadows=w,V.numPointShadows=_,V.numSpotShadows=x,i.version=As++)},state:i}}function Rs(e,t){var n=new Cs(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(e){n.setup(r,i,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function Os(e,t){var n=new WeakMap;return{get:function(r,i){var o;return!1===n.has(r)?(o=new Rs(e,t),n.set(r,new WeakMap),n.get(r).set(i,o)):!1===n.get(r).has(i)?(o=new Rs(e,t),n.get(r).set(i,o)):o=n.get(r).get(i),o},dispose:function(){n=new WeakMap}}}function Ps(e){Oi.call(this),this.type="MeshDepthMaterial",this.depthPacking=vn,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function Is(e){Oi.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new sr,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}Ps.prototype=Object.create(Oi.prototype),Ps.prototype.constructor=Ps,Ps.prototype.isMeshDepthMaterial=!0,Ps.prototype.copy=function(e){return Oi.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Is.prototype=Object.create(Oi.prototype),Is.prototype.constructor=Is,Is.prototype.isMeshDistanceMaterial=!0,Is.prototype.copy=function(e){return Oi.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function Ls(e,t,n){var r=new No,i=new Zn,o=new Zn,a=new rr,s=[],u=[],c={},l={0:E,1:S,2:T},f=new To({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Zn},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),h=f.clone();h.defines.HORIZONAL_PASS=1;var d=new eo;d.setAttribute("position",new Di(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var p=new bo(d,f),v=this;function m(n,r){var i=t.update(p);f.uniforms.shadow_pass.value=n.map.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,f,p,null),h.uniforms.shadow_pass.value=n.mapPass.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,h,p,null)}function g(e,t,n){var r=e<<0|t<<1|n<<2,i=s[r];return void 0===i&&(i=new Ps({depthPacking:mn,morphTargets:e,skinning:t}),s[r]=i),i}function y(e,t,n){var r=e<<0|t<<1|n<<2,i=u[r];return void 0===i&&(i=new Is({morphTargets:e,skinning:t}),u[r]=i),i}function b(t,n,r,i,o,a,s){var u=null,f=g,h=t.customDepthMaterial;if(!0===i.isPointLight&&(f=y,h=t.customDistanceMaterial),void 0===h){var d=!1;!0===r.morphTargets&&(d=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var p=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?p=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),u=f(d,p,!0===t.isInstancedMesh)}else u=h;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var v=u.uuid,m=r.uuid,b=c[v];void 0===b&&(b={},c[v]=b);var w=b[m];void 0===w&&(w=u.clone(),b[m]=w),u=w}return u.visible=r.visible,u.wireframe=r.wireframe,u.side=s===M?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:l[r.side],u.clipShadows=r.clipShadows,u.clippingPlanes=r.clippingPlanes,u.clipIntersection=r.clipIntersection,u.wireframeLinewidth=r.wireframeLinewidth,u.linewidth=r.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=o,u.farDistance=a),u}function w(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===M)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var u=t.update(n),c=n.material;if(Array.isArray(c))for(var l=u.groups,f=0,h=l.length;fn||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/b.x),i.x=o.x*b.x,y.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/b.y),i.y=o.y*b.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&this.type===M){var _={minFilter:Ce,magFilter:Ce,format:Ye};y.map=new ir(i.x,i.y,_),y.map.texture.name=g.name+".shadowMap",y.mapPass=new ir(i.x,i.y,_),y.camera.updateProjectionMatrix()}if(null===y.map){var x={minFilter:Se,magFilter:Se,format:Ye};y.map=new ir(i.x,i.y,x),y.map.texture.name=g.name+".shadowMap",y.camera.updateProjectionMatrix()}e.setRenderTarget(y.map),e.clear();for(var S=y.getViewportCount(),E=0;E=1):-1!==le.indexOf("OpenGL ES")&&(ce=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(le)[1]),ue=ce>=2);var fe=null,he={},de=new rr,pe=new rr;function ve(t,n,r){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var a=0;ar||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap){var o=t?Kn.floorPowerOfTwo:Math.floor,a=o(i*e.width),s=o(i*e.height);void 0===l&&(l=y(a,s));var u=n?y(a,s):l;return u.width=a,u.height=s,u.getContext("2d").drawImage(e,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+s+")."),u}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function w(e){return Kn.isPowerOfTwo(e.width)&&Kn.isPowerOfTwo(e.height)}function _(e,t){return e.generateMipmaps&&t&&e.minFilter!==Se&&e.minFilter!==Ce}function x(t,n,i,o){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function M(n,r,i){if(!1===f)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function S(e){return e===Se||e===Ee||e===Ae?9728:9729}function E(t){var n=t.target;n.removeEventListener("dispose",E),function(t){var n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&m.delete(n),a.memory.textures--}function T(t){var n=t.target;n.removeEventListener("dispose",T),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)e.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[o]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}(n),a.memory.textures--}var A=0;function k(e,t){var i=r.get(e);if(e.isVideoTexture&&function(e){var t=a.render.frame;m.get(e)!==t&&(m.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){var o=e.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void L(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function C(t,i){var a=r.get(t);t.version>0&&a.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;I(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY);for(var a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),s=r.image[0]&&r.image[0].isDataTexture,u=[],c=0;c<6;c++)u[c]=a||s?s?r.image[c].image:r.image[c]:b(r.image[c],!1,!0,d);var l,h=u[0],p=w(h)||f,v=o.convert(r.format),m=o.convert(r.type),g=M(r.internalFormat,v,m);if(P(34067,r,p),a){for(var y=0;y<6;y++){l=u[y].mipmaps;for(var S=0;S1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function I(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",E),t.__webglTexture=e.createTexture(),a.memory.textures++)}function L(t,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),I(t,r),n.activeTexture(33984+i),n.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s,u=function(e){return!f&&(e.wrapS!==xe||e.wrapT!==xe||e.minFilter!==Se&&e.minFilter!==Ce)}(r)&&!1===w(r.image),c=b(r.image,u,!1,p),l=w(c)||f,h=o.convert(r.format),d=o.convert(r.type),v=M(r.internalFormat,h,d);P(a,r,l);var m=r.mipmaps;if(r.isDepthTexture)v=6402,f?v=r.type===Be?36012:r.type===Ue?33190:r.type===We?35056:33189:r.type===Be&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===Ze&&6402===v&&r.type!==Fe&&r.type!==Ue&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Fe,d=o.convert(r.type)),r.format===Je&&6402===v&&(v=34041,r.type!==We&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=We,d=o.convert(r.type))),n.texImage2D(3553,0,v,c.width,c.height,0,h,d,null);else if(r.isDataTexture)if(m.length>0&&l){for(var g=0,y=m.length;g0&&l){for(var T=0,A=m.length;T=h&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+h),A+=1,e},this.resetTextureUnits=function(){A=0},this.setTexture2D=k,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?L(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?L(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=C,this.setupRenderTarget=function(t){var i=r.get(t),s=r.get(t.texture);t.addEventListener("dispose",T),s.__webglTexture=e.createTexture(),a.memory.textures++;var u=!0===t.isWebGLCubeRenderTarget,c=!0===t.isWebGLMultisampleRenderTarget,l=w(t)||f;if(!f||t.texture.format!==qe||t.texture.type!==Be&&t.texture.type!==Ge||(t.texture.format=Ye,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),u){i.__webglFramebuffer=[];for(var h=0;h<6;h++)i.__webglFramebuffer[h]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),c)if(f){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var d=o.convert(t.texture.format),p=o.convert(t.texture.type),v=M(t.texture.internalFormat,d,p),m=j(t);e.renderbufferStorageMultisample(36161,m,v,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),N(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(u){n.bindTexture(34067,s.__webglTexture),P(34067,t.texture,l);for(var g=0;g<6;g++)D(i.__webglFramebuffer[g],t,36064,34069+g);_(t.texture,l)&&x(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),P(3553,t.texture,l),D(i.__webglFramebuffer,t,36064,3553),_(t.texture,l)&&x(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&F(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(_(t,w(e)||f)){var i=e.isWebGLCubeRenderTarget?34067:3553,o=r.get(t).__webglTexture;n.bindTexture(i,o),x(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(f){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,o=t.height,a=16384;t.depthBuffer&&(a|=256),t.stencilBuffer&&(a|=1024),e.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),U=!0),e=e.texture),k(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),B=!0),e=e.texture),C(e,t)}}function Fs(e,t,n){var r=n.isWebGL2;return{convert:function(e){var n;if(e===Le)return 5121;if(e===ze)return 32819;if(e===Ve)return 32820;if(e===He)return 33635;if(e===De)return 5120;if(e===Ne)return 5122;if(e===Fe)return 5123;if(e===je)return 5124;if(e===Ue)return 5125;if(e===Be)return 5126;if(e===Ge)return r?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(e===Xe)return 6406;if(e===qe)return 6407;if(e===Ye)return 6408;if(e===$e)return 6409;if(e===Qe)return 6410;if(e===Ze)return 6402;if(e===Je)return 34041;if(e===et)return 6403;if(e===tt)return 36244;if(e===nt)return 33319;if(e===rt)return 33320;if(e===it)return 36248;if(e===ot)return 36249;if(e===at||e===st||e===ut||e===ct){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(e===at)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===st)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===ut)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===ct)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===lt||e===ft||e===ht||e===dt){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===lt)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===ft)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===ht)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===dt)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===pt)return null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===vt||e===mt)&&null!==(n=t.get("WEBGL_compressed_texture_etc"))){if(e===vt)return n.COMPRESSED_RGB8_ETC2;if(e===mt)return n.COMPRESSED_RGBA8_ETC2_EAC}return e===gt||e===yt||e===bt||e===wt||e===_t||e===xt||e===Mt||e===St||e===Et||e===Tt||e===At||e===kt||e===Ct||e===Rt||e===Pt||e===It||e===Lt||e===Dt||e===Nt||e===Ft||e===jt||e===Ut||e===Bt||e===Gt||e===zt||e===Vt||e===Ht||e===Wt?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:e===Ot?null!==(n=t.get("EXT_texture_compression_bptc"))?e:null:e===We?r?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function js(e){ko.call(this),this.cameras=e||[]}function Us(){ai.call(this),this.type="Group"}function Bs(){this._targetRay=null,this._grip=null,this._hand=null}function Gs(e,t){var n=this,r=null,i=1,o=null,a="local-floor",s=null,u=[],c=new Map,l=new ko;l.layers.enable(1),l.viewport=new rr;var f=new ko;f.layers.enable(2),f.viewport=new rr;var h=[l,f],d=new js;d.layers.enable(1),d.layers.enable(2);var p=null,v=null;function m(e){var t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function g(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(e){o=e,S.setContext(r),S.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function b(e){for(var t=r.inputSources,n=0;n0&&Me(o,e,t),a.length>0&&Me(a,e,t),!0===e.isScene&&e.onAfterRender(d,e,t),null!==y&&(X.updateRenderTargetMipmap(y),X.updateMultisampleRenderTarget(y)),V.buffers.depth.setTest(!0),V.buffers.depth.setMask(!0),V.buffers.color.setMask(!0),V.setPolygonOffset(!1),f=null,h=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){v!==e&&null===y&&ce.bindFramebuffer(36160,e),v=e},this.getActiveCubeFace=function(){return m},this.getActiveMipmapLevel=function(){return g},this.getRenderList=function(){return f},this.setRenderList=function(e){f=e},this.getRenderState=function(){return h},this.setRenderState=function(e){h=e},this.getRenderTarget=function(){return y},this.setRenderTarget=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;y=e,m=t,g=n,e&&void 0===W.get(e).__webglFramebuffer&&X.setupRenderTarget(e);var r=v,i=!1;if(e){var o=W.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=o[t],i=!0):r=e.isWebGLMultisampleRenderTarget?W.get(e).__webglMultisampledFramebuffer:o,M.copy(e.viewport),S.copy(e.scissor),E=e.scissorTest}else M.copy(O).multiplyScalar(k).floor(),S.copy(P).multiplyScalar(k).floor(),E=I;if(b!==r&&(ce.bindFramebuffer(36160,r),b=r),V.viewport(M),V.scissor(S),V.setScissorTest(E),i){var a=W.get(e.texture);ce.framebufferTexture2D(36160,36064,34069+t,a.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,r,i,o,a){if(e&&e.isWebGLRenderTarget){var s=W.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var u=!1;s!==b&&(ce.bindFramebuffer(36160,s),u=!0);try{var c=e.texture,l=c.format,f=c.type;if(l!==Ye&&ae.convert(l)!==ce.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(f!==Le&&ae.convert(f)!==ce.getParameter(35738)&&(f!==Be||!(z.isWebGL2||G.get("OES_texture_float")||G.get("WEBGL_color_buffer_float")))&&(f!==Ge||!(z.isWebGL2?G.get("EXT_color_buffer_float"):G.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ce.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ce.readPixels(t,n,r,i,ae.convert(l),ae.convert(f),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{u&&ce.bindFramebuffer(36160,b)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r),a=ae.convert(t.format);X.setTexture2D(t,0),ce.copyTexImage2D(3553,n,a,e.x,e.y,i,o,0),V.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){void 0===r&&(r=0);var i=t.image.width,o=t.image.height,a=ae.convert(n.format),s=ae.convert(n.type);X.setTexture2D(n,0),ce.pixelStorei(37440,n.flipY),ce.pixelStorei(37441,n.premultiplyAlpha),ce.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ce.texSubImage2D(3553,r,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?ce.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):ce.texSubImage2D(3553,r,e.x,e.y,a,s,t.image),0===r&&n.generateMipmaps&&ce.generateMipmap(3553),V.unbindTexture()},this.initTexture=function(e){X.setTexture2D(e,0),V.unbindTexture()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Hs(e){Vs.call(this,e)}js.prototype=Object.assign(Object.create(ko.prototype),{constructor:js,isArrayCamera:!0}),Us.prototype=Object.assign(Object.create(ai.prototype),{constructor:Us,isGroup:!0}),Object.assign(Bs.prototype,{constructor:Bs,getHandSpace:function(){if(null===this._hand&&(this._hand=new Us,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(var e=0;e<=window.XRHand.LITTLE_PHALANX_TIP;e++){var t=new Us;t.matrixAutoUpdate=!1,t.visible=!1,this._hand.joints.push(t),this._hand.add(t)}return this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Us,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Us,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){var r=null,i=null,o=null,a=this._targetRay,s=this._grip,u=this._hand;if(e)if(u&&e.hand){o=!0;for(var c=0;c<=window.XRHand.LITTLE_PHALANX_TIP;c++)if(e.hand[c]){var l=t.getJointPose(e.hand[c],n),f=u.joints[c];null!==l&&(f.matrix.fromArray(l.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.jointRadius=l.radius),f.visible=null!==l;var h=u.joints[window.XRHand.INDEX_PHALANX_TIP],d=u.joints[window.XRHand.THUMB_PHALANX_TIP],p=h.position.distanceTo(d.position);u.inputState.pinching&&p>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=.015&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}}else null!==a&&null!==(r=t.getPose(e.targetRaySpace,n))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)),null!==s&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==u&&(u.visible=null!==o),this}}),Object.assign(Gs.prototype,Xn.prototype),Hs.prototype=Object.assign(Object.create(Vs.prototype),{constructor:Hs,isWebGL1Renderer:!0});var Ws=function(){function e(t,n){Object(f.a)(this,e),Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new ki(t),this.density=void 0!==n?n:25e-5}return Object(h.a)(e,[{key:"clone",value:function(){return new e(this.color,this.density)}},{key:"toJSON",value:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}]),e}(),Xs=function(){function e(t,n,r){Object(f.a)(this,e),Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new ki(t),this.near=void 0!==n?n:1,this.far=void 0!==r?r:1e3}return Object(h.a)(e,[{key:"clone",value:function(){return new e(this.color,this.near,this.far)}},{key:"toJSON",value:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}]),e}(),qs=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(){var e;return Object(f.a)(this,n),e=t.call(this),Object.defineProperty(Object(u.a)(e),"isScene",{value:!0}),e.type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:Object(u.a)(e)})),e}return Object(h.a)(n,[{key:"copy",value:function(e,t){return Object(o.a)(Object(a.a)(n.prototype),"copy",this).call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var t=Object(o.a)(Object(a.a)(n.prototype),"toJSON",this).call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}]),n}(ai);function Ys(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Dn,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Kn.generateUUID()}Object.defineProperty(Ys.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ys.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;re.far||t.push({distance:s,point:Js.clone(),uv:_i.getUV(Js,ou,au,su,uu,cu,lu,new Zn),face:null,object:this})}},copy:function(e){return ai.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});var du=new sr,pu=new sr;function vu(){ai.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function mu(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),bo.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Dr,this.bindMatrixInverse=new Dr}vu.prototype=Object.assign(Object.create(ai.prototype),{constructor:vu,isLOD:!0,copy:function(e){ai.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n0){var n,r;for(n=1,r=t.length;n0){du.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(du);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){du.setFromMatrixPosition(e.matrixWorld),pu.setFromMatrixPosition(this.matrixWorld);var n,r,i=du.distanceTo(pu)/e.zoom;for(t[0].object.visible=!0,n=1,r=t.length;n=t[n].distance;n++)t[n-1].object.visible=!1,t[n].object.visible=!0;for(this._currentLevel=n-1;na)){l.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(l);be.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else for(var w=0,_=d.count-1;w<_;w+=f){if(s.fromBufferAttribute(d,w),u.fromBufferAttribute(d,w+1),!(Ru.distanceSqToSegment(s,u,l,c)>a)){l.applyMatrix4(this.matrixWorld);var x=e.ray.origin.distanceTo(l);xe.far||t.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}else if(n.isGeometry)for(var M=n.vertices,S=M.length,E=0;Ea)){l.applyMatrix4(this.matrixWorld);var T=e.ray.origin.distanceTo(l);Te.far||t.push({distance:T,point:c.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}}},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var Iu=new sr,Lu=new sr;function Du(e,t){Pu.call(this,e,t),this.type="LineSegments"}function Nu(e,t){Pu.call(this,e,t),this.type="LineLoop"}function Fu(e){Oi.call(this),this.type="PointsMaterial",this.color=new ki(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Du.prototype=Object.assign(Object.create(Pu.prototype),{constructor:Du,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;ri.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:u,index:t,face:null,object:a})}}function Hu(e,t,n,r,i,o,a,s,u){nr.call(this,e,t,n,r,i,o,a,s,u),this.format=void 0!==a?a:qe,this.minFilter=void 0!==o?o:Ce,this.magFilter=void 0!==i?i:Ce,this.generateMipmaps=!1;var c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function Wu(e,t,n,r,i,o,a,s,u,c,l,f){nr.call(this,null,o,a,s,u,c,r,i,l,f),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Xu(e,t,n,r,i,o,a,s,u){nr.call(this,e,t,n,r,i,o,a,s,u),this.needsUpdate=!0}function qu(e,t,n,r,i,o,a,s,u,c){if((c=void 0!==c?c:Ze)!==Ze&&c!==Je)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Ze&&(n=Fe),void 0===n&&c===Je&&(n=We),nr.call(this,null,r,i,o,a,s,c,n,u),this.image={width:e,height:t},this.magFilter=void 0!==a?a:Se,this.minFilter=void 0!==s?s:Se,this.flipY=!1,this.generateMipmaps=!1}zu.prototype=Object.assign(Object.create(ai.prototype),{constructor:zu,isPoints:!0,copy:function(e){return ai.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Bu.copy(n.boundingSphere),Bu.applyMatrix4(r),Bu.radius+=i,!1!==e.ray.intersectsSphere(Bu)){ju.getInverse(r),Uu.copy(e.ray).applyMatrix4(ju);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){var s=n.index,u=n.attributes.position;if(null!==s)for(var c=s.array,l=0,f=c.length;l0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),Hu.prototype=Object.assign(Object.create(nr.prototype),{constructor:Hu,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){var e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Wu.prototype=Object.create(nr.prototype),Wu.prototype.constructor=Wu,Wu.prototype.isCompressedTexture=!0,Xu.prototype=Object.create(nr.prototype),Xu.prototype.constructor=Xu,Xu.prototype.isCanvasTexture=!0,qu.prototype=Object.create(nr.prototype),qu.prototype.constructor=qu,qu.prototype.isDepthTexture=!0;var Yu=0,$u=new Dr,Qu=new ai,Ku=new sr;function Zu(){Object.defineProperty(this,"id",{value:Yu+=2}),this.uuid=Kn.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}Zu.prototype=Object.assign(Object.create(Xn.prototype),{constructor:Zu,isGeometry:!0,applyMatrix4:function(e){for(var t=(new Jn).getNormalMatrix(e),n=0,r=this.vertices.length;n0)for(var h=0;h0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var e=0,t=this.faces.length;e=0;p--){var v=u[p];this.faces.splice(v,1);for(var m=0,g=this.faceVertexUvs.length;m0,g=p.vertexNormals.length>0,y=1!==p.color.r||1!==p.color.g||1!==p.color.b,b=p.vertexColors.length>0,w=0;if(w=S(w,0,0),w=S(w,1,!0),w=S(w,2,!1),w=S(w,3,v),w=S(w,4,m),w=S(w,5,g),w=S(w,6,y),w=S(w,7,b),a.push(w),a.push(p.a,p.b,p.c),a.push(p.materialIndex),v){var _=this.faceVertexUvs[0][d];a.push(A(_[0]),A(_[1]),A(_[2]))}if(m&&a.push(E(p.normal)),g){var x=p.vertexNormals;a.push(E(x[0]),E(x[1]),E(x[2]))}if(y&&a.push(T(p.color)),b){var M=p.vertexColors;a.push(T(M[0]),T(M[1]),T(M[2]))}}function S(e,t,n){return n?e|1<0&&(e.data.colors=c),f.length>0&&(e.data.uvs=[f]),e.data.faces=a,e},clone:function(){return(new Zu).copy(this)},copy:function(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;for(var t=e.vertices,n=0,r=t.length;n0&&x(!0),r>0&&x(!1)),h.setIndex(p),h.setAttribute("position",new Vi(v,3)),h.setAttribute("normal",new Vi(m,3)),h.setAttribute("uv",new Vi(g,2)),h}return n}(eo),rc=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r,i,o,a,s,u,c){var l;return Object(f.a)(this,n),(l=t.call(this)).type="CylinderGeometry",l.parameters={radiusTop:e,radiusBottom:r,height:i,radialSegments:o,heightSegments:a,openEnded:s,thetaStart:u,thetaLength:c},l.fromBufferGeometry(new nc(e,r,i,o,a,s,u,c)),l.mergeVertices(),l}return n}(Zu),ic=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r,i,o,a,s,u){var c;return Object(f.a)(this,n),(c=t.call(this,0,e,r,i,o,a,s,u)).type="ConeGeometry",c.parameters={radius:e,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:u},c}return n}(rc),oc=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r,i,o,a,s,u){var c;return Object(f.a)(this,n),(c=t.call(this,0,e,r,i,o,a,s,u)).type="ConeBufferGeometry",c.parameters={radius:e,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:u},c}return n}(nc),ac=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r,i,o){var a;Object(f.a)(this,n),(a=t.call(this)).type="PolyhedronBufferGeometry",a.parameters={vertices:e,indices:r,radius:i,detail:o},i=i||1;var s=[],u=[];function c(e,t,n,r){for(var i=r+1,o=[],a=0;a<=i;a++){o[a]=[];for(var s=e.clone().lerp(n,a/i),u=t.clone().lerp(n,a/i),c=i-a,f=0;f<=c;f++)o[a][f]=0===f&&a===i?s:s.clone().lerp(u,f/c)}for(var h=0;h.9&&o<.1&&(t<.2&&(u[e+0]+=1),n<.2&&(u[e+2]+=1),r<.2&&(u[e+4]+=1))}}()}(),a.setAttribute("position",new Vi(s,3)),a.setAttribute("normal",new Vi(s.slice(),3)),a.setAttribute("uv",new Vi(u,2)),0===o?a.computeVertexNormals():a.normalizeNormals(),a}return n}(eo),sc=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;Object(f.a)(this,n);var o=(1+Math.sqrt(5))/2,a=1/o,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-a,-o,0,-a,o,0,a,-o,0,a,o,-a,-o,0,-a,o,0,a,-o,0,a,o,0,-o,0,-a,o,0,-a,-o,0,a,o,0,a];return(i=t.call(this,s,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,r)).type="DodecahedronBufferGeometry",i.parameters={radius:e,detail:r},i}return n}(ac),uc=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).type="DodecahedronGeometry",i.parameters={radius:e,detail:r},i.fromBufferGeometry(new sc(e,r)),i.mergeVertices(),i}return n}(Zu),cc=new sr,lc=new sr,fc=new sr,hc=new _i,dc=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;Object(f.a)(this,n),(i=t.call(this)).type="EdgesGeometry",i.parameters={thresholdAngle:r},r=void 0!==r?r:1,e.isGeometry&&(e=(new eo).fromGeometry(e));for(var o=Math.pow(10,4),a=Math.cos(Kn.DEG2RAD*r),s=e.getIndex(),u=e.getAttribute("position"),c=s?s.count:u.count,l=[0,0,0],h=["a","b","c"],d=new Array(3),p={},v=[],m=0;m80*n){r=o=e[0],i=a=e[1];for(var p=n;po&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return gc(h,d,n,r,i,c),d};function vc(e,t,n,r,i){var o,a;if(i===function(e,t,n,r){for(var i=0,o=t,a=n-r;o0)for(o=t;o=t;o-=r)a=Nc(o,e[o],e[o+1],a);return a&&Rc(a,a.next)&&(Fc(a),a=a.next),a}function mc(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Rc(r,r.next)&&0!==Cc(r.prev,r,r.next))r=r.next;else{if(Fc(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function gc(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=Ec(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,u,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,o);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,o?bc(e,r,i,o):yc(e))t.push(s.i/n),t.push(e.i/n),t.push(u.i/n),Fc(e),e=u.next,c=u.next;else if((e=u)===c){a?1===a?gc(e=wc(mc(e),t,n),t,n,r,i,o,2):2===a&&_c(e,t,n,r,i,o):gc(mc(e),t,n,r,i,o,1);break}}}function yc(e){var t=e.prev,n=e,r=e.next;if(Cc(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Ac(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Cc(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function bc(e,t,n,r){var i=e.prev,o=e,a=e.next;if(Cc(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=Ec(s,u,t,n,r),h=Ec(c,l,t,n,r),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&Ac(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Cc(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&Ac(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Cc(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&Ac(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Cc(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&Ac(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Cc(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function wc(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!Rc(i,o)&&Oc(i,r,r.next,o)&&Lc(i,o)&&Lc(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),Fc(r),Fc(r.next),r=e=o),r=r.next}while(r!==e);return mc(r)}function _c(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&kc(a,s)){var u=Dc(a,s);return a=mc(a,a.next),u=mc(u,u.next),gc(a,t,n,r,i,o),void gc(u,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function xc(e,t){return e.x-t.x}function Mc(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=l&&i!==r.x&&Ac(on.x||r.x===n.x&&Sc(n,r)))&&(n=r,h=u)),r=r.next}while(r!==c);return n}(e,t)){var n=Dc(t,e);mc(t,t.next),mc(n,n.next)}}function Sc(e,t){return Cc(e.prev,e,t.prev)<0&&Cc(t.next,e,e.next)<0}function Ec(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Tc(e){var t=e,n=e;do{(t.x=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function kc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Oc(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Lc(e,t)&&Lc(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Cc(e.prev,e,t.prev)||Cc(e,t.prev,t))||Rc(e,t)&&Cc(e.prev,e,e.next)>0&&Cc(t.prev,t,t.next)>0)}function Cc(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Rc(e,t){return e.x===t.x&&e.y===t.y}function Oc(e,t,n,r){var i=Ic(Cc(e,t,n)),o=Ic(Cc(e,t,r)),a=Ic(Cc(n,r,e)),s=Ic(Cc(n,r,t));return i!==o&&a!==s||(!(0!==i||!Pc(e,n,t))||(!(0!==o||!Pc(e,r,t))||(!(0!==a||!Pc(n,e,r))||!(0!==s||!Pc(n,t,r)))))}function Pc(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Ic(e){return e>0?1:e<0?-1:0}function Lc(e,t){return Cc(e.prev,e,e.next)<0?Cc(e,t,e.next)>=0&&Cc(e,e.prev,t)>=0:Cc(e,t,e.prev)<0||Cc(e,e.next,t)<0}function Dc(e,t){var n=new jc(e.i,e.x,e.y),r=new jc(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Nc(e,t,n,r){var i=new jc(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Fc(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function jc(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Uc={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function Gc(e,t){for(var n=0;nNumber.EPSILON){var h=Math.sqrt(l),d=Math.sqrt(u*u+c*c),p=t.x-s/h,v=t.y+a/h,m=((n.x-c/d-p)*c-(n.y+u/d-v)*u)/(a*c-s*u),g=(r=p+a*m-e.x)*r+(i=v+s*m-e.y)*i;if(g<=2)return new Zn(r,i);o=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?u>Number.EPSILON&&(y=!0):a<-Number.EPSILON?u<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(c)&&(y=!0),y?(r=-s,i=a,o=Math.sqrt(l)):(r=a,i=s,o=Math.sqrt(l/2))}return new Zn(r/o,i/o)}for(var F=[],j=0,U=C.length,B=U-1,G=j+1;j=0;ge--){for(var ye=ge/d,be=l*Math.cos(ye*Math.PI/2),we=f*Math.sin(ye*Math.PI/2)+h,_e=0,xe=C.length;_e=0;){var r=n,o=n-1;o<0&&(o=e.length-1);for(var a=0,s=i+2*d;a=0?(e(g-s,v,l),f.subVectors(c,l)):(e(g+s,v,l),f.subVectors(l,c)),v-s>=0?(e(g,v-s,l),h.subVectors(c,l)):(e(g,v+s,l),h.subVectors(l,c)),u.crossVectors(f,h).normalize(),o.push(u.x,u.y,u.z),a.push(g,v)}for(var y=0;y0)&&m.push(k,C,O),(T!==i-1||l=r)){l.push(u.times[h]);for(var p=0;po.tracks[m].times[0]&&(v=o.tracks[m].times[0]);for(var g=0;g=r.times[f]){var v=f*u+s,m=v+u-s;h=Rl.arraySlice(r.values,v,m)}else{var g=r.createInterpolant(),y=s,b=u-s;g.evaluate(o),h=Rl.arraySlice(g.resultBuffer,y,b)}"quaternion"===i&&(new ar).fromArray(h).normalize().conjugate().toArray(h);for(var w=a.times.length,_=0;_=i)break e;var s=t[1];e=(i=t[--n-1]))break t}o=n,n=0}for(;n>>1;et;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Rl.arraySlice(n,i,o),this.values=Rl.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"===typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==r&&Rl.isTypedArray(r))for(var u=0,c=r.length;u!==c;++u){var l=r[u];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,l),e=!1;break}}return e},optimize:function(){for(var e=Rl.arraySlice(this.times),t=Rl.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Kt,i=e.length-1,o=1,a=1;a0){e[o]=e[i];for(var g=i*n,y=o*n,b=0;b!==n;++b)t[y+b]=t[g+b];++o}return o!==e.length?(this.times=Rl.arraySlice(e,0,o),this.values=Rl.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this},clone:function(){var e=Rl.arraySlice(this.times,0),t=Rl.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),Nl.prototype=Object.assign(Object.create(Dl.prototype),{constructor:Nl,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:$t,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Fl.prototype=Object.assign(Object.create(Dl.prototype),{constructor:Fl,ValueTypeName:"color"}),jl.prototype=Object.assign(Object.create(Dl.prototype),{constructor:jl,ValueTypeName:"number"}),Ul.prototype=Object.assign(Object.create(Ol.prototype),{constructor:Ul,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-t)/(r-t),u=e*a,c=u+a;u!==c;u+=4)ar.slerpFlat(i,0,o,u-a,o,u,s);return i}}),Bl.prototype=Object.assign(Object.create(Dl.prototype),{constructor:Bl,ValueTypeName:"quaternion",DefaultInterpolation:Qt,InterpolantFactoryMethodLinear:function(e){return new Ul(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Gl.prototype=Object.assign(Object.create(Dl.prototype),{constructor:Gl,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:$t,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),zl.prototype=Object.assign(Object.create(Dl.prototype),{constructor:zl,ValueTypeName:"vector"}),Object.assign(Vl,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,o=n.length;i!==o;++i)t.push(Hl(n[i]).scale(r));return new Vl(e.name,e.duration,t,e.blendMode)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode},i=0,o=n.length;i!==o;++i)t.push(Dl.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,o=[],a=0;a1){var c=u[1],l=r[c];l||(r[c]=l=[]),l.push(s)}}var f=[];for(var h in r)f.push(Vl.CreateFromMorphTargetSequence(h,r[h],t,n));return f},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var o=[],a=[];Rl.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode,s=e.length||-1,u=e.hierarchy||[],c=0;c0||0===e.search(/^data\:image\/jpeg/);i.format=r?qe:Ye,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(rf.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n=[],r=this.getPoint(0),i=0;n.push(0);for(var o=1;o<=e;o++)i+=(t=this.getPoint(o/e)).distanceTo(r),n.push(i),r=t;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,u=o-1;s<=u;)if((a=r[i=Math.floor(s+(u-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(r[i=u]===n)return i/(o-1);var c=r[i];return(i+(n-c)/(r[i+1]-c))/(o-1)},getTangent:function(e,t){var n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);var o=this.getPoint(r),a=this.getPoint(i),s=t||(o.isVector2?new Zn:new sr);return s.copy(a).sub(o).normalize(),s},getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){for(var n=new sr,r=[],i=[],o=[],a=new sr,s=new Dr,u=0;u<=e;u++){var c=u/e;r[u]=this.getTangentAt(c,new sr),r[u].normalize()}i[0]=new sr,o[0]=new sr;var l=Number.MAX_VALUE,f=Math.abs(r[0].x),h=Math.abs(r[0].y),d=Math.abs(r[0].z);f<=l&&(l=f,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),d<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(var p=1;p<=e;p++){if(i[p]=i[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(r[p-1],r[p]),a.length()>Number.EPSILON){a.normalize();var v=Math.acos(Kn.clamp(r[p-1].dot(r[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(a,v))}o[p].crossVectors(r[p],i[p])}if(!0===t){var m=Math.acos(Kn.clamp(i[0].dot(i[e]),-1,1));m/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(m=-m);for(var g=1;g<=e;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],m*g)),o[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),of.prototype=Object.create(rf.prototype),of.prototype.constructor=of,of.prototype.isEllipseCurve=!0,of.prototype.getPoint=function(e,t){for(var n=t||new Zn,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(u)/a)+1)*a:0===c&&u===a-1&&(u=a-2,c=1),this.closed||u>0?n=o[(u-1)%a]:(uf.subVectors(o[0],o[1]).add(o[0]),n=uf);var l=o[u%a],f=o[(u+1)%a];if(this.closed||u+2r.length-2?r.length-1:o+1],l=r[o>r.length-3?r.length-1:o+2];return n.set(df(a,s.x,u.x,c.x,l.x),df(a,s.y,u.y,c.y,l.y)),n},xf.prototype.copy=function(e){rf.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t=t){var i=n[r]-t,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){rf.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t0){var c=u.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(u);var l=u.getPoint(1);return this.currentPoint.copy(l),this},copy:function(e){return Sf.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Sf.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Sf.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Tf.prototype=Object.assign(Object.create(Ef.prototype),{constructor:Tf,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}],[{key:"getBasisAt",value:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}]),e}();function Bf(e,t){Af.call(this,void 0,t),this.type="LightProbe",this.sh=void 0!==e?e:new Uf}function Gf(e){Yl.call(this,e),this.textures={}}Bf.prototype=Object.assign(Object.create(Af.prototype),{constructor:Bf,isLightProbe:!0,copy:function(e){return Af.prototype.copy.call(this,e),this.sh.copy(e.sh),this},fromJSON:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this},toJSON:function(e){var t=Af.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}}),Gf.prototype=Object.assign(Object.create(Yl.prototype),{constructor:Gf,load:function(e,t,n,r){var i=this,o=new Ql(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(o){r?r(o):console.error(o),i.manager.itemError(e)}}),n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new Cl[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new ki).setHex(e.sheen)),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.vertexTangents&&(r.vertexTangents=e.vertexTangents),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"===typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var i in e.uniforms){var o=e.uniforms[i];switch(r.uniforms[i]={},o.type){case"t":r.uniforms[i].value=n(o.value);break;case"c":r.uniforms[i].value=(new ki).setHex(o.value);break;case"v2":r.uniforms[i].value=(new Zn).fromArray(o.value);break;case"v3":r.uniforms[i].value=(new sr).fromArray(o.value);break;case"v4":r.uniforms[i].value=(new rr).fromArray(o.value);break;case"m3":r.uniforms[i].value=(new Jn).fromArray(o.value);break;case"m4":r.uniforms[i].value=(new Dr).fromArray(o.value);break;default:r.uniforms[i].value=o.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var a in e.extensions)r.extensions[a]=e.extensions[a];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new Zn).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new Zn).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r},setTextures:function(e){return this.textures=e,this}});var zf={decodeText:function(e){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n0){var a=new Xl(t);(n=new Jl(a)).setCrossOrigin(this.crossOrigin);for(var s=0,u=e.length;sNumber.EPSILON){if(c<0&&(a=t[o],u=-u,s=t[i],c=-c),e.ys.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var l=c*(e.x-a.x)-u*(e.y-a.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var i,o,a,s=Uc.isClockWise,u=this.subPaths;if(0===u.length)return[];if(!0===t)return n(u);var c=[];if(1===u.length)return o=u[0],(a=new Tf).curves=o.curves,c.push(a),c;var l=!s(u[0].getPoints());l=e?!l:l;var f,h,d=[],p=[],v=[],m=0;p[m]=void 0,v[m]=[];for(var g=0,y=u.length;g1){for(var b=!1,w=[],_=0,x=p.length;_0&&(b||(v=d))}for(var R=0,O=p.length;R0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var u=t,c=t+t;u!==c;++u)if(n[u]!==n[u+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,o=r;i!==o;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n=.5)for(var o=0;o!==i;++o)e[t+o]=e[n+o]},_slerp:function(e,t,n,r){ar.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){var o=this._workIndex*i;ar.multiplyQuaternionsFlat(e,o,e,t,e,n),ar.slerpFlat(e,t,e,t,e,o,r)},_lerp:function(e,t,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[n+a]*r}},_lerpAdditive:function(e,t,n,r,i){for(var o=0;o!==i;++o){var a=t+o;e[a]=e[a]+e[n+o]*r}}});var Sh="\\[\\]\\.:\\/",Eh=new RegExp("[\\[\\]\\.:\\/]","g"),Th="[^\\[\\]\\.:\\/]",Ah="[^"+Sh.replace("\\.","")+"]",kh=/((?:WC+[\/:])*)/.source.replace("WC",Th),Ch=/(WCOD+)?/.source.replace("WCOD",Ah),Rh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Th),Oh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Th),Ph=new RegExp("^"+kh+Ch+Rh+Oh+"$"),Ih=["material","materials","bones"];function Lh(e,t,n){var r=n||Dh.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Dh(e,t,n){this.path=t,this.parsedPath=n||Dh.parseTrackName(t),this.node=Dh.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Nh(){this.uuid=Kn.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}Object.assign(Lh.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(Dh,{Composite:Lh,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Dh.Composite(e,t,n):new Dh(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Eh,"")},parseTrackName:function(e){var t=Ph.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==Ih.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function e(n){for(var r=0;r=i){var l=i++,f=e[l];t[f.uuid]=c,e[c]=f,t[u]=l,e[l]=s;for(var h=0,d=r;h!==d;++h){var p=n[h],v=p[l],m=p[c];p[c]=v,p[l]=m}}}this.nCachedObjects_=i},uncache:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,o=e.length,a=0,s=arguments.length;a!==s;++a){var u=arguments[a],c=u.uuid,l=t[c];if(void 0!==l)if(delete t[c],l0&&(t[_.uuid]=l),e[l]=_,e.pop();for(var x=0,M=r;x!==M;++x){var S=n[x];S[l]=S[w],S.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,u=s.length,c=this.nCachedObjects_,l=new Array(u);r=i.length,n[e]=r,o.push(e),a.push(t),i.push(l);for(var f=c,h=s.length;f!==h;++f){var d=s[f];l[f]=new Dh(d,e,t)}return l},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];t[e[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}});var Fh=function(){function e(t,n,r,i){Object(f.a)(this,e),this._mixer=t,this._clip=n,this._localRoot=r||null,this.blendMode=i||n.blendMode;for(var o=n.tracks,a=o.length,s=new Array(a),u={endingStart:Zt,endingEnd:Zt},c=0;c!==a;++c){var l=o[c].createInterpolant(null);s[c]=l,l.settings=u}this._interpolantSettings=u,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=qt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}return Object(h.a)(e,[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(e){return this._startTime=e,this}},{key:"setLoop",value:function(e,t){return this.loop=e,this.repetitions=t,this}},{key:"setEffectiveWeight",value:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(e){return this._scheduleFading(e,0,1)}},{key:"fadeOut",value:function(e){return this._scheduleFading(e,1,0)}},{key:"crossFadeFrom",value:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,o=i/r,a=r/i;e.warp(1,o,t),this.warp(a,1,t)}return this}},{key:"crossFadeTo",value:function(e,t,n){return e.crossFadeFrom(this,t,n)}},{key:"stopFading",value:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"setEffectiveTimeScale",value:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}},{key:"syncWith",value:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}},{key:"halt",value:function(e){return this.warp(this._effectiveTimeScale,0,e)}},{key:"warp",value:function(e,t,n){var r=this._mixer,i=r.time,o=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,u=a.sampleValues;return s[0]=i,s[1]=i+n,u[0]=e/o,u[1]=t/o,this}},{key:"stopWarping",value:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(e-i)*n;if(o<0||0===n)return;this._startTime=null,t=n*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0){var u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case nn:for(var l=0,f=u.length;l!==f;++l)u[l].evaluate(a),c[l].accumulateAdditive(s);break;case tn:default:for(var h=0,d=u.length;h!==d;++h)u[h].evaluate(a),c[h].accumulate(r,s)}}}else this._updateWeight(e)}},{key:"_updateWeight",value:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}},{key:"_updateTimeScale",value:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t}},{key:"_updateTime",value:function(e){var t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,o=n===Yt;if(0===e)return-1===i?r:o&&1===(1&i)?t-r:r;if(n===Xt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=t||r<0){var a=Math.floor(r/t);r-=t*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&1===(1&i))return t-r}return r}},{key:"_setEndings",value:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=Jt,r.endingEnd=Jt):(r.endingStart=e?this.zeroSlopeAtStart?Jt:Zt:en,r.endingEnd=t?this.zeroSlopeAtEnd?Jt:Zt:en)}},{key:"_scheduleFading",value:function(e,t,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this}}]),e}();function jh(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}jh.prototype=Object.assign(Object.create(Xn.prototype),{constructor:jh,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,u=this._bindingsByRootAndName,c=u[s];void 0===c&&(c={},u[s]=c);for(var l=0;l!==i;++l){var f=r[l],h=f.name,d=c[h];if(void 0!==d)o[l]=d;else{if(void 0!==(d=o[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,h));continue}var p=t&&t._propertyBindings[l].binding.parsedPath;++(d=new Mh(Dh.create(n,h,p),f.ValueTypeName,f.getValueSize())).referenceCount,this._addInactiveBinding(d,s,h),o[l]=d}a[l].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1,a=0;a!==n;++a){t[a]._update(r,e,i,o)}for(var s=this._bindings,u=this._nActiveBindings,c=0;c!==u;++c)s[c].apply(o);return this},setTime:function(e){this.time=0;for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(f.a)(this,e),this.radius=t,this.phi=n,this.theta=r,this}return Object(h.a)(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}},{key:"makeSafe",value:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Kn.clamp(t/this.radius,-1,1))),this}}]),e}(),Xh=function(){function e(t,n,r){return Object(f.a)(this,e),this.radius=void 0!==t?t:1,this.theta=void 0!==n?n:0,this.y=void 0!==r?r:0,this}return Object(h.a)(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}}]),e}(),qh=new Zn,Yh=function(){function e(t,n){Object(f.a)(this,e),Object.defineProperty(this,"isBox2",{value:!0}),this.min=void 0!==t?t:new Zn(1/0,1/0),this.max=void 0!==n?n:new Zn(-1/0,-1/0)}return Object(h.a)(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}},{key:"getParameter",value:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Zn),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}},{key:"clampPoint",value:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Zn),t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return qh.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}(),$h=new sr,Qh=new sr,Kh=function(){function e(t,n){Object(f.a)(this,e),this.start=void 0!==t?t:new sr,this.end=void 0!==n?n:new sr}return Object(h.a)(e,[{key:"set",value:function(e,t){return this.start.copy(e),this.end.copy(t),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.start.copy(e.start),this.end.copy(e.end),this}},{key:"getCenter",value:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new sr),e.addVectors(this.start,this.end).multiplyScalar(.5)}},{key:"delta",value:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new sr),e.subVectors(this.end,this.start)}},{key:"distanceSq",value:function(){return this.start.distanceToSquared(this.end)}},{key:"distance",value:function(){return this.start.distanceTo(this.end)}},{key:"at",value:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new sr),this.delta(t).multiplyScalar(e).add(this.start)}},{key:"closestPointToPointParameter",value:function(e,t){$h.subVectors(e,this.start),Qh.subVectors(this.end,this.start);var n=Qh.dot(Qh),r=Qh.dot($h)/n;return t&&(r=Kn.clamp(r,0,1)),r}},{key:"closestPointToPoint",value:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new sr),this.delta(n).multiplyScalar(r).add(this.start)}},{key:"applyMatrix4",value:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}},{key:"equals",value:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}]),e}();function Zh(e){ai.call(this),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Zh.prototype=Object.create(ai.prototype),Zh.prototype.constructor=Zh,Zh.prototype.isImmediateRenderObject=!0;var Jh=new sr,ed=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;Object(f.a)(this,n),(i=t.call(this)).light=e,i.light.updateMatrixWorld(),i.matrix=e.matrixWorld,i.matrixAutoUpdate=!1,i.color=r;for(var o=new eo,a=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],s=0,u=1;s<32;s++,u++){var c=s/32*Math.PI*2,l=u/32*Math.PI*2;a.push(Math.cos(c),Math.sin(c),1,Math.cos(l),Math.sin(l),1)}o.setAttribute("position",new Vi(a,3));var h=new Tu({fog:!1,toneMapped:!1});return i.cone=new Du(o,h),i.add(i.cone),i.update(),i}return Object(h.a)(n,[{key:"dispose",value:function(){this.cone.geometry.dispose(),this.cone.material.dispose()}},{key:"update",value:function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Jh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Jh),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}]),n}(ai),td=new sr,nd=new Dr,rd=new Dr,id=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e){var r;Object(f.a)(this,n);for(var i=od(e),o=new eo,a=[],s=[],u=new ki(0,0,1),c=new ki(0,1,0),l=0;l1&&void 0!==arguments[1]?arguments[1]:16776960;Object(f.a)(this,n);var o=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),a=new Float32Array(24),s=new eo;return s.setIndex(new Di(o,1)),s.setAttribute("position",new Di(a,3)),(r=t.call(this,s,new Tu({color:i,toneMapped:!1}))).object=e,r.type="BoxHelper",r.matrixAutoUpdate=!1,r.update(),r}return Object(h.a)(n,[{key:"update",value:function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Md.setFromObject(this.object),!Md.isEmpty()){var t=Md.min,n=Md.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}},{key:"setFromObject",value:function(e){return this.object=e,this.update(),this}},{key:"copy",value:function(e){return Du.prototype.copy.call(this,e),this.object=e.object,this}}]),n}(Du),Ed=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;Object(f.a)(this,n);var o=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),a=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new eo;return s.setIndex(new Di(o,1)),s.setAttribute("position",new Vi(a,3)),(r=t.call(this,s,new Tu({color:i,toneMapped:!1}))).box=e,r.type="Box3Helper",r.geometry.computeBoundingSphere(),r}return Object(h.a)(n,[{key:"updateMatrixWorld",value:function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Object(o.a)(Object(a.a)(n.prototype),"updateMatrixWorld",this).call(this,e))}}]),n}(Du),Td=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var o;Object(f.a)(this,n);var a=void 0!==i?i:16776960,s=new eo;s.setAttribute("position",new Vi([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),s.computeBoundingSphere(),(o=t.call(this,s,new Tu({color:a,toneMapped:!1}))).type="PlaneHelper",o.plane=e,o.size=void 0===r?1:r;var u=new eo;return u.setAttribute("position",new Vi([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),u.computeBoundingSphere(),o.add(new bo(u,new Pi({color:a,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1}))),o}return Object(h.a)(n,[{key:"updateMatrixWorld",value:function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?E:S,this.lookAt(this.plane.normal),Object(o.a)(Object(a.a)(n.prototype),"updateMatrixWorld",this).call(this,e)}}]),n}(Pu),Ad=new sr,kd=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(e,r,i,o,a,s){var u;return Object(f.a)(this,n),(u=t.call(this)).type="ArrowHelper",void 0===e&&(e=new sr(0,0,1)),void 0===r&&(r=new sr(0,0,0)),void 0===i&&(i=1),void 0===o&&(o=16776960),void 0===a&&(a=.2*i),void 0===s&&(s=.2*a),void 0===_d&&((_d=new eo).setAttribute("position",new Vi([0,0,0,0,1,0],3)),(xd=new nc(0,.5,1,5,1)).translate(0,-.5,0)),u.position.copy(r),u.line=new Pu(_d,new Tu({color:o,toneMapped:!1})),u.line.matrixAutoUpdate=!1,u.add(u.line),u.cone=new bo(xd,new Pi({color:o,toneMapped:!1})),u.cone.matrixAutoUpdate=!1,u.add(u.cone),u.setDirection(e),u.setLength(i,a,s),u}return Object(h.a)(n,[{key:"setDirection",value:function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Ad.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Ad,t)}}},{key:"setLength",value:function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}},{key:"setColor",value:function(e){this.line.material.color.set(e),this.cone.material.color.set(e)}},{key:"copy",value:function(e){return Object(o.a)(Object(a.a)(n.prototype),"copy",this).call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}]),n}(ai),Cd=function(e){Object(c.a)(n,e);var t=Object(l.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;Object(f.a)(this,n);var i=[0,0,0,r,0,0,0,0,0,0,r,0,0,0,0,0,0,r],o=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],a=new eo;a.setAttribute("position",new Vi(i,3)),a.setAttribute("color",new Vi(o,3));var s=new Tu({vertexColors:!0,toneMapped:!1});return(e=t.call(this,a,s)).type="AxesHelper",e}return n}(Du),Rd=Math.pow(2,8),Od=[.125,.215,.35,.446,.526,.582],Pd=5+Od.length,Id=20,Ld=(r={},Object(s.a)(r,sn,0),Object(s.a)(r,un,1),Object(s.a)(r,ln,2),Object(s.a)(r,hn,3),Object(s.a)(r,dn,4),Object(s.a)(r,pn,5),Object(s.a)(r,cn,6),r),Dd=new Lf,Nd=Xd(),Fd=Nd._lodPlanes,jd=Nd._sizeLods,Ud=Nd._sigmas,Bd=null,Gd=(1+Math.sqrt(5))/2,zd=1/Gd,Vd=[new sr(1,1,1),new sr(-1,1,1),new sr(1,1,-1),new sr(-1,1,-1),new sr(0,Gd,zd),new sr(0,Gd,-zd),new sr(zd,0,Gd),new sr(-zd,0,Gd),new sr(Gd,zd,0),new sr(-Gd,zd,0)],Hd=function(){function e(t){Object(f.a)(this,e),this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(e){var t=new Float32Array(e),n=new sr(0,1,0);return new wl({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:Ld[sn]},outputEncoding:{value:Ld[sn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:C,depthTest:!1,depthWrite:!1})}(Id),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}return Object(h.a)(e,[{key:"fromScene",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;Bd=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}},{key:"fromEquirectangular",value:function(e){return this._fromTexture(e)}},{key:"fromCubemap",value:function(e){return this._fromTexture(e)}},{key:"compileCubemapShader",value:function(){null===this._cubemapShader&&(this._cubemapShader=Qd(),this._compileMaterial(this._cubemapShader))}},{key:"compileEquirectangularShader",value:function(){null===this._equirectShader&&(this._equirectShader=$d(),this._compileMaterial(this._equirectShader))}},{key:"dispose",value:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var e=0;e2?Rd:0,Rd,Rd),s.setRenderTarget(r),s.render(e,i)}s.toneMapping=c,s.outputEncoding=u,s.setClearColor(l,f)}},{key:"_textureToCubeUV",value:function(e,t){var n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Qd()):null==this._equirectShader&&(this._equirectShader=$d());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new bo(Fd[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=Ld[e.encoding],o.outputEncoding.value=Ld[t.texture.encoding],Yd(t,0,0,3*Rd,2*Rd),n.setRenderTarget(t),n.render(i,Dd)}},{key:"_applyPMREM",value:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;rId&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(p," samples when the maximum is set to ").concat(Id));for(var v=[],m=0,g=0;g4?r-8+4:0),3*_,2*_),s.setRenderTarget(t),s.render(c,Dd)}}]),e}();function Wd(e){return void 0!==e&&e.type===Le&&(e.encoding===sn||e.encoding===un||e.encoding===cn)}function Xd(){for(var e=[],t=[],n=[],r=8,i=0;i4?a=Od[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),u=-s/2,c=1+s/2,l=[u,u,c,u,c,c,u,u,c,c,u,c],f=new Float32Array(108),h=new Float32Array(72),d=new Float32Array(36),p=0;p<6;p++){var v=p%3*2/3-1,m=p>2?0:-1,g=[v,m,0,v+2/3,m,0,v+2/3,m+1,0,v,m,0,v+2/3,m+1,0,v,m+1,0];f.set(g,18*p),h.set(l,12*p);var y=[p,p,p,p,p,p];d.set(y,6*p)}var b=new eo;b.setAttribute("position",new Di(f,3)),b.setAttribute("uv",new Di(h,2)),b.setAttribute("faceIndex",new Di(d,1)),e.push(b),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function qd(e){var t=new ir(3*Rd,3*Rd,e);return t.texture.mapping=be,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Yd(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function $d(){return new wl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new Zn(1,1)},inputEncoding:{value:Ld[sn]},outputEncoding:{value:Ld[sn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:C,depthTest:!1,depthWrite:!1})}function Qd(){return new wl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Ld[sn]},outputEncoding:{value:Ld[sn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:C,depthTest:!1,depthWrite:!1})}function Kd(e,t,n,r,i,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Ci(e,t,n,i,o,a)}var Zd=0,Jd=1,ep=0,tp=1,np=2;function rp(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function ip(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function op(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new zu(e,t)}function ap(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new fu(e)}function sp(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new zu(e,t)}function up(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Fu(e)}function cp(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Fu(e)}function lp(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Fu(e)}function fp(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new sr(e,t,n)}function hp(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Di(e,t).setUsage(Nn)}function dp(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Ni(e,t)}function pp(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Fi(e,t)}function vp(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ji(e,t)}function mp(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Ui(e,t)}function gp(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Bi(e,t)}function yp(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Gi(e,t)}function bp(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new zi(e,t)}function wp(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Vi(e,t)}function _p(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Hi(e,t)}function xp(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),hf.call(this,e),this.type="catmullrom",this.closed=!0}function Mp(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),hf.call(this,e),this.type="catmullrom"}function Sp(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),hf.call(this,e),this.type="catmullrom"}function Ep(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Cd(e)}function Tp(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Sd(e,t)}function Ap(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Du(new dc(e.geometry),new Tu({color:void 0!==t?t:16777215}))}function kp(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Du(new gl(e.geometry),new Tu({color:void 0!==t?t:16777215}))}function Cp(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Ql(e)}function Rp(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new tf(e)}function Op(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Po(e,n)}rf.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(rf.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Sf.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Zu,n=0,r=e.length;n3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u=Object(r.a)(t);try{for(u.s();!(i=u.n()).done;){var c=i.value;if(M()(n,c.args)){if(s)return;if(c.error)throw c.error;if(c.response)return c.response;throw c.promise}}}catch(f){u.e(f)}finally{u.f()}var l={args:n,promise:e.apply(void 0,Object(a.a)(n)).then((function(e){return l.response=null==e||e})).catch((function(e){return l.error=e})).then((function(){o>0&&setTimeout((function(){var e=t.indexOf(l);-1!==e&&t.splice(e,1)}),o)}))};if(t.push(l),!s)throw l.promise}function E(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(i)for(n=0;n0)&&(n=U(r,e,n))})),t=0;t0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!0===e)R.forEach((function(e){var n=e.containerInfo.__state;n.current.frames=n.current.ready?n.current.frames+t:t}));else if(e&&e.current){if(e.current.vr)return;e.current.frames=e.current.ready?e.current.frames+t:t}B||(B=!0,requestAnimationFrame(G))}var V={};function H(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e.__container,s=[],u=[],c=Object.keys(t);for(n=0;n-1&&delete m[c[n]];for(c=Object.keys(l),n=0;n0){if(g.forEach((function(t){var n=Object(h.a)(t,2),r=n[0],i=n[1];if(!u.includes(r)){var o,s,c=e,l=c[r];if(r.includes("-")){var d=r.split("-");if(!(l=d.reduce((function(e,t){return e[t]}),e))||!l.set){var p=f(d.reverse()),m=p[0];c=p.slice(1).reverse().reduce((function(e,t){return e[t]}),e),r=m}}var g,y=null==(o=e.__container)||null==(s=o.__state)?void 0:s.current.colorManagement;if(l&&l.set&&(l.copy||l instanceof v.Layers))if(Array.isArray(i))(g=l).set.apply(g,Object(a.a)(i));else l.copy&&i&&i.constructor&&l.constructor.name===i.constructor.name?l.copy(i):void 0!==i&&(l.set(i),y&&l instanceof v.Color&&l.convertSRGBToLinear());else c[r]=i,y&&c[r]instanceof v.Texture&&(c[r].encoding=v.sRGBEncoding);W(e)}})),i&&o&&e.raycast&&e.__handlers){e.__handlers=void 0;var y=o.__interaction.indexOf(e);y>-1&&o.__interaction.splice(y,1)}u.length&&(i&&o&&e.raycast&&o.__interaction.push(e),e.__handlers=u.reduce((function(e,n){return e[n.charAt(2).toLowerCase()+n.substr(3)]=t[n],e}),{})),e.parent&&X(e)}}function W(e){e.__container&&e.__container.__state&&z(e.__container.__state)}function X(e){e.onUpdate&&e.onUpdate(e)}function q(e,t,n,r,s){var u,c=t.args,l=void 0===c?[]:c,f=Object(o.a)(t,["args"]),h="".concat(e[0].toUpperCase()).concat(e.slice(1));if("primitive"===e)(u=(f=Object(d.a)({dispose:null},f)).object).__instance=!0,u.__dispose=u.dispose;else{var p=V[h]||v[h];if(!p)throw'"'.concat(h,'" is not part of the THREE namespace! Did you forget to extend it? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively');u=P.arr(l)?Object(i.a)(p,Object(a.a)(l)):new p(l)}for(;n.__container;)n=n.__container;if(!R.has(n)){n=function e(t){return t.return?e(t.return):t.stateNode&&t.stateNode.containerInfo}(s)}return u.__objects=[],u.__container=n,h.endsWith("Geometry")?f=Object(d.a)({attach:"geometry"},f):h.endsWith("Material")&&(f=Object(d.a)({attach:"material"},f)),H(u,f,{}),u}function Y(e,t){t&&(t.isObject3D?e.add(t):(e.__objects.push(t),t.parent=e,t.attachArray?(P.arr(e[t.attachArray])||(e[t.attachArray]=[]),e[t.attachArray].push(t)):t.attachObject?(P.obj(e[t.attachObject[0]])||(e[t.attachObject[0]]={}),e[t.attachObject[0]][t.attachObject[1]]=t):t.attach&&(e[t.attach]=t)),X(t),W(t))}function $(e,t,n){if(t){if(t.isObject3D){t.parent=e,t.dispatchEvent({type:"added"});var r=e.children.filter((function(e){return e!==t})),i=r.indexOf(n);e.children=[].concat(Object(a.a)(r.slice(0,i)),[t],Object(a.a)(r.slice(i))),X(t)}else Y(e,t);W(t)}}function Q(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){var r=n?Object(a.a)(e):e;r.forEach((function(e){return K(t,e)}))}}function K(e,t){t&&(t.isObject3D?e.remove(t):(t.parent=null,e.__objects&&(e.__objects=e.__objects.filter((function(e){return e!==t}))),t.attachArray?e[t.attachArray]=e[t.attachArray].filter((function(e){return e!==t})):t.attachObject?delete e[t.attachObject[0]][t.attachObject[1]]:t.attach&&(e[t.attach]=null)),t.__container&&(t.__container.__interaction=t.__container.__interaction.filter((function(e){return e!==t}))),W(t),null!==t.dispose&&Object(y.unstable_runWithPriority)(y.unstable_IdlePriority,(function(){Q(t.__objects,t),Q(t.children,t,!0),t.dispose&&"Scene"!==t.type?t.dispose():t.__dispose&&t.__dispose(),delete t.__container,delete t.__objects})))}function Z(e,t,n,r){var i=e.parent,o=q(t,n,e.__container,0,r);K(i,e),Y(i,o),[r,r.alternate].forEach((function(e){null!==e&&(e.stateNode=o,e.ref&&(P.fun(e.ref)?e.ref(o):e.ref.current=o))}))}var J=g()({now:y.unstable_now,createInstance:q,removeChild:K,appendChild:Y,insertBefore:$,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:P.fun(setTimeout)?setTimeout:void 0,cancelTimeout:P.fun(clearTimeout)?clearTimeout:void 0,setTimeout:P.fun(setTimeout)?setTimeout:void 0,clearTimeout:P.fun(clearTimeout)?clearTimeout:void 0,noTimeout:-1,appendInitialChild:Y,appendChildToContainer:Y,removeChildFromContainer:K,insertInContainerBefore:$,commitUpdate:function(e,t,n,r,i,a){if(e.__instance&&i.object&&i.object!==e)Z(e,n,i,a);else{var s=i.args,u=void 0===s?[]:s,c=Object(o.a)(i,["args"]),l=r.args,f=void 0===l?[]:l,d=Object(o.a)(r,["args"]);u.some((function(e,t){return P.obj(e)?Object.entries(e).some((function(e){var n=Object(h.a)(e,2),r=n[0];return n[1]!==f[t][r]})):e!==f[t]}))?Z(e,n,i,a):H(e,c,d,!0)}},hideInstance:function(e){e.isObject3D&&(e.visible=!1,W(e))},unhideInstance:function(e,t){(e.isObject3D&&null==t.visible||t.visible)&&(e.visible=!0,W(e))},hideTextInstance:function(){throw new Error("Text is not allowed in the react-three-fibre tree. You may have extraneous whitespace between components.")},getPublicInstance:function(e){return e},getRootHostContext:function(){return O},getChildHostContext:function(){return O},createTextInstance:function(){},finalizeInitialChildren:function(e){return e.__handlers},commitMount:function(e){var t=e.__container;t&&e.raycast&&e.__handlers&&t.__interaction.push(e)},prepareUpdate:function(){return O},shouldDeprioritizeSubtree:function(){return!1},prepareForCommit:function(){return null},preparePortalMount:function(){return null},resetAfterCommit:function(){},shouldSetTextContent:function(){return!1},clearContainer:function(){return!1}});P.fun(Symbol)&&Symbol.for&&Symbol.for("react.portal");J.injectIntoDevTools({bundleType:0,findHostInstanceByFiber:function(){return null},version:"5.3.10",rendererPackageName:"react-three-fiber"});function ee(e){return e.isOrthographicCamera}function te(e){return(e.eventObject||e.object).uuid+"/"+e.index}var ne=Object(b.createContext)({}),re=function(e){var t=e.children,n=e.gl,i=e.camera,s=e.orthographic,u=e.raycaster,c=e.size,l=e.pixelRatio,f=e.vr,p=void 0!==f&&f,m=e.concurrent,g=void 0!==m&&m,y=e.shadowMap,w=void 0!==y&&y,x=e.colorManagement,M=void 0===x||x,S=e.invalidateFrameloop,E=void 0!==S&&S,T=e.updateDefaultCamera,A=void 0===T||T,k=e.noEvents,C=void 0!==k&&k,O=e.onCreated,P=e.onPointerMissed,I=e.forceResize,L=Object(b.useState)(!1),D=Object(h.a)(L,2),N=D[0],F=D[1],j=Object(b.useState)((function(){return new v.Vector2})),B=Object(h.a)(j,1)[0],G=Object(b.useState)((function(){var e=new v.Raycaster;if(u){u.filter,u.computeOffsets;H(e,Object(o.a)(u,["filter","computeOffsets"]),{})}return e})),V=Object(h.a)(G,1)[0],W=Object(b.useState)((function(){var e=new v.Scene;return e.__interaction=[],e.__objects=[],e})),X=Object(h.a)(W,1)[0],q=Object(b.useState)((function(){var e=s?new v.OrthographicCamera(0,0,0,0,.1,1e3):new v.PerspectiveCamera(75,0,.1,1e3);return e.position.z=5,i&&H(e,i,{}),e.lookAt(0,0,0),e})),Y=Object(h.a)(q,2),$=Y[0],Q=Y[1],K=Object(b.useState)((function(){return new v.Clock})),Z=Object(h.a)(K,1)[0],re=Object(b.useRef)({ready:!1,active:!0,manual:0,colorManagement:M,vr:p,concurrent:g,noEvents:C,invalidateFrameloop:!1,frames:0,aspect:0,subscribers:[],camera:$,scene:X,raycaster:V,mouse:B,clock:Z,gl:n,size:c,viewport:null,initialClick:[0,0],initialHits:[],pointer:new _.TinyEmitter,captured:void 0,events:void 0,subscribe:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t&&re.current.manual++,re.current.subscribers.push({ref:e,priority:t}),re.current.subscribers=re.current.subscribers.sort((function(e,t){return e.priority-t.priority})),function(){var n;null!=(n=re.current)&&n.subscribers&&(t&&re.current.manual--,re.current.subscribers=re.current.subscribers.filter((function(t){return t.ref!==e})))}},setDefaultCamera:function(e){return Q(e)},invalidate:function(){return z(re)},intersect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return me(e,t)},forceResize:I}),ae=Object(b.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re.current.camera,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new v.Vector3(0,0,0),n=re.current.size,r=n.width,i=n.height,o=e.position.distanceTo(t);if(ee(e))return{width:r/e.zoom,height:i/e.zoom,factor:1,distance:o};var a=e.fov*Math.PI/180,s=2*Math.tan(a/2)*o,u=s*(r/i);return{width:u,height:s,factor:r/u,distance:o}}),[]);Object(b.useMemo)((function(){re.current.ready=N,re.current.size=c,re.current.camera=$,re.current.invalidateFrameloop=E,re.current.vr=p,re.current.gl=n,re.current.concurrent=g,re.current.noEvents=C,re.current.viewport=ae}),[E,p,g,C,N,c,$,n]),Object(b.useMemo)((function(){re.current.aspect=c.width/c.height,Object.assign(re.current.viewport,ae()),A&&(ee($)?($.left=c.width/-2,$.right=c.width/2,$.top=c.height/2,$.bottom=c.height/-2):$.aspect=re.current.aspect,$.updateProjectionMatrix(),$.updateMatrixWorld()),n.setSize(c.width,c.height),N&&z(re)}),[$,n,c,A,N]);var se=Object(b.useRef)(null);Object(b.useMemo)((function(){var e=re.current,t=(e.ready,e.manual,e.vr,e.noEvents,e.invalidateFrameloop,e.frames,e.subscribers,e.captured,e.initialClick,e.initialHits,Object(o.a)(e,["ready","manual","vr","noEvents","invalidateFrameloop","frames","subscribers","captured","initialClick","initialHits"]));se.current=t}),[c,$]),Object(b.useLayoutEffect)((function(){l&&(Array.isArray(l)?n.setPixelRatio(Math.max(Math.min(l[0],window.devicePixelRatio),l[1])):n.setPixelRatio(l))}),[n,l]),Object(b.useLayoutEffect)((function(){w&&(n.shadowMap.enabled=!0,"object"===typeof w?Object.assign(n.shadowMap,w):n.shadowMap.type=v.PCFSoftShadowMap),M&&(n.toneMapping=v.ACESFilmicToneMapping,n.outputEncoding=v.sRGBEncoding)}),[w,M]);var ue=Object(b.useMemo)((function(){return new Map}),[]),ce=new v.Vector3,le=Object(b.useCallback)((function(e){var t=(null==u||null==u.computeOffsets?void 0:u.computeOffsets(e,se.current))||e.nativeEvent;if(t){var n=t.offsetX,r=t.offsetY,i=re.current.size,o=i.width,a=i.height;B.set(n/o*2-1,-r/a*2+1),V.setFromCamera(B,re.current.camera)}}),[]),fe=Object(b.useCallback)((function(e,t){if(re.current.noEvents)return[];var n=new Set,i=[],o=t?t(re.current.scene.__interaction):re.current.scene.__interaction,a=V.intersectObjects(o,!0).filter((function(e){var t=te(e);return!n.has(t)&&(n.add(t),!0)}));u&&u.filter&&se.current&&(a=u.filter(a,se.current));var s,c=Object(r.a)(a);try{for(c.s();!(s=c.n()).done;)for(var l=s.value,f=l.object;f;){f.__handlers&&i.push(Object(d.a)(Object(d.a)({},l),{},{eventObject:f})),f=f.parent}}catch(h){c.e(h)}finally{c.f()}return i}),[]),he=Object(b.useCallback)((function(e){var t=e.nativeEvent.offsetX-re.current.initialClick[0],n=e.nativeEvent.offsetY-re.current.initialClick[1];return Math.round(Math.sqrt(t*t+n*n))}),[]),de=Object(b.useCallback)((function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];re.current.pointer.emit("pointerCancel",e),n&&le(e),Array.from(ue.values()).forEach((function(e){if(t&&(!t.length||!t.find((function(t){return t.object===e.object&&t.index===e.index})))){var n=e.eventObject.__handlers;if(ue.delete(te(e)),n){var r=Object(d.a)(Object(d.a)({},e),{},{intersections:t||[]});n.pointerOut&&n.pointerOut(Object(d.a)(Object(d.a)({},r),{},{type:"pointerout"})),n.pointerLeave&&n.pointerLeave(Object(d.a)(Object(d.a)({},r),{},{type:"pointerleave"}))}}}))}),[]),pe=Object(b.useCallback)((function(e,t){var n=fe(e,t);return re.current.captured&&"click"!==e.type&&"wheel"!==e.type&&re.current.captured.forEach((function(e){n.find((function(t){return t.eventObject===e.eventObject}))||n.push(e)})),n}),[]),ve=Object(b.useCallback)((function(e,t,n){return e.length&&function(){var i,o=ce.set(B.x,B.y,0).unproject(re.current.camera),s="click"===t.type?he(t):0,u=function(e){return t.target.releasePointerCapture(e)},c={stopped:!1,captured:!1},l=Object(r.a)(e);try{var f=function(){var r=i.value,l=function(e){c.captured||(c.captured=!0,re.current.captured=[]),re.current.captured&&re.current.captured.push(r),t.target.setPointerCapture(e)},f=Object(d.a)(Object(d.a)(Object(d.a)({},t),r),{},{intersections:e,stopped:c.stopped,delta:s,unprojectedPoint:o,ray:V.ray,camera:re.current.camera,stopPropagation:function(){var t=re.current.captured;if((!t||t.find((function(e){return e.eventObject.id===r.eventObject.id})))&&(f.stopped=c.stopped=!0,ue.size&&Array.from(ue.values()).find((function(e){return e.eventObject===r.eventObject})))){var n=e.slice(0,e.indexOf(r));de(f,[].concat(Object(a.a)(n),[r]))}},target:Object(d.a)(Object(d.a)({},t.target),{},{setPointerCapture:l,releasePointerCapture:u}),currentTarget:Object(d.a)(Object(d.a)({},t.currentTarget),{},{setPointerCapture:l,releasePointerCapture:u}),sourceEvent:t});if(n(f),!0===c.stopped)return"break"};for(l.s();!(i=l.n()).done;){if("break"===f())break}}catch(h){l.e(h)}finally{l.f()}}(),e}),[]),me=Object(b.useCallback)((function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];re.current.pointer.emit("pointerMove",e),t&&le(e);var n=pe(e,(function(e){return e.filter((function(e){return["Move","Over","Enter","Out","Leave"].some((function(t){return e.__handlers["pointer"+t]}))}))}));return de(e,n),ve(n,e,(function(e){var t=e.eventObject.__handlers;if(t){if(t.pointerOver||t.pointerEnter||t.pointerOut||t.pointerLeave){var n=te(e),r=ue.get(n);r?r.stopped&&e.stopPropagation():(ue.set(n,e),t.pointerOver&&t.pointerOver(Object(d.a)(Object(d.a)({},e),{},{type:"pointerover"})),t.pointerEnter&&t.pointerEnter(Object(d.a)(Object(d.a)({},e),{},{type:"pointerenter"})))}t.pointerMove&&t.pointerMove(e)}})),n}),[]),ge=Object(b.useCallback)((function(e){return function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];re.current.pointer.emit(e,t),n&&le(t);var r=pe(t);ve(r,t,(function(n){var r=n.eventObject,i=r.__handlers;i&&i[e]&&("click"!==e&&"contextMenu"!==e&&"doubleClick"!==e||re.current.initialHits.includes(r))&&(i[e](n),ie(t,X.__interaction,(function(e){return e!==r})))})),"pointerDown"===e&&(re.current.initialClick=[t.nativeEvent.offsetX,t.nativeEvent.offsetY],re.current.initialHits=r.map((function(e){return e.eventObject}))),"click"!==e&&"contextMenu"!==e&&"doubleClick"!==e||r.length||he(t)<=2&&(ie(t,X.__interaction),P&&P())}}),[P,he,pe,ve,le]);Object(b.useMemo)((function(){re.current.events={onClick:ge("click"),onContextMenu:ge("contextMenu"),onDoubleClick:ge("doubleClick"),onWheel:ge("wheel"),onPointerDown:ge("pointerDown"),onPointerUp:ge("pointerUp"),onPointerLeave:function(e){return de(e,[])},onPointerMove:me,onGotPointerCaptureLegacy:function(e){return re.current.captured=fe(e)},onLostPointerCapture:function(e){return re.current.captured=void 0,de(e)}}}),[ge,fe,de,me]);var ye=Object(b.useCallback)((function(e){var t=function(){return F(!0)};return Object(b.useEffect)((function(){var e=O&&O(re.current);e&&e.then?e.then(t):t()}),[]),e.children}),[]);return Object(b.useLayoutEffect)((function(){!function(e,t,n){var r=R.get(t);if(!r){t.__state=n;var i=r=J.createContainer(t,void 0!==n&&n.current.concurrent?2:0,!1,null);R.set(t,i)}J.updateContainer(e,r,null,(function(){})),J.getPublicRootInstance(r)}(Object(b.createElement)(ye,null,Object(b.createElement)(ne.Provider,{value:se.current},"function"===typeof t?t(re.current):t)),X,re)}),[N,t,se.current]),Object(b.useLayoutEffect)((function(){N&&(re.current.vr?(n.xr||n.vr)&&n.setAnimationLoop?((n.xr||n.vr).enabled=!0,n.setAnimationLoop((function(e){return U(re,e,0,!0)}))):console.warn("the gl instance does not support VR!"):0===re.current.frames&&z(re))}),[n,N,E]),Object(b.useEffect)((function(){return function(){re.current.gl&&(re.current.gl.renderLists&&re.current.gl.renderLists.dispose(),re.current.gl.forceContextLoss&&re.current.gl.forceContextLoss(),oe(re.current.gl)),function(e,t){var n=R.get(e);n&&J.updateContainer(null,n,null,(function(){R.delete(e),t&&t(e)}))}(re.current.scene,(function(){oe(re.current.raycaster),oe(re.current.camera),oe(re.current)}))}}),[]),re.current.events};function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return!0};t.filter(n).forEach((function(t){var n,r;return null==(n=(r=t.__handlers).pointerMissed)?void 0:n.call(r,e)}))}function oe(e){for(var t in e.dispose&&"Scene"!==e.type&&e.dispose(),e)"object"===typeof t&&t.dispose&&t.dispose(),delete e[t]}function ae(e){var t=Object(b.useContext)(e);if(!("subscribe"in t))throw new Error("\u26a1\ufe0f react-three-fiber hooks can only be used within the Canvas component! https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#hooks");return t}function se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=ae(ne),r=n.subscribe,i=Object(b.useRef)(e);return Object(b.useLayoutEffect)((function(){i.current=e}),[e]),Object(b.useEffect)((function(){var e=r(i,t);return function(){return e()}}),[t,r]),null}function ue(){return ae(ne)}function ce(e,t,n){var r=ae(ne).invalidate,i=Object(b.useRef)(),o=n||i;return Object(b.useLayoutEffect)((function(){o.current&&(e(o.current),r())}),t),o}function le(e){var t={nodes:{},materials:{}};return e&&e.traverse((function(e){e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material)})),t}function fe(e,t){return function(n,r){var i=new n;e&&e(i);var o=Array.isArray(r)?r:[r];return Promise.all(o.map((function(e){return new Promise((function(n,r){return i.load(e,(function(e){e.scene&&Object.assign(e,le(e.scene)),n(e)}),t,(function(e){return r(e.message)}))}))})))}}function he(e,t,n,r){var i=A(fe(n,r),[e,t]);return Array.isArray(t)?i:i[0]}he.preload=function(e,t,n){return A.preload(fe(n),e,t)};var de={position:"relative",width:"100%",height:"100%",overflow:"hidden"};function pe(e){var t=e.children,n=e.setEvents,r=e.container,i=e.renderer,a=e.effects,s=Object(o.a)(e,["children","setEvents","container","renderer","effects"]),u=Object(b.useState)(i),c=Object(h.a)(u,1)[0];c||console.warn("No renderer created!"),Object(b.useEffect)((function(){a&&a(c,r)}),[r,a,c]);var l=re(Object(d.a)(Object(d.a)({},s),{},{children:t,gl:c}));return Object(b.useEffect)((function(){n(l)}),[l,n]),null}var ve=w.a.memo((function(e){e.renderer,e.effects,e.children,e.vr,e.webgl1,e.concurrent,e.shadowMap,e.colorManagement,e.orthographic,e.invalidateFrameloop,e.updateDefaultCamera,e.noEvents,e.gl,e.camera,e.raycaster,e.pixelRatio,e.onCreated,e.onPointerMissed;var t=e.preRender,n=e.resize,r=e.style,i=Object(o.a)(e,["renderer","effects","children","vr","webgl1","concurrent","shadowMap","colorManagement","orthographic","invalidateFrameloop","updateDefaultCamera","noEvents","gl","camera","raycaster","pixelRatio","onCreated","onPointerMissed","preRender","resize","style"]),a=Object(b.useRef)(),s=Object(b.useState)({}),u=Object(h.a)(s,2),c=u[0],l=(c.onGotPointerCaptureLegacy,Object(o.a)(c,["onGotPointerCaptureLegacy"])),f=u[1],v=Object(k.a)(Object(d.a)({scroll:!0,debounce:{scroll:50,resize:0}},n)),m=Object(h.a)(v,3),g=m[0],y=m[1],_=m[2],x=Object(b.useRef)(!1),M=Object(b.useMemo)((function(){return x.current=x.current||!!y.width&&!!y.height}),[y]),S=Object(b.useMemo)((function(){return{size:y,forceResize:_,setEvents:f,container:a.current}}),[_,y]);return"undefined"===typeof window?w.a.createElement("div",Object(p.a)({style:Object(d.a)(Object(d.a)({},de),r)},i),t):w.a.createElement("div",Object(p.a)({ref:Object(C.a)([g,a]),style:Object(d.a)(Object(d.a)({},de),r)},l,i),t,M&&w.a.createElement(pe,Object(p.a)({},e,S)))})),me=w.a.memo((function(e){var t=e.children,n=Object(o.a)(e,["children"]),r=Object(b.useRef)(),i=n.webgl1?v.WebGL1Renderer:v.WebGLRenderer;return w.a.createElement(ve,Object(p.a)({},n,{renderer:function(){if(r.current){var e=Object(d.a)({antialias:!0,alpha:!0},n.gl);return new i(Object(d.a)({powerPreference:"high-performance",canvas:r.current},e))}},preRender:w.a.createElement("canvas",{ref:r,style:{display:"block"}})}),t)}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(168)},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=Symbol.for("FluidValue:config");function i(e){var t=o(e);return t?t.get():e}function o(e){if(e)return e[r]}var a=function(){var e,t;e=this,t=this,Object.defineProperty(e,r,{value:t,configurable:!0})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return A})),n.d(t,"b",(function(){return T})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return M})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return b})),n.d(t,"g",(function(){return _})),n.d(t,"h",(function(){return w}));var r=n(22),i=n(19),o=n(15),a=n(7),s=n(8),u=n(4),c=n(10),l=n(3),f=n(42),h=n(17),d=n(45),p=n(5),v=n(13),m=n(1),g=n(40),y=Symbol.for("Animated:node"),b=function(e){return e&&e[y]},w=function(e,t){return Object(l.a)(e,y,t)},_=function(e){return e&&e[y]&&e[y].getPayload()},x=function(){function e(){Object(u.a)(this,e),this.payload=void 0,w(this,this)}return Object(c.a)(e,[{key:"getPayload",value:function(){return this.payload||[]}}]),e}(),M=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(u.a)(this,n),(r=t.call(this))._value=e,r.done=!0,r.elapsedTime=void 0,r.lastPosition=void 0,r.lastVelocity=void 0,r.v0=void 0,l.d.num(r._value)&&(r.lastPosition=r._value),r}return Object(c.a)(n,[{key:"getPayload",value:function(){return[this]}},{key:"getValue",value:function(){return this._value}},{key:"setValue",value:function(e,t){return l.d.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}},{key:"reset",value:function(){var e=this.done;this.done=!1,l.d.num(this._value)&&(this.elapsedTime=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}],[{key:"create",value:function(e,t){return new n(e)}}]),n}(x),S=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r){var i;return Object(u.a)(this,n),(i=t.call(this,0))._value=void 0,i._string=null,i._toString=void 0,i._toString=Object(f.a)({output:[e,r]}),i}return Object(c.a)(n,[{key:"getValue",value:function(){var e=this._string;return null==e?this._string=this._toString(this._value):e}},{key:"setValue",value:function(e){if(l.d.num(e)){if(!Object(i.a)(Object(o.a)(n.prototype),"setValue",this).call(this,e))return!1;this._string=null}else this._string=e,this._value=1;return!0}},{key:"reset",value:function(e){e&&(this._toString=Object(f.a)({output:[this.getValue(),e]})),this._value=0,Object(i.a)(Object(o.a)(n.prototype),"reset",this).call(this)}}],[{key:"create",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(l.d.str(e)&&l.d.str(t))return new n(e,t);throw TypeError('Expected "from" and "to" to be strings')}}]),n}(M),E={current:null},T=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Object(u.a)(this,n),(e=t.call(this)).source=void 0,e.setValue(r),e}return Object(c.a)(n,[{key:"getValue",value:function(e){if(!this.source)return null;var t={};return Object(l.b)(this.source,(function(n,r){if((o=n)&&o[y]===o)t[r]=n.getValue(e);else{var i=Object(h.b)(n);i?t[r]=i.get():e||(t[r]=n)}var o})),t}},{key:"setValue",value:function(e){this.source=e,this.payload=this._makePayload(e)}},{key:"reset",value:function(){this.payload&&Object(l.b)(this.payload,(function(e){return e.reset()}))}},{key:"_makePayload",value:function(e){if(e){var t=new Set;return Object(l.b)(e,this._addToPayload,t),Array.from(t)}}},{key:"_addToPayload",value:function(e){var t=this;Object(h.b)(e)&&E.current&&E.current.dependencies.add(e);var n=_(e);n&&Object(l.b)(n,(function(e){return t.add(e)}))}}]),n}(x),A=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,a){var s,c;return Object(u.a)(this,n),(c=t.call(this,null)).source=void 0,Object(i.a)((s=Object(r.a)(c),Object(o.a)(n.prototype)),"setValue",s).call(s,c._makeAnimated(e,a)),c}return Object(c.a)(n,[{key:"getValue",value:function(){return this.source.map((function(e){return e.getValue()}))}},{key:"setValue",value:function(e){var t=this.getPayload();e&&e.length==t.length?Object(l.b)(t,(function(t,n){return t.setValue(e[n])})):(this.source=this._makeAnimated(e),this.payload=this._makePayload(this.source))}},{key:"_makeAnimated",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return e?e.map((function(e,n){return(Object(l.e)(e)?S:M).create(e,t[n])})):[]}}],[{key:"create",value:function(e,t){return new n(e,t)}}]),n}(T),k=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(u.a)(this,n),(r=t.call(this,null)).update=e,r.dirty=!1,r}return Object(c.a)(n,[{key:"setValue",value:function(e,t){if(e){if(t&&(E.current=t,e.style)){var r=t.host.createAnimatedStyle;e=Object(p.a)(Object(p.a)({},e),{},{style:r(e.style)})}Object(i.a)(Object(o.a)(n.prototype),"setValue",this).call(this,e),E.current=null}}},{key:"onParentChange",value:function(e){var t=this,n=e.type;this.dirty||"change"!==n||(this.dirty=!0,v.frameLoop.onFrame((function(){t.dirty=!1,t.update()})))}}]),n}(T),C=function(e,t){return Object(m.forwardRef)((function(n,r){var i=Object(m.useRef)(null),o=!l.d.fun(e)||e.prototype&&e.prototype.isReactComponent,a=Object(d.a)(),s=new k((function(){var e=i.current;o&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&a()})),u=new Set;return s.setValue(n,{dependencies:u,host:t}),Object(g.a)((function(){return Object(l.b)(u,(function(e){return e.addChild(s)})),function(){return Object(l.b)(u,(function(e){return e.removeChild(s)}))}})),Object(m.createElement)(e,Object(p.a)({},t.getComponentProps(s.getValue()),{ref:o&&function(e){i.current=function(e,t){e&&(l.d.fun(e)?e(t):e.current=t);return t}(r,e)}}))}))};var R=Symbol.for("AnimatedComponent"),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.applyAnimatedValues,r=void 0===n?function(){return!1}:n,i=t.createAnimatedStyle,o=void 0===i?function(e){return new T(e)}:i,a=t.getComponentProps,s=void 0===a?function(e){return e}:a,u={applyAnimatedValues:r,createAnimatedStyle:o,getComponentProps:s},c=function(e){var t=P(e)||"Anonymous";return(e=l.d.str(e)?C(e,u):e[R]||(e[R]=C(e,u))).displayName="Animated("+t+")",e};return Object(l.b)(e,(function(e,t){l.d.str(t)||(t=P(e)),c[t]=c(e)})),{animated:c}},P=function(e){return l.d.str(e)?e:e&&l.d.str(e.displayName)?e.displayName:l.d.fun(e)&&e.name||null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(15);function i(e,t,n){return(i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(59);var i=n(74),o=n(41);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return E})),n.d(t,"d",(function(){return p})),n.d(t,"e",(function(){return y})),n.d(t,"f",(function(){return A}));var r=n(27),i=n(1),o=n.n(i),a=(n(48),n(33)),s=n(95),u=n(28),c=n(5),l=n(96),f=n.n(l),h=(n(99),n(14)),d=(n(144),function(e){var t=Object(s.a)();return t.displayName=e,t}("Router-History")),p=function(e){var t=Object(s.a)();return t.displayName=e,t}("Router"),v=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(r.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return o.a.createElement(p.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},o.a.createElement(d.Provider,{children:this.props.children||null,value:this.props.history}))},t}(o.a.Component);o.a.Component;o.a.Component;var m={},g=0;function y(e,t){void 0===t&&(t={}),("string"===typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,u=n.sensitive,c=void 0!==u&&u;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=m[n]||(m[n]={});if(r[e])return r[e];var i=[],o={regexp:f()(e,i,t),keys:i};return g<1e4&&(r[e]=o,g++),o}(n,{end:o,strict:s,sensitive:c}),i=r.regexp,a=r.keys,u=i.exec(e);if(!u)return null;var l=u[0],h=u.slice(1),d=e===l;return o&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:a.reduce((function(e,t,n){return e[t.name]=h[n],e}),{})}}),null)}var b=function(e){function t(){return e.apply(this,arguments)||this}return Object(r.a)(t,e),t.prototype.render=function(){var e=this;return o.a.createElement(p.Consumer,null,(function(t){t||Object(u.a)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?y(n.pathname,e.props):t.match,i=Object(c.a)({},t,{location:n,match:r}),a=e.props,s=a.children,l=a.component,f=a.render;return Array.isArray(s)&&0===s.length&&(s=null),o.a.createElement(p.Provider,{value:i},i.match?s?"function"===typeof s?s(i):s:l?o.a.createElement(l,i):f?f(i):null:"function"===typeof s?s(i):null)}))},t}(o.a.Component);function w(e){return"/"===e.charAt(0)?e:"/"+e}function _(e,t){if(!e)return t;var n=w(e);return 0!==t.pathname.indexOf(n)?t:Object(c.a)({},t,{pathname:t.pathname.substr(n.length)})}function x(e){return"string"===typeof e?e:Object(a.e)(e)}function M(e){return function(){Object(u.a)(!1)}}function S(){}o.a.Component;var E=function(e){function t(){return e.apply(this,arguments)||this}return Object(r.a)(t,e),t.prototype.render=function(){var e=this;return o.a.createElement(p.Consumer,null,(function(t){t||Object(u.a)(!1);var n,r,i=e.props.location||t.location;return o.a.Children.forEach(e.props.children,(function(e){if(null==r&&o.a.isValidElement(e)){n=e;var a=e.props.path||e.props.from;r=a?y(i.pathname,Object(c.a)({},e.props,{path:a})):t.match}})),r?o.a.cloneElement(n,{location:i,computedMatch:r}):null}))},t}(o.a.Component);var T=o.a.useContext;function A(){return T(d)}},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(173),i=n(175),o=!1,a=null;if(i({},(function(e,t){if(!o){if(o=!0,e)throw e;a=t}})),!o)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");e.exports=r(a.bind,a.lib)},function(e,t,n){"use strict";var r=n(126),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return"undefined"===typeof e}function s(e){return null!==e&&"object"===typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",(function(){return r}))},function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include \n\t\t\t#include \n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t"};var y=function(e){v.ShaderMaterial.call(this,{type:"LineMaterial",uniforms:v.UniformsUtils.clone(v.ShaderLib.line.uniforms),vertexShader:v.ShaderLib.line.vertexShader,fragmentShader:v.ShaderLib.line.fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}}),this.setValues(e)};(y.prototype=Object.create(v.ShaderMaterial.prototype)).constructor=y,y.prototype.isLineMaterial=!0;var b=function(e,t){void 0===e&&(e=new m),void 0===t&&(t=new y({color:16777215*Math.random()})),v.Mesh.call(this,e,t),this.type="LineSegments2"};b.prototype=Object.assign(Object.create(v.Mesh.prototype),{constructor:b,isLineSegments2:!0,computeLineDistances:function(){var e=new v.Vector3,t=new v.Vector3;return function(){for(var n=this.geometry,r=n.attributes.instanceStart,i=n.attributes.instanceEnd,o=new Float32Array(2*r.data.count),a=0,s=0,u=r.data.count;a1&&t.z>1;if(!M&&!S){e.x*=m.x/2,e.y*=m.y/2,t.x*=m.x/2,t.y*=m.y/2,o.start.copy(e),o.start.z=0,o.end.copy(t),o.end.z=0;var E=o.closestPointToPointParameter(r,!0);o.at(E,a);var T=v.MathUtils.lerp(e.z,t.z,E),A=T>=-1&&T<=1,k=r.distanceTo(a)<.5*g;if(A&&k){o.start.fromBufferAttribute(y,_),o.end.fromBufferAttribute(b,_),o.start.applyMatrix4(w),o.end.applyMatrix4(w);var C=new v.Vector3,R=new v.Vector3;l.distanceSqToSegment(o.start,o.end,R,C),u.push({point:R,pointOnLine:C,distance:l.origin.distanceTo(R),object:this,face:null,faceIndex:_,uv:null,uv2:null})}}}}}()});var w=function(e,t){void 0===e&&(e=new g),void 0===t&&(t=new y({color:16777215*Math.random()})),b.call(this,e,t),this.type="Line2"};w.prototype=Object.assign(Object.create(b.prototype),{constructor:w,isLine2:!0});n(138);var _=function(e){var t=this,n={type:"change"};this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r=function(e){t.deviceOrientation=e},i=function(){t.screenOrientation=window.orientation||0},o=function(){var e=new v.Vector3(0,0,1),t=new v.Euler,n=new v.Quaternion,r=new v.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return function(i,o,a,s,u){t.set(a,o,-s,"YXZ"),i.setFromEuler(t),i.multiply(r),i.multiply(n.setFromAxisAngle(e,-u))}}();this.connect=function(){i(),void 0!==window.DeviceOrientationEvent&&"function"===typeof window.DeviceOrientationEvent.requestPermission?window.DeviceOrientationEvent.requestPermission().then((function(e){"granted"==e&&(window.addEventListener("orientationchange",i,!1),window.addEventListener("deviceorientation",r,!1))})).catch((function(e){console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",e)})):(window.addEventListener("orientationchange",i,!1),window.addEventListener("deviceorientation",r,!1)),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",i,!1),window.removeEventListener("deviceorientation",r,!1),t.enabled=!1},this.update=function(){var e=new v.Quaternion;return function(){if(!1!==t.enabled){var r=t.deviceOrientation;if(r){var i=r.alpha?v.MathUtils.degToRad(r.alpha)+t.alphaOffset:0,a=r.beta?v.MathUtils.degToRad(r.beta):0,s=r.gamma?v.MathUtils.degToRad(r.gamma):0,u=t.screenOrientation?v.MathUtils.degToRad(t.screenOrientation):0;o(t.object.quaternion,i,a,s,u),8*(1-e.dot(t.object.quaternion))>1e-6&&(e.copy(t.object.quaternion),t.dispatchEvent(n))}}}}(),this.dispose=function(){t.disconnect()},this.connect()};(_.prototype=Object.create(v.EventDispatcher.prototype)).constructor=_;var x=function(e,t){void 0===t&&(console.warn('THREE.FlyControls: The second parameter "domElement" is now mandatory.'),t=document),this.object=e,this.domElement=t,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1;var n=this,r={type:"change"},i=1e-6;function o(e,t){return function(){t.apply(e,arguments)}}function a(e){e.preventDefault()}this.tmpQuaternion=new v.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new v.Vector3(0,0,0),this.rotationVector=new v.Vector3(0,0,0),this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),n=t.size[0]/2,r=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-n)/n,this.moveState.pitchDown=(e.pageY-t.offset[1]-r)/r,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(){var e=new v.Quaternion,t=new v.Vector3;return function(o){var a=o*n.movementSpeed,s=o*n.rollSpeed;n.object.translateX(n.moveVector.x*a),n.object.translateY(n.moveVector.y*a),n.object.translateZ(n.moveVector.z*a),n.tmpQuaternion.set(n.rotationVector.x*s,n.rotationVector.y*s,n.rotationVector.z*s,1).normalize(),n.object.quaternion.multiply(n.tmpQuaternion),(t.distanceToSquared(n.object.position)>i||8*(1-e.dot(n.object.quaternion))>i)&&(n.dispatchEvent(r),e.copy(n.object.quaternion),t.copy(n.object.position))}}(),this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",a,!1),this.domElement.removeEventListener("mousedown",u,!1),this.domElement.removeEventListener("mousemove",s,!1),this.domElement.removeEventListener("mouseup",c,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",f,!1)};var s=o(this,this.mousemove),u=o(this,this.mousedown),c=o(this,this.mouseup),l=o(this,this.keydown),f=o(this,this.keyup);this.domElement.addEventListener("contextmenu",a,!1),this.domElement.addEventListener("mousemove",s,!1),this.domElement.addEventListener("mousedown",u,!1),this.domElement.addEventListener("mouseup",c,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",f,!1),this.updateMovementVector(),this.updateRotationVector()};(x.prototype=Object.create(v.EventDispatcher.prototype)).constructor=x;var M=function(e,t){void 0===t&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.target=new v.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:v.MOUSE.ROTATE,MIDDLE:v.MOUSE.DOLLY,RIGHT:v.MOUSE.PAN},this.touches={ONE:v.TOUCH.ROTATE,TWO:v.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return c.phi},this.getAzimuthalAngle=function(){return c.theta},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),s=a.NONE},this.update=function(){var t=new v.Vector3,i=(new v.Quaternion).setFromUnitVectors(e.up,new v.Vector3(0,1,0)),o=i.clone().inverse(),p=new v.Vector3,m=new v.Quaternion,g=2*Math.PI;return function(){var e=n.object.position;t.copy(e).sub(n.target),t.applyQuaternion(i),c.setFromVector3(t),n.autoRotate&&s===a.NONE&&E(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(c.theta+=l.theta*n.dampingFactor,c.phi+=l.phi*n.dampingFactor):(c.theta+=l.theta,c.phi+=l.phi);var v=n.minAzimuthAngle,y=n.maxAzimuthAngle;return isFinite(v)&&isFinite(y)&&(v<-Math.PI?v+=g:v>Math.PI&&(v-=g),y<-Math.PI?y+=g:y>Math.PI&&(y-=g),c.theta=v(v+y)/2?Math.max(v,c.theta):Math.min(y,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.makeSafe(),c.radius*=f,c.radius=Math.max(n.minDistance,Math.min(n.maxDistance,c.radius)),!0===n.enableDamping?n.target.addScaledVector(h,n.dampingFactor):n.target.add(h),t.setFromSpherical(c),t.applyQuaternion(o),e.copy(n.target).add(t),n.object.lookAt(n.target),!0===n.enableDamping?(l.theta*=1-n.dampingFactor,l.phi*=1-n.dampingFactor,h.multiplyScalar(1-n.dampingFactor)):(l.set(0,0,0),h.set(0,0,0)),f=1,!!(d||p.distanceToSquared(n.object.position)>u||8*(1-m.dot(n.object.quaternion))>u)&&(n.dispatchEvent(r),p.copy(n.object.position),m.copy(n.object.quaternion),d=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",Y,!1),n.domElement.removeEventListener("pointerdown",B,!1),n.domElement.removeEventListener("wheel",V,!1),n.domElement.removeEventListener("touchstart",W,!1),n.domElement.removeEventListener("touchend",q,!1),n.domElement.removeEventListener("touchmove",X,!1),n.domElement.ownerDocument.removeEventListener("pointermove",G,!1),n.domElement.ownerDocument.removeEventListener("pointerup",z,!1),n.domElement.removeEventListener("keydown",H,!1)};var n=this,r={type:"change"},i={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},s=a.NONE,u=1e-6,c=new v.Spherical,l=new v.Spherical,f=1,h=new v.Vector3,d=!1,p=new v.Vector2,m=new v.Vector2,g=new v.Vector2,y=new v.Vector2,b=new v.Vector2,w=new v.Vector2,_=new v.Vector2,x=new v.Vector2,M=new v.Vector2;function S(){return Math.pow(.95,n.zoomSpeed)}function E(e){l.theta-=e}function T(e){l.phi-=e}var A=function(){var e=new v.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),h.add(e)}}(),k=function(){var e=new v.Vector3;return function(t,r){!0===n.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),h.add(e)}}(),C=function(){var e=new v.Vector3;return function(t,r){var i=n.domElement;if(n.object.isPerspectiveCamera){var o=n.object.position;e.copy(o).sub(n.target);var a=e.length();a*=Math.tan(n.object.fov/2*Math.PI/180),A(2*t*a/i.clientHeight,n.object.matrix),k(2*r*a/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(A(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),k(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function R(e){n.object.isPerspectiveCamera?f/=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*e)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function O(e){n.object.isPerspectiveCamera?f*=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/e)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function P(e){p.set(e.clientX,e.clientY)}function I(e){y.set(e.clientX,e.clientY)}function L(e){if(1==e.touches.length)p.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);p.set(t,n)}}function D(e){if(1==e.touches.length)y.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);y.set(t,n)}}function N(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);_.set(0,r)}function F(e){if(1==e.touches.length)m.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);m.set(t,r)}g.subVectors(m,p).multiplyScalar(n.rotateSpeed);var i=n.domElement;E(2*Math.PI*g.x/i.clientHeight),T(2*Math.PI*g.y/i.clientHeight),p.copy(m)}function j(e){if(1==e.touches.length)b.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);b.set(t,r)}w.subVectors(b,y).multiplyScalar(n.panSpeed),C(w.x,w.y),y.copy(b)}function U(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+r*r);x.set(0,i),M.set(0,Math.pow(x.y/_.y,n.zoomSpeed)),R(M.y),_.copy(x)}function B(e){if(!1!==n.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){var t;switch(e.preventDefault(),n.domElement.focus?n.domElement.focus():window.focus(),e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case v.MOUSE.DOLLY:if(!1===n.enableZoom)return;!function(e){_.set(e.clientX,e.clientY)}(e),s=a.DOLLY;break;case v.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;I(e),s=a.PAN}else{if(!1===n.enableRotate)return;P(e),s=a.ROTATE}break;case v.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;P(e),s=a.ROTATE}else{if(!1===n.enablePan)return;I(e),s=a.PAN}break;default:s=a.NONE}s!==a.NONE&&(n.domElement.ownerDocument.addEventListener("pointermove",G,!1),n.domElement.ownerDocument.addEventListener("pointerup",z,!1),n.dispatchEvent(i))}(e)}}function G(e){if(!1!==n.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){if(!1===n.enabled)return;switch(e.preventDefault(),s){case a.ROTATE:if(!1===n.enableRotate)return;!function(e){m.set(e.clientX,e.clientY),g.subVectors(m,p).multiplyScalar(n.rotateSpeed);var t=n.domElement;E(2*Math.PI*g.x/t.clientHeight),T(2*Math.PI*g.y/t.clientHeight),p.copy(m),n.update()}(e);break;case a.DOLLY:if(!1===n.enableZoom)return;!function(e){x.set(e.clientX,e.clientY),M.subVectors(x,_),M.y>0?R(S()):M.y<0&&O(S()),_.copy(x),n.update()}(e);break;case a.PAN:if(!1===n.enablePan)return;!function(e){b.set(e.clientX,e.clientY),w.subVectors(b,y).multiplyScalar(n.panSpeed),C(w.x,w.y),y.copy(b),n.update()}(e)}}(e)}}function z(e){if(!1!==n.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){if(!1===n.enabled)return;n.domElement.ownerDocument.removeEventListener("pointermove",G,!1),n.domElement.ownerDocument.removeEventListener("pointerup",z,!1),n.dispatchEvent(o),s=a.NONE}()}}function V(e){!1===n.enabled||!1===n.enableZoom||s!==a.NONE&&s!==a.ROTATE||(e.preventDefault(),e.stopPropagation(),n.dispatchEvent(i),function(e){e.deltaY<0?O(S()):e.deltaY>0&&R(S()),n.update()}(e),n.dispatchEvent(o))}function H(e){!1!==n.enabled&&!1!==n.enableKeys&&!1!==n.enablePan&&function(e){var t=!1;switch(e.keyCode){case n.keys.UP:C(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:C(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:C(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:C(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}(e)}function W(e){if(!1!==n.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(n.touches.ONE){case v.TOUCH.ROTATE:if(!1===n.enableRotate)return;L(e),s=a.TOUCH_ROTATE;break;case v.TOUCH.PAN:if(!1===n.enablePan)return;D(e),s=a.TOUCH_PAN;break;default:s=a.NONE}break;case 2:switch(n.touches.TWO){case v.TOUCH.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&N(e),n.enablePan&&D(e)}(e),s=a.TOUCH_DOLLY_PAN;break;case v.TOUCH.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&N(e),n.enableRotate&&L(e)}(e),s=a.TOUCH_DOLLY_ROTATE;break;default:s=a.NONE}break;default:s=a.NONE}s!==a.NONE&&n.dispatchEvent(i)}}function X(e){if(!1!==n.enabled)switch(e.preventDefault(),e.stopPropagation(),s){case a.TOUCH_ROTATE:if(!1===n.enableRotate)return;F(e),n.update();break;case a.TOUCH_PAN:if(!1===n.enablePan)return;j(e),n.update();break;case a.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&U(e),n.enablePan&&j(e)}(e),n.update();break;case a.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&U(e),n.enableRotate&&F(e)}(e),n.update();break;default:s=a.NONE}}function q(e){!1!==n.enabled&&(n.dispatchEvent(o),s=a.NONE)}function Y(e){!1!==n.enabled&&e.preventDefault()}n.domElement.addEventListener("contextmenu",Y,!1),n.domElement.addEventListener("pointerdown",B,!1),n.domElement.addEventListener("wheel",V,!1),n.domElement.addEventListener("touchstart",W,!1),n.domElement.addEventListener("touchend",q,!1),n.domElement.addEventListener("touchmove",X,!1),n.domElement.addEventListener("keydown",H,!1),-1===n.domElement.tabIndex&&(n.domElement.tabIndex=0),this.update()};(M.prototype=Object.create(v.EventDispatcher.prototype)).constructor=M;var S=function(e,t){M.call(this,e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=v.MOUSE.PAN,this.mouseButtons.RIGHT=v.MOUSE.ROTATE,this.touches.ONE=v.TOUCH.PAN,this.touches.TWO=v.TOUCH.DOLLY_ROTATE};(S.prototype=Object.create(v.EventDispatcher.prototype)).constructor=S;var E=function(e,t){void 0===t&&console.warn('THREE.TrackballControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.TrackballControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.');var n=this,r=-1,i=0,o=1,a=2,s=3,u=4;this.object=e,this.domElement=t,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.mouseButtons={LEFT:v.MOUSE.ROTATE,MIDDLE:v.MOUSE.ZOOM,RIGHT:v.MOUSE.PAN},this.target=new v.Vector3;var c=1e-6,l=new v.Vector3,f=1,h=r,d=r,p=new v.Vector3,m=new v.Vector2,g=new v.Vector2,y=new v.Vector3,b=0,w=new v.Vector2,_=new v.Vector2,x=0,M=0,S=new v.Vector2,E=new v.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom;var T={type:"change"},A={type:"start"},k={type:"end"};this.handleResize=function(){var e=n.domElement.getBoundingClientRect(),t=n.domElement.ownerDocument.documentElement;n.screen.left=e.left+window.pageXOffset-t.clientLeft,n.screen.top=e.top+window.pageYOffset-t.clientTop,n.screen.width=e.width,n.screen.height=e.height};var C=function(){var e=new v.Vector2;return function(t,r){return e.set((t-n.screen.left)/n.screen.width,(r-n.screen.top)/n.screen.height),e}}(),R=function(){var e=new v.Vector2;return function(t,r){return e.set((t-.5*n.screen.width-n.screen.left)/(.5*n.screen.width),(n.screen.height+2*(n.screen.top-r))/n.screen.width),e}}();function O(e){if(!1!==n.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){if(e.preventDefault(),e.stopPropagation(),h===r)switch(e.button){case n.mouseButtons.LEFT:h=i;break;case n.mouseButtons.MIDDLE:h=o;break;case n.mouseButtons.RIGHT:h=a;break;default:h=r}var t=d!==r?d:h;t!==i||n.noRotate?t!==o||n.noZoom?t!==a||n.noPan||(S.copy(C(e.pageX,e.pageY)),E.copy(S)):(w.copy(C(e.pageX,e.pageY)),_.copy(w)):(g.copy(R(e.pageX,e.pageY)),m.copy(g));n.domElement.ownerDocument.addEventListener("pointermove",P,!1),n.domElement.ownerDocument.addEventListener("pointerup",I,!1),n.dispatchEvent(A)}(e)}}function P(e){if(!1!==n.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){if(!1===n.enabled)return;e.preventDefault(),e.stopPropagation();var t=d!==r?d:h;t!==i||n.noRotate?t!==o||n.noZoom?t!==a||n.noPan||E.copy(C(e.pageX,e.pageY)):_.copy(C(e.pageX,e.pageY)):(m.copy(g),g.copy(R(e.pageX,e.pageY)))}(e)}}function I(e){if(!1!==n.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){if(!1===n.enabled)return;e.preventDefault(),e.stopPropagation(),h=r,n.domElement.ownerDocument.removeEventListener("pointermove",P),n.domElement.ownerDocument.removeEventListener("pointerup",I),n.dispatchEvent(k)}(e)}}function L(e){!1!==n.enabled&&(window.removeEventListener("keydown",L),d===r&&(e.keyCode!==n.keys[i]||n.noRotate?e.keyCode!==n.keys[o]||n.noZoom?e.keyCode!==n.keys[a]||n.noPan||(d=a):d=o:d=i))}function D(){!1!==n.enabled&&(d=r,window.addEventListener("keydown",L,!1))}function N(e){if(!1!==n.enabled&&!0!==n.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:w.y-=.025*e.deltaY;break;case 1:w.y-=.01*e.deltaY;break;default:w.y-=25e-5*e.deltaY}n.dispatchEvent(A),n.dispatchEvent(k)}}function F(e){if(!1!==n.enabled){switch(e.preventDefault(),e.touches.length){case 1:h=s,g.copy(R(e.touches[0].pageX,e.touches[0].pageY)),m.copy(g);break;default:h=u;var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY;M=x=Math.sqrt(t*t+r*r);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,o=(e.touches[0].pageY+e.touches[1].pageY)/2;S.copy(C(i,o)),E.copy(S)}n.dispatchEvent(A)}}function j(e){if(!1!==n.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:m.copy(g),g.copy(R(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY;M=Math.sqrt(t*t+r*r);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,o=(e.touches[0].pageY+e.touches[1].pageY)/2;E.copy(C(i,o))}}function U(e){if(!1!==n.enabled){switch(e.touches.length){case 0:h=r;break;case 1:h=s,g.copy(R(e.touches[0].pageX,e.touches[0].pageY)),m.copy(g)}n.dispatchEvent(k)}}function B(e){!1!==n.enabled&&e.preventDefault()}this.rotateCamera=function(){var e,t=new v.Vector3,r=new v.Quaternion,i=new v.Vector3,o=new v.Vector3,a=new v.Vector3,s=new v.Vector3;return function(){s.set(g.x-m.x,g.y-m.y,0),(e=s.length())?(p.copy(n.object.position).sub(n.target),i.copy(p).normalize(),o.copy(n.object.up).normalize(),a.crossVectors(o,i).normalize(),o.setLength(g.y-m.y),a.setLength(g.x-m.x),s.copy(o.add(a)),t.crossVectors(s,p).normalize(),e*=n.rotateSpeed,r.setFromAxisAngle(t,e),p.applyQuaternion(r),n.object.up.applyQuaternion(r),y.copy(t),b=e):!n.staticMoving&&b&&(b*=Math.sqrt(1-n.dynamicDampingFactor),p.copy(n.object.position).sub(n.target),r.setFromAxisAngle(y,b),p.applyQuaternion(r),n.object.up.applyQuaternion(r)),m.copy(g)}}(),this.zoomCamera=function(){var e;h===u?(e=x/M,x=M,n.object.isPerspectiveCamera?p.multiplyScalar(e):n.object.isOrthographicCamera?(n.object.zoom*=e,n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(1!==(e=1+(_.y-w.y)*n.zoomSpeed)&&e>0&&(n.object.isPerspectiveCamera?p.multiplyScalar(e):n.object.isOrthographicCamera?(n.object.zoom/=e,n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),n.staticMoving?w.copy(_):w.y+=(_.y-w.y)*this.dynamicDampingFactor)},this.panCamera=function(){var e=new v.Vector2,t=new v.Vector3,r=new v.Vector3;return function(){if(e.copy(E).sub(S),e.lengthSq()){if(n.object.isOrthographicCamera){var i=(n.object.right-n.object.left)/n.object.zoom/n.domElement.clientWidth,o=(n.object.top-n.object.bottom)/n.object.zoom/n.domElement.clientWidth;e.x*=i,e.y*=o}e.multiplyScalar(p.length()*n.panSpeed),r.copy(p).cross(n.object.up).setLength(e.x),r.add(t.copy(n.object.up).setLength(e.y)),n.object.position.add(r),n.target.add(r),n.staticMoving?S.copy(E):S.add(e.subVectors(E,S).multiplyScalar(n.dynamicDampingFactor))}}}(),this.checkDistances=function(){n.noZoom&&n.noPan||(p.lengthSq()>n.maxDistance*n.maxDistance&&(n.object.position.addVectors(n.target,p.setLength(n.maxDistance)),w.copy(_)),p.lengthSq()c&&(n.dispatchEvent(T),l.copy(n.object.position))):n.object.isOrthographicCamera?(n.object.lookAt(n.target),(l.distanceToSquared(n.object.position)>c||f!==n.object.zoom)&&(n.dispatchEvent(T),l.copy(n.object.position),f=n.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")},this.reset=function(){h=r,d=r,n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.up.copy(n.up0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),p.subVectors(n.object.position,n.target),n.object.lookAt(n.target),n.dispatchEvent(T),l.copy(n.object.position),f=n.object.zoom},this.dispose=function(){n.domElement.removeEventListener("contextmenu",B,!1),n.domElement.removeEventListener("pointerdown",O,!1),n.domElement.removeEventListener("wheel",N,!1),n.domElement.removeEventListener("touchstart",F,!1),n.domElement.removeEventListener("touchend",U,!1),n.domElement.removeEventListener("touchmove",j,!1),n.domElement.ownerDocument.removeEventListener("pointermove",P,!1),n.domElement.ownerDocument.removeEventListener("pointerup",I,!1),window.removeEventListener("keydown",L,!1),window.removeEventListener("keyup",D,!1)},this.domElement.addEventListener("contextmenu",B,!1),this.domElement.addEventListener("pointerdown",O,!1),this.domElement.addEventListener("wheel",N,!1),this.domElement.addEventListener("touchstart",F,!1),this.domElement.addEventListener("touchend",U,!1),this.domElement.addEventListener("touchmove",j,!1),this.domElement.ownerDocument.addEventListener("pointermove",P,!1),this.domElement.ownerDocument.addEventListener("pointerup",I,!1),window.addEventListener("keydown",L,!1),window.addEventListener("keyup",D,!1),this.handleResize(),this.update()};(E.prototype=Object.create(v.EventDispatcher.prototype)).constructor=E;var T=function(e,t){void 0===t&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),v.Object3D.call(this),this.visible=!1,this.domElement=t;var n=new A;this.add(n);var r=new k;this.add(r);var i=this;V("camera",e),V("object",void 0),V("enabled",!0),V("axis",null),V("mode","translate"),V("translationSnap",null),V("rotationSnap",null),V("scaleSnap",null),V("space","world"),V("size",1),V("dragging",!1),V("showX",!0),V("showY",!0),V("showZ",!0);var o={type:"change"},a={type:"mouseDown"},s={type:"mouseUp",mode:i.mode},u={type:"objectChange"},c=new v.Raycaster;function l(e,t,n){for(var r=t.intersectObject(e,!0),i=0;ia&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),"Y"!==o.name&&"XYZY"!==o.name||Math.abs(N.copy(V).applyQuaternion(t).dot(this.eye))>a&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),"Z"!==o.name&&"XYZZ"!==o.name||Math.abs(N.copy(H).applyQuaternion(t).dot(this.eye))>a&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),"XY"===o.name&&Math.abs(N.copy(H).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),"YZ"===o.name&&Math.abs(N.copy(z).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),"XZ"===o.name&&Math.abs(N.copy(V).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),-1!==o.name.search("X")&&(N.copy(z).applyQuaternion(t).dot(this.eye)<0?"fwd"===o.tag?o.visible=!1:o.scale.x*=-1:"bwd"===o.tag&&(o.visible=!1)),-1!==o.name.search("Y")&&(N.copy(V).applyQuaternion(t).dot(this.eye)<0?"fwd"===o.tag?o.visible=!1:o.scale.y*=-1:"bwd"===o.tag&&(o.visible=!1)),-1!==o.name.search("Z")&&(N.copy(H).applyQuaternion(t).dot(this.eye)<0?"fwd"===o.tag?o.visible=!1:o.scale.z*=-1:"bwd"===o.tag&&(o.visible=!1))}else"rotate"===this.mode&&(B.copy(t),N.copy(this.eye).applyQuaternion(U.copy(t).inverse()),-1!==o.name.search("E")&&o.quaternion.setFromRotationMatrix(j.lookAt(this.eye,F,V)),"X"===o.name&&(U.setFromAxisAngle(z,Math.atan2(-N.y,N.z)),U.multiplyQuaternions(B,U),o.quaternion.copy(U)),"Y"===o.name&&(U.setFromAxisAngle(V,Math.atan2(N.x,N.z)),U.multiplyQuaternions(B,U),o.quaternion.copy(U)),"Z"===o.name&&(U.setFromAxisAngle(H,Math.atan2(N.y,N.x)),U.multiplyQuaternions(B,U),o.quaternion.copy(U)));o.visible=o.visible&&(-1===o.name.indexOf("X")||this.showX),o.visible=o.visible&&(-1===o.name.indexOf("Y")||this.showY),o.visible=o.visible&&(-1===o.name.indexOf("Z")||this.showZ),o.visible=o.visible&&(-1===o.name.indexOf("E")||this.showX&&this.showY&&this.showZ),o.material._opacity=o.material._opacity||o.material.opacity,o.material._color=o.material._color||o.material.color.clone(),o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled?this.axis&&(o.name===this.axis||this.axis.split("").some((function(e){return o.name===e}))?(o.material.opacity=1,o.material.color.lerp(new v.Color(1,1,1),.5)):(o.material.opacity*=.25,o.material.color.lerp(new v.Color(1,1,1),.5))):(o.material.opacity*=.5,o.material.color.lerp(new v.Color(1,1,1),.5))}else o.visible=!1,"AXIS"===o.name?(o.position.copy(this.worldPositionStart),o.visible=!!this.axis,"X"===this.axis&&(U.setFromEuler(D.set(0,0,0)),o.quaternion.copy(t).multiply(U),Math.abs(N.copy(z).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),"Y"===this.axis&&(U.setFromEuler(D.set(0,0,Math.PI/2)),o.quaternion.copy(t).multiply(U),Math.abs(N.copy(V).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),"Z"===this.axis&&(U.setFromEuler(D.set(0,Math.PI/2,0)),o.quaternion.copy(t).multiply(U),Math.abs(N.copy(H).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),"XYZE"===this.axis&&(U.setFromEuler(D.set(0,Math.PI/2,0)),N.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(j.lookAt(F,N,V)),o.quaternion.multiply(U),o.visible=this.dragging),"E"===this.axis&&(o.visible=!1)):"START"===o.name?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):"END"===o.name?(o.position.copy(this.worldPosition),o.visible=this.dragging):"DELTA"===o.name?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),L.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),L.applyQuaternion(this.worldQuaternionStart.clone().inverse()),o.scale.copy(L),o.visible=this.dragging):(o.quaternion.copy(t),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=-1!==this.axis.search(o.name)))}v.Object3D.prototype.updateMatrixWorld.call(this)}};A.prototype=Object.assign(Object.create(v.Object3D.prototype),{constructor:A,isTransformControlsGizmo:!0});var k=function(){v.Mesh.call(this,new v.PlaneBufferGeometry(1e5,1e5,2,2),new v.MeshBasicMaterial({visible:!1,wireframe:!0,side:v.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.type="TransformControlsPlane";var e=new v.Vector3(1,0,0),t=new v.Vector3(0,1,0),n=new v.Vector3(0,0,1),r=new v.Vector3,i=new v.Vector3,o=new v.Vector3,a=new v.Matrix4,s=new v.Quaternion;this.updateMatrixWorld=function(){var u=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(u="local"),e.set(1,0,0).applyQuaternion("local"===u?this.worldQuaternion:s),t.set(0,1,0).applyQuaternion("local"===u?this.worldQuaternion:s),n.set(0,0,1).applyQuaternion("local"===u?this.worldQuaternion:s),o.copy(t),this.mode){case"translate":case"scale":switch(this.axis){case"X":o.copy(this.eye).cross(e),i.copy(e).cross(o);break;case"Y":o.copy(this.eye).cross(t),i.copy(t).cross(o);break;case"Z":o.copy(this.eye).cross(n),i.copy(n).cross(o);break;case"XY":i.copy(n);break;case"YZ":i.copy(e);break;case"XZ":o.copy(n),i.copy(t);break;case"XYZ":case"E":i.set(0,0,0)}break;case"rotate":default:i.set(0,0,0)}0===i.length()?this.quaternion.copy(this.cameraQuaternion):(a.lookAt(r.set(0,0,0),i,o),this.quaternion.setFromRotationMatrix(a)),v.Object3D.prototype.updateMatrixWorld.call(this)}};k.prototype=Object.assign(Object.create(v.Mesh.prototype),{constructor:k,isTransformControlsPlane:!0});n(139),n(140);var C=function(e,t){void 0===t&&(console.warn('THREE.PointerLockControls: The second parameter "domElement" is now mandatory.'),t=document.body),this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI;var n=this,r={type:"change"},i={type:"lock"},o={type:"unlock"},a=new v.Euler(0,0,0,"YXZ"),s=Math.PI/2,u=new v.Vector3;function c(t){if(!1!==n.isLocked){var i=t.movementX||t.mozMovementX||t.webkitMovementX||0,o=t.movementY||t.mozMovementY||t.webkitMovementY||0;a.setFromQuaternion(e.quaternion),a.y-=.002*i,a.x-=.002*o,a.x=Math.max(s-n.maxPolarAngle,Math.min(s-n.minPolarAngle,a.x)),e.quaternion.setFromEuler(a),n.dispatchEvent(r)}}function l(){n.domElement.ownerDocument.pointerLockElement===n.domElement?(n.dispatchEvent(i),n.isLocked=!0):(n.dispatchEvent(o),n.isLocked=!1)}function f(){console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}this.connect=function(){n.domElement.ownerDocument.addEventListener("mousemove",c,!1),n.domElement.ownerDocument.addEventListener("pointerlockchange",l,!1),n.domElement.ownerDocument.addEventListener("pointerlockerror",f,!1)},this.disconnect=function(){n.domElement.ownerDocument.removeEventListener("mousemove",c,!1),n.domElement.ownerDocument.removeEventListener("pointerlockchange",l,!1),n.domElement.ownerDocument.removeEventListener("pointerlockerror",f,!1)},this.dispose=function(){this.disconnect()},this.getObject=function(){return e},this.getDirection=function(){var t=new v.Vector3(0,0,-1);return function(n){return n.copy(t).applyQuaternion(e.quaternion)}}(),this.moveForward=function(t){u.setFromMatrixColumn(e.matrix,0),u.crossVectors(e.up,u),e.position.addScaledVector(u,t)},this.moveRight=function(t){u.setFromMatrixColumn(e.matrix,0),e.position.addScaledVector(u,t)},this.lock=function(){this.domElement.requestPointerLock()},this.unlock=function(){n.domElement.ownerDocument.exitPointerLock()},this.connect()};(C.prototype=Object.create(v.EventDispatcher.prototype)).constructor=C;var R=function(e){v.Loader.call(this,e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};R.prototype=Object.assign(Object.create(v.Loader.prototype),{constructor:R,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(e,t,n,r){var i=this,o=new v.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(e){var n={attributeIDs:i.defaultAttributeIDs,attributeTypes:i.defaultAttributeTypes,useUniqueIDs:!1};i.decodeGeometry(e,n).then(t).catch(r)}),n,r)},decodeDracoFile:function(e,t,n,r){var i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)},decodeGeometry:function(e,t){var n=this;for(var r in t.attributeTypes){var i=t.attributeTypes[r];void 0!==i.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=i.name)}var o,a=JSON.stringify(t);if(R.taskCache.has(e)){var s=R.taskCache.get(e);if(s.key===a)return s.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var u=this.workerNextTaskID++,c=e.byteLength,l=this._getWorker(u,c).then((function(n){return o=n,new Promise((function(n,r){o._callbacks[u]={resolve:n,reject:r},o.postMessage({type:"decode",id:u,taskConfig:t,buffer:e},[e])}))})).then((function(e){return n._createGeometry(e.geometry)}));return l.catch((function(){return!0})).then((function(){o&&u&&n._releaseTask(o,u)})),R.taskCache.set(e,{key:a,promise:l}),l},_createGeometry:function(e){var t=new v.BufferGeometry;e.index&&t.setIndex(new v.BufferAttribute(e.index.array,1));for(var n=0;nt._taskLoad?-1:1}));return(r=n.workerPool[n.workerPool.length-1])._taskCosts[e]=t,r._taskLoad+=t,r}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((function(e){return e._taskLoad})))},dispose:function(){for(var e=0;eh&&(h=e[u]),e[u]>=1;for(l=r<<16|u,c=a;c>>=1){case 0:var t=this.input,n=this.a,r=this.c,i=this.b,o=t.length,a=P,s=r.length,u=P;if(this.d=this.f=0,n+1>=o)throw Error("invalid uncompressed block header: LEN");if(a=t[n++]|t[n++]<<8,n+1>=o)throw Error("invalid uncompressed block header: NLEN");if(a===~(t[n++]|t[n++]<<8))throw Error("invalid uncompressed block header: length verify");if(n+a>t.length)throw Error("input buffer is broken");switch(this.i){case j:for(;i+a>r.length;){if(a-=u=s-i,D)r.set(t.subarray(n,n+u),i),i+=u,n+=u;else for(;u--;)r[i++]=t[n++];this.b=i,r=this.e(),i=this.b}break;case U:for(;i+a>r.length;)r=this.e({p:2});break;default:throw Error("invalid inflate mode")}if(D)r.set(t.subarray(n,n+a),i),i+=a,n+=a;else for(;a--;)r[i++]=t[n++];this.a=n,this.b=i,this.c=r;break;case 1:this.j(ne,ie);break;case 2:var c,l,f,h,d=oe(this,5)+257,p=oe(this,5)+1,v=oe(this,4)+4,m=new(D?Uint8Array:Array)(H.length),g=P,y=P,b=P,w=P,_=P;for(_=0;_=G?8:255>=G?9:279>=G?7:8;var ee,te,ne=N(J),re=new(D?Uint8Array:Array)(30);for(ee=0,te=re.length;ee=s)throw Error("input buffer is broken");r|=o[a++]<>>t,e.d=i-t,e.a=a,n}function ae(e,t){for(var n,r,i=e.f,o=e.d,a=e.input,s=e.a,u=a.length,c=t[0],l=t[1];o=u);)i|=a[s++]<>>16)>o)throw Error("invalid code length: "+r);return e.f=i>>r,e.d=o-r,e.a=s,65535&n}function se(e,t){var n,r;switch(this.input=e,this.a=0,!t&&(t={})||(t.index&&(this.a=t.index),t.verify&&(this.A=t.verify)),n=e[this.a++],r=e[this.a++],15&n){case ue:this.method=ue;break;default:throw Error("unsupported compression method")}if(0!==((n<<8)+r)%31)throw Error("invalid fcheck flag:"+((n<<8)+r)%31);if(32&r)throw Error("fdict flag is not supported");this.q=new F(e,{index:this.a,bufferSize:t.bufferSize,bufferType:t.bufferType,resize:t.resize})}F.prototype.j=function(e,t){var n=this.c,r=this.b;this.o=e;for(var i,o,a,s,u=n.length-258;256!==(i=ae(this,e));)if(256>i)r>=u&&(this.b=r,n=this.e(),r=this.b),n[r++]=i;else for(s=X[o=i-257],0=u&&(this.b=r,n=this.e(),r=this.b);s--;)n[r]=n[r++-a];for(;8<=this.d;)this.d-=8,this.a--;this.b=r},F.prototype.w=function(e,t){var n=this.c,r=this.b;this.o=e;for(var i,o,a,s,u=n.length;256!==(i=ae(this,e));)if(256>i)r>=u&&(u=(n=this.e()).length),n[r++]=i;else for(s=X[o=i-257],0u&&(u=(n=this.e()).length);s--;)n[r]=n[r++-a];for(;8<=this.d;)this.d-=8,this.a--;this.b=r},F.prototype.e=function(){var e,t,n=new(D?Uint8Array:Array)(this.b-32768),r=this.b-32768,i=this.c;if(D)n.set(i.subarray(32768,n.length));else for(e=0,t=n.length;ee;++e)i[e]=i[r+e];return this.b=32768,i},F.prototype.z=function(e){var t,n,r,i=this.input.length/this.a+1|0,o=this.input,a=this.c;return e&&("number"===typeof e.p&&(i=e.p),"number"===typeof e.u&&(i+=e.u)),2>i?n=(r=(o.length-this.a)/this.o[2]/2*258|0)t&&(this.c.length=t),e=this.c),this.buffer=e},se.prototype.k=function(){var e,t,n=this.input;if(e=this.q.k(),this.a=this.q.a,this.A){t=(n[this.a++]<<24|n[this.a++]<<16|n[this.a++]<<8|n[this.a++])>>>0;var r=e;if("string"===typeof r){var i,o,a=r.split("");for(i=0,o=a.length;i>>0;r=a}for(var s,u=1,c=0,l=r.length,f=0;0>>0)throw Error("invalid adler-32 checksum")}return e};var ue=8;L("Zlib.Inflate",se),L("Zlib.Inflate.prototype.decompress",se.prototype.k);var ce,le,fe,he,de={ADAPTIVE:B.s,BLOCK:B.t};if(Object.keys)ce=Object.keys(de);else for(le in ce=[],fe=0,de)ce[fe++]=le;for(fe=0,he=ce.length;fe=n[r])return r-1;if(t<=n[e])return e;for(var i=e,o=r,a=Math.floor((i+o)/2);t=n[a+1];)t=w&&(b[y][0]=b[g][0]/u[M+1][x],_=b[y][0]*u[x][M]);var S=d-1<=M?w-1:n-d;for(f=x>=-1?1:-x;f<=S;++f)b[y][f]=(b[g][f]-b[g][f-1])/u[M+1][x+f],_+=b[y][f]*u[x+f][M];d<=M&&(b[y][w]=-b[g][w-1]/u[M+1][d],_+=b[y][w]*u[d][M]),s[w][d]=_;f=g;g=y,y=f}}for(d=n,w=1;w<=r;++w){for(f=0;f<=n;++f)s[w][f]*=d;d*=n-w}return s},calcBSplineDerivatives:function(e,t,n,r,i){for(var o=i=t.length&&t===_(e,0,t.length)}(t))e=(new u).parse(t);else{var r=_(t);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],n=0;function r(t){var r=e[t-1];return e=e.slice(n+t),n++,r}for(var i=0;i0,s="string"===typeof o.Content&&""!==o.Content;if(a||s){var u=this.parseImage(r[i]);n[o.RelativeFilename||o.Filename]=u}}}}for(var c in t){var l=t[c];void 0!==n[l]?t[c]=n[l]:t[c]=t[c].split("\\").pop()}return t},parseImage:function(e){var t,n=e.Content,r=e.RelativeFilename||e.Filename,i=r.slice(r.lastIndexOf(".")+1).toLowerCase();switch(i){case"bmp":t="image/bmp";break;case"jpg":case"jpeg":t="image/jpeg";break;case"png":t="image/png";break;case"tif":t="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",r),t="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+i+'" is not supported.')}if("string"===typeof n)return"data:"+t+";base64,"+n;var o=new Uint8Array(n);return window.URL.createObjectURL(new Blob([o],{type:t}))},parseTextures:function(t){var n=new Map;if("Texture"in e.Objects){var r=e.Objects.Texture;for(var i in r){var o=this.parseTexture(r[i],t);n.set(parseInt(i),o)}}return n},parseTexture:function(e,t){var n=this.loadTexture(e,t);n.ID=e.id,n.name=e.attrName;var r=e.WrapModeU,i=e.WrapModeV,o=void 0!==r?r.value:0,a=void 0!==i?i.value:0;if(n.wrapS=0===o?v.RepeatWrapping:v.ClampToEdgeWrapping,n.wrapT=0===a?v.RepeatWrapping:v.ClampToEdgeWrapping,"Scaling"in e){var s=e.Scaling.value;n.repeat.x=s[0],n.repeat.y=s[1]}return n},loadTexture:function(e,n){var r,i,o=this.textureLoader.path,a=t.get(e.id).children;void 0!==a&&a.length>0&&void 0!==n[a[0].ID]&&(0!==(r=n[a[0].ID]).indexOf("blob:")&&0!==r.indexOf("data:")||this.textureLoader.setPath(void 0));var s=e.FileName.slice(-3).toLowerCase();if("tga"===s){var u=this.manager.getHandler(".tga");null===u?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),i=new v.Texture):i=u.load(r)}else"psd"===s?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),i=new v.Texture):i=this.textureLoader.load(r);return this.textureLoader.setPath(o),i},parseMaterials:function(t){var n=new Map;if("Material"in e.Objects){var r=e.Objects.Material;for(var i in r){var o=this.parseMaterial(r[i],t);null!==o&&n.set(parseInt(i),o)}}return n},parseMaterial:function(e,n){var r=e.id,i=e.attrName,o=e.ShadingModel;if("object"===typeof o&&(o=o.value),!t.has(r))return null;var a,s=this.parseParameters(e,n,r);switch(o.toLowerCase()){case"phong":a=new v.MeshPhongMaterial;break;case"lambert":a=new v.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',o),a=new v.MeshPhongMaterial}return a.setValues(s),a.name=i,a},parseParameters:function(e,n,r){var i={};e.BumpFactor&&(i.bumpScale=e.BumpFactor.value),e.Diffuse?i.color=(new v.Color).fromArray(e.Diffuse.value):e.DiffuseColor&&"Color"===e.DiffuseColor.type&&(i.color=(new v.Color).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(i.displacementScale=e.DisplacementFactor.value),e.Emissive?i.emissive=(new v.Color).fromArray(e.Emissive.value):e.EmissiveColor&&"Color"===e.EmissiveColor.type&&(i.emissive=(new v.Color).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(i.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(i.opacity=parseFloat(e.Opacity.value)),i.opacity<1&&(i.transparent=!0),e.ReflectionFactor&&(i.reflectivity=e.ReflectionFactor.value),e.Shininess&&(i.shininess=e.Shininess.value),e.Specular?i.specular=(new v.Color).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(i.specular=(new v.Color).fromArray(e.SpecularColor.value));var o=this;return t.get(r).children.forEach((function(e){var t=e.relationship;switch(t){case"Bump":i.bumpMap=o.getTexture(n,e.ID);break;case"Maya|TEX_ao_map":i.aoMap=o.getTexture(n,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":i.map=o.getTexture(n,e.ID),i.map.encoding=v.sRGBEncoding;break;case"DisplacementColor":i.displacementMap=o.getTexture(n,e.ID);break;case"EmissiveColor":i.emissiveMap=o.getTexture(n,e.ID),i.emissiveMap.encoding=v.sRGBEncoding;break;case"NormalMap":case"Maya|TEX_normal_map":i.normalMap=o.getTexture(n,e.ID);break;case"ReflectionColor":i.envMap=o.getTexture(n,e.ID),i.envMap.mapping=v.EquirectangularReflectionMapping,i.envMap.encoding=v.sRGBEncoding;break;case"SpecularColor":i.specularMap=o.getTexture(n,e.ID),i.specularMap.encoding=v.sRGBEncoding;break;case"TransparentColor":case"TransparencyFactor":i.alphaMap=o.getTexture(n,e.ID),i.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",t)}})),i},getTexture:function(n,r){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=t.get(r).children[0].ID),n.get(r)},parseDeformers:function(){var n={},r={};if("Deformer"in e.Objects){var i=e.Objects.Deformer;for(var o in i){var a=i[o],s=t.get(parseInt(o));if("Skin"===a.attrType){var u=this.parseSkeleton(s,i);u.ID=o,s.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),u.geometryID=s.parents[0].ID,n[o]=u}else if("BlendShape"===a.attrType){var c={id:o};c.rawTargets=this.parseMorphTargets(s,i),c.id=o,s.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),r[o]=c}}}return{skeletons:n,morphTargets:r}},parseSkeleton:function(e,t){var n=[];return e.children.forEach((function(e){var r=t[e.ID];if("Cluster"===r.attrType){var i={ID:e.ID,indices:[],weights:[],transformLink:(new v.Matrix4).fromArray(r.TransformLink.a)};"Indexes"in r&&(i.indices=r.Indexes.a,i.weights=r.Weights.a),n.push(i)}})),{rawBones:n,bones:[]}},parseMorphTargets:function(e,n){for(var r=[],i=0;i1?o=a:a.length>0?o=a[0]:(o=new v.MeshPhongMaterial({color:13421772}),a.push(o)),"color"in i.attributes&&a.forEach((function(e){e.vertexColors=!0})),i.FBX_Deformer?(a.forEach((function(e){e.skinning=!0})),(r=new v.SkinnedMesh(i,o)).normalizeSkinWeights()):r=new v.Mesh(i,o),r},createCurve:function(e,t){var n=e.children.reduce((function(e,n){return t.has(n.ID)&&(e=t.get(n.ID)),e}),null),r=new v.LineBasicMaterial({color:3342591,linewidth:1});return new v.Line(n,r)},getTransformData:function(e,t){var n={};"InheritType"in t&&(n.inheritType=parseInt(t.InheritType.value)),n.eulerOrder="RotationOrder"in t?b(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(n.translation=t.Lcl_Translation.value),"PreRotation"in t&&(n.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(n.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(n.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(n.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(n.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(n.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(n.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(n.rotationPivot=t.RotationPivot.value),e.userData.transformData=n},setLookAtProperties:function(r,i){"LookAtProperty"in i&&t.get(r.ID).children.forEach((function(t){if("LookAtProperty"===t.relationship){var i=e.Objects.Model[t.ID];if("Lcl_Translation"in i){var o=i.Lcl_Translation.value;void 0!==r.target?(r.target.position.fromArray(o),n.add(r.target)):r.lookAt((new v.Vector3).fromArray(o))}}}))},bindSkeleton:function(e,n,r){var i=this.parsePoseNodes();for(var o in e){var a=e[o];t.get(parseInt(a.ID)).parents.forEach((function(e){if(n.has(e.ID)){var o=e.ID;t.get(o).parents.forEach((function(e){r.has(e.ID)&&r.get(e.ID).bind(new v.Skeleton(a.bones),i[e.ID])}))}}))}},parsePoseNodes:function(){var t={};if("Pose"in e.Objects){var n=e.Objects.Pose;for(var r in n)if("BindPose"===n[r].attrType){var i=n[r].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new v.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new v.Matrix4).fromArray(i.Matrix.a)}}return t},createAmbientLight:function(){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var t=e.GlobalSettings.AmbientColor.value,r=t[0],i=t[1],o=t[2];if(0!==r||0!==i||0!==o){var a=new v.Color(r,i,o);n.add(new v.AmbientLight(a,1))}}},setupMorphMaterials:function(){var e=this;n.traverse((function(t){t.isMesh&&t.geometry.morphAttributes.position&&t.geometry.morphAttributes.position.length&&(Array.isArray(t.material)?t.material.forEach((function(n,r){e.setupMorphMaterial(t,n,r)})):e.setupMorphMaterial(t,t.material))}))},setupMorphMaterial:function(e,t,r){var i=e.uuid,o=t.uuid,a=!1;if(n.traverse((function(e){e.isMesh&&(Array.isArray(e.material)?e.material.forEach((function(t){t.uuid===o&&e.uuid!==i&&(a=!0)})):e.material.uuid===o&&e.uuid!==i&&(a=!0))})),!0===a){var s=t.clone();s.morphTargets=!0,void 0===r?e.material=s:e.material[r]=s}else t.morphTargets=!0}},o.prototype={constructor:o,parse:function(n){var r=new Map;if("Geometry"in e.Objects){var i=e.Objects.Geometry;for(var o in i){var a=t.get(parseInt(o)),s=this.parseGeometry(a,i[o],n);r.set(parseInt(o),s)}}return r},parseGeometry:function(e,t,n){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,n);case"NurbsCurve":return this.parseNurbsGeometry(t)}},parseMeshGeometry:function(t,n,r){var i=r.skeletons,o=[],a=t.parents.map((function(t){return e.Objects.Model[t.ID]}));if(0!==a.length){var s=t.children.reduce((function(e,t){return void 0!==i[t.ID]&&(e=i[t.ID]),e}),null);t.children.forEach((function(e){void 0!==r.morphTargets[e.ID]&&o.push(r.morphTargets[e.ID])}));var u=a[0],c={};"RotationOrder"in u&&(c.eulerOrder=b(u.RotationOrder.value)),"InheritType"in u&&(c.inheritType=parseInt(u.InheritType.value)),"GeometricTranslation"in u&&(c.translation=u.GeometricTranslation.value),"GeometricRotation"in u&&(c.rotation=u.GeometricRotation.value),"GeometricScaling"in u&&(c.scale=u.GeometricScaling.value);var l=y(c);return this.genGeometry(n,s,o,l)}},genGeometry:function(e,t,n,r){var i=new v.BufferGeometry;e.attrName&&(i.name=e.attrName);var o=this.parseGeoNode(e,t),a=this.genBuffers(o),s=new v.Float32BufferAttribute(a.vertex,3);if(s.applyMatrix4(r),i.setAttribute("position",s),a.colors.length>0&&i.setAttribute("color",new v.Float32BufferAttribute(a.colors,3)),t&&(i.setAttribute("skinIndex",new v.Uint16BufferAttribute(a.weightsIndices,4)),i.setAttribute("skinWeight",new v.Float32BufferAttribute(a.vertexWeights,4)),i.FBX_Deformer=t),a.normal.length>0){var u=(new v.Matrix3).getNormalMatrix(r),c=new v.Float32BufferAttribute(a.normal,3);c.applyNormalMatrix(u),i.setAttribute("normal",c)}if(a.uvs.forEach((function(e,t){var n="uv"+(t+1).toString();0===t&&(n="uv"),i.setAttribute(n,new v.Float32BufferAttribute(a.uvs[t],2))})),o.material&&"AllSame"!==o.material.mappingType){var l=a.materialIndex[0],f=0;if(a.materialIndex.forEach((function(e,t){e!==l&&(i.addGroup(f,t-f,l),l=e,f=t)})),i.groups.length>0){var h=i.groups[i.groups.length-1],d=h.start+h.count;d!==a.materialIndex.length&&i.addGroup(d,a.materialIndex.length-d,l)}0===i.groups.length&&i.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(i,e,n,r),i},parseGeoNode:function(e,t){var n={};if(n.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],n.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(n.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(n.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(n.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){n.uv=[];for(var r=0;e.LayerElementUV[r];)e.LayerElementUV[r].UV&&n.uv.push(this.parseUVs(e.LayerElementUV[r])),r++}return n.weightTable={},null!==t&&(n.skeleton=t,t.rawBones.forEach((function(e,t){e.indices.forEach((function(r,i){void 0===n.weightTable[r]&&(n.weightTable[r]=[]),n.weightTable[r].push({id:t,weight:e.weights[i]})}))}))),n},genBuffers:function(e){var t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},n=0,r=0,i=!1,o=[],a=[],s=[],u=[],c=[],l=[],f=this;return e.vertexIndices.forEach((function(h,d){var v=!1;h<0&&(h^=-1,v=!0);var m=[],g=[];if(o.push(3*h,3*h+1,3*h+2),e.color){var y=p(d,n,h,e.color);s.push(y[0],y[1],y[2])}if(e.skeleton){if(void 0!==e.weightTable[h]&&e.weightTable[h].forEach((function(e){g.push(e.weight),m.push(e.id)})),g.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);var b=[0,0,0,0],w=[0,0,0,0];g.forEach((function(e,t){var n=e,r=m[t];w.forEach((function(e,t,i){if(n>e){i[t]=n,n=e;var o=b[t];b[t]=r,r=o}}))})),m=b,g=w}for(;g.length<4;)g.push(0),m.push(0);for(var _=0;_<4;++_)c.push(g[_]),l.push(m[_])}if(e.normal){y=p(d,n,h,e.normal);a.push(y[0],y[1],y[2])}if(e.material&&"AllSame"!==e.material.mappingType)var x=p(d,n,h,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var r=p(d,n,h,e);void 0===u[t]&&(u[t]=[]),u[t].push(r[0]),u[t].push(r[1])})),r++,v&&(f.genFace(t,e,o,x,a,s,u,c,l,r),n++,r=0,o=[],a=[],s=[],u=[],c=[],l=[])})),t},genFace:function(e,t,n,r,i,o,a,s,u,c){for(var l=2;l1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=n.get(a[0].ID);i[o]={name:r[o].attrName,layer:s}}return i},addClip:function(e){var t=[],n=this;return e.layer.forEach((function(e){t=t.concat(n.generateTracks(e))})),new v.AnimationClip(e.name,-1,t)},generateTracks:function(e){var t=[],n=new v.Vector3,r=new v.Quaternion,i=new v.Vector3;if(e.transform&&e.transform.decompose(n,r,i),n=n.toArray(),r=(new v.Euler).setFromQuaternion(r,e.eulerOrder).toArray(),i=i.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){var o=this.generateVectorTrack(e.modelName,e.T.curves,n,"position");void 0!==o&&t.push(o)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=this.generateRotationTrack(e.modelName,e.R.curves,r,e.preRotation,e.postRotation,e.eulerOrder);void 0!==a&&t.push(a)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){var s=this.generateVectorTrack(e.modelName,e.S.curves,i,"scale");void 0!==s&&t.push(s)}if(void 0!==e.DeformPercent){var u=this.generateMorphTrack(e);void 0!==u&&t.push(u)}return t},generateVectorTrack:function(e,t,n,r){var i=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(i,t,n);return new v.VectorKeyframeTrack(e+"."+r,i,o)},generateRotationTrack:function(e,t,n,r,i,o){void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=t.x.values.map(v.MathUtils.degToRad)),void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=t.y.values.map(v.MathUtils.degToRad)),void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=t.z.values.map(v.MathUtils.degToRad));var a=this.getTimesForAllAxes(t),s=this.getKeyframeTrackValues(a,t,n);void 0!==r&&((r=r.map(v.MathUtils.degToRad)).push(o),r=(new v.Euler).fromArray(r),r=(new v.Quaternion).setFromEuler(r)),void 0!==i&&((i=i.map(v.MathUtils.degToRad)).push(o),i=(new v.Euler).fromArray(i),i=(new v.Quaternion).setFromEuler(i).inverse());for(var u=new v.Quaternion,c=new v.Euler,l=[],f=0;f=180){for(var o=i/180,a=r/o,s=n+a,u=e.times[t-1],c=(e.times[t]-u)/o,l=u+c,f=[],h=[];l1&&(n=e[1].replace(/^(\w+)::/,""),r=e[2]),{id:t,name:n,type:r}},parseNodeProperty:function(e,t,n){var r=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===r&&","===i&&(i=n.replace(/"/g,"").replace(/,$/,"").trim());var o=this.getCurrentNode();if("Properties70"!==o.name){if("C"===r){var a=i.split(",").slice(1),s=parseInt(a[0]),u=parseInt(a[1]),c=i.split(",").slice(3);r="connections",function(e,t){for(var n=0,r=e.length,i=t.length;n=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var n={},r=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();var o=e.getUint8(),a=e.getString(o);if(0===r)return null;for(var s=[],u=0;u0?s[0]:"",l=s.length>1?s[1]:"",f=s.length>2?s[2]:"";for(n.singleProperty=1===i&&e.getOffset()===r;r>e.getOffset();){var h=this.parseNode(e,t);null!==h&&this.parseSubNode(a,n,h)}return n.propertyList=s,"number"===typeof c&&(n.id=c),""!==l&&(n.attrName=l),""!==f&&(n.attrType=f),""!==a&&(n.name=a),n},parseSubNode:function(e,t,n){if(!0===n.singleProperty){var r=n.propertyList[0];Array.isArray(r)?(t[n.name]=n,n.a=r):t[n.name]=r}else if("Connections"===e&&"C"===n.name){var i=[];n.propertyList.forEach((function(e,t){0!==t&&i.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(i)}else if("Properties70"===n.name){Object.keys(n).forEach((function(e){t[e]=n[e]}))}else if("Properties70"===e&&"P"===n.name){var o,a=n.propertyList[0],s=n.propertyList[1],u=n.propertyList[2],c=n.propertyList[3];0===a.indexOf("Lcl ")&&(a=a.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),o="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:n.propertyList[4],t[a]={type:s,type2:u,flag:c,value:o}}else void 0===t[n.name]?"number"===typeof n.id?(t[n.name]={},t[n.name][n.id]=n):t[n.name]=n:"PoseNode"===n.name?(Array.isArray(t[n.name])||(t[n.name]=[t[n.name]]),t[n.name].push(n)):void 0===t[n.name][n.id]&&(t[n.name][n.id]=n)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var n=e.getUint32();return e.getArrayBuffer(n);case"S":n=e.getUint32();return e.getString(n);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var r=e.getUint32(),i=e.getUint32(),o=e.getUint32();if(0===i)switch(t){case"b":case"c":return e.getBooleanArray(r);case"d":return e.getFloat64Array(r);case"f":return e.getFloat32Array(r);case"i":return e.getInt32Array(r);case"l":return e.getInt64Array(r)}"undefined"===typeof pe&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var a=new c(new pe(new Uint8Array(e.getArrayBuffer(o))).decompress().buffer);switch(t){case"b":case"c":return a.getBooleanArray(r);case"d":return a.getFloat64Array(r);case"f":return a.getFloat32Array(r);case"i":return a.getInt32Array(r);case"l":return a.getInt64Array(r)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}},c.prototype={constructor:c,getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1===(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],n=0;n=0&&(t=t.slice(0,r)),v.LoaderUtils.decodeText(new Uint8Array(t))}},l.prototype={constructor:l,add:function(e,t){this[e]=t}};var d=[];function p(e,t,n,r){var i;switch(r.mappingType){case"ByPolygonVertex":i=e;break;case"ByPolygon":i=t;break;case"ByVertice":i=n;break;case"AllSame":i=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType)}"IndexToDirect"===r.referenceType&&(i=r.indices[i]);var o=i*r.dataSize,a=o+r.dataSize;return function(e,t,n,r){for(var i=n,o=0;i1&&void 0!==arguments[1]?arguments[1]:i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.is,a=r(t);function s(){var n=r(t);if(!o(a,n)){var i=a;e(a=n,i)}}return n.add(s),function(){return n.delete(s)}}(e,r,o):(n.add(e),function(){return n.delete(e)})},destroy:function(){return n.clear()}};return t=e(r,i,o),o}var we="undefined"===typeof window?h.useEffect:h.useLayoutEffect;var _e=function(e){var t="function"===typeof e?be(e):e,n=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.getState,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.is,i=Object(h.useReducer)((function(e){return e+1}),0),o=Object(c.a)(i,2),a=o[1],s=t.getState(),u=Object(h.useRef)(s),l=Object(h.useRef)(n),f=Object(h.useRef)(r),d=Object(h.useRef)(!1),p=Object(h.useRef)();void 0===p.current&&(p.current=n(s));var v=!1;(u.current!==s||l.current!==n||f.current!==r||d.current)&&(e=n(s),v=!r(p.current,e)),we((function(){v&&(p.current=e),u.current=s,l.current=n,f.current=r,d.current=!1}));var m=Object(h.useRef)(s);return Object(h.useEffect)((function(){var e=function(){try{var e=t.getState(),n=l.current(e);f.current(p.current,n)||(u.current=e,p.current=n,a())}catch(r){d.current=!0,a()}},n=t.subscribe(e);return t.getState()!==m.current&&e(),n}),[]),v?e:p.current};return Object.assign(n,t),n[Symbol.iterator]=ye.a.mark((function e(){return ye.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.warn("[useStore, api] = create() is deprecated and will be removed in v4"),e.next=3,n;case 3:return e.next=5,t;case 5:case"end":return e.stop()}}),e)})),n},xe=n(25),Me=n.n(xe),Se=function e(t,n){v.Mesh.call(this,t),this.type="Reflector";var r=this,i=void 0!==(n=n||{}).color?new v.Color(n.color):new v.Color(8355711),o=n.textureWidth||512,a=n.textureHeight||512,s=n.clipBias||0,u=n.shader||e.ReflectorShader,c=new v.Plane,l=new v.Vector3,f=new v.Vector3,h=new v.Vector3,d=new v.Matrix4,p=new v.Vector3(0,0,-1),m=new v.Vector4,g=new v.Vector3,y=new v.Vector3,b=new v.Vector4,w=new v.Matrix4,_=new v.PerspectiveCamera,x={minFilter:v.LinearFilter,magFilter:v.LinearFilter,format:v.RGBFormat},M=new v.WebGLRenderTarget(o,a,x);v.MathUtils.isPowerOfTwo(o)&&v.MathUtils.isPowerOfTwo(a)||(M.texture.generateMipmaps=!1);var S=new v.ShaderMaterial({uniforms:v.UniformsUtils.clone(u.uniforms),fragmentShader:u.fragmentShader,vertexShader:u.vertexShader});S.uniforms.tDiffuse.value=M.texture,S.uniforms.color.value=i,S.uniforms.textureMatrix.value=w,this.material=S,this.onBeforeRender=function(e,t,n){if(f.setFromMatrixPosition(r.matrixWorld),h.setFromMatrixPosition(n.matrixWorld),d.extractRotation(r.matrixWorld),l.set(0,0,1),l.applyMatrix4(d),g.subVectors(f,h),!(g.dot(l)>0)){g.reflect(l).negate(),g.add(f),d.extractRotation(n.matrixWorld),p.set(0,0,-1),p.applyMatrix4(d),p.add(h),y.subVectors(f,p),y.reflect(l).negate(),y.add(f),_.position.copy(g),_.up.set(0,1,0),_.up.applyMatrix4(d),_.up.reflect(l),_.lookAt(y),_.far=n.far,_.updateMatrixWorld(),_.projectionMatrix.copy(n.projectionMatrix),w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(_.projectionMatrix),w.multiply(_.matrixWorldInverse),w.multiply(r.matrixWorld),c.setFromNormalAndCoplanarPoint(l,f),c.applyMatrix4(_.matrixWorldInverse),m.set(c.normal.x,c.normal.y,c.normal.z,c.constant);var i=_.projectionMatrix;b.x=(Math.sign(m.x)+i.elements[8])/i.elements[0],b.y=(Math.sign(m.y)+i.elements[9])/i.elements[5],b.z=-1,b.w=(1+i.elements[10])/i.elements[14],m.multiplyScalar(2/m.dot(b)),i.elements[2]=m.x,i.elements[6]=m.y,i.elements[10]=m.z+1-s,i.elements[14]=m.w,M.texture.encoding=e.outputEncoding,r.visible=!1;var o=e.getRenderTarget(),a=e.xr.enabled,u=e.shadowMap.autoUpdate;e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(M),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,_),e.xr.enabled=a,e.shadowMap.autoUpdate=u,e.setRenderTarget(o);var v=n.viewport;void 0!==v&&e.state.viewport(v),r.visible=!0}},this.getRenderTarget=function(){return M}};(Se.prototype=Object.create(v.Mesh.prototype)).constructor=Se,Se.ReflectorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec4 vUv;","void main() {","\tvUv = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec4 vUv;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );","}","void main() {","\tvec4 base = texture2DProj( tDiffuse, vUv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};n(141),n(142);var Ee=function(){};!function(){var e=new v.Vector3,t=new v.Vector3;function n(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}function r(e,t){var n,r,i,o=t.position.distanceTo(e.position),a=0,s=[],u=e.faces.length;for(n=0;n=0;s--)n.faces[s].hasVertex(r)&&a(n.faces[s],t);for(s=n.faces.length-1;s>=0;s--)n.faces[s].replaceVertex(n,r);for(o(n,e),s=0;s0;)this.smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e},function(){var e=["a","b","c"];function t(e,t,n){return n[Math.min(e,t)+"_"+Math.max(e,t)]}function n(e,t,n,r,i,o){var a,s=Math.min(e,t),u=Math.max(e,t),c=s+"_"+u;c in r?a=r[c]:(a={a:n[s],b:n[u],newEdge:null,faces:[]},r[c]=a);a.faces.push(i),o[e].edges.push(a),o[t].edges.push(a)}function r(e,t,n,r,i){e.push(new v.Face3(t,n,r,void 0,void 0,i))}function i(e,t){return Math.abs(t-e)/2+Math.min(e,t)}function o(e,t,n,r){e.push([t.clone(),n.clone(),r.clone()])}Te.prototype.smooth=function(a){var s,u,c,l,f,h,d,p,m,g,y,b,w,_=new v.Vector3,x=[];s=a.vertices,u=a.faces;var M,S,E,T,A,k,C,R,O,P,I,L,D,N,F=void 0!==(c=a.faceVertexUvs)[0]&&c[0].length>0;if(F)for(var j=0;j3&&(R=3/(8*h)),O=1-h*R,P=R,h<=2&&2==h&&(O=3/4,P=1/8),N=D.clone().multiplyScalar(O),_.set(0,0,0),j=0;ji||m>i||g>i){var y=e.vertices.length,b=s.clone(),w=s.clone();if(p>=m&&p>=g){if((_=f.clone()).lerp(h,.5),b.a=u,b.b=y,b.c=l,w.a=y,w.b=c,w.c=l,3===s.vertexNormals.length)(x=s.vertexNormals[0].clone()).lerp(s.vertexNormals[1],.5),b.vertexNormals[1].copy(x),w.vertexNormals[0].copy(x);if(3===s.vertexColors.length)(M=s.vertexColors[0].clone()).lerp(s.vertexColors[1],.5),b.vertexColors[1].copy(M),w.vertexColors[0].copy(M);t=0}else if(m>=p&&m>=g){if((_=h.clone()).lerp(d,.5),b.a=u,b.b=c,b.c=y,w.a=y,w.b=l,w.c=u,3===s.vertexNormals.length)(x=s.vertexNormals[1].clone()).lerp(s.vertexNormals[2],.5),b.vertexNormals[2].copy(x),w.vertexNormals[0].copy(x),w.vertexNormals[1].copy(s.vertexNormals[2]),w.vertexNormals[2].copy(s.vertexNormals[0]);if(3===s.vertexColors.length)(M=s.vertexColors[1].clone()).lerp(s.vertexColors[2],.5),b.vertexColors[2].copy(M),w.vertexColors[0].copy(M),w.vertexColors[1].copy(s.vertexColors[2]),w.vertexColors[2].copy(s.vertexColors[0]);t=1}else{var _,x,M;if((_=f.clone()).lerp(d,.5),b.a=u,b.b=c,b.c=y,w.a=y,w.b=c,w.c=l,3===s.vertexNormals.length)(x=s.vertexNormals[0].clone()).lerp(s.vertexNormals[2],.5),b.vertexNormals[2].copy(x),w.vertexNormals[0].copy(x);if(3===s.vertexColors.length)(M=s.vertexColors[0].clone()).lerp(s.vertexColors[2],.5),b.vertexColors[2].copy(M),w.vertexColors[0].copy(M);t=2}n.push(b,w),e.vertices.push(_);for(var S=0,E=e.faceVertexUvs.length;S","#include ","}"].join("\n")};["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","\tvec4 sum = vec4( 0.0 );","\tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","\tgl_FragColor = sum;","}"].join("\n"),["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","\tvec4 sum = vec4( 0.0 );","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","\tgl_FragColor = sum;","}"].join("\n"),n(82),n(78);function Re(e){var t=e+"BufferGeometry";return Object(h.forwardRef)((function(e,n){var r=e.args,i=e.children,o=Object(f.a)(e,["args","children"]);return d.a.createElement("mesh",Object(l.a)({ref:n},o),d.a.createElement(t,{attach:"geometry",args:r}),i)}))}Re("box"),Re("circle"),Re("cone"),Re("cylinder"),Re("sphere"),Re("plane"),Re("tube"),Re("torus"),Re("torusKnot"),Re("tetrahedron"),Re("ring"),Re("polyhedron"),Re("icosahedron"),Re("octahedron"),Re("dodecahedron"),Re("extrude"),Re("lathe"),Re("parametric");_e((function(e){return v.DefaultLoadingManager.onStart=function(t,n,r){return e({active:!0,item:t,loaded:n,total:r,progress:n/r*100})},v.DefaultLoadingManager.onLoad=function(){return e({active:!1})},v.DefaultLoadingManager.onError=function(t){return e((function(e){return{errors:[].concat(Object(u.a)(e.errors),[t])}}))},v.DefaultLoadingManager.onProgress=function(t,n,r){return e({item:t,loaded:n,total:r,progress:n/r*100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}}));var Oe=new v.Vector3,Pe=new v.Vector3,Ie=new v.Vector3;function Le(e,t,n){var r=Oe.setFromMatrixPosition(e.matrixWorld);r.project(t);var i=n.width/2,o=n.height/2;return[r.x*i+i,-r.y*o+o]}var De=d.a.forwardRef((function(e,t){var n,r=e.children,i=e.eps,o=void 0===i?.001:i,a=e.style,s=e.className,u=e.prepend,m=e.center,g=e.fullscreen,y=e.portal,b=e.scaleFactor,w=e.zIndexRange,_=void 0===w?[16777271,0]:w,x=Object(f.a)(e,["children","eps","style","className","prepend","center","fullscreen","portal","scaleFactor","zIndexRange"]),M=Object(p.g)(),S=M.gl,E=M.scene,T=M.camera,A=M.size,k=Object(h.useState)((function(){return document.createElement("div")})),C=Object(c.a)(k,1)[0],R=Object(h.useRef)(null),O=Object(h.useRef)([0,0]),P=null!=(n=null==y?void 0:y.current)?n:S.domElement.parentNode;Object(h.useEffect)((function(){if(R.current){E.updateMatrixWorld();var e=Le(R.current,T,A);return C.style.cssText="position:absolute;top:0;left:0;transform:translate3d("+e[0]+"px,"+e[1]+"px,0);transform-origin:0 0;",P&&(u?P.prepend(C):P.appendChild(C)),function(){P&&P.removeChild(C),Me.a.unmountComponentAtNode(C)}}}),[P]);var I=Object(h.useMemo)((function(){return Object(l.a)({position:"absolute",transform:m?"translate3d(-50%,-50%,0)":"none"},g&&{top:-A.height/2,left:-A.width/2,width:A.width,height:A.height},a)}),[a,m,g,A]);return Object(h.useEffect)((function(){Me.a.render(d.a.createElement("div",{ref:t,style:I,className:s,children:r}),C)})),Object(p.e)((function(){if(R.current){var e=Le(R.current,T,A);if(Math.abs(O.current[0]-e[0])>o||Math.abs(O.current[1]-e[1])>o){C.style.display=function(e,t){var n=Oe.setFromMatrixPosition(e.matrixWorld),r=Pe.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),o=t.getWorldDirection(Ie);return i.angleTo(o)>Math.PI/2}(R.current,T)?"none":"block";var t=void 0===b?1:function(e,t){if(t instanceof v.PerspectiveCamera){var n=Oe.setFromMatrixPosition(e.matrixWorld),r=Pe.setFromMatrixPosition(t.matrixWorld),i=t.fov*Math.PI/180,o=n.distanceTo(r);return 1/(2*Math.tan(i/2)*o)}return t instanceof v.OrthographicCamera?t.zoom:1}(R.current,T)*b;C.style.transform="translate3d("+e[0]+"px,"+e[1]+"px,0) scale("+t+")",C.style.zIndex=""+function(e,t,n){if(t instanceof v.PerspectiveCamera||t instanceof v.OrthographicCamera){var r=Oe.setFromMatrixPosition(e.matrixWorld),i=Pe.setFromMatrixPosition(t.matrixWorld),o=r.distanceTo(i),a=(n[1]-n[0])/(t.far-t.near),s=n[1]-a*t.far;return Math.round(a*o+s)}}(R.current,T,_)}O.current=e}})),d.a.createElement("group",Object(l.a)({},x,{ref:R}))})),Ne=d.a.forwardRef((function(e,t){return Object(h.useEffect)((function(){console.warn("The component was renamed to ")}),[]),d.a.createElement(De,Object(l.a)({},e,{ref:t}))}));new v.Matrix4,new v.Ray,new v.Sphere,new v.Vector3;v.MeshPhysicalMaterial,v.MeshStandardMaterial;v.ShaderMaterial},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),i=function(){function e(e){r.Loader.call(this,e),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new s(e)})),this.register((function(e){return new c(e)})),this.register((function(e){return new l(e)})),this.register((function(e){return new u(e)})),this.register((function(e){return new o(e)})),this.register((function(e){return new f(e)}))}function t(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(r.Loader.prototype),{constructor:e,load:function(e,t,n,i){var o,a=this;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:r.LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);var s=function(t){i?i(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},u=new r.FileLoader(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(this.withCredentials),u.load(e,(function(n){try{a.parse(n,o,(function(n){t(n),a.manager.itemEnd(e)}),s)}catch(r){s(r)}}),n,s)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},setKTX2Loader:function(e){return this.ktx2Loader=e,this},setMeshoptDecoder:function(e){return this.meshoptDecoder=e,this},register:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this},unregister:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this},parse:function(e,t,o,s){var u,c={},l={};if("string"===typeof e)u=e;else if(r.LoaderUtils.decodeText(new Uint8Array(e,0,4))===h){try{c[n.KHR_BINARY_GLTF]=new v(e)}catch(M){return void(s&&s(M))}u=c[n.KHR_BINARY_GLTF].content}else u=r.LoaderUtils.decodeText(new Uint8Array(e));var f=JSON.parse(u);if(void 0===f.asset||f.asset.version[0]<2)s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var d=new W(f,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(var p=0;p=0&&void 0===l[_]&&console.warn('THREE.GLTFLoader: Unknown extension "'+_+'".')}}d.setExtensions(c),d.setPlugins(l),d.parse(o,s)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function i(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=e}function o(e){this.parser=e,this.name=n.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}function a(){this.name=n.KHR_MATERIALS_UNLIT}function s(e){this.parser=e,this.name=n.KHR_MATERIALS_CLEARCOAT}function u(e){this.parser=e,this.name=n.KHR_MATERIALS_TRANSMISSION}function c(e){this.parser=e,this.name=n.KHR_TEXTURE_BASISU}function l(e){this.parser=e,this.name=n.EXT_TEXTURE_WEBP,this.isSupported=null}function f(e){this.name=n.EXT_MESHOPT_COMPRESSION,this.parser=e}o.prototype._markDefs=function(){for(var e=this.parser,t=this.parser.json.nodes||[],n=0,r=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)},l.prototype.loadTexture=function(e){var t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;var o=i.extensions[t],a=r.images[o.source],s=a.uri?n.options.manager.getHandler(a.uri):n.textureLoader;return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,a,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))},l.prototype.detectSupport=function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported},f.prototype.loadBufferView=function(e){var t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){var r=n.extensions[this.name],i=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([i,o.ready]).then((function(e){var t=r.byteOffset||0,n=r.byteLength||0,i=r.count,a=r.byteStride,s=new ArrayBuffer(i*a),u=new Uint8Array(e[0],t,n);return o.decodeGltfBuffer(new Uint8Array(s),i,a,u,r.mode,r.filter),s}))}return null};var h="glTF",d=1313821514,p=5130562;function v(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:r.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==h)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var i=new DataView(e,12),o=0;o",t).replace("#include ",n).replace("#include ",i).replace("#include ",o).replace("#include ",a)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function b(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return y},extendParams:function(e,t,n){var i=t.extensions[this.name];e.color=new r.Color(1,1,1),e.opacity=1;var o=[];if(Array.isArray(i.diffuseFactor)){var a=i.diffuseFactor;e.color.fromArray(a),e.opacity=a[3]}if(void 0!==i.diffuseTexture&&o.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new r.Color(0,0,0),e.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,e.specular=new r.Color(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var s=i.specularGlossinessTexture;o.push(n.assignTexture(e,"glossinessMap",s)),o.push(n.assignTexture(e,"specularMap",s))}return Promise.all(o)},createMaterial:function(e){var t=new y(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=r.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function w(){this.name=n.KHR_MESH_QUANTIZATION}function _(e,t,n,i){r.Interpolant.call(this,e,t,n,i)}m.prototype.decodePrimitive=function(e,t){var n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},s={},u={};for(var c in o){var l=I[c]||c.toLowerCase();a[l]=o[c]}for(c in e.attributes){l=I[c]||c.toLowerCase();if(void 0!==o[c]){var f=n.accessors[e.attributes[c]],h=C[f.componentType];u[l]=h,s[l]=!0===f.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(var n in e.attributes){var r=e.attributes[n],i=s[n];void 0!==i&&(r.normalized=i)}t(e)}),a,u)}))}))},g.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},y.prototype=Object.create(r.MeshStandardMaterial.prototype),y.prototype.constructor=y,y.prototype.copy=function(e){return r.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},_.prototype=Object.create(r.Interpolant.prototype),_.prototype.constructor=_,_.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r,o=0;o!==r;o++)t[o]=n[i+o];return t},_.prototype.beforeStart_=_.prototype.copySampleValue_,_.prototype.afterEnd_=_.prototype.copySampleValue_,_.prototype.interpolate_=function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=2*a,u=3*a,c=r-t,l=(n-t)/c,f=l*l,h=f*l,d=e*u,p=d-u,v=-2*h+3*f,m=h-f,g=1-v,y=m-f+l,b=0;b!==a;b++){var w=o[p+b+a],_=o[p+b+s]*c,x=o[d+b+a],M=o[d+b]*c;i[b]=g*w+y*_+v*x+m*M}return i};var x=0,M=1,S=2,E=3,T=4,A=5,k=6,C={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},R={9728:r.NearestFilter,9729:r.LinearFilter,9984:r.NearestMipmapNearestFilter,9985:r.LinearMipmapNearestFilter,9986:r.NearestMipmapLinearFilter,9987:r.LinearMipmapLinearFilter},O={33071:r.ClampToEdgeWrapping,33648:r.MirroredRepeatWrapping,10497:r.RepeatWrapping},P={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},I={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},L={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},D={CUBICSPLINE:void 0,LINEAR:r.InterpolateLinear,STEP:r.InterpolateDiscrete},N="OPAQUE",F="MASK",j="BLEND";function U(e,t){return"string"!==typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function B(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function G(e,t){void 0!==t.extras&&("object"===typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function z(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,r=t.weights.length;n=2&&a.setY(T,M[S*u+1]),u>=3&&a.setZ(T,M[S*u+2]),u>=4&&a.setW(T,M[S*u+3]),u>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a}))},W.prototype.loadTexture=function(e){var t,r,i=this.json,o=this.options,a=i.textures[e],s=a.extensions||{};return(t=s[n.MSFT_TEXTURE_DDS]?i.images[s[n.MSFT_TEXTURE_DDS].source]:i.images[a.source]).uri&&(r=o.manager.getHandler(t.uri)),r||(r=s[n.MSFT_TEXTURE_DDS]?this.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(e,t,r)},W.prototype.loadTextureImage=function(e,t,n){var i=this,o=this.json,a=this.options,s=o.textures[e],u=self.URL||self.webkitURL,c=t.uri,l=!1,f=!0;return"image/jpeg"===t.mimeType&&(f=!1),void 0!==t.bufferView&&(c=i.getDependency("bufferView",t.bufferView).then((function(e){if("image/png"===t.mimeType){var n=new DataView(e,25,1).getUint8(0,!1);f=6===n||4===n||3===n}l=!0;var r=new Blob([e],{type:t.mimeType});return c=u.createObjectURL(r)}))),Promise.resolve(c).then((function(e){return new Promise((function(t,i){var o=t;!0===n.isImageBitmapLoader&&(o=function(e){t(new r.CanvasTexture(e))}),n.load(U(e,a.path),o,void 0,i)}))})).then((function(t){!0===l&&u.revokeObjectURL(c),t.flipY=!1,s.name&&(t.name=s.name),f||(t.format=r.RGBFormat);var n=(o.samplers||{})[s.sampler]||{};return t.magFilter=R[n.magFilter]||r.LinearFilter,t.minFilter=R[n.minFilter]||r.LinearMipmapLinearFilter,t.wrapS=O[n.wrapS]||r.RepeatWrapping,t.wrapT=O[n.wrapT]||r.RepeatWrapping,i.associations.set(t,{type:"textures",index:e}),t}))},W.prototype.assignTexture=function(e,t,r){var i=this;return this.getDependency("texture",r.index).then((function(o){if(void 0===r.texCoord||0==r.texCoord||"aoMap"===t&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+t+" not yet supported."),i.extensions[n.KHR_TEXTURE_TRANSFORM]){var a=void 0!==r.extensions?r.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(a){var s=i.associations.get(o);o=i.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),i.associations.set(o,s)}}e[t]=o}))},W.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,i=void 0!==t.attributes.tangent,o=void 0!==t.attributes.color,a=void 0===t.attributes.normal,s=!0===e.isSkinnedMesh,u=Object.keys(t.morphAttributes).length>0,c=u&&void 0!==t.morphAttributes.normal;if(e.isPoints){var l="PointsMaterial:"+n.uuid,f=this.cache.get(l);f||(f=new r.PointsMaterial,r.Material.prototype.copy.call(f,n),f.color.copy(n.color),f.map=n.map,f.sizeAttenuation=!1,this.cache.add(l,f)),n=f}else if(e.isLine){l="LineBasicMaterial:"+n.uuid;var h=this.cache.get(l);h||(h=new r.LineBasicMaterial,r.Material.prototype.copy.call(h,n),h.color.copy(n.color),this.cache.add(l,h)),n=h}if(i||o||a||s||u){l="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(l+="specular-glossiness:"),s&&(l+="skinning:"),i&&(l+="vertex-tangents:"),o&&(l+="vertex-colors:"),a&&(l+="flat-shading:"),u&&(l+="morph-targets:"),c&&(l+="morph-normals:");var d=this.cache.get(l);d||(d=n.clone(),s&&(d.skinning=!0),i&&(d.vertexTangents=!0),o&&(d.vertexColors=!0),a&&(d.flatShading=!0),u&&(d.morphTargets=!0),c&&(d.morphNormals=!0),this.cache.add(l,d),this.associations.set(d,this.associations.get(n))),n=d}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),n.normalScale&&!i&&(n.normalScale.y=-n.normalScale.y),n.clearcoatNormalScale&&!i&&(n.clearcoatNormalScale.y=-n.clearcoatNormalScale.y),e.material=n},W.prototype.getMaterialType=function(){return r.MeshStandardMaterial},W.prototype.loadMaterial=function(e){var t,i=this,o=this.json,a=this.extensions,s=o.materials[e],u={},c=s.extensions||{},l=[];if(c[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var f=a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=f.getMaterialType(),l.push(f.extendParams(u,s,i))}else if(c[n.KHR_MATERIALS_UNLIT]){var h=a[n.KHR_MATERIALS_UNLIT];t=h.getMaterialType(),l.push(h.extendParams(u,s,i))}else{var d=s.pbrMetallicRoughness||{};if(u.color=new r.Color(1,1,1),u.opacity=1,Array.isArray(d.baseColorFactor)){var p=d.baseColorFactor;u.color.fromArray(p),u.opacity=p[3]}void 0!==d.baseColorTexture&&l.push(i.assignTexture(u,"map",d.baseColorTexture)),u.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,u.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(l.push(i.assignTexture(u,"metalnessMap",d.metallicRoughnessTexture)),l.push(i.assignTexture(u,"roughnessMap",d.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,u)}))))}!0===s.doubleSided&&(u.side=r.DoubleSide);var v=s.alphaMode||N;return v===j?(u.transparent=!0,u.depthWrite=!1):(u.transparent=!1,v===F&&(u.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&t!==r.MeshBasicMaterial&&(l.push(i.assignTexture(u,"normalMap",s.normalTexture)),u.normalScale=new r.Vector2(1,1),void 0!==s.normalTexture.scale&&u.normalScale.set(s.normalTexture.scale,s.normalTexture.scale)),void 0!==s.occlusionTexture&&t!==r.MeshBasicMaterial&&(l.push(i.assignTexture(u,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(u.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&t!==r.MeshBasicMaterial&&(u.emissive=(new r.Color).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&t!==r.MeshBasicMaterial&&l.push(i.assignTexture(u,"emissiveMap",s.emissiveTexture)),Promise.all(l).then((function(){var o;return o=t===y?a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(u):new t(u),s.name&&(o.name=s.name),o.map&&(o.map.encoding=r.sRGBEncoding),o.emissiveMap&&(o.emissiveMap.encoding=r.sRGBEncoding),G(o,s),i.associations.set(o,{type:"materials",index:e}),s.extensions&&B(a,o,s),o}))},W.prototype.createUniqueName=function(e){for(var t=r.PropertyBinding.sanitizeNodeName(e||""),n=1;this.nodeNamesUsed[t];++n)t=e+"_"+n;return this.nodeNamesUsed[t]=!0,t},W.prototype.loadGeometries=function(e){var t=this,i=this.extensions,o=this.primitiveCache;function a(e){return i[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return X(n,e,t)}))}for(var s=[],u=0,c=e.length;u0&&z(f,i),f.name=n.createUniqueName(i.name||"mesh_"+e),G(f,i),n.assignFinalMaterial(f),u.push(f)}if(1===u.length)return u[0];var v=new r.Group;for(c=0,l=u.length;c1?new r.Group:1===t.length?t[0]:new r.Object3D)!==t[0])for(var u=0,c=t.length;u=0;h--){var d=a[h];"."===d?o(a,h):".."===d?(o(a,h),f++):f&&(o(a,h),f--)}if(!c)for(;f--;f)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var p=a.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"===typeof t||"object"===typeof n){var r=s(t),i=s(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},c=n(28);function l(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function h(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function v(e,t,n,i){var o;"string"===typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function m(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"===typeof e?e(t,n):e;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,i):n.push(i),f({action:r,location:i,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",i=v(e,t,h(),w.location);l.confirmTransitionTo(i,r,n,(function(e){e&&(w.entries[w.index]=i,f({action:r,location:i}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(i())}).call(this,n(46))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(1),i="undefined"!==typeof window&&window.document&&window.document.createElement?r.useLayoutEffect:r.useEffect},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(59);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(13),i=n(3),o=function e(t,n,o){if(i.d.fun(t))return t;if(i.d.arr(t))return e({range:t,output:n,extrapolate:o});if(i.d.str(t.output[0]))return r.createStringInterpolator(t);var a=t,s=a.output,u=a.range||[0,1],c=a.extrapolateLeft||a.extrapolate||"extend",l=a.extrapolateRight||a.extrapolate||"extend",f=a.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,u);return function(e,t,n,r,i,o,a,s,u){var c=u?u(e):e;if(cn){if("identity"===s)return c;"clamp"===s&&(c=n)}if(r===i)return r;if(t===n)return e<=t?r:i;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=o(c),r===-1/0?c=-c:i===1/0?c+=r:c=c*(i-r)+r;return c}(e,u[t],u[t+1],s[t],s[t+1],f,c,l,a.map)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(41);function i(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Object(r.a)(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}},function(e,t,n){"use strict";t.a=function(e){return function(t){e.forEach((function(e){"function"===typeof e?e(t):null!=e&&(e.current=t)}))}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return a}));var r=n(1),i=function(e){return Object(r.useEffect)(e,[])},o=function(){var e=Object(r.useState)(0)[1],t=Object(r.useRef)(!1);return i((function(){return function(){t.current=!0}})),function(){t.current||e({})}};function a(e){var t=Object(r.useRef)(void 0);return Object(r.useEffect)((function(){t.current=e})),t.current}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1?{type:d[i],data:e.substring(1)}:{type:d[i]}:p}i=new Uint8Array(e)[0];var o=a(e,1);return v&&"blob"===n&&(o=new v([o])),{type:d[i],data:o}},t.decodeBase64Packet=function(e,t){var n=d[e.charAt(0)];if(!r)return{type:n,data:{base64:!0,data:e.substr(1)}};var i=r.decode(e.substr(1));return"blob"===t&&v&&(i=new v([i])),{type:n,data:i}},t.encodePayload=function(e,n,r){"function"===typeof n&&(r=n,n=null);var i=o(e);if(n&&i)return v&&!f?t.encodePayloadAsBlob(e,r):t.encodePayloadAsArrayBuffer(e,r);if(!e.length)return r("0:");m(e,(function(e,r){t.encodePacket(e,!!i&&n,!1,(function(e){r(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return r(t.join(""))}))},t.decodePayload=function(e,n,r){if("string"!==typeof e)return t.decodePayloadAsBinary(e,n,r);var i;if("function"===typeof n&&(r=n,n=null),""===e)return r(p,0,1);for(var o,a,s="",u=0,c=e.length;u0;){for(var s=new Uint8Array(i),u=0===s[0],c="",l=1;255!==s[l];l++){if(c.length>310)return r(p,0,1);c+=s[l]}i=a(i,2+c.length),c=parseInt(c);var f=a(i,0,c);if(u)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(v){var h=new Uint8Array(f);f="";for(l=0;l=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128===(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return M(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function k(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,o){return o||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,o){return o||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||I(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);I(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);I(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function V(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(61))},function(e,t,n){var r=n(200),i=n(201),o=String.fromCharCode(30);e.exports={protocol:4,encodePacket:r,encodePayload:function(e,t){var n=e.length,i=new Array(n),a=0;e.forEach((function(e,s){r(e,!1,(function(e){i[s]=e,++a===n&&t(i.join(o))}))}))},decodePacket:i,decodePayload:function(e,t){for(var n=e.split(o),r=[],a=0;ae.priority})),s.splice(~t?t:s.length,0,e))},d=function n(){if(!t)try{m(),e(n)}catch(r){console.error(r)}},p=function(){t&&(t=!1,0==o&&(o=r.now(),e(d)))},v=[];this.setTimeout=function(e,t){var n=r.now()+t,i=a(v,(function(e){return e.time>n})),o={time:n,handler:e,cancel:function e(){var t=v.findIndex((function(t){return t.cancel==e}));t>=0&&v.splice(t,1)}};return v.splice(i,0,o),p(),o};var m=this.advance=function(){var e=r.now();if(c.size&&(c.forEach(h),c.clear()),v.length&&r.batchedUpdates((function(){var t=a(v,(function(t){return t.time>e}));v.splice(0,t).forEach((function(e){return e.handler()}))})),e>o){var t=Math.min(64,e-o);o=e,r.batchedUpdates((function(){s.length&&(r.willAdvance(s),s=s.filter((function(e){return u=e.priority,e.idle||e.advance(t),!e.idle})),u=0),l.size&&(l.forEach((function(t){return t(e)})),l.clear()),f.size&&(n=!0,f.forEach((function(t){return t(e)})),f.clear(),n=!1)}))}};this.start=function(e){u>e.priority?c.add(e):(h(e),p())},this.onFrame=function(e){l.add(e),p()},this.onWrite=function(e){n?e(o):f.add(e)}};function a(e,t){var n=e.findIndex(t);return n<0?e.length:n}}).call(this,n(46))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(188)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,n(46))},function(e,t,n){var r=n(192);function i(t,n,o){return"undefined"!==typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,n){var i=r(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}},i(t,n,o||t)}e.exports=i},function(e,t){e.exports="undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")()},function(e,t,n){"use strict";var r,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),o={},a=0,s=0;function u(e){var t="";do{t=i[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function c(){var e=u(+new Date);return e!==r?(a=0,r=e):e+"."+u(a++)}for(;s<64;s++)o[i[s]]=s;c.encode=u,c.decode=function(e){var t=0;for(s=0;s=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(202)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,n(46))},function(e,t){var n=[].slice;e.exports=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}},function(e,t){e.exports=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(228)},function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n255?255:t}function w(e){return(parseFloat(e)%360+360)%360/360}function _(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function x(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function M(e){var t=function(e){var t;return"number"===typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=v.exec(e))?parseInt(t[1]+"ff",16)>>>0:g.colorNames&&void 0!==g.colorNames[e]?g.colorNames[e]:(t=c.exec(e))?(b(t[1])<<24|b(t[2])<<16|b(t[3])<<8|255)>>>0:(t=l.exec(e))?(b(t[1])<<24|b(t[2])<<16|b(t[3])<<8|_(t[4]))>>>0:(t=d.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=m.exec(e))?parseInt(t[1],16)>>>0:(t=p.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=f.exec(e))?(255|y(w(t[1]),x(t[2]),x(t[3])))>>>0:(t=h.exec(e))?(y(w(t[1]),x(t[2]),x(t[3]))|_(t[4]))>>>0:null}(e);return null===t?e:"rgba("+((4278190080&(t=t||0))>>>24)+", "+((16711680&t)>>>16)+", "+((65280&t)>>>8)+", "+(255&t)/255+")"}var S,E=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,T=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,A=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,k=function(e,t,n,r,i){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+i+")"},C=function(e){S||(S=g.colorNames?new RegExp("("+Object.keys(g.colorNames).join("|")+")","g"):/^\b$/);var t=e.output.map((function(e){return Object(i.c)(e).replace(T,M).replace(S,M)})),n=t.map((function(e){return e.match(E).map(Number)})),a=n[0].map((function(e,t){return n.map((function(e){if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]}))})).map((function(t){return Object(o.a)(r(r({},e),{output:t}))}));return function(e){var n=0;return t[0].replace(E,(function(){return String(a[n++](e))})).replace(A,k)}}},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return o}));var i=n(22);function o(e,t){return!t||"object"!==r(t)&&"function"!==typeof t?Object(i.a)(e):t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var r=n(10),i=n(6),o=n(4),a=n(7),s=n(8),u=n(14),c=n(34),l=n(25),f=n(76),h=n(143),d=n(18),p=n(3),v=n(17),m=/^--/;function g(e,t){return null==t||"boolean"===typeof t||""===t?"":"number"!==typeof t||0===t||m.test(e)||b.hasOwnProperty(e)&&b[e]?(""+t).trim():t+"px"}var y={};var b={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},w=["Webkit","Ms","Moz","O"];b=Object.keys(b).reduce((function(e,t){return w.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),b);var _=/^(matrix|translate|scale|rotate|skew)/,x=/^(translate)/,M=/^(rotate|skew)/,S=function(e,t){return p.d.num(e)&&0!==e?e+t:e},E=function e(t,n){return p.d.arr(t)?t.every((function(t){return e(t,n)})):p.d.num(t)?t===n:parseFloat(t)===n},T=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){Object(o.a)(this,n);var r=e.x,a=e.y,s=e.z,c=Object(u.a)(e,["x","y","z"]),l=[],f=[];return(r||a||s)&&(l.push([r||0,a||0,s||0]),f.push((function(e){return["translate3d("+e.map((function(e){return S(e,"px")})).join(",")+")",E(e,0)]}))),Object(p.b)(c,(function(e,t){if("transform"===t)l.push([e||""]),f.push((function(e){return[e,""===e]}));else if(_.test(t)){if(delete c[t],p.d.und(e))return;var n=x.test(t)?"px":M.test(t)?"deg":"";l.push(Object(p.h)(e)),f.push("rotate3d"===t?function(e){var t=Object(i.a)(e,4),r=t[0],o=t[1],a=t[2],s=t[3];return["rotate3d("+r+","+o+","+a+","+S(s,n)+")",E(s,0)]}:function(e){return[t+"("+e.map((function(e){return S(e,n)})).join(",")+")",E(e,t.startsWith("scale")?1:0)]})}})),l.length&&(c.transform=new A(l,f)),t.call(this,c)}return n}(d.b),A=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r){var i;return Object(o.a)(this,n),(i=t.call(this)).inputs=e,i.transforms=r,i._value=null,i._children=new Set,i}return Object(r.a)(n,[{key:"get",value:function(){return this._value||(this._value=this._get())}},{key:"_get",value:function(){var e=this,t="",n=!0;return Object(p.b)(this.inputs,(function(r,o){var a=Object(v.c)(r[0]),s=e.transforms[o](p.d.arr(a)?a:r.map(v.c)),u=Object(i.a)(s,2),c=u[0],l=u[1];t+=" "+c,n=n&&l})),n?"none":t}},{key:"addChild",value:function(e){var t=this;this._children.size||Object(p.b)(this.inputs,(function(e){return Object(p.b)(e,(function(e){var n=Object(v.b)(e);n&&n.addChild(t)}))})),this._children.add(e)}},{key:"removeChild",value:function(e){var t=this;this._children.delete(e),this._children.size||Object(p.b)(this.inputs,(function(e){return Object(p.b)(e,(function(e){var n=Object(v.b)(e);n&&n.removeChild(t)}))}))}},{key:"onParentChange",value:function(e){"change"==e.type&&(this._value=null),Object(p.b)(this._children,(function(t){t.onParentChange(e)}))}}]),n}(v.a);c.Globals.assign({colorNames:h.a,createStringInterpolator:f.a,batchedUpdates:l.unstable_batchedUpdates});var k=Object(d.e)(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;var n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,r=t,i=r.style,o=r.children,a=r.scrollTop,s=r.scrollLeft,l=Object(u.a)(r,["style","children","scrollTop","scrollLeft"]),f=Object.values(l),h=Object.keys(l).map((function(t){return n||e.hasAttribute(t)?t:y[t]||(y[t]=t.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})))}));c.Globals.frameLoop.onWrite((function(){for(var t in void 0!==o&&(e.textContent=o),i)if(i.hasOwnProperty(t)){var n=g(t,i[t]);"float"===t?t="cssFloat":m.test(t)?e.style.setProperty(t,n):e.style[t]=n}h.forEach((function(t,n){e.setAttribute(t,f[n])})),void 0!==a&&(e.scrollTop=a),void 0!==s&&(e.scrollLeft=s)}))},createAnimatedStyle:function(e){return new T(e)},getComponentProps:function(e){return Object(u.a)(e,["scrollTop","scrollLeft"])}}).animated},,,function(e,t,n){var r=n(98);e.exports=function(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"useTransition",(function(){return Le}));var r=n(22),i=n(6),o=n(16),a=n.n(o),s=n(19),u=n(15),c=n(10),l=n(7),f=n(8),h=n(149),d=n(26),p=n(43),v=n(4),m=n(20),g=n(40),y=n(3),b=n(17),w=n(34),_=n(45),x=n(42),M=n(5),S=n(1),E=n(18),T=n(13),A=n(93),k=n(94),C=n(14),R=n(76);var O=Object(M.a)(Object(M.a)({},{tension:170,friction:26}),{},{mass:1,damping:1,easing:function(e){return e},clamp:!1}),P=function e(){Object(v.a)(this,e),this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,O)};function I(e,t){if(y.d.und(t.decay)){var n=!y.d.und(t.tension)||!y.d.und(t.friction);!n&&y.d.und(t.frequency)&&y.d.und(t.damping)&&y.d.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var L=[],D=function e(){Object(v.a)(this,e),this.changed=!1,this.values=L,this.toValues=null,this.fromValues=L,this.to=void 0,this.from=void 0,this.config=new P,this.immediate=!1,this.onStart=void 0,this.onChange=void 0,this.onRest=[]},N=function(e,t){return Object(A.b)(e,t||[{}])};function F(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=z;e.default&&!0!==e.default&&(e=e.default,r=Object.keys(e));var i,o=Object(p.a)(r);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=e[a];y.d.und(s)||t.includes(a)||(n[a]=s)}}catch(u){o.e(u)}finally{o.f()}return n},z=["pause","cancel","config","immediate","onDelayEnd","onProps","onStart","onChange","onRest"],V={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onDelayEnd:1,onProps:1,onStart:1,onChange:1,onRest:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,keys:1,callId:1,parentId:1};function H(e){var t=function(e){var t={},n=0;if(Object(y.b)(e,(function(e,r){V[r]||(t[r]=e,n++)})),n)return t}(e);if(t){var n={to:t};return Object(y.b)(e,(function(e,r){return r in t||(n[r]=e)})),n}return Object(M.a)({},e)}function W(e){var t=Object(b.b)(e);return t?W(t.get()):y.d.arr(e)?e.map(W):Object(y.e)(e)?Object(T.createStringInterpolator)({range:[0,1],output:[e,e]})(1):e}function X(e,t){var n=t.key,r=t.props,i=t.state,o=t.actions;return new Promise((function(t,a){var s,u,c=!1,l=j(r.cancel,n);function f(){i.resumeQueue.add(h),u.cancel(),s=u.time-w.Globals.now()}function h(){s>0?(i.pauseQueue.add(f),u=w.Globals.frameLoop.setTimeout(d,s)):d()}function d(){i.pauseQueue.delete(f),e<=(i.cancelId||0)&&(l=!0);try{o.start(Object(M.a)(Object(M.a)({},r),{},{callId:e,delay:s,cancel:l,pause:c}),t)}catch(n){a(n)}}l?d():(s=F(r.delay||0,n),(c=j(r.pause,n))?(i.resumeQueue.add(h),o.pause()):(o.resume(),h()))}))}var q=function(e,t){return 1==t.length?t[0]:t.some((function(e){return e.cancelled}))?Q(e):t.every((function(e){return e.noop}))?Y(e):$(e,t.every((function(e){return e.finished})))},Y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.get();return{value:t,noop:!0,finished:!0,target:e}},$=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.get();return{value:n,finished:t,target:e}},Q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.get();return{value:t,cancelled:!0,target:e}};function K(e,t,n,r){return Z.apply(this,arguments)}function Z(){return(Z=Object(d.a)(a.a.mark((function e(t,n,r,i){var o,s,u,c,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.pause){e.next=3;break}return e.next=3,new Promise((function(e){r.resumeQueue.add(e)}));case 3:if(o=n.callId,s=n.parentId,u=n.onRest,c=r.asyncTo,l=r.promise,s||t!==c||n.reset){e.next=7;break}return e.abrupt("return",l);case 7:return e.abrupt("return",r.promise=Object(d.a)(a.a.mark((function e(){var f,h,v,m,g,b,w,_;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.asyncId=o,r.asyncTo=t,f=G(n,["onRest"]),m=new Promise((function(e,t){return h=e,v=t})),g=function(e){var t=o<=(r.cancelId||0)&&Q(i)||o!==r.asyncId&&$(i,!1);if(t)throw e.result=t,e},b=function(e){return function(){var t=function(e){throw e instanceof ee&&v(e),e};try{return e.apply(void 0,arguments).catch(t)}catch(n){t(n)}}}((function(e,t){var n=new ee;g(n);var s=y.d.obj(e)?Object(M.a)({},e):Object(M.a)(Object(M.a)({},t),{},{to:e});return s.parentId=o,Object(y.b)(f,(function(e,t){y.d.und(s[t])&&(s[t]=e)})),i.start(s).then(function(){var e=Object(d.a)(a.a.mark((function e(t){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g(n),!i.is("PAUSED")){e.next=4;break}return e.next=4,new Promise((function(e){r.resumeQueue.add(e)}));case 4:return e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())})),e.prev=7,y.d.arr(t)?_=function(){var e=Object(d.a)(a.a.mark((function e(t){var n,r,i;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Object(p.a)(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return i=r.value,e.next=7,b(i);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})));return function(t){return e.apply(this,arguments)}}()(t):y.d.fun(t)&&(_=Promise.resolve(t(b,i.stop.bind(i)))),e.next=11,Promise.all([_.then(h),m]);case 11:w=$(i,!0),e.next=21;break;case 14:if(e.prev=14,e.t0=e.catch(7),!(e.t0 instanceof ee)){e.next=20;break}w=e.t0.result,e.next=21;break;case 20:throw e.t0;case 21:return e.prev=21,o==r.asyncId&&(r.asyncId=s,r.asyncTo=s?c:void 0,r.promise=s?l:void 0),e.finish(21);case 24:return y.d.fun(u)&&Object(T.batchedUpdates)((function(){u(w)})),e.abrupt("return",w);case 26:case"end":return e.stop()}}),e,null,[[7,14,21,24]])})))());case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(e,t){e.cancelId=t,e.asyncId=e.asyncTo=e.promise=void 0}var ee=function(e){Object(l.a)(n,e);var t=Object(f.a)(n);function n(){var e;return Object(v.a)(this,n),(e=t.call(this,"An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")).result=void 0,e}return n}(Object(h.a)(Error)),te=function(e){return e instanceof re},ne=1,re=function(e){Object(l.a)(n,e);var t=Object(f.a)(n);function n(){var e;Object(v.a)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o1&&void 0!==arguments[1]&&arguments[1];this._emit({type:"change",parent:this,value:e,idle:t})}},{key:"_onPriorityChange",value:function(e){this.idle||T.frameLoop.start(this),this._emit({type:"priority",parent:this,priority:e})}},{key:"_emit",value:function(e){Object(y.b)(Array.from(this._children),(function(t){t.onParentChange(e)}))}},{key:"priority",get:function(){return this._priority},set:function(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}}]),n}(b.a),ie="CREATED",oe="IDLE",ae="ACTIVE",se="PAUSED",ue="DISPOSED",ce=function(e){Object(l.a)(n,e);var t=Object(f.a)(n);function n(e,r){var i;if(Object(v.a)(this,n),(i=t.call(this)).key=void 0,i.animation=new D,i.queue=void 0,i._phase=ie,i._state={pauseQueue:new Set,resumeQueue:new Set},i._defaultProps={},i._lastCallId=0,i._lastToId=0,!y.d.und(e)||!y.d.und(r)){var o=y.d.obj(e)?Object(M.a)({},e):Object(M.a)(Object(M.a)({},r),{},{from:e});o.default=!0,i.start(o)}return i}return Object(c.a)(n,[{key:"advance",value:function(e){var t=this,n=!0,r=!1,i=this.animation,o=i.config,a=i.toValues,s=Object(E.g)(i.to);if(!s){var u=Object(b.b)(i.to);u&&(a=Object(y.h)(u.get()))}return i.values.forEach((function(u,c){if(!u.done){var l=s?s[c].lastPosition:a[c],f=i.immediate,h=l;if(!f){if(h=u.lastPosition,o.tension<=0)return void(u.done=!0);var d,p=u.elapsedTime+=e,v=i.fromValues[c],m=null!=u.v0?u.v0:u.v0=y.d.arr(o.velocity)?o.velocity[c]:o.velocity;if(y.d.und(o.duration))if(o.decay){var g=!0===o.decay?.998:o.decay,b=Math.exp(-(1-g)*p);h=v+m/(1-g)*(1-b),f=Math.abs(u.lastPosition-h)<.1,d=m*b}else{d=null==u.lastVelocity?m:u.lastVelocity;for(var w=o.precision||(v==l?.005:Math.min(1,.001*Math.abs(l-v))),_=o.restVelocity||w/10,x=o.clamp?0:o.bounce,M=!y.d.und(x),S=v==l?u.v0>0:v_||!(f=Math.abs(l-h)<=w));++T){M&&(h==l||h>l==S)&&(d=-d*x,h=l),h+=1*(d+=1*((1e-6*-o.tension*(h-l)+.001*-o.friction*d)/o.mass))}}else{var A=o.progress||0;o.duration<=0?A=1:A+=(1-A)*Math.min(1,p/o.duration),d=((h=v+o.easing(A)*(l-v))-u.lastPosition)/e,f=1==A}u.lastVelocity=d,Number.isNaN(h)&&(console.warn("Got NaN while animating:",t),f=!0)}s&&!s[c].done&&(f=!1),f?u.done=!0:n=!1,u.setValue(h,o.round)&&(r=!0)}})),n?this.finish():r&&this._onChange(this.get()),n}},{key:"is",value:function(e){return this._phase==e}},{key:"set",value:function(e){var t=this;return Object(T.batchedUpdates)((function(){if(t._focus(e),t._set(e)&&!t.is(ae))return t._onChange(t.get(),!0);t._stop()})),this}},{key:"pause",value:function(){le(this,"pause"),this.is(se)||(this._phase=se,Object(y.c)(this._state.pauseQueue,(function(e){return e()})))}},{key:"resume",value:function(){le(this,"resume"),this.is(se)&&(this._start(),Object(y.c)(this._state.resumeQueue,(function(e){return e()})))}},{key:"finish",value:function(e){var t=this;if(this.resume(),this.is(ae)){var n=this.animation;!n.config.decay&&y.d.und(e)&&(e=n.to),y.d.und(e)||this._set(e),Object(T.batchedUpdates)((function(){n.changed||(n.changed=!0,n.onStart&&n.onStart(t)),t._stop()}))}return this}},{key:"update",value:function(e){return le(this,"update"),(this.queue||(this.queue=[])).push(e),this}},{key:"start",value:function(){var e=Object(d.a)(a.a.mark((function e(t,n){var r,i,o=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(this,"start"),y.d.und(t)?(r=this.queue||[],this.queue=[]):r=[y.d.obj(t)?t:Object(M.a)(Object(M.a)({},n),{},{to:t})],e.next=4,Promise.all(r.map((function(e){return o._update(e)})));case 4:return i=e.sent,e.abrupt("return",q(this,i));case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"stop",value:function(e){var t=this;return this.is(ue)||(J(this._state,this._lastCallId),this._focus(this.get()),Object(T.batchedUpdates)((function(){return t._stop(e)}))),this}},{key:"reset",value:function(){this._update({reset:!0})}},{key:"dispose",value:function(){this.is(ue)||(this.animation&&(this.animation.onRest=[]),this.stop(),this._phase=ue)}},{key:"onParentChange",value:function(e){Object(s.a)(Object(u.a)(n.prototype),"onParentChange",this).call(this,e),"change"==e.type?this.is(ae)||(this._reset(),this.is(se)||this._start()):"priority"==e.type&&(this.priority=e.priority+1)}},{key:"_prepareNode",value:function(e){var t=e.to,n=e.from,r=e.reverse,i=this.key||"",o={to:t=!y.d.obj(t)||Object(b.b)(t)?t:t[i],from:n=!y.d.obj(n)||Object(b.b)(n)?n:n[i]};if(this.is(ie)){if(r){var a=[n,t];t=a[0],n=a[1]}n=Object(b.c)(n);var s=this._updateNode(y.d.und(n)?Object(b.c)(t):n);s&&!y.d.und(n)&&s.setValue(n)}return o}},{key:"_updateNode",value:function(e){var t=Object(E.f)(this);if(!y.d.und(e)){var n=this._getNodeType(e);t&&t.constructor===n||Object(E.h)(this,t=n.create(e))}return t}},{key:"_getNodeType",value:function(e){var t=Object(E.f)(e);return t?t.constructor:y.d.arr(e)?E.a:Object(y.e)(e)?E.c:E.d}},{key:"_update",value:function(e,t){var n=this,r=this._defaultProps,i=function(t){var n=B(e,t);y.d.und(n)||(r[t]=n),r[t]&&(e[t]=r[t])};i("cancel"),i("pause");var o=this._prepareNode(e);return X(++this._lastCallId,{key:this.key,props:e,state:this._state,actions:{pause:this.pause.bind(this),resume:this.resume.bind(this),start:this._merge.bind(this,o)}}).then((function(r){if(e.loop&&r.finished&&(!t||!r.noop)){var i=de(e);if(i)return n._update(i,!0)}return r}))}},{key:"_merge",value:function(e,t,n){if(t.cancel)return this.stop(!0),n(Q(this));var r=this.key,i=this.animation,o=this._defaultProps,a=!y.d.und(e.to),s=!y.d.und(e.from);if(a||s){if(!(t.callId>this._lastToId))return n(Q(this));this._lastToId=t.callId}var u=function(e){return y.d.und(t[e])?o[e]:t[e]},c=fe(u("onDelayEnd"),r);c&&c(t,this),t.default&&function(e,t,n){G(t,n,e)}(o,t,["pause","cancel"]);var l=i.to,f=i.from,h=e.to,d=void 0===h?l:h,p=e.from,v=void 0===p?f:p;if(s&&!a&&(d=v),t.reverse){var m=[v,d];d=m[0],v=m[1]}var g=!Object(y.f)(v,f);g&&(i.from=v);var w=!Object(y.f)(d,l);w&&this._focus(d);var _=Object(b.b)(d),x=Object(b.b)(v);x&&(v=x.get());var S=y.d.arr(t.to)||y.d.fun(t.to),A=i.config,k=A.decay,C=A.velocity;t.config&&!S&&function(e,t,n){for(var r in n&&(I(n=Object(M.a)({},n),t),t=Object(M.a)(Object(M.a)({},n),t)),I(e,t),Object.assign(e,t),O)null==e[r]&&(e[r]=O[r]);var i=e.mass,o=e.frequency,a=e.damping;y.d.und(o)||(o<.01&&(o=.01),a<0&&(a=0),e.tension=Math.pow(2*Math.PI/o,2)*i,e.friction=4*Math.PI*a*i/o)}(A,F(t.config,r),t.config!==o.config?F(o.config,r):void 0);var R=Object(E.f)(this);if(!R||y.d.und(d))return n($(this,!0));var P=y.d.und(t.reset)?s&&!t.default:!y.d.und(v)&&j(t.reset,r),L=P?v:this.get(),D=W(d),N=y.d.num(D)||y.d.arr(D)||Object(y.e)(D),U=!S&&(!N||j(o.immediate||t.immediate,r));if(w)if(U)R=this._updateNode(D);else{var B=this._getNodeType(d);if(B!==R.constructor)throw Error("Cannot animate between "+R.constructor.name+" and "+B.name+', as the "to" prop suggests')}var z=R.constructor,V=!!_,H=!1;if(!V){var X=P||this.is(ie)&&g;(w||X)&&(V=!(H=Object(y.f)(W(L),D))),Object(y.f)(A.decay,k)&&Object(y.f)(A.velocity,C)||(V=!0)}if(H&&this.is(ae)&&(i.changed&&!P?V=!0:V||this._stop()),!S){(V||Object(b.b)(l))&&(i.values=R.getPayload(),i.toValues=_?null:z==E.c?[1]:Object(y.h)(D)),i.immediate=U,i.onStart=fe(u("onStart"),r),i.onChange=fe(u("onChange"),r);var q=i.onRest,Z=P&&!t.onRest?q[0]||y.g:he(fe(u("onRest"),r),this);if(V){i.onRest=[Z,he(n,this)];var J=P?0:1;J1&&void 0!==arguments[1]&&arguments[1],r=this.animation;r.changed||t||(r.changed=!0,r.onStart&&r.onStart(this)),r.onChange&&r.onChange(e,this),Object(s.a)(Object(u.a)(n.prototype),"_onChange",this).call(this,e,t)}},{key:"_reset",value:function(){var e=this.animation;Object(E.f)(this).reset(e.to),this.is(ae)||(e.changed=!1),e.immediate||(e.fromValues=e.values.map((function(e){return e.lastPosition}))),Object(s.a)(Object(u.a)(n.prototype),"_reset",this).call(this)}},{key:"_start",value:function(){this.is(ae)||(this._phase=ae,Object(s.a)(Object(u.a)(n.prototype),"_start",this).call(this),T.skipAnimation?this.finish():T.frameLoop.start(this))}},{key:"_stop",value:function(e){if(this.resume(),this.is(ae)){this._phase=oe,this._onChange(this.get(),!0);var t=this.animation;Object(y.b)(t.values,(function(e){e.done=!0}));var n=t.onRest;n.length&&(t.onRest=[t.toValues?y.g:n[0]],t.changed||(n[0]=y.g),Object(y.b)(n,(function(t){return t(e)})))}}},{key:"idle",get:function(){return!this.is(ae)&&!this._state.asyncTo}},{key:"goal",get:function(){return Object(b.c)(this.animation.to)}},{key:"velocity",get:function(){var e=Object(E.f)(this);return e instanceof E.d?e.lastVelocity||0:e.getPayload().map((function(e){return e.lastVelocity||0}))}}]),n}(re);function le(e,t){if(e.is(ue))throw Error('Cannot call "'+t+'" of disposed "'+e.constructor.name+'" object')}function fe(e,t){return y.d.fun(e)?e:t&&e?e[t]:void 0}var he=function(e,t){var n=t.animation.to;return e?function(r){if(r)e(Q(t));else{var i=W(n),o=W(t.get()),a=Object(y.f)(o,i);e($(t,a))}}:y.g};function de(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.loop,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.to,r=F(t);if(r){var i=!0!==r&&H(r),o=(i||e).reverse,a=!i||i.reset;return pe(Object(M.a)(Object(M.a)({},e),{},{loop:t,default:!1,to:!o||y.d.arr(n)||y.d.fun(n)?n:void 0,from:a?e.from:void 0,reset:a},i))}}function pe(e){var t=e=H(e),n=t.to,r=t.from,i=new Set;return r?ve(r,i):delete e.from,y.d.obj(n)?ve(n,i):n||delete e.to,e.keys=i.size?Array.from(i):null,e}function ve(e,t){Object(y.b)(e,(function(e,n){return null!=e&&t.add(n)}))}var me=["onStart","onChange","onRest"],ge=1,ye=function(){function e(t,n){Object(v.a)(this,e),this.id=ge++,this.springs={},this.queue=[],this._flush=void 0,this._initialProps=void 0,this._phase=ie,this._lastAsyncId=0,this._active=new Set,this._state={pauseQueue:new Set,resumeQueue:new Set},this._events={onStart:new Set,onChange:new Set,onRest:new Map},this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),t&&this.start(t)}return Object(c.a)(e,[{key:"is",value:function(e){return this._phase==e}},{key:"get",value:function(){var e={};return this.each((function(t,n){return e[n]=t.get()})),e}},{key:"update",value:function(e){return e&&this.queue.push(pe(e)),this}},{key:"start",value:function(e){var t=e?Object(y.h)(e).map(pe):this.queue;return e||(this.queue=[]),this._flush?this._flush(this,t):(Ee(this,t),be(this,t))}},{key:"stop",value:function(e){if(y.d.und(e))this.each((function(e){return e.stop()})),J(this._state,this._lastAsyncId);else{var t=this.springs;Object(y.b)(Object(y.h)(e),(function(e){return t[e].stop()}))}return this}},{key:"pause",value:function(e){if(y.d.und(e))this.each((function(e){return e.pause()}));else{var t=this.springs;Object(y.b)(Object(y.h)(e),(function(e){return t[e].pause()}))}return this}},{key:"resume",value:function(e){if(y.d.und(e))this.each((function(e){return e.resume()}));else{var t=this.springs;Object(y.b)(Object(y.h)(e),(function(e){return t[e].resume()}))}return this}},{key:"reset",value:function(){return this.each((function(e){return e.reset()})),this}},{key:"each",value:function(e){Object(y.b)(this.springs,e)}},{key:"dispose",value:function(){this._state.asyncTo=void 0,this.each((function(e){return e.dispose()})),this.springs={}}},{key:"_onFrame",value:function(){var e=this,t=this._events,n=t.onStart,r=t.onChange,o=t.onRest,a=this._active.size>0;a&&this._phase!=ae&&(this._phase=ae,Object(y.c)(n,(function(t){return t(e)})));var s=(r.size||!a&&o.size)&&this.get();Object(y.c)(r,(function(e){return e(s)})),a||(this._phase=oe,Object(y.c)(o,(function(e){var t=Object(i.a)(e,2),n=t[0],r=t[1];r.value=s,n(r)})))}},{key:"onParentChange",value:function(e){"change"==e.type&&(this._active[e.idle?"delete":"add"](e.parent),T.frameLoop.onFrame(this._onFrame))}},{key:"idle",get:function(){return!this._state.asyncTo&&Object.values(this.springs).every((function(e){return e.idle}))}}]),e}();function be(e,t){return Promise.all(t.map((function(t){return we(e,t)}))).then((function(t){return q(e,t)}))}function we(e,t,n){var r=t.to,i=t.loop,o=t.onRest;i&&(t.loop=!1);var a=y.d.arr(r)||y.d.fun(r)?r:void 0;a?(t.to=void 0,t.onRest=void 0):Object(y.b)(me,(function(n){var r=t[n];if(y.d.fun(r)){var i=e._events[n];i instanceof Set?t[n]=function(){return i.add(r)}:t[n]=function(e){var t=e.finished,n=e.cancelled,o=i.get(r);o?(t||(o.finished=!1),n&&(o.cancelled=!0)):i.set(r,{value:null,finished:t,cancelled:n})}}}));var s=(t.keys||Object.keys(e.springs)).map((function(n){return e.springs[n].start(t)})),u=e._state;return a?s.push(X(++e._lastAsyncId,{props:t,state:u,actions:{pause:y.g,resume:y.g,start:function(t,n){t.onRest=o,t.cancel?function(e,t){return!y.d.und(B(e,t))}(t,"cancel")&&J(u,t.callId):n(K(a,t,u,e))}}})):t.keys||!0!==t.cancel||J(u,e._lastAsyncId),Promise.all(s).then((function(o){var a=q(e,o);if(i&&a.finished&&(!n||!a.noop)){var s=de(t,i,r);if(s)return Ee(e,[s]),we(e,s,!0)}return a}))}function _e(e,t){var n=Object(M.a)({},e.springs);return t&&Object(y.b)(Object(y.h)(t),(function(e){y.d.und(e.keys)&&(e=pe(e)),y.d.obj(e.to)||(e=Object(M.a)(Object(M.a)({},e),{},{to:void 0})),Se(n,e,(function(e){return Me(e)}))})),n}function xe(e,t){Object(y.b)(t,(function(t,n){e.springs[n]||(e.springs[n]=t,t.addChild(e))}))}function Me(e,t){var n=new ce;return n.key=e,t&&n.addChild(t),n}function Se(e,t,n){t.keys&&Object(y.b)(t.keys,(function(r){(e[r]||(e[r]=n(r)))._prepareNode(t)}))}function Ee(e,t){Object(y.b)(t,(function(t){Se(e.springs,t,(function(t){return Me(t,e)}))}))}var Te=Object(S.createContext)({}),Ae=function(e){var t=e.children,n=Object(C.a)(e,["children"]),r=Object(S.useContext)(Te);n=N((function(){return Object(M.a)(Object(M.a)({},r),n)}),[r,n.pause,n.cancel,n.immediate,n.config]);var i=Te.Provider;return Object(S.createElement)(i,{value:n},t)};Ae.Provider=Te.Provider,Ae.Consumer=Te.Consumer;var ke=function(){return Object(S.useContext)(Te)},Ce=function(e){return{get controllers(){return e()},update:function(t){return Object(y.b)(e(),(function(e,n){e.update(U(t,n,e))})),this},start:function(t){return Object(d.a)(a.a.mark((function n(){var r;return a.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all(e().map((function(e,n){var r=U(t,n,e);return e.start(r)})));case 2:return r=n.sent,n.abrupt("return",{value:r.map((function(e){return e.value})),finished:r.every((function(e){return e.finished}))});case 4:case"end":return n.stop()}}),n)})))()},stop:function(t){return Object(y.b)(e(),(function(e){return e.stop(t)}))},pause:function(t){return Object(y.b)(e(),(function(e){return e.pause(t)}))},resume:function(t){return Object(y.b)(e(),(function(e){return e.resume(t)}))}}};var Re="mount",Oe="enter",Pe="update",Ie="leave";function Le(e,t,n){var r=t.ref,i=t.reset,o=t.sort,a=t.trail,s=void 0===a?0:a,u=t.expires,c=void 0===u||u,l=Object(y.h)(e),f=[],h=De(l,t),d=Object(S.useRef)(null),p=i?null:d.current;Object(g.a)((function(){d.current=f})),Object(_.b)((function(){return function(){return Object(y.b)(d.current,(function(e){e.expired&&clearTimeout(e.expirationId),e.ctrl.dispose()}))}}));var v=[];if(p&&Object(y.b)(p,(function(e,t){e.expired?clearTimeout(e.expirationId):~(t=v[t]=h.indexOf(e.key))&&(f[t]=e)})),Object(y.b)(l,(function(e,t){f[t]||(f[t]={key:h[t],item:e,phase:Re,ctrl:new ye})})),v.length){var m=-1;Object(y.b)(v,(function(e,n){var r=p[n];~e?(m=f.indexOf(r),f[m]=Object(M.a)(Object(M.a)({},r),{},{item:l[e]})):t.leave&&f.splice(++m,0,r)}))}y.d.fun(o)&&f.sort((function(e,t){return o(e.item,t.item)}));var b=-s,w=Object(_.a)(),x=G(t),E=new Map;Object(y.b)(f,(function(e,n){var r,i,o=e.key,a=e.phase;if(a==Re)r=t.enter,i=Oe;else{var u=h.indexOf(o)<0;if(a!=Ie)if(u)r=t.leave,i=Ie;else{if(!(r=t.update))return;i=Pe}else{if(u)return;r=t.enter,i=Oe}}if(r=F(r,e.item,n),!(r=y.d.obj(r)?H(r):{to:r}).config){var l=t.config||x.config;r.config=F(l,e.item,n)}var f=Object(M.a)(Object(M.a)({},x),{},{delay:b+=s,reset:!1},r);if(i==Oe&&y.d.und(f.from)){var v=y.d.und(t.initial)||p?t.from:t.initial;f.from=F(v,e.item,n)}var m=f.onRest;f.onRest=function(e){var t=d.current,n=t.find((function(e){return e.key===o}));if(n)if(y.d.fun(m)&&m(e,n),e.cancelled&&n.phase!=Pe)n.phase=a;else if(n.ctrl.idle){var r=t.every((function(e){return e.ctrl.idle}));if(n.phase==Ie){var i=F(c,n.item);if(!1!==i){var s=!0===i?0:i;if(n.expired=!0,!r&&s>0)return void(s<=2147483647&&(n.expirationId=setTimeout(w,s)))}}r&&t.some((function(e){return e.expired}))&&w()}};var g=_e(e.ctrl,f);E.set(e,{phase:i,springs:g,payload:f})}));var T=ke();Object(g.a)((function(){Object(y.b)(f,(function(e){e.ctrl.start({default:T})}))}),[T]);var A=Object(S.useMemo)((function(){return Ce((function(){return d.current.map((function(e){return e.ctrl}))}))}),[]);Object(S.useImperativeHandle)(r,(function(){return A})),Object(g.a)((function(){Object(y.b)(E,(function(e,t){var n=e.phase,i=e.springs,o=e.payload;xe(t.ctrl,i),T.cancel||(t.phase=n,n==Oe&&t.ctrl.start({default:T}),t.ctrl[r?"update":"start"](o))}))}),i?void 0:n);var k=function(e){return Object(S.createElement)(S.Fragment,null,f.map((function(t,n){var r=(E.get(t)||t.ctrl).springs,i=e(Object(M.a)({},r),t.item,t,n);return i&&i.type?Object(S.createElement)(i.type,Object(M.a)({},i.props,{key:y.d.str(t.key)||y.d.num(t.key)?t.key:t.ctrl.id,ref:i.ref})):i})))};return 3==arguments.length?[k,A.start,A.stop]:k}function De(e,t){var n=t.key,r=t.keys,i=void 0===r?n:r;return y.d.und(i)?e:y.d.fun(i)?e.map(i):Object(y.h)(i)}var Ne=function(e){Object(l.a)(n,e);var t=Object(f.a)(n);function n(e,i){var o;Object(v.a)(this,n),(o=t.call(this)).source=e,o.key=void 0,o.idle=!0,o.calc=void 0,o.calc=x.a.apply(void 0,Object(m.a)(i));var a=o._get(),s=y.d.arr(a)?E.a:E.d;return Object(E.h)(Object(r.a)(o),s.create(a)),o}return Object(c.a)(n,[{key:"advance",value:function(e){var t=this._get(),n=this.get();Object(y.f)(t,n)||(Object(E.f)(this).setValue(t),this._onChange(t,this.idle))}},{key:"_get",value:function(){var e=y.d.arr(this.source)?this.source.map((function(e){return e.get()})):Object(y.h)(this.source.get());return this.calc.apply(this,Object(m.a)(e))}},{key:"_reset",value:function(){Object(y.b)(Object(E.g)(this),(function(e){return e.reset()})),Object(s.a)(Object(u.a)(n.prototype),"_reset",this).call(this)}},{key:"_start",value:function(){this.idle=!1,Object(s.a)(Object(u.a)(n.prototype),"_start",this).call(this),T.skipAnimation?(this.idle=!0,this.advance()):T.frameLoop.start(this)}},{key:"_attach",value:function(){var e=this,t=!0,n=1;Object(y.b)(Object(y.h)(this.source),(function(r){te(r)&&(r.idle||(t=!1),n=Math.max(n,r.priority+1)),r.addChild(e)})),this.priority=n,t||(this._reset(),this._start())}},{key:"_detach",value:function(){var e=this;Object(y.b)(Object(y.h)(this.source),(function(t){t.removeChild(e)})),this.idle=!0}},{key:"onParentChange",value:function(e){"start"==e.type?this.advance():"change"==e.type?this.idle?this.advance():e.idle&&(this.idle=Object(y.h)(this.source).every((function(e){return!1!==e.idle})),this.idle&&(this.advance(),Object(y.b)(Object(E.g)(this),(function(e){e.done=!0})))):"priority"==e.type&&(this.priority=Object(y.h)(this.source).reduce((function(e,t){return Math.max(e,(t.priority||0)+1)}),0)),Object(s.a)(Object(u.a)(n.prototype),"onParentChange",this).call(this,e)}}]),n}(re);w.Globals.assign({createStringInterpolator:R.a,to:function(e,t){return new Ne(e,t)}})},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.matchesSelector=f,t.matchesSelectorAndParentsTo=function(e,t,n){var r=e;do{if(f(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},t.addEvent=function(e,t,n,r){if(!e)return;var i=u({capture:!0},r);e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.removeEvent=function(e,t,n,r){if(!e)return;var i=u({capture:!0},r);e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.outerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,i.int)(n.borderTopWidth),t+=(0,i.int)(n.borderBottomWidth)},t.outerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,i.int)(n.borderLeftWidth),t+=(0,i.int)(n.borderRightWidth)},t.innerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,i.int)(n.paddingTop),t-=(0,i.int)(n.paddingBottom)},t.innerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,i.int)(n.paddingLeft),t-=(0,i.int)(n.paddingRight)},t.offsetXYFromParent=function(e,t,n){var r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-r.left)/n,o=(e.clientY+t.scrollTop-r.top)/n;return{x:i,y:o}},t.createCSSTransform=function(e,t){var n=h(e,t,"px");return c({},(0,o.browserPrefixToKey)("transform",o.default),n)},t.createSVGTransform=function(e,t){return h(e,t,"")},t.getTranslation=h,t.getTouch=function(e,t){return e.targetTouches&&(0,i.findInArray)(e.targetTouches,(function(e){return t===e.identifier}))||e.changedTouches&&(0,i.findInArray)(e.changedTouches,(function(e){return t===e.identifier}))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},t.addUserSelectStyles=function(e){if(!e)return;var t=e.getElementById("react-draggable-style-el");t||((t=e.createElement("style")).type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&d(e.body,"react-draggable-transparent-selection")},t.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&p(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{var t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(n){}},t.addClassName=d,t.removeClassName=p;var i=n(62),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n(182));function a(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,t){t=t||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var u=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*a;case"days":case"day":case"d":return u*o;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(e);if("number"===c&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return u(e,t,o,"day");if(t>=i)return u(e,t,i,"hour");if(t>=r)return u(e,t,r,"minute");if(t>=n)return u(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=r)return Math.round(e/r)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){var r=n(35),i=n(36),o=n(37),a=n(38),s=n(57),u=function(e){"use strict";o(n,e);var t=a(n);function n(e){var i;return r(this,n),(i=t.call(this)).opts=e,i.query=e.query,i.readyState="",i.socket=e.socket,i}return i(n,[{key:"onError",value:function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this}},{key:"open",value:function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}},{key:"close",value:function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}},{key:"send",value:function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)}},{key:"onOpen",value:function(){this.readyState="open",this.writable=!0,this.emit("open")}},{key:"onData",value:function(e){var t=s.decodePacket(e,this.socket.binaryType);this.onPacket(t)}},{key:"onPacket",value:function(e){this.emit("packet",e)}},{key:"onClose",value:function(){this.readyState="closed",this.emit("close")}}]),n}(n(30));e.exports=u},function(e,t,n){"use strict";var r=n(65),i=n(50),o=n(37),a=n(38),s=n(35),u=n(36);Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;var c,l=n(30),f=n(206),h=n(114),d=n(207)("socket.io-parser");t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(c=t.PacketType||(t.PacketType={}));var p=function(){function e(){s(this,e)}return u(e,[{key:"encode",value:function(e){return d("encoding packet %j",e),e.type!==c.EVENT&&e.type!==c.ACK||!h.hasBinary(e)?[this.encodeAsString(e)]:(e.type=e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,this.encodeAsBinary(e))}},{key:"encodeAsString",value:function(e){var t=""+e.type;return e.type!==c.BINARY_EVENT&&e.type!==c.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data)),d("encoded %j as %s",e,t),t}},{key:"encodeAsBinary",value:function(e){var t=f.deconstructPacket(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}]),e}();t.Encoder=p;var v=function(e){o(n,e);var t=a(n);function n(){return s(this,n),t.call(this)}return u(n,[{key:"add",value:function(e){var t;if("string"===typeof e)(t=this.decodeString(e)).type===c.BINARY_EVENT||t.type===c.BINARY_ACK?(this.reconstructor=new m(t),0===t.attachments&&r(i(n.prototype),"emit",this).call(this,"decoded",t)):r(i(n.prototype),"emit",this).call(this,"decoded",t);else{if(!h.isBinary(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,r(i(n.prototype),"emit",this).call(this,"decoded",t))}}},{key:"decodeString",value:function(e){var t=0,r={type:Number(e.charAt(0))};if(void 0===c[r.type])throw new Error("unknown packet type "+r.type);if(r.type===c.BINARY_EVENT||r.type===c.BINARY_ACK){for(var i=t+1;"-"!==e.charAt(++t)&&t!=e.length;);var o=e.substring(i,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===e.charAt(t+1)){for(var a=t+1;++t;){if(","===e.charAt(t))break;if(t===e.length)break}r.nsp=e.substring(a,t)}else r.nsp="/";var s=e.charAt(t+1);if(""!==s&&Number(s)==s){for(var u=t+1;++t;){var l=e.charAt(t);if(null==l||Number(l)!=l){--t;break}if(t===e.length)break}r.id=Number(e.substring(u,t+1))}if(e.charAt(++t)){var f=function(e){try{return JSON.parse(e)}catch(t){return!1}}(e.substr(t));if(!n.isPayloadValid(r.type,f))throw new Error("invalid payload");r.data=f}return d("decoded %s as %j",e,r),r}},{key:"destroy",value:function(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}],[{key:"isPayloadValid",value:function(e,t){switch(e){case c.CONNECT:return"object"===typeof t;case c.DISCONNECT:return void 0===t;case c.CONNECT_ERROR:return"string"===typeof t||"object"===typeof t;case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&"string"===typeof t[0];case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}}]),n}(l);t.Decoder=v;var m=function(){function e(t){s(this,e),this.packet=t,this.buffers=[],this.reconPack=t}return u(e,[{key:"takeBinaryData",value:function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=f.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}},{key:"finishedReconstruction",value:function(){this.reconPack=null,this.buffers=[]}}]),e}()},function(e,t,n){var r=n(39)("socket.io-parser"),i=n(30),o=n(213),a=n(117),s=n(118);function u(){}t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=u,t.Decoder=f;var c=t.ERROR+'"encode error"';function l(e){var n=""+e.type;if(t.BINARY_EVENT!==e.type&&t.BINARY_ACK!==e.type||(n+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(n+=e.nsp+","),null!=e.id&&(n+=e.id),null!=e.data){var i=function(e){try{return JSON.stringify(e)}catch(t){return!1}}(e.data);if(!1===i)return c;n+=i}return r("encoded %j as %s",e,n),n}function f(){this.reconstructor=null}function h(e){this.reconPack=e,this.buffers=[]}function d(e){return{type:t.ERROR,data:"parser error: "+e}}u.prototype.encode=function(e,n){(r("encoding packet %j",e),t.BINARY_EVENT===e.type||t.BINARY_ACK===e.type)?function(e,t){function n(e){var n=o.deconstructPacket(e),r=l(n.packet),i=n.buffers;i.unshift(r),t(i)}o.removeBlobs(e,n)}(e,n):n([l(e)])},i(f.prototype),f.prototype.add=function(e){var n;if("string"===typeof e)n=function(e){var n=0,i={type:Number(e.charAt(0))};if(null==t.types[i.type])return d("unknown packet type "+i.type);if(t.BINARY_EVENT===i.type||t.BINARY_ACK===i.type){for(var o="";"-"!==e.charAt(++n)&&(o+=e.charAt(n),n!=e.length););if(o!=Number(o)||"-"!==e.charAt(n))throw new Error("Illegal attachments");i.attachments=Number(o)}if("/"===e.charAt(n+1))for(i.nsp="";++n;){if(","===(u=e.charAt(n)))break;if(i.nsp+=u,n===e.length)break}else i.nsp="/";var s=e.charAt(n+1);if(""!==s&&Number(s)==s){for(i.id="";++n;){var u;if(null==(u=e.charAt(n))||Number(u)!=u){--n;break}if(i.id+=e.charAt(n),n===e.length)break}i.id=Number(i.id)}if(e.charAt(++n)){var c=function(e){try{return JSON.parse(e)}catch(t){return!1}}(e.substr(n));if(!(!1!==c&&(i.type===t.ERROR||a(c))))return d("invalid payload");i.data=c}return r("decoded %s as %j",e,i),i}(e),t.BINARY_EVENT===n.type||t.BINARY_ACK===n.type?(this.reconstructor=new h(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!s(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(n=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,this.emit("decoded",n))}},f.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},h.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=o.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},h.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(e,t,n){var r=n(108),i=n(90);e.exports=function(e){var t=e.xdomain,n=e.xscheme,o=e.enablesXDR;try{if("undefined"!==typeof XMLHttpRequest&&(!t||r))return new XMLHttpRequest}catch(a){}try{if("undefined"!==typeof XDomainRequest&&!n&&o)return new XDomainRequest}catch(a){}if(!t)try{return new(i[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(a){}}},function(e,t){e.exports="undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")()},function(e,t,n){var r=n(51),i=n(30);function o(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.withCredentials=e.withCredentials,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}e.exports=o,i(o.prototype),o.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},o.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},o.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},o.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},o.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},o.prototype.onData=function(e){var t=r.decodePacket(e,this.socket.binaryType);this.onPacket(t)},o.prototype.onPacket=function(e){this.emit("packet",e)},o.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(e,t){function n(e,t,n){var r,i,o,a,s;function u(){var c=Date.now()-a;c=0?r=setTimeout(u,t-c):(r=null,n||(s=e.apply(o,i),o=i=null))}null==t&&(t=100);var c=function(){o=this,i=arguments,a=Date.now();var c=n&&!r;return r||(r=setTimeout(u,t)),c&&(s=e.apply(o,i),o=i=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=e.apply(o,i),o=i=null,clearTimeout(r),r=null)},c}n.debounce=n,e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(1);function i(e,t){var n=Object(r.useState)((function(){return{inputs:t,result:e()}}))[0],i=Object(r.useRef)(n),o=Boolean(t&&i.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n];var a=e.props.bounds;a="string"===typeof a?a:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(a);var s=o(e);if("string"===typeof a){var u,c=s.ownerDocument,l=c.defaultView;if(!((u="parent"===a?s.parentNode:c.querySelector(a))instanceof l.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');var f=l.getComputedStyle(s),h=l.getComputedStyle(u);a={left:-s.offsetLeft+(0,r.int)(h.paddingLeft)+(0,r.int)(f.marginLeft),top:-s.offsetTop+(0,r.int)(h.paddingTop)+(0,r.int)(f.marginTop),right:(0,i.innerWidth)(u)-(0,i.outerWidth)(s)-s.offsetLeft+(0,r.int)(h.paddingRight)-(0,r.int)(f.marginRight),bottom:(0,i.innerHeight)(u)-(0,i.outerHeight)(s)-s.offsetTop+(0,r.int)(h.paddingBottom)-(0,r.int)(f.marginBottom)}}(0,r.isNum)(a.right)&&(t=Math.min(t,a.right));(0,r.isNum)(a.bottom)&&(n=Math.min(n,a.bottom));(0,r.isNum)(a.left)&&(t=Math.max(t,a.left));(0,r.isNum)(a.top)&&(n=Math.max(n,a.top));return[t,n]},t.snapToGrid=function(e,t,n){var r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]},t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.getControlPosition=function(e,t,n){var r="number"===typeof t?(0,i.getTouch)(e,t):null;if("number"===typeof t&&!r)return null;var a=o(n),s=n.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,i.offsetXYFromParent)(r||e,s,n.props.scale)},t.createCoreData=function(e,t,n){var i=e.state,a=!(0,r.isNum)(i.lastX),s=o(e);return a?{node:s,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:s,deltaX:t-i.lastX,deltaY:n-i.lastY,lastX:i.lastX,lastY:i.lastY,x:t,y:n}},t.createDraggableData=function(e,t){var n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}};var r=n(62),i=n(83);function o(e){var t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){void 0}},function(e,t,n){"use strict";var r=n(35),i=n(36),o=n(65),a=n(50),s=n(37),u=n(38);Object.defineProperty(t,"__esModule",{value:!0}),t.Manager=void 0;var c=n(197),l=n(113),f=n(30),h=n(87),d=n(115),p=n(69),v=n(116),m=n(64)("socket.io-client:manager"),g=function(e){s(n,e);var t=u(n);function n(e,i){var o;r(this,n),(o=t.call(this)).nsps={},o.subs=[],e&&"object"===typeof e&&(i=e,e=void 0),(i=i||{}).path=i.path||"/socket.io",o.opts=i,o.reconnection(!1!==i.reconnection),o.reconnectionAttempts(i.reconnectionAttempts||1/0),o.reconnectionDelay(i.reconnectionDelay||1e3),o.reconnectionDelayMax(i.reconnectionDelayMax||5e3),o.randomizationFactor(i.randomizationFactor||.5),o.backoff=new v({min:o.reconnectionDelay(),max:o.reconnectionDelayMax(),jitter:o.randomizationFactor()}),o.timeout(null==i.timeout?2e4:i.timeout),o._readyState="closed",o.uri=e;var a=i.parser||h;return o.encoder=new a.Encoder,o.decoder=new a.Decoder,o._autoConnect=!1!==i.autoConnect,o._autoConnect&&o.open(),o}return i(n,[{key:"reconnection",value:function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}},{key:"reconnectionAttempts",value:function(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}},{key:"reconnectionDelay",value:function(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}},{key:"randomizationFactor",value:function(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}},{key:"reconnectionDelayMax",value:function(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}},{key:"timeout",value:function(e){return arguments.length?(this._timeout=e,this):this._timeout}},{key:"maybeReconnectOnOpen",value:function(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}},{key:"open",value:function(e){var t=this;if(m("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;m("opening %s",this.uri),this.engine=c(this.uri,this.opts);var r=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;var s=d.on(r,"open",(function(){i.onopen(),e&&e()})),u=d.on(r,"error",(function(r){m("error"),i.cleanup(),i._readyState="closed",o(a(n.prototype),"emit",t).call(t,"error",r),e?e(r):i.maybeReconnectOnOpen()}));if(!1!==this._timeout){var l=this._timeout;m("connect attempt will timeout after %d",l),0===l&&s.destroy();var f=setTimeout((function(){m("connect attempt timed out after %d",l),s.destroy(),r.close(),r.emit("error",new Error("timeout"))}),l);this.subs.push({destroy:function(){clearTimeout(f)}})}return this.subs.push(s),this.subs.push(u),this}},{key:"connect",value:function(e){return this.open(e)}},{key:"onopen",value:function(){m("open"),this.cleanup(),this._readyState="open",o(a(n.prototype),"emit",this).call(this,"open");var e=this.engine;this.subs.push(d.on(e,"data",p(this,"ondata")),d.on(e,"ping",p(this,"onping")),d.on(e,"error",p(this,"onerror")),d.on(e,"close",p(this,"onclose")),d.on(this.decoder,"decoded",p(this,"ondecoded")))}},{key:"onping",value:function(){o(a(n.prototype),"emit",this).call(this,"ping")}},{key:"ondata",value:function(e){this.decoder.add(e)}},{key:"ondecoded",value:function(e){o(a(n.prototype),"emit",this).call(this,"packet",e)}},{key:"onerror",value:function(e){m("error",e),o(a(n.prototype),"emit",this).call(this,"error",e)}},{key:"socket",value:function(e,t){var n=this.nsps[e];return n||(n=new l.Socket(this,e,t),this.nsps[e]=n),n}},{key:"_destroy",value:function(e){for(var t=0,n=Object.keys(this.nsps);t=this._reconnectionAttempts)m("reconnect failed"),this.backoff.reset(),o(a(n.prototype),"emit",this).call(this,"reconnect_failed"),this._reconnecting=!1;else{var r=this.backoff.duration();m("will wait %dms before reconnect attempt",r),this._reconnecting=!0;var i=setTimeout((function(){t.skipReconnect||(m("attempting reconnect"),o(a(n.prototype),"emit",e).call(e,"reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((function(r){r?(m("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),o(a(n.prototype),"emit",e).call(e,"reconnect_error",r)):(m("reconnect success"),t.onreconnect())})))}),r);this.subs.push({destroy:function(){clearTimeout(i)}})}}},{key:"onreconnect",value:function(){var e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),o(a(n.prototype),"emit",this).call(this,"reconnect",e)}}]),n}(f);t.Manager=g},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var r=n(107),i=n(199),o=n(203),a=n(204);t.polling=function(e){var t=!1,n=!1,a=!1!==e.jsonp;if("undefined"!==typeof location){var s="https:"===location.protocol,u=location.port;u||(u=s?443:80),t=e.hostname!==location.hostname||u!==e.port,n=e.secure!==s}if(e.xdomain=t,e.xscheme=n,"open"in new r(e)&&!e.forceJSONP)return new i(e);if(!a)throw new Error("JSONP disabled");return new o(e)},t.websocket=a},function(e,t,n){var r=n(108),i=n(66);e.exports=function(e){var t=e.xdomain,n=e.xscheme,o=e.enablesXDR;try{if("undefined"!==typeof XMLHttpRequest&&(!t||r))return new XMLHttpRequest}catch(a){}try{if("undefined"!==typeof XDomainRequest&&!n&&o)return new XDomainRequest}catch(a){}if(!t)try{return new(i[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(a){}}},function(e,t){try{e.exports="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(n){e.exports=!1}},function(e,t,n){var r=n(35),i=n(36),o=n(37),a=n(38),s=n(86),u=n(47),c=n(57),l=n(67),f=n(68)("engine.io-client:polling"),h=function(e){"use strict";o(n,e);var t=a(n);function n(){return r(this,n),t.apply(this,arguments)}return i(n,[{key:"doOpen",value:function(){this.poll()}},{key:"pause",value:function(e){var t=this;function n(){f("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(f("we are currently polling - waiting to pause"),r++,this.once("pollComplete",(function(){f("pre-pause polling complete"),--r||n()}))),this.writable||(f("we are currently writing - waiting to pause"),r++,this.once("drain",(function(){f("pre-pause writing complete"),--r||n()})))}else n()}},{key:"poll",value:function(){f("polling"),this.polling=!0,this.doPoll(),this.emit("poll")}},{key:"onData",value:function(e){var t=this;f("polling got data %s",e);c.decodePayload(e,this.socket.binaryType).forEach((function(e,n,r){if("opening"===t.readyState&&"open"===e.type&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():f('ignoring poll - transport state "%s"',this.readyState))}},{key:"doClose",value:function(){var e=this;function t(){f("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(f("transport open - closing"),t()):(f("transport not open - deferring close"),this.once("open",t))}},{key:"write",value:function(e){var t=this;this.writable=!1,c.encodePayload(e,(function(e){t.doWrite(e,(function(){t.writable=!0,t.emit("drain")}))}))}},{key:"uri",value:function(){var e=this.query||{},t=this.opts.secure?"https":"http",n="";return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=l()),this.supportsBinary||e.sid||(e.b64=1),e=u.encode(e),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),e.length&&(e="?"+e),t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+e}},{key:"name",get:function(){return"polling"}}]),n}(s);e.exports=h},function(e,t){var n=Object.create(null);n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";var r=Object.create(null);Object.keys(n).forEach((function(e){r[n[e]]=e}));e.exports={PACKET_TYPES:n,PACKET_TYPES_REVERSE:r,ERROR_PACKET:{type:"error",data:"parser error"}}},function(e,t){!function(e){"use strict";t.encode=function(t){var n,r=new Uint8Array(t),i=r.length,o="";for(n=0;n>2],o+=e[(3&r[n])<<4|r[n+1]>>4],o+=e[(15&r[n+1])<<2|r[n+2]>>6],o+=e[63&r[n+2]];return i%3===2?o=o.substring(0,o.length-1)+"=":i%3===1&&(o=o.substring(0,o.length-2)+"=="),o},t.decode=function(t){var n,r,i,o,a,s=.75*t.length,u=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var l=new ArrayBuffer(s),f=new Uint8Array(l);for(n=0;n>4,f[c++]=(15&i)<<4|o>>2,f[c++]=(3&o)<<6|63&a;return l}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},function(e,t){e.exports.pick=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(function(t){e.exports=function(e){return n&&t.isBuffer(e)||r&&(e instanceof ArrayBuffer||function(e){return"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}(e))};var n="function"===typeof t&&"function"===typeof t.isBuffer,r="function"===typeof ArrayBuffer}).call(this,n(56).Buffer)},function(e,t,n){var r=n(214),i=n(124),o=n(30),a=n(88),s=n(125),u=n(69),c=n(39)("socket.io-client:manager"),l=n(123),f=n(116),h=Object.prototype.hasOwnProperty;function d(e,t){if(!(this instanceof d))return new d(e,t);e&&"object"===typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=t.parser||a;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}e.exports=d,d.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)h.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},d.prototype.updateSocketIds=function(){for(var e in this.nsps)h.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},d.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},o(d.prototype),d.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},d.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},d.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},d.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},d.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},d.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},d.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},d.prototype.open=d.prototype.connect=function(e,t){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=r(this.uri,this.opts);var n=this.engine,i=this;this.readyState="opening",this.skipReconnect=!1;var o=s(n,"open",(function(){i.onopen(),e&&e()})),a=s(n,"error",(function(t){if(c("connect_error"),i.cleanup(),i.readyState="closed",i.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else i.maybeReconnectOnOpen()}));if(!1!==this._timeout){var u=this._timeout;c("connect attempt will timeout after %d",u),0===u&&o.destroy();var l=setTimeout((function(){c("connect attempt timed out after %d",u),o.destroy(),n.close(),n.emit("error","timeout"),i.emitAll("connect_timeout",u)}),u);this.subs.push({destroy:function(){clearTimeout(l)}})}return this.subs.push(o),this.subs.push(a),this},d.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(s(e,"data",u(this,"ondata"))),this.subs.push(s(e,"ping",u(this,"onping"))),this.subs.push(s(e,"pong",u(this,"onpong"))),this.subs.push(s(e,"error",u(this,"onerror"))),this.subs.push(s(e,"close",u(this,"onclose"))),this.subs.push(s(this.decoder,"decoded",u(this,"ondecoded")))},d.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},d.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},d.prototype.ondata=function(e){this.decoder.add(e)},d.prototype.ondecoded=function(e){this.emit("packet",e)},d.prototype.onerror=function(e){c("error",e),this.emitAll("error",e)},d.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new i(this,e,t),this.nsps[e]=n;var r=this;n.on("connecting",o),n.on("connect",(function(){n.id=r.generateId(e)})),this.autoConnect&&o()}function o(){~l(r.connecting,n)||r.connecting.push(n)}return n},d.prototype.destroy=function(e){var t=l(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},d.prototype.packet=function(e){c("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(n){for(var r=0;r0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},d.prototype.cleanup=function(){c("cleanup");for(var e=this.subs.length,t=0;t=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();c("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout((function(){e.skipReconnect||(c("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(c("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(c("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(n)}})}},d.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},function(e,t,n){var r=n(89),i=n(216),o=n(223),a=n(224);t.polling=function(e){var t=!1,n=!1,a=!1!==e.jsonp;if("undefined"!==typeof location){var s="https:"===location.protocol,u=location.port;u||(u=s?443:80),t=e.hostname!==location.hostname||u!==e.port,n=e.secure!==s}if(e.xdomain=t,e.xscheme=n,"open"in new r(e)&&!e.forceJSONP)return new i(e);if(!a)throw new Error("JSONP disabled");return new o(e)},t.websocket=a},function(e,t,n){var r=n(91),i=n(47),o=n(51),a=n(70),s=n(67),u=n(39)("engine.io-client:polling");e.exports=l;var c=null!=new(n(89))({xdomain:!1}).responseType;function l(e){var t=e&&e.forceBase64;c&&!t||(this.supportsBinary=!1),r.call(this,e)}a(l,r),l.prototype.name="polling",l.prototype.doOpen=function(){this.poll()},l.prototype.pause=function(e){var t=this;function n(){u("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(u("we are currently polling - waiting to pause"),r++,this.once("pollComplete",(function(){u("pre-pause polling complete"),--r||n()}))),this.writable||(u("we are currently writing - waiting to pause"),r++,this.once("drain",(function(){u("pre-pause writing complete"),--r||n()})))}else n()},l.prototype.poll=function(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},l.prototype.onData=function(e){var t=this;u("polling got data %s",e);o.decodePayload(e,this.socket.binaryType,(function(e,n,r){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))},l.prototype.doClose=function(){var e=this;function t(){u("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(u("transport open - closing"),t()):(u("transport not open - deferring close"),this.once("open",t))},l.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};o.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,n)}))},l.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=s()),this.supportsBinary||e.sid||(e.b64=1),e=i.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e}},function(e,t,n){(function(t){var r=n(218),i=Object.prototype.toString,o="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===i.call(Blob),a="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===i.call(File);e.exports=function e(n){if(!n||"object"!==typeof n)return!1;if(r(n)){for(var i=0,s=n.length;i=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){s.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){s.headers[e]=r.merge(o)})),e.exports=s}).call(this,n(46))},function(e,t,n){"use strict";var r=n(24),i=n(234),o=n(236),a=n(127),s=n(237),u=n(240),c=n(241),l=n(131);e.exports=function(e){return new Promise((function(t,n){var f=e.data,h=e.headers;r.isFormData(f)&&delete h["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";h.Authorization="Basic "+btoa(p+":"+v)}var m=s(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),a(m,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in d?u(d.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:e,request:d};i(t,n,o),d=null}},d.onabort=function(){d&&(n(l("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){n(l("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var g=(e.withCredentials||c(m))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;g&&(h[e.xsrfHeaderName]=g)}if("setRequestHeader"in d&&r.forEach(h,(function(e,t){"undefined"===typeof f&&"content-type"===t.toLowerCase()?delete h[t]:d.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(y){if("json"!==e.responseType)throw y}"function"===typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),n(e),d=null)})),f||(f=null),d.send(f)}))}},function(e,t,n){"use strict";var r=n(235);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},function(e,t,n){"use strict";var r=n(24);e.exports=function(e,t){t=t||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function u(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function c(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=u(void 0,e[i])):n[i]=u(e[i],t[i])}r.forEach(i,(function(e){r.isUndefined(t[e])||(n[e]=u(void 0,t[e]))})),r.forEach(o,c),r.forEach(a,(function(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=u(void 0,e[i])):n[i]=u(void 0,t[i])})),r.forEach(s,(function(r){r in t?n[r]=u(e[r],t[r]):r in e&&(n[r]=u(void 0,e[r]))}));var l=i.concat(o).concat(a).concat(s),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(f,c),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmailJSResponseStatus=t.sendForm=t.send=t.init=void 0;var r=n(158);Object.defineProperty(t,"EmailJSResponseStatus",{enumerable:!0,get:function(){return r.EmailJSResponseStatus}});var i=n(159),o=null,a="https://api.emailjs.com";function s(e,t,n){return void 0===n&&(n={}),new Promise((function(i,o){var a=new XMLHttpRequest;for(var s in a.addEventListener("load",(function(e){var t=new r.EmailJSResponseStatus(e.target);200===t.status||"OK"===t.text?i(t):o(t)})),a.addEventListener("error",(function(e){o(new r.EmailJSResponseStatus(e.target))})),a.open("POST",e,!0),n)a.setRequestHeader(s,n[s]);a.send(t)}))}function u(e){var t=document&&document.getElementById("g-recaptcha-response");return t&&t.value&&(e["g-recaptcha-response"]=t.value),t=null,e}function c(e,t){o=e,a=t||"https://api.emailjs.com"}function l(e,t,n,r){var i={lib_version:"2.6.4",user_id:r||o,service_id:e,template_id:t,template_params:u(n)};return s(a+"/api/v1.0/email/send",JSON.stringify(i),{"Content-type":"application/json"})}function f(e,t,n,r){var u;if("string"===typeof n&&(n=document.querySelector("#"!==(u=n)[0]&&"."!==u[0]?"#"+u:u)),!n||"FORM"!==n.nodeName)throw"Expected the HTML form element or the style selector of form";i.UI.progressState(n);var c=new FormData(n);return c.append("lib_version","2.6.4"),c.append("service_id",e),c.append("template_id",t),c.append("user_id",r||o),s(a+"/api/v1.0/email/send-form",c).then((function(e){return i.UI.successState(n),e}),(function(e){return i.UI.errorState(n),Promise.reject(e)}))}t.init=c,t.send=l,t.sendForm=f,t.default={init:c,send:l,sendForm:f}},function(e,t,n){"use strict";e.exports=n(160)},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;r0&&void 0!==arguments[0]?arguments[0]:{debounce:0,scroll:!1},t=e.debounce,n=e.scroll,r=e.polyfill,u=r||("undefined"===typeof window?function e(){Object(o.a)(this,e)}:window.ResizeObserver);if(!u)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");var h=Object(a.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),p=Object(i.a)(h,2),v=p[0],m=p[1],g=Object(a.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:v}),y=t?"number"===typeof t?t:t.scroll:null,b=t?"number"===typeof t?t:t.resize:null,w=Object(a.useRef)(!1);Object(a.useEffect)((function(){return w.current=!0,function(){w.current=!1}}));var _=Object(a.useMemo)((function(){var e=function(){if(g.current.element){var e=g.current.element.getBoundingClientRect(),t={left:e.left,top:e.top,width:e.width,height:e.height,bottom:e.bottom,right:e.right,x:e.x,y:e.y};Object.freeze(t),w.current&&!d(g.current.lastBounds,t)&&m(g.current.lastBounds=t)}};return[e,b?Object(s.debounce)(e,b):e,y?Object(s.debounce)(e,y):e]}),[m,y,b]),x=Object(i.a)(_,3),M=x[0],S=x[1],E=x[2];function T(){g.current.scrollContainers&&(g.current.scrollContainers.forEach((function(e){return e.removeEventListener("scroll",E,!0)})),g.current.scrollContainers=null),g.current.resizeObserver&&(g.current.resizeObserver.disconnect(),g.current.resizeObserver=null)}function A(){g.current.element&&(g.current.resizeObserver=new u(E),g.current.resizeObserver.observe(g.current.element),n&&g.current.scrollContainers&&g.current.scrollContainers.forEach((function(e){return e.addEventListener("scroll",E,{capture:!0,passive:!0})})))}var k=function(e){e&&e!==g.current.element&&(T(),g.current.element=e,g.current.scrollContainers=f(e),A())};return l(E,Boolean(n)),c(S),Object(a.useEffect)((function(){T(),A()}),[n,E,S]),Object(a.useEffect)((function(){return T}),[]),[k,v,M]}function c(e){Object(a.useEffect)((function(){var t=e;return window.addEventListener("resize",t),function(){window.removeEventListener("resize",t)}}),[e])}function l(e,t){Object(a.useEffect)((function(){if(t){var n=e;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),function(){window.removeEventListener("scroll",n,!0)}}}),[e,t])}function f(e){var t=[];if(!e||e===document.body)return t;var n=window.getComputedStyle(e);return[n.overflow,n.overflowX,n.overflowY].some((function(e){return"auto"===e||"scroll"===e}))&&t.push(e),[].concat(t,Object(r.a)(f(e.parentElement)))}var h=["x","y","top","bottom","left","right","width","height"],d=function(e,t){return h.every((function(n){return e[n]===t[n]}))};Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(e,"exports").writable&&(e.exports=u),t.a=u}).call(this,n(161)(e))},function(e,t,n){!function(e,t,n,r){"use strict";function i(e,t){var n=t.sdfDistancePercent,r=16;function i(e,t,n,r,i,o,a){var s=1-a;return{x:s*s*e+2*s*a*n+a*a*i,y:s*s*t+2*s*a*r+a*a*o}}function o(e,t,n,r,i,o,a,s,u){var c=1-u;return{x:c*c*c*e+3*c*c*u*n+3*c*u*u*i+u*u*u*a,y:c*c*c*t+3*c*c*u*r+3*c*u*u*o+u*u*u*s}}function a(t,a){var s=new Uint8Array(a*a),u=t.xMax-t.xMin,c=t.yMax-t.yMin,l=Math.max(u,c)*n,f=(u+2*l)/a,h=(c+2*l)/a,d=t.xMin-l-f,p=t.yMin-l-h,v=t.xMax+l+f,m=t.yMax+l+h;function g(e){return d+(v-d)*e/a}function y(e){return p+(m-p)*e/a}if(t.pathCommandCount){var b,w,_,x,M=e(t);t.forEachPathCommand((function(e,t,n,a,s,u,c){switch(e){case"M":_=b=t,x=w=n;break;case"L":t===_&&n===x||M.addLineSegment(_,x,_=t,x=n);break;case"Q":for(var l={x:_,y:x},f=1;f=400)o(new Error(a.statusText));else if(a.status>0)try{var t=e(a.response);n(t)}catch(r){o(r)}},a.onerror=o,a.send()}catch(s){o(s)}}i()}function u(e,t){e||(e=r);var n=o[e];n?n.pending?n.pending.push(t):t(n):(o[e]={pending:[t]},s(e,(function(t){var n=o[e].pending;o[e]=t,n.forEach((function(e){return e(t)}))})))}function c(e,t,n){e||(e=r);var o=e+"@"+t,a=i[o];a?n(a):u(e,(function(e){a=i[o]||(i[o]={fontObj:e,glyphs:{},glyphCount:0}),n(a)}))}function l(e,n,i){var o=e.text;void 0===o&&(o="");var s=e.font;void 0===s&&(s=r);var u=e.sdfGlyphSize;void 0===u&&(u=64);var l=e.fontSize;void 0===l&&(l=1);var f=e.letterSpacing;void 0===f&&(f=0);var v=e.lineHeight;void 0===v&&(v="normal");var m=e.maxWidth;void 0===m&&(m=a);var g=e.textAlign;void 0===g&&(g="left");var y=e.textIndent;void 0===y&&(y=0);var b=e.whiteSpace;void 0===b&&(b="normal");var w=e.overflowWrap;void 0===w&&(w="normal");var _=e.anchorX;void 0===_&&(_=0);var x=e.anchorY;void 0===x&&(x=0);var M=e.includeCaretPositions;void 0===M&&(M=!1);var S=e.chunkedBoundsSize;void 0===S&&(S=8192);var E=e.colorRanges;void 0===E&&(E=null),void 0===i&&(i=!1);var T=d(),A={total:0,fontLoad:0,layout:0,sdf:{},sdfTotal:0};o.indexOf("\r")>-1&&(console.warn("FontProcessor.process: got text with \\r chars; normalizing to \\n"),o=o.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),l=+l,f=+f,m=+m,v=v||"normal",y=+y,c(s,u,(function(e){var r=e.fontObj,s=isFinite(m),c=null,k=null,C=null,R=null,O=null,P=null,I=null,L=0,D=0,N="nowrap"!==b,F=r.ascender,j=r.descender,U=r.unitsPerEm;A.fontLoad=d()-T;var B=d(),G=l/U;"normal"===v&&(v=(F-j)/U);var z=((v*=l)-(F-j)*G)/2,V=-(l+z),H=Math.min(v,(F-j)*G),W=(F+j)/2*G-H/2,X=y,q=new p,Y=[q];if(r.forEachGlyph(o,l,f,(function(e,t,n){var r,i=o.charAt(n),a=e.advanceWidth*G,u=q.count;if("isEmpty"in e||(e.isWhitespace=!!i&&/\s/.test(i),e.isEmpty=e.xMin===e.xMax||e.yMin===e.yMax),e.isWhitespace||e.isEmpty||D++,N&&s&&!e.isWhitespace&&t+a+X>m&&u){if(q.glyphAt(u-1).glyphObj.isWhitespace)r=new p,X=-t;else for(var c=u;c--;){if(0===c&&"break-word"===w){r=new p,X=-t;break}if(q.glyphAt(c).glyphObj.isWhitespace){var h=(r=q.splitAt(c+1)).glyphAt(0).x;X-=h;for(var d=r.count;d--;)r.glyphAt(d).x-=h;break}}r&&(q.isSoftWrapped=!0,q=r,Y.push(q),L=m)}var v=q.glyphAt(q.count);v.glyphObj=e,v.x=t+X,v.width=a,v.charIndex=n,"\n"===i&&(q=new p,Y.push(q),X=-(t+a+f*l)+y)})),Y.forEach((function(e){for(var t=e.count;t--;){var n=e.glyphAt(t),r=n.glyphObj,i=n.x,o=n.width;if(!r.isWhitespace)return e.width=i+o,void(e.width>L&&(L=e.width))}})),!i){var $=0,Q=0;if(_&&("number"===typeof _?$=-_:"string"===typeof _&&($=-L*("left"===_?0:"center"===_?.5:"right"===_?1:h(_)))),x)if("number"===typeof x)Q=-x;else if("string"===typeof x){var K=Y.length*v;Q="top"===x?0:"top-baseline"===x?-V:"middle"===x?K/2:"bottom"===x?K:"bottom-baseline"===x?K-z+j*G:h(x)*K}k=new Float32Array(4*D),C=new Float32Array(D),P=[a,a,-a,-a],I=[];var Z=V;M&&(O=new Float32Array(3*o.length)),E&&(R=new Uint8Array(3*D));var J,ee,te=0,ne=-1,re=-1;Y.forEach((function(n){var r=n.count,i=n.width;if(r>0){var s=0,l=0;if("center"===g)s=(L-i)/2;else if("right"===g)s=L-i;else if("justify"===g&&n.isSoftWrapped){for(var f=0,h=r;h--;)if(!n.glyphAt(h).glyphObj.isWhitespace){for(;h--;)n.glyphAt(h).glyphObj,n.glyphAt(h).glyphObj.isWhitespace&&f++;break}l=(L-i)/f}for(var p=0;p1;)O[3*(ne+1)]=O[3*ne+1],O[3*(ne+1)+1]=O[3*ne+1],O[3*(ne+1)+2]=O[3*ne+2],ne++;ne=b}if(E)for(var w=m.charIndex;w>re;)re++,E.hasOwnProperty(re)&&(ee=E[re]);if(!y.isWhitespace&&!y.isEmpty){var _=te++,x=e.glyphs[y.index];if(!x){var T=d(),D=t(y,u);A.sdf[o.charAt(m.charIndex)]=d()-T,D.atlasIndex=e.glyphCount++,c||(c=[]),c.push(D),x=e.glyphs[y.index]={atlasIndex:D.atlasIndex,glyphObj:y,renderingBounds:D.renderingBounds}}var N=x.renderingBounds,F=4*_,j=k[F]=m.x+N[0]*G+$,U=k[F+1]=Z+N[1]*G+Q,B=k[F+2]=m.x+N[2]*G+$,z=k[F+3]=Z+N[3]*G+Q;if(jP[2]&&(P[2]=B),z>P[3]&&(P[3]=z),_%S===0&&(J={start:_,end:_,rect:[a,a,-a,-a]},I.push(J)),J.end++,jJ.rect[2]&&(J.rect[2]=B),z>J.rect[3]&&(J.rect[3]=z),C[_]=x.atlasIndex,E){var V=3*_;R[V]=ee>>16&255,R[V+1]=ee>>8&255,R[V+2]=255&ee}}}}Z-=v}))}for(var ie in A.sdf)A.sdfTotal+=A.sdf[ie];A.layout=d()-B-A.sdfTotal,A.total=d()-T,n({glyphBounds:k,glyphAtlasIndices:C,caretPositions:O,caretHeight:H,glyphColors:R,chunkedBounds:I,ascender:F*G,descender:j*G,lineHeight:v,topBaseline:V,totalBounds:P,totalBlockSize:[L,Y.length*v],newGlyphSDFs:c,timings:A})}))}function f(e,t){l(e,(function(e){t({width:e.totalBlockSize[0],height:e.totalBlockSize[1]})}),{metricsOnly:!0})}function h(e){var t=e.match(/^([\d.]+)%$/),n=t?parseFloat(t[1]):NaN;return isNaN(n)?0:n/100}function d(){return(self.performance||Date).now()}function p(){this.data=[]}return p.prototype={width:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/4)},glyphAt:function(e){var t=p.flyweight;return t.data=this.data,t.index=e,t},splitAt:function(e){var t=new p;return t.data=this.data.splice(4*e),t}},p.flyweight=["glyphObj","x","width","charIndex"].reduce((function(e,t,n,r){return Object.defineProperty(e,t,{get:function(){return this.data[4*this.index+n]},set:function(e){this.data[4*this.index+n]=e}}),e}),{data:null,index:0}),{process:l,measure:f,loadFont:u}}function a(e){var t=e.xMin,n=e.yMin,r=e.xMax-t,i=e.yMax-n,o=1/0,a={0:null,1:null,2:null,3:null,data:null,cx:Math.round(t+r/2),cy:Math.round(n+i/2),r:Math.pow(2,Math.floor(Math.log(Math.max(r,i))*Math.LOG2E)),minX:o,minY:o,maxX:-o,maxY:-o};function s(e,t,n,r){u({x0:e,y0:t,x1:n,y1:r,cx:(e+n)/2,cy:(t+r)/2,minX:Math.min(e,n),minY:Math.min(t,r),maxX:Math.max(e,n),maxY:Math.max(t,r),next:null},a)}function u(e,t){var n=e.minX,r=e.minY,i=e.maxX,o=e.maxY,a=e.cx,s=e.cy;nt.maxX&&(t.maxX=i),o>t.maxY&&(t.maxY=o);var c=t.data;if(c)if(c.cx===a&&c.cy===s){for(;c.next;)c=c.next;c.next=e}else t.data=null,u(c,t),u(e,t);else{var l=(sn.maxX||e+rn.maxY||t+rt||r.maxYt!==u>t&&e<(s-o)*(t-a)/(u-a)+o&&(n=!n)}})),n}function d(e,t,n,r,i,o){var a=i-n,s=o-r,u=a*a+s*s,c=u?Math.max(0,Math.min(1,((e-n)*a+(t-r)*s)/u)):0,l=e-(n+c*a),f=t-(r+c*s);return l*l+f*f}return{addLineSegment:s,findNearestSignedDistance:f}}function s(){var e=self,t={parse:function(e){var n=t._bin,r=new Uint8Array(e);if("ttcf"==n.readASCII(r,0,4)){var i=4;n.readUshort(r,i),i+=2,n.readUshort(r,i),i+=2;var o=n.readUint(r,i);i+=4;for(var a=[],s=0;s>>n&1)&&t++;return t},t._lctf.readClassDef=function(e,n){var r=t._bin,i=[],o=r.readUshort(e,n);if(n+=2,1==o){var a=r.readUshort(e,n);n+=2;var s=r.readUshort(e,n);n+=2;for(var u=0;u255?-1:t.CFF.glyphByUnicode(e,t.CFF.tableSE[n])},t.CFF.readEncoding=function(e,n,r){t._bin;var i=[".notdef"],o=e[n];if(n++,0!=o)throw"error: unknown encoding format: "+o;var a=e[n];n++;for(var s=0;s>4,v=15&d;if(15!=p&&h.push(p),15!=v&&h.push(v),15==v)break}for(var m="",g=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],y=0;y=a.xMax||a.yMin>=a.yMax)return null;if(a.noc>0){a.endPts=[];for(var s=0;s>>8;if(0!=(f&=15))throw"unknown kern table format: "+f;n=t.kern.readFormat0(e,n,u)}return u},t.kern.parseV1=function(e,n,r,i){var o=t._bin;o.readFixed(e,n),n+=4;var a=o.readUint(e,n);n+=4;for(var s={glyph1:[],rval:[]},u=0;u>>8;if(0!=(l&=15))throw"unknown kern table format: "+l;n=t.kern.readFormat0(e,n,s)}return s},t.kern.readFormat0=function(e,n,r){var i=t._bin,o=-1,a=i.readUshort(e,n);n+=2,i.readUshort(e,n),n+=2,i.readUshort(e,n),n+=2,i.readUshort(e,n),n+=2;for(var s=0;s=i.map.length?0:i.map[t];if(4==i.format){for(var o=-1,a=0;at?0:65535&(0!=i.idRangeOffset[o]?i.glyphIdArray[t-i.startCount[o]+(i.idRangeOffset[o]>>1)-(i.idRangeOffset.length-o)]:t+i.idDelta[o])}if(12==i.format){if(t>i.groups[i.groups.length-1][1])return 0;for(a=0;a-1?t.U._simpleGlyph(i,r):t.U._compoGlyph(i,n,r))},t.U._simpleGlyph=function(e,n){for(var r=0;r65535&&i++,r.push(t.U.codeToGlyph(e,o));for(i=0;i65535&&i++}var s=e.GSUB;if(null==s)return r;for(var u=s.lookupList,c=s.featureList,l=["rlig","liga","mset","isol","init","fina","medi","half","pres","blws"],f=[],h=0;ho)){for(var d=!0,p=0,v=0;vo)){for(d=!0,v=0;v<_.length;v++){var x=t._lctf.getInterval(u.cDef,e[n+1+v]);if(-1==m&&u.cDef[x+2]!=_[v]){d=!1;break}}if(d){var M=w.substLookupRecords;for(l=0;l>1,a.length=0,u=!0;else if("o3"==E||"o23"==E)a.length%2!==0&&!u&&(c=a.shift()+i.nominalWidthX),s+=a.length>>1,a.length=0,u=!0;else if("o4"==E)a.length>1&&!u&&(c=a.shift()+i.nominalWidthX,u=!0),l&&t.U.P.closePath(o),d+=a.pop(),t.U.P.moveTo(o,h,d),l=!0;else if("o5"==E)for(;a.length>0;)h+=a.shift(),d+=a.shift(),t.U.P.lineTo(o,h,d);else if("o6"==E||"o7"==E)for(var T=a.length,A="o6"==E,k=0;kMath.abs(_-d)?h=w+a.shift():d=_+a.shift(),t.U.P.curveTo(o,p,v,m,g,x,M),t.U.P.curveTo(o,y,b,w,_,h,d));else if("o14"==E){if(a.length>0&&!u&&(c=a.shift()+r.nominalWidthX,u=!0),4==a.length){var O=a.shift(),P=a.shift(),I=a.shift(),L=a.shift(),D=t.CFF.glyphBySE(r,I),N=t.CFF.glyphBySE(r,L);t.U._drawCFF(r.CharStrings[D],n,r,i,o),n.x=O,n.y=P,t.U._drawCFF(r.CharStrings[N],n,r,i,o)}l&&(t.U.P.closePath(o),l=!1)}else if("o19"==E||"o20"==E)a.length%2!==0&&!u&&(c=a.shift()+i.nominalWidthX),s+=a.length>>1,a.length=0,u=!0,f+=s+7>>3;else if("o21"==E)a.length>2&&!u&&(c=a.shift()+i.nominalWidthX,u=!0),d+=a.pop(),h+=a.pop(),l&&t.U.P.closePath(o),t.U.P.moveTo(o,h,d),l=!0;else if("o22"==E)a.length>1&&!u&&(c=a.shift()+i.nominalWidthX,u=!0),h+=a.pop(),l&&t.U.P.closePath(o),t.U.P.moveTo(o,h,d),l=!0;else if("o25"==E){for(;a.length>6;)h+=a.shift(),d+=a.shift(),t.U.P.lineTo(o,h,d);p=h+a.shift(),v=d+a.shift(),m=p+a.shift(),g=v+a.shift(),h=m+a.shift(),d=g+a.shift(),t.U.P.curveTo(o,p,v,m,g,h,d)}else if("o26"==E)for(a.length%2&&(h+=a.shift());a.length>0;)p=h,v=d+a.shift(),h=m=p+a.shift(),d=(g=v+a.shift())+a.shift(),t.U.P.curveTo(o,p,v,m,g,h,d);else if("o27"==E)for(a.length%2&&(d+=a.shift());a.length>0;)v=d,m=(p=h+a.shift())+a.shift(),g=v+a.shift(),h=m+a.shift(),d=g,t.U.P.curveTo(o,p,v,m,g,h,d);else if("o10"==E||"o29"==E){var F="o10"==E?i:r;if(0==a.length)console.log("error: empty stack");else{var j=a.pop(),U=F.Subrs[j+F.Bias];n.x=h,n.y=d,n.nStems=s,n.haveWidth=u,n.width=c,n.open=l,t.U._drawCFF(U,n,r,i,o),h=n.x,d=n.y,s=n.nStems,u=n.haveWidth,c=n.width,l=n.open}}else if("o30"==E||"o31"==E){var B=a.length,G=(R=0,"o31"==E);for(R+=B-(T=-3&B);R>>=1,t}function b(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,r+n}function w(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++i,n+=t.table[i],r-=t.table[i]}while(r>=0);return e.tag=o,e.bitcount-=i,t.trans[n+r]}function _(e,t,n){var r,i,o,a,s,u;for(r=b(e,5,257),i=b(e,5,1),o=b(e,4,4),a=0;a<19;++a)d[a]=0;for(a=0;a8;)e.sourceIndex--,e.bitcount-=8;if((r=256*(r=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return n;for(e.sourceIndex+=4,i=r;i;--i)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,t}function S(e,r){var s,u,c=new i(e,r);do{switch(s=y(c),b(c,2,0)){case 0:u=M(c);break;case 1:u=x(c,o,a);break;case 2:_(c,c.ltree,c.dtree),u=x(c,c.ltree,c.dtree);break;default:u=n}if(u!==t)throw new Error("Data error")}while(!s);return c.destLenv&&(v=x),M>m&&(m=M)}}else d=v=p=m=0;f=r[i]={index:i,advanceWidth:t.hmtx.aWidth[i],xMin:d,yMin:p,xMax:v,yMax:m,pathCommandCount:y.length,forEachPathCommand:function(e){for(var t=0,r=[],i=0,o=y.length;i65535?2:1})),c}};return i}return function(n){var i=new Uint8Array(n,0,4),o=e._bin.readASCII(i,0,4);if("wOFF"===o)n=t(n);else if("wOF2"===o)throw new Error("woff2 fonts not supported");return r(e.parse(n)[0])}}var l=n.defineWorkerModule({name:"Typr Font Parser",dependencies:[s,u,c],init:function(e,t,n){return n(e(),t())}}),f={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,textureWidth:2048},h=new t.Color;function d(e){b(f,e)}var p,v=1/8,m=Object.create(null);function g(e,n){if((e=b({},e)).font=w(e.font||f.defaultFontURL),e.text=""+e.text,e.sdfGlyphSize=e.sdfGlyphSize||f.sdfGlyphSize,null!=e.colorRanges){var r={};for(var i in e.colorRanges)if(e.colorRanges.hasOwnProperty(i)){var o=e.colorRanges[i];"number"!==typeof o&&(o=h.set(o).getHex()),r[i]=o}e.colorRanges=r}Object.freeze(e);var a=f.textureWidth,s=e.sdfGlyphSize,u=e.font+"@"+s,c=m[u];c||((c=m[u]={sdfTexture:new t.DataTexture(new Uint8Array(s*a),a,s,t.LuminanceFormat,void 0,void 0,void 0,void 0,t.LinearFilter,t.LinearFilter)}).sdfTexture.font=e.font),x(e).then((function(t){t.newGlyphSDFs&&(t.newGlyphSDFs.forEach((function(e){for(var t=e.textureData,n=e.atlasIndex,r=c.sdfTexture.image;r.data.length<(n+1)*s*s;){var i=new Uint8Array(2*r.data.length);i.set(r.data),r.data=i,r.height*=2}for(var o=r.width/s,a=0;ae.y&&i[0]e.x)break}O(this,t)},Object.defineProperties(n.prototype,r),n}(t.InstancedBufferGeometry);function R(e,n,r,i){var o=e.getAttribute(n);r?o&&o.array.length===r.length?(o.array.set(r),o.needsUpdate=!0):(e.setAttribute(n,new t.InstancedBufferAttribute(r,i)),delete e._maxInstanceCount,e.dispose()):o&&e.deleteAttribute(n)}function O(e,t){e[e.hasOwnProperty("instanceCount")?"instanceCount":"maxInstancedCount"]=t}C.prototype.setAttribute||(C.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this});var P="\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaSDFTextureUV;\nvarying vec2 vTroikaGlyphUV;\nvarying vec3 vTroikaGlyphColor;\n",I="\nvec4 bounds = aTroikaGlyphBounds;\nvec4 clippedBounds = vec4(\n clamp(bounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(bounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\nvTroikaGlyphUV = clippedXY.xy;\n\nfloat cols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvTroikaSDFTextureUV = vec2(\n mod(aTroikaGlyphIndex, cols) + clippedXY.x,\n floor(aTroikaGlyphIndex / cols) + clippedXY.y\n) * uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = vec2(\n (position.x - uTroikaTotalBounds.x) / (uTroikaTotalBounds.z - uTroikaTotalBounds.x),\n (position.y - uTroikaTotalBounds.y) / (uTroikaTotalBounds.w - uTroikaTotalBounds.y)\n);\n\nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n",L="\nuniform sampler2D uTroikaSDFTexture;\nuniform float uTroikaSDFMinDistancePct;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaSDFTextureUV;\nvarying vec2 vTroikaGlyphUV;\n\nfloat troikaGetTextAlpha() {\n float troikaSDFValue = texture2D(uTroikaSDFTexture, vTroikaSDFTextureUV).r;\n \n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(0.5, troikaSDFValue);\n #else\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n float aaDist = min(\n 0.5,\n 0.5 * min(\n fwidth(vTroikaGlyphUV.x),\n fwidth(vTroikaGlyphUV.y)\n )\n ) / uTroikaSDFMinDistancePct;\n #else\n float aaDist = 0.01;\n #endif\n \n float alpha = uTroikaSDFDebug ? troikaSDFValue : smoothstep(\n 0.5 - aaDist,\n 0.5 + aaDist,\n troikaSDFValue\n );\n #endif\n \n return alpha;\n}\n",D="\nfloat troikaAlphaMult = troikaGetTextAlpha();\nif (troikaAlphaMult == 0.0) {\n discard;\n} else {\n gl_FragColor.a *= troikaAlphaMult;\n}\n";function N(e){var n=r.createDerivedMaterial(e,{extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new t.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFMinDistancePct:{value:0},uTroikaTotalBounds:{value:new t.Vector4(0,0,0,0)},uTroikaClipRect:{value:new t.Vector4(0,0,0,0)},uTroikaOrient:{value:new t.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:P,vertexTransform:I,fragmentDefs:L,fragmentColorTransform:D,customRewriter:function(e){var t=e.vertexShader,n=e.fragmentShader,i=/\buniform\s+vec3\s+diffuse\b/;return i.test(n)&&(n=n.replace(i,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),i.test(t)||(t=t.replace(r.voidMainRegExp,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:t,fragmentShader:n}}});return n.transparent=!0,Object.defineProperties(n,{isTroikaTextMaterial:{value:!0},shadowSide:{get:function(){return this.side},set:function(){}}}),n}var F=new t.MeshBasicMaterial({color:16777215,side:t.DoubleSide,transparent:!0}),j=new t.Matrix4,U=new t.Vector3,B=new t.Vector3,G=[],z=new t.Vector3,V="+x+y",H=new t.Mesh(new t.PlaneBufferGeometry(1,1).translate(.5,.5,0),F),W={type:"syncstart"},X={type:"synccomplete"},q=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],Y=q.concat("material","color","depthOffset","clipRect","orientation","glyphGeometryDetail"),$=function(e){function t(){var t=new C;e.call(this,t,null),this.text="",this.anchorX=0,this.anchorY=0,this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.depthOffset=0,this.clipRect=null,this.orientation=V,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.debugSDF=!1}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={textRenderInfo:{configurable:!0},material:{configurable:!0},glyphGeometryDetail:{configurable:!0},customDepthMaterial:{configurable:!0},customDistanceMaterial:{configurable:!0}};return t.prototype.sync=function(e){var t=this;this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(W),g({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize},(function(n){t._isSyncing=!1,t._textRenderInfo=n,t.geometry.updateGlyphs(n.glyphBounds,n.glyphAtlasIndices,n.totalBounds,n.chunkedBounds,n.glyphColors);var r=t._queuedSyncs;r&&(t._queuedSyncs=null,t._needsSync=!0,t.sync((function(){r.forEach((function(e){return e&&e()}))}))),t.dispatchEvent(X),e&&e()}))))},t.prototype.onBeforeRender=function(){this.sync(),this._prepareForRender()},t.prototype.dispose=function(){this.geometry.dispose()},n.textRenderInfo.get=function(){return this._textRenderInfo||null},n.material.get=function(){var e=this._derivedMaterial,t=this._baseMaterial||F;return e&&e.baseMaterial===t||(e=this._derivedMaterial=N(t),t.addEventListener("dispose",(function n(){t.removeEventListener("dispose",n),e.dispose()}))),e},n.material.set=function(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e},n.glyphGeometryDetail.get=function(){return this.geometry.detail},n.glyphGeometryDetail.set=function(e){this.geometry.detail=e},n.customDepthMaterial.get=function(){return this.material.getDepthMaterial()},n.customDistanceMaterial.get=function(){return this.material.getDistanceMaterial()},t.prototype._prepareForRender=function(){var e=this._derivedMaterial,t=e.uniforms,n=this.textRenderInfo;if(n){var r=n.sdfTexture,i=n.totalBounds;t.uTroikaSDFTexture.value=r,t.uTroikaSDFTextureSize.value.set(r.image.width,r.image.height),t.uTroikaSDFGlyphSize.value=n.sdfGlyphSize,t.uTroikaSDFMinDistancePct.value=n.sdfMinDistancePercent,t.uTroikaTotalBounds.value.fromArray(i),t.uTroikaUseGlyphColors.value=!!n.glyphColors;var o=this.clipRect;o&&Array.isArray(o)&&4===o.length?t.uTroikaClipRect.value.set(Math.max(i[0],o[0]),Math.max(i[1],o[1]),Math.min(i[2],o[2]),Math.min(i[3],o[3])):t.uTroikaClipRect.value.fromArray(i),this.geometry.applyClipRect(t.uTroikaClipRect.value)}t.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;var a=this.color;null!=a&&e.color&&e.color.isColor&&a!==e._troikaColor&&e.color.set(e._troikaColor=a);var s=this.orientation||V;if(s!==e._orientation){var u=t.uTroikaOrient.value,c=(s=s.replace(/[^-+xyz]/g,""))!==V&&s.match(/^([-+])([xyz])([-+])([xyz])$/);if(c){var l=c[1],f=c[2],h=c[3],d=c[4];U.set(0,0,0)[f]="-"===l?1:-1,B.set(0,0,0)[d]="-"===h?-1:1,j.lookAt(z,U.cross(B),B),u.setFromMatrix4(j)}else u.identity();e._orientation=s}},t.prototype.raycast=function(e,t){var n=this.textRenderInfo;if(n){var r=n.totalBounds;H.matrixWorld.multiplyMatrices(this.matrixWorld,j.set(r[2]-r[0],0,0,r[0],0,r[3]-r[1],0,r[1],0,0,1,0,0,0,0,1)),G.length=0,H.raycast(e,G);for(var i=0;i=n.length&&a.push({x:n[i+1],y:o,height:r,charIndex:i/3+1})}}return ee.set(e,t),t}e.GlyphsGeometry=C,e.Text=$,e.configureTextBuilder=d,e.createTextDerivedMaterial=N,e.fontProcessorWorkerModule=_,e.getCaretAtPoint=K,e.getSelectionRects=J,e.preloadFont=y,Object.defineProperty(e,"__esModule",{value:!0})}(t,n(0),n(162),n(163))},function(e,t,n){(function(t){var n=9007199254740991,r="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",a="[object Symbol]",s="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,c=s||u||Function("return this")();function l(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function f(e,t){for(var n=-1,r=t.length,i=e.length;++n0&&n(s)?t>1?b(s,t-1,n,r,i):f(i,s):r||(i[i.length]=s)}return i}function w(e){return x(e)||function(e){return function(e){return M(e)&&function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?p.call(e):"";return t==i||t==o}(e)}(e)}(e)&&d.call(e,"callee")&&(!m.call(e,"callee")||p.call(e)==r)}(e)||!!(g&&e&&e[g])}function _(e){if("string"==typeof e||function(e){return"symbol"==typeof e||M(e)&&p.call(e)==a}(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}var x=Array.isArray;function M(e){return!!e&&"object"==typeof e}var S,E,T=(S=function(e,t){return null==e?{}:function(e,t){return function(e,t,n){for(var r=-1,i=t.length,o={};++r-1}function h(e,t,n){for(var r=-1,i=e?e.length:0;++r0&&n(s)?t>1?z(s,t-1,n,r,i):p(i,s):r||(i[i.length]=s)}return i}function V(e){return!(!re(e)||(t=e,x&&x in t))&&(ne(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}(e)?T:o).test(function(e){if(null!=e){try{return M.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e));var t}function H(e){if(!re(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=function(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||w;return e===n}(e),n=[];for(var r in e)("constructor"!=r||!t&&S.call(e,r))&&n.push(r);return n}function W(e){return function(e,t,n){var r=t(e);return ee(e)?r:p(r,n(e))}(e,oe,$)}function X(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function q(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return V(n)?n:void 0}N.prototype.clear=function(){this.__data__=D?D(null):{}},N.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},N.prototype.get=function(e){var t=this.__data__;if(D){var r=t[e];return r===n?void 0:r}return S.call(t,e)?t[e]:void 0},N.prototype.has=function(e){var t=this.__data__;return D?void 0!==t[e]:S.call(t,e)},N.prototype.set=function(e,t){return this.__data__[e]=D&&void 0===t?n:t,this},F.prototype.clear=function(){this.__data__=[]},F.prototype.delete=function(e){var t=this.__data__,n=G(t,e);return!(n<0)&&(n==t.length-1?t.pop():R.call(t,n,1),!0)},F.prototype.get=function(e){var t=this.__data__,n=G(t,e);return n<0?void 0:t[n][1]},F.prototype.has=function(e){return G(this.__data__,e)>-1},F.prototype.set=function(e,t){var n=this.__data__,r=G(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},j.prototype.clear=function(){this.__data__={hash:new N,map:new(L||F),string:new N}},j.prototype.delete=function(e){return X(this,e).delete(e)},j.prototype.get=function(e){return X(this,e).get(e)},j.prototype.has=function(e){return X(this,e).has(e)},j.prototype.set=function(e,t){return X(this,e).set(e,t),this},U.prototype.add=U.prototype.push=function(e){return this.__data__.set(e,n),this},U.prototype.has=function(e){return this.__data__.has(e)};var Y=P?g(P,Object):ce,$=P?function(e){for(var t=[];e;)p(t,Y(e)),e=k(e);return t}:ce;function Q(e){return ee(e)||J(e)||!!(O&&e&&e[O])}function K(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||a.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=r}(e.length)&&!ne(e)}function ne(e){var t=re(e)?E.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function re(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ie(e){return!!e&&"object"==typeof e}function oe(e){return te(e)?B(e,!0):H(e)}var ae,se,ue=(ae=function(e,t){return null==e?{}:(t=d(z(t,1),Z),function(e,t){return function(e,t,n){for(var r=-1,i=t.length,o={};++r=200&&(a=m,s=!1,t=new U(t));e:for(;++oa+1e3&&(u.update(1e3*s/(e-a),100),a=e,s=0,l)){var t=performance.memory;l.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){o=this.end()},domElement:i,setMode:n}};r.Panel=function(e,t,n){var r=1/0,i=0,o=Math.round,a=o(window.devicePixelRatio||1),s=80*a,u=48*a,c=3*a,l=2*a,f=3*a,h=15*a,d=74*a,p=30*a,v=document.createElement("canvas");v.width=s,v.height=u,v.style.cssText="width:80px;height:48px";var m=v.getContext("2d");return m.font="bold "+9*a+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=n,m.fillRect(0,0,s,u),m.fillStyle=t,m.fillText(e,c,l),m.fillRect(f,h,d,p),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(f,h,d,p),{dom:v,update:function(u,g){r=Math.min(r,u),i=Math.max(i,u),m.fillStyle=n,m.globalAlpha=1,m.fillRect(0,0,s,h),m.fillStyle=t,m.fillText(o(u)+" "+e+" ("+o(r)+"-"+o(i)+")",c,l),m.drawImage(v,f+a,h,d-a,p,f,h,d-a,p),m.fillRect(f+d-a,h,a,p),m.fillStyle=n,m.globalAlpha=.9,m.fillRect(f+d-a,h,a,o((1-u/g)*p))}}},e.exports=r},function(e,t,n){var r=n(164);!function(e){"use strict";var t=["992 - Silicon Motion SM502","991 - ATI Mobility 128 M3","990 - VIA S3 Graphics ProSavage8","989 - SIS Mirage M661FX ","988 - SIS Mirage 2 M760","987 - VIA Castle Rock","986 - VIA S3G UniChrome Pro","985 - VIA S3G UniChrome Pro II","984 - ATI Radeon IGP 320M","983 - ATI Radeon IGP 340M","982 - ATI Mobility Radeon 7000 IGP","981 - Intel Extreme Graphics 2","980 - VIA Chrome9 HC","979 - ATI Mobility Radeon M6","978 - ATI Mobility Radeon M7","977 - ATI Mobility Radeon 9000 IGP","976 - ATI Mobility Radeon 9100 IGP","975 - NVIDIA GeForce 2 Go (200 / 100)","974 - NVIDIA GeForce 3 Go","965 - Intel Graphics Media Accelerator (GMA) 500","963 - Intel Graphics Media Accelerator (GMA) 600","952 - SIS Mirage 3 671MX","951 - SIS Mirage 3+ 672MX","950 - ATI Radeon Xpress 1100","949 - ATI Radeon Xpress 200M","948 - Intel Graphics Media Accelerator (GMA) 900","947 - ATI Mobility FireGL 7800","946 - ATI Mobility Radeon 7500","934 - Intel Graphics Media Accelerator (GMA) 950","933 - Intel Graphics Media Accelerator (GMA) 3150","931 - NVIDIA GeForce 4 420 Go","930 - NVIDIA GeForce 4 440 Go","929 - NVIDIA GeForce 4 460 Go","928 - NVIDIA GeForce 4 488 Go","927 - ATI Mobility Radeon 9000","926 - NVIDIA GeForce FX Go 5200","925 - ATI Mobility FireGL 9000","924 - ATI Mobility Radeon 9200","923 - Intel Graphics Media Accelerator (GMA) 3600","921 - NVIDIA GeForce 7000M","920 - NVIDIA GeForce Go 6100","919 - NVIDIA GeForce Go 6150","918 - ATI Radeon Xpress 1150","917 - NVIDIA GeForce 7150M","916 - NVIDIA GeForce 7190M","915 - Intel Graphics Media Accelerator (GMA) 3650","904 - Intel Graphics Media Accelerator (GMA) X3100","903 - ATI Radeon Xpress X1200","902 - ATI Radeon Xpress 1250","901 - ATI Radeon Xpress X1250","900 - ATI Radeon Xpress X1270","899 - NVIDIA GeForce FX Go 5600 / 5650","898 - NVIDIA Quadro FX Go 1000","897 - NVIDIA GeForce FX Go 5700","896 - NVIDIA GeForce Go 6200","895 - NVIDIA GeForce Go 6250","894 - ATI Mobility Radeon X300","893 - NVIDIA GeForce Go 6400","892 - NVIDIA GeForce Go 7200","891 - ATI Mobility Radeon 9550","890 - ATI Mobility FireGL T2","889 - ATI Mobility Radeon 9600","888 - NVIDIA GeForce4 4200 Go","887 - ATI Mobility Radeon X1300","886 - ATI Mobility FireGL T2e","885 - ATI Mobility Radeon 9700","884 - ATI Mobility Radeon HD 2300","883 - ATI Mobility Radeon X2300","882 - ATI Mobility FireGL V3100","881 - ATI Mobility FireGL V3200","880 - ATI Mobility Radeon X600","879 - NVIDIA Quadro NVS 110M","874 - NVIDIA GeForce Go 7300","873 - NVIDIA Quadro NVS 120M","872 - NVIDIA Quadro FX 350M","871 - NVIDIA GeForce Go 7400","869 - Intel Graphics Media Accelerator (GMA) 4500M","868 - Intel Graphics Media Accelerator (GMA) 4500MHD","867 - Intel Graphics Media Accelerator (GMA) 4700MHD","866 - NVIDIA GeForce 8200M G","865 - NVIDIA Quadro NVS 130M","862 - NVIDIA GeForce 8400M G","861 - ATI Radeon HD 3100","860 - ATI Mobility Radeon HD 3400","851 - ATI Radeon HD 4100","850 - ATI Radeon HD 4225","849 - ATI Radeon HD 3200","848 - ATI Mobility Radeon HD 2400","847 - NVIDIA Quadro NVS 135M","846 - NVIDIA GeForce 8400M GS","845 - NVIDIA GeForce 9100M G","844 - ATI Mobility Radeon X1400","843 - ATI Mobility Radeon X1350","842 - NVIDIA Quadro FX 360M","841 - NVIDIA Quadro NVS 150M","840 - AMD Radeon HD 6250","839 - Intel Graphics Media Accelerator (GMA) HD Graphics","838 - ATI Radeon HD 4200","837 - ATI Radeon HD 4250","836 - ATI Radeon HD 4270","835 - ATI Mobility Radeon HD 2400 XT","834 - ATI Mobility Radeon HD 3410","833 - ATI Mobility Radeon HD 3430","832 - ATI Mobility Radeon HD 3450","831 - AMD Radeon HD 6290","830 - AMD Radeon HD 7290","829 - NVIDIA GeForce 9200M GS","828 - NVIDIA Quadro NVS 160M","827 - NVIDIA Quadro FX 370M","826 - NVIDIA GeForce 9300M GS","825 - NVIDIA ION 2","824 - NVIDIA GeForce 9300M G","823 - ATI Mobility Radeon HD 3470","822 - NVIDIA GeForce 9400M GeForceBoost","821 - ATI Mobility Radeon HD 3470 Hybrid X2","820 - AMD Radeon HD 8180","819 - AMD Radeon HD 6310","818 - AMD Radeon HD 7310","817 - AMD Radeon HD 6320","816 - AMD Radeon HD 7340","812 - Intel HD Graphics (Bay Trail)","803 - Intel HD Graphics (Sandy Bridge)","802 - NVIDIA GeForce 9400M (G) / ION (LE)","801 - NVIDIA GeForce G 205M","800 - NVIDIA GeForce G 102M","799 - NVIDIA GeForce 9500M GE","798 - NVIDIA GeForce G 103M","797 - NVIDIA GeForce G 105M","795 - Intel HD Graphics 2000","794 - NVIDIA Quadro NVS 140M","793 - NVIDIA GeForce 8400M GT","792 - ATI Mobility Radeon HD 4330","791 - AMD Radeon HD 6330M","790 - NVIDIA GeForce G 110M","789 - ATI Mobility FireGL V5000","788 - ATI Mobility Radeon X700","787 - ATI Mobility Radeon X1450","786 - NVIDIA GeForce Go 6600","785 - ATI Mobility Radeon 9800","784 - ATI Mobility FireGL V5200","783 - ATI Mobility Radeon X1600","782 - ATI Mobility Radeon X800","781 - NVIDIA Quadro NVS 300M","780 - NVIDIA GeForce Go 7600","779 - ATI Mobility Radeon X2500","778 - ATI Mobility FireGL V5250","777 - ATI Mobility Radeon X1700","776 - NVIDIA GeForce 305M","775 - ATI Mobility Radeon HD 530v","774 - ATI Radeon HD 4350","773 - ATI Mobility Radeon HD 4350","772 - ATI Mobility Radeon HD 4530","771 - AMD Radeon HD 6350M","770 - AMD Radeon HD 7350M","769 - Intel HD Graphics (Ivy Bridge)","768 - Intel HD Graphics 2500","767 - ATI Mobility Radeon HD 4550","766 - ATI Mobility Radeon HD 540v","765 - AMD Radeon HD 8210","764 - ATI Mobility Radeon HD 5430","763 - AMD Radeon HD 6380G","762 - AMD Radeon HD 6430M","761 - ATI Mobility Radeon X800XT","760 - NVIDIA Quadro FX Go 1400","759 - NVIDIA GeForce Go 6800","758 - NVIDIA GeForce Go 7700","757 - NVIDIA NVS 2100M","756 - NVIDIA GeForce 8600M GS","755 - NVIDIA GeForce 9500M G","754 - NVIDIA GeForce Go 7600 GT","753 - NVIDIA GeForce 315M","752 - NVIDIA GeForce 405M","751 - NVIDIA NVS 3100M","750 - NVIDIA GeForce G210M","749 - NVIDIA GeForce 310M","748 - NVIDIA Quadro FX 380M","747 - Intel HD Graphics 3000","746 - ATI Mobility Radeon HD 2600","745 - NVIDIA GeForce 8600M GT","744 - ATI Mobility Radeon HD 5450","743 - NVIDIA Quadro FX 570M","742 - ATI Mobility Radeon HD 4570","741 - Intel HD Graphics (Cherry Trail)","740 - AMD Radeon HD 8250","739 - AMD Radeon R6 (Mullins)","738 - AMD Radeon HD 8240","737 - ATI Mobility Radeon HD 545v","736 - ATI Mobility Radeon HD 5145","735 - ATI Mobility FireGL V5700","734 - ATI Mobility Radeon HD 3650","733 - AMD Radeon HD 7430M","732 - AMD Radeon HD 6450M","731 - ATI Mobility Radeon HD 5470","730 - AMD Radeon HD 8280","729 - AMD Radeon HD 6370M","727 - AMD Radeon R2 (Mullins/Beema/Carrizo-L)","723 - AMD Radeon HD 7370M","722 - NVIDIA GeForce 410M","721 - NVIDIA GeForce GT 415M","720 - ATI Mobility Radeon HD 2700","719 - AMD Radeon HD 6480G","718 - AMD Radeon HD 7400G","717 - NVIDIA GeForce 9500M GS","716 - NVIDIA GeForce 9600M GS","715 - NVIDIA GeForce Go 7800","714 - NVIDIA GeForce Go 6800 Ultra","713 - ATI Mobility Radeon X1800","712 - ATI Mobility Radeon X1800XT","711 - ATI Mobility Radeon X1900","710 - ATI Mobility Radeon HD 2600 XT","709 - NVIDIA GeForce GT 320M","708 - NVIDIA GeForce 320M","707 - AMD Radeon HD 8310G","706 - AMD Radeon HD 6520G","705 - Intel HD Graphics (Haswell)","701 - ATI Mobility FireGL V5725","700 - ATI Mobility Radeon HD 3670","699 - AMD Radeon HD 7420G","698 - NVIDIA GeForce GT 520M","697 - AMD FirePro M3900","696 - AMD Radeon HD 6470M","695 - Intel HD Graphics 400 (Braswell)","694 - Intel HD Graphics (Braswell)","693 - Intel HD Graphics 405 (Braswell)","690 - NVIDIA GeForce 705M","689 - NVIDIA GeForce 610M","688 - AMD Radeon HD 7450M","687 - AMD Radeon HD 6510G2","686 - NVIDIA GeForce GT 120M","685 - NVIDIA Quadro FX 770M","684 - NVIDIA GeForce GT 220M","683 - NVIDIA GeForce 9600M GT","682 - NVIDIA Quadro FX 1500M","681 - NVIDIA Quadro NVS 320M","680 - NVIDIA GeForce Go 7900 GS","679 - NVIDIA GeForce Go 7800 GTX","678 - NVIDIA Quadro FX 1600M","677 - NVIDIA Quadro FX 1700M","676 - NVIDIA GeForce 8700M GT","675 - NVIDIA GeForce 9650M GT","674 - NVIDIA GeForce 9650M GS","673 - Intel HD Graphics 500","672 - Intel UHD Graphics 600","671 - AMD Radeon HD 8330","670 - AMD Radeon HD 8350G","669 - NVIDIA Quadro FX 2500M","668 - NVIDIA GeForce Go 7900 GTX","667 - NVIDIA NVS 4200M","666 - NVIDIA GeForce GT 130M","665 - NVIDIA GeForce Go 7900 GS SLI","664 - NVIDIA GeForce 8600M GT SLI","663 - NVIDIA GeForce Go 7800 GTX SLI","662 - NVIDIA GeForce GT 325M","661 - AMD Radeon HD 7520G","660 - NVIDIA GeForce GT 520MX","654 - AMD Radeon HD 8400","653 - AMD Radeon HD 8410G","652 - AMD Radeon HD 6490M","651 - AMD Radeon HD 7470M","650 - AMD Radeon HD 8450G","649 - AMD Radeon HD 6515G2","648 - AMD Radeon HD 6480G + HD 7450M Dual Graphics","647 - AMD Radeon HD 7500G","646 - AMD Radeon HD 6540G2","645 - AMD Radeon HD 6520G + HD 7450M Dual Graphics","644 - AMD Radeon HD 6545G2","643 - AMD Radeon HD 6450 GDDR5","642 - Intel HD Graphics (Skylake)","641 - Intel HD Graphics 4200","640 - Intel HD Graphics (Broadwell)","639 - AMD Radeon R2 (Stoney Ridge)","638 - AMD Radeon R3 (Mullins/Beema)","637 - AMD Radeon R4 (Kaveri)","636 - AMD Radeon R4 (Beema)","635 - AMD Radeon R5 (Beema/Carrizo-L)","633 - AMD Radeon R4 (Stoney Ridge)","632 - AMD Radeon HD 6620G","629 - Intel HD Graphics 4000","628 - AMD Radeon HD 7480D","627 - ATI Mobility Radeon HD 550v","626 - NVIDIA GeForce GT 230M","625 - NVIDIA GeForce 9700M GT","624 - NVIDIA GeForce 8700M GT SLI","623 - NVIDIA Quadro FX 3500M","622 - NVIDIA GeForce Go 7950 GTX","621 - AMD Radeon HD 7510M","620 - Intel HD Graphics 5300","619 - Intel HD Graphics 505","618 - Intel UHD Graphics 605","617 - AMD Radeon HD 7490M","616 - NVIDIA GeForce GT 240M","615 - NVIDIA Quadro NVS 5100M","614 - NVIDIA Quadro FX 880M","613 - NVIDIA GeForce GT 330M","612 - ATI Mobility Radeon HD 3850","611 - AMD Radeon HD 7530M","610 - NVIDIA GeForce GT 420M","609 - NVIDIA GeForce Go 7900 GTX SLI","608 - NVIDIA GeForce GT 220","607 - NVIDIA GeForce Go 7950 GTX SLI","606 - ATI Mobility Radeon HD 4650","605 - ATI Mobility Radeon HD 560v","604 - ATI Mobility Radeon HD 5165","603 - AMD Radeon HD 6640G2","602 - AMD Radeon HD 6620G + HD 7450M Dual Graphics","601 - ATI Mobility Radeon HD 3870","600 - AMD Radeon HD 7600G","599 - AMD Radeon HD 7500G + HD 7550M Dual Graphics","598 - NVIDIA GeForce GT 335M","597 - NVIDIA Quadro FX 2700M","596 - AMD Radeon HD 6645G2","595 - NVIDIA GeForce 9700M GTS","594 - NVIDIA GeForce GT 425M","593 - ATI Mobility Radeon HD 4670","592 - AMD Radeon HD 7550M","591 - ATI Mobility Radeon HD 565v","590 - NVIDIA NVS 5200M","589 - Intel HD Graphics 510","588 - AMD Radeon HD 8610G","587 - Intel HD Graphics 4400","586 - Intel HD Graphics 610","585 - Intel UHD Graphics 610","584 - Intel HD Graphics 515","576 - AMD Radeon HD 7640G","575 - AMD Radeon HD 8470D","574 - AMD Radeon HD 7620G","573 - AMD Radeon HD 7610M","572 - AMD Radeon HD 7640G + HD 7610M Dual Graphics","571 - AMD Radeon HD 6550D","570 - NVIDIA GeForce GT 525M","569 - NVIDIA GeForce GT 620M","568 - NVIDIA GeForce GT 625M","567 - NVIDIA Quadro K500M","566 - AMD Radeon HD 8550G","565 - AMD Radeon HD 6530M","564 - AMD Radeon HD 8510G","563 - ATI Mobility Radeon HD 5650","562 - NVIDIA Quadro FX 1800M","561 - AMD Radeon HD 7630M","560 - AMD Radeon HD 7570M","559 - AMD FirePro M2000","558 - AMD Radeon HD 7650M","557 - AMD Radeon HD 6630M","556 - NVIDIA GeForce GTS 250M","555 - NVIDIA GeForce GTS 350M","554 - AMD Radeon HD 7590M","553 - AMD Radeon HD 6550M","552 - ATI Radeon HD 5570","551 - NVIDIA Quadro K510M","550 - Intel HD Graphics 5000","549 - AMD Radeon HD 6680G2","548 - NVIDIA GeForce GT 435M","547 - AMD Radeon HD 7660G","546 - NVIDIA GeForce 710M","545 - NVIDIA NVS 5400M","544 - ATI FirePro M5800","543 - AMD Radeon R5 (Kaveri)","542 - AMD Radeon R5 (Carrizo)","541 - Intel HD Graphics 615","540 - Intel UHD Graphics 615","539 - Intel UHD Graphics 617","530 - Qualcomm Adreno 630","526 - Intel HD Graphics 5500","525 - ATI Mobility Radeon HD 5730","524 - Intel HD Graphics 4600","523 - AMD Radeon HD 6650M","522 - AMD Radeon HD 6690G2","521 - NVIDIA GeForce GT 540M","520 - Intel Iris Graphics 5100","519 - AMD Radeon HD 8550M","518 - NVIDIA Quadro K610M","517 - Intel HD Graphics 6000","516 - AMD Radeon HD 8570M","515 - AMD Radeon HD 8450G + Radeon HD 8570M Dual Graphics","514 - AMD Radeon HD 6720G2","513 - ATI Mobility Radeon HD 5750","511 - AMD Radeon R5 (Stoney Ridge)","510 - AMD Radeon RX Vega 2","509 - AMD Radeon R5 M420","508 - AMD Radeon R5 M315","507 - AMD Radeon R5 M230","506 - AMD Radeon R5 M320","505 - AMD Radeon R5 M240","504 - NVIDIA GeForce 8800M GTS","503 - NVIDIA GeForce GT 720M","502 - Intel UHD Graphics G4 (Lakefield GT1 48 EU)","501 - Intel Iris Graphics 6100","500 - Intel HD Graphics 520","499 - NVIDIA GeForce 820M","498 - NVIDIA GeForce 910M","497 - NVIDIA Quadro 1000M","496 - AMD Radeon RX Vega 3","495 - AMD Radeon R5 M255","494 - AMD Radeon R5 M430","493 - AMD Radeon R5 M330","492 - AMD Radeon R5 M335","491 - NVIDIA GeForce GTS 150M","490 - AMD Radeon HD 7560D","489 - NVIDIA GeForce GT 630M","488 - AMD Radeon HD 7670M","487 - AMD Radeon HD 7520G + HD 7670M Dual Graphics","486 - AMD Radeon HD 6620G + HD 7670M Dual Graphics","485 - AMD Radeon HD 7640G + HD 7670M Dual Graphics","484 - AMD Radeon HD 8650G","483 - AMD Radeon HD 6570M","482 - ATI Mobility Radeon HD 5770","481 - ATI Mobility Radeon HD 4830","480 - NVIDIA GeForce 9800M GS","479 - AMD Radeon HD 6730M","478 - AMD Radeon HD 6740G2","477 - AMD Radeon HD 6760G2","476 - ATI Mobility Radeon HD 5830","475 - AMD Radeon HD 6830M","474 - NVIDIA GeForce GT 430","473 - NVIDIA GeForce 9800M GTS","472 - NVIDIA GeForce GTS 160M","471 - NVIDIA GeForce GTS 260M","470 - AMD Radeon HD 8590M","469 - NVIDIA GeForce GT 550M","468 - NVIDIA Quadro K1000M","467 - AMD Radeon HD 6750M","466 - AMD Radeon HD 7660D","465 - AMD Radeon R6 M255DX","464 - AMD Radeon HD 8670M","463 - AMD Radeon HD 8550G + HD 8670M Dual Graphics","462 - AMD Radeon HD 7660G + HD 7670M Dual Graphics","461 - AMD Radeon HD 8650G + HD 8570M Dual Graphics","460 - AMD Radeon HD 8650G + HD 8670M Dual Graphics","459 - AMD Radeon HD 8570D","458 - Intel HD Graphics 5600","457 - AMD Radeon HD 7690M","456 - AMD Radeon HD 6755G2","455 - NVIDIA GeForce GT 240 GDDR5","454 - NVIDIA GeForce GTS 360M","453 - NVIDIA GeForce GT 445M","452 - NVIDIA Quadro FX 3600M","451 - NVIDIA GeForce 8800M GTX","450 - NVIDIA GeForce 9800M GT","449 - NVIDIA Quadro 2000M","448 - AMD FirePro W2100","447 - AMD Radeon HD 6850M","446 - ATI Mobility Radeon HD 5850","445 - ATI Radeon HD 5670","444 - NVIDIA GeForce GT 555M","443 - NVIDIA GeForce GT 635M","442 - AMD Radeon HD 6770M","441 - AMD Radeon HD 8730M","440 - AMD Radeon HD 8650M","439 - AMD Radeon R6 (Kaveri)","438 - NVIDIA GeForce GT 640M LE","437 - AMD FirePro M5950","436 - AMD Radeon HD 7690M XT","435 - AMD Radeon HD 8670D","434 - AMD Radeon HD 6775G2","433 - NVIDIA Quadro FX 2800M","432 - NVIDIA GeForce 9800M GTX","431 - NVIDIA GeForce GTX 260M","430 - ATI Mobility Radeon HD 4850","429 - ATI FirePro M7740","428 - ATI Mobility Radeon HD 4860","427 - Qualcomm Adreno 680","426 - Qualcomm Adreno 685","425 - AMD Radeon R6 (Carrizo)","424 - Intel HD Graphics 620","423 - Intel UHD Graphics 620","422 - AMD Radeon R5 (Bristol Ridge)","420 - Intel HD Graphics P530","419 - Intel HD Graphics 530","418 - Intel UHD Graphics G7 (Lakefield GT2 64 EU)","417 - Intel HD Graphics P630","416 - Intel HD Graphics 630","415 - Intel UHD Graphics P630","414 - Intel UHD Graphics 630","413 - Intel UHD Graphics G1 (Ice Lake 32 EU)","412 - AMD Radeon RX Vega 5","411 - AMD Radeon RX Vega 6 (Ryzen 2000/3000)","410 - AMD Radeon R6 M340DX","409 - AMD Radeon 610","408 - AMD Radeon 520","407 - AMD Radeon R7 M340","406 - AMD Radeon R7 M260","405 - NVIDIA Quadro FX 3700M","404 - ATI Mobility Radeon HD 3850 X2","403 - NVIDIA GeForce 8800M GTX SLI","402 - ATI Mobility Radeon HD 3870 X2","401 - NVIDIA GeForce 9800M GTS SLI","400 - AMD Radeon R7 M440","399 - AMD Radeon 620","398 - AMD Radeon R8 M445DX","397 - AMD Radeon HD 8690M","396 - NVIDIA GeForce 9800M GT SLI","395 - NVIDIA GeForce 920M","394 - NVIDIA GeForce GTX 280M","393 - AMD Radeon R7 M360","391 - AMD Radeon HD 7730M","390 - AMD Radeon R7 M460","389 - AMD Radeon R8 M365DX","388 - AMD Radeon R7 (Kaveri)","387 - AMD Radeon R7 (Carrizo)","386 - NVIDIA GeForce GT 640M","385 - AMD Radeon R7 (Bristol Ridge)","384 - ATI Mobility Radeon HD 4870","383 - NVIDIA GeForce GTX 285M","382 - NVIDIA Quadro FX 3800M","381 - AMD Radeon R7 M265","380 - AMD Radeon R7 M270","379 - NVIDIA Quadro 3000M","378 - AMD Radeon HD 8750M","377 - AMD FirePro M4100","376 - AMD Radeon HD 7750M","375 - NVIDIA GeForce GT 645M","374 - NVIDIA GeForce GT 730M","373 - AMD Radeon HD 8550G + HD 8750M Dual Graphics","372 - NVIDIA GeForce GTX 460M","371 - AMD Radeon R7 M260X","370 - AMD Radeon HD 8770M","369 - AMD Radeon HD 8830M","368 - NVIDIA GeForce 9800M GTX SLI","367 - ATI Radeon HD 4850","366 - AMD Radeon HD 6870M","365 - ATI FirePro M7820","364 - AMD FirePro M4000","363 - NVIDIA Quadro 5000M","362 - NVIDIA GeForce 825M","361 - ATI Mobility Radeon HD 5870","360 - NVIDIA GeForce GT 735M","359 - NVIDIA GeForce GTX 260M SLI","358 - NVIDIA GeForce GTS 450","357 - NVIDIA Quadro K2000M","352 - Intel Iris Graphics 540","351 - NVIDIA GeForce 920MX","350 - Intel Iris Plus Graphics 640","349 - NVIDIA GeForce MX110","348 - NVIDIA GeForce 830M","346 - Intel Iris Plus Graphics 645","345 - AMD Radeon RX Vega 6 (Ryzen 4000)","344 - AMD Radeon 625","343 - AMD Radeon 530","342 - Intel Iris Graphics 550","341 - NVIDIA GeForce 930M","340 - Intel Iris Plus Graphics 650","339 - NVIDIA GeForce GT 740M","338 - AMD Radeon R7 384 Cores (Kaveri Desktop)","337 - Intel Iris Pro Graphics 5200","336 - AMD Radeon R7 512 Cores (Kaveri Desktop)","335 - NVIDIA GeForce GTX 560M","334 - AMD Radeon HD 7770M","333 - NVIDIA GeForce GT 745M","332 - AMD Radeon R7 M275DX","331 - NVIDIA GeForce 840M","330 - NVIDIA Quadro M500M","329 - NVIDIA Quadro K620M","328 - NVIDIA GeForce GT 650M","327 - AMD Radeon R7 M370","326 - AMD Radeon R7 M380","325 - AMD Radeon R7 M445","324 - Intel Iris Plus Graphics 655","323 - AMD Radeon R9 M375","322 - AMD FirePro W4190M","321 - NVIDIA Quadro M600M","318 - NVIDIA GeForce 930MX","317 - Intel Iris Plus Graphics G4 (Ice Lake 48 EU)","316 - NVIDIA GeForce 940M","315 - AMD Radeon RX Vega 7","314 - AMD Radeon RX Vega 8 (Ryzen 2000/3000)","313 - NVIDIA Quadro K1100M","312 - NVIDIA Quadro M520","311 - NVIDIA GeForce 940MX","310 - NVIDIA GeForce MX130","309 - Intel Iris Pro Graphics 6200","308 - NVIDIA GeForce GT 750M","307 - NVIDIA GeForce GTX 480M","306 - NVIDIA GeForce GTX 470M","305 - NVIDIA Quadro 4000M","304 - ATI Mobility Radeon HD 4870 X2","303 - AMD FirePro W4100","302 - AMD FirePro W4170M","301 - AMD Radeon HD 8790M","300 - AMD Radeon R7 M465","299 - AMD Radeon HD 7850M","298 - AMD Radeon R9 M265X","297 - AMD Radeon R9 M365X","296 - AMD Radeon HD 8850M","295 - NVIDIA GeForce 845M","294 - NVIDIA GeForce GTX 660M","293 - NVIDIA GeForce GT 755M","292 - AMD Radeon R7 250","291 - AMD Radeon HD 6950M","290 - NVIDIA GeForce GTX 280M SLI","289 - NVIDIA GeForce GTX 550 Ti","288 - ATI Radeon HD 5770","287 - NVIDIA Quadro K2100M","286 - AMD Radeon RX Vega 8 (Ryzen 4000)","285 - NVIDIA GeForce MX230","284 - AMD FirePro M5100","283 - AMD FirePro M6000","282 - Intel UHD Graphics Xe G4 48EUs","281 - NVIDIA GeForce GTX 570M","280 - NVIDIA Quadro K3000M","279 - AMD Radeon HD 7870M","278 - AMD Radeon HD 8870M","277 - AMD Radeon R9 M270","276 - AMD Radeon HD 6970M","275 - AMD FirePro M8900","274 - AMD FirePro W5130M","273 - NVIDIA Maxwell GPU Surface Book","272 - AMD Radeon RX Vega 9","271 - NVIDIA GeForce GTX 670M","270 - AMD Radeon R9 M275","269 - NVIDIA GeForce GTX 760M","268 - NVIDIA Quadro 5010M","267 - NVIDIA GeForce GTX 670MX","266 - AMD Radeon R9 M370X","265 - AMD FirePro W5170M","264 - NVIDIA Quadro K3100M","263 - NVIDIA GeForce GTX 285M SLI","262 - AMD Radeon HD 6790","261 - NVIDIA GeForce GTX 460 768MB","260 - NVIDIA GeForce GTX 485M","259 - ATI Mobility Radeon HD 5870 Crossfire","258 - NVIDIA GeForce GTX 460M SLI","257 - NVIDIA GeForce GT 650M SLI","256 - AMD Radeon HD 7770","255 - AMD Radeon R9 M380","254 - AMD Radeon R9 M385","253 - AMD Radeon R9 M470","252 - AMD Radeon HD 6990M","251 - NVIDIA GeForce GTX 580M","250 - NVIDIA GeForce GTX 675M","249 - ATI Radeon HD 5850","248 - Intel Iris Pro Graphics 580","247 - Intel Iris Pro Graphics P580","246 - AMD Radeon RX Vega 10","245 - Intel Iris Plus Graphics G7 (Ice Lake 64 EU)","244 - NVIDIA Quadro P500","243 - NVIDIA Quadro K4000M","242 - NVIDIA GeForce GTX 560M SLI","241 - NVIDIA GeForce GTX 480M SLI","240 - NVIDIA GeForce GTX 470M SLI","239 - NVIDIA GeForce GTX 765M","238 - NVIDIA GeForce 945M","237 - NVIDIA GeForce GTX 470","236 - AMD Radeon HD 6870","235 - NVIDIA GeForce GTX 560 Ti","234 - AMD Radeon HD 7950M","233 - AMD Radeon R9 M280X","232 - AMD Radeon RX Vega 11","231 - NVIDIA Quadro M620","230 - NVIDIA Quadro M1000M","229 - NVIDIA GeForce GTX 850M","228 - NVIDIA Quadro P520","227 - AMD Radeon R9 M385X","226 - AMD Radeon R9 M470X","225 - AMD Radeon 540X","224 - AMD Radeon 630","223 - AMD Radeon Pro 450","222 - NVIDIA GeForce GTX 950M","221 - NVIDIA GeForce GT 750M SLI","220 - NVIDIA GeForce GTX 675MX","219 - AMD Radeon HD 6970M Crossfire","218 - NVIDIA GeForce GTX 485M SLI","217 - NVIDIA GeForce GT 755M SLI","216 - AMD Radeon HD 6990M Crossfire","215 - NVIDIA GeForce GTX 580M SLI","214 - NVIDIA GeForce GTX 860M","213 - AMD Radeon Pro WX 3100","212 - AMD Radeon RX 540","211 - AMD Radeon Pro WX 2100","210 - AMD Radeon RX 540X","209 - NVIDIA GeForce GTX 770M","208 - Intel Iris Xe Graphics G7 80EUs","207 - NVIDIA Quadro K4100M","206 - NVIDIA Quadro K5000M","205 - NVIDIA Quadro M2000M","204 - NVIDIA GeForce MX330","203 - NVIDIA GeForce MX150","202 - NVIDIA GeForce MX250","201 - NVIDIA Quadro P600","200 - NVIDIA GeForce GT 1030","199 - AMD Radeon Pro 455","198 - AMD Radeon Pro 555","197 - AMD Radeon Pro 555X","196 - AMD Radeon Pro WX 3200","195 - AMD Radeon RX 640","194 - AMD Radeon RX 550","193 - AMD Radeon RX 550X","192 - NVIDIA Quadro P620","191 - NVIDIA Quadro M1200","190 - NVIDIA GeForce GTX 480","189 - NVIDIA GeForce GTX 570","188 - NVIDIA GeForce GTX 670MX SLI","187 - NVIDIA GeForce GTX 750 Ti","186 - NVIDIA GeForce GTX 960M","185 - AMD Radeon Pro WX 4130","184 - AMD Radeon Pro 460","183 - AMD Radeon Pro 560","182 - AMD Radeon Pro 560X","181 - AMD Radeon HD 7970M","180 - AMD FirePro M6100","179 - AMD Radeon R9 M390","178 - NVIDIA GeForce GTX 775M","177 - NVIDIA GeForce GTX 680M","176 - AMD Radeon RX 460","175 - NVIDIA GeForce GTX 765M SLI","174 - NVIDIA GeForce GTX 675M SLI","173 - AMD Radeon HD 6970","172 - NVIDIA GeForce GTX 580","171 - AMD Radeon HD 8970M","170 - AMD Radeon R9 M290X","169 - NVIDIA GeForce GTX 870M","168 - NVIDIA Quadro M2200","167 - AMD Radeon RX 560","166 - AMD Radeon RX 560X","165 - NVIDIA GeForce GTX 965M","164 - AMD Radeon HD 7870","163 - AMD Radeon Pro WX 4150","162 - AMD Radeon RX 460","161 - NVIDIA GeForce GTX 680MX","160 - NVIDIA GeForce MX350","159 - NVIDIA Quadro P1000","158 - NVIDIA Quadro K5100M","157 - NVIDIA GeForce GTX 780M","156 - NVIDIA GeForce GTX 760","155 - NVIDIA GeForce GTX 660 Ti","154 - AMD Radeon R9 270X","153 - NVIDIA GeForce GTX 950","152 - NVIDIA GeForce GTX 1050 Max-Q","151 - NVIDIA GeForce GTX 880M","150 - NVIDIA GeForce GTX 590","149 - Intel Iris Xe Graphics G7 96EUs","148 - AMD Radeon R7 370","147 - AMD Radeon R9 M395","146 - AMD FirePro W7170M","145 - Intel Xe DG1 LP (iDG1LP) Mobile","144 - NVIDIA GeForce GTX 1050 Mobile","143 - NVIDIA GeForce GTX 1050","142 - NVIDIA Quadro M3000M","141 - AMD Radeon R9 M390X","140 - AMD Radeon R9 M295X","139 - AMD Radeon R9 M485X","138 - AMD Radeon Pro Vega 16","137 - AMD Radeon Pro WX Vega M GL","136 - AMD Radeon RX Vega M GL / 870","135 - NVIDIA GeForce GTX 1050 Ti Max-Q","134 - AMD Radeon R9 M395X","133 - NVIDIA GeForce GTX 770M SLI","132 - AMD Radeon HD 7970","131 - NVIDIA GeForce GTX 680","130 - NVIDIA GeForce GTX 860M SLI","129 - NVIDIA GeForce GTX 970M","128 - NVIDIA Quadro M4000M","127 - NVIDIA Quadro P2000 Max-Q","126 - NVIDIA Quadro P2000","125 - NVIDIA GeForce GTX 1050 Ti","124 - NVIDIA GeForce GTX 1050 Ti Mobile","123 - NVIDIA GeForce GTX 960","122 - AMD Radeon R9 380","121 - AMD Radeon R9 280X","120 - NVIDIA Quadro M5000M","119 - AMD Radeon Pro Vega 20","118 - AMD Radeon RX Vega M GH","117 - NVIDIA GeForce GTX 980M","116 - AMD Radeon HD 7970M Crossfire","115 - NVIDIA GeForce GTX 680M SLI","114 - AMD Radeon HD 8970M Crossfire","113 - AMD Radeon R9 M290X Crossfire","112 - NVIDIA GeForce GTX 965M SLI","111 - AMD Radeon RX 490M","110 - AMD Radeon R9 290X","109 - NVIDIA GeForce GTX 780M SLI","108 - NVIDIA GeForce GTX 880M SLI","107 - NVIDIA GeForce MX450","106 - NVIDIA Quadro T1000 Max-Q","105 - NVIDIA Quadro T1000","104 - NVIDIA GeForce GTX 1650 Max-Q","103 - AMD Radeon RX 470","102 - AMD Radeon RX 570","101 - AMD Radeon RX 570X","100 - AMD Radeon RX 470","99 - AMD Radeon Pro WX 7100","98 - AMD Radeon RX 480","97 - NVIDIA Quadro P3000 Max-Q","96 - NVIDIA GeForce GTX 1060 Max-Q","95 - NVIDIA GeForce GTX 1650 Ti Max-Q","94 - NVIDIA GeForce GTX 1650","93 - NVIDIA GeForce GTX 1650 Mobile","92 - NVIDIA GeForce GTX 970","91 - NVIDIA Quadro P3000","90 - AMD Radeon RX 5300M","89 - AMD Radeon Pro 5300M","88 - AMD Radeon RX Vega Mobile","87 - NVIDIA GeForce GTX 780 Ti","86 - AMD Radeon RX 580","85 - AMD Radeon RX 580X","84 - NVIDIA Quadro P3200","83 - NVIDIA Quadro P4000 Max-Q","82 - AMD Radeon Pro 5500M","81 - AMD Radeon RX 5500M","80 - NVIDIA GeForce GTX 1060 Mobile","79 - AMD Radeon RX 480","78 - NVIDIA GeForce GTX 1650 Ti Mobile","76 - NVIDIA Quadro T2000 Max-Q","75 - NVIDIA Quadro T2000","74 - NVIDIA Quadro P4000","73 - AMD Radeon RX 570","72 - NVIDIA GeForce GTX 1060","71 - NVIDIA GeForce GTX 970M SLI","70 - AMD Radeon R9 390X","69 - NVIDIA Quadro M5500","68 - NVIDIA GeForce GTX 980","67 - AMD Radeon RX 580","66 - AMD Radeon RX 590","65 - NVIDIA GeForce GTX 980","64 - AMD Radeon R9 Nano","63 - AMD Radeon R9 Fury","62 - NVIDIA GeForce GTX 980M SLI","61 - NVIDIA Quadro P5000 Max-Q","60 - NVIDIA GeForce GTX 1660 Ti Max-Q","59 - AMD Radeon Pro 5600M","58 - NVIDIA GeForce GTX 1070 Max-Q","57 - NVIDIA GeForce GTX 1660","56 - NVIDIA GeForce GTX 980 Ti","55 - AMD Radeon RX 5600M","54 - NVIDIA GeForce GTX 1660 Ti Mobile","53 - NVIDIA Quadro P5000","52 - NVIDIA GeForce GTX 1660 Super","51 - NVIDIA GeForce GTX 1660 Ti","50 - NVIDIA Quadro P4200","49 - NVIDIA GeForce GTX 1070 Mobile","48 - NVIDIA GeForce RTX 2060 Max-Q","47 - AMD Radeon Pro Vega 56","46 - NVIDIA GeForce GTX 1080 Max-Q","45 - AMD Radeon RX 5600 XT","44 - NVIDIA GeForce GTX 1070","43 - NVIDIA Quadro P5200","42 - NVIDIA GeForce GTX 980 SLI","41 - NVIDIA GeForce RTX 2060 Mobile","40 - AMD Radeon RX Vega 56","39 - NVIDIA Quadro RTX 3000 Max-Q","38 - NVIDIA Quadro RTX 3000","37 - NVIDIA GeForce RTX 2070 Max-Q","36 - NVIDIA GeForce GTX 1070 Ti","35 - NVIDIA GeForce RTX 2070 Super Max-Q","34 - NVIDIA GeForce RTX 2060","33 - NVIDIA Quadro RTX 4000 Max-Q","32 - NVIDIA Quadro RTX 4000","31 - NVIDIA GeForce GTX 1080 Mobile","30 - AMD Radeon RX Vega 64","29 - AMD Radeon RX 5700M","28 - AMD Radeon RX 5700","27 - NVIDIA GeForce RTX 2060 Super","26 - NVIDIA GeForce RTX 2070 Mobile","25 - NVIDIA GeForce RTX 2070 Super Mobile","24 - NVIDIA GeForce GTX 1080","22 - NVIDIA GeForce RTX 2070","21 - AMD Radeon RX 5700 XT","20 - AMD Radeon VII","19 - NVIDIA GeForce RTX 2070 Super","18 - NVIDIA GeForce RTX 2080 Max-Q","17 - NVIDIA GeForce RTX 2080 Super Max-Q","16 - NVIDIA GeForce GTX 1070 SLI","15 - NVIDIA GeForce GTX 1070 SLI","14 - NVIDIA GeForce GTX 1080 SLI","13 - NVIDIA Titan X Pascal","12 - NVIDIA GeForce GTX 1080 Ti","11 - NVIDIA GeForce RTX 2080 Mobile","10 - NVIDIA GeForce RTX 2080 Super Mobile","9 - NVIDIA Quadro RTX 5000 Max-Q","8 - NVIDIA Quadro RTX 5000","6 - NVIDIA GeForce RTX 2080","5 - NVIDIA GeForce RTX 2080 Super","4 - NVIDIA Quadro RTX 6000","2 - NVIDIA GeForce RTX 2080 Ti","1 - NVIDIA Titan RTX"],n=["973 - ARM Mali-200","972 - Qualcomm Adreno 200","971 - PowerVR SGX530","970 - PowerVR SGX531","969 - PowerVR SGX535","968 - Vivante GC800","967 - Qualcomm Adreno 203","966 - Qualcomm Adreno 205","964 - PowerVR SGX540","962 - NVIDIA GeForce ULP (Tegra 2)","961 - ARM Mali-400 MP","960 - ARM Mali-400 MP2","959 - Vivante GC1000+ Dual-Core","958 - Qualcomm Adreno 220","957 - Broadcom VideoCore-IV","956 - NVIDIA GeForce ULP (Tegra 3)","955 - ARM Mali-400 MP4","954 - Vivante GC4000","953 - Qualcomm Adreno 225","945 - Qualcomm Adreno 302","944 - Vivante GC7000UL","943 - ARM Mali-T720","942 - Qualcomm Adreno 304","941 - Qualcomm Adreno 305","940 - Qualcomm Adreno 306","939 - Qualcomm Adreno 308","938 - PowerVR SGX544","937 - ARM Mali-T720 MP2","936 - PowerVR SGX544MP2","935 - PowerVR SGX545","932 - PowerVR SGX543MP2","922 - PowerVR SGX543MP3","914 - ARM Mali-T830 MP1","913 - ARM Mali-450 MP4","912 - ARM Mali-T720 MP4","911 - PowerVR GE8100","910 - PowerVR GE8300","909 - PowerVR GE8320","908 - ARM Mali-T760 MP2","907 - Qualcomm Adreno 320","906 - ARM Mali-T624","905 - PowerVR SGX543MP4","878 - ARM Mali-T830 MP2","877 - Qualcomm Adreno 405","876 - PowerVR G6200","875 - NVIDIA GeForce Tegra 4","870 - ARM Mali-T604 MP4","864 - ARM Mali-T830 MP3","863 - ARM Mali-T860 MP2","859 - Qualcomm Adreno 504","858 - Qualcomm Adreno 505","857 - PowerVR GE8322 / IMG8322","856 - Qualcomm Adreno 506","855 - Qualcomm Adreno 508","854 - Qualcomm Adreno 509","853 - ARM Mali-T628 MP4","852 - PowerVR SGX554MP4","814 - ARM Mali-T760 MP4","813 - ARM Mali-T628 MP6","812 - Intel HD Graphics (Bay Trail)","811 - PowerVR G6400","810 - PowerVR GX6250","809 - PowerVR G6430","808 - Qualcomm Adreno 330","807 - Qualcomm Adreno 510","806 - Qualcomm Adreno 512","805 - Qualcomm Adreno 610","804 - Qualcomm Adreno 612","741 - Intel HD Graphics (Cherry Trail)","728 - ARM Mali-G51 MP4","726 - Qualcomm Adreno 616","725 - Qualcomm Adreno 618","724 - Qualcomm Adreno 418","704 - Qualcomm Adreno 620","703 - Qualcomm Adreno 420","702 - PowerVR GX6450","692 - ARM Mali-T880 MP2","691 - ARM Mali-T760 MP6","659 - ARM Mali-G52 MP1","658 - ARM Mali-G52 MP2","657 - ARM Mali-G52 MP6","656 - ARM Mali-T880 MP4","655 - ARM Mali-G72 MP3","634 - Qualcomm Adreno 430","631 - ARM Mali-G71 MP2","630 - ARM Mali-T760 MP8","583 - ARM Mali-G76 MP4","582 - ARM Mali-T880 MP12","581 - Apple A9 / PowerVR GT7600","580 - NVIDIA Tegra K1 Kepler GPU","579 - PowerVR GXA6850","578 - Qualcomm Adreno 530","577 - PowerVR GM9446","538 - ARM Mali-G71 MP8","537 - ARM Mali-G72 MP12","536 - ARM Mali-G71 MP20","535 - ARM Mali-G72 MP18","534 - ARM Mali-G57 MP6","533 - Qualcomm Adreno 540","532 - ARM Mali-G76 MP10","531 - ARM Mali-G76 MP12","530 - Qualcomm Adreno 630","529 - Qualcomm Adreno 640","528 - ARM Mali-G76 MP16","527 - ARM Mali-G77 MP11","512 - Apple A10 Fusion GPU / PowerVR","421 - NVIDIA Tegra X1 Maxwell GPU","392 - Apple A9X / PowerVR Series 7XT","356 - Apple A10X Fusion GPU / PowerVR","355 - Apple A11 Bionic GPU","354 - Qualcomm Adreno 650","353 - Apple A12 Bionic GPU","347 - Apple A13 Bionic GPU","320 - Apple A12X Bionic GPU","319 - Apple A12Z Bionic GPU"],i=function(e){return e.toLowerCase().split("- ")[1].split(" /")[0]},o="undefined"==typeof window,a=new(function(){function e(e){this.userAgent=e||(!o&&window.navigator?window.navigator.userAgent:""),this.isAndroidDevice=!/like android/i.test(this.userAgent)&&/android/i.test(this.userAgent),this.iOSDevice=this.match(1,/(iphone|ipod|ipad)/i).toLowerCase(),!o&&"MacIntel"===navigator.platform&&navigator.maxTouchPoints>2&&!window.MSStream&&(this.iOSDevice="ipad")}return e.prototype.match=function(e,t){var n=this.userAgent.match(t);return n&&n.length>1&&n[e]||""},Object.defineProperty(e.prototype,"isMobile",{get:function(){return!this.isTablet&&(/[^-]mobi/i.test(this.userAgent)||"iphone"===this.iOSDevice||"ipod"===this.iOSDevice||this.isAndroidDevice||/nexus\s*[0-6]\s*/i.test(this.userAgent))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTablet",{get:function(){return/tablet/i.test(this.userAgent)&&!/tablet pc/i.test(this.userAgent)||"ipad"===this.iOSDevice||this.isAndroidDevice&&!/[^-]mobi/i.test(this.userAgent)||!/nexus\s*[0-6]\s*/i.test(this.userAgent)&&/nexus\s*[0-9]+/i.test(this.userAgent)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDesktop",{get:function(){return!this.isMobile&&!this.isTablet},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMacOS",{get:function(){return/macintosh/i.test(this.userAgent)&&{version:this.match(1,/mac os x (\d+(\.?_?\d+)+)/i).replace(/[_\s]/g,".").split(".").map((function(e){return e}))[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isWindows",{get:function(){return/windows /i.test(this.userAgent)&&{version:this.match(1,/Windows ((NT|XP)( \d\d?.\d)?)/i)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isiOS",{get:function(){return!!this.iOSDevice&&{version:this.match(1,/os (\d+([_\s]\d+)*) like mac os x/i).replace(/[_\s]/g,".")||this.match(1,/version\/(\d+(\.\d+)?)/i)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAndroid",{get:function(){return this.isAndroidDevice&&{version:this.match(1,/android[ \/-](\d+(\.\d+)*)/i)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"browser",{get:function(){var e=this.match(1,/version\/(\d+(\.\d+)?)/i);return/opera/i.test(this.userAgent)?{name:"Opera",version:e||this.match(1,/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(this.userAgent)?{name:"Opera",version:this.match(1,/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||e}:/SamsungBrowser/i.test(this.userAgent)?{name:"Samsung Internet for Android",version:e||this.match(1,/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(this.userAgent)?{name:"Yandex Browser",version:e||this.match(1,/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(this.userAgent)?{name:"UC Browser",version:this.match(1,/(?:ucbrowser)[\s\/](\d+(\.\d+)?)/i)}:/msie|trident/i.test(this.userAgent)?{name:"Internet Explorer",version:this.match(1,/(?:msie |rv:)(\d+(\.\d+)?)/i)}:/(edge|edgios|edga|edg)/i.test(this.userAgent)?{name:"Microsoft Edge",version:this.match(2,/(edge|edgios|edga|edg)\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(this.userAgent)?{name:"Firefox",version:this.match(1,/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)}:/chromium/i.test(this.userAgent)?{name:"Chromium",version:this.match(1,/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||e}:/chrome|crios|crmo/i.test(this.userAgent)?{name:"Chrome",version:this.match(1,/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/safari|applewebkit/i.test(this.userAgent)?{name:"Safari",version:e}:{name:this.match(1,/^(.*)\/(.*) /),version:this.match(2,/^(.*)\/(.*) /)}},enumerable:!1,configurable:!0}),e}()),s=a.browser,u=a.isMobile,c=a.isTablet,l=function(e){return e.replace(/[\D]/g,"")},f=function(e,t){var n=e?e.length:0,r=t?t.length:0;if(0===n)return r;if(0===r)return n;for(var i=new Array(r+1),o=0;o<=r;++o)(i[o]=new Array(n+1))[0]=o;for(var a=i[0],s=1;s<=n;++s)a[s]=s;for(var u=1;u<=r;++u)for(var c=1;c<=n;++c)t.charAt(u-1)===e.charAt(c-1)?i[u][c]=i[u-1][c-1]:i[u][c]=Math.min(i[u-1][c-1],i[u][c-1],i[u-1][c])+1;return i[r][n]},h=function(e,t,n){var r=["adreno","apple","mali-t","mali","nvidia","powervr"].find((function(e){return t.includes(e)})),o=[];if(r)for(var a=0;a0?h[0].rank:[void 0,void 0]},d=function(e){return e.sort((function(e,t){return e.distance-t.distance}))},p=function(e,t,n){var r=["intel","amd","nvidia"].find((function(e){return t.includes(e)})),o=[];if(r)for(var a=0;a0?h[0].rank:[void 0,void 0]};e.getGPUTier=function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.mobileBenchmarkPercentages,a=void 0===o?[0,50,30,20]:o,f=i.desktopBenchmarkPercentages,d=void 0===f?[0,50,30,20]:f,v=i.forceRendererString,m=void 0===v?"":v,g=i.forceMobile,y=void 0!==g&&g,b=i.glContext,w=i.failIfMajorPerformanceCaveat,_=u||c||y,x=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"FALLBACK";return{tier:"GPU_".concat(_?"MOBILE":"DESKTOP","_TIER_").concat(e),type:t}};if(m)e=m;else{var M=b||function(e){var t={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:!(arguments.length>1&&void 0!==arguments[1])||arguments[1],powerPreference:"high-performance",stencil:!1};"boolean"!=typeof e&&"Safari"===e.name&&e.version.includes("12")&&delete t.powerPreference;var n=document.createElement("canvas"),r=n.getContext("webgl",t)||n.getContext("experimental-webgl",t);if(r&&r instanceof WebGLRenderingContext)return r}(s,void 0===w||w);if(!M)return x(0,"WEBGL_UNSUPPORTED");e=function(e){var t=e.getExtension("WEBGL_debug_renderer_info");return t&&e.getParameter(t.UNMASKED_RENDERER_WEBGL)}(M)}if(e=function(e){var t=e.toLowerCase();return t.includes("angle (")&&t.includes("direct3d")&&(t=t.replace("angle (","").split(" direct3d")[0]),t.includes("nvidia")&&t.includes("gb")&&(t=t.split(/\dgb/)[0]),t}(e),/(radeon hd 6970m|radeon hd 6770m|radeon hd 6490m|radeon hd 6630m|radeon hd 6750m|radeon hd 5750|radeon hd 5670|radeon hd 4850|radeon hd 4870|radeon hd 4670|geforce 9400m|geforce 320m|geforce 330m|geforce gt 130|geforce gt 120|geforce gtx 285|geforce 8600|geforce 9600m|geforce 9400m|geforce 8800 gs|geforce 8800 gt|quadro fx 5|quadro fx 4|radeon hd 2600|radeon hd 2400|radeon r9 200|mali-4|mali-3|mali-2|google swiftshader|sgx543|legacy|sgx 543)/.test(e))return x(0,"BLACKLISTED");var S=(_?h:p)(function(e,t){var n=0;return t.map((function(t){var r=Math.round(e.length/100*t),i=e.slice(n,n+r);return n+=r,i}))}(_?n:t,_?a:d),e,l(e)),E=r(S,2);return x(E[0],E[1])},Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";t.a={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}},function(e,t,n){"use strict";var r=n(99),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=d(n);i&&i!==p&&e(t,i,r)}var a=l(n);f&&(a=a.concat(f(n)));for(var s=u(t),v=u(n),m=0;m0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.Schema=void 0;var o=n(0),a=n(5),s=n(12),u=n(13),c=n(4),l=n(6),f=n(15),h=n(16),d=n(3),p=n(38),v=n(39),m=n(2),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(Error);function y(e,t,n,r){if(!(e instanceof t))throw new g("a '"+t.name+"' was expected, but '"+e.constructor.name+"' was provided in "+n.constructor.name+"#"+r)}function b(e,t,n,r,i){!function(e,t,n,r){var i,o=!1;switch(t){case"number":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":case"int64":case"uint64":case"float32":case"float64":i="number",isNaN(e)&&console.log('trying to encode "NaN" in '+n.constructor.name+"#"+r);break;case"string":i="string",o=!0;break;case"boolean":return}if(typeof e!==i&&(!o||o&&null!==e)){var a="'"+JSON.stringify(e)+"'"+(e&&e.constructor&&" ("+e.constructor.name+")"||"");throw new g("a '"+i+"' was expected, but "+a+" was provided in "+n.constructor.name+"#"+r)}}(n,e,r,i);var o=s[e];if(!o)throw new g("a '"+e+"' was expected, but "+n+" was provided in "+r.constructor.name+"#"+i);o(t,n)}function w(e,t,n){return u[e](t,n)}var _=function(){function e(){for(var e=[],t=0;t>6<<6:g;if(_!==o.OPERATION.CLEAR){var x=b?g%(_||255):u.number(t,n),M=b?r._definition.fieldsByIndex[x]:"",S=y.getType(x),E=void 0,T=void 0,A=void 0;if(b?T=r["_"+M]:(T=r.getByIndex(x),(_&o.OPERATION.ADD)===o.OPERATION.ADD?(A=r instanceof l.MapSchema?u.string(t,n):x,r.setIndex(x,A)):A=r.getIndex(x)),(_&o.OPERATION.DELETE)===o.OPERATION.DELETE&&(_!==o.OPERATION.DELETE_AND_ADD&&r.deleteByIndex(x),T&&T.$changes&&s.removeRef(T.$changes.refId),E=null),void 0!==M){if(_===o.OPERATION.DELETE);else if(e.is(S)){var k=u.number(t,n);if(E=s.refs.get(k),_!==o.OPERATION.REPLACE){var C=this.getSchemaType(t,n,S);E||((E=this.createTypeInstance(C)).$changes.refId=k,T&&(E.onChange=T.onChange,E.onRemove=T.onRemove,E.$listeners=T.$listeners,T.$changes.refId&&k!==T.$changes.refId&&s.removeRef(T.$changes.refId))),s.addRef(k,E,E!==T)}}else if("string"===typeof S)E=w(S,t,n);else{var R=m.getType(Object.keys(S)[0]),O=u.number(t,n),P=s.refs.has(O)?T:new R.constructor;if((E=P.clone(!0)).$changes.refId=O,T&&(E.onAdd=T.onAdd,E.onRemove=T.onRemove,E.onChange=T.onChange,T.$changes.refId&&O!==T.$changes.refId)){s.removeRef(T.$changes.refId);for(var I=[],L=T.entries(),D=void 0;(D=L.next())&&!D.done;){var N=i(D.value,2),F=N[0],j=N[1];I.push({op:o.OPERATION.DELETE,field:F,value:void 0,previousValue:j})}a.set(T.$changes.refId,I)}s.addRef(O,E,P!==T),R.getProxy&&(E=R.getProxy(E))}var U=T!==E;if(null!==E&&void 0!==E)if(E.$changes&&E.$changes.setParent(y.ref,y.root,x),r instanceof e)r[M]=E;else if(r instanceof l.MapSchema)F=A,r.$items.set(F,E);else if(r instanceof c.ArraySchema)r.setAt(x,E);else if(r instanceof f.CollectionSchema||r instanceof h.SetSchema){var B=r.add(E);r.setIndex(x,B)}U&&v.push({op:_,field:M,dynamicIndex:A,value:E,previousValue:T})}else{console.warn("@colyseus/schema: definition mismatch");for(var G={offset:n.offset};n.offset0){for(var g=n.$changes.root.refs.get(r),y=g instanceof e,b=0;b0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spread||function(){for(var e=[],t=0;tr?1:0};function l(e){return e.$proxy=!0,e=new Proxy(e,{get:function(e,t){return"symbol"===typeof t||isNaN(t)?e[t]:e.at(t)},set:function(e,t,n){if("symbol"===typeof t||isNaN(t))e[t]=n;else{var r=Array.from(e.$items.keys()),i=parseInt(r[t]||t);void 0===n||null===n?e.deleteAt(i):e.setAt(i,n)}return!0},deleteProperty:function(e,t){return"number"===typeof t?e.deleteAt(t):delete e[t],!0}})}t.getArrayProxy=l;var f=function(){function e(){for(var e=[],t=0;t0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spread||function(){for(var e=[],t=0;t=400?o:i)(l)},(s=r.body)&&"object"==typeof s&&(f["content-type"]="application/json",s=JSON.stringify(s)),l.withCredentials=!!r.withCredentials,f)l.setRequestHeader(a,f[a]);l.send(s)}))},t.get=t.send.bind(t.send,"GET"),t.post=t.send.bind(t.send,"POST"),t.patch=t.send.bind(t.send,"PATCH"),t.del=t.send.bind(t.send,"DELETE"),t.put=t.send.bind(t.send,"PUT")},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Room=void 0;var a=o(n(9)),s=n(23),u=n(24),c=n(25),l=n(10),f=n(11),h=o(n(12)),d=o(n(13)),p=function(){function e(e,t){var n=this;this.onStateChange=s.createSignal(),this.onError=s.createSignal(),this.onLeave=s.createSignal(),this.onJoin=s.createSignal(),this.hasJoined=!1,this.onMessageHandlers=u.createNanoEvents(),this.id=null,this.name=e,t&&(this.serializer=new(l.getSerializer("schema")),this.rootSchema=t,this.serializer.state=new t),this.onError((function(e,t){return console.warn("colyseus.js - onError => ("+e+") "+t)})),this.onLeave((function(){return n.removeAllListeners()}))}return e.prototype.connect=function(e){var t=this;this.connection=new c.Connection(e,!1),this.connection.reconnectEnabled=!1,this.connection.onmessage=this.onMessageCallback.bind(this),this.connection.onclose=function(e){if(!t.hasJoined)return console.warn("Room connection was closed unexpectedly ("+e.code+"): "+e.reason),void t.onError.invoke(e.code,e.reason);t.onLeave.invoke(e.code)},this.connection.onerror=function(e){console.warn("Room, onError ("+e.code+"): "+e.reason),t.onError.invoke(e.code,e.reason)},this.connection.open()},e.prototype.leave=function(e){void 0===e&&(e=!0),this.connection?e?this.connection.send([f.Protocol.LEAVE_ROOM]):this.connection.close():this.onLeave.invoke(4e3)},e.prototype.onMessage=function(e,t){return this.onMessageHandlers.on(this.getMessageHandlerKey(e),t)},e.prototype.send=function(e,t){var n,r=[f.Protocol.ROOM_DATA];if("string"===typeof e?h.string(r,e):h.number(r,e),void 0!==t){var i=a.encode(t);(n=new Uint8Array(r.length+i.byteLength)).set(new Uint8Array(r),0),n.set(new Uint8Array(i),r.length)}else n=new Uint8Array(r);this.connection.send(n.buffer)},Object.defineProperty(e.prototype,"state",{get:function(){return this.serializer.getState()},enumerable:!1,configurable:!0}),e.prototype.listen=function(e,t,n){if("schema"!==this.serializerId)return this.serializerId||console.warn("room.Listen() should be called after room.onJoin has been called (DEPRECATION WARNING)"),this.serializer.api.listen(e,t,n);console.warn("'"+this.serializerId+"' serializer doesn't support .listen() method here.")},e.prototype.removeListener=function(e){return this.serializer.api.removeListener(e)},e.prototype.removeAllListeners=function(){this.serializer&&this.serializer.teardown(),this.onJoin.clear(),this.onStateChange.clear(),this.onError.clear(),this.onLeave.clear(),this.onMessageHandlers.events={}},e.prototype.onMessageCallback=function(e){var t=Array.from(new Uint8Array(e.data)),n=t[0];if(n===f.Protocol.JOIN_ROOM){var r=1;if(this.serializerId=f.utf8Read(t,r),r+=f.utf8Length(this.serializerId),!this.serializer){var i=l.getSerializer(this.serializerId);this.serializer=new i}t.length>r&&this.serializer.handshake&&this.serializer.handshake(t,{offset:r}),this.hasJoined=!0,this.onJoin.invoke(),this.connection.send([f.Protocol.JOIN_ROOM])}else if(n===f.Protocol.ERROR){var o={offset:1},s=d.number(t,o),u=d.string(t,o);this.onError.invoke(s,u)}else if(n===f.Protocol.LEAVE_ROOM)this.leave();else if(n===f.Protocol.ROOM_DATA_SCHEMA){var c={offset:1};(u=new(p=this.serializer.getState().constructor._context.get(d.number(t,c)))).decode(t,c),this.dispatchMessage(p,u)}else if(n===f.Protocol.ROOM_STATE)t.shift(),this.setState(t);else if(n===f.Protocol.ROOM_STATE_PATCH)t.shift(),this.patch(t);else if(n===f.Protocol.ROOM_DATA){var h={offset:1},p=d.stringCheck(t,h)?d.string(t,h):d.number(t,h);u=t.length>h.offset?a.decode(e.data,h.offset):void 0,this.dispatchMessage(p,u)}},e.prototype.setState=function(e){this.serializer.setState(e),this.onStateChange.invoke(this.serializer.getState())},e.prototype.patch=function(e){this.serializer.patch(e),this.onStateChange.invoke(this.serializer.getState())},e.prototype.dispatchMessage=function(e,t){var n=this.getMessageHandlerKey(e);this.onMessageHandlers.events[n]?this.onMessageHandlers.emit(n,t):this.onMessageHandlers.events["*"]?this.onMessageHandlers.emit("*",e,t):console.warn("onMessage not registered for type '"+e+"'.")},e.prototype.getMessageHandlerKey=function(e){switch(typeof e){case"function":return"$"+e._typeid;case"string":return e;case"number":return"i"+e;default:throw new Error("invalid message type.")}},e}();t.Room=p},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=void 0;var i=r(n(21)),o=r(n(22));t.decode=i.default,t.encode=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSerializer=t.registerSerializer=void 0;var r={};t.registerSerializer=function(e,t){r[e]=t},t.getSerializer=function(e){var t=r[e];if(!t)throw new Error("missing serializer: "+e);return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utf8Length=t.utf8Read=t.ErrorCode=t.Protocol=void 0,function(e){e[e.HANDSHAKE=9]="HANDSHAKE",e[e.JOIN_ROOM=10]="JOIN_ROOM",e[e.ERROR=11]="ERROR",e[e.LEAVE_ROOM=12]="LEAVE_ROOM",e[e.ROOM_DATA=13]="ROOM_DATA",e[e.ROOM_STATE=14]="ROOM_STATE",e[e.ROOM_STATE_PATCH=15]="ROOM_STATE_PATCH",e[e.ROOM_DATA_SCHEMA=16]="ROOM_DATA_SCHEMA"}(t.Protocol||(t.Protocol={})),function(e){e[e.MATCHMAKE_NO_HANDLER=4210]="MATCHMAKE_NO_HANDLER",e[e.MATCHMAKE_INVALID_CRITERIA=4211]="MATCHMAKE_INVALID_CRITERIA",e[e.MATCHMAKE_INVALID_ROOM_ID=4212]="MATCHMAKE_INVALID_ROOM_ID",e[e.MATCHMAKE_UNHANDLED=4213]="MATCHMAKE_UNHANDLED",e[e.MATCHMAKE_EXPIRED=4214]="MATCHMAKE_EXPIRED",e[e.AUTH_FAILED=4215]="AUTH_FAILED",e[e.APPLICATION_ERROR=4216]="APPLICATION_ERROR"}(t.ErrorCode||(t.ErrorCode={})),t.utf8Read=function(e,t){for(var n=e[t++],r="",i=0,o=t,a=t+n;o=65536?(i-=65536,r+=String.fromCharCode(55296+(i>>>10),56320+(1023&i))):r+=String.fromCharCode(i)}else r+=String.fromCharCode((15&s)<<12|(63&e[++o])<<6|(63&e[++o])<<0);else r+=String.fromCharCode((31&s)<<6|63&e[++o]);else r+=String.fromCharCode(s)}return r},t.utf8Length=function(e){void 0===e&&(e="");for(var t=0,n=0,r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n+1}},function(e,t,n){"use strict";function r(e,t,n){for(var r=0,i=0,o=n.length;i>6,e[t++]=128|63&r):r<55296||r>=57344?(e[t++]=224|r>>12,e[t++]=128|r>>6&63,e[t++]=128|63&r):(i++,r=65536+((1023&r)<<10|1023&n.charCodeAt(i)),e[t++]=240|r>>18,e[t++]=128|r>>12&63,e[t++]=128|r>>6&63,e[t++]=128|63&r)}function i(e,t){e.push(255&t)}function o(e,t){e.push(255&t)}function a(e,t){e.push(255&t),e.push(t>>8&255)}function s(e,t){e.push(255&t),e.push(t>>8&255)}function u(e,t){e.push(255&t),e.push(t>>8&255),e.push(t>>16&255),e.push(t>>24&255)}function c(e,t){var n=t>>24,r=t>>16,i=t>>8,o=t;e.push(255&o),e.push(255&i),e.push(255&r),e.push(255&n)}function l(e,t){var n=Math.floor(t/Math.pow(2,32));c(e,t>>>0),c(e,n)}function f(e,t){var n=t/Math.pow(2,32)>>0;c(e,t>>>0),c(e,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.number=t.string=t.boolean=t.writeFloat64=t.writeFloat32=t.float64=t.float32=t.uint64=t.int64=t.uint32=t.int32=t.uint16=t.int16=t.uint8=t.int8=t.utf8Write=void 0,t.utf8Write=r,t.int8=i,t.uint8=o,t.int16=a,t.uint16=s,t.int32=u,t.uint32=c,t.int64=l,t.uint64=f,t.float32=function(e,t){v(e,t)},t.float64=function(e,t){m(e,t)};var h=new Int32Array(2),d=new Float32Array(h.buffer),p=new Float64Array(h.buffer);function v(e,t){d[0]=t,u(e,h[0])}function m(e,t){p[0]=t,u(e,h[0]),u(e,h[1])}t.writeFloat32=v,t.writeFloat64=m,t.boolean=function(e,t){return o(e,t?1:0)},t.string=function(e,t){t||(t="");var n=function(e){for(var t=0,n=0,r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}(t),i=0;if(n<32)e.push(160|n),i=1;else if(n<256)e.push(217),o(e,n),i=2;else if(n<65536)e.push(218),s(e,n),i=3;else{if(!(n<4294967296))throw new Error("String too long");e.push(219),c(e,n),i=5}return r(e,e.length,t),i+n},t.number=function e(t,n){return isNaN(n)?e(t,0):isFinite(n)?n!==(0|n)?(t.push(203),m(t,n),9):n>=0?n<128?(o(t,n),1):n<256?(t.push(204),o(t,n),2):n<65536?(t.push(205),s(t,n),3):n<4294967296?(t.push(206),c(t,n),5):(t.push(207),f(t,n),9):n>=-32?(t.push(224|n+32),1):n>=-128?(t.push(208),i(t,n),2):n>=-32768?(t.push(209),a(t,n),3):n>=-2147483648?(t.push(210),u(t,n),5):(t.push(211),l(t,n),9):e(t,n>0?Number.MAX_SAFE_INTEGER:-Number.MAX_SAFE_INTEGER)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchStructureCheck=t.arrayCheck=t.numberCheck=t.number=t.stringCheck=t.string=t.boolean=t.readFloat64=t.readFloat32=t.uint64=t.int64=t.float64=t.float32=t.uint32=t.int32=t.uint16=t.int16=t.uint8=t.int8=void 0;var r=n(0);function i(e,t){return o(e,t)<<24>>24}function o(e,t){return e[t.offset++]}function a(e,t){return s(e,t)<<16>>16}function s(e,t){return e[t.offset++]|e[t.offset++]<<8}function u(e,t){return e[t.offset++]|e[t.offset++]<<8|e[t.offset++]<<16|e[t.offset++]<<24}function c(e,t){return u(e,t)>>>0}function l(e,t){var n=c(e,t);return u(e,t)*Math.pow(2,32)+n}function f(e,t){var n=c(e,t);return c(e,t)*Math.pow(2,32)+n}t.int8=i,t.uint8=o,t.int16=a,t.uint16=s,t.int32=u,t.uint32=c,t.float32=function(e,t){return v(e,t)},t.float64=function(e,t){return m(e,t)},t.int64=l,t.uint64=f;var h=new Int32Array(2),d=new Float32Array(h.buffer),p=new Float64Array(h.buffer);function v(e,t){return h[0]=u(e,t),d[0]}function m(e,t){return h[0]=u(e,t),h[1]=u(e,t),p[0]}t.readFloat32=v,t.readFloat64=m,t.boolean=function(e,t){return o(e,t)>0},t.string=function(e,t){var n,r=e[t.offset++];r<192?n=31&r:217===r?n=o(e,t):218===r?n=s(e,t):219===r&&(n=c(e,t));var i=function(e,t,n){for(var r="",i=0,o=t,a=t+n;o=65536?(i-=65536,r+=String.fromCharCode(55296+(i>>>10),56320+(1023&i))):r+=String.fromCharCode(i):r+=String.fromCharCode((15&s)<<12|(63&e[++o])<<6|(63&e[++o])<<0):r+=String.fromCharCode((31&s)<<6|63&e[++o]):r+=String.fromCharCode(s)}return r}(e,t.offset,n);return t.offset+=n,i},t.stringCheck=function(e,t){var n=e[t.offset];return n<192&&n>160||217===n||218===n||219===n},t.number=function(e,t){var n=e[t.offset++];return n<128?n:202===n?v(e,t):203===n?m(e,t):204===n?o(e,t):205===n?s(e,t):206===n?c(e,t):207===n?f(e,t):208===n?i(e,t):209===n?a(e,t):210===n?u(e,t):211===n?l(e,t):n>223?-1*(255-n+1):void 0},t.numberCheck=function(e,t){var n=e[t.offset];return n<128||n>=202&&n<=211},t.arrayCheck=function(e,t){return e[t.offset]<160},t.switchStructureCheck=function(e,t){return e[t.offset-1]===r.SWITCH_TO_STRUCTURE&&(e[t.offset]<128||e[t.offset]>=202&&e[t.offset]<=211)}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?"?"+o.join("&"):"",l={headers:i},r&&(l.body=r),[4,u[e](""+this.endpoint+t+c,l)];case 1:return[2,s.sent().data]}}))}))},e.prototype.logout=function(){this.token=void 0,c.removeItem(l),this.unregisterPingService()},e.prototype.registerPingService=function(e){var t=this;void 0===e&&(e=15e3),this.unregisterPingService(),this.keepOnlineInterval=setInterval((function(){return t.request("get","/auth")}),e)},e.prototype.unregisterPingService=function(){clearInterval(this.keepOnlineInterval)},e}();t.Auth=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionSchema=void 0;var r=n(3),i=n(0),o=n(1),a=n(2),s=function(){function e(e){var t=this;this.$changes=new r.ChangeTree(this),this.$items=new Map,this.$indexes=new Map,this.$refId=0,e&&e.forEach((function(e){return t.add(e)}))}return e.is=function(e){return void 0!==e.collection},e.prototype.add=function(e){var t=this.$refId++;return void 0!==e.$changes&&e.$changes.setParent(this,this.$changes.root,t),this.$changes.indexes[t]=t,this.$indexes.set(t,t),this.$items.set(t,e),this.$changes.change(t),t},e.prototype.at=function(e){var t=Array.from(this.$items.keys())[e];return this.$items.get(t)},e.prototype.entries=function(){return this.$items.entries()},e.prototype.delete=function(e){for(var t,n,r=this.$items.entries();(n=r.next())&&!n.done;)if(e===n.value[1]){t=n.value[0];break}return void 0!==t&&(this.$changes.delete(t),this.$indexes.delete(t),this.$items.delete(t))},e.prototype.clear=function(e){var t=this;this.$changes.discard(!0,!0),this.$changes.indexes={},this.$indexes.clear(),e&&"string"!==typeof this.$changes.getType()&&this.$items.forEach((function(e){t.$changes.root.removeRef(e.$changes.refId)})),this.$items.clear(),this.$changes.operation({index:0,op:i.OPERATION.CLEAR}),this.$changes.touchParents()},e.prototype.has=function(e){return Array.from(this.$items.values()).some((function(t){return t===e}))},e.prototype.forEach=function(e){var t=this;this.$items.forEach((function(n,r,i){return e(n,r,t)}))},e.prototype.values=function(){return this.$items.values()},Object.defineProperty(e.prototype,"size",{get:function(){return this.$items.size},enumerable:!1,configurable:!0}),e.prototype.setIndex=function(e,t){this.$indexes.set(e,t)},e.prototype.getIndex=function(e){return this.$indexes.get(e)},e.prototype.getByIndex=function(e){return this.$items.get(this.$indexes.get(e))},e.prototype.deleteByIndex=function(e){var t=this.$indexes.get(e);this.$items.delete(t),this.$indexes.delete(e)},e.prototype.toArray=function(){return Array.from(this.$items.values())},e.prototype.toJSON=function(){var e=[];return this.forEach((function(t,n){e.push("function"===typeof t.toJSON?t.toJSON():t)})),e},e.prototype.clone=function(t){var n;if(t)n=Object.assign(new e,this);else{var r=new e;this.forEach((function(e){e.$changes?r.add(e.clone()):r.add(e)}))}return n},e.prototype.triggerAll=function(){o.Schema.prototype.triggerAll.apply(this)},e}();t.CollectionSchema=s,a.registerType("collection",{constructor:s})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SetSchema=void 0;var r=n(3),i=n(0),o=n(1),a=n(2),s=function(){function e(e){var t=this;this.$changes=new r.ChangeTree(this),this.$items=new Map,this.$indexes=new Map,this.$refId=0,e&&e.forEach((function(e){return t.add(e)}))}return e.is=function(e){return void 0!==e.set},e.prototype.add=function(e){if(this.has(e))return!1;var t=this.$refId++;return void 0!==e.$changes&&e.$changes.setParent(this,this.$changes.root,t),this.$changes.indexes[t]=t,this.$indexes.set(t,t),this.$items.set(t,e),this.$changes.change(t),t},e.prototype.entries=function(){return this.$items.entries()},e.prototype.delete=function(e){for(var t,n,r=this.$items.entries();(n=r.next())&&!n.done;)if(e===n.value[1]){t=n.value[0];break}return void 0!==t&&(this.$changes.delete(t),this.$indexes.delete(t),this.$items.delete(t))},e.prototype.clear=function(e){var t=this;this.$changes.discard(!0,!0),this.$changes.indexes={},this.$indexes.clear(),e&&"string"!==typeof this.$changes.getType()&&this.$items.forEach((function(e){t.$changes.root.removeRef(e.$changes.refId)})),this.$items.clear(),this.$changes.operation({index:0,op:i.OPERATION.CLEAR}),this.$changes.touchParents()},e.prototype.has=function(e){for(var t,n=this.$items.values(),r=!1;(t=n.next())&&!t.done;)if(e===t.value){r=!0;break}return r},e.prototype.forEach=function(e){var t=this;this.$items.forEach((function(n,r,i){return e(n,r,t)}))},e.prototype.values=function(){return this.$items.values()},Object.defineProperty(e.prototype,"size",{get:function(){return this.$items.size},enumerable:!1,configurable:!0}),e.prototype.setIndex=function(e,t){this.$indexes.set(e,t)},e.prototype.getIndex=function(e){return this.$indexes.get(e)},e.prototype.getByIndex=function(e){return this.$items.get(this.$indexes.get(e))},e.prototype.deleteByIndex=function(e){var t=this.$indexes.get(e);this.$items.delete(t),this.$indexes.delete(e)},e.prototype.toArray=function(){return Array.from(this.$items.values())},e.prototype.toJSON=function(){var e=[];return this.forEach((function(t,n){e.push("function"===typeof t.toJSON?t.toJSON():t)})),e},e.prototype.clone=function(t){var n;if(t)n=Object.assign(new e,this);else{var r=new e;this.forEach((function(e){e.$changes?r.add(e.clone()):r.add(e)}))}return n},e.prototype.triggerAll=function(){o.Schema.prototype.triggerAll.apply(this)},e}();t.SetSchema=s,a.registerType("set",{constructor:s})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SchemaSerializer=t.FossilDeltaSerializer=t.registerSerializer=void 0,n(18);var r=n(19);Object.defineProperty(t,"Client",{enumerable:!0,get:function(){return r.Client}});var i=n(11);Object.defineProperty(t,"Protocol",{enumerable:!0,get:function(){return i.Protocol}}),Object.defineProperty(t,"ErrorCode",{enumerable:!0,get:function(){return i.ErrorCode}});var o=n(8);Object.defineProperty(t,"Room",{enumerable:!0,get:function(){return o.Room}});var a=n(14);Object.defineProperty(t,"Auth",{enumerable:!0,get:function(){return a.Auth}}),Object.defineProperty(t,"Platform",{enumerable:!0,get:function(){return a.Platform}});var s=n(31);Object.defineProperty(t,"FossilDeltaSerializer",{enumerable:!0,get:function(){return s.FossilDeltaSerializer}});var u=n(36);Object.defineProperty(t,"SchemaSerializer",{enumerable:!0,get:function(){return u.SchemaSerializer}});var c=n(42),l=n(10);Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return l.registerSerializer}}),l.registerSerializer("fossil-delta",s.FossilDeltaSerializer),l.registerSerializer("schema",u.SchemaSerializer),l.registerSerializer("none",c.NoneSerializer)},function(e,t){ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return null!==e&&"object"===typeof e&&e.buffer instanceof ArrayBuffer})},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=65536?(i-=65536,r+=String.fromCharCode(55296+(i>>>10),56320+(1023&i))):r+=String.fromCharCode(i)}else r+=String.fromCharCode((15&s)<<12|(63&e.getUint8(++o))<<6|(63&e.getUint8(++o))<<0);else r+=String.fromCharCode((31&s)<<6|63&e.getUint8(++o));else r+=String.fromCharCode(s)}return r}(this._view,this._offset,e);return this._offset+=e,t},r.prototype._bin=function(e){var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},r.prototype._parse=function(){var e,t=this._view.getUint8(this._offset++),n=0,r=0,i=0,o=0;if(t<192)return t<128?t:t<144?this._map(15&t):t<160?this._array(15&t):this._str(31&t);if(t>223)return-1*(255-t+1);switch(t){case 192:return null;case 194:return!1;case 195:return!0;case 196:return n=this._view.getUint8(this._offset),this._offset+=1,this._bin(n);case 197:return n=this._view.getUint16(this._offset),this._offset+=2,this._bin(n);case 198:return n=this._view.getUint32(this._offset),this._offset+=4,this._bin(n);case 199:return n=this._view.getUint8(this._offset),r=this._view.getInt8(this._offset+1),this._offset+=2,[r,this._bin(n)];case 200:return n=this._view.getUint16(this._offset),r=this._view.getInt8(this._offset+2),this._offset+=3,[r,this._bin(n)];case 201:return n=this._view.getUint32(this._offset),r=this._view.getInt8(this._offset+4),this._offset+=5,[r,this._bin(n)];case 202:return e=this._view.getFloat32(this._offset),this._offset+=4,e;case 203:return e=this._view.getFloat64(this._offset),this._offset+=8,e;case 204:return e=this._view.getUint8(this._offset),this._offset+=1,e;case 205:return e=this._view.getUint16(this._offset),this._offset+=2,e;case 206:return e=this._view.getUint32(this._offset),this._offset+=4,e;case 207:return i=this._view.getUint32(this._offset)*Math.pow(2,32),o=this._view.getUint32(this._offset+4),this._offset+=8,i+o;case 208:return e=this._view.getInt8(this._offset),this._offset+=1,e;case 209:return e=this._view.getInt16(this._offset),this._offset+=2,e;case 210:return e=this._view.getInt32(this._offset),this._offset+=4,e;case 211:return i=this._view.getInt32(this._offset)*Math.pow(2,32),o=this._view.getUint32(this._offset+4),this._offset+=8,i+o;case 212:return r=this._view.getInt8(this._offset),this._offset+=1,0===r?void(this._offset+=1):[r,this._bin(1)];case 213:return r=this._view.getInt8(this._offset),this._offset+=1,[r,this._bin(2)];case 214:return r=this._view.getInt8(this._offset),this._offset+=1,[r,this._bin(4)];case 215:return r=this._view.getInt8(this._offset),this._offset+=1,0===r?(i=this._view.getInt32(this._offset)*Math.pow(2,32),o=this._view.getUint32(this._offset+4),this._offset+=8,new Date(i+o)):[r,this._bin(8)];case 216:return r=this._view.getInt8(this._offset),this._offset+=1,[r,this._bin(16)];case 217:return n=this._view.getUint8(this._offset),this._offset+=1,this._str(n);case 218:return n=this._view.getUint16(this._offset),this._offset+=2,this._str(n);case 219:return n=this._view.getUint32(this._offset),this._offset+=4,this._str(n);case 220:return n=this._view.getUint16(this._offset),this._offset+=2,this._array(n);case 221:return n=this._view.getUint32(this._offset),this._offset+=4,this._array(n);case 222:return n=this._view.getUint16(this._offset),this._offset+=2,this._map(n);case 223:return n=this._view.getUint32(this._offset),this._offset+=4,this._map(n)}throw new Error("Could not parse")},t.default=function(e,t){void 0===t&&(t=0);var n=new r(e,t),i=n._parse();if(n._offset!==e.byteLength)throw new Error(e.byteLength-n._offset+" trailing bytes");return i}},function(e,t,n){"use strict";function r(e,t,n){for(var r=0,i=0,o=n.length;i>6),e.setUint8(t++,128|63&r)):r<55296||r>=57344?(e.setUint8(t++,224|r>>12),e.setUint8(t++,128|r>>6&63),e.setUint8(t++,128|63&r)):(i++,r=65536+((1023&r)<<10|1023&n.charCodeAt(i)),e.setUint8(t++,240|r>>18),e.setUint8(t++,128|r>>12&63),e.setUint8(t++,128|r>>6&63),e.setUint8(t++,128|63&r))}function i(e,t,n){var r=typeof n,o=0,a=0,s=0,u=0,c=0,l=0;if("string"===r){if((c=function(e){for(var t=0,n=0,r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}(n))<32)e.push(160|c),l=1;else if(c<256)e.push(217,c),l=2;else if(c<65536)e.push(218,c>>8,c),l=3;else{if(!(c<4294967296))throw new Error("String too long");e.push(219,c>>24,c>>16,c>>8,c),l=5}return t.push({_str:n,_length:c,_offset:e.length}),l+c}if("number"===r)return Math.floor(n)===n&&isFinite(n)?n>=0?n<128?(e.push(n),1):n<256?(e.push(204,n),2):n<65536?(e.push(205,n>>8,n),3):n<4294967296?(e.push(206,n>>24,n>>16,n>>8,n),5):(s=n/Math.pow(2,32)>>0,u=n>>>0,e.push(207,s>>24,s>>16,s>>8,s,u>>24,u>>16,u>>8,u),9):n>=-32?(e.push(n),1):n>=-128?(e.push(208,n),2):n>=-32768?(e.push(209,n>>8,n),3):n>=-2147483648?(e.push(210,n>>24,n>>16,n>>8,n),5):(s=Math.floor(n/Math.pow(2,32)),u=n>>>0,e.push(211,s>>24,s>>16,s>>8,s,u>>24,u>>16,u>>8,u),9):(e.push(203),t.push({_float:n,_length:8,_offset:e.length}),9);if("object"===r){if(null===n)return e.push(192),1;if(Array.isArray(n)){if((c=n.length)<16)e.push(144|c),l=1;else if(c<65536)e.push(220,c>>8,c),l=3;else{if(!(c<4294967296))throw new Error("Array too large");e.push(221,c>>24,c>>16,c>>8,c),l=5}for(o=0;o>>0,e.push(215,0,s>>24,s>>16,s>>8,s,u>>24,u>>16,u>>8,u),10}if(n instanceof ArrayBuffer){if((c=n.byteLength)<256)e.push(196,c),l=2;else if(c<65536)e.push(197,c>>8,c),l=3;else{if(!(c<4294967296))throw new Error("Buffer too large");e.push(198,c>>24,c>>16,c>>8,c),l=5}return t.push({_bin:n,_length:c,_offset:e.length}),l+c}if("function"===typeof n.toJSON)return i(e,t,n.toJSON());var h=[],d="",p=Object.keys(n);for(o=0,a=p.length;o>8,c),l=3;else{if(!(c<4294967296))throw new Error("Object too large");e.push(223,c>>24,c>>16,c>>8,c),l=5}for(o=0;o0&&(l=n[0]._offset);for(var f,h=0,d=0,p=0,v=t.length;p1?t-1:0),r=1;r0){for(var n=0,r=this._enqueuedCalls;n2&&void 0!==arguments[2]?arguments[2]:{};i(this,e),this.url=t,this.protocols=n,this.reconnectEnabled=!0,this.listeners={},this.backoff=o(r.backoff||"exponential",r),this.backoff.onReady=this.onBackoffReady.bind(this),("undefined"===typeof r.connect||r.connect)&&this.open()}return r(e,[{key:"open",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isReconnect=e;var t=this.ws&&this.ws.binaryType;this.ws=new a(this.url,this.protocols),this.ws.onclose=this.onCloseCallback.bind(this),this.ws.onerror=this.onErrorCallback.bind(this),this.ws.onmessage=this.onMessageCallback.bind(this),this.ws.onopen=this.onOpenCallback.bind(this),t&&(this.ws.binaryType=t)}},{key:"onBackoffReady",value:function(e,t){this.open(!0)}},{key:"onCloseCallback",value:function(e){!this.isReconnect&&this.listeners.onclose&&this.listeners.onclose.apply(null,arguments),this.reconnectEnabled&&e.code<3e3&&this.backoff.backoff()}},{key:"onErrorCallback",value:function(){this.listeners.onerror&&this.listeners.onerror.apply(null,arguments)}},{key:"onMessageCallback",value:function(){this.listeners.onmessage&&this.listeners.onmessage.apply(null,arguments)}},{key:"onOpenCallback",value:function(){this.listeners.onopen&&this.listeners.onopen.apply(null,arguments),this.isReconnect&&this.listeners.onreconnect&&this.listeners.onreconnect.apply(null,arguments),this.isReconnect=!1}},{key:"close",value:function(e,t){"undefined"==typeof e&&(e=1e3),this.reconnectEnabled=!1,this.ws.close(e,t)}},{key:"send",value:function(e){this.ws.send(e)}},{key:"bufferedAmount",get:function(){return this.ws.bufferedAmount}},{key:"readyState",get:function(){return this.ws.readyState}},{key:"binaryType",get:function(){return this.ws.binaryType},set:function(e){this.ws.binaryType=e}},{key:"extensions",get:function(){return this.ws.extensions},set:function(e){this.ws.extensions=e}},{key:"protocol",get:function(){return this.ws.protocol},set:function(e){this.ws.protocol=e}},{key:"onclose",set:function(e){this.listeners.onclose=e},get:function(){return this.listeners.onclose}},{key:"onerror",set:function(e){this.listeners.onerror=e},get:function(){return this.listeners.onerror}},{key:"onmessage",set:function(e){this.listeners.onmessage=e},get:function(){return this.listeners.onmessage}},{key:"onopen",set:function(e){this.listeners.onopen=e},get:function(){return this.listeners.onopen}},{key:"onreconnect",set:function(e){this.listeners.onreconnect=e},get:function(){return this.listeners.onreconnect}}]),e}();s.CONNECTING=a.CONNECTING,s.OPEN=a.OPEN,s.CLOSING=a.CLOSING,s.CLOSED=a.CLOSED,t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBackoff=function(e,t){return new i(r[e],t)};var r={exponential:function(e,t){return Math.floor(Math.random()*Math.pow(2,e)*t)},fibonacci:function(e,t){if(e>(r=1))for(var n=1,r=2,i=2;i0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&console.warn(".listen() accepts only one parameter.");var a={callback:t,rawRules:i,rules:i.map((function(e){return"string"===typeof e?0===e.indexOf(":")?o.matcherPlaceholders[e]||o.matcherPlaceholders[":*"]:new RegExp("^"+e+"$"):e}))};return 0===i.length?this.defaultListener=a:this.listeners.push(a),n&&this.checkPatches(r.compare({},this.state),[a]),a},e.prototype.removeListener=function(e){for(var t=this.listeners.length-1;t>=0;t--)this.listeners[t]===e&&this.listeners.splice(t,1)},e.prototype.removeAllListeners=function(){this.reset()},e.prototype.checkPatches=function(e,t,n){for(var r=0,i=t.length;r=0;a--){var s=o&&this.getPathVariables(e[a],o);s&&(o.callback({path:s,rawPath:e[a].path,operation:e[a].operation,value:e[a].value}),e[a].matched=!0)}if(n)for(a=e.length-1;a>=0;a--)e[a].matched||n.callback(e[a])},e.prototype.getPathVariables=function(e,t){if(e.path.length!==t.rules.length)return!1;for(var n={},r=0,i=t.rules.length;r2)return!1;":"===t.rawRules[r].substr(0,1)&&(n[t.rawRules[r].substr(1)]=o[1])}return n},e.prototype.reset=function(){this.listeners=[]},e}();t.StateContainer=i},function(e,t,n){"use strict";function r(e,t){var n=e.slice();return n.push(t),n}function i(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=0;l--){var f=e[d=u[l]];if(!t.hasOwnProperty(d)||void 0===t[d]&&void 0!==f&&!1===Array.isArray(t))n.push({operation:"remove",path:r(a,d)}),c=!0;else{var h=t[d];"object"==typeof f&&null!=f&&"object"==typeof h&&null!=h?o(f,h,n,r(a,d)):f!==h&&n.push({operation:"replace",path:r(a,d),value:h,previousValue:f})}}if(c||s.length!=u.length)for(l=s.length-1;l>=0;l--){var d=s[l];if(!e.hasOwnProperty(d)&&void 0!==t[d]){h=t[d];var p=r(a,d);"object"==typeof h&&null!=h&&o({},h,n,p),n.push({operation:"add",path:p,value:h})}}}Object.defineProperty(t,"__esModule",{value:!0}),t.compare=function(e,t){var n=[];return o(e,t,n,[]),n}},function(e,t,n){var r,i;r=this,i=function(){"use strict";var e={},t=16;function n(){this.a=0,this.b=0,this.i=0,this.z=new Array(t)}n.prototype.init=function(e,n){var r,i,o=0,a=0;for(r=0;r>>0};var r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~".split("").map((function(e){return e.charCodeAt(0)})),i=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,36,-1,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,-1,-1,-1,63,-1];function o(e){this.a=e,this.pos=0}function a(){this.a=[]}function s(e){var t,n;for(t=1,n=64;e>=n;t++,n<<=6);return t}function u(e){for(var t=0,n=0,r=0,i=0,o=0,a=e.length;a>=16;)t=t+e[o+0]|0,n=n+e[o+1]|0,r=r+e[o+2]|0,i=i+e[o+3]|0,t=t+e[o+4]|0,n=n+e[o+5]|0,r=r+e[o+6]|0,i=i+e[o+7]|0,t=t+e[o+8]|0,n=n+e[o+9]|0,r=r+e[o+10]|0,i=i+e[o+11]|0,t=t+e[o+12]|0,n=n+e[o+13]|0,r=r+e[o+14]|0,i=i+e[o+15]|0,o+=16,a-=16;for(;a>=4;)t=t+e[o+0]|0,n=n+e[o+1]|0,r=r+e[o+2]|0,i=i+e[o+3]|0,o+=4,a-=4;switch(i=((i+(r<<8)|0)+(n<<16)|0)+(t<<24)|0,a){case 3:i=i+(e[o+2]<<8)|0;case 2:i=i+(e[o+1]<<16)|0;case 1:i=i+(e[o+0]<<24)|0}return i>>>0}return o.prototype.haveBytes=function(){return this.posthis.a.length)throw new RangeError("out of bounds");return e},o.prototype.getChar=function(){return String.fromCharCode(this.getByte())},o.prototype.getInt=function(){for(var e,t=0;this.haveBytes()&&(e=i[127&this.getByte()])>=0;)t=(t<<6)+e;return this.pos--,t>>>0},a.prototype.toArray=function(){return this.a},a.prototype.putByte=function(e){this.a.push(255&e)},a.prototype.putChar=function(e){this.putByte(e.charCodeAt(0))},a.prototype.putInt=function(e){var t,n,i=[];if(0!==e){for(t=0;e>0;t++,e>>>=6)i.push(r[63&e]);for(n=t-1;n>=0;n--)this.putByte(i[n])}else this.putChar("0")},a.prototype.putArray=function(e,t,n){for(var r=t;r=0&&M-- >0;){var S,E,T,A,k,C,R;for(A=0,C=g=y*t,R=x+i;C=s(i-k)+s(S)+s(E)+3&&S>b&&(b=S,w=g-k,_=T),y=d[y]}if(b>0){_>0&&(o.putInt(_),o.putChar(":"),o.putArray(r,x,x+_),x+=_),x+=b,o.putInt(b),o.putChar("@"),o.putInt(w),o.putChar(","),w+b-1>f&&(f=w+b-1),b=0;break}if(x+i+t>=c){o.putInt(c-x),o.putChar(":"),o.putArray(r,x,x+c-x),x=c;break}m.next(r[x+i+t]),i++}return xr)throw new Error("copy exceeds output file size");if(d+h>c)throw new Error("copy extends past end of input");f.putArray(e,d,d+h);break;case":":if((i+=h)>r)throw new Error("insert command gives an output larger than predicted");if(h>l)throw new Error("insert count exceeds size of delta");f.putArray(s.a,s.pos,s.pos+h),s.pos+=h;break;case";":var p=f.toArray();if((!n||!1!==n.verifyChecksum)&&h!==u(p))throw new Error("bad checksum");if(i!==r)throw new Error("generated size does not match predicted size");return p;default:throw new Error("unknown delta operator")}}throw new Error("unterminated delta")},e},e.exports?e.exports=i():r.fossilDelta=i()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SchemaSerializer=void 0;var r=n(37),i=function(){function e(){}return e.prototype.setState=function(e){this.state.decode(e)},e.prototype.getState=function(){return this.state},e.prototype.patch=function(e){this.state.decode(e)},e.prototype.teardown=function(){var e,t;null===(t=null===(e=this.state)||void 0===e?void 0:e.$changes)||void 0===t||t.root.clearRefs()},e.prototype.handshake=function(e,t){this.state?(new r.Reflection).decode(e,t):this.state=r.Reflection.decode(e,t)},e}();t.SchemaSerializer=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);Object.defineProperty(t,"Schema",{enumerable:!0,get:function(){return r.Schema}});var i=n(6);Object.defineProperty(t,"MapSchema",{enumerable:!0,get:function(){return i.MapSchema}});var o=n(4);Object.defineProperty(t,"ArraySchema",{enumerable:!0,get:function(){return o.ArraySchema}});var a=n(15);Object.defineProperty(t,"CollectionSchema",{enumerable:!0,get:function(){return a.CollectionSchema}});var s=n(16);Object.defineProperty(t,"SetSchema",{enumerable:!0,get:function(){return s.SetSchema}});var u=n(40);Object.defineProperty(t,"dumpChanges",{enumerable:!0,get:function(){return u.dumpChanges}});var c=n(41);Object.defineProperty(t,"Reflection",{enumerable:!0,get:function(){return c.Reflection}}),Object.defineProperty(t,"ReflectionType",{enumerable:!0,get:function(){return c.ReflectionType}}),Object.defineProperty(t,"ReflectionField",{enumerable:!0,get:function(){return c.ReflectionField}});var l=n(5);Object.defineProperty(t,"type",{enumerable:!0,get:function(){return l.type}}),Object.defineProperty(t,"deprecated",{enumerable:!0,get:function(){return l.deprecated}}),Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return l.filter}}),Object.defineProperty(t,"filterChildren",{enumerable:!0,get:function(){return l.filterChildren}}),Object.defineProperty(t,"defineTypes",{enumerable:!0,get:function(){return l.defineTypes}}),Object.defineProperty(t,"hasFilter",{enumerable:!0,get:function(){return l.hasFilter}}),Object.defineProperty(t,"SchemaDefinition",{enumerable:!0,get:function(){return l.SchemaDefinition}}),Object.defineProperty(t,"Context",{enumerable:!0,get:function(){return l.Context}});var f=n(0);Object.defineProperty(t,"OPERATION",{enumerable:!0,get:function(){return f.OPERATION}})},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spread||function(){for(var e=[],t=0;t=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(t,"__esModule",{value:!0}),t.Reflection=t.ReflectionType=t.ReflectionField=void 0;var o=n(5),a=n(1),s=n(4),u=n(2),c=new o.Context,l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),i([o.type("string",c)],t.prototype,"name",void 0),i([o.type("string",c)],t.prototype,"type",void 0),i([o.type("number",c)],t.prototype,"referencedType",void 0),t}(a.Schema);t.ReflectionField=l;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.fields=new s.ArraySchema,t}return r(t,e),i([o.type("number",c)],t.prototype,"id",void 0),i([o.type([l],c)],t.prototype,"fields",void 0),t}(a.Schema);t.ReflectionType=f;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.types=new s.ArraySchema,t}return r(t,e),t.encode=function(e){var n=e.constructor,r=new t;r.rootType=n._typeid;var i=function(e,t){for(var n in t){var i=new l;i.name=n;var o=void 0;if("string"===typeof t[n])o=t[n];else{var s=t[n],u=void 0;a.Schema.is(s)?(o="ref",u=t[n]):"string"===typeof s[o=Object.keys(s)[0]]?o+=":"+s[o]:u=s[o],i.referencedType=u?u._typeid:-1}i.type=o,e.fields.push(i)}r.types.push(e)},o=n._context.types;for(var s in o){var u=new f;u.id=Number(s),i(u,o[s]._definition.schema)}return r.encodeAll()},t.decode=function(e,n){var i=new o.Context,s=new t;s.decode(e,n);var c=s.types.reduce((function(e,t){var n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(a.Schema),o=t.id;return e[o]=n,i.add(n,o),e}),{});s.types.forEach((function(e){var t=c[e.id];e.fields.forEach((function(e){var n;if(void 0!==e.referencedType){var r=e.type,a=c[e.referencedType];if(!a){var s=e.type.split(":");r=s[0],a=s[1]}"ref"===r?o.type(a,i)(t.prototype,e.name):o.type(((n={})[r]=a,n),i)(t.prototype,e.name)}else o.type(e.type,i)(t.prototype,e.name)}))}));var l=c[s.rootType],f=new l;for(var h in l._definition.schema){var d=l._definition.schema[h];"string"!==typeof d&&(f[h]="function"===typeof d?new d:new(u.getType(Object.keys(d)[0]).constructor))}return f},i([o.type([f],c)],t.prototype,"types",void 0),i([o.type("number",c)],t.prototype,"rootType",void 0),t}(a.Schema);t.Reflection=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoneSerializer=void 0;var r=function(){function e(){}return e.prototype.setState=function(e){},e.prototype.getState=function(){return null},e.prototype.patch=function(e){},e.prototype.teardown=function(){},e.prototype.handshake=function(e){},e}();t.NoneSerializer=r}])},e.exports=r()},function(e,t,n){"use strict";var r=n(180),i=r.default,o=r.DraggableCore;e.exports=i,e.exports.default=i,e.exports.DraggableCore=o},function(e,t,n){"use strict";var r=n(1),i=n(148),o=n.n(i);t.a=function(){var e=Object(r.useRef)(o.a.apply(void 0,arguments)),t=e.current;return Object(r.useEffect)((function(){return function(){t&&t.removeAllListeners(),t&&t.close()}}),[t]),[t]}},function(e,t,n){var r=n(210),i=n(88),o=n(119),a=n(39)("socket.io-client");e.exports=t=u;var s=t.managers={};function u(e,t){"object"===typeof e&&(t=e,e=void 0),t=t||{};var n,i=r(e),u=i.source,c=i.id,l=i.path,f=s[c]&&l in s[c].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||f?(a("ignoring socket cache for %s",u),n=o(u,t)):(s[c]||(a("new io instance for %s",u),s[c]=o(u,t)),n=s[c]),i.query&&!t.query&&(t.query=i.query),n.socket(i.path,t)}t.protocol=i.protocol,t.connect=u,t.Manager=n(119),t.Socket=n(124)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(15),i=n(53);var o=n(54);function a(e){var t="function"===typeof Map?new Map:void 0;return(a=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return Object(o.a)(e,arguments,Object(r.a)(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Object(i.a)(a,e)})(e)}},,,function(e,t,n){"use strict";n(55);var r=n(1),i=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,l=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(l=t.ref),t)s.call(t,r)&&!u.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:l,props:o,_owner:a.current}}t.jsx=c,t.jsxs=c},function(e,t,n){"use strict";var r=n(55),i=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,u=60112;t.Suspense=60113;var c=60115,l=60116;if("function"===typeof Symbol&&Symbol.for){var f=Symbol.for;i=f("react.element"),o=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),a=f("react.provider"),s=f("react.context"),u=f("react.forward_ref"),t.Suspense=f("react.suspense"),c=f("react.memo"),l=f("react.lazy")}var h="function"===typeof Symbol&&Symbol.iterator;function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n