[
  {
    "path": "CHANGELOG.md",
    "content": "## 0.3.0\n\n#### Enhancements\n\n- Add an Object class: convenience methods to produce lines, spheres, tubes, and imported OBJ/MTL meshes, as well as a method to bring in THREE.Object3D's produced elsewhere with vanilla Three.js. Most of these are moveable, and have methods to move/rotate/rescale\n\n- No need to call `tb.update()` after putting it in the custom layer's `render()` function.\n\n#### Bug fixes\n\n- Automatically adjust for viewport size (https://github.com/peterqliu/threebox/issues/43)\n\n#### Deprecated (but still functional)\n- `.setupDefaultLights()` has moved to an optional `defaultLights` parameter, in the third argument for Threebox().\n- `tb.addAtCoordinate()` and `tb.moveToCoordinate()` have been deprecated. `tb.add(Object)` and `Object.setCoords()` replace them"
  },
  {
    "path": "LICENSE.txt",
    "content": "MIT License\n\nCopyright (c) 2017 Peter Liu\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# `threebox`\n\nA three.js plugin for Mapbox GL JS, using the custom layer feature. Provides convenient methods to manage objects in lnglat coordinates, and to synchronize the map and scene cameras.\n\n<img alt=\"threebox\" src=\"docs/gallery.jpg\">\n\n### Compatibility/Dependencies\n\n- Mapbox v.0.50.0 and later (for custom layer support)\n- Three.r94 (already bundled into the Threebox build). If desired, other versions can be swapped in and rebuilt [here](https://github.com/peterqliu/threebox/blob/master/src/three.js), though compatibility is not guaranteed.\n\n### Getting started\n\nDownload the bundle from [`dist/threebox.js`](dist/threebox.js) and add include it in a `<script>` tag on your page.\n\nSeveral introductory examples are [here](https://github.com/peterqliu/threebox/tree/master/examples). To run them, create a `config.js` file with your Mapbox access token, alongside and in the format of [the template](https://github.com/peterqliu/threebox/blob/master/examples/config_template.js).\n\n[Documentation lives here](docs/Threebox.md).\n\n### Contributing\n\nBuild the library with `npm run build`, or `npm run dev` to rebuild continuously as you develop. Both commands will output a bundle in `/dist/threebox.js`.\n\nTests live [here](tests/) -- run `index.html` and check the console for test results.\n\n\n"
  },
  {
    "path": "dist/threebox.js",
    "content": "(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\nwindow.Threebox = require('./src/Threebox.js'),\nwindow.THREE = require('./src/three.js')\n\n},{\"./src/Threebox.js\":2,\"./src/three.js\":16}],2:[function(require,module,exports){\nvar THREE = require(\"./three.js\");\nvar CameraSync = require(\"./camera/CameraSync.js\");\nvar utils = require(\"./utils/utils.js\");\nvar AnimationManager = require(\"./animation/AnimationManager.js\");\nvar ThreeboxConstants = require(\"./utils/constants.js\");\n\nvar Objects = require(\"./objects/objects.js\");\nvar material = require(\"./utils/material.js\");\nvar sphere = require(\"./objects/sphere.js\");\nvar loadObj = require(\"./objects/loadObj.js\");\nvar Object3D = require(\"./objects/Object3D.js\");\nvar line = require(\"./objects/line.js\");\nvar tube = require(\"./objects/tube.js\");\n\nfunction Threebox(map, glContext, options){\n\n    this.init(map, glContext, options);\n\n};\n\nThreebox.prototype = {\n\n    repaint: function(){\n        this.map.repaint = true;\n    },\n\n    init: function (map, glContext, options){\n\n        this.map = map;\n\n        // Set up a THREE.js scene\n        this.renderer = new THREE.WebGLRenderer( { \n            alpha: true, \n            antialias: true,\n            canvas: map.getCanvas(),\n            context: glContext\n        } );\n\n        this.renderer.shadowMap.enabled = true;\n        this.renderer.autoClear = false;\n\n        this.scene = new THREE.Scene();\n        this.camera = new THREE.PerspectiveCamera( 28, window.innerWidth / window.innerHeight, 0.000000000001, Infinity);\n\n        // The CameraSync object will keep the Mapbox and THREE.js camera movements in sync.\n        // It requires a world group to scale as we zoom in. Rotation is handled in the camera's\n        // projection matrix itself (as is field of view and near/far clipping)\n        // It automatically registers to listen for move events on the map so we don't need to do that here\n        this.world = new THREE.Group();\n        this.scene.add(this.world);\n\n        this.cameraSync = new CameraSync(this.map, this.camera, this.world);\n\n        //raycaster for mouse events\n        this.raycaster = new THREE.Raycaster();\n\n        // apply starter options\n        \n        this.options = utils._validate(options || {}, defaultOptions);\n        if (this.options.defaultLights) this.defaultLights();\n        \n    },\n\n    // Objects\n\n    objects: new Objects(AnimationManager),\n\n    sphere: sphere,\n\n    line: line,\n\n    tube: function(obj){\n        return tube(obj, this.world)\n    },\n\n    Object3D: function(obj, o) {\n        return Object3D(obj, o)\n    },\n\n    loadObj: loadObj,\n\n\n    // Material\n\n    material: function(o){\n        return material(o)\n    },\n\n    utils: utils,\n\n    projectToWorld: function(coords) {\n        return this.utils.projectToWorld(coords)\n    },\n\n    unprojectFromWorld: function(v3) {\n        return this.utils.unprojectFromWorld(v3)\n    },\n\n    projectedUnitsPerMeter: function(lat) {\n        return this.utils.projectedUnitsPerMeter(lat)\n    },\n\n    queryRenderedFeatures: function(point){\n\n        var mouse = new THREE.Vector2();\n        \n        // // scale mouse pixel position to a percentage of the screen's width and height\n        mouse.x = ( point.x / this.map.transform.width ) * 2 - 1;\n        mouse.y = 1 - ( point.y / this.map.transform.height ) * 2;\n\n        this.raycaster.setFromCamera(mouse, this.camera);\n\n        // calculate objects intersecting the picking ray\n        var intersects = this.raycaster.intersectObjects(this.world.children, true);\n\n        return intersects\n    },\n\n    update: function() {\n        \n        if (this.map.repaint) this.map.repaint = false\n\n        var timestamp = Date.now();\n\n        // Update any animations\n        this.objects.animationManager.update(timestamp);\n        \n        this.renderer.state.reset();\n\n        // Render the scene and repaint the map\n        this.renderer.render( this.scene, this.camera );\n\n        if (this.options.passiveRendering === false) this.map.triggerRepaint();\n    },\n\n    add: function(obj) {\n        this.world.add(obj);\n    },\n\n    remove: function(obj) {\n        this.world.remove(obj);\n    },\n\n\n    defaultLights: function(){\n\n        this.scene.add( new THREE.AmbientLight( 0xffffff ) );\n        var sunlight = new THREE.DirectionalLight(0xffffff, 0.25);\n        sunlight.position.set(0,80000000,100000000);\n        sunlight.matrixWorldNeedsUpdate = true;\n        this.world.add(sunlight);\n\n    },\n\n    memory: function (){ return this.renderer.info.memory},\n\n    version: '0.3.0',\n\n    // DEPRECATED METHODS\n\n    setupDefaultLights: function() {\n        console.warn('.setupDefaultLights() has been moved to a \"defaultLights\" option inside Threebox()')\n        this.defaultLights();\n    },\n\n    addAtCoordinate: function(obj, lnglat, options) {\n        \n        console.warn('addAtCoordinate() has been deprecated. Check out the and threebox.add() Object.setCoords() methods instead.')\n        \n        obj = this.Object3D({obj:obj});\n\n        obj.setCoords(lnglat)\n        this.add(obj);\n\n        return obj;\n    },\n\n    moveToCoordinate: function(obj, lnglat, options) {\n        console.warn('addAtCoordinate() has been deprecated. Check out the Object.setCoords() and threebox.add() methods instead.')\n\n        if (!obj.setCoords) obj = this.Object3D(obj);\n        obj.setCoords(lnglat, options);\n\n        return obj;\n    }\n}\n\nvar defaultOptions = {\n    defaultLights: false,\n    passiveRendering: true\n}\nmodule.exports = exports = Threebox;\n\n\n},{\"./animation/AnimationManager.js\":6,\"./camera/CameraSync.js\":7,\"./objects/Object3D.js\":8,\"./objects/line.js\":9,\"./objects/loadObj.js\":10,\"./objects/objects.js\":13,\"./objects/sphere.js\":14,\"./objects/tube.js\":15,\"./three.js\":16,\"./utils/constants.js\":17,\"./utils/material.js\":18,\"./utils/utils.js\":19}],3:[function(require,module,exports){\nvar THREE = require(\"../three.js\");\nvar Constants = require(\"./constants.js\");\nvar validate = require(\"./validate.js\");\n\nvar utils = {\n\n    prettyPrintMatrix: function(uglymatrix){\n        for (var s=0; s<4; s++){\n            var quartet=[uglymatrix[s],\n            uglymatrix[s+4],\n            uglymatrix[s+8],\n            uglymatrix[s+12]];\n            console.log(quartet.map(function(num){return num.toFixed(4)}))\n        }\n    },\n\n    makePerspectiveMatrix: function(fovy, aspect, near, far) {\n\n        var out = new THREE.Matrix4();\n        var f = 1.0 / Math.tan(fovy / 2),\n        nf = 1 / (near - far);\n\n        var newMatrix = [\n            f / aspect, 0, 0, 0,\n            0, f, 0, 0,\n            0, 0, (far + near) * nf, -1,\n            0, 0, (2 * far * near) * nf, 0\n        ]\n\n        out.elements = newMatrix\n        return out;\n    },\n\n    //gimme radians\n    radify: function(deg){\n\n        function convert(degrees){\n            degrees = degrees || 0;\n            return Math.PI*2*degrees/360\n        }\n\n        if (typeof deg === 'object'){\n\n            //if [x,y,z] array of rotations\n            if (deg.length > 0){\n                return deg.map(function(degree){\n                    return convert(degree)\n                })\n            }\n\n            // if {x: y: z:} rotation object\n            else {\n                return [convert(deg.x), convert(deg.y), convert(deg.z)]\n            }\n        }\n\n        //if just a number\n        else return convert(deg)\n    },\n\n    //gimme degrees\n    degreeify: function(rad){\n        function convert(radians){\n            radians = radians || 0;\n            return radians * 360/(Math.PI*2)\n        }\n\n        if (typeof rad === 'object') {\n            return [convert(rad.x), convert(rad.y), convert(rad.z)]\n        }\n\n        else return convert(rad)\n    },\n\n    projectToWorld: function(coords){\n\n        // Spherical mercator forward projection, re-scaling to WORLD_SIZE\n\n        var projected = [\n            -Constants.MERCATOR_A * Constants.DEG2RAD* coords[0] * Constants.PROJECTION_WORLD_SIZE,\n            -Constants.MERCATOR_A * Math.log(Math.tan((Math.PI*0.25) + (0.5 * Constants.DEG2RAD * coords[1]) )) * Constants.PROJECTION_WORLD_SIZE\n        ];\n     \n        //z dimension, defaulting to 0 if not provided\n\n        if (!coords[2]) projected.push(0)\n        else {\n            var pixelsPerMeter = this.projectedUnitsPerMeter(coords[1]);\n            projected.push( coords[2] * pixelsPerMeter );\n        }\n\n        var result = new THREE.Vector3(projected[0], projected[1], projected[2]);\n\n        return result;\n    },\n\n    projectedUnitsPerMeter: function(latitude) {\n        return Math.abs( Constants.WORLD_SIZE / Math.cos( Constants.DEG2RAD * latitude ) / Constants.EARTH_CIRCUMFERENCE );\n    },\n\n    _scaleVerticesToMeters: function(centerLatLng, vertices) {\n        var pixelsPerMeter = this.projectedUnitsPerMeter(centerLatLng[1]);\n        var centerProjected = this.projectToWorld(centerLatLng);\n\n        for (var i = 0; i < vertices.length; i++) {\n            vertices[i].multiplyScalar(pixelsPerMeter);\n        }\n\n        return vertices;\n    },\n\n    projectToScreen: function(coords) {\n        console.log(\"WARNING: Projecting to screen coordinates is not yet implemented\");\n    },\n\n    unprojectFromScreen: function (pixel) {\n        console.log(\"WARNING: unproject is not yet implemented\");\n    },\n\n    //world units to lnglat\n    unprojectFromWorld: function (worldUnits) {\n\n        var unprojected = [\n            -worldUnits.x / (Constants.MERCATOR_A * Constants.DEG2RAD * Constants.PROJECTION_WORLD_SIZE),\n            2*(Math.atan(Math.exp(worldUnits.y/(Constants.PROJECTION_WORLD_SIZE*(-Constants.MERCATOR_A))))-Math.PI/4)/Constants.DEG2RAD\n        ];\n\n        var pixelsPerMeter = this.projectedUnitsPerMeter(unprojected[1]);\n\n        //z dimension\n        var height = worldUnits.z || 0;\n        unprojected.push( height / pixelsPerMeter );\n\n        return unprojected;\n    },\n\n    _flipMaterialSides: function(obj) {\n\n    },\n\n    // to improve precision, normalize a series of vector3's to their collective center, and move the resultant mesh to that center\n    normalizeVertices(vertices) {\n\n        var geometry = new THREE.Geometry();\n\n        for (v3 of vertices) {\n            geometry.vertices.push(v3)\n        }\n\n        geometry.computeBoundingSphere();\n        var center = geometry.boundingSphere.center;\n        var radius = geometry.boundingSphere.radius;\n\n        var scaled = vertices.map(function(v3){\n            var normalized = v3.sub(center);\n            return normalized;\n        });\n\n        return {vertices: scaled, position: center}\n    },\n\n    //flatten an array of Vector3's into a shallow array of values in x-y-z order, for bufferGeometry\n    flattenVectors(vectors) {\n        var flattenedArray = [];\n        for (vertex of vectors) {\n            flattenedArray.push(vertex.x, vertex.y, vertex.z);\n        }\n        return flattenedArray\n    },\n\n    //convert a line/polygon to Vector3's\n\n    lnglatsToWorld: function(coords){\n\n        var vector3 = coords.map(\n            function(pt){\n                var p = utils.projectToWorld(pt);\n                var v3 = new THREE.Vector3(p.x, p.y, p.z);\n                return v3\n            }\n        );\n\n        return vector3\n    },\n\n    extend: function(original, addition) {\n        for (key in addition) original[key] = addition[key];\n    },\n\n    clone: function(original) {\n        var clone = {};\n        for (key in original) clone[key] = original[key];\n        return clone;\n    },\n    \n    // retrieve object parameters from an options object\n\n    types: {\n\n        rotation: function(r, currentRotation){\n\n            // if number provided, rotate only in Z by that amount\n            if (typeof r === 'number') r = {z:r};\n\n            var degrees = this.applyDefault([r.x, r.y, r.z], currentRotation);\n            var radians = utils.radify(degrees);\n            return radians;\n            \n        },\n\n        scale: function(s, currentScale){\n            if (typeof s === 'number') return s = [s,s,s]; \n            else return this.applyDefault([s.x, s.y, s.z], currentScale);\n        },\n\n        applyDefault: function(array, current){\n\n            var output = array.map(function(item, index){\n                item = item || current[index];\n                return item\n            })\n\n            return output\n        }\n    },\n\n    _validate: function(userInputs, defaults){\n        \n        userInputs = userInputs || {};\n        var validatedOutput = {};\n        utils.extend(validatedOutput, userInputs);\n\n        for (key of Object.keys(defaults)){\n\n            if (userInputs[key] === undefined) {\n                //make sure required params are present\n                if (defaults[key] === null) {\n                    console.error(key + ' is required')\n                    return;\n                }\n    \n                else validatedOutput[key] = defaults[key]\n\n            }\n\n            else validatedOutput[key] = userInputs[key]\n        }\n\n        return validatedOutput\n    },\n    Validator: new validate(),\n    exposedMethods: ['projectToWorld', 'projectedUnitsPerMeter', 'extend', 'unprojectFromWorld']\n}\n\nmodule.exports = exports = utils\n},{\"../three.js\":16,\"./constants.js\":4,\"./validate.js\":5}],4:[function(require,module,exports){\nconst WORLD_SIZE = 1024000;\nconst MERCATOR_A = 6378137.0;\n\nmodule.exports = exports = {\n    WORLD_SIZE: WORLD_SIZE,\n    PROJECTION_WORLD_SIZE: WORLD_SIZE / (MERCATOR_A * Math.PI * 2),\n    MERCATOR_A: MERCATOR_A, // 900913 projection property\n    DEG2RAD: Math.PI / 180,\n    RAD2DEG: 180 / Math.PI,\n    EARTH_CIRCUMFERENCE: 40075000, // In meters\n}\n},{}],5:[function(require,module,exports){\n// Type validator\n\nfunction Validate(){\n\n};\n\nValidate.prototype = {\n\n    Coords: function(input) {\n\n        if (input.constructor !== Array) {\n            console.error(\"Coords must be an array\")\n            return\n        }\n\n        if (input.length < 2) {\n            console.error(\"Coords length must be at least 2\")\n            return\n        }\n    \n        for (member of input) {\n            if (member.constructor !== Number) {\n                console.error(\"Coords values must be numbers\")\n                return\n            }\n        }\n\n        if (Math.abs(input[1]) > 90) {\n            console.error(\"Latitude must be between -90 and 90\")\n            return                    \n        }\n\n        return input\n    },\n\n    Line: function(input) {\n\n        var scope = this;\n\n        if (input.constructor !== Array) {\n            console.error(\"Line must be an array\")\n            return\n        }\n\n        for (coord of input){\n            if (!scope.Coords(coord)) {\n                console.error(\"Each coordinate in a line must be a valid Coords type\")\n                return                    \n            }\n\n        }\n\n        return input\n    },\n\n    Rotation: function(input) {\n\n        if (input.constructor === Number) input = {z: input}\n\n        else if (input.constructor === Object) {\n\n            for (key of Object.keys(input)){\n\n                if (!['x', 'y', 'z'].includes(key)) {\n                    console.error('Rotation parameters must be x, y, or z')\n                    return                            \n                }\n                if (input[key].constructor !== Number) {\n                    console.error('Individual rotation values must be numbers')\n                    return\n                }\n            }\n        }\n\n        else {\n            console.error('Rotation must be an object or a number')\n            return\n        }\n\n        return input\n    },\n\n    Scale: function(input) {\n\n        if (input.constructor === Number) {\n            input = {x:input, y:input, z: input}\n        }\n        \n        else if (input.constructor === Object) {\n\n            for (key of Object.keys(input)){\n\n                if (!['x', 'y', 'z'].includes(key)) {\n                    console.error('Scale parameters must be x, y, or z')\n                    return                            \n                }\n                if (input[key].constructor !== Number) {\n                    console.error('Individual scale values must be numbers')\n                    return\n                }\n            }\n        }\n\n        else {\n            console.error('Scale must be an object or a number')\n            return\n        }\n\n        return input\n    }\n\n}\n\n\nmodule.exports = exports = Validate;\n},{}],6:[function(require,module,exports){\nvar threebox = require('../Threebox.js');\nvar utils = require(\"../utils/utils.js\");\nvar validate = require(\"../utils/validate.js\");\n\nfunction AnimationManager(map) {\n\n    this.map = map\n    this.enrolledObjects = [];    \n    this.previousFrameTime;\n\n};\n\nAnimationManager.prototype = {\n\n    enroll: function(obj) {\n\n        /* Extend the provided object with animation-specific properties and track in the animation manager */\n\n        this.enrolledObjects.push(obj);\n\n        // Give this object its own internal animation queue\n        obj.animationQueue = [];\n\n        obj.set = function(options) {\n\n            //if duration is set, animate to the new state\n            if (options.duration > 0 ){\n\n                var newParams = {\n                    start: Date.now(),\n                    expiration: Date.now() + options.duration,\n                    endState: {}\n                }\n\n                utils.extend(options, newParams);\n\n                var translating = options.coords;\n                var rotating = options.rotation;\n                var scaling = options.scale || options.scaleX || options.scaleY || options.scaleZ;\n\n                if (rotating) {\n                    \n                    var r = obj.rotation;\n                    options.startRotation = [r.x, r.y, r.z];\n\n\n                    options.endState.rotation = utils.types.rotation(options.rotation, options.startRotation);\n                    options.rotationPerMs = options.endState.rotation\n                        .map(function(angle, index){\n                            return (angle-options.startRotation[index])/options.duration;\n                        })\n                }\n\n                if (scaling) {\n                    var s = obj.scale;\n                    options.startScale = [s.x, s.y, s.z];\n                    options.endState.scale = utils.types.scale(options.scale, options.startScale);\n\n                    options.scalePerMs = options.endState.scale\n                        .map(function(scale, index){\n                            return (scale-options.startScale[index])/options.duration;\n                        })                    \n                }\n\n                if (translating) options.pathCurve = new THREE.CatmullRomCurve3(utils.lnglatsToWorld([obj.coordinates, options.coords]));\n\n                var entry = {\n                    type:'set',\n                    parameters: options\n                }\n\n                this.animationQueue\n                    .push(entry);\n\n                map.repaint = true;   \n            }\n\n            //if no duration set, stop object's existing animations and go to that state immediately\n            else {\n                this.stop();\n                options.rotation = utils.radify(options.rotation);\n                this._setObject(options);\n            }\n\n            return this\n\n        };\n\n        obj.stop = function(){\n            this.animationQueue = [];\n            return this;\n        }\n\n        obj.followPath = function (options, cb){\n\n            var entry = {\n                type: 'followPath', \n                parameters: utils._validate(options, defaults.followPath)\n            };\n                     \n            utils.extend(\n                entry.parameters, \n                {\n                    pathCurve: new THREE.CatmullRomCurve3(\n                        utils.lnglatsToWorld(options.path)\n                    ),\n                    start: Date.now(),\n                    expiration: Date.now() + entry.parameters.duration,\n                    cb: cb\n                }\n            );    \n\n            this.animationQueue\n                .push(entry);\n\n            map.repaint = true;\n            \n            return this;\n        };\n\n        obj._setObject = function (options){\n\n            var p = options.position; // lnglat\n            var r = options.rotation; // radians\n            var s = options.scale; // \n            var w = options.worldCoordinates; //Vector3\n            var q = options.quaternion // [axis, angle]\n\n            if (p) {\n                this.coordinates = p;\n                var c = utils.projectToWorld(p);\n                this.position.copy(c)\n            }\n\n            if (r) this.rotation.set(r[0], r[1], r[2]);\n            \n            if (s) this.scale.set(s[0], s[1], s[2]);\n            \n            if (q) this.quaternion.setFromAxisAngle(q[0], q[1]);\n            \n            if (w) this.position.copy(w);\n\n            map.repaint = true\n        }\n    },\n\n    update: function(now) {\n\n        if (this.previousFrameTime === undefined) this.previousFrameTime = now;\n\n        var dimensions = ['X','Y','Z'];\n\n        //iterate through objects in queue. count in reverse so we can cull objects without frame shifting\n        for (var a = this.enrolledObjects.length-1; a>=0; a--){   \n\n            var object = this.enrolledObjects[a];\n\n            if(!object.animationQueue || object.animationQueue.length === 0) continue;\n\n            //focus on first item in queue\n            var item = object.animationQueue[0];\n            var options = item.parameters;\n\n            // if an animation is past its expiration date, cull it\n            if (!options.expiration) {\n                // console.log('culled')\n\n                object.animationQueue.splice(0,1);\n\n                // set the start time of the next animation\n                if (object.animationQueue[0]) object.animationQueue[0].parameters.start = now;\n\n                return\n            }\n\n            //if finished, jump to end state and flag animation entry for removal next time around. Execute callback if there is one\n            var expiring = now >= options.expiration;\n\n            if (expiring) {\n                options.expiration = false;\n                if (options.endState) object._setObject(options.endState);\n                options.cb();\n            }\n\n            else {\n\n                var timeProgress = (now - options.start) / options.duration;\n\n                if (item.type === 'set'){\n\n                    var objectState = {};\n\n                    if (options.pathCurve) objectState.worldCoordinates = options.pathCurve.getPoint(timeProgress);\n\n                    if (options.rotationPerMs) {\n                        objectState.rotation = options.startRotation.map(function(rad, index){\n                            return rad + options.rotationPerMs[index] * timeProgress * options.duration\n                        })\n                    }\n\n                    if (options.scalePerMs) {\n                        objectState.scale = options.startScale.map(function(scale, index){\n                            return scale + options.scalePerMs[index]*timeProgress * options.duration\n                        })\n                    }\n\n                    object._setObject(objectState);\n                }\n\n                if (item.type === 'followPath'){\n\n                    var position = options.pathCurve.getPointAt(timeProgress);\n                    objectState = {worldCoordinates: position};\n\n                    // if we need to track heading\n                    if (options.trackHeading){\n\n                        var tangent = options.pathCurve\n                        .getTangentAt(timeProgress)\n                            .normalize();\n\n                        var axis = new THREE.Vector3(0,0,0);\n                        var up = new THREE.Vector3(0,1,0);\n\n                        axis\n                            .crossVectors(up, tangent)\n                            .normalize();\n\n                        var radians = Math.acos(up.dot(tangent));\n\n                        objectState.quaternion = [axis, radians];\n\n                    }\n\n                    object._setObject(objectState);\n\n                }\n            }\n\n        }\n\n        this.previousFrameTime = now;\n    }\n}\n\nconst defaults = {\n    followPath: {\n        path: null,\n        duration: 1000,\n        trackHeading: true\n    }\n}\nmodule.exports = exports = AnimationManager;\n},{\"../Threebox.js\":2,\"../utils/utils.js\":19,\"../utils/validate.js\":20}],7:[function(require,module,exports){\nvar THREE = require(\"../three.js\");\nvar utils = require(\"../utils/utils.js\");\nvar ThreeboxConstants = require(\"../utils/constants.js\");\n\nfunction CameraSync(map, camera, world) {\n\n    this.map = map;\n    this.camera = camera;\n    this.active = true;\n\n    this.camera.matrixAutoUpdate = false;   // We're in charge of the camera now!\n\n    // Postion and configure the world group so we can scale it appropriately when the camera zooms\n    this.world = world || new THREE.Group();\n    this.world.position.x = this.world.position.y = ThreeboxConstants.WORLD_SIZE/2\n    this.world.matrixAutoUpdate = false;\n\n\n    //set up basic camera state\n\n    this.state = {\n        fov: 0.6435011087932844,\n        translateCenter: new THREE.Matrix4,\n        worldSizeRatio: 512/ThreeboxConstants.WORLD_SIZE\n    };\n\n    this.state.translateCenter.makeTranslation(ThreeboxConstants.WORLD_SIZE/2, -ThreeboxConstants.WORLD_SIZE / 2, 0);\n\n    // Listen for move events from the map and update the Three.js camera. Some attributes only change when viewport resizes, so update those accordingly\n    var _this = this;\n\n    this.map\n        .on('move', function() {\n            _this.updateCamera()\n        })\n        .on('resize', function(){\n            _this.setupCamera();\n        })\n\n\n    this.setupCamera();\n}\n\nCameraSync.prototype = {\n\n    setupCamera: function() {\n\n        var t = this.map.transform\n        const halfFov = this.state.fov / 2;\n        var cameraToCenterDistance = 0.5 / Math.tan(halfFov) * t.height;\n        const groundAngle = Math.PI / 2 + t._pitch;\n\n        this.state.cameraToCenterDistance = cameraToCenterDistance;\n        this.state.cameraTranslateZ = new THREE.Matrix4().makeTranslation(0,0,cameraToCenterDistance);\n        this.state.topHalfSurfaceDistance = Math.sin(halfFov) * cameraToCenterDistance / Math.sin(Math.PI - groundAngle - halfFov);\n    \n        this.updateCamera();\n    },\n\n    updateCamera: function(ev) {\n\n        if(!this.camera) {\n            console.log('nocamera')\n            return;\n        }\n\n        var t = this.map.transform\n\n        // Calculate z distance of the farthest fragment that should be rendered.\n        const furthestDistance = Math.cos(Math.PI / 2 - t._pitch) * this.state.topHalfSurfaceDistance + this.state.cameraToCenterDistance;\n\n        // Add a bit extra to avoid precision problems when a fragment's distance is exactly `furthestDistance`\n        const farZ = furthestDistance * 1.01;\n\n        this.camera.projectionMatrix = utils.makePerspectiveMatrix(this.state.fov, t.width / t.height, 1, farZ);\n        \n\n        var cameraWorldMatrix = new THREE.Matrix4();\n        var cameraTranslateZ = new THREE.Matrix4().makeTranslation(0,0,this.state.cameraToCenterDistance);\n        var rotatePitch = new THREE.Matrix4().makeRotationX(t._pitch);\n        var rotateBearing = new THREE.Matrix4().makeRotationZ(t.angle);\n\n        // Unlike the Mapbox GL JS camera, separate camera translation and rotation out into its world matrix\n        // If this is applied directly to the projection matrix, it will work OK but break raycasting\n\n        cameraWorldMatrix\n            .premultiply(this.state.cameraTranslateZ)\n            .premultiply(rotatePitch)\n            .premultiply(rotateBearing)   \n\n        this.camera.matrixWorld.copy(cameraWorldMatrix);\n\n\n        var zoomPow = t.scale * this.state.worldSizeRatio; \n\n        // Handle scaling and translation of objects in the map in the world's matrix transform, not the camera\n        var scale = new THREE.Matrix4;\n        var translateCenter = new THREE.Matrix4;\n        var translateMap = new THREE.Matrix4;\n        var rotateMap = new THREE.Matrix4;\n\n        scale\n            .makeScale( zoomPow, zoomPow , zoomPow );\n    \n        \n        var x = -this.map.transform.x || -this.map.transform.point.x;\n        var y = this.map.transform.y || this.map.transform.point.y;\n\n        translateMap\n            .makeTranslation(x, y, 0);\n        \n        rotateMap\n            .makeRotationZ(Math.PI);\n\n        this.world.matrix = new THREE.Matrix4;\n        this.world.matrix\n            .premultiply(rotateMap)\n            .premultiply(this.state.translateCenter)\n            .premultiply(scale)\n            .premultiply(translateMap)\n\n\n        // utils.prettyPrintMatrix(this.camera.projectionMatrix.elements);\n    }\n}\n\nmodule.exports = exports = CameraSync;\n\n},{\"../three.js\":16,\"../utils/constants.js\":17,\"../utils/utils.js\":19}],8:[function(require,module,exports){\nvar Objects = require('./objects.js');\nvar utils = require(\"../utils/utils.js\");\n\nfunction Object3D(options) {\n\toptions = utils._validate(options,  Objects.prototype._defaults.Object3D);\n\n\tvar obj = options.obj;\n\n\tif (options.units === 'meters') obj = Objects.prototype._makeGroup(options.obj, options);\n\n\tobj = Objects.prototype._addMethods(obj);\n\treturn obj\n}\n\n\nmodule.exports = exports = Object3D;\n},{\"../utils/utils.js\":19,\"./objects.js\":13}],9:[function(require,module,exports){\nvar THREE = require(\"../three.js\");\nvar utils = require(\"../utils/utils.js\");\nvar Objects = require('./objects.js');\n\nfunction line(obj){\n\n\tobj = utils._validate(obj, Objects.prototype._defaults.line);\n\n\t// Geometry\n    var straightProject = utils.lnglatsToWorld(obj.geometry);\n\tvar normalized = utils.normalizeVertices(straightProject);\n    var flattenedArray = utils.flattenVectors(normalized.vertices);\n\tconsole.log('line', normalized.vertices)\n\n\tvar geometry = new THREE.LineGeometry();\n\tgeometry.setPositions( flattenedArray );\n\t// geometry.setColors( colors );\n\n\t// Material\n\tmatLine = new THREE.LineMaterial( {\n\t\tcolor: obj.color,\n\t\tlinewidth: obj.width, // in pixels\n\t\tdashed: false,\n\t\topacity: obj.opacity\n\t} );\n\t\n\tmatLine.resolution.set( window.innerWidth, window.innerHeight );\n\tmatLine.isMaterial = true;\n\tmatLine.transparent = true;\n\tmatLine.depthWrite = false;\n\n\t// Mesh\n\tline = new THREE.Line2( geometry, matLine );\n\tline.position.copy(normalized.position)\n\tline.computeLineDistances();\n\n\treturn line\n}\n\nmodule.exports = exports = line;\n\n\n\n/**\n * custom line shader by WestLangley, sourced from https://github.com/mrdoob/three.js/tree/master/examples/js/lines\n *\n */\n\nTHREE.LineSegmentsGeometry = function () {\n\n\tTHREE.InstancedBufferGeometry.call( this );\n\n\tthis.type = 'LineSegmentsGeometry';\n\n\tvar plane = new THREE.BufferGeometry();\n\n\tvar positions = [ - 1, 2, 0, 1, 2, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, - 1, 0, 1, - 1, 0 ];\n\tvar uvs = [ 0, 1, 1, 1, 0, .5, 1, .5, 0, .5, 1, .5, 0, 0, 1, 0 ];\n\tvar index = [ 0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5 ];\n\n\tthis.setIndex( index );\n\tthis.addAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );\n\tthis.addAttribute( 'uv', new THREE.Float32BufferAttribute( uvs, 2 ) );\n\n};\n\nTHREE.LineSegmentsGeometry.prototype = Object.assign( Object.create( THREE.InstancedBufferGeometry.prototype ), {\n\n\tconstructor: THREE.LineSegmentsGeometry,\n\n\tisLineSegmentsGeometry: true,\n\n\tapplyMatrix: function ( matrix ) {\n\n\t\tvar start = this.attributes.instanceStart;\n\t\tvar end = this.attributes.instanceEnd;\n\n\t\tif ( start !== undefined ) {\n\n\t\t\tmatrix.applyToBufferAttribute( start );\n\n\t\t\tmatrix.applyToBufferAttribute( end );\n\n\t\t\tstart.data.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t}\n\n\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\tthis.computeBoundingSphere();\n\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tsetPositions: function ( array ) {\n\n\t\tvar lineSegments;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\tlineSegments = array;\n\n\t\t} else if ( Array.isArray( array ) ) {\n\n\t\t\tlineSegments = new Float32Array( array );\n\n\t\t}\n\n\t\tvar instanceBuffer = new THREE.InstancedInterleavedBuffer( lineSegments, 6, 1 ); // xyz, xyz\n\n\t\tthis.addAttribute( 'instanceStart', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 0 ) ); // xyz\n\t\tthis.addAttribute( 'instanceEnd', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 3 ) ); // xyz\n\n\t\t//\n\n\t\tthis.computeBoundingBox();\n\t\tthis.computeBoundingSphere();\n\n\t\treturn this;\n\n\t},\n\n\tsetColors: function ( array ) {\n\n\t\tvar colors;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\tcolors = array;\n\n\t\t} else if ( Array.isArray( array ) ) {\n\n\t\t\tcolors = new Float32Array( array );\n\n\t\t}\n\n\t\tvar instanceColorBuffer = new THREE.InstancedInterleavedBuffer( colors, 6, 1 ); // rgb, rgb\n\n\t\tthis.addAttribute( 'instanceColorStart', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 0 ) ); // rgb\n\t\tthis.addAttribute( 'instanceColorEnd', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 3 ) ); // rgb\n\n\t\treturn this;\n\n\t},\n\n\tfromWireframeGeometry: function ( geometry ) {\n\n\t\tthis.setPositions( geometry.attributes.position.array );\n\n\t\treturn this;\n\n\t},\n\n\tfromEdgesGeometry: function ( geometry ) {\n\n\t\tthis.setPositions( geometry.attributes.position.array );\n\n\t\treturn this;\n\n\t},\n\n\tfromMesh: function ( mesh ) {\n\n\t\tthis.fromWireframeGeometry( new THREE.WireframeGeometry( mesh.geometry ) );\n\n\t\t// set colors, maybe\n\n\t\treturn this;\n\n\t},\n\n\tfromLineSegements: function ( lineSegments ) {\n\n\t\tvar geometry = lineSegments.geometry;\n\n\t\tif ( geometry.isGeometry ) {\n\n\t\t\tthis.setPositions( geometry.vertices );\n\n\t\t} else if ( geometry.isBufferGeometry ) {\n\n\t\t\tthis.setPositions( geometry.position.array ); // assumes non-indexed\n\n\t\t}\n\n\t\t// set colors, maybe\n\n\t\treturn this;\n\n\t},\n\n\tcomputeBoundingBox: function () {\n\n\t\tvar box = new THREE.Box3();\n\n\t\treturn function computeBoundingBox() {\n\n\t\t\tif ( this.boundingBox === null ) {\n\n\t\t\t\tthis.boundingBox = new THREE.Box3();\n\n\t\t\t}\n\n\t\t\tvar start = this.attributes.instanceStart;\n\t\t\tvar end = this.attributes.instanceEnd;\n\n\t\t\tif ( start !== undefined && end !== undefined ) {\n\n\t\t\t\tthis.boundingBox.setFromBufferAttribute( start );\n\n\t\t\t\tbox.setFromBufferAttribute( end );\n\n\t\t\t\tthis.boundingBox.union( box );\n\n\t\t\t}\n\n\t\t};\n\n\t}(),\n\n\tcomputeBoundingSphere: function () {\n\n\t\tvar vector = new THREE.Vector3();\n\n\t\treturn function computeBoundingSphere() {\n\n\t\t\tif ( this.boundingSphere === null ) {\n\n\t\t\t\tthis.boundingSphere = new THREE.Sphere();\n\n\t\t\t}\n\n\t\t\tif ( this.boundingBox === null ) {\n\n\t\t\t\tthis.computeBoundingBox();\n\n\t\t\t}\n\n\t\t\tvar start = this.attributes.instanceStart;\n\t\t\tvar end = this.attributes.instanceEnd;\n\n\t\t\tif ( start !== undefined && end !== undefined ) {\n\n\t\t\t\tvar center = this.boundingSphere.center;\n\n\t\t\t\tthis.boundingBox.getCenter( center );\n\n\t\t\t\tvar maxRadiusSq = 0;\n\n\t\t\t\tfor ( var i = 0, il = start.count; i < il; i ++ ) {\n\n\t\t\t\t\tvector.fromBufferAttribute( start, i );\n\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );\n\n\t\t\t\t\tvector.fromBufferAttribute( end, i );\n\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );\n\n\t\t\t\t}\n\n\t\t\t\tthis.boundingSphere.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\t\tif ( isNaN( this.boundingSphere.radius ) ) {\n\n\t\t\t\t\tconsole.error( 'THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.', this );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t}(),\n\n\ttoJSON: function () {\n\n\t\t// todo\n\n\t},\n\n\tclone: function () {\n\n\t\t// todo\n\n\t},\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineGeometry = function () {\n\n\tTHREE.LineSegmentsGeometry.call( this );\n\n\tthis.type = 'LineGeometry';\n\n};\n\nTHREE.LineGeometry.prototype = Object.assign( Object.create( THREE.LineSegmentsGeometry.prototype ), {\n\n\tconstructor: THREE.LineGeometry,\n\n\tisLineGeometry: true,\n\n\tsetPositions: function ( array ) {\n\n\t\t// converts [ x1, y1, z1,  x2, y2, z2, ... ] to pairs format\n\n\t\tvar length = array.length - 3;\n\t\tvar points = new Float32Array( 2 * length );\n\n\t\tfor ( var i = 0; i < length; i += 3 ) {\n\n\t\t\tpoints[ 2 * i ] = array[ i ];\n\t\t\tpoints[ 2 * i + 1 ] = array[ i + 1 ];\n\t\t\tpoints[ 2 * i + 2 ] = array[ i + 2 ];\n\n\t\t\tpoints[ 2 * i + 3 ] = array[ i + 3 ];\n\t\t\tpoints[ 2 * i + 4 ] = array[ i + 4 ];\n\t\t\tpoints[ 2 * i + 5 ] = array[ i + 5 ];\n\n\t\t}\n\n\t\tTHREE.LineSegmentsGeometry.prototype.setPositions.call( this, points );\n\n\t\treturn this;\n\n\t},\n\n\tsetColors: function ( array ) {\n\n\t\t// converts [ r1, g1, b1,  r2, g2, b2, ... ] to pairs format\n\n\t\tvar length = array.length - 3;\n\t\tvar colors = new Float32Array( 2 * length );\n\n\t\tfor ( var i = 0; i < length; i += 3 ) {\n\n\t\t\tcolors[ 2 * i ] = array[ i ];\n\t\t\tcolors[ 2 * i + 1 ] = array[ i + 1 ];\n\t\t\tcolors[ 2 * i + 2 ] = array[ i + 2 ];\n\n\t\t\tcolors[ 2 * i + 3 ] = array[ i + 3 ];\n\t\t\tcolors[ 2 * i + 4 ] = array[ i + 4 ];\n\t\t\tcolors[ 2 * i + 5 ] = array[ i + 5 ];\n\n\t\t}\n\n\t\tTHREE.LineSegmentsGeometry.prototype.setColors.call( this, colors );\n\n\t\treturn this;\n\n\t},\n\n\tfromLine: function ( line ) {\n\n\t\tvar geometry = line.geometry;\n\n\t\tif ( geometry.isGeometry ) {\n\n\t\t\tthis.setPositions( geometry.vertices );\n\n\t\t} else if ( geometry.isBufferGeometry ) {\n\n\t\t\tthis.setPositions( geometry.position.array ); // assumes non-indexed\n\n\t\t}\n\n\t\t// set colors, maybe\n\n\t\treturn this;\n\n\t},\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.WireframeGeometry2 = function ( geometry ) {\n\n\tTHREE.LineSegmentsGeometry.call( this );\n\n\tthis.type = 'WireframeGeometry2';\n\n\tthis.fromWireframeGeometry( new THREE.WireframeGeometry( geometry ) );\n\n\t// set colors, maybe\n\n};\n\nTHREE.WireframeGeometry2.prototype = Object.assign( Object.create( THREE.LineSegmentsGeometry.prototype ), {\n\n\tconstructor: THREE.WireframeGeometry2,\n\n\tisWireframeGeometry2: true,\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n * parameters = {\n *  color: <hex>,\n *  linewidth: <float>,\n *  dashed: <boolean>,\n *  dashScale: <float>,\n *  dashSize: <float>,\n *  gapSize: <float>,\n *  resolution: <Vector2>, // to be set by renderer\n * }\n */\n\nTHREE.UniformsLib.line = {\n\n\tlinewidth: { value: 1 },\n\tresolution: { value: new THREE.Vector2( 1, 1 ) },\n\tdashScale: { value: 1 },\n\tdashSize: { value: 1 },\n\tgapSize: { value: 1 } // todo FIX - maybe change to totalSize\n\n};\n\nTHREE.ShaderLib[ 'line' ] = {\n\n\tuniforms: THREE.UniformsUtils.merge( [\n\t\tTHREE.UniformsLib.common,\n\t\tTHREE.UniformsLib.fog,\n\t\tTHREE.UniformsLib.line\n\t] ),\n\n\tvertexShader:\n\t\t`\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\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\t#include <logdepthbuf_vertex>\n\n\t\t\t#include <worldpos_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t`,\n\n\tfragmentShader:\n\t\t`\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 <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < 0.5 || vUv.y > 0.5 ) 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 ( vUv.y < 0.5 || vUv.y > 0.5 ) {\n\n\t\t\t\tfloat a = vUv.x - 0.5;\n\t\t\t\tfloat b = vUv.y - 0.5;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 0.25 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, opacity );\n\n\t\t\t#include <premultiplied_alpha_fragment>\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\n\t\t}\n\t\t`\n};\n\nTHREE.LineMaterial = function ( parameters ) {\n\n\tvar lineUniforms = THREE.UniformsUtils.clone( THREE.ShaderLib[ 'line' ].uniforms );\n\tlineUniforms.opacity.value = parameters.opacity;\n\n\tTHREE.ShaderMaterial.call( this, {\n\n\t\ttype: 'LineMaterial',\n\n\t\tuniforms: lineUniforms,\n\n\t\tvertexShader: THREE.ShaderLib[ 'line' ].vertexShader,\n\t\tfragmentShader: THREE.ShaderLib[ 'line' ].fragmentShader\n\n\t} );\n\n\tthis.dashed = false;\n\n\tObject.defineProperties( this, {\n\n\t\tcolor: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.diffuse.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.diffuse.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tlinewidth: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.linewidth.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.linewidth.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdashScale: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.dashScale.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.dashScale.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdashSize: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.dashSize.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.dashSize.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tgapSize: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.gapSize.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.gapSize.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tresolution: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.resolution.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.resolution.value.copy( value );\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\tthis.setValues( parameters );\n\n};\n\nTHREE.LineMaterial.prototype = Object.create( THREE.ShaderMaterial.prototype );\nTHREE.LineMaterial.prototype.constructor = THREE.LineMaterial;\n\nTHREE.LineMaterial.prototype.isLineMaterial = true;\n\nTHREE.LineMaterial.prototype.copy = function ( source ) {\n\n\tTHREE.ShaderMaterial.prototype.copy.call( this, source );\n\n\tthis.color.copy( source.color );\n\n\tthis.linewidth = source.linewidth;\n\n\tthis.resolution = source.resolution;\n\n\t// todo\n\n\treturn this;\n\n};\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineSegments2 = function ( geometry, material ) {\n\n\tTHREE.Mesh.call( this );\n\n\tthis.type = 'LineSegments2';\n\n\tthis.geometry = geometry !== undefined ? geometry : new THREE.LineSegmentsGeometry();\n\tthis.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );\n\n};\n\nTHREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {\n\n\tconstructor: THREE.LineSegments2,\n\n\tisLineSegments2: true,\n\n\tcomputeLineDistances: ( function () { // for backwards-compatability, but could be a method of LineSegmentsGeometry...\n\n\t\tvar start = new THREE.Vector3();\n\t\tvar end = new THREE.Vector3();\n\n\t\treturn function computeLineDistances() {\n\n\t\t\tvar geometry = this.geometry;\n\n\t\t\tvar instanceStart = geometry.attributes.instanceStart;\n\t\t\tvar instanceEnd = geometry.attributes.instanceEnd;\n\t\t\tvar lineDistances = new Float32Array( 2 * instanceStart.data.count );\n\n\t\t\tfor ( var i = 0, j = 0, l = instanceStart.data.count; i < l; i ++, j += 2 ) {\n\n\t\t\t\tstart.fromBufferAttribute( instanceStart, i );\n\t\t\t\tend.fromBufferAttribute( instanceEnd, i );\n\n\t\t\t\tlineDistances[ j ] = ( j === 0 ) ? 0 : lineDistances[ j - 1 ];\n\t\t\t\tlineDistances[ j + 1 ] = lineDistances[ j ] + start.distanceTo( end );\n\n\t\t\t}\n\n\t\t\tvar instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1\n\n\t\t\tgeometry.addAttribute( 'instanceDistanceStart', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0\n\t\t\tgeometry.addAttribute( 'instanceDistanceEnd', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}() ),\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.Line2 = function ( geometry, material ) {\n\n\tTHREE.LineSegments2.call( this );\n\n\tthis.type = 'Line2';\n\n\tthis.geometry = geometry !== undefined ? geometry : new THREE.LineGeometry();\n\tthis.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );\n\n};\n\nTHREE.Line2.prototype = Object.assign( Object.create( THREE.LineSegments2.prototype ), {\n\n\tconstructor: THREE.Line2,\n\n\tisLine2: true,\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.Wireframe = function ( geometry, material ) {\n\n\tTHREE.Mesh.call( this );\n\n\tthis.type = 'Wireframe';\n\n\tthis.geometry = geometry !== undefined ? geometry : new THREE.LineSegmentsGeometry();\n\tthis.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );\n\n};\n\nTHREE.Wireframe.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {\n\n\tconstructor: THREE.Wireframe,\n\n\tisWireframe: true,\n\n\tcomputeLineDistances: ( function () { // for backwards-compatability, but could be a method of LineSegmentsGeometry...\n\n\t\tvar start = new THREE.Vector3();\n\t\tvar end = new THREE.Vector3();\n\n\t\treturn function computeLineDistances() {\n\n\t\t\tvar geometry = this.geometry;\n\n\t\t\tvar instanceStart = geometry.attributes.instanceStart;\n\t\t\tvar instanceEnd = geometry.attributes.instanceEnd;\n\t\t\tvar lineDistances = new Float32Array( 2 * instanceStart.data.count );\n\n\t\t\tfor ( var i = 0, j = 0, l = instanceStart.data.count; i < l; i ++, j += 2 ) {\n\n\t\t\t\tstart.fromBufferAttribute( instanceStart, i );\n\t\t\t\tend.fromBufferAttribute( instanceEnd, i );\n\n\t\t\t\tlineDistances[ j ] = ( j === 0 ) ? 0 : lineDistances[ j - 1 ];\n\t\t\t\tlineDistances[ j + 1 ] = lineDistances[ j ] + start.distanceTo( end );\n\n\t\t\t}\n\n\t\t\tvar instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1\n\n\t\t\tgeometry.addAttribute( 'instanceDistanceStart', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0\n\t\t\tgeometry.addAttribute( 'instanceDistanceEnd', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}() ),\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n},{\"../three.js\":16,\"../utils/utils.js\":19,\"./objects.js\":13}],10:[function(require,module,exports){\nvar utils = require(\"../utils/utils.js\");\nvar Objects = require('./objects.js');\nconst OBJLoader = require(\"./loaders/OBJLoader.js\");\nconst MTLLoader = require(\"./loaders/MTLLoader.js\");\n\nfunction loadObj(options, cb){\n\n\t    if (options === undefined) return console.error(\"Invalid options provided to loadObj()\");\n\n\t    this.loaded = false;\n\n        const modelComplete = (m) => {\n            console.log(\"Model complete!\", m);\n\n            if(--remaining === 0) this.loaded = true;\n        }\n\n        \n\n        // TODO: Support formats other than OBJ/MTL\n        const objLoader = new OBJLoader();\n        const materialLoader = new MTLLoader();\n        materialLoader.load(options.mtl, loadObject, () => (null), error => {\n            console.warn(\"No material file found for SymbolLayer3D model \" + m);\n        });\n\n        function loadObject(materials) {\n\n            if (materials) {\n                materials.preload();\n                objLoader.setMaterials( materials );\n            }\n            \n            objLoader.load(options.obj, obj => {\n\n            \tvar r = utils.types.rotation(options, [0, 0, 0]);\n            \tvar s = utils.types.scale(options, [1, 1, 1]);\n\n            \tobj = obj.children[0];\n            \tobj.rotation.set(r[0] + Math.PI/2, r[1] + Math.PI, r[2]);\n            \tobj.scale.set(s[0], s[1], s[2]);\n\n            \tvar projScaleGroup = new THREE.Group();\n            \tprojScaleGroup.add(obj)\n\t\t        var userScaleGroup = Objects.prototype._makeGroup(projScaleGroup, options);\n\t\t        Objects.prototype._addMethods(userScaleGroup);\n\n                cb(userScaleGroup);\n\n            }, () => (null), error => {\n                console.error(\"Could not load model file.\");    \n            } );\n\n        };\n\t}\n\n\nmodule.exports = exports = loadObj;\n},{\"../utils/utils.js\":19,\"./loaders/MTLLoader.js\":11,\"./loaders/OBJLoader.js\":12,\"./objects.js\":13}],11:[function(require,module,exports){\n/**\n * Loads a Wavefront .mtl file specifying materials\n *\n * @author angelxuanchang\n */\n\nconst THREE = require('../../three.js');\n\nconst MTLLoader = function ( manager ) {\n\n    this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n\n};\n\nMTLLoader.prototype = {\n\n    constructor: MTLLoader,\n\n    /**\n     * Loads and parses a MTL asset from a URL.\n     *\n     * @param {String} url - URL to the MTL file.\n     * @param {Function} [onLoad] - Callback invoked with the loaded object.\n     * @param {Function} [onProgress] - Callback for download progress.\n     * @param {Function} [onError] - Callback for download errors.\n     *\n     * @see setPath setTexturePath\n     *\n     * @note In order for relative texture references to resolve correctly\n     * you must call setPath and/or setTexturePath explicitly prior to load.\n     */\n    load: function ( url, onLoad, onProgress, onError ) {\n\n        var scope = this;\n\n        var loader = new THREE.FileLoader( this.manager );\n        loader.setPath( this.path );\n        loader.load( url, function ( text ) {\n\n            onLoad( scope.parse( text ) );\n\n        }, onProgress, onError );\n\n    },\n\n    /**\n     * Set base path for resolving references.\n     * If set this path will be prepended to each loaded and found reference.\n     *\n     * @see setTexturePath\n     * @param {String} path\n     *\n     * @example\n     *     mtlLoader.setPath( 'assets/obj/' );\n     *     mtlLoader.load( 'my.mtl', ... );\n     */\n    setPath: function ( path ) {\n\n        this.path = path;\n\n    },\n\n    /**\n     * Set base path for resolving texture references.\n     * If set this path will be prepended found texture reference.\n     * If not set and setPath is, it will be used as texture base path.\n     *\n     * @see setPath\n     * @param {String} path\n     *\n     * @example\n     *     mtlLoader.setPath( 'assets/obj/' );\n     *     mtlLoader.setTexturePath( 'assets/textures/' );\n     *     mtlLoader.load( 'my.mtl', ... );\n     */\n    setTexturePath: function ( path ) {\n\n        this.texturePath = path;\n\n    },\n\n    setBaseUrl: function ( path ) {\n\n        console.warn( 'THREE.MTLLoader: .setBaseUrl() is deprecated. Use .setTexturePath( path ) for texture path or .setPath( path ) for general base path instead.' );\n\n        this.setTexturePath( path );\n\n    },\n\n    setCrossOrigin: function ( value ) {\n\n        this.crossOrigin = value;\n\n    },\n\n    setMaterialOptions: function ( value ) {\n\n        this.materialOptions = value;\n\n    },\n\n    /**\n     * Parses a MTL file.\n     *\n     * @param {String} text - Content of MTL file\n     * @return {THREE.MTLLoader.MaterialCreator}\n     *\n     * @see setPath setTexturePath\n     *\n     * @note In order for relative texture references to resolve correctly\n     * you must call setPath and/or setTexturePath explicitly prior to parse.\n     */\n    parse: function ( text ) {\n\n        var lines = text.split( '\\n' );\n        var info = {};\n        var delimiter_pattern = /\\s+/;\n        var materialsInfo = {};\n\n        for ( var i = 0; i < lines.length; i ++ ) {\n\n            var line = lines[ i ];\n            line = line.trim();\n\n            if ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\n                // Blank line or comment ignore\n                continue;\n\n            }\n\n            var pos = line.indexOf( ' ' );\n\n            var key = ( pos >= 0 ) ? line.substring( 0, pos ) : line;\n            key = key.toLowerCase();\n\n            var value = ( pos >= 0 ) ? line.substring( pos + 1 ) : '';\n            value = value.trim();\n\n            if ( key === 'newmtl' ) {\n\n                // New material\n\n                info = { name: value };\n                materialsInfo[ value ] = info;\n\n            } else if ( info ) {\n\n                if ( key === 'ka' || key === 'kd' || key === 'ks' ) {\n\n                    var ss = value.split( delimiter_pattern, 3 );\n                    info[ key ] = [ parseFloat( ss[ 0 ] ), parseFloat( ss[ 1 ] ), parseFloat( ss[ 2 ] ) ];\n\n                } else {\n\n                    info[ key ] = value;\n\n                }\n\n            }\n\n        }\n\n        var materialCreator = new MTLLoader.MaterialCreator( this.texturePath || this.path, this.materialOptions );\n        materialCreator.setCrossOrigin( this.crossOrigin );\n        materialCreator.setManager( this.manager );\n        materialCreator.setMaterials( materialsInfo );\n        return materialCreator;\n\n    }\n\n};\n\n/**\n * Create a new THREE-MTLLoader.MaterialCreator\n * @param baseUrl - Url relative to which textures are loaded\n * @param options - Set of options on how to construct the materials\n *                  side: Which side to apply the material\n *                        THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide\n *                  wrap: What type of wrapping to apply for textures\n *                        THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping\n *                  normalizeRGB: RGBs need to be normalized to 0-1 from 0-255\n *                                Default: false, assumed to be already normalized\n *                  ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's\n *                                  Default: false\n * @constructor\n */\n\nMTLLoader.MaterialCreator = function ( baseUrl, options ) {\n\n    this.baseUrl = baseUrl || '';\n    this.options = options;\n    this.materialsInfo = {};\n    this.materials = {};\n    this.materialsArray = [];\n    this.nameLookup = {};\n\n    this.side = ( this.options && this.options.side ) ? this.options.side : THREE.FrontSide;\n    this.wrap = ( this.options && this.options.wrap ) ? this.options.wrap : THREE.RepeatWrapping;\n\n};\n\nMTLLoader.MaterialCreator.prototype = {\n\n    constructor: MTLLoader.MaterialCreator,\n\n    setCrossOrigin: function ( value ) {\n\n        this.crossOrigin = value;\n\n    },\n\n    setManager: function ( value ) {\n\n        this.manager = value;\n\n    },\n\n    setMaterials: function ( materialsInfo ) {\n\n        this.materialsInfo = this.convert( materialsInfo );\n        this.materials = {};\n        this.materialsArray = [];\n        this.nameLookup = {};\n\n    },\n\n    convert: function ( materialsInfo ) {\n\n        if ( ! this.options ) return materialsInfo;\n\n        var converted = {};\n\n        for ( var mn in materialsInfo ) {\n\n            // Convert materials info into normalized form based on options\n\n            var mat = materialsInfo[ mn ];\n\n            var covmat = {};\n\n            converted[ mn ] = covmat;\n\n            for ( var prop in mat ) {\n\n                var save = true;\n                var value = mat[ prop ];\n                var lprop = prop.toLowerCase();\n\n                switch ( lprop ) {\n\n                    case 'kd':\n                    case 'ka':\n                    case 'ks':\n\n                        // Diffuse color (color under white light) using RGB values\n\n                        if ( this.options && this.options.normalizeRGB ) {\n\n                            value = [ value[ 0 ] / 255, value[ 1 ] / 255, value[ 2 ] / 255 ];\n\n                        }\n\n                        if ( this.options && this.options.ignoreZeroRGBs ) {\n\n                            if ( value[ 0 ] === 0 && value[ 1 ] === 0 && value[ 2 ] === 0 ) {\n\n                                // ignore\n\n                                save = false;\n\n                            }\n\n                        }\n\n                        break;\n\n                    default:\n\n                        break;\n\n                }\n\n                if ( save ) {\n\n                    covmat[ lprop ] = value;\n\n                }\n\n            }\n\n        }\n\n        return converted;\n\n    },\n\n    preload: function () {\n\n        for ( var mn in this.materialsInfo ) {\n\n            this.create( mn );\n\n        }\n\n    },\n\n    getIndex: function ( materialName ) {\n\n        return this.nameLookup[ materialName ];\n\n    },\n\n    getAsArray: function () {\n\n        var index = 0;\n\n        for ( var mn in this.materialsInfo ) {\n\n            this.materialsArray[ index ] = this.create( mn );\n            this.nameLookup[ mn ] = index;\n            index ++;\n\n        }\n\n        return this.materialsArray;\n\n    },\n\n    create: function ( materialName ) {\n\n        if ( this.materials[ materialName ] === undefined ) {\n\n            this.createMaterial_( materialName );\n\n        }\n\n        return this.materials[ materialName ];\n\n    },\n\n    createMaterial_: function ( materialName ) {\n\n        // Create material\n\n        var scope = this;\n        var mat = this.materialsInfo[ materialName ];\n        var params = {\n\n            name: materialName,\n            side: this.side\n\n        };\n\n        function resolveURL( baseUrl, url ) {\n\n            if ( typeof url !== 'string' || url === '' )\n                return '';\n\n            // Absolute URL\n            if ( /^https?:\\/\\//i.test( url ) ) return url;\n\n            return baseUrl + url;\n\n        }\n\n        function setMapForType( mapType, value ) {\n\n            if ( params[ mapType ] ) return; // Keep the first encountered texture\n\n            var texParams = scope.getTextureParams( value, params );\n            var map = scope.loadTexture( resolveURL( scope.baseUrl, texParams.url ) );\n\n            map.repeat.copy( texParams.scale );\n            map.offset.copy( texParams.offset );\n\n            map.wrapS = scope.wrap;\n            map.wrapT = scope.wrap;\n\n            params[ mapType ] = map;\n\n        }\n\n        for ( var prop in mat ) {\n\n            var value = mat[ prop ];\n\n            if ( value === '' ) continue;\n\n            switch ( prop.toLowerCase() ) {\n\n                // Ns is material specular exponent\n\n                case 'kd':\n\n                    // Diffuse color (color under white light) using RGB values\n\n                    params.color = new THREE.Color().fromArray( value );\n\n                    break;\n\n                case 'ks':\n\n                    // Specular color (color when light is reflected from shiny surface) using RGB values\n                    params.specular = new THREE.Color().fromArray( value );\n\n                    break;\n\n                case 'map_kd':\n\n                    // Diffuse texture map\n\n                    setMapForType( \"map\", value );\n\n                    break;\n\n                case 'map_ks':\n\n                    // Specular map\n\n                    setMapForType( \"specularMap\", value );\n\n                    break;\n\n                case 'map_bump':\n                case 'bump':\n\n                    // Bump texture map\n\n                    setMapForType( \"bumpMap\", value );\n\n                    break;\n\n                case 'ns':\n\n                    // The specular exponent (defines the focus of the specular highlight)\n                    // A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.\n                    params.shininess = parseFloat( value );\n\n                    break;\n\n                case 'd':\n\n                    if ( value < 1 ) {\n\n                        params.opacity = value;\n                        params.transparent = true;\n\n                    }\n\n                    break;\n\n                case 'Tr':\n\n                    if ( value > 0 ) {\n\n                        params.opacity = 1 - value;\n                        params.transparent = true;\n\n                    }\n\n                    break;\n\n                default:\n                    break;\n\n            }\n\n        }\n\n        this.materials[ materialName ] = new THREE.MeshPhongMaterial( params );\n        return this.materials[ materialName ];\n\n    },\n\n    getTextureParams: function ( value, matParams ) {\n\n        var texParams = {\n\n            scale: new THREE.Vector2( 1, 1 ),\n            offset: new THREE.Vector2( 0, 0 )\n\n         };\n\n        var items = value.split( /\\s+/ );\n        var pos;\n\n        pos = items.indexOf( '-bm' );\n\n        if ( pos >= 0 ) {\n\n            matParams.bumpScale = parseFloat( items[ pos + 1 ] );\n            items.splice( pos, 2 );\n\n        }\n\n        pos = items.indexOf( '-s' );\n\n        if ( pos >= 0 ) {\n\n            texParams.scale.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n            items.splice( pos, 4 ); // we expect 3 parameters here!\n\n        }\n\n        pos = items.indexOf( '-o' );\n\n        if ( pos >= 0 ) {\n\n            texParams.offset.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n            items.splice( pos, 4 ); // we expect 3 parameters here!\n\n        }\n\n        texParams.url = items.join( ' ' ).trim();\n        return texParams;\n\n    },\n\n    loadTexture: function ( url, mapping, onLoad, onProgress, onError ) {\n\n        var texture;\n        var loader = THREE.Loader.Handlers.get( url );\n        var manager = ( this.manager !== undefined ) ? this.manager : THREE.DefaultLoadingManager;\n\n        if ( loader === null ) {\n\n            loader = new THREE.TextureLoader( manager );\n\n        }\n\n        if ( loader.setCrossOrigin ) loader.setCrossOrigin( this.crossOrigin );\n        texture = loader.load( url, onLoad, onProgress, onError );\n\n        if ( mapping !== undefined ) texture.mapping = mapping;\n\n        return texture;\n\n    }\n\n};\n\nmodule.exports = exports = MTLLoader;\n},{\"../../three.js\":16}],12:[function(require,module,exports){\n/**\n * @author mrdoob / http://mrdoob.com/\n */\nconst THREE = require('../../three.js');\n\nconst OBJLoader = function ( manager ) {\n\n    this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n\n    this.materials = null;\n\n    this.regexp = {\n        // v float float float\n        vertex_pattern           : /^v\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)/,\n        // vn float float float\n        normal_pattern           : /^vn\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)/,\n        // vt float float\n        uv_pattern               : /^vt\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)/,\n        // f vertex vertex vertex\n        face_vertex              : /^f\\s+(-?\\d+)\\s+(-?\\d+)\\s+(-?\\d+)(?:\\s+(-?\\d+))?/,\n        // f vertex/uv vertex/uv vertex/uv\n        face_vertex_uv           : /^f\\s+(-?\\d+)\\/(-?\\d+)\\s+(-?\\d+)\\/(-?\\d+)\\s+(-?\\d+)\\/(-?\\d+)(?:\\s+(-?\\d+)\\/(-?\\d+))?/,\n        // f vertex/uv/normal vertex/uv/normal vertex/uv/normal\n        face_vertex_uv_normal    : /^f\\s+(-?\\d+)\\/(-?\\d+)\\/(-?\\d+)\\s+(-?\\d+)\\/(-?\\d+)\\/(-?\\d+)\\s+(-?\\d+)\\/(-?\\d+)\\/(-?\\d+)(?:\\s+(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))?/,\n        // f vertex//normal vertex//normal vertex//normal\n        face_vertex_normal       : /^f\\s+(-?\\d+)\\/\\/(-?\\d+)\\s+(-?\\d+)\\/\\/(-?\\d+)\\s+(-?\\d+)\\/\\/(-?\\d+)(?:\\s+(-?\\d+)\\/\\/(-?\\d+))?/,\n        // o object_name | g group_name\n        object_pattern           : /^[og]\\s*(.+)?/,\n        // s boolean\n        smoothing_pattern        : /^s\\s+(\\d+|on|off)/,\n        // mtllib file_reference\n        material_library_pattern : /^mtllib /,\n        // usemtl material_name\n        material_use_pattern     : /^usemtl /\n    };\n\n};\n\nOBJLoader.prototype = {\n\n    constructor: OBJLoader,\n\n    load: function ( url, onLoad, onProgress, onError ) {\n\n        var scope = this;\n\n        var loader = new THREE.FileLoader( scope.manager );\n        loader.setPath( this.path );\n        loader.load( url, function ( text ) {\n\n            onLoad( scope.parse( text ) );\n\n        }, onProgress, onError );\n\n    },\n\n    setPath: function ( value ) {\n\n        this.path = value;\n\n    },\n\n    setMaterials: function ( materials ) {\n\n        this.materials = materials;\n\n    },\n\n    _createParserState : function () {\n\n        var state = {\n            objects  : [],\n            object   : {},\n\n            vertices : [],\n            normals  : [],\n            uvs      : [],\n\n            materialLibraries : [],\n\n            startObject: function ( name, fromDeclaration ) {\n\n                // If the current object (initial from reset) is not from a g/o declaration in the parsed\n                // file. We need to use it for the first parsed g/o to keep things in sync.\n                if ( this.object && this.object.fromDeclaration === false ) {\n\n                    this.object.name = name;\n                    this.object.fromDeclaration = ( fromDeclaration !== false );\n                    return;\n\n                }\n\n                var previousMaterial = ( this.object && typeof this.object.currentMaterial === 'function' ? this.object.currentMaterial() : undefined );\n\n                if ( this.object && typeof this.object._finalize === 'function' ) {\n\n                    this.object._finalize( true );\n\n                }\n\n                this.object = {\n                    name : name || '',\n                    fromDeclaration : ( fromDeclaration !== false ),\n\n                    geometry : {\n                        vertices : [],\n                        normals  : [],\n                        uvs      : []\n                    },\n                    materials : [],\n                    smooth : true,\n\n                    startMaterial : function( name, libraries ) {\n\n                        var previous = this._finalize( false );\n\n                        // New usemtl declaration overwrites an inherited material, except if faces were declared\n                        // after the material, then it must be preserved for proper MultiMaterial continuation.\n                        if ( previous && ( previous.inherited || previous.groupCount <= 0 ) ) {\n\n                            this.materials.splice( previous.index, 1 );\n\n                        }\n\n                        var material = {\n                            index      : this.materials.length,\n                            name       : name || '',\n                            mtllib     : ( Array.isArray( libraries ) && libraries.length > 0 ? libraries[ libraries.length - 1 ] : '' ),\n                            smooth     : ( previous !== undefined ? previous.smooth : this.smooth ),\n                            groupStart : ( previous !== undefined ? previous.groupEnd : 0 ),\n                            groupEnd   : -1,\n                            groupCount : -1,\n                            inherited  : false,\n\n                            clone : function( index ) {\n                                var cloned = {\n                                    index      : ( typeof index === 'number' ? index : this.index ),\n                                    name       : this.name,\n                                    mtllib     : this.mtllib,\n                                    smooth     : this.smooth,\n                                    groupStart : 0,\n                                    groupEnd   : -1,\n                                    groupCount : -1,\n                                    inherited  : false\n                                };\n                                cloned.clone = this.clone.bind(cloned);\n                                return cloned;\n                            }\n                        };\n\n                        this.materials.push( material );\n\n                        return material;\n\n                    },\n\n                    currentMaterial : function() {\n\n                        if ( this.materials.length > 0 ) {\n                            return this.materials[ this.materials.length - 1 ];\n                        }\n\n                        return undefined;\n\n                    },\n\n                    _finalize : function( end ) {\n\n                        var lastMultiMaterial = this.currentMaterial();\n                        if ( lastMultiMaterial && lastMultiMaterial.groupEnd === -1 ) {\n\n                            lastMultiMaterial.groupEnd = this.geometry.vertices.length / 3;\n                            lastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart;\n                            lastMultiMaterial.inherited = false;\n\n                        }\n\n                        // Ignore objects tail materials if no face declarations followed them before a new o/g started.\n                        if ( end && this.materials.length > 1 ) {\n\n                            for ( var mi = this.materials.length - 1; mi >= 0; mi-- ) {\n                                if ( this.materials[mi].groupCount <= 0 ) {\n                                    this.materials.splice( mi, 1 );\n                                }\n                            }\n\n                        }\n\n                        // Guarantee at least one empty material, this makes the creation later more straight forward.\n                        if ( end && this.materials.length === 0 ) {\n\n                            this.materials.push({\n                                name   : '',\n                                smooth : this.smooth\n                            });\n\n                        }\n\n                        return lastMultiMaterial;\n\n                    }\n                };\n\n                // Inherit previous objects material.\n                // Spec tells us that a declared material must be set to all objects until a new material is declared.\n                // If a usemtl declaration is encountered while this new object is being parsed, it will\n                // overwrite the inherited material. Exception being that there was already face declarations\n                // to the inherited material, then it will be preserved for proper MultiMaterial continuation.\n\n                if ( previousMaterial && previousMaterial.name && typeof previousMaterial.clone === \"function\" ) {\n\n                    var declared = previousMaterial.clone( 0 );\n                    declared.inherited = true;\n                    this.object.materials.push( declared );\n\n                }\n\n                this.objects.push( this.object );\n\n            },\n\n            finalize : function() {\n\n                if ( this.object && typeof this.object._finalize === 'function' ) {\n\n                    this.object._finalize( true );\n\n                }\n\n            },\n\n            parseVertexIndex: function ( value, len ) {\n\n                var index = parseInt( value, 10 );\n                return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n            },\n\n            parseNormalIndex: function ( value, len ) {\n\n                var index = parseInt( value, 10 );\n                return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n            },\n\n            parseUVIndex: function ( value, len ) {\n\n                var index = parseInt( value, 10 );\n                return ( index >= 0 ? index - 1 : index + len / 2 ) * 2;\n\n            },\n\n            addVertex: function ( a, b, c ) {\n\n                var src = this.vertices;\n                var dst = this.object.geometry.vertices;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n                dst.push( src[ a + 2 ] );\n                dst.push( src[ b + 0 ] );\n                dst.push( src[ b + 1 ] );\n                dst.push( src[ b + 2 ] );\n                dst.push( src[ c + 0 ] );\n                dst.push( src[ c + 1 ] );\n                dst.push( src[ c + 2 ] );\n\n            },\n\n            addVertexLine: function ( a ) {\n\n                var src = this.vertices;\n                var dst = this.object.geometry.vertices;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n                dst.push( src[ a + 2 ] );\n\n            },\n\n            addNormal : function ( a, b, c ) {\n\n                var src = this.normals;\n                var dst = this.object.geometry.normals;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n                dst.push( src[ a + 2 ] );\n                dst.push( src[ b + 0 ] );\n                dst.push( src[ b + 1 ] );\n                dst.push( src[ b + 2 ] );\n                dst.push( src[ c + 0 ] );\n                dst.push( src[ c + 1 ] );\n                dst.push( src[ c + 2 ] );\n\n            },\n\n            addUV: function ( a, b, c ) {\n\n                var src = this.uvs;\n                var dst = this.object.geometry.uvs;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n                dst.push( src[ b + 0 ] );\n                dst.push( src[ b + 1 ] );\n                dst.push( src[ c + 0 ] );\n                dst.push( src[ c + 1 ] );\n\n            },\n\n            addUVLine: function ( a ) {\n\n                var src = this.uvs;\n                var dst = this.object.geometry.uvs;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n\n            },\n\n            addFace: function ( a, b, c, d, ua, ub, uc, ud, na, nb, nc, nd ) {\n\n                var vLen = this.vertices.length;\n\n                var ia = this.parseVertexIndex( a, vLen );\n                var ib = this.parseVertexIndex( b, vLen );\n                var ic = this.parseVertexIndex( c, vLen );\n                var id;\n\n                if ( d === undefined ) {\n\n                    this.addVertex( ia, ib, ic );\n\n                } else {\n\n                    id = this.parseVertexIndex( d, vLen );\n\n                    this.addVertex( ia, ib, id );\n                    this.addVertex( ib, ic, id );\n\n                }\n\n                if ( ua !== undefined ) {\n\n                    var uvLen = this.uvs.length;\n\n                    ia = this.parseUVIndex( ua, uvLen );\n                    ib = this.parseUVIndex( ub, uvLen );\n                    ic = this.parseUVIndex( uc, uvLen );\n\n                    if ( d === undefined ) {\n\n                        this.addUV( ia, ib, ic );\n\n                    } else {\n\n                        id = this.parseUVIndex( ud, uvLen );\n\n                        this.addUV( ia, ib, id );\n                        this.addUV( ib, ic, id );\n\n                    }\n\n                }\n\n                if ( na !== undefined ) {\n\n                    // Normals are many times the same. If so, skip function call and parseInt.\n                    var nLen = this.normals.length;\n                    ia = this.parseNormalIndex( na, nLen );\n\n                    ib = na === nb ? ia : this.parseNormalIndex( nb, nLen );\n                    ic = na === nc ? ia : this.parseNormalIndex( nc, nLen );\n\n                    if ( d === undefined ) {\n\n                        this.addNormal( ia, ib, ic );\n\n                    } else {\n\n                        id = this.parseNormalIndex( nd, nLen );\n\n                        this.addNormal( ia, ib, id );\n                        this.addNormal( ib, ic, id );\n\n                    }\n\n                }\n\n            },\n\n            addLineGeometry: function ( vertices, uvs ) {\n\n                this.object.geometry.type = 'Line';\n\n                var vLen = this.vertices.length;\n                var uvLen = this.uvs.length;\n\n                for ( var vi = 0, l = vertices.length; vi < l; vi ++ ) {\n\n                    this.addVertexLine( this.parseVertexIndex( vertices[ vi ], vLen ) );\n\n                }\n\n                for ( var uvi = 0, l = uvs.length; uvi < l; uvi ++ ) {\n\n                    this.addUVLine( this.parseUVIndex( uvs[ uvi ], uvLen ) );\n\n                }\n\n            }\n\n        };\n\n        state.startObject( '', false );\n\n        return state;\n\n    },\n\n    parse: function ( text ) {\n\n        //console.time( 'OBJLoader' );\n\n        var state = this._createParserState();\n\n        if ( text.indexOf( '\\r\\n' ) !== - 1 ) {\n\n            // This is faster than String.split with regex that splits on both\n            text = text.replace( /\\r\\n/g, '\\n' );\n\n        }\n\n        if ( text.indexOf( '\\\\\\n' ) !== - 1) {\n\n            // join lines separated by a line continuation character (\\)\n            text = text.replace( /\\\\\\n/g, '' );\n\n        }\n\n        var lines = text.split( '\\n' );\n        var line = '', lineFirstChar = '', lineSecondChar = '';\n        var lineLength = 0;\n        var result = [];\n\n        // Faster to just trim left side of the line. Use if available.\n        var trimLeft = ( typeof ''.trimLeft === 'function' );\n\n        for ( var i = 0, l = lines.length; i < l; i ++ ) {\n\n            line = lines[ i ];\n\n            line = trimLeft ? line.trimLeft() : line.trim();\n\n            lineLength = line.length;\n\n            if ( lineLength === 0 ) continue;\n\n            lineFirstChar = line.charAt( 0 );\n\n            // @todo invoke passed in handler if any\n            if ( lineFirstChar === '#' ) continue;\n\n            if ( lineFirstChar === 'v' ) {\n\n                lineSecondChar = line.charAt( 1 );\n\n                if ( lineSecondChar === ' ' && ( result = this.regexp.vertex_pattern.exec( line ) ) !== null ) {\n\n                    // 0                  1      2      3\n                    // [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n                    state.vertices.push(\n                        parseFloat( result[ 1 ] ),\n                        parseFloat( result[ 2 ] ),\n                        parseFloat( result[ 3 ] )\n                    );\n\n                } else if ( lineSecondChar === 'n' && ( result = this.regexp.normal_pattern.exec( line ) ) !== null ) {\n\n                    // 0                   1      2      3\n                    // [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n                    state.normals.push(\n                        parseFloat( result[ 1 ] ),\n                        parseFloat( result[ 2 ] ),\n                        parseFloat( result[ 3 ] )\n                    );\n\n                } else if ( lineSecondChar === 't' && ( result = this.regexp.uv_pattern.exec( line ) ) !== null ) {\n\n                    // 0               1      2\n                    // [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\n\n                    state.uvs.push(\n                        parseFloat( result[ 1 ] ),\n                        parseFloat( result[ 2 ] )\n                    );\n\n                } else {\n\n                    throw new Error( \"Unexpected vertex/normal/uv line: '\" + line  + \"'\" );\n\n                }\n\n            } else if ( lineFirstChar === \"f\" ) {\n\n                if ( ( result = this.regexp.face_vertex_uv_normal.exec( line ) ) !== null ) {\n\n                    // f vertex/uv/normal vertex/uv/normal vertex/uv/normal\n                    // 0                        1    2    3    4    5    6    7    8    9   10         11         12\n                    // [\"f 1/1/1 2/2/2 3/3/3\", \"1\", \"1\", \"1\", \"2\", \"2\", \"2\", \"3\", \"3\", \"3\", undefined, undefined, undefined]\n\n                    state.addFace(\n                        result[ 1 ], result[ 4 ], result[ 7 ], result[ 10 ],\n                        result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ],\n                        result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ]\n                    );\n\n                } else if ( ( result = this.regexp.face_vertex_uv.exec( line ) ) !== null ) {\n\n                    // f vertex/uv vertex/uv vertex/uv\n                    // 0                  1    2    3    4    5    6   7          8\n                    // [\"f 1/1 2/2 3/3\", \"1\", \"1\", \"2\", \"2\", \"3\", \"3\", undefined, undefined]\n\n                    state.addFace(\n                        result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],\n                        result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]\n                    );\n\n                } else if ( ( result = this.regexp.face_vertex_normal.exec( line ) ) !== null ) {\n\n                    // f vertex//normal vertex//normal vertex//normal\n                    // 0                     1    2    3    4    5    6   7          8\n                    // [\"f 1//1 2//2 3//3\", \"1\", \"1\", \"2\", \"2\", \"3\", \"3\", undefined, undefined]\n\n                    state.addFace(\n                        result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],\n                        undefined, undefined, undefined, undefined,\n                        result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]\n                    );\n\n                } else if ( ( result = this.regexp.face_vertex.exec( line ) ) !== null ) {\n\n                    // f vertex vertex vertex\n                    // 0            1    2    3   4\n                    // [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\n\n                    state.addFace(\n                        result[ 1 ], result[ 2 ], result[ 3 ], result[ 4 ]\n                    );\n\n                } else {\n\n                    throw new Error( \"Unexpected face line: '\" + line  + \"'\" );\n\n                }\n\n            } else if ( lineFirstChar === \"l\" ) {\n\n                var lineParts = line.substring( 1 ).trim().split( \" \" );\n                var lineVertices = [], lineUVs = [];\n\n                if ( line.indexOf( \"/\" ) === - 1 ) {\n\n                    lineVertices = lineParts;\n\n                } else {\n\n                    for ( var li = 0, llen = lineParts.length; li < llen; li ++ ) {\n\n                        var parts = lineParts[ li ].split( \"/\" );\n\n                        if ( parts[ 0 ] !== \"\" ) lineVertices.push( parts[ 0 ] );\n                        if ( parts[ 1 ] !== \"\" ) lineUVs.push( parts[ 1 ] );\n\n                    }\n\n                }\n                state.addLineGeometry( lineVertices, lineUVs );\n\n            } else if ( ( result = this.regexp.object_pattern.exec( line ) ) !== null ) {\n\n                // o object_name\n                // or\n                // g group_name\n\n                // WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869\n                // var name = result[ 0 ].substr( 1 ).trim();\n                var name = ( \" \" + result[ 0 ].substr( 1 ).trim() ).substr( 1 );\n\n                state.startObject( name );\n\n            } else if ( this.regexp.material_use_pattern.test( line ) ) {\n\n                // material\n\n                state.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries );\n\n            } else if ( this.regexp.material_library_pattern.test( line ) ) {\n\n                // mtl file\n\n                state.materialLibraries.push( line.substring( 7 ).trim() );\n\n            } else if ( ( result = this.regexp.smoothing_pattern.exec( line ) ) !== null ) {\n\n                // smooth shading\n\n                // @todo Handle files that have varying smooth values for a set of faces inside one geometry,\n                // but does not define a usemtl for each face set.\n                // This should be detected and a dummy material created (later MultiMaterial and geometry groups).\n                // This requires some care to not create extra material on each smooth value for \"normal\" obj files.\n                // where explicit usemtl defines geometry groups.\n                // Example asset: examples/models/obj/cerberus/Cerberus.obj\n\n                var value = result[ 1 ].trim().toLowerCase();\n                state.object.smooth = ( value === '1' || value === 'on' );\n\n                var material = state.object.currentMaterial();\n                if ( material ) {\n\n                    material.smooth = state.object.smooth;\n\n                }\n\n            } else {\n\n                // Handle null terminated files without exception\n                if ( line === '\\0' ) continue;\n\n                throw new Error( \"Unexpected line: '\" + line  + \"'\" );\n\n            }\n\n        }\n\n        state.finalize();\n\n        var container = new THREE.Group();\n        container.materialLibraries = [].concat( state.materialLibraries );\n\n        for ( var i = 0, l = state.objects.length; i < l; i ++ ) {\n\n            var object = state.objects[ i ];\n            var geometry = object.geometry;\n            var materials = object.materials;\n            var isLine = ( geometry.type === 'Line' );\n\n            // Skip o/g line declarations that did not follow with any faces\n            if ( geometry.vertices.length === 0 ) continue;\n\n            var buffergeometry = new THREE.BufferGeometry();\n\n            buffergeometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( geometry.vertices ), 3 ) );\n\n            if ( geometry.normals.length > 0 ) {\n\n                buffergeometry.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( geometry.normals ), 3 ) );\n\n            } else {\n\n                buffergeometry.computeVertexNormals();\n\n            }\n\n            if ( geometry.uvs.length > 0 ) {\n\n                buffergeometry.addAttribute( 'uv', new THREE.BufferAttribute( new Float32Array( geometry.uvs ), 2 ) );\n\n            }\n\n            // Create materials\n\n            var createdMaterials = [];\n\n            for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {\n\n                var sourceMaterial = materials[mi];\n                var material = undefined;\n\n                if ( this.materials !== null ) {\n\n                    material = this.materials.create( sourceMaterial.name );\n\n                    // mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.\n                    if ( isLine && material && ! ( material instanceof THREE.LineBasicMaterial ) ) {\n\n                        var materialLine = new THREE.LineBasicMaterial();\n                        materialLine.copy( material );\n                        materialLine.lights = false;\n                        material = materialLine;\n\n                    }\n\n                }\n\n                if ( ! material ) {\n\n                    material = ( ! isLine ? new THREE.MeshPhongMaterial() : new THREE.LineBasicMaterial() );\n                    material.name = sourceMaterial.name;\n\n                }\n\n                material.shading = sourceMaterial.smooth ? THREE.SmoothShading : THREE.FlatShading;\n\n                createdMaterials.push(material);\n\n            }\n\n            // Create mesh\n\n            var mesh;\n\n            if ( createdMaterials.length > 1 ) {\n\n                for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {\n\n                    var sourceMaterial = materials[mi];\n                    buffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );\n\n                }\n\n                var multiMaterial = new THREE.MultiMaterial( createdMaterials );\n                mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, multiMaterial ) : new THREE.LineSegments( buffergeometry, multiMaterial ) );\n\n            } else {\n\n                mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, createdMaterials[ 0 ] ) : new THREE.LineSegments( buffergeometry, createdMaterials[ 0 ] ) );\n            }\n\n            mesh.name = object.name;\n\n            container.add( mesh );\n\n        }\n\n        //console.timeEnd( 'OBJLoader' );\n\n        return container;\n\n    }\n\n};\n\nmodule.exports = exports = OBJLoader;\n},{\"../../three.js\":16}],13:[function(require,module,exports){\nvar utils = require(\"../utils/utils.js\");\nvar material = require(\"../utils/material.js\");\n\nconst AnimationManager = require(\"../animation/AnimationManager.js\");\n\n\nfunction Objects(){\n\n}\n\nObjects.prototype = {\n\n\t// standard 1px line with gl\n\tline: function(obj){\n\n\t\tobj = utils._validate(obj, this._defaults.line);\n\n\t\t//project to world and normalize\n        var straightProject = utils.lnglatsToWorld(obj.geometry);\n\t\tvar normalized = utils.normalizeVertices(straightProject);\n\n\t\t//flatten array for buffergeometry\n        var flattenedArray = utils.flattenVectors(normalized.vertices);\n\n\t\tvar positions = new Float32Array(flattenedArray); // 3 vertices per point\n\t\tvar geometry = new THREE.BufferGeometry();\n\t\tgeometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );\n\n\t\t// material\n\t\tvar material = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 21 } );\n\t\tvar line = new THREE.Line( geometry,  material );\n\n        line.options = options || {};\n        line.position.copy(normalized.position)\n\n  \t\treturn line  \n\t},\n\n\n\textrusion: function(options){\n\n\t},\n\n\t_addMethods: function(obj, static){\n\n\t\tvar root = this;\n\n\t\tif (static) {\n\n\t\t}\n\n\t\telse {\n\n\t\t\tif (!obj.coordinates) obj.coordinates = [0,0,0];\n\n\t    \t// Bestow this mesh with animation superpowers and keeps track of its movements in the global animation queue\t\t\t\n\t\t\troot.animationManager.enroll(obj); \n\t\t\tobj.setCoords = function(lnglat){\n\n\t\t        /** Place the given object on the map, centered around the provided longitude and latitude\n\t\t            The object's internal coordinates are assumed to be in meter-offset format, meaning\n\t\t            1 unit represents 1 meter distance away from the provided coordinate.\n\t\t        */\n\n\t\t        // If object already added, scale the model so that its units are interpreted as meters at the given latitude\n\t\t\t\tif (obj.userData.units === 'meters'){\n\t\t\t\t\tvar s = utils.projectedUnitsPerMeter(lnglat[1]);\n\t\t\t\t\tobj.scale.set(s,s,s);\n\t\t\t\t}\n\n\t\t\t\tobj.coordinates = lnglat;\n\t        \tobj.set({position:lnglat})\n\t\t        \n\n\t\t        return obj;\n\n\t\t\t}\n\n\t\t\tobj.setRotation = function(xyz) {\n\n\t\t\t\tif (typeof xyz === 'number') xyz = {z: xyz}\n\n\t\t\t\tvar r = {\n\t\t\t\t\tx: utils.radify(xyz.x) || obj.rotation.x,\n\t\t\t\t\ty: utils.radify(xyz.y) || obj.rotation.y,\n\t\t\t\t\tz: utils.radify(xyz.z) || obj.rotation.z\n\t\t\t\t}\n\n\t\t\t\tobj._setObject({rotation: [r.x, r.y, r.z]})\n\t\t\t}\n\n\t\t}\n\n\t\tobj.add = function(){\n\t        root.world.add(obj);\n\t        if (!static) obj.set({position:obj.coordinates});\n\t        return obj;\n\t\t}\n\n\n\t\tobj.remove = function(){\n\t\t\troot.world.remove(obj);\n\t\t\troot.map.repaint = true;\n\t\t}\n\n\t\tobj.duplicate = function(a) {\n\t\t\tvar dupe = obj.clone(); \n\t\t\tdupe.userData = obj.userData;\n\t\t\troot._addMethods(dupe);\n\t\t\treturn dupe\n\t\t}\n\t\n\t\treturn obj\n\t},\n\n\t_makeGroup: function(obj, options){\n        var geoGroup = new THREE.Group();\n        geoGroup.userData = options || {};\n        geoGroup.userData.isGeoGroup = true;\n\n        var isArrayOfObjects = obj.length;\n\n        if (isArrayOfObjects) for (o of obj) geoGroup.add(o)\n\n\n    \telse geoGroup.add(obj);\n\n        utils._flipMaterialSides(obj);\n\n        return geoGroup\n\t},\n\n\tanimationManager: new AnimationManager,\n\n\t_defaults: {\n\n\t\tline: {\n\t\t\tgeometry: null,\n\t\t\tcolor: 'black',\n\t\t\twidth:1,\n\t\t\topacity:1\n\t\t},\n\n\t\tsphere: {\n\t\t\tposition: [0,0,0],\n\t\t\tradius: 1,\n\t\t\tsides: 20,\n\t\t\tunits: 'scene',\n\t\t\tmaterial: 'MeshBasicMaterial'\n\t\t},\n\n\t\ttube: {                \n\t\t\tgeometry: null,\n            radius: 1,\n            sides:6,\n\t\t\tmaterial: 'MeshBasicMaterial'\n        },\n\n        extrusion:{\n        \tfootprint: null,\n        \tbase: 0,\n        \ttop: 100,\n        \tcolor:'black',\n\t\t\tmaterial: 'MeshBasicMaterial',\n\t\t\tscaleToLatitude: false\n        },\n\n        loadObj:{\n        \tobj: null,\n        \tmtl: null,\n        \trotation: 0,\n        \tscale: 1,\n\t\t\tunits: 'scene'\n        },\n\n        Object3D: {\n        \tobj: null, \n\t\t\tunits: 'scene'\n        }\n\t},\n\n\tgeometries:{\n\t\tline: ['LineString'],\n\t\ttube: ['LineString'],\n\t\tsphere: ['Point'],\n\t}\n}\n\nmodule.exports = exports = Objects;\n},{\"../animation/AnimationManager.js\":6,\"../utils/material.js\":18,\"../utils/utils.js\":19}],14:[function(require,module,exports){\nvar utils = require(\"../utils/utils.js\");\nvar material = require(\"../utils/material.js\");\nvar Objects = require('./objects.js');\n\nfunction Sphere(obj){\n\n\tobj = utils._validate(obj,  Objects.prototype._defaults.sphere);\n\tvar geometry = new THREE.SphereBufferGeometry( obj.radius, obj.sides, obj.sides );\n\tvar mat = material(obj)\n\tvar output = new THREE.Mesh( geometry, mat );\n\n\tif (obj.units === 'meters') output = Objects.prototype._makeGroup(output, obj);\n    Objects.prototype._addMethods(output);\n    return output\n}\n\n\nmodule.exports = exports = Sphere;\n},{\"../utils/material.js\":18,\"../utils/utils.js\":19,\"./objects.js\":13}],15:[function(require,module,exports){\nvar utils = require(\"../utils/utils.js\");\nvar material = require(\"../utils/material.js\");\nvar Objects = require('./objects.js');\nvar THREE = require(\"../three.js\");\n\nfunction tube(obj, world){\n\n\t// validate and prep input geometry\n\tvar obj = utils._validate(obj, Objects.prototype._defaults.tube);\n    var straightProject = utils.lnglatsToWorld(obj.geometry);\n\tvar normalized = utils.normalizeVertices(straightProject);\n\n\tvar crossSection = tube.prototype.defineCrossSection(obj);\n\tvar vertices = tube.prototype.buildVertices(crossSection, normalized.vertices, world);\n\tvar geom = tube.prototype.buildFaces(vertices, normalized.vertices, obj);\n\n\tvar mat = material(obj);\n\n    var mesh = new THREE.Mesh( geom, mat );\n    mesh.position.copy(normalized.position);\n\n    return mesh\n\n}\n\ntube.prototype = {\n\n\tbuildVertices: function (crossSection, spine, world){\n\n\t\t//create reusable plane for intersection calculations\n\t\tvar geometry = new THREE.PlaneBufferGeometry(99999999999, 9999999999);\n\t\tvar m = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} );\n\t\tm.opacity = 0\n\t\tvar plane = new THREE.Mesh( geometry, m );\n\t\t// world.add( plane );\n\n\t\tvar geom = new THREE.Geometry(); \n\t\tvar lastElbow = false;\n\n\n\t\t// BUILD VERTICES: iterate through points in spine and position each vertex in cross section\n\n\n\t\t// get normalized vectors for each spine segment\n\t\tvar spineSegments = [spine[0].clone().normalize()];\n\n\t\tfor (i in spine) {\n\n\t\t\ti = parseFloat(i);\n\n\t\t\tvar segment;\n\n\t\t\tif (spine[i+1]){\n\t\t\t\tsegment = new THREE.Vector3()\n\t\t\t\t\t.subVectors( spine[i+1], spine[i])\n\t\t\t\t\t.normalize();\n\n\t\t\t}\n\n\t\t\tspineSegments.push(segment);\n\t\t}\n\n\t\tspineSegments.push(new THREE.Vector3());\n\n\t\tfor (i in spine) {\n\n\t\t\ti = parseFloat(i);\n\t\t\tvar lineVertex = spine[i];\n\n\t\t\t// ROTATE cross section\n\n\t\t\tvar humerus = spineSegments[i]\n\n\t\t\tvar forearm = spineSegments[i+1]\n\n\t\t\tvar midpointToLookAt = humerus.clone()\n\t\t\t\t.add(forearm)\n\t\t\t\t.normalize();\n\n\t\t\tif (i === 0) midpointToLookAt = forearm;\n\t\t\t\n\t\t\telse if (i === spine.length - 1) midpointToLookAt = humerus;\n\n\t\t\t\t\t\t\n\t\t\t// if first point in input line, rotate and translate it to position\n\t\t\tif (!lastElbow) {\n\n\t\t\t\tvar elbow = crossSection.clone();\n\n\t\t\t\telbow\n\t\t\t\t\t.lookAt(midpointToLookAt)\n\n\t\t\t\telbow.vertices.forEach(function(vertex){\n\t\t\t\t\tgeom.vertices\n\t\t\t\t\t\t.push(vertex.add(lineVertex));\n\t\t\t\t})\n\n\t\t\t\tlastElbow = elbow.vertices;\n\n\t\t\t}\n\n\t\t\telse {\n\n\t\t\t\tvar elbow = [];\n\t\t\t\tplane.position.copy(lineVertex);\n\t\t\t\tplane.lookAt(midpointToLookAt.clone().add(lineVertex));\n\t\t\t\tplane.updateMatrixWorld();\n\n\t\t\t\tlastElbow.forEach(function(v3){\n\n\t\t\t\t\tvar raycaster = new THREE.Raycaster(v3, humerus);\n\n\t\t\t\t\tvar intersection = raycaster\n\t\t\t\t\t\t.intersectObject(plane)[0];\n\n\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\tgeom.vertices.push(intersection.point);\n\t\t\t\t\t\telbow.push(intersection.point);\n\t\t\t\t\t}\n\n\t\t\t\t\telse console.error('Tube geometry failed at vertex '+i+'. Consider reducing tube radius, or smoothening out the sharp angle at this vertex')\n\t\t\t\t})\n\n\t\t\t\tlastElbow = elbow\n\t\t\t}\n\n\t\t}\n\n\t\tworld.remove(plane);\n\n\t\treturn geom\n\t},\n\n\tdefineCrossSection: function(obj){\n        var crossSection = new THREE.Geometry();\n        var count = obj.sides;\n\n        for ( var i = 0; i < count; i ++ ) {\n\n            var l = obj.radius;\n            var a = (i+0.5) / count * Math.PI;\n\n            crossSection.vertices.push( \n            \tnew THREE.Vector3 ( \n            \t\t-Math.sin( 2 * a ), \n            \t\tMath.cos( 2 * a ),\n            \t\t0\n            \t)\n            \t.multiplyScalar(l)\n            );\n        }\n\n        return crossSection\n\t},\n\n\t//build faces between vertices\n\n\tbuildFaces: function(geom, spine, obj){\n\n\t\tfor (var i in spine) {\n\n\t\t\ti = parseFloat(i);\n\t\t\tvar vertex = spine[i];\n\n\t\t\tif (i < spine.length - 1) {\n\n\t\t\t\tfor (var p = 0; p < obj.sides; p++) {\n\n\t\t\t\t\tvar b1 = i * obj.sides + p;\n\t\t\t\t\tvar b2 = i * obj.sides + (p+1) % obj.sides\n\t\t\t\t\tvar t1 = b1 + obj.sides\n\t\t\t\t\tvar t2 = b2 + obj.sides;\n\n\t\t\t\t\tvar triangle1 = new THREE.Face3(t1, b1, b2);\n\t\t\t\t\tvar triangle2 = new THREE.Face3(t1, b2, t2);\n\t\t\t\t\tgeom.faces.push(triangle1, triangle2)\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t//add endcaps\n\t\tvar v = geom.vertices.length;\n\n\t\tfor (var c = 0; c+2<obj.sides; c++) {\n\t\t\tvar tri1 = new THREE.Face3(0, c+2, c+1);\n\t\t\tvar tri2 = new THREE.Face3(v-1, v-1-(c+2), v-1-(c+1))\n\t\t\tgeom.faces.push(tri1, tri2)\n\t\t}\n\n\t\t//compute normals to get shading to work properly\n\t\tgeom.computeFaceNormals();\n\n\t\tvar bufferGeom = new THREE.BufferGeometry().fromGeometry(geom);\n\t\treturn geom\n\t}\n}\n\nmodule.exports = exports = tube;\n\n\n},{\"../three.js\":16,\"../utils/material.js\":18,\"../utils/utils.js\":19,\"./objects.js\":13}],16:[function(require,module,exports){\n// threejs.org/license\n(function(k,za){\"object\"===typeof exports&&\"undefined\"!==typeof module?za(exports):\"function\"===typeof define&&define.amd?define([\"exports\"],za):za(k.THREE={})})(this,function(k){function za(){}function B(a,b){this.x=a||0;this.y=b||0}function R(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0<arguments.length&&console.error(\"THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.\")}function ca(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function p(a,\nb,c){this.x=a||0;this.y=b||0;this.z=c||0}function la(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&console.error(\"THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.\")}function ea(a,b,c,d,e,f,g,h,l,m){Object.defineProperty(this,\"id\",{value:Ff++});this.uuid=J.generateUUID();this.name=\"\";this.image=void 0!==a?a:ea.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==b?b:ea.DEFAULT_MAPPING;this.wrapS=void 0!==c?c:1001;this.wrapT=void 0!==d?d:1001;this.magFilter=void 0!==\ne?e:1006;this.minFilter=void 0!==f?f:1008;this.anisotropy=void 0!==l?l:1;this.format=void 0!==g?g:1023;this.type=void 0!==h?h:1009;this.offset=new B(0,0);this.repeat=new B(1,1);this.center=new B(0,0);this.rotation=0;this.matrixAutoUpdate=!0;this.matrix=new la;this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=void 0!==m?m:3E3;this.version=0;this.onUpdate=null}function W(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}function kb(a,\nb,c){this.width=a;this.height=b;this.scissor=new W(0,0,a,b);this.scissorTest=!1;this.viewport=new W(0,0,a,b);c=c||{};void 0===c.minFilter&&(c.minFilter=1006);this.texture=new ea(void 0,void 0,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy,c.encoding);this.texture.generateMipmaps=void 0!==c.generateMipmaps?c.generateMipmaps:!0;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.depthTexture=void 0!==c.depthTexture?\nc.depthTexture:null}function Lb(a,b,c){kb.call(this,a,b,c);this.activeMipMapLevel=this.activeCubeFace=0}function lb(a,b,c,d,e,f,g,h,l,m,v,n){ea.call(this,null,f,g,h,l,m,d,e,v,n);this.image={data:a,width:b,height:c};this.magFilter=void 0!==l?l:1003;this.minFilter=void 0!==m?m:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1}function Xa(a,b){this.min=void 0!==a?a:new p(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new p(-Infinity,-Infinity,-Infinity)}function Ha(a,b){this.center=void 0!==\na?a:new p;this.radius=void 0!==b?b:0}function Ia(a,b){this.normal=void 0!==a?a:new p(1,0,0);this.constant=void 0!==b?b:0}function td(a,b,c,d,e,f){this.planes=[void 0!==a?a:new Ia,void 0!==b?b:new Ia,void 0!==c?c:new Ia,void 0!==d?d:new Ia,void 0!==e?e:new Ia,void 0!==f?f:new Ia]}function G(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function Vd(){function a(e,f){!1!==c&&(d(e,f),b.requestAnimationFrame(a))}var b=null,c=!1,d=null;return{start:function(){!0!==c&&null!==d&&(b.requestAnimationFrame(a),\nc=!0)},stop:function(){c=!1},setAnimationLoop:function(a){d=a},setContext:function(a){b=a}}}function Gf(a){function b(b,c){var d=b.array,e=b.dynamic?a.DYNAMIC_DRAW:a.STATIC_DRAW,h=a.createBuffer();a.bindBuffer(c,h);a.bufferData(c,d,e);b.onUploadCallback();c=a.FLOAT;d instanceof Float32Array?c=a.FLOAT:d instanceof Float64Array?console.warn(\"THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.\"):d instanceof Uint16Array?c=a.UNSIGNED_SHORT:d instanceof Int16Array?c=a.SHORT:d instanceof\nUint32Array?c=a.UNSIGNED_INT:d instanceof Int32Array?c=a.INT:d instanceof Int8Array?c=a.BYTE:d instanceof Uint8Array&&(c=a.UNSIGNED_BYTE);return{buffer:h,type:c,bytesPerElement:d.BYTES_PER_ELEMENT,version:b.version}}var c=new WeakMap;return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return c.get(a)},remove:function(b){b.isInterleavedBufferAttribute&&(b=b.data);var d=c.get(b);d&&(a.deleteBuffer(d.buffer),c.delete(b))},update:function(d,e){d.isInterleavedBufferAttribute&&(d=d.data);\nvar f=c.get(d);if(void 0===f)c.set(d,b(d,e));else if(f.version<d.version){var g=d,h=g.array,l=g.updateRange;a.bindBuffer(e,f.buffer);!1===g.dynamic?a.bufferData(e,h,a.STATIC_DRAW):-1===l.count?a.bufferSubData(e,0,h):0===l.count?console.error(\"THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.\"):(a.bufferSubData(e,l.offset*h.BYTES_PER_ELEMENT,h.subarray(l.offset,l.offset+l.count)),l.count=\n-1);f.version=d.version}}}}function mb(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||mb.DefaultOrder}function Wd(){this.mask=1}function H(){Object.defineProperty(this,\"id\",{value:Hf++});this.uuid=J.generateUUID();this.name=\"\";this.type=\"Object3D\";this.parent=null;this.children=[];this.up=H.DefaultUp.clone();var a=new p,b=new mb,c=new ca,d=new p(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,\n{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d},modelViewMatrix:{value:new R},normalMatrix:{value:new la}});this.matrix=new R;this.matrixWorld=new R;this.matrixAutoUpdate=H.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new Wd;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}}function Ra(){H.call(this);this.type=\"Camera\";this.matrixWorldInverse=\nnew R;this.projectionMatrix=new R}function Mb(a,b,c,d,e,f){Ra.call(this);this.type=\"OrthographicCamera\";this.zoom=1;this.view=null;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function Ya(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d&&d.isVector3?d:new p;this.vertexNormals=Array.isArray(d)?d:[];this.color=e&&e.isColor?e:new G;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=void 0!==f?f:0}function P(){Object.defineProperty(this,\n\"id\",{value:If+=2});this.uuid=J.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.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function L(a,b,c){if(Array.isArray(a))throw new TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");\nthis.name=\"\";this.array=a;this.itemSize=b;this.count=void 0!==a?a.length/b:0;this.normalized=!0===c;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function yc(a,b,c){L.call(this,new Int8Array(a),b,c)}function zc(a,b,c){L.call(this,new Uint8Array(a),b,c)}function Ac(a,b,c){L.call(this,new Uint8ClampedArray(a),b,c)}function Bc(a,b,c){L.call(this,new Int16Array(a),b,c)}function nb(a,b,c){L.call(this,new Uint16Array(a),b,c)}function Cc(a,b,c){L.call(this,new Int32Array(a),b,c)}function ob(a,\nb,c){L.call(this,new Uint32Array(a),b,c)}function z(a,b,c){L.call(this,new Float32Array(a),b,c)}function Dc(a,b,c){L.call(this,new Float64Array(a),b,c)}function Ge(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function He(a){if(0===a.length)return-Infinity;\nfor(var b=a[0],c=1,d=a.length;c<d;++c)a[c]>b&&(b=a[c]);return b}function D(){Object.defineProperty(this,\"id\",{value:Jf+=2});this.uuid=J.generateUUID();this.name=\"\";this.type=\"BufferGeometry\";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function Nb(a,b,c,d,e,f){P.call(this);this.type=\"BoxGeometry\";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,\ndepthSegments:f};this.fromBufferGeometry(new pb(a,b,c,d,e,f));this.mergeVertices()}function pb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,k,Q,M,Ob){var r=f/Q,u=g/M,O=f/2,y=g/2,x=k/2;g=Q+1;var w=M+1,C=f=0,A,B,z=new p;for(B=0;B<w;B++){var H=B*u-y;for(A=0;A<g;A++)z[a]=(A*r-O)*d,z[b]=H*e,z[c]=x,m.push(z.x,z.y,z.z),z[a]=0,z[b]=0,z[c]=0<k?1:-1,v.push(z.x,z.y,z.z),n.push(A/Q),n.push(1-B/M),f+=1}for(B=0;B<M;B++)for(A=0;A<Q;A++)a=t+A+g*(B+1),b=t+(A+1)+g*(B+1),c=t+(A+1)+g*B,l.push(t+A+g*B,a,c),l.push(a,b,c),C+=\n6;h.addGroup(q,C,Ob);q+=C;t+=f}D.call(this);this.type=\"BoxBufferGeometry\";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};var h=this;a=a||1;b=b||1;c=c||1;d=Math.floor(d)||1;e=Math.floor(e)||1;f=Math.floor(f)||1;var l=[],m=[],v=[],n=[],t=0,q=0;g(\"z\",\"y\",\"x\",-1,-1,c,b,a,f,e,0);g(\"z\",\"y\",\"x\",1,-1,c,b,-a,f,e,1);g(\"x\",\"z\",\"y\",1,1,a,c,b,d,f,2);g(\"x\",\"z\",\"y\",1,-1,a,c,-b,d,f,3);g(\"x\",\"y\",\"z\",1,-1,a,b,c,d,e,4);g(\"x\",\"y\",\"z\",-1,-1,a,b,-c,d,e,5);this.setIndex(l);this.addAttribute(\"position\",\nnew z(m,3));this.addAttribute(\"normal\",new z(v,3));this.addAttribute(\"uv\",new z(n,2))}function Fc(a,b,c,d){P.call(this);this.type=\"PlaneGeometry\";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new rb(a,b,c,d));this.mergeVertices()}function rb(a,b,c,d){D.call(this);this.type=\"PlaneBufferGeometry\";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};a=a||1;b=b||1;var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,l=a/c,m=\nb/d,v=[],n=[],t=[],q=[];for(a=0;a<h;a++){var r=a*m-f;for(b=0;b<g;b++)n.push(b*l-e,-r,0),t.push(0,0,1),q.push(b/c),q.push(1-a/d)}for(a=0;a<d;a++)for(b=0;b<c;b++)e=b+g*(a+1),f=b+1+g*(a+1),h=b+1+g*a,v.push(b+g*a,e,h),v.push(e,f,h);this.setIndex(v);this.addAttribute(\"position\",new z(n,3));this.addAttribute(\"normal\",new z(t,3));this.addAttribute(\"uv\",new z(q,2))}function I(){Object.defineProperty(this,\"id\",{value:Kf++});this.uuid=J.generateUUID();this.name=\"\";this.type=\"Material\";this.lights=this.fog=\n!0;this.blending=1;this.side=0;this.flatShading=!1;this.vertexColors=0;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=3;this.depthWrite=this.depthTest=!0;this.clippingPlanes=null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.dithering=!1;\nthis.alphaTest=0;this.premultipliedAlpha=!1;this.overdraw=0;this.visible=!0;this.userData={};this.needsUpdate=!0}function ua(a){I.call(this);this.type=\"MeshBasicMaterial\";this.color=new G(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.lights=\nthis.morphTargets=this.skinning=!1;this.setValues(a)}function Fa(a){I.call(this);this.type=\"ShaderMaterial\";this.defines={};this.uniforms={};this.vertexShader=\"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";this.fragmentShader=\"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1;this.extensions=\n{derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.uniformsNeedUpdate=!1;void 0!==a&&(void 0!==a.attributes&&console.error(\"THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.\"),this.setValues(a))}function sb(a,b){this.origin=void 0!==a?a:new p;this.direction=void 0!==b?b:new p}function Qb(a,b){this.start=void 0!==a?a:new p;this.end=void 0!==b?b:new p}\nfunction ta(a,b,c){this.a=void 0!==a?a:new p;this.b=void 0!==b?b:new p;this.c=void 0!==c?c:new p}function va(a,b){H.call(this);this.type=\"Mesh\";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new ua({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function Lf(a,b,c,d){function e(a,c){b.buffers.color.setClear(a.r,a.g,a.b,c,d)}var f=new G(0),g=0,h,l,m;return{getClearColor:function(){return f},setClearColor:function(a,b){f.set(a);g=void 0!==b?b:1;e(f,g)},getClearAlpha:function(){return g},\nsetClearAlpha:function(a){g=a;e(f,g)},render:function(b,d,t,q){d=d.background;null===d?e(f,g):d&&d.isColor&&(e(d,1),q=!0);(a.autoClear||q)&&a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil);d&&d.isCubeTexture?(void 0===m&&(m=new va(new pb(1,1,1),new Fa({uniforms:tb.cube.uniforms,vertexShader:tb.cube.vertexShader,fragmentShader:tb.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1,fog:!1})),m.geometry.removeAttribute(\"normal\"),m.geometry.removeAttribute(\"uv\"),m.onBeforeRender=function(a,\nb,c){this.matrixWorld.copyPosition(c.matrixWorld)},c.update(m)),m.material.uniforms.tCube.value=d,b.push(m,m.geometry,m.material,0,null)):d&&d.isTexture&&(void 0===h&&(h=new Mb(-1,1,1,-1,0,1),l=new va(new rb(2,2),new ua({depthTest:!1,depthWrite:!1,fog:!1})),c.update(l)),l.material.map=d,a.renderBufferDirect(h,null,l.geometry,l.material,l,null))}}}function Mf(a,b,c){var d;this.setMode=function(a){d=a};this.render=function(b,f){a.drawArrays(d,b,f);c.update(f,d)};this.renderInstances=function(a,f,g){var e=\nb.get(\"ANGLE_instanced_arrays\");null===e?console.error(\"THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.\"):(e.drawArraysInstancedANGLE(d,f,g,a.maxInstancedCount),c.update(g,d,a.maxInstancedCount))}}function Nf(a,b,c){function d(b){if(\"highp\"===b){if(0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision)return\"highp\";b=\"mediump\"}return\"mediump\"===\nb&&0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision?\"mediump\":\"lowp\"}var e,f=void 0!==c.precision?c.precision:\"highp\",g=d(f);g!==f&&(console.warn(\"THREE.WebGLRenderer:\",f,\"not supported, using\",g,\"instead.\"),f=g);c=!0===c.logarithmicDepthBuffer;g=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS);var h=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=a.getParameter(a.MAX_TEXTURE_SIZE),m=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),\nv=a.getParameter(a.MAX_VERTEX_ATTRIBS),n=a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),t=a.getParameter(a.MAX_VARYING_VECTORS),q=a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),r=0<h,k=!!b.get(\"OES_texture_float\");return{getMaxAnisotropy:function(){if(void 0!==e)return e;var c=b.get(\"EXT_texture_filter_anisotropic\");return e=null!==c?a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:d,precision:f,logarithmicDepthBuffer:c,maxTextures:g,maxVertexTextures:h,maxTextureSize:l,maxCubemapSize:m,\nmaxAttributes:v,maxVertexUniforms:n,maxVaryings:t,maxFragmentUniforms:q,vertexTextures:r,floatFragmentTextures:k,floatVertexTextures:r&&k}}function Of(){function a(){m.value!==d&&(m.value=d,m.needsUpdate=0<e);c.numPlanes=e;c.numIntersection=0}function b(a,b,d,e){var f=null!==a?a.length:0,g=null;if(0!==f){g=m.value;if(!0!==e||null===g){e=d+4*f;b=b.matrixWorldInverse;l.getNormalMatrix(b);if(null===g||g.length<e)g=new Float32Array(e);for(e=0;e!==f;++e,d+=4)h.copy(a[e]).applyMatrix4(b,l),h.normal.toArray(g,\nd),g[d+3]=h.constant}m.value=g;m.needsUpdate=!0}c.numPlanes=f;return g}var c=this,d=null,e=0,f=!1,g=!1,h=new Ia,l=new la,m={value:null,needsUpdate:!1};this.uniform=m;this.numIntersection=this.numPlanes=0;this.init=function(a,c,g){var h=0!==a.length||c||0!==e||f;f=c;d=b(a,g,0);e=a.length;return h};this.beginShadows=function(){g=!0;b(null)};this.endShadows=function(){g=!1;a()};this.setState=function(c,h,l,q,r,k){if(!f||null===c||0===c.length||g&&!l)g?b(null):a();else{l=g?0:e;var n=4*l,v=r.clippingState||\nnull;m.value=v;v=b(c,q,n,k);for(c=0;c!==n;++c)v[c]=d[c];r.clippingState=v;this.numIntersection=h?this.numPlanes:0;this.numPlanes+=l}}}function Pf(a){var b={};return{get:function(c){if(void 0!==b[c])return b[c];switch(c){case \"WEBGL_depth_texture\":var d=a.getExtension(\"WEBGL_depth_texture\")||a.getExtension(\"MOZ_WEBGL_depth_texture\")||a.getExtension(\"WEBKIT_WEBGL_depth_texture\");break;case \"EXT_texture_filter_anisotropic\":d=a.getExtension(\"EXT_texture_filter_anisotropic\")||a.getExtension(\"MOZ_EXT_texture_filter_anisotropic\")||\na.getExtension(\"WEBKIT_EXT_texture_filter_anisotropic\");break;case \"WEBGL_compressed_texture_s3tc\":d=a.getExtension(\"WEBGL_compressed_texture_s3tc\")||a.getExtension(\"MOZ_WEBGL_compressed_texture_s3tc\")||a.getExtension(\"WEBKIT_WEBGL_compressed_texture_s3tc\");break;case \"WEBGL_compressed_texture_pvrtc\":d=a.getExtension(\"WEBGL_compressed_texture_pvrtc\")||a.getExtension(\"WEBKIT_WEBGL_compressed_texture_pvrtc\");break;default:d=a.getExtension(c)}null===d&&console.warn(\"THREE.WebGLRenderer: \"+c+\" extension not supported.\");\nreturn b[c]=d}}}function Qf(a,b,c){function d(a){a=a.target;var g=e[a.id];null!==g.index&&b.remove(g.index);for(var l in g.attributes)b.remove(g.attributes[l]);a.removeEventListener(\"dispose\",d);delete e[a.id];if(l=f[a.id])b.remove(l),delete f[a.id];if(l=f[g.id])b.remove(l),delete f[g.id];c.memory.geometries--}var e={},f={};return{get:function(a,b){var f=e[b.id];if(f)return f;b.addEventListener(\"dispose\",d);b.isBufferGeometry?f=b:b.isGeometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new D).setFromObject(a)),\nf=b._bufferGeometry);e[b.id]=f;c.memory.geometries++;return f},update:function(c){var d=c.index,e=c.attributes;null!==d&&b.update(d,a.ELEMENT_ARRAY_BUFFER);for(var f in e)b.update(e[f],a.ARRAY_BUFFER);c=c.morphAttributes;for(f in c){d=c[f];e=0;for(var g=d.length;e<g;e++)b.update(d[e],a.ARRAY_BUFFER)}},getWireframeAttribute:function(c){var d=f[c.id];if(d)return d;d=[];var e=c.index,g=c.attributes;if(null!==e){e=e.array;g=0;for(var v=e.length;g<v;g+=3){var n=e[g+0],t=e[g+1],q=e[g+2];d.push(n,t,t,q,\nq,n)}}else for(e=g.position.array,g=0,v=e.length/3-1;g<v;g+=3)n=g+0,t=g+1,q=g+2,d.push(n,t,t,q,q,n);d=new (65535<He(d)?ob:nb)(d,1);b.update(d,a.ELEMENT_ARRAY_BUFFER);return f[c.id]=d}}}function Rf(a,b,c){var d,e,f;this.setMode=function(a){d=a};this.setIndex=function(a){e=a.type;f=a.bytesPerElement};this.render=function(b,h){a.drawElements(d,h,e,b*f);c.update(h,d)};this.renderInstances=function(a,h,l){var g=b.get(\"ANGLE_instanced_arrays\");null===g?console.error(\"THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.\"):\n(g.drawElementsInstancedANGLE(d,l,e,h*f,a.maxInstancedCount),c.update(l,d,a.maxInstancedCount))}}function Sf(a){var b={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:b,programs:null,autoReset:!0,reset:function(){b.frame++;b.calls=0;b.triangles=0;b.points=0;b.lines=0},update:function(c,d,e){e=e||1;b.calls++;switch(d){case a.TRIANGLES:b.triangles+=c/3*e;break;case a.TRIANGLE_STRIP:case a.TRIANGLE_FAN:b.triangles+=e*(c-2);break;case a.LINES:b.lines+=c/2*\ne;break;case a.LINE_STRIP:b.lines+=e*(c-1);break;case a.LINE_LOOP:b.lines+=e*c;break;case a.POINTS:b.points+=e*c;break;default:console.error(\"THREE.WebGLInfo: Unknown draw mode:\",d)}}}}function Tf(a,b){return Math.abs(b[1])-Math.abs(a[1])}function Uf(a){var b={},c=new Float32Array(8);return{update:function(d,e,f,g){var h=d.morphTargetInfluences,l=h.length;d=b[e.id];if(void 0===d){d=[];for(var m=0;m<l;m++)d[m]=[m,0];b[e.id]=d}var v=f.morphTargets&&e.morphAttributes.position;f=f.morphNormals&&e.morphAttributes.normal;\nfor(m=0;m<l;m++){var n=d[m];0!==n[1]&&(v&&e.removeAttribute(\"morphTarget\"+m),f&&e.removeAttribute(\"morphNormal\"+m))}for(m=0;m<l;m++)n=d[m],n[0]=m,n[1]=h[m];d.sort(Tf);for(m=0;8>m;m++){if(n=d[m])if(h=n[0],l=n[1]){v&&e.addAttribute(\"morphTarget\"+m,v[h]);f&&e.addAttribute(\"morphNormal\"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a,\"morphTargetInfluences\",c)}}}function Vf(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),\na.update(g),c[g.id]=e);return g},dispose:function(){c={}}}}function Za(a,b,c,d,e,f,g,h,l,m){a=void 0!==a?a:[];ea.call(this,a,void 0!==b?b:301,c,d,e,f,g,h,l,m);this.flipY=!1}function Rb(a,b,c){var d=a[0];if(0>=d||0<d)return a;var e=b*c,f=Ie[e];void 0===f&&(f=new Float32Array(e),Ie[e]=f);if(0!==b)for(d.toArray(f,0),d=1,e=0;d!==b;++d)e+=c,a[d].toArray(f,e);return f}function da(a,b){if(a.length!==b.length)return!1;for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function qa(a,b){for(var c=\n0,d=b.length;c<d;c++)a[c]=b[c]}function Je(a,b){var c=Ke[b];void 0===c&&(c=new Int32Array(b),Ke[b]=c);for(var d=0;d!==b;++d)c[d]=a.allocTextureUnit();return c}function Wf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[0]=b)}function Xf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1i(this.addr,b),c[0]=b)}function Yf(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y)a.uniform2f(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y}else da(c,b)||(a.uniform2fv(this.addr,b),qa(c,b))}function Zf(a,\nb){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z)a.uniform3f(this.addr,b.x,b.y,b.z),c[0]=b.x,c[1]=b.y,c[2]=b.z}else if(void 0!==b.r){if(c[0]!==b.r||c[1]!==b.g||c[2]!==b.b)a.uniform3f(this.addr,b.r,b.g,b.b),c[0]=b.r,c[1]=b.g,c[2]=b.b}else da(c,b)||(a.uniform3fv(this.addr,b),qa(c,b))}function $f(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)a.uniform4f(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w}else da(c,b)||(a.uniform4fv(this.addr,\nb),qa(c,b))}function ag(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),qa(c,b)):da(c,d)||(Le.set(d),a.uniformMatrix2fv(this.addr,!1,Le),qa(c,d))}function bg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),qa(c,b)):da(c,d)||(Me.set(d),a.uniformMatrix3fv(this.addr,!1,Me),qa(c,d))}function cg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),qa(c,b)):da(c,d)||(Ne.set(d),a.uniformMatrix4fv(this.addr,\n!1,Ne),qa(c,d))}function dg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture2D(b||Oe,e)}function eg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTextureCube(b||Pe,e)}function Qe(a,b){var c=this.cache;da(c,b)||(a.uniform2iv(this.addr,b),qa(c,b))}function Re(a,b){var c=this.cache;da(c,b)||(a.uniform3iv(this.addr,b),qa(c,b))}function Se(a,b){var c=this.cache;da(c,b)||(a.uniform4iv(this.addr,b),qa(c,\nb))}function fg(a){switch(a){case 5126:return Wf;case 35664:return Yf;case 35665:return Zf;case 35666:return $f;case 35674:return ag;case 35675:return bg;case 35676:return cg;case 35678:case 36198:return dg;case 35680:return eg;case 5124:case 35670:return Xf;case 35667:case 35671:return Qe;case 35668:case 35672:return Re;case 35669:case 35673:return Se}}function gg(a,b){var c=this.cache;da(c,b)||(a.uniform1fv(this.addr,b),qa(c,b))}function hg(a,b){var c=this.cache;da(c,b)||(a.uniform1iv(this.addr,\nb),qa(c,b))}function ig(a,b){var c=this.cache;b=Rb(b,this.size,2);da(c,b)||(a.uniform2fv(this.addr,b),this.updateCache(b))}function jg(a,b){var c=this.cache;b=Rb(b,this.size,3);da(c,b)||(a.uniform3fv(this.addr,b),this.updateCache(b))}function kg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.uniform4fv(this.addr,b),this.updateCache(b))}function lg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),this.updateCache(b))}function mg(a,b){var c=this.cache;b=\nRb(b,this.size,9);da(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),this.updateCache(b))}function ng(a,b){var c=this.cache;b=Rb(b,this.size,16);da(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),this.updateCache(b))}function og(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(a.uniform1iv(this.addr,f),qa(d,f));for(a=0;a!==e;++a)c.setTexture2D(b[a]||Oe,f[a])}function pg(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(a.uniform1iv(this.addr,f),qa(d,f));for(a=0;a!==e;++a)c.setTextureCube(b[a]||\nPe,f[a])}function qg(a){switch(a){case 5126:return gg;case 35664:return ig;case 35665:return jg;case 35666:return kg;case 35674:return lg;case 35675:return mg;case 35676:return ng;case 35678:return og;case 35680:return pg;case 5124:case 35670:return hg;case 35667:case 35671:return Qe;case 35668:case 35672:return Re;case 35669:case 35673:return Se}}function rg(a,b,c){this.id=a;this.addr=c;this.cache=[];this.setValue=fg(b.type)}function Te(a,b,c){this.id=a;this.addr=c;this.cache=[];this.size=b.size;\nthis.setValue=qg(b.type)}function Ue(a){this.id=a;this.seq=[];this.map={}}function eb(a,b,c){this.seq=[];this.map={};this.renderer=c;c=a.getProgramParameter(b,a.ACTIVE_UNIFORMS);for(var d=0;d<c;++d){var e=a.getActiveUniform(b,d),f=a.getUniformLocation(b,e.name),g=this,h=e.name,l=h.length;for(Xd.lastIndex=0;;){var m=Xd.exec(h),v=Xd.lastIndex,n=m[1],t=m[3];\"]\"===m[2]&&(n|=0);if(void 0===t||\"[\"===t&&v+2===l){h=g;e=void 0===t?new rg(n,e,f):new Te(n,e,f);h.seq.push(e);h.map[e.id]=e;break}else t=g.map[n],\nvoid 0===t&&(t=new Ue(n),n=g,g=t,n.seq.push(g),n.map[g.id]=g),g=t}}}function sg(a){a=a.split(\"\\n\");for(var b=0;b<a.length;b++)a[b]=b+1+\": \"+a[b];return a.join(\"\\n\")}function Ve(a,b,c){var d=a.createShader(b);a.shaderSource(d,c);a.compileShader(d);!1===a.getShaderParameter(d,a.COMPILE_STATUS)&&console.error(\"THREE.WebGLShader: Shader couldn't compile.\");\"\"!==a.getShaderInfoLog(d)&&console.warn(\"THREE.WebGLShader: gl.getShaderInfoLog()\",b===a.VERTEX_SHADER?\"vertex\":\"fragment\",a.getShaderInfoLog(d),\nsg(c));return d}function We(a){switch(a){case 3E3:return[\"Linear\",\"( value )\"];case 3001:return[\"sRGB\",\"( value )\"];case 3002:return[\"RGBE\",\"( value )\"];case 3004:return[\"RGBM\",\"( value, 7.0 )\"];case 3005:return[\"RGBM\",\"( value, 16.0 )\"];case 3006:return[\"RGBD\",\"( value, 256.0 )\"];case 3007:return[\"Gamma\",\"( value, float( GAMMA_FACTOR ) )\"];default:throw Error(\"unsupported encoding: \"+a);}}function Yd(a,b){b=We(b);return\"vec4 \"+a+\"( vec4 value ) { return \"+b[0]+\"ToLinear\"+b[1]+\"; }\"}function tg(a,\nb){b=We(b);return\"vec4 \"+a+\"( vec4 value ) { return LinearTo\"+b[0]+b[1]+\"; }\"}function ug(a,b){switch(b){case 1:b=\"Linear\";break;case 2:b=\"Reinhard\";break;case 3:b=\"Uncharted2\";break;case 4:b=\"OptimizedCineon\";break;default:throw Error(\"unsupported toneMapping: \"+b);}return\"vec3 \"+a+\"( vec3 color ) { return \"+b+\"ToneMapping( color ); }\"}function vg(a,b,c){a=a||{};return[a.derivatives||b.envMapCubeUV||b.bumpMap||b.normalMap&&!b.objectSpaceNormalMap||b.flatShading?\"#extension GL_OES_standard_derivatives : enable\":\n\"\",(a.fragDepth||b.logarithmicDepthBuffer)&&c.get(\"EXT_frag_depth\")?\"#extension GL_EXT_frag_depth : enable\":\"\",a.drawBuffers&&c.get(\"WEBGL_draw_buffers\")?\"#extension GL_EXT_draw_buffers : require\":\"\",(a.shaderTextureLOD||b.envMap)&&c.get(\"EXT_shader_texture_lod\")?\"#extension GL_EXT_shader_texture_lod : enable\":\"\"].filter(Gc).join(\"\\n\")}function wg(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push(\"#define \"+c+\" \"+d)}return b.join(\"\\n\")}function Gc(a){return\"\"!==a}function Xe(a,b){return a.replace(/NUM_DIR_LIGHTS/g,\nb.numDirLights).replace(/NUM_SPOT_LIGHTS/g,b.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,b.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,b.numPointLights).replace(/NUM_HEMI_LIGHTS/g,b.numHemiLights)}function Ye(a,b){return a.replace(/NUM_CLIPPING_PLANES/g,b.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,b.numClippingPlanes-b.numClipIntersection)}function Zd(a){return a.replace(/^[ \\t]*#include +<([\\w\\d.]+)>/gm,function(a,c){a=S[c];if(void 0===a)throw Error(\"Can not resolve #include <\"+c+\n\">\");return Zd(a)})}function Ze(a){return a.replace(/#pragma unroll_loop[\\s]+?for \\( int i = (\\d+); i < (\\d+); i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g,function(a,c,d,e){a=\"\";for(c=parseInt(c);c<parseInt(d);c++)a+=e.replace(/\\[ i \\]/g,\"[ \"+c+\" ]\");return a})}function xg(a,b,c,d,e,f){var g=a.context,h=d.defines,l=e.vertexShader,m=e.fragmentShader,v=\"SHADOWMAP_TYPE_BASIC\";1===f.shadowMapType?v=\"SHADOWMAP_TYPE_PCF\":2===f.shadowMapType&&(v=\"SHADOWMAP_TYPE_PCF_SOFT\");var n=\"ENVMAP_TYPE_CUBE\",t=\"ENVMAP_MODE_REFLECTION\",\nq=\"ENVMAP_BLENDING_MULTIPLY\";if(f.envMap){switch(d.envMap.mapping){case 301:case 302:n=\"ENVMAP_TYPE_CUBE\";break;case 306:case 307:n=\"ENVMAP_TYPE_CUBE_UV\";break;case 303:case 304:n=\"ENVMAP_TYPE_EQUIREC\";break;case 305:n=\"ENVMAP_TYPE_SPHERE\"}switch(d.envMap.mapping){case 302:case 304:t=\"ENVMAP_MODE_REFRACTION\"}switch(d.combine){case 0:q=\"ENVMAP_BLENDING_MULTIPLY\";break;case 1:q=\"ENVMAP_BLENDING_MIX\";break;case 2:q=\"ENVMAP_BLENDING_ADD\"}}var r=0<a.gammaFactor?a.gammaFactor:1,k=vg(d.extensions,f,b),p=\nwg(h),w=g.createProgram();d.isRawShaderMaterial?(h=[p].filter(Gc).join(\"\\n\"),0<h.length&&(h+=\"\\n\"),b=[k,p].filter(Gc).join(\"\\n\"),0<b.length&&(b+=\"\\n\")):(h=[\"precision \"+f.precision+\" float;\",\"precision \"+f.precision+\" int;\",\"#define SHADER_NAME \"+e.name,p,f.supportsVertexTextures?\"#define VERTEX_TEXTURES\":\"\",\"#define GAMMA_FACTOR \"+r,\"#define MAX_BONES \"+f.maxBones,f.useFog&&f.fog?\"#define USE_FOG\":\"\",f.useFog&&f.fogExp?\"#define FOG_EXP2\":\"\",f.map?\"#define USE_MAP\":\"\",f.envMap?\"#define USE_ENVMAP\":\n\"\",f.envMap?\"#define \"+t:\"\",f.lightMap?\"#define USE_LIGHTMAP\":\"\",f.aoMap?\"#define USE_AOMAP\":\"\",f.emissiveMap?\"#define USE_EMISSIVEMAP\":\"\",f.bumpMap?\"#define USE_BUMPMAP\":\"\",f.normalMap?\"#define USE_NORMALMAP\":\"\",f.normalMap&&f.objectSpaceNormalMap?\"#define OBJECTSPACE_NORMALMAP\":\"\",f.displacementMap&&f.supportsVertexTextures?\"#define USE_DISPLACEMENTMAP\":\"\",f.specularMap?\"#define USE_SPECULARMAP\":\"\",f.roughnessMap?\"#define USE_ROUGHNESSMAP\":\"\",f.metalnessMap?\"#define USE_METALNESSMAP\":\"\",f.alphaMap?\n\"#define USE_ALPHAMAP\":\"\",f.vertexColors?\"#define USE_COLOR\":\"\",f.flatShading?\"#define FLAT_SHADED\":\"\",f.skinning?\"#define USE_SKINNING\":\"\",f.useVertexTexture?\"#define BONE_TEXTURE\":\"\",f.morphTargets?\"#define USE_MORPHTARGETS\":\"\",f.morphNormals&&!1===f.flatShading?\"#define USE_MORPHNORMALS\":\"\",f.doubleSided?\"#define DOUBLE_SIDED\":\"\",f.flipSided?\"#define FLIP_SIDED\":\"\",f.shadowMapEnabled?\"#define USE_SHADOWMAP\":\"\",f.shadowMapEnabled?\"#define \"+v:\"\",f.sizeAttenuation?\"#define USE_SIZEATTENUATION\":\"\",\nf.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",f.logarithmicDepthBuffer&&b.get(\"EXT_frag_depth\")?\"#define USE_LOGDEPTHBUF_EXT\":\"\",\"uniform mat4 modelMatrix;\",\"uniform mat4 modelViewMatrix;\",\"uniform mat4 projectionMatrix;\",\"uniform mat4 viewMatrix;\",\"uniform mat3 normalMatrix;\",\"uniform vec3 cameraPosition;\",\"attribute vec3 position;\",\"attribute vec3 normal;\",\"attribute vec2 uv;\",\"#ifdef USE_COLOR\",\"\\tattribute vec3 color;\",\"#endif\",\"#ifdef USE_MORPHTARGETS\",\"\\tattribute vec3 morphTarget0;\",\n\"\\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;\",\n\"#endif\",\"\\n\"].filter(Gc).join(\"\\n\"),b=[k,\"precision \"+f.precision+\" float;\",\"precision \"+f.precision+\" int;\",\"#define SHADER_NAME \"+e.name,p,f.alphaTest?\"#define ALPHATEST \"+f.alphaTest+(f.alphaTest%1?\"\":\".0\"):\"\",\"#define GAMMA_FACTOR \"+r,f.useFog&&f.fog?\"#define USE_FOG\":\"\",f.useFog&&f.fogExp?\"#define FOG_EXP2\":\"\",f.map?\"#define USE_MAP\":\"\",f.envMap?\"#define USE_ENVMAP\":\"\",f.envMap?\"#define \"+n:\"\",f.envMap?\"#define \"+t:\"\",f.envMap?\"#define \"+q:\"\",f.lightMap?\"#define USE_LIGHTMAP\":\"\",f.aoMap?\"#define USE_AOMAP\":\n\"\",f.emissiveMap?\"#define USE_EMISSIVEMAP\":\"\",f.bumpMap?\"#define USE_BUMPMAP\":\"\",f.normalMap?\"#define USE_NORMALMAP\":\"\",f.normalMap&&f.objectSpaceNormalMap?\"#define OBJECTSPACE_NORMALMAP\":\"\",f.specularMap?\"#define USE_SPECULARMAP\":\"\",f.roughnessMap?\"#define USE_ROUGHNESSMAP\":\"\",f.metalnessMap?\"#define USE_METALNESSMAP\":\"\",f.alphaMap?\"#define USE_ALPHAMAP\":\"\",f.vertexColors?\"#define USE_COLOR\":\"\",f.gradientMap?\"#define USE_GRADIENTMAP\":\"\",f.flatShading?\"#define FLAT_SHADED\":\"\",f.doubleSided?\"#define DOUBLE_SIDED\":\n\"\",f.flipSided?\"#define FLIP_SIDED\":\"\",f.shadowMapEnabled?\"#define USE_SHADOWMAP\":\"\",f.shadowMapEnabled?\"#define \"+v:\"\",f.premultipliedAlpha?\"#define PREMULTIPLIED_ALPHA\":\"\",f.physicallyCorrectLights?\"#define PHYSICALLY_CORRECT_LIGHTS\":\"\",f.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",f.logarithmicDepthBuffer&&b.get(\"EXT_frag_depth\")?\"#define USE_LOGDEPTHBUF_EXT\":\"\",f.envMap&&b.get(\"EXT_shader_texture_lod\")?\"#define TEXTURE_LOD_EXT\":\"\",\"uniform mat4 viewMatrix;\",\"uniform vec3 cameraPosition;\",\n0!==f.toneMapping?\"#define TONE_MAPPING\":\"\",0!==f.toneMapping?S.tonemapping_pars_fragment:\"\",0!==f.toneMapping?ug(\"toneMapping\",f.toneMapping):\"\",f.dithering?\"#define DITHERING\":\"\",f.outputEncoding||f.mapEncoding||f.envMapEncoding||f.emissiveMapEncoding?S.encodings_pars_fragment:\"\",f.mapEncoding?Yd(\"mapTexelToLinear\",f.mapEncoding):\"\",f.envMapEncoding?Yd(\"envMapTexelToLinear\",f.envMapEncoding):\"\",f.emissiveMapEncoding?Yd(\"emissiveMapTexelToLinear\",f.emissiveMapEncoding):\"\",f.outputEncoding?tg(\"linearToOutputTexel\",\nf.outputEncoding):\"\",f.depthPacking?\"#define DEPTH_PACKING \"+d.depthPacking:\"\",\"\\n\"].filter(Gc).join(\"\\n\"));l=Zd(l);l=Xe(l,f);l=Ye(l,f);m=Zd(m);m=Xe(m,f);m=Ye(m,f);l=Ze(l);m=Ze(m);m=b+m;l=Ve(g,g.VERTEX_SHADER,h+l);m=Ve(g,g.FRAGMENT_SHADER,m);g.attachShader(w,l);g.attachShader(w,m);void 0!==d.index0AttributeName?g.bindAttribLocation(w,0,d.index0AttributeName):!0===f.morphTargets&&g.bindAttribLocation(w,0,\"position\");g.linkProgram(w);f=g.getProgramInfoLog(w).trim();v=g.getShaderInfoLog(l).trim();n=\ng.getShaderInfoLog(m).trim();q=t=!0;if(!1===g.getProgramParameter(w,g.LINK_STATUS))t=!1,console.error(\"THREE.WebGLProgram: shader error: \",g.getError(),\"gl.VALIDATE_STATUS\",g.getProgramParameter(w,g.VALIDATE_STATUS),\"gl.getProgramInfoLog\",f,v,n);else if(\"\"!==f)console.warn(\"THREE.WebGLProgram: gl.getProgramInfoLog()\",f);else if(\"\"===v||\"\"===n)q=!1;q&&(this.diagnostics={runnable:t,material:d,programLog:f,vertexShader:{log:v,prefix:h},fragmentShader:{log:n,prefix:b}});g.deleteShader(l);g.deleteShader(m);\nvar x;this.getUniforms=function(){void 0===x&&(x=new eb(g,w,a));return x};var A;this.getAttributes=function(){if(void 0===A){for(var a={},b=g.getProgramParameter(w,g.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=g.getActiveAttrib(w,c).name;a[d]=g.getAttribLocation(w,d)}A=a}return A};this.destroy=function(){g.deleteProgram(w);this.program=void 0};Object.defineProperties(this,{uniforms:{get:function(){console.warn(\"THREE.WebGLProgram: .uniforms is now .getUniforms().\");return this.getUniforms()}},attributes:{get:function(){console.warn(\"THREE.WebGLProgram: .attributes is now .getAttributes().\");\nreturn this.getAttributes()}}});this.name=e.name;this.id=yg++;this.code=c;this.usedTimes=1;this.program=w;this.vertexShader=l;this.fragmentShader=m;return this}function zg(a,b,c){function d(a,b){if(a)a.isTexture?c=a.encoding:a.isWebGLRenderTarget&&(console.warn(\"THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead.\"),c=a.texture.encoding);else var c=3E3;3E3===c&&b&&(c=3007);return c}var e=[],f={MeshDepthMaterial:\"depth\",MeshDistanceMaterial:\"distanceRGBA\",\nMeshNormalMaterial:\"normal\",MeshBasicMaterial:\"basic\",MeshLambertMaterial:\"lambert\",MeshPhongMaterial:\"phong\",MeshToonMaterial:\"phong\",MeshStandardMaterial:\"physical\",MeshPhysicalMaterial:\"physical\",LineBasicMaterial:\"basic\",LineDashedMaterial:\"dashed\",PointsMaterial:\"points\",ShadowMaterial:\"shadow\"},g=\"precision supportsVertexTextures map mapEncoding envMap envMapMode envMapEncoding lightMap aoMap emissiveMap emissiveMapEncoding bumpMap normalMap objectSpaceNormalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking dithering\".split(\" \");\nthis.getParameters=function(b,e,g,v,n,t,q){var h=f[b.type];if(q.isSkinnedMesh){var l=q.skeleton.bones;if(c.floatVertexTextures)l=1024;else{var m=Math.min(Math.floor((c.maxVertexUniforms-20)/4),l.length);m<l.length?(console.warn(\"THREE.WebGLRenderer: Skeleton has \"+l.length+\" bones. This GPU supports \"+m+\".\"),l=0):l=m}}else l=0;m=c.precision;null!==b.precision&&(m=c.getMaxPrecision(b.precision),m!==b.precision&&console.warn(\"THREE.WebGLProgram.getParameters:\",b.precision,\"not supported, using\",m,\"instead.\"));\nvar k=a.getRenderTarget();return{shaderID:h,precision:m,supportsVertexTextures:c.vertexTextures,outputEncoding:d(k?k.texture:null,a.gammaOutput),map:!!b.map,mapEncoding:d(b.map,a.gammaInput),envMap:!!b.envMap,envMapMode:b.envMap&&b.envMap.mapping,envMapEncoding:d(b.envMap,a.gammaInput),envMapCubeUV:!!b.envMap&&(306===b.envMap.mapping||307===b.envMap.mapping),lightMap:!!b.lightMap,aoMap:!!b.aoMap,emissiveMap:!!b.emissiveMap,emissiveMapEncoding:d(b.emissiveMap,a.gammaInput),bumpMap:!!b.bumpMap,normalMap:!!b.normalMap,\nobjectSpaceNormalMap:1===b.normalMapType,displacementMap:!!b.displacementMap,roughnessMap:!!b.roughnessMap,metalnessMap:!!b.metalnessMap,specularMap:!!b.specularMap,alphaMap:!!b.alphaMap,gradientMap:!!b.gradientMap,combine:b.combine,vertexColors:b.vertexColors,fog:!!v,useFog:b.fog,fogExp:v&&v.isFogExp2,flatShading:b.flatShading,sizeAttenuation:b.sizeAttenuation,logarithmicDepthBuffer:c.logarithmicDepthBuffer,skinning:b.skinning&&0<l,maxBones:l,useVertexTexture:c.floatVertexTextures,morphTargets:b.morphTargets,\nmorphNormals:b.morphNormals,maxMorphTargets:a.maxMorphTargets,maxMorphNormals:a.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numClippingPlanes:n,numClipIntersection:t,dithering:b.dithering,shadowMapEnabled:a.shadowMap.enabled&&q.receiveShadow&&0<g.length,shadowMapType:a.shadowMap.type,toneMapping:a.toneMapping,physicallyCorrectLights:a.physicallyCorrectLights,premultipliedAlpha:b.premultipliedAlpha,\nalphaTest:b.alphaTest,doubleSided:2===b.side,flipSided:1===b.side,depthPacking:void 0!==b.depthPacking?b.depthPacking:!1}};this.getProgramCode=function(b,c){var d=[];c.shaderID?d.push(c.shaderID):(d.push(b.fragmentShader),d.push(b.vertexShader));if(void 0!==b.defines)for(var e in b.defines)d.push(e),d.push(b.defines[e]);for(e=0;e<g.length;e++)d.push(c[g[e]]);d.push(b.onBeforeCompile.toString());d.push(a.gammaOutput);return d.join()};this.acquireProgram=function(c,d,f,g){for(var h,l=0,m=e.length;l<\nm;l++){var v=e[l];if(v.code===g){h=v;++h.usedTimes;break}}void 0===h&&(h=new xg(a,b,g,c,d,f),e.push(h));return h};this.releaseProgram=function(a){if(0===--a.usedTimes){var b=e.indexOf(a);e[b]=e[e.length-1];e.pop();a.destroy()}};this.programs=e}function Ag(){var a=new WeakMap;return{get:function(b){var c=a.get(b);void 0===c&&(c={},a.set(b,c));return c},remove:function(b){a.delete(b)},update:function(b,c,d){a.get(b)[c]=d},dispose:function(){a=new WeakMap}}}function Bg(a,b){return a.renderOrder!==b.renderOrder?\na.renderOrder-b.renderOrder:a.program&&b.program&&a.program!==b.program?a.program.id-b.program.id:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function Cg(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function Dg(){var a=[],b=0,c=[],d=[];return{opaque:c,transparent:d,init:function(){b=0;c.length=0;d.length=0},push:function(e,f,g,h,l){var m=a[b];void 0===m?(m={id:e.id,object:e,geometry:f,material:g,program:g.program,\nrenderOrder:e.renderOrder,z:h,group:l},a[b]=m):(m.id=e.id,m.object=e,m.geometry=f,m.material=g,m.program=g.program,m.renderOrder=e.renderOrder,m.z=h,m.group=l);(!0===g.transparent?d:c).push(m);b++},sort:function(){1<c.length&&c.sort(Bg);1<d.length&&d.sort(Cg)}}}function Eg(){var a={};return{get:function(b,c){b=b.id+\",\"+c.id;c=a[b];void 0===c&&(c=new Dg,a[b]=c);return c},dispose:function(){a={}}}}function Fg(){var a={};return{get:function(b){if(void 0!==a[b.id])return a[b.id];switch(b.type){case \"DirectionalLight\":var c=\n{direction:new p,color:new G,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new B};break;case \"SpotLight\":c={position:new p,direction:new p,color:new G,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new B};break;case \"PointLight\":c={position:new p,color:new G,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new B,shadowCameraNear:1,shadowCameraFar:1E3};break;case \"HemisphereLight\":c={direction:new p,skyColor:new G,groundColor:new G};\nbreak;case \"RectAreaLight\":c={color:new G,position:new p,halfWidth:new p,halfHeight:new p}}return a[b.id]=c}}}function Gg(){var a=new Fg,b={id:Hg++,hash:\"\",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},c=new p,d=new R,e=new R;return{setup:function(f,g,h){var l=0,m=0,v=0,n=0,t=0,q=0,r=0,k=0;h=h.matrixWorldInverse;for(var p=0,w=f.length;p<w;p++){var x=\nf[p],A=x.color,C=x.intensity,O=x.distance,Q=x.shadow&&x.shadow.map?x.shadow.map.texture:null;if(x.isAmbientLight)l+=A.r*C,m+=A.g*C,v+=A.b*C;else if(x.isDirectionalLight){var M=a.get(x);M.color.copy(x.color).multiplyScalar(x.intensity);M.direction.setFromMatrixPosition(x.matrixWorld);c.setFromMatrixPosition(x.target.matrixWorld);M.direction.sub(c);M.direction.transformDirection(h);if(M.shadow=x.castShadow)A=x.shadow,M.shadowBias=A.bias,M.shadowRadius=A.radius,M.shadowMapSize=A.mapSize;b.directionalShadowMap[n]=\nQ;b.directionalShadowMatrix[n]=x.shadow.matrix;b.directional[n]=M;n++}else if(x.isSpotLight){M=a.get(x);M.position.setFromMatrixPosition(x.matrixWorld);M.position.applyMatrix4(h);M.color.copy(A).multiplyScalar(C);M.distance=O;M.direction.setFromMatrixPosition(x.matrixWorld);c.setFromMatrixPosition(x.target.matrixWorld);M.direction.sub(c);M.direction.transformDirection(h);M.coneCos=Math.cos(x.angle);M.penumbraCos=Math.cos(x.angle*(1-x.penumbra));M.decay=0===x.distance?0:x.decay;if(M.shadow=x.castShadow)A=\nx.shadow,M.shadowBias=A.bias,M.shadowRadius=A.radius,M.shadowMapSize=A.mapSize;b.spotShadowMap[q]=Q;b.spotShadowMatrix[q]=x.shadow.matrix;b.spot[q]=M;q++}else if(x.isRectAreaLight)M=a.get(x),M.color.copy(A).multiplyScalar(C),M.position.setFromMatrixPosition(x.matrixWorld),M.position.applyMatrix4(h),e.identity(),d.copy(x.matrixWorld),d.premultiply(h),e.extractRotation(d),M.halfWidth.set(.5*x.width,0,0),M.halfHeight.set(0,.5*x.height,0),M.halfWidth.applyMatrix4(e),M.halfHeight.applyMatrix4(e),b.rectArea[r]=\nM,r++;else if(x.isPointLight){M=a.get(x);M.position.setFromMatrixPosition(x.matrixWorld);M.position.applyMatrix4(h);M.color.copy(x.color).multiplyScalar(x.intensity);M.distance=x.distance;M.decay=0===x.distance?0:x.decay;if(M.shadow=x.castShadow)A=x.shadow,M.shadowBias=A.bias,M.shadowRadius=A.radius,M.shadowMapSize=A.mapSize,M.shadowCameraNear=A.camera.near,M.shadowCameraFar=A.camera.far;b.pointShadowMap[t]=Q;b.pointShadowMatrix[t]=x.shadow.matrix;b.point[t]=M;t++}else x.isHemisphereLight&&(M=a.get(x),\nM.direction.setFromMatrixPosition(x.matrixWorld),M.direction.transformDirection(h),M.direction.normalize(),M.skyColor.copy(x.color).multiplyScalar(C),M.groundColor.copy(x.groundColor).multiplyScalar(C),b.hemi[k]=M,k++)}b.ambient[0]=l;b.ambient[1]=m;b.ambient[2]=v;b.directional.length=n;b.spot.length=q;b.rectArea.length=r;b.point.length=t;b.hemi.length=k;b.hash=b.id+\",\"+n+\",\"+t+\",\"+q+\",\"+r+\",\"+k+\",\"+g.length},state:b}}function Ig(){var a=new Gg,b=[],c=[],d=[];return{init:function(){b.length=0;c.length=\n0;d.length=0},state:{lightsArray:b,shadowsArray:c,spritesArray:d,lights:a},setupLights:function(d){a.setup(b,c,d)},pushLight:function(a){b.push(a)},pushShadow:function(a){c.push(a)},pushSprite:function(a){d.push(a)}}}function Jg(){var a={};return{get:function(b,c){b=b.id+\",\"+c.id;c=a[b];void 0===c&&(c=new Ig,a[b]=c);return c},dispose:function(){a={}}}}function fb(a){I.call(this);this.type=\"MeshDepthMaterial\";this.depthPacking=3200;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=\nthis.map=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.setValues(a)}function gb(a){I.call(this);this.type=\"MeshDistanceMaterial\";this.referencePosition=new p;this.nearDistance=1;this.farDistance=1E3;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.lights=this.fog=!1;this.setValues(a)}function $e(a,b,c){function d(b,c,d,e,f,g){var h=\nb.geometry;var l=n;var m=b.customDepthMaterial;d&&(l=t,m=b.customDistanceMaterial);m?l=m:(m=!1,c.morphTargets&&(h&&h.isBufferGeometry?m=h.morphAttributes&&h.morphAttributes.position&&0<h.morphAttributes.position.length:h&&h.isGeometry&&(m=h.morphTargets&&0<h.morphTargets.length)),b.isSkinnedMesh&&!1===c.skinning&&console.warn(\"THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:\",b),b=b.isSkinnedMesh&&c.skinning,h=0,m&&(h|=1),b&&(h|=2),l=l[h]);a.localClippingEnabled&&!0===\nc.clipShadows&&0!==c.clippingPlanes.length&&(h=l.uuid,m=c.uuid,b=q[h],void 0===b&&(b={},q[h]=b),h=b[m],void 0===h&&(h=l.clone(),b[m]=h),l=h);l.visible=c.visible;l.wireframe=c.wireframe;l.side=null!=c.shadowSide?c.shadowSide:r[c.side];l.clipShadows=c.clipShadows;l.clippingPlanes=c.clippingPlanes;l.clipIntersection=c.clipIntersection;l.wireframeLinewidth=c.wireframeLinewidth;l.linewidth=c.linewidth;d&&l.isMeshDistanceMaterial&&(l.referencePosition.copy(e),l.nearDistance=f,l.farDistance=g);return l}\nfunction e(c,g,h,l){if(!1!==c.visible){if(c.layers.test(g.layers)&&(c.isMesh||c.isLine||c.isPoints)&&c.castShadow&&(!c.frustumCulled||f.intersectsObject(c))){c.modelViewMatrix.multiplyMatrices(h.matrixWorldInverse,c.matrixWorld);var m=b.update(c),n=c.material;if(Array.isArray(n))for(var t=m.groups,q=0,r=t.length;q<r;q++){var k=t[q],O=n[k.materialIndex];O&&O.visible&&(O=d(c,O,l,v,h.near,h.far),a.renderBufferDirect(h,null,m,O,c,k))}else n.visible&&(O=d(c,n,l,v,h.near,h.far),a.renderBufferDirect(h,null,\nm,O,c,null))}c=c.children;m=0;for(n=c.length;m<n;m++)e(c[m],g,h,l)}}var f=new td,g=new R,h=new B,l=new B(c,c),m=new p,v=new p,n=Array(4),t=Array(4),q={},r={0:1,1:0,2:2},k=[new p(1,0,0),new p(-1,0,0),new p(0,0,1),new p(0,0,-1),new p(0,1,0),new p(0,-1,0)],y=[new p(0,1,0),new p(0,1,0),new p(0,1,0),new p(0,1,0),new p(0,0,1),new p(0,0,-1)],w=[new W,new W,new W,new W,new W,new W];for(c=0;4!==c;++c){var x=0!==(c&1),A=0!==(c&2),C=new fb({depthPacking:3201,morphTargets:x,skinning:A});n[c]=C;x=new gb({morphTargets:x,\nskinning:A});t[c]=x}var O=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(b,c,d){if(!1!==O.enabled&&(!1!==O.autoUpdate||!1!==O.needsUpdate)&&0!==b.length){var n=a.state;n.disable(a.context.BLEND);n.buffers.color.setClear(1,1,1,1);n.buffers.depth.setTest(!0);n.setScissorTest(!1);for(var t,q=0,r=b.length;q<r;q++){var u=b[q];t=u.shadow;var p=u&&u.isPointLight;if(void 0===t)console.warn(\"THREE.WebGLShadowMap:\",u,\"has no shadow.\");else{var Q=t.camera;h.copy(t.mapSize);\nh.min(l);if(p){var x=h.x,C=h.y;w[0].set(2*x,C,x,C);w[1].set(0,C,x,C);w[2].set(3*x,C,x,C);w[3].set(x,C,x,C);w[4].set(3*x,0,x,C);w[5].set(x,0,x,C);h.x*=4;h.y*=2}null===t.map&&(t.map=new kb(h.x,h.y,{minFilter:1003,magFilter:1003,format:1023}),t.map.texture.name=u.name+\".shadowMap\",Q.updateProjectionMatrix());t.isSpotLightShadow&&t.update(u);x=t.map;C=t.matrix;v.setFromMatrixPosition(u.matrixWorld);Q.position.copy(v);p?(t=6,C.makeTranslation(-v.x,-v.y,-v.z)):(t=1,m.setFromMatrixPosition(u.target.matrixWorld),\nQ.lookAt(m),Q.updateMatrixWorld(),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(Q.projectionMatrix),C.multiply(Q.matrixWorldInverse));a.setRenderTarget(x);a.clear();for(u=0;u<t;u++)p&&(m.copy(Q.position),m.add(k[u]),Q.up.copy(y[u]),Q.lookAt(m),Q.updateMatrixWorld(),n.viewport(w[u])),g.multiplyMatrices(Q.projectionMatrix,Q.matrixWorldInverse),f.setFromMatrix(g),e(c,d,Q,p)}}O.needsUpdate=!1}}}function Sb(a,b,c,d,e,f,g,h,l){ea.call(this,a,b,c,d,e,f,g,h,l);this.needsUpdate=!0}function Kg(a,\nb,c,d,e){var f,g,h,l,m,v,n,t,q,r,k,y,w,x,A,C,O,Q;function M(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:b.id-a.id}var B,qb,U,z,Ec=new p,H=new ca,D=new p;this.render=function(u,p,Ob){if(0!==u.length){if(void 0===U){var sa=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),Ca=new Uint16Array([0,1,2,0,2,3]);B=b.createBuffer();qb=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,B);b.bufferData(b.ARRAY_BUFFER,sa,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,\nqb);b.bufferData(b.ELEMENT_ARRAY_BUFFER,Ca,b.STATIC_DRAW);sa=b.createProgram();Ca=b.createShader(b.VERTEX_SHADER);var G=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(Ca,[\"precision \"+e.precision+\" float;\",\"#define SHADER_NAME SpriteMaterial\\nuniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\nuniform float rotation;\\nuniform vec2 center;\\nuniform vec2 scale;\\nuniform vec2 uvOffset;\\nuniform vec2 uvScale;\\nattribute vec2 position;\\nattribute vec2 uv;\\nvarying vec2 vUV;\\nvarying float fogDepth;\\nvoid main() {\\n\\tvUV = uvOffset + uv * uvScale;\\n\\tvec2 alignedPosition = ( position - center ) * 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\\tvec4 mvPosition;\\n\\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\tmvPosition.xy += rotatedPosition;\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\tfogDepth = - mvPosition.z;\\n}\"].join(\"\\n\"));\nb.shaderSource(G,[\"precision \"+e.precision+\" float;\",\"#define SHADER_NAME SpriteMaterial\\nuniform vec3 color;\\nuniform sampler2D map;\\nuniform float opacity;\\nuniform int fogType;\\nuniform vec3 fogColor;\\nuniform float fogDensity;\\nuniform float fogNear;\\nuniform float fogFar;\\nuniform float alphaTest;\\nvarying vec2 vUV;\\nvarying float fogDepth;\\nvoid main() {\\n\\tvec4 texture = texture2D( map, vUV );\\n\\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\\n\\tif ( gl_FragColor.a < alphaTest ) discard;\\n\\tif ( fogType > 0 ) {\\n\\t\\tfloat fogFactor = 0.0;\\n\\t\\tif ( fogType == 1 ) {\\n\\t\\t\\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );\\n\\t\\t} else {\\n\\t\\t\\tconst float LOG2 = 1.442695;\\n\\t\\t\\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );\\n\\t\\t\\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\\n\\t\\t}\\n\\t\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n\\t}\\n}\"].join(\"\\n\"));\nb.compileShader(Ca);b.compileShader(G);b.attachShader(sa,Ca);b.attachShader(sa,G);b.linkProgram(sa);U=sa;O=b.getAttribLocation(U,\"position\");Q=b.getAttribLocation(U,\"uv\");f=b.getUniformLocation(U,\"uvOffset\");g=b.getUniformLocation(U,\"uvScale\");h=b.getUniformLocation(U,\"rotation\");l=b.getUniformLocation(U,\"center\");m=b.getUniformLocation(U,\"scale\");v=b.getUniformLocation(U,\"color\");n=b.getUniformLocation(U,\"map\");t=b.getUniformLocation(U,\"opacity\");q=b.getUniformLocation(U,\"modelViewMatrix\");r=b.getUniformLocation(U,\n\"projectionMatrix\");k=b.getUniformLocation(U,\"fogType\");y=b.getUniformLocation(U,\"fogDensity\");w=b.getUniformLocation(U,\"fogNear\");x=b.getUniformLocation(U,\"fogFar\");A=b.getUniformLocation(U,\"fogColor\");b.getUniformLocation(U,\"fogDepth\");C=b.getUniformLocation(U,\"alphaTest\");sa=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\");sa.width=8;sa.height=8;Ca=sa.getContext(\"2d\");Ca.fillStyle=\"white\";Ca.fillRect(0,0,8,8);z=new Sb(sa)}c.useProgram(U);c.initAttributes();c.enableAttribute(O);\nc.enableAttribute(Q);c.disableUnusedAttributes();c.disable(b.CULL_FACE);c.enable(b.BLEND);b.bindBuffer(b.ARRAY_BUFFER,B);b.vertexAttribPointer(O,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(Q,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,qb);b.uniformMatrix4fv(r,!1,Ob.projectionMatrix.elements);c.activeTexture(b.TEXTURE0);b.uniform1i(n,0);Ca=sa=0;(G=p.fog)?(b.uniform3f(A,G.color.r,G.color.g,G.color.b),G.isFog?(b.uniform1f(w,G.near),b.uniform1f(x,G.far),b.uniform1i(k,1),Ca=sa=1):G.isFogExp2&&\n(b.uniform1f(y,G.density),b.uniform1i(k,2),Ca=sa=2)):(b.uniform1i(k,0),Ca=sa=0);G=0;for(var K=u.length;G<K;G++){var E=u[G];E.modelViewMatrix.multiplyMatrices(Ob.matrixWorldInverse,E.matrixWorld);E.z=-E.modelViewMatrix.elements[14]}u.sort(M);var P=[],R=[];G=0;for(K=u.length;G<K;G++){E=u[G];var V=E.material;if(!1!==V.visible){E.onBeforeRender(a,p,Ob,void 0,V,void 0);b.uniform1f(C,V.alphaTest);b.uniformMatrix4fv(q,!1,E.modelViewMatrix.elements);E.matrixWorld.decompose(Ec,H,D);P[0]=D.x;P[1]=D.y;R[0]=\nE.center.x-.5;R[1]=E.center.y-.5;var N=0;p.fog&&V.fog&&(N=Ca);sa!==N&&(b.uniform1i(k,N),sa=N);null!==V.map?(b.uniform2f(f,V.map.offset.x,V.map.offset.y),b.uniform2f(g,V.map.repeat.x,V.map.repeat.y)):(b.uniform2f(f,0,0),b.uniform2f(g,1,1));b.uniform1f(t,V.opacity);b.uniform3f(v,V.color.r,V.color.g,V.color.b);b.uniform1f(h,V.rotation);b.uniform2fv(l,R);b.uniform2fv(m,P);c.setBlending(V.blending,V.blendEquation,V.blendSrc,V.blendDst,V.blendEquationAlpha,V.blendSrcAlpha,V.blendDstAlpha,V.premultipliedAlpha);\nc.buffers.depth.setTest(V.depthTest);c.buffers.depth.setMask(V.depthWrite);c.buffers.color.setMask(V.colorWrite);d.setTexture2D(V.map||z,0);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);E.onAfterRender(a,p,Ob,void 0,V,void 0)}}c.enable(b.CULL_FACE);c.reset()}}}function Lg(a,b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(b,a.TEXTURE_MAG_FILTER,a.NEAREST);for(b=0;b<d;b++)a.texImage2D(c+b,0,a.RGBA,\n1,1,0,a.RGBA,a.UNSIGNED_BYTE,e);return f}function e(c,d){p[c]=1;0===w[c]&&(a.enableVertexAttribArray(c),w[c]=1);x[c]!==d&&(b.get(\"ANGLE_instanced_arrays\").vertexAttribDivisorANGLE(c,d),x[c]=d)}function f(b){!0!==A[b]&&(a.enable(b),A[b]=!0)}function g(b){!1!==A[b]&&(a.disable(b),A[b]=!1)}function h(b,d,e,h,l,m,n,v){0!==b?f(a.BLEND):g(a.BLEND);if(5!==b){if(b!==Q||v!==sa)switch(b){case 2:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,a.ONE,a.ONE,a.ONE)):(a.blendEquation(a.FUNC_ADD),\na.blendFunc(a.SRC_ALPHA,a.ONE));break;case 3:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.ZERO,a.ONE_MINUS_SRC_COLOR,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR));break;case 4:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.SRC_COLOR,a.ZERO,a.SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR));break;default:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,\na.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA))}Ec=z=U=qb=B=M=null}else{l=l||d;m=m||e;n=n||h;if(d!==M||l!==U)a.blendEquationSeparate(c.convert(d),c.convert(l)),M=d,U=l;if(e!==B||h!==qb||m!==z||n!==Ec)a.blendFuncSeparate(c.convert(e),c.convert(h),c.convert(m),c.convert(n)),B=e,qb=h,z=m,Ec=n}Q=b;sa=v}function l(b){G!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),G=b)}\nfunction m(b){0!==b?(f(a.CULL_FACE),b!==H&&(1===b?a.cullFace(a.BACK):2===b?a.cullFace(a.FRONT):a.cullFace(a.FRONT_AND_BACK))):g(a.CULL_FACE);H=b}function v(b,c,d){if(b){if(f(a.POLYGON_OFFSET_FILL),E!==c||K!==d)a.polygonOffset(c,d),E=c,K=d}else g(a.POLYGON_OFFSET_FILL)}function n(b){void 0===b&&(b=a.TEXTURE0+P-1);I!==b&&(a.activeTexture(b),I=b)}var t=new function(){var b=!1,c=new W,d=null,e=new W(0,0,0,0);return{setMask:function(c){d===c||b||(a.colorMask(c,c,c,c),d=c)},setLocked:function(a){b=a},setClear:function(b,\nd,f,g,h){!0===h&&(b*=g,d*=g,f*=g);c.set(b,d,f,g);!1===e.equals(c)&&(a.clearColor(b,d,f,g),e.copy(c))},reset:function(){b=!1;d=null;e.set(-1,0,0,0)}}},q=new function(){var b=!1,c=null,d=null,e=null;return{setTest:function(b){b?f(a.DEPTH_TEST):g(a.DEPTH_TEST)},setMask:function(d){c===d||b||(a.depthMask(d),c=d)},setFunc:function(b){if(d!==b){if(b)switch(b){case 0:a.depthFunc(a.NEVER);break;case 1:a.depthFunc(a.ALWAYS);break;case 2:a.depthFunc(a.LESS);break;case 3:a.depthFunc(a.LEQUAL);break;case 4:a.depthFunc(a.EQUAL);\nbreak;case 5:a.depthFunc(a.GEQUAL);break;case 6:a.depthFunc(a.GREATER);break;case 7:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);d=b}},setLocked:function(a){b=a},setClear:function(b){e!==b&&(a.clearDepth(b),e=b)},reset:function(){b=!1;e=d=c=null}}},k=new function(){var b=!1,c=null,d=null,e=null,h=null,l=null,m=null,n=null,v=null;return{setTest:function(b){b?f(a.STENCIL_TEST):g(a.STENCIL_TEST)},setMask:function(d){c===d||b||(a.stencilMask(d),c=d)},setFunc:function(b,\nc,f){if(d!==b||e!==c||h!==f)a.stencilFunc(b,c,f),d=b,e=c,h=f},setOp:function(b,c,d){if(l!==b||m!==c||n!==d)a.stencilOp(b,c,d),l=b,m=c,n=d},setLocked:function(a){b=a},setClear:function(b){v!==b&&(a.clearStencil(b),v=b)},reset:function(){b=!1;v=n=m=l=h=e=d=c=null}}},u=a.getParameter(a.MAX_VERTEX_ATTRIBS),p=new Uint8Array(u),w=new Uint8Array(u),x=new Uint8Array(u),A={},C=null,O=null,Q=null,M=null,B=null,qb=null,U=null,z=null,Ec=null,sa=!1,G=null,H=null,D=null,E=null,K=null,P=a.getParameter(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS),\nR=!1;u=0;u=a.getParameter(a.VERSION);-1!==u.indexOf(\"WebGL\")?(u=parseFloat(/^WebGL ([0-9])/.exec(u)[1]),R=1<=u):-1!==u.indexOf(\"OpenGL ES\")&&(u=parseFloat(/^OpenGL ES ([0-9])/.exec(u)[1]),R=2<=u);var I=null,L={},J=new W,fa=new W,V={};V[a.TEXTURE_2D]=d(a.TEXTURE_2D,a.TEXTURE_2D,1);V[a.TEXTURE_CUBE_MAP]=d(a.TEXTURE_CUBE_MAP,a.TEXTURE_CUBE_MAP_POSITIVE_X,6);t.setClear(0,0,0,1);q.setClear(1);k.setClear(0);f(a.DEPTH_TEST);q.setFunc(3);l(!1);m(1);f(a.CULL_FACE);f(a.BLEND);h(1);return{buffers:{color:t,depth:q,\nstencil:k},initAttributes:function(){for(var a=0,b=p.length;a<b;a++)p[a]=0},enableAttribute:function(a){e(a,0)},enableAttributeAndDivisor:e,disableUnusedAttributes:function(){for(var b=0,c=w.length;b!==c;++b)w[b]!==p[b]&&(a.disableVertexAttribArray(b),w[b]=0)},enable:f,disable:g,getCompressedTextureFormats:function(){if(null===C&&(C=[],b.get(\"WEBGL_compressed_texture_pvrtc\")||b.get(\"WEBGL_compressed_texture_s3tc\")||b.get(\"WEBGL_compressed_texture_etc1\")||b.get(\"WEBGL_compressed_texture_astc\")))for(var c=\na.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)C.push(c[d]);return C},useProgram:function(b){return O!==b?(a.useProgram(b),O=b,!0):!1},setBlending:h,setMaterial:function(b,c){2===b.side?g(a.CULL_FACE):f(a.CULL_FACE);var d=1===b.side;c&&(d=!d);l(d);1===b.blending&&!1===b.transparent?h(0):h(b.blending,b.blendEquation,b.blendSrc,b.blendDst,b.blendEquationAlpha,b.blendSrcAlpha,b.blendDstAlpha,b.premultipliedAlpha);q.setFunc(b.depthFunc);q.setTest(b.depthTest);q.setMask(b.depthWrite);\nt.setMask(b.colorWrite);v(b.polygonOffset,b.polygonOffsetFactor,b.polygonOffsetUnits)},setFlipSided:l,setCullFace:m,setLineWidth:function(b){b!==D&&(R&&a.lineWidth(b),D=b)},setPolygonOffset:v,setScissorTest:function(b){b?f(a.SCISSOR_TEST):g(a.SCISSOR_TEST)},activeTexture:n,bindTexture:function(b,c){null===I&&n();var d=L[I];void 0===d&&(d={type:void 0,texture:void 0},L[I]=d);if(d.type!==b||d.texture!==c)a.bindTexture(b,c||V[b]),d.type=b,d.texture=c},compressedTexImage2D:function(){try{a.compressedTexImage2D.apply(a,\narguments)}catch(N){console.error(\"THREE.WebGLState:\",N)}},texImage2D:function(){try{a.texImage2D.apply(a,arguments)}catch(N){console.error(\"THREE.WebGLState:\",N)}},scissor:function(b){!1===J.equals(b)&&(a.scissor(b.x,b.y,b.z,b.w),J.copy(b))},viewport:function(b){!1===fa.equals(b)&&(a.viewport(b.x,b.y,b.z,b.w),fa.copy(b))},reset:function(){for(var b=0;b<w.length;b++)1===w[b]&&(a.disableVertexAttribArray(b),w[b]=0);A={};I=C=null;L={};H=G=Q=O=null;t.reset();q.reset();k.reset()}}}function Mg(a,b,c,d,\ne,f,g){function h(a,b){if(a.width>b||a.height>b){if(\"data\"in a){console.warn(\"THREE.WebGLRenderer: image in DataTexture is too big (\"+a.width+\"x\"+a.height+\").\");return}b/=Math.max(a.width,a.height);var c=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\");c.width=Math.floor(a.width*b);c.height=Math.floor(a.height*b);c.getContext(\"2d\").drawImage(a,0,0,a.width,a.height,0,0,c.width,c.height);console.warn(\"THREE.WebGLRenderer: image is too big (\"+a.width+\"x\"+a.height+\"). Resized to \"+c.width+\n\"x\"+c.height,a);return c}return a}function l(a){return J.isPowerOfTwo(a.width)&&J.isPowerOfTwo(a.height)}function m(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function v(b,c,e,f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function n(b){return 1003===b||1004===b||1005===b?a.NEAREST:a.LINEAR}function t(b){b=b.target;b.removeEventListener(\"dispose\",t);a:{var c=d.get(b);if(b.image&&c.__image__webglTextureCube)a.deleteTexture(c.__image__webglTextureCube);\nelse{if(void 0===c.__webglInit)break a;a.deleteTexture(c.__webglTexture)}d.remove(b)}b.isVideoTexture&&delete A[b.id];g.memory.textures--}function q(b){b=b.target;b.removeEventListener(\"dispose\",q);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&&a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e=0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),\nc.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d.remove(b.texture);d.remove(b)}g.memory.textures--}function k(b,n){var q=d.get(b);if(b.isVideoTexture){var k=b.id,r=g.render.frame;A[k]!==r&&(A[k]=r,b.update())}if(0<b.version&&q.__version!==b.version)if(k=b.image,void 0===k)console.warn(\"THREE.WebGLRenderer: Texture marked for update but image is undefined\",b);else if(!1===k.complete)console.warn(\"THREE.WebGLRenderer: Texture marked for update but image is incomplete\",b);else{void 0===\nq.__webglInit&&(q.__webglInit=!0,b.addEventListener(\"dispose\",t),q.__webglTexture=a.createTexture(),g.memory.textures++);c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_2D,q.__webglTexture);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY);a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha);a.pixelStorei(a.UNPACK_ALIGNMENT,b.unpackAlignment);n=h(b.image,e.maxTextureSize);(1001!==b.wrapS||1001!==b.wrapT||1003!==b.minFilter&&1006!==b.minFilter)&&!1===l(n)&&(n instanceof HTMLImageElement||\nn instanceof HTMLCanvasElement||n instanceof ImageBitmap)&&(void 0===C&&(C=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\")),C.width=J.floorPowerOfTwo(n.width),C.height=J.floorPowerOfTwo(n.height),C.getContext(\"2d\").drawImage(n,0,0,C.width,C.height),console.warn(\"THREE.WebGLRenderer: image is not power of two (\"+n.width+\"x\"+n.height+\"). Resized to \"+C.width+\"x\"+C.height,n),n=C);k=l(n);r=f.convert(b.format);var p=f.convert(b.type);u(a.TEXTURE_2D,b,k);var O=b.mipmaps;if(b.isDepthTexture){var y=\na.DEPTH_COMPONENT;if(1015===b.type){if(!x)throw Error(\"Float Depth Texture only supported in WebGL2.0\");y=a.DEPTH_COMPONENT32F}else x&&(y=a.DEPTH_COMPONENT16);1026===b.format&&y===a.DEPTH_COMPONENT&&1012!==b.type&&1014!==b.type&&(console.warn(\"THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.\"),b.type=1012,p=f.convert(b.type));1027===b.format&&(y=a.DEPTH_STENCIL,1020!==b.type&&(console.warn(\"THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.\"),\nb.type=1020,p=f.convert(b.type)));c.texImage2D(a.TEXTURE_2D,0,y,n.width,n.height,0,r,p,null)}else if(b.isDataTexture)if(0<O.length&&k){for(var Q=0,w=O.length;Q<w;Q++)y=O[Q],c.texImage2D(a.TEXTURE_2D,Q,r,y.width,y.height,0,r,p,y.data);b.generateMipmaps=!1;q.__maxMipLevel=O.length-1}else c.texImage2D(a.TEXTURE_2D,0,r,n.width,n.height,0,r,p,n.data),q.__maxMipLevel=0;else if(b.isCompressedTexture){Q=0;for(w=O.length;Q<w;Q++)y=O[Q],1023!==b.format&&1022!==b.format?-1<c.getCompressedTextureFormats().indexOf(r)?\nc.compressedTexImage2D(a.TEXTURE_2D,Q,r,y.width,y.height,0,y.data):console.warn(\"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()\"):c.texImage2D(a.TEXTURE_2D,Q,r,y.width,y.height,0,r,p,y.data);q.__maxMipLevel=O.length-1}else if(0<O.length&&k){Q=0;for(w=O.length;Q<w;Q++)y=O[Q],c.texImage2D(a.TEXTURE_2D,Q,r,r,p,y);b.generateMipmaps=!1;q.__maxMipLevel=O.length-1}else c.texImage2D(a.TEXTURE_2D,0,r,r,p,n),q.__maxMipLevel=0;m(b,k)&&v(a.TEXTURE_2D,b,n.width,\nn.height);q.__version=b.version;if(b.onUpdate)b.onUpdate(b);return}c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_2D,q.__webglTexture)}function u(c,g,h){h?(a.texParameteri(c,a.TEXTURE_WRAP_S,f.convert(g.wrapS)),a.texParameteri(c,a.TEXTURE_WRAP_T,f.convert(g.wrapT)),a.texParameteri(c,a.TEXTURE_MAG_FILTER,f.convert(g.magFilter)),a.texParameteri(c,a.TEXTURE_MIN_FILTER,f.convert(g.minFilter))):(a.texParameteri(c,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(c,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),\n1001===g.wrapS&&1001===g.wrapT||console.warn(\"THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.\",g),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n(g.magFilter)),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n(g.minFilter)),1003!==g.minFilter&&1006!==g.minFilter&&console.warn(\"THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.\",g));!(h=b.get(\"EXT_texture_filter_anisotropic\"))||\n1015===g.type&&null===b.get(\"OES_texture_float_linear\")||1016===g.type&&null===b.get(\"OES_texture_half_float_linear\")||!(1<g.anisotropy||d.get(g).__currentAnisotropy)||(a.texParameterf(c,h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,e.getMaxAnisotropy())),d.get(g).__currentAnisotropy=g.anisotropy)}function p(b,e,g,h){var l=f.convert(e.texture.format),m=f.convert(e.texture.type);c.texImage2D(h,0,l,e.width,e.height,0,l,m,null);a.bindFramebuffer(a.FRAMEBUFFER,b);a.framebufferTexture2D(a.FRAMEBUFFER,\ng,h,d.get(e.texture).__webglTexture,0);a.bindFramebuffer(a.FRAMEBUFFER,null)}function w(b,c){a.bindRenderbuffer(a.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,\nb)):a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,c.width,c.height);a.bindRenderbuffer(a.RENDERBUFFER,null)}var x=\"undefined\"!==typeof WebGL2RenderingContext&&a instanceof WebGL2RenderingContext,A={},C;this.setTexture2D=k;this.setTextureCube=function(b,n){var q=d.get(b);if(6===b.image.length)if(0<b.version&&q.__version!==b.version){q.__image__webglTextureCube||(b.addEventListener(\"dispose\",t),q.__image__webglTextureCube=a.createTexture(),g.memory.textures++);c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_CUBE_MAP,\nq.__image__webglTextureCube);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY);n=b&&b.isCompressedTexture;for(var k=b.image[0]&&b.image[0].isDataTexture,r=[],p=0;6>p;p++)r[p]=n||k?k?b.image[p].image:b.image[p]:h(b.image[p],e.maxCubemapSize);var x=r[0],y=l(x),C=f.convert(b.format),w=f.convert(b.type);u(a.TEXTURE_CUBE_MAP,b,y);for(p=0;6>p;p++)if(n)for(var O,Q=r[p].mipmaps,A=0,B=Q.length;A<B;A++)O=Q[A],1023!==b.format&&1022!==b.format?-1<c.getCompressedTextureFormats().indexOf(C)?c.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+\np,A,C,O.width,O.height,0,O.data):console.warn(\"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()\"):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,A,C,O.width,O.height,0,C,w,O.data);else k?c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,C,r[p].width,r[p].height,0,C,w,r[p].data):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,C,C,w,r[p]);q.__maxMipLevel=n?Q.length-1:0;m(b,y)&&v(a.TEXTURE_CUBE_MAP,b,x.width,x.height);q.__version=b.version;if(b.onUpdate)b.onUpdate(b)}else c.activeTexture(a.TEXTURE0+\nn),c.bindTexture(a.TEXTURE_CUBE_MAP,q.__image__webglTextureCube)};this.setTextureCubeDynamic=function(b,e){c.activeTexture(a.TEXTURE0+e);c.bindTexture(a.TEXTURE_CUBE_MAP,d.get(b).__webglTexture)};this.setupRenderTarget=function(b){var e=d.get(b),f=d.get(b.texture);b.addEventListener(\"dispose\",q);f.__webglTexture=a.createTexture();g.memory.textures++;var h=!0===b.isWebGLRenderTargetCube,n=l(b);if(h){e.__webglFramebuffer=[];for(var t=0;6>t;t++)e.__webglFramebuffer[t]=a.createFramebuffer()}else e.__webglFramebuffer=\na.createFramebuffer();if(h){c.bindTexture(a.TEXTURE_CUBE_MAP,f.__webglTexture);u(a.TEXTURE_CUBE_MAP,b.texture,n);for(t=0;6>t;t++)p(e.__webglFramebuffer[t],b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+t);m(b.texture,n)&&v(a.TEXTURE_CUBE_MAP,b.texture,b.width,b.height);c.bindTexture(a.TEXTURE_CUBE_MAP,null)}else c.bindTexture(a.TEXTURE_2D,f.__webglTexture),u(a.TEXTURE_2D,b.texture,n),p(e.__webglFramebuffer,b,a.COLOR_ATTACHMENT0,a.TEXTURE_2D),m(b.texture,n)&&v(a.TEXTURE_2D,b.texture,b.width,b.height),\nc.bindTexture(a.TEXTURE_2D,null);if(b.depthBuffer){e=d.get(b);f=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(f)throw Error(\"target.depthTexture not supported in Cube render targets\");if(b&&b.isWebGLRenderTargetCube)throw Error(\"Depth Texture with cube render targets is not supported\");a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error(\"renderTarget.depthTexture must be an instance of THREE.DepthTexture\");d.get(b.depthTexture).__webglTexture&&\nb.depthTexture.image.width===b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0);k(b.depthTexture,0);e=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,e,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,e,0);else throw Error(\"Unknown depthTexture format\");\n}else if(f)for(e.__webglDepthbuffer=[],f=0;6>f;f++)a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer[f]),e.__webglDepthbuffer[f]=a.createRenderbuffer(),w(e.__webglDepthbuffer[f],b);else a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=a.createRenderbuffer(),w(e.__webglDepthbuffer,b);a.bindFramebuffer(a.FRAMEBUFFER,null)}};this.updateRenderTargetMipmap=function(b){var e=b.texture,f=l(b);if(m(e,f)){f=b.isWebGLRenderTargetCube?a.TEXTURE_CUBE_MAP:a.TEXTURE_2D;var g=d.get(e).__webglTexture;\nc.bindTexture(f,g);v(f,e,b.width,b.height);c.bindTexture(f,null)}}}function af(a,b){return{convert:function(c){if(1E3===c)return a.REPEAT;if(1001===c)return a.CLAMP_TO_EDGE;if(1002===c)return a.MIRRORED_REPEAT;if(1003===c)return a.NEAREST;if(1004===c)return a.NEAREST_MIPMAP_NEAREST;if(1005===c)return a.NEAREST_MIPMAP_LINEAR;if(1006===c)return a.LINEAR;if(1007===c)return a.LINEAR_MIPMAP_NEAREST;if(1008===c)return a.LINEAR_MIPMAP_LINEAR;if(1009===c)return a.UNSIGNED_BYTE;if(1017===c)return a.UNSIGNED_SHORT_4_4_4_4;\nif(1018===c)return a.UNSIGNED_SHORT_5_5_5_1;if(1019===c)return a.UNSIGNED_SHORT_5_6_5;if(1010===c)return a.BYTE;if(1011===c)return a.SHORT;if(1012===c)return a.UNSIGNED_SHORT;if(1013===c)return a.INT;if(1014===c)return a.UNSIGNED_INT;if(1015===c)return a.FLOAT;if(1016===c){var d=b.get(\"OES_texture_half_float\");if(null!==d)return d.HALF_FLOAT_OES}if(1021===c)return a.ALPHA;if(1022===c)return a.RGB;if(1023===c)return a.RGBA;if(1024===c)return a.LUMINANCE;if(1025===c)return a.LUMINANCE_ALPHA;if(1026===\nc)return a.DEPTH_COMPONENT;if(1027===c)return a.DEPTH_STENCIL;if(100===c)return a.FUNC_ADD;if(101===c)return a.FUNC_SUBTRACT;if(102===c)return a.FUNC_REVERSE_SUBTRACT;if(200===c)return a.ZERO;if(201===c)return a.ONE;if(202===c)return a.SRC_COLOR;if(203===c)return a.ONE_MINUS_SRC_COLOR;if(204===c)return a.SRC_ALPHA;if(205===c)return a.ONE_MINUS_SRC_ALPHA;if(206===c)return a.DST_ALPHA;if(207===c)return a.ONE_MINUS_DST_ALPHA;if(208===c)return a.DST_COLOR;if(209===c)return a.ONE_MINUS_DST_COLOR;if(210===\nc)return a.SRC_ALPHA_SATURATE;if(33776===c||33777===c||33778===c||33779===c)if(d=b.get(\"WEBGL_compressed_texture_s3tc\"),null!==d){if(33776===c)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===c)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===c)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===c)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===c||35841===c||35842===c||35843===c)if(d=b.get(\"WEBGL_compressed_texture_pvrtc\"),null!==d){if(35840===c)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===\nc)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===c)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===c)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===c&&(d=b.get(\"WEBGL_compressed_texture_etc1\"),null!==d))return d.COMPRESSED_RGB_ETC1_WEBGL;if(37808===c||37809===c||37810===c||37811===c||37812===c||37813===c||37814===c||37815===c||37816===c||37817===c||37818===c||37819===c||37820===c||37821===c)if(d=b.get(\"WEBGL_compressed_texture_astc\"),null!==d)return c;if(103===c||104===c)if(d=b.get(\"EXT_blend_minmax\"),\nnull!==d){if(103===c)return d.MIN_EXT;if(104===c)return d.MAX_EXT}return 1020===c&&(d=b.get(\"WEBGL_depth_texture\"),null!==d)?d.UNSIGNED_INT_24_8_WEBGL:0}}}function Ub(){H.call(this);this.type=\"Group\"}function Z(a,b,c,d){Ra.call(this);this.type=\"PerspectiveCamera\";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Hc(a){Z.call(this);\nthis.cameras=a||[]}function bf(a){function b(){return null!==e&&!0===e.isPresenting}function c(){if(b()){var c=e.getEyeParameters(\"left\"),f=c.renderWidth;c=c.renderHeight;w=a.getPixelRatio();y=a.getSize();a.setDrawingBufferSize(2*f,c,1);A.start()}else d.enabled&&(a.setDrawingBufferSize(y.width,y.height,w),A.stop())}var d=this,e=null,f=null,g=null,h=[],l=new R,m=new R;\"undefined\"!==typeof window&&\"VRFrameData\"in window&&(f=new window.VRFrameData,window.addEventListener(\"vrdisplaypresentchange\",c,!1));\nvar v=new R,n=new ca,t=new p,q=new Z;q.bounds=new W(0,0,.5,1);q.layers.enable(1);var k=new Z;k.bounds=new W(.5,0,.5,1);k.layers.enable(2);var u=new Hc([q,k]);u.layers.enable(1);u.layers.enable(2);var y,w,x=!1;this.enabled=!1;this.userHeight=1.6;this.getController=function(a){var b=h[a];void 0===b&&(b=new Ub,b.matrixAutoUpdate=!1,b.visible=!1,h[a]=b);return b};this.getDevice=function(){return e};this.setDevice=function(a){void 0!==a&&(e=a);A.setContext(a)};this.setPoseTarget=function(a){void 0!==a&&\n(g=a)};this.getCamera=function(a){if(null===e)return a.position.set(0,d.userHeight,0),a;e.depthNear=a.near;e.depthFar=a.far;e.getFrameData(f);var b=e.stageParameters;b?l.fromArray(b.sittingToStandingTransform):l.makeTranslation(0,d.userHeight,0);b=f.pose;var c=null!==g?g:a;c.matrix.copy(l);c.matrix.decompose(c.position,c.quaternion,c.scale);null!==b.orientation&&(n.fromArray(b.orientation),c.quaternion.multiply(n));null!==b.position&&(n.setFromRotationMatrix(l),t.fromArray(b.position),t.applyQuaternion(n),\nc.position.add(t));c.updateMatrixWorld();if(!1===e.isPresenting)return a;q.near=a.near;k.near=a.near;q.far=a.far;k.far=a.far;u.matrixWorld.copy(a.matrixWorld);u.matrixWorldInverse.copy(a.matrixWorldInverse);q.matrixWorldInverse.fromArray(f.leftViewMatrix);k.matrixWorldInverse.fromArray(f.rightViewMatrix);m.getInverse(l);q.matrixWorldInverse.multiply(m);k.matrixWorldInverse.multiply(m);a=c.parent;null!==a&&(v.getInverse(a.matrixWorld),q.matrixWorldInverse.multiply(v),k.matrixWorldInverse.multiply(v));\nq.matrixWorld.getInverse(q.matrixWorldInverse);k.matrixWorld.getInverse(k.matrixWorldInverse);q.projectionMatrix.fromArray(f.leftProjectionMatrix);k.projectionMatrix.fromArray(f.rightProjectionMatrix);u.projectionMatrix.copy(q.projectionMatrix);a=e.getLayers();a.length&&(a=a[0],null!==a.leftBounds&&4===a.leftBounds.length&&q.bounds.fromArray(a.leftBounds),null!==a.rightBounds&&4===a.rightBounds.length&&k.bounds.fromArray(a.rightBounds));a:for(a=0;a<h.length;a++){b=h[a];b:{c=a;for(var r=navigator.getGamepads&&\nnavigator.getGamepads(),p=0,y=0,w=r.length;p<w;p++){var C=r[p];if(C&&(\"Daydream Controller\"===C.id||\"Gear VR Controller\"===C.id||\"Oculus Go Controller\"===C.id||\"OpenVR Gamepad\"===C.id||C.id.startsWith(\"Oculus Touch\")||C.id.startsWith(\"Spatial Controller\"))){if(y===c){c=C;break b}y++}}c=void 0}if(void 0!==c&&void 0!==c.pose){if(null===c.pose)break a;r=c.pose;!1===r.hasPosition&&b.position.set(.2,-.6,-.05);null!==r.position&&b.position.fromArray(r.position);null!==r.orientation&&b.quaternion.fromArray(r.orientation);\nb.matrix.compose(b.position,b.quaternion,b.scale);b.matrix.premultiply(l);b.matrix.decompose(b.position,b.quaternion,b.scale);b.matrixWorldNeedsUpdate=!0;b.visible=!0;r=\"Daydream Controller\"===c.id?0:1;x!==c.buttons[r].pressed&&((x=c.buttons[r].pressed)?b.dispatchEvent({type:\"selectstart\"}):(b.dispatchEvent({type:\"selectend\"}),b.dispatchEvent({type:\"select\"})))}else b.visible=!1}return u};this.getStandingMatrix=function(){return l};this.isPresenting=b;var A=new Vd;this.setAnimationLoop=function(a){A.setAnimationLoop(a)};\nthis.submitFrame=function(){b()&&e.submitFrame()};this.dispose=function(){\"undefined\"!==typeof window&&window.removeEventListener(\"vrdisplaypresentchange\",c)}}function Ng(a){function b(){return null!==h&&null!==l}function c(a){var b=v[n.indexOf(a.inputSource)];b&&b.dispatchEvent({type:a.type})}function d(){a.setFramebuffer(null);p.stop()}function e(a,b){null===b?a.matrixWorld.copy(a.matrix):a.matrixWorld.multiplyMatrices(b.matrixWorld,a.matrix);a.matrixWorldInverse.getInverse(a.matrixWorld)}var f=\na.context,g=null,h=null,l=null,m=null,v=[],n=[],t=new Z;t.layers.enable(1);t.viewport=new W;var q=new Z;q.layers.enable(2);q.viewport=new W;var k=new Hc([t,q]);k.layers.enable(1);k.layers.enable(2);this.enabled=!1;this.getController=function(a){var b=v[a];void 0===b&&(b=new Ub,b.matrixAutoUpdate=!1,b.visible=!1,v[a]=b);return b};this.getDevice=function(){return g};this.setDevice=function(a){void 0!==a&&(g=a);f.setCompatibleXRDevice(a)};this.setSession=function(b,e){h=b;null!==h&&(h.addEventListener(\"select\",\nc),h.addEventListener(\"selectstart\",c),h.addEventListener(\"selectend\",c),h.addEventListener(\"end\",d),h.baseLayer=new XRWebGLLayer(h,f),h.requestFrameOfReference(e.frameOfReferenceType).then(function(b){l=b;a.setFramebuffer(h.baseLayer.framebuffer);p.setContext(h);p.start()}),n=h.getInputSources(),h.addEventListener(\"inputsourceschange\",function(){n=h.getInputSources();console.log(n)}))};this.getCamera=function(a){if(b()){var c=a.parent,d=k.cameras;e(k,c);for(var f=0;f<d.length;f++)e(d[f],c);a.matrixWorld.copy(k.matrixWorld);\na=a.children;f=0;for(c=a.length;f<c;f++)a[f].updateMatrixWorld(!0);return k}return a};this.isPresenting=b;var u=null,p=new Vd;p.setAnimationLoop(function(a,b){m=b.getDevicePose(l);if(null!==m)for(var c=h.baseLayer,d=b.views,e=0;e<d.length;e++){var f=d[e],g=c.getViewport(f),t=m.getViewMatrix(f),q=k.cameras[e];q.matrix.fromArray(t).getInverse(q.matrix);q.projectionMatrix.fromArray(f.projectionMatrix);q.viewport.set(g.x,g.y,g.width,g.height);0===e&&(k.matrix.copy(q.matrix),k.projectionMatrix.copy(q.projectionMatrix))}for(e=\n0;e<v.length;e++){c=v[e];if(d=n[e])if(d=b.getInputPose(d,l),null!==d){c.matrix.elements=d.pointerMatrix;c.matrix.decompose(c.position,c.rotation,c.scale);c.visible=!0;continue}c.visible=!1}u&&u(a)});this.setAnimationLoop=function(a){u=a};this.dispose=function(){};this.getStandingMatrix=function(){console.warn(\"THREE.WebXRManager: getStandingMatrix() is no longer needed.\");return new THREE.Matrix4};this.submitFrame=function(){}}function ae(a){function b(){ma=new Pf(F);ma.get(\"WEBGL_depth_texture\");\nma.get(\"OES_texture_float\");ma.get(\"OES_texture_float_linear\");ma.get(\"OES_texture_half_float\");ma.get(\"OES_texture_half_float_linear\");ma.get(\"OES_standard_derivatives\");ma.get(\"OES_element_index_uint\");ma.get(\"ANGLE_instanced_arrays\");ia=new af(F,ma);Sa=new Nf(F,ma,a);aa=new Lg(F,ma,ia);aa.scissor(S.copy(ba).multiplyScalar(V));aa.viewport(db.copy(N).multiplyScalar(V));hb=new Sf(F);Aa=new Ag;Z=new Mg(F,ma,aa,Aa,Sa,ia,hb);ja=new Gf(F);qa=new Qf(F,ja,hb);pa=new Vf(qa,hb);va=new Uf(F);na=new zg(U,ma,\nSa);ra=new Eg;oa=new Jg;la=new Lf(U,aa,pa,O);wa=new Mf(F,ma,hb);xa=new Rf(F,ma,hb);ya=new Kg(U,F,aa,Z,Sa);hb.programs=na.programs;U.context=F;U.capabilities=Sa;U.extensions=ma;U.properties=Aa;U.renderLists=ra;U.state=aa;U.info=hb}function c(a){a.preventDefault();console.log(\"THREE.WebGLRenderer: Context Lost.\");G=!0}function d(){console.log(\"THREE.WebGLRenderer: Context Restored.\");G=!1;b()}function e(a){a=a.target;a.removeEventListener(\"dispose\",e);f(a);Aa.remove(a)}function f(a){var b=Aa.get(a).program;\na.program=void 0;void 0!==b&&na.releaseProgram(b)}function g(a,b,c){a.render(function(a){U.renderBufferImmediate(a,b,c)})}function h(a,b,c){if(!1!==a.visible){if(a.layers.test(b.layers))if(a.isLight)z.pushLight(a),a.castShadow&&z.pushShadow(a);else if(a.isSprite)a.frustumCulled&&!da.intersectsSprite(a)||z.pushSprite(a);else if(a.isImmediateRenderObject)c&&Tb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(ud),B.push(a,null,a.material,Tb.z,null);else if(a.isMesh||a.isLine||a.isPoints)if(a.isSkinnedMesh&&\na.skeleton.update(),!a.frustumCulled||da.intersectsObject(a)){c&&Tb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(ud);var d=pa.update(a),e=a.material;if(Array.isArray(e))for(var f=d.groups,g=0,l=f.length;g<l;g++){var m=f[g],n=e[m.materialIndex];n&&n.visible&&B.push(a,d,n,Tb.z,m)}else e.visible&&B.push(a,d,e,Tb.z,null)}a=a.children;g=0;for(l=a.length;g<l;g++)h(a[g],b,c)}}function l(a,b,c,d){for(var e=0,f=a.length;e<f;e++){var g=a[e],h=g.object,l=g.geometry,n=void 0===d?g.material:d;g=g.group;if(c.isArrayCamera){Pb=\nc;for(var v=c.cameras,t=0,q=v.length;t<q;t++){var k=v[t];if(h.layers.test(k.layers)){if(\"viewport\"in k)aa.viewport(db.copy(k.viewport));else{var r=k.bounds;aa.viewport(db.set(r.x*Y,r.y*fa,r.z*Y,r.w*fa).multiplyScalar(V))}m(h,b,k,l,n,g)}}}else Pb=null,m(h,b,c,l,n,g)}}function m(a,b,c,d,e,f){a.onBeforeRender(U,b,c,d,e,f);z=oa.get(b,Pb||c);a.modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,a.matrixWorld);a.normalMatrix.getNormalMatrix(a.modelViewMatrix);if(a.isImmediateRenderObject){var h=a.isMesh&&\n0>a.matrixWorld.determinant();aa.setMaterial(e,h);h=n(c,b.fog,e,a);I=\"\";g(a,h,e)}else U.renderBufferDirect(c,b.fog,d,e,a,f);a.onAfterRender(U,b,c,d,e,f);z=oa.get(b,Pb||c)}function v(a,b,c){var d=Aa.get(a),g=z.state.lights;c=na.getParameters(a,g.state,z.state.shadowsArray,b,X.numPlanes,X.numIntersection,c);var h=na.getProgramCode(a,c),l=d.program,m=!0;if(void 0===l)a.addEventListener(\"dispose\",e);else if(l.code!==h)f(a);else{if(d.lightsHash!==g.state.hash)Aa.update(a,\"lightsHash\",g.state.hash);else if(void 0!==\nc.shaderID)return;m=!1}m&&(c.shaderID?(l=tb[c.shaderID],d.shader={name:a.type,uniforms:Ba.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}):d.shader={name:a.type,uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader},a.onBeforeCompile(d.shader,U),l=na.acquireProgram(a,d.shader,c,h),d.program=l,a.program=l);c=l.getAttributes();if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h<U.maxMorphTargets;h++)0<=c[\"morphTarget\"+h]&&a.numSupportedMorphTargets++;\nif(a.morphNormals)for(h=a.numSupportedMorphNormals=0;h<U.maxMorphNormals;h++)0<=c[\"morphNormal\"+h]&&a.numSupportedMorphNormals++;c=d.shader.uniforms;if(!a.isShaderMaterial&&!a.isRawShaderMaterial||!0===a.clipping)d.numClippingPlanes=X.numPlanes,d.numIntersection=X.numIntersection,c.clippingPlanes=X.uniform;d.fog=b;d.lightsHash=g.state.hash;a.lights&&(c.ambientLightColor.value=g.state.ambient,c.directionalLights.value=g.state.directional,c.spotLights.value=g.state.spot,c.rectAreaLights.value=g.state.rectArea,\nc.pointLights.value=g.state.point,c.hemisphereLights.value=g.state.hemi,c.directionalShadowMap.value=g.state.directionalShadowMap,c.directionalShadowMatrix.value=g.state.directionalShadowMatrix,c.spotShadowMap.value=g.state.spotShadowMap,c.spotShadowMatrix.value=g.state.spotShadowMatrix,c.pointShadowMap.value=g.state.pointShadowMap,c.pointShadowMatrix.value=g.state.pointShadowMatrix);a=d.program.getUniforms();a=eb.seqWithValue(a.seq,c);d.uniformsList=a}function n(a,b,c,d){$d=0;var e=Aa.get(c),f=z.state.lights;\nca&&(ha||a!==L)&&X.setState(c.clippingPlanes,c.clipIntersection,c.clipShadows,a,e,a===L&&c.id===P);!1===c.needsUpdate&&(void 0===e.program?c.needsUpdate=!0:c.fog&&e.fog!==b?c.needsUpdate=!0:c.lights&&e.lightsHash!==f.state.hash?c.needsUpdate=!0:void 0===e.numClippingPlanes||e.numClippingPlanes===X.numPlanes&&e.numIntersection===X.numIntersection||(c.needsUpdate=!0));c.needsUpdate&&(v(c,b,d),c.needsUpdate=!1);var g=!1,h=!1,l=!1;f=e.program;var m=f.getUniforms(),n=e.shader.uniforms;aa.useProgram(f.program)&&\n(l=h=g=!0);c.id!==P&&(P=c.id,h=!0);if(g||a!==L){m.setValue(F,\"projectionMatrix\",a.projectionMatrix);Sa.logarithmicDepthBuffer&&m.setValue(F,\"logDepthBufFC\",2/(Math.log(a.far+1)/Math.LN2));L!==(Pb||a)&&(L=Pb||a,l=h=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||c.isMeshStandardMaterial||c.envMap)g=m.map.cameraPosition,void 0!==g&&g.setValue(F,Tb.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||\nc.skinning)&&m.setValue(F,\"viewMatrix\",a.matrixWorldInverse)}if(c.skinning&&(m.setOptional(F,d,\"bindMatrix\"),m.setOptional(F,d,\"bindMatrixInverse\"),a=d.skeleton))if(g=a.bones,Sa.floatVertexTextures){if(void 0===a.boneTexture){g=Math.sqrt(4*g.length);g=J.ceilPowerOfTwo(g);g=Math.max(g,4);var r=new Float32Array(g*g*4);r.set(a.boneMatrices);var u=new lb(r,g,g,1023,1015);u.needsUpdate=!0;a.boneMatrices=r;a.boneTexture=u;a.boneTextureSize=g}m.setValue(F,\"boneTexture\",a.boneTexture);m.setValue(F,\"boneTextureSize\",\na.boneTextureSize)}else m.setOptional(F,a,\"boneMatrices\");h&&(m.setValue(F,\"toneMappingExposure\",U.toneMappingExposure),m.setValue(F,\"toneMappingWhitePoint\",U.toneMappingWhitePoint),c.lights&&(h=l,n.ambientLightColor.needsUpdate=h,n.directionalLights.needsUpdate=h,n.pointLights.needsUpdate=h,n.spotLights.needsUpdate=h,n.rectAreaLights.needsUpdate=h,n.hemisphereLights.needsUpdate=h),b&&c.fog&&(n.fogColor.value=b.color,b.isFog?(n.fogNear.value=b.near,n.fogFar.value=b.far):b.isFogExp2&&(n.fogDensity.value=\nb.density)),c.isMeshBasicMaterial?t(n,c):c.isMeshLambertMaterial?(t(n,c),c.emissiveMap&&(n.emissiveMap.value=c.emissiveMap)):c.isMeshPhongMaterial?(t(n,c),c.isMeshToonMaterial?(q(n,c),c.gradientMap&&(n.gradientMap.value=c.gradientMap)):q(n,c)):c.isMeshStandardMaterial?(t(n,c),c.isMeshPhysicalMaterial?(k(n,c),n.reflectivity.value=c.reflectivity,n.clearCoat.value=c.clearCoat,n.clearCoatRoughness.value=c.clearCoatRoughness):k(n,c)):c.isMeshDepthMaterial?(t(n,c),c.displacementMap&&(n.displacementMap.value=\nc.displacementMap,n.displacementScale.value=c.displacementScale,n.displacementBias.value=c.displacementBias)):c.isMeshDistanceMaterial?(t(n,c),c.displacementMap&&(n.displacementMap.value=c.displacementMap,n.displacementScale.value=c.displacementScale,n.displacementBias.value=c.displacementBias),n.referencePosition.value.copy(c.referencePosition),n.nearDistance.value=c.nearDistance,n.farDistance.value=c.farDistance):c.isMeshNormalMaterial?(t(n,c),c.bumpMap&&(n.bumpMap.value=c.bumpMap,n.bumpScale.value=\nc.bumpScale,1===c.side&&(n.bumpScale.value*=-1)),c.normalMap&&(n.normalMap.value=c.normalMap,n.normalScale.value.copy(c.normalScale),1===c.side&&n.normalScale.value.negate()),c.displacementMap&&(n.displacementMap.value=c.displacementMap,n.displacementScale.value=c.displacementScale,n.displacementBias.value=c.displacementBias)):c.isLineBasicMaterial?(n.diffuse.value=c.color,n.opacity.value=c.opacity,c.isLineDashedMaterial&&(n.dashSize.value=c.dashSize,n.totalSize.value=c.dashSize+c.gapSize,n.scale.value=\nc.scale)):c.isPointsMaterial?(n.diffuse.value=c.color,n.opacity.value=c.opacity,n.size.value=c.size*V,n.scale.value=.5*fa,n.map.value=c.map,null!==c.map&&(!0===c.map.matrixAutoUpdate&&c.map.updateMatrix(),n.uvTransform.value.copy(c.map.matrix))):c.isShadowMaterial&&(n.color.value=c.color,n.opacity.value=c.opacity),void 0!==n.ltc_1&&(n.ltc_1.value=K.LTC_1),void 0!==n.ltc_2&&(n.ltc_2.value=K.LTC_2),eb.upload(F,e.uniformsList,n,U));c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&(eb.upload(F,e.uniformsList,\nn,U),c.uniformsNeedUpdate=!1);m.setValue(F,\"modelViewMatrix\",d.modelViewMatrix);m.setValue(F,\"normalMatrix\",d.normalMatrix);m.setValue(F,\"modelMatrix\",d.matrixWorld);return f}function t(a,b){a.opacity.value=b.opacity;b.color&&(a.diffuse.value=b.color);b.emissive&&a.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity);b.map&&(a.map.value=b.map);b.alphaMap&&(a.alphaMap.value=b.alphaMap);b.specularMap&&(a.specularMap.value=b.specularMap);b.envMap&&(a.envMap.value=b.envMap,a.flipEnvMap.value=\nb.envMap&&b.envMap.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=Aa.get(b.envMap).__maxMipLevel);b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);if(b.map)var c=b.map;else b.specularMap?c=b.specularMap:b.displacementMap?c=b.displacementMap:b.normalMap?c=b.normalMap:b.bumpMap?c=b.bumpMap:b.roughnessMap?c=b.roughnessMap:\nb.metalnessMap?c=b.metalnessMap:b.alphaMap?c=b.alphaMap:b.emissiveMap&&(c=b.emissiveMap);void 0!==c&&(c.isWebGLRenderTarget&&(c=c.texture),!0===c.matrixAutoUpdate&&c.updateMatrix(),a.uvTransform.value.copy(c.matrix))}function q(a,b){a.specular.value=b.specular;a.shininess.value=Math.max(b.shininess,1E-4);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,\na.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias)}function k(a,b){a.roughness.value=b.roughness;a.metalness.value=b.metalness;b.roughnessMap&&(a.roughnessMap.value=b.roughnessMap);b.metalnessMap&&(a.metalnessMap.value=b.metalnessMap);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,\na.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}console.log(\"THREE.WebGLRenderer\",\"94\");a=a||{};var u=void 0!==a.canvas?a.canvas:document.createElementNS(\"http://www.w3.org/1999/xhtml\",\n\"canvas\"),y=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,x=void 0!==a.depth?a.depth:!0,A=void 0!==a.stencil?a.stencil:!0,C=void 0!==a.antialias?a.antialias:!1,O=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Q=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,M=void 0!==a.powerPreference?a.powerPreference:\"default\",B=null,z=null;this.domElement=u;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=\n[];this.localClippingEnabled=!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var U=this,G=!1,H=null,D=null,E=null,P=-1,I=\"\",L=null,Pb=null,db=new W,S=new W,T=null,$d=0,Y=u.width,fa=u.height,V=1,N=new W(0,0,Y,fa),ba=new W(0,0,Y,fa),ea=!1,da=new td,X=new Of,ca=!1,ha=!1,ud=new R,Tb=new p;try{w={alpha:w,depth:x,stencil:A,antialias:C,premultipliedAlpha:O,\npreserveDrawingBuffer:Q,powerPreference:M};u.addEventListener(\"webglcontextlost\",c,!1);u.addEventListener(\"webglcontextrestored\",d,!1);var F=y||u.getContext(\"webgl\",w)||u.getContext(\"experimental-webgl\",w);if(null===F){if(null!==u.getContext(\"webgl\"))throw Error(\"Error creating WebGL context with your selected attributes.\");throw Error(\"Error creating WebGL context.\");}void 0===F.getShaderPrecisionFormat&&(F.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Og){console.error(\"THREE.WebGLRenderer: \"+\nOg.message)}var ma,Sa,aa,hb,Aa,Z,ja,qa,pa,na,ra,oa,la,va,wa,xa,ya,ia;b();var ka=\"xr\"in navigator?new Ng(U):new bf(U);this.vr=ka;var za=new $e(U,pa,Sa.maxTextureSize);this.shadowMap=za;this.getContext=function(){return F};this.getContextAttributes=function(){return F.getContextAttributes()};this.forceContextLoss=function(){var a=ma.get(\"WEBGL_lose_context\");a&&a.loseContext()};this.forceContextRestore=function(){var a=ma.get(\"WEBGL_lose_context\");a&&a.restoreContext()};this.getPixelRatio=function(){return V};\nthis.setPixelRatio=function(a){void 0!==a&&(V=a,this.setSize(Y,fa,!1))};this.getSize=function(){return{width:Y,height:fa}};this.setSize=function(a,b,c){ka.isPresenting()?console.warn(\"THREE.WebGLRenderer: Can't change size while VR device is presenting.\"):(Y=a,fa=b,u.width=a*V,u.height=b*V,!1!==c&&(u.style.width=a+\"px\",u.style.height=b+\"px\"),this.setViewport(0,0,a,b))};this.getDrawingBufferSize=function(){return{width:Y*V,height:fa*V}};this.setDrawingBufferSize=function(a,b,c){Y=a;fa=b;V=c;u.width=\na*c;u.height=b*c;this.setViewport(0,0,a,b)};this.getCurrentViewport=function(){return db};this.setViewport=function(a,b,c,d){N.set(a,fa-b-d,c,d);aa.viewport(db.copy(N).multiplyScalar(V))};this.setScissor=function(a,b,c,d){ba.set(a,fa-b-d,c,d);aa.scissor(S.copy(ba).multiplyScalar(V))};this.setScissorTest=function(a){aa.setScissorTest(ea=a)};this.getClearColor=function(){return la.getClearColor()};this.setClearColor=function(){la.setClearColor.apply(la,arguments)};this.getClearAlpha=function(){return la.getClearAlpha()};\nthis.setClearAlpha=function(){la.setClearAlpha.apply(la,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=F.COLOR_BUFFER_BIT;if(void 0===b||b)d|=F.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=F.STENCIL_BUFFER_BIT;F.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.dispose=function(){u.removeEventListener(\"webglcontextlost\",\nc,!1);u.removeEventListener(\"webglcontextrestored\",d,!1);ra.dispose();oa.dispose();Aa.dispose();pa.dispose();ka.dispose();ta.stop()};this.renderBufferImmediate=function(a,b,c){aa.initAttributes();var d=Aa.get(a);a.hasPositions&&!d.position&&(d.position=F.createBuffer());a.hasNormals&&!d.normal&&(d.normal=F.createBuffer());a.hasUvs&&!d.uv&&(d.uv=F.createBuffer());a.hasColors&&!d.color&&(d.color=F.createBuffer());b=b.getAttributes();a.hasPositions&&(F.bindBuffer(F.ARRAY_BUFFER,d.position),F.bufferData(F.ARRAY_BUFFER,\na.positionArray,F.DYNAMIC_DRAW),aa.enableAttribute(b.position),F.vertexAttribPointer(b.position,3,F.FLOAT,!1,0,0));if(a.hasNormals){F.bindBuffer(F.ARRAY_BUFFER,d.normal);if(!c.isMeshPhongMaterial&&!c.isMeshStandardMaterial&&!c.isMeshNormalMaterial&&!0===c.flatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,l=(g[e+1]+g[e+4]+g[e+7])/3,m=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=l;g[e+2]=m;g[e+3]=h;g[e+4]=l;g[e+5]=m;g[e+6]=h;g[e+7]=l;g[e+8]=m}F.bufferData(F.ARRAY_BUFFER,\na.normalArray,F.DYNAMIC_DRAW);aa.enableAttribute(b.normal);F.vertexAttribPointer(b.normal,3,F.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(F.bindBuffer(F.ARRAY_BUFFER,d.uv),F.bufferData(F.ARRAY_BUFFER,a.uvArray,F.DYNAMIC_DRAW),aa.enableAttribute(b.uv),F.vertexAttribPointer(b.uv,2,F.FLOAT,!1,0,0));a.hasColors&&0!==c.vertexColors&&(F.bindBuffer(F.ARRAY_BUFFER,d.color),F.bufferData(F.ARRAY_BUFFER,a.colorArray,F.DYNAMIC_DRAW),aa.enableAttribute(b.color),F.vertexAttribPointer(b.color,3,F.FLOAT,!1,0,0));aa.disableUnusedAttributes();\nF.drawArrays(F.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){var g=e.isMesh&&0>e.matrixWorld.determinant();aa.setMaterial(d,g);var h=n(a,b,d,e);a=c.id+\"_\"+h.id+\"_\"+(!0===d.wireframe);var l=!1;a!==I&&(I=a,l=!0);e.morphTargetInfluences&&(va.update(e,c,d,h),l=!0);g=c.index;var m=c.attributes.position;b=1;!0===d.wireframe&&(g=qa.getWireframeAttribute(c),b=2);a=wa;if(null!==g){var v=ja.get(g);a=xa;a.setIndex(v)}if(l){if(c&&c.isInstancedBufferGeometry&&null===ma.get(\"ANGLE_instanced_arrays\"))console.error(\"THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.\");\nelse{aa.initAttributes();l=c.attributes;h=h.getAttributes();var t=d.defaultAttributeValues;for(A in h){var q=h[A];if(0<=q){var k=l[A];if(void 0!==k){var r=k.normalized,u=k.itemSize,p=ja.get(k);if(void 0!==p){var y=p.buffer,x=p.type;p=p.bytesPerElement;if(k.isInterleavedBufferAttribute){var w=k.data,C=w.stride;k=k.offset;w&&w.isInstancedInterleavedBuffer?(aa.enableAttributeAndDivisor(q,w.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=w.meshPerAttribute*w.count)):aa.enableAttribute(q);\nF.bindBuffer(F.ARRAY_BUFFER,y);F.vertexAttribPointer(q,u,x,r,C*p,k*p)}else k.isInstancedBufferAttribute?(aa.enableAttributeAndDivisor(q,k.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=k.meshPerAttribute*k.count)):aa.enableAttribute(q),F.bindBuffer(F.ARRAY_BUFFER,y),F.vertexAttribPointer(q,u,x,r,0,0)}}else if(void 0!==t&&(r=t[A],void 0!==r))switch(r.length){case 2:F.vertexAttrib2fv(q,r);break;case 3:F.vertexAttrib3fv(q,r);break;case 4:F.vertexAttrib4fv(q,r);break;default:F.vertexAttrib1fv(q,\nr)}}}aa.disableUnusedAttributes()}null!==g&&F.bindBuffer(F.ELEMENT_ARRAY_BUFFER,v.buffer)}v=Infinity;null!==g?v=g.count:void 0!==m&&(v=m.count);g=c.drawRange.start*b;m=null!==f?f.start*b:0;var A=Math.max(g,m);f=Math.max(0,Math.min(v,g+c.drawRange.count*b,m+(null!==f?f.count*b:Infinity))-1-A+1);if(0!==f){if(e.isMesh)if(!0===d.wireframe)aa.setLineWidth(d.wireframeLinewidth*(null===D?V:1)),a.setMode(F.LINES);else switch(e.drawMode){case 0:a.setMode(F.TRIANGLES);break;case 1:a.setMode(F.TRIANGLE_STRIP);\nbreak;case 2:a.setMode(F.TRIANGLE_FAN)}else e.isLine?(d=d.linewidth,void 0===d&&(d=1),aa.setLineWidth(d*(null===D?V:1)),e.isLineSegments?a.setMode(F.LINES):e.isLineLoop?a.setMode(F.LINE_LOOP):a.setMode(F.LINE_STRIP)):e.isPoints&&a.setMode(F.POINTS);c&&c.isInstancedBufferGeometry?0<c.maxInstancedCount&&a.renderInstances(c,A,f):a.render(A,f)}};this.compile=function(a,b){z=oa.get(a,b);z.init();a.traverse(function(a){a.isLight&&(z.pushLight(a),a.castShadow&&z.pushShadow(a))});z.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=\n0;c<b.material.length;c++)v(b.material[c],a.fog,b);else v(b.material,a.fog,b)})};var ua=null,ta=new Vd;ta.setAnimationLoop(function(a){ka.isPresenting()||ua&&ua(a)});\"undefined\"!==typeof window&&ta.setContext(window);this.setAnimationLoop=function(a){ua=a;ka.setAnimationLoop(a);ta.start()};this.render=function(a,b,c,d){if(!b||!b.isCamera)console.error(\"THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.\");else if(!G){I=\"\";P=-1;L=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===\nb.parent&&b.updateMatrixWorld();ka.enabled&&(b=ka.getCamera(b));z=oa.get(a,b);z.init();a.onBeforeRender(U,a,b,c);ud.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);da.setFromMatrix(ud);ha=this.localClippingEnabled;ca=X.init(this.clippingPlanes,ha,b);B=ra.get(a,b);B.init();h(a,b,U.sortObjects);!0===U.sortObjects&&B.sort();ca&&X.beginShadows();za.render(z.state.shadowsArray,a,b);z.setupLights(b);ca&&X.endShadows();this.info.autoReset&&this.info.reset();void 0===c&&(c=null);this.setRenderTarget(c);\nla.render(B,a,b,d);d=B.opaque;var e=B.transparent;if(a.overrideMaterial){var f=a.overrideMaterial;d.length&&l(d,a,b,f);e.length&&l(e,a,b,f)}else d.length&&l(d,a,b),e.length&&l(e,a,b);ya.render(z.state.spritesArray,a,b);c&&Z.updateRenderTargetMipmap(c);aa.buffers.depth.setTest(!0);aa.buffers.depth.setMask(!0);aa.buffers.color.setMask(!0);aa.setPolygonOffset(!1);a.onAfterRender(U,a,b);ka.enabled&&ka.submitFrame();z=B=null}};this.allocTextureUnit=function(){var a=$d;a>=Sa.maxTextures&&console.warn(\"THREE.WebGLRenderer: Trying to use \"+\na+\" texture units while this GPU supports only \"+Sa.maxTextures);$d+=1;return a};this.setTexture2D=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTarget&&(a||(console.warn(\"THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead.\"),a=!0),b=b.texture);Z.setTexture2D(b,c)}}();this.setTexture=function(){var a=!1;return function(b,c){a||(console.warn(\"THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead.\"),a=!0);Z.setTexture2D(b,\nc)}}();this.setTextureCube=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTargetCube&&(a||(console.warn(\"THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead.\"),a=!0),b=b.texture);b&&b.isCubeTexture||Array.isArray(b.image)&&6===b.image.length?Z.setTextureCube(b,c):Z.setTextureCubeDynamic(b,c)}}();this.setFramebuffer=function(a){H=a};this.getRenderTarget=function(){return D};this.setRenderTarget=function(a){(D=a)&&void 0===Aa.get(a).__webglFramebuffer&&\nZ.setupRenderTarget(a);var b=H,c=!1;a?(b=Aa.get(a).__webglFramebuffer,a.isWebGLRenderTargetCube&&(b=b[a.activeCubeFace],c=!0),db.copy(a.viewport),S.copy(a.scissor),T=a.scissorTest):(db.copy(N).multiplyScalar(V),S.copy(ba).multiplyScalar(V),T=ea);E!==b&&(F.bindFramebuffer(F.FRAMEBUFFER,b),E=b);aa.viewport(db);aa.scissor(S);aa.setScissorTest(T);c&&(c=Aa.get(a.texture),F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,c.__webglTexture,a.activeMipMapLevel))};\nthis.readRenderTargetPixels=function(a,b,c,d,e,f){if(a&&a.isWebGLRenderTarget){var g=Aa.get(a).__webglFramebuffer;if(g){var h=!1;g!==E&&(F.bindFramebuffer(F.FRAMEBUFFER,g),h=!0);try{var l=a.texture,m=l.format,n=l.type;1023!==m&&ia.convert(m)!==F.getParameter(F.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.\"):1009===n||ia.convert(n)===F.getParameter(F.IMPLEMENTATION_COLOR_READ_TYPE)||1015===\nn&&(ma.get(\"OES_texture_float\")||ma.get(\"WEBGL_color_buffer_float\"))||1016===n&&ma.get(\"EXT_color_buffer_half_float\")?F.checkFramebufferStatus(F.FRAMEBUFFER)===F.FRAMEBUFFER_COMPLETE?0<=b&&b<=a.width-d&&0<=c&&c<=a.height-e&&F.readPixels(b,c,d,e,ia.convert(m),ia.convert(n),f):console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.\"):console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.\")}finally{h&&\nF.bindFramebuffer(F.FRAMEBUFFER,E)}}}else console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.\")};this.copyFramebufferToTexture=function(a,b,c){var d=b.image.width,e=b.image.height,f=ia.convert(b.format);this.setTexture2D(b,0);F.copyTexImage2D(F.TEXTURE_2D,c||0,f,a.x,a.y,d,e,0)};this.copyTextureToTexture=function(a,b,c,d){var e=b.image.width,f=b.image.height,g=ia.convert(c.format),h=ia.convert(c.type);this.setTexture2D(c,0);b.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,\nd||0,a.x,a.y,e,f,g,h,b.image.data):F.texSubImage2D(F.TEXTURE_2D,d||0,a.x,a.y,g,h,b.image)}}function Vb(a,b){this.name=\"\";this.color=new G(a);this.density=void 0!==b?b:2.5E-4}function Wb(a,b,c){this.name=\"\";this.color=new G(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3}function vd(){H.call(this);this.type=\"Scene\";this.overrideMaterial=this.fog=this.background=null;this.autoUpdate=!0}function ib(a){I.call(this);this.type=\"SpriteMaterial\";this.color=new G(16777215);this.map=null;this.rotation=\n0;this.lights=this.fog=!1;this.setValues(a)}function Ic(a){H.call(this);this.type=\"Sprite\";this.material=void 0!==a?a:new ib;this.center=new B(.5,.5)}function Jc(){H.call(this);this.type=\"LOD\";Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Kc(a,b){a=a||[];this.bones=a.slice(0);this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn(\"THREE.Skeleton boneInverses is the wrong length.\"),\nthis.boneInverses=[],a=0,b=this.bones.length;a<b;a++)this.boneInverses.push(new R)}function wd(){H.call(this);this.type=\"Bone\"}function xd(a,b){va.call(this,a,b);this.type=\"SkinnedMesh\";this.bindMode=\"attached\";this.bindMatrix=new R;this.bindMatrixInverse=new R;a=this.initBones();a=new Kc(a);this.bind(a,this.matrixWorld);this.normalizeSkinWeights()}function T(a){I.call(this);this.type=\"LineBasicMaterial\";this.color=new G(16777215);this.linewidth=1;this.linejoin=this.linecap=\"round\";this.lights=!1;\nthis.setValues(a)}function wa(a,b,c){if(1===c)return console.warn(\"THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.\"),new Y(a,b);H.call(this);this.type=\"Line\";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new T({color:16777215*Math.random()})}function Y(a,b){wa.call(this,a,b);this.type=\"LineSegments\"}function yd(a,b){wa.call(this,a,b);this.type=\"LineLoop\"}function Ja(a){I.call(this);this.type=\"PointsMaterial\";this.color=new G(16777215);\nthis.map=null;this.size=1;this.sizeAttenuation=!0;this.lights=this.morphTargets=!1;this.setValues(a)}function Xb(a,b){H.call(this);this.type=\"Points\";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new Ja({color:16777215*Math.random()})}function be(a,b,c,d,e,f,g,h,l){ea.call(this,a,b,c,d,e,f,g,h,l);this.generateMipmaps=!1}function Yb(a,b,c,d,e,f,g,h,l,m,v,n){ea.call(this,null,f,g,h,l,m,d,e,v,n);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Lc(a,\nb,c,d,e,f,g,h,l,m){m=void 0!==m?m:1026;if(1026!==m&&1027!==m)throw Error(\"DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat\");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);ea.call(this,null,d,e,f,g,h,m,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==h?h:1003;this.generateMipmaps=this.flipY=!1}function Zb(a){D.call(this);this.type=\"WireframeGeometry\";var b=[],c,d,e,f=[0,0],g={},h=[\"a\",\"b\",\"c\"];if(a&&a.isGeometry){var l=\na.faces;var m=0;for(d=l.length;m<d;m++){var v=l[m];for(c=0;3>c;c++){var n=v[h[c]];var t=v[h[(c+1)%3]];f[0]=Math.min(n,t);f[1]=Math.max(n,t);n=f[0]+\",\"+f[1];void 0===g[n]&&(g[n]={index1:f[0],index2:f[1]})}}for(n in g)m=g[n],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isBufferGeometry)if(h=new p,null!==a.index){l=a.attributes.position;v=a.index;var q=a.groups;0===q.length&&(q=[{start:0,count:v.count,materialIndex:0}]);a=0;for(e=q.length;a<e;++a)for(m=\nq[a],c=m.start,d=m.count,m=c,d=c+d;m<d;m+=3)for(c=0;3>c;c++)n=v.getX(m+c),t=v.getX(m+(c+1)%3),f[0]=Math.min(n,t),f[1]=Math.max(n,t),n=f[0]+\",\"+f[1],void 0===g[n]&&(g[n]={index1:f[0],index2:f[1]});for(n in g)m=g[n],h.fromBufferAttribute(l,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(l,m.index2),b.push(h.x,h.y,h.z)}else for(l=a.attributes.position,m=0,d=l.count/3;m<d;m++)for(c=0;3>c;c++)g=3*m+c,h.fromBufferAttribute(l,g),b.push(h.x,h.y,h.z),g=3*m+(c+1)%3,h.fromBufferAttribute(l,g),b.push(h.x,\nh.y,h.z);this.addAttribute(\"position\",new z(b,3))}function Mc(a,b,c){P.call(this);this.type=\"ParametricGeometry\";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new $b(a,b,c));this.mergeVertices()}function $b(a,b,c){D.call(this);this.type=\"ParametricBufferGeometry\";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new p,l=new p,m=new p,v=new p,n=new p,t,q;3>a.length&&console.error(\"THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.\");\nvar k=b+1;for(t=0;t<=c;t++){var u=t/c;for(q=0;q<=b;q++){var y=q/b;a(y,u,l);e.push(l.x,l.y,l.z);0<=y-1E-5?(a(y-1E-5,u,m),v.subVectors(l,m)):(a(y+1E-5,u,m),v.subVectors(m,l));0<=u-1E-5?(a(y,u-1E-5,m),n.subVectors(l,m)):(a(y,u+1E-5,m),n.subVectors(m,l));h.crossVectors(v,n).normalize();f.push(h.x,h.y,h.z);g.push(y,u)}}for(t=0;t<c;t++)for(q=0;q<b;q++)a=t*k+q+1,h=(t+1)*k+q+1,l=(t+1)*k+q,d.push(t*k+q,a,l),d.push(a,h,l);this.setIndex(d);this.addAttribute(\"position\",new z(e,3));this.addAttribute(\"normal\",\nnew z(f,3));this.addAttribute(\"uv\",new z(g,2))}function Nc(a,b,c,d){P.call(this);this.type=\"PolyhedronGeometry\";this.parameters={vertices:a,indices:b,radius:c,detail:d};this.fromBufferGeometry(new xa(a,b,c,d));this.mergeVertices()}function xa(a,b,c,d){function e(a){h.push(a.x,a.y,a.z)}function f(b,c){b*=3;c.x=a[b+0];c.y=a[b+1];c.z=a[b+2]}function g(a,b,c,d){0>d&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}D.call(this);this.type=\"PolyhedronBufferGeometry\";this.parameters={vertices:a,\nindices:b,radius:c,detail:d};c=c||1;d=d||0;var h=[],l=[];(function(a){for(var c=new p,d=new p,g=new p,h=0;h<b.length;h+=3){f(b[h+0],c);f(b[h+1],d);f(b[h+2],g);var l,m,k=c,w=d,x=g,A=Math.pow(2,a),C=[];for(m=0;m<=A;m++){C[m]=[];var O=k.clone().lerp(x,m/A),Q=w.clone().lerp(x,m/A),M=A-m;for(l=0;l<=M;l++)C[m][l]=0===l&&m===A?O:O.clone().lerp(Q,l/M)}for(m=0;m<A;m++)for(l=0;l<2*(A-m)-1;l++)k=Math.floor(l/2),0===l%2?(e(C[m][k+1]),e(C[m+1][k]),e(C[m][k])):(e(C[m][k+1]),e(C[m+1][k+1]),e(C[m+1][k]))}})(d);(function(a){for(var b=\nnew p,c=0;c<h.length;c+=3)b.x=h[c+0],b.y=h[c+1],b.z=h[c+2],b.normalize().multiplyScalar(a),h[c+0]=b.x,h[c+1]=b.y,h[c+2]=b.z})(c);(function(){for(var a=new p,b=0;b<h.length;b+=3)a.x=h[b+0],a.y=h[b+1],a.z=h[b+2],l.push(Math.atan2(a.z,-a.x)/2/Math.PI+.5,1-(Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5));a=new p;b=new p;for(var c=new p,d=new p,e=new B,f=new B,k=new B,y=0,w=0;y<h.length;y+=9,w+=6){a.set(h[y+0],h[y+1],h[y+2]);b.set(h[y+3],h[y+4],h[y+5]);c.set(h[y+6],h[y+7],h[y+8]);e.set(l[w+0],\nl[w+1]);f.set(l[w+2],l[w+3]);k.set(l[w+4],l[w+5]);d.copy(a).add(b).add(c).divideScalar(3);var x=Math.atan2(d.z,-d.x);g(e,w+0,a,x);g(f,w+2,b,x);g(k,w+4,c,x)}for(a=0;a<l.length;a+=6)b=l[a+0],c=l[a+2],d=l[a+4],e=Math.min(b,c,d),.9<Math.max(b,c,d)&&.1>e&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.addAttribute(\"position\",new z(h,3));this.addAttribute(\"normal\",new z(h.slice(),3));this.addAttribute(\"uv\",new z(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Oc(a,\nb){P.call(this);this.type=\"TetrahedronGeometry\";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ac(a,b));this.mergeVertices()}function ac(a,b){xa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type=\"TetrahedronBufferGeometry\";this.parameters={radius:a,detail:b}}function Pc(a,b){P.call(this);this.type=\"OctahedronGeometry\";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ub(a,b));this.mergeVertices()}function ub(a,b){xa.call(this,[1,0,0,\n-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type=\"OctahedronBufferGeometry\";this.parameters={radius:a,detail:b}}function Qc(a,b){P.call(this);this.type=\"IcosahedronGeometry\";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new bc(a,b));this.mergeVertices()}function bc(a,b){var c=(1+Math.sqrt(5))/2;xa.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,\n11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type=\"IcosahedronBufferGeometry\";this.parameters={radius:a,detail:b}}function Rc(a,b){P.call(this);this.type=\"DodecahedronGeometry\";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new cc(a,b));this.mergeVertices()}function cc(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;xa.call(this,[-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,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,\n0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[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],a,b);this.type=\"DodecahedronBufferGeometry\";this.parameters={radius:a,detail:b}}function Sc(a,b,c,d,e,f){P.call(this);this.type=\"TubeGeometry\";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,\nclosed:e};void 0!==f&&console.warn(\"THREE.TubeGeometry: taper has been removed.\");a=new dc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function dc(a,b,c,d,e){function f(e){v=a.getPointAt(e/b,v);var f=g.normals[e];e=g.binormals[e];for(k=0;k<=d;k++){var m=k/d*Math.PI*2,n=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+n*e.x;l.y=m*f.y+n*e.y;l.z=m*f.z+n*e.z;l.normalize();r.push(l.x,l.y,l.z);h.x=v.x+c*l.x;h.y=v.y+c*l.y;h.z=\nv.z+c*l.z;q.push(h.x,h.y,h.z)}}D.call(this);this.type=\"TubeBufferGeometry\";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new p,l=new p,m=new B,v=new p,n,k,q=[],r=[],u=[],y=[];for(n=0;n<b;n++)f(n);f(!1===e?b:0);for(n=0;n<=b;n++)for(k=0;k<=d;k++)m.x=n/b,m.y=k/d,u.push(m.x,m.y);(function(){for(k=1;k<=b;k++)for(n=1;n<=d;n++){var a=\n(d+1)*k+(n-1),c=(d+1)*k+n,e=(d+1)*(k-1)+n;y.push((d+1)*(k-1)+(n-1),a,e);y.push(a,c,e)}})();this.setIndex(y);this.addAttribute(\"position\",new z(q,3));this.addAttribute(\"normal\",new z(r,3));this.addAttribute(\"uv\",new z(u,2))}function Tc(a,b,c,d,e,f,g){P.call(this);this.type=\"TorusKnotGeometry\";this.parameters={radius:a,tube:b,tubularSegments:c,radialSegments:d,p:e,q:f};void 0!==g&&console.warn(\"THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.\");this.fromBufferGeometry(new ec(a,\nb,c,d,e,f));this.mergeVertices()}function ec(a,b,c,d,e,f){function g(a,b,c,d,e){var f=Math.sin(a);b=c/b*a;c=Math.cos(b);e.x=d*(2+c)*.5*Math.cos(a);e.y=d*(2+c)*f*.5;e.z=d*Math.sin(b)*.5}D.call(this);this.type=\"TorusKnotBufferGeometry\";this.parameters={radius:a,tube:b,tubularSegments:c,radialSegments:d,p:e,q:f};a=a||1;b=b||.4;c=Math.floor(c)||64;d=Math.floor(d)||8;e=e||2;f=f||3;var h=[],l=[],m=[],v=[],n,k=new p,q=new p,r=new p,u=new p,y=new p,w=new p,x=new p;for(n=0;n<=c;++n){var A=n/c*e*Math.PI*2;\ng(A,e,f,a,r);g(A+.01,e,f,a,u);w.subVectors(u,r);x.addVectors(u,r);y.crossVectors(w,x);x.crossVectors(y,w);y.normalize();x.normalize();for(A=0;A<=d;++A){var C=A/d*Math.PI*2,O=-b*Math.cos(C);C=b*Math.sin(C);k.x=r.x+(O*x.x+C*y.x);k.y=r.y+(O*x.y+C*y.y);k.z=r.z+(O*x.z+C*y.z);l.push(k.x,k.y,k.z);q.subVectors(k,r).normalize();m.push(q.x,q.y,q.z);v.push(n/c);v.push(A/d)}}for(A=1;A<=c;A++)for(n=1;n<=d;n++)a=(d+1)*A+(n-1),b=(d+1)*A+n,e=(d+1)*(A-1)+n,h.push((d+1)*(A-1)+(n-1),a,e),h.push(a,b,e);this.setIndex(h);\nthis.addAttribute(\"position\",new z(l,3));this.addAttribute(\"normal\",new z(m,3));this.addAttribute(\"uv\",new z(v,2))}function Uc(a,b,c,d,e){P.call(this);this.type=\"TorusGeometry\";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};this.fromBufferGeometry(new fc(a,b,c,d,e));this.mergeVertices()}function fc(a,b,c,d,e){D.call(this);this.type=\"TorusBufferGeometry\";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||1;b=b||.4;c=Math.floor(c)||8;d=Math.floor(d)||\n6;e=e||2*Math.PI;var f=[],g=[],h=[],l=[],m=new p,v=new p,n=new p,k,q;for(k=0;k<=c;k++)for(q=0;q<=d;q++){var r=q/d*e,u=k/c*Math.PI*2;v.x=(a+b*Math.cos(u))*Math.cos(r);v.y=(a+b*Math.cos(u))*Math.sin(r);v.z=b*Math.sin(u);g.push(v.x,v.y,v.z);m.x=a*Math.cos(r);m.y=a*Math.sin(r);n.subVectors(v,m).normalize();h.push(n.x,n.y,n.z);l.push(q/d);l.push(k/c)}for(k=1;k<=c;k++)for(q=1;q<=d;q++)a=(d+1)*(k-1)+q-1,b=(d+1)*(k-1)+q,e=(d+1)*k+q,f.push((d+1)*k+q-1,a,e),f.push(a,b,e);this.setIndex(f);this.addAttribute(\"position\",\nnew z(g,3));this.addAttribute(\"normal\",new z(h,3));this.addAttribute(\"uv\",new z(l,2))}function cf(a,b,c,d,e){for(var f,g=0,h=b,l=c-d;h<c;h+=d)g+=(a[l]-a[h])*(a[h+1]+a[l+1]),l=h;if(e===0<g)for(e=b;e<c;e+=d)f=df(e,a[e],a[e+1],f);else for(e=c-d;e>=b;e-=d)f=df(e,a[e],a[e+1],f);f&&vb(f,f.next)&&(Vc(f),f=f.next);return f}function Wc(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!vb(a,a.next)&&0!==oa(a.prev,a,a.next))a=a.next;else{Vc(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}\nfunction Xc(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=ce(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==h);l.prevZ.nextZ=null;l.prevZ=null;h=l;var m,v,n,k,q=1;do{l=h;var r=h=null;for(v=0;l;){v++;var p=l;for(m=n=0;m<q&&(n++,p=p.nextZ,p);m++);for(k=q;0<n||0<k&&p;)0!==n&&(0===k||!p||l.z<=p.z)?(m=l,l=l.nextZ,n--):(m=p,p=p.nextZ,k--),r?r.nextZ=m:h=m,m.prevZ=r,r=m;l=p}r.nextZ=null;q*=2}while(1<v)}for(h=a;a.prev!==a.next;){l=a.prev;p=a.next;if(f)a:{r=a;k=d;var y=e,w=f;v=r.prev;\nn=r;q=r.next;if(0<=oa(v,n,q))r=!1;else{var x=v.x>n.x?v.x>q.x?v.x:q.x:n.x>q.x?n.x:q.x,A=v.y>n.y?v.y>q.y?v.y:q.y:n.y>q.y?n.y:q.y;m=ce(v.x<n.x?v.x<q.x?v.x:q.x:n.x<q.x?n.x:q.x,v.y<n.y?v.y<q.y?v.y:q.y:n.y<q.y?n.y:q.y,k,y,w);k=ce(x,A,k,y,w);for(y=r.nextZ;y&&y.z<=k;){if(y!==r.prev&&y!==r.next&&zd(v.x,v.y,n.x,n.y,q.x,q.y,y.x,y.y)&&0<=oa(y.prev,y,y.next)){r=!1;break a}y=y.nextZ}for(y=r.prevZ;y&&y.z>=m;){if(y!==r.prev&&y!==r.next&&zd(v.x,v.y,n.x,n.y,q.x,q.y,y.x,y.y)&&0<=oa(y.prev,y,y.next)){r=!1;break a}y=\ny.prevZ}r=!0}}else a:if(r=a,v=r.prev,n=r,q=r.next,0<=oa(v,n,q))r=!1;else{for(m=r.next.next;m!==r.prev;){if(zd(v.x,v.y,n.x,n.y,q.x,q.y,m.x,m.y)&&0<=oa(m.prev,m,m.next)){r=!1;break a}m=m.next}r=!0}if(r)b.push(l.i/c),b.push(a.i/c),b.push(p.i/c),Vc(a),h=a=p.next;else if(a=p,a===h){if(!g)Xc(Wc(a),b,c,d,e,f,1);else if(1===g){g=b;h=c;l=a;do p=l.prev,r=l.next.next,!vb(p,r)&&ef(p,l,l.next,r)&&Yc(p,r)&&Yc(r,p)&&(g.push(p.i/h),g.push(l.i/h),g.push(r.i/h),Vc(l),Vc(l.next),l=a=r),l=l.next;while(l!==a);a=l;Xc(a,\nb,c,d,e,f,2)}else if(2===g)a:{g=a;do{for(h=g.next.next;h!==g.prev;){if(l=g.i!==h.i){l=g;p=h;if(r=l.next.i!==p.i&&l.prev.i!==p.i){b:{r=l;do{if(r.i!==l.i&&r.next.i!==l.i&&r.i!==p.i&&r.next.i!==p.i&&ef(r,r.next,l,p)){r=!0;break b}r=r.next}while(r!==l);r=!1}r=!r}if(r=r&&Yc(l,p)&&Yc(p,l)){r=l;v=!1;n=(l.x+p.x)/2;p=(l.y+p.y)/2;do r.y>p!==r.next.y>p&&r.next.y!==r.y&&n<(r.next.x-r.x)*(p-r.y)/(r.next.y-r.y)+r.x&&(v=!v),r=r.next;while(r!==l);r=v}l=r}if(l){a=ff(g,h);g=Wc(g,g.next);a=Wc(a,a.next);Xc(g,b,c,d,e,\nf);Xc(a,b,c,d,e,f);break a}h=h.next}g=g.next}while(g!==a)}break}}}}function Pg(a,b){return a.x-b.x}function Qg(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var h=c.x<c.next.x?c:c.next}}c=c.next}while(c!==b);if(!h)return null;if(d===f)return h.prev;b=h;g=h.x;var l=h.y,m=Infinity;for(c=h.next;c!==b;){if(d>=c.x&&c.x>=g&&d!==c.x&&zd(e<l?d:f,e,\ng,l,e<l?f:d,e,c.x,c.y)){var v=Math.abs(e-c.y)/(d-c.x);(v<m||v===m&&c.x>h.x)&&Yc(c,a)&&(h=c,m=v)}c=c.next}return h}function ce(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function Rg(a){var b=a,c=a;do b.x<c.x&&(c=b),b=b.next;while(b!==a);return c}function zd(a,b,c,d,e,f,g,h){return 0<=(e-g)*(b-h)-(a-g)*(f-h)&&0<=(a-g)*(d-h)-(c-\ng)*(b-h)&&0<=(c-g)*(f-h)-(e-g)*(d-h)}function oa(a,b,c){return(b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y)}function vb(a,b){return a.x===b.x&&a.y===b.y}function ef(a,b,c,d){return vb(a,b)&&vb(c,d)||vb(a,d)&&vb(c,b)?!0:0<oa(a,b,c)!==0<oa(a,b,d)&&0<oa(c,d,a)!==0<oa(c,d,b)}function Yc(a,b){return 0>oa(a.prev,a,a.next)?0<=oa(a,b,a.next)&&0<=oa(a,a.prev,b):0>oa(a,b,a.prev)||0>oa(a,a.next,b)}function ff(a,b){var c=new de(a.i,a.x,a.y),d=new de(b.i,b.x,b.y),e=a.next,f=b.prev;a.next=b;b.prev=a;c.next=e;e.prev=\nc;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function df(a,b,c,d){a=new de(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function Vc(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function de(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function gf(a){var b=a.length;2<b&&a[b-1].equals(a[0])&&a.pop()}function hf(a,b){for(var c=0;c<b.length;c++)a.push(b[c].x),\na.push(b[c].y)}function wb(a,b){P.call(this);this.type=\"ExtrudeGeometry\";this.parameters={shapes:a,options:b};this.fromBufferGeometry(new Ta(a,b));this.mergeVertices()}function Ta(a,b){function c(a){function c(a,b,c){b||console.error(\"THREE.ExtrudeGeometry: vec does not exist\");return b.clone().multiplyScalar(c).add(a)}function g(a,b,c){var d=a.x-b.x;var e=a.y-b.y;var f=c.x-a.x;var g=c.y-a.y,h=d*d+e*e;if(Math.abs(d*g-e*f)>Number.EPSILON){var l=Math.sqrt(h),m=Math.sqrt(f*f+g*g);h=b.x-e/l;b=b.y+d/l;\ng=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new B(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new B(f/e,d/e)}function h(a,b){for(N=a.length;0<=--N;){var c=N;var f=N-1;0>f&&(f=a.length-1);var g,h=x+2*M;for(g=0;g<h;g++){var l=Z*g,m=Z*(g+1),n=b+f+l,v=b+f+m;m=b+c+m;r(b+c+l);r(n);r(m);r(n);\nr(v);r(m);l=e.length/3;l=G.generateSideWallUV(d,e,l-6,l-3,l-2,l-1);u(l[0]);u(l[1]);u(l[3]);u(l[1]);u(l[2]);u(l[3])}}}function l(a,b,c){y.push(a);y.push(b);y.push(c)}function k(a,b,c){r(a);r(b);r(c);a=e.length/3;a=G.generateTopUV(d,e,a-3,a-2,a-1);u(a[0]);u(a[1]);u(a[2])}function r(a){e.push(y[3*a]);e.push(y[3*a+1]);e.push(y[3*a+2])}function u(a){f.push(a.x);f.push(a.y)}var y=[],w=void 0!==b.curveSegments?b.curveSegments:12,x=void 0!==b.steps?b.steps:1,A=void 0!==b.depth?b.depth:100,C=void 0!==b.bevelEnabled?\nb.bevelEnabled:!0,O=void 0!==b.bevelThickness?b.bevelThickness:6,Q=void 0!==b.bevelSize?b.bevelSize:O-2,M=void 0!==b.bevelSegments?b.bevelSegments:3,z=b.extrudePath,G=void 0!==b.UVGenerator?b.UVGenerator:Sg;void 0!==b.amount&&(console.warn(\"THREE.ExtrudeBufferGeometry: amount has been renamed to depth.\"),A=b.amount);var H=!1;if(z){var D=z.getSpacedPoints(x);H=!0;C=!1;var E=z.computeFrenetFrames(x,!1);var K=new p;var P=new p;var R=new p}C||(Q=O=M=0);var I;w=a.extractPoints(w);a=w.shape;var L=w.holes;\nif(!$a.isClockWise(a)){a=a.reverse();var J=0;for(I=L.length;J<I;J++){var S=L[J];$a.isClockWise(S)&&(L[J]=S.reverse())}}var Y=$a.triangulateShape(a,L),X=a;J=0;for(I=L.length;J<I;J++)S=L[J],a=a.concat(S);var T,Z=a.length,fa,V=Y.length;w=[];var N=0;var ba=X.length;var W=ba-1;for(T=N+1;N<ba;N++,W++,T++)W===ba&&(W=0),T===ba&&(T=0),w[N]=g(X[N],X[W],X[T]);z=[];var ea=w.concat();J=0;for(I=L.length;J<I;J++){S=L[J];var ca=[];N=0;ba=S.length;W=ba-1;for(T=N+1;N<ba;N++,W++,T++)W===ba&&(W=0),T===ba&&(T=0),ca[N]=\ng(S[N],S[W],S[T]);z.push(ca);ea=ea.concat(ca)}for(W=0;W<M;W++){ba=W/M;var da=O*Math.cos(ba*Math.PI/2);T=Q*Math.sin(ba*Math.PI/2);N=0;for(ba=X.length;N<ba;N++){var ha=c(X[N],w[N],T);l(ha.x,ha.y,-da)}J=0;for(I=L.length;J<I;J++)for(S=L[J],ca=z[J],N=0,ba=S.length;N<ba;N++)ha=c(S[N],ca[N],T),l(ha.x,ha.y,-da)}T=Q;for(N=0;N<Z;N++)ha=C?c(a[N],ea[N],T):a[N],H?(P.copy(E.normals[0]).multiplyScalar(ha.x),K.copy(E.binormals[0]).multiplyScalar(ha.y),R.copy(D[0]).add(P).add(K),l(R.x,R.y,R.z)):l(ha.x,ha.y,0);for(ba=\n1;ba<=x;ba++)for(N=0;N<Z;N++)ha=C?c(a[N],ea[N],T):a[N],H?(P.copy(E.normals[ba]).multiplyScalar(ha.x),K.copy(E.binormals[ba]).multiplyScalar(ha.y),R.copy(D[ba]).add(P).add(K),l(R.x,R.y,R.z)):l(ha.x,ha.y,A/x*ba);for(W=M-1;0<=W;W--){ba=W/M;da=O*Math.cos(ba*Math.PI/2);T=Q*Math.sin(ba*Math.PI/2);N=0;for(ba=X.length;N<ba;N++)ha=c(X[N],w[N],T),l(ha.x,ha.y,A+da);J=0;for(I=L.length;J<I;J++)for(S=L[J],ca=z[J],N=0,ba=S.length;N<ba;N++)ha=c(S[N],ca[N],T),H?l(ha.x,ha.y+D[x-1].y,D[x-1].x+da):l(ha.x,ha.y,A+da)}(function(){var a=\ne.length/3;if(C){var b=0*Z;for(N=0;N<V;N++)fa=Y[N],k(fa[2]+b,fa[1]+b,fa[0]+b);b=Z*(x+2*M);for(N=0;N<V;N++)fa=Y[N],k(fa[0]+b,fa[1]+b,fa[2]+b)}else{for(N=0;N<V;N++)fa=Y[N],k(fa[2],fa[1],fa[0]);for(N=0;N<V;N++)fa=Y[N],k(fa[0]+Z*x,fa[1]+Z*x,fa[2]+Z*x)}d.addGroup(a,e.length/3-a,0)})();(function(){var a=e.length/3,b=0;h(X,b);b+=X.length;J=0;for(I=L.length;J<I;J++)S=L[J],h(S,b),b+=S.length;d.addGroup(a,e.length/3-a,1)})()}D.call(this);this.type=\"ExtrudeBufferGeometry\";this.parameters={shapes:a,options:b};\na=Array.isArray(a)?a:[a];for(var d=this,e=[],f=[],g=0,h=a.length;g<h;g++)c(a[g]);this.addAttribute(\"position\",new z(e,3));this.addAttribute(\"uv\",new z(f,2));this.computeVertexNormals()}function jf(a,b,c){c.shapes=[];if(Array.isArray(a))for(var d=0,e=a.length;d<e;d++)c.shapes.push(a[d].uuid);else c.shapes.push(a.uuid);void 0!==b.extrudePath&&(c.options.extrudePath=b.extrudePath.toJSON());return c}function Zc(a,b){P.call(this);this.type=\"TextGeometry\";this.parameters={text:a,parameters:b};this.fromBufferGeometry(new gc(a,\nb));this.mergeVertices()}function gc(a,b){b=b||{};var c=b.font;if(!c||!c.isFont)return console.error(\"THREE.TextGeometry: font parameter is not an instance of THREE.Font.\"),new P;a=c.generateShapes(a,b.size);b.depth=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);Ta.call(this,a,b);this.type=\"TextBufferGeometry\"}function $c(a,b,c,d,e,f,g){P.call(this);this.type=\"SphereGeometry\";this.parameters=\n{radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};this.fromBufferGeometry(new xb(a,b,c,d,e,f,g));this.mergeVertices()}function xb(a,b,c,d,e,f,g){D.call(this);this.type=\"SphereBufferGeometry\";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||1;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h=\nf+g,l,m,v=0,n=[],k=new p,q=new p,r=[],u=[],y=[],w=[];for(m=0;m<=c;m++){var x=[],A=m/c;for(l=0;l<=b;l++){var C=l/b;k.x=-a*Math.cos(d+C*e)*Math.sin(f+A*g);k.y=a*Math.cos(f+A*g);k.z=a*Math.sin(d+C*e)*Math.sin(f+A*g);u.push(k.x,k.y,k.z);q.set(k.x,k.y,k.z).normalize();y.push(q.x,q.y,q.z);w.push(C,1-A);x.push(v++)}n.push(x)}for(m=0;m<c;m++)for(l=0;l<b;l++)a=n[m][l+1],d=n[m][l],e=n[m+1][l],g=n[m+1][l+1],(0!==m||0<f)&&r.push(a,d,g),(m!==c-1||h<Math.PI)&&r.push(d,e,g);this.setIndex(r);this.addAttribute(\"position\",\nnew z(u,3));this.addAttribute(\"normal\",new z(y,3));this.addAttribute(\"uv\",new z(w,2))}function ad(a,b,c,d,e,f){P.call(this);this.type=\"RingGeometry\";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};this.fromBufferGeometry(new hc(a,b,c,d,e,f));this.mergeVertices()}function hc(a,b,c,d,e,f){D.call(this);this.type=\"RingBufferGeometry\";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||.5;b=b||\n1;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):1;var g=[],h=[],l=[],m=[],v=a,n=(b-a)/d,k=new p,q=new B,r,u;for(r=0;r<=d;r++){for(u=0;u<=c;u++)a=e+u/c*f,k.x=v*Math.cos(a),k.y=v*Math.sin(a),h.push(k.x,k.y,k.z),l.push(0,0,1),q.x=(k.x/b+1)/2,q.y=(k.y/b+1)/2,m.push(q.x,q.y);v+=n}for(r=0;r<d;r++)for(b=r*(c+1),u=0;u<c;u++)a=u+b,e=a+c+1,f=a+c+2,v=a+1,g.push(a,e,v),g.push(e,f,v);this.setIndex(g);this.addAttribute(\"position\",new z(h,3));this.addAttribute(\"normal\",\nnew z(l,3));this.addAttribute(\"uv\",new z(m,2))}function bd(a,b,c,d){P.call(this);this.type=\"LatheGeometry\";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};this.fromBufferGeometry(new ic(a,b,c,d));this.mergeVertices()}function ic(a,b,c,d){D.call(this);this.type=\"LatheBufferGeometry\";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=Math.floor(b)||12;c=c||0;d=d||2*Math.PI;d=J.clamp(d,0,2*Math.PI);var e=[],f=[],g=[],h=1/b,l=new p,m=new B,v;for(v=0;v<=b;v++){var n=c+v*h*d;var k=\nMath.sin(n),q=Math.cos(n);for(n=0;n<=a.length-1;n++)l.x=a[n].x*k,l.y=a[n].y,l.z=a[n].x*q,f.push(l.x,l.y,l.z),m.x=v/b,m.y=n/(a.length-1),g.push(m.x,m.y)}for(v=0;v<b;v++)for(n=0;n<a.length-1;n++)c=n+v*a.length,h=c+a.length,l=c+a.length+1,m=c+1,e.push(c,h,m),e.push(h,l,m);this.setIndex(e);this.addAttribute(\"position\",new z(f,3));this.addAttribute(\"uv\",new z(g,2));this.computeVertexNormals();if(d===2*Math.PI)for(d=this.attributes.normal.array,e=new p,f=new p,g=new p,c=b*a.length*3,n=v=0;v<a.length;v++,\nn+=3)e.x=d[n+0],e.y=d[n+1],e.z=d[n+2],f.x=d[c+n+0],f.y=d[c+n+1],f.z=d[c+n+2],g.addVectors(e,f).normalize(),d[n+0]=d[c+n+0]=g.x,d[n+1]=d[c+n+1]=g.y,d[n+2]=d[c+n+2]=g.z}function yb(a,b){P.call(this);this.type=\"ShapeGeometry\";\"object\"===typeof b&&(console.warn(\"THREE.ShapeGeometry: Options parameter has been removed.\"),b=b.curveSegments);this.parameters={shapes:a,curveSegments:b};this.fromBufferGeometry(new zb(a,b));this.mergeVertices()}function zb(a,b){function c(a){var c,h=e.length/3;a=a.extractPoints(b);\nvar m=a.shape,k=a.holes;if(!1===$a.isClockWise(m))for(m=m.reverse(),a=0,c=k.length;a<c;a++){var v=k[a];!0===$a.isClockWise(v)&&(k[a]=v.reverse())}var p=$a.triangulateShape(m,k);a=0;for(c=k.length;a<c;a++)v=k[a],m=m.concat(v);a=0;for(c=m.length;a<c;a++)v=m[a],e.push(v.x,v.y,0),f.push(0,0,1),g.push(v.x,v.y);a=0;for(c=p.length;a<c;a++)m=p[a],d.push(m[0]+h,m[1]+h,m[2]+h),l+=3}D.call(this);this.type=\"ShapeBufferGeometry\";this.parameters={shapes:a,curveSegments:b};b=b||12;var d=[],e=[],f=[],g=[],h=0,l=\n0;if(!1===Array.isArray(a))c(a);else for(var m=0;m<a.length;m++)c(a[m]),this.addGroup(h,l,m),h+=l,l=0;this.setIndex(d);this.addAttribute(\"position\",new z(e,3));this.addAttribute(\"normal\",new z(f,3));this.addAttribute(\"uv\",new z(g,2))}function kf(a,b){b.shapes=[];if(Array.isArray(a))for(var c=0,d=a.length;c<d;c++)b.shapes.push(a[c].uuid);else b.shapes.push(a.uuid);return b}function jc(a,b){D.call(this);this.type=\"EdgesGeometry\";this.parameters={thresholdAngle:b};var c=[];b=Math.cos(J.DEG2RAD*(void 0!==\nb?b:1));var d=[0,0],e={},f=[\"a\",\"b\",\"c\"];if(a.isBufferGeometry){var g=new P;g.fromBufferGeometry(a)}else g=a.clone();g.mergeVertices();g.computeFaceNormals();a=g.vertices;g=g.faces;for(var h=0,l=g.length;h<l;h++)for(var m=g[h],k=0;3>k;k++){var n=m[f[k]];var t=m[f[(k+1)%3]];d[0]=Math.min(n,t);d[1]=Math.max(n,t);n=d[0]+\",\"+d[1];void 0===e[n]?e[n]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[n].face2=h}for(n in e)if(d=e[n],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],\nc.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addAttribute(\"position\",new z(c,3))}function Ab(a,b,c,d,e,f,g,h){P.call(this);this.type=\"CylinderGeometry\";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new ab(a,b,c,d,e,f,g,h));this.mergeVertices()}function ab(a,b,c,d,e,f,g,h){function l(c){var e,f=new B,l=new p,v=0,u=!0===c?a:b,x=!0===c?1:-1;var z=r;for(e=1;e<=d;e++)n.push(0,y*x,0),t.push(0,\nx,0),q.push(.5,.5),r++;var G=r;for(e=0;e<=d;e++){var H=e/d*h+g,D=Math.cos(H);H=Math.sin(H);l.x=u*H;l.y=y*x;l.z=u*D;n.push(l.x,l.y,l.z);t.push(0,x,0);f.x=.5*D+.5;f.y=.5*H*x+.5;q.push(f.x,f.y);r++}for(e=0;e<d;e++)f=z+e,l=G+e,!0===c?k.push(l,l+1,f):k.push(l+1,l,f),v+=3;m.addGroup(w,v,!0===c?1:2);w+=v}D.call(this);this.type=\"CylinderBufferGeometry\";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};var m=this;a=void 0!==a?a:1;\nb=void 0!==b?b:1;c=c||1;d=Math.floor(d)||8;e=Math.floor(e)||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=[],n=[],t=[],q=[],r=0,u=[],y=c/2,w=0;(function(){var f,l,v=new p,O=new p,Q=0,z=(b-a)/c;for(l=0;l<=e;l++){var B=[],H=l/e,G=H*(b-a)+a;for(f=0;f<=d;f++){var D=f/d,E=D*h+g,J=Math.sin(E);E=Math.cos(E);O.x=G*J;O.y=-H*c+y;O.z=G*E;n.push(O.x,O.y,O.z);v.set(J,z,E).normalize();t.push(v.x,v.y,v.z);q.push(D,1-H);B.push(r++)}u.push(B)}for(f=0;f<d;f++)for(l=0;l<e;l++)v=u[l+1][f],O=u[l+\n1][f+1],z=u[l][f+1],k.push(u[l][f],v,z),k.push(v,O,z),Q+=6;m.addGroup(w,Q,0);w+=Q})();!1===f&&(0<a&&l(!0),0<b&&l(!1));this.setIndex(k);this.addAttribute(\"position\",new z(n,3));this.addAttribute(\"normal\",new z(t,3));this.addAttribute(\"uv\",new z(q,2))}function cd(a,b,c,d,e,f,g){Ab.call(this,0,a,b,c,d,e,f,g);this.type=\"ConeGeometry\";this.parameters={radius:a,height:b,radialSegments:c,heightSegments:d,openEnded:e,thetaStart:f,thetaLength:g}}function dd(a,b,c,d,e,f,g){ab.call(this,0,a,b,c,d,e,f,g);this.type=\n\"ConeBufferGeometry\";this.parameters={radius:a,height:b,radialSegments:c,heightSegments:d,openEnded:e,thetaStart:f,thetaLength:g}}function ed(a,b,c,d){P.call(this);this.type=\"CircleGeometry\";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};this.fromBufferGeometry(new kc(a,b,c,d));this.mergeVertices()}function kc(a,b,c,d){D.call(this);this.type=\"CircleBufferGeometry\";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||1;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:\n0;d=void 0!==d?d:2*Math.PI;var e=[],f=[],g=[],h=[],l,m=new p,k=new B;f.push(0,0,0);g.push(0,0,1);h.push(.5,.5);var n=0;for(l=3;n<=b;n++,l+=3){var t=c+n/b*d;m.x=a*Math.cos(t);m.y=a*Math.sin(t);f.push(m.x,m.y,m.z);g.push(0,0,1);k.x=(f[l]/a+1)/2;k.y=(f[l+1]/a+1)/2;h.push(k.x,k.y)}for(l=1;l<=b;l++)e.push(l,l+1,0);this.setIndex(e);this.addAttribute(\"position\",new z(f,3));this.addAttribute(\"normal\",new z(g,3));this.addAttribute(\"uv\",new z(h,2))}function Bb(a){I.call(this);this.type=\"ShadowMaterial\";this.color=\nnew G(0);this.transparent=!0;this.setValues(a)}function lc(a){Fa.call(this,a);this.type=\"RawShaderMaterial\"}function Ua(a){I.call(this);this.defines={STANDARD:\"\"};this.type=\"MeshStandardMaterial\";this.color=new G(16777215);this.metalness=this.roughness=.5;this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new G(0);this.emissiveIntensity=1;this.bumpMap=this.emissiveMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=\nnew B(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.envMap=this.alphaMap=this.metalnessMap=this.roughnessMap=null;this.envMapIntensity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function Cb(a){Ua.call(this);this.defines={PHYSICAL:\"\"};this.type=\"MeshPhysicalMaterial\";this.reflectivity=.5;this.clearCoatRoughness=\nthis.clearCoat=0;this.setValues(a)}function Ka(a){I.call(this);this.type=\"MeshPhongMaterial\";this.color=new G(16777215);this.specular=new G(1118481);this.shininess=30;this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new G(0);this.emissiveIntensity=1;this.bumpMap=this.emissiveMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=new B(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;\nthis.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function Db(a){Ka.call(this);this.defines={TOON:\"\"};this.type=\"MeshToonMaterial\";this.gradientMap=null;this.setValues(a)}function Eb(a){I.call(this);this.type=\"MeshNormalMaterial\";this.bumpMap=null;this.bumpScale=1;this.normalMap=\nnull;this.normalMapType=0;this.normalScale=new B(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.lights=this.fog=!1;this.setValues(a)}function Fb(a){I.call(this);this.type=\"MeshLambertMaterial\";this.color=new G(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new G(0);this.emissiveIntensity=1;this.envMap=\nthis.alphaMap=this.specularMap=this.emissiveMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function Gb(a){T.call(this);this.type=\"LineDashedMaterial\";this.scale=1;this.dashSize=3;this.gapSize=1;this.setValues(a)}function ee(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0;this.onStart=void 0;this.onLoad=a;this.onProgress=\nb;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()};this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h=a;return this}}function La(a){this.manager=void 0!==a?a:ya}function lf(a){this.manager=void 0!==a?a:ya;this._parser=null}function fe(a){this.manager=\nvoid 0!==a?a:ya;this._parser=null}function fd(a){this.manager=void 0!==a?a:ya}function ge(a){this.manager=void 0!==a?a:ya}function Ad(a){this.manager=void 0!==a?a:ya}function E(){this.type=\"Curve\";this.arcLengthDivisions=200}function Da(a,b,c,d,e,f,g,h){E.call(this);this.type=\"EllipseCurve\";this.aX=a||0;this.aY=b||0;this.xRadius=c||1;this.yRadius=d||1;this.aStartAngle=e||0;this.aEndAngle=f||2*Math.PI;this.aClockwise=g||!1;this.aRotation=h||0}function mc(a,b,c,d,e,f){Da.call(this,a,b,c,c,d,e,f);this.type=\n\"ArcCurve\"}function he(){var a=0,b=0,c=0,d=0;return{initCatmullRom:function(e,f,g,h,l){e=l*(g-e);h=l*(h-f);a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},initNonuniformCatmullRom:function(e,f,g,h,l,m,k){e=((f-e)/l-(g-e)/(l+m)+(g-f)/m)*m;h=((g-f)/m-(h-f)/(m+k)+(h-g)/k)*m;a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},calc:function(e){var f=e*e;return a+b*e+c*f+d*f*e}}}function pa(a,b,c,d){E.call(this);this.type=\"CatmullRomCurve3\";this.points=a||[];this.closed=b||!1;this.curveType=c||\"centripetal\";this.tension=d||\n.5}function mf(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return(2*c-2*d+b+e)*a*f+(-3*c+3*d-2*b-e)*f+b*a+c}function gd(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}function hd(a,b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*a*a*d+a*a*a*e}function Ma(a,b,c,d){E.call(this);this.type=\"CubicBezierCurve\";this.v0=a||new B;this.v1=b||new B;this.v2=c||new B;this.v3=d||new B}function Va(a,b,c,d){E.call(this);this.type=\"CubicBezierCurve3\";this.v0=a||new p;this.v1=b||new p;this.v2=c||new p;\nthis.v3=d||new p}function ia(a,b){E.call(this);this.type=\"LineCurve\";this.v1=a||new B;this.v2=b||new B}function Na(a,b){E.call(this);this.type=\"LineCurve3\";this.v1=a||new p;this.v2=b||new p}function Oa(a,b,c){E.call(this);this.type=\"QuadraticBezierCurve\";this.v0=a||new B;this.v1=b||new B;this.v2=c||new B}function Wa(a,b,c){E.call(this);this.type=\"QuadraticBezierCurve3\";this.v0=a||new p;this.v1=b||new p;this.v2=c||new p}function Pa(a){E.call(this);this.type=\"SplineCurve\";this.points=a||[]}function bb(){E.call(this);\nthis.type=\"CurvePath\";this.curves=[];this.autoClose=!1}function Qa(a){bb.call(this);this.type=\"Path\";this.currentPoint=new B;a&&this.setFromPoints(a)}function jb(a){Qa.call(this,a);this.uuid=J.generateUUID();this.type=\"Shape\";this.holes=[]}function X(a,b){H.call(this);this.type=\"Light\";this.color=new G(a);this.intensity=void 0!==b?b:1;this.receiveShadow=void 0}function Bd(a,b,c){X.call(this,a,c);this.type=\"HemisphereLight\";this.castShadow=void 0;this.position.copy(H.DefaultUp);this.updateMatrix();\nthis.groundColor=new G(b)}function Hb(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new B(512,512);this.map=null;this.matrix=new R}function Cd(){Hb.call(this,new Z(50,1,.5,500))}function Dd(a,b,c,d,e,f){X.call(this,a,b);this.type=\"SpotLight\";this.position.copy(H.DefaultUp);this.updateMatrix();this.target=new H;Object.defineProperty(this,\"power\",{get:function(){return this.intensity*Math.PI},set:function(a){this.intensity=a/Math.PI}});this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:\nMath.PI/3;this.penumbra=void 0!==e?e:0;this.decay=void 0!==f?f:1;this.shadow=new Cd}function Ed(a,b,c,d){X.call(this,a,b);this.type=\"PointLight\";Object.defineProperty(this,\"power\",{get:function(){return 4*this.intensity*Math.PI},set:function(a){this.intensity=a/(4*Math.PI)}});this.distance=void 0!==c?c:0;this.decay=void 0!==d?d:1;this.shadow=new Hb(new Z(90,1,.5,500))}function Fd(){Hb.call(this,new Mb(-5,5,5,-5,.5,500))}function Gd(a,b){X.call(this,a,b);this.type=\"DirectionalLight\";this.position.copy(H.DefaultUp);\nthis.updateMatrix();this.target=new H;this.shadow=new Fd}function Hd(a,b){X.call(this,a,b);this.type=\"AmbientLight\";this.castShadow=void 0}function Id(a,b,c,d){X.call(this,a,b);this.type=\"RectAreaLight\";this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function Jd(a,b,c,d){ja.call(this,a,b,c,d)}function Kd(a,b,c){ja.call(this,a,b,c)}function Ea(a,b,c,d){this.parameterPositions=a;this._cachedIndex=0;this.resultBuffer=void 0!==d?d:new b.constructor(c);this.sampleValues=b;this.valueSize=c}function Ld(a,\nb,c,d){Ea.call(this,a,b,c,d)}function id(a,b,c,d){ja.call(this,a,b,c,d)}function Md(a,b,c,d){ja.call(this,a,b,c,d)}function nc(a,b,c,d){ja.call(this,a,b,c,d)}function Nd(a,b,c,d){Ea.call(this,a,b,c,d);this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function jd(a,b,c,d){Ea.call(this,a,b,c,d)}function Od(a,b,c,d){Ea.call(this,a,b,c,d)}function ja(a,b,c,d){if(void 0===a)throw Error(\"THREE.KeyframeTrack: track name is undefined\");if(void 0===b||0===b.length)throw Error(\"THREE.KeyframeTrack: no keyframes in track named \"+\na);this.name=a;this.times=na.convertArray(b,this.TimeBufferType);this.values=na.convertArray(c,this.ValueBufferType);this.setInterpolation(d||this.DefaultInterpolation);this.validate();this.optimize()}function oc(a,b,c,d){ja.call(this,a,b,c,d)}function Ga(a,b,c){this.name=a;this.tracks=c;this.duration=void 0!==b?b:-1;this.uuid=J.generateUUID();0>this.duration&&this.resetDuration();this.optimize()}function Pd(a){this.manager=void 0!==a?a:ya;this.textures={}}function ie(a){this.manager=void 0!==a?a:\nya}function pc(){}function je(a){\"boolean\"===typeof a&&(console.warn(\"THREE.JSONLoader: showStatus parameter has been removed from constructor.\"),a=void 0);this.manager=void 0!==a?a:ya;this.withCredentials=!1}function nf(a){this.manager=void 0!==a?a:ya;this.texturePath=\"\"}function ke(a){\"undefined\"===typeof createImageBitmap&&console.warn(\"THREE.ImageBitmapLoader: createImageBitmap() not supported.\");\"undefined\"===typeof fetch&&console.warn(\"THREE.ImageBitmapLoader: fetch() not supported.\");this.manager=\nvoid 0!==a?a:ya;this.options=void 0}function le(){this.type=\"ShapePath\";this.color=new G;this.subPaths=[];this.currentPath=null}function me(a){this.type=\"Font\";this.data=a}function of(a){this.manager=void 0!==a?a:ya}function ne(a){this.manager=void 0!==a?a:ya}function pf(){this.type=\"StereoCamera\";this.aspect=1;this.eyeSep=.064;this.cameraL=new Z;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new Z;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1}function kd(a,\nb,c){H.call(this);this.type=\"CubeCamera\";var d=new Z(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new p(1,0,0));this.add(d);var e=new Z(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new p(-1,0,0));this.add(e);var f=new Z(90,1,a,b);f.up.set(0,0,1);f.lookAt(new p(0,1,0));this.add(f);var g=new Z(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new p(0,-1,0));this.add(g);var h=new Z(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new p(0,0,1));this.add(h);var l=new Z(90,1,a,b);l.up.set(0,-1,0);l.lookAt(new p(0,0,-1));this.add(l);this.renderTarget=\nnew Lb(c,c,{format:1022,magFilter:1006,minFilter:1006});this.renderTarget.texture.name=\"CubeCamera\";this.update=function(a,b){null===this.parent&&this.updateMatrixWorld();var c=this.renderTarget,m=c.texture.generateMipmaps;c.texture.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.texture.generateMipmaps=m;c.activeCubeFace=5;a.render(b,l,c);a.setRenderTarget(null)};\nthis.clear=function(a,b,c,d){for(var e=this.renderTarget,f=0;6>f;f++)e.activeCubeFace=f,a.setRenderTarget(e),a.clear(b,c,d);a.setRenderTarget(null)}}function oe(){H.call(this);this.type=\"AudioListener\";this.context=pe.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null}function qc(a){H.call(this);this.type=\"Audio\";this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.loop=\n!1;this.offset=this.startTime=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType=\"empty\";this.filters=[]}function qe(a){qc.call(this,a);this.panner=this.context.createPanner();this.panner.connect(this.gain)}function re(a,b){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function se(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case \"quaternion\":b=\nthis._slerp;break;case \"string\":case \"bool\":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function qf(a,b,c){c=c||ra.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function ra(a,b,c){this.path=b;this.parsedPath=c||ra.parseTrackName(b);this.node=ra.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function rf(){this.uuid=J.generateUUID();this._objects=Array.prototype.slice.call(arguments);\nthis.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function sf(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400,\nendingEnd:2400},e=0;e!==b;++e){var f=a[e].createInterpolant(null);c[e]=f;f.settings=d}this._interpolantSettings=d;this._interpolants=c;this._propertyBindings=Array(b);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null;this.loop=2201;this._loopCount=-1;this._startTime=null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd=\nthis.zeroSlopeAtStart=!0}function te(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Qd(a,b){\"string\"===typeof a&&(console.warn(\"THREE.Uniform: Type parameter is no longer needed.\"),a=b);this.value=a}function ue(){D.call(this);this.type=\"InstancedBufferGeometry\";this.maxInstancedCount=void 0}function ve(a,b,c,d){this.data=a;this.itemSize=b;this.offset=c;this.normalized=!0===d}function rc(a,b){this.array=a;this.stride=b;this.count=void 0!==a?a.length/\nb:0;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function we(a,b,c){rc.call(this,a,b);this.meshPerAttribute=c||1}function xe(a,b,c){L.call(this,a,b);this.meshPerAttribute=c||1}function tf(a,b,c,d){this.ray=new sb(a,b);this.near=c||0;this.far=d||Infinity;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn(\"THREE.Raycaster: params.PointCloud has been renamed to params.Points.\");return this.Points}}})}\nfunction uf(a,b){return a.distance-b.distance}function ye(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.children;d=0;for(var e=a.length;d<e;d++)ye(a[d],b,c,!0)}}function vf(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function wf(a,b,c){this.radius=void 0!==a?a:1;this.phi=void 0!==b?b:0;this.theta=void 0!==c?c:0;return this}function xf(a,b,c){this.radius=void 0!==a?a:1;this.theta=void 0!==b?b:0;this.y=void 0!==c?c:0;return this}function ze(a,\nb){this.min=void 0!==a?a:new B(Infinity,Infinity);this.max=void 0!==b?b:new B(-Infinity,-Infinity)}function ld(a){H.call(this);this.material=a;this.render=function(){}}function md(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16711680;d=void 0!==d?d:1;b=0;(c=this.object.geometry)&&c.isGeometry?b=3*c.faces.length:c&&c.isBufferGeometry&&(b=c.attributes.normal.count);c=new D;b=new z(6*b,3);c.addAttribute(\"position\",b);Y.call(this,c,new T({color:a,linewidth:d}));this.matrixAutoUpdate=\n!1;this.update()}function sc(a,b){H.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=b;a=new D;b=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(var c=0,d=1;32>c;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.addAttribute(\"position\",new z(b,3));b=new T({fog:!1});this.cone=new Y(a,b);this.add(this.cone);this.update()}function yf(a){var b=[];a&&a.isBone&&\nb.push(a);for(var c=0;c<a.children.length;c++)b.push.apply(b,yf(a.children[c]));return b}function tc(a){for(var b=yf(a),c=new D,d=[],e=[],f=new G(0,0,1),g=new G(0,1,0),h=0;h<b.length;h++){var l=b[h];l.parent&&l.parent.isBone&&(d.push(0,0,0),d.push(0,0,0),e.push(f.r,f.g,f.b),e.push(g.r,g.g,g.b))}c.addAttribute(\"position\",new z(d,3));c.addAttribute(\"color\",new z(e,3));d=new T({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Y.call(this,c,d);this.root=a;this.bones=b;this.matrix=a.matrixWorld;\nthis.matrixAutoUpdate=!1}function uc(a,b,c){this.light=a;this.light.updateMatrixWorld();this.color=c;a=new xb(b,4,2);b=new ua({wireframe:!0,fog:!1});va.call(this,a,b);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1;this.update()}function vc(a,b){H.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=b;a=new T({fog:!1});b=new D;b.addAttribute(\"position\",new L(new Float32Array(15),3));this.line=new wa(b,a);this.add(this.line);\nthis.update()}function wc(a,b,c){H.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=c;a=new ub(b);a.rotateY(.5*Math.PI);this.material=new ua({wireframe:!0,fog:!1});void 0===this.color&&(this.material.vertexColors=2);b=a.getAttribute(\"position\");b=new Float32Array(3*b.count);a.addAttribute(\"color\",new L(b,3));this.add(new va(a,this.material));this.update()}function nd(a,b,c,d){a=a||10;b=b||10;c=new G(void 0!==c?c:4473924);d=new G(void 0!==\nd?d:8947848);var e=b/2,f=a/b,g=a/2;a=[];for(var h=[],l=0,m=0,k=-g;l<=b;l++,k+=f){a.push(-g,0,k,g,0,k);a.push(k,0,-g,k,0,g);var n=l===e?c:d;n.toArray(h,m);m+=3;n.toArray(h,m);m+=3;n.toArray(h,m);m+=3;n.toArray(h,m);m+=3}b=new D;b.addAttribute(\"position\",new z(a,3));b.addAttribute(\"color\",new z(h,3));c=new T({vertexColors:2});Y.call(this,b,c)}function Rd(a,b,c,d,e,f){a=a||10;b=b||16;c=c||8;d=d||64;e=new G(void 0!==e?e:4473924);f=new G(void 0!==f?f:8947848);var g=[],h=[],l;for(l=0;l<=b;l++){var m=l/\nb*2*Math.PI;var k=Math.sin(m)*a;m=Math.cos(m)*a;g.push(0,0,0);g.push(k,0,m);var n=l&1?e:f;h.push(n.r,n.g,n.b);h.push(n.r,n.g,n.b)}for(l=0;l<=c;l++){n=l&1?e:f;var t=a-a/c*l;for(b=0;b<d;b++)m=b/d*2*Math.PI,k=Math.sin(m)*t,m=Math.cos(m)*t,g.push(k,0,m),h.push(n.r,n.g,n.b),m=(b+1)/d*2*Math.PI,k=Math.sin(m)*t,m=Math.cos(m)*t,g.push(k,0,m),h.push(n.r,n.g,n.b)}a=new D;a.addAttribute(\"position\",new z(g,3));a.addAttribute(\"color\",new z(h,3));g=new T({vertexColors:2});Y.call(this,a,g)}function od(a,b,c,d){this.object=\na;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=0;(c=this.object.geometry)&&c.isGeometry?b=c.faces.length:console.warn(\"THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.\");c=new D;b=new z(6*b,3);c.addAttribute(\"position\",b);Y.call(this,c,new T({color:a,linewidth:d}));this.matrixAutoUpdate=!1;this.update()}function xc(a,b,c){H.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=\n!1;this.color=c;void 0===b&&(b=1);a=new D;a.addAttribute(\"position\",new z([-b,b,0,b,b,0,b,-b,0,-b,-b,0,-b,b,0],3));b=new T({fog:!1});this.lightPlane=new wa(a,b);this.add(this.lightPlane);a=new D;a.addAttribute(\"position\",new z([0,0,0,0,0,1],3));this.targetLine=new wa(a,b);this.add(this.targetLine);this.update()}function pd(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){f.push(0,0,0);g.push(b.r,b.g,b.b);void 0===h[a]&&(h[a]=[]);h[a].push(f.length/3-1)}var d=new D,e=new T({color:16777215,vertexColors:1}),\nf=[],g=[],h={},l=new G(16755200),m=new G(16711680),k=new G(43775),n=new G(16777215),t=new G(3355443);b(\"n1\",\"n2\",l);b(\"n2\",\"n4\",l);b(\"n4\",\"n3\",l);b(\"n3\",\"n1\",l);b(\"f1\",\"f2\",l);b(\"f2\",\"f4\",l);b(\"f4\",\"f3\",l);b(\"f3\",\"f1\",l);b(\"n1\",\"f1\",l);b(\"n2\",\"f2\",l);b(\"n3\",\"f3\",l);b(\"n4\",\"f4\",l);b(\"p\",\"n1\",m);b(\"p\",\"n2\",m);b(\"p\",\"n3\",m);b(\"p\",\"n4\",m);b(\"u1\",\"u2\",k);b(\"u2\",\"u3\",k);b(\"u3\",\"u1\",k);b(\"c\",\"t\",n);b(\"p\",\"c\",t);b(\"cn1\",\"cn2\",t);b(\"cn3\",\"cn4\",t);b(\"cf1\",\"cf2\",t);b(\"cf3\",\"cf4\",t);d.addAttribute(\"position\",\nnew z(f,3));d.addAttribute(\"color\",new z(g,3));Y.call(this,d,e);this.camera=a;this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=h;this.update()}function Ib(a,b){this.object=a;void 0===b&&(b=16776960);a=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]);var c=new Float32Array(24),d=new D;d.setIndex(new L(a,1));d.addAttribute(\"position\",new L(c,3));Y.call(this,d,new T({color:b}));this.matrixAutoUpdate=\n!1;this.update()}function qd(a,b){this.type=\"Box3Helper\";this.box=a;a=void 0!==b?b:16776960;b=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]);var c=new D;c.setIndex(new L(b,1));c.addAttribute(\"position\",new z([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3));Y.call(this,c,new T({color:a}));this.geometry.computeBoundingSphere()}function rd(a,b,c){this.type=\"PlaneHelper\";this.plane=a;this.size=void 0===b?1:b;a=void 0!==c?c:16776960;b=new D;b.addAttribute(\"position\",\nnew z([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));b.computeBoundingSphere();wa.call(this,b,new T({color:a}));b=new D;b.addAttribute(\"position\",new z([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3));b.computeBoundingSphere();this.add(new va(b,new ua({color:a,opacity:.2,transparent:!0,depthWrite:!1})))}function Jb(a,b,c,d,e,f){H.call(this);void 0===d&&(d=16776960);void 0===c&&(c=1);void 0===e&&(e=.2*c);void 0===f&&(f=.2*e);void 0===Sd&&(Sd=new D,Sd.addAttribute(\"position\",\nnew z([0,0,0,0,1,0],3)),Ae=new ab(0,.5,1,5,1),Ae.translate(0,-.5,0));this.position.copy(b);this.line=new wa(Sd,new T({color:d}));this.line.matrixAutoUpdate=!1;this.add(this.line);this.cone=new va(Ae,new ua({color:d}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(a);this.setLength(c,e,f)}function sd(a){a=a||1;var b=[0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a];a=new D;a.addAttribute(\"position\",new z(b,3));a.addAttribute(\"color\",new z([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));b=new T({vertexColors:2});\nY.call(this,a,b)}function zf(a){console.warn(\"THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.\");pa.call(this,a);this.type=\"catmullrom\";this.closed=!0}function Af(a){console.warn(\"THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.\");pa.call(this,a);this.type=\"catmullrom\"}function Be(a){console.warn(\"THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.\");pa.call(this,a);this.type=\"catmullrom\"}void 0===Number.EPSILON&&(Number.EPSILON=\nMath.pow(2,-52));void 0===Number.isInteger&&(Number.isInteger=function(a){return\"number\"===typeof a&&isFinite(a)&&Math.floor(a)===a});void 0===Math.sign&&(Math.sign=function(a){return 0>a?-1:0<a?1:+a});!1===\"name\"in Function.prototype&&Object.defineProperty(Function.prototype,\"name\",{get:function(){return this.toString().match(/^\\s*function\\s*([^\\(\\s]*)/)[1]}});void 0===Object.assign&&function(){Object.assign=function(a){if(void 0===a||null===a)throw new TypeError(\"Cannot convert undefined or null to object\");\nfor(var b=Object(a),c=1;c<arguments.length;c++){var d=arguments[c];if(void 0!==d&&null!==d)for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&(b[e]=d[e])}return b}}();Object.assign(za.prototype,{addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)},removeEventListener:function(a,\nb){void 0!==this._listeners&&(a=this._listeners[a],void 0!==a&&(b=a.indexOf(b),-1!==b&&a.splice(b,1)))},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;b=b.slice(0);for(var c=0,d=b.length;c<d;c++)b[c].call(this,a)}}}});var J={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var a=[],b=0;256>b;b++)a[b]=(16>b?\"0\":\"\")+b.toString(16);return function(){var b=4294967295*Math.random()|0,d=4294967295*Math.random()|0,e=4294967295*\nMath.random()|0,f=4294967295*Math.random()|0;return(a[b&255]+a[b>>8&255]+a[b>>16&255]+a[b>>24&255]+\"-\"+a[d&255]+a[d>>8&255]+\"-\"+a[d>>16&15|64]+a[d>>24&255]+\"-\"+a[e&63|128]+a[e>>8&255]+\"-\"+a[e>>16&255]+a[e>>24&255]+a[f&255]+a[f>>8&255]+a[f>>16&255]+a[f>>24&255]).toUpperCase()}}(),clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a,\nb,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(a){return a*J.DEG2RAD},radToDeg:function(a){return a*J.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,\nMath.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(B.prototype,{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(B.prototype,{isVector2:!0,set:function(a,b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},\nsetComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error(\"index is out of range: \"+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error(\"index is out of range: \"+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),\nthis.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},\nsubVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},applyMatrix3:function(a){var b=this.x,c=this.y;a=a.elements;this.x=a[0]*b+a[3]*c+a[6];this.y=a[1]*b+a[4]*c+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},\nmax:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));return this},clampScalar:function(){var a=new B,b=new B;return function(c,d){a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);\nreturn this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*\nthis.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var a=Math.atan2(this.y,this.x);0>a&&(a+=2*Math.PI);return a},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)},setLength:function(a){return this.normalize().multiplyScalar(a)},\nlerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn(\"THREE.Vector2: offset has been removed from .fromBufferAttribute().\");\nthis.x=a.getX(b);this.y=a.getY(b);return this},rotateAround:function(a,b){var c=Math.cos(b);b=Math.sin(b);var d=this.x-a.x,e=this.y-a.y;this.x=d*c-e*b+a.x;this.y=d*b+e*c+a.y;return this}});Object.assign(R.prototype,{isMatrix4:!0,set:function(a,b,c,d,e,f,g,h,l,m,k,n,t,q,r,p){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=h;v[2]=l;v[6]=m;v[10]=k;v[14]=n;v[3]=t;v[7]=q;v[11]=r;v[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},\nclone:function(){return(new R).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return this},copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){a.setFromMatrixColumn(this,0);b.setFromMatrixColumn(this,1);c.setFromMatrixColumn(this,\n2);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a=new p;return function(b){var c=this.elements,d=b.elements,e=1/a.setFromMatrixColumn(b,0).length(),f=1/a.setFromMatrixColumn(b,1).length();b=1/a.setFromMatrixColumn(b,2).length();c[0]=d[0]*e;c[1]=d[1]*e;c[2]=d[2]*e;c[3]=0;c[4]=d[4]*f;c[5]=d[5]*f;c[6]=d[6]*f;c[7]=0;c[8]=d[8]*b;c[9]=d[9]*b;c[10]=d[10]*b;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return this}}(),\nmakeRotationFromEuler:function(a){a&&a.isEuler||console.error(\"THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.\");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c);c=Math.sin(c);var g=Math.cos(d);d=Math.sin(d);var h=Math.cos(e);e=Math.sin(e);if(\"XYZ\"===a.order){a=f*h;var l=f*e,m=c*h,k=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=l+m*d;b[5]=a-k*d;b[9]=-c*g;b[2]=k-a*d;b[6]=m+l*d;b[10]=f*g}else\"YXZ\"===a.order?(a=g*h,l=g*e,m=d*h,k=d*e,b[0]=a+k*c,b[4]=m*c-l,\nb[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=l*c-m,b[6]=k+a*c,b[10]=f*g):\"ZXY\"===a.order?(a=g*h,l=g*e,m=d*h,k=d*e,b[0]=a-k*c,b[4]=-f*e,b[8]=m+l*c,b[1]=l+m*c,b[5]=f*h,b[9]=k-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):\"ZYX\"===a.order?(a=f*h,l=f*e,m=c*h,k=c*e,b[0]=g*h,b[4]=m*d-l,b[8]=a*d+k,b[1]=g*e,b[5]=k*d+a,b[9]=l*d-m,b[2]=-d,b[6]=c*g,b[10]=f*g):\"YZX\"===a.order?(a=f*g,l=f*d,m=c*g,k=c*d,b[0]=g*h,b[4]=k-a*e,b[8]=m*e+l,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+m,b[10]=a-k*e):\"XZY\"===a.order&&(a=f*g,l=f*d,m=c*g,k=\nc*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+k,b[5]=f*h,b[9]=l*e-m,b[2]=m*e-l,b[6]=c*h,b[10]=k*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(){var a=new p(0,0,0),b=new p(1,1,1);return function(c){return this.compose(a,c,b)}}(),lookAt:function(){var a=new p,b=new p,c=new p;return function(d,e,f){var g=this.elements;c.subVectors(d,e);0===c.lengthSq()&&(c.z=1);c.normalize();a.crossVectors(f,c);0===a.lengthSq()&&(1===Math.abs(f.z)?c.x+=1E-4:c.z+=\n1E-4,c.normalize(),a.crossVectors(f,c));a.normalize();b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn(\"THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.\"),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;\nb=this.elements;a=c[0];var e=c[4],f=c[8],g=c[12],h=c[1],l=c[5],m=c[9],k=c[13],n=c[2],t=c[6],q=c[10],r=c[14],p=c[3],y=c[7],w=c[11];c=c[15];var x=d[0],A=d[4],C=d[8],O=d[12],Q=d[1],z=d[5],B=d[9],H=d[13],G=d[2],D=d[6],E=d[10],J=d[14],L=d[3],I=d[7],K=d[11];d=d[15];b[0]=a*x+e*Q+f*G+g*L;b[4]=a*A+e*z+f*D+g*I;b[8]=a*C+e*B+f*E+g*K;b[12]=a*O+e*H+f*J+g*d;b[1]=h*x+l*Q+m*G+k*L;b[5]=h*A+l*z+m*D+k*I;b[9]=h*C+l*B+m*E+k*K;b[13]=h*O+l*H+m*J+k*d;b[2]=n*x+t*Q+q*G+r*L;b[6]=n*A+t*z+q*D+r*I;b[10]=n*C+t*B+q*E+r*K;b[14]=n*\nO+t*H+q*J+r*d;b[3]=p*x+y*Q+w*G+c*L;b[7]=p*A+y*z+w*D+c*I;b[11]=p*C+y*B+w*E+c*K;b[15]=p*O+y*H+w*J+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applyToBufferAttribute:function(){var a=new p;return function(b){for(var c=0,d=b.count;c<d;c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(c,a.x,a.y,a.z);return b}}(),\ndeterminant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],l=a[13],m=a[2],k=a[6],n=a[10],t=a[14];return a[3]*(+e*h*k-d*l*k-e*g*n+c*l*n+d*g*t-c*h*t)+a[7]*(+b*h*t-b*l*n+e*f*n-d*f*t+d*l*m-e*h*m)+a[11]*(+b*l*k-b*g*t-e*f*k+c*f*t+e*g*m-c*l*m)+a[15]*(-d*g*m-b*h*k+b*g*n+d*f*k-c*f*n+c*h*m)},transpose:function(){var a=this.elements;var b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];\na[14]=b;return this},setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements;a=d[0];var e=d[1],f=d[2],g=d[3],h=d[4],l=d[5],m=d[6],k=d[7],n=d[8],t=d[9],q=d[10],r=d[11],p=d[12],y=d[13],w=d[14];d=d[15];var x=t*w*k-y*q*k+y*m*r-l*w*r-t*m*d+l*q*d,A=p*q*k-n*w*k-p*m*r+h*w*r+n*m*d-h*q*d,C=n*y*k-p*t*k+p*l*r-h*y*r-n*l*d+h*t*d,O=p*t*m-n*y*m-p*l*q+h*y*q+n*l*w-h*t*w,Q=a*x+e*A+f*C+g*O;if(0===Q){if(!0===b)throw Error(\"THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0\");\nconsole.warn(\"THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0\");return this.identity()}b=1/Q;c[0]=x*b;c[1]=(y*q*g-t*w*g-y*f*r+e*w*r+t*f*d-e*q*d)*b;c[2]=(l*w*g-y*m*g+y*f*k-e*w*k-l*f*d+e*m*d)*b;c[3]=(t*m*g-l*q*g-t*f*k+e*q*k+l*f*r-e*m*r)*b;c[4]=A*b;c[5]=(n*w*g-p*q*g+p*f*r-a*w*r-n*f*d+a*q*d)*b;c[6]=(p*m*g-h*w*g-p*f*k+a*w*k+h*f*d-a*m*d)*b;c[7]=(h*q*g-n*m*g+n*f*k-a*q*k-h*f*r+a*m*r)*b;c[8]=C*b;c[9]=(p*t*g-n*y*g-p*e*r+a*y*r+n*e*d-a*t*d)*b;c[10]=(h*y*g-p*l*g+p*e*k-a*y*k-h*e*d+a*l*d)*b;c[11]=\n(n*l*g-h*t*g-n*e*k+a*t*k+h*e*r-a*l*r)*b;c[12]=O*b;c[13]=(n*y*f-p*t*f+p*e*q-a*y*q-n*e*w+a*t*w)*b;c[14]=(p*l*f-h*y*f-p*e*m+a*y*m+h*e*w-a*l*w)*b;c[15]=(h*t*f-n*l*f+n*e*m-a*t*m-h*e*q+a*l*q)*b;return this},scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],a[4]*a[4]+a[5]*a[5]+a[6]*a[6],\na[8]*a[8]+a[9]*a[9]+a[10]*a[10]))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=\nMath.cos(b);b=Math.sin(b);var d=1-c,e=a.x,f=a.y;a=a.z;var g=d*e,h=d*f;this.set(g*e+c,g*f-b*a,g*a+b*f,0,g*f+b*a,h*f+c,h*a-b*e,0,g*a-b*f,h*a+b*e,d*a*a+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},makeShear:function(a,b,c){this.set(1,b,c,0,a,1,c,0,a,b,1,0,0,0,0,1);return this},compose:function(a,b,c){var d=this.elements,e=b._x,f=b._y,g=b._z,h=b._w,l=e+e,m=f+f,k=g+g;b=e*l;var n=e*m;e*=k;var t=f*m;f*=k;g*=k;l*=h;m*=h;h*=k;k=c.x;var q=c.y;c=\nc.z;d[0]=(1-(t+g))*k;d[1]=(n+h)*k;d[2]=(e-m)*k;d[3]=0;d[4]=(n-h)*q;d[5]=(1-(b+g))*q;d[6]=(f+l)*q;d[7]=0;d[8]=(e+m)*c;d[9]=(f-l)*c;d[10]=(1-(b+t))*c;d[11]=0;d[12]=a.x;d[13]=a.y;d[14]=a.z;d[15]=1;return this},decompose:function(){var a=new p,b=new R;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),l=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.copy(this);c=1/g;f=1/h;var m=1/l;b.elements[0]*=c;\nb.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=m;b.elements[9]*=m;b.elements[10]*=m;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=l;return this}}(),makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn(\"THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.\");var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(c-d);g[9]=(c+d)/(c-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+\ne)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=1/(b-a),l=1/(c-d),m=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);g[1]=0;g[5]=2*l;g[9]=0;g[13]=-((c+d)*l);g[2]=0;g[6]=0;g[10]=-2*m;g[14]=-((f+e)*m);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements;a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=\na[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});Object.assign(ca,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h=c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],n=e[f+2];e=e[f+3];if(c!==\ne||h!==d||l!==k||m!==n){f=1-g;var t=h*d+l*k+m*n+c*e,q=0<=t?1:-1,p=1-t*t;p>Number.EPSILON&&(p=Math.sqrt(p),t=Math.atan2(p,t*q),f=Math.sin(f*t)/p,g=Math.sin(g*t)/p);q*=g;h=h*f+d*q;l=l*f+k*q;m=m*f+n*q;c=c*f+e*q;f===1-g&&(g=1/Math.sqrt(h*h+l*l+m*m+c*c),h*=g,l*=g,m*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(ca.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},\nz:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this.onChangeCallback()}}});Object.assign(ca.prototype,{set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,\nb){if(!a||!a.isEuler)throw Error(\"THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.\");var c=a._x,d=a._y,e=a._z;a=a.order;var f=Math.cos,g=Math.sin,h=f(c/2),l=f(d/2);f=f(e/2);c=g(c/2);d=g(d/2);e=g(e/2);\"XYZ\"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f-c*d*e):\"YXZ\"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f+c*d*e):\"ZXY\"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e+c*d*\nf,this._w=h*l*f-c*d*e):\"ZYX\"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f+c*d*e):\"YZX\"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f-c*d*e):\"XZY\"===a&&(this._x=c*l*f-h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f+c*d*e);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,b){b/=2;var c=Math.sin(b);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=Math.cos(b);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=\na.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],l=b[6];b=b[10];var m=c+f+b;0<m?(c=.5/Math.sqrt(m+1),this._w=.25/c,this._x=(l-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(l-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+l)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+l)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a=\nnew p,b;return function(c,d){void 0===a&&(a=new p);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;return this.normalize()}}(),inverse:function(){return this.conjugate()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+\nthis._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},multiply:function(a,b){return void 0!==b?(console.warn(\"THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.\"),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,\na)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z;a=a._w;var f=b._x,g=b._y,h=b._z;b=b._w;this._x=c*b+a*f+d*h-e*g;this._y=d*b+a*g+e*f-c*h;this._z=e*b+a*h+c*g-d*f;this._w=a*b-c*f-d*g-e*h;this.onChangeCallback();return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,\ng=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;a=1-g*g;if(a<=Number.EPSILON)return g=1-b,this._w=g*f+b*this._w,this._x=g*c+b*this._x,this._y=g*d+b*this._y,this._z=g*e+b*this._z,this.normalize();a=Math.sqrt(a);var h=Math.atan2(a,g);g=Math.sin((1-b)*h)/a;b=Math.sin(b*h)/a;this._w=f*g+this._w*b;this._x=c*g+this._x*b;this._y=d*g+this._y*b;this._z=e*g+this._z*b;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&\na._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(p.prototype,{isVector3:!0,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setScalar:function(a){this.z=this.y=\nthis.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error(\"index is out of range: \"+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(\"index is out of range: \"+a);}},clone:function(){return new this.constructor(this.x,\nthis.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=\na.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.\"),\nthis.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a=new ca;return function(b){b&&b.isEuler||console.error(\"THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.\");return this.applyQuaternion(a.setFromEuler(b))}}(),applyAxisAngle:function(){var a=new ca;return function(b,\nc){return this.applyQuaternion(a.setFromAxisAngle(b,c))}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,\nc=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,l=a*c+g*b-e*d,m=a*d+e*c-f*b;b=-e*b-f*c-g*d;this.x=h*a+b*-e+l*-g-m*-f;this.y=l*a+b*-f+m*-e-h*-g;this.z=m*a+b*-g+h*-f-l*-e;return this},project:function(){var a=new R;return function(b){a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyMatrix4(a)}}(),unproject:function(){var a=new R;return function(b){a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix));return this.applyMatrix4(a)}}(),transformDirection:function(a){var b=\nthis.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;return this.normalize()},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);return this},clamp:function(a,\nb){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));return this},clampScalar:function(){var a=new p,b=new p;return function(c,d){a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=\nMath.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*\na.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpVectors:function(a,\nb,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},cross:function(a,b){return void 0!==b?(console.warn(\"THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.\"),this.crossVectors(a,b)):this.crossVectors(this,a)},crossVectors:function(a,b){var c=a.x,d=a.y;a=a.z;var e=b.x,f=b.y;b=b.z;this.x=d*b-a*f;this.y=a*e-c*b;this.z=c*f-d*e;return this},projectOnVector:function(a){var b=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(){var a=\nnew p;return function(b){a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a=new p;return function(b){return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(J.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-\na.x)+Math.abs(this.y-a.y)+Math.abs(this.z-a.z)},setFromSpherical:function(a){var b=Math.sin(a.phi)*a.radius;this.x=b*Math.sin(a.theta);this.y=Math.cos(a.phi)*a.radius;this.z=b*Math.cos(a.theta);return this},setFromCylindrical:function(a){this.x=a.radius*Math.sin(a.theta);this.y=a.y;this.z=a.radius*Math.cos(a.theta);return this},setFromMatrixPosition:function(a){a=a.elements;this.x=a[12];this.y=a[13];this.z=a[14];return this},setFromMatrixScale:function(a){var b=this.setFromMatrixColumn(a,0).length(),\nc=this.setFromMatrixColumn(a,1).length();a=this.setFromMatrixColumn(a,2).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){return this.fromArray(a.elements,4*b)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromBufferAttribute:function(a,b,c){void 0!==\nc&&console.warn(\"THREE.Vector3: offset has been removed from .fromBufferAttribute().\");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this}});Object.assign(la.prototype,{isMatrix3:!0,set:function(a,b,c,d,e,f,g,h,l){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=h;m[6]=c;m[7]=f;m[8]=l;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;\nb[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this},applyToBufferAttribute:function(){var a=new p;return function(b){for(var c=0,d=b.count;c<d;c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix3(this),b.setXYZ(c,a.x,a.y,a.z);return b}}(),multiply:function(a){return this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,\nthis)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;b=this.elements;a=c[0];var e=c[3],f=c[6],g=c[1],h=c[4],l=c[7],m=c[2],k=c[5];c=c[8];var n=d[0],t=d[3],q=d[6],p=d[1],u=d[4],y=d[7],w=d[2],x=d[5];d=d[8];b[0]=a*n+e*p+f*w;b[3]=a*t+e*u+f*x;b[6]=a*q+e*y+f*d;b[1]=g*n+h*p+l*w;b[4]=g*t+h*u+l*x;b[7]=g*q+h*y+l*d;b[2]=m*n+k*p+c*w;b[5]=m*t+k*u+c*x;b[8]=m*q+k*y+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=\na;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],l=a[7];a=a[8];return b*f*a-b*g*l-c*e*a+c*g*h+d*e*l-d*f*h},getInverse:function(a,b){a&&a.isMatrix4&&console.error(\"THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.\");var c=a.elements;a=this.elements;var d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],l=c[5],m=c[6],k=c[7];c=c[8];var n=c*h-l*k,p=l*m-c*g,q=k*g-h*m,r=d*n+e*p+f*q;if(0===r){if(!0===b)throw Error(\"THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0\");\nconsole.warn(\"THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0\");return this.identity()}b=1/r;a[0]=n*b;a[1]=(f*k-c*e)*b;a[2]=(l*e-f*h)*b;a[3]=p*b;a[4]=(c*d-f*m)*b;a[5]=(f*g-l*d)*b;a[6]=q*b;a[7]=(e*m-k*d)*b;a[8]=(h*d-e*g)*b;return this},transpose:function(){var a=this.elements;var b=a[1];a[1]=a[3];a[3]=b;b=a[2];a[2]=a[6];a[6]=b;b=a[5];a[5]=a[7];a[7]=b;return this},getNormalMatrix:function(a){return this.setFromMatrix4(a).getInverse(this).transpose()},transposeIntoArray:function(a){var b=\nthis.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},setUvTransform:function(a,b,c,d,e,f,g){var h=Math.cos(e);e=Math.sin(e);this.set(c*h,c*e,-c*(h*f+e*g)+f+a,-d*e,d*h,-d*(-e*f+h*g)+g+b,0,0,1)},scale:function(a,b){var c=this.elements;c[0]*=a;c[3]*=a;c[6]*=a;c[1]*=b;c[4]*=b;c[7]*=b;return this},rotate:function(a){var b=Math.cos(a);a=Math.sin(a);var c=this.elements,d=c[0],e=c[3],f=c[6],g=c[1],h=c[4],l=c[7];c[0]=b*d+a*g;c[3]=b*e+a*h;c[6]=\nb*f+a*l;c[1]=-a*d+b*g;c[4]=-a*e+b*h;c[7]=-a*f+b*l;return this},translate:function(a,b){var c=this.elements;c[0]+=a*c[2];c[3]+=a*c[5];c[6]+=a*c[8];c[1]+=b*c[2];c[4]+=b*c[5];c[7]+=b*c[8];return this},equals:function(a){var b=this.elements;a=a.elements;for(var c=0;9>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];\na[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}});var Ff=0;ea.DEFAULT_IMAGE=void 0;ea.DEFAULT_MAPPING=300;ea.prototype=Object.assign(Object.create(za.prototype),{constructor:ea,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(a){this.name=a.name;this.image=a.image;this.mipmaps=\na.mipmaps.slice(0);this.mapping=a.mapping;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy=a.anisotropy;this.format=a.format;this.type=a.type;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.center.copy(a.center);this.rotation=a.rotation;this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrix.copy(a.matrix);this.generateMipmaps=a.generateMipmaps;this.premultiplyAlpha=a.premultiplyAlpha;this.flipY=a.flipY;this.unpackAlignment=a.unpackAlignment;\nthis.encoding=a.encoding;return this},toJSON:function(a){function b(a){if(a instanceof HTMLCanvasElement)var b=a;else{b=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\");b.width=a.width;b.height=a.height;var c=b.getContext(\"2d\");a instanceof ImageData?c.putImageData(a,0,0):c.drawImage(a,0,0,a.width,a.height)}return 2048<b.width||2048<b.height?b.toDataURL(\"image/jpeg\",.6):b.toDataURL(\"image/png\")}var c=void 0===a||\"string\"===typeof a;if(!c&&void 0!==a.textures[this.uuid])return a.textures[this.uuid];\nvar d={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,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var e=this.image;void 0===e.uuid&&(e.uuid=J.generateUUID());if(!c&&void 0===a.images[e.uuid]){if(Array.isArray(e)){var f=\n[];for(var g=0,h=e.length;g<h;g++)f.push(b(e[g]))}else f=b(e);a.images[e.uuid]={uuid:e.uuid,url:f}}d.image=e.uuid}c||(a.textures[this.uuid]=d);return d},dispose:function(){this.dispatchEvent({type:\"dispose\"})},transformUv:function(a){if(300===this.mapping){a.applyMatrix3(this.matrix);if(0>a.x||1<a.x)switch(this.wrapS){case 1E3:a.x-=Math.floor(a.x);break;case 1001:a.x=0>a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0>a.y||1<a.y)switch(this.wrapT){case 1E3:a.y-=\nMath.floor(a.y);break;case 1001:a.y=0>a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y)}}});Object.defineProperty(ea.prototype,\"needsUpdate\",{set:function(a){!0===a&&this.version++}});Object.assign(W.prototype,{isVector4:!0,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},\nsetZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error(\"index is out of range: \"+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(\"index is out of range: \"+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,\nthis.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addScaledVector:function(a,\nb){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;this.w-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=\na;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/\nb);return this},setAxisAngleFromRotationMatrix:function(a){a=a.elements;var b=a[0];var c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9];var h=a[2];var l=a[6];var m=a[10];if(.01>Math.abs(c-e)&&.01>Math.abs(d-h)&&.01>Math.abs(g-l)){if(.1>Math.abs(c+e)&&.1>Math.abs(d+h)&&.1>Math.abs(g+l)&&.1>Math.abs(b+f+m-3))return this.set(1,0,0,0),this;a=Math.PI;b=(b+1)/2;f=(f+1)/2;m=(m+1)/2;c=(c+e)/4;d=(d+h)/4;g=(g+l)/4;b>f&&b>m?.01>b?(l=0,c=h=.707106781):(l=Math.sqrt(b),h=c/l,c=d/l):f>m?.01>f?(l=.707106781,h=0,c=.707106781):\n(h=Math.sqrt(f),l=c/h,c=g/h):.01>m?(h=l=.707106781,c=0):(c=Math.sqrt(m),l=d/c,h=g/c);this.set(l,h,c,a);return this}a=Math.sqrt((l-g)*(l-g)+(d-h)*(d-h)+(e-c)*(e-c));.001>Math.abs(a)&&(a=1);this.x=(l-g)/a;this.y=(d-h)/a;this.z=(e-c)/a;this.w=Math.acos((b+f+m-1)/2);return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);this.w=Math.min(this.w,a.w);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,\na.z);this.w=Math.max(this.w,a.w);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));this.w=Math.max(a.w,Math.min(b.w,this.w));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new W,b=new W);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},\nfloor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):\nMath.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+\nMath.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===\nb&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn(\"THREE.Vector4: offset has been removed from .fromBufferAttribute().\");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}});kb.prototype=Object.assign(Object.create(za.prototype),{constructor:kb,isWebGLRenderTarget:!0,\nsetSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport);this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:\"dispose\"})}});\nLb.prototype=Object.create(kb.prototype);Lb.prototype.constructor=Lb;Lb.prototype.isWebGLRenderTargetCube=!0;lb.prototype=Object.create(ea.prototype);lb.prototype.constructor=lb;lb.prototype.isDataTexture=!0;Object.assign(Xa.prototype,{isBox3:!0,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromArray:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.length;h<l;h+=3){var m=a[h],k=a[h+1],n=a[h+2];m<b&&(b=m);k<c&&(c=k);n<d&&(d=n);m>\ne&&(e=m);k>f&&(f=k);n>g&&(g=n)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.count;h<l;h++){var m=a.getX(h),k=a.getY(h),n=a.getZ(h);m<b&&(b=m);k<c&&(c=k);n<d&&(d=n);m>e&&(e=m);k>f&&(f=k);n>g&&(g=n)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=\nnew p;return function(b,c){c=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(c);this.max.copy(b).add(c);return this}}(),setFromObject:function(a){this.makeEmpty();return this.expandByObject(a)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=this.min.z=Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<\nthis.min.y||this.max.z<this.min.z},getCenter:function(a){void 0===a&&(console.warn(\"THREE.Box3: .getCenter() target is now required\"),a=new p);return this.isEmpty()?a.set(0,0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(a){void 0===a&&(console.warn(\"THREE.Box3: .getSize() target is now required\"),a=new p);return this.isEmpty()?a.set(0,0,0):a.subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);\nthis.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},expandByObject:function(){function a(a){var f=a.geometry;if(void 0!==f)if(f.isGeometry)for(f=f.vertices,c=0,d=f.length;c<d;c++)e.copy(f[c]),e.applyMatrix4(a.matrixWorld),b.expandByPoint(e);else if(f.isBufferGeometry&&(f=f.attributes.position,void 0!==f))for(c=0,d=f.count;c<d;c++)e.fromBufferAttribute(f,c).applyMatrix4(a.matrixWorld),b.expandByPoint(e)}var b,c,d,e=new p;return function(c){b=\nthis;c.updateMatrixWorld(!0);c.traverse(a);return this}}(),containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y||a.z<this.min.z||a.z>this.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getParameter:function(a,b){void 0===b&&(console.warn(\"THREE.Box3: .getParameter() target is now required\"),b=new p);return b.set((a.x-this.min.x)/(this.max.x-\nthis.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y||a.max.z<this.min.z||a.min.z>this.max.z?!1:!0},intersectsSphere:function(){var a=new p;return function(b){this.clampPoint(b.center,a);return a.distanceToSquared(b.center)<=b.radius*b.radius}}(),intersectsPlane:function(a){if(0<a.normal.x){var b=a.normal.x*this.min.x;var c=a.normal.x*this.max.x}else b=\na.normal.x*this.max.x,c=a.normal.x*this.min.x;0<a.normal.y?(b+=a.normal.y*this.min.y,c+=a.normal.y*this.max.y):(b+=a.normal.y*this.max.y,c+=a.normal.y*this.min.y);0<a.normal.z?(b+=a.normal.z*this.min.z,c+=a.normal.z*this.max.z):(b+=a.normal.z*this.max.z,c+=a.normal.z*this.min.z);return b<=a.constant&&c>=a.constant},intersectsTriangle:function(){function a(a){var e;var f=0;for(e=a.length-3;f<=e;f+=3){h.fromArray(a,f);var g=m.x*Math.abs(h.x)+m.y*Math.abs(h.y)+m.z*Math.abs(h.z),l=b.dot(h),k=c.dot(h),\nn=d.dot(h);if(Math.max(-Math.max(l,k,n),Math.min(l,k,n))>g)return!1}return!0}var b=new p,c=new p,d=new p,e=new p,f=new p,g=new p,h=new p,l=new p,m=new p,k=new p;return function(h){if(this.isEmpty())return!1;this.getCenter(l);m.subVectors(this.max,l);b.subVectors(h.a,l);c.subVectors(h.b,l);d.subVectors(h.c,l);e.subVectors(c,b);f.subVectors(d,c);g.subVectors(b,d);h=[0,-e.z,e.y,0,-f.z,f.y,0,-g.z,g.y,e.z,0,-e.x,f.z,0,-f.x,g.z,0,-g.x,-e.y,e.x,0,-f.y,f.x,0,-g.y,g.x,0];if(!a(h))return!1;h=[1,0,0,0,1,0,0,\n0,1];if(!a(h))return!1;k.crossVectors(e,f);h=[k.x,k.y,k.z];return a(h)}}(),clampPoint:function(a,b){void 0===b&&(console.warn(\"THREE.Box3: .clampPoint() target is now required\"),b=new p);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new p;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new p;return function(b){void 0===b&&(console.warn(\"THREE.Box3: .getBoundingSphere() target is now required\"),b=new Ha);\nthis.getCenter(b.center);b.radius=.5*this.getSize(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(a){if(this.isEmpty())return this;a=a.elements;var b=a[0]*this.min.x,c=a[1]*this.min.x,d=a[2]*this.min.x,e=a[0]*this.max.x,f=a[1]*this.max.x,g=a[2]*this.max.x,h=a[4]*this.min.y,l=a[5]*this.min.y,m=a[6]*this.min.y,k=a[4]*this.max.y,\nn=a[5]*this.max.y,p=a[6]*this.max.y,q=a[8]*this.min.z,r=a[9]*this.min.z,u=a[10]*this.min.z,y=a[8]*this.max.z,w=a[9]*this.max.z,x=a[10]*this.max.z;this.min.x=Math.min(b,e)+Math.min(h,k)+Math.min(q,y)+a[12];this.min.y=Math.min(c,f)+Math.min(l,n)+Math.min(r,w)+a[13];this.min.z=Math.min(d,g)+Math.min(m,p)+Math.min(u,x)+a[14];this.max.x=Math.max(b,e)+Math.max(h,k)+Math.max(q,y)+a[12];this.max.y=Math.max(c,f)+Math.max(l,n)+Math.max(r,w)+a[13];this.max.z=Math.max(d,g)+Math.max(m,p)+Math.max(u,x)+a[14];return this},\ntranslate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});Object.assign(Ha.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new Xa;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).getCenter(d);for(var e=c=0,f=b.length;e<f;e++)c=Math.max(c,d.distanceToSquared(b[e]));this.radius=Math.sqrt(c);return this}}(),clone:function(){return(new this.constructor).copy(this)},\ncopy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(a.distanceToPoint(this.center))<=\nthis.radius},clampPoint:function(a,b){var c=this.center.distanceToSquared(a);void 0===b&&(console.warn(\"THREE.Sphere: .clampPoint() target is now required\"),b=new p);b.copy(a);c>this.radius*this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center));return b},getBoundingBox:function(a){void 0===a&&(console.warn(\"THREE.Sphere: .getBoundingBox() target is now required\"),a=new Xa);a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);\nthis.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}});Object.assign(Ia.prototype,{set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=\nnew p,b=new p;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,c);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+\nthis.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){void 0===b&&(console.warn(\"THREE.Plane: .projectPoint() target is now required\"),b=new p);return b.copy(this.normal).multiplyScalar(-this.distanceToPoint(a)).add(a)},intersectLine:function(){var a=new p;return function(b,c){void 0===c&&(console.warn(\"THREE.Plane: .intersectLine() target is now required\"),c=new p);var d=b.delta(a),e=this.normal.dot(d);if(0===e){if(0===this.distanceToPoint(b.start))return c.copy(b.start)}else if(e=\n-(b.start.dot(this.normal)+this.constant)/e,!(0>e||1<e))return c.copy(d).multiplyScalar(e).add(b.start)}}(),intersectsLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0<a||0>a&&0<b},intersectsBox:function(a){return a.intersectsPlane(this)},intersectsSphere:function(a){return a.intersectsPlane(this)},coplanarPoint:function(a){void 0===a&&(console.warn(\"THREE.Plane: .coplanarPoint() target is now required\"),a=new p);return a.copy(this.normal).multiplyScalar(-this.constant)},\napplyMatrix4:function(){var a=new p,b=new la;return function(c,d){d=d||b.getNormalMatrix(c);c=this.coplanarPoint(a).applyMatrix4(c);d=this.normal.applyMatrix3(d).normalize();this.constant=-c.dot(d);return this}}(),translate:function(a){this.constant-=a.dot(this.normal);return this},equals:function(a){return a.normal.equals(this.normal)&&a.constant===this.constant}});Object.assign(td.prototype,{set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);\ng[5].copy(f);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],m=c[7],k=c[8],n=c[9],p=c[10],q=c[11],r=c[12],u=c[13],y=c[14];c=c[15];b[0].setComponents(f-a,m-g,q-k,c-r).normalize();b[1].setComponents(f+a,m+g,q+k,c+r).normalize();b[2].setComponents(f+d,m+h,q+n,c+u).normalize();b[3].setComponents(f-\nd,m-h,q-n,c-u).normalize();b[4].setComponents(f-e,m-l,q-p,c-y).normalize();b[5].setComponents(f+e,m+l,q+p,c+y).normalize();return this},intersectsObject:function(){var a=new Ha;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSprite:function(){var a=new Ha;return function(b){a.center.set(0,0,0);a.radius=.7071067811865476;a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),\nintersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new p,b=new p;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var g=f.distanceToPoint(a);f=f.distanceToPoint(b);if(0>\ng&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});var S={alphamap_fragment:\"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\\n#endif\\n\",alphamap_pars_fragment:\"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\\n\",alphatest_fragment:\"#ifdef ALPHATEST\\n\\tif ( diffuseColor.a < ALPHATEST ) discard;\\n#endif\\n\",aomap_fragment:\"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\\n\\t#endif\\n#endif\\n\",\naomap_pars_fragment:\"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\",begin_vertex:\"\\nvec3 transformed = vec3( position );\\n\",beginnormal_vertex:\"\\nvec3 objectNormal = vec3( normal );\\n\",bsdfs:\"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\\tif( decayExponent > 0.0 ) {\\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\treturn distanceFalloff * maxDistanceCutoffFactor;\\n#else\\n\\t\\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n#endif\\n\\t}\\n\\treturn 1.0;\\n}\\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\\n\\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\\n\\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\\n\\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\\n}\\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\treturn 1.0 / ( gl * gv );\\n}\\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\\n\\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\\n\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\\n\\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, dotLH );\\n\\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\tfloat D = D_GGX( alpha, dotNH );\\n\\treturn F * ( G * D );\\n}\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\n\\tconst float LUT_SIZE  = 64.0;\\n\\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\\n\\tconst float LUT_BIAS  = 0.5 / LUT_SIZE;\\n\\tfloat dotNV = saturate( dot( N, V ) );\\n\\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\\tfloat l = length( f );\\n\\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\\tfloat x = dot( v1, v2 );\\n\\tfloat y = abs( x );\\n\\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\\n\\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\\n\\tfloat v = a / b;\\n\\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\\tvec3 lightNormal = cross( v1, v2 );\\n\\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\\tvec3 T1, T2;\\n\\tT1 = normalize( V - N * dot( V, N ) );\\n\\tT2 = - cross( N, T1 );\\n\\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\\n\\tvec3 coords[ 4 ];\\n\\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\\tvec3 vectorFormFactor = vec3( 0.0 );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\\treturn vec3( result );\\n}\\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\\tvec4 r = roughness * c0 + c1;\\n\\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\\n\\treturn specularColor * AB.x + AB.y;\\n}\\nfloat G_BlinnPhong_Implicit( ) {\\n\\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\\n\\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\\n\\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\\n\\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, dotLH );\\n\\tfloat G = G_BlinnPhong_Implicit( );\\n\\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\\treturn F * ( G * D );\\n}\\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\\n\\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\\n}\\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\\n\\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\\n}\\n\",\nbumpmap_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\\n\",\nclipping_planes_fragment:\"#if NUM_CLIPPING_PLANES > 0\\n\\tvec4 plane;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\tplane = clippingPlanes[ i ];\\n\\t\\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\\n\\t}\\n\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\tbool clipped = true;\\n\\t\\t#pragma unroll_loop\\n\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t}\\n\\t\\tif ( clipped ) discard;\\n\\t#endif\\n#endif\\n\",\nclipping_planes_pars_fragment:\"#if NUM_CLIPPING_PLANES > 0\\n\\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\\n\\t\\tvarying vec3 vViewPosition;\\n\\t#endif\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\\n\",clipping_planes_pars_vertex:\"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n\",clipping_planes_vertex:\"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n\",\ncolor_fragment:\"#ifdef USE_COLOR\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\",color_pars_fragment:\"#ifdef USE_COLOR\\n\\tvarying vec3 vColor;\\n#endif\\n\",color_pars_vertex:\"#ifdef USE_COLOR\\n\\tvarying vec3 vColor;\\n#endif\",color_vertex:\"#ifdef USE_COLOR\\n\\tvColor.xyz = color.xyz;\\n#endif\",common:\"#define PI 3.14159265359\\n#define PI2 6.28318530718\\n#define PI_HALF 1.5707963267949\\n#define RECIPROCAL_PI 0.31830988618\\n#define RECIPROCAL_PI2 0.15915494\\n#define LOG2 1.442695\\n#define EPSILON 1e-6\\n#define saturate(a) clamp( a, 0.0, 1.0 )\\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\\treturn fract(sin(sn) * c);\\n}\\nstruct IncidentLight {\\n\\tvec3 color;\\n\\tvec3 direction;\\n\\tbool visible;\\n};\\nstruct ReflectedLight {\\n\\tvec3 directDiffuse;\\n\\tvec3 directSpecular;\\n\\tvec3 indirectDiffuse;\\n\\tvec3 indirectSpecular;\\n};\\nstruct GeometricContext {\\n\\tvec3 position;\\n\\tvec3 normal;\\n\\tvec3 viewDir;\\n};\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\\n\\tfloat distance = dot( planeNormal, point - pointOnPlane );\\n\\treturn - distance * planeNormal + point;\\n}\\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\\n\\treturn sign( dot( point - pointOnPlane, planeNormal ) );\\n}\\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\\n\\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\\n}\\nmat3 transposeMat3( const in mat3 m ) {\\n\\tmat3 tmp;\\n\\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\\n\\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\\n\\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\\n\\treturn tmp;\\n}\\nfloat linearToRelativeLuminance( const in vec3 color ) {\\n\\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\\n\\treturn dot( weights, color.rgb );\\n}\\n\",\ncube_uv_reflection_fragment:\"#ifdef ENVMAP_TYPE_CUBE_UV\\n#define cubeUV_textureSize (1024.0)\\nint getFaceFromDirection(vec3 direction) {\\n\\tvec3 absDirection = abs(direction);\\n\\tint face = -1;\\n\\tif( absDirection.x > absDirection.z ) {\\n\\t\\tif(absDirection.x > absDirection.y )\\n\\t\\t\\tface = direction.x > 0.0 ? 0 : 3;\\n\\t\\telse\\n\\t\\t\\tface = direction.y > 0.0 ? 1 : 4;\\n\\t}\\n\\telse {\\n\\t\\tif(absDirection.z > absDirection.y )\\n\\t\\t\\tface = direction.z > 0.0 ? 2 : 5;\\n\\t\\telse\\n\\t\\t\\tface = direction.y > 0.0 ? 1 : 4;\\n\\t}\\n\\treturn face;\\n}\\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\\n\\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\\n\\tfloat dxRoughness = dFdx(roughness);\\n\\tfloat dyRoughness = dFdy(roughness);\\n\\tvec3 dx = dFdx( vec * scale * dxRoughness );\\n\\tvec3 dy = dFdy( vec * scale * dyRoughness );\\n\\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\\n\\td = clamp(d, 1.0, cubeUV_rangeClamp);\\n\\tfloat mipLevel = 0.5 * log2(d);\\n\\treturn vec2(floor(mipLevel), fract(mipLevel));\\n}\\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\\n\\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\\n\\tfloat a = 16.0 * cubeUV_rcpTextureSize;\\n\\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\\n\\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\\n\\tfloat powScale = exp2_packed.x * exp2_packed.y;\\n\\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\\n\\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\\n\\tbool bRes = mipLevel == 0.0;\\n\\tscale =  bRes && (scale < a) ? a : scale;\\n\\tvec3 r;\\n\\tvec2 offset;\\n\\tint face = getFaceFromDirection(direction);\\n\\tfloat rcpPowScale = 1.0 / powScale;\\n\\tif( face == 0) {\\n\\t\\tr = vec3(direction.x, -direction.z, direction.y);\\n\\t\\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\\n\\t}\\n\\telse if( face == 1) {\\n\\t\\tr = vec3(direction.y, direction.x, direction.z);\\n\\t\\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\\n\\t}\\n\\telse if( face == 2) {\\n\\t\\tr = vec3(direction.z, direction.x, direction.y);\\n\\t\\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\\n\\t}\\n\\telse if( face == 3) {\\n\\t\\tr = vec3(direction.x, direction.z, direction.y);\\n\\t\\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\\n\\t}\\n\\telse if( face == 4) {\\n\\t\\tr = vec3(direction.y, direction.x, -direction.z);\\n\\t\\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\\n\\t}\\n\\telse {\\n\\t\\tr = vec3(direction.z, -direction.x, direction.y);\\n\\t\\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\\n\\t}\\n\\tr = normalize(r);\\n\\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\\n\\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\\n\\tvec2 base = offset + vec2( texelOffset );\\n\\treturn base + s * ( scale - 2.0 * texelOffset );\\n}\\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\\n\\tfloat roughnessVal = roughness* cubeUV_maxLods3;\\n\\tfloat r1 = floor(roughnessVal);\\n\\tfloat r2 = r1 + 1.0;\\n\\tfloat t = fract(roughnessVal);\\n\\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\\n\\tfloat s = mipInfo.y;\\n\\tfloat level0 = mipInfo.x;\\n\\tfloat level1 = level0 + 1.0;\\n\\tlevel1 = level1 > 5.0 ? 5.0 : level1;\\n\\tlevel0 += min( floor( s + 0.5 ), 5.0 );\\n\\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\\n\\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\\n\\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\\n\\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\\n\\tvec4 result = mix(color10, color20, t);\\n\\treturn vec4(result.rgb, 1.0);\\n}\\n#endif\\n\",\ndefaultnormal_vertex:\"vec3 transformedNormal = normalMatrix * objectNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\n\",displacementmap_pars_vertex:\"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\\n\",displacementmap_vertex:\"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\\n#endif\\n\",\nemissivemap_fragment:\"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\\n\\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\\n\",emissivemap_pars_fragment:\"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\\n\",encodings_fragment:\"  gl_FragColor = linearToOutputTexel( gl_FragColor );\\n\",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.xyz, vec3( gammaFactor ) ), value.w );\\n}\\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\\n}\\nvec4 sRGBToLinear( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\\n}\\nvec4 LinearTosRGB( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\\n}\\nvec4 RGBEToLinear( in vec4 value ) {\\n\\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\\n}\\nvec4 LinearToRGBE( in vec4 value ) {\\n\\tfloat maxComponent = max( max( value.r, value.g ), value.b );\\n\\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\\n\\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\\n}\\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\\n}\\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\\n\\tfloat M      = clamp( maxRGB / maxRange, 0.0, 1.0 );\\n\\tM            = ceil( M * 255.0 ) / 255.0;\\n\\treturn vec4( value.rgb / ( M * maxRange ), M );\\n}\\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\\n}\\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\\n\\tfloat D      = max( maxRange / maxRGB, 1.0 );\\n\\tD            = min( floor( D ) / 255.0, 1.0 );\\n\\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\\n}\\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\\nvec4 LinearToLogLuv( in vec4 value )  {\\n\\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\\n\\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\\n\\tvec4 vResult;\\n\\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\\n\\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\\n\\tvResult.w = fract(Le);\\n\\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\\n\\treturn vResult;\\n}\\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\\nvec4 LogLuvToLinear( in vec4 value ) {\\n\\tfloat Le = value.z * 255.0 + value.w;\\n\\tvec3 Xp_Y_XYZp;\\n\\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\\n\\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\\n\\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\\n\\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\\n\\treturn vec4( max(vRGB, 0.0), 1.0 );\\n}\\n\",\nenvmap_fragment:\"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\\n\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#else\\n\\t\\tvec3 reflectVec = vReflect;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t#elif defined( ENVMAP_TYPE_EQUIREC )\\n\\t\\tvec2 sampleUV;\\n\\t\\treflectVec = normalize( reflectVec );\\n\\t\\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\t\\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\\n\\t\\tvec4 envColor = texture2D( envMap, sampleUV );\\n\\t#elif defined( ENVMAP_TYPE_SPHERE )\\n\\t\\treflectVec = normalize( reflectVec );\\n\\t\\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\\n\\t\\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\\n\\t#else\\n\\t\\tvec4 envColor = vec4( 0.0 );\\n\\t#endif\\n\\tenvColor = envMapTexelToLinear( envColor );\\n\\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\\t\\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_MIX )\\n\\t\\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_ADD )\\n\\t\\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\\t#endif\\n#endif\\n\",\nenvmap_pars_fragment:\"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\\n\\tuniform float reflectivity;\\n\\tuniform float envMapIntensity;\\n#endif\\n#ifdef USE_ENVMAP\\n\\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tuniform samplerCube envMap;\\n\\t#else\\n\\t\\tuniform sampler2D envMap;\\n\\t#endif\\n\\tuniform float flipEnvMap;\\n\\tuniform int maxMipLevel;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\\n\\t\\tuniform float refractionRatio;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t#endif\\n#endif\\n\",\nenvmap_pars_vertex:\"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n#endif\\n\",envmap_vertex:\"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\tvWorldPosition = worldPosition.xyz;\\n\\t#else\\n\\t\\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\t\\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#endif\\n#endif\\n\",\nfog_vertex:\"\\n#ifdef USE_FOG\\nfogDepth = -mvPosition.z;\\n#endif\",fog_pars_vertex:\"#ifdef USE_FOG\\n  varying float fogDepth;\\n#endif\\n\",fog_fragment:\"#ifdef USE_FOG\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\\n\\t#endif\\n\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\\n\",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\\n\",\ngradientmap_pars_fragment:\"#ifdef TOON\\n\\tuniform sampler2D gradientMap;\\n\\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\\t\\tfloat dotNL = dot( normal, lightDirection );\\n\\t\\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\\t\\t#ifdef USE_GRADIENTMAP\\n\\t\\t\\treturn texture2D( gradientMap, coord ).rgb;\\n\\t\\t#else\\n\\t\\t\\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\\n\\t\\t#endif\\n\\t}\\n#endif\\n\",lightmap_fragment:\"#ifdef USE_LIGHTMAP\\n\\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\\n#endif\\n\",\nlightmap_pars_fragment:\"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\",lights_lambert_vertex:\"vec3 diffuse = vec3( 1.0 );\\nGeometricContext geometry;\\ngeometry.position = mvPosition.xyz;\\ngeometry.normal = normalize( transformedNormal );\\ngeometry.viewDir = normalize( -mvPosition.xyz );\\nGeometricContext backGeometry;\\nbackGeometry.position = geometry.position;\\nbackGeometry.normal = -geometry.normal;\\nbackGeometry.viewDir = geometry.viewDir;\\nvLightFront = vec3( 0.0 );\\n#ifdef DOUBLE_SIDED\\n\\tvLightBack = vec3( 0.0 );\\n#endif\\nIncidentLight directLight;\\nfloat dotNL;\\nvec3 directLightColor_Diffuse;\\n#if NUM_POINT_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = PI * directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = PI * directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n#endif\\n#if NUM_DIR_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = PI * directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\\n\\t\\t#endif\\n\\t}\\n#endif\\n\",\nlights_pars_begin:\"uniform vec3 ambientLightColor;\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\\tvec3 irradiance = ambientLightColor;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tirradiance *= PI;\\n\\t#endif\\n\\treturn irradiance;\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\\tstruct DirectionalLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tint shadow;\\n\\t\\tfloat shadowBias;\\n\\t\\tfloat shadowRadius;\\n\\t\\tvec2 shadowMapSize;\\n\\t};\\n\\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\\n\\t\\tdirectLight.color = directionalLight.color;\\n\\t\\tdirectLight.direction = directionalLight.direction;\\n\\t\\tdirectLight.visible = true;\\n\\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\tstruct PointLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tint shadow;\\n\\t\\tfloat shadowBias;\\n\\t\\tfloat shadowRadius;\\n\\t\\tvec2 shadowMapSize;\\n\\t\\tfloat shadowCameraNear;\\n\\t\\tfloat shadowCameraFar;\\n\\t};\\n\\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\\n\\t\\tvec3 lVector = pointLight.position - geometry.position;\\n\\t\\tdirectLight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tdirectLight.color = pointLight.color;\\n\\t\\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\\n\\t\\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\tstruct SpotLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tfloat coneCos;\\n\\t\\tfloat penumbraCos;\\n\\t\\tint shadow;\\n\\t\\tfloat shadowBias;\\n\\t\\tfloat shadowRadius;\\n\\t\\tvec2 shadowMapSize;\\n\\t};\\n\\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\\n\\t\\tvec3 lVector = spotLight.position - geometry.position;\\n\\t\\tdirectLight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tfloat angleCos = dot( directLight.direction, spotLight.direction );\\n\\t\\tif ( angleCos > spotLight.coneCos ) {\\n\\t\\t\\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\\t\\t\\tdirectLight.color = spotLight.color;\\n\\t\\t\\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\\n\\t\\t\\tdirectLight.visible = true;\\n\\t\\t} else {\\n\\t\\t\\tdirectLight.color = vec3( 0.0 );\\n\\t\\t\\tdirectLight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tstruct RectAreaLight {\\n\\t\\tvec3 color;\\n\\t\\tvec3 position;\\n\\t\\tvec3 halfWidth;\\n\\t\\tvec3 halfHeight;\\n\\t};\\n\\tuniform sampler2D ltc_1;\\tuniform sampler2D ltc_2;\\n\\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tstruct HemisphereLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 skyColor;\\n\\t\\tvec3 groundColor;\\n\\t};\\n\\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\\n\\t\\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\\t\\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tirradiance *= PI;\\n\\t\\t#endif\\n\\t\\treturn irradiance;\\n\\t}\\n#endif\\n\",\nlights_pars_maps:\"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\\n\\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\\n\\t\\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\t\\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\\n\\t\\t#else\\n\\t\\t\\tvec4 envMapColor = vec4( 0.0 );\\n\\t\\t#endif\\n\\t\\treturn PI * envMapColor.rgb * envMapIntensity;\\n\\t}\\n\\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\\n\\t\\tfloat maxMIPLevelScalar = float( maxMIPLevel );\\n\\t\\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\\n\\t\\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\\n\\t}\\n\\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\\n\\t\\t#endif\\n\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\t\\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\\n\\t\\t#elif defined( ENVMAP_TYPE_EQUIREC )\\n\\t\\t\\tvec2 sampleUV;\\n\\t\\t\\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\t\\t\\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#elif defined( ENVMAP_TYPE_SPHERE )\\n\\t\\t\\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#endif\\n\\t\\treturn envMapColor.rgb * envMapIntensity;\\n\\t}\\n#endif\\n\",\nlights_phong_fragment:\"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\\n\",lights_phong_pars_fragment:\"varying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\nstruct BlinnPhongMaterial {\\n\\tvec3\\tdiffuseColor;\\n\\tvec3\\tspecularColor;\\n\\tfloat\\tspecularShininess;\\n\\tfloat\\tspecularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t#ifdef TOON\\n\\t\\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\\n\\t#else\\n\\t\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\t\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#endif\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tirradiance *= PI;\\n\\t#endif\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_BlinnPhong\\n#define Material_LightProbeLOD( material )\\t(0)\\n\",\nlights_physical_fragment:\"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\\n#ifdef STANDARD\\n\\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\\n#else\\n\\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\\n\\tmaterial.clearCoat = saturate( clearCoat );\\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\\n#endif\\n\",\nlights_physical_pars_fragment:\"struct PhysicalMaterial {\\n\\tvec3\\tdiffuseColor;\\n\\tfloat\\tspecularRoughness;\\n\\tvec3\\tspecularColor;\\n\\t#ifndef STANDARD\\n\\t\\tfloat clearCoat;\\n\\t\\tfloat clearCoatRoughness;\\n\\t#endif\\n};\\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\\n\\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t\\tvec3 normal = geometry.normal;\\n\\t\\tvec3 viewDir = geometry.viewDir;\\n\\t\\tvec3 position = geometry.position;\\n\\t\\tvec3 lightPos = rectAreaLight.position;\\n\\t\\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\\t\\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\\t\\tvec3 lightColor = rectAreaLight.color;\\n\\t\\tfloat roughness = material.specularRoughness;\\n\\t\\tvec3 rectCoords[ 4 ];\\n\\t\\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\\t\\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\\n\\t\\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\\n\\t\\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\\n\\t\\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\\t\\tvec4 t1 = texture2D( ltc_1, uv );\\n\\t\\tvec4 t2 = texture2D( ltc_2, uv );\\n\\t\\tmat3 mInv = mat3(\\n\\t\\t\\tvec3( t1.x, 0, t1.y ),\\n\\t\\t\\tvec3(    0, 1,    0 ),\\n\\t\\t\\tvec3( t1.z, 0, t1.w )\\n\\t\\t);\\n\\t\\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\\n\\t\\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\\t\\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tirradiance *= PI;\\n\\t#endif\\n\\t#ifndef STANDARD\\n\\t\\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\\n\\t#else\\n\\t\\tfloat clearCoatDHR = 0.0;\\n\\t#endif\\n\\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\\n\\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n\\t#ifndef STANDARD\\n\\t\\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\\n\\t#endif\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t#ifndef STANDARD\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\tfloat dotNL = dotNV;\\n\\t\\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\\n\\t#else\\n\\t\\tfloat clearCoatDHR = 0.0;\\n\\t#endif\\n\\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\\n\\t#ifndef STANDARD\\n\\t\\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\\n\\t#endif\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Physical\\n#define RE_Direct_RectArea\\t\\tRE_Direct_RectArea_Physical\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\\t\\tRE_IndirectSpecular_Physical\\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\\n#define Material_ClearCoat_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\\n\",\nlights_fragment_begin:\"\\nGeometricContext geometry;\\ngeometry.position = - vViewPosition;\\ngeometry.normal = normal;\\ngeometry.viewDir = normalize( vViewPosition );\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tPointLight pointLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\\n\\t\\t#ifdef USE_SHADOWMAP\\n\\t\\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tSpotLight spotLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\\n\\t\\t#ifdef USE_SHADOWMAP\\n\\t\\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tDirectionalLight directionalLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\\n\\t\\t#ifdef USE_SHADOWMAP\\n\\t\\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\\tRectAreaLight rectAreaLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\\t\\trectAreaLight = rectAreaLights[ i ];\\n\\t\\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\\t\\t#pragma unroll_loop\\n\\t\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\\n\\t\\t}\\n\\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tvec3 radiance = vec3( 0.0 );\\n\\tvec3 clearCoatRadiance = vec3( 0.0 );\\n#endif\\n\",\nlights_fragment_maps:\"#if defined( RE_IndirectDiffuse )\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tlightMapIrradiance *= PI;\\n\\t\\t#endif\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\\n\\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\\n\\t#ifndef STANDARD\\n\\t\\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\\n\\t#endif\\n#endif\\n\",\nlights_fragment_end:\"#if defined( RE_IndirectDiffuse )\\n\\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\\n#endif\\n\",logdepthbuf_fragment:\"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\",logdepthbuf_pars_fragment:\"#ifdef USE_LOGDEPTHBUF\\n\\tuniform float logDepthBufFC;\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t#endif\\n#endif\\n\",\nlogdepthbuf_pars_vertex:\"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t#endif\\n\\tuniform float logDepthBufFC;\\n#endif\",logdepthbuf_vertex:\"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\t#else\\n\\t\\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\\n\\t\\tgl_Position.z *= gl_Position.w;\\n\\t#endif\\n#endif\\n\",map_fragment:\"#ifdef USE_MAP\\n\\tvec4 texelColor = texture2D( map, vUv );\\n\\ttexelColor = mapTexelToLinear( texelColor );\\n\\tdiffuseColor *= texelColor;\\n#endif\\n\",\nmap_pars_fragment:\"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n\",map_particle_fragment:\"#ifdef USE_MAP\\n\\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n\\tvec4 mapTexel = texture2D( map, uv );\\n\\tdiffuseColor *= mapTexelToLinear( mapTexel );\\n#endif\\n\",map_particle_pars_fragment:\"#ifdef USE_MAP\\n\\tuniform mat3 uvTransform;\\n\\tuniform sampler2D map;\\n#endif\\n\",metalnessmap_fragment:\"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\\n\",\nmetalnessmap_pars_fragment:\"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\",morphnormal_vertex:\"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\\n\\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\\n\\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\\n\\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\\n#endif\\n\",morphtarget_pars_vertex:\"#ifdef USE_MORPHTARGETS\\n\\t#ifndef USE_MORPHNORMALS\\n\\tuniform float morphTargetInfluences[ 8 ];\\n\\t#else\\n\\tuniform float morphTargetInfluences[ 4 ];\\n\\t#endif\\n#endif\",\nmorphtarget_vertex:\"#ifdef USE_MORPHTARGETS\\n\\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\\n\\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\\n\\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\\n\\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\\n\\t#ifndef USE_MORPHNORMALS\\n\\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\\n\\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\\n\\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\\n\\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\\n\\t#endif\\n#endif\\n\",\nnormal_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#endif\\n\",normal_fragment_maps:\"#ifdef USE_NORMALMAP\\n\\t#ifdef OBJECTSPACE_NORMALMAP\\n\\t\\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t\\t#ifdef FLIP_SIDED\\n\\t\\t\\tnormal = - normal;\\n\\t\\t#endif\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\\n\\t\\t#endif\\n\\t\\tnormal = normalize( normalMatrix * normal );\\n\\t#else\\n\\t\\tnormal = perturbNormal2Arb( -vViewPosition, normal );\\n\\t#endif\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\\n#endif\\n\",\nnormalmap_pars_fragment:\"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n\\t#ifdef OBJECTSPACE_NORMALMAP\\n\\t\\tuniform mat3 normalMatrix;\\n\\t#else\\n\\t\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\\n\\t\\t\\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\\n\\t\\t\\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\\n\\t\\t\\tvec2 st0 = dFdx( vUv.st );\\n\\t\\t\\tvec2 st1 = dFdy( vUv.st );\\n\\t\\t\\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\\n\\t\\t\\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\\n\\t\\t\\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\\n\\t\\t\\tvec3 N = normalize( surf_norm );\\n\\t\\t\\tmat3 tsn = mat3( S, T, N );\\n\\t\\t\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t\\t\\tmapN.xy *= normalScale;\\n\\t\\t\\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\\n\\t\\t\\treturn normalize( tsn * mapN );\\n\\t\\t}\\n\\t#endif\\n#endif\\n\",\npacking:\"vec3 packNormalToRGB( const in vec3 normal ) {\\n\\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\\nconst float ShiftRight8 = 1. / 256.;\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tvec4 r = vec4( fract( v * PackFactors ), v );\\n\\tr.yzw -= r.xyz * ShiftRight8;\\treturn r * PackUpscale;\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\\n\\treturn linearClipZ * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\\n\\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\\n}\\n\",\npremultiplied_alpha_fragment:\"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\\n\",project_vertex:\"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\\ngl_Position = projectionMatrix * mvPosition;\\n\",dithering_fragment:\"#if defined( DITHERING )\\n  gl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\\n\",dithering_pars_fragment:\"#if defined( DITHERING )\\n\\tvec3 dithering( vec3 color ) {\\n\\t\\tfloat grid_position = rand( gl_FragCoord.xy );\\n\\t\\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\\t\\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\\t\\treturn color + dither_shift_RGB;\\n\\t}\\n#endif\\n\",\nroughnessmap_fragment:\"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\\n\",roughnessmap_pars_fragment:\"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\",shadowmap_pars_fragment:\"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\t\\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\t\\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\t\\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\\n\\t#endif\\n\\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\\n\\t\\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\\n\\t}\\n\\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\\n\\t\\tconst vec2 offset = vec2( 0.0, 1.0 );\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / size;\\n\\t\\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\\n\\t\\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\\n\\t\\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\\n\\t\\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\\n\\t\\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\\n\\t\\tvec2 f = fract( uv * size + 0.5 );\\n\\t\\tfloat a = mix( lb, lt, f.y );\\n\\t\\tfloat b = mix( rb, rt, f.y );\\n\\t\\tfloat c = mix( a, b, f.x );\\n\\t\\treturn c;\\n\\t}\\n\\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;\\n\\t\\tshadowCoord.z += shadowBias;\\n\\t\\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\\n\\t\\tbool inFrustum = all( inFrustumVec );\\n\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\t\\tbool frustumTest = all( frustumTestVec );\\n\\t\\tif ( frustumTest ) {\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\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( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn shadow;\\n\\t}\\n\\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\\t\\tvec3 absV = abs( v );\\n\\t\\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\\t\\tabsV *= scaleToCube;\\n\\t\\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\\t\\tvec2 planar = v.xy;\\n\\t\\tfloat almostATexel = 1.5 * texelSizeY;\\n\\t\\tfloat almostOne = 1.0 - almostATexel;\\n\\t\\tif ( absV.z >= almostOne ) {\\n\\t\\t\\tif ( v.z > 0.0 )\\n\\t\\t\\t\\tplanar.x = 4.0 - v.x;\\n\\t\\t} else if ( absV.x >= almostOne ) {\\n\\t\\t\\tfloat signX = sign( v.x );\\n\\t\\t\\tplanar.x = v.z * signX + 2.0 * signX;\\n\\t\\t} else if ( absV.y >= almostOne ) {\\n\\t\\t\\tfloat signY = sign( v.y );\\n\\t\\t\\tplanar.x = v.x + 2.0 * signY + 2.0;\\n\\t\\t\\tplanar.y = v.z * signY - 2.0;\\n\\t\\t}\\n\\t\\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\\t}\\n\\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\tdp += shadowBias;\\n\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\\t\\t\\treturn (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t#endif\\n\\t}\\n#endif\\n\",\nshadowmap_pars_vertex:\"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\t\\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\t\\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\t\\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\\n\\t#endif\\n#endif\\n\",\nshadowmap_vertex:\"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\\n\\t}\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\\n\\t}\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\\n\\t}\\n\\t#endif\\n#endif\\n\",\nshadowmask_pars_fragment:\"float getShadowMask() {\\n\\tfloat shadow = 1.0;\\n\\t#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\tDirectionalLight directionalLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\tSpotLight spotLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\tPointLight pointLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t}\\n\\t#endif\\n\\t#endif\\n\\treturn shadow;\\n}\\n\",\nskinbase_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 sampler2D boneTexture;\\n\\t\\tuniform int boneTextureSize;\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tfloat j = i * 4.0;\\n\\t\\t\\tfloat x = mod( j, float( boneTextureSize ) );\\n\\t\\t\\tfloat y = floor( j / float( boneTextureSize ) );\\n\\t\\t\\tfloat dx = 1.0 / float( boneTextureSize );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureSize );\\n\\t\\t\\ty = dy * ( y + 0.5 );\\n\\t\\t\\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\\n\\t\\t\\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\\n\\t\\t\\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\\n\\t\\t\\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\\n\\t\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#else\\n\\t\\tuniform mat4 boneMatrices[ MAX_BONES ];\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tmat4 bone = boneMatrices[ int(i) ];\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#endif\\n#endif\\n\",\nskinning_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\\n\",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#endif\\n\",\nspecularmap_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  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\\n\",tonemapping_pars_fragment:\"#ifndef saturate\\n\\t#define saturate(a) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nuniform float toneMappingWhitePoint;\\nvec3 LinearToneMapping( vec3 color ) {\\n\\treturn toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\\nvec3 Uncharted2ToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\n\",\nuv_pars_fragment:\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\\n\\tvarying vec2 vUv;\\n#endif\",uv_pars_vertex:\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\\n\\tvarying vec2 vUv;\\n\\tuniform mat3 uvTransform;\\n#endif\\n\",\nuv_vertex:\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n#endif\",uv2_pars_fragment:\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvarying vec2 vUv2;\\n#endif\",uv2_pars_vertex:\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tattribute vec2 uv2;\\n\\tvarying vec2 vUv2;\\n#endif\",\nuv2_vertex:\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvUv2 = uv2;\\n#endif\",worldpos_vertex:\"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\\n\\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\\n#endif\\n\",cube_frag:\"uniform samplerCube tCube;\\nuniform float tFlip;\\nuniform float opacity;\\nvarying vec3 vWorldPosition;\\nvoid main() {\\n\\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\\n\\tgl_FragColor.a *= opacity;\\n}\\n\",\ncube_vert:\"varying vec3 vWorldPosition;\\n#include <common>\\nvoid main() {\\n\\tvWorldPosition = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n\\tgl_Position.z = gl_Position.w;\\n}\\n\",depth_frag:\"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\\n\\t#elif DEPTH_PACKING == 3201\\n\\t\\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\\n\\t#endif\\n}\\n\",\ndepth_vert:\"#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n}\\n\",\ndistanceRGBA_frag:\"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main () {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\\n\",\ndistanceRGBA_vert:\"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvWorldPosition = worldPosition.xyz;\\n}\\n\",\nequirect_frag:\"uniform sampler2D tEquirect;\\nvarying vec3 vWorldPosition;\\n#include <common>\\nvoid main() {\\n\\tvec3 direction = normalize( vWorldPosition );\\n\\tvec2 sampleUV;\\n\\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\\n\\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n}\\n\",equirect_vert:\"varying vec3 vWorldPosition;\\n#include <common>\\nvoid main() {\\n\\tvWorldPosition = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n}\\n\",\nlinedashed_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <color_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\\n\",\nlinedashed_vert:\"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <color_vertex>\\n\\tvLineDistance = scale * lineDistance;\\n\\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nmeshbasic_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\\t#endif\\n\\t#include <aomap_fragment>\\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include <envmap_fragment>\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\\n\",\nmeshbasic_vert:\"#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_ENVMAP\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nmeshlambert_frag:\"uniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <fog_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <emissivemap_fragment>\\n\\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\\n\\t#include <lightmap_fragment>\\n\\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\\n\\t#else\\n\\t\\treflectedLight.directDiffuse = vLightFront;\\n\\t#endif\\n\\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\\n\",\nmeshlambert_vert:\"#define LAMBERT\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <lights_lambert_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nmeshphong_frag:\"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <gradientmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <lights_phong_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_phong_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\\n\",\nmeshphong_vert:\"#define PHONG\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nmeshphysical_frag:\"#define PHYSICAL\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifndef STANDARD\\n\\tuniform float clearCoat;\\n\\tuniform float clearCoatRoughness;\\n#endif\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <cube_uv_reflection_fragment>\\n#include <lights_pars_begin>\\n#include <lights_pars_maps>\\n#include <lights_physical_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <roughnessmap_pars_fragment>\\n#include <metalnessmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <roughnessmap_fragment>\\n\\t#include <metalnessmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_physical_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\\n\",\nmeshphysical_vert:\"#define PHYSICAL\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nnormal_frag:\"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\nvoid main() {\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\\n}\\n\",\nnormal_vert:\"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\\n\",\npoints_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <color_pars_fragment>\\n#include <map_particle_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_particle_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\\n\",\npoints_vert:\"uniform float size;\\nuniform float scale;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <color_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tgl_PointSize = size * ( scale / - mvPosition.z );\\n\\t#else\\n\\t\\tgl_PointSize = size;\\n\\t#endif\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nshadow_frag:\"uniform vec3 color;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\nvoid main() {\\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\\t#include <fog_fragment>\\n}\\n\",shadow_vert:\"#include <fog_pars_vertex>\\n#include <shadowmap_pars_vertex>\\nvoid main() {\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\"},\nBa={merge:function(a){for(var b={},c=0;c<a.length;c++){var d=this.clone(a[c]),e;for(e in d)b[e]=d[e]}return b},clone:function(a){var b={},c;for(c in a){b[c]={};for(var d in a[c]){var e=a[c][d];e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture)?b[c][d]=e.clone():Array.isArray(e)?b[c][d]=e.slice():b[c][d]=e}}return b}},Tg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,\nblue: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,\ndarkslategrey: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,\nlemonchiffon: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,\nmediumslateblue: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,\nrebeccapurple: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};Object.assign(G.prototype,\n{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):\"number\"===typeof a?this.setHex(a):\"string\"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(){function a(a,c,d){0>d&&(d+=1);1<d&&--d;return d<1/6?a+6*(c-a)*d:.5>d?c:d<2/3?a+6*(c-a)*(2/3-d):a}return function(b,\nc,d){b=J.euclideanModulo(b,1);c=J.clamp(c,0,1);d=J.clamp(d,0,1);0===c?this.r=this.g=this.b=d:(c=.5>=d?d*(1+c):d+c-d*c,d=2*d-c,this.r=a(d,c,b+1/3),this.g=a(d,c,b),this.b=a(d,c,b-1/3));return this}}(),setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn(\"THREE.Color: Alpha component of \"+a+\" will be ignored.\")}var c;if(c=/^((?:rgb|hsl)a?)\\(\\s*([^\\)]*)\\)/.exec(a)){var d=c[2];switch(c[1]){case \"rgb\":case \"rgba\":if(c=/^(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(d))return this.r=\nMath.min(255,parseInt(c[1],10))/255,this.g=Math.min(255,parseInt(c[2],10))/255,this.b=Math.min(255,parseInt(c[3],10))/255,b(c[5]),this;if(c=/^(\\d+)%\\s*,\\s*(\\d+)%\\s*,\\s*(\\d+)%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(d))return this.r=Math.min(100,parseInt(c[1],10))/100,this.g=Math.min(100,parseInt(c[2],10))/100,this.b=Math.min(100,parseInt(c[3],10))/100,b(c[5]),this;break;case \"hsl\":case \"hsla\":if(c=/^([0-9]*\\.?[0-9]+)\\s*,\\s*(\\d+)%\\s*,\\s*(\\d+)%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(d)){d=parseFloat(c[1])/\n360;var e=parseInt(c[2],10)/100,f=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,f)}}}else if(c=/^#([A-Fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)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===d)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}a&&0<a.length&&(c=Tg[a],\nvoid 0!==c?this.setHex(c):console.warn(\"THREE.Color: Unknown color \"+a));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a,b){void 0===b&&(b=2);this.r=Math.pow(a.r,b);this.g=Math.pow(a.g,b);this.b=Math.pow(a.b,b);return this},copyLinearToGamma:function(a,b){void 0===b&&(b=2);b=0<b?1/b:1;this.r=Math.pow(a.r,b);this.g=Math.pow(a.g,b);this.b=Math.pow(a.b,b);return this},convertGammaToLinear:function(a){this.copyGammaToLinear(this,\na);return this},convertLinearToGamma:function(a){this.copyLinearToGamma(this,a);return this},copySRGBToLinear:function(){function a(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}return function(b){this.r=a(b.r);this.g=a(b.g);this.b=a(b.b);return this}}(),copyLinearToSRGB:function(){function a(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}return function(b){this.r=a(b.r);this.g=a(b.g);this.b=a(b.b);return this}}(),convertSRGBToLinear:function(){this.copySRGBToLinear(this);\nreturn this},convertLinearToSRGB:function(){this.copyLinearToSRGB(this);return this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return(\"000000\"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){void 0===a&&(console.warn(\"THREE.Color: .getHSL() target is now required\"),a={h:0,s:0,l:0});var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var l=e-f;f=.5>=h?l/(e+f):l/(2-e-f);switch(e){case b:g=(c-\nd)/l+(c<d?6:0);break;case c:g=(d-b)/l+2;break;case d:g=(b-c)/l+4}g/=6}a.h=g;a.s=f;a.l=h;return a},getStyle:function(){return\"rgb(\"+(255*this.r|0)+\",\"+(255*this.g|0)+\",\"+(255*this.b|0)+\")\"},offsetHSL:function(){var a={};return function(b,c,d){this.getHSL(a);a.h+=b;a.s+=c;a.l+=d;this.setHSL(a.h,a.s,a.l);return this}}(),add:function(a){this.r+=a.r;this.g+=a.g;this.b+=a.b;return this},addColors:function(a,b){this.r=a.r+b.r;this.g=a.g+b.g;this.b=a.b+b.b;return this},addScalar:function(a){this.r+=a;this.g+=\na;this.b+=a;return this},sub:function(a){this.r=Math.max(0,this.r-a.r);this.g=Math.max(0,this.g-a.g);this.b=Math.max(0,this.b-a.b);return this},multiply:function(a){this.r*=a.r;this.g*=a.g;this.b*=a.b;return this},multiplyScalar:function(a){this.r*=a;this.g*=a;this.b*=a;return this},lerp:function(a,b){this.r+=(a.r-this.r)*b;this.g+=(a.g-this.g)*b;this.b+=(a.b-this.b)*b;return this},equals:function(a){return a.r===this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a,b){void 0===b&&(b=0);this.r=\na[b];this.g=a[b+1];this.b=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.r;a[b+1]=this.g;a[b+2]=this.b;return a},toJSON:function(){return this.getHex()}});var K={common:{diffuse:{value:new G(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new la},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},\naoMapIntensity:{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 B(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:2.5E-4},fogNear:{value:1},\nfogFar:{value:2E3},fogColor:{value:new G(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},\npointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new G(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new la}}},\ntb={basic:{uniforms:Ba.merge([K.common,K.specularmap,K.envmap,K.aomap,K.lightmap,K.fog]),vertexShader:S.meshbasic_vert,fragmentShader:S.meshbasic_frag},lambert:{uniforms:Ba.merge([K.common,K.specularmap,K.envmap,K.aomap,K.lightmap,K.emissivemap,K.fog,K.lights,{emissive:{value:new G(0)}}]),vertexShader:S.meshlambert_vert,fragmentShader:S.meshlambert_frag},phong:{uniforms:Ba.merge([K.common,K.specularmap,K.envmap,K.aomap,K.lightmap,K.emissivemap,K.bumpmap,K.normalmap,K.displacementmap,K.gradientmap,\nK.fog,K.lights,{emissive:{value:new G(0)},specular:{value:new G(1118481)},shininess:{value:30}}]),vertexShader:S.meshphong_vert,fragmentShader:S.meshphong_frag},standard:{uniforms:Ba.merge([K.common,K.envmap,K.aomap,K.lightmap,K.emissivemap,K.bumpmap,K.normalmap,K.displacementmap,K.roughnessmap,K.metalnessmap,K.fog,K.lights,{emissive:{value:new G(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:S.meshphysical_vert,fragmentShader:S.meshphysical_frag},points:{uniforms:Ba.merge([K.points,\nK.fog]),vertexShader:S.points_vert,fragmentShader:S.points_frag},dashed:{uniforms:Ba.merge([K.common,K.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:S.linedashed_vert,fragmentShader:S.linedashed_frag},depth:{uniforms:Ba.merge([K.common,K.displacementmap]),vertexShader:S.depth_vert,fragmentShader:S.depth_frag},normal:{uniforms:Ba.merge([K.common,K.bumpmap,K.normalmap,K.displacementmap,{opacity:{value:1}}]),vertexShader:S.normal_vert,fragmentShader:S.normal_frag},cube:{uniforms:{tCube:{value:null},\ntFlip:{value:-1},opacity:{value:1}},vertexShader:S.cube_vert,fragmentShader:S.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:S.equirect_vert,fragmentShader:S.equirect_frag},distanceRGBA:{uniforms:Ba.merge([K.common,K.displacementmap,{referencePosition:{value:new p},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:S.distanceRGBA_vert,fragmentShader:S.distanceRGBA_frag},shadow:{uniforms:Ba.merge([K.lights,K.fog,{color:{value:new G(0)},opacity:{value:1}}]),vertexShader:S.shadow_vert,\nfragmentShader:S.shadow_frag}};tb.physical={uniforms:Ba.merge([tb.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:S.meshphysical_vert,fragmentShader:S.meshphysical_frag};mb.RotationOrders=\"XYZ YZX ZXY XZY YXZ ZYX\".split(\" \");mb.DefaultOrder=\"XYZ\";Object.defineProperties(mb.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},\nset:function(a){this._z=a;this.onChangeCallback()}},order:{get:function(){return this._order},set:function(a){this._order=a;this.onChangeCallback()}}});Object.assign(mb.prototype,{isEuler:!0,set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},\nsetFromRotationMatrix:function(a,b,c){var d=J.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],l=e[5],m=e[9],k=e[2],n=e[6];e=e[10];b=b||this._order;\"XYZ\"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-m,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(n,l),this._z=0)):\"YXZ\"===b?(this._x=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-k,a),this._z=0)):\"ZXY\"===b?(this._x=Math.asin(d(n,-1,1)),.99999>Math.abs(n)?\n(this._y=Math.atan2(-k,e),this._z=Math.atan2(-f,l)):(this._y=0,this._z=Math.atan2(h,a))):\"ZYX\"===b?(this._y=Math.asin(-d(k,-1,1)),.99999>Math.abs(k)?(this._x=Math.atan2(n,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,l))):\"YZX\"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-m,l),this._y=Math.atan2(-k,a)):(this._x=0,this._y=Math.atan2(g,e))):\"XZY\"===b?(this._z=Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(n,l),this._y=Math.atan2(g,a)):(this._x=\nMath.atan2(-m,e),this._y=0)):console.warn(\"THREE.Euler: .setFromRotationMatrix() given unsupported order: \"+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a=new R;return function(b,c,d){a.makeRotationFromQuaternion(b);return this.setFromRotationMatrix(a,c,d)}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new ca;return function(b){a.setFromEuler(this);return this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===\nthis._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new p(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});\nObject.assign(Wd.prototype,{set:function(a){this.mask=1<<a|0},enable:function(a){this.mask=this.mask|1<<a|0},toggle:function(a){this.mask^=1<<a|0},disable:function(a){this.mask&=~(1<<a|0)},test:function(a){return 0!==(this.mask&a.mask)}});var Hf=0;H.DefaultUp=new p(0,1,0);H.DefaultMatrixAutoUpdate=!0;H.prototype=Object.assign(Object.create(za.prototype),{constructor:H,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix);\nthis.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(a){this.quaternion.premultiply(a);return this},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new ca;return function(b,c){a.setFromAxisAngle(b,\nc);this.quaternion.multiply(a);return this}}(),rotateOnWorldAxis:function(){var a=new ca;return function(b,c){a.setFromAxisAngle(b,c);this.quaternion.premultiply(a);return this}}(),rotateX:function(){var a=new p(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new p(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateZ:function(){var a=new p(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new p;return function(b,\nc){a.copy(b).applyQuaternion(this.quaternion);this.position.add(a.multiplyScalar(c));return this}}(),translateX:function(){var a=new p(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new p(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new p(0,0,1);return function(b){return this.translateOnAxis(a,b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new R;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),\nlookAt:function(){var a=new R,b=new p;return function(c,d,e){c.isVector3?b.copy(c):b.set(c,d,e);this.isCamera?a.lookAt(this.position,b,this.up):a.lookAt(b,this.position,this.up);this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.add(arguments[b]);return this}if(a===this)return console.error(\"THREE.Object3D.add: object can't be added as a child of itself.\",a),this;a&&a.isObject3D?(null!==a.parent&&a.parent.remove(a),a.parent=\nthis,a.dispatchEvent({type:\"added\"}),this.children.push(a)):console.error(\"THREE.Object3D.add: object not an instance of THREE.Object3D.\",a);return this},remove:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);return this}b=this.children.indexOf(a);-1!==b&&(a.parent=null,a.dispatchEvent({type:\"removed\"}),this.children.splice(b,1));return this},getObjectById:function(a){return this.getObjectByProperty(\"id\",a)},getObjectByName:function(a){return this.getObjectByProperty(\"name\",\na)},getObjectByProperty:function(a,b){if(this[a]===b)return this;for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c].getObjectByProperty(a,b);if(void 0!==e)return e}},getWorldPosition:function(a){void 0===a&&(console.warn(\"THREE.Object3D: .getWorldPosition() target is now required\"),a=new p);this.updateMatrixWorld(!0);return a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new p,b=new p;return function(c){void 0===c&&(console.warn(\"THREE.Object3D: .getWorldQuaternion() target is now required\"),\nc=new ca);this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,c,b);return c}}(),getWorldScale:function(){var a=new p,b=new ca;return function(c){void 0===c&&(console.warn(\"THREE.Object3D: .getWorldScale() target is now required\"),c=new p);this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,b,c);return c}}(),getWorldDirection:function(){var a=new ca;return function(b){void 0===b&&(console.warn(\"THREE.Object3D: .getWorldDirection() target is now required\"),b=new p);this.getWorldQuaternion(a);\nreturn b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverseVisible(a)}},traverseAncestors:function(a){var b=this.parent;null!==b&&(a(b),b.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){this.matrixAutoUpdate&&\nthis.updateMatrix();if(this.matrixWorldNeedsUpdate||a)null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].updateMatrixWorld(a)},toJSON:function(a){function b(b,c){void 0===b[c.uuid]&&(b[c.uuid]=c.toJSON(a));return c.uuid}function c(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var d=void 0===a||\"string\"===typeof a,\ne={};d&&(a={geometries:{},materials:{},textures:{},images:{},shapes:{}},e.metadata={version:4.5,type:\"Object\",generator:\"Object3D.toJSON\"});var f={};f.uuid=this.uuid;f.type=this.type;\"\"!==this.name&&(f.name=this.name);!0===this.castShadow&&(f.castShadow=!0);!0===this.receiveShadow&&(f.receiveShadow=!0);!1===this.visible&&(f.visible=!1);!1===this.frustumCulled&&(f.frustumCulled=!1);0!==this.renderOrder&&(f.renderOrder=this.renderOrder);\"{}\"!==JSON.stringify(this.userData)&&(f.userData=this.userData);\nf.layers=this.layers.mask;f.matrix=this.matrix.toArray();!1===this.matrixAutoUpdate&&(f.matrixAutoUpdate=!1);if(void 0!==this.geometry){f.geometry=b(a.geometries,this.geometry);var g=this.geometry.parameters;if(void 0!==g&&void 0!==g.shapes)if(g=g.shapes,Array.isArray(g))for(var h=0,l=g.length;h<l;h++)b(a.shapes,g[h]);else b(a.shapes,g)}if(void 0!==this.material)if(Array.isArray(this.material)){g=[];h=0;for(l=this.material.length;h<l;h++)g.push(b(a.materials,this.material[h]));f.material=g}else f.material=\nb(a.materials,this.material);if(0<this.children.length)for(f.children=[],h=0;h<this.children.length;h++)f.children.push(this.children[h].toJSON(a).object);if(d){d=c(a.geometries);h=c(a.materials);l=c(a.textures);var m=c(a.images);g=c(a.shapes);0<d.length&&(e.geometries=d);0<h.length&&(e.materials=h);0<l.length&&(e.textures=l);0<m.length&&(e.images=m);0<g.length&&(e.shapes=g)}e.object=f;return e},clone:function(a){return(new this.constructor).copy(this,a)},copy:function(a,b){void 0===b&&(b=!0);this.name=\na.name;this.up.copy(a.up);this.position.copy(a.position);this.quaternion.copy(a.quaternion);this.scale.copy(a.scale);this.matrix.copy(a.matrix);this.matrixWorld.copy(a.matrixWorld);this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrixWorldNeedsUpdate=a.matrixWorldNeedsUpdate;this.layers.mask=a.layers.mask;this.visible=a.visible;this.castShadow=a.castShadow;this.receiveShadow=a.receiveShadow;this.frustumCulled=a.frustumCulled;this.renderOrder=a.renderOrder;this.userData=JSON.parse(JSON.stringify(a.userData));\nif(!0===b)for(b=0;b<a.children.length;b++)this.add(a.children[b].clone());return this}});Ra.prototype=Object.assign(Object.create(H.prototype),{constructor:Ra,isCamera:!0,copy:function(a,b){H.prototype.copy.call(this,a,b);this.matrixWorldInverse.copy(a.matrixWorldInverse);this.projectionMatrix.copy(a.projectionMatrix);return this},getWorldDirection:function(){var a=new ca;return function(b){void 0===b&&(console.warn(\"THREE.Camera: .getWorldDirection() target is now required\"),b=new p);this.getWorldQuaternion(a);\nreturn b.set(0,0,-1).applyQuaternion(a)}}(),updateMatrixWorld:function(a){H.prototype.updateMatrixWorld.call(this,a);this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}});Mb.prototype=Object.assign(Object.create(Ra.prototype),{constructor:Mb,isOrthographicCamera:!0,copy:function(a,b){Ra.prototype.copy.call(this,a,b);this.left=a.left;this.right=a.right;this.top=a.top;this.bottom=a.bottom;this.near=a.near;this.far=a.far;this.zoom=a.zoom;this.view=\nnull===a.view?null:Object.assign({},a.view);return this},setViewOffset:function(a,b,c,d,e,f){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=a;this.view.fullHeight=b;this.view.offsetX=c;this.view.offsetY=d;this.view.width=e;this.view.height=f;this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1);this.updateProjectionMatrix()},updateProjectionMatrix:function(){var a=\n(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2,e=c-a;c+=a;a=d+b;b=d-b;if(null!==this.view&&this.view.enabled){c=this.zoom/(this.view.width/this.view.fullWidth);b=this.zoom/(this.view.height/this.view.fullHeight);var f=(this.right-this.left)/this.view.width;d=(this.top-this.bottom)/this.view.height;e+=this.view.offsetX/c*f;c=e+this.view.width/c*f;a-=this.view.offsetY/b*d;b=a-this.view.height/b*d}this.projectionMatrix.makeOrthographic(e,\nc,a,b,this.near,this.far)},toJSON:function(a){a=H.prototype.toJSON.call(this,a);a.object.zoom=this.zoom;a.object.left=this.left;a.object.right=this.right;a.object.top=this.top;a.object.bottom=this.bottom;a.object.near=this.near;a.object.far=this.far;null!==this.view&&(a.object.view=Object.assign({},this.view));return a}});Object.assign(Ya.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a=a.a;this.b=a.b;this.c=a.c;this.normal.copy(a.normal);this.color.copy(a.color);\nthis.materialIndex=a.materialIndex;for(var b=0,c=a.vertexNormals.length;b<c;b++)this.vertexNormals[b]=a.vertexNormals[b].clone();b=0;for(c=a.vertexColors.length;b<c;b++)this.vertexColors[b]=a.vertexColors[b].clone();return this}});var If=0;P.prototype=Object.assign(Object.create(za.prototype),{constructor:P,isGeometry:!0,applyMatrix:function(a){for(var b=(new la).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];\na.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=this.verticesNeedUpdate=!0;return this},rotateX:function(){var a=new R;return function(b){a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new R;return function(b){a.makeRotationY(b);this.applyMatrix(a);return this}}(),\nrotateZ:function(){var a=new R;return function(b){a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a=new R;return function(b,c,d){a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a=new R;return function(b,c,d){a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a=new H;return function(b){a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),fromBufferGeometry:function(a){function b(a,b,d,e){var f=void 0!==\ng?[k[a].clone(),k[b].clone(),k[d].clone()]:[],q=void 0!==h?[c.colors[a].clone(),c.colors[b].clone(),c.colors[d].clone()]:[];e=new Ya(a,b,d,f,q,e);c.faces.push(e);void 0!==l&&c.faceVertexUvs[0].push([n[a].clone(),n[b].clone(),n[d].clone()]);void 0!==m&&c.faceVertexUvs[1].push([t[a].clone(),t[b].clone(),t[d].clone()])}var c=this,d=null!==a.index?a.index.array:void 0,e=a.attributes,f=e.position.array,g=void 0!==e.normal?e.normal.array:void 0,h=void 0!==e.color?e.color.array:void 0,l=void 0!==e.uv?e.uv.array:\nvoid 0,m=void 0!==e.uv2?e.uv2.array:void 0;void 0!==m&&(this.faceVertexUvs[1]=[]);for(var k=[],n=[],t=[],q=e=0;e<f.length;e+=3,q+=2)c.vertices.push(new p(f[e],f[e+1],f[e+2])),void 0!==g&&k.push(new p(g[e],g[e+1],g[e+2])),void 0!==h&&c.colors.push(new G(h[e],h[e+1],h[e+2])),void 0!==l&&n.push(new B(l[q],l[q+1])),void 0!==m&&t.push(new B(m[q],m[q+1]));var r=a.groups;if(0<r.length)for(e=0;e<r.length;e++){f=r[e];var u=f.start,y=f.count;q=u;for(u+=y;q<u;q+=3)void 0!==d?b(d[q],d[q+1],d[q+2],f.materialIndex):\nb(q,q+1,q+2,f.materialIndex)}else if(void 0!==d)for(e=0;e<d.length;e+=3)b(d[e],d[e+1],d[e+2]);else for(e=0;e<f.length/3;e+=3)b(e,e+1,e+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){var a=new p;return function(){this.computeBoundingBox();this.boundingBox.getCenter(a).negate();this.translate(a.x,a.y,a.z);return this}}(),normalize:function(){this.computeBoundingSphere();\nvar a=this.boundingSphere.center,b=this.boundingSphere.radius;b=0===b?1:1/b;var c=new R;c.set(b,0,0,-b*a.x,0,b,0,-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);return this},computeFaceNormals:function(){for(var a=new p,b=new p,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){void 0===a&&(a=!0);var b;var c=Array(this.vertices.length);\nvar d=0;for(b=this.vertices.length;d<b;d++)c[d]=new p;if(a){var e=new p,f=new p;a=0;for(d=this.faces.length;a<d;a++){b=this.faces[a];var g=this.vertices[b.a];var h=this.vertices[b.b];var l=this.vertices[b.c];e.subVectors(l,h);f.subVectors(g,h);e.cross(f);c[b.a].add(e);c[b.b].add(e);c[b.c].add(e)}}else for(this.computeFaceNormals(),a=0,d=this.faces.length;a<d;a++)b=this.faces[a],c[b.a].add(b.normal),c[b.b].add(b.normal),c[b.c].add(b.normal);d=0;for(b=this.vertices.length;d<b;d++)c[d].normalize();a=\n0;for(d=this.faces.length;a<d;a++)b=this.faces[a],g=b.vertexNormals,3===g.length?(g[0].copy(c[b.a]),g[1].copy(c[b.b]),g[2].copy(c[b.c])):(g[0]=c[b.a].clone(),g[1]=c[b.b].clone(),g[2]=c[b.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var a;this.computeFaceNormals();var b=0;for(a=this.faces.length;b<a;b++){var c=this.faces[b];var d=c.vertexNormals;3===d.length?(d[0].copy(c.normal),d[1].copy(c.normal),d[2].copy(c.normal)):(d[0]=c.normal.clone(),d[1]=\nc.normal.clone(),d[2]=c.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var a,b;var c=0;for(b=this.faces.length;c<b;c++){var d=this.faces[c];d.__originalFaceNormal?d.__originalFaceNormal.copy(d.normal):d.__originalFaceNormal=d.normal.clone();d.__originalVertexNormals||(d.__originalVertexNormals=[]);var e=0;for(a=d.vertexNormals.length;e<a;e++)d.__originalVertexNormals[e]?d.__originalVertexNormals[e].copy(d.vertexNormals[e]):d.__originalVertexNormals[e]=\nd.vertexNormals[e].clone()}var f=new P;f.faces=this.faces;e=0;for(a=this.morphTargets.length;e<a;e++){if(!this.morphNormals[e]){this.morphNormals[e]={};this.morphNormals[e].faceNormals=[];this.morphNormals[e].vertexNormals=[];d=this.morphNormals[e].faceNormals;var g=this.morphNormals[e].vertexNormals;c=0;for(b=this.faces.length;c<b;c++){var h=new p;var l={a:new p,b:new p,c:new p};d.push(h);g.push(l)}}g=this.morphNormals[e];f.vertices=this.morphTargets[e].vertices;f.computeFaceNormals();f.computeVertexNormals();\nc=0;for(b=this.faces.length;c<b;c++)d=this.faces[c],h=g.faceNormals[c],l=g.vertexNormals[c],h.copy(d.normal),l.a.copy(d.vertexNormals[0]),l.b.copy(d.vertexNormals[1]),l.c.copy(d.vertexNormals[2])}c=0;for(b=this.faces.length;c<b;c++)d=this.faces[c],d.normal=d.__originalFaceNormal,d.vertexNormals=d.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Xa);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&\n(this.boundingSphere=new Ha);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(a&&a.isGeometry){var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,l=a.faces,m=this.faceVertexUvs[0],k=a.faceVertexUvs[0],n=this.colors,p=a.colors;void 0===c&&(c=0);void 0!==b&&(d=(new la).getNormalMatrix(b));a=0;for(var q=g.length;a<q;a++){var r=g[a].clone();void 0!==b&&r.applyMatrix4(b);f.push(r)}a=0;for(q=p.length;a<q;a++)n.push(p[a].clone());a=0;for(q=l.length;a<q;a++){g=\nl[a];var u=g.vertexNormals;p=g.vertexColors;n=new Ya(g.a+e,g.b+e,g.c+e);n.normal.copy(g.normal);void 0!==d&&n.normal.applyMatrix3(d).normalize();b=0;for(f=u.length;b<f;b++)r=u[b].clone(),void 0!==d&&r.applyMatrix3(d).normalize(),n.vertexNormals.push(r);n.color.copy(g.color);b=0;for(f=p.length;b<f;b++)r=p[b],n.vertexColors.push(r.clone());n.materialIndex=g.materialIndex+c;h.push(n)}a=0;for(q=k.length;a<q;a++)if(c=k[a],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());m.push(d)}}else console.error(\"THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.\",\na)},mergeMesh:function(a){a&&a.isMesh?(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix)):console.error(\"THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.\",a)},mergeVertices:function(){var a={},b=[],c=[],d=Math.pow(10,4),e;var f=0;for(e=this.vertices.length;f<e;f++){var g=this.vertices[f];g=Math.round(g.x*d)+\"_\"+Math.round(g.y*d)+\"_\"+Math.round(g.z*d);void 0===a[g]?(a[g]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[g]]}a=[];f=0;for(e=this.faces.length;f<e;f++)for(d=\nthis.faces[f],d.a=c[d.a],d.b=c[d.b],d.c=c[d.c],d=[d.a,d.b,d.c],g=0;3>g;g++)if(d[g]===d[(g+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(d=a[f],this.faces.splice(d,1),c=0,e=this.faceVertexUvs.length;c<e;c++)this.faceVertexUvs[c].splice(d,1);f=this.vertices.length-b.length;this.vertices=b;return f},setFromPoints:function(a){this.vertices=[];for(var b=0,c=a.length;b<c;b++){var d=a[b];this.vertices.push(new p(d.x,d.y,d.z||0))}return this},sortFacesByMaterialIndex:function(){for(var a=this.faces,\nb=a.length,c=0;c<b;c++)a[c]._id=c;a.sort(function(a,b){return a.materialIndex-b.materialIndex});var d=this.faceVertexUvs[0],e=this.faceVertexUvs[1],f,g;d&&d.length===b&&(f=[]);e&&e.length===b&&(g=[]);for(c=0;c<b;c++){var h=a[c]._id;f&&f.push(d[h]);g&&g.push(e[h])}f&&(this.faceVertexUvs[0]=f);g&&(this.faceVertexUvs[1]=g)},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==m[b])return m[b];m[b]=l.length/3;l.push(a.x,\na.y,a.z);return m[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==n[b])return n[b];n[b]=k.length;k.push(a.getHex());return n[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=p.length/2;p.push(a.x,a.y);return q[b]}var e={metadata:{version:4.5,type:\"Geometry\",generator:\"Geometry.toJSON\"}};e.uuid=this.uuid;e.type=this.type;\"\"!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&\n(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}h=[];var l=[],m={},k=[],n={},p=[],q={};for(g=0;g<this.faces.length;g++){var r=this.faces[g],u=void 0!==this.faceVertexUvs[0][g],y=0<r.normal.length(),w=0<r.vertexNormals.length,x=1!==r.color.r||1!==r.color.g||1!==r.color.b,A=0<r.vertexColors.length,C=0;C=a(C,0,0);C=a(C,1,!0);C=a(C,2,!1);C=a(C,3,u);C=a(C,4,y);C=a(C,5,w);C=a(C,6,x);C=a(C,7,A);h.push(C);h.push(r.a,r.b,r.c);h.push(r.materialIndex);\nu&&(u=this.faceVertexUvs[0][g],h.push(d(u[0]),d(u[1]),d(u[2])));y&&h.push(b(r.normal));w&&(y=r.vertexNormals,h.push(b(y[0]),b(y[1]),b(y[2])));x&&h.push(c(r.color));A&&(r=r.vertexColors,h.push(c(r[0]),c(r[1]),c(r[2])))}e.data={};e.data.vertices=f;e.data.normals=l;0<k.length&&(e.data.colors=k);0<p.length&&(e.data.uvs=[p]);e.data.faces=h;return e},clone:function(){return(new P).copy(this)},copy:function(a){var b,c,d;this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=\n[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.name=a.name;var e=a.vertices;var f=0;for(b=e.length;f<b;f++)this.vertices.push(e[f].clone());e=a.colors;f=0;for(b=e.length;f<b;f++)this.colors.push(e[f].clone());e=a.faces;f=0;for(b=e.length;f<b;f++)this.faces.push(e[f].clone());f=0;for(b=a.faceVertexUvs.length;f<b;f++){var g=a.faceVertexUvs[f];void 0===this.faceVertexUvs[f]&&(this.faceVertexUvs[f]=[]);e=0;for(c=g.length;e<\nc;e++){var h=g[e],l=[];var m=0;for(d=h.length;m<d;m++)l.push(h[m].clone());this.faceVertexUvs[f].push(l)}}m=a.morphTargets;f=0;for(b=m.length;f<b;f++){d={};d.name=m[f].name;if(void 0!==m[f].vertices)for(d.vertices=[],e=0,c=m[f].vertices.length;e<c;e++)d.vertices.push(m[f].vertices[e].clone());if(void 0!==m[f].normals)for(d.normals=[],e=0,c=m[f].normals.length;e<c;e++)d.normals.push(m[f].normals[e].clone());this.morphTargets.push(d)}m=a.morphNormals;f=0;for(b=m.length;f<b;f++){d={};if(void 0!==m[f].vertexNormals)for(d.vertexNormals=\n[],e=0,c=m[f].vertexNormals.length;e<c;e++)g=m[f].vertexNormals[e],h={},h.a=g.a.clone(),h.b=g.b.clone(),h.c=g.c.clone(),d.vertexNormals.push(h);if(void 0!==m[f].faceNormals)for(d.faceNormals=[],e=0,c=m[f].faceNormals.length;e<c;e++)d.faceNormals.push(m[f].faceNormals[e].clone());this.morphNormals.push(d)}e=a.skinWeights;f=0;for(b=e.length;f<b;f++)this.skinWeights.push(e[f].clone());e=a.skinIndices;f=0;for(b=e.length;f<b;f++)this.skinIndices.push(e[f].clone());e=a.lineDistances;f=0;for(b=e.length;f<\nb;f++)this.lineDistances.push(e[f]);f=a.boundingBox;null!==f&&(this.boundingBox=f.clone());f=a.boundingSphere;null!==f&&(this.boundingSphere=f.clone());this.elementsNeedUpdate=a.elementsNeedUpdate;this.verticesNeedUpdate=a.verticesNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.lineDistancesNeedUpdate=a.lineDistancesNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:\"dispose\"})}});\nObject.defineProperty(L.prototype,\"needsUpdate\",{set:function(a){!0===a&&this.version++}});Object.assign(L.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(a){if(Array.isArray(a))throw new TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");this.count=void 0!==a?a.length/this.itemSize:0;this.array=a;return this},setDynamic:function(a){this.dynamic=a;return this},copy:function(a){this.name=a.name;this.array=new a.array.constructor(a.array);this.itemSize=\na.itemSize;this.count=a.count;this.normalized=a.normalized;this.dynamic=a.dynamic;return this},copyAt:function(a,b,c){a*=this.itemSize;c*=b.itemSize;for(var d=0,e=this.itemSize;d<e;d++)this.array[a+d]=b.array[c+d];return this},copyArray:function(a){this.array.set(a);return this},copyColorsArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn(\"THREE.BufferAttribute.copyColorsArray(): color is undefined\",d),f=new G);b[c++]=f.r;b[c++]=f.g;b[c++]=f.b}return this},\ncopyVector2sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn(\"THREE.BufferAttribute.copyVector2sArray(): vector is undefined\",d),f=new B);b[c++]=f.x;b[c++]=f.y}return this},copyVector3sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn(\"THREE.BufferAttribute.copyVector3sArray(): vector is undefined\",d),f=new p);b[c++]=f.x;b[c++]=f.y;b[c++]=f.z}return this},copyVector4sArray:function(a){for(var b=\nthis.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn(\"THREE.BufferAttribute.copyVector4sArray(): vector is undefined\",d),f=new W);b[c++]=f.x;b[c++]=f.y;b[c++]=f.z;b[c++]=f.w}return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},getX:function(a){return this.array[a*this.itemSize]},setX:function(a,b){this.array[a*this.itemSize]=b;return this},getY:function(a){return this.array[a*this.itemSize+1]},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},\ngetZ:function(a){return this.array[a*this.itemSize+2]},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},getW:function(a){return this.array[a*this.itemSize+3]},setW:function(a,b){this.array[a*this.itemSize+3]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a+0]=b;this.array[a+\n1]=c;this.array[a+2]=d;this.array[a+3]=e;return this},onUpload:function(a){this.onUploadCallback=a;return this},clone:function(){return(new this.constructor(this.array,this.itemSize)).copy(this)}});yc.prototype=Object.create(L.prototype);yc.prototype.constructor=yc;zc.prototype=Object.create(L.prototype);zc.prototype.constructor=zc;Ac.prototype=Object.create(L.prototype);Ac.prototype.constructor=Ac;Bc.prototype=Object.create(L.prototype);Bc.prototype.constructor=Bc;nb.prototype=Object.create(L.prototype);\nnb.prototype.constructor=nb;Cc.prototype=Object.create(L.prototype);Cc.prototype.constructor=Cc;ob.prototype=Object.create(L.prototype);ob.prototype.constructor=ob;z.prototype=Object.create(L.prototype);z.prototype.constructor=z;Dc.prototype=Object.create(L.prototype);Dc.prototype.constructor=Dc;Object.assign(Ge.prototype,{computeGroups:function(a){var b=[],c=void 0;a=a.faces;for(var d=0;d<a.length;d++){var e=a[d];if(e.materialIndex!==c){c=e.materialIndex;void 0!==f&&(f.count=3*d-f.start,b.push(f));\nvar f={start:3*d,materialIndex:c}}}void 0!==f&&(f.count=3*d-f.start,b.push(f));this.groups=b},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,h=g.length;if(0<h){var l=[];for(var m=0;m<h;m++)l[m]=[];this.morphTargets.position=l}var k=a.morphNormals,n=k.length;if(0<n){var p=[];for(m=0;m<n;m++)p[m]=[];this.morphTargets.normal=p}var q=a.skinIndices,r=a.skinWeights,u=q.length===c.length,y=r.length===c.length;0<c.length&&\n0===b.length&&console.error(\"THREE.DirectGeometry: Faceless geometries are not supported.\");for(m=0;m<b.length;m++){var w=b[m];this.vertices.push(c[w.a],c[w.b],c[w.c]);var x=w.vertexNormals;3===x.length?this.normals.push(x[0],x[1],x[2]):(x=w.normal,this.normals.push(x,x,x));x=w.vertexColors;3===x.length?this.colors.push(x[0],x[1],x[2]):(x=w.color,this.colors.push(x,x,x));!0===e&&(x=d[0][m],void 0!==x?this.uvs.push(x[0],x[1],x[2]):(console.warn(\"THREE.DirectGeometry.fromGeometry(): Undefined vertexUv \",\nm),this.uvs.push(new B,new B,new B)));!0===f&&(x=d[1][m],void 0!==x?this.uvs2.push(x[0],x[1],x[2]):(console.warn(\"THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 \",m),this.uvs2.push(new B,new B,new B)));for(x=0;x<h;x++){var A=g[x].vertices;l[x].push(A[w.a],A[w.b],A[w.c])}for(x=0;x<n;x++)A=k[x].vertexNormals[m],p[x].push(A.a,A.b,A.c);u&&this.skinIndices.push(q[w.a],q[w.b],q[w.c]);y&&this.skinWeights.push(r[w.a],r[w.b],r[w.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;\nthis.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this}});var Jf=1;D.prototype=Object.assign(Object.create(za.prototype),{constructor:D,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(a){Array.isArray(a)?this.index=new (65535<He(a)?ob:nb)(a,1):this.index=a},addAttribute:function(a,b,c){if(!(b&&b.isBufferAttribute||b&&b.isInterleavedBufferAttribute))return console.warn(\"THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).\"),\nthis.addAttribute(a,new L(b,c));if(\"index\"===a)return console.warn(\"THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.\"),this.setIndex(b),this;this.attributes[a]=b;return this},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a];return this},addGroup:function(a,b,c){this.groups.push({start:a,count:b,materialIndex:void 0!==c?c:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(a,b){this.drawRange.start=a;this.drawRange.count=\nb},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToBufferAttribute(b),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new la).getNormalMatrix(a).applyToBufferAttribute(b),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();return this},rotateX:function(){var a=new R;return function(b){a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new R;return function(b){a.makeRotationY(b);\nthis.applyMatrix(a);return this}}(),rotateZ:function(){var a=new R;return function(b){a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a=new R;return function(b,c,d){a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a=new R;return function(b,c,d){a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a=new H;return function(b){a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),center:function(){var a=new p;\nreturn function(){this.computeBoundingBox();this.boundingBox.getCenter(a).negate();this.translate(a.x,a.y,a.z);return this}}(),setFromObject:function(a){var b=a.geometry;if(a.isPoints||a.isLine){a=new z(3*b.vertices.length,3);var c=new z(3*b.colors.length,3);this.addAttribute(\"position\",a.copyVector3sArray(b.vertices));this.addAttribute(\"color\",c.copyColorsArray(b.colors));b.lineDistances&&b.lineDistances.length===b.vertices.length&&(a=new z(b.lineDistances.length,1),this.addAttribute(\"lineDistance\",\na.copyArray(b.lineDistances)));null!==b.boundingSphere&&(this.boundingSphere=b.boundingSphere.clone());null!==b.boundingBox&&(this.boundingBox=b.boundingBox.clone())}else a.isMesh&&b&&b.isGeometry&&this.fromGeometry(b);return this},setFromPoints:function(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c];b.push(e.x,e.y,e.z||0)}this.addAttribute(\"position\",new z(b,3));return this},updateFromObject:function(a){var b=a.geometry;if(a.isMesh){var c=b.__directGeometry;!0===b.elementsNeedUpdate&&(c=void 0,\nb.elementsNeedUpdate=!1);if(void 0===c)return this.fromGeometry(b);c.verticesNeedUpdate=b.verticesNeedUpdate;c.normalsNeedUpdate=b.normalsNeedUpdate;c.colorsNeedUpdate=b.colorsNeedUpdate;c.uvsNeedUpdate=b.uvsNeedUpdate;c.groupsNeedUpdate=b.groupsNeedUpdate;b.verticesNeedUpdate=!1;b.normalsNeedUpdate=!1;b.colorsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.groupsNeedUpdate=!1;b=c}!0===b.verticesNeedUpdate&&(c=this.attributes.position,void 0!==c&&(c.copyVector3sArray(b.vertices),c.needsUpdate=!0),b.verticesNeedUpdate=\n!1);!0===b.normalsNeedUpdate&&(c=this.attributes.normal,void 0!==c&&(c.copyVector3sArray(b.normals),c.needsUpdate=!0),b.normalsNeedUpdate=!1);!0===b.colorsNeedUpdate&&(c=this.attributes.color,void 0!==c&&(c.copyColorsArray(b.colors),c.needsUpdate=!0),b.colorsNeedUpdate=!1);b.uvsNeedUpdate&&(c=this.attributes.uv,void 0!==c&&(c.copyVector2sArray(b.uvs),c.needsUpdate=!0),b.uvsNeedUpdate=!1);b.lineDistancesNeedUpdate&&(c=this.attributes.lineDistance,void 0!==c&&(c.copyArray(b.lineDistances),c.needsUpdate=\n!0),b.lineDistancesNeedUpdate=!1);b.groupsNeedUpdate&&(b.computeGroups(a.geometry),this.groups=b.groups,b.groupsNeedUpdate=!1);return this},fromGeometry:function(a){a.__directGeometry=(new Ge).fromGeometry(a);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){var b=new Float32Array(3*a.vertices.length);this.addAttribute(\"position\",(new L(b,3)).copyVector3sArray(a.vertices));0<a.normals.length&&(b=new Float32Array(3*a.normals.length),this.addAttribute(\"normal\",(new L(b,\n3)).copyVector3sArray(a.normals)));0<a.colors.length&&(b=new Float32Array(3*a.colors.length),this.addAttribute(\"color\",(new L(b,3)).copyColorsArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute(\"uv\",(new L(b,2)).copyVector2sArray(a.uvs)));0<a.uvs2.length&&(b=new Float32Array(2*a.uvs2.length),this.addAttribute(\"uv2\",(new L(b,2)).copyVector2sArray(a.uvs2)));this.groups=a.groups;for(var c in a.morphTargets){b=[];for(var d=a.morphTargets[c],e=0,f=d.length;e<f;e++){var g=\nd[e],h=new z(3*g.length,3);b.push(h.copyVector3sArray(g))}this.morphAttributes[c]=b}0<a.skinIndices.length&&(c=new z(4*a.skinIndices.length,4),this.addAttribute(\"skinIndex\",c.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&(c=new z(4*a.skinWeights.length,4),this.addAttribute(\"skinWeight\",c.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){null===\nthis.boundingBox&&(this.boundingBox=new Xa);var a=this.attributes.position;void 0!==a?this.boundingBox.setFromBufferAttribute(a):this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var a=new Xa,b=new p;return function(){null===this.boundingSphere&&\n(this.boundingSphere=new Ha);var c=this.attributes.position;if(c){var d=this.boundingSphere.center;a.setFromBufferAttribute(c);a.getCenter(d);for(var e=0,f=0,g=c.count;f<g;f++)b.x=c.getX(f),b.y=c.getY(f),b.z=c.getZ(f),e=Math.max(e,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(e);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},\ncomputeVertexNormals:function(){var a=this.index,b=this.attributes,c=this.groups;if(b.position){var d=b.position.array;if(void 0===b.normal)this.addAttribute(\"normal\",new L(new Float32Array(d.length),3));else for(var e=b.normal.array,f=0,g=e.length;f<g;f++)e[f]=0;e=b.normal.array;var h=new p,l=new p,m=new p,k=new p,n=new p;if(a){a=a.array;0===c.length&&this.addGroup(0,a.length);for(var t=0,q=c.length;t<q;++t){f=c[t];g=f.start;var r=f.count;f=g;for(g+=r;f<g;f+=3){r=3*a[f+0];var u=3*a[f+1];var y=3*\na[f+2];h.fromArray(d,r);l.fromArray(d,u);m.fromArray(d,y);k.subVectors(m,l);n.subVectors(h,l);k.cross(n);e[r]+=k.x;e[r+1]+=k.y;e[r+2]+=k.z;e[u]+=k.x;e[u+1]+=k.y;e[u+2]+=k.z;e[y]+=k.x;e[y+1]+=k.y;e[y+2]+=k.z}}}else for(f=0,g=d.length;f<g;f+=9)h.fromArray(d,f),l.fromArray(d,f+3),m.fromArray(d,f+6),k.subVectors(m,l),n.subVectors(h,l),k.cross(n),e[f]=k.x,e[f+1]=k.y,e[f+2]=k.z,e[f+3]=k.x,e[f+4]=k.y,e[f+5]=k.z,e[f+6]=k.x,e[f+7]=k.y,e[f+8]=k.z;this.normalizeNormals();b.normal.needsUpdate=!0}},merge:function(a,\nb){if(a&&a.isBufferGeometry){void 0===b&&(b=0,console.warn(\"THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.\"));var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d]){var e=c[d].array,f=a.attributes[d],g=f.array,h=0;for(f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h]}return this}console.error(\"THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.\",a)},normalizeNormals:function(){var a=\nnew p;return function(){for(var b=this.attributes.normal,c=0,d=b.count;c<d;c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.normalize(),b.setXYZ(c,a.x,a.y,a.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn(\"THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.\"),this;var a=new D,b=this.index.array,c=this.attributes,d;for(d in c){var e=c[d],f=e.array,g=e.itemSize,h=new f.constructor(b.length*g),l=0;e=0;for(var m=b.length;e<m;e++){var k=b[e]*g;for(var n=0;n<g;n++)h[l++]=\nf[k++]}a.addAttribute(d,new L(h,g))}b=this.groups;e=0;for(m=b.length;e<m;e++)c=b[e],a.addGroup(c.start,c.count,c.materialIndex);return a},toJSON:function(){var a={metadata:{version:4.5,type:\"BufferGeometry\",generator:\"BufferGeometry.toJSON\"}};a.uuid=this.uuid;a.type=this.type;\"\"!==this.name&&(a.name=this.name);0<Object.keys(this.userData).length&&(a.userData=this.userData);if(void 0!==this.parameters){var b=this.parameters;for(e in b)void 0!==b[e]&&(a[e]=b[e]);return a}a.data={attributes:{}};var c=\nthis.index;null!==c&&(b=Array.prototype.slice.call(c.array),a.data.index={type:c.array.constructor.name,array:b});c=this.attributes;for(e in c){var d=c[e];b=Array.prototype.slice.call(d.array);a.data.attributes[e]={itemSize:d.itemSize,type:d.array.constructor.name,array:b,normalized:d.normalized}}var e=this.groups;0<e.length&&(a.data.groups=JSON.parse(JSON.stringify(e)));e=this.boundingSphere;null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){return(new D).copy(this)},\ncopy:function(a){var b;this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.name=a.name;var c=a.index;null!==c&&this.setIndex(c.clone());c=a.attributes;for(g in c)this.addAttribute(g,c[g].clone());var d=a.morphAttributes;for(g in d){var e=[],f=d[g];c=0;for(b=f.length;c<b;c++)e.push(f[c].clone());this.morphAttributes[g]=e}var g=a.groups;c=0;for(b=g.length;c<b;c++)d=g[c],this.addGroup(d.start,d.count,d.materialIndex);g=a.boundingBox;\nnull!==g&&(this.boundingBox=g.clone());g=a.boundingSphere;null!==g&&(this.boundingSphere=g.clone());this.drawRange.start=a.drawRange.start;this.drawRange.count=a.drawRange.count;this.userData=a.userData;return this},dispose:function(){this.dispatchEvent({type:\"dispose\"})}});Nb.prototype=Object.create(P.prototype);Nb.prototype.constructor=Nb;pb.prototype=Object.create(D.prototype);pb.prototype.constructor=pb;Fc.prototype=Object.create(P.prototype);Fc.prototype.constructor=Fc;rb.prototype=Object.create(D.prototype);\nrb.prototype.constructor=rb;var Kf=0;I.prototype=Object.assign(Object.create(za.prototype),{constructor:I,isMaterial:!0,onBeforeCompile:function(){},setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn(\"THREE.Material: '\"+b+\"' parameter is undefined.\");else if(\"shading\"===b)console.warn(\"THREE.\"+this.type+\": .shading has been removed. Use the boolean .flatShading instead.\"),this.flatShading=1===c?!0:!1;else{var d=this[b];void 0===d?console.warn(\"THREE.\"+this.type+\n\": '\"+b+\"' is not a property of this material.\"):d&&d.isColor?d.set(c):d&&d.isVector3&&c&&c.isVector3?d.copy(c):this[b]=\"overdraw\"===b?Number(c):c}}},toJSON:function(a){function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var c=void 0===a||\"string\"===typeof a;c&&(a={textures:{},images:{}});var d={metadata:{version:4.5,type:\"Material\",generator:\"Material.toJSON\"}};d.uuid=this.uuid;d.type=this.type;\"\"!==this.name&&(d.name=this.name);this.color&&this.color.isColor&&(d.color=\nthis.color.getHex());void 0!==this.roughness&&(d.roughness=this.roughness);void 0!==this.metalness&&(d.metalness=this.metalness);this.emissive&&this.emissive.isColor&&(d.emissive=this.emissive.getHex());1!==this.emissiveIntensity&&(d.emissiveIntensity=this.emissiveIntensity);this.specular&&this.specular.isColor&&(d.specular=this.specular.getHex());void 0!==this.shininess&&(d.shininess=this.shininess);void 0!==this.clearCoat&&(d.clearCoat=this.clearCoat);void 0!==this.clearCoatRoughness&&(d.clearCoatRoughness=\nthis.clearCoatRoughness);this.map&&this.map.isTexture&&(d.map=this.map.toJSON(a).uuid);this.alphaMap&&this.alphaMap.isTexture&&(d.alphaMap=this.alphaMap.toJSON(a).uuid);this.lightMap&&this.lightMap.isTexture&&(d.lightMap=this.lightMap.toJSON(a).uuid);this.aoMap&&this.aoMap.isTexture&&(d.aoMap=this.aoMap.toJSON(a).uuid,d.aoMapIntensity=this.aoMapIntensity);this.bumpMap&&this.bumpMap.isTexture&&(d.bumpMap=this.bumpMap.toJSON(a).uuid,d.bumpScale=this.bumpScale);this.normalMap&&this.normalMap.isTexture&&\n(d.normalMap=this.normalMap.toJSON(a).uuid,d.normalMapType=this.normalMapType,d.normalScale=this.normalScale.toArray());this.displacementMap&&this.displacementMap.isTexture&&(d.displacementMap=this.displacementMap.toJSON(a).uuid,d.displacementScale=this.displacementScale,d.displacementBias=this.displacementBias);this.roughnessMap&&this.roughnessMap.isTexture&&(d.roughnessMap=this.roughnessMap.toJSON(a).uuid);this.metalnessMap&&this.metalnessMap.isTexture&&(d.metalnessMap=this.metalnessMap.toJSON(a).uuid);\nthis.emissiveMap&&this.emissiveMap.isTexture&&(d.emissiveMap=this.emissiveMap.toJSON(a).uuid);this.specularMap&&this.specularMap.isTexture&&(d.specularMap=this.specularMap.toJSON(a).uuid);this.envMap&&this.envMap.isTexture&&(d.envMap=this.envMap.toJSON(a).uuid,d.reflectivity=this.reflectivity);this.gradientMap&&this.gradientMap.isTexture&&(d.gradientMap=this.gradientMap.toJSON(a).uuid);void 0!==this.size&&(d.size=this.size);void 0!==this.sizeAttenuation&&(d.sizeAttenuation=this.sizeAttenuation);1!==\nthis.blending&&(d.blending=this.blending);!0===this.flatShading&&(d.flatShading=this.flatShading);0!==this.side&&(d.side=this.side);0!==this.vertexColors&&(d.vertexColors=this.vertexColors);1>this.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc;d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;0!==this.rotation&&(d.rotation=this.rotation);1!==this.linewidth&&(d.linewidth=this.linewidth);void 0!==this.dashSize&&(d.dashSize=\nthis.dashSize);void 0!==this.gapSize&&(d.gapSize=this.gapSize);void 0!==this.scale&&(d.scale=this.scale);!0===this.dithering&&(d.dithering=!0);0<this.alphaTest&&(d.alphaTest=this.alphaTest);!0===this.premultipliedAlpha&&(d.premultipliedAlpha=this.premultipliedAlpha);!0===this.wireframe&&(d.wireframe=this.wireframe);1<this.wireframeLinewidth&&(d.wireframeLinewidth=this.wireframeLinewidth);\"round\"!==this.wireframeLinecap&&(d.wireframeLinecap=this.wireframeLinecap);\"round\"!==this.wireframeLinejoin&&\n(d.wireframeLinejoin=this.wireframeLinejoin);!0===this.morphTargets&&(d.morphTargets=!0);!0===this.skinning&&(d.skinning=!0);!1===this.visible&&(d.visible=!1);\"{}\"!==JSON.stringify(this.userData)&&(d.userData=this.userData);c&&(c=b(a.textures),a=b(a.images),0<c.length&&(d.textures=c),0<a.length&&(d.images=a));return d},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.name=a.name;this.fog=a.fog;this.lights=a.lights;this.blending=a.blending;this.side=a.side;this.flatShading=\na.flatShading;this.vertexColors=a.vertexColors;this.opacity=a.opacity;this.transparent=a.transparent;this.blendSrc=a.blendSrc;this.blendDst=a.blendDst;this.blendEquation=a.blendEquation;this.blendSrcAlpha=a.blendSrcAlpha;this.blendDstAlpha=a.blendDstAlpha;this.blendEquationAlpha=a.blendEquationAlpha;this.depthFunc=a.depthFunc;this.depthTest=a.depthTest;this.depthWrite=a.depthWrite;this.colorWrite=a.colorWrite;this.precision=a.precision;this.polygonOffset=a.polygonOffset;this.polygonOffsetFactor=a.polygonOffsetFactor;\nthis.polygonOffsetUnits=a.polygonOffsetUnits;this.dithering=a.dithering;this.alphaTest=a.alphaTest;this.premultipliedAlpha=a.premultipliedAlpha;this.overdraw=a.overdraw;this.visible=a.visible;this.userData=JSON.parse(JSON.stringify(a.userData));this.clipShadows=a.clipShadows;this.clipIntersection=a.clipIntersection;var b=a.clippingPlanes,c=null;if(null!==b){var d=b.length;c=Array(d);for(var e=0;e!==d;++e)c[e]=b[e].clone()}this.clippingPlanes=c;this.shadowSide=a.shadowSide;return this},dispose:function(){this.dispatchEvent({type:\"dispose\"})}});\nua.prototype=Object.create(I.prototype);ua.prototype.constructor=ua;ua.prototype.isMeshBasicMaterial=!0;ua.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=\na.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;return this};Fa.prototype=Object.create(I.prototype);Fa.prototype.constructor=Fa;Fa.prototype.isShaderMaterial=!0;Fa.prototype.copy=function(a){I.prototype.copy.call(this,a);this.fragmentShader=a.fragmentShader;this.vertexShader=a.vertexShader;this.uniforms=Ba.clone(a.uniforms);this.defines=Object.assign({},\na.defines);this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.lights=a.lights;this.clipping=a.clipping;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;this.extensions=a.extensions;return this};Fa.prototype.toJSON=function(a){a=I.prototype.toJSON.call(this,a);a.uniforms=this.uniforms;a.vertexShader=this.vertexShader;a.fragmentShader=this.fragmentShader;return a};Object.assign(sb.prototype,{set:function(a,b){this.origin.copy(a);this.direction.copy(b);\nreturn this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){void 0===b&&(console.warn(\"THREE.Ray: .at() target is now required\"),b=new p);return b.copy(this.direction).multiplyScalar(a).add(this.origin)},lookAt:function(a){this.direction.copy(a).sub(this.origin).normalize();return this},recast:function(){var a=new p;return function(b){this.origin.copy(this.at(b,a));return this}}(),\nclosestPointToPoint:function(a,b){void 0===b&&(console.warn(\"THREE.Ray: .closestPointToPoint() target is now required\"),b=new p);b.subVectors(a,this.origin);a=b.dot(this.direction);return 0>a?b.copy(this.origin):b.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new p;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);\na.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(),distanceSqToSegment:function(){var a=new p,b=new p,c=new p;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),l=-this.direction.dot(b),m=c.dot(this.direction),k=-c.dot(b),n=c.lengthSq(),p=Math.abs(1-l*l);if(0<p){d=l*k-m;e=l*m-k;var q=h*p;0<=d?e>=-q?e<=q?(h=1/p,d*=h,e*=h,l=d*(d+l*e+2*m)+e*(l*d+e+2*k)+n):(e=h,d=Math.max(0,\n-(l*e+m)),l=-d*d+e*(e+2*k)+n):(e=-h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+n):e<=-q?(d=Math.max(0,-(-l*h+m)),e=0<d?-h:Math.min(Math.max(-h,-k),h),l=-d*d+e*(e+2*k)+n):e<=q?(d=0,e=Math.min(Math.max(-h,-k),h),l=e*(e+2*k)+n):(d=Math.max(0,-(l*h+m)),e=0<d?h:Math.min(Math.max(-h,-k),h),l=-d*d+e*(e+2*k)+n)}else e=0<l?-h:h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+n;f&&f.copy(this.direction).multiplyScalar(d).add(this.origin);g&&g.copy(b).multiplyScalar(e).add(a);return l}}(),intersectSphere:function(){var a=\nnew p;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d;b=b.radius*b.radius;if(e>b)return null;b=Math.sqrt(b-e);e=d-b;d+=b;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),intersectsSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,\nb){a=this.distanceToPlane(a);return null===a?null:this.at(a,b)},intersectsPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},intersectBox:function(a,b){var c=1/this.direction.x;var d=1/this.direction.y;var e=1/this.direction.z,f=this.origin;if(0<=c){var g=(a.min.x-f.x)*c;c*=a.max.x-f.x}else g=(a.max.x-f.x)*c,c*=a.min.x-f.x;if(0<=d){var h=(a.min.y-f.y)*d;d*=a.max.y-f.y}else h=(a.max.y-f.y)*d,d*=a.min.y-f.y;if(g>d||h>c)return null;if(h>g||g!==\ng)g=h;if(d<c||c!==c)c=d;0<=e?(h=(a.min.z-f.z)*e,a=(a.max.z-f.z)*e):(h=(a.max.z-f.z)*e,a=(a.min.z-f.z)*e);if(g>a||h>c)return null;if(h>g||g!==g)g=h;if(a<c||c!==c)c=a;return 0>c?null:this.at(0<=g?g:c,b)},intersectsBox:function(){var a=new p;return function(b){return null!==this.intersectBox(b,a)}}(),intersectTriangle:function(){var a=new p,b=new p,c=new p,d=new p;return function(e,f,g,h,l){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0<f){if(h)return null;h=1}else if(0>\nf)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/f,l)}}(),applyMatrix4:function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}});Object.assign(Qb.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);\nreturn this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},getCenter:function(a){void 0===a&&(console.warn(\"THREE.Line3: .getCenter() target is now required\"),a=new p);return a.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){void 0===a&&(console.warn(\"THREE.Line3: .delta() target is now required\"),a=new p);return a.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},\ndistance:function(){return this.start.distanceTo(this.end)},at:function(a,b){void 0===b&&(console.warn(\"THREE.Line3: .at() target is now required\"),b=new p);return this.delta(b).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new p,b=new p;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);c=b.dot(b);c=b.dot(a)/c;d&&(c=J.clamp(c,0,1));return c}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);void 0===c&&\n(console.warn(\"THREE.Line3: .closestPointToPoint() target is now required\"),c=new p);return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a);this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}});Object.assign(ta,{getNormal:function(){var a=new p;return function(b,c,d,e){void 0===e&&(console.warn(\"THREE.Triangle: .getNormal() target is now required\"),e=new p);e.subVectors(d,c);a.subVectors(b,\nc);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}(),getBarycoord:function(){var a=new p,b=new p,c=new p;return function(d,e,f,g,h){a.subVectors(g,e);b.subVectors(f,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);f=a.dot(c);var l=b.dot(b);g=b.dot(c);var m=d*l-e*e;void 0===h&&(console.warn(\"THREE.Triangle: .getBarycoord() target is now required\"),h=new p);if(0===m)return h.set(-2,-1,-1);m=1/m;l=(l*f-e*g)*m;d=(d*g-e*f)*m;return h.set(1-l-d,d,l)}}(),containsPoint:function(){var a=\nnew p;return function(b,c,d,e){ta.getBarycoord(b,c,d,e,a);return 0<=a.x&&0<=a.y&&1>=a.x+a.y}}()});Object.assign(ta.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){var a=new p,b=new p;return function(){a.subVectors(this.c,\nthis.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),getMidpoint:function(a){void 0===a&&(console.warn(\"THREE.Triangle: .getMidpoint() target is now required\"),a=new p);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return ta.getNormal(this.a,this.b,this.c,a)},getPlane:function(a){void 0===a&&(console.warn(\"THREE.Triangle: .getPlane() target is now required\"),a=new p);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,\nb){return ta.getBarycoord(a,this.a,this.b,this.c,b)},containsPoint:function(a){return ta.containsPoint(a,this.a,this.b,this.c)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(){var a=new Ia,b=[new Qb,new Qb,new Qb],c=new p,d=new p;return function(e,f){void 0===f&&(console.warn(\"THREE.Triangle: .closestPointToPoint() target is now required\"),f=new p);var g=Infinity;a.setFromCoplanarPoints(this.a,this.b,this.c);a.projectPoint(e,c);if(!0===this.containsPoint(c))f.copy(c);\nelse for(b[0].set(this.a,this.b),b[1].set(this.b,this.c),b[2].set(this.c,this.a),e=0;e<b.length;e++){b[e].closestPointToPoint(c,!0,d);var h=c.distanceToSquared(d);h<g&&(g=h,f.copy(d))}return f}}(),equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});va.prototype=Object.assign(Object.create(H.prototype),{constructor:va,isMesh:!0,setDrawMode:function(a){this.drawMode=a},copy:function(a){H.prototype.copy.call(this,a);this.drawMode=a.drawMode;void 0!==a.morphTargetInfluences&&\n(this.morphTargetInfluences=a.morphTargetInfluences.slice());void 0!==a.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},a.morphTargetDictionary));return this},updateMorphTargets:function(){var a=this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var b=Object.keys(a);if(0<b.length){var c=a[b[0]];if(void 0!==c)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},a=0,b=c.length;a<b;a++){var d=c[a].name||String(a);this.morphTargetInfluences.push(0);this.morphTargetDictionary[d]=\na}}}else if(c=a.morphTargets,void 0!==c&&0<c.length)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},a=0,b=c.length;a<b;a++)d=c[a].name||String(a),this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=a},raycast:function(){function a(a,b,c,d,e,f,g){ta.getBarycoord(a,b,c,d,u);e.multiplyScalar(u.x);f.multiplyScalar(u.y);g.multiplyScalar(u.z);e.add(f).add(g);return e.clone()}function b(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,\nf,g,2!==b.side,h)))return null;w.copy(h);w.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(w);return b<c.near||b>c.far?null:{distance:b,point:w.clone(),object:a}}function c(c,d,e,f,m,k,n,p,v){g.fromBufferAttribute(m,n);h.fromBufferAttribute(m,p);l.fromBufferAttribute(m,v);if(c=b(c,d,e,f,g,h,l,y))k&&(t.fromBufferAttribute(k,n),q.fromBufferAttribute(k,p),r.fromBufferAttribute(k,v),c.uv=a(y,g,h,l,t,q,r)),k=new Ya(n,p,v),ta.getNormal(g,h,l,k.normal),c.face=k;return c}var d=new R,e=new sb,f=new Ha,\ng=new p,h=new p,l=new p,m=new p,k=new p,n=new p,t=new B,q=new B,r=new B,u=new p,y=new p,w=new p;return function(p,v){var u=this.geometry,x=this.material,w=this.matrixWorld;if(void 0!==x&&(null===u.boundingSphere&&u.computeBoundingSphere(),f.copy(u.boundingSphere),f.applyMatrix4(w),!1!==p.ray.intersectsSphere(f)&&(d.getInverse(w),e.copy(p.ray).applyMatrix4(d),null===u.boundingBox||!1!==e.intersectsBox(u.boundingBox))))if(u.isBufferGeometry){var A=u.index,z=u.attributes.position,B=u.attributes.uv,H=\nu.groups;u=u.drawRange;var G;if(null!==A)if(Array.isArray(x)){var D=0;for(G=H.length;D<G;D++){var E=H[D];var J=x[E.materialIndex];w=Math.max(E.start,u.start);var L=Math.min(E.start+E.count,u.start+u.count);for(E=w;E<L;E+=3){w=A.getX(D);var I=A.getX(D+1);var K=A.getX(D+2);if(w=c(this,J,p,e,z,B,w,I,K))w.faceIndex=Math.floor(D/3),v.push(w)}}}else for(w=Math.max(0,u.start),L=Math.min(A.count,u.start+u.count),D=w,G=L;D<G;D+=3){if(w=A.getX(D),I=A.getX(D+1),K=A.getX(D+2),w=c(this,x,p,e,z,B,w,I,K))w.faceIndex=\nMath.floor(D/3),v.push(w)}else if(void 0!==z)if(Array.isArray(x))for(D=0,G=H.length;D<G;D++)for(E=H[D],J=x[E.materialIndex],w=Math.max(E.start,u.start),L=Math.min(E.start+E.count,u.start+u.count),E=w;E<L;E+=3){if(w=E,I=E+1,K=E+2,w=c(this,J,p,e,z,B,w,I,K))w.faceIndex=Math.floor(D/3),v.push(w)}else for(w=Math.max(0,u.start),L=Math.min(z.count,u.start+u.count),D=w,G=L;D<G;D+=3)if(w=D,I=D+1,K=D+2,w=c(this,x,p,e,z,B,w,I,K))w.faceIndex=Math.floor(D/3),v.push(w)}else if(u.isGeometry)for(z=Array.isArray(x),\nB=u.vertices,H=u.faces,w=u.faceVertexUvs[0],0<w.length&&(A=w),E=0,L=H.length;E<L;E++)if(I=H[E],w=z?x[I.materialIndex]:x,void 0!==w){D=B[I.a];G=B[I.b];J=B[I.c];if(!0===w.morphTargets){K=u.morphTargets;var R=this.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);l.set(0,0,0);for(var P=0,S=K.length;P<S;P++){var T=R[P];if(0!==T){var W=K[P].vertices;g.addScaledVector(m.subVectors(W[I.a],D),T);h.addScaledVector(k.subVectors(W[I.b],G),T);l.addScaledVector(n.subVectors(W[I.c],J),T)}}g.add(D);h.add(G);l.add(J);\nD=g;G=h;J=l}if(w=b(this,w,p,e,D,G,J,y))A&&A[E]&&(K=A[E],t.copy(K[0]),q.copy(K[1]),r.copy(K[2]),w.uv=a(y,D,G,J,t,q,r)),w.face=I,w.faceIndex=E,v.push(w)}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});Za.prototype=Object.create(ea.prototype);Za.prototype.constructor=Za;Za.prototype.isCubeTexture=!0;Object.defineProperty(Za.prototype,\"images\",{get:function(){return this.image},set:function(a){this.image=a}});var Oe=new ea,Pe=new Za,Ie=[],Ke=[],Ne=new Float32Array(16),\nMe=new Float32Array(9),Le=new Float32Array(4);Te.prototype.updateCache=function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));qa(b,a)};Ue.prototype.setValue=function(a,b){for(var c=this.seq,d=0,e=c.length;d!==e;++d){var f=c[d];f.setValue(a,b[f.id])}};var Xd=/([\\w\\d_]+)(\\])?(\\[|\\.)?/g;eb.prototype.setValue=function(a,b,c){b=this.map[b];void 0!==b&&b.setValue(a,c,this.renderer)};eb.prototype.setOptional=function(a,b,c){b=b[c];void 0!==b&&\nthis.setValue(a,c,b)};eb.upload=function(a,b,c,d){for(var e=0,f=b.length;e!==f;++e){var g=b[e],h=c[g.id];!1!==h.needsUpdate&&g.setValue(a,h.value,d)}};eb.seqWithValue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var f=a[d];f.id in b&&c.push(f)}return c};var yg=0,Hg=0;fb.prototype=Object.create(I.prototype);fb.prototype.constructor=fb;fb.prototype.isMeshDepthMaterial=!0;fb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.depthPacking=a.depthPacking;this.skinning=a.skinning;this.morphTargets=\na.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;return this};gb.prototype=Object.create(I.prototype);gb.prototype.constructor=gb;gb.prototype.isMeshDistanceMaterial=!0;gb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.referencePosition.copy(a.referencePosition);this.nearDistance=a.nearDistance;\nthis.farDistance=a.farDistance;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;return this};Sb.prototype=Object.create(ea.prototype);Sb.prototype.constructor=Sb;Sb.prototype.isCanvasTexture=!0;Ub.prototype=Object.assign(Object.create(H.prototype),{constructor:Ub,isGroup:!0});Z.prototype=Object.assign(Object.create(Ra.prototype),\n{constructor:Z,isPerspectiveCamera:!0,copy:function(a,b){Ra.prototype.copy.call(this,a,b);this.fov=a.fov;this.zoom=a.zoom;this.near=a.near;this.far=a.far;this.focus=a.focus;this.aspect=a.aspect;this.view=null===a.view?null:Object.assign({},a.view);this.filmGauge=a.filmGauge;this.filmOffset=a.filmOffset;return this},setFocalLength:function(a){a=.5*this.getFilmHeight()/a;this.fov=2*J.RAD2DEG*Math.atan(a);this.updateProjectionMatrix()},getFocalLength:function(){var a=Math.tan(.5*J.DEG2RAD*this.fov);\nreturn.5*this.getFilmHeight()/a},getEffectiveFOV:function(){return 2*J.RAD2DEG*Math.atan(Math.tan(.5*J.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(a,b,c,d,e,f){this.aspect=a/b;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=a;this.view.fullHeight=b;this.view.offsetX=\nc;this.view.offsetY=d;this.view.width=e;this.view.height=f;this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1);this.updateProjectionMatrix()},updateProjectionMatrix:function(){var a=this.near,b=a*Math.tan(.5*J.DEG2RAD*this.fov)/this.zoom,c=2*b,d=this.aspect*c,e=-.5*d,f=this.view;if(null!==this.view&&this.view.enabled){var g=f.fullWidth,h=f.fullHeight;e+=f.offsetX*d/g;b-=f.offsetY*c/h;d*=f.width/g;c*=f.height/h}f=this.filmOffset;0!==f&&(e+=a*f/this.getFilmWidth());\nthis.projectionMatrix.makePerspective(e,e+d,b,b-c,a,this.far)},toJSON:function(a){a=H.prototype.toJSON.call(this,a);a.object.fov=this.fov;a.object.zoom=this.zoom;a.object.near=this.near;a.object.far=this.far;a.object.focus=this.focus;a.object.aspect=this.aspect;null!==this.view&&(a.object.view=Object.assign({},this.view));a.object.filmGauge=this.filmGauge;a.object.filmOffset=this.filmOffset;return a}});Hc.prototype=Object.assign(Object.create(Z.prototype),{constructor:Hc,isArrayCamera:!0});Vb.prototype.isFogExp2=\n!0;Vb.prototype.clone=function(){return new Vb(this.color,this.density)};Vb.prototype.toJSON=function(){return{type:\"FogExp2\",color:this.color.getHex(),density:this.density}};Wb.prototype.isFog=!0;Wb.prototype.clone=function(){return new Wb(this.color,this.near,this.far)};Wb.prototype.toJSON=function(){return{type:\"Fog\",color:this.color.getHex(),near:this.near,far:this.far}};vd.prototype=Object.assign(Object.create(H.prototype),{constructor:vd,copy:function(a,b){H.prototype.copy.call(this,a,b);null!==\na.background&&(this.background=a.background.clone());null!==a.fog&&(this.fog=a.fog.clone());null!==a.overrideMaterial&&(this.overrideMaterial=a.overrideMaterial.clone());this.autoUpdate=a.autoUpdate;this.matrixAutoUpdate=a.matrixAutoUpdate;return this},toJSON:function(a){var b=H.prototype.toJSON.call(this,a);null!==this.background&&(b.object.background=this.background.toJSON(a));null!==this.fog&&(b.object.fog=this.fog.toJSON());return b}});ib.prototype=Object.create(I.prototype);ib.prototype.constructor=\nib;ib.prototype.isSpriteMaterial=!0;ib.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.rotation=a.rotation;return this};Ic.prototype=Object.assign(Object.create(H.prototype),{constructor:Ic,isSprite:!0,raycast:function(){function a(a,b,c,d,h,l){e.subVectors(a,c).addScalar(.5).multiply(d);void 0!==h?(f.x=l*e.x-h*e.y,f.y=h*e.x+l*e.y):f.copy(e);a.copy(b);a.x+=f.x;a.y+=f.y;a.applyMatrix4(g)}var b=new p,c=new p,d=new p,e=new B,f=new B,g=new R,h=new p,\nl=new p,m=new p;return function(e,f){c.setFromMatrixScale(this.matrixWorld);g.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld);d.setFromMatrixPosition(this.modelViewMatrix);var k=this.material.rotation;if(0!==k){var n=Math.cos(k);var p=Math.sin(k)}k=this.center;a(h.set(-.5,-.5,0),d,k,c,p,n);a(l.set(.5,-.5,0),d,k,c,p,n);a(m.set(.5,.5,0),d,k,c,p,n);var v=e.ray.intersectTriangle(h,l,m,!1,b);if(null===v&&(a(l.set(-.5,.5,0),d,k,c,p,n),v=e.ray.intersectTriangle(h,m,l,!1,b),null===v))return;\np=e.ray.origin.distanceTo(b);p<e.near||p>e.far||f.push({distance:p,point:b.clone(),face:null,object:this})}}(),clone:function(){return(new this.constructor(this.material)).copy(this)},copy:function(a){H.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}});Jc.prototype=Object.assign(Object.create(H.prototype),{constructor:Jc,copy:function(a){H.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b<c;b++){var d=a[b];this.addLevel(d.object.clone(),d.distance)}return this},\naddLevel:function(a,b){void 0===b&&(b=0);b=Math.abs(b);for(var c=this.levels,d=0;d<c.length&&!(b<c[d].distance);d++);c.splice(d,0,{distance:b,object:a});this.add(a)},getObjectForDistance:function(a){for(var b=this.levels,c=1,d=b.length;c<d&&!(a<b[c].distance);c++);return b[c-1].object},raycast:function(){var a=new p;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}(),update:function(){var a=new p,b=new p;return function(c){var d=\nthis.levels;if(1<d.length){a.setFromMatrixPosition(c.matrixWorld);b.setFromMatrixPosition(this.matrixWorld);c=a.distanceTo(b);d[0].object.visible=!0;for(var e=1,f=d.length;e<f;e++)if(c>=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;e<f;e++)d[e].object.visible=!1}}}(),toJSON:function(a){a=H.prototype.toJSON.call(this,a);a.object.levels=[];for(var b=this.levels,c=0,d=b.length;c<d;c++){var e=b[c];a.object.levels.push({object:e.object.uuid,distance:e.distance})}return a}});\nObject.assign(Kc.prototype,{calculateInverses:function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new R;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}},pose:function(){var a,b;var c=0;for(b=this.bones.length;c<b;c++)(a=this.bones[c])&&a.matrixWorld.getInverse(this.boneInverses[c]);c=0;for(b=this.bones.length;c<b;c++)if(a=this.bones[c])a.parent&&a.parent.isBone?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):\na.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale)},update:function(){var a=new R,b=new R;return function(){for(var c=this.bones,d=this.boneInverses,e=this.boneMatrices,f=this.boneTexture,g=0,h=c.length;g<h;g++)a.multiplyMatrices(c[g]?c[g].matrixWorld:b,d[g]),a.toArray(e,16*g);void 0!==f&&(f.needsUpdate=!0)}}(),clone:function(){return new Kc(this.bones,this.boneInverses)},getBoneByName:function(a){for(var b=0,c=this.bones.length;b<c;b++){var d=this.bones[b];if(d.name===\na)return d}}});wd.prototype=Object.assign(Object.create(H.prototype),{constructor:wd,isBone:!0});xd.prototype=Object.assign(Object.create(va.prototype),{constructor:xd,isSkinnedMesh:!0,initBones:function(){var a=[],b;if(this.geometry&&void 0!==this.geometry.bones){var c=0;for(b=this.geometry.bones.length;c<b;c++){var d=this.geometry.bones[c];var e=new wd;a.push(e);e.name=d.name;e.position.fromArray(d.pos);e.quaternion.fromArray(d.rotq);void 0!==d.scl&&e.scale.fromArray(d.scl)}c=0;for(b=this.geometry.bones.length;c<\nb;c++)d=this.geometry.bones[c],-1!==d.parent&&null!==d.parent&&void 0!==a[d.parent]?a[d.parent].add(a[c]):this.add(a[c])}this.updateMatrixWorld(!0);return a},bind:function(a,b){this.skeleton=a;void 0===b&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),b=this.matrixWorld);this.bindMatrix.copy(b);this.bindMatrixInverse.getInverse(b)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var a;if(this.geometry&&this.geometry.isGeometry)for(a=0;a<this.geometry.skinWeights.length;a++){var b=\nthis.geometry.skinWeights[a];var c=1/b.manhattanLength();Infinity!==c?b.multiplyScalar(c):b.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){b=new W;var d=this.geometry.attributes.skinWeight;for(a=0;a<d.count;a++)b.x=d.getX(a),b.y=d.getY(a),b.z=d.getZ(a),b.w=d.getW(a),c=1/b.manhattanLength(),Infinity!==c?b.multiplyScalar(c):b.set(1,0,0,0),d.setXYZW(a,b.x,b.y,b.z,b.w)}},updateMatrixWorld:function(a){va.prototype.updateMatrixWorld.call(this,a);\"attached\"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):\n\"detached\"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn(\"THREE.SkinnedMesh: Unrecognized bindMode: \"+this.bindMode)},clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});T.prototype=Object.create(I.prototype);T.prototype.constructor=T;T.prototype.isLineBasicMaterial=!0;T.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.linewidth=a.linewidth;this.linecap=a.linecap;this.linejoin=a.linejoin;return this};\nwa.prototype=Object.assign(Object.create(H.prototype),{constructor:wa,isLine:!0,computeLineDistances:function(){var a=new p,b=new p;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[0],f=1,g=d.count;f<g;f++)a.fromBufferAttribute(d,f-1),b.fromBufferAttribute(d,f),e[f]=e[f-1],e[f]+=a.distanceTo(b);c.addAttribute(\"lineDistance\",new z(e,1))}else console.warn(\"THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\");\nelse if(c.isGeometry)for(d=c.vertices,e=c.lineDistances,e[0]=0,f=1,g=d.length;f<g;f++)e[f]=e[f-1],e[f]+=d[f-1].distanceTo(d[f]);return this}}(),raycast:function(){var a=new R,b=new sb,c=new Ha;return function(d,e){var f=d.linePrecision;f*=f;var g=this.geometry,h=this.matrixWorld;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(h);if(!1!==d.ray.intersectsSphere(c)){a.getInverse(h);b.copy(d.ray).applyMatrix4(a);var l=new p,m=new p;h=new p;var k=new p,n=this&&\nthis.isLineSegments?2:1;if(g.isBufferGeometry){var t=g.index,q=g.attributes.position.array;if(null!==t){t=t.array;g=0;for(var r=t.length-1;g<r;g+=n){var u=t[g+1];l.fromArray(q,3*t[g]);m.fromArray(q,3*u);u=b.distanceSqToSegment(l,m,k,h);u>f||(k.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(k),u<d.near||u>d.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}else for(g=0,r=q.length/3-1;g<r;g+=n)l.fromArray(q,3*g),m.fromArray(q,\n3*g+3),u=b.distanceSqToSegment(l,m,k,h),u>f||(k.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(k),u<d.near||u>d.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g.isGeometry)for(l=g.vertices,m=l.length,g=0;g<m-1;g+=n)u=b.distanceSqToSegment(l[g],l[g+1],k,h),u>f||(k.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(k),u<d.near||u>d.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,\nface:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});Y.prototype=Object.assign(Object.create(wa.prototype),{constructor:Y,isLineSegments:!0,computeLineDistances:function(){var a=new p,b=new p;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[],f=0,g=d.count;f<g;f+=2)a.fromBufferAttribute(d,f),b.fromBufferAttribute(d,f+1),e[f]=0===f?0:e[f-1],e[f+1]=e[f]+a.distanceTo(b);\nc.addAttribute(\"lineDistance\",new z(e,1))}else console.warn(\"THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\");else if(c.isGeometry)for(d=c.vertices,e=c.lineDistances,f=0,g=d.length;f<g;f+=2)a.copy(d[f]),b.copy(d[f+1]),e[f]=0===f?0:e[f-1],e[f+1]=e[f]+a.distanceTo(b);return this}}()});yd.prototype=Object.assign(Object.create(wa.prototype),{constructor:yd,isLineLoop:!0});Ja.prototype=Object.create(I.prototype);Ja.prototype.constructor=Ja;Ja.prototype.isPointsMaterial=\n!0;Ja.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.size=a.size;this.sizeAttenuation=a.sizeAttenuation;this.morphTargets=a.morphTargets;return this};Xb.prototype=Object.assign(Object.create(H.prototype),{constructor:Xb,isPoints:!0,raycast:function(){var a=new R,b=new sb,c=new Ha;return function(d,e){function f(a,c){var f=b.distanceSqToPoint(a);f<k&&(b.closestPointToPoint(a,n),n.applyMatrix4(l),a=d.ray.origin.distanceTo(n),a<d.near||a>d.far||\ne.push({distance:a,distanceToRay:Math.sqrt(f),point:n.clone(),index:c,face:null,object:g}))}var g=this,h=this.geometry,l=this.matrixWorld,m=d.params.Points.threshold;null===h.boundingSphere&&h.computeBoundingSphere();c.copy(h.boundingSphere);c.applyMatrix4(l);c.radius+=m;if(!1!==d.ray.intersectsSphere(c)){a.getInverse(l);b.copy(d.ray).applyMatrix4(a);m/=(this.scale.x+this.scale.y+this.scale.z)/3;var k=m*m;m=new p;var n=new p;if(h.isBufferGeometry){var t=h.index;h=h.attributes.position.array;if(null!==\nt){var q=t.array;t=0;for(var r=q.length;t<r;t++){var u=q[t];m.fromArray(h,3*u);f(m,u)}}else for(t=0,q=h.length/3;t<q;t++)m.fromArray(h,3*t),f(m,t)}else for(m=h.vertices,t=0,q=m.length;t<q;t++)f(m[t],t)}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});be.prototype=Object.assign(Object.create(ea.prototype),{constructor:be,isVideoTexture:!0,update:function(){var a=this.image;a.readyState>=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Yb.prototype=Object.create(ea.prototype);\nYb.prototype.constructor=Yb;Yb.prototype.isCompressedTexture=!0;Lc.prototype=Object.create(ea.prototype);Lc.prototype.constructor=Lc;Lc.prototype.isDepthTexture=!0;Zb.prototype=Object.create(D.prototype);Zb.prototype.constructor=Zb;Mc.prototype=Object.create(P.prototype);Mc.prototype.constructor=Mc;$b.prototype=Object.create(D.prototype);$b.prototype.constructor=$b;Nc.prototype=Object.create(P.prototype);Nc.prototype.constructor=Nc;xa.prototype=Object.create(D.prototype);xa.prototype.constructor=\nxa;Oc.prototype=Object.create(P.prototype);Oc.prototype.constructor=Oc;ac.prototype=Object.create(xa.prototype);ac.prototype.constructor=ac;Pc.prototype=Object.create(P.prototype);Pc.prototype.constructor=Pc;ub.prototype=Object.create(xa.prototype);ub.prototype.constructor=ub;Qc.prototype=Object.create(P.prototype);Qc.prototype.constructor=Qc;bc.prototype=Object.create(xa.prototype);bc.prototype.constructor=bc;Rc.prototype=Object.create(P.prototype);Rc.prototype.constructor=Rc;cc.prototype=Object.create(xa.prototype);\ncc.prototype.constructor=cc;Sc.prototype=Object.create(P.prototype);Sc.prototype.constructor=Sc;dc.prototype=Object.create(D.prototype);dc.prototype.constructor=dc;Tc.prototype=Object.create(P.prototype);Tc.prototype.constructor=Tc;ec.prototype=Object.create(D.prototype);ec.prototype.constructor=ec;Uc.prototype=Object.create(P.prototype);Uc.prototype.constructor=Uc;fc.prototype=Object.create(D.prototype);fc.prototype.constructor=fc;var Ug={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?\nb[0]*c:a.length,f=cf(a,0,e,c,!0),g=[];if(!f)return g;var h;if(d){var l=c;d=[];var m;var k=0;for(m=b.length;k<m;k++){var n=b[k]*l;var p=k<m-1?b[k+1]*l:a.length;n=cf(a,n,p,l,!1);n===n.next&&(n.steiner=!0);d.push(Rg(n))}d.sort(Pg);for(k=0;k<d.length;k++){b=d[k];l=f;if(l=Qg(b,l))b=ff(l,b),Wc(b,b.next);f=Wc(f,f.next)}}if(a.length>80*c){var q=h=a[0];var r=d=a[1];for(l=c;l<e;l+=c)k=a[l],b=a[l+1],k<q&&(q=k),b<r&&(r=b),k>h&&(h=k),b>d&&(d=b);h=Math.max(h-q,d-r);h=0!==h?1/h:0}Xc(f,g,c,q,r,h);return g}},$a={area:function(a){for(var b=\na.length,c=0,d=b-1,e=0;e<b;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*c},isClockWise:function(a){return 0>$a.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];gf(a);hf(c,a);var f=a.length;b.forEach(gf);for(a=0;a<b.length;a++)d.push(f),f+=b[a].length,hf(c,b[a]);b=Ug.triangulate(c,d);for(a=0;a<b.length;a+=3)e.push(b.slice(a,a+3));return e}};wb.prototype=Object.create(P.prototype);wb.prototype.constructor=wb;wb.prototype.toJSON=function(){var a=P.prototype.toJSON.call(this);return jf(this.parameters.shapes,\nthis.parameters.options,a)};Ta.prototype=Object.create(D.prototype);Ta.prototype.constructor=Ta;Ta.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);return jf(this.parameters.shapes,this.parameters.options,a)};var Sg={generateTopUV:function(a,b,c,d,e){a=b[3*d];d=b[3*d+1];var f=b[3*e];e=b[3*e+1];return[new B(b[3*c],b[3*c+1]),new B(a,d),new B(f,e)]},generateSideWallUV:function(a,b,c,d,e,f){a=b[3*c];var g=b[3*c+1];c=b[3*c+2];var h=b[3*d],l=b[3*d+1];d=b[3*d+2];var m=b[3*e],k=b[3*e+1];e=\nb[3*e+2];var n=b[3*f],p=b[3*f+1];b=b[3*f+2];return.01>Math.abs(g-l)?[new B(a,1-c),new B(h,1-d),new B(m,1-e),new B(n,1-b)]:[new B(g,1-c),new B(l,1-d),new B(k,1-e),new B(p,1-b)]}};Zc.prototype=Object.create(P.prototype);Zc.prototype.constructor=Zc;gc.prototype=Object.create(Ta.prototype);gc.prototype.constructor=gc;$c.prototype=Object.create(P.prototype);$c.prototype.constructor=$c;xb.prototype=Object.create(D.prototype);xb.prototype.constructor=xb;ad.prototype=Object.create(P.prototype);ad.prototype.constructor=\nad;hc.prototype=Object.create(D.prototype);hc.prototype.constructor=hc;bd.prototype=Object.create(P.prototype);bd.prototype.constructor=bd;ic.prototype=Object.create(D.prototype);ic.prototype.constructor=ic;yb.prototype=Object.create(P.prototype);yb.prototype.constructor=yb;yb.prototype.toJSON=function(){var a=P.prototype.toJSON.call(this);return kf(this.parameters.shapes,a)};zb.prototype=Object.create(D.prototype);zb.prototype.constructor=zb;zb.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);\nreturn kf(this.parameters.shapes,a)};jc.prototype=Object.create(D.prototype);jc.prototype.constructor=jc;Ab.prototype=Object.create(P.prototype);Ab.prototype.constructor=Ab;ab.prototype=Object.create(D.prototype);ab.prototype.constructor=ab;cd.prototype=Object.create(Ab.prototype);cd.prototype.constructor=cd;dd.prototype=Object.create(ab.prototype);dd.prototype.constructor=dd;ed.prototype=Object.create(P.prototype);ed.prototype.constructor=ed;kc.prototype=Object.create(D.prototype);kc.prototype.constructor=\nkc;var ka=Object.freeze({WireframeGeometry:Zb,ParametricGeometry:Mc,ParametricBufferGeometry:$b,TetrahedronGeometry:Oc,TetrahedronBufferGeometry:ac,OctahedronGeometry:Pc,OctahedronBufferGeometry:ub,IcosahedronGeometry:Qc,IcosahedronBufferGeometry:bc,DodecahedronGeometry:Rc,DodecahedronBufferGeometry:cc,PolyhedronGeometry:Nc,PolyhedronBufferGeometry:xa,TubeGeometry:Sc,TubeBufferGeometry:dc,TorusKnotGeometry:Tc,TorusKnotBufferGeometry:ec,TorusGeometry:Uc,TorusBufferGeometry:fc,TextGeometry:Zc,TextBufferGeometry:gc,\nSphereGeometry:$c,SphereBufferGeometry:xb,RingGeometry:ad,RingBufferGeometry:hc,PlaneGeometry:Fc,PlaneBufferGeometry:rb,LatheGeometry:bd,LatheBufferGeometry:ic,ShapeGeometry:yb,ShapeBufferGeometry:zb,ExtrudeGeometry:wb,ExtrudeBufferGeometry:Ta,EdgesGeometry:jc,ConeGeometry:cd,ConeBufferGeometry:dd,CylinderGeometry:Ab,CylinderBufferGeometry:ab,CircleGeometry:ed,CircleBufferGeometry:kc,BoxGeometry:Nb,BoxBufferGeometry:pb});Bb.prototype=Object.create(I.prototype);Bb.prototype.constructor=Bb;Bb.prototype.isShadowMaterial=\n!0;Bb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);return this};lc.prototype=Object.create(Fa.prototype);lc.prototype.constructor=lc;lc.prototype.isRawShaderMaterial=!0;Ua.prototype=Object.create(I.prototype);Ua.prototype.constructor=Ua;Ua.prototype.isMeshStandardMaterial=!0;Ua.prototype.copy=function(a){I.prototype.copy.call(this,a);this.defines={STANDARD:\"\"};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=\na.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.roughnessMap=\na.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Cb.prototype=Object.create(Ua.prototype);Cb.prototype.constructor=Cb;\nCb.prototype.isMeshPhysicalMaterial=!0;Cb.prototype.copy=function(a){Ua.prototype.copy.call(this,a);this.defines={PHYSICAL:\"\"};this.reflectivity=a.reflectivity;this.clearCoat=a.clearCoat;this.clearCoatRoughness=a.clearCoatRoughness;return this};Ka.prototype=Object.create(I.prototype);Ka.prototype.constructor=Ka;Ka.prototype.isMeshPhongMaterial=!0;Ka.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=\na.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;\nthis.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Db.prototype=Object.create(Ka.prototype);Db.prototype.constructor=Db;\nDb.prototype.isMeshToonMaterial=!0;Db.prototype.copy=function(a){Ka.prototype.copy.call(this,a);this.gradientMap=a.gradientMap;return this};Eb.prototype=Object.create(I.prototype);Eb.prototype.constructor=Eb;Eb.prototype.isMeshNormalMaterial=!0;Eb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=\na.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Fb.prototype=Object.create(I.prototype);Fb.prototype.constructor=Fb;Fb.prototype.isMeshLambertMaterial=!0;Fb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;\nthis.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=\na.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Gb.prototype=Object.create(T.prototype);Gb.prototype.constructor=Gb;Gb.prototype.isLineDashedMaterial=!0;Gb.prototype.copy=function(a){T.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var Vg=Object.freeze({ShadowMaterial:Bb,SpriteMaterial:ib,RawShaderMaterial:lc,ShaderMaterial:Fa,PointsMaterial:Ja,MeshPhysicalMaterial:Cb,MeshStandardMaterial:Ua,MeshPhongMaterial:Ka,\nMeshToonMaterial:Db,MeshNormalMaterial:Eb,MeshLambertMaterial:Fb,MeshDepthMaterial:fb,MeshDistanceMaterial:gb,MeshBasicMaterial:ua,LineDashedMaterial:Gb,LineBasicMaterial:T,Material:I}),Kb={enabled:!1,files:{},add:function(a,b){!1!==this.enabled&&(this.files[a]=b)},get:function(a){if(!1!==this.enabled)return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}},ya=new ee,cb={};Object.assign(La.prototype,{load:function(a,b,c,d){void 0===a&&(a=\"\");void 0!==this.path&&\n(a=this.path+a);a=this.manager.resolveURL(a);var e=this,f=Kb.get(a);if(void 0!==f)return e.manager.itemStart(a),setTimeout(function(){b&&b(f);e.manager.itemEnd(a)},0),f;if(void 0!==cb[a])cb[a].push({onLoad:b,onProgress:c,onError:d});else{var g=a.match(/^data:(.*?)(;base64)?,(.*)$/);if(g){c=g[1];var h=!!g[2];g=g[3];g=window.decodeURIComponent(g);h&&(g=window.atob(g));try{var l=(this.responseType||\"\").toLowerCase();switch(l){case \"arraybuffer\":case \"blob\":var m=new Uint8Array(g.length);for(h=0;h<g.length;h++)m[h]=\ng.charCodeAt(h);var k=\"blob\"===l?new Blob([m.buffer],{type:c}):m.buffer;break;case \"document\":k=(new DOMParser).parseFromString(g,c);break;case \"json\":k=JSON.parse(g);break;default:k=g}window.setTimeout(function(){b&&b(k);e.manager.itemEnd(a)},0)}catch(t){window.setTimeout(function(){d&&d(t);e.manager.itemEnd(a);e.manager.itemError(a)},0)}}else{cb[a]=[];cb[a].push({onLoad:b,onProgress:c,onError:d});var n=new XMLHttpRequest;n.open(\"GET\",a,!0);n.addEventListener(\"load\",function(b){var c=this.response;\nKb.add(a,c);var d=cb[a];delete cb[a];if(200===this.status||0===this.status){0===this.status&&console.warn(\"THREE.FileLoader: HTTP Status 0 received.\");for(var f=0,g=d.length;f<g;f++){var h=d[f];if(h.onLoad)h.onLoad(c)}e.manager.itemEnd(a)}else{f=0;for(g=d.length;f<g;f++)if(h=d[f],h.onError)h.onError(b);e.manager.itemEnd(a);e.manager.itemError(a)}},!1);n.addEventListener(\"progress\",function(b){for(var c=cb[a],d=0,e=c.length;d<e;d++){var f=c[d];if(f.onProgress)f.onProgress(b)}},!1);n.addEventListener(\"error\",\nfunction(b){var c=cb[a];delete cb[a];for(var d=0,f=c.length;d<f;d++){var g=c[d];if(g.onError)g.onError(b)}e.manager.itemEnd(a);e.manager.itemError(a)},!1);void 0!==this.responseType&&(n.responseType=this.responseType);void 0!==this.withCredentials&&(n.withCredentials=this.withCredentials);n.overrideMimeType&&n.overrideMimeType(void 0!==this.mimeType?this.mimeType:\"text/plain\");for(h in this.requestHeader)n.setRequestHeader(h,this.requestHeader[h]);n.send(null)}e.manager.itemStart(a);return n}},setPath:function(a){this.path=\na;return this},setResponseType:function(a){this.responseType=a;return this},setWithCredentials:function(a){this.withCredentials=a;return this},setMimeType:function(a){this.mimeType=a;return this},setRequestHeader:function(a){this.requestHeader=a;return this}});Object.assign(lf.prototype,{load:function(a,b,c,d){function e(e){l.load(a[e],function(a){a=f._parser(a,!0);g[e]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};m+=1;6===m&&(1===a.mipmapCount&&(h.minFilter=1006),h.format=a.format,\nh.needsUpdate=!0,b&&b(h))},c,d)}var f=this,g=[],h=new Yb;h.image=g;var l=new La(this.manager);l.setPath(this.path);l.setResponseType(\"arraybuffer\");if(Array.isArray(a))for(var m=0,k=0,n=a.length;k<n;++k)e(k);else l.load(a,function(a){a=f._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,d=0;d<c;d++){g[d]={mipmaps:[]};for(var e=0;e<a.mipmapCount;e++)g[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+e]),g[d].format=a.format,g[d].width=a.width,g[d].height=a.height}else h.image.width=a.width,\nh.image.height=a.height,h.mipmaps=a.mipmaps;1===a.mipmapCount&&(h.minFilter=1006);h.format=a.format;h.needsUpdate=!0;b&&b(h)},c,d);return h},setPath:function(a){this.path=a;return this}});Object.assign(fe.prototype,{load:function(a,b,c,d){var e=this,f=new lb,g=new La(this.manager);g.setResponseType(\"arraybuffer\");g.load(a,function(a){if(a=e._parser(a))void 0!==a.image?f.image=a.image:void 0!==a.data&&(f.image.width=a.width,f.image.height=a.height,f.image.data=a.data),f.wrapS=void 0!==a.wrapS?a.wrapS:\n1001,f.wrapT=void 0!==a.wrapT?a.wrapT:1001,f.magFilter=void 0!==a.magFilter?a.magFilter:1006,f.minFilter=void 0!==a.minFilter?a.minFilter:1008,f.anisotropy=void 0!==a.anisotropy?a.anisotropy:1,void 0!==a.format&&(f.format=a.format),void 0!==a.type&&(f.type=a.type),void 0!==a.mipmaps&&(f.mipmaps=a.mipmaps),1===a.mipmapCount&&(f.minFilter=1006),f.needsUpdate=!0,b&&b(f,a)},c,d);return f}});Object.assign(fd.prototype,{crossOrigin:\"anonymous\",load:function(a,b,c,d){function e(){l.removeEventListener(\"load\",\ne,!1);l.removeEventListener(\"error\",f,!1);Kb.add(a,this);b&&b(this);g.manager.itemEnd(a)}function f(b){l.removeEventListener(\"load\",e,!1);l.removeEventListener(\"error\",f,!1);d&&d(b);g.manager.itemEnd(a);g.manager.itemError(a)}void 0===a&&(a=\"\");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var g=this,h=Kb.get(a);if(void 0!==h)return g.manager.itemStart(a),setTimeout(function(){b&&b(h);g.manager.itemEnd(a)},0),h;var l=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"img\");\nl.addEventListener(\"load\",e,!1);l.addEventListener(\"error\",f,!1);\"data:\"!==a.substr(0,5)&&void 0!==this.crossOrigin&&(l.crossOrigin=this.crossOrigin);g.manager.itemStart(a);l.src=a;return l},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(ge.prototype,{crossOrigin:\"anonymous\",load:function(a,b,c,d){function e(c){g.load(a[c],function(a){f.images[c]=a;h++;6===h&&(f.needsUpdate=!0,b&&b(f))},void 0,d)}var f=new Za,g=new fd(this.manager);\ng.setCrossOrigin(this.crossOrigin);g.setPath(this.path);var h=0;for(c=0;c<a.length;++c)e(c);return f},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(Ad.prototype,{crossOrigin:\"anonymous\",load:function(a,b,c,d){var e=new ea,f=new fd(this.manager);f.setCrossOrigin(this.crossOrigin);f.setPath(this.path);f.load(a,function(c){e.image=c;c=0<a.search(/\\.(jpg|jpeg)$/)||0===a.search(/^data:image\\/jpeg/);e.format=c?1022:1023;e.needsUpdate=\n!0;void 0!==b&&b(e)},c,d);return e},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(E.prototype,{getPoint:function(){console.warn(\"THREE.Curve: .getPoint() not implemented.\");return null},getPointAt:function(a,b){a=this.getUtoTmapping(a);return this.getPoint(a,b)},getPoints:function(a){void 0===a&&(a=5);for(var b=[],c=0;c<=a;c++)b.push(this.getPoint(c/a));return b},getSpacedPoints:function(a){void 0===a&&(a=5);for(var b=[],c=\n0;c<=a;c++)b.push(this.getPointAt(c/a));return b},getLength:function(){var a=this.getLengths();return a[a.length-1]},getLengths:function(a){void 0===a&&(a=this.arcLengthDivisions);if(this.cacheArcLengths&&this.cacheArcLengths.length===a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c=this.getPoint(0),d,e=0;b.push(0);for(d=1;d<=a;d++){var f=this.getPoint(d/a);e+=f.distanceTo(c);b.push(e);c=f}return this.cacheArcLengths=b},updateArcLengths:function(){this.needsUpdate=\n!0;this.getLengths()},getUtoTmapping:function(a,b){var c=this.getLengths(),d=c.length;b=b?b:a*c[d-1];for(var e=0,f=d-1,g;e<=f;)if(a=Math.floor(e+(f-e)/2),g=c[a]-b,0>g)e=a+1;else if(0<g)f=a-1;else{f=a;break}a=f;if(c[a]===b)return a/(d-1);e=c[a];return(a+(b-e)/(c[a+1]-e))/(d-1)},getTangent:function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()},getTangentAt:function(a){a=this.getUtoTmapping(a);return this.getTangent(a)},computeFrenetFrames:function(a,\nb){var c=new p,d=[],e=[],f=[],g=new p,h=new R,l;for(l=0;l<=a;l++){var m=l/a;d[l]=this.getTangentAt(m);d[l].normalize()}e[0]=new p;f[0]=new p;l=Number.MAX_VALUE;m=Math.abs(d[0].x);var k=Math.abs(d[0].y),n=Math.abs(d[0].z);m<=l&&(l=m,c.set(1,0,0));k<=l&&(l=k,c.set(0,1,0));n<=l&&c.set(0,0,1);g.crossVectors(d[0],c).normalize();e[0].crossVectors(d[0],g);f[0].crossVectors(d[0],e[0]);for(l=1;l<=a;l++)e[l]=e[l-1].clone(),f[l]=f[l-1].clone(),g.crossVectors(d[l-1],d[l]),g.length()>Number.EPSILON&&(g.normalize(),\nc=Math.acos(J.clamp(d[l-1].dot(d[l]),-1,1)),e[l].applyMatrix4(h.makeRotationAxis(g,c))),f[l].crossVectors(d[l],e[l]);if(!0===b)for(c=Math.acos(J.clamp(e[0].dot(e[a]),-1,1)),c/=a,0<d[0].dot(g.crossVectors(e[0],e[a]))&&(c=-c),l=1;l<=a;l++)e[l].applyMatrix4(h.makeRotationAxis(d[l],c*l)),f[l].crossVectors(d[l],e[l]);return{tangents:d,normals:e,binormals:f}},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.arcLengthDivisions=a.arcLengthDivisions;return this},toJSON:function(){var a=\n{metadata:{version:4.5,type:\"Curve\",generator:\"Curve.toJSON\"}};a.arcLengthDivisions=this.arcLengthDivisions;a.type=this.type;return a},fromJSON:function(a){this.arcLengthDivisions=a.arcLengthDivisions;return this}});Da.prototype=Object.create(E.prototype);Da.prototype.constructor=Da;Da.prototype.isEllipseCurve=!0;Da.prototype.getPoint=function(a,b){b=b||new B;for(var c=2*Math.PI,d=this.aEndAngle-this.aStartAngle,e=Math.abs(d)<Number.EPSILON;0>d;)d+=c;for(;d>c;)d-=c;d<Number.EPSILON&&(d=e?0:c);!0!==\nthis.aClockwise||e||(d=d===c?-c:d-c);c=this.aStartAngle+a*d;a=this.aX+this.xRadius*Math.cos(c);var f=this.aY+this.yRadius*Math.sin(c);0!==this.aRotation&&(c=Math.cos(this.aRotation),d=Math.sin(this.aRotation),e=a-this.aX,f-=this.aY,a=e*c-f*d+this.aX,f=e*d+f*c+this.aY);return b.set(a,f)};Da.prototype.copy=function(a){E.prototype.copy.call(this,a);this.aX=a.aX;this.aY=a.aY;this.xRadius=a.xRadius;this.yRadius=a.yRadius;this.aStartAngle=a.aStartAngle;this.aEndAngle=a.aEndAngle;this.aClockwise=a.aClockwise;\nthis.aRotation=a.aRotation;return this};Da.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.aX=this.aX;a.aY=this.aY;a.xRadius=this.xRadius;a.yRadius=this.yRadius;a.aStartAngle=this.aStartAngle;a.aEndAngle=this.aEndAngle;a.aClockwise=this.aClockwise;a.aRotation=this.aRotation;return a};Da.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.aX=a.aX;this.aY=a.aY;this.xRadius=a.xRadius;this.yRadius=a.yRadius;this.aStartAngle=a.aStartAngle;this.aEndAngle=a.aEndAngle;\nthis.aClockwise=a.aClockwise;this.aRotation=a.aRotation;return this};mc.prototype=Object.create(Da.prototype);mc.prototype.constructor=mc;mc.prototype.isArcCurve=!0;var Td=new p,Ce=new he,De=new he,Ee=new he;pa.prototype=Object.create(E.prototype);pa.prototype.constructor=pa;pa.prototype.isCatmullRomCurve3=!0;pa.prototype.getPoint=function(a,b){b=b||new p;var c=this.points,d=c.length;a*=d-(this.closed?0:1);var e=Math.floor(a);a-=e;this.closed?e+=0<e?0:(Math.floor(Math.abs(e)/d)+1)*d:0===a&&e===d-\n1&&(e=d-2,a=1);if(this.closed||0<e)var f=c[(e-1)%d];else Td.subVectors(c[0],c[1]).add(c[0]),f=Td;var g=c[e%d];var h=c[(e+1)%d];this.closed||e+2<d?c=c[(e+2)%d]:(Td.subVectors(c[d-1],c[d-2]).add(c[d-1]),c=Td);if(\"centripetal\"===this.curveType||\"chordal\"===this.curveType){var l=\"chordal\"===this.curveType?.5:.25;d=Math.pow(f.distanceToSquared(g),l);e=Math.pow(g.distanceToSquared(h),l);l=Math.pow(h.distanceToSquared(c),l);1E-4>e&&(e=1);1E-4>d&&(d=e);1E-4>l&&(l=e);Ce.initNonuniformCatmullRom(f.x,g.x,h.x,\nc.x,d,e,l);De.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,l);Ee.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,l)}else\"catmullrom\"===this.curveType&&(Ce.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),De.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),Ee.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(Ce.calc(a),De.calc(a),Ee.calc(a));return b};pa.prototype.copy=function(a){E.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b<c;b++)this.points.push(a.points[b].clone());this.closed=\na.closed;this.curveType=a.curveType;this.tension=a.tension;return this};pa.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.points=[];for(var b=0,c=this.points.length;b<c;b++)a.points.push(this.points[b].toArray());a.closed=this.closed;a.curveType=this.curveType;a.tension=this.tension;return a};pa.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.points=[];for(var b=0,c=a.points.length;b<c;b++){var d=a.points[b];this.points.push((new p).fromArray(d))}this.closed=\na.closed;this.curveType=a.curveType;this.tension=a.tension;return this};Ma.prototype=Object.create(E.prototype);Ma.prototype.constructor=Ma;Ma.prototype.isCubicBezierCurve=!0;Ma.prototype.getPoint=function(a,b){b=b||new B;var c=this.v0,d=this.v1,e=this.v2,f=this.v3;b.set(hd(a,c.x,d.x,e.x,f.x),hd(a,c.y,d.y,e.y,f.y));return b};Ma.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);this.v3.copy(a.v3);return this};Ma.prototype.toJSON=function(){var a=\nE.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();a.v3=this.v3.toArray();return a};Ma.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);this.v3.fromArray(a.v3);return this};Va.prototype=Object.create(E.prototype);Va.prototype.constructor=Va;Va.prototype.isCubicBezierCurve3=!0;Va.prototype.getPoint=function(a,b){b=b||new p;var c=this.v0,d=this.v1,e=this.v2,f=this.v3;\nb.set(hd(a,c.x,d.x,e.x,f.x),hd(a,c.y,d.y,e.y,f.y),hd(a,c.z,d.z,e.z,f.z));return b};Va.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);this.v3.copy(a.v3);return this};Va.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();a.v3=this.v3.toArray();return a};Va.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);\nthis.v2.fromArray(a.v2);this.v3.fromArray(a.v3);return this};ia.prototype=Object.create(E.prototype);ia.prototype.constructor=ia;ia.prototype.isLineCurve=!0;ia.prototype.getPoint=function(a,b){b=b||new B;1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(a).add(this.v1));return b};ia.prototype.getPointAt=function(a,b){return this.getPoint(a,b)};ia.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()};ia.prototype.copy=function(a){E.prototype.copy.call(this,\na);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};ia.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};ia.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Na.prototype=Object.create(E.prototype);Na.prototype.constructor=Na;Na.prototype.isLineCurve3=!0;Na.prototype.getPoint=function(a,b){b=b||new p;1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),\nb.multiplyScalar(a).add(this.v1));return b};Na.prototype.getPointAt=function(a,b){return this.getPoint(a,b)};Na.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};Na.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};Na.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Oa.prototype=Object.create(E.prototype);\nOa.prototype.constructor=Oa;Oa.prototype.isQuadraticBezierCurve=!0;Oa.prototype.getPoint=function(a,b){b=b||new B;var c=this.v0,d=this.v1,e=this.v2;b.set(gd(a,c.x,d.x,e.x),gd(a,c.y,d.y,e.y));return b};Oa.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};Oa.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};Oa.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,\na);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Wa.prototype=Object.create(E.prototype);Wa.prototype.constructor=Wa;Wa.prototype.isQuadraticBezierCurve3=!0;Wa.prototype.getPoint=function(a,b){b=b||new p;var c=this.v0,d=this.v1,e=this.v2;b.set(gd(a,c.x,d.x,e.x),gd(a,c.y,d.y,e.y),gd(a,c.z,d.z,e.z));return b};Wa.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};Wa.prototype.toJSON=function(){var a=\nE.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};Wa.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Pa.prototype=Object.create(E.prototype);Pa.prototype.constructor=Pa;Pa.prototype.isSplineCurve=!0;Pa.prototype.getPoint=function(a,b){b=b||new B;var c=this.points,d=(c.length-1)*a;a=Math.floor(d);d-=a;var e=c[0===a?a:a-1],f=c[a],g=c[a>c.length-\n2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(mf(d,e.x,f.x,g.x,c.x),mf(d,e.y,f.y,g.y,c.y));return b};Pa.prototype.copy=function(a){E.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b<c;b++)this.points.push(a.points[b].clone());return this};Pa.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.points=[];for(var b=0,c=this.points.length;b<c;b++)a.points.push(this.points[b].toArray());return a};Pa.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,\na);this.points=[];for(var b=0,c=a.points.length;b<c;b++){var d=a.points[b];this.points.push((new B).fromArray(d))}return this};var Bf=Object.freeze({ArcCurve:mc,CatmullRomCurve3:pa,CubicBezierCurve:Ma,CubicBezierCurve3:Va,EllipseCurve:Da,LineCurve:ia,LineCurve3:Na,QuadraticBezierCurve:Oa,QuadraticBezierCurve3:Wa,SplineCurve:Pa});bb.prototype=Object.assign(Object.create(E.prototype),{constructor:bb,add:function(a){this.curves.push(a)},closePath:function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-\n1].getPoint(1);a.equals(b)||this.curves.push(new ia(b,a))},getPoint:function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.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;\nfor(var a=[],b=0,c=0,d=this.curves.length;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a},getSpacedPoints:function(a){void 0===a&&(a=40);for(var b=[],c=0;c<=a;c++)b.push(this.getPoint(c/a));this.autoClose&&b.push(b[0]);return b},getPoints:function(a){a=a||12;for(var b=[],c,d=0,e=this.curves;d<e.length;d++){var f=e[d];f=f.getPoints(f&&f.isEllipseCurve?2*a:f&&(f.isLineCurve||f.isLineCurve3)?1:f&&f.isSplineCurve?a*f.points.length:a);for(var g=0;g<f.length;g++){var h=f[g];\nc&&c.equals(h)||(b.push(h),c=h)}}this.autoClose&&1<b.length&&!b[b.length-1].equals(b[0])&&b.push(b[0]);return b},copy:function(a){E.prototype.copy.call(this,a);this.curves=[];for(var b=0,c=a.curves.length;b<c;b++)this.curves.push(a.curves[b].clone());this.autoClose=a.autoClose;return this},toJSON:function(){var a=E.prototype.toJSON.call(this);a.autoClose=this.autoClose;a.curves=[];for(var b=0,c=this.curves.length;b<c;b++)a.curves.push(this.curves[b].toJSON());return a},fromJSON:function(a){E.prototype.fromJSON.call(this,\na);this.autoClose=a.autoClose;this.curves=[];for(var b=0,c=a.curves.length;b<c;b++){var d=a.curves[b];this.curves.push((new Bf[d.type]).fromJSON(d))}return this}});Qa.prototype=Object.assign(Object.create(bb.prototype),{constructor:Qa,setFromPoints:function(a){this.moveTo(a[0].x,a[0].y);for(var b=1,c=a.length;b<c;b++)this.lineTo(a[b].x,a[b].y)},moveTo:function(a,b){this.currentPoint.set(a,b)},lineTo:function(a,b){var c=new ia(this.currentPoint.clone(),new B(a,b));this.curves.push(c);this.currentPoint.set(a,\nb)},quadraticCurveTo:function(a,b,c,d){a=new Oa(this.currentPoint.clone(),new B(a,b),new B(c,d));this.curves.push(a);this.currentPoint.set(c,d)},bezierCurveTo:function(a,b,c,d,e,f){a=new Ma(this.currentPoint.clone(),new B(a,b),new B(c,d),new B(e,f));this.curves.push(a);this.currentPoint.set(e,f)},splineThru:function(a){var b=[this.currentPoint.clone()].concat(a);b=new Pa(b);this.curves.push(b);this.currentPoint.copy(a[a.length-1])},arc:function(a,b,c,d,e,f){this.absarc(a+this.currentPoint.x,b+this.currentPoint.y,\nc,d,e,f)},absarc:function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)},ellipse:function(a,b,c,d,e,f,g,h){this.absellipse(a+this.currentPoint.x,b+this.currentPoint.y,c,d,e,f,g,h)},absellipse:function(a,b,c,d,e,f,g,h){a=new Da(a,b,c,d,e,f,g,h);0<this.curves.length&&(b=a.getPoint(0),b.equals(this.currentPoint)||this.lineTo(b.x,b.y));this.curves.push(a);a=a.getPoint(1);this.currentPoint.copy(a)},copy:function(a){bb.prototype.copy.call(this,a);this.currentPoint.copy(a.currentPoint);return this},toJSON:function(){var a=\nbb.prototype.toJSON.call(this);a.currentPoint=this.currentPoint.toArray();return a},fromJSON:function(a){bb.prototype.fromJSON.call(this,a);this.currentPoint.fromArray(a.currentPoint);return this}});jb.prototype=Object.assign(Object.create(Qa.prototype),{constructor:jb,getPointsHoles:function(a){for(var b=[],c=0,d=this.holes.length;c<d;c++)b[c]=this.holes[c].getPoints(a);return b},extractPoints:function(a){return{shape:this.getPoints(a),holes:this.getPointsHoles(a)}},copy:function(a){Qa.prototype.copy.call(this,\na);this.holes=[];for(var b=0,c=a.holes.length;b<c;b++)this.holes.push(a.holes[b].clone());return this},toJSON:function(){var a=Qa.prototype.toJSON.call(this);a.uuid=this.uuid;a.holes=[];for(var b=0,c=this.holes.length;b<c;b++)a.holes.push(this.holes[b].toJSON());return a},fromJSON:function(a){Qa.prototype.fromJSON.call(this,a);this.uuid=a.uuid;this.holes=[];for(var b=0,c=a.holes.length;b<c;b++){var d=a.holes[b];this.holes.push((new Qa).fromJSON(d))}return this}});X.prototype=Object.assign(Object.create(H.prototype),\n{constructor:X,isLight:!0,copy:function(a){H.prototype.copy.call(this,a);this.color.copy(a.color);this.intensity=a.intensity;return this},toJSON:function(a){a=H.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();a.object.intensity=this.intensity;void 0!==this.groundColor&&(a.object.groundColor=this.groundColor.getHex());void 0!==this.distance&&(a.object.distance=this.distance);void 0!==this.angle&&(a.object.angle=this.angle);void 0!==this.decay&&(a.object.decay=this.decay);void 0!==\nthis.penumbra&&(a.object.penumbra=this.penumbra);void 0!==this.shadow&&(a.object.shadow=this.shadow.toJSON());return a}});Bd.prototype=Object.assign(Object.create(X.prototype),{constructor:Bd,isHemisphereLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.groundColor.copy(a.groundColor);return this}});Object.assign(Hb.prototype,{copy:function(a){this.camera=a.camera.clone();this.bias=a.bias;this.radius=a.radius;this.mapSize.copy(a.mapSize);return this},clone:function(){return(new this.constructor).copy(this)},\ntoJSON:function(){var a={};0!==this.bias&&(a.bias=this.bias);1!==this.radius&&(a.radius=this.radius);if(512!==this.mapSize.x||512!==this.mapSize.y)a.mapSize=this.mapSize.toArray();a.camera=this.camera.toJSON(!1).object;delete a.camera.matrix;return a}});Cd.prototype=Object.assign(Object.create(Hb.prototype),{constructor:Cd,isSpotLightShadow:!0,update:function(a){var b=this.camera,c=2*J.RAD2DEG*a.angle,d=this.mapSize.width/this.mapSize.height;a=a.distance||b.far;if(c!==b.fov||d!==b.aspect||a!==b.far)b.fov=\nc,b.aspect=d,b.far=a,b.updateProjectionMatrix()}});Dd.prototype=Object.assign(Object.create(X.prototype),{constructor:Dd,isSpotLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.distance=a.distance;this.angle=a.angle;this.penumbra=a.penumbra;this.decay=a.decay;this.target=a.target.clone();this.shadow=a.shadow.clone();return this}});Ed.prototype=Object.assign(Object.create(X.prototype),{constructor:Ed,isPointLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.distance=a.distance;\nthis.decay=a.decay;this.shadow=a.shadow.clone();return this}});Fd.prototype=Object.assign(Object.create(Hb.prototype),{constructor:Fd});Gd.prototype=Object.assign(Object.create(X.prototype),{constructor:Gd,isDirectionalLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.target=a.target.clone();this.shadow=a.shadow.clone();return this}});Hd.prototype=Object.assign(Object.create(X.prototype),{constructor:Hd,isAmbientLight:!0});Id.prototype=Object.assign(Object.create(X.prototype),{constructor:Id,\nisRectAreaLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.width=a.width;this.height=a.height;return this},toJSON:function(a){a=X.prototype.toJSON.call(this,a);a.object.width=this.width;a.object.height=this.height;return a}});Jd.prototype=Object.assign(Object.create(ja.prototype),{constructor:Jd,ValueTypeName:\"string\",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Kd.prototype=Object.assign(Object.create(ja.prototype),\n{constructor:Kd,ValueTypeName:\"bool\",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Object.assign(Ea.prototype,{evaluate:function(a){var b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];a:{b:{c:{d:if(!(a<d)){for(var f=c+2;;){if(void 0===d){if(a<e)break d;this._cachedIndex=c=b.length;return this.afterEnd_(c-1,a,e)}if(c===f)break;e=d;d=b[++c];if(a<d)break b}d=b.length;break c}if(a>=e)break a;else{f=b[1];a<f&&\n(c=2,e=f);for(f=c-2;;){if(void 0===e)return this._cachedIndex=0,this.beforeStart_(0,a,d);if(c===f)break;d=e;e=b[--c-1];if(a>=e)break b}d=c;c=0}}for(;c<d;)e=c+d>>>1,a<b[e]?d=e:c=e+1;d=b[c];e=b[c-1];if(void 0===e)return this._cachedIndex=0,this.beforeStart_(0,a,d);if(void 0===d)return this._cachedIndex=c=b.length,this.afterEnd_(c-1,e,a)}this._cachedIndex=c;this.intervalChanged_(c,e,d)}return this.interpolate_(c,e,a,d)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||\nthis.DefaultSettings_},copySampleValue_:function(a){var b=this.resultBuffer,c=this.sampleValues,d=this.valueSize;a*=d;for(var e=0;e!==d;++e)b[e]=c[a+e];return b},interpolate_:function(){throw Error(\"call to abstract method\");},intervalChanged_:function(){}});Object.assign(Ea.prototype,{beforeStart_:Ea.prototype.copySampleValue_,afterEnd_:Ea.prototype.copySampleValue_});Ld.prototype=Object.assign(Object.create(Ea.prototype),{constructor:Ld,interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,\ng=this.valueSize;a*=g;b=(c-b)/(d-b);for(c=a+g;a!==c;a+=4)ca.slerpFlat(e,0,f,a-g,f,a,b);return e}});id.prototype=Object.assign(Object.create(ja.prototype),{constructor:id,ValueTypeName:\"quaternion\",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(a){return new Ld(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:void 0});Md.prototype=Object.assign(Object.create(ja.prototype),{constructor:Md,ValueTypeName:\"color\"});nc.prototype=Object.assign(Object.create(ja.prototype),\n{constructor:nc,ValueTypeName:\"number\"});Nd.prototype=Object.assign(Object.create(Ea.prototype),{constructor:Nd,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(a,b,c){var d=this.parameterPositions,e=a-2,f=a+1,g=d[e],h=d[f];if(void 0===g)switch(this.getSettings_().endingStart){case 2401:e=a;g=2*b-c;break;case 2402:e=d.length-2;g=b+d[e]-d[e+1];break;default:e=a,g=c}if(void 0===h)switch(this.getSettings_().endingEnd){case 2401:f=a;h=2*c-b;break;case 2402:f=1;h=c+d[1]-d[0];\nbreak;default:f=a-1,h=b}a=.5*(c-b);d=this.valueSize;this._weightPrev=a/(b-g);this._weightNext=a/(h-c);this._offsetPrev=e*d;this._offsetNext=f*d},interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;var h=a-g,l=this._offsetPrev,m=this._offsetNext,k=this._weightPrev,n=this._weightNext,p=(c-b)/(d-b);c=p*p;d=c*p;b=-k*d+2*k*c-k*p;k=(1+k)*d+(-1.5-2*k)*c+(-.5+k)*p+1;p=(-1-n)*d+(1.5+n)*c+.5*p;n=n*d-n*c;for(c=0;c!==g;++c)e[c]=b*f[l+c]+k*f[h+c]+p*f[a+c]+n*f[m+c];\nreturn e}});jd.prototype=Object.assign(Object.create(Ea.prototype),{constructor:jd,interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;var h=a-g;b=(c-b)/(d-b);c=1-b;for(d=0;d!==g;++d)e[d]=f[h+d]*c+f[a+d]*b;return e}});Od.prototype=Object.assign(Object.create(Ea.prototype),{constructor:Od,interpolate_:function(a){return this.copySampleValue_(a-1)}});var na={arraySlice:function(a,b,c){return na.isTypedArray(a)?new a.constructor(a.subarray(b,void 0!==c?c:\na.length)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:\"number\"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var b=a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a,b,c){for(var d=a.length,e=new a.constructor(d),f=0,g=0;g!==d;++f)for(var h=c[f]*b,l=0;l!==b;++l)e[g++]=\na[h+l];return e},flattenJSON:function(a,b,c,d){for(var e=1,f=a[0];void 0!==f&&void 0===f[d];)f=a[e++];if(void 0!==f){var g=f[d];if(void 0!==g)if(Array.isArray(g)){do g=f[d],void 0!==g&&(b.push(f.time),c.push.apply(c,g)),f=a[e++];while(void 0!==f)}else if(void 0!==g.toArray){do g=f[d],void 0!==g&&(b.push(f.time),g.toArray(c,c.length)),f=a[e++];while(void 0!==f)}else{do g=f[d],void 0!==g&&(b.push(f.time),c.push(g)),f=a[e++];while(void 0!==f)}}}};Object.assign(ja,{parse:function(a){if(void 0===a.type)throw Error(\"THREE.KeyframeTrack: track type undefined, can not parse\");\nvar b=ja._getTrackTypeForValueTypeName(a.type);if(void 0===a.times){var c=[],d=[];na.flattenJSON(a.keys,c,d,\"value\");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)},toJSON:function(a){var b=a.constructor;if(void 0!==b.toJSON)b=b.toJSON(a);else{b={name:a.name,times:na.convertArray(a.times,Array),values:na.convertArray(a.values,Array)};var c=a.getInterpolation();c!==a.DefaultInterpolation&&(b.interpolation=c)}b.type=a.ValueTypeName;return b},_getTrackTypeForValueTypeName:function(a){switch(a.toLowerCase()){case \"scalar\":case \"double\":case \"float\":case \"number\":case \"integer\":return nc;\ncase \"vector\":case \"vector2\":case \"vector3\":case \"vector4\":return oc;case \"color\":return Md;case \"quaternion\":return id;case \"bool\":case \"boolean\":return Kd;case \"string\":return Jd}throw Error(\"THREE.KeyframeTrack: Unsupported typeName: \"+a);}});Object.assign(ja.prototype,{constructor:ja,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(a){return new Od(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodLinear:function(a){return new jd(this.times,\nthis.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:function(a){return new Nd(this.times,this.values,this.getValueSize(),a)},setInterpolation:function(a){switch(a){case 2300:var b=this.InterpolantFactoryMethodDiscrete;break;case 2301:b=this.InterpolantFactoryMethodLinear;break;case 2302:b=this.InterpolantFactoryMethodSmooth}if(void 0===b){b=\"unsupported interpolation for \"+this.ValueTypeName+\" keyframe track named \"+this.name;if(void 0===this.createInterpolant)if(a!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);\nelse throw Error(b);console.warn(\"THREE.KeyframeTrack:\",b)}else this.createInterpolant=b},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(a){if(0!==a)for(var b=this.times,c=0,d=b.length;c!==d;++c)b[c]+=a;return this},scale:function(a){if(1!==a)for(var b=\nthis.times,c=0,d=b.length;c!==d;++c)b[c]*=a;return this},trim:function(a,b){for(var c=this.times,d=c.length,e=0,f=d-1;e!==d&&c[e]<a;)++e;for(;-1!==f&&c[f]>b;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=na.arraySlice(c,e,f),this.values=na.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error(\"THREE.KeyframeTrack: Invalid value size in track.\",this),a=!1);var c=this.times;b=this.values;\nvar d=c.length;0===d&&(console.error(\"THREE.KeyframeTrack: Track is empty.\",this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if(\"number\"===typeof g&&isNaN(g)){console.error(\"THREE.KeyframeTrack: Time is not a valid number.\",this,f,g);a=!1;break}if(null!==e&&e>g){console.error(\"THREE.KeyframeTrack: Out of order keys.\",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&na.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error(\"THREE.KeyframeTrack: Value is not a valid number.\",this,\nf,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values,c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;g<f;++g){var h=!1,l=a[g];if(l!==a[g+1]&&(1!==g||l!==l[0]))if(d)h=!0;else{var k=g*c,p=k-c,n=k+c;for(l=0;l!==c;++l){var t=b[k+l];if(t!==b[p+l]||t!==b[n+l]){h=!0;break}}}if(h){if(g!==e)for(a[e]=a[g],h=g*c,k=e*c,l=0;l!==c;++l)b[k+l]=b[h+l];++e}}if(0<f){a[e]=a[f];h=f*c;k=e*c;for(l=0;l!==c;++l)b[k+l]=b[h+l];++e}e!==a.length&&(this.times=na.arraySlice(a,\n0,e),this.values=na.arraySlice(b,0,e*c));return this}});oc.prototype=Object.assign(Object.create(ja.prototype),{constructor:oc,ValueTypeName:\"vector\"});Object.assign(Ga,{parse:function(a){for(var b=[],c=a.tracks,d=1/(a.fps||1),e=0,f=c.length;e!==f;++e)b.push(ja.parse(c[e]).scale(d));return new Ga(a.name,a.duration,b)},toJSON:function(a){var b=[],c=a.tracks;a={name:a.name,duration:a.duration,tracks:b,uuid:a.uuid};for(var d=0,e=c.length;d!==e;++d)b.push(ja.toJSON(c[d]));return a},CreateFromMorphTargetSequence:function(a,\nb,c,d){for(var e=b.length,f=[],g=0;g<e;g++){var h=[],l=[];h.push((g+e-1)%e,g,(g+1)%e);l.push(0,1,0);var k=na.getKeyframeOrder(h);h=na.sortedArray(h,1,k);l=na.sortedArray(l,1,k);d||0!==h[0]||(h.push(e),l.push(l[0]));f.push((new nc(\".morphTargetInfluences[\"+b[g].name+\"]\",h,l)).scale(1/c))}return new Ga(a,-1,f)},findByName:function(a,b){var c=a;Array.isArray(a)||(c=a.geometry&&a.geometry.animations||a.animations);for(a=0;a<c.length;a++)if(c[a].name===b)return c[a];return null},CreateClipsFromMorphTargetSequences:function(a,\nb,c){for(var d={},e=/^([\\w-]*?)([\\d]+)$/,f=0,g=a.length;f<g;f++){var h=a[f],l=h.name.match(e);if(l&&1<l.length){var k=l[1];(l=d[k])||(d[k]=l=[]);l.push(h)}}a=[];for(k in d)a.push(Ga.CreateFromMorphTargetSequence(k,d[k],b,c));return a},parseAnimation:function(a,b){if(!a)return console.error(\"THREE.AnimationClip: No animation in JSONLoader data.\"),null;var c=function(a,b,c,d,e){if(0!==c.length){var f=[],g=[];na.flattenJSON(c,f,g,d);0!==f.length&&e.push(new a(b,f,g))}},d=[],e=a.name||\"default\",f=a.length||\n-1,g=a.fps||30;a=a.hierarchy||[];for(var h=0;h<a.length;h++){var l=a[h].keys;if(l&&0!==l.length)if(l[0].morphTargets){f={};for(var k=0;k<l.length;k++)if(l[k].morphTargets)for(var p=0;p<l[k].morphTargets.length;p++)f[l[k].morphTargets[p]]=-1;for(var n in f){var t=[],q=[];for(p=0;p!==l[k].morphTargets.length;++p){var r=l[k];t.push(r.time);q.push(r.morphTarget===n?1:0)}d.push(new nc(\".morphTargetInfluence[\"+n+\"]\",t,q))}f=f.length*(g||1)}else k=\".bones[\"+b[h].name+\"]\",c(oc,k+\".position\",l,\"pos\",d),c(id,\nk+\".quaternion\",l,\"rot\",d),c(oc,k+\".scale\",l,\"scl\",d)}return 0===d.length?null:new Ga(e,f,d)}});Object.assign(Ga.prototype,{resetDuration:function(){for(var a=0,b=0,c=this.tracks.length;b!==c;++b){var d=this.tracks[b];a=Math.max(a,d.times[d.times.length-1])}this.duration=a},trim:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].trim(0,this.duration);return this},optimize:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].optimize();return this}});Object.assign(Pd.prototype,\n{load:function(a,b,c,d){var e=this;(new La(e.manager)).load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setTextures:function(a){this.textures=a},parse:function(a){function b(a){void 0===c[a]&&console.warn(\"THREE.MaterialLoader: Undefined texture\",a);return c[a]}var c=this.textures,d=new Vg[a.type];void 0!==a.uuid&&(d.uuid=a.uuid);void 0!==a.name&&(d.name=a.name);void 0!==a.color&&d.color.setHex(a.color);void 0!==a.roughness&&(d.roughness=a.roughness);void 0!==a.metalness&&(d.metalness=a.metalness);\nvoid 0!==a.emissive&&d.emissive.setHex(a.emissive);void 0!==a.specular&&d.specular.setHex(a.specular);void 0!==a.shininess&&(d.shininess=a.shininess);void 0!==a.clearCoat&&(d.clearCoat=a.clearCoat);void 0!==a.clearCoatRoughness&&(d.clearCoatRoughness=a.clearCoatRoughness);void 0!==a.uniforms&&(d.uniforms=a.uniforms);void 0!==a.vertexShader&&(d.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(d.fragmentShader=a.fragmentShader);void 0!==a.vertexColors&&(d.vertexColors=a.vertexColors);void 0!==\na.fog&&(d.fog=a.fog);void 0!==a.flatShading&&(d.flatShading=a.flatShading);void 0!==a.blending&&(d.blending=a.blending);void 0!==a.side&&(d.side=a.side);void 0!==a.opacity&&(d.opacity=a.opacity);void 0!==a.transparent&&(d.transparent=a.transparent);void 0!==a.alphaTest&&(d.alphaTest=a.alphaTest);void 0!==a.depthTest&&(d.depthTest=a.depthTest);void 0!==a.depthWrite&&(d.depthWrite=a.depthWrite);void 0!==a.colorWrite&&(d.colorWrite=a.colorWrite);void 0!==a.wireframe&&(d.wireframe=a.wireframe);void 0!==\na.wireframeLinewidth&&(d.wireframeLinewidth=a.wireframeLinewidth);void 0!==a.wireframeLinecap&&(d.wireframeLinecap=a.wireframeLinecap);void 0!==a.wireframeLinejoin&&(d.wireframeLinejoin=a.wireframeLinejoin);void 0!==a.rotation&&(d.rotation=a.rotation);1!==a.linewidth&&(d.linewidth=a.linewidth);void 0!==a.dashSize&&(d.dashSize=a.dashSize);void 0!==a.gapSize&&(d.gapSize=a.gapSize);void 0!==a.scale&&(d.scale=a.scale);void 0!==a.polygonOffset&&(d.polygonOffset=a.polygonOffset);void 0!==a.polygonOffsetFactor&&\n(d.polygonOffsetFactor=a.polygonOffsetFactor);void 0!==a.polygonOffsetUnits&&(d.polygonOffsetUnits=a.polygonOffsetUnits);void 0!==a.skinning&&(d.skinning=a.skinning);void 0!==a.morphTargets&&(d.morphTargets=a.morphTargets);void 0!==a.dithering&&(d.dithering=a.dithering);void 0!==a.visible&&(d.visible=a.visible);void 0!==a.userData&&(d.userData=a.userData);void 0!==a.shading&&(d.flatShading=1===a.shading);void 0!==a.size&&(d.size=a.size);void 0!==a.sizeAttenuation&&(d.sizeAttenuation=a.sizeAttenuation);\nvoid 0!==a.map&&(d.map=b(a.map));void 0!==a.alphaMap&&(d.alphaMap=b(a.alphaMap),d.transparent=!0);void 0!==a.bumpMap&&(d.bumpMap=b(a.bumpMap));void 0!==a.bumpScale&&(d.bumpScale=a.bumpScale);void 0!==a.normalMap&&(d.normalMap=b(a.normalMap));void 0!==a.normalMapType&&(d.normalMapType=a.normalMapType);if(void 0!==a.normalScale){var e=a.normalScale;!1===Array.isArray(e)&&(e=[e,e]);d.normalScale=(new B).fromArray(e)}void 0!==a.displacementMap&&(d.displacementMap=b(a.displacementMap));void 0!==a.displacementScale&&\n(d.displacementScale=a.displacementScale);void 0!==a.displacementBias&&(d.displacementBias=a.displacementBias);void 0!==a.roughnessMap&&(d.roughnessMap=b(a.roughnessMap));void 0!==a.metalnessMap&&(d.metalnessMap=b(a.metalnessMap));void 0!==a.emissiveMap&&(d.emissiveMap=b(a.emissiveMap));void 0!==a.emissiveIntensity&&(d.emissiveIntensity=a.emissiveIntensity);void 0!==a.specularMap&&(d.specularMap=b(a.specularMap));void 0!==a.envMap&&(d.envMap=b(a.envMap));void 0!==a.reflectivity&&(d.reflectivity=a.reflectivity);\nvoid 0!==a.lightMap&&(d.lightMap=b(a.lightMap));void 0!==a.lightMapIntensity&&(d.lightMapIntensity=a.lightMapIntensity);void 0!==a.aoMap&&(d.aoMap=b(a.aoMap));void 0!==a.aoMapIntensity&&(d.aoMapIntensity=a.aoMapIntensity);void 0!==a.gradientMap&&(d.gradientMap=b(a.gradientMap));return d}});Object.assign(ie.prototype,{load:function(a,b,c,d){var e=this;(new La(e.manager)).load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},parse:function(a){var b=new D,c=a.data.index;void 0!==c&&(c=new Cf[c.type](c.array),\nb.setIndex(new L(c,1)));var d=a.data.attributes;for(f in d){var e=d[f];c=new Cf[e.type](e.array);b.addAttribute(f,new L(c,e.itemSize,e.normalized))}var f=a.data.groups||a.data.drawcalls||a.data.offsets;if(void 0!==f)for(c=0,d=f.length;c!==d;++c)e=f[c],b.addGroup(e.start,e.count,e.materialIndex);a=a.data.boundingSphere;void 0!==a&&(f=new p,void 0!==a.center&&f.fromArray(a.center),b.boundingSphere=new Ha(f,a.radius));return b}});var Cf={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:\"undefined\"!==\ntypeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};pc.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=this.handlers,c=0,d=b.length;c<d;c+=2){var e=b[c+1];if(b[c].test(a))return e}return null}};Object.assign(pc.prototype,{crossOrigin:\"anonymous\",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},\ninitMaterials:function(a,b,c){for(var d=[],e=0;e<a.length;++e)d[e]=this.createMaterial(a[e],b,c);return d},createMaterial:function(){var a={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},b=new G,c=new Ad,d=new Pd;return function(e,f,g){function h(a,b,d,e,h){a=f+a;var k=pc.Handlers.get(a);null!==k?a=k.load(a):(c.setCrossOrigin(g),a=c.load(a));void 0!==b&&(a.repeat.fromArray(b),1!==b[0]&&(a.wrapS=1E3),1!==b[1]&&(a.wrapT=1E3));void 0!==d&&\na.offset.fromArray(d);void 0!==e&&(\"repeat\"===e[0]&&(a.wrapS=1E3),\"mirror\"===e[0]&&(a.wrapS=1002),\"repeat\"===e[1]&&(a.wrapT=1E3),\"mirror\"===e[1]&&(a.wrapT=1002));void 0!==h&&(a.anisotropy=h);b=J.generateUUID();l[b]=a;return b}var l={},k={uuid:J.generateUUID(),type:\"MeshLambertMaterial\"},p;for(p in e){var n=e[p];switch(p){case \"DbgColor\":case \"DbgIndex\":case \"opticalDensity\":case \"illumination\":break;case \"DbgName\":k.name=n;break;case \"blending\":k.blending=a[n];break;case \"colorAmbient\":case \"mapAmbient\":console.warn(\"THREE.Loader.createMaterial:\",\np,\"is no longer supported.\");break;case \"colorDiffuse\":k.color=b.fromArray(n).getHex();break;case \"colorSpecular\":k.specular=b.fromArray(n).getHex();break;case \"colorEmissive\":k.emissive=b.fromArray(n).getHex();break;case \"specularCoef\":k.shininess=n;break;case \"shading\":\"basic\"===n.toLowerCase()&&(k.type=\"MeshBasicMaterial\");\"phong\"===n.toLowerCase()&&(k.type=\"MeshPhongMaterial\");\"standard\"===n.toLowerCase()&&(k.type=\"MeshStandardMaterial\");break;case \"mapDiffuse\":k.map=h(n,e.mapDiffuseRepeat,e.mapDiffuseOffset,\ne.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case \"mapDiffuseRepeat\":case \"mapDiffuseOffset\":case \"mapDiffuseWrap\":case \"mapDiffuseAnisotropy\":break;case \"mapEmissive\":k.emissiveMap=h(n,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case \"mapEmissiveRepeat\":case \"mapEmissiveOffset\":case \"mapEmissiveWrap\":case \"mapEmissiveAnisotropy\":break;case \"mapLight\":k.lightMap=h(n,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case \"mapLightRepeat\":case \"mapLightOffset\":case \"mapLightWrap\":case \"mapLightAnisotropy\":break;\ncase \"mapAO\":k.aoMap=h(n,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case \"mapAORepeat\":case \"mapAOOffset\":case \"mapAOWrap\":case \"mapAOAnisotropy\":break;case \"mapBump\":k.bumpMap=h(n,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case \"mapBumpScale\":k.bumpScale=n;break;case \"mapBumpRepeat\":case \"mapBumpOffset\":case \"mapBumpWrap\":case \"mapBumpAnisotropy\":break;case \"mapNormal\":k.normalMap=h(n,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);\nbreak;case \"mapNormalFactor\":k.normalScale=n;break;case \"mapNormalRepeat\":case \"mapNormalOffset\":case \"mapNormalWrap\":case \"mapNormalAnisotropy\":break;case \"mapSpecular\":k.specularMap=h(n,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case \"mapSpecularRepeat\":case \"mapSpecularOffset\":case \"mapSpecularWrap\":case \"mapSpecularAnisotropy\":break;case \"mapMetalness\":k.metalnessMap=h(n,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);\nbreak;case \"mapMetalnessRepeat\":case \"mapMetalnessOffset\":case \"mapMetalnessWrap\":case \"mapMetalnessAnisotropy\":break;case \"mapRoughness\":k.roughnessMap=h(n,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case \"mapRoughnessRepeat\":case \"mapRoughnessOffset\":case \"mapRoughnessWrap\":case \"mapRoughnessAnisotropy\":break;case \"mapAlpha\":k.alphaMap=h(n,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case \"mapAlphaRepeat\":case \"mapAlphaOffset\":case \"mapAlphaWrap\":case \"mapAlphaAnisotropy\":break;\ncase \"flipSided\":k.side=1;break;case \"doubleSided\":k.side=2;break;case \"transparency\":console.warn(\"THREE.Loader.createMaterial: transparency has been renamed to opacity\");k.opacity=n;break;case \"depthTest\":case \"depthWrite\":case \"colorWrite\":case \"opacity\":case \"reflectivity\":case \"transparent\":case \"visible\":case \"wireframe\":k[p]=n;break;case \"vertexColors\":!0===n&&(k.vertexColors=2);\"face\"===n&&(k.vertexColors=1);break;default:console.error(\"THREE.Loader.createMaterial: Unsupported\",p,n)}}\"MeshBasicMaterial\"===\nk.type&&delete k.emissive;\"MeshPhongMaterial\"!==k.type&&delete k.specular;1>k.opacity&&(k.transparent=!0);d.setTextures(l);return d.parse(k)}}()});var Fe={decodeText:function(a){if(\"undefined\"!==typeof TextDecoder)return(new TextDecoder).decode(a);for(var b=\"\",c=0,d=a.length;c<d;c++)b+=String.fromCharCode(a[c]);return decodeURIComponent(escape(b))},extractUrlBase:function(a){var b=a.lastIndexOf(\"/\");return-1===b?\"./\":a.substr(0,b+1)}};Object.assign(je.prototype,{crossOrigin:\"anonymous\",load:function(a,\nb,c,d){var e=this,f=this.texturePath&&\"string\"===typeof this.texturePath?this.texturePath:Fe.extractUrlBase(a),g=new La(this.manager);g.setWithCredentials(this.withCredentials);g.load(a,function(c){c=JSON.parse(c);var d=c.metadata;if(void 0!==d&&(d=d.type,void 0!==d&&\"object\"===d.toLowerCase())){console.error(\"THREE.JSONLoader: \"+a+\" should be loaded with THREE.ObjectLoader instead.\");return}c=e.parse(c,f);b(c.geometry,c.materials)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a;return this},\nsetTexturePath:function(a){this.texturePath=a;return this},parse:function(){return function(a,b){void 0!==a.data&&(a=a.data);a.scale=void 0!==a.scale?1/a.scale:1;var c=new P,d=a,e,f,g,h=d.faces;var l=d.vertices;var k=d.normals,v=d.colors;var n=d.scale;var t=0;if(void 0!==d.uvs){for(e=0;e<d.uvs.length;e++)d.uvs[e].length&&t++;for(e=0;e<t;e++)c.faceVertexUvs[e]=[]}var q=0;for(g=l.length;q<g;)e=new p,e.x=l[q++]*n,e.y=l[q++]*n,e.z=l[q++]*n,c.vertices.push(e);q=0;for(g=h.length;q<g;){l=h[q++];var r=l&\n1;var u=l&2;e=l&8;var y=l&16;var w=l&32;n=l&64;l&=128;if(r){r=new Ya;r.a=h[q];r.b=h[q+1];r.c=h[q+3];var x=new Ya;x.a=h[q+1];x.b=h[q+2];x.c=h[q+3];q+=4;u&&(u=h[q++],r.materialIndex=u,x.materialIndex=u);u=c.faces.length;if(e)for(e=0;e<t;e++){var A=d.uvs[e];c.faceVertexUvs[e][u]=[];c.faceVertexUvs[e][u+1]=[];for(f=0;4>f;f++){var C=h[q++];var z=A[2*C];C=A[2*C+1];z=new B(z,C);2!==f&&c.faceVertexUvs[e][u].push(z);0!==f&&c.faceVertexUvs[e][u+1].push(z)}}y&&(y=3*h[q++],r.normal.set(k[y++],k[y++],k[y]),x.normal.copy(r.normal));\nif(w)for(e=0;4>e;e++)y=3*h[q++],w=new p(k[y++],k[y++],k[y]),2!==e&&r.vertexNormals.push(w),0!==e&&x.vertexNormals.push(w);n&&(n=h[q++],n=v[n],r.color.setHex(n),x.color.setHex(n));if(l)for(e=0;4>e;e++)n=h[q++],n=v[n],2!==e&&r.vertexColors.push(new G(n)),0!==e&&x.vertexColors.push(new G(n));c.faces.push(r);c.faces.push(x)}else{r=new Ya;r.a=h[q++];r.b=h[q++];r.c=h[q++];u&&(u=h[q++],r.materialIndex=u);u=c.faces.length;if(e)for(e=0;e<t;e++)for(A=d.uvs[e],c.faceVertexUvs[e][u]=[],f=0;3>f;f++)C=h[q++],z=\nA[2*C],C=A[2*C+1],z=new B(z,C),c.faceVertexUvs[e][u].push(z);y&&(y=3*h[q++],r.normal.set(k[y++],k[y++],k[y]));if(w)for(e=0;3>e;e++)y=3*h[q++],w=new p(k[y++],k[y++],k[y]),r.vertexNormals.push(w);n&&(n=h[q++],r.color.setHex(v[n]));if(l)for(e=0;3>e;e++)n=h[q++],r.vertexColors.push(new G(v[n]));c.faces.push(r)}}d=a;q=void 0!==d.influencesPerVertex?d.influencesPerVertex:2;if(d.skinWeights)for(g=0,h=d.skinWeights.length;g<h;g+=q)c.skinWeights.push(new W(d.skinWeights[g],1<q?d.skinWeights[g+1]:0,2<q?d.skinWeights[g+\n2]:0,3<q?d.skinWeights[g+3]:0));if(d.skinIndices)for(g=0,h=d.skinIndices.length;g<h;g+=q)c.skinIndices.push(new W(d.skinIndices[g],1<q?d.skinIndices[g+1]:0,2<q?d.skinIndices[g+2]:0,3<q?d.skinIndices[g+3]:0));c.bones=d.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn(\"When skinning, number of vertices (\"+c.vertices.length+\"), skinIndices (\"+c.skinIndices.length+\"), and skinWeights (\"+c.skinWeights.length+\") should match.\");\ng=a;h=g.scale;if(void 0!==g.morphTargets)for(d=0,q=g.morphTargets.length;d<q;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=g.morphTargets[d].name,c.morphTargets[d].vertices=[],k=c.morphTargets[d].vertices,v=g.morphTargets[d].vertices,t=0,l=v.length;t<l;t+=3)n=new p,n.x=v[t]*h,n.y=v[t+1]*h,n.z=v[t+2]*h,k.push(n);if(void 0!==g.morphColors&&0<g.morphColors.length)for(console.warn('THREE.JSONLoader: \"morphColors\" no longer supported. Using them as face colors.'),h=c.faces,g=g.morphColors[0].colors,\nd=0,q=h.length;d<q;d++)h[d].color.fromArray(g,3*d);g=a;d=[];q=[];void 0!==g.animation&&q.push(g.animation);void 0!==g.animations&&(g.animations.length?q=q.concat(g.animations):q.push(g.animations));for(g=0;g<q.length;g++)(h=Ga.parseAnimation(q[g],c.bones))&&d.push(h);c.morphTargets&&(q=Ga.CreateClipsFromMorphTargetSequences(c.morphTargets,10),d=d.concat(q));0<d.length&&(c.animations=d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};\na=pc.prototype.initMaterials(a.materials,b,this.crossOrigin);return{geometry:c,materials:a}}}()});Object.assign(nf.prototype,{crossOrigin:\"anonymous\",load:function(a,b,c,d){\"\"===this.texturePath&&(this.texturePath=a.substring(0,a.lastIndexOf(\"/\")+1));var e=this;(new La(e.manager)).load(a,function(c){var f=null;try{f=JSON.parse(c)}catch(h){void 0!==d&&d(h);console.error(\"THREE:ObjectLoader: Can't parse \"+a+\".\",h.message);return}c=f.metadata;void 0===c||void 0===c.type||\"geometry\"===c.type.toLowerCase()?\nconsole.error(\"THREE.ObjectLoader: Can't load \"+a+\". Use THREE.JSONLoader instead.\"):e.parse(f,b)},c,d)},setTexturePath:function(a){this.texturePath=a;return this},setCrossOrigin:function(a){this.crossOrigin=a;return this},parse:function(a,b){var c=this.parseShape(a.shapes);c=this.parseGeometries(a.geometries,c);var d=this.parseImages(a.images,function(){void 0!==b&&b(e)});d=this.parseTextures(a.textures,d);d=this.parseMaterials(a.materials,d);var e=this.parseObject(a.object,c,d);a.animations&&(e.animations=\nthis.parseAnimations(a.animations));void 0!==a.images&&0!==a.images.length||void 0===b||b(e);return e},parseShape:function(a){var b={};if(void 0!==a)for(var c=0,d=a.length;c<d;c++){var e=(new jb).fromJSON(a[c]);b[e.uuid]=e}return b},parseGeometries:function(a,b){var c={};if(void 0!==a)for(var d=new je,e=new ie,f=0,g=a.length;f<g;f++){var h=a[f];switch(h.type){case \"PlaneGeometry\":case \"PlaneBufferGeometry\":var l=new ka[h.type](h.width,h.height,h.widthSegments,h.heightSegments);break;case \"BoxGeometry\":case \"BoxBufferGeometry\":case \"CubeGeometry\":l=\nnew ka[h.type](h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case \"CircleGeometry\":case \"CircleBufferGeometry\":l=new ka[h.type](h.radius,h.segments,h.thetaStart,h.thetaLength);break;case \"CylinderGeometry\":case \"CylinderBufferGeometry\":l=new ka[h.type](h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded,h.thetaStart,h.thetaLength);break;case \"ConeGeometry\":case \"ConeBufferGeometry\":l=new ka[h.type](h.radius,h.height,h.radialSegments,\nh.heightSegments,h.openEnded,h.thetaStart,h.thetaLength);break;case \"SphereGeometry\":case \"SphereBufferGeometry\":l=new ka[h.type](h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case \"DodecahedronGeometry\":case \"DodecahedronBufferGeometry\":case \"IcosahedronGeometry\":case \"IcosahedronBufferGeometry\":case \"OctahedronGeometry\":case \"OctahedronBufferGeometry\":case \"TetrahedronGeometry\":case \"TetrahedronBufferGeometry\":l=new ka[h.type](h.radius,h.detail);\nbreak;case \"RingGeometry\":case \"RingBufferGeometry\":l=new ka[h.type](h.innerRadius,h.outerRadius,h.thetaSegments,h.phiSegments,h.thetaStart,h.thetaLength);break;case \"TorusGeometry\":case \"TorusBufferGeometry\":l=new ka[h.type](h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case \"TorusKnotGeometry\":case \"TorusKnotBufferGeometry\":l=new ka[h.type](h.radius,h.tube,h.tubularSegments,h.radialSegments,h.p,h.q);break;case \"LatheGeometry\":case \"LatheBufferGeometry\":l=new ka[h.type](h.points,\nh.segments,h.phiStart,h.phiLength);break;case \"PolyhedronGeometry\":case \"PolyhedronBufferGeometry\":l=new ka[h.type](h.vertices,h.indices,h.radius,h.details);break;case \"ShapeGeometry\":case \"ShapeBufferGeometry\":l=[];for(var k=0,p=h.shapes.length;k<p;k++){var n=b[h.shapes[k]];l.push(n)}l=new ka[h.type](l,h.curveSegments);break;case \"ExtrudeGeometry\":case \"ExtrudeBufferGeometry\":l=[];k=0;for(p=h.shapes.length;k<p;k++)n=b[h.shapes[k]],l.push(n);k=h.options.extrudePath;void 0!==k&&(h.options.extrudePath=\n(new Bf[k.type]).fromJSON(k));l=new ka[h.type](l,h.options);break;case \"BufferGeometry\":l=e.parse(h);break;case \"Geometry\":l=d.parse(h,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type \"'+h.type+'\"');continue}l.uuid=h.uuid;void 0!==h.name&&(l.name=h.name);!0===l.isBufferGeometry&&void 0!==h.userData&&(l.userData=h.userData);c[h.uuid]=l}return c},parseMaterials:function(a,b){var c={};if(void 0!==a){var d=new Pd;d.setTextures(b);b=0;for(var e=a.length;b<\ne;b++){var f=a[b];if(\"MultiMaterial\"===f.type){for(var g=[],h=0;h<f.materials.length;h++)g.push(d.parse(f.materials[h]));c[f.uuid]=g}else c[f.uuid]=d.parse(f)}}return c},parseAnimations:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=Ga.parse(d);void 0!==d.uuid&&(e.uuid=d.uuid);b.push(e)}return b},parseImages:function(a,b){function c(a){d.manager.itemStart(a);return f.load(a,function(){d.manager.itemEnd(a)},void 0,function(){d.manager.itemEnd(a);d.manager.itemError(a)})}var d=this,e={};\nif(void 0!==a&&0<a.length){b=new ee(b);var f=new fd(b);f.setCrossOrigin(this.crossOrigin);b=0;for(var g=a.length;b<g;b++){var h=a[b],l=h.url;if(Array.isArray(l)){e[h.uuid]=[];for(var k=0,p=l.length;k<p;k++){var n=l[k];n=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(n)?n:d.texturePath+n;e[h.uuid].push(c(n))}}else n=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(h.url)?h.url:d.texturePath+h.url,e[h.uuid]=c(n)}}return e},parseTextures:function(a,b){function c(a,b){if(\"number\"===typeof a)return a;console.warn(\"THREE.ObjectLoader.parseTexture: Constant should be in numeric form.\",\na);return b[a]}var d={};if(void 0!==a)for(var e=0,f=a.length;e<f;e++){var g=a[e];void 0===g.image&&console.warn('THREE.ObjectLoader: No \"image\" specified for',g.uuid);void 0===b[g.image]&&console.warn(\"THREE.ObjectLoader: Undefined image\",g.image);var h=Array.isArray(b[g.image])?new Za(b[g.image]):new ea(b[g.image]);h.needsUpdate=!0;h.uuid=g.uuid;void 0!==g.name&&(h.name=g.name);void 0!==g.mapping&&(h.mapping=c(g.mapping,Wg));void 0!==g.offset&&h.offset.fromArray(g.offset);void 0!==g.repeat&&h.repeat.fromArray(g.repeat);\nvoid 0!==g.center&&h.center.fromArray(g.center);void 0!==g.rotation&&(h.rotation=g.rotation);void 0!==g.wrap&&(h.wrapS=c(g.wrap[0],Df),h.wrapT=c(g.wrap[1],Df));void 0!==g.format&&(h.format=g.format);void 0!==g.minFilter&&(h.minFilter=c(g.minFilter,Ef));void 0!==g.magFilter&&(h.magFilter=c(g.magFilter,Ef));void 0!==g.anisotropy&&(h.anisotropy=g.anisotropy);void 0!==g.flipY&&(h.flipY=g.flipY);d[g.uuid]=h}return d},parseObject:function(a,b,c){function d(a){void 0===b[a]&&console.warn(\"THREE.ObjectLoader: Undefined geometry\",\na);return b[a]}function e(a){if(void 0!==a){if(Array.isArray(a)){for(var b=[],d=0,e=a.length;d<e;d++){var f=a[d];void 0===c[f]&&console.warn(\"THREE.ObjectLoader: Undefined material\",f);b.push(c[f])}return b}void 0===c[a]&&console.warn(\"THREE.ObjectLoader: Undefined material\",a);return c[a]}}switch(a.type){case \"Scene\":var f=new vd;void 0!==a.background&&Number.isInteger(a.background)&&(f.background=new G(a.background));void 0!==a.fog&&(\"Fog\"===a.fog.type?f.fog=new Wb(a.fog.color,a.fog.near,a.fog.far):\n\"FogExp2\"===a.fog.type&&(f.fog=new Vb(a.fog.color,a.fog.density)));break;case \"PerspectiveCamera\":f=new Z(a.fov,a.aspect,a.near,a.far);void 0!==a.focus&&(f.focus=a.focus);void 0!==a.zoom&&(f.zoom=a.zoom);void 0!==a.filmGauge&&(f.filmGauge=a.filmGauge);void 0!==a.filmOffset&&(f.filmOffset=a.filmOffset);void 0!==a.view&&(f.view=Object.assign({},a.view));break;case \"OrthographicCamera\":f=new Mb(a.left,a.right,a.top,a.bottom,a.near,a.far);void 0!==a.zoom&&(f.zoom=a.zoom);void 0!==a.view&&(f.view=Object.assign({},\na.view));break;case \"AmbientLight\":f=new Hd(a.color,a.intensity);break;case \"DirectionalLight\":f=new Gd(a.color,a.intensity);break;case \"PointLight\":f=new Ed(a.color,a.intensity,a.distance,a.decay);break;case \"RectAreaLight\":f=new Id(a.color,a.intensity,a.width,a.height);break;case \"SpotLight\":f=new Dd(a.color,a.intensity,a.distance,a.angle,a.penumbra,a.decay);break;case \"HemisphereLight\":f=new Bd(a.color,a.groundColor,a.intensity);break;case \"SkinnedMesh\":console.warn(\"THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.\");\ncase \"Mesh\":f=d(a.geometry);var g=e(a.material);f=f.bones&&0<f.bones.length?new xd(f,g):new va(f,g);break;case \"LOD\":f=new Jc;break;case \"Line\":f=new wa(d(a.geometry),e(a.material),a.mode);break;case \"LineLoop\":f=new yd(d(a.geometry),e(a.material));break;case \"LineSegments\":f=new Y(d(a.geometry),e(a.material));break;case \"PointCloud\":case \"Points\":f=new Xb(d(a.geometry),e(a.material));break;case \"Sprite\":f=new Ic(e(a.material));break;case \"Group\":f=new Ub;break;default:f=new H}f.uuid=a.uuid;void 0!==\na.name&&(f.name=a.name);void 0!==a.matrix?(f.matrix.fromArray(a.matrix),void 0!==a.matrixAutoUpdate&&(f.matrixAutoUpdate=a.matrixAutoUpdate),f.matrixAutoUpdate&&f.matrix.decompose(f.position,f.quaternion,f.scale)):(void 0!==a.position&&f.position.fromArray(a.position),void 0!==a.rotation&&f.rotation.fromArray(a.rotation),void 0!==a.quaternion&&f.quaternion.fromArray(a.quaternion),void 0!==a.scale&&f.scale.fromArray(a.scale));void 0!==a.castShadow&&(f.castShadow=a.castShadow);void 0!==a.receiveShadow&&\n(f.receiveShadow=a.receiveShadow);a.shadow&&(void 0!==a.shadow.bias&&(f.shadow.bias=a.shadow.bias),void 0!==a.shadow.radius&&(f.shadow.radius=a.shadow.radius),void 0!==a.shadow.mapSize&&f.shadow.mapSize.fromArray(a.shadow.mapSize),void 0!==a.shadow.camera&&(f.shadow.camera=this.parseObject(a.shadow.camera)));void 0!==a.visible&&(f.visible=a.visible);void 0!==a.frustumCulled&&(f.frustumCulled=a.frustumCulled);void 0!==a.renderOrder&&(f.renderOrder=a.renderOrder);void 0!==a.userData&&(f.userData=a.userData);\nvoid 0!==a.layers&&(f.layers.mask=a.layers);if(void 0!==a.children){g=a.children;for(var h=0;h<g.length;h++)f.add(this.parseObject(g[h],b,c))}if(\"LOD\"===a.type)for(a=a.levels,g=0;g<a.length;g++){h=a[g];var l=f.getObjectByProperty(\"uuid\",h.object);void 0!==l&&f.addLevel(l,h.distance)}return f}});var Wg={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,\nCubeUVRefractionMapping:307},Df={RepeatWrapping:1E3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Ef={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};ke.prototype={constructor:ke,setOptions:function(a){this.options=a;return this},load:function(a,b,c,d){void 0===a&&(a=\"\");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var e=this,f=Kb.get(a);if(void 0!==f)return e.manager.itemStart(a),\nsetTimeout(function(){b&&b(f);e.manager.itemEnd(a)},0),f;fetch(a).then(function(a){return a.blob()}).then(function(a){return createImageBitmap(a,e.options)}).then(function(c){Kb.add(a,c);b&&b(c);e.manager.itemEnd(a)}).catch(function(b){d&&d(b);e.manager.itemEnd(a);e.manager.itemError(a)})},setCrossOrigin:function(){return this},setPath:function(a){this.path=a;return this}};Object.assign(le.prototype,{moveTo:function(a,b){this.currentPath=new Qa;this.subPaths.push(this.currentPath);this.currentPath.moveTo(a,\nb)},lineTo:function(a,b){this.currentPath.lineTo(a,b)},quadraticCurveTo:function(a,b,c,d){this.currentPath.quadraticCurveTo(a,b,c,d)},bezierCurveTo:function(a,b,c,d,e,f){this.currentPath.bezierCurveTo(a,b,c,d,e,f)},splineThru:function(a){this.currentPath.splineThru(a)},toShapes:function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new jb;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],l=h.x-g.x,k=h.y-g.y;if(Math.abs(k)>\nNumber.EPSILON){if(0>k&&(g=b[f],l=-l,h=b[e],k=-k),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=k*(a.x-g.x)-l*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=$a.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new jb;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints());l=a?!l:l;h=[];var k=[],p=[],n=0;k[n]=void 0;p[n]=[];for(var t=\n0,q=f.length;t<q;t++){g=f[t];var r=g.getPoints();var u=e(r);(u=a?!u:u)?(!l&&k[n]&&n++,k[n]={s:new jb,p:r},k[n].s.curves=g.curves,l&&n++,p[n]=[]):p[n].push({h:g,p:r[0]})}if(!k[0])return c(f);if(1<k.length){t=!1;a=[];e=0;for(f=k.length;e<f;e++)h[e]=[];e=0;for(f=k.length;e<f;e++)for(g=p[e],u=0;u<g.length;u++){l=g[u];n=!0;for(r=0;r<k.length;r++)d(l.p,k[r].p)&&(e!==r&&a.push({froms:e,tos:r,hole:u}),n?(n=!1,h[r].push(l)):t=!0);n&&h[e].push(l)}0<a.length&&(t||(p=h))}t=0;for(e=k.length;t<e;t++)for(h=k[t].s,\nb.push(h),a=p[t],f=0,g=a.length;f<g;f++)h.holes.push(a[f].h);return b}});Object.assign(me.prototype,{isFont:!0,generateShapes:function(a,b){void 0===b&&(b=100);var c=[],d=b;b=this.data;var e=Array.from?Array.from(a):String(a).split(\"\");d/=b.resolution;var f=(b.boundingBox.yMax-b.boundingBox.yMin+b.underlineThickness)*d;a=[];for(var g=0,h=0,l=0;l<e.length;l++){var k=e[l];if(\"\\n\"===k)g=0,h-=f;else{var p=d;var n=g,t=h;if(k=b.glyphs[k]||b.glyphs[\"?\"]){var q=new le;if(k.o)for(var r=k._cachedOutline||(k._cachedOutline=\nk.o.split(\" \")),u=0,y=r.length;u<y;)switch(r[u++]){case \"m\":var w=r[u++]*p+n;var x=r[u++]*p+t;q.moveTo(w,x);break;case \"l\":w=r[u++]*p+n;x=r[u++]*p+t;q.lineTo(w,x);break;case \"q\":var z=r[u++]*p+n;var B=r[u++]*p+t;var D=r[u++]*p+n;var E=r[u++]*p+t;q.quadraticCurveTo(D,E,z,B);break;case \"b\":z=r[u++]*p+n,B=r[u++]*p+t,D=r[u++]*p+n,E=r[u++]*p+t,w=r[u++]*p+n,x=r[u++]*p+t,q.bezierCurveTo(D,E,w,x,z,B)}p={offsetX:k.ha*p,path:q}}else p=void 0;g+=p.offsetX;a.push(p.path)}}b=0;for(e=a.length;b<e;b++)Array.prototype.push.apply(c,\na[b].toShapes());return c}});Object.assign(of.prototype,{load:function(a,b,c,d){var e=this,f=new La(this.manager);f.setPath(this.path);f.load(a,function(a){try{var c=JSON.parse(a)}catch(l){console.warn(\"THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.\"),c=JSON.parse(a.substring(65,a.length-2))}a=e.parse(c);b&&b(a)},c,d)},parse:function(a){return new me(a)},setPath:function(a){this.path=a;return this}});var Ud,pe={getContext:function(){void 0===Ud&&(Ud=new (window.AudioContext||\nwindow.webkitAudioContext));return Ud},setContext:function(a){Ud=a}};Object.assign(ne.prototype,{load:function(a,b,c,d){var e=new La(this.manager);e.setResponseType(\"arraybuffer\");e.load(a,function(a){a=a.slice(0);pe.getContext().decodeAudioData(a,function(a){b(a)})},c,d)}});Object.assign(pf.prototype,{update:function(){var a,b,c,d,e,f,g,h,l=new R,k=new R;return function(m){if(a!==this||b!==m.focus||c!==m.fov||d!==m.aspect*this.aspect||e!==m.near||f!==m.far||g!==m.zoom||h!==this.eyeSep){a=this;b=\nm.focus;c=m.fov;d=m.aspect*this.aspect;e=m.near;f=m.far;g=m.zoom;var n=m.projectionMatrix.clone();h=this.eyeSep/2;var p=h*e/b,q=e*Math.tan(J.DEG2RAD*c*.5)/g;k.elements[12]=-h;l.elements[12]=h;var r=-q*d+p;var v=q*d+p;n.elements[0]=2*e/(v-r);n.elements[8]=(v+r)/(v-r);this.cameraL.projectionMatrix.copy(n);r=-q*d-p;v=q*d-p;n.elements[0]=2*e/(v-r);n.elements[8]=(v+r)/(v-r);this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(m.matrixWorld).multiply(k);this.cameraR.matrixWorld.copy(m.matrixWorld).multiply(l)}}()});\nkd.prototype=Object.create(H.prototype);kd.prototype.constructor=kd;oe.prototype=Object.assign(Object.create(H.prototype),{constructor:oe,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null);return this},getFilter:function(){return this.filter},setFilter:function(a){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):\nthis.gain.disconnect(this.context.destination);this.filter=a;this.gain.connect(this.filter);this.filter.connect(this.context.destination);return this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this},updateMatrixWorld:function(){var a=new p,b=new ca,c=new p,d=new p;return function(e){H.prototype.updateMatrixWorld.call(this,e);e=this.context.listener;var f=this.up;this.matrixWorld.decompose(a,\nb,c);d.set(0,0,-1).applyQuaternion(b);e.positionX?(e.positionX.setValueAtTime(a.x,this.context.currentTime),e.positionY.setValueAtTime(a.y,this.context.currentTime),e.positionZ.setValueAtTime(a.z,this.context.currentTime),e.forwardX.setValueAtTime(d.x,this.context.currentTime),e.forwardY.setValueAtTime(d.y,this.context.currentTime),e.forwardZ.setValueAtTime(d.z,this.context.currentTime),e.upX.setValueAtTime(f.x,this.context.currentTime),e.upY.setValueAtTime(f.y,this.context.currentTime),e.upZ.setValueAtTime(f.z,\nthis.context.currentTime)):(e.setPosition(a.x,a.y,a.z),e.setOrientation(d.x,d.y,d.z,f.x,f.y,f.z))}}()});qc.prototype=Object.assign(Object.create(H.prototype),{constructor:qc,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl=!1;this.sourceType=\"audioNode\";this.source=a;this.connect();return this},setMediaElementSource:function(a){this.hasPlaybackControl=!1;this.sourceType=\"mediaNode\";this.source=this.context.createMediaElementSource(a);this.connect();return this},\nsetBuffer:function(a){this.buffer=a;this.sourceType=\"buffer\";this.autoplay&&this.play();return this},play:function(){if(!0===this.isPlaying)console.warn(\"THREE.Audio: Audio is already playing.\");else if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else{var a=this.context.createBufferSource();a.buffer=this.buffer;a.loop=this.loop;a.onended=this.onEnded.bind(this);a.playbackRate.setValueAtTime(this.playbackRate,this.startTime);this.startTime=this.context.currentTime;\na.start(this.startTime,this.offset);this.isPlaying=!0;this.source=a;return this.connect()}},pause:function(){if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else return!0===this.isPlaying&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this},stop:function(){if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else return this.source.stop(),this.offset=\n0,this.isPlaying=!1,this},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].connect(this.filters[a]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].disconnect(this.filters[a]);this.filters[this.filters.length-\n1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(a){a||(a=[]);!0===this.isPlaying?(this.disconnect(),this.filters=a,this.connect()):this.filters=a;return this},getFilter:function(){return this.getFilters()[0]},setFilter:function(a){return this.setFilters(a?[a]:[])},setPlaybackRate:function(a){if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else return this.playbackRate=\na,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn(\"THREE.Audio: this Audio has no playback control.\"),!1):this.loop},setLoop:function(a){if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else return this.loop=a,!0===this.isPlaying&&\n(this.source.loop=this.loop),this},getVolume:function(){return this.gain.gain.value},setVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this}});qe.prototype=Object.assign(Object.create(qc.prototype),{constructor:qe,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(a){this.panner.refDistance=a;return this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(a){this.panner.rolloffFactor=\na;return this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(a){this.panner.distanceModel=a;return this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(a){this.panner.maxDistance=a;return this},setDirectionalCone:function(a,b,c){this.panner.coneInnerAngle=a;this.panner.coneOuterAngle=b;this.panner.coneOuterGain=c;return this},updateMatrixWorld:function(){var a=new p,b=new ca,c=new p,d=new p;return function(e){H.prototype.updateMatrixWorld.call(this,\ne);e=this.panner;this.matrixWorld.decompose(a,b,c);d.set(0,0,1).applyQuaternion(b);e.setPosition(a.x,a.y,a.z);e.setOrientation(d.x,d.y,d.z)}}()});Object.assign(re.prototype,{getFrequencyData:function(){this.analyser.getByteFrequencyData(this.data);return this.data},getAverageFrequency:function(){for(var a=0,b=this.getFrequencyData(),c=0;c<b.length;c++)a+=b[c];return a/b.length}});Object.assign(se.prototype,{accumulate:function(a,b){var c=this.buffer,d=this.valueSize;a=a*d+d;var e=this.cumulativeWeight;\nif(0===e){for(e=0;e!==d;++e)c[a+e]=c[e];e=b}else e+=b,this._mixBufferRegion(c,a,0,b/e,d);this.cumulativeWeight=e},apply:function(a){var b=this.valueSize,c=this.buffer;a=a*b+b;var d=this.cumulativeWeight,e=this.binding;this.cumulativeWeight=0;1>d&&this._mixBufferRegion(c,a,3*b,1-d,b);d=b;for(var f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a=this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=\n0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a,b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){ca.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f=1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});Object.assign(qf.prototype,{getValue:function(a,b){this.bind();var c=this._bindings[this._targetGroup.nCachedObjects_];void 0!==c&&c.getValue(a,b)},setValue:function(a,b){for(var c=this._bindings,d=this._targetGroup.nCachedObjects_,\ne=c.length;d!==e;++d)c[d].setValue(a,b)},bind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(ra,{Composite:qf,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new ra.Composite(a,b,c):new ra(a,b,c)},sanitizeNodeName:function(){var a=/[\\[\\]\\.:\\/]/g;return function(b){return b.replace(/\\s/g,\"_\").replace(a,\n\"\")}}(),parseTrackName:function(){var a=\"[^\"+\"\\\\[\\\\]\\\\.:\\\\/\".replace(\"\\\\.\",\"\")+\"]\",b=/((?:WC+[\\/:])*)/.source.replace(\"WC\",\"[^\\\\[\\\\]\\\\.:\\\\/]\");a=/(WCOD+)?/.source.replace(\"WCOD\",a);var c=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace(\"WC\",\"[^\\\\[\\\\]\\\\.:\\\\/]\"),d=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace(\"WC\",\"[^\\\\[\\\\]\\\\.:\\\\/]\"),e=new RegExp(\"^\"+b+a+c+d+\"$\"),f=[\"material\",\"materials\",\"bones\"];return function(a){var b=e.exec(a);if(!b)throw Error(\"PropertyBinding: Cannot parse trackName: \"+a);b={nodeName:b[2],\nobjectName:b[3],objectIndex:b[4],propertyName:b[5],propertyIndex:b[6]};var c=b.nodeName&&b.nodeName.lastIndexOf(\".\");if(void 0!==c&&-1!==c){var d=b.nodeName.substring(c+1);-1!==f.indexOf(d)&&(b.nodeName=b.nodeName.substring(0,c),b.objectName=d)}if(null===b.propertyName||0===b.propertyName.length)throw Error(\"PropertyBinding: can not parse propertyName from trackName: \"+a);return b}}(),findNode:function(a,b){if(!b||\"\"===b||\"root\"===b||\".\"===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){var c=\na.skeleton.getBoneByName(b);if(void 0!==c)return c}if(a.children){var d=function(a){for(var c=0;c<a.length;c++){var e=a[c];if(e.name===b||e.uuid===b||(e=d(e.children)))return e}return null};if(a=d(a.children))return a}return null}});Object.assign(ra.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(a,b){a[b]=this.node[this.propertyName]},\nfunction(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)a[b++]=c[d]},function(a,b){a[b]=this.resolvedProperty[this.propertyIndex]},function(a,b){this.resolvedProperty.toArray(a,b)}],SetterByBindingTypeAndVersioning:[[function(a,b){this.targetObject[this.propertyName]=a[b]},function(a,b){this.targetObject[this.propertyName]=a[b];this.targetObject.needsUpdate=!0},function(a,b){this.targetObject[this.propertyName]=a[b];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){for(var c=\nthis.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++]},function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.needsUpdate=!0},function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){this.resolvedProperty[this.propertyIndex]=a[b]},function(a,b){this.resolvedProperty[this.propertyIndex]=a[b];this.targetObject.needsUpdate=!0},function(a,b){this.resolvedProperty[this.propertyIndex]=\na[b];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){this.resolvedProperty.fromArray(a,b)},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.needsUpdate=!0},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(a,b){this.bind();this.getValue(a,b)},setValue:function(a,b){this.bind();this.setValue(a,b)},bind:function(){var a=this.node,b=this.parsedPath,c=b.objectName,d=b.propertyName,e=b.propertyIndex;a||(this.node=\na=ra.findNode(this.rootNode,b.nodeName)||this.rootNode);this.getValue=this._getValue_unavailable;this.setValue=this._setValue_unavailable;if(a){if(c){var f=b.objectIndex;switch(c){case \"materials\":if(!a.material){console.error(\"THREE.PropertyBinding: Can not bind to material as node does not have a material.\",this);return}if(!a.material.materials){console.error(\"THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.\",this);return}a=a.material.materials;\nbreak;case \"bones\":if(!a.skeleton){console.error(\"THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.\",this);return}a=a.skeleton.bones;for(c=0;c<a.length;c++)if(a[c].name===f){f=c;break}break;default:if(void 0===a[c]){console.error(\"THREE.PropertyBinding: Can not bind to objectName of node undefined.\",this);return}a=a[c]}if(void 0!==f){if(void 0===a[f]){console.error(\"THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.\",this,a);return}a=\na[f]}}f=a[d];if(void 0===f)console.error(\"THREE.PropertyBinding: Trying to update property for track: \"+b.nodeName+\".\"+d+\" but it wasn't found.\",a);else{b=this.Versioning.None;void 0!==a.needsUpdate?(b=this.Versioning.NeedsUpdate,this.targetObject=a):void 0!==a.matrixWorldNeedsUpdate&&(b=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=a);c=this.BindingType.Direct;if(void 0!==e){if(\"morphTargetInfluences\"===d){if(!a.geometry){console.error(\"THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.\",\nthis);return}if(a.geometry.isBufferGeometry){if(!a.geometry.morphAttributes){console.error(\"THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.\",this);return}for(c=0;c<this.node.geometry.morphAttributes.position.length;c++)if(a.geometry.morphAttributes.position[c].name===e){e=c;break}}else{if(!a.geometry.morphTargets){console.error(\"THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.\",\nthis);return}for(c=0;c<this.node.geometry.morphTargets.length;c++)if(a.geometry.morphTargets[c].name===e){e=c;break}}}c=this.BindingType.ArrayElement;this.resolvedProperty=f;this.propertyIndex=e}else void 0!==f.fromArray&&void 0!==f.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=f):Array.isArray(f)?(c=this.BindingType.EntireArray,this.resolvedProperty=f):this.propertyName=d;this.getValue=this.GetterByBindingType[c];this.setValue=this.SetterByBindingTypeAndVersioning[c][b]}}else console.error(\"THREE.PropertyBinding: Trying to update node for track: \"+\nthis.path+\" but it wasn't found.\")},unbind:function(){this.node=null;this.getValue=this._getValue_unbound;this.setValue=this._setValue_unbound}});Object.assign(ra.prototype,{_getValue_unbound:ra.prototype.getValue,_setValue_unbound:ra.prototype.setValue});Object.assign(rf.prototype,{isAnimationObjectGroup:!0,add:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._paths,f=this._parsedPaths,g=this._bindings,h=g.length,l=void 0,k=0,p=arguments.length;k!==\np;++k){var n=arguments[k],t=n.uuid,q=d[t];if(void 0===q){q=b++;d[t]=q;a.push(n);t=0;for(var r=h;t!==r;++t)g[t].push(new ra(n,e[t],f[t]))}else if(q<c){l=a[q];var u=--c;r=a[u];d[r.uuid]=q;a[q]=r;d[t]=u;a[u]=n;t=0;for(r=h;t!==r;++t){var y=g[t],w=y[q];y[q]=y[u];void 0===w&&(w=new ra(n,e[t],f[t]));y[u]=w}}else a[q]!==l&&console.error(\"THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.\")}this.nCachedObjects_=\nc},remove:function(){for(var a=this._objects,b=this.nCachedObjects_,c=this._indicesByUUID,d=this._bindings,e=d.length,f=0,g=arguments.length;f!==g;++f){var h=arguments[f],l=h.uuid,k=c[l];if(void 0!==k&&k>=b){var p=b++,n=a[p];c[n.uuid]=k;a[k]=n;c[l]=p;a[p]=h;h=0;for(l=e;h!==l;++h){n=d[h];var t=n[k];n[k]=n[p];n[p]=t}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var l=\narguments[g].uuid,k=d[l];if(void 0!==k)if(delete d[l],k<c){l=--c;var p=a[l],n=--b,t=a[n];d[p.uuid]=k;a[k]=p;d[t.uuid]=l;a[l]=t;a.pop();p=0;for(t=f;p!==t;++p){var q=e[p],r=q[n];q[k]=q[l];q[l]=r;q.pop()}}else for(n=--b,t=a[n],d[t.uuid]=k,a[k]=t,a.pop(),p=0,t=f;p!==t;++p)q=e[p],q[k]=q[n],q.pop()}this.nCachedObjects_=c},subscribe_:function(a,b){var c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];var f=this._paths,g=this._parsedPaths,h=this._objects,k=this.nCachedObjects_,\nm=Array(h.length);d=e.length;c[a]=d;f.push(a);g.push(b);e.push(m);c=k;for(d=h.length;c!==d;++c)m[c]=new ra(h[c],a,b);return m},unsubscribe_:function(a){var b=this._bindingsIndicesByPath,c=b[a];if(void 0!==c){var d=this._paths,e=this._parsedPaths,f=this._bindings,g=f.length-1,h=f[g];b[a[g]]=c;f[c]=h;f.pop();e[c]=e[g];e.pop();d[c]=d[g];d.pop()}}});Object.assign(sf.prototype,{play:function(){this._mixer._activateAction(this);return this},stop:function(){this._mixer._deactivateAction(this);return this.reset()},\nreset:function(){this.paused=!1;this.enabled=!0;this.time=0;this._loopCount=-1;this._startTime=null;return this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(a){this._startTime=a;return this},setLoop:function(a,b){this.loop=a;this.repetitions=b;return this},setEffectiveWeight:function(a){this.weight=a;\nthis._effectiveWeight=this.enabled?a:0;return this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(a){return this._scheduleFading(a,0,1)},fadeOut:function(a){return this._scheduleFading(a,1,0)},crossFadeFrom:function(a,b,c){a.fadeOut(b);this.fadeIn(b);if(c){c=this._clip.duration;var d=a._clip.duration,e=c/d;a.warp(1,d/c,b);this.warp(e,1,b)}return this},crossFadeTo:function(a,b,c){return a.crossFadeFrom(this,b,c)},stopFading:function(){var a=this._weightInterpolant;\nnull!==a&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},setEffectiveTimeScale:function(a){this.timeScale=a;this._effectiveTimeScale=this.paused?0:a;return this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(a){this.timeScale=this._clip.duration/a;return this.stopWarping()},syncWith:function(a){this.time=a.time;this.timeScale=a.timeScale;return this.stopWarping()},halt:function(a){return this.warp(this._effectiveTimeScale,\n0,a)},warp:function(a,b,c){var d=this._mixer,e=d.time,f=this._timeScaleInterpolant,g=this.timeScale;null===f&&(this._timeScaleInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;d[1]=e+c;f[0]=a/g;f[1]=b/g;return this},stopWarping:function(){var a=this._timeScaleInterpolant;null!==a&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||\nthis._mixer._root},_update:function(a,b,c,d){if(this.enabled){var e=this._startTime;if(null!==e){b=(a-e)*c;if(0>b||0===c)return;this._startTime=null;b*=c}b*=this._updateTimeScale(a);c=this._updateTime(b);a=this._updateWeight(a);if(0<a){b=this._interpolants;e=this._propertyBindings;for(var f=0,g=b.length;f!==g;++f)b[f].evaluate(c),e[f].accumulate(d,a)}}else this._updateWeight(a)},_updateWeight:function(a){var b=0;if(this.enabled){b=this.weight;var c=this._weightInterpolant;if(null!==c){var d=c.evaluate(a)[0];\nb*=d;a>c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight=b},_updateTimeScale:function(a){var b=0;if(!this.paused){b=this.timeScale;var c=this._timeScaleInterpolant;if(null!==c){var d=c.evaluate(a)[0];b*=d;a>c.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a;if(0===a)return b;var c=this._clip.duration,d=this.loop,e=this._loopCount;if(2200===\nd)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else break a;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:\"finished\",action:this,direction:0>a?-1:1})}else{d=2202===d;-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,d)):this._setEndings(0===this.repetitions,!0,d));if(b>=c||0>b){var f=Math.floor(b/c);b-=c*f;e+=Math.abs(f);var g=this.repetitions-e;0>=g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=\n0<a?c:0,this._mixer.dispatchEvent({type:\"finished\",action:this,direction:0<a?1:-1})):(1===g?(a=0>a,this._setEndings(a,!a,d)):this._setEndings(!1,!1,d),this._loopCount=e,this._mixer.dispatchEvent({type:\"loop\",action:this,loopDelta:f}))}if(d&&1===(e&1))return this.time=b,c-b}return this.time=b},_setEndings:function(a,b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,\nb,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}});te.prototype=Object.assign(Object.create(za.prototype),{constructor:te,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var m=\nd[h],p=m.name,n=k[p];if(void 0===n){n=f[h];if(void 0!==n){null===n._cacheIndex&&(++n.referenceCount,this._addInactiveBinding(n,g,p));continue}n=new se(ra.create(c,p,b&&b._propertyBindings[h].binding.parsedPath),m.ValueTypeName,m.getValueSize());++n.referenceCount;this._addInactiveBinding(n,g,p)}f[h]=n;a[h].resultBuffer=n.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,\nd&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip=\n{};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;\nreturn null!==a&&a<this._nActiveActions},_addInactiveAction:function(a,b,c){var d=this._actions,e=this._actionsByClip,f=e[b];void 0===f?(f={knownActions:[a],actionByRoot:{}},a._byClipCacheIndex=0,e[b]=f):(b=f.knownActions,a._byClipCacheIndex=b.length,b.push(a));a._cacheIndex=d.length;d.push(a);f.actionByRoot[c]=a},_removeInactiveAction:function(a){var b=this._actions,c=b[b.length-1],d=a._cacheIndex;c._cacheIndex=d;b[d]=c;b.pop();a._cacheIndex=null;b=a._clip.uuid;c=this._actionsByClip;d=c[b];var e=\nd.knownActions,f=e[e.length-1],g=a._byClipCacheIndex;f._byClipCacheIndex=g;e[g]=f;e.pop();a._byClipCacheIndex=null;delete d.actionByRoot[(a._localRoot||this._root).uuid];0===e.length&&delete c[b];this._removeInactiveBindingsForAction(a)},_removeInactiveBindingsForAction:function(a){a=a._propertyBindings;for(var b=0,c=a.length;b!==c;++b){var d=a[b];0===--d.referenceCount&&this._removeInactiveBinding(d)}},_lendAction:function(a){var b=this._actions,c=a._cacheIndex,d=this._nActiveActions++,e=b[d];a._cacheIndex=\nd;b[d]=a;e._cacheIndex=c;b[c]=e},_takeBackAction:function(a){var b=this._actions,c=a._cacheIndex,d=--this._nActiveActions,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_addInactiveBinding:function(a,b,c){var d=this._bindingsByRootAndName,e=d[b],f=this._bindings;void 0===e&&(e={},d[b]=e);e[c]=a;a._cacheIndex=f.length;f.push(a)},_removeInactiveBinding:function(a){var b=this._bindings,c=a.binding,d=c.rootNode.uuid;c=c.path;var e=this._bindingsByRootAndName,f=e[d],g=b[b.length-1];a=a._cacheIndex;\ng._cacheIndex=a;b[a]=g;b.pop();delete f[c];a:{for(var h in f)break a;delete e[d]}},_lendBinding:function(a){var b=this._bindings,c=a._cacheIndex,d=this._nActiveBindings++,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_takeBackBinding:function(a){var b=this._bindings,c=a._cacheIndex,d=--this._nActiveBindings,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_lendControlInterpolant:function(){var a=this._controlInterpolants,b=this._nActiveControlInterpolants++,c=a[b];void 0===c&&(c=new jd(new Float32Array(2),\nnew Float32Array(2),1,this._controlInterpolantsResultBuffer),c.__cacheIndex=b,a[b]=c);return c},_takeBackControlInterpolant:function(a){var b=this._controlInterpolants,c=a.__cacheIndex,d=--this._nActiveControlInterpolants,e=b[d];a.__cacheIndex=d;b[d]=a;e.__cacheIndex=c;b[c]=e},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(a,b){var c=b||this._root,d=c.uuid;c=\"string\"===typeof a?Ga.findByName(c,a):a;a=null!==c?c.uuid:a;var e=this._actionsByClip[a],f=null;if(void 0!==e){f=\ne.actionByRoot[d];if(void 0!==f)return f;f=e.knownActions[0];null===c&&(c=f._clip)}if(null===c)return null;b=new sf(this,c,b);this._bindAction(b,f);this._addInactiveAction(b,a,d);return b},existingAction:function(a,b){var c=b||this._root;b=c.uuid;c=\"string\"===typeof a?Ga.findByName(c,a):a;a=this._actionsByClip[c?c.uuid:a];return void 0!==a?a.actionByRoot[b]||null:null},stopAllAction:function(){for(var a=this._actions,b=this._nActiveActions,c=this._bindings,d=this._nActiveBindings,e=this._nActiveBindings=\nthis._nActiveActions=0;e!==b;++e)a[e].reset();for(e=0;e!==d;++e)c[e].useCount=0;return this},update:function(a){a*=this.timeScale;for(var b=this._actions,c=this._nActiveActions,d=this.time+=a,e=Math.sign(a),f=this._accuIndex^=1,g=0;g!==c;++g)b[g]._update(d,a,e,f);a=this._bindings;b=this._nActiveBindings;for(g=0;g!==b;++g)a[g].apply(f);return this},getRoot:function(){return this._root},uncacheClip:function(a){var b=this._actions;a=a.uuid;var c=this._actionsByClip,d=c[a];if(void 0!==d){d=d.knownActions;\nfor(var e=0,f=d.length;e!==f;++e){var g=d[e];this._deactivateAction(g);var h=g._cacheIndex,k=b[b.length-1];g._cacheIndex=null;g._byClipCacheIndex=null;k._cacheIndex=h;b[h]=k;b.pop();this._removeInactiveBindingsForAction(g)}delete c[a]}},uncacheRoot:function(a){a=a.uuid;var b=this._actionsByClip;for(d in b){var c=b[d].actionByRoot[a];void 0!==c&&(this._deactivateAction(c),this._removeInactiveAction(c))}var d=this._bindingsByRootAndName[a];if(void 0!==d)for(var e in d)a=d[e],a.restoreOriginalState(),\nthis._removeInactiveBinding(a)},uncacheAction:function(a,b){a=this.existingAction(a,b);null!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}});Qd.prototype.clone=function(){return new Qd(void 0===this.value.clone?this.value:this.value.clone())};ue.prototype=Object.assign(Object.create(D.prototype),{constructor:ue,isInstancedBufferGeometry:!0,copy:function(a){D.prototype.copy.call(this,a);this.maxInstancedCount=a.maxInstancedCount;return this},clone:function(){return(new this.constructor).copy(this)}});\nObject.defineProperties(ve.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}});Object.assign(ve.prototype,{isInterleavedBufferAttribute:!0,setX:function(a,b){this.data.array[a*this.data.stride+this.offset]=b;return this},setY:function(a,b){this.data.array[a*this.data.stride+this.offset+1]=b;return this},setZ:function(a,b){this.data.array[a*this.data.stride+this.offset+2]=b;return this},setW:function(a,b){this.data.array[a*this.data.stride+this.offset+\n3]=b;return this},getX:function(a){return this.data.array[a*this.data.stride+this.offset]},getY:function(a){return this.data.array[a*this.data.stride+this.offset+1]},getZ:function(a){return this.data.array[a*this.data.stride+this.offset+2]},getW:function(a){return this.data.array[a*this.data.stride+this.offset+3]},setXY:function(a,b,c){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data.array[a+\n0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;this.data.array[a+3]=e;return this}});Object.defineProperty(rc.prototype,\"needsUpdate\",{set:function(a){!0===a&&this.version++}});Object.assign(rc.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(a){if(Array.isArray(a))throw new TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");\nthis.count=void 0!==a?a.length/this.stride:0;this.array=a;return this},setDynamic:function(a){this.dynamic=a;return this},copy:function(a){this.array=new a.array.constructor(a.array);this.count=a.count;this.stride=a.stride;this.dynamic=a.dynamic;return this},copyAt:function(a,b,c){a*=this.stride;c*=b.stride;for(var d=0,e=this.stride;d<e;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},clone:function(){return(new this.constructor).copy(this)},\nonUpload:function(a){this.onUploadCallback=a;return this}});we.prototype=Object.assign(Object.create(rc.prototype),{constructor:we,isInstancedInterleavedBuffer:!0,copy:function(a){rc.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;return this}});xe.prototype=Object.assign(Object.create(L.prototype),{constructor:xe,isInstancedBufferAttribute:!0,copy:function(a){L.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;return this}});Object.assign(tf.prototype,{linePrecision:1,\nset:function(a,b){this.ray.set(a,b)},setFromCamera:function(a,b){b&&b.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(b.matrixWorld),this.ray.direction.set(a.x,a.y,.5).unproject(b).sub(this.ray.origin).normalize()):b&&b.isOrthographicCamera?(this.ray.origin.set(a.x,a.y,(b.near+b.far)/(b.near-b.far)).unproject(b),this.ray.direction.set(0,0,-1).transformDirection(b.matrixWorld)):console.error(\"THREE.Raycaster: Unsupported camera type.\")},intersectObject:function(a,b,c){c=c||[];ye(a,this,\nc,b);c.sort(uf);return c},intersectObjects:function(a,b,c){c=c||[];if(!1===Array.isArray(a))return console.warn(\"THREE.Raycaster.intersectObjects: objects is not an Array.\"),c;for(var d=0,e=a.length;d<e;d++)ye(a[d],this,c,b);c.sort(uf);return c}});Object.assign(vf.prototype,{start:function(){this.oldTime=this.startTime=(\"undefined\"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0},stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta();\nreturn this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=(\"undefined\"===typeof performance?Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});Object.assign(wf.prototype,{set:function(a,b,c){this.radius=a;this.phi=b;this.theta=c;return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.radius=a.radius;this.phi=a.phi;this.theta=a.theta;return this},\nmakeSafe:function(){this.phi=Math.max(1E-6,Math.min(Math.PI-1E-6,this.phi));return this},setFromVector3:function(a){this.radius=a.length();0===this.radius?this.phi=this.theta=0:(this.theta=Math.atan2(a.x,a.z),this.phi=Math.acos(J.clamp(a.y/this.radius,-1,1)));return this}});Object.assign(xf.prototype,{set:function(a,b,c){this.radius=a;this.theta=b;this.y=c;return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.radius=a.radius;this.theta=a.theta;this.y=a.y;return this},\nsetFromVector3:function(a){this.radius=Math.sqrt(a.x*a.x+a.z*a.z);this.theta=Math.atan2(a.x,a.z);this.y=a.y;return this}});Object.assign(ze.prototype,{set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new B;return function(b,c){c=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(c);this.max.copy(b).add(c);return this}}(),clone:function(){return(new this.constructor).copy(this)},\ncopy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=Infinity;this.max.x=this.max.y=-Infinity;return this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(a){void 0===a&&(console.warn(\"THREE.Box2: .getCenter() target is now required\"),a=new B);return this.isEmpty()?a.set(0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(a){void 0===a&&(console.warn(\"THREE.Box2: .getSize() target is now required\"),\na=new B);return this.isEmpty()?a.set(0,0):a.subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=\nthis.max.y},getParameter:function(a,b){void 0===b&&(console.warn(\"THREE.Box2: .getParameter() target is now required\"),b=new B);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn(\"THREE.Box2: .clampPoint() target is now required\"),b=new B);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=\nnew B;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});ld.prototype=Object.create(H.prototype);ld.prototype.constructor=ld;ld.prototype.isImmediateRenderObject=!0;md.prototype=Object.create(Y.prototype);\nmd.prototype.constructor=md;md.prototype.update=function(){var a=new p,b=new p,c=new la;return function(){var d=[\"a\",\"b\",\"c\"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,f=this.geometry.attributes.position,g=this.object.geometry;if(g&&g.isGeometry)for(var h=g.vertices,k=g.faces,m=g=0,p=k.length;m<p;m++)for(var n=k[m],t=0,q=n.vertexNormals.length;t<q;t++){var r=n.vertexNormals[t];a.copy(h[n[d[t]]]).applyMatrix4(e);b.copy(r).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);\nf.setXYZ(g,a.x,a.y,a.z);g+=1;f.setXYZ(g,b.x,b.y,b.z);g+=1}else if(g&&g.isBufferGeometry)for(d=g.attributes.position,h=g.attributes.normal,t=g=0,q=d.count;t<q;t++)a.set(d.getX(t),d.getY(t),d.getZ(t)).applyMatrix4(e),b.set(h.getX(t),h.getY(t),h.getZ(t)),b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a),f.setXYZ(g,a.x,a.y,a.z),g+=1,f.setXYZ(g,b.x,b.y,b.z),g+=1;f.needsUpdate=!0}}();sc.prototype=Object.create(H.prototype);sc.prototype.constructor=sc;sc.prototype.dispose=function(){this.cone.geometry.dispose();\nthis.cone.material.dispose()};sc.prototype.update=function(){var a=new p,b=new p;return function(){this.light.updateMatrixWorld();var c=this.light.distance?this.light.distance:1E3,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}();tc.prototype=Object.create(Y.prototype);\ntc.prototype.constructor=tc;tc.prototype.updateMatrixWorld=function(){var a=new p,b=new R,c=new R;return function(d){var e=this.bones,f=this.geometry,g=f.getAttribute(\"position\");c.getInverse(this.root.matrixWorld);for(var h=0,k=0;h<e.length;h++){var m=e[h];m.parent&&m.parent.isBone&&(b.multiplyMatrices(c,m.matrixWorld),a.setFromMatrixPosition(b),g.setXYZ(k,a.x,a.y,a.z),b.multiplyMatrices(c,m.parent.matrixWorld),a.setFromMatrixPosition(b),g.setXYZ(k+1,a.x,a.y,a.z),k+=2)}f.getAttribute(\"position\").needsUpdate=\n!0;H.prototype.updateMatrixWorld.call(this,d)}}();uc.prototype=Object.create(va.prototype);uc.prototype.constructor=uc;uc.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};uc.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};vc.prototype=Object.create(H.prototype);vc.prototype.constructor=vc;vc.prototype.dispose=function(){this.children[0].geometry.dispose();this.children[0].material.dispose()};\nvc.prototype.update=function(){var a=.5*this.light.width,b=.5*this.light.height,c=this.line.geometry.attributes.position,d=c.array;d[0]=a;d[1]=-b;d[2]=0;d[3]=a;d[4]=b;d[5]=0;d[6]=-a;d[7]=b;d[8]=0;d[9]=-a;d[10]=-b;d[11]=0;d[12]=a;d[13]=-b;d[14]=0;c.needsUpdate=!0;void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)};wc.prototype=Object.create(H.prototype);wc.prototype.constructor=wc;wc.prototype.dispose=function(){this.children[0].geometry.dispose();\nthis.children[0].material.dispose()};wc.prototype.update=function(){var a=new p,b=new G,c=new G;return function(){var d=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=d.geometry.getAttribute(\"color\");b.copy(this.light.color);c.copy(this.light.groundColor);for(var f=0,g=e.count;f<g;f++){var h=f<g/2?b:c;e.setXYZ(f,h.r,h.g,h.b)}e.needsUpdate=!0}d.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate())}}();nd.prototype=Object.create(Y.prototype);nd.prototype.constructor=\nnd;Rd.prototype=Object.create(Y.prototype);Rd.prototype.constructor=Rd;od.prototype=Object.create(Y.prototype);od.prototype.constructor=od;od.prototype.update=function(){var a=new p,b=new p,c=new la;return function(){this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var d=this.object.matrixWorld,e=this.geometry.attributes.position,f=this.object.geometry,g=f.vertices;f=f.faces;for(var h=0,k=0,m=f.length;k<m;k++){var p=f[k],n=p.normal;a.copy(g[p.a]).add(g[p.b]).add(g[p.c]).divideScalar(3).applyMatrix4(d);\nb.copy(n).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);e.setXYZ(h,a.x,a.y,a.z);h+=1;e.setXYZ(h,b.x,b.y,b.z);h+=1}e.needsUpdate=!0}}();xc.prototype=Object.create(H.prototype);xc.prototype.constructor=xc;xc.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};xc.prototype.update=function(){var a=new p,b=new p,c=new p;return function(){a.setFromMatrixPosition(this.light.matrixWorld);\nb.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color));this.targetLine.lookAt(c);this.targetLine.scale.z=c.length()}}();pd.prototype=Object.create(Y.prototype);pd.prototype.constructor=pd;pd.prototype.update=function(){function a(a,\ng,h,k){d.set(g,h,k).unproject(e);a=c[a];if(void 0!==a)for(g=b.getAttribute(\"position\"),h=0,k=a.length;h<k;h++)g.setXYZ(a[h],d.x,d.y,d.z)}var b,c,d=new p,e=new Ra;return function(){b=this.geometry;c=this.pointMap;e.projectionMatrix.copy(this.camera.projectionMatrix);a(\"c\",0,0,-1);a(\"t\",0,0,1);a(\"n1\",-1,-1,-1);a(\"n2\",1,-1,-1);a(\"n3\",-1,1,-1);a(\"n4\",1,1,-1);a(\"f1\",-1,-1,1);a(\"f2\",1,-1,1);a(\"f3\",-1,1,1);a(\"f4\",1,1,1);a(\"u1\",.7,1.1,-1);a(\"u2\",-.7,1.1,-1);a(\"u3\",0,2,-1);a(\"cf1\",-1,0,1);a(\"cf2\",1,0,1);a(\"cf3\",\n0,-1,1);a(\"cf4\",0,1,1);a(\"cn1\",-1,0,-1);a(\"cn2\",1,0,-1);a(\"cn3\",0,-1,-1);a(\"cn4\",0,1,-1);b.getAttribute(\"position\").needsUpdate=!0}}();Ib.prototype=Object.create(Y.prototype);Ib.prototype.constructor=Ib;Ib.prototype.update=function(){var a=new Xa;return function(b){void 0!==b&&console.warn(\"THREE.BoxHelper: .update() has no longer arguments.\");void 0!==this.object&&a.setFromObject(this.object);if(!a.isEmpty()){b=a.min;var c=a.max,d=this.geometry.attributes.position,e=d.array;e[0]=c.x;e[1]=c.y;e[2]=\nc.z;e[3]=b.x;e[4]=c.y;e[5]=c.z;e[6]=b.x;e[7]=b.y;e[8]=c.z;e[9]=c.x;e[10]=b.y;e[11]=c.z;e[12]=c.x;e[13]=c.y;e[14]=b.z;e[15]=b.x;e[16]=c.y;e[17]=b.z;e[18]=b.x;e[19]=b.y;e[20]=b.z;e[21]=c.x;e[22]=b.y;e[23]=b.z;d.needsUpdate=!0;this.geometry.computeBoundingSphere()}}}();Ib.prototype.setFromObject=function(a){this.object=a;this.update();return this};qd.prototype=Object.create(Y.prototype);qd.prototype.constructor=qd;qd.prototype.updateMatrixWorld=function(a){var b=this.box;b.isEmpty()||(b.getCenter(this.position),\nb.getSize(this.scale),this.scale.multiplyScalar(.5),H.prototype.updateMatrixWorld.call(this,a))};rd.prototype=Object.create(wa.prototype);rd.prototype.constructor=rd;rd.prototype.updateMatrixWorld=function(a){var b=-this.plane.constant;1E-8>Math.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);H.prototype.updateMatrixWorld.call(this,a)};var Sd,Ae;Jb.prototype=Object.create(H.prototype);Jb.prototype.constructor=Jb;Jb.prototype.setDirection=\nfunction(){var a=new p,b;return function(c){.99999<c.y?this.quaternion.set(0,0,0,1):-.99999>c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();Jb.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(0,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};Jb.prototype.setColor=function(a){this.line.material.color.copy(a);\nthis.cone.material.color.copy(a)};sd.prototype=Object.create(Y.prototype);sd.prototype.constructor=sd;E.create=function(a,b){console.log(\"THREE.Curve.create() has been deprecated\");a.prototype=Object.create(E.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(bb.prototype,{createPointsGeometry:function(a){console.warn(\"THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.\");a=this.getPoints(a);return this.createGeometry(a)},\ncreateSpacedPointsGeometry:function(a){console.warn(\"THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.\");a=this.getSpacedPoints(a);return this.createGeometry(a)},createGeometry:function(a){console.warn(\"THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.\");for(var b=new P,c=0,d=a.length;c<d;c++){var e=a[c];b.vertices.push(new p(e.x,e.y,e.z||0))}return b}});Object.assign(Qa.prototype,\n{fromPoints:function(a){console.warn(\"THREE.Path: .fromPoints() has been renamed to .setFromPoints().\");this.setFromPoints(a)}});zf.prototype=Object.create(pa.prototype);Af.prototype=Object.create(pa.prototype);Be.prototype=Object.create(pa.prototype);Object.assign(Be.prototype,{initFromArray:function(){console.error(\"THREE.Spline: .initFromArray() has been removed.\")},getControlPointsArray:function(){console.error(\"THREE.Spline: .getControlPointsArray() has been removed.\")},reparametrizeByArcLength:function(){console.error(\"THREE.Spline: .reparametrizeByArcLength() has been removed.\")}});\nnd.prototype.setColors=function(){console.error(\"THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.\")};tc.prototype.update=function(){console.error(\"THREE.SkeletonHelper: update() no longer needs to be called.\")};Object.assign(pc.prototype,{extractUrlBase:function(a){console.warn(\"THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.\");return Fe.extractUrlBase(a)}});Object.assign(ze.prototype,{center:function(a){console.warn(\"THREE.Box2: .center() has been renamed to .getCenter().\");\nreturn this.getCenter(a)},empty:function(){console.warn(\"THREE.Box2: .empty() has been renamed to .isEmpty().\");return this.isEmpty()},isIntersectionBox:function(a){console.warn(\"THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().\");return this.intersectsBox(a)},size:function(a){console.warn(\"THREE.Box2: .size() has been renamed to .getSize().\");return this.getSize(a)}});Object.assign(Xa.prototype,{center:function(a){console.warn(\"THREE.Box3: .center() has been renamed to .getCenter().\");\nreturn this.getCenter(a)},empty:function(){console.warn(\"THREE.Box3: .empty() has been renamed to .isEmpty().\");return this.isEmpty()},isIntersectionBox:function(a){console.warn(\"THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().\");return this.intersectsBox(a)},isIntersectionSphere:function(a){console.warn(\"THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().\");return this.intersectsSphere(a)},size:function(a){console.warn(\"THREE.Box3: .size() has been renamed to .getSize().\");\nreturn this.getSize(a)}});Qb.prototype.center=function(a){console.warn(\"THREE.Line3: .center() has been renamed to .getCenter().\");return this.getCenter(a)};Object.assign(J,{random16:function(){console.warn(\"THREE.Math: .random16() has been deprecated. Use Math.random() instead.\");return Math.random()},nearestPowerOfTwo:function(a){console.warn(\"THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo().\");return J.floorPowerOfTwo(a)},nextPowerOfTwo:function(a){console.warn(\"THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo().\");\nreturn J.ceilPowerOfTwo(a)}});Object.assign(la.prototype,{flattenToArrayOffset:function(a,b){console.warn(\"THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.\");return this.toArray(a,b)},multiplyVector3:function(a){console.warn(\"THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.\");return a.applyMatrix3(this)},multiplyVector3Array:function(){console.error(\"THREE.Matrix3: .multiplyVector3Array() has been removed.\")},applyToBuffer:function(a){console.warn(\"THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.\");\nreturn this.applyToBufferAttribute(a)},applyToVector3Array:function(){console.error(\"THREE.Matrix3: .applyToVector3Array() has been removed.\")}});Object.assign(R.prototype,{extractPosition:function(a){console.warn(\"THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().\");return this.copyPosition(a)},flattenToArrayOffset:function(a,b){console.warn(\"THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.\");return this.toArray(a,b)},getPosition:function(){var a;\nreturn function(){void 0===a&&(a=new p);console.warn(\"THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.\");return a.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(a){console.warn(\"THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().\");return this.makeRotationFromQuaternion(a)},multiplyToArray:function(){console.warn(\"THREE.Matrix4: .multiplyToArray() has been removed.\")},multiplyVector3:function(a){console.warn(\"THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.\");\nreturn a.applyMatrix4(this)},multiplyVector4:function(a){console.warn(\"THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.\");return a.applyMatrix4(this)},multiplyVector3Array:function(){console.error(\"THREE.Matrix4: .multiplyVector3Array() has been removed.\")},rotateAxis:function(a){console.warn(\"THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.\");a.transformDirection(this)},crossVector:function(a){console.warn(\"THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.\");\nreturn a.applyMatrix4(this)},translate:function(){console.error(\"THREE.Matrix4: .translate() has been removed.\")},rotateX:function(){console.error(\"THREE.Matrix4: .rotateX() has been removed.\")},rotateY:function(){console.error(\"THREE.Matrix4: .rotateY() has been removed.\")},rotateZ:function(){console.error(\"THREE.Matrix4: .rotateZ() has been removed.\")},rotateByAxis:function(){console.error(\"THREE.Matrix4: .rotateByAxis() has been removed.\")},applyToBuffer:function(a){console.warn(\"THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.\");\nreturn this.applyToBufferAttribute(a)},applyToVector3Array:function(){console.error(\"THREE.Matrix4: .applyToVector3Array() has been removed.\")},makeFrustum:function(a,b,c,d,e,f){console.warn(\"THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.\");return this.makePerspective(a,b,d,c,e,f)}});Ia.prototype.isIntersectionLine=function(a){console.warn(\"THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().\");return this.intersectsLine(a)};\nca.prototype.multiplyVector3=function(a){console.warn(\"THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.\");return a.applyQuaternion(this)};Object.assign(sb.prototype,{isIntersectionBox:function(a){console.warn(\"THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().\");return this.intersectsBox(a)},isIntersectionPlane:function(a){console.warn(\"THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().\");return this.intersectsPlane(a)},\nisIntersectionSphere:function(a){console.warn(\"THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().\");return this.intersectsSphere(a)}});Object.assign(ta.prototype,{area:function(){console.warn(\"THREE.Triangle: .area() has been renamed to .getArea().\");return this.getArea()},barycoordFromPoint:function(a,b){console.warn(\"THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().\");return this.getBarycoord(a,b)},midpoint:function(a){console.warn(\"THREE.Triangle: .midpoint() has been renamed to .getMidpoint().\");\nreturn this.getMidpoint(a)},normal:function(a){console.warn(\"THREE.Triangle: .normal() has been renamed to .getNormal().\");return this.getNormal(a)},plane:function(a){console.warn(\"THREE.Triangle: .plane() has been renamed to .getPlane().\");return this.getPlane(a)}});Object.assign(ta,{barycoordFromPoint:function(a,b,c,d,e){console.warn(\"THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().\");return ta.getBarycoord(a,b,c,d,e)},normal:function(a,b,c,d){console.warn(\"THREE.Triangle: .normal() has been renamed to .getNormal().\");\nreturn ta.getNormal(a,b,c,d)}});Object.assign(jb.prototype,{extractAllPoints:function(a){console.warn(\"THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.\");return this.extractPoints(a)},extrude:function(a){console.warn(\"THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.\");return new wb(this,a)},makeGeometry:function(a){console.warn(\"THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.\");return new yb(this,a)}});Object.assign(B.prototype,\n{fromAttribute:function(a,b,c){console.warn(\"THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().\");return this.fromBufferAttribute(a,b,c)},distanceToManhattan:function(a){console.warn(\"THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().\");return this.manhattanDistanceTo(a)},lengthManhattan:function(){console.warn(\"THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().\");return this.manhattanLength()}});Object.assign(p.prototype,\n{setEulerFromRotationMatrix:function(){console.error(\"THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.\")},setEulerFromQuaternion:function(){console.error(\"THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.\")},getPositionFromMatrix:function(a){console.warn(\"THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().\");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn(\"THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().\");\nreturn this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){console.warn(\"THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().\");return this.setFromMatrixColumn(b,a)},applyProjection:function(a){console.warn(\"THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.\");return this.applyMatrix4(a)},fromAttribute:function(a,b,c){console.warn(\"THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().\");return this.fromBufferAttribute(a,\nb,c)},distanceToManhattan:function(a){console.warn(\"THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().\");return this.manhattanDistanceTo(a)},lengthManhattan:function(){console.warn(\"THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().\");return this.manhattanLength()}});Object.assign(W.prototype,{fromAttribute:function(a,b,c){console.warn(\"THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().\");return this.fromBufferAttribute(a,\nb,c)},lengthManhattan:function(){console.warn(\"THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().\");return this.manhattanLength()}});Object.assign(P.prototype,{computeTangents:function(){console.error(\"THREE.Geometry: .computeTangents() has been removed.\")},computeLineDistances:function(){console.error(\"THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.\")}});Object.assign(H.prototype,{getChildByName:function(a){console.warn(\"THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().\");\nreturn this.getObjectByName(a)},renderDepth:function(){console.warn(\"THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.\")},translate:function(a,b){console.warn(\"THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.\");return this.translateOnAxis(b,a)},getWorldRotation:function(){console.error(\"THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.\")}});Object.defineProperties(H.prototype,\n{eulerOrder:{get:function(){console.warn(\"THREE.Object3D: .eulerOrder is now .rotation.order.\");return this.rotation.order},set:function(a){console.warn(\"THREE.Object3D: .eulerOrder is now .rotation.order.\");this.rotation.order=a}},useQuaternion:{get:function(){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")},set:function(){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")}}});\nObject.defineProperties(Jc.prototype,{objects:{get:function(){console.warn(\"THREE.LOD: .objects has been renamed to .levels.\");return this.levels}}});Object.defineProperty(Kc.prototype,\"useVertexTexture\",{get:function(){console.warn(\"THREE.Skeleton: useVertexTexture has been removed.\")},set:function(){console.warn(\"THREE.Skeleton: useVertexTexture has been removed.\")}});Object.defineProperty(E.prototype,\"__arcLengthDivisions\",{get:function(){console.warn(\"THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.\");\nreturn this.arcLengthDivisions},set:function(a){console.warn(\"THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.\");this.arcLengthDivisions=a}});Z.prototype.setLens=function(a,b){console.warn(\"THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup.\");void 0!==b&&(this.filmGauge=b);this.setFocalLength(a)};Object.defineProperties(X.prototype,{onlyShadow:{set:function(){console.warn(\"THREE.Light: .onlyShadow has been removed.\")}},shadowCameraFov:{set:function(a){console.warn(\"THREE.Light: .shadowCameraFov is now .shadow.camera.fov.\");\nthis.shadow.camera.fov=a}},shadowCameraLeft:{set:function(a){console.warn(\"THREE.Light: .shadowCameraLeft is now .shadow.camera.left.\");this.shadow.camera.left=a}},shadowCameraRight:{set:function(a){console.warn(\"THREE.Light: .shadowCameraRight is now .shadow.camera.right.\");this.shadow.camera.right=a}},shadowCameraTop:{set:function(a){console.warn(\"THREE.Light: .shadowCameraTop is now .shadow.camera.top.\");this.shadow.camera.top=a}},shadowCameraBottom:{set:function(a){console.warn(\"THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.\");\nthis.shadow.camera.bottom=a}},shadowCameraNear:{set:function(a){console.warn(\"THREE.Light: .shadowCameraNear is now .shadow.camera.near.\");this.shadow.camera.near=a}},shadowCameraFar:{set:function(a){console.warn(\"THREE.Light: .shadowCameraFar is now .shadow.camera.far.\");this.shadow.camera.far=a}},shadowCameraVisible:{set:function(){console.warn(\"THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.\")}},shadowBias:{set:function(a){console.warn(\"THREE.Light: .shadowBias is now .shadow.bias.\");\nthis.shadow.bias=a}},shadowDarkness:{set:function(){console.warn(\"THREE.Light: .shadowDarkness has been removed.\")}},shadowMapWidth:{set:function(a){console.warn(\"THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.\");this.shadow.mapSize.width=a}},shadowMapHeight:{set:function(a){console.warn(\"THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.\");this.shadow.mapSize.height=a}}});Object.defineProperties(L.prototype,{length:{get:function(){console.warn(\"THREE.BufferAttribute: .length has been deprecated. Use .count instead.\");\nreturn this.array.length}},copyIndicesArray:function(){console.error(\"THREE.BufferAttribute: .copyIndicesArray() has been removed.\")}});Object.assign(D.prototype,{addIndex:function(a){console.warn(\"THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().\");this.setIndex(a)},addDrawCall:function(a,b,c){void 0!==c&&console.warn(\"THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.\");console.warn(\"THREE.BufferGeometry: .addDrawCall() is now .addGroup().\");this.addGroup(a,b)},\nclearDrawCalls:function(){console.warn(\"THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().\");this.clearGroups()},computeTangents:function(){console.warn(\"THREE.BufferGeometry: .computeTangents() has been removed.\")},computeOffsets:function(){console.warn(\"THREE.BufferGeometry: .computeOffsets() has been removed.\")}});Object.defineProperties(D.prototype,{drawcalls:{get:function(){console.error(\"THREE.BufferGeometry: .drawcalls has been renamed to .groups.\");return this.groups}},offsets:{get:function(){console.warn(\"THREE.BufferGeometry: .offsets has been renamed to .groups.\");\nreturn this.groups}}});Object.assign(Ta.prototype,{getArrays:function(){console.error(\"THREE.ExtrudeBufferGeometry: .getArrays() has been removed.\")},addShapeList:function(){console.error(\"THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.\")},addShape:function(){console.error(\"THREE.ExtrudeBufferGeometry: .addShape() has been removed.\")}});Object.defineProperties(Qd.prototype,{dynamic:{set:function(){console.warn(\"THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.\")}},\nonUpdate:{value:function(){console.warn(\"THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.\");return this}}});Object.defineProperties(I.prototype,{wrapAround:{get:function(){console.warn(\"THREE.Material: .wrapAround has been removed.\")},set:function(){console.warn(\"THREE.Material: .wrapAround has been removed.\")}},wrapRGB:{get:function(){console.warn(\"THREE.Material: .wrapRGB has been removed.\");return new G}},shading:{get:function(){console.error(\"THREE.\"+this.type+\n\": .shading has been removed. Use the boolean .flatShading instead.\")},set:function(a){console.warn(\"THREE.\"+this.type+\": .shading has been removed. Use the boolean .flatShading instead.\");this.flatShading=1===a}}});Object.defineProperties(Ka.prototype,{metal:{get:function(){console.warn(\"THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.\");return!1},set:function(){console.warn(\"THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead\")}}});\nObject.defineProperties(Fa.prototype,{derivatives:{get:function(){console.warn(\"THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.\");return this.extensions.derivatives},set:function(a){console.warn(\"THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.\");this.extensions.derivatives=a}}});Object.assign(ae.prototype,{animate:function(a){console.warn(\"THREE.WebGLRenderer: .animate() is now .setAnimationLoop().\");this.setAnimationLoop(a)},getCurrentRenderTarget:function(){console.warn(\"THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().\");\nreturn this.getRenderTarget()},getMaxAnisotropy:function(){console.warn(\"THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().\");return this.capabilities.getMaxAnisotropy()},getPrecision:function(){console.warn(\"THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.\");return this.capabilities.precision},resetGLState:function(){console.warn(\"THREE.WebGLRenderer: .resetGLState() is now .state.reset().\");return this.state.reset()},supportsFloatTextures:function(){console.warn(\"THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).\");\nreturn this.extensions.get(\"OES_texture_float\")},supportsHalfFloatTextures:function(){console.warn(\"THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).\");return this.extensions.get(\"OES_texture_half_float\")},supportsStandardDerivatives:function(){console.warn(\"THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).\");return this.extensions.get(\"OES_standard_derivatives\")},supportsCompressedTextureS3TC:function(){console.warn(\"THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).\");\nreturn this.extensions.get(\"WEBGL_compressed_texture_s3tc\")},supportsCompressedTexturePVRTC:function(){console.warn(\"THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).\");return this.extensions.get(\"WEBGL_compressed_texture_pvrtc\")},supportsBlendMinMax:function(){console.warn(\"THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).\");return this.extensions.get(\"EXT_blend_minmax\")},supportsVertexTextures:function(){console.warn(\"THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.\");\nreturn this.capabilities.vertexTextures},supportsInstancedArrays:function(){console.warn(\"THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).\");return this.extensions.get(\"ANGLE_instanced_arrays\")},enableScissorTest:function(a){console.warn(\"THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().\");this.setScissorTest(a)},initMaterial:function(){console.warn(\"THREE.WebGLRenderer: .initMaterial() has been removed.\")},addPrePlugin:function(){console.warn(\"THREE.WebGLRenderer: .addPrePlugin() has been removed.\")},\naddPostPlugin:function(){console.warn(\"THREE.WebGLRenderer: .addPostPlugin() has been removed.\")},updateShadowMap:function(){console.warn(\"THREE.WebGLRenderer: .updateShadowMap() has been removed.\")},setFaceCulling:function(){console.warn(\"THREE.WebGLRenderer: .setFaceCulling() has been removed.\")}});Object.defineProperties(ae.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(a){console.warn(\"THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.\");\nthis.shadowMap.enabled=a}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(a){console.warn(\"THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.\");this.shadowMap.type=a}},shadowMapCullFace:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.\")}}});Object.defineProperties($e.prototype,\n{cullFace:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.\")}},renderReverseSided:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.\")}},\nrenderSingleSided:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.\")}}});Object.defineProperties(kb.prototype,{wrapS:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.\");return this.texture.wrapS},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.\");\nthis.texture.wrapS=a}},wrapT:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.\");return this.texture.wrapT},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.\");this.texture.wrapT=a}},magFilter:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.\");return this.texture.magFilter},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.\");this.texture.magFilter=\na}},minFilter:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.\");return this.texture.minFilter},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.\");this.texture.minFilter=a}},anisotropy:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.\");return this.texture.anisotropy},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.\");this.texture.anisotropy=\na}},offset:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .offset is now .texture.offset.\");return this.texture.offset},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .offset is now .texture.offset.\");this.texture.offset=a}},repeat:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .repeat is now .texture.repeat.\");return this.texture.repeat},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .repeat is now .texture.repeat.\");this.texture.repeat=a}},format:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .format is now .texture.format.\");\nreturn this.texture.format},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .format is now .texture.format.\");this.texture.format=a}},type:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .type is now .texture.type.\");return this.texture.type},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .type is now .texture.type.\");this.texture.type=a}},generateMipmaps:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.\");return this.texture.generateMipmaps},\nset:function(a){console.warn(\"THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.\");this.texture.generateMipmaps=a}}});Object.defineProperties(bf.prototype,{standing:{set:function(){console.warn(\"THREE.WebVRManager: .standing has been removed.\")}}});qc.prototype.load=function(a){console.warn(\"THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.\");var b=this;(new ne).load(a,function(a){b.setBuffer(a)});return this};re.prototype.getData=function(){console.warn(\"THREE.AudioAnalyser: .getData() is now .getFrequencyData().\");\nreturn this.getFrequencyData()};kd.prototype.updateCubeMap=function(a,b){console.warn(\"THREE.CubeCamera: .updateCubeMap() is now .update().\");return this.update(a,b)};k.WebGLRenderTargetCube=Lb;k.WebGLRenderTarget=kb;k.WebGLRenderer=ae;k.ShaderLib=tb;k.UniformsLib=K;k.UniformsUtils=Ba;k.ShaderChunk=S;k.FogExp2=Vb;k.Fog=Wb;k.Scene=vd;k.Sprite=Ic;k.LOD=Jc;k.SkinnedMesh=xd;k.Skeleton=Kc;k.Bone=wd;k.Mesh=va;k.LineSegments=Y;k.LineLoop=yd;k.Line=wa;k.Points=Xb;k.Group=Ub;k.VideoTexture=be;k.DataTexture=\nlb;k.CompressedTexture=Yb;k.CubeTexture=Za;k.CanvasTexture=Sb;k.DepthTexture=Lc;k.Texture=ea;k.CompressedTextureLoader=lf;k.DataTextureLoader=fe;k.CubeTextureLoader=ge;k.TextureLoader=Ad;k.ObjectLoader=nf;k.MaterialLoader=Pd;k.BufferGeometryLoader=ie;k.DefaultLoadingManager=ya;k.LoadingManager=ee;k.JSONLoader=je;k.ImageLoader=fd;k.ImageBitmapLoader=ke;k.FontLoader=of;k.FileLoader=La;k.Loader=pc;k.LoaderUtils=Fe;k.Cache=Kb;k.AudioLoader=ne;k.SpotLightShadow=Cd;k.SpotLight=Dd;k.PointLight=Ed;k.RectAreaLight=\nId;k.HemisphereLight=Bd;k.DirectionalLightShadow=Fd;k.DirectionalLight=Gd;k.AmbientLight=Hd;k.LightShadow=Hb;k.Light=X;k.StereoCamera=pf;k.PerspectiveCamera=Z;k.OrthographicCamera=Mb;k.CubeCamera=kd;k.ArrayCamera=Hc;k.Camera=Ra;k.AudioListener=oe;k.PositionalAudio=qe;k.AudioContext=pe;k.AudioAnalyser=re;k.Audio=qc;k.VectorKeyframeTrack=oc;k.StringKeyframeTrack=Jd;k.QuaternionKeyframeTrack=id;k.NumberKeyframeTrack=nc;k.ColorKeyframeTrack=Md;k.BooleanKeyframeTrack=Kd;k.PropertyMixer=se;k.PropertyBinding=\nra;k.KeyframeTrack=ja;k.AnimationUtils=na;k.AnimationObjectGroup=rf;k.AnimationMixer=te;k.AnimationClip=Ga;k.Uniform=Qd;k.InstancedBufferGeometry=ue;k.BufferGeometry=D;k.Geometry=P;k.InterleavedBufferAttribute=ve;k.InstancedInterleavedBuffer=we;k.InterleavedBuffer=rc;k.InstancedBufferAttribute=xe;k.Face3=Ya;k.Object3D=H;k.Raycaster=tf;k.Layers=Wd;k.EventDispatcher=za;k.Clock=vf;k.QuaternionLinearInterpolant=Ld;k.LinearInterpolant=jd;k.DiscreteInterpolant=Od;k.CubicInterpolant=Nd;k.Interpolant=Ea;\nk.Triangle=ta;k.Math=J;k.Spherical=wf;k.Cylindrical=xf;k.Plane=Ia;k.Frustum=td;k.Sphere=Ha;k.Ray=sb;k.Matrix4=R;k.Matrix3=la;k.Box3=Xa;k.Box2=ze;k.Line3=Qb;k.Euler=mb;k.Vector4=W;k.Vector3=p;k.Vector2=B;k.Quaternion=ca;k.Color=G;k.ImmediateRenderObject=ld;k.VertexNormalsHelper=md;k.SpotLightHelper=sc;k.SkeletonHelper=tc;k.PointLightHelper=uc;k.RectAreaLightHelper=vc;k.HemisphereLightHelper=wc;k.GridHelper=nd;k.PolarGridHelper=Rd;k.FaceNormalsHelper=od;k.DirectionalLightHelper=xc;k.CameraHelper=pd;\nk.BoxHelper=Ib;k.Box3Helper=qd;k.PlaneHelper=rd;k.ArrowHelper=Jb;k.AxesHelper=sd;k.Shape=jb;k.Path=Qa;k.ShapePath=le;k.Font=me;k.CurvePath=bb;k.Curve=E;k.ShapeUtils=$a;k.WebGLUtils=af;k.WireframeGeometry=Zb;k.ParametricGeometry=Mc;k.ParametricBufferGeometry=$b;k.TetrahedronGeometry=Oc;k.TetrahedronBufferGeometry=ac;k.OctahedronGeometry=Pc;k.OctahedronBufferGeometry=ub;k.IcosahedronGeometry=Qc;k.IcosahedronBufferGeometry=bc;k.DodecahedronGeometry=Rc;k.DodecahedronBufferGeometry=cc;k.PolyhedronGeometry=\nNc;k.PolyhedronBufferGeometry=xa;k.TubeGeometry=Sc;k.TubeBufferGeometry=dc;k.TorusKnotGeometry=Tc;k.TorusKnotBufferGeometry=ec;k.TorusGeometry=Uc;k.TorusBufferGeometry=fc;k.TextGeometry=Zc;k.TextBufferGeometry=gc;k.SphereGeometry=$c;k.SphereBufferGeometry=xb;k.RingGeometry=ad;k.RingBufferGeometry=hc;k.PlaneGeometry=Fc;k.PlaneBufferGeometry=rb;k.LatheGeometry=bd;k.LatheBufferGeometry=ic;k.ShapeGeometry=yb;k.ShapeBufferGeometry=zb;k.ExtrudeGeometry=wb;k.ExtrudeBufferGeometry=Ta;k.EdgesGeometry=jc;k.ConeGeometry=\ncd;k.ConeBufferGeometry=dd;k.CylinderGeometry=Ab;k.CylinderBufferGeometry=ab;k.CircleGeometry=ed;k.CircleBufferGeometry=kc;k.BoxGeometry=Nb;k.BoxBufferGeometry=pb;k.ShadowMaterial=Bb;k.SpriteMaterial=ib;k.RawShaderMaterial=lc;k.ShaderMaterial=Fa;k.PointsMaterial=Ja;k.MeshPhysicalMaterial=Cb;k.MeshStandardMaterial=Ua;k.MeshPhongMaterial=Ka;k.MeshToonMaterial=Db;k.MeshNormalMaterial=Eb;k.MeshLambertMaterial=Fb;k.MeshDepthMaterial=fb;k.MeshDistanceMaterial=gb;k.MeshBasicMaterial=ua;k.LineDashedMaterial=\nGb;k.LineBasicMaterial=T;k.Material=I;k.Float64BufferAttribute=Dc;k.Float32BufferAttribute=z;k.Uint32BufferAttribute=ob;k.Int32BufferAttribute=Cc;k.Uint16BufferAttribute=nb;k.Int16BufferAttribute=Bc;k.Uint8ClampedBufferAttribute=Ac;k.Uint8BufferAttribute=zc;k.Int8BufferAttribute=yc;k.BufferAttribute=L;k.ArcCurve=mc;k.CatmullRomCurve3=pa;k.CubicBezierCurve=Ma;k.CubicBezierCurve3=Va;k.EllipseCurve=Da;k.LineCurve=ia;k.LineCurve3=Na;k.QuadraticBezierCurve=Oa;k.QuadraticBezierCurve3=Wa;k.SplineCurve=Pa;\nk.REVISION=\"94\";k.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2};k.CullFaceNone=0;k.CullFaceBack=1;k.CullFaceFront=2;k.CullFaceFrontBack=3;k.FrontFaceDirectionCW=0;k.FrontFaceDirectionCCW=1;k.BasicShadowMap=0;k.PCFShadowMap=1;k.PCFSoftShadowMap=2;k.FrontSide=0;k.BackSide=1;k.DoubleSide=2;k.FlatShading=1;k.SmoothShading=2;k.NoColors=0;k.FaceColors=1;k.VertexColors=2;k.NoBlending=0;k.NormalBlending=1;k.AdditiveBlending=2;k.SubtractiveBlending=3;k.MultiplyBlending=4;k.CustomBlending=5;k.AddEquation=100;k.SubtractEquation=\n101;k.ReverseSubtractEquation=102;k.MinEquation=103;k.MaxEquation=104;k.ZeroFactor=200;k.OneFactor=201;k.SrcColorFactor=202;k.OneMinusSrcColorFactor=203;k.SrcAlphaFactor=204;k.OneMinusSrcAlphaFactor=205;k.DstAlphaFactor=206;k.OneMinusDstAlphaFactor=207;k.DstColorFactor=208;k.OneMinusDstColorFactor=209;k.SrcAlphaSaturateFactor=210;k.NeverDepth=0;k.AlwaysDepth=1;k.LessDepth=2;k.LessEqualDepth=3;k.EqualDepth=4;k.GreaterEqualDepth=5;k.GreaterDepth=6;k.NotEqualDepth=7;k.MultiplyOperation=0;k.MixOperation=\n1;k.AddOperation=2;k.NoToneMapping=0;k.LinearToneMapping=1;k.ReinhardToneMapping=2;k.Uncharted2ToneMapping=3;k.CineonToneMapping=4;k.UVMapping=300;k.CubeReflectionMapping=301;k.CubeRefractionMapping=302;k.EquirectangularReflectionMapping=303;k.EquirectangularRefractionMapping=304;k.SphericalReflectionMapping=305;k.CubeUVReflectionMapping=306;k.CubeUVRefractionMapping=307;k.RepeatWrapping=1E3;k.ClampToEdgeWrapping=1001;k.MirroredRepeatWrapping=1002;k.NearestFilter=1003;k.NearestMipMapNearestFilter=\n1004;k.NearestMipMapLinearFilter=1005;k.LinearFilter=1006;k.LinearMipMapNearestFilter=1007;k.LinearMipMapLinearFilter=1008;k.UnsignedByteType=1009;k.ByteType=1010;k.ShortType=1011;k.UnsignedShortType=1012;k.IntType=1013;k.UnsignedIntType=1014;k.FloatType=1015;k.HalfFloatType=1016;k.UnsignedShort4444Type=1017;k.UnsignedShort5551Type=1018;k.UnsignedShort565Type=1019;k.UnsignedInt248Type=1020;k.AlphaFormat=1021;k.RGBFormat=1022;k.RGBAFormat=1023;k.LuminanceFormat=1024;k.LuminanceAlphaFormat=1025;k.RGBEFormat=\n1023;k.DepthFormat=1026;k.DepthStencilFormat=1027;k.RGB_S3TC_DXT1_Format=33776;k.RGBA_S3TC_DXT1_Format=33777;k.RGBA_S3TC_DXT3_Format=33778;k.RGBA_S3TC_DXT5_Format=33779;k.RGB_PVRTC_4BPPV1_Format=35840;k.RGB_PVRTC_2BPPV1_Format=35841;k.RGBA_PVRTC_4BPPV1_Format=35842;k.RGBA_PVRTC_2BPPV1_Format=35843;k.RGB_ETC1_Format=36196;k.RGBA_ASTC_4x4_Format=37808;k.RGBA_ASTC_5x4_Format=37809;k.RGBA_ASTC_5x5_Format=37810;k.RGBA_ASTC_6x5_Format=37811;k.RGBA_ASTC_6x6_Format=37812;k.RGBA_ASTC_8x5_Format=37813;k.RGBA_ASTC_8x6_Format=\n37814;k.RGBA_ASTC_8x8_Format=37815;k.RGBA_ASTC_10x5_Format=37816;k.RGBA_ASTC_10x6_Format=37817;k.RGBA_ASTC_10x8_Format=37818;k.RGBA_ASTC_10x10_Format=37819;k.RGBA_ASTC_12x10_Format=37820;k.RGBA_ASTC_12x12_Format=37821;k.LoopOnce=2200;k.LoopRepeat=2201;k.LoopPingPong=2202;k.InterpolateDiscrete=2300;k.InterpolateLinear=2301;k.InterpolateSmooth=2302;k.ZeroCurvatureEnding=2400;k.ZeroSlopeEnding=2401;k.WrapAroundEnding=2402;k.TrianglesDrawMode=0;k.TriangleStripDrawMode=1;k.TriangleFanDrawMode=2;k.LinearEncoding=\n3E3;k.sRGBEncoding=3001;k.GammaEncoding=3007;k.RGBEEncoding=3002;k.LogLuvEncoding=3003;k.RGBM7Encoding=3004;k.RGBM16Encoding=3005;k.RGBDEncoding=3006;k.BasicDepthPacking=3200;k.RGBADepthPacking=3201;k.TangentSpaceNormalMap=0;k.ObjectSpaceNormalMap=1;k.CubeGeometry=Nb;k.Face4=function(a,b,c,d,e,f,g){console.warn(\"THREE.Face4 has been removed. A THREE.Face3 will be created instead.\");return new Ya(a,b,c,e,f,g)};k.LineStrip=0;k.LinePieces=1;k.MeshFaceMaterial=function(a){console.warn(\"THREE.MeshFaceMaterial has been removed. Use an Array instead.\");\nreturn a};k.MultiMaterial=function(a){void 0===a&&(a=[]);console.warn(\"THREE.MultiMaterial has been removed. Use an Array instead.\");a.isMultiMaterial=!0;a.materials=a;a.clone=function(){return a.slice()};return a};k.PointCloud=function(a,b){console.warn(\"THREE.PointCloud has been renamed to THREE.Points.\");return new Xb(a,b)};k.Particle=function(a){console.warn(\"THREE.Particle has been renamed to THREE.Sprite.\");return new Ic(a)};k.ParticleSystem=function(a,b){console.warn(\"THREE.ParticleSystem has been renamed to THREE.Points.\");\nreturn new Xb(a,b)};k.PointCloudMaterial=function(a){console.warn(\"THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.\");return new Ja(a)};k.ParticleBasicMaterial=function(a){console.warn(\"THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.\");return new Ja(a)};k.ParticleSystemMaterial=function(a){console.warn(\"THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.\");return new Ja(a)};k.Vertex=function(a,b,c){console.warn(\"THREE.Vertex has been removed. Use THREE.Vector3 instead.\");\nreturn new p(a,b,c)};k.DynamicBufferAttribute=function(a,b){console.warn(\"THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.\");return(new L(a,b)).setDynamic(!0)};k.Int8Attribute=function(a,b){console.warn(\"THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.\");return new yc(a,b)};k.Uint8Attribute=function(a,b){console.warn(\"THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.\");return new zc(a,\nb)};k.Uint8ClampedAttribute=function(a,b){console.warn(\"THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.\");return new Ac(a,b)};k.Int16Attribute=function(a,b){console.warn(\"THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.\");return new Bc(a,b)};k.Uint16Attribute=function(a,b){console.warn(\"THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.\");return new nb(a,b)};k.Int32Attribute=\nfunction(a,b){console.warn(\"THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.\");return new Cc(a,b)};k.Uint32Attribute=function(a,b){console.warn(\"THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.\");return new ob(a,b)};k.Float32Attribute=function(a,b){console.warn(\"THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.\");return new z(a,b)};k.Float64Attribute=function(a,b){console.warn(\"THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.\");\nreturn new Dc(a,b)};k.ClosedSplineCurve3=zf;k.SplineCurve3=Af;k.Spline=Be;k.AxisHelper=function(a){console.warn(\"THREE.AxisHelper has been renamed to THREE.AxesHelper.\");return new sd(a)};k.BoundingBoxHelper=function(a,b){console.warn(\"THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.\");return new Ib(a,b)};k.EdgesHelper=function(a,b){console.warn(\"THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.\");return new Y(new jc(a.geometry),new T({color:void 0!==\nb?b:16777215}))};k.WireframeHelper=function(a,b){console.warn(\"THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.\");return new Y(new Zb(a.geometry),new T({color:void 0!==b?b:16777215}))};k.XHRLoader=function(a){console.warn(\"THREE.XHRLoader has been renamed to THREE.FileLoader.\");return new La(a)};k.BinaryTextureLoader=function(a){console.warn(\"THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.\");return new fe(a)};k.GeometryUtils={merge:function(a,b,c){console.warn(\"THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.\");\nif(b.isMesh){b.matrixAutoUpdate&&b.updateMatrix();var d=b.matrix;b=b.geometry}a.merge(b,d,c)},center:function(a){console.warn(\"THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.\");return a.center()}};k.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){console.warn(\"THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.\");var e=new Ad;e.setCrossOrigin(this.crossOrigin);a=e.load(a,c,void 0,d);b&&(a.mapping=b);return a},\nloadTextureCube:function(a,b,c,d){console.warn(\"THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.\");var e=new ge;e.setCrossOrigin(this.crossOrigin);a=e.load(a,c,void 0,d);b&&(a.mapping=b);return a},loadCompressedTexture:function(){console.error(\"THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.\")},loadCompressedTextureCube:function(){console.error(\"THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.\")}};\nk.Projector=function(){console.error(\"THREE.Projector has been moved to /examples/js/renderers/Projector.js.\");this.projectVector=function(a,b){console.warn(\"THREE.Projector: .projectVector() is now vector.project().\");a.project(b)};this.unprojectVector=function(a,b){console.warn(\"THREE.Projector: .unprojectVector() is now vector.unproject().\");a.unproject(b)};this.pickingRay=function(){console.error(\"THREE.Projector: .pickingRay() is now raycaster.setFromCamera().\")}};k.CanvasRenderer=function(){console.error(\"THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js\");\nthis.domElement=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\");this.clear=function(){};this.render=function(){};this.setClearColor=function(){};this.setSize=function(){}};k.SceneUtils={createMultiMaterialObject:function(){console.error(\"THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js\")},detach:function(){console.error(\"THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js\")},attach:function(){console.error(\"THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js\")}};\nk.LensFlare=function(){console.error(\"THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js\")};Object.defineProperty(k,\"__esModule\",{value:!0})});\n},{}],17:[function(require,module,exports){\narguments[4][4][0].apply(exports,arguments)\n},{\"dup\":4}],18:[function(require,module,exports){\n// This module creates a THREE material from the options object provided into the Objects class.\n// Users can do this in one of three ways:\n\n// - provide a preset THREE.Material in the `material` parameter\n// - specify a `material` string, `color`, and/or `opacity` as modifications of the default material\n// - provide none of these parameters, to use the default material\n\nvar utils = require(\"../Utils/Utils.js\");\nvar THREE = require(\"../three.js\");\n\nvar defaults = {\n\tmaterial: 'MeshBasicMaterial',\n\tcolor: 'black',\n\topacity: 1\n};\n\n\nfunction material (options) {\n\n\tvar output;\n\n\tif (options) {\n\n\t\toptions = utils._validate(options, defaults);\n\n\t\t// check if user provided material object\n\t\tif (options.material && options.material.isMaterial) output = options.material;\n\n\t\t// check if user provided any material parameters. create new material object based on that.\n\t\telse if (options.material || options.color || options.opacity){\n\t\t    output = new THREE[options.material]({color: options.color, transparent: options.opacity<1});\n\t\t}\n\n\t\t// if neither, return default material\n\t\telse output = generateDefaultMaterial();\n\n\t\toutput.opacity = options.opacity;\n\n\t}\n\n\t// if no options, return default\n\telse output = generateDefaultMaterial();\n\n\tfunction generateDefaultMaterial(){\n\t\treturn new THREE[defaults.material]({color: defaults.color});\n\t}\n\n\treturn output\n}\n\nmodule.exports = exports = material;\n\n},{\"../Utils/Utils.js\":3,\"../three.js\":16}],19:[function(require,module,exports){\narguments[4][3][0].apply(exports,arguments)\n},{\"../three.js\":16,\"./constants.js\":17,\"./validate.js\":20,\"dup\":3}],20:[function(require,module,exports){\narguments[4][5][0].apply(exports,arguments)\n},{\"dup\":5}]},{},[1]);\n"
  },
  {
    "path": "docs/SymbolLayer3D.md",
    "content": "![3D Symbol Layers](img/features-3D-symbols.png)\n\n## `SymbolLayer3D`\n\nThe `SymbolLayer3D` object lets you load in a GeoJSON FeatureCollection of points and will automatically place 3D models at each point.\n\nCreate a 3D symbol layer using this syntax:\n```\nvar symbols = threebox.addSymbolLayer({\n  id:             'yourLayerName',\n  source:         GeoJSON object | URL,\n  modelName:      string | property | generator,\n  modelDirectory: string | property | generator,\n  rotation:       THREE.Euler | generator,\n  scale:          number | property | generator,\n  scaleWithMapProjection: boolean,\n  key:            property | generator\n});\n```\n\n### Examples\n\n- [Static symbol layer](../examples/SymbolLayer3D.html)\n- [Flocking demo showing fast updates and generator functions](../examples/flocking.html)\n\n### Sources\n\nPass either an object that contains a GeoJSON `FeatureCollection` or a URL that points to a GeoJSON source as a parameter to `addSymbolLayer`. If you pass a URL, the GeoJSON source will be downloaded and parsed for you.\n\nThe `FeatureCollection` should contain a `features` array, and each feature should contain geometry of `type: Point`. `threebox` will place a 3D symbol at the specified longitude/latitude point for each feature.\n\n### Scaling and units\n\nThe `scaleWithMapProjection` parameter can help when choosing units and scale factors for 3D symbols on a map. If set to `true` (default), the units of the 3D model file will be interpreted as **meters** at each feature's latitude. Because of distortion inherent in the Mercator projection, this means objects closer to the equator will be automatically scaled to appear smaller than objects closer to the poles. This lets you model your 3D symbols using real-world units and have them appear correctly at all latitudes.\n\nIf `scaleWithMapProjection` is set to `false`, the correspondence between your 3D symbol model units and map units can be defined however you see fit.\n\nUnits in 3D files coming from different sources tend be somewhat arbitrary and dependent on the context they are rendered into. In `threebox`, a line going from `{latitude: 0, longitude: 0}` to `{latitude: 0, longitude: 360}` (circumnavigating the world once at the equator) would measure 512 units long. Because of this, building- or vehicle-sized objects must generally be scaled down significantly to appear correctly if `scaleWithMapProject` is set to `false`.\n\n### Models\n\n`SymbolLayer3D` currently supports loading 3D models in the [.OBJ format](https://en.wikipedia.org/wiki/Wavefront_.obj_file) with materials specified in a corresponding [.MTL file](https://en.wikipedia.org/wiki/Wavefront_.obj_file#Material_template_library). These are common interchange formats that most 3D modeling programs can export. For proper rendering, it is important to ensure that the model's *normals are correctly facing outwards* and that all *faces are triangulated* (triangulating faces is an option when exporting in many programs). Simplified, low-polygon models work best; it may be necessary to model your 3D symbols specifically for use on a map just as you would design pixel-perfect icons in 2D.\n\nYour `.obj` and `.mtl` files should share the same base file name and you should not include the file extension when specifying the `modelName` parameter. Both the geometry and material files will be loaded automatically based on the `modelName`. Specify the directory where your models are located using the `modelDirectory` parameter.\n\n\n### Using `property` and `generator` rules for data-driven styling\nNotice that some parameters can be set using an optional `property` or `generator` rule. These are two different ways of setting per-feature styles based on your data.\n\nA `property` is an object of the form: `{ property: 'propertyName' }`. This lets you pull a value directly from the `properties` object of each GeoJSON `Feature`.\n\nA `generator` is an object of the form: `{ generator: generatorFunction }`. The `generatorFunction` is a function taking two parameters (`feature`, `index`) that will be run for each GeoJSON `Feature`. This lets you perform custom transformations to turn feature properties into a value. For example:\n\n```\nvar source = {\n  type: \"FeatureCollection\",\n  features: [\n    {\n      type: \"Feature\",\n      properties: {\n        heading: 30,\n      },\n      geometry: { type: \"Point\", coordinates: [-122, 37] }\n    },\n    ...\n  ]\n}\n\nthreebox.addSymbolLayer({\n  rotation: { generator: (feature, index) => (\n    new Three.Euler(0, 0, feature.properties['heading'] * Math.PI / 180), 'XYZ')\n  ) },\n  ...\n});\n```\n\n_(This example uses [ES6 'arrow function'](https://medium.com/ecmascript-2015/arrow-functions-bb08eeb11667) notation for the generator function, but a regular function declaration or reference would work too)_\n\nThis generator converts the `heading` property from degrees to radians and uses it to rotate the 3D symbol about its z-axis. (_Note: There are many ways to describe rotations in 3D space with [Euler angles](https://threejs.org/docs/#Reference/Math/Euler) being perhaps the most intuitive and the standard for a `threebox` `SymbolLayer3D`. The exact function used here will depend on your needs._)\n\n### Keys & updating data\nTo support **fast data updates** as well as **partial updates** of a 3D symbol layer, you can specify a `key` property that will be used to tie unique GeoJSON `Feature` objects to their corresponding object in the 3D scene graph. This way the 3D geometry needs only be created, destroyed, or updated when necessary.\n\nIt is best practice to specify the `key` property explicitly. If you don't, the array index of each feature is used as the key and you will not be able to perform reliable partial updates.\n\nFor example, assume each feature in your data has a unique `id` property and you create a new `SymbolLayer3D` with `key: { property: 'id' }`. You can then do the following to update your data:\n\n```\nsymbols.updateSourceData({\n  type: \"FeatureCollection\",\n  features: [\n    {\n      type: \"Feature\",\n      properties: {\n        heading: 45,\n        id: 'a_unique_feature'\n      },\n      geometry: {\n        type: \"Point\",\n        coordinates: [-123, 38]\n      }\n    }\n  ]\n});\n```\n\nThis will update a single feature in the collection while leaving all the others alone. The pre-existing `rotation`, `scale`, and `modelName` `property` or `generator` rules will automatically be applied again to calculate new values on the updated features.\n\nIf this behavior is not desired, `updateSourceData` takes an optional second parameter, `absolute`, that if set to `true` will delete any features not included in the updated GeoJSON.\n\nTo remove a feature, use the `SymbolLayer3D.removeFeature` method and specify the `key` of the feature you want to remove.\n"
  },
  {
    "path": "docs/Threebox.md",
    "content": "# Documentation\n---\n## Background\n\nThreebox works by adding a Three.js scene to Mapbox GL, via a custom layer. The custom layer API takes a fair amount of finessing to be useful, and Threebox tackles several hurdles to getting THREE and Mapbox to work together. \n\n<br>\n\n## Setup\n\n`var tb = new Threebox(map, mapboxGLContext[, options])`\n\nSets up a threebox scene inside a [Mapbox GL custom layer's onAdd function](https://www.mapbox.com/mapbox-gl-js/api/#customlayerinterface), which provides both inputs for this method. Automatically synchronizes the camera movement and events between Three.js and Mapbox GL JS. \n\n| option | required | default | type   | purpose                                                                                  |\n|-----------|----------|---------|--------|----------------------------------------------------------------------------------------------|\n| `defaultLights`    | no       | false      | boolean | Whether to add some default lighting to the scene. If no lighting added, most objects in the scene will render as black |\n| `passiveRendering`     | no       | true   | boolean  | Color of line. Unlike other Threebox objects, this color will render on screen precisely as specified, regardless of scene lighting |\n                                                              \n\n`tb.update()`\n\nRerender the threebox scene. Fired in the custom layer's `render` function.\n\n\n<br>\n\n# Objects\n\nThreebox offers convenience functions to construct meshes of various Three.js meshes, as well asl . Under the hood, they invoke a subclass of [THREE.Object3D](https://threejs.org/docs/#api/en/core/Object3D). \n\nObjects in Threebox fall under two broad varieties. *Static objects* don't move or change once they're placed, and used usually to display background or geographical features. They may have complex internal geometry, which are expressed primarily in lnglat coordinates. \n\nIn contrast, *dynamic objects* can move around the map, positioned by a single lnglat point. Their internal geometries are produced mainly in local scene units, whether through external obj files, or these convenience methods below.\n\n##Static objects\n\n###Line \n\n`tb.line(options)`\n\nAdds a line to the map, in full 3D space. Color renders independently of scene lighting. Internally, calls a [custom line shader](https://threejs.org/examples/?q=line#webgl_lines_fat).\n\n\n| option | required | default | type   | purpose                                                                                  |\n|-----------|----------|---------|--------|----------------------------------------------------------------------------------------------|\n| `geometry`    | yes       | NA      | lineGeometry | Array of lnglat coordinates to draw the line |\n| `color`     | no       | black   | color  | Color of line. Unlike other Threebox objects, this color will render on screen precisely as specified, regardless of scene lighting |\n| `width`     | no       | 1   | number  | Line width. Unlike other Threebox objects, this width is in units of display pixels, rather than meters or scene units. |\n| `opacity`     | no       | 1   | Number  | Line opacity |                                                                       \n\n\n<br>\n\n###Tube\n\n`tb.tube(options)`\n\nExtrude a tube along a specific lineGeometry, with an equilateral polygon as cross section. Internally uses a custom tube geometry generator.\n\n\n| option | required | default | type   | description                                                                                  |\n|-----------|----------|---------|--------|----------|\n| `geometry`    | yes       | NA      | lineGeometry | Line coordinates forming the tube backbone |\n| `radius`    | no       | 20      | number | Radius of the tube cross section, or half of tube width.|\n| `sides`  | no       | 8       | number | Number of facets along the tube. The higher, the more closely the tube will approximate a smooth cylinder. |\n| `material`     | no       | MeshLambertMaterial   | threeMaterial  | [THREE material](https://github.com/mrdoob/three.js/tree/master/src/materials) to use. Can be invoked with a text string, or a predefined material object via THREE itself.|   \n| `color`     | no       | black   | color  | Tube color. Ignored if `material` is a predefined `THREE.Material` object.  |\n| `opacity`     | no       | 1   | Number  | Tube opacity |                                                                                                                                                   \n\n\n<br>\n##Dynamic objects\n\n<br>\n\n###Sphere\n\n`tb.sphere(options)`\n\nAdd a sphere to the map. Internally, calls `THREE.Mesh` with a `THREE.SphereGeometry`.\n\n\n| option | required | default | type   | description                                                                                  |\n|-----------|----------|---------|--------|-------|\n| `radius`    | no       | 50      | number | Radius of sphere. |\n| `units`    | no       | scene      | string (\"scene\" or \"meters\") | Units with which to interpret `radius`. If meters, Threebox will also rescale the object with changes in latitude, to appear to scale with objects and geography nearby.|\n| sides  | no       | 8       | number | Number of width and height segments. The higher the number, the smoother the sphere. |\n| color     | no       | black   | color  | Color of sphere.                                                                             \n| `material`     | no       | MeshLambertMaterial   | threeMaterial  | [THREE material](https://github.com/mrdoob/three.js/tree/master/src/materials) to use. Can be invoked with a text string, or a predefined material object via THREE itself.|   \n\n<br>\n\n###External OBJ object\n\n`threebox.loadObj(options, callback(obj))`\n\nLoads an object via an external .obj and .mtl file. Note that unlike all the other object classes, this is asynchronous, and returns the object as an argument of the callback function. Internally, uses `THREE.OBJLoader` to fetch the .obj assets.\n\n\n| option | required | default | type   | description                                                                                  |\n|-----------|----------|---------|--------|------------|\n| `obj`  | yes       | NA       | string | URL path to asset's .obj file |\n| `mtl`  | yes       | NA       | string | URL path to asset's .mtl file |\n| `units`    | no       | scene      | string (\"scene\" or \"meters\") | Units with which to interpret the object's vertices. If meters, Threebox will also rescale the object with changes in latitude, to appear to scale with objects and geography nearby.|\n| `rotation`     | no       | 0   | rotationTransform  | Rotation of the object along the three axes, to align it to desired orientation before future rotations. Note that future rotations apply atop this transformation, and do not overwrite it. |\n| `scale`     | no       | 1   | scaleTransform  | Scale of the object along the three axes, to size it appropriately before future transformations. Note that future scaling applies atop this transformation, rather than overwriting it.|\n| `callback`     | yes       | NA   | function  | A function to run after the object loads. The first argument will be the successfully loaded object.\n                                                   \n<br>\n###Object3D\n\n`threebox.Object3D(obj)`\n\nAdd a `THREE.Object3D` instantiated elsewhere in THREE, to empower it with Threebox methods below. Unnecessary for objects instantiated with any methods above.\n\n| option | required | default | type   | description                                                                                  |\n|-----------|----------|---------|--------|------------|\n| `units`    | no       | scene      | string (\"scene\" or \"meters\") | Units with which to interpret the object's vertices. If meters, Threebox will also rescale the object with changes in latitude, to appear to scale with objects and geography nearby.|\n\n\n\n###Shared methods between dynamic objects\n\n`obj.setCoords(lnglat)`\n\nPositions the object at the desired coordinate, and resizes it appropriately if it was instantiated with `units: \"meters\"`. Can be called before adding object to the map.\n\n`obj.set(options)`\n\nBroad method to update object's position, rotation, and scale. Check out the Threebox Types section below for details\n\nOptions\n\n| option | required | default | type   | description                                                                                  |\n|-----------|----------|---------|--------|------------|\n| `coords`    | no       | NA      | `lnglat` | Position to which to move the object |\n| `rotation`    | no       | NA      | `rotationTransform` | Rotation(s) to set the object, in units of degrees |\n| `scale`    | no       | NA      | `scaleTransform` | Scale(s) to set the object, where 1 is the default scale |\n\n`obj.followPath(options(, callback) )`\n\nTranslate object along a specified path. Optional callback function to execute when animation finishes\n\n| option | required | default | type   | description                                                                                  |\n|-----------|----------|---------|--------|------------|\n| `path`    | yes       | NA      | lineGeometry | Path for the object to follow |\n| `duration`    | no       | 1000      | number | Duration to travel the path, in milliseconds |\n| `trackHeading`    | no       | true      | boolean | Rotate the object so that it stays aligned with the direction of travel, throughout the animation |\n\n\n\n####`obj.stop()`\n\nStops all of object's current animations.\n\n####`obj.duplicate()`\n\nReturns a clone of the object. Greatly improves performance when handling many identical objects, by reusing materials and geometries.\n\n<br>\n##Utilities\n\n`tb.projectToWorld(lnglat)`\n\nCalculate the corresponding `Vector3` for a given lnglat.\n\n\n`tb.unprojectFromWorld(Vector3)`\n\nCalculate the corresponding lnglat for a given `Vector3`.\n\n\n`tb.queryRenderedFeatures({x: number, y: number})`\n\nTakes an input of `xy` as an object with values representing screen coordinates (as returned by mapboxgl mouse events as `e.point`). Returns an array of threebox objects at that screen position.\n\n<br>\n\n## Threebox types\n\n<b>pointGeometry</b> `[longitude, latitude(, meters altitude)]`\n\nAn array of 2-3 numbers representing longitude, latitude, and optionally altitude (in meters). When altitude is omitted, it is assumed to be 0. When populating this from a GeoJSON Point, this array can be accessed at `point.geometry.coordinates`.  \n\nWhile altitude is not standardized in the GeoJSON specification, Threebox will accept it as such to position objects along the z-axis.   \n\n<br>\n\n####lineGeometry\n\n`[pointGeometry, pointGeometry ... pointGeometry]`\n\nAn array of at least two lnglat's, forming a line. When populating this from a GeoJSON Linestring, this array can be accessed at `linestring.geometry.coordinates`. \n\n<br>\n####rotationTransform\n\n`number` or `{x: number, y: number, z: number}`\n\nAngle(s) in degrees to rotate object. Can be expressed as either an object or number. \n\nThe object form takes three optional parameters along the three major axes: x is parallel to the equator, y parallel to longitudinal lines, and z perpendicular to the ground plane.\n\nThe number form rotates along the z axis, and equivalent to `{z: number}`.\n\n<br>\n\n####scaleTransform\n\n`number ` or `{x: number, y: number, z: number}`\n\nAmount to scale the object, where 1 is the default size. Can be expressed as either an object or number.\n\nThe three axes are identical to those of `rotationTransform`. However, expressing as number form scales all three axes by that amount.\n\n####threeMaterial\n\n`string` or instance of `THREE.Material()`\n\nDenotes the material used for an object. This can usually be customized further with `color` and `opacity` parameters in the same \n\n\nCan be expressed as a string to the corresponding material type (e.g. `\"MeshPhysicalMaterial\"` for `THREE.MeshPhysicalMaterial()`), or a prebuilt THREE material directly.\n\n##Using vanilla Three.js in Threebox\n\nThreebox implements many small affordances to make mapping run in Three.js quickly and precisely on a global scale. Whenever possible, use threebox methods to add, change, manage, and remove elements of the scene. Otherwise, here are some best practices:\n\n- Use `threebox.Object3D` to add custom objects to the scene\n- If you must interact directly with the THREE scene, add all objects to `threebox.world`.\n- `tb.projectToWorld` to convert lnglat to the corresponding `Vector3()`\n\n\n#Performance considerations\n\n- Use `obj.clone()` when adding many identical objects.\n"
  },
  {
    "path": "examples/Object3D.html",
    "content": "<!doctype html>\n<head>\n    <title>Threebox Basic Example</title>\n    <script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n    <script src=\"config.js\"></script>\n\n    <script src='https://api.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.js'></script>\n    <link href='https://api.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.css' rel='stylesheet' />\n    <style>\n        body, html { \n            width: 100%;\n            height: 100%;\n            margin: 0;\n        }\n        #map { \n            width: 100%;\n            height: 100%;\n        }\n    </style>\n</head>\n<body>\n    <div id='map' class='map'></div>\n\n    <script>\n    if(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n    \n    mapboxgl.accessToken = config.accessToken;\n    var origin = [-122.4340, 37.7353, 15000];\n\n    var map = new mapboxgl.Map({\n      container: 'map',\n      style: 'mapbox://styles/mapbox/light-v9',\n      center: origin,\n      zoom: 8,\n      pitch: 60,\n      bearing: 80\n    });\n\n\nmap.on('style.load', function() {\n\n    map.addLayer({\n        id: 'custom_layer',\n        type: 'custom',\n        onAdd: function(map, mbxContext){\n\n            tb = new Threebox(\n                map, \n                mbxContext,\n                {defaultLights: true}\n            );\n\n            // initialize geometry and material of our cube object\n            var geometry = new THREE.BoxGeometry(200, 200, 200);\n\n            var redMaterial = new THREE.MeshPhongMaterial( {\n                color: 0x009900, \n                side: THREE.DoubleSide\n            });\n\n            var cube = new THREE.Mesh(geometry, redMaterial);\n\n            cube = tb.Object3D({obj: cube})\n                .setCoords(origin)\n\n            tb.add(cube)\n        },\n        \n        render: function(gl, matrix){\n            tb.update();\n        }\n    });\n});\n\n\n    </script>\n</body>"
  },
  {
    "path": "examples/basic.html",
    "content": "<!doctype html>\n<head>\n\t\t<title>Sphere Example</title>\n\t\t<script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n\t\t<script src=\"config.js\"></script>\n\n\t\t<script src='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js'></script>\n\t\t<link href='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css' rel='stylesheet' />\n\t\t<style>\n\t\t\t\tbody, html { \n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t\t#map { \n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\theight: 100%;\n\t\t\t\t}\n\t\t</style>\n</head>\n<body>\n\t<div id='map' class='map'></div>\n\n\t<script>\n\n\t\tif(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n\t\t\n\t\tmapboxgl.accessToken = config.accessToken;\n\n\t\t//starting location for both map and eventual sphere\n\t\tvar origin = [-122.4340, 37.7353, 500];\n\n\t\tvar map = new mapboxgl.Map({\n\t\t\tcontainer: 'map',\n\t\t\tstyle: 'mapbox://styles/mapbox/light-v9',\n\t\t\tcenter: origin,\n\t\t\tzoom: 16,\n\t\t\tpitch: 60\n\t\t});\n\n\n\t\tmap.on('style.load', function() {\n\n\t\t\tmap.addLayer({\n\t\t\t\tid: 'custom_layer',\n\t\t\t\ttype: 'custom',\n\t\t\t\tonAdd: function(map, mbxContext){\n\n\t\t\t\t\ttb = new Threebox(\n\t\t\t\t\t\tmap, \n\t\t\t\t\t\tmbxContext,\n\t\t\t\t\t\t{defaultLights: true}\n\t\t\t\t\t);\n\n\t\t\t\t\t//instantiate a red sphere and position it at the origin lnglat\n\t\t\t\t\tvar sphere = tb.sphere({color: 'red', material: 'MeshStandardMaterial'})\n\t\t\t\t\t\t.setCoords(origin);\n\n\t\t\t\t\t// add sphere to the scene\n\t\t\t\t\ttb.add(sphere);\n\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\trender: function(gl, matrix){\n\t\t\t\t\ttb.update();\n\t\t\t\t}\n\t\t\t})\n\t\t});\n\n\t</script>\n</body>"
  },
  {
    "path": "examples/config_template.js",
    "content": "var config = {\n    accessToken: ''\n};"
  },
  {
    "path": "examples/line.html",
    "content": "<!doctype html>\n<head>\n\t<title>Line Example</title>\n\t<script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n\t<script src=\"config.js\"></script>\n\n\t<script src='https://api.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.js'></script>\n\t<link href='https://api.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.css' rel='stylesheet' />\n\t<style>\n\t\t\tbody, html { \n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tmargin: 0;\n\t\t\t\tbackground:black;\n\t\t\t}\n\t\t\t#map { \n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t</style>\n</head>\n<body>\n\t<div id='map' class='map'></div>\n\n\t<script>\n\n\n\t\t// this demo generates lineGeometry for 50 lines, and adds them as lines to the map with random widths, and colors based on latitudes of their unique endpoints\n\n\t\tif(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n\t\t\n\t\tmapboxgl.accessToken = config.accessToken;\n\n\t\tvar map = new mapboxgl.Map({\n\t\t\tcontainer: 'map',\n\t\t\tstyle: 'mapbox://styles/mapbox/dark-v9',\n\t\t\tzoom: 2,\n\t\t\tpitch:45\n\t\t});\n\n\t\t// randomly generate some line arcs (not essential for understanding this demo)\n\t\t\n\t\tvar lines = new Array();\n\t\tvar arcSegments = 25;\n\t\tvar lineQuantity = 50;\n\n\t\tfor (var i = 0; i < lineQuantity; i++){\n\n\t\t\tvar line = new Array();\n\t\t\tvar destination = [300*(Math.random()-0.5), 140*(Math.random()-0.5)];\n\t\t\tvar maxElevation = Math.pow(Math.abs(destination[0]*destination[1]), 0.5) * 80000;\n\n\t\t\tvar increment = destination.map(function(direction){\n\t\t\t\treturn direction/arcSegments;\n\t\t\t})\n\n\t\t\tfor (var l = 0; l<=arcSegments; l++){\n\t\t\t\tvar waypoint = increment.map(function(direction){\n\t\t\t\t\treturn direction * l\n\t\t\t\t})\n\n\t\t\t\tvar waypointElevation = Math.sin(Math.PI*l/arcSegments) * maxElevation;\n\n\t\t\t\twaypoint.push(waypointElevation);\n\t\t\t\tline.push(waypoint);\n\t\t\t}\n\n\t\t\tlines.push(line)\n\t\t}\n\n\t\tconsole.log('lineGeometries of the lines: ', lines);\n\n\t\t// instantiate threebox\n\n\t\tmap.on('style.load', function() {\n\n\t\t\tmap.addLayer({\n\t\t\t\tid: 'custom_layer',\n\t\t\t\ttype: 'custom',\n\t\t\t\tonAdd: function(map, mbxContext){\n\n\t\t\t\t\ttb = new Threebox(\n\t\t\t\t\t\tmap, \n\t\t\t\t\t\tmbxContext,\n\t\t\t\t\t\t{defaultLights: true}\n\t\t\t\t\t);\n\n\t\t\t\t\tfor (line of lines) {\n\t\t\t\t\t\tvar lineOptions = {\n\t\t\t\t\t\t\tgeometry: line,\n\t\t\t\t\t\t\tcolor: (line[1][1]/180) * 0xffffff, // color based on latitude of endpoint\n\t\t\t\t\t\t\twidth: Math.random() + 1 // random width between 1 and 2\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlineMesh = tb.line(lineOptions);\n\n\t\t\t\t\t\ttb.add(lineMesh)\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\trender: function(gl, matrix){\n\t\t\t\t\t\ttb.update();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\n\t</script>\n</body>"
  },
  {
    "path": "examples/logistics.html",
    "content": "<!doctype html>\n<head>\n\t<title>Animated truck</title>\n\t<script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n\t<script src=\"config.js\"></script>\n\t<script src='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js'></script>\n\t<link href='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css' rel='stylesheet' />\n\t<script src=\"https://d3js.org/d3.v5.min.js\"></script>\n\t<style>\n\t\tbody, html { \n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmargin: 0;\n\t\t\tbackground:black;\n\t\t}\n\t\t#map { \n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\t#explainer {\n\t\t\tz-index:99;\n\t\t}\n\t</style>\n</head>\n<body>\n\t<div id='map' class='map'></div>\n\t<div id='explainer'>Click on the map to drive the truck there</div>\n\t<script>\n\n\n\t\t// This example downloads a truck model from an external OBJ/MTL file, adds it to the map, and drives it around via paths fetched from the Mapbox Directions API\n\n\t\tif(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n\t\t\n\t\tmapboxgl.accessToken = config.accessToken;\n\n\t\tvar origin = [-122.4340, 37.7353];\n\t\tvar destination, line;\n\t\tvar truck;\n\n\t\tvar map = new mapboxgl.Map({\n\t\t  container: 'map',\n\t\t  style: 'mapbox://styles/mapbox/dark-v9',\n\t\t  center: origin,\n\t\t  zoom: 16,\n\t\t  pitch:60,\n\t\t  bearing:90\n\t\t});\n\n\t\tmap.on('style.load', function() {\n\n\t\t\tmap\n\t\t\t.addLayer({\n\t\t\t\tid: 'custom_layer',\n\t\t\t\ttype: 'custom',\n\t\t\t\trenderingMode: '3d',\n\t\t\t\tonAdd: function(map, mbxContext){\n\n\t\t\t\t\twindow.tb = new Threebox(\n\t\t\t\t\t\tmap, \n\t\t\t\t\t\tmbxContext,\n\t\t\t\t\t\t{defaultLights: true}\n\t\t\t\t\t);\n\n\t\t\t\t\t// import truck from an external obj file, scaling up its size 10x\n\t\t\t\t\tvar options = {\n\t\t\t\t\t\tobj: 'models/Truck.obj',\n\t\t\t\t\t\tmtl: 'models/Truck.mtl',\n\t\t\t\t\t\tscale: 10\n\t\t\t\t\t}\n\n\t\t\t\t\ttb.loadObj(options, function(model) {\n\n\t\t\t\t\t\ttruck = model.setCoords(origin);\n\t\t\t\t\t\ttb.add(truck);                        \n\t\t\t\t\t})\n\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\trender: function(gl, matrix){\n\t\t\t\t\ttb.update();\n\t\t\t\t}\n\t\t\t});\n\t\t})\n\t\t.on('click', function(e){\n\t\t\tvar pt = [e.lngLat.lng, e.lngLat.lat];\n\t\t\ttravelPath(pt);\n\t\t})\n\n\n\t\tfunction travelPath(destination){\n\n\t\t\t// request directions. See https://docs.mapbox.com/api/navigation/#directions for details\n\n\t\t\tvar url = \"https://api.mapbox.com/directions/v5/mapbox/driving/\"+[origin, destination].join(';')+\"?geometries=geojson&access_token=\" + config.accessToken\n\n\n\t\t\tfetchFunction(url, function(data){\n\n\t\t\t\t// extract path geometry from callback geojson, and set duration of travel\n\t\t\t\tvar options = {\n\t\t\t\t\tpath: data.routes[0].geometry.coordinates,\n\t\t\t\t\tduration: 10000\n\t\t\t\t}\n\n\t\t\t\t// start the truck animation with above options, and remove the line when animation ends\n\t\t\t\ttruck.followPath(\n\t\t\t\t\toptions,\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\ttb.remove(line);\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// set up geometry for a line to be added to map, lofting it up a bit for *style*\n\t\t\t\tvar lineGeometry = options.path\n\t\t\t\t\t.map(function(coordinate){\n\t\t\t\t\t\treturn coordinate.concat([15])\n\t\t\t\t\t})\n\n\t\t\t\t// create and add line object\n\t\t\t\tline = tb.line({\n\t\t\t\t\tgeometry: lineGeometry,\n\t\t\t\t\twidth: 5,\n\t\t\t\t\tcolor: 'steelblue'\n\t\t\t\t})\n\n\t\t\t\ttb.add(line);\n\n\t\t\t\t// set destination as the new origin, for the next trip\n\t\t\t\torigin = destination;\n\n\t\t\t})\n\t\t}\n\t\t\n\t\t//convenience function for fetch\n\n\t\tfunction fetchFunction(url, cb) {\n\t\t\tfetch(url)\n\t\t\t\t.then(\n\t\t\t\t\tfunction(response){\n\t\t\t\t\t\tif (response.status === 200) {\n\t\t\t\t\t\t\tresponse.json()\n\t\t\t\t\t\t\t\t.then(function(data){\n\t\t\t\t\t\t\t\t\tcb(data)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t}\n\t</script>\n</body>"
  },
  {
    "path": "examples/mercator.html",
    "content": "<!doctype html>\n<head>\n    <title>Mercator projection</title>\n    <script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n    <script src=\"config.js\"></script>\n\n    <script src='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js'></script>\n    <link href='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css' rel='stylesheet' />\n    <style>\n        body, html { \n            width: 100%;\n            height: 100%;\n            margin: 0;\n        }\n        #map { \n            width: 100%;\n            height: 100%;\n        }\n    </style>\n</head>\n<body>\n    <div id='map' class='map'></div>\n\n    <script>\n\n        // this example demonstrates the use of duplicate(), to replicate a sphere many times with minimal performance implications. Also shows the distortion effects of mercator: despite their appearance, all spheres have a radius of 500km, at an altitude of 2000km.\n\n        if(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n        \n        mapboxgl.accessToken = config.accessToken;\n\n        var map = new mapboxgl.Map({\n          container: 'map',\n          style: 'mapbox://styles/mapbox/light-v9',\n          zoom: 0,\n          pitch: 45,\n          bearing: 45\n        });\n\n\n        map.on('style.load', function() {\n\n            map.addLayer({\n                id: 'custom_layer',\n                type: 'custom',\n                onAdd: function(map, mbxContext){\n\n                    window.tb = new Threebox(\n                        map, \n                        mbxContext,\n                        {defaultLights: true}\n                    );\n\n                    // generate 100 points around the world, at random locations but the same altitude\n                    var randomPoints = [];\n\n                    for (var i = 0; i < 100; i++){\n\n                        var point = [\n                            360 * (Math.random()-0.5), \n                            160 * (Math.random()-0.5),\n                            2000000\n                        ]\n                        \n                        randomPoints.push(point);\n                    }\n\n                    // build a template sphere sized in meters, such that it will appear to scale with its local surroundings\n                    sphereTemplate = tb.sphere(\n                        {\n                            radius: 500000,\n                            units: 'meters',\n                            sides: 120,\n                            color: 'purple',\n                            material: 'MeshPhysicalMaterial'\n                        }\n                    )\n\n                    // for best performance, clone the template sphere for each point in randomPoint\n\n                    randomPoints.forEach(function(pt){\n\n                        newSphere = sphereTemplate\n                            .duplicate()\n                            .setCoords(pt);\n\n                        tb.add(newSphere);\n\n                    })\n\n                },\n                \n                render: function(gl, matrix){\n                    tb.update();\n                }\n            });\n        });\n\n    </script>\n</body>"
  },
  {
    "path": "examples/models/Truck.mtl",
    "content": "# Blender MTL File: 'Truck.blend'\n# Material Count: 7\n\nnewmtl Black\nNs 96.078431\nKa 1.000000 1.000000 1.000000\nKd 0.013347 0.013347 0.013347\nKs 0.500000 0.500000 0.500000\nKe 0.000000 0.000000 0.000000\nNi 1.000000\nd 1.000000\nillum 2\n\nnewmtl Cream\nNs 96.078431\nKa 1.000000 1.000000 1.000000\nKd 0.565467 0.640000 0.496259\nKs 0.500000 0.500000 0.500000\nKe 0.000000 0.000000 0.000000\nNi 1.000000\nd 1.000000\nillum 2\n\nnewmtl Silver\nNs 96.078431\nKa 1.000000 1.000000 1.000000\nKd 0.385546 0.385546 0.385546\nKs 0.500000 0.500000 0.500000\nKe 0.000000 0.000000 0.000000\nNi 1.000000\nd 1.000000\nillum 2\n\nnewmtl Wheel_Rim\nNs 96.078431\nKa 1.000000 1.000000 1.000000\nKd 0.640000 0.640000 0.640000\nKs 0.500000 0.500000 0.500000\nKe 0.000000 0.000000 0.000000\nNi 1.000000\nd 1.000000\nillum 2\n\nnewmtl Wheels\nNs 96.078431\nKa 1.000000 1.000000 1.000000\nKd 0.047401 0.047401 0.047401\nKs 0.500000 0.500000 0.500000\nKe 0.000000 0.000000 0.000000\nNi 1.000000\nd 1.000000\nillum 2\n\nnewmtl White\nNs 96.078431\nKa 1.000000 1.000000 1.000000\nKd 0.800000 0.800000 0.800000\nKs 0.500000 0.500000 0.500000\nKe 0.000000 0.000000 0.000000\nNi 1.000000\nd 1.000000\nillum 2\n\nnewmtl Window\nNs 96.078431\nKa 1.000000 1.000000 1.000000\nKd 0.362586 0.585789 0.640000\nKs 0.500000 0.500000 0.500000\nKe 0.000000 0.000000 0.000000\nNi 1.000000\nd 1.000000\nillum 2\n"
  },
  {
    "path": "examples/models/Truck.obj",
    "content": "# Blender v2.78 (sub 0) OBJ File: 'Truck.blend'\n# www.blender.org\nmtllib Truck.mtl\no Truck_Cube\nv 0.298667 0.276472 0.014476\nv 0.298667 1.006751 0.014476\nv 0.298667 0.276472 -1.584185\nv 0.298667 1.006751 -1.584185\nv 0.298667 0.100000 0.610000\nv 0.284365 0.699252 0.408889\nv 0.298667 0.100000 0.020000\nv 0.284365 0.700000 0.032540\nv 0.298667 0.806751 -1.584185\nv 0.298667 0.806751 0.014476\nv 0.298667 0.906751 -1.584185\nv 0.298667 0.906751 0.014476\nv 0.298667 0.849813 0.114476\nv 0.298667 0.863689 0.064476\nv 0.298667 0.849813 0.624476\nv 0.298667 0.863689 0.624476\nv 0.291516 0.400000 0.026270\nv 0.291516 0.400188 0.610280\nv 0.143127 0.700000 0.032540\nv 0.143127 0.100000 0.020000\nv 0.143127 0.699252 0.408889\nv 0.103127 0.100000 0.610000\nv 0.143127 0.400188 0.610280\nv 0.143127 0.400000 0.026270\nv 0.295091 0.266667 0.023135\nv 0.295930 0.227554 0.610000\nv 0.103127 0.215089 0.610000\nv 0.143127 0.266667 0.023135\nv 0.143127 0.100000 -1.378433\nv 0.143127 0.266667 -1.378433\nv 0.261053 0.076899 -1.123101\nv 0.261053 0.067330 -1.100000\nv 0.261053 0.076899 -1.076899\nv 0.261053 0.100000 -1.067330\nv 0.261053 0.123101 -1.076899\nv 0.261053 0.132670 -1.100000\nv 0.261053 0.100000 -1.132670\nv 0.261053 0.123101 -1.123101\nv 0.281053 0.076899 -1.123101\nv 0.281053 0.067330 -1.100000\nv 0.281053 0.076899 -1.076899\nv 0.281053 0.100000 -1.067330\nv 0.281053 0.123101 -1.076899\nv 0.281053 0.132670 -1.100000\nv 0.281053 0.100000 -1.132670\nv 0.281053 0.123101 -1.123101\nv 0.157302 0.100000 0.090585\nv 0.157302 0.177368 0.122632\nv 0.157302 0.209415 0.200000\nv 0.157302 0.177368 0.277368\nv 0.157302 0.100000 0.309415\nv 0.157302 0.022632 0.277368\nv 0.157302 -0.009415 0.200000\nv 0.157302 0.022632 0.122632\nv 0.278021 0.100000 0.090585\nv 0.278021 0.177368 0.122632\nv 0.278021 0.209415 0.200000\nv 0.278021 0.177368 0.277368\nv 0.278021 0.100000 0.309415\nv 0.278021 0.022632 0.277368\nv 0.278021 -0.009415 0.200000\nv 0.278021 0.022632 0.122632\nv 0.298667 0.849813 0.637553\nv 0.298667 0.863689 0.637553\nv 0.298667 0.880016 0.624476\nv 0.298667 0.880016 0.637553\nv 0.103127 0.215089 0.492665\nv 0.298667 0.100000 0.327395\nv 0.298667 0.100000 0.072364\nv 0.143127 0.226797 0.198574\nv 0.143127 0.187628 0.293449\nv 0.143127 0.100000 0.072364\nv 0.143127 0.100000 0.327395\nv 0.296787 0.187628 0.293449\nv 0.295948 0.226797 0.198574\nv 0.296694 0.191980 0.112403\nv 0.143127 0.191980 0.112403\nv 0.143127 0.100000 0.198574\nv 0.284365 0.700000 0.055217\nv 0.291516 0.400000 0.051469\nv 0.143127 0.700000 0.088920\nv 0.295091 0.266667 0.088920\nv 0.284907 0.677322 0.077668\nv 0.284907 0.677322 0.397832\nv 0.290974 0.418120 0.567529\nv 0.290974 0.418120 0.074488\nv 0.275031 0.677322 0.077668\nv 0.275031 0.677322 0.397832\nv 0.281098 0.418120 0.567529\nv 0.281098 0.418120 0.074488\nv 0.261874 0.677753 0.423366\nv 0.268114 0.419217 0.597465\nv 0.143127 0.419217 0.597465\nv 0.143127 0.677753 0.423366\nv 0.143127 0.677322 0.412451\nv 0.143127 0.418120 0.586999\nv 0.261874 0.677322 0.412451\nv 0.268114 0.418120 0.586999\nv 0.292222 0.373741 0.180184\nv 0.293120 0.340169 0.180097\nv 0.292220 0.373725 0.089181\nv 0.293120 0.340216 0.089187\nv 0.280037 0.373415 0.180184\nv 0.280935 0.339842 0.180097\nv 0.280035 0.373399 0.089181\nv 0.280935 0.339890 0.089187\nv 0.280205 0.367145 0.173897\nv 0.280767 0.346113 0.173843\nv 0.280203 0.367132 0.095442\nv 0.280768 0.346155 0.095446\nv 0.280767 0.346124 0.154165\nv 0.280205 0.367142 0.154165\nv 0.286854 0.367323 0.173897\nv 0.287415 0.346291 0.173843\nv 0.287415 0.346301 0.154165\nv 0.286853 0.367320 0.154165\nv 0.296457 0.367579 0.173897\nv 0.297018 0.346547 0.173843\nv 0.297018 0.346558 0.154165\nv 0.296456 0.367576 0.154165\nv 0.287415 0.346302 0.095446\nv 0.286853 0.367320 0.095442\nv 0.297018 0.346559 0.095446\nv 0.296456 0.367577 0.095442\nv 0.134539 0.252996 0.007801\nv 0.134539 0.293932 0.007801\nv 0.134539 0.252996 -1.366103\nv 0.134539 0.293932 -1.366103\nv 0.280657 0.988741 -1.584185\nv 0.280657 0.806751 -1.584185\nv 0.280657 0.294482 -1.584185\nv 0.280657 0.906751 -1.584185\nv 0.231746 0.895578 -1.570077\nv 0.231746 0.910831 -1.570077\nv 0.231746 0.895578 -1.592661\nv 0.231746 0.910831 -1.592661\nv 0.291788 0.895578 -1.570077\nv 0.291788 0.910831 -1.570077\nv 0.291788 0.895578 -1.592661\nv 0.291788 0.910831 -1.592661\nv 0.231746 0.366770 -1.570077\nv 0.231746 0.382023 -1.570077\nv 0.231746 0.366770 -1.592661\nv 0.231746 0.382023 -1.592661\nv 0.291788 0.366770 -1.570077\nv 0.291788 0.382023 -1.570077\nv 0.291788 0.366770 -1.592661\nv 0.291788 0.382023 -1.592661\nv 0.006417 1.006751 -1.584185\nv 0.006417 0.276472 0.014476\nv 0.006417 0.806751 0.014476\nv 0.006417 0.906751 0.014476\nv 0.006417 0.849813 0.114476\nv 0.006417 0.863689 0.064476\nv 0.006417 0.849813 0.624476\nv 0.006417 0.863689 0.624476\nv 0.006417 0.849813 0.637553\nv 0.006417 0.863689 0.637553\nv 0.006417 0.880016 0.624476\nv 0.006417 0.880016 0.637553\nv 0.006417 0.276472 -1.584185\nv 0.006417 1.006751 0.014476\nv 0.006417 0.988741 -1.584185\nv 0.006417 0.294482 -1.584185\nv 0.006417 0.806751 -1.584185\nv 0.006417 0.906751 -1.584185\nv 0.006417 0.294482 -1.580206\nv 0.006417 0.806751 -1.580206\nv 0.006417 0.988741 -1.580206\nv 0.006417 0.906751 -1.580206\nv 0.006417 0.604103 -1.584185\nv 0.006417 0.622964 -1.584185\nv 0.006417 0.604103 -1.580206\nv 0.006417 0.622964 -1.580206\nv 0.055292 0.622964 -1.584184\nv 0.055292 0.604103 -1.584184\nv 0.007139 0.604825 -1.584185\nv 0.007139 0.622242 -1.584185\nv 0.054570 0.622242 -1.584184\nv 0.054570 0.604825 -1.584184\nv 0.007139 0.604825 -1.572059\nv 0.007139 0.622242 -1.572059\nv 0.054570 0.622242 -1.572058\nv 0.054570 0.604825 -1.572058\nv 0.040830 0.622242 -1.572058\nv 0.040830 0.604825 -1.572058\nv 0.041681 0.621391 -1.572058\nv 0.053718 0.621391 -1.572058\nv 0.053718 0.605676 -1.572058\nv 0.041681 0.605676 -1.572058\nv 0.041681 0.621391 -1.577313\nv 0.053718 0.621391 -1.577312\nv 0.053718 0.605676 -1.577312\nv 0.041681 0.605676 -1.577313\nv 0.041681 0.621391 -1.583780\nv 0.053718 0.621391 -1.583780\nv 0.053718 0.605676 -1.583780\nv 0.041681 0.605676 -1.583780\nv 0.009750 0.605677 -1.577313\nv 0.009750 0.621391 -1.577313\nv 0.009750 0.605677 -1.583780\nv 0.009750 0.621391 -1.583780\nv 0.223972 0.227554 0.610000\nv 0.223972 0.100000 0.610000\nv 0.297298 0.163777 0.610000\nv 0.249569 0.100000 0.610000\nv 0.103127 0.163777 0.610000\nv 0.259951 0.227554 0.610000\nv 0.183549 0.227554 0.610000\nv 0.154931 0.100000 0.610000\nv 0.223972 0.189119 0.610000\nv 0.160087 0.189119 0.610000\nv 0.166959 0.172529 0.610000\nv 0.183549 0.212582 0.610000\nv 0.200140 0.205710 0.610000\nv 0.183549 0.165657 0.610000\nv 0.200140 0.172529 0.610000\nv 0.207012 0.189119 0.610000\nv 0.166959 0.205710 0.610000\nv 0.283204 0.188989 0.610000\nv 0.276527 0.173058 0.610000\nv 0.260540 0.166515 0.610000\nv 0.260730 0.211653 0.610000\nv 0.276661 0.204976 0.610000\nv 0.238066 0.189179 0.610000\nv 0.244609 0.173192 0.610000\nv 0.244743 0.205110 0.610000\nv 0.260635 0.189105 0.600800\nv 0.260540 0.166515 0.600800\nv 0.260730 0.211653 0.600800\nv 0.283204 0.188989 0.600800\nv 0.238066 0.189179 0.600800\nv 0.183549 0.189119 0.600800\nv 0.183549 0.165657 0.600800\nv 0.183549 0.212582 0.600800\nv 0.207012 0.189119 0.600800\nv 0.160087 0.189119 0.600800\nv 0.166959 0.172529 0.600800\nv 0.200140 0.205710 0.600800\nv 0.200140 0.172529 0.600800\nv 0.166959 0.205710 0.600800\nv 0.276527 0.173058 0.600800\nv 0.276661 0.204976 0.600800\nv 0.244609 0.173192 0.600800\nv 0.244743 0.205110 0.600800\nv 0.296248 0.212755 0.492665\nv 0.298667 0.100000 0.492665\nv 0.103127 0.100000 0.492665\nv 0.103127 0.163777 0.492665\nv 0.100500 0.102023 0.614248\nv 0.100500 0.213065 0.614248\nv 0.100500 0.102023 0.488417\nv 0.100500 0.213065 0.488417\nv 0.094915 0.207480 0.614248\nv 0.094915 0.107609 0.614248\nv 0.094915 0.207480 0.609985\nv 0.094915 0.107609 0.609985\nv 0.136002 0.137354 0.610000\nv 0.223972 0.137354 0.610000\nv 0.103127 0.137354 0.610000\nv 0.234504 0.137354 0.610000\nv 0.297865 0.137354 0.610000\nv 0.154931 0.137354 0.610000\nv 0.287347 0.137354 0.610000\nv 0.249569 0.137354 0.610000\nv 0.211698 0.137354 0.610000\nv 0.293858 0.133260 0.610000\nv 0.287347 0.133260 0.610000\nv 0.253663 0.133260 0.610000\nv 0.253663 0.104094 0.610000\nv 0.294484 0.104094 0.610000\nv 0.234504 0.133260 0.610000\nv 0.223972 0.133260 0.610000\nv 0.211698 0.133260 0.610000\nv 0.159025 0.133260 0.610000\nv 0.159025 0.104094 0.610000\nv 0.223972 0.104094 0.610000\nv 0.245476 0.104094 0.610000\nv 0.245476 0.133260 0.610000\nv 0.136002 0.133260 0.610000\nv 0.107221 0.133260 0.610000\nv 0.107221 0.104094 0.610000\nv 0.150838 0.104094 0.610000\nv 0.150838 0.133260 0.610000\nv 0.293858 0.133260 0.600000\nv 0.287347 0.133260 0.600000\nv 0.294484 0.104094 0.600000\nv 0.253663 0.133260 0.600000\nv 0.253663 0.104094 0.600000\nv 0.234504 0.133260 0.600000\nv 0.223972 0.133260 0.600000\nv 0.245476 0.133260 0.600000\nv 0.211698 0.133260 0.600000\nv 0.159025 0.133260 0.600000\nv 0.159025 0.104094 0.600000\nv 0.223972 0.104094 0.600000\nv 0.245476 0.104094 0.600000\nv 0.136002 0.133260 0.600000\nv 0.107221 0.133260 0.600000\nv 0.150838 0.133260 0.600000\nv 0.107221 0.104094 0.600000\nv 0.150838 0.104094 0.600000\nv 0.293064 0.339637 0.610182\nv 0.293712 0.314296 0.610141\nv 0.293071 0.339637 0.568244\nv 0.293719 0.314296 0.568244\nv 0.236061 0.314296 0.610139\nv 0.236061 0.339637 0.610181\nv 0.293080 0.338382 0.610181\nv 0.293103 0.338382 0.569500\nv 0.293696 0.315551 0.610142\nv 0.293687 0.315551 0.569500\nv 0.237317 0.315551 0.610141\nv 0.237317 0.338382 0.610179\nv 0.290275 0.336639 0.608109\nv 0.290789 0.317904 0.608076\nv 0.290294 0.336640 0.571772\nv 0.290789 0.317293 0.571772\nv 0.239062 0.317293 0.608075\nv 0.239062 0.336639 0.608107\nv 0.290283 0.336029 0.608108\nv 0.290310 0.336029 0.572382\nv 0.290797 0.317293 0.608076\nv 0.290773 0.317904 0.572382\nv 0.239673 0.317904 0.608076\nv 0.239673 0.336029 0.608106\nv 0.295945 0.339101 0.612150\nv 0.296623 0.314832 0.612107\nv 0.295981 0.339102 0.572318\nv 0.296602 0.314831 0.572318\nv 0.240057 0.314832 0.612107\nv 0.240057 0.339101 0.612147\nv 0.143127 0.266667 -0.309708\nv 0.143127 0.266667 -0.516516\nv 0.143127 0.100000 -0.309708\nv 0.143127 0.100000 -0.516979\nv 0.143127 0.266667 -0.615822\nv 0.143127 0.266667 -0.872679\nv 0.143127 0.100000 -0.616083\nv 0.143127 0.100000 -0.872810\nv 0.143127 0.198619 -0.516705\nv 0.143127 0.198619 -0.309708\nv 0.143127 0.242627 -0.872698\nv 0.143127 0.242627 -0.615860\nv 0.228681 0.100000 -0.309708\nv 0.228681 0.100000 -0.516979\nv 0.255569 0.100000 -0.616083\nv 0.255569 0.100000 -0.872810\nv 0.228681 0.198619 -0.516705\nv 0.228681 0.198619 -0.309708\nv 0.255569 0.242627 -0.872698\nv 0.255569 0.242627 -0.615860\nv 0.278021 0.156375 0.143625\nv 0.278021 0.100000 0.120274\nv 0.278021 0.179726 0.200000\nv 0.278021 0.156375 0.256375\nv 0.278021 0.100000 0.279726\nv 0.278021 0.043625 0.256375\nv 0.278021 0.020274 0.200000\nv 0.278021 0.043625 0.143625\nv 0.278021 0.153714 0.146286\nv 0.278021 0.100000 0.124037\nv 0.278021 0.175963 0.200000\nv 0.278021 0.153714 0.253714\nv 0.278021 0.100000 0.275963\nv 0.278021 0.046286 0.253714\nv 0.278021 0.024037 0.200000\nv 0.278021 0.046286 0.146286\nv 0.281053 0.155560 0.144440\nv 0.281053 0.100000 0.121426\nv 0.281053 0.178574 0.200000\nv 0.281053 0.155560 0.255560\nv 0.281053 0.100000 0.278574\nv 0.281053 0.044440 0.255560\nv 0.281053 0.021426 0.200000\nv 0.281053 0.044440 0.144440\nv 0.281053 0.133173 0.166827\nv 0.281053 0.100000 0.153086\nv 0.281053 0.146914 0.200000\nv 0.281053 0.133173 0.233173\nv 0.281053 0.100000 0.246914\nv 0.281053 0.066827 0.233173\nv 0.281053 0.053086 0.200000\nv 0.281053 0.066827 0.166827\nv 0.281053 0.047990 0.252010\nv 0.281053 0.028368 0.204639\nv 0.281053 0.049986 0.204639\nv 0.281053 0.063276 0.236724\nv 0.281053 0.095361 0.250014\nv 0.281053 0.095361 0.271632\nv 0.281053 0.152010 0.252010\nv 0.281053 0.104639 0.271632\nv 0.281053 0.104639 0.250014\nv 0.281053 0.136724 0.236724\nv 0.281053 0.150014 0.204639\nv 0.281053 0.171632 0.204639\nv 0.281053 0.152010 0.147990\nv 0.281053 0.171632 0.195361\nv 0.281053 0.150014 0.195361\nv 0.281053 0.136724 0.163276\nv 0.281053 0.104639 0.149986\nv 0.281053 0.104639 0.128368\nv 0.281053 0.047990 0.147990\nv 0.281053 0.095361 0.128368\nv 0.281053 0.095361 0.149986\nv 0.281053 0.063276 0.163276\nv 0.281053 0.049986 0.195361\nv 0.281053 0.028368 0.195361\nv 0.261053 0.028368 0.204639\nv 0.261053 0.047990 0.252010\nv 0.261053 0.095361 0.271632\nv 0.261053 0.049986 0.204639\nv 0.261053 0.063276 0.236724\nv 0.261053 0.095361 0.250014\nv 0.261053 0.104639 0.271632\nv 0.261053 0.152010 0.252010\nv 0.261053 0.171632 0.204639\nv 0.261053 0.104639 0.250014\nv 0.261053 0.136724 0.236724\nv 0.261053 0.150014 0.204639\nv 0.261053 0.171632 0.195361\nv 0.261053 0.152010 0.147990\nv 0.261053 0.104639 0.128368\nv 0.261053 0.150014 0.195361\nv 0.261053 0.136724 0.163276\nv 0.261053 0.104639 0.149986\nv 0.261053 0.095361 0.128368\nv 0.261053 0.047990 0.147990\nv 0.261053 0.028368 0.195361\nv 0.261053 0.095361 0.149986\nv 0.261053 0.063276 0.163276\nv 0.261053 0.049986 0.195361\nv 0.281053 0.123101 0.176899\nv 0.281053 0.100000 0.167330\nv 0.281053 0.132670 0.200000\nv 0.281053 0.123101 0.223101\nv 0.281053 0.100000 0.232670\nv 0.281053 0.076899 0.223101\nv 0.281053 0.067330 0.200000\nv 0.281053 0.076899 0.176899\nv 0.261053 0.123101 0.176899\nv 0.261053 0.100000 0.167330\nv 0.261053 0.132670 0.200000\nv 0.261053 0.123101 0.223101\nv 0.261053 0.100000 0.232670\nv 0.261053 0.076899 0.223101\nv 0.261053 0.067330 0.200000\nv 0.261053 0.076899 0.176899\nv 0.261053 0.049986 -1.104639\nv 0.261053 0.063276 -1.136724\nv 0.261053 0.095361 -1.150014\nv 0.261053 0.028368 -1.104639\nv 0.261053 0.047990 -1.152010\nv 0.261053 0.095361 -1.171632\nv 0.261053 0.104639 -1.150014\nv 0.261053 0.136724 -1.136724\nv 0.261053 0.150014 -1.104639\nv 0.261053 0.104639 -1.171632\nv 0.261053 0.152010 -1.152010\nv 0.261053 0.171632 -1.104639\nv 0.261053 0.150014 -1.095361\nv 0.261053 0.136724 -1.063276\nv 0.261053 0.104639 -1.049986\nv 0.261053 0.171632 -1.095361\nv 0.261053 0.152010 -1.047990\nv 0.261053 0.104639 -1.028368\nv 0.261053 0.095361 -1.049986\nv 0.261053 0.063276 -1.063276\nv 0.261053 0.049986 -1.095361\nv 0.261053 0.095361 -1.028368\nv 0.261053 0.047990 -1.047990\nv 0.261053 0.028368 -1.095361\nv 0.281053 0.028368 -1.104639\nv 0.281053 0.049986 -1.104639\nv 0.281053 0.063276 -1.136724\nv 0.281053 0.095361 -1.150014\nv 0.281053 0.095361 -1.171632\nv 0.281053 0.047990 -1.152010\nv 0.281053 0.104639 -1.171632\nv 0.281053 0.104639 -1.150014\nv 0.281053 0.136724 -1.136724\nv 0.281053 0.150014 -1.104639\nv 0.281053 0.171632 -1.104639\nv 0.281053 0.152010 -1.152010\nv 0.281053 0.171632 -1.095361\nv 0.281053 0.150014 -1.095361\nv 0.281053 0.136724 -1.063276\nv 0.281053 0.104639 -1.049986\nv 0.281053 0.104639 -1.028368\nv 0.281053 0.152010 -1.047990\nv 0.281053 0.095361 -1.028368\nv 0.281053 0.095361 -1.049986\nv 0.281053 0.063276 -1.063276\nv 0.281053 0.049986 -1.095361\nv 0.281053 0.028368 -1.095361\nv 0.281053 0.047990 -1.047990\nv 0.281053 0.066827 -1.133173\nv 0.281053 0.053086 -1.100000\nv 0.281053 0.066827 -1.066827\nv 0.281053 0.100000 -1.053086\nv 0.281053 0.133173 -1.066827\nv 0.281053 0.146914 -1.100000\nv 0.281053 0.100000 -1.146914\nv 0.281053 0.133173 -1.133173\nv 0.281053 0.044440 -1.155560\nv 0.281053 0.021426 -1.100000\nv 0.281053 0.044440 -1.044440\nv 0.281053 0.100000 -1.021426\nv 0.281053 0.155560 -1.044440\nv 0.281053 0.178574 -1.100000\nv 0.281053 0.100000 -1.178574\nv 0.281053 0.155560 -1.155560\nv 0.278021 0.046286 -1.153714\nv 0.278021 0.024037 -1.100000\nv 0.278021 0.046286 -1.046286\nv 0.278021 0.100000 -1.024037\nv 0.278021 0.153714 -1.046286\nv 0.278021 0.175963 -1.100000\nv 0.278021 0.100000 -1.175963\nv 0.278021 0.153714 -1.153714\nv 0.278021 0.043625 -1.156375\nv 0.278021 0.020274 -1.100000\nv 0.278021 0.043625 -1.043625\nv 0.278021 0.100000 -1.020274\nv 0.278021 0.156375 -1.043625\nv 0.278021 0.179726 -1.100000\nv 0.278021 0.100000 -1.179726\nv 0.278021 0.156375 -1.156375\nv 0.278021 0.022632 -1.177368\nv 0.278021 -0.009415 -1.100000\nv 0.278021 0.022632 -1.022632\nv 0.278021 0.100000 -0.990585\nv 0.278021 0.177368 -1.022632\nv 0.278021 0.209415 -1.100000\nv 0.278021 0.177368 -1.177368\nv 0.278021 0.100000 -1.209415\nv 0.157302 0.022632 -1.177368\nv 0.157302 -0.009415 -1.100000\nv 0.157302 0.022632 -1.022632\nv 0.157302 0.100000 -0.990585\nv 0.157302 0.177368 -1.022632\nv 0.157302 0.209415 -1.100000\nv 0.157302 0.177368 -1.177368\nv 0.157302 0.100000 -1.209415\nv 0.295196 0.256283 0.610047\nv 0.295876 0.230064 0.576561\nv 0.296021 0.223336 0.576561\nv 0.298667 0.100000 0.576561\nv 0.295712 0.236314 0.576561\nv 0.295213 0.256283 0.500328\nv 0.109784 0.256283 0.610047\nv 0.295199 0.256282 0.576560\nv -0.298667 0.276472 0.014476\nv -0.298667 1.006751 0.014476\nv -0.298667 0.276472 -1.584185\nv -0.298667 1.006751 -1.584185\nv -0.298667 0.100000 0.610000\nv -0.284365 0.699252 0.408889\nv -0.298667 0.100000 0.020000\nv -0.284365 0.700000 0.032540\nv -0.298667 0.806751 -1.584185\nv -0.298667 0.806751 0.014476\nv -0.298667 0.906751 -1.584185\nv -0.298667 0.906751 0.014476\nv -0.298667 0.849813 0.114476\nv -0.298667 0.863689 0.064476\nv -0.298667 0.849813 0.624476\nv -0.298667 0.863689 0.624476\nv -0.291516 0.400000 0.026270\nv -0.291516 0.400188 0.610280\nv -0.143127 0.700000 0.032540\nv -0.143127 0.100000 0.020000\nv -0.143127 0.699252 0.408889\nv -0.103127 0.100000 0.610000\nv -0.143127 0.400188 0.610280\nv -0.143127 0.400000 0.026270\nv -0.295091 0.266667 0.023135\nv -0.295930 0.227554 0.610000\nv -0.103127 0.215089 0.610000\nv -0.143127 0.266667 0.023135\nv -0.143127 0.100000 -1.378433\nv -0.143127 0.266667 -1.378433\nv -0.261053 0.076899 -1.123101\nv -0.261053 0.067330 -1.100000\nv -0.261053 0.076899 -1.076899\nv -0.261053 0.100000 -1.067330\nv -0.261053 0.123101 -1.076899\nv -0.261053 0.132670 -1.100000\nv -0.261053 0.100000 -1.132670\nv -0.261053 0.123101 -1.123101\nv -0.281053 0.076899 -1.123101\nv -0.281053 0.067330 -1.100000\nv -0.281053 0.076899 -1.076899\nv -0.281053 0.100000 -1.067330\nv -0.281053 0.123101 -1.076899\nv -0.281053 0.132670 -1.100000\nv -0.281053 0.100000 -1.132670\nv -0.281053 0.123101 -1.123101\nv -0.157302 0.100000 0.090585\nv -0.157302 0.177368 0.122632\nv -0.157302 0.209415 0.200000\nv -0.157302 0.177368 0.277368\nv -0.157302 0.100000 0.309415\nv -0.157302 0.022632 0.277368\nv -0.157302 -0.009415 0.200000\nv -0.157302 0.022632 0.122632\nv -0.278021 0.100000 0.090585\nv -0.278021 0.177368 0.122632\nv -0.278021 0.209415 0.200000\nv -0.278021 0.177368 0.277368\nv -0.278021 0.100000 0.309415\nv -0.278021 0.022632 0.277368\nv -0.278021 -0.009415 0.200000\nv -0.278021 0.022632 0.122632\nv -0.298667 0.849813 0.637553\nv -0.298667 0.863689 0.637553\nv -0.298667 0.880016 0.624476\nv -0.298667 0.880016 0.637553\nv 0.000000 1.006751 -1.584185\nv 0.000000 0.276472 -1.584185\nv 0.000000 1.006751 0.014476\nv 0.000000 0.276472 0.014476\nv 0.000000 0.806751 0.014476\nv 0.000000 0.906751 0.014476\nv 0.000000 0.849813 0.114476\nv 0.000000 0.863689 0.064476\nv 0.000000 0.849813 0.624476\nv 0.000000 0.863689 0.624476\nv 0.000000 0.849813 0.637553\nv 0.000000 0.863689 0.637553\nv 0.000000 0.880016 0.624476\nv 0.000000 0.880016 0.637553\nv 0.000000 0.700000 0.032540\nv 0.000000 0.100000 0.020000\nv 0.000000 0.699252 0.408889\nv -0.103127 0.215089 0.492665\nv 0.000000 0.400188 0.610280\nv 0.000000 0.400000 0.026270\nv 0.000000 0.266667 0.023135\nv 0.000000 0.215089 0.610000\nv 0.000000 0.100000 -1.378433\nv 0.000000 0.266667 -1.378433\nv -0.298667 0.100000 0.327395\nv -0.298667 0.100000 0.072364\nv -0.143127 0.226797 0.198574\nv -0.143127 0.187628 0.293449\nv -0.143127 0.100000 0.072364\nv -0.143127 0.100000 0.327395\nv -0.296787 0.187628 0.293449\nv -0.295948 0.226797 0.198574\nv -0.296694 0.191980 0.112403\nv -0.143127 0.191980 0.112403\nv -0.143127 0.100000 0.198574\nv 0.000000 0.100000 0.198574\nv -0.284365 0.700000 0.055217\nv -0.291516 0.400000 0.051469\nv -0.143127 0.700000 0.088920\nv -0.295091 0.266667 0.088920\nv 0.000000 0.700000 0.088920\nv -0.284907 0.677322 0.077668\nv -0.284907 0.677322 0.397832\nv -0.290974 0.418120 0.567529\nv -0.290974 0.418120 0.074488\nv -0.275031 0.677322 0.077668\nv -0.275031 0.677322 0.397832\nv -0.281098 0.418120 0.567529\nv -0.281098 0.418120 0.074488\nv -0.261874 0.677753 0.423366\nv -0.268114 0.419217 0.597465\nv -0.143127 0.419217 0.597465\nv -0.143127 0.677753 0.423366\nv 0.000000 0.419217 0.597465\nv 0.000000 0.677753 0.423366\nv -0.143127 0.677322 0.412451\nv -0.143127 0.418120 0.586999\nv 0.000000 0.677322 0.412451\nv 0.000000 0.418120 0.586999\nv -0.261874 0.677322 0.412451\nv -0.268114 0.418120 0.586999\nv -0.292222 0.373741 0.180184\nv -0.293120 0.340169 0.180097\nv -0.292220 0.373725 0.089181\nv -0.293120 0.340216 0.089187\nv -0.280037 0.373415 0.180184\nv -0.280935 0.339842 0.180097\nv -0.280035 0.373399 0.089181\nv -0.280935 0.339890 0.089187\nv -0.280205 0.367145 0.173897\nv -0.280767 0.346113 0.173843\nv -0.280203 0.367132 0.095442\nv -0.280768 0.346155 0.095446\nv -0.280767 0.346124 0.154165\nv -0.280205 0.367142 0.154165\nv -0.286854 0.367323 0.173897\nv -0.287415 0.346291 0.173843\nv -0.287415 0.346301 0.154165\nv -0.286853 0.367320 0.154165\nv -0.296457 0.367579 0.173897\nv -0.297018 0.346547 0.173843\nv -0.297018 0.346558 0.154165\nv -0.296456 0.367576 0.154165\nv -0.287415 0.346302 0.095446\nv -0.286853 0.367320 0.095442\nv -0.297018 0.346559 0.095446\nv -0.296456 0.367577 0.095442\nv 0.000000 0.252996 0.007801\nv 0.000000 0.293932 0.007801\nv 0.000000 0.252996 -1.366103\nv 0.000000 0.293932 -1.366103\nv -0.134539 0.252996 0.007801\nv -0.134539 0.293932 0.007801\nv -0.134539 0.252996 -1.366103\nv -0.134539 0.293932 -1.366103\nv -0.280657 0.988741 -1.584185\nv -0.280657 0.806751 -1.584185\nv -0.280657 0.294482 -1.584185\nv -0.280657 0.906751 -1.584185\nv -0.231746 0.895578 -1.570077\nv -0.231746 0.910831 -1.570077\nv -0.231746 0.895578 -1.592661\nv -0.231746 0.910831 -1.592661\nv -0.291788 0.895578 -1.570077\nv -0.291788 0.910831 -1.570077\nv -0.291788 0.895578 -1.592661\nv -0.291788 0.910831 -1.592661\nv -0.231746 0.366770 -1.570077\nv -0.231746 0.382023 -1.570077\nv -0.231746 0.366770 -1.592661\nv -0.231746 0.382023 -1.592661\nv -0.291788 0.366770 -1.570077\nv -0.291788 0.382023 -1.570077\nv -0.291788 0.366770 -1.592661\nv -0.291788 0.382023 -1.592661\nv -0.006417 1.006751 -1.584185\nv -0.006417 0.276472 0.014476\nv -0.006417 0.806751 0.014476\nv -0.006417 0.906751 0.014476\nv -0.006417 0.849813 0.114476\nv -0.006417 0.863689 0.064476\nv -0.006417 0.849813 0.624476\nv -0.006417 0.863689 0.624476\nv -0.006417 0.849813 0.637553\nv -0.006417 0.863689 0.637553\nv -0.006417 0.880016 0.624476\nv -0.006417 0.880016 0.637553\nv -0.006417 0.276472 -1.584185\nv -0.006417 1.006751 0.014476\nv -0.006417 0.988741 -1.584185\nv -0.006417 0.294482 -1.584185\nv 0.000000 0.294482 -1.584185\nv 0.000000 0.988741 -1.584185\nv -0.006417 0.806751 -1.584185\nv -0.006417 0.906751 -1.584185\nv -0.006417 0.294482 -1.580206\nv -0.006417 0.806751 -1.580206\nv 0.000000 0.294482 -1.580206\nv 0.000000 0.806751 -1.580206\nv -0.006417 0.988741 -1.580206\nv 0.000000 0.988741 -1.580206\nv -0.006417 0.906751 -1.580206\nv 0.000000 0.906751 -1.580206\nv -0.006417 0.604103 -1.584185\nv -0.006417 0.622964 -1.584185\nv -0.006417 0.604103 -1.580206\nv 0.000000 0.604103 -1.580206\nv 0.000000 0.622964 -1.580206\nv -0.006417 0.622964 -1.580206\nv -0.055292 0.622964 -1.584184\nv -0.055292 0.604103 -1.584184\nv -0.007139 0.604825 -1.584185\nv -0.007139 0.622242 -1.584185\nv -0.054570 0.622242 -1.584184\nv -0.054570 0.604825 -1.584184\nv -0.007139 0.604825 -1.572059\nv -0.007139 0.622242 -1.572059\nv -0.054570 0.622242 -1.572058\nv -0.054570 0.604825 -1.572058\nv -0.040830 0.622242 -1.572058\nv -0.040830 0.604825 -1.572058\nv -0.041681 0.621391 -1.572058\nv -0.053718 0.621391 -1.572058\nv -0.053718 0.605676 -1.572058\nv -0.041681 0.605676 -1.572058\nv -0.041681 0.621391 -1.577313\nv -0.053718 0.621391 -1.577312\nv -0.053718 0.605676 -1.577312\nv -0.041681 0.605676 -1.577313\nv -0.041681 0.621391 -1.583780\nv -0.053718 0.621391 -1.583780\nv -0.053718 0.605676 -1.583780\nv -0.041681 0.605676 -1.583780\nv -0.009750 0.605677 -1.577313\nv -0.009750 0.621391 -1.577313\nv -0.009750 0.605677 -1.583780\nv -0.009750 0.621391 -1.583780\nv -0.223972 0.227554 0.610000\nv -0.223972 0.100000 0.610000\nv -0.297298 0.163777 0.610000\nv -0.249569 0.100000 0.610000\nv -0.103127 0.163777 0.610000\nv -0.259951 0.227554 0.610000\nv -0.183549 0.227554 0.610000\nv -0.154931 0.100000 0.610000\nv -0.223972 0.189119 0.610000\nv -0.160087 0.189119 0.610000\nv -0.166959 0.172529 0.610000\nv -0.183549 0.212582 0.610000\nv -0.200140 0.205710 0.610000\nv -0.183549 0.165657 0.610000\nv -0.200140 0.172529 0.610000\nv -0.207012 0.189119 0.610000\nv -0.166959 0.205710 0.610000\nv -0.283204 0.188989 0.610000\nv -0.276527 0.173058 0.610000\nv -0.260540 0.166515 0.610000\nv -0.260730 0.211653 0.610000\nv -0.276661 0.204976 0.610000\nv -0.238066 0.189179 0.610000\nv -0.244609 0.173192 0.610000\nv -0.244743 0.205110 0.610000\nv -0.260635 0.189105 0.600800\nv -0.260540 0.166515 0.600800\nv -0.260730 0.211653 0.600800\nv -0.283204 0.188989 0.600800\nv -0.238066 0.189179 0.600800\nv -0.183549 0.189119 0.600800\nv -0.183549 0.165657 0.600800\nv -0.183549 0.212582 0.600800\nv -0.207012 0.189119 0.600800\nv -0.160087 0.189119 0.600800\nv -0.166959 0.172529 0.600800\nv -0.200140 0.205710 0.600800\nv -0.200140 0.172529 0.600800\nv -0.166959 0.205710 0.600800\nv -0.276527 0.173058 0.600800\nv -0.276661 0.204976 0.600800\nv -0.244609 0.173192 0.600800\nv -0.244743 0.205110 0.600800\nv -0.296248 0.212755 0.492665\nv -0.298667 0.100000 0.492665\nv -0.103127 0.100000 0.492665\nv 0.000000 0.100000 0.492665\nv 0.000000 0.215089 0.492665\nv 0.000000 0.107609 0.614248\nv -0.103127 0.163777 0.492665\nv 0.000000 0.163777 0.492665\nv 0.000000 0.213065 0.614248\nv 0.000000 0.102023 0.488417\nv 0.000000 0.213065 0.488417\nv -0.100500 0.102023 0.614248\nv -0.100500 0.213065 0.614248\nv -0.100500 0.102023 0.488417\nv -0.100500 0.213065 0.488417\nv -0.094915 0.207480 0.614248\nv -0.094915 0.107609 0.614248\nv 0.000000 0.207480 0.614248\nv 0.000000 0.102023 0.614248\nv 0.000000 0.107609 0.609985\nv 0.000000 0.207480 0.609985\nv -0.094915 0.207480 0.609985\nv -0.094915 0.107609 0.609985\nv -0.136002 0.137354 0.610000\nv -0.223972 0.137354 0.610000\nv -0.103127 0.137354 0.610000\nv -0.234504 0.137354 0.610000\nv -0.297865 0.137354 0.610000\nv -0.154931 0.137354 0.610000\nv -0.287347 0.137354 0.610000\nv -0.249569 0.137354 0.610000\nv -0.211698 0.137354 0.610000\nv -0.293858 0.133260 0.610000\nv -0.287347 0.133260 0.610000\nv -0.253663 0.133260 0.610000\nv -0.253663 0.104094 0.610000\nv -0.294484 0.104094 0.610000\nv -0.234504 0.133260 0.610000\nv -0.223972 0.133260 0.610000\nv -0.211698 0.133260 0.610000\nv -0.159025 0.133260 0.610000\nv -0.159025 0.104094 0.610000\nv -0.223972 0.104094 0.610000\nv -0.245476 0.104094 0.610000\nv -0.245476 0.133260 0.610000\nv -0.136002 0.133260 0.610000\nv -0.107221 0.133260 0.610000\nv -0.107221 0.104094 0.610000\nv -0.150838 0.104094 0.610000\nv -0.150838 0.133260 0.610000\nv -0.293858 0.133260 0.600000\nv -0.287347 0.133260 0.600000\nv -0.294484 0.104094 0.600000\nv -0.253663 0.133260 0.600000\nv -0.253663 0.104094 0.600000\nv -0.234504 0.133260 0.600000\nv -0.223972 0.133260 0.600000\nv -0.245476 0.133260 0.600000\nv -0.211698 0.133260 0.600000\nv -0.159025 0.133260 0.600000\nv -0.159025 0.104094 0.600000\nv -0.223972 0.104094 0.600000\nv -0.245476 0.104094 0.600000\nv -0.136002 0.133260 0.600000\nv -0.107221 0.133260 0.600000\nv -0.150838 0.133260 0.600000\nv -0.107221 0.104094 0.600000\nv -0.150838 0.104094 0.600000\nv -0.293064 0.339637 0.610182\nv -0.293712 0.314296 0.610141\nv -0.293071 0.339637 0.568244\nv -0.293719 0.314296 0.568244\nv -0.236061 0.314296 0.610139\nv -0.236061 0.339637 0.610181\nv -0.293080 0.338382 0.610181\nv -0.293103 0.338382 0.569500\nv -0.293696 0.315551 0.610142\nv -0.293687 0.315551 0.569500\nv -0.237317 0.315551 0.610141\nv -0.237317 0.338382 0.610179\nv -0.290275 0.336639 0.608109\nv -0.290789 0.317904 0.608076\nv -0.290294 0.336640 0.571772\nv -0.290789 0.317293 0.571772\nv -0.239062 0.317293 0.608075\nv -0.239062 0.336639 0.608107\nv -0.290283 0.336029 0.608108\nv -0.290310 0.336029 0.572382\nv -0.290797 0.317293 0.608076\nv -0.290773 0.317904 0.572382\nv -0.239673 0.317904 0.608076\nv -0.239673 0.336029 0.608106\nv -0.295945 0.339101 0.612150\nv -0.296623 0.314832 0.612107\nv -0.295981 0.339102 0.572318\nv -0.296602 0.314831 0.572318\nv -0.240057 0.314832 0.612107\nv -0.240057 0.339101 0.612147\nv -0.143127 0.266667 -0.309708\nv -0.143127 0.266667 -0.516516\nv -0.143127 0.100000 -0.309708\nv -0.143127 0.100000 -0.516979\nv 0.000000 0.100000 -0.309708\nv 0.000000 0.100000 -0.516979\nv 0.000000 0.266667 -0.309708\nv 0.000000 0.266667 -0.516516\nv -0.143127 0.266667 -0.615822\nv -0.143127 0.266667 -0.872679\nv -0.143127 0.100000 -0.616083\nv -0.143127 0.100000 -0.872810\nv 0.000000 0.100000 -0.616083\nv 0.000000 0.100000 -0.872810\nv 0.000000 0.266667 -0.615822\nv 0.000000 0.266667 -0.872679\nv -0.143127 0.198619 -0.516705\nv -0.143127 0.198619 -0.309708\nv -0.143127 0.242627 -0.872698\nv -0.143127 0.242627 -0.615860\nv -0.228681 0.100000 -0.309708\nv -0.228681 0.100000 -0.516979\nv -0.255569 0.100000 -0.616083\nv -0.255569 0.100000 -0.872810\nv -0.228681 0.198619 -0.516705\nv -0.228681 0.198619 -0.309708\nv -0.255569 0.242627 -0.872698\nv -0.255569 0.242627 -0.615860\nv -0.278021 0.156375 0.143625\nv -0.278021 0.100000 0.120274\nv -0.278021 0.179726 0.200000\nv -0.278021 0.156375 0.256375\nv -0.278021 0.100000 0.279726\nv -0.278021 0.043625 0.256375\nv -0.278021 0.020274 0.200000\nv -0.278021 0.043625 0.143625\nv -0.278021 0.153714 0.146286\nv -0.278021 0.100000 0.124037\nv -0.278021 0.175963 0.200000\nv -0.278021 0.153714 0.253714\nv -0.278021 0.100000 0.275963\nv -0.278021 0.046286 0.253714\nv -0.278021 0.024037 0.200000\nv -0.278021 0.046286 0.146286\nv -0.281053 0.155560 0.144440\nv -0.281053 0.100000 0.121426\nv -0.281053 0.178574 0.200000\nv -0.281053 0.155560 0.255560\nv -0.281053 0.100000 0.278574\nv -0.281053 0.044440 0.255560\nv -0.281053 0.021426 0.200000\nv -0.281053 0.044440 0.144440\nv -0.281053 0.133173 0.166827\nv -0.281053 0.100000 0.153086\nv -0.281053 0.146914 0.200000\nv -0.281053 0.133173 0.233173\nv -0.281053 0.100000 0.246914\nv -0.281053 0.066827 0.233173\nv -0.281053 0.053086 0.200000\nv -0.281053 0.066827 0.166827\nv -0.281053 0.047990 0.252010\nv -0.281053 0.028368 0.204639\nv -0.281053 0.049986 0.204639\nv -0.281053 0.063276 0.236724\nv -0.281053 0.095361 0.250014\nv -0.281053 0.095361 0.271632\nv -0.281053 0.152010 0.252010\nv -0.281053 0.104639 0.271632\nv -0.281053 0.104639 0.250014\nv -0.281053 0.136724 0.236724\nv -0.281053 0.150014 0.204639\nv -0.281053 0.171632 0.204639\nv -0.281053 0.152010 0.147990\nv -0.281053 0.171632 0.195361\nv -0.281053 0.150014 0.195361\nv -0.281053 0.136724 0.163276\nv -0.281053 0.104639 0.149986\nv -0.281053 0.104639 0.128368\nv -0.281053 0.047990 0.147990\nv -0.281053 0.095361 0.128368\nv -0.281053 0.095361 0.149986\nv -0.281053 0.063276 0.163276\nv -0.281053 0.049986 0.195361\nv -0.281053 0.028368 0.195361\nv -0.261053 0.028368 0.204639\nv -0.261053 0.047990 0.252010\nv -0.261053 0.095361 0.271632\nv -0.261053 0.049986 0.204639\nv -0.261053 0.063276 0.236724\nv -0.261053 0.095361 0.250014\nv -0.261053 0.104639 0.271632\nv -0.261053 0.152010 0.252010\nv -0.261053 0.171632 0.204639\nv -0.261053 0.104639 0.250014\nv -0.261053 0.136724 0.236724\nv -0.261053 0.150014 0.204639\nv -0.261053 0.171632 0.195361\nv -0.261053 0.152010 0.147990\nv -0.261053 0.104639 0.128368\nv -0.261053 0.150014 0.195361\nv -0.261053 0.136724 0.163276\nv -0.261053 0.104639 0.149986\nv -0.261053 0.095361 0.128368\nv -0.261053 0.047990 0.147990\nv -0.261053 0.028368 0.195361\nv -0.261053 0.095361 0.149986\nv -0.261053 0.063276 0.163276\nv -0.261053 0.049986 0.195361\nv -0.281053 0.123101 0.176899\nv -0.281053 0.100000 0.167330\nv -0.281053 0.132670 0.200000\nv -0.281053 0.123101 0.223101\nv -0.281053 0.100000 0.232670\nv -0.281053 0.076899 0.223101\nv -0.281053 0.067330 0.200000\nv -0.281053 0.076899 0.176899\nv -0.261053 0.123101 0.176899\nv -0.261053 0.100000 0.167330\nv -0.261053 0.132670 0.200000\nv -0.261053 0.123101 0.223101\nv -0.261053 0.100000 0.232670\nv -0.261053 0.076899 0.223101\nv -0.261053 0.067330 0.200000\nv -0.261053 0.076899 0.176899\nv -0.261053 0.049986 -1.104639\nv -0.261053 0.063276 -1.136724\nv -0.261053 0.095361 -1.150014\nv -0.261053 0.028368 -1.104639\nv -0.261053 0.047990 -1.152010\nv -0.261053 0.095361 -1.171632\nv -0.261053 0.104639 -1.150014\nv -0.261053 0.136724 -1.136724\nv -0.261053 0.150014 -1.104639\nv -0.261053 0.104639 -1.171632\nv -0.261053 0.152010 -1.152010\nv -0.261053 0.171632 -1.104639\nv -0.261053 0.150014 -1.095361\nv -0.261053 0.136724 -1.063276\nv -0.261053 0.104639 -1.049986\nv -0.261053 0.171632 -1.095361\nv -0.261053 0.152010 -1.047990\nv -0.261053 0.104639 -1.028368\nv -0.261053 0.095361 -1.049986\nv -0.261053 0.063276 -1.063276\nv -0.261053 0.049986 -1.095361\nv -0.261053 0.095361 -1.028368\nv -0.261053 0.047990 -1.047990\nv -0.261053 0.028368 -1.095361\nv -0.281053 0.028368 -1.104639\nv -0.281053 0.049986 -1.104639\nv -0.281053 0.063276 -1.136724\nv -0.281053 0.095361 -1.150014\nv -0.281053 0.095361 -1.171632\nv -0.281053 0.047990 -1.152010\nv -0.281053 0.104639 -1.171632\nv -0.281053 0.104639 -1.150014\nv -0.281053 0.136724 -1.136724\nv -0.281053 0.150014 -1.104639\nv -0.281053 0.171632 -1.104639\nv -0.281053 0.152010 -1.152010\nv -0.281053 0.171632 -1.095361\nv -0.281053 0.150014 -1.095361\nv -0.281053 0.136724 -1.063276\nv -0.281053 0.104639 -1.049986\nv -0.281053 0.104639 -1.028368\nv -0.281053 0.152010 -1.047990\nv -0.281053 0.095361 -1.028368\nv -0.281053 0.095361 -1.049986\nv -0.281053 0.063276 -1.063276\nv -0.281053 0.049986 -1.095361\nv -0.281053 0.028368 -1.095361\nv -0.281053 0.047990 -1.047990\nv -0.281053 0.066827 -1.133173\nv -0.281053 0.053086 -1.100000\nv -0.281053 0.066827 -1.066827\nv -0.281053 0.100000 -1.053086\nv -0.281053 0.133173 -1.066827\nv -0.281053 0.146914 -1.100000\nv -0.281053 0.100000 -1.146914\nv -0.281053 0.133173 -1.133173\nv -0.281053 0.044440 -1.155560\nv -0.281053 0.021426 -1.100000\nv -0.281053 0.044440 -1.044440\nv -0.281053 0.100000 -1.021426\nv -0.281053 0.155560 -1.044440\nv -0.281053 0.178574 -1.100000\nv -0.281053 0.100000 -1.178574\nv -0.281053 0.155560 -1.155560\nv -0.278021 0.046286 -1.153714\nv -0.278021 0.024037 -1.100000\nv -0.278021 0.046286 -1.046286\nv -0.278021 0.100000 -1.024037\nv -0.278021 0.153714 -1.046286\nv -0.278021 0.175963 -1.100000\nv -0.278021 0.100000 -1.175963\nv -0.278021 0.153714 -1.153714\nv -0.278021 0.043625 -1.156375\nv -0.278021 0.020274 -1.100000\nv -0.278021 0.043625 -1.043625\nv -0.278021 0.100000 -1.020274\nv -0.278021 0.156375 -1.043625\nv -0.278021 0.179726 -1.100000\nv -0.278021 0.100000 -1.179726\nv -0.278021 0.156375 -1.156375\nv -0.278021 0.022632 -1.177368\nv -0.278021 -0.009415 -1.100000\nv -0.278021 0.022632 -1.022632\nv -0.278021 0.100000 -0.990585\nv -0.278021 0.177368 -1.022632\nv -0.278021 0.209415 -1.100000\nv -0.278021 0.177368 -1.177368\nv -0.278021 0.100000 -1.209415\nv -0.157302 0.022632 -1.177368\nv -0.157302 -0.009415 -1.100000\nv -0.157302 0.022632 -1.022632\nv -0.157302 0.100000 -0.990585\nv -0.157302 0.177368 -1.022632\nv -0.157302 0.209415 -1.100000\nv -0.157302 0.177368 -1.177368\nv -0.157302 0.100000 -1.209415\nv -0.295196 0.256283 0.610047\nv -0.295876 0.230064 0.576561\nv -0.296021 0.223336 0.576561\nv -0.298667 0.100000 0.576561\nv -0.295712 0.236314 0.576561\nv -0.295213 0.256283 0.500328\nv -0.109784 0.256283 0.610047\nv 0.000000 0.256283 0.610047\nv -0.295199 0.256282 0.576560\nvn -0.0000 0.0188 -0.9998\nvn 0.0000 -0.0123 0.9999\nvn 0.0000 0.0209 -0.9998\nvn 0.0000 0.9945 -0.1043\nvn 0.0000 1.0000 0.0000\nvn -0.9239 0.3827 0.0000\nvn -0.0000 0.0235 -0.9997\nvn 0.7644 -0.0011 0.6448\nvn 0.0000 0.0002 1.0000\nvn 0.0000 0.0000 -1.0000\nvn 1.0000 0.0000 0.0000\nvn 0.0000 -0.0016 1.0000\nvn 0.9998 0.0214 0.0000\nvn 0.0000 -0.9992 0.0395\nvn 0.0000 1.0000 0.0023\nvn 0.9996 0.0268 0.0000\nvn 0.9997 0.0238 0.0000\nvn 0.9998 0.0215 0.0000\nvn 0.9997 0.0247 0.0000\nvn 0.9998 0.0214 -0.0037\nvn 0.9996 0.0299 0.0000\nvn 0.9997 0.0238 -0.0001\nvn 0.0000 -0.5477 -0.8366\nvn 0.0000 -1.0000 0.0000\nvn 0.0000 0.5586 0.8295\nvn -0.9997 -0.0225 0.0024\nvn 0.9997 0.0256 0.0002\nvn 0.9996 0.0269 -0.0000\nvn 0.9997 0.0264 0.0004\nvn -0.0268 0.9996 0.0005\nvn 0.0268 -0.9996 0.0002\nvn -0.0001 0.0026 -1.0000\nvn 0.9996 0.0267 -0.0001\nvn 0.9996 0.0269 0.0001\nvn -0.0267 0.9996 0.0000\nvn -0.0267 0.9996 -0.0002\nvn 0.0267 -0.9996 -0.0005\nvn 0.0001 -0.0026 1.0000\nvn 0.9996 0.0267 0.0000\nvn 0.0000 -0.0002 -1.0000\nvn 0.0267 -0.9996 -0.0000\nvn -0.9996 -0.0267 0.0000\nvn 0.0000 0.0000 1.0000\nvn -1.0000 0.0000 0.0000\nvn -0.9223 0.3866 0.0000\nvn 0.3827 -0.9239 0.0000\nvn -0.3866 -0.9223 0.0000\nvn -0.9239 -0.3827 0.0000\nvn -0.9255 -0.3788 0.0000\nvn 0.3788 -0.9255 0.0000\nvn 0.9239 0.3827 0.0000\nvn -0.3827 -0.9239 0.0000\nvn 0.9223 -0.3866 0.0000\nvn 0.3866 0.9223 0.0000\nvn 0.9255 0.3788 0.0000\nvn 0.3827 0.9239 0.0000\nvn -0.3788 0.9255 0.0000\nvn 0.9239 -0.3827 0.0000\nvn -0.3827 0.9239 0.0000\nvn -0.0000 -0.0017 1.0000\nvn -0.0000 -0.7653 0.6437\nvn 0.9999 0.0128 0.0006\nvn -0.0000 -0.0008 1.0000\nvn -0.9955 -0.0002 0.0948\nvn -0.0000 0.7644 0.6447\nvn 0.6228 0.0159 0.7822\nvn 0.5151 0.8571 -0.0001\nvn 0.5273 -0.8497 0.0003\nvn 0.9999 0.0132 0.0008\nvn 0.9996 0.0265 -0.0002\nvn 0.9997 0.0255 -0.0006\nvn -0.0000 -0.0009 1.0000\nvn -0.0112 -0.0003 -0.9999\nvn 0.0000 0.0008 -1.0000\nvn 0.0000 0.0028 -1.0000\nvn 0.9997 0.0256 0.0001\nvn -0.7644 -0.0011 0.6448\nvn -0.9998 0.0214 0.0000\nvn -0.9996 0.0268 0.0000\nvn -0.0005 1.0000 0.0021\nvn -0.9997 0.0238 0.0000\nvn -0.9998 0.0215 0.0000\nvn -0.9997 0.0247 0.0000\nvn -0.9997 0.0241 0.0011\nvn -0.9996 0.0299 0.0000\nvn -0.9997 0.0233 0.0052\nvn 0.9997 -0.0225 0.0024\nvn -0.9997 0.0256 0.0002\nvn -0.9996 0.0267 -0.0000\nvn -0.9997 0.0263 0.0004\nvn -0.9996 0.0269 0.0000\nvn 0.0268 0.9996 0.0005\nvn -0.0268 -0.9996 0.0002\nvn 0.0001 0.0026 -1.0000\nvn -0.9996 0.0267 -0.0001\nvn -0.9996 0.0269 -0.0001\nvn 0.0267 0.9996 0.0000\nvn 0.0267 0.9996 -0.0002\nvn -0.0267 -0.9996 -0.0005\nvn -0.0001 -0.0026 1.0000\nvn -0.0267 -0.9996 -0.0000\nvn 0.9996 -0.0267 0.0000\nvn 0.9223 0.3866 0.0000\nvn 0.3866 -0.9223 0.0000\nvn 0.9255 -0.3788 0.0000\nvn -0.3788 -0.9255 0.0000\nvn -0.9223 -0.3866 0.0000\nvn -0.3866 0.9223 0.0000\nvn -0.9255 0.3788 0.0000\nvn 0.3788 0.9255 0.0000\nvn -0.9999 0.0128 0.0006\nvn -0.9999 0.0128 -0.0002\nvn 0.0001 -0.0017 1.0000\nvn 0.9955 -0.0002 0.0948\nvn -0.6228 0.0159 0.7822\nvn -0.5152 0.8571 -0.0001\nvn -0.5273 -0.8497 0.0003\nvn -0.9999 0.0131 0.0008\nvn -0.9999 0.0132 -0.0004\nvn -0.9997 0.0255 -0.0006\nvn 0.0112 -0.0003 -0.9999\nvn -0.9997 0.0256 0.0001\nvn 0.7644 -0.0011 0.6447\nvn 0.0005 1.0000 0.0021\nvn 0.9997 0.0239 0.0001\nvn 0.9997 0.0241 0.0011\nvn 0.9995 0.0302 -0.0000\nvn 0.9997 0.0233 0.0052\nvn -0.9997 -0.0234 0.0009\nvn 0.9997 0.0263 0.0004\nvn 0.9996 0.0268 -0.0001\nvn 0.9996 0.0267 0.0001\nvn 0.9996 0.0269 -0.0001\nvn 0.9999 0.0128 -0.0002\nvn 0.5152 0.8571 -0.0001\nvn 0.5275 -0.8496 0.0003\nvn 0.9996 0.0265 0.0005\nvn 0.9999 0.0132 -0.0004\nvn 0.9997 0.0256 0.0009\nvn 0.9996 0.0267 0.0005\nvn 0.9997 0.0255 0.0002\nvn -0.7644 -0.0011 0.6447\nvn -0.9997 0.0239 0.0001\nvn -0.9998 0.0214 -0.0037\nvn -0.9995 0.0302 -0.0000\nvn -0.9997 0.0238 -0.0001\nvn 0.9997 -0.0234 0.0009\nvn -0.9997 0.0264 0.0004\nvn -0.9996 0.0268 -0.0001\nvn -0.9996 0.0267 0.0001\nvn -0.9996 0.0269 0.0001\nvn -0.0001 -0.0017 1.0000\nvn -0.5151 0.8571 -0.0001\nvn -0.5274 -0.8496 0.0003\nvn -0.9996 0.0266 0.0005\nvn -0.9996 0.0265 -0.0002\nvn -0.9997 0.0256 0.0009\nvn -0.9996 0.0267 0.0005\nvn -0.9997 0.0255 0.0002\nvn 0.9997 0.0234 0.0000\nvn -0.9997 0.0234 0.0000\nvn 0.0000 -0.3827 -0.9239\nvn 0.0000 -0.9239 -0.3827\nvn 0.0000 -0.9239 0.3827\nvn 0.0000 -0.3827 0.9239\nvn 0.0000 0.3827 0.9239\nvn 0.0000 0.9239 0.3827\nvn 0.0000 0.9239 -0.3827\nvn 0.0000 0.3827 -0.9239\nvn -0.6225 -0.2995 -0.7231\nvn -0.6225 -0.7230 -0.2995\nvn -0.6225 -0.7230 0.2995\nvn -0.6225 -0.2995 0.7231\nvn -0.6225 0.2995 0.7231\nvn -0.6225 0.7231 0.2995\nvn -0.6225 0.7231 -0.2995\nvn -0.6225 0.2995 -0.7231\nvn -0.6225 -0.7231 -0.2995\nvn -0.6225 0.2995 -0.7230\nvn 0.6225 -0.2995 -0.7231\nvn 0.6225 -0.7231 -0.2995\nvn 0.6225 -0.7231 0.2995\nvn 0.6225 -0.2995 0.7231\nvn 0.6225 0.2995 0.7231\nvn 0.6225 0.7231 0.2995\nvn 0.6225 0.7231 -0.2995\nvn 0.6225 0.2995 -0.7231\nvn 0.6225 -0.7230 -0.2995\nvn 0.6225 0.7230 0.2995\nvn 0.6225 -0.2995 -0.7230\nvn 0.6225 0.2995 -0.7230\nvn 0.6225 0.2995 0.7230\nvn -0.6225 -0.7231 0.2995\nvn -0.6225 0.7230 0.2995\nvn -0.6225 -0.2995 -0.7230\nvn -0.6224 0.2995 -0.7231\nvn -0.6225 0.2995 0.7230\nvn 0.6224 0.2995 -0.7231\nvn 0.6225 -0.7230 0.2995\nvn 0.0000 -0.9272 0.3746\nvn 0.0000 -0.9243 -0.3816\nvn 0.0000 -0.3612 -0.9325\nvn 0.0000 -0.3991 0.9169\nvn -0.9998 -0.0214 0.0000\nvn 0.0000 -0.0011 1.0000\nvn 0.9998 -0.0214 0.0000\nvn 0.0002 -0.0012 1.0000\nvn -0.0002 -0.0012 1.0000\nvn -0.0000 -0.9185 0.3955\nvn 0.0000 0.7577 0.6526\nvn -0.0001 0.0000 -1.0000\nvn 0.0003 0.0000 -1.0000\nvn 0.0001 0.0000 -1.0000\nvn 0.0000 0.7960 -0.6052\nvn -0.0000 -0.0018 1.0000\nvn 0.9996 0.0279 0.0009\nvn 0.0000 -0.7953 -0.6063\nvn -0.4662 -0.8847 0.0003\nvn -0.4764 0.8792 -0.0003\nvn -0.0000 0.7960 -0.6053\nvn -0.9997 0.0255 -0.0005\nvn 0.4664 -0.8846 0.0002\nvn 0.4764 0.8792 -0.0003\nvn 0.9997 0.0255 -0.0005\nvn -0.4664 -0.8846 0.0002\nvn -0.4767 0.8791 -0.0004\nvn -0.9996 0.0279 0.0009\nvn 0.4662 -0.8847 0.0003\nvn 0.4767 0.8791 -0.0004\nusemtl White\ns off\nf 25//1 20//1 28//1\nf 83//2 90//2 86//2\nf 8//3 24//3 19//3\nf 19//3 638//3 633//3\nf 93//4 677//4 672//4\nf 79//5 19//5 81//5\nf 218//6 240//6 217//6\nf 338//5 642//5 952//5\nf 24//7 639//7 638//7\nf 313//8 320//8 314//8\nf 101//9 106//9 102//9\nf 17//7 28//7 24//7\nf 30//10 641//10 642//10\nf 343//11 29//11 30//11\nf 637//12 551//12 23//12\nf 246//13 68//13 74//13\nf 19//5 659//5 81//5\nf 673//14 95//14 94//14\nf 548//13 246//13 547//13\nf 253//10 848//10 849//10\nf 81//15 635//15 21//15\nf 80//16 25//16 17//16\nf 6//15 81//15 21//15\nf 8//17 80//17 17//17\nf 82//18 76//18 25//18\nf 7//13 76//13 69//13\nf 546//18 246//18 82//18\nf 83//19 6//19 84//19\nf 85//20 6//20 18//20\nf 85//21 80//21 86//21\nf 83//22 80//22 79//22\nf 86//5 89//5 85//5\nf 84//23 89//23 88//23\nf 84//24 87//24 83//24\nf 91//25 18//25 6//25\nf 92//25 23//25 18//25\nf 91//25 21//25 94//25\nf 672//25 23//25 93//25\nf 94//25 635//25 673//25\nf 94//14 97//14 91//14\nf 92//4 96//4 93//4\nf 91//26 98//26 92//26\nf 550//27 552//27 549//27\nf 99//28 80//28 18//28\nf 550//29 546//29 82//29\nf 102//28 80//28 101//28\nf 112//28 110//28 109//28\nf 100//30 106//30 104//30\nf 101//31 103//31 105//31\nf 100//32 103//32 99//32\nf 107//33 104//33 108//33\nf 112//16 105//16 103//16\nf 111//16 104//16 106//16\nf 109//34 106//34 105//34\nf 111//10 116//10 115//10\nf 116//35 124//35 122//35\nf 107//36 116//36 112//36\nf 111//37 114//37 108//37\nf 107//38 114//38 113//38\nf 120//39 118//39 119//39\nf 113//36 120//36 116//36\nf 115//37 118//37 114//37\nf 113//38 118//38 117//38\nf 121//40 124//40 123//40\nf 115//41 123//41 119//41\nf 120//39 123//39 124//39\nf 116//42 121//42 115//42\nf 128//10 708//10 709//10\nf 126//11 127//11 128//11\nf 707//43 125//43 126//43\nf 708//24 125//24 706//24\nf 128//5 707//5 126//5\nf 136//44 133//44 134//44\nf 140//10 135//10 136//10\nf 138//11 139//11 140//11\nf 134//43 137//43 138//43\nf 135//24 137//24 133//24\nf 140//5 134//5 138//5\nf 144//44 141//44 142//44\nf 148//10 143//10 144//10\nf 146//11 147//11 148//11\nf 142//43 145//43 146//43\nf 143//24 145//24 141//24\nf 148//5 142//5 146//5\nf 220//45 242//45 221//45\nf 219//46 235//46 214//46\nf 223//47 243//47 224//47\nf 215//48 236//48 218//48\nf 224//49 231//49 220//49\nf 227//50 230//50 223//50\nf 213//51 237//51 212//51\nf 214//52 239//52 215//52\nf 225//53 245//53 227//53\nf 222//54 244//54 226//54\nf 226//55 232//55 225//55\nf 216//56 238//56 213//56\nf 221//57 229//57 222//57\nf 212//58 241//58 219//58\nf 217//59 234//59 216//59\nf 846//43 248//43 249//43\nf 843//24 27//24 640//24\nf 843//43 249//43 67//43\nf 248//44 260//44 249//44\nf 249//44 27//44 67//44\nf 251//11 252//11 253//11\nf 255//5 858//5 844//5\nf 848//24 250//24 857//24\nf 253//5 847//5 251//5\nf 254//43 250//43 251//43\nf 254//43 847//43 856//43\nf 255//43 857//43 250//43\nf 859//43 257//43 256//43\nf 856//24 256//24 254//24\nf 254//44 257//44 255//44\nf 23//60 307//60 308//60\nf 314//61 315//61 309//61\nf 310//62 303//62 309//62\nf 312//27 304//27 306//27\nf 312//27 305//27 310//27\nf 313//63 304//63 311//63\nf 314//60 307//60 313//60\nf 314//12 303//12 308//12\nf 326//64 331//64 332//64\nf 313//65 323//65 319//65\nf 310//66 318//66 312//66\nf 311//67 318//67 323//67\nf 309//68 317//68 310//68\nf 322//69 315//69 321//69\nf 324//70 323//70 318//70\nf 324//71 317//71 322//71\nf 325//72 323//72 316//72\nf 325//60 320//60 319//60\nf 326//60 315//60 320//60\nf 324//73 329//73 330//73\nf 20//11 342//11 28//11\nf 339//12 352//12 344//12\nf 28//5 943//5 639//5\nf 333//5 944//5 943//5\nf 341//11 339//11 344//11\nf 344//5 351//5 343//5\nf 334//5 951//5 944//5\nf 337//5 952//5 951//5\nf 342//11 334//11 333//11\nf 344//11 338//11 337//11\nf 345//11 349//11 350//11\nf 347//11 351//11 352//11\nf 343//74 348//74 340//74\nf 342//5 349//5 341//5\nf 335//43 350//43 342//43\nf 341//75 346//75 336//75\nf 340//24 347//24 339//24\nf 336//24 345//24 335//24\nf 305//76 306//76 550//76\nf 572//1 577//1 580//1\nf 667//2 660//2 663//2\nf 576//3 560//3 571//3\nf 633//3 576//3 571//3\nf 677//4 670//4 672//4\nf 655//5 571//5 560//5\nf 833//51 811//51 810//51\nf 642//5 946//5 952//5\nf 639//7 576//7 638//7\nf 924//77 917//77 918//77\nf 687//9 682//9 683//9\nf 580//7 569//7 576//7\nf 641//10 582//10 642//10\nf 581//44 948//44 955//44\nf 1163//12 637//12 575//12\nf 839//78 643//78 840//78\nf 659//5 571//5 657//5\nf 674//14 673//14 671//14\nf 839//78 1160//78 1159//78\nf 848//10 853//10 849//10\nf 635//15 657//15 573//15\nf 577//79 656//79 569//79\nf 558//80 657//80 655//80\nf 560//81 656//81 655//81\nf 651//82 658//82 577//82\nf 559//78 651//78 577//78\nf 650//82 839//82 658//82\nf 558//83 660//83 661//83\nf 662//84 558//84 661//84\nf 656//85 662//85 663//85\nf 660//86 656//86 663//86\nf 666//5 663//5 662//5\nf 661//23 666//23 662//23\nf 664//24 661//24 660//24\nf 668//25 570//25 669//25\nf 669//25 575//25 670//25\nf 573//25 668//25 671//25\nf 575//25 672//25 670//25\nf 635//25 671//25 673//25\nf 678//14 671//14 668//14\nf 675//4 669//4 670//4\nf 679//87 668//87 669//87\nf 1162//88 1161//88 1165//88\nf 680//89 656//89 682//89\nf 1158//90 1161//90 1162//90\nf 656//91 683//91 682//91\nf 691//91 693//91 690//91\nf 681//92 687//92 683//92\nf 682//93 684//93 680//93\nf 684//94 681//94 680//94\nf 685//95 688//95 689//95\nf 686//89 690//89 693//89\nf 685//79 689//79 692//79\nf 690//96 687//96 691//96\nf 692//10 697//10 693//10\nf 697//97 705//97 701//97\nf 697//98 688//98 693//98\nf 695//99 692//99 689//99\nf 688//100 695//100 689//100\nf 701//89 699//89 698//89\nf 701//98 694//98 697//98\nf 699//99 696//99 695//99\nf 694//100 699//100 695//100\nf 702//40 705//40 703//40\nf 704//101 696//101 700//101\nf 701//89 704//89 700//89\nf 702//102 697//102 696//102\nf 708//10 713//10 709//10\nf 712//44 711//44 713//44\nf 710//43 707//43 711//43\nf 710//24 708//24 706//24\nf 707//5 713//5 711//5\nf 718//11 721//11 719//11\nf 720//10 725//10 721//10\nf 724//44 723//44 725//44\nf 722//43 719//43 723//43\nf 722//24 720//24 718//24\nf 719//5 725//5 723//5\nf 726//11 729//11 727//11\nf 728//10 733//10 729//10\nf 732//44 731//44 733//44\nf 730//43 727//43 731//43\nf 730//24 728//24 726//24\nf 727//5 733//5 731//5\nf 835//103 813//103 814//103\nf 828//52 812//52 807//52\nf 836//104 816//104 817//104\nf 829//58 808//58 811//58\nf 824//105 817//105 813//105\nf 823//106 820//106 816//106\nf 830//6 806//6 805//6\nf 832//46 807//46 808//46\nf 838//107 818//107 820//107\nf 837//108 815//108 819//108\nf 825//109 819//109 818//109\nf 831//59 809//59 806//59\nf 822//110 814//110 815//110\nf 834//48 805//48 812//48\nf 827//56 810//56 809//56\nf 841//43 846//43 845//43\nf 579//24 843//24 640//24\nf 845//43 843//43 636//43\nf 800//11 864//11 845//11\nf 579//11 845//11 636//11\nf 852//44 851//44 853//44\nf 858//5 855//5 844//5\nf 850//24 848//24 857//24\nf 847//5 853//5 851//5\nf 851//43 855//43 854//43\nf 847//43 854//43 856//43\nf 855//43 857//43 844//43\nf 861//43 859//43 860//43\nf 860//24 856//24 854//24\nf 861//11 854//11 855//11\nf 911//12 1163//12 575//12\nf 919//61 918//61 913//61\nf 907//111 914//111 913//111\nf 916//112 908//112 915//112\nf 909//88 916//88 914//88\nf 908//63 917//63 915//63\nf 911//113 918//113 917//113\nf 918//63 907//63 913//63\nf 930//114 935//114 929//114\nf 917//65 927//65 915//65\nf 922//115 914//115 916//115\nf 915//116 922//116 916//116\nf 921//117 913//117 914//117\nf 919//118 926//118 925//118\nf 928//119 927//119 920//119\nf 921//120 928//120 926//120\nf 927//72 929//72 920//72\nf 929//60 924//60 930//60\nf 930//72 919//72 925//72\nf 928//121 933//121 926//121\nf 937//44 954//44 580//44\nf 964//12 947//12 956//12\nf 943//5 580//5 639//5\nf 944//5 937//5 943//5\nf 947//44 940//44 953//44\nf 963//5 956//5 955//5\nf 951//5 938//5 944//5\nf 952//5 945//5 951//5\nf 938//44 954//44 937//44\nf 946//44 956//44 945//44\nf 961//44 957//44 962//44\nf 963//44 959//44 964//44\nf 960//74 955//74 948//74\nf 961//5 954//5 953//5\nf 962//43 939//43 954//43\nf 958//75 953//75 940//75\nf 959//24 948//24 947//24\nf 957//24 940//24 939//24\nf 1162//122 909//122 680//122\nf 25//1 7//1 20//1\nf 83//2 87//2 90//2\nf 8//3 17//3 24//3\nf 19//3 24//3 638//3\nf 93//4 96//4 677//4\nf 79//5 8//5 19//5\nf 218//6 236//6 240//6\nf 338//5 30//5 642//5\nf 24//7 28//7 639//7\nf 313//123 319//123 320//123\nf 101//9 105//9 106//9\nf 17//7 25//7 28//7\nf 30//10 29//10 641//10\nf 30//11 338//11 343//11\nf 343//11 340//11 29//11\nf 637//12 1164//12 551//12\nf 246//13 247//13 68//13\nf 19//5 633//5 659//5\nf 673//14 676//14 95//14\nf 548//13 247//13 246//13\nf 253//10 252//10 848//10\nf 81//15 659//15 635//15\nf 80//16 82//16 25//16\nf 6//124 79//124 81//124\nf 8//17 79//17 80//17\nf 82//13 75//13 76//13\nf 7//13 25//13 76//13\nf 75//18 82//18 246//18\nf 546//18 547//18 246//18\nf 246//13 74//13 75//13\nf 83//125 79//125 6//125\nf 85//126 84//126 6//126\nf 85//127 18//127 80//127\nf 83//128 86//128 80//128\nf 86//5 90//5 89//5\nf 84//23 85//23 89//23\nf 84//24 88//24 87//24\nf 91//25 92//25 18//25\nf 92//25 93//25 23//25\nf 91//25 6//25 21//25\nf 672//25 637//25 23//25\nf 94//25 21//25 635//25\nf 94//14 95//14 97//14\nf 92//4 98//4 96//4\nf 91//129 97//129 98//129\nf 99//39 101//39 80//39\nf 82//16 102//16 100//16\nf 550//130 549//130 546//130\nf 82//29 100//29 550//29\nf 102//131 82//131 80//131\nf 112//39 111//39 110//39\nf 100//30 102//30 106//30\nf 101//31 99//31 103//31\nf 100//32 104//32 103//32\nf 107//132 103//132 104//132\nf 103//16 107//16 112//16\nf 112//39 109//39 105//39\nf 106//16 110//16 111//16\nf 111//16 108//16 104//16\nf 109//133 110//133 106//133\nf 111//10 112//10 116//10\nf 116//35 120//35 124//35\nf 107//36 113//36 116//36\nf 111//37 115//37 114//37\nf 107//38 108//38 114//38\nf 120//39 117//39 118//39\nf 113//36 117//36 120//36\nf 115//37 119//37 118//37\nf 113//38 114//38 118//38\nf 121//40 122//40 124//40\nf 115//41 121//41 123//41\nf 120//39 119//39 123//39\nf 116//42 122//42 121//42\nf 128//10 127//10 708//10\nf 126//11 125//11 127//11\nf 707//43 706//43 125//43\nf 708//24 127//24 125//24\nf 128//5 709//5 707//5\nf 136//44 135//44 133//44\nf 140//10 139//10 135//10\nf 138//11 137//11 139//11\nf 134//43 133//43 137//43\nf 135//24 139//24 137//24\nf 140//5 136//5 134//5\nf 144//44 143//44 141//44\nf 148//10 147//10 143//10\nf 146//11 145//11 147//11\nf 142//43 141//43 145//43\nf 143//24 147//24 145//24\nf 148//5 144//5 142//5\nf 220//45 231//45 242//45\nf 219//46 241//46 235//46\nf 223//47 230//47 243//47\nf 215//48 239//48 236//48\nf 224//49 243//49 231//49\nf 227//50 245//50 230//50\nf 213//51 238//51 237//51\nf 214//52 235//52 239//52\nf 225//53 232//53 245//53\nf 222//54 229//54 244//54\nf 226//55 244//55 232//55\nf 216//56 234//56 238//56\nf 221//57 242//57 229//57\nf 212//58 237//58 241//58\nf 217//59 240//59 234//59\nf 846//43 842//43 248//43\nf 843//24 67//24 27//24\nf 843//43 846//43 249//43\nf 207//44 249//44 260//44\nf 248//44 22//44 260//44\nf 249//44 207//44 27//44\nf 251//11 250//11 252//11\nf 255//5 257//5 858//5\nf 848//24 252//24 250//24\nf 253//5 849//5 847//5\nf 254//43 255//43 250//43\nf 254//43 251//43 847//43\nf 255//43 844//43 857//43\nf 859//43 858//43 257//43\nf 856//24 859//24 256//24\nf 254//44 256//44 257//44\nf 303//12 18//12 308//12\nf 23//12 551//12 307//12\nf 545//12 304//12 307//12\nf 308//12 18//12 23//12\nf 551//12 545//12 307//12\nf 314//61 320//61 315//61\nf 310//27 305//27 303//27\nf 312//134 311//134 304//134\nf 312//76 306//76 305//76\nf 313//12 307//12 304//12\nf 314//113 308//113 307//113\nf 314//63 309//63 303//63\nf 326//64 325//64 331//64\nf 313//65 311//65 323//65\nf 310//66 317//66 318//66\nf 311//135 312//135 318//135\nf 309//136 315//136 317//136\nf 322//137 317//137 315//137\nf 324//138 316//138 323//138\nf 324//139 318//139 317//139\nf 325//12 319//12 323//12\nf 325//60 326//60 320//60\nf 326//72 321//72 315//72\nf 324//73 322//73 329//73\nf 333//11 28//11 342//11\nf 20//11 335//11 342//11\nf 339//12 347//12 352//12\nf 28//5 333//5 943//5\nf 333//5 334//5 944//5\nf 337//11 334//11 344//11\nf 341//11 336//11 339//11\nf 344//11 334//11 341//11\nf 344//5 352//5 351//5\nf 334//5 337//5 951//5\nf 337//5 338//5 952//5\nf 342//11 341//11 334//11\nf 344//11 343//11 338//11\nf 345//11 346//11 349//11\nf 347//11 348//11 351//11\nf 343//74 351//74 348//74\nf 342//5 350//5 349//5\nf 335//43 345//43 350//43\nf 341//75 349//75 346//75\nf 340//24 348//24 347//24\nf 336//24 346//24 345//24\nf 550//140 100//140 99//140\nf 99//76 18//76 305//76\nf 18//27 303//27 305//27\nf 552//141 550//141 306//141\nf 304//76 545//76 552//76\nf 99//76 305//76 550//76\nf 306//141 304//141 552//141\nf 572//1 559//1 577//1\nf 667//2 664//2 660//2\nf 576//3 569//3 560//3\nf 633//3 638//3 576//3\nf 677//4 675//4 670//4\nf 655//5 657//5 571//5\nf 833//51 829//51 811//51\nf 642//5 582//5 946//5\nf 639//7 580//7 576//7\nf 924//142 923//142 917//142\nf 687//9 686//9 682//9\nf 580//7 577//7 569//7\nf 641//10 581//10 582//10\nf 955//44 946//44 582//44\nf 582//44 581//44 955//44\nf 1163//12 1164//12 637//12\nf 839//78 649//78 643//78\nf 659//5 633//5 571//5\nf 674//14 676//14 673//14\nf 839//78 840//78 1160//78\nf 848//10 852//10 853//10\nf 635//15 659//15 657//15\nf 577//79 658//79 656//79\nf 558//15 573//15 657//15\nf 560//81 569//81 656//81\nf 651//78 650//78 658//78\nf 559//78 644//78 651//78\nf 1158//82 658//82 839//82\nf 650//78 649//78 839//78\nf 839//82 1159//82 1158//82\nf 558//143 655//143 660//143\nf 662//144 570//144 558//144\nf 656//145 570//145 662//145\nf 660//146 655//146 656//146\nf 666//5 667//5 663//5\nf 661//23 665//23 666//23\nf 664//24 665//24 661//24\nf 668//25 558//25 570//25\nf 669//25 570//25 575//25\nf 573//25 558//25 668//25\nf 575//25 637//25 672//25\nf 635//25 573//25 671//25\nf 678//14 674//14 671//14\nf 675//4 679//4 669//4\nf 679//147 678//147 668//147\nf 680//91 570//91 656//91\nf 681//79 683//79 658//79\nf 658//148 1158//148 1162//148\nf 1162//148 681//148 658//148\nf 656//149 658//149 683//149\nf 691//89 692//89 693//89\nf 681//92 685//92 687//92\nf 682//93 686//93 684//93\nf 684//94 685//94 681//94\nf 685//150 684//150 688//150\nf 693//79 688//79 684//79\nf 684//79 686//79 693//79\nf 692//79 691//79 687//79\nf 687//79 685//79 692//79\nf 690//151 686//151 687//151\nf 692//10 696//10 697//10\nf 697//97 703//97 705//97\nf 697//98 694//98 688//98\nf 695//99 696//99 692//99\nf 688//100 694//100 695//100\nf 701//89 700//89 699//89\nf 701//98 698//98 694//98\nf 699//99 700//99 696//99\nf 694//100 698//100 699//100\nf 702//40 704//40 705//40\nf 704//101 702//101 696//101\nf 701//89 705//89 704//89\nf 702//102 703//102 697//102\nf 708//10 712//10 713//10\nf 712//44 710//44 711//44\nf 710//43 706//43 707//43\nf 710//24 712//24 708//24\nf 707//5 709//5 713//5\nf 718//11 720//11 721//11\nf 720//10 724//10 725//10\nf 724//44 722//44 723//44\nf 722//43 718//43 719//43\nf 722//24 724//24 720//24\nf 719//5 721//5 725//5\nf 726//11 728//11 729//11\nf 728//10 732//10 733//10\nf 732//44 730//44 731//44\nf 730//43 726//43 727//43\nf 730//24 732//24 728//24\nf 727//5 729//5 733//5\nf 835//103 824//103 813//103\nf 828//52 834//52 812//52\nf 836//104 823//104 816//104\nf 829//58 832//58 808//58\nf 824//105 836//105 817//105\nf 823//106 838//106 820//106\nf 830//6 831//6 806//6\nf 832//46 828//46 807//46\nf 838//107 825//107 818//107\nf 837//108 822//108 815//108\nf 825//109 837//109 819//109\nf 831//59 827//59 809//59\nf 822//110 835//110 814//110\nf 834//48 830//48 805//48\nf 827//56 833//56 810//56\nf 841//43 842//43 846//43\nf 579//24 636//24 843//24\nf 845//43 846//43 843//43\nf 841//11 845//11 864//11\nf 864//11 574//11 841//11\nf 579//11 800//11 845//11\nf 852//44 850//44 851//44\nf 858//5 861//5 855//5\nf 850//24 852//24 848//24\nf 847//5 849//5 853//5\nf 851//43 850//43 855//43\nf 847//43 851//43 854//43\nf 855//43 850//43 857//43\nf 861//43 858//43 859//43\nf 860//24 859//24 856//24\nf 861//11 860//11 854//11\nf 575//12 570//12 912//12\nf 570//12 907//12 912//12\nf 1157//12 1163//12 911//12\nf 911//12 908//12 1157//12\nf 575//60 912//60 911//60\nf 919//61 924//61 918//61\nf 907//88 909//88 914//88\nf 916//88 910//88 908//88\nf 909//122 910//122 916//122\nf 908//12 911//12 917//12\nf 911//152 912//152 918//152\nf 918//12 912//12 907//12\nf 930//114 936//114 935//114\nf 917//65 923//65 927//65\nf 922//115 921//115 914//115\nf 915//153 927//153 922//153\nf 921//154 919//154 913//154\nf 919//155 921//155 926//155\nf 928//156 922//156 927//156\nf 921//157 922//157 928//157\nf 927//12 923//12 929//12\nf 929//60 923//60 924//60\nf 930//60 924//60 919//60\nf 928//121 934//121 933//121\nf 572//44 580//44 954//44\nf 954//44 939//44 572//44\nf 964//12 959//12 947//12\nf 943//5 937//5 580//5\nf 944//5 938//5 937//5\nf 953//44 938//44 956//44\nf 956//44 947//44 953//44\nf 938//44 945//44 956//44\nf 963//5 964//5 956//5\nf 951//5 945//5 938//5\nf 952//5 946//5 945//5\nf 938//44 953//44 954//44\nf 946//44 955//44 956//44\nf 961//44 958//44 957//44\nf 963//44 960//44 959//44\nf 960//74 963//74 955//74\nf 961//5 962//5 954//5\nf 962//43 957//43 939//43\nf 958//75 961//75 953//75\nf 959//24 960//24 948//24\nf 957//24 958//24 940//24\nf 680//158 681//158 1162//158\nf 1162//159 1165//159 910//159\nf 1157//122 908//122 1165//122\nf 909//88 907//88 570//88\nf 1165//159 908//159 910//159\nf 909//122 570//122 680//122\nf 1162//122 910//122 909//122\nusemtl Window\nf 88//160 90//160 87//160\nf 97//25 96//25 98//25\nf 676//25 96//25 95//25\nf 667//161 665//161 664//161\nf 678//25 675//25 674//25\nf 675//25 676//25 674//25\nf 88//160 89//160 90//160\nf 97//25 95//25 96//25\nf 676//25 677//25 96//25\nf 667//161 666//161 665//161\nf 678//25 679//25 675//25\nf 675//25 677//25 676//25\nusemtl Wheels\nf 55//162 54//162 47//162\nf 62//163 53//163 54//163\nf 61//164 52//164 53//164\nf 52//165 59//165 51//165\nf 59//166 50//166 51//166\nf 58//167 49//167 50//167\nf 57//168 48//168 49//168\nf 56//169 47//169 48//169\nf 354//11 368//11 360//11\nf 53//44 51//44 49//44\nf 353//11 55//11 56//11\nf 353//11 57//11 355//11\nf 356//11 57//11 58//11\nf 356//11 59//11 357//11\nf 358//11 59//11 60//11\nf 358//11 61//11 359//11\nf 360//11 61//11 62//11\nf 360//11 55//11 354//11\nf 360//11 367//11 359//11\nf 359//11 366//11 358//11\nf 357//11 366//11 365//11\nf 357//11 364//11 356//11\nf 355//11 364//11 363//11\nf 355//11 361//11 353//11\nf 353//11 362//11 354//11\nf 528//11 519//11 527//11\nf 523//11 514//11 515//11\nf 523//11 530//11 522//11\nf 525//11 532//11 524//11\nf 525//11 534//11 533//11\nf 528//11 534//11 526//11\nf 528//11 536//11 535//11\nf 538//44 540//44 542//44\nf 521//11 536//11 527//11\nf 524//11 517//11 525//11\nf 528//11 518//11 520//11\nf 523//11 532//11 531//11\nf 521//11 514//11 522//11\nf 521//11 530//11 529//11\nf 524//11 515//11 516//11\nf 525//11 518//11 526//11\nf 534//168 543//168 542//168\nf 536//162 537//162 544//162\nf 529//163 538//163 537//163\nf 530//164 539//164 538//164\nf 539//165 532//165 540//165\nf 532//166 541//166 540//166\nf 533//167 542//167 541//167\nf 535//169 544//169 543//169\nf 527//11 513//11 521//11\nf 606//162 607//162 599//162\nf 605//163 614//163 606//163\nf 604//164 613//164 605//164\nf 604//165 611//165 612//165\nf 602//166 611//166 603//166\nf 601//167 610//167 602//167\nf 600//168 609//168 601//168\nf 599//169 608//169 600//169\nf 980//44 966//44 972//44\nf 603//11 605//11 599//11\nf 965//44 607//44 966//44\nf 609//44 965//44 967//44\nf 968//44 609//44 967//44\nf 611//44 968//44 969//44\nf 970//44 611//44 969//44\nf 613//44 970//44 971//44\nf 972//44 613//44 971//44\nf 607//44 972//44 966//44\nf 979//44 972//44 971//44\nf 978//44 971//44 970//44\nf 969//44 978//44 970//44\nf 976//44 969//44 968//44\nf 967//44 976//44 968//44\nf 973//44 967//44 965//44\nf 966//44 973//44 965//44\nf 1139//44 1132//44 1140//44\nf 1127//44 1134//44 1135//44\nf 1142//44 1135//44 1134//44\nf 1144//44 1137//44 1136//44\nf 1137//44 1146//44 1138//44\nf 1146//44 1140//44 1138//44\nf 1140//44 1148//44 1139//44\nf 1152//11 1150//11 1156//11\nf 1148//44 1133//44 1139//44\nf 1129//44 1136//44 1137//44\nf 1140//44 1130//44 1138//44\nf 1135//44 1144//44 1136//44\nf 1134//44 1125//44 1133//44\nf 1133//44 1142//44 1134//44\nf 1136//44 1127//44 1135//44\nf 1130//44 1137//44 1138//44\nf 1155//168 1146//168 1154//168\nf 1149//162 1148//162 1156//162\nf 1150//163 1141//163 1149//163\nf 1151//164 1142//164 1150//164\nf 1151//165 1144//165 1143//165\nf 1153//166 1144//166 1152//166\nf 1154//167 1145//167 1153//167\nf 1156//169 1147//169 1155//169\nf 1125//44 1139//44 1133//44\nf 55//162 62//162 54//162\nf 62//163 61//163 53//163\nf 61//164 60//164 52//164\nf 52//165 60//165 59//165\nf 59//166 58//166 50//166\nf 58//167 57//167 49//167\nf 57//168 56//168 48//168\nf 56//169 55//169 47//169\nf 354//11 362//11 368//11\nf 49//44 48//44 47//44\nf 47//44 54//44 53//44\nf 53//44 52//44 51//44\nf 51//44 50//44 49//44\nf 49//44 47//44 53//44\nf 353//11 354//11 55//11\nf 353//11 56//11 57//11\nf 356//11 355//11 57//11\nf 356//11 58//11 59//11\nf 358//11 357//11 59//11\nf 358//11 60//11 61//11\nf 360//11 359//11 61//11\nf 360//11 62//11 55//11\nf 360//11 368//11 367//11\nf 359//11 367//11 366//11\nf 357//11 358//11 366//11\nf 357//11 365//11 364//11\nf 355//11 356//11 364//11\nf 355//11 363//11 361//11\nf 353//11 361//11 362//11\nf 528//11 520//11 519//11\nf 523//11 522//11 514//11\nf 523//11 531//11 530//11\nf 525//11 533//11 532//11\nf 525//11 526//11 534//11\nf 528//11 535//11 534//11\nf 528//11 527//11 536//11\nf 542//44 543//44 544//44\nf 544//44 537//44 538//44\nf 538//44 539//44 540//44\nf 540//44 541//44 542//44\nf 542//44 544//44 538//44\nf 521//11 529//11 536//11\nf 524//11 516//11 517//11\nf 528//11 526//11 518//11\nf 523//11 524//11 532//11\nf 521//11 513//11 514//11\nf 521//11 522//11 530//11\nf 524//11 523//11 515//11\nf 525//11 517//11 518//11\nf 534//168 535//168 543//168\nf 536//162 529//162 537//162\nf 529//163 530//163 538//163\nf 530//164 531//164 539//164\nf 539//165 531//165 532//165\nf 532//166 533//166 541//166\nf 533//167 534//167 542//167\nf 535//169 536//169 544//169\nf 527//11 519//11 513//11\nf 606//162 614//162 607//162\nf 605//163 613//163 614//163\nf 604//164 612//164 613//164\nf 604//165 603//165 611//165\nf 602//166 610//166 611//166\nf 601//167 609//167 610//167\nf 600//168 608//168 609//168\nf 599//169 607//169 608//169\nf 980//44 974//44 966//44\nf 599//11 600//11 601//11\nf 601//11 602//11 603//11\nf 603//11 604//11 605//11\nf 605//11 606//11 599//11\nf 599//11 601//11 603//11\nf 965//44 608//44 607//44\nf 609//44 608//44 965//44\nf 968//44 610//44 609//44\nf 611//44 610//44 968//44\nf 970//44 612//44 611//44\nf 613//44 612//44 970//44\nf 972//44 614//44 613//44\nf 607//44 614//44 972//44\nf 979//44 980//44 972//44\nf 978//44 979//44 971//44\nf 969//44 977//44 978//44\nf 976//44 977//44 969//44\nf 967//44 975//44 976//44\nf 973//44 975//44 967//44\nf 966//44 974//44 973//44\nf 1139//44 1131//44 1132//44\nf 1127//44 1126//44 1134//44\nf 1142//44 1143//44 1135//44\nf 1144//44 1145//44 1137//44\nf 1137//44 1145//44 1146//44\nf 1146//44 1147//44 1140//44\nf 1140//44 1147//44 1148//44\nf 1156//11 1155//11 1154//11\nf 1154//11 1153//11 1152//11\nf 1152//11 1151//11 1150//11\nf 1150//11 1149//11 1156//11\nf 1156//11 1154//11 1152//11\nf 1148//44 1141//44 1133//44\nf 1129//44 1128//44 1136//44\nf 1140//44 1132//44 1130//44\nf 1135//44 1143//44 1144//44\nf 1134//44 1126//44 1125//44\nf 1133//44 1141//44 1142//44\nf 1136//44 1128//44 1127//44\nf 1130//44 1129//44 1137//44\nf 1155//168 1147//168 1146//168\nf 1149//162 1141//162 1148//162\nf 1150//163 1142//163 1141//163\nf 1151//164 1143//164 1142//164\nf 1151//165 1152//165 1144//165\nf 1153//166 1145//166 1144//166\nf 1154//167 1146//167 1145//167\nf 1156//169 1148//169 1147//169\nf 1125//44 1131//44 1139//44\nusemtl Wheel_Rim\nf 489//162 465//162 490//162\nf 488//5 466//5 489//5\nf 498//11 39//11 40//11\nf 499//11 42//11 500//11\nf 502//11 43//11 44//11\nf 503//11 46//11 45//11\nf 39//167 32//167 40//167\nf 42//169 33//169 34//169\nf 44//164 38//164 46//164\nf 45//165 38//165 37//165\nf 368//170 370//170 376//170\nf 396//43 420//43 395//43\nf 368//171 375//171 367//171\nf 367//172 374//172 366//172\nf 365//173 374//173 373//173\nf 364//174 373//174 372//174\nf 364//175 371//175 363//175\nf 361//176 371//176 369//176\nf 361//177 370//177 362//177\nf 378//11 440//11 384//11\nf 401//169 425//169 400//169\nf 405//162 431//162 430//162\nf 408//10 432//10 407//10\nf 374//11 386//11 385//11\nf 383//11 386//11 375//11\nf 382//11 387//11 383//11\nf 382//11 389//11 388//11\nf 381//11 390//11 389//11\nf 374//11 390//11 373//11\nf 372//11 392//11 391//11\nf 381//11 392//11 373//11\nf 380//11 393//11 381//11\nf 380//11 395//11 394//11\nf 379//11 396//11 395//11\nf 372//11 396//11 371//11\nf 369//11 398//11 397//11\nf 379//11 398//11 371//11\nf 377//11 399//11 379//11\nf 377//11 401//11 400//11\nf 378//11 402//11 401//11\nf 369//11 402//11 370//11\nf 376//11 404//11 403//11\nf 378//11 404//11 370//11\nf 384//11 405//11 378//11\nf 384//11 407//11 406//11\nf 383//11 408//11 407//11\nf 376//11 408//11 375//11\nf 409//11 413//11 410//11\nf 415//11 419//11 416//11\nf 421//11 425//11 422//11\nf 427//11 431//11 428//11\nf 403//167 429//167 408//167\nf 389//165 413//165 388//165\nf 394//166 418//166 393//166\nf 399//10 421//10 398//10\nf 386//43 412//43 409//43\nf 391//163 417//163 396//163\nf 398//164 422//164 397//164\nf 386//168 410//168 385//168\nf 407//163 431//163 406//163\nf 402//5 426//5 401//5\nf 405//24 427//24 404//24\nf 390//24 414//24 389//24\nf 395//167 419//167 394//167\nf 400//168 424//168 399//168\nf 404//166 428//166 403//166\nf 388//164 412//164 387//164\nf 393//5 415//5 392//5\nf 397//165 423//165 402//165\nf 390//169 410//169 411//169\nf 392//162 416//162 391//162\nf 434//166 448//166 440//166\nf 383//11 440//11 439//11\nf 383//11 438//11 382//11\nf 382//11 437//11 381//11\nf 381//11 436//11 380//11\nf 379//11 436//11 435//11\nf 379//11 433//11 377//11\nf 378//11 433//11 434//11\nf 445//11 447//11 443//11\nf 440//167 447//167 439//167\nf 439//168 446//168 438//168\nf 437//169 446//169 445//169\nf 437//162 444//162 436//162\nf 436//163 443//163 435//163\nf 433//164 443//164 441//164\nf 434//165 441//165 442//165\nf 45//166 31//166 39//166\nf 498//11 41//11 499//11\nf 500//11 43//11 501//11\nf 502//11 46//11 504//11\nf 34//11 32//11 37//11\nf 40//168 33//168 41//168\nf 42//162 35//162 43//162\nf 43//163 36//163 44//163\nf 474//163 450//163 475//163\nf 491//24 467//24 492//24\nf 486//167 462//167 487//167\nf 481//168 457//168 482//168\nf 477//166 453//166 478//166\nf 493//164 469//164 494//164\nf 484//165 458//165 479//165\nf 496//169 470//169 491//169\nf 482//10 460//10 483//10\nf 495//43 469//43 472//43\nf 490//163 464//163 485//163\nf 483//164 459//164 484//164\nf 495//168 471//168 496//168\nf 479//5 455//5 480//5\nf 476//24 454//24 477//24\nf 501//11 486//11 487//11\nf 505//11 477//11 478//11\nf 504//11 480//11 481//11\nf 498//11 495//11 506//11\nf 499//11 492//11 493//11\nf 503//11 477//11 511//11\nf 497//11 474//11 475//11\nf 498//11 473//11 474//11\nf 497//11 476//11 503//11\nf 507//11 491//11 508//11\nf 500//11 489//11 508//11\nf 505//11 473//11 506//11\nf 466//11 462//11 465//11\nf 492//165 468//165 493//165\nf 472//11 468//11 471//11\nf 509//11 485//11 510//11\nf 502//11 483//11 510//11\nf 460//11 456//11 459//11\nf 487//166 463//166 488//166\nf 478//167 452//167 473//167\nf 454//11 450//11 453//11\nf 502//11 485//11 486//11\nf 473//10 449//10 474//10\nf 503//11 479//11 480//11\nf 512//11 479//11 511//11\nf 518//176 512//176 520//176\nf 514//178 505//178 506//178\nf 503//11 39//11 497//11\nf 516//173 507//173 508//173\nf 476//162 450//162 451//162\nf 517//175 510//175 518//175\nf 485//43 461//43 486//43\nf 513//170 511//170 505//170\nf 520//179 511//179 519//179\nf 515//172 506//172 507//172\nf 480//169 456//169 481//169\nf 517//174 508//174 509//174\nf 507//11 495//11 496//11\nf 499//11 494//11 498//11\nf 500//11 491//11 492//11\nf 509//11 489//11 490//11\nf 501//11 488//11 500//11\nf 512//11 483//11 484//11\nf 504//11 482//11 502//11\nf 1077//162 1101//162 1102//162\nf 1078//5 1100//5 1101//5\nf 1110//44 591//44 1109//44\nf 594//44 1111//44 1112//44\nf 1114//44 595//44 1113//44\nf 1115//44 598//44 1116//44\nf 584//167 591//167 592//167\nf 594//169 585//169 593//169\nf 590//164 596//164 598//164\nf 597//165 590//165 598//165\nf 980//180 982//180 974//180\nf 1032//43 1008//43 1007//43\nf 979//181 988//181 980//181\nf 978//182 987//182 979//182\nf 977//183 986//183 978//183\nf 984//184 977//184 976//184\nf 983//185 976//185 975//185\nf 973//186 983//186 975//186\nf 982//187 973//187 974//187\nf 1052//44 990//44 996//44\nf 1037//169 1013//169 1012//169\nf 1017//162 1043//162 1018//162\nf 1044//10 1020//10 1019//10\nf 986//44 998//44 987//44\nf 998//44 995//44 987//44\nf 999//44 994//44 995//44\nf 994//44 1001//44 993//44\nf 993//44 1002//44 985//44\nf 1002//44 986//44 985//44\nf 984//44 1004//44 985//44\nf 1004//44 993//44 985//44\nf 1005//44 992//44 993//44\nf 992//44 1007//44 991//44\nf 991//44 1008//44 983//44\nf 1008//44 984//44 983//44\nf 981//44 1010//44 983//44\nf 1010//44 991//44 983//44\nf 1011//44 989//44 991//44\nf 989//44 1013//44 990//44\nf 990//44 1014//44 982//44\nf 1014//44 981//44 982//44\nf 988//44 1016//44 982//44\nf 1016//44 990//44 982//44\nf 1017//44 996//44 990//44\nf 996//44 1019//44 995//44\nf 995//44 1020//44 987//44\nf 1020//44 988//44 987//44\nf 1023//44 1025//44 1022//44\nf 1029//44 1031//44 1028//44\nf 1035//44 1037//44 1034//44\nf 1041//44 1043//44 1040//44\nf 1041//167 1015//167 1020//167\nf 1025//165 1001//165 1000//165\nf 1030//166 1006//166 1005//166\nf 1033//10 1011//10 1010//10\nf 998//43 1024//43 999//43\nf 1029//163 1003//163 1008//163\nf 1034//164 1010//164 1009//164\nf 1022//168 998//168 997//168\nf 1043//163 1019//163 1018//163\nf 1038//5 1014//5 1013//5\nf 1039//24 1017//24 1016//24\nf 1026//24 1002//24 1001//24\nf 1031//167 1007//167 1006//167\nf 1036//168 1012//168 1011//168\nf 1040//166 1016//166 1015//166\nf 1024//164 1000//164 999//164\nf 1027//5 1005//5 1004//5\nf 1035//165 1009//165 1014//165\nf 1023//169 997//169 1002//169\nf 1028//162 1004//162 1003//162\nf 1060//166 1046//166 1052//166\nf 995//44 1052//44 996//44\nf 1050//44 995//44 994//44\nf 1049//44 994//44 993//44\nf 1048//44 993//44 992//44\nf 991//44 1048//44 992//44\nf 1045//44 991//44 989//44\nf 990//44 1045//44 989//44\nf 1059//44 1057//44 1055//44\nf 1059//167 1052//167 1051//167\nf 1058//168 1051//168 1050//168\nf 1049//169 1058//169 1050//169\nf 1056//162 1049//162 1048//162\nf 1055//163 1048//163 1047//163\nf 1053//164 1047//164 1045//164\nf 1046//165 1053//165 1045//165\nf 583//166 597//166 591//166\nf 593//44 1110//44 1111//44\nf 595//44 1112//44 1113//44\nf 598//44 1114//44 1116//44\nf 584//44 586//44 589//44\nf 585//168 592//168 593//168\nf 587//162 594//162 595//162\nf 588//163 595//163 596//163\nf 1062//163 1086//163 1087//163\nf 1079//24 1103//24 1104//24\nf 1074//167 1098//167 1099//167\nf 1069//168 1093//168 1094//168\nf 1065//166 1089//166 1090//166\nf 1081//164 1105//164 1106//164\nf 1070//165 1096//165 1091//165\nf 1103//169 1083//169 1108//169\nf 1072//10 1094//10 1095//10\nf 1107//43 1081//43 1106//43\nf 1076//163 1102//163 1097//163\nf 1071//164 1095//164 1096//164\nf 1083//168 1107//168 1108//168\nf 1067//5 1091//5 1092//5\nf 1066//24 1088//24 1089//24\nf 1113//44 1098//44 1114//44\nf 1117//44 1089//44 1123//44\nf 1116//44 1092//44 1115//44\nf 1107//44 1110//44 1118//44\nf 1111//44 1104//44 1112//44\nf 1089//44 1115//44 1123//44\nf 1109//44 1086//44 1110//44\nf 1110//44 1085//44 1118//44\nf 1088//44 1109//44 1115//44\nf 1103//44 1119//44 1120//44\nf 1101//44 1112//44 1120//44\nf 1085//44 1117//44 1118//44\nf 1076//44 1074//44 1077//44\nf 1080//165 1104//165 1105//165\nf 1082//44 1080//44 1083//44\nf 1097//44 1121//44 1122//44\nf 1095//44 1114//44 1122//44\nf 1070//44 1068//44 1071//44\nf 1075//166 1099//166 1100//166\nf 1064//167 1090//167 1085//167\nf 1064//44 1062//44 1065//44\nf 1114//44 1097//44 1122//44\nf 1061//10 1085//10 1086//10\nf 1115//44 1091//44 1123//44\nf 1091//44 1124//44 1123//44\nf 1124//186 1130//186 1132//186\nf 1126//188 1117//188 1125//188\nf 591//44 1115//44 1109//44\nf 1128//183 1119//183 1127//183\nf 1088//162 1062//162 1087//162\nf 1130//189 1121//189 1129//189\nf 1073//43 1097//43 1098//43\nf 1125//190 1123//190 1131//190\nf 1123//191 1132//191 1131//191\nf 1127//182 1118//182 1126//182\nf 1068//169 1092//169 1093//169\nf 1129//192 1120//192 1128//192\nf 1119//44 1107//44 1118//44\nf 1106//44 1111//44 1110//44\nf 1112//44 1103//44 1120//44\nf 1121//44 1101//44 1120//44\nf 1100//44 1113//44 1112//44\nf 1124//44 1095//44 1122//44\nf 1094//44 1116//44 1114//44\nf 489//162 466//162 465//162\nf 488//5 463//5 466//5\nf 498//11 497//11 39//11\nf 499//11 41//11 42//11\nf 502//11 501//11 43//11\nf 503//11 504//11 46//11\nf 39//167 31//167 32//167\nf 42//169 41//169 33//169\nf 44//164 36//164 38//164\nf 45//165 46//165 38//165\nf 368//170 362//170 370//170\nf 396//43 417//43 420//43\nf 368//178 376//178 375//178\nf 367//193 375//193 374//193\nf 365//173 366//173 374//173\nf 364//174 365//174 373//174\nf 364//175 372//175 371//175\nf 361//176 363//176 371//176\nf 361//177 369//177 370//177\nf 378//11 434//11 440//11\nf 401//169 426//169 425//169\nf 405//162 406//162 431//162\nf 408//10 429//10 432//10\nf 374//11 375//11 386//11\nf 383//11 387//11 386//11\nf 382//11 388//11 387//11\nf 382//11 381//11 389//11\nf 381//11 373//11 390//11\nf 374//11 385//11 390//11\nf 372//11 373//11 392//11\nf 381//11 393//11 392//11\nf 380//11 394//11 393//11\nf 380//11 379//11 395//11\nf 379//11 371//11 396//11\nf 372//11 391//11 396//11\nf 369//11 371//11 398//11\nf 379//11 399//11 398//11\nf 377//11 400//11 399//11\nf 377//11 378//11 401//11\nf 378//11 370//11 402//11\nf 369//11 397//11 402//11\nf 376//11 370//11 404//11\nf 378//11 405//11 404//11\nf 384//11 406//11 405//11\nf 384//11 383//11 407//11\nf 383//11 375//11 408//11\nf 376//11 403//11 408//11\nf 411//11 410//11 413//11\nf 409//11 412//11 413//11\nf 413//11 414//11 411//11\nf 417//11 416//11 419//11\nf 415//11 418//11 419//11\nf 419//11 420//11 417//11\nf 423//11 422//11 425//11\nf 421//11 424//11 425//11\nf 425//11 426//11 423//11\nf 429//11 428//11 431//11\nf 427//11 430//11 431//11\nf 431//11 432//11 429//11\nf 403//167 428//167 429//167\nf 389//165 414//165 413//165\nf 394//166 419//166 418//166\nf 399//10 424//10 421//10\nf 386//43 387//43 412//43\nf 391//163 416//163 417//163\nf 398//164 421//164 422//164\nf 386//168 409//168 410//168\nf 407//163 432//163 431//163\nf 402//5 423//5 426//5\nf 405//24 430//24 427//24\nf 390//24 411//24 414//24\nf 395//167 420//167 419//167\nf 400//168 425//168 424//168\nf 404//166 427//166 428//166\nf 388//164 413//164 412//164\nf 393//5 418//5 415//5\nf 397//165 422//165 423//165\nf 390//169 385//169 410//169\nf 392//162 415//162 416//162\nf 434//166 442//166 448//166\nf 383//11 384//11 440//11\nf 383//11 439//11 438//11\nf 382//11 438//11 437//11\nf 381//11 437//11 436//11\nf 379//11 380//11 436//11\nf 379//11 435//11 433//11\nf 378//11 377//11 433//11\nf 442//11 441//11 443//11\nf 443//11 444//11 445//11\nf 445//11 446//11 447//11\nf 447//11 448//11 442//11\nf 442//11 443//11 447//11\nf 440//167 448//167 447//167\nf 439//168 447//168 446//168\nf 437//169 438//169 446//169\nf 437//162 445//162 444//162\nf 436//163 444//163 443//163\nf 433//164 435//164 443//164\nf 434//165 433//165 441//165\nf 45//166 37//166 31//166\nf 498//11 40//11 41//11\nf 500//11 42//11 43//11\nf 502//11 44//11 46//11\nf 37//11 38//11 36//11\nf 36//11 35//11 34//11\nf 34//11 33//11 32//11\nf 32//11 31//11 37//11\nf 37//11 36//11 34//11\nf 40//168 32//168 33//168\nf 42//162 34//162 35//162\nf 43//163 35//163 36//163\nf 474//163 449//163 450//163\nf 491//24 470//24 467//24\nf 486//167 461//167 462//167\nf 481//168 456//168 457//168\nf 477//166 454//166 453//166\nf 493//164 468//164 469//164\nf 484//165 459//165 458//165\nf 496//169 471//169 470//169\nf 482//10 457//10 460//10\nf 495//43 494//43 469//43\nf 490//163 465//163 464//163\nf 483//164 460//164 459//164\nf 495//168 472//168 471//168\nf 479//5 458//5 455//5\nf 476//24 451//24 454//24\nf 501//11 502//11 486//11\nf 505//11 511//11 477//11\nf 504//11 503//11 480//11\nf 498//11 494//11 495//11\nf 499//11 500//11 492//11\nf 503//11 476//11 477//11\nf 497//11 498//11 474//11\nf 498//11 506//11 473//11\nf 497//11 475//11 476//11\nf 507//11 496//11 491//11\nf 500//11 488//11 489//11\nf 505//11 478//11 473//11\nf 464//11 465//11 462//11\nf 466//11 463//11 462//11\nf 462//11 461//11 464//11\nf 492//165 467//165 468//165\nf 470//11 471//11 468//11\nf 472//11 469//11 468//11\nf 468//11 467//11 470//11\nf 509//11 490//11 485//11\nf 502//11 482//11 483//11\nf 458//11 459//11 456//11\nf 460//11 457//11 456//11\nf 456//11 455//11 458//11\nf 487//166 462//166 463//166\nf 478//167 453//167 452//167\nf 452//11 453//11 450//11\nf 454//11 451//11 450//11\nf 450//11 449//11 452//11\nf 502//11 510//11 485//11\nf 473//10 452//10 449//10\nf 503//11 511//11 479//11\nf 512//11 484//11 479//11\nf 518//176 510//176 512//176\nf 514//171 513//171 505//171\nf 503//11 45//11 39//11\nf 516//173 515//173 507//173\nf 476//162 475//162 450//162\nf 517//194 509//194 510//194\nf 485//43 464//43 461//43\nf 513//195 519//195 511//195\nf 520//196 512//196 511//196\nf 515//193 514//193 506//193\nf 480//169 455//169 456//169\nf 517//197 516//197 508//197\nf 507//11 506//11 495//11\nf 499//11 493//11 494//11\nf 500//11 508//11 491//11\nf 509//11 508//11 489//11\nf 501//11 487//11 488//11\nf 512//11 510//11 483//11\nf 504//11 481//11 482//11\nf 1077//162 1078//162 1101//162\nf 1078//5 1075//5 1100//5\nf 1110//44 592//44 591//44\nf 594//44 593//44 1111//44\nf 1114//44 596//44 595//44\nf 1115//44 597//44 598//44\nf 584//167 583//167 591//167\nf 594//169 586//169 585//169\nf 590//164 588//164 596//164\nf 597//165 589//165 590//165\nf 980//180 988//180 982//180\nf 1032//43 1029//43 1008//43\nf 979//181 987//181 988//181\nf 978//182 986//182 987//182\nf 977//183 985//183 986//183\nf 984//184 985//184 977//184\nf 983//185 984//185 976//185\nf 973//186 981//186 983//186\nf 982//187 981//187 973//187\nf 1052//44 1046//44 990//44\nf 1037//169 1038//169 1013//169\nf 1017//162 1042//162 1043//162\nf 1044//10 1041//10 1020//10\nf 986//44 997//44 998//44\nf 998//44 999//44 995//44\nf 999//44 1000//44 994//44\nf 994//44 1000//44 1001//44\nf 993//44 1001//44 1002//44\nf 1002//44 997//44 986//44\nf 984//44 1003//44 1004//44\nf 1004//44 1005//44 993//44\nf 1005//44 1006//44 992//44\nf 992//44 1006//44 1007//44\nf 991//44 1007//44 1008//44\nf 1008//44 1003//44 984//44\nf 981//44 1009//44 1010//44\nf 1010//44 1011//44 991//44\nf 1011//44 1012//44 989//44\nf 989//44 1012//44 1013//44\nf 990//44 1013//44 1014//44\nf 1014//44 1009//44 981//44\nf 988//44 1015//44 1016//44\nf 1016//44 1017//44 990//44\nf 1017//44 1018//44 996//44\nf 996//44 1018//44 1019//44\nf 995//44 1019//44 1020//44\nf 1020//44 1015//44 988//44\nf 1021//44 1022//44 1025//44\nf 1023//44 1026//44 1025//44\nf 1025//44 1024//44 1021//44\nf 1027//44 1028//44 1031//44\nf 1029//44 1032//44 1031//44\nf 1031//44 1030//44 1027//44\nf 1033//44 1034//44 1037//44\nf 1035//44 1038//44 1037//44\nf 1037//44 1036//44 1033//44\nf 1039//44 1040//44 1043//44\nf 1041//44 1044//44 1043//44\nf 1043//44 1042//44 1039//44\nf 1041//167 1040//167 1015//167\nf 1025//165 1026//165 1001//165\nf 1030//166 1031//166 1006//166\nf 1033//10 1036//10 1011//10\nf 998//43 1021//43 1024//43\nf 1029//163 1028//163 1003//163\nf 1034//164 1033//164 1010//164\nf 1022//168 1021//168 998//168\nf 1043//163 1044//163 1019//163\nf 1038//5 1035//5 1014//5\nf 1039//24 1042//24 1017//24\nf 1026//24 1023//24 1002//24\nf 1031//167 1032//167 1007//167\nf 1036//168 1037//168 1012//168\nf 1040//166 1039//166 1016//166\nf 1024//164 1025//164 1000//164\nf 1027//5 1030//5 1005//5\nf 1035//165 1034//165 1009//165\nf 1023//169 1022//169 997//169\nf 1028//162 1027//162 1004//162\nf 1060//166 1054//166 1046//166\nf 995//44 1051//44 1052//44\nf 1050//44 1051//44 995//44\nf 1049//44 1050//44 994//44\nf 1048//44 1049//44 993//44\nf 991//44 1047//44 1048//44\nf 1045//44 1047//44 991//44\nf 990//44 1046//44 1045//44\nf 1055//44 1053//44 1054//44\nf 1054//44 1060//44 1059//44\nf 1059//44 1058//44 1057//44\nf 1057//44 1056//44 1055//44\nf 1055//44 1054//44 1059//44\nf 1059//167 1060//167 1052//167\nf 1058//168 1059//168 1051//168\nf 1049//169 1057//169 1058//169\nf 1056//162 1057//162 1049//162\nf 1055//163 1056//163 1048//163\nf 1053//164 1055//164 1047//164\nf 1046//165 1054//165 1053//165\nf 583//166 589//166 597//166\nf 593//44 592//44 1110//44\nf 595//44 594//44 1112//44\nf 598//44 596//44 1114//44\nf 588//44 590//44 589//44\nf 589//44 583//44 584//44\nf 584//44 585//44 586//44\nf 586//44 587//44 588//44\nf 588//44 589//44 586//44\nf 585//168 584//168 592//168\nf 587//162 586//162 594//162\nf 588//163 587//163 595//163\nf 1062//163 1061//163 1086//163\nf 1079//24 1082//24 1103//24\nf 1074//167 1073//167 1098//167\nf 1069//168 1068//168 1093//168\nf 1065//166 1066//166 1089//166\nf 1081//164 1080//164 1105//164\nf 1070//165 1071//165 1096//165\nf 1103//169 1082//169 1083//169\nf 1072//10 1069//10 1094//10\nf 1107//43 1084//43 1081//43\nf 1076//163 1077//163 1102//163\nf 1071//164 1072//164 1095//164\nf 1083//168 1084//168 1107//168\nf 1067//5 1070//5 1091//5\nf 1066//24 1063//24 1088//24\nf 1113//44 1099//44 1098//44\nf 1117//44 1090//44 1089//44\nf 1116//44 1093//44 1092//44\nf 1107//44 1106//44 1110//44\nf 1111//44 1105//44 1104//44\nf 1089//44 1088//44 1115//44\nf 1109//44 1087//44 1086//44\nf 1110//44 1086//44 1085//44\nf 1088//44 1087//44 1109//44\nf 1103//44 1108//44 1119//44\nf 1101//44 1100//44 1112//44\nf 1085//44 1090//44 1117//44\nf 1078//44 1077//44 1074//44\nf 1076//44 1073//44 1074//44\nf 1074//44 1075//44 1078//44\nf 1080//165 1079//165 1104//165\nf 1084//44 1083//44 1080//44\nf 1082//44 1079//44 1080//44\nf 1080//44 1081//44 1084//44\nf 1097//44 1102//44 1121//44\nf 1095//44 1094//44 1114//44\nf 1072//44 1071//44 1068//44\nf 1070//44 1067//44 1068//44\nf 1068//44 1069//44 1072//44\nf 1075//166 1074//166 1099//166\nf 1064//167 1065//167 1090//167\nf 1066//44 1065//44 1062//44\nf 1064//44 1061//44 1062//44\nf 1062//44 1063//44 1066//44\nf 1114//44 1098//44 1097//44\nf 1061//10 1064//10 1085//10\nf 1115//44 1092//44 1091//44\nf 1091//44 1096//44 1124//44\nf 1124//186 1122//186 1130//186\nf 1126//181 1118//181 1117//181\nf 591//44 597//44 1115//44\nf 1128//183 1120//183 1119//183\nf 1088//162 1063//162 1062//162\nf 1130//185 1122//185 1121//185\nf 1073//43 1076//43 1097//43\nf 1125//180 1117//180 1123//180\nf 1123//198 1124//198 1132//198\nf 1127//199 1119//199 1118//199\nf 1068//169 1067//169 1092//169\nf 1129//184 1121//184 1120//184\nf 1119//44 1108//44 1107//44\nf 1106//44 1105//44 1111//44\nf 1112//44 1104//44 1103//44\nf 1121//44 1102//44 1101//44\nf 1100//44 1099//44 1113//44\nf 1124//44 1096//44 1095//44\nf 1094//44 1093//44 1116//44\nusemtl Black\nf 78//11 71//11 73//11\nf 950//24 29//24 340//24\nf 247//24 548//24 204//24\nf 77//200 75//200 70//200\nf 71//201 75//201 74//201\nf 74//202 73//202 71//202\nf 20//24 69//24 72//24\nf 72//203 76//203 77//203\nf 634//24 72//24 654//24\nf 78//11 77//11 70//11\nf 207//43 260//43 258//43\nf 215//43 209//43 214//43\nf 216//43 266//43 217//43\nf 217//43 259//43 211//43\nf 212//43 27//43 207//43\nf 219//43 209//43 27//43\nf 213//43 263//43 216//43\nf 215//43 211//43 203//43\nf 264//43 262//43 205//43\nf 222//43 264//43 221//43\nf 224//43 208//43 223//43\nf 211//43 259//43 226//43\nf 220//43 26//43 224//43\nf 226//43 265//43 222//43\nf 227//43 208//43 203//43\nf 227//43 211//43 225//43\nf 73//24 247//24 248//24\nf 654//24 73//24 842//24\nf 281//24 298//24 280//24\nf 277//5 295//5 276//5\nf 271//5 289//5 270//5\nf 264//43 267//43 262//43\nf 264//43 269//43 268//43\nf 206//43 269//43 265//43\nf 206//43 271//43 270//43\nf 262//43 271//43 5//43\nf 261//43 273//43 272//43\nf 266//43 273//43 259//43\nf 266//43 275//43 274//43\nf 210//43 275//43 263//43\nf 204//43 276//43 210//43\nf 204//43 278//43 277//43\nf 265//43 278//43 206//43\nf 261//43 279//43 265//43\nf 258//43 281//43 280//43\nf 22//43 281//43 260//43\nf 210//43 282//43 22//43\nf 210//43 284//43 283//43\nf 258//43 284//43 263//43\nf 286//43 289//43 287//43\nf 291//43 293//43 296//43\nf 298//43 302//43 300//43\nf 269//24 286//24 268//24\nf 275//24 293//24 274//24\nf 268//24 285//24 267//24\nf 272//24 292//24 279//24\nf 283//5 301//5 282//5\nf 278//5 296//5 277//5\nf 280//24 300//24 284//24\nf 270//11 288//11 269//11\nf 276//11 294//11 275//11\nf 267//204 287//204 271//204\nf 274//24 291//24 273//24\nf 273//24 290//24 272//24\nf 284//44 302//44 283//44\nf 279//44 297//44 278//44\nf 282//11 299//11 281//11\nf 634//24 335//24 20//24\nf 941//24 336//24 335//24\nf 942//24 339//24 336//24\nf 949//24 340//24 339//24\nf 546//18 26//18 547//18\nf 549//27 545//27 26//27\nf 546//29 549//29 26//29\nf 262//13 548//13 205//13\nf 209//12 203//12 545//12\nf 1164//205 27//205 551//205\nf 646//44 653//44 648//44\nf 581//24 950//24 948//24\nf 797//24 840//24 841//24\nf 650//200 652//200 645//200\nf 650//201 646//201 649//201\nf 648//202 649//202 646//202\nf 644//24 572//24 647//24\nf 651//203 647//203 652//203\nf 653//24 647//24 654//24\nf 652//44 653//44 645//44\nf 862//43 800//43 805//43\nf 802//43 808//43 807//43\nf 870//43 809//43 810//43\nf 863//43 870//43 810//43\nf 805//43 579//43 812//43\nf 812//43 802//43 807//43\nf 867//43 806//43 809//43\nf 808//43 804//43 811//43\nf 798//43 868//43 814//43\nf 868//43 815//43 814//43\nf 801//43 817//43 816//43\nf 863//43 804//43 819//43\nf 578//43 813//43 817//43\nf 869//43 819//43 815//43\nf 820//43 801//43 816//43\nf 804//43 820//43 818//43\nf 840//24 648//24 841//24\nf 648//24 653//24 654//24\nf 902//24 885//24 884//24\nf 899//5 881//5 880//5\nf 893//5 875//5 874//5\nf 871//43 868//43 866//43\nf 868//43 873//43 869//43\nf 873//43 799//43 869//43\nf 799//43 875//43 557//43\nf 875//43 866//43 557//43\nf 865//43 877//43 863//43\nf 877//43 870//43 863//43\nf 870//43 879//43 867//43\nf 879//43 803//43 867//43\nf 880//43 797//43 803//43\nf 797//43 882//43 799//43\nf 882//43 869//43 799//43\nf 883//43 865//43 869//43\nf 862//43 885//43 864//43\nf 885//43 574//43 864//43\nf 886//43 803//43 574//43\nf 803//43 888//43 867//43\nf 888//43 862//43 867//43\nf 893//43 892//43 890//43\nf 894//43 900//43 895//43\nf 902//43 905//43 903//43\nf 890//24 873//24 872//24\nf 897//24 879//24 878//24\nf 889//24 872//24 871//24\nf 896//24 876//24 883//24\nf 905//5 887//5 886//5\nf 900//5 882//5 881//5\nf 904//24 884//24 888//24\nf 892//44 874//44 873//44\nf 898//44 880//44 879//44\nf 891//206 871//206 875//206\nf 895//24 878//24 877//24\nf 894//24 877//24 876//24\nf 906//11 888//11 887//11\nf 901//11 883//11 882//11\nf 903//44 886//44 885//44\nf 939//24 634//24 572//24\nf 940//24 941//24 939//24\nf 947//24 942//24 940//24\nf 948//24 949//24 947//24\nf 1158//82 1159//82 578//82\nf 1161//122 1157//122 1165//122\nf 1158//148 578//148 1161//148\nf 1160//78 557//78 866//78\nf 796//12 802//12 1157//12\nf 579//205 1164//205 1163//205\nf 78//11 70//11 71//11\nf 950//24 641//24 29//24\nf 210//24 22//24 248//24\nf 248//24 247//24 204//24\nf 548//24 5//24 206//24\nf 204//24 210//24 248//24\nf 548//24 206//24 204//24\nf 77//200 76//200 75//200\nf 71//201 70//201 75//201\nf 74//202 68//202 73//202\nf 20//24 7//24 69//24\nf 72//203 69//203 76//203\nf 78//24 654//24 72//24\nf 634//24 20//24 72//24\nf 78//11 72//11 77//11\nf 258//43 213//43 212//43\nf 212//43 207//43 258//43\nf 215//43 203//43 209//43\nf 216//43 263//43 266//43\nf 211//43 218//43 217//43\nf 217//43 266//43 259//43\nf 212//43 219//43 27//43\nf 219//43 214//43 209//43\nf 213//43 258//43 263//43\nf 215//43 218//43 211//43\nf 205//43 220//43 221//43\nf 221//43 264//43 205//43\nf 222//43 265//43 264//43\nf 224//43 26//43 208//43\nf 261//43 226//43 259//43\nf 225//43 211//43 226//43\nf 220//43 205//43 26//43\nf 226//43 261//43 265//43\nf 227//43 223//43 208//43\nf 227//43 203//43 211//43\nf 73//24 68//24 247//24\nf 248//24 842//24 73//24\nf 654//24 78//24 73//24\nf 281//24 299//24 298//24\nf 277//5 296//5 295//5\nf 271//5 287//5 289//5\nf 264//43 268//43 267//43\nf 264//43 265//43 269//43\nf 206//43 270//43 269//43\nf 206//43 5//43 271//43\nf 262//43 267//43 271//43\nf 261//43 259//43 273//43\nf 266//43 274//43 273//43\nf 266//43 263//43 275//43\nf 210//43 276//43 275//43\nf 204//43 277//43 276//43\nf 204//43 206//43 278//43\nf 265//43 279//43 278//43\nf 261//43 272//43 279//43\nf 258//43 260//43 281//43\nf 22//43 282//43 281//43\nf 210//43 283//43 282//43\nf 210//43 263//43 284//43\nf 258//43 280//43 284//43\nf 287//43 285//43 286//43\nf 286//43 288//43 289//43\nf 290//43 291//43 296//43\nf 293//43 294//43 295//43\nf 296//43 297//43 290//43\nf 293//43 295//43 296//43\nf 297//43 292//43 290//43\nf 298//43 299//43 301//43\nf 301//43 302//43 298//43\nf 269//24 288//24 286//24\nf 275//24 294//24 293//24\nf 268//24 286//24 285//24\nf 272//24 290//24 292//24\nf 283//5 302//5 301//5\nf 278//5 297//5 296//5\nf 280//24 298//24 300//24\nf 270//11 289//11 288//11\nf 276//11 295//11 294//11\nf 267//204 285//204 287//204\nf 274//24 293//24 291//24\nf 273//24 291//24 290//24\nf 284//44 300//44 302//44\nf 279//44 292//44 297//44\nf 282//11 301//11 299//11\nf 634//24 941//24 335//24\nf 941//24 942//24 336//24\nf 942//24 949//24 339//24\nf 949//24 950//24 340//24\nf 549//76 552//76 545//76\nf 547//13 26//13 205//13\nf 262//13 5//13 548//13\nf 547//13 205//13 548//13\nf 26//12 545//12 208//12\nf 551//207 27//207 209//207\nf 203//12 208//12 545//12\nf 551//12 209//12 545//12\nf 1164//205 640//205 27//205\nf 646//44 645//44 653//44\nf 581//24 641//24 950//24\nf 841//24 574//24 803//24\nf 797//24 799//24 1160//24\nf 841//24 803//24 797//24\nf 1160//24 840//24 797//24\nf 799//24 557//24 1160//24\nf 650//200 651//200 652//200\nf 650//201 645//201 646//201\nf 648//202 643//202 649//202\nf 644//24 559//24 572//24\nf 651//203 644//203 647//203\nf 634//24 654//24 647//24\nf 647//24 572//24 634//24\nf 652//44 647//44 653//44\nf 805//43 806//43 862//43\nf 862//43 864//43 800//43\nf 802//43 796//43 808//43\nf 870//43 867//43 809//43\nf 810//43 811//43 804//43\nf 804//43 863//43 810//43\nf 805//43 800//43 579//43\nf 812//43 579//43 802//43\nf 867//43 862//43 806//43\nf 808//43 796//43 804//43\nf 814//43 813//43 798//43\nf 798//43 866//43 868//43\nf 868//43 869//43 815//43\nf 801//43 578//43 817//43\nf 818//43 819//43 804//43\nf 865//43 863//43 819//43\nf 578//43 798//43 813//43\nf 869//43 865//43 819//43\nf 820//43 796//43 801//43\nf 804//43 796//43 820//43\nf 840//24 643//24 648//24\nf 654//24 842//24 648//24\nf 841//24 648//24 842//24\nf 902//24 903//24 885//24\nf 899//5 900//5 881//5\nf 893//5 891//5 875//5\nf 871//43 872//43 868//43\nf 868//43 872//43 873//43\nf 873//43 874//43 799//43\nf 799//43 874//43 875//43\nf 875//43 871//43 866//43\nf 865//43 876//43 877//43\nf 877//43 878//43 870//43\nf 870//43 878//43 879//43\nf 879//43 880//43 803//43\nf 880//43 881//43 797//43\nf 797//43 881//43 882//43\nf 882//43 883//43 869//43\nf 883//43 876//43 865//43\nf 862//43 884//43 885//43\nf 885//43 886//43 574//43\nf 886//43 887//43 803//43\nf 803//43 887//43 888//43\nf 888//43 884//43 862//43\nf 890//43 889//43 891//43\nf 891//43 893//43 890//43\nf 894//43 896//43 901//43\nf 900//43 899//43 897//43\nf 894//43 901//43 900//43\nf 897//43 895//43 900//43\nf 899//43 898//43 897//43\nf 902//43 904//43 906//43\nf 906//43 905//43 902//43\nf 890//24 892//24 873//24\nf 897//24 898//24 879//24\nf 889//24 890//24 872//24\nf 896//24 894//24 876//24\nf 905//5 906//5 887//5\nf 900//5 901//5 882//5\nf 904//24 902//24 884//24\nf 892//44 893//44 874//44\nf 898//44 899//44 880//44\nf 891//206 889//206 871//206\nf 895//24 897//24 878//24\nf 894//24 895//24 877//24\nf 906//11 904//11 888//11\nf 901//11 896//11 883//11\nf 903//44 905//44 886//44\nf 939//24 941//24 634//24\nf 940//24 942//24 941//24\nf 947//24 949//24 942//24\nf 948//24 950//24 949//24\nf 1161//88 578//88 1157//88\nf 798//78 578//78 1159//78\nf 1159//78 1160//78 798//78\nf 866//78 798//78 1160//78\nf 1163//12 1157//12 802//12\nf 801//12 796//12 1157//12\nf 1157//12 578//12 801//12\nf 802//208 579//208 1163//208\nf 579//205 640//205 1164//205\nusemtl Cream\nf 10//11 3//11 9//11\nf 150//24 3//24 1//24\nf 12//11 9//11 11//11\nf 2//11 11//11 4//11\nf 628//10 159//10 156//10\nf 10//209 153//209 151//209\nf 10//11 14//11 13//11\nf 13//24 155//24 153//24\nf 13//11 16//11 15//11\nf 15//24 157//24 155//24\nf 16//11 63//11 15//11\nf 16//11 66//11 64//11\nf 64//43 160//43 158//43\nf 631//5 160//5 159//5\nf 630//43 157//43 158//43\nf 626//5 156//5 154//5\nf 621//43 152//43 162//43\nf 624//210 154//210 152//210\nf 149//5 621//5 162//5\nf 623//43 150//43 151//43\nf 619//10 163//10 751//10\nf 131//10 9//10 3//10\nf 132//10 9//10 130//10\nf 129//10 11//10 132//10\nf 131//10 161//10 164//10\nf 750//10 161//10 620//10\nf 163//24 759//24 751//24\nf 129//10 149//10 4//10\nf 151//43 1//43 10//43\nf 4//5 162//5 2//5\nf 152//210 14//210 12//210\nf 162//43 12//43 2//43\nf 154//5 16//5 14//5\nf 158//43 63//43 64//43\nf 159//5 66//5 65//5\nf 158//43 632//43 630//43\nf 627//24 157//24 629//24\nf 625//24 155//24 627//24\nf 623//209 153//209 625//209\nf 156//10 65//10 16//10\nf 620//24 150//24 622//24\nf 132//10 165//10 166//10\nf 165//44 170//44 166//44\nf 129//10 166//10 163//10\nf 166//44 169//44 163//44\nf 176//10 175//10 130//10\nf 167//10 765//10 173//10\nf 170//10 757//10 761//10\nf 169//10 761//10 759//10\nf 750//5 167//5 164//5\nf 171//44 167//44 173//44\nf 174//10 757//10 168//10\nf 177//5 186//5 180//5\nf 173//10 766//10 174//10\nf 172//44 168//44 165//44\nf 172//44 173//44 174//44\nf 177//211 172//211 178//211\nf 178//10 175//10 179//10\nf 179//10 176//10 180//10\nf 177//10 176//10 171//10\nf 182//10 186//10 181//10\nf 180//44 183//44 179//44\nf 179//24 185//24 178//24\nf 178//11 181//11 177//11\nf 187//44 194//44 190//44\nf 188//10 185//10 183//10\nf 188//211 184//211 189//211\nf 189//10 186//10 190//10\nf 190//10 185//10 187//10\nf 191//5 202//5 200//5\nf 190//24 193//24 189//24\nf 189//11 192//11 188//11\nf 187//5 192//5 191//5\nf 195//10 197//10 198//10\nf 194//24 197//24 193//24\nf 193//11 196//11 192//11\nf 192//5 195//5 191//5\nf 200//44 201//44 199//44\nf 194//24 201//24 198//24\nf 195//10 201//10 202//10\nf 191//43 199//43 194//43\nf 555//44 562//44 561//44\nf 553//24 746//24 735//24\nf 561//44 564//44 563//44\nf 563//44 554//44 556//44\nf 744//10 628//10 741//10\nf 738//209 562//209 736//209\nf 562//44 566//44 564//44\nf 740//24 565//24 738//24\nf 565//44 568//44 566//44\nf 742//24 567//24 740//24\nf 615//44 568//44 567//44\nf 618//44 568//44 616//44\nf 745//43 616//43 743//43\nf 745//5 631//5 744//5\nf 742//43 630//43 743//43\nf 741//5 626//5 739//5\nf 737//43 621//43 747//43\nf 739//210 624//210 737//210\nf 747//5 619//5 734//5\nf 735//43 623//43 736//43\nf 748//10 619//10 751//10\nf 716//10 561//10 715//10\nf 561//10 717//10 715//10\nf 563//10 714//10 717//10\nf 746//10 716//10 749//10\nf 746//10 750//10 620//10\nf 759//24 748//24 751//24\nf 714//10 734//10 748//10\nf 553//43 736//43 562//43\nf 747//5 556//5 554//5\nf 566//210 737//210 564//210\nf 564//43 747//43 554//43\nf 568//5 739//5 566//5\nf 615//43 743//43 616//43\nf 618//5 744//5 617//5\nf 632//43 743//43 630//43\nf 627//24 742//24 740//24\nf 625//24 740//24 738//24\nf 625//209 736//209 623//209\nf 617//10 741//10 568//10\nf 735//24 620//24 622//24\nf 752//10 717//10 753//10\nf 760//11 752//11 753//11\nf 753//10 714//10 748//10\nf 758//11 753//11 748//11\nf 768//10 769//10 715//10\nf 765//10 754//10 764//10\nf 757//10 760//10 761//10\nf 761//10 758//10 759//10\nf 754//5 750//5 749//5\nf 762//11 754//11 749//11\nf 757//10 767//10 755//10\nf 779//5 774//5 770//5\nf 766//10 764//10 767//10\nf 755//11 763//11 752//11\nf 763//11 764//11 762//11\nf 763//10 770//10 771//10\nf 768//10 771//10 772//10\nf 773//10 768//10 772//10\nf 770//10 769//10 773//10\nf 775//10 779//10 778//10\nf 776//11 773//11 772//11\nf 778//24 776//24 772//24\nf 774//44 771//44 770//44\nf 787//11 780//11 783//11\nf 781//10 778//10 780//10\nf 777//10 781//10 782//10\nf 779//10 782//10 783//10\nf 778//10 783//10 780//10\nf 784//5 795//5 788//5\nf 786//24 783//24 782//24\nf 785//44 782//44 781//44\nf 780//5 785//5 781//5\nf 788//10 790//10 789//10\nf 790//24 787//24 786//24\nf 789//44 786//44 785//44\nf 788//5 785//5 784//5\nf 794//11 793//11 792//11\nf 794//24 787//24 791//24\nf 788//10 794//10 791//10\nf 792//43 784//43 787//43\nf 10//11 1//11 3//11\nf 150//24 161//24 3//24\nf 12//11 10//11 9//11\nf 2//11 12//11 11//11\nf 628//10 631//10 159//10\nf 10//209 13//209 153//209\nf 10//11 12//11 14//11\nf 13//24 15//24 155//24\nf 13//11 14//11 16//11\nf 15//24 63//24 157//24\nf 16//11 64//11 63//11\nf 16//11 65//11 66//11\nf 64//43 66//43 160//43\nf 631//5 632//5 160//5\nf 630//43 629//43 157//43\nf 626//5 628//5 156//5\nf 621//43 624//43 152//43\nf 624//210 626//210 154//210\nf 149//5 619//5 621//5\nf 623//43 622//43 150//43\nf 619//10 149//10 163//10\nf 131//10 130//10 9//10\nf 132//10 11//10 9//10\nf 129//10 4//10 11//10\nf 131//10 3//10 161//10\nf 750//10 164//10 161//10\nf 163//24 169//24 759//24\nf 129//10 163//10 149//10\nf 151//43 150//43 1//43\nf 4//5 149//5 162//5\nf 152//210 154//210 14//210\nf 162//43 152//43 12//43\nf 154//5 156//5 16//5\nf 158//43 157//43 63//43\nf 159//5 160//5 66//5\nf 158//43 160//43 632//43\nf 627//24 155//24 157//24\nf 625//24 153//24 155//24\nf 623//209 151//209 153//209\nf 156//10 159//10 65//10\nf 620//24 161//24 150//24\nf 132//10 130//10 165//10\nf 165//44 168//44 170//44\nf 129//10 132//10 166//10\nf 166//44 170//44 169//44\nf 165//10 130//10 175//10\nf 131//10 164//10 176//10\nf 164//10 171//10 176//10\nf 175//10 172//10 165//10\nf 131//10 176//10 130//10\nf 167//10 756//10 765//10\nf 170//10 168//10 757//10\nf 169//10 170//10 761//10\nf 750//5 756//5 167//5\nf 171//44 164//44 167//44\nf 174//10 766//10 757//10\nf 184//5 180//5 186//5\nf 177//5 181//5 186//5\nf 173//10 765//10 766//10\nf 172//44 174//44 168//44\nf 172//44 171//44 173//44\nf 177//10 171//10 172//10\nf 178//10 172//10 175//10\nf 179//10 175//10 176//10\nf 177//10 180//10 176//10\nf 182//10 185//10 186//10\nf 180//44 184//44 183//44\nf 182//24 178//24 185//24\nf 179//24 183//24 185//24\nf 178//11 182//11 181//11\nf 187//44 191//44 194//44\nf 188//10 187//10 185//10\nf 188//212 183//212 184//212\nf 189//10 184//10 186//10\nf 190//10 186//10 185//10\nf 191//5 195//5 202//5\nf 190//24 194//24 193//24\nf 189//11 193//11 192//11\nf 187//5 188//5 192//5\nf 195//10 196//10 197//10\nf 194//24 198//24 197//24\nf 193//11 197//11 196//11\nf 192//5 196//5 195//5\nf 200//44 202//44 201//44\nf 194//24 199//24 201//24\nf 195//10 198//10 201//10\nf 191//43 200//43 199//43\nf 555//44 553//44 562//44\nf 553//24 555//24 746//24\nf 561//44 562//44 564//44\nf 563//44 564//44 554//44\nf 744//10 631//10 628//10\nf 738//209 565//209 562//209\nf 562//44 565//44 566//44\nf 740//24 567//24 565//24\nf 565//44 567//44 568//44\nf 742//24 615//24 567//24\nf 615//44 616//44 568//44\nf 618//44 617//44 568//44\nf 745//43 618//43 616//43\nf 745//5 632//5 631//5\nf 742//43 629//43 630//43\nf 741//5 628//5 626//5\nf 737//43 624//43 621//43\nf 739//210 626//210 624//210\nf 747//5 621//5 619//5\nf 735//43 622//43 623//43\nf 748//10 734//10 619//10\nf 716//10 555//10 561//10\nf 561//10 563//10 717//10\nf 563//10 556//10 714//10\nf 746//10 555//10 716//10\nf 746//10 749//10 750//10\nf 759//24 758//24 748//24\nf 714//10 556//10 734//10\nf 553//43 735//43 736//43\nf 747//5 734//5 556//5\nf 566//210 739//210 737//210\nf 564//43 737//43 747//43\nf 568//5 741//5 739//5\nf 615//43 742//43 743//43\nf 618//5 745//5 744//5\nf 632//43 745//43 743//43\nf 627//24 629//24 742//24\nf 625//24 627//24 740//24\nf 625//209 738//209 736//209\nf 617//10 744//10 741//10\nf 735//24 746//24 620//24\nf 752//10 715//10 717//10\nf 760//11 755//11 752//11\nf 753//10 717//10 714//10\nf 758//11 760//11 753//11\nf 716//10 715//10 769//10\nf 752//10 763//10 768//10\nf 769//10 762//10 749//10\nf 715//10 752//10 768//10\nf 769//10 749//10 716//10\nf 765//10 756//10 754//10\nf 757//10 755//10 760//10\nf 761//10 760//10 758//10\nf 754//5 756//5 750//5\nf 762//11 764//11 754//11\nf 757//10 766//10 767//10\nf 770//5 773//5 779//5\nf 777//5 779//5 773//5\nf 766//10 765//10 764//10\nf 755//11 767//11 763//11\nf 763//11 767//11 764//11\nf 763//213 762//213 770//213\nf 768//10 763//10 771//10\nf 773//10 769//10 768//10\nf 770//10 762//10 769//10\nf 775//10 774//10 779//10\nf 776//11 777//11 773//11\nf 772//24 771//24 778//24\nf 775//24 778//24 771//24\nf 774//44 775//44 771//44\nf 787//11 784//11 780//11\nf 781//10 776//10 778//10\nf 777//211 776//211 781//211\nf 779//10 777//10 782//10\nf 778//10 779//10 783//10\nf 784//5 793//5 795//5\nf 786//24 787//24 783//24\nf 785//44 786//44 782//44\nf 780//5 784//5 785//5\nf 788//10 791//10 790//10\nf 790//24 791//24 787//24\nf 789//44 790//44 786//44\nf 788//5 789//5 785//5\nf 794//11 795//11 793//11\nf 794//24 792//24 787//24\nf 788//10 795//10 794//10\nf 792//43 793//43 784//43\nusemtl Silver\nf 233//43 238//43 234//43\nf 228//43 244//43 229//43\nf 228//43 242//43 231//43\nf 243//43 228//43 231//43\nf 245//43 228//43 230//43\nf 233//43 240//43 236//43\nf 239//43 233//43 236//43\nf 241//43 233//43 235//43\nf 321//214 332//214 327//214\nf 327//215 331//215 328//215\nf 328//216 329//216 327//216\nf 316//217 331//217 325//217\nf 316//218 330//218 328//218\nf 321//219 329//219 322//219\nf 826//43 831//43 830//43\nf 821//43 837//43 825//43\nf 835//43 821//43 824//43\nf 836//43 821//43 823//43\nf 821//43 838//43 823//43\nf 833//43 826//43 829//43\nf 832//43 826//43 828//43\nf 826//43 834//43 828//43\nf 925//220 936//220 930//220\nf 931//60 935//60 936//60\nf 932//221 933//221 934//221\nf 935//217 920//217 929//217\nf 920//222 934//222 928//222\nf 933//223 925//223 926//223\nf 233//43 237//43 238//43\nf 228//43 232//43 244//43\nf 228//43 229//43 242//43\nf 243//43 230//43 228//43\nf 245//43 232//43 228//43\nf 233//43 234//43 240//43\nf 239//43 235//43 233//43\nf 241//43 237//43 233//43\nf 321//220 326//220 332//220\nf 327//60 332//60 331//60\nf 328//224 330//224 329//224\nf 316//217 328//217 331//217\nf 316//225 324//225 330//225\nf 321//226 327//226 329//226\nf 826//43 827//43 831//43\nf 821//43 822//43 837//43\nf 835//43 822//43 821//43\nf 836//43 824//43 821//43\nf 821//43 825//43 838//43\nf 833//43 827//43 826//43\nf 832//43 829//43 826//43\nf 826//43 830//43 834//43\nf 925//214 931//214 936//214\nf 931//215 932//215 935//215\nf 932//227 931//227 933//227\nf 935//217 932//217 920//217\nf 920//228 932//228 934//228\nf 933//229 931//229 925//229\n"
  },
  {
    "path": "examples/old/basic.html",
    "content": "<!doctype html>\n<head>\n    <title>Threebox Basic Example</title>\n    <script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n    <script src=\"config.js\"></script>\n\n    <script src='https://api.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.js'></script>\n    <link href='https://api.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.css' rel='stylesheet' />\n    <style>\n        body, html { \n            width: 100%;\n            height: 100%;\n            margin: 0;\n        }\n        #map { \n            width: 100%;\n            height: 100%;\n        }\n    </style>\n</head>\n<body>\n    <div id='map' class='map'></div>\n\n    <script>\n    if(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n    \n    mapboxgl.accessToken = config.accessToken;\n    var map = new mapboxgl.Map({\n      container: 'map',\n      style: 'mapbox://styles/mapbox/streets-v9',\n      center: [-122.4131, 37.7743],\n      zoom: 15.95,\n      pitch: 60,\n      heading: 41,\n      hash: true\n    });\n\n    map.on(\"load\", function() {\n        // Initialize threebox\n        window.threebox = new Threebox(map);\n        threebox.setupDefaultLights();\n\n\n        // Load and manipulate a THREE.js scenegraph as you would normally\n        loader = new THREE.JSONLoader();\n\n        loader.load(\"models/boeing747-400-jw.json\", function(geometry) {\n            geometry.rotateY((90/360)*2*Math.PI);\n            geometry.rotateX((90/360)*2*Math.PI);\n\n            var material = new THREE.MeshPhongMaterial( {color: 0xaaaaff, side: THREE.DoubleSide}); \n            aircraft = new THREE.Mesh( geometry, material );\n            var planePosition = [-122.41356, 37.77577 ,100];\n\n            // Add the model to the threebox scenegraph at a specific geographic coordinate\n            threebox.addAtCoordinate(aircraft, planePosition, {scaleToLatitude: true, preScale: 2});\n        });\n\n    });\n\n\n    </script>\n</body>"
  },
  {
    "path": "examples/old/flocking.html",
    "content": "<!doctype html>\n<head>\n    <title>Flocking Trucks SymbolLayer3D example</title>\n    <script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n    <script src=\"config.js\"></script>\n\n    <script src='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js'></script>\n    <link href='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css' rel='stylesheet' />\n    <style>\n        body, html { \n            width: 100%;\n            height: 100%;\n            margin: 0;\n        }\n        #map { \n            width: 100%;\n            height: 100%;\n        }\n    </style>\n</head>\n<body>\n    <div id='map' class='map'></div>\n\n    <script>\n    if(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n    \n    mapboxgl.accessToken = config.accessToken;\n    var map = new mapboxgl.Map({\n      container: 'map',\n      style: 'mapbox://styles/mapbox/dark-v9',\n      center: [-122.4131, 37.7743],\n      zoom: 15.95,\n      pitch: 60,\n      heading: 41,\n      hash: true,\n      maxZoom: 24\n    });\n\n    map.on(\"load\", function() {\n\n        map.addLayer({\n            id: 'custom_layer',\n            type: 'custom',\n            onAdd: function(map, gl){\n                window.threebox = new Threebox(map, gl);\n\n                onAdd(map, gl)\n            },\n            render: function(gl, matrix){\n                threebox.update();\n            }\n        });\n\n\n        threebox.setupDefaultLights();\n\n    });\n\n    function onAdd(map, gl){\n\n        var source = {\n            type: \"FeatureCollection\",\n            features: []\n        };\n\n        for (var i = 0; i < 100; i++) {\n            var newFeat = {\n                type: \"Feature\",\n                properties: {\n                    heading: randomRange(0, 360),\n                    headingChange: 0,\n                    zAcceleration: 0,\n                    size: 60,\n                    id: i\n                },\n                geometry: {\n                    type: \"Point\",\n                    coordinates: [\n                        randomRange(-122.508544921875, -122.37945556640624), \n                        randomRange(37.70229391925025, 37.800289863702076), \n                        randomRange(0,2000)\n                    ]\n                }\n            }\n            source.features.push(newFeat);\n        }\n\n        var symbols = threebox.addSymbolLayer({\n            id:             \"trucks\",\n            source:         source, // You can also specify a URL or relative path such as \"data/points.geojson\",\n            modelName:      \"Truck\",    // will look for an .obj and .mtl file with this name\n            modelDirectory: \"models/\",          // in this directory\n            rotation:       { \n                generator: feature => (\n                    new THREE.Euler(\n                        Math.PI / 2, \n                        -feature.properties['headingChange'] * 10  * Math.PI / 180, \n                        -feature.properties['heading'] * Math.PI / 180, \"ZYX\"\n                    )\n                ) \n            },\n            // scale:          { property: 'size' },\n            // scaleWithMapProjection: true,\n            key:            { property: \"id\" }\n        });\n        return;\n        var cohere = true;\n\n\n        var lastT = performance.now();\n        const drive = (t) => {\n            const dT = t - lastT;\n            lastT = t;\n            const fpsFactor = Math.min(dT,1000) / 16.7 * 2;\n            \n\n            var source = symbols.source;\n            if(symbols.loaded && source) {\n\n                const kSeparation = -0.00000001;\n                const nSeparation = Math.ceil(source.features.length / 20);\n                const separationDistance = 0.00005;\n\n                const kAlignment = 0.01;\n                const nAlignment = 5;\n\n                const kCohesion = 0.0005;\n                const nCohesion = Math.ceil(source.features.length / 4);\n\n                const headingDiff = (a,b) => (((((a - b) % 360) + 540) % 360) - 180);\n\n                const speed = 0.0001;\n                const targetAltitude = 10000000/Math.pow(2, map.transform.zoom);\n                source.features.forEach((f,i) => {\n                    if(f.properties.headingChange === undefined) f.properties.headingChange = 0;\n                    \n                    // Find neighbors (brute force search for now) and implement flocking algorithm\n                    var neighbors = [];\n                    source.features.forEach(f2 => {\n                        const deltaX = f.geometry.coordinates[0] - f2.geometry.coordinates[0];\n                        const deltaY = f.geometry.coordinates[1] - f2.geometry.coordinates[1];\n                        const deltaZ = (f.geometry.coordinates[2] - f2.geometry.coordinates[2]) / 10000;\n                        const distance = deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;\n                        neighbors.push({\n                            feature: f2,\n                            distance: distance\n                        });\n                    });\n                    neighbors = neighbors.sort((a,b) => (a.distance - b.distance)).slice(1);\n                    const alignmentNeighbors = neighbors.slice(0,nAlignment);\n                    const alignment = kAlignment * alignmentNeighbors\n                        .map(f2 => (headingDiff(f2.feature.properties.heading, f.properties.heading)))\n                        .reduce((a,b) => (a + b), 0) / alignmentNeighbors.length;\n\n                    const cohesionNeighbors = neighbors.slice(0,nCohesion);\n                    var cohesionVector = [0,0,0];\n                    if(cohere) {\n                        cohesionVector = [\n                            cohesionNeighbors.map(f2 => (f2.feature.geometry.coordinates[0] - f.geometry.coordinates[0]) ).reduce((a,b) => (a + b)) / cohesionNeighbors.length * kCohesion,\n                            cohesionNeighbors.map(f2 => (f2.feature.geometry.coordinates[1] - f.geometry.coordinates[1]) ).reduce((a,b) => (a + b)) / cohesionNeighbors.length * kCohesion,\n                            cohesionNeighbors.map(f2 => (f2.feature.geometry.coordinates[2] - f.geometry.coordinates[2]) ).reduce((a,b) => (a + b)) / cohesionNeighbors.length * kCohesion,\n                        ];\n                    }\n\n                    \n\n                    var centerVector = [0,0,0];\n                    if(cohere) { \n                        centerVector = [\n                            (map.transform.center.lng - f.geometry.coordinates[0]),\n                            (map.transform.center.lat - f.geometry.coordinates[1]),\n                            targetAltitude - f.geometry.coordinates[2]\n                        ]\n                    }\n\n\n                    centerVector[0] *= 0.001;\n                    centerVector[1] *= 0.001;\n                    centerVector[2] *= 0.1;\n\n                    centerVector[0] = Math.min(centerVector[0], 0.01);\n                    centerVector[0] = Math.max(centerVector[0], -0.01);\n                    centerVector[1] = Math.min(centerVector[1], 0.01);\n                    centerVector[1] = Math.max(centerVector[1], -0.01);\n                    centerVector[2] = Math.min(centerVector[2], 0.1);\n                    centerVector[2] = Math.max(centerVector[2], -0.1);\n\n                    cohesionVector[0] += centerVector[0];\n                    cohesionVector[1] += centerVector[1];\n                    cohesionVector[2] += centerVector[2];\n\n                    const separationNeighbors = neighbors.slice(0,nSeparation);//filter(f2 => f2.distance < separationDistance)\n                    const neighborsDX = separationNeighbors.map(f2 => (((f2.feature.geometry.coordinates[0] - f.geometry.coordinates[0]) / (f2.distance))));\n                    const neighborsDY = separationNeighbors.map(f2 => (((f2.feature.geometry.coordinates[1] - f.geometry.coordinates[1]) / (f2.distance))));\n                    const neighborsDZ = separationNeighbors.map(f2 => (((f2.feature.geometry.coordinates[2] - f.geometry.coordinates[2]) / (f2.distance))));\n                    const separationVector = [\n                        neighborsDX.reduce((a,b) => (a + b), 0) * kSeparation,\n                        neighborsDY.reduce((a,b) => (a + b), 0) * kSeparation,\n                        neighborsDZ.reduce((a,b) => (a + b), 0) * kSeparation\n                    ];\n\n                    const zForce = cohesionVector[2] + separationVector[2];\n                    f.properties.zAcceleration += zForce;\n                    f.properties.zAcceleration *= 0.98\n\n                    var forwardVector = [\n                        Math.sin(f.properties.heading * Math.PI / 180) * speed + cohesionVector[0] + separationVector[0],\n                        Math.cos(f.properties.heading * Math.PI / 180) * speed + cohesionVector[1] + separationVector[1],\n                        f.properties.zAcceleration\n                    ];\n\n                    const forwardSpeed = Math.sqrt(forwardVector[0] * forwardVector[0] + forwardVector[1] * forwardVector[1]);\n                    if(forwardSpeed > 0.001) {\n                        forwardVector[0] *= 0.001 / forwardSpeed;\n                        forwardVector[1] *= 0.001 / forwardSpeed;\n                        //forwardVector[2] *= 0.0005 / forwardSpeed;\n                    }\n\n                    const newBearing = 90-Math.atan2(forwardVector[1], forwardVector[0]) * 180 / Math.PI;\n\n                    const change = headingDiff(newBearing, f.properties.heading) * 0.1 + alignment;\n                    f.properties.headingChange += change * 0.5;\n                    f.properties.headingChange = Math.min(f.properties.headingChange, 5);\n                    f.properties.headingChange = Math.max(f.properties.headingChange, -5);\n                    f.properties.heading += change * fpsFactor;\n\n                    \n\n                    forwardVector[0] *= fpsFactor;\n                    forwardVector[1] *= fpsFactor;\n\n                \n                    f.geometry.coordinates = [f.geometry.coordinates[0] + forwardVector[0], f.geometry.coordinates[1] + forwardVector[1], f.geometry.coordinates[2] + forwardVector[2]];\n                });\n\n                symbols.updateSourceData(source);\n            }\n\n            window.requestAnimationFrame(drive);\n        }\n        drive();\n    }\n\n    function randomRange(low, high) {\n        return Math.random() * (high - low) + low;\n    }\n\n    </script>\n</body>"
  },
  {
    "path": "examples/old/orientation.html",
    "content": "<!doctype html>\n<head>\n    <title>SymboLayer3D example</title>\n    <script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n    <script src=\"config.js\"></script>\n\n    <script src='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js'></script>\n    <link href='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css' rel='stylesheet' />\n    <style>\n        body, html { \n            width: 100%;\n            height: 100%;\n            margin: 0;\n        }\n        #map { \n            width: 100%;\n            height: 100%;\n        }\n    </style>\n</head>\n<body>\n    <div id='map' class='map'></div>\n\n    <script>\n    if(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n    \n    mapboxgl.accessToken = config.accessToken;\n    var map = new mapboxgl.Map({\n      container: 'map',\n      style: 'mapbox://styles/mapbox/streets-v9',\n      center: [-122.4131, 37.7743],\n      zoom: 15.95,\n      pitch: 60,\n      heading: 41,\n      hash: true,\n      maxZoom: 24\n    });\n\n    map.on(\"load\", function() {\n        // Initialize threebox\n        map.addLayer({\n            id: 'custom_layer',\n            type: 'custom',\n            onAdd: function(map, gl){\n                \n                window.threebox = new Threebox(map, gl);\n                threebox.setupDefaultLights();\n\n                var source = {\n                    type: \"FeatureCollection\",\n                    features: [\n                    {\n                        type: \"Feature\",\n                        properties: { model: \"orientation_0_0\" },\n                        geometry: {\n                            type: \"Point\",\n                            coordinates: [0,0]\n                        }\n                    },\n                    {\n                        type: \"Feature\",\n                        properties: { model: \"orientation_-30_-30\" },\n                        geometry: {\n                            type: \"Point\",\n                            coordinates: [-30,-30]\n                        }\n                    },\n                    {\n                        type: \"Feature\",\n                        properties: { model: \"orientation_-30_0\" },\n                        geometry: {\n                            type: \"Point\",\n                            coordinates: [-30,0]\n                        }\n                    },\n                    {\n                        type: \"Feature\",\n                        properties: { model: \"orientation_0_30\" },\n                        geometry: {\n                            type: \"Point\",\n                            coordinates: [0,30]\n                        }\n                    },\n                    {\n                        type: \"Feature\",\n                        properties: { model: \"orientation_30_30\" },\n                        geometry: {\n                            type: \"Point\",\n                            coordinates: [30,30]\n                        }\n                    },\n                    \n                    ]\n                };\n\n                var symbols = threebox.addSymbolLayer({\n                    id:             \"scale\",\n                    source:         source, // You can also specify a URL or relative path such as \"data/points.geojson\",\n                    modelName:      {property: 'model'},    // will look for an .obj and .mtl file with this name\n                    modelDirectory: \"models/\",          // in this directory\n                    rotation:       { generator: feature => (new THREE.Euler(0,0,0, \"ZXY\")) },\n                    scale:          [100000,100000,100000],\n                    scaleWithMapProjection: true\n                });\n\n                console.log(symbols);\n\n            },\n            render: function(gl, matrix){\n                threebox.update();\n            }\n        });\n\n    });\n\n    </script>\n</body>"
  },
  {
    "path": "examples/raycaster.html",
    "content": "<!doctype html>\n<head>\n    <title>Raycaster</title>\n    <script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n    <script src=\"config.js\"></script>\n\n    <script src='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js'></script>\n    <link href='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css' rel='stylesheet' />\n    <style>\n        body, html { \n            width: 100%;\n            height: 100%;\n            margin: 0;\n        }\n        #map { \n            width: 100%;\n            height: 100%;\n        }\n    </style>\n</head>\n<body>\n    <div id='map' class='map'></div>\n\n    <script>\n        if(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n        \n        mapboxgl.accessToken = config.accessToken;\n        var origin = [-122.4340, 37.7353, 1000];\n\n        var map = new mapboxgl.Map({\n          container: 'map',\n          style: 'mapbox://styles/mapbox/dark-v9',\n          center: origin,\n          zoom: 15.95,\n          pitch: 60,\n          heading: 41,\n          hash: true\n        });\n\n        var active = false\n        map.on('style.load', function() {\n\n            map.addLayer({\n                id: 'custom_layer',\n                type: 'custom',\n                onAdd: function(map, mbxContext){\n\n                    window.tb = new Threebox(\n                        map, \n                        mbxContext,\n                        {defaultLights: true}\n                    );\n\n                    // initialize geometry and material of our cube object\n                    var geometry = new THREE.BoxGeometry(2000, 2000, 2000);\n\n                    var redMaterial = new THREE.MeshPhongMaterial( {\n                        color: 0x660000, \n                        side: THREE.DoubleSide\n                    });\n                    var greenMaterial = new THREE.MeshPhongMaterial( {\n                        color: 0xaaffaa, \n                        side: THREE.DoubleSide\n                    });\n\n\n                    cube = new THREE.Mesh(geometry, redMaterial);\n                    cube = tb.Object3D({obj:cube, units:'meters'})\n                        .setCoords(origin);\n                    \n                    tb.add(cube)\n                    var highlighted = [];\n\n                    //add mousing interactions\n                    map.on('mousemove', function(e){\n\n                        // Clear old objects\n                        highlighted.forEach(function(h) {\n                            h.material = redMaterial;\n                        });\n                        highlighted.length = 0;\n\n\n                        // calculate objects intersecting the picking ray\n                        var intersect = tb.queryRenderedFeatures(e.point)[0]\n                        var intersectionExists = typeof intersect == \"object\"\n\n                        // if intersect exists, highlight it\n                        if (intersect) {\n\n                            var nearestObject = intersect.object;\n                            nearestObject.material = greenMaterial;\n                            highlighted.push(nearestObject)\n\n                        }\n\n                        // on state change, fire a repaint\n                        if (active !== intersectionExists) {\n                            active = intersectionExists;\n                            tb.repaint();\n                        }\n                    });\n                },\n\n                render: function(gl, matrix){\n                    tb.update();\n                }\n            });\n        });\n\n    </script>\n</body>"
  },
  {
    "path": "examples/tube.html",
    "content": "<!doctype html>\n<head>\n\t<title>Tube Example</title>\n\t<script src=\"../dist/threebox.js\" type=\"text/javascript\"></script>\n\t<script src=\"config.js\"></script>\n\n\t<script src='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js'></script>\n\t<link href='https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css' rel='stylesheet' />\n\t<style>\n\t\tbody, html { \n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmargin: 0;\n\t\t}\n\t\t#map { \n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t</style>\n</head>\n<body>\n\t<div id='map' class='map'></div>\n\n\t<script>\n\n\t\tif(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n\t\t\n\t\tmapboxgl.accessToken = config.accessToken;\n\t\tvar origin = [-95.97299, 36.15031,0];\n\n\t\tvar map = new mapboxgl.Map({\n\t\t  container: 'map',\n\t\t  style: 'mapbox://styles/mapbox/light-v9',\n\t\t  center: origin,\n\t\t  zoom: 14,\n\t\t  pitch: 60,\n\t\t  heading: 41\n\t\t});\n\n\t\t//generate a spiral line geometry (not essential for understanding this demo)\n\n\t\tvar lineGeometry = [];\n\n\t\tfor (var l = 0; l<200; l++) {\n\n\t\t\tvar delta = [\n\t\t\t\tMath.sin(l/5) * l/100000, \n\t\t\t\tMath.cos(l/5) * l/100000, \n\t\t\t\tl*5\n\t\t\t]\n\n\t\t\tvar newCoordinate = origin.map(function(d,i){\n\t\t\t\treturn d + delta[i]\n\t\t\t})\n\t\t\tlineGeometry.push(newCoordinate)\n\t\t}\n\n\t\tconsole.log(\"Tube's line geometry: \", lineGeometry);\n\n\n\n\t\tmap.on('style.load', function() {\n\n\t\t\tmap.addLayer({\n\t\t\t\tid: 'custom_layer',\n\t\t\t\ttype: 'custom',\n\t\t\t\trenderingMode: '3d',\n\t\t\t\tonAdd: function(map, mbxContext){\n\n\t\t\t\t\twindow.tb = new Threebox(\n\t\t\t\t\t\tmap, \n\t\t\t\t\t\tmbxContext,\n\t\t\t\t\t\t{defaultLights: true}\n\t\t\t\t\t);\n\n\t\t\t\t\tvar tubeOptions = {\n\t\t\t\t\t\tgeometry: lineGeometry,\n\t\t\t\t\t\tradius: 1,\n\t\t\t\t\t\tsides: 8,\n\t\t\t\t\t\tmaterial: 'MeshPhysicalMaterial',\n\t\t\t\t\t\tcolor:'#00ffff'\n\t\t\t\t\t}\n\n\t\t\t\t\ttube = tb.tube(tubeOptions);\n\t\t\t\t\t// tube.material.wireframe = true\n\t\t\t\t\ttb.add(tube);\n\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\trender: function(gl, matrix){\n\t\t\t\t\ttb.update();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t</script>\n</body>"
  },
  {
    "path": "exports.js",
    "content": "window.Threebox = require('./src/Threebox.js'),\nwindow.THREE = require('./src/three.js')\n"
  },
  {
    "path": "main.js",
    "content": "module.exports = exports = {\n    Threebox: require('./src/Threebox'),\n    THREE: require('./src/three.js')\n}"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"threebox\",\n  \"version\": \"0.2.0\",\n  \"description\": \"A Mapbox GL JS plugin that combines the power of the Three.js 3D library with Mapbox geospatial tools.\",\n  \"main\": \"main.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/peterqliu/threebox.git\"\n  },\n  \"author\": \"@peterqliu and @kronick\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/peterqliu/threebox/issues\"\n  },\n  \"dev-dependencies\": {\n    \"tap-prettify\": \"0.0.2\",\n    \"tape\": \"^4.6.3\"\n  },\n  \"scripts\": {\n    \"build\": \"browserify -g ./node_modules/uglifyify exports.js > dist/threebox.min.js\",\n    \"dev\": \"watchify exports.js --verbose -o dist/threebox.js\",\n    \"test\": \"browserify tests/threebox-tests.js > tests/threebox-tests-bundle.js; echo 'Open tests/threebox-tests.html to run tests in the browser.'\"\n  },\n  \"dependencies\": {\n    \"@turf/turf\": \"^5.1.6\",\n    \"tape\": \"^4.10.1\",\n    \"turf\": \"^3.0.14\",\n    \"watchify\": \"^3.11.1\",\n    \"uglifyify\": \"5.0.1\"\n  }\n}\n"
  },
  {
    "path": "src/Animation/AnimationManager.js",
    "content": "var threebox = require('../Threebox.js');\nvar utils = require(\"../utils/utils.js\");\nvar validate = require(\"../utils/validate.js\");\n\nfunction AnimationManager(map) {\n\n    this.map = map\n    this.enrolledObjects = [];    \n    this.previousFrameTime;\n\n};\n\nAnimationManager.prototype = {\n\n    enroll: function(obj) {\n\n        /* Extend the provided object with animation-specific properties and track in the animation manager */\n\n        this.enrolledObjects.push(obj);\n\n        // Give this object its own internal animation queue\n        obj.animationQueue = [];\n\n        obj.set = function(options) {\n\n            //if duration is set, animate to the new state\n            if (options.duration > 0 ){\n\n                var newParams = {\n                    start: Date.now(),\n                    expiration: Date.now() + options.duration,\n                    endState: {}\n                }\n\n                utils.extend(options, newParams);\n\n                var translating = options.coords;\n                var rotating = options.rotation;\n                var scaling = options.scale || options.scaleX || options.scaleY || options.scaleZ;\n\n                if (rotating) {\n                    \n                    var r = obj.rotation;\n                    options.startRotation = [r.x, r.y, r.z];\n\n\n                    options.endState.rotation = utils.types.rotation(options.rotation, options.startRotation);\n                    options.rotationPerMs = options.endState.rotation\n                        .map(function(angle, index){\n                            return (angle-options.startRotation[index])/options.duration;\n                        })\n                }\n\n                if (scaling) {\n                    var s = obj.scale;\n                    options.startScale = [s.x, s.y, s.z];\n                    options.endState.scale = utils.types.scale(options.scale, options.startScale);\n\n                    options.scalePerMs = options.endState.scale\n                        .map(function(scale, index){\n                            return (scale-options.startScale[index])/options.duration;\n                        })                    \n                }\n\n                if (translating) options.pathCurve = new THREE.CatmullRomCurve3(utils.lnglatsToWorld([obj.coordinates, options.coords]));\n\n                var entry = {\n                    type:'set',\n                    parameters: options\n                }\n\n                this.animationQueue\n                    .push(entry);\n\n                map.repaint = true;   \n            }\n\n            //if no duration set, stop object's existing animations and go to that state immediately\n            else {\n                this.stop();\n                options.rotation = utils.radify(options.rotation);\n                this._setObject(options);\n            }\n\n            return this\n\n        };\n\n        obj.stop = function(){\n            this.animationQueue = [];\n            return this;\n        }\n\n        obj.followPath = function (options, cb){\n\n            var entry = {\n                type: 'followPath', \n                parameters: utils._validate(options, defaults.followPath)\n            };\n                     \n            utils.extend(\n                entry.parameters, \n                {\n                    pathCurve: new THREE.CatmullRomCurve3(\n                        utils.lnglatsToWorld(options.path)\n                    ),\n                    start: Date.now(),\n                    expiration: Date.now() + entry.parameters.duration,\n                    cb: cb\n                }\n            );    \n\n            this.animationQueue\n                .push(entry);\n\n            map.repaint = true;\n            \n            return this;\n        };\n\n        obj._setObject = function (options){\n\n            var p = options.position; // lnglat\n            var r = options.rotation; // radians\n            var s = options.scale; // \n            var w = options.worldCoordinates; //Vector3\n            var q = options.quaternion // [axis, angle]\n\n            if (p) {\n                this.coordinates = p;\n                var c = utils.projectToWorld(p);\n                this.position.copy(c)\n            }\n\n            if (r) this.rotation.set(r[0], r[1], r[2]);\n            \n            if (s) this.scale.set(s[0], s[1], s[2]);\n            \n            if (q) this.quaternion.setFromAxisAngle(q[0], q[1]);\n            \n            if (w) this.position.copy(w);\n\n            map.repaint = true\n        }\n    },\n\n    update: function(now) {\n\n        if (this.previousFrameTime === undefined) this.previousFrameTime = now;\n\n        var dimensions = ['X','Y','Z'];\n\n        //iterate through objects in queue. count in reverse so we can cull objects without frame shifting\n        for (var a = this.enrolledObjects.length-1; a>=0; a--){   \n\n            var object = this.enrolledObjects[a];\n\n            if(!object.animationQueue || object.animationQueue.length === 0) continue;\n\n            //focus on first item in queue\n            var item = object.animationQueue[0];\n            var options = item.parameters;\n\n            // if an animation is past its expiration date, cull it\n            if (!options.expiration) {\n                // console.log('culled')\n\n                object.animationQueue.splice(0,1);\n\n                // set the start time of the next animation\n                if (object.animationQueue[0]) object.animationQueue[0].parameters.start = now;\n\n                return\n            }\n\n            //if finished, jump to end state and flag animation entry for removal next time around. Execute callback if there is one\n            var expiring = now >= options.expiration;\n\n            if (expiring) {\n                options.expiration = false;\n                if (options.endState) object._setObject(options.endState);\n                options.cb();\n            }\n\n            else {\n\n                var timeProgress = (now - options.start) / options.duration;\n\n                if (item.type === 'set'){\n\n                    var objectState = {};\n\n                    if (options.pathCurve) objectState.worldCoordinates = options.pathCurve.getPoint(timeProgress);\n\n                    if (options.rotationPerMs) {\n                        objectState.rotation = options.startRotation.map(function(rad, index){\n                            return rad + options.rotationPerMs[index] * timeProgress * options.duration\n                        })\n                    }\n\n                    if (options.scalePerMs) {\n                        objectState.scale = options.startScale.map(function(scale, index){\n                            return scale + options.scalePerMs[index]*timeProgress * options.duration\n                        })\n                    }\n\n                    object._setObject(objectState);\n                }\n\n                if (item.type === 'followPath'){\n\n                    var position = options.pathCurve.getPointAt(timeProgress);\n                    objectState = {worldCoordinates: position};\n\n                    // if we need to track heading\n                    if (options.trackHeading){\n\n                        var tangent = options.pathCurve\n                        .getTangentAt(timeProgress)\n                            .normalize();\n\n                        var axis = new THREE.Vector3(0,0,0);\n                        var up = new THREE.Vector3(0,1,0);\n\n                        axis\n                            .crossVectors(up, tangent)\n                            .normalize();\n\n                        var radians = Math.acos(up.dot(tangent));\n\n                        objectState.quaternion = [axis, radians];\n\n                    }\n\n                    object._setObject(objectState);\n\n                }\n            }\n\n        }\n\n        this.previousFrameTime = now;\n    }\n}\n\nconst defaults = {\n    followPath: {\n        path: null,\n        duration: 1000,\n        trackHeading: true\n    }\n}\nmodule.exports = exports = AnimationManager;"
  },
  {
    "path": "src/Camera/CameraSync.js",
    "content": "var THREE = require(\"../three.js\");\nvar utils = require(\"../utils/utils.js\");\nvar ThreeboxConstants = require(\"../utils/constants.js\");\n\nfunction CameraSync(map, camera, world) {\n\n    this.map = map;\n    this.camera = camera;\n    this.active = true;\n\n    this.camera.matrixAutoUpdate = false;   // We're in charge of the camera now!\n\n    // Postion and configure the world group so we can scale it appropriately when the camera zooms\n    this.world = world || new THREE.Group();\n    this.world.position.x = this.world.position.y = ThreeboxConstants.WORLD_SIZE/2\n    this.world.matrixAutoUpdate = false;\n\n\n    //set up basic camera state\n\n    this.state = {\n        fov: 0.6435011087932844,\n        translateCenter: new THREE.Matrix4,\n        worldSizeRatio: 512/ThreeboxConstants.WORLD_SIZE\n    };\n\n    this.state.translateCenter.makeTranslation(ThreeboxConstants.WORLD_SIZE/2, -ThreeboxConstants.WORLD_SIZE / 2, 0);\n\n    // Listen for move events from the map and update the Three.js camera. Some attributes only change when viewport resizes, so update those accordingly\n    var _this = this;\n\n    this.map\n        .on('move', function() {\n            _this.updateCamera()\n        })\n        .on('resize', function(){\n            _this.setupCamera();\n        })\n\n\n    this.setupCamera();\n}\n\nCameraSync.prototype = {\n\n    setupCamera: function() {\n\n        var t = this.map.transform\n        const halfFov = this.state.fov / 2;\n        var cameraToCenterDistance = 0.5 / Math.tan(halfFov) * t.height;\n        const groundAngle = Math.PI / 2 + t._pitch;\n\n        this.state.cameraToCenterDistance = cameraToCenterDistance;\n        this.state.cameraTranslateZ = new THREE.Matrix4().makeTranslation(0,0,cameraToCenterDistance);\n        this.state.topHalfSurfaceDistance = Math.sin(halfFov) * cameraToCenterDistance / Math.sin(Math.PI - groundAngle - halfFov);\n    \n        this.updateCamera();\n    },\n\n    updateCamera: function(ev) {\n\n        if(!this.camera) {\n            console.log('nocamera')\n            return;\n        }\n\n        var t = this.map.transform\n\n        // Calculate z distance of the farthest fragment that should be rendered.\n        const furthestDistance = Math.cos(Math.PI / 2 - t._pitch) * this.state.topHalfSurfaceDistance + this.state.cameraToCenterDistance;\n\n        // Add a bit extra to avoid precision problems when a fragment's distance is exactly `furthestDistance`\n        const farZ = furthestDistance * 1.01;\n\n        this.camera.projectionMatrix = utils.makePerspectiveMatrix(this.state.fov, t.width / t.height, 1, farZ);\n        \n\n        var cameraWorldMatrix = new THREE.Matrix4();\n        var cameraTranslateZ = new THREE.Matrix4().makeTranslation(0,0,this.state.cameraToCenterDistance);\n        var rotatePitch = new THREE.Matrix4().makeRotationX(t._pitch);\n        var rotateBearing = new THREE.Matrix4().makeRotationZ(t.angle);\n\n        // Unlike the Mapbox GL JS camera, separate camera translation and rotation out into its world matrix\n        // If this is applied directly to the projection matrix, it will work OK but break raycasting\n\n        cameraWorldMatrix\n            .premultiply(this.state.cameraTranslateZ)\n            .premultiply(rotatePitch)\n            .premultiply(rotateBearing)   \n\n        this.camera.matrixWorld.copy(cameraWorldMatrix);\n\n\n        var zoomPow = t.scale * this.state.worldSizeRatio; \n\n        // Handle scaling and translation of objects in the map in the world's matrix transform, not the camera\n        var scale = new THREE.Matrix4;\n        var translateCenter = new THREE.Matrix4;\n        var translateMap = new THREE.Matrix4;\n        var rotateMap = new THREE.Matrix4;\n\n        scale\n            .makeScale( zoomPow, zoomPow , zoomPow );\n    \n        \n        var x = -this.map.transform.x || -this.map.transform.point.x;\n        var y = this.map.transform.y || this.map.transform.point.y;\n\n        translateMap\n            .makeTranslation(x, y, 0);\n        \n        rotateMap\n            .makeRotationZ(Math.PI);\n\n        this.world.matrix = new THREE.Matrix4;\n        this.world.matrix\n            .premultiply(rotateMap)\n            .premultiply(this.state.translateCenter)\n            .premultiply(scale)\n            .premultiply(translateMap)\n\n\n        // utils.prettyPrintMatrix(this.camera.projectionMatrix.elements);\n    }\n}\n\nmodule.exports = exports = CameraSync;\n"
  },
  {
    "path": "src/Threebox.js",
    "content": "var THREE = require(\"./three.js\");\nvar CameraSync = require(\"./camera/CameraSync.js\");\nvar utils = require(\"./utils/utils.js\");\nvar AnimationManager = require(\"./animation/AnimationManager.js\");\nvar ThreeboxConstants = require(\"./utils/constants.js\");\n\nvar Objects = require(\"./objects/objects.js\");\nvar material = require(\"./utils/material.js\");\nvar sphere = require(\"./objects/sphere.js\");\nvar loadObj = require(\"./objects/loadObj.js\");\nvar Object3D = require(\"./objects/Object3D.js\");\nvar line = require(\"./objects/line.js\");\nvar tube = require(\"./objects/tube.js\");\n\nfunction Threebox(map, glContext, options){\n\n    this.init(map, glContext, options);\n\n};\n\nThreebox.prototype = {\n\n    repaint: function(){\n        this.map.repaint = true;\n    },\n\n    init: function (map, glContext, options){\n\n        this.map = map;\n\n        // Set up a THREE.js scene\n        this.renderer = new THREE.WebGLRenderer( { \n            alpha: true, \n            antialias: true,\n            canvas: map.getCanvas(),\n            context: glContext\n        } );\n\n        this.renderer.shadowMap.enabled = true;\n        this.renderer.autoClear = false;\n\n        this.scene = new THREE.Scene();\n        this.camera = new THREE.PerspectiveCamera( 28, window.innerWidth / window.innerHeight, 0.000000000001, Infinity);\n\n        // The CameraSync object will keep the Mapbox and THREE.js camera movements in sync.\n        // It requires a world group to scale as we zoom in. Rotation is handled in the camera's\n        // projection matrix itself (as is field of view and near/far clipping)\n        // It automatically registers to listen for move events on the map so we don't need to do that here\n        this.world = new THREE.Group();\n        this.scene.add(this.world);\n\n        this.cameraSync = new CameraSync(this.map, this.camera, this.world);\n\n        //raycaster for mouse events\n        this.raycaster = new THREE.Raycaster();\n\n        // apply starter options\n        \n        this.options = utils._validate(options || {}, defaultOptions);\n        if (this.options.defaultLights) this.defaultLights();\n        \n    },\n\n    // Objects\n\n    objects: new Objects(AnimationManager),\n\n    sphere: sphere,\n\n    line: line,\n\n    tube: function(obj){\n        return tube(obj, this.world)\n    },\n\n    Object3D: function(obj, o) {\n        return Object3D(obj, o)\n    },\n\n    loadObj: loadObj,\n\n\n    // Material\n\n    material: function(o){\n        return material(o)\n    },\n\n    utils: utils,\n\n    projectToWorld: function(coords) {\n        return this.utils.projectToWorld(coords)\n    },\n\n    unprojectFromWorld: function(v3) {\n        return this.utils.unprojectFromWorld(v3)\n    },\n\n    projectedUnitsPerMeter: function(lat) {\n        return this.utils.projectedUnitsPerMeter(lat)\n    },\n\n    queryRenderedFeatures: function(point){\n\n        var mouse = new THREE.Vector2();\n        \n        // // scale mouse pixel position to a percentage of the screen's width and height\n        mouse.x = ( point.x / this.map.transform.width ) * 2 - 1;\n        mouse.y = 1 - ( point.y / this.map.transform.height ) * 2;\n\n        this.raycaster.setFromCamera(mouse, this.camera);\n\n        // calculate objects intersecting the picking ray\n        var intersects = this.raycaster.intersectObjects(this.world.children, true);\n\n        return intersects\n    },\n\n    update: function() {\n        \n        if (this.map.repaint) this.map.repaint = false\n\n        var timestamp = Date.now();\n\n        // Update any animations\n        this.objects.animationManager.update(timestamp);\n        \n        this.renderer.state.reset();\n\n        // Render the scene and repaint the map\n        this.renderer.render( this.scene, this.camera );\n\n        if (this.options.passiveRendering === false) this.map.triggerRepaint();\n    },\n\n    add: function(obj) {\n        this.world.add(obj);\n    },\n\n    remove: function(obj) {\n        this.world.remove(obj);\n    },\n\n\n    defaultLights: function(){\n\n        this.scene.add( new THREE.AmbientLight( 0xffffff ) );\n        var sunlight = new THREE.DirectionalLight(0xffffff, 0.25);\n        sunlight.position.set(0,80000000,100000000);\n        sunlight.matrixWorldNeedsUpdate = true;\n        this.world.add(sunlight);\n\n    },\n\n    memory: function (){ return this.renderer.info.memory},\n\n    version: '0.3.0',\n\n    // DEPRECATED METHODS\n\n    setupDefaultLights: function() {\n        console.warn('.setupDefaultLights() has been moved to a \"defaultLights\" option inside Threebox()')\n        this.defaultLights();\n    },\n\n    addAtCoordinate: function(obj, lnglat, options) {\n        \n        console.warn('addAtCoordinate() has been deprecated. Check out the and threebox.add() Object.setCoords() methods instead.')\n        \n        obj = this.Object3D({obj:obj});\n\n        obj.setCoords(lnglat)\n        this.add(obj);\n\n        return obj;\n    },\n\n    moveToCoordinate: function(obj, lnglat, options) {\n        console.warn('addAtCoordinate() has been deprecated. Check out the Object.setCoords() and threebox.add() methods instead.')\n\n        if (!obj.setCoords) obj = this.Object3D(obj);\n        obj.setCoords(lnglat, options);\n\n        return obj;\n    }\n}\n\nvar defaultOptions = {\n    defaultLights: false,\n    passiveRendering: true\n}\nmodule.exports = exports = Threebox;\n\n"
  },
  {
    "path": "src/Utils/Utils.js",
    "content": "var THREE = require(\"../three.js\");\nvar Constants = require(\"./constants.js\");\nvar validate = require(\"./validate.js\");\n\nvar utils = {\n\n    prettyPrintMatrix: function(uglymatrix){\n        for (var s=0; s<4; s++){\n            var quartet=[uglymatrix[s],\n            uglymatrix[s+4],\n            uglymatrix[s+8],\n            uglymatrix[s+12]];\n            console.log(quartet.map(function(num){return num.toFixed(4)}))\n        }\n    },\n\n    makePerspectiveMatrix: function(fovy, aspect, near, far) {\n\n        var out = new THREE.Matrix4();\n        var f = 1.0 / Math.tan(fovy / 2),\n        nf = 1 / (near - far);\n\n        var newMatrix = [\n            f / aspect, 0, 0, 0,\n            0, f, 0, 0,\n            0, 0, (far + near) * nf, -1,\n            0, 0, (2 * far * near) * nf, 0\n        ]\n\n        out.elements = newMatrix\n        return out;\n    },\n\n    //gimme radians\n    radify: function(deg){\n\n        function convert(degrees){\n            degrees = degrees || 0;\n            return Math.PI*2*degrees/360\n        }\n\n        if (typeof deg === 'object'){\n\n            //if [x,y,z] array of rotations\n            if (deg.length > 0){\n                return deg.map(function(degree){\n                    return convert(degree)\n                })\n            }\n\n            // if {x: y: z:} rotation object\n            else {\n                return [convert(deg.x), convert(deg.y), convert(deg.z)]\n            }\n        }\n\n        //if just a number\n        else return convert(deg)\n    },\n\n    //gimme degrees\n    degreeify: function(rad){\n        function convert(radians){\n            radians = radians || 0;\n            return radians * 360/(Math.PI*2)\n        }\n\n        if (typeof rad === 'object') {\n            return [convert(rad.x), convert(rad.y), convert(rad.z)]\n        }\n\n        else return convert(rad)\n    },\n\n    projectToWorld: function(coords){\n\n        // Spherical mercator forward projection, re-scaling to WORLD_SIZE\n\n        var projected = [\n            -Constants.MERCATOR_A * Constants.DEG2RAD* coords[0] * Constants.PROJECTION_WORLD_SIZE,\n            -Constants.MERCATOR_A * Math.log(Math.tan((Math.PI*0.25) + (0.5 * Constants.DEG2RAD * coords[1]) )) * Constants.PROJECTION_WORLD_SIZE\n        ];\n     \n        //z dimension, defaulting to 0 if not provided\n\n        if (!coords[2]) projected.push(0)\n        else {\n            var pixelsPerMeter = this.projectedUnitsPerMeter(coords[1]);\n            projected.push( coords[2] * pixelsPerMeter );\n        }\n\n        var result = new THREE.Vector3(projected[0], projected[1], projected[2]);\n\n        return result;\n    },\n\n    projectedUnitsPerMeter: function(latitude) {\n        return Math.abs( Constants.WORLD_SIZE / Math.cos( Constants.DEG2RAD * latitude ) / Constants.EARTH_CIRCUMFERENCE );\n    },\n\n    _scaleVerticesToMeters: function(centerLatLng, vertices) {\n        var pixelsPerMeter = this.projectedUnitsPerMeter(centerLatLng[1]);\n        var centerProjected = this.projectToWorld(centerLatLng);\n\n        for (var i = 0; i < vertices.length; i++) {\n            vertices[i].multiplyScalar(pixelsPerMeter);\n        }\n\n        return vertices;\n    },\n\n    projectToScreen: function(coords) {\n        console.log(\"WARNING: Projecting to screen coordinates is not yet implemented\");\n    },\n\n    unprojectFromScreen: function (pixel) {\n        console.log(\"WARNING: unproject is not yet implemented\");\n    },\n\n    //world units to lnglat\n    unprojectFromWorld: function (worldUnits) {\n\n        var unprojected = [\n            -worldUnits.x / (Constants.MERCATOR_A * Constants.DEG2RAD * Constants.PROJECTION_WORLD_SIZE),\n            2*(Math.atan(Math.exp(worldUnits.y/(Constants.PROJECTION_WORLD_SIZE*(-Constants.MERCATOR_A))))-Math.PI/4)/Constants.DEG2RAD\n        ];\n\n        var pixelsPerMeter = this.projectedUnitsPerMeter(unprojected[1]);\n\n        //z dimension\n        var height = worldUnits.z || 0;\n        unprojected.push( height / pixelsPerMeter );\n\n        return unprojected;\n    },\n\n    _flipMaterialSides: function(obj) {\n\n    },\n\n    // to improve precision, normalize a series of vector3's to their collective center, and move the resultant mesh to that center\n    normalizeVertices(vertices) {\n\n        var geometry = new THREE.Geometry();\n\n        for (v3 of vertices) {\n            geometry.vertices.push(v3)\n        }\n\n        geometry.computeBoundingSphere();\n        var center = geometry.boundingSphere.center;\n        var radius = geometry.boundingSphere.radius;\n\n        var scaled = vertices.map(function(v3){\n            var normalized = v3.sub(center);\n            return normalized;\n        });\n\n        return {vertices: scaled, position: center}\n    },\n\n    //flatten an array of Vector3's into a shallow array of values in x-y-z order, for bufferGeometry\n    flattenVectors(vectors) {\n        var flattenedArray = [];\n        for (vertex of vectors) {\n            flattenedArray.push(vertex.x, vertex.y, vertex.z);\n        }\n        return flattenedArray\n    },\n\n    //convert a line/polygon to Vector3's\n\n    lnglatsToWorld: function(coords){\n\n        var vector3 = coords.map(\n            function(pt){\n                var p = utils.projectToWorld(pt);\n                var v3 = new THREE.Vector3(p.x, p.y, p.z);\n                return v3\n            }\n        );\n\n        return vector3\n    },\n\n    extend: function(original, addition) {\n        for (key in addition) original[key] = addition[key];\n    },\n\n    clone: function(original) {\n        var clone = {};\n        for (key in original) clone[key] = original[key];\n        return clone;\n    },\n    \n    // retrieve object parameters from an options object\n\n    types: {\n\n        rotation: function(r, currentRotation){\n\n            // if number provided, rotate only in Z by that amount\n            if (typeof r === 'number') r = {z:r};\n\n            var degrees = this.applyDefault([r.x, r.y, r.z], currentRotation);\n            var radians = utils.radify(degrees);\n            return radians;\n            \n        },\n\n        scale: function(s, currentScale){\n            if (typeof s === 'number') return s = [s,s,s]; \n            else return this.applyDefault([s.x, s.y, s.z], currentScale);\n        },\n\n        applyDefault: function(array, current){\n\n            var output = array.map(function(item, index){\n                item = item || current[index];\n                return item\n            })\n\n            return output\n        }\n    },\n\n    _validate: function(userInputs, defaults){\n        \n        userInputs = userInputs || {};\n        var validatedOutput = {};\n        utils.extend(validatedOutput, userInputs);\n\n        for (key of Object.keys(defaults)){\n\n            if (userInputs[key] === undefined) {\n                //make sure required params are present\n                if (defaults[key] === null) {\n                    console.error(key + ' is required')\n                    return;\n                }\n    \n                else validatedOutput[key] = defaults[key]\n\n            }\n\n            else validatedOutput[key] = userInputs[key]\n        }\n\n        return validatedOutput\n    },\n    Validator: new validate(),\n    exposedMethods: ['projectToWorld', 'projectedUnitsPerMeter', 'extend', 'unprojectFromWorld']\n}\n\nmodule.exports = exports = utils"
  },
  {
    "path": "src/Utils/ValueGenerator.js",
    "content": "const ValueGenerator = function(input) {\n    if(typeof input === 'object' && input.property !== undefined)    // Value name comes from a property in each item\n        return (f => f.properties[input.property]);\n    else if(typeof input === 'object' && input.generator !== undefined)   // Value name generated by a function run on each item\n        return input.generator;\n    else return (() => input);\n\n    return undefined;\n}\n\nmodule.exports = exports = ValueGenerator;"
  },
  {
    "path": "src/objects/Object3D.js",
    "content": "var Objects = require('./objects.js');\nvar utils = require(\"../utils/utils.js\");\n\nfunction Object3D(options) {\n\toptions = utils._validate(options,  Objects.prototype._defaults.Object3D);\n\n\tvar obj = options.obj;\n\n\tif (options.units === 'meters') obj = Objects.prototype._makeGroup(options.obj, options);\n\n\tobj = Objects.prototype._addMethods(obj);\n\treturn obj\n}\n\n\nmodule.exports = exports = Object3D;"
  },
  {
    "path": "src/objects/customLines/Line2.js",
    "content": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.Line2 = function ( geometry, material ) {\n\n\tTHREE.LineSegments2.call( this );\n\n\tthis.type = 'Line2';\n\n\tthis.geometry = geometry !== undefined ? geometry : new THREE.LineGeometry();\n\tthis.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );\n\n};\n\nTHREE.Line2.prototype = Object.assign( Object.create( THREE.LineSegments2.prototype ), {\n\n\tconstructor: THREE.Line2,\n\n\tisLine2: true,\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n"
  },
  {
    "path": "src/objects/customLines/LineGeometry.js",
    "content": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineGeometry = function () {\n\n\tTHREE.LineSegmentsGeometry.call( this );\n\n\tthis.type = 'LineGeometry';\n\n};\n\nTHREE.LineGeometry.prototype = Object.assign( Object.create( THREE.LineSegmentsGeometry.prototype ), {\n\n\tconstructor: THREE.LineGeometry,\n\n\tisLineGeometry: true,\n\n\tsetPositions: function ( array ) {\n\n\t\t// converts [ x1, y1, z1,  x2, y2, z2, ... ] to pairs format\n\n\t\tvar length = array.length - 3;\n\t\tvar points = new Float32Array( 2 * length );\n\n\t\tfor ( var i = 0; i < length; i += 3 ) {\n\n\t\t\tpoints[ 2 * i ] = array[ i ];\n\t\t\tpoints[ 2 * i + 1 ] = array[ i + 1 ];\n\t\t\tpoints[ 2 * i + 2 ] = array[ i + 2 ];\n\n\t\t\tpoints[ 2 * i + 3 ] = array[ i + 3 ];\n\t\t\tpoints[ 2 * i + 4 ] = array[ i + 4 ];\n\t\t\tpoints[ 2 * i + 5 ] = array[ i + 5 ];\n\n\t\t}\n\n\t\tTHREE.LineSegmentsGeometry.prototype.setPositions.call( this, points );\n\n\t\treturn this;\n\n\t},\n\n\tsetColors: function ( array ) {\n\n\t\t// converts [ r1, g1, b1,  r2, g2, b2, ... ] to pairs format\n\n\t\tvar length = array.length - 3;\n\t\tvar colors = new Float32Array( 2 * length );\n\n\t\tfor ( var i = 0; i < length; i += 3 ) {\n\n\t\t\tcolors[ 2 * i ] = array[ i ];\n\t\t\tcolors[ 2 * i + 1 ] = array[ i + 1 ];\n\t\t\tcolors[ 2 * i + 2 ] = array[ i + 2 ];\n\n\t\t\tcolors[ 2 * i + 3 ] = array[ i + 3 ];\n\t\t\tcolors[ 2 * i + 4 ] = array[ i + 4 ];\n\t\t\tcolors[ 2 * i + 5 ] = array[ i + 5 ];\n\n\t\t}\n\n\t\tTHREE.LineSegmentsGeometry.prototype.setColors.call( this, colors );\n\n\t\treturn this;\n\n\t},\n\n\tfromLine: function ( line ) {\n\n\t\tvar geometry = line.geometry;\n\n\t\tif ( geometry.isGeometry ) {\n\n\t\t\tthis.setPositions( geometry.vertices );\n\n\t\t} else if ( geometry.isBufferGeometry ) {\n\n\t\t\tthis.setPositions( geometry.position.array ); // assumes non-indexed\n\n\t\t}\n\n\t\t// set colors, maybe\n\n\t\treturn this;\n\n\t},\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n"
  },
  {
    "path": "src/objects/customLines/LineMaterial.js",
    "content": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n * parameters = {\n *  color: <hex>,\n *  linewidth: <float>,\n *  dashed: <boolean>,\n *  dashScale: <float>,\n *  dashSize: <float>,\n *  gapSize: <float>,\n *  resolution: <Vector2>, // to be set by renderer\n * }\n */\n\nTHREE.UniformsLib.line = {\n\n\tlinewidth: { value: 1 },\n\tresolution: { value: new THREE.Vector2( 1, 1 ) },\n\tdashScale: { value: 1 },\n\tdashSize: { value: 1 },\n\tgapSize: { value: 1 } // todo FIX - maybe change to totalSize\n\n};\n\nTHREE.ShaderLib[ 'line' ] = {\n\n\tuniforms: THREE.UniformsUtils.merge( [\n\t\tTHREE.UniformsLib.common,\n\t\tTHREE.UniformsLib.fog,\n\t\tTHREE.UniformsLib.line\n\t] ),\n\n\tvertexShader:\n\t\t`\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\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\t#include <logdepthbuf_vertex>\n\n\t\t\t#include <worldpos_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t`,\n\n\tfragmentShader:\n\t\t`\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 <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < 0.5 || vUv.y > 0.5 ) 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 ( vUv.y < 0.5 || vUv.y > 0.5 ) {\n\n\t\t\t\tfloat a = vUv.x - 0.5;\n\t\t\t\tfloat b = vUv.y - 0.5;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 0.25 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <premultiplied_alpha_fragment>\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\n\t\t}\n\t\t`\n};\n\nTHREE.LineMaterial = function ( parameters ) {\n\n\tTHREE.ShaderMaterial.call( this, {\n\n\t\ttype: 'LineMaterial',\n\n\t\tuniforms: THREE.UniformsUtils.clone( THREE.ShaderLib[ 'line' ].uniforms ),\n\n\t\tvertexShader: THREE.ShaderLib[ 'line' ].vertexShader,\n\t\tfragmentShader: THREE.ShaderLib[ 'line' ].fragmentShader\n\n\t} );\n\n\tthis.dashed = false;\n\n\tObject.defineProperties( this, {\n\n\t\tcolor: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.diffuse.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.diffuse.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tlinewidth: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.linewidth.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.linewidth.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdashScale: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.dashScale.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.dashScale.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdashSize: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.dashSize.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.dashSize.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tgapSize: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.gapSize.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.gapSize.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tresolution: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.resolution.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.resolution.value.copy( value );\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\tthis.setValues( parameters );\n\n};\n\nTHREE.LineMaterial.prototype = Object.create( THREE.ShaderMaterial.prototype );\nTHREE.LineMaterial.prototype.constructor = THREE.LineMaterial;\n\nTHREE.LineMaterial.prototype.isLineMaterial = true;\n\nTHREE.LineMaterial.prototype.copy = function ( source ) {\n\n\tTHREE.ShaderMaterial.prototype.copy.call( this, source );\n\n\tthis.color.copy( source.color );\n\n\tthis.linewidth = source.linewidth;\n\n\tthis.resolution = source.resolution;\n\n\t// todo\n\n\treturn this;\n\n};\n\n"
  },
  {
    "path": "src/objects/customLines/LineSegments2.js",
    "content": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineSegments2 = function ( geometry, material ) {\n\n\tTHREE.Mesh.call( this );\n\n\tthis.type = 'LineSegments2';\n\n\tthis.geometry = geometry !== undefined ? geometry : new THREE.LineSegmentsGeometry();\n\tthis.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );\n\n};\n\nTHREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {\n\n\tconstructor: THREE.LineSegments2,\n\n\tisLineSegments2: true,\n\n\tcomputeLineDistances: ( function () { // for backwards-compatability, but could be a method of LineSegmentsGeometry...\n\n\t\tvar start = new THREE.Vector3();\n\t\tvar end = new THREE.Vector3();\n\n\t\treturn function computeLineDistances() {\n\n\t\t\tvar geometry = this.geometry;\n\n\t\t\tvar instanceStart = geometry.attributes.instanceStart;\n\t\t\tvar instanceEnd = geometry.attributes.instanceEnd;\n\t\t\tvar lineDistances = new Float32Array( 2 * instanceStart.data.count );\n\n\t\t\tfor ( var i = 0, j = 0, l = instanceStart.data.count; i < l; i ++, j += 2 ) {\n\n\t\t\t\tstart.fromBufferAttribute( instanceStart, i );\n\t\t\t\tend.fromBufferAttribute( instanceEnd, i );\n\n\t\t\t\tlineDistances[ j ] = ( j === 0 ) ? 0 : lineDistances[ j - 1 ];\n\t\t\t\tlineDistances[ j + 1 ] = lineDistances[ j ] + start.distanceTo( end );\n\n\t\t\t}\n\n\t\t\tvar instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1\n\n\t\t\tgeometry.addAttribute( 'instanceDistanceStart', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0\n\t\t\tgeometry.addAttribute( 'instanceDistanceEnd', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}() ),\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n"
  },
  {
    "path": "src/objects/customLines/LineSegmentsGeometry.js",
    "content": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineSegmentsGeometry = function () {\n\n\tTHREE.InstancedBufferGeometry.call( this );\n\n\tthis.type = 'LineSegmentsGeometry';\n\n\tvar plane = new THREE.BufferGeometry();\n\n\tvar positions = [ - 1, 2, 0, 1, 2, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, - 1, 0, 1, - 1, 0 ];\n\tvar uvs = [ 0, 1, 1, 1, 0, .5, 1, .5, 0, .5, 1, .5, 0, 0, 1, 0 ];\n\tvar index = [ 0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5 ];\n\n\tthis.setIndex( index );\n\tthis.addAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );\n\tthis.addAttribute( 'uv', new THREE.Float32BufferAttribute( uvs, 2 ) );\n\n};\n\nTHREE.LineSegmentsGeometry.prototype = Object.assign( Object.create( THREE.InstancedBufferGeometry.prototype ), {\n\n\tconstructor: THREE.LineSegmentsGeometry,\n\n\tisLineSegmentsGeometry: true,\n\n\tapplyMatrix: function ( matrix ) {\n\n\t\tvar start = this.attributes.instanceStart;\n\t\tvar end = this.attributes.instanceEnd;\n\n\t\tif ( start !== undefined ) {\n\n\t\t\tmatrix.applyToBufferAttribute( start );\n\n\t\t\tmatrix.applyToBufferAttribute( end );\n\n\t\t\tstart.data.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t}\n\n\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\tthis.computeBoundingSphere();\n\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tsetPositions: function ( array ) {\n\n\t\tvar lineSegments;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\tlineSegments = array;\n\n\t\t} else if ( Array.isArray( array ) ) {\n\n\t\t\tlineSegments = new Float32Array( array );\n\n\t\t}\n\n\t\tvar instanceBuffer = new THREE.InstancedInterleavedBuffer( lineSegments, 6, 1 ); // xyz, xyz\n\n\t\tthis.addAttribute( 'instanceStart', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 0 ) ); // xyz\n\t\tthis.addAttribute( 'instanceEnd', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 3 ) ); // xyz\n\n\t\t//\n\n\t\tthis.computeBoundingBox();\n\t\tthis.computeBoundingSphere();\n\n\t\treturn this;\n\n\t},\n\n\tsetColors: function ( array ) {\n\n\t\tvar colors;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\tcolors = array;\n\n\t\t} else if ( Array.isArray( array ) ) {\n\n\t\t\tcolors = new Float32Array( array );\n\n\t\t}\n\n\t\tvar instanceColorBuffer = new THREE.InstancedInterleavedBuffer( colors, 6, 1 ); // rgb, rgb\n\n\t\tthis.addAttribute( 'instanceColorStart', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 0 ) ); // rgb\n\t\tthis.addAttribute( 'instanceColorEnd', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 3 ) ); // rgb\n\n\t\treturn this;\n\n\t},\n\n\tfromWireframeGeometry: function ( geometry ) {\n\n\t\tthis.setPositions( geometry.attributes.position.array );\n\n\t\treturn this;\n\n\t},\n\n\tfromEdgesGeometry: function ( geometry ) {\n\n\t\tthis.setPositions( geometry.attributes.position.array );\n\n\t\treturn this;\n\n\t},\n\n\tfromMesh: function ( mesh ) {\n\n\t\tthis.fromWireframeGeometry( new THREE.WireframeGeometry( mesh.geometry ) );\n\n\t\t// set colors, maybe\n\n\t\treturn this;\n\n\t},\n\n\tfromLineSegements: function ( lineSegments ) {\n\n\t\tvar geometry = lineSegments.geometry;\n\n\t\tif ( geometry.isGeometry ) {\n\n\t\t\tthis.setPositions( geometry.vertices );\n\n\t\t} else if ( geometry.isBufferGeometry ) {\n\n\t\t\tthis.setPositions( geometry.position.array ); // assumes non-indexed\n\n\t\t}\n\n\t\t// set colors, maybe\n\n\t\treturn this;\n\n\t},\n\n\tcomputeBoundingBox: function () {\n\n\t\tvar box = new THREE.Box3();\n\n\t\treturn function computeBoundingBox() {\n\n\t\t\tif ( this.boundingBox === null ) {\n\n\t\t\t\tthis.boundingBox = new THREE.Box3();\n\n\t\t\t}\n\n\t\t\tvar start = this.attributes.instanceStart;\n\t\t\tvar end = this.attributes.instanceEnd;\n\n\t\t\tif ( start !== undefined && end !== undefined ) {\n\n\t\t\t\tthis.boundingBox.setFromBufferAttribute( start );\n\n\t\t\t\tbox.setFromBufferAttribute( end );\n\n\t\t\t\tthis.boundingBox.union( box );\n\n\t\t\t}\n\n\t\t};\n\n\t}(),\n\n\tcomputeBoundingSphere: function () {\n\n\t\tvar vector = new THREE.Vector3();\n\n\t\treturn function computeBoundingSphere() {\n\n\t\t\tif ( this.boundingSphere === null ) {\n\n\t\t\t\tthis.boundingSphere = new THREE.Sphere();\n\n\t\t\t}\n\n\t\t\tif ( this.boundingBox === null ) {\n\n\t\t\t\tthis.computeBoundingBox();\n\n\t\t\t}\n\n\t\t\tvar start = this.attributes.instanceStart;\n\t\t\tvar end = this.attributes.instanceEnd;\n\n\t\t\tif ( start !== undefined && end !== undefined ) {\n\n\t\t\t\tvar center = this.boundingSphere.center;\n\n\t\t\t\tthis.boundingBox.getCenter( center );\n\n\t\t\t\tvar maxRadiusSq = 0;\n\n\t\t\t\tfor ( var i = 0, il = start.count; i < il; i ++ ) {\n\n\t\t\t\t\tvector.fromBufferAttribute( start, i );\n\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );\n\n\t\t\t\t\tvector.fromBufferAttribute( end, i );\n\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );\n\n\t\t\t\t}\n\n\t\t\t\tthis.boundingSphere.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\t\tif ( isNaN( this.boundingSphere.radius ) ) {\n\n\t\t\t\t\tconsole.error( 'THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.', this );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t}(),\n\n\ttoJSON: function () {\n\n\t\t// todo\n\n\t},\n\n\tclone: function () {\n\n\t\t// todo\n\n\t},\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n"
  },
  {
    "path": "src/objects/customLines/Wireframe.js",
    "content": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.Wireframe = function ( geometry, material ) {\n\n\tTHREE.Mesh.call( this );\n\n\tthis.type = 'Wireframe';\n\n\tthis.geometry = geometry !== undefined ? geometry : new THREE.LineSegmentsGeometry();\n\tthis.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );\n\n};\n\nTHREE.Wireframe.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {\n\n\tconstructor: THREE.Wireframe,\n\n\tisWireframe: true,\n\n\tcomputeLineDistances: ( function () { // for backwards-compatability, but could be a method of LineSegmentsGeometry...\n\n\t\tvar start = new THREE.Vector3();\n\t\tvar end = new THREE.Vector3();\n\n\t\treturn function computeLineDistances() {\n\n\t\t\tvar geometry = this.geometry;\n\n\t\t\tvar instanceStart = geometry.attributes.instanceStart;\n\t\t\tvar instanceEnd = geometry.attributes.instanceEnd;\n\t\t\tvar lineDistances = new Float32Array( 2 * instanceStart.data.count );\n\n\t\t\tfor ( var i = 0, j = 0, l = instanceStart.data.count; i < l; i ++, j += 2 ) {\n\n\t\t\t\tstart.fromBufferAttribute( instanceStart, i );\n\t\t\t\tend.fromBufferAttribute( instanceEnd, i );\n\n\t\t\t\tlineDistances[ j ] = ( j === 0 ) ? 0 : lineDistances[ j - 1 ];\n\t\t\t\tlineDistances[ j + 1 ] = lineDistances[ j ] + start.distanceTo( end );\n\n\t\t\t}\n\n\t\t\tvar instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1\n\n\t\t\tgeometry.addAttribute( 'instanceDistanceStart', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0\n\t\t\tgeometry.addAttribute( 'instanceDistanceEnd', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}() ),\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n"
  },
  {
    "path": "src/objects/customLines/WireframeGeometry2.js",
    "content": "/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.WireframeGeometry2 = function ( geometry ) {\n\n\tTHREE.LineSegmentsGeometry.call( this );\n\n\tthis.type = 'WireframeGeometry2';\n\n\tthis.fromWireframeGeometry( new THREE.WireframeGeometry( geometry ) );\n\n\t// set colors, maybe\n\n};\n\nTHREE.WireframeGeometry2.prototype = Object.assign( Object.create( THREE.LineSegmentsGeometry.prototype ), {\n\n\tconstructor: THREE.WireframeGeometry2,\n\n\tisWireframeGeometry2: true,\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n"
  },
  {
    "path": "src/objects/line.js",
    "content": "var THREE = require(\"../three.js\");\nvar utils = require(\"../utils/utils.js\");\nvar Objects = require('./objects.js');\n\nfunction line(obj){\n\n\tobj = utils._validate(obj, Objects.prototype._defaults.line);\n\n\t// Geometry\n    var straightProject = utils.lnglatsToWorld(obj.geometry);\n\tvar normalized = utils.normalizeVertices(straightProject);\n    var flattenedArray = utils.flattenVectors(normalized.vertices);\n\tconsole.log('line', normalized.vertices)\n\n\tvar geometry = new THREE.LineGeometry();\n\tgeometry.setPositions( flattenedArray );\n\t// geometry.setColors( colors );\n\n\t// Material\n\tmatLine = new THREE.LineMaterial( {\n\t\tcolor: obj.color,\n\t\tlinewidth: obj.width, // in pixels\n\t\tdashed: false,\n\t\topacity: obj.opacity\n\t} );\n\t\n\tmatLine.resolution.set( window.innerWidth, window.innerHeight );\n\tmatLine.isMaterial = true;\n\tmatLine.transparent = true;\n\tmatLine.depthWrite = false;\n\n\t// Mesh\n\tline = new THREE.Line2( geometry, matLine );\n\tline.position.copy(normalized.position)\n\tline.computeLineDistances();\n\n\treturn line\n}\n\nmodule.exports = exports = line;\n\n\n\n/**\n * custom line shader by WestLangley, sourced from https://github.com/mrdoob/three.js/tree/master/examples/js/lines\n *\n */\n\nTHREE.LineSegmentsGeometry = function () {\n\n\tTHREE.InstancedBufferGeometry.call( this );\n\n\tthis.type = 'LineSegmentsGeometry';\n\n\tvar plane = new THREE.BufferGeometry();\n\n\tvar positions = [ - 1, 2, 0, 1, 2, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, - 1, 0, 1, - 1, 0 ];\n\tvar uvs = [ 0, 1, 1, 1, 0, .5, 1, .5, 0, .5, 1, .5, 0, 0, 1, 0 ];\n\tvar index = [ 0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5 ];\n\n\tthis.setIndex( index );\n\tthis.addAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );\n\tthis.addAttribute( 'uv', new THREE.Float32BufferAttribute( uvs, 2 ) );\n\n};\n\nTHREE.LineSegmentsGeometry.prototype = Object.assign( Object.create( THREE.InstancedBufferGeometry.prototype ), {\n\n\tconstructor: THREE.LineSegmentsGeometry,\n\n\tisLineSegmentsGeometry: true,\n\n\tapplyMatrix: function ( matrix ) {\n\n\t\tvar start = this.attributes.instanceStart;\n\t\tvar end = this.attributes.instanceEnd;\n\n\t\tif ( start !== undefined ) {\n\n\t\t\tmatrix.applyToBufferAttribute( start );\n\n\t\t\tmatrix.applyToBufferAttribute( end );\n\n\t\t\tstart.data.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t}\n\n\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\tthis.computeBoundingSphere();\n\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tsetPositions: function ( array ) {\n\n\t\tvar lineSegments;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\tlineSegments = array;\n\n\t\t} else if ( Array.isArray( array ) ) {\n\n\t\t\tlineSegments = new Float32Array( array );\n\n\t\t}\n\n\t\tvar instanceBuffer = new THREE.InstancedInterleavedBuffer( lineSegments, 6, 1 ); // xyz, xyz\n\n\t\tthis.addAttribute( 'instanceStart', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 0 ) ); // xyz\n\t\tthis.addAttribute( 'instanceEnd', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 3 ) ); // xyz\n\n\t\t//\n\n\t\tthis.computeBoundingBox();\n\t\tthis.computeBoundingSphere();\n\n\t\treturn this;\n\n\t},\n\n\tsetColors: function ( array ) {\n\n\t\tvar colors;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\tcolors = array;\n\n\t\t} else if ( Array.isArray( array ) ) {\n\n\t\t\tcolors = new Float32Array( array );\n\n\t\t}\n\n\t\tvar instanceColorBuffer = new THREE.InstancedInterleavedBuffer( colors, 6, 1 ); // rgb, rgb\n\n\t\tthis.addAttribute( 'instanceColorStart', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 0 ) ); // rgb\n\t\tthis.addAttribute( 'instanceColorEnd', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 3 ) ); // rgb\n\n\t\treturn this;\n\n\t},\n\n\tfromWireframeGeometry: function ( geometry ) {\n\n\t\tthis.setPositions( geometry.attributes.position.array );\n\n\t\treturn this;\n\n\t},\n\n\tfromEdgesGeometry: function ( geometry ) {\n\n\t\tthis.setPositions( geometry.attributes.position.array );\n\n\t\treturn this;\n\n\t},\n\n\tfromMesh: function ( mesh ) {\n\n\t\tthis.fromWireframeGeometry( new THREE.WireframeGeometry( mesh.geometry ) );\n\n\t\t// set colors, maybe\n\n\t\treturn this;\n\n\t},\n\n\tfromLineSegements: function ( lineSegments ) {\n\n\t\tvar geometry = lineSegments.geometry;\n\n\t\tif ( geometry.isGeometry ) {\n\n\t\t\tthis.setPositions( geometry.vertices );\n\n\t\t} else if ( geometry.isBufferGeometry ) {\n\n\t\t\tthis.setPositions( geometry.position.array ); // assumes non-indexed\n\n\t\t}\n\n\t\t// set colors, maybe\n\n\t\treturn this;\n\n\t},\n\n\tcomputeBoundingBox: function () {\n\n\t\tvar box = new THREE.Box3();\n\n\t\treturn function computeBoundingBox() {\n\n\t\t\tif ( this.boundingBox === null ) {\n\n\t\t\t\tthis.boundingBox = new THREE.Box3();\n\n\t\t\t}\n\n\t\t\tvar start = this.attributes.instanceStart;\n\t\t\tvar end = this.attributes.instanceEnd;\n\n\t\t\tif ( start !== undefined && end !== undefined ) {\n\n\t\t\t\tthis.boundingBox.setFromBufferAttribute( start );\n\n\t\t\t\tbox.setFromBufferAttribute( end );\n\n\t\t\t\tthis.boundingBox.union( box );\n\n\t\t\t}\n\n\t\t};\n\n\t}(),\n\n\tcomputeBoundingSphere: function () {\n\n\t\tvar vector = new THREE.Vector3();\n\n\t\treturn function computeBoundingSphere() {\n\n\t\t\tif ( this.boundingSphere === null ) {\n\n\t\t\t\tthis.boundingSphere = new THREE.Sphere();\n\n\t\t\t}\n\n\t\t\tif ( this.boundingBox === null ) {\n\n\t\t\t\tthis.computeBoundingBox();\n\n\t\t\t}\n\n\t\t\tvar start = this.attributes.instanceStart;\n\t\t\tvar end = this.attributes.instanceEnd;\n\n\t\t\tif ( start !== undefined && end !== undefined ) {\n\n\t\t\t\tvar center = this.boundingSphere.center;\n\n\t\t\t\tthis.boundingBox.getCenter( center );\n\n\t\t\t\tvar maxRadiusSq = 0;\n\n\t\t\t\tfor ( var i = 0, il = start.count; i < il; i ++ ) {\n\n\t\t\t\t\tvector.fromBufferAttribute( start, i );\n\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );\n\n\t\t\t\t\tvector.fromBufferAttribute( end, i );\n\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );\n\n\t\t\t\t}\n\n\t\t\t\tthis.boundingSphere.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\t\tif ( isNaN( this.boundingSphere.radius ) ) {\n\n\t\t\t\t\tconsole.error( 'THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.', this );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t}(),\n\n\ttoJSON: function () {\n\n\t\t// todo\n\n\t},\n\n\tclone: function () {\n\n\t\t// todo\n\n\t},\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineGeometry = function () {\n\n\tTHREE.LineSegmentsGeometry.call( this );\n\n\tthis.type = 'LineGeometry';\n\n};\n\nTHREE.LineGeometry.prototype = Object.assign( Object.create( THREE.LineSegmentsGeometry.prototype ), {\n\n\tconstructor: THREE.LineGeometry,\n\n\tisLineGeometry: true,\n\n\tsetPositions: function ( array ) {\n\n\t\t// converts [ x1, y1, z1,  x2, y2, z2, ... ] to pairs format\n\n\t\tvar length = array.length - 3;\n\t\tvar points = new Float32Array( 2 * length );\n\n\t\tfor ( var i = 0; i < length; i += 3 ) {\n\n\t\t\tpoints[ 2 * i ] = array[ i ];\n\t\t\tpoints[ 2 * i + 1 ] = array[ i + 1 ];\n\t\t\tpoints[ 2 * i + 2 ] = array[ i + 2 ];\n\n\t\t\tpoints[ 2 * i + 3 ] = array[ i + 3 ];\n\t\t\tpoints[ 2 * i + 4 ] = array[ i + 4 ];\n\t\t\tpoints[ 2 * i + 5 ] = array[ i + 5 ];\n\n\t\t}\n\n\t\tTHREE.LineSegmentsGeometry.prototype.setPositions.call( this, points );\n\n\t\treturn this;\n\n\t},\n\n\tsetColors: function ( array ) {\n\n\t\t// converts [ r1, g1, b1,  r2, g2, b2, ... ] to pairs format\n\n\t\tvar length = array.length - 3;\n\t\tvar colors = new Float32Array( 2 * length );\n\n\t\tfor ( var i = 0; i < length; i += 3 ) {\n\n\t\t\tcolors[ 2 * i ] = array[ i ];\n\t\t\tcolors[ 2 * i + 1 ] = array[ i + 1 ];\n\t\t\tcolors[ 2 * i + 2 ] = array[ i + 2 ];\n\n\t\t\tcolors[ 2 * i + 3 ] = array[ i + 3 ];\n\t\t\tcolors[ 2 * i + 4 ] = array[ i + 4 ];\n\t\t\tcolors[ 2 * i + 5 ] = array[ i + 5 ];\n\n\t\t}\n\n\t\tTHREE.LineSegmentsGeometry.prototype.setColors.call( this, colors );\n\n\t\treturn this;\n\n\t},\n\n\tfromLine: function ( line ) {\n\n\t\tvar geometry = line.geometry;\n\n\t\tif ( geometry.isGeometry ) {\n\n\t\t\tthis.setPositions( geometry.vertices );\n\n\t\t} else if ( geometry.isBufferGeometry ) {\n\n\t\t\tthis.setPositions( geometry.position.array ); // assumes non-indexed\n\n\t\t}\n\n\t\t// set colors, maybe\n\n\t\treturn this;\n\n\t},\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.WireframeGeometry2 = function ( geometry ) {\n\n\tTHREE.LineSegmentsGeometry.call( this );\n\n\tthis.type = 'WireframeGeometry2';\n\n\tthis.fromWireframeGeometry( new THREE.WireframeGeometry( geometry ) );\n\n\t// set colors, maybe\n\n};\n\nTHREE.WireframeGeometry2.prototype = Object.assign( Object.create( THREE.LineSegmentsGeometry.prototype ), {\n\n\tconstructor: THREE.WireframeGeometry2,\n\n\tisWireframeGeometry2: true,\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n * parameters = {\n *  color: <hex>,\n *  linewidth: <float>,\n *  dashed: <boolean>,\n *  dashScale: <float>,\n *  dashSize: <float>,\n *  gapSize: <float>,\n *  resolution: <Vector2>, // to be set by renderer\n * }\n */\n\nTHREE.UniformsLib.line = {\n\n\tlinewidth: { value: 1 },\n\tresolution: { value: new THREE.Vector2( 1, 1 ) },\n\tdashScale: { value: 1 },\n\tdashSize: { value: 1 },\n\tgapSize: { value: 1 } // todo FIX - maybe change to totalSize\n\n};\n\nTHREE.ShaderLib[ 'line' ] = {\n\n\tuniforms: THREE.UniformsUtils.merge( [\n\t\tTHREE.UniformsLib.common,\n\t\tTHREE.UniformsLib.fog,\n\t\tTHREE.UniformsLib.line\n\t] ),\n\n\tvertexShader:\n\t\t`\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\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\t#include <logdepthbuf_vertex>\n\n\t\t\t#include <worldpos_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t`,\n\n\tfragmentShader:\n\t\t`\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 <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < 0.5 || vUv.y > 0.5 ) 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 ( vUv.y < 0.5 || vUv.y > 0.5 ) {\n\n\t\t\t\tfloat a = vUv.x - 0.5;\n\t\t\t\tfloat b = vUv.y - 0.5;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 0.25 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, opacity );\n\n\t\t\t#include <premultiplied_alpha_fragment>\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\n\t\t}\n\t\t`\n};\n\nTHREE.LineMaterial = function ( parameters ) {\n\n\tvar lineUniforms = THREE.UniformsUtils.clone( THREE.ShaderLib[ 'line' ].uniforms );\n\tlineUniforms.opacity.value = parameters.opacity;\n\n\tTHREE.ShaderMaterial.call( this, {\n\n\t\ttype: 'LineMaterial',\n\n\t\tuniforms: lineUniforms,\n\n\t\tvertexShader: THREE.ShaderLib[ 'line' ].vertexShader,\n\t\tfragmentShader: THREE.ShaderLib[ 'line' ].fragmentShader\n\n\t} );\n\n\tthis.dashed = false;\n\n\tObject.defineProperties( this, {\n\n\t\tcolor: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.diffuse.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.diffuse.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tlinewidth: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.linewidth.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.linewidth.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdashScale: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.dashScale.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.dashScale.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdashSize: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.dashSize.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.dashSize.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tgapSize: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.gapSize.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.gapSize.value = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tresolution: {\n\n\t\t\tenumerable: true,\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.uniforms.resolution.value;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.uniforms.resolution.value.copy( value );\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\tthis.setValues( parameters );\n\n};\n\nTHREE.LineMaterial.prototype = Object.create( THREE.ShaderMaterial.prototype );\nTHREE.LineMaterial.prototype.constructor = THREE.LineMaterial;\n\nTHREE.LineMaterial.prototype.isLineMaterial = true;\n\nTHREE.LineMaterial.prototype.copy = function ( source ) {\n\n\tTHREE.ShaderMaterial.prototype.copy.call( this, source );\n\n\tthis.color.copy( source.color );\n\n\tthis.linewidth = source.linewidth;\n\n\tthis.resolution = source.resolution;\n\n\t// todo\n\n\treturn this;\n\n};\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.LineSegments2 = function ( geometry, material ) {\n\n\tTHREE.Mesh.call( this );\n\n\tthis.type = 'LineSegments2';\n\n\tthis.geometry = geometry !== undefined ? geometry : new THREE.LineSegmentsGeometry();\n\tthis.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );\n\n};\n\nTHREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {\n\n\tconstructor: THREE.LineSegments2,\n\n\tisLineSegments2: true,\n\n\tcomputeLineDistances: ( function () { // for backwards-compatability, but could be a method of LineSegmentsGeometry...\n\n\t\tvar start = new THREE.Vector3();\n\t\tvar end = new THREE.Vector3();\n\n\t\treturn function computeLineDistances() {\n\n\t\t\tvar geometry = this.geometry;\n\n\t\t\tvar instanceStart = geometry.attributes.instanceStart;\n\t\t\tvar instanceEnd = geometry.attributes.instanceEnd;\n\t\t\tvar lineDistances = new Float32Array( 2 * instanceStart.data.count );\n\n\t\t\tfor ( var i = 0, j = 0, l = instanceStart.data.count; i < l; i ++, j += 2 ) {\n\n\t\t\t\tstart.fromBufferAttribute( instanceStart, i );\n\t\t\t\tend.fromBufferAttribute( instanceEnd, i );\n\n\t\t\t\tlineDistances[ j ] = ( j === 0 ) ? 0 : lineDistances[ j - 1 ];\n\t\t\t\tlineDistances[ j + 1 ] = lineDistances[ j ] + start.distanceTo( end );\n\n\t\t\t}\n\n\t\t\tvar instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1\n\n\t\t\tgeometry.addAttribute( 'instanceDistanceStart', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0\n\t\t\tgeometry.addAttribute( 'instanceDistanceEnd', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}() ),\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.Line2 = function ( geometry, material ) {\n\n\tTHREE.LineSegments2.call( this );\n\n\tthis.type = 'Line2';\n\n\tthis.geometry = geometry !== undefined ? geometry : new THREE.LineGeometry();\n\tthis.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );\n\n};\n\nTHREE.Line2.prototype = Object.assign( Object.create( THREE.LineSegments2.prototype ), {\n\n\tconstructor: THREE.Line2,\n\n\tisLine2: true,\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n */\n\nTHREE.Wireframe = function ( geometry, material ) {\n\n\tTHREE.Mesh.call( this );\n\n\tthis.type = 'Wireframe';\n\n\tthis.geometry = geometry !== undefined ? geometry : new THREE.LineSegmentsGeometry();\n\tthis.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );\n\n};\n\nTHREE.Wireframe.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {\n\n\tconstructor: THREE.Wireframe,\n\n\tisWireframe: true,\n\n\tcomputeLineDistances: ( function () { // for backwards-compatability, but could be a method of LineSegmentsGeometry...\n\n\t\tvar start = new THREE.Vector3();\n\t\tvar end = new THREE.Vector3();\n\n\t\treturn function computeLineDistances() {\n\n\t\t\tvar geometry = this.geometry;\n\n\t\t\tvar instanceStart = geometry.attributes.instanceStart;\n\t\t\tvar instanceEnd = geometry.attributes.instanceEnd;\n\t\t\tvar lineDistances = new Float32Array( 2 * instanceStart.data.count );\n\n\t\t\tfor ( var i = 0, j = 0, l = instanceStart.data.count; i < l; i ++, j += 2 ) {\n\n\t\t\t\tstart.fromBufferAttribute( instanceStart, i );\n\t\t\t\tend.fromBufferAttribute( instanceEnd, i );\n\n\t\t\t\tlineDistances[ j ] = ( j === 0 ) ? 0 : lineDistances[ j - 1 ];\n\t\t\t\tlineDistances[ j + 1 ] = lineDistances[ j ] + start.distanceTo( end );\n\n\t\t\t}\n\n\t\t\tvar instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1\n\n\t\t\tgeometry.addAttribute( 'instanceDistanceStart', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0\n\t\t\tgeometry.addAttribute( 'instanceDistanceEnd', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}() ),\n\n\tcopy: function ( source ) {\n\n\t\t// todo\n\n\t\treturn this;\n\n\t}\n\n} );\n"
  },
  {
    "path": "src/objects/loadObj.js",
    "content": "var utils = require(\"../utils/utils.js\");\nvar Objects = require('./objects.js');\nconst OBJLoader = require(\"./loaders/OBJLoader.js\");\nconst MTLLoader = require(\"./loaders/MTLLoader.js\");\n\nfunction loadObj(options, cb){\n\n\t    if (options === undefined) return console.error(\"Invalid options provided to loadObj()\");\n\n\t    this.loaded = false;\n\n        const modelComplete = (m) => {\n            console.log(\"Model complete!\", m);\n\n            if(--remaining === 0) this.loaded = true;\n        }\n\n        \n\n        // TODO: Support formats other than OBJ/MTL\n        const objLoader = new OBJLoader();\n        const materialLoader = new MTLLoader();\n        materialLoader.load(options.mtl, loadObject, () => (null), error => {\n            console.warn(\"No material file found for SymbolLayer3D model \" + m);\n        });\n\n        function loadObject(materials) {\n\n            if (materials) {\n                materials.preload();\n                objLoader.setMaterials( materials );\n            }\n            \n            objLoader.load(options.obj, obj => {\n\n            \tvar r = utils.types.rotation(options, [0, 0, 0]);\n            \tvar s = utils.types.scale(options, [1, 1, 1]);\n\n            \tobj = obj.children[0];\n            \tobj.rotation.set(r[0] + Math.PI/2, r[1] + Math.PI, r[2]);\n            \tobj.scale.set(s[0], s[1], s[2]);\n\n            \tvar projScaleGroup = new THREE.Group();\n            \tprojScaleGroup.add(obj)\n\t\t        var userScaleGroup = Objects.prototype._makeGroup(projScaleGroup, options);\n\t\t        Objects.prototype._addMethods(userScaleGroup);\n\n                cb(userScaleGroup);\n\n            }, () => (null), error => {\n                console.error(\"Could not load model file.\");    \n            } );\n\n        };\n\t}\n\n\nmodule.exports = exports = loadObj;"
  },
  {
    "path": "src/objects/loaders/MTLLoader.js",
    "content": "/**\n * Loads a Wavefront .mtl file specifying materials\n *\n * @author angelxuanchang\n */\n\nconst THREE = require('../../three.js');\n\nconst MTLLoader = function ( manager ) {\n\n    this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n\n};\n\nMTLLoader.prototype = {\n\n    constructor: MTLLoader,\n\n    /**\n     * Loads and parses a MTL asset from a URL.\n     *\n     * @param {String} url - URL to the MTL file.\n     * @param {Function} [onLoad] - Callback invoked with the loaded object.\n     * @param {Function} [onProgress] - Callback for download progress.\n     * @param {Function} [onError] - Callback for download errors.\n     *\n     * @see setPath setTexturePath\n     *\n     * @note In order for relative texture references to resolve correctly\n     * you must call setPath and/or setTexturePath explicitly prior to load.\n     */\n    load: function ( url, onLoad, onProgress, onError ) {\n\n        var scope = this;\n\n        var loader = new THREE.FileLoader( this.manager );\n        loader.setPath( this.path );\n        loader.load( url, function ( text ) {\n\n            onLoad( scope.parse( text ) );\n\n        }, onProgress, onError );\n\n    },\n\n    /**\n     * Set base path for resolving references.\n     * If set this path will be prepended to each loaded and found reference.\n     *\n     * @see setTexturePath\n     * @param {String} path\n     *\n     * @example\n     *     mtlLoader.setPath( 'assets/obj/' );\n     *     mtlLoader.load( 'my.mtl', ... );\n     */\n    setPath: function ( path ) {\n\n        this.path = path;\n\n    },\n\n    /**\n     * Set base path for resolving texture references.\n     * If set this path will be prepended found texture reference.\n     * If not set and setPath is, it will be used as texture base path.\n     *\n     * @see setPath\n     * @param {String} path\n     *\n     * @example\n     *     mtlLoader.setPath( 'assets/obj/' );\n     *     mtlLoader.setTexturePath( 'assets/textures/' );\n     *     mtlLoader.load( 'my.mtl', ... );\n     */\n    setTexturePath: function ( path ) {\n\n        this.texturePath = path;\n\n    },\n\n    setBaseUrl: function ( path ) {\n\n        console.warn( 'THREE.MTLLoader: .setBaseUrl() is deprecated. Use .setTexturePath( path ) for texture path or .setPath( path ) for general base path instead.' );\n\n        this.setTexturePath( path );\n\n    },\n\n    setCrossOrigin: function ( value ) {\n\n        this.crossOrigin = value;\n\n    },\n\n    setMaterialOptions: function ( value ) {\n\n        this.materialOptions = value;\n\n    },\n\n    /**\n     * Parses a MTL file.\n     *\n     * @param {String} text - Content of MTL file\n     * @return {THREE.MTLLoader.MaterialCreator}\n     *\n     * @see setPath setTexturePath\n     *\n     * @note In order for relative texture references to resolve correctly\n     * you must call setPath and/or setTexturePath explicitly prior to parse.\n     */\n    parse: function ( text ) {\n\n        var lines = text.split( '\\n' );\n        var info = {};\n        var delimiter_pattern = /\\s+/;\n        var materialsInfo = {};\n\n        for ( var i = 0; i < lines.length; i ++ ) {\n\n            var line = lines[ i ];\n            line = line.trim();\n\n            if ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\n                // Blank line or comment ignore\n                continue;\n\n            }\n\n            var pos = line.indexOf( ' ' );\n\n            var key = ( pos >= 0 ) ? line.substring( 0, pos ) : line;\n            key = key.toLowerCase();\n\n            var value = ( pos >= 0 ) ? line.substring( pos + 1 ) : '';\n            value = value.trim();\n\n            if ( key === 'newmtl' ) {\n\n                // New material\n\n                info = { name: value };\n                materialsInfo[ value ] = info;\n\n            } else if ( info ) {\n\n                if ( key === 'ka' || key === 'kd' || key === 'ks' ) {\n\n                    var ss = value.split( delimiter_pattern, 3 );\n                    info[ key ] = [ parseFloat( ss[ 0 ] ), parseFloat( ss[ 1 ] ), parseFloat( ss[ 2 ] ) ];\n\n                } else {\n\n                    info[ key ] = value;\n\n                }\n\n            }\n\n        }\n\n        var materialCreator = new MTLLoader.MaterialCreator( this.texturePath || this.path, this.materialOptions );\n        materialCreator.setCrossOrigin( this.crossOrigin );\n        materialCreator.setManager( this.manager );\n        materialCreator.setMaterials( materialsInfo );\n        return materialCreator;\n\n    }\n\n};\n\n/**\n * Create a new THREE-MTLLoader.MaterialCreator\n * @param baseUrl - Url relative to which textures are loaded\n * @param options - Set of options on how to construct the materials\n *                  side: Which side to apply the material\n *                        THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide\n *                  wrap: What type of wrapping to apply for textures\n *                        THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping\n *                  normalizeRGB: RGBs need to be normalized to 0-1 from 0-255\n *                                Default: false, assumed to be already normalized\n *                  ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's\n *                                  Default: false\n * @constructor\n */\n\nMTLLoader.MaterialCreator = function ( baseUrl, options ) {\n\n    this.baseUrl = baseUrl || '';\n    this.options = options;\n    this.materialsInfo = {};\n    this.materials = {};\n    this.materialsArray = [];\n    this.nameLookup = {};\n\n    this.side = ( this.options && this.options.side ) ? this.options.side : THREE.FrontSide;\n    this.wrap = ( this.options && this.options.wrap ) ? this.options.wrap : THREE.RepeatWrapping;\n\n};\n\nMTLLoader.MaterialCreator.prototype = {\n\n    constructor: MTLLoader.MaterialCreator,\n\n    setCrossOrigin: function ( value ) {\n\n        this.crossOrigin = value;\n\n    },\n\n    setManager: function ( value ) {\n\n        this.manager = value;\n\n    },\n\n    setMaterials: function ( materialsInfo ) {\n\n        this.materialsInfo = this.convert( materialsInfo );\n        this.materials = {};\n        this.materialsArray = [];\n        this.nameLookup = {};\n\n    },\n\n    convert: function ( materialsInfo ) {\n\n        if ( ! this.options ) return materialsInfo;\n\n        var converted = {};\n\n        for ( var mn in materialsInfo ) {\n\n            // Convert materials info into normalized form based on options\n\n            var mat = materialsInfo[ mn ];\n\n            var covmat = {};\n\n            converted[ mn ] = covmat;\n\n            for ( var prop in mat ) {\n\n                var save = true;\n                var value = mat[ prop ];\n                var lprop = prop.toLowerCase();\n\n                switch ( lprop ) {\n\n                    case 'kd':\n                    case 'ka':\n                    case 'ks':\n\n                        // Diffuse color (color under white light) using RGB values\n\n                        if ( this.options && this.options.normalizeRGB ) {\n\n                            value = [ value[ 0 ] / 255, value[ 1 ] / 255, value[ 2 ] / 255 ];\n\n                        }\n\n                        if ( this.options && this.options.ignoreZeroRGBs ) {\n\n                            if ( value[ 0 ] === 0 && value[ 1 ] === 0 && value[ 2 ] === 0 ) {\n\n                                // ignore\n\n                                save = false;\n\n                            }\n\n                        }\n\n                        break;\n\n                    default:\n\n                        break;\n\n                }\n\n                if ( save ) {\n\n                    covmat[ lprop ] = value;\n\n                }\n\n            }\n\n        }\n\n        return converted;\n\n    },\n\n    preload: function () {\n\n        for ( var mn in this.materialsInfo ) {\n\n            this.create( mn );\n\n        }\n\n    },\n\n    getIndex: function ( materialName ) {\n\n        return this.nameLookup[ materialName ];\n\n    },\n\n    getAsArray: function () {\n\n        var index = 0;\n\n        for ( var mn in this.materialsInfo ) {\n\n            this.materialsArray[ index ] = this.create( mn );\n            this.nameLookup[ mn ] = index;\n            index ++;\n\n        }\n\n        return this.materialsArray;\n\n    },\n\n    create: function ( materialName ) {\n\n        if ( this.materials[ materialName ] === undefined ) {\n\n            this.createMaterial_( materialName );\n\n        }\n\n        return this.materials[ materialName ];\n\n    },\n\n    createMaterial_: function ( materialName ) {\n\n        // Create material\n\n        var scope = this;\n        var mat = this.materialsInfo[ materialName ];\n        var params = {\n\n            name: materialName,\n            side: this.side\n\n        };\n\n        function resolveURL( baseUrl, url ) {\n\n            if ( typeof url !== 'string' || url === '' )\n                return '';\n\n            // Absolute URL\n            if ( /^https?:\\/\\//i.test( url ) ) return url;\n\n            return baseUrl + url;\n\n        }\n\n        function setMapForType( mapType, value ) {\n\n            if ( params[ mapType ] ) return; // Keep the first encountered texture\n\n            var texParams = scope.getTextureParams( value, params );\n            var map = scope.loadTexture( resolveURL( scope.baseUrl, texParams.url ) );\n\n            map.repeat.copy( texParams.scale );\n            map.offset.copy( texParams.offset );\n\n            map.wrapS = scope.wrap;\n            map.wrapT = scope.wrap;\n\n            params[ mapType ] = map;\n\n        }\n\n        for ( var prop in mat ) {\n\n            var value = mat[ prop ];\n\n            if ( value === '' ) continue;\n\n            switch ( prop.toLowerCase() ) {\n\n                // Ns is material specular exponent\n\n                case 'kd':\n\n                    // Diffuse color (color under white light) using RGB values\n\n                    params.color = new THREE.Color().fromArray( value );\n\n                    break;\n\n                case 'ks':\n\n                    // Specular color (color when light is reflected from shiny surface) using RGB values\n                    params.specular = new THREE.Color().fromArray( value );\n\n                    break;\n\n                case 'map_kd':\n\n                    // Diffuse texture map\n\n                    setMapForType( \"map\", value );\n\n                    break;\n\n                case 'map_ks':\n\n                    // Specular map\n\n                    setMapForType( \"specularMap\", value );\n\n                    break;\n\n                case 'map_bump':\n                case 'bump':\n\n                    // Bump texture map\n\n                    setMapForType( \"bumpMap\", value );\n\n                    break;\n\n                case 'ns':\n\n                    // The specular exponent (defines the focus of the specular highlight)\n                    // A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.\n                    params.shininess = parseFloat( value );\n\n                    break;\n\n                case 'd':\n\n                    if ( value < 1 ) {\n\n                        params.opacity = value;\n                        params.transparent = true;\n\n                    }\n\n                    break;\n\n                case 'Tr':\n\n                    if ( value > 0 ) {\n\n                        params.opacity = 1 - value;\n                        params.transparent = true;\n\n                    }\n\n                    break;\n\n                default:\n                    break;\n\n            }\n\n        }\n\n        this.materials[ materialName ] = new THREE.MeshPhongMaterial( params );\n        return this.materials[ materialName ];\n\n    },\n\n    getTextureParams: function ( value, matParams ) {\n\n        var texParams = {\n\n            scale: new THREE.Vector2( 1, 1 ),\n            offset: new THREE.Vector2( 0, 0 )\n\n         };\n\n        var items = value.split( /\\s+/ );\n        var pos;\n\n        pos = items.indexOf( '-bm' );\n\n        if ( pos >= 0 ) {\n\n            matParams.bumpScale = parseFloat( items[ pos + 1 ] );\n            items.splice( pos, 2 );\n\n        }\n\n        pos = items.indexOf( '-s' );\n\n        if ( pos >= 0 ) {\n\n            texParams.scale.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n            items.splice( pos, 4 ); // we expect 3 parameters here!\n\n        }\n\n        pos = items.indexOf( '-o' );\n\n        if ( pos >= 0 ) {\n\n            texParams.offset.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n            items.splice( pos, 4 ); // we expect 3 parameters here!\n\n        }\n\n        texParams.url = items.join( ' ' ).trim();\n        return texParams;\n\n    },\n\n    loadTexture: function ( url, mapping, onLoad, onProgress, onError ) {\n\n        var texture;\n        var loader = THREE.Loader.Handlers.get( url );\n        var manager = ( this.manager !== undefined ) ? this.manager : THREE.DefaultLoadingManager;\n\n        if ( loader === null ) {\n\n            loader = new THREE.TextureLoader( manager );\n\n        }\n\n        if ( loader.setCrossOrigin ) loader.setCrossOrigin( this.crossOrigin );\n        texture = loader.load( url, onLoad, onProgress, onError );\n\n        if ( mapping !== undefined ) texture.mapping = mapping;\n\n        return texture;\n\n    }\n\n};\n\nmodule.exports = exports = MTLLoader;"
  },
  {
    "path": "src/objects/loaders/OBJLoader.js",
    "content": "/**\n * @author mrdoob / http://mrdoob.com/\n */\nconst THREE = require('../../three.js');\n\nconst OBJLoader = function ( manager ) {\n\n    this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n\n    this.materials = null;\n\n    this.regexp = {\n        // v float float float\n        vertex_pattern           : /^v\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)/,\n        // vn float float float\n        normal_pattern           : /^vn\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)/,\n        // vt float float\n        uv_pattern               : /^vt\\s+([\\d|\\.|\\+|\\-|e|E]+)\\s+([\\d|\\.|\\+|\\-|e|E]+)/,\n        // f vertex vertex vertex\n        face_vertex              : /^f\\s+(-?\\d+)\\s+(-?\\d+)\\s+(-?\\d+)(?:\\s+(-?\\d+))?/,\n        // f vertex/uv vertex/uv vertex/uv\n        face_vertex_uv           : /^f\\s+(-?\\d+)\\/(-?\\d+)\\s+(-?\\d+)\\/(-?\\d+)\\s+(-?\\d+)\\/(-?\\d+)(?:\\s+(-?\\d+)\\/(-?\\d+))?/,\n        // f vertex/uv/normal vertex/uv/normal vertex/uv/normal\n        face_vertex_uv_normal    : /^f\\s+(-?\\d+)\\/(-?\\d+)\\/(-?\\d+)\\s+(-?\\d+)\\/(-?\\d+)\\/(-?\\d+)\\s+(-?\\d+)\\/(-?\\d+)\\/(-?\\d+)(?:\\s+(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))?/,\n        // f vertex//normal vertex//normal vertex//normal\n        face_vertex_normal       : /^f\\s+(-?\\d+)\\/\\/(-?\\d+)\\s+(-?\\d+)\\/\\/(-?\\d+)\\s+(-?\\d+)\\/\\/(-?\\d+)(?:\\s+(-?\\d+)\\/\\/(-?\\d+))?/,\n        // o object_name | g group_name\n        object_pattern           : /^[og]\\s*(.+)?/,\n        // s boolean\n        smoothing_pattern        : /^s\\s+(\\d+|on|off)/,\n        // mtllib file_reference\n        material_library_pattern : /^mtllib /,\n        // usemtl material_name\n        material_use_pattern     : /^usemtl /\n    };\n\n};\n\nOBJLoader.prototype = {\n\n    constructor: OBJLoader,\n\n    load: function ( url, onLoad, onProgress, onError ) {\n\n        var scope = this;\n\n        var loader = new THREE.FileLoader( scope.manager );\n        loader.setPath( this.path );\n        loader.load( url, function ( text ) {\n\n            onLoad( scope.parse( text ) );\n\n        }, onProgress, onError );\n\n    },\n\n    setPath: function ( value ) {\n\n        this.path = value;\n\n    },\n\n    setMaterials: function ( materials ) {\n\n        this.materials = materials;\n\n    },\n\n    _createParserState : function () {\n\n        var state = {\n            objects  : [],\n            object   : {},\n\n            vertices : [],\n            normals  : [],\n            uvs      : [],\n\n            materialLibraries : [],\n\n            startObject: function ( name, fromDeclaration ) {\n\n                // If the current object (initial from reset) is not from a g/o declaration in the parsed\n                // file. We need to use it for the first parsed g/o to keep things in sync.\n                if ( this.object && this.object.fromDeclaration === false ) {\n\n                    this.object.name = name;\n                    this.object.fromDeclaration = ( fromDeclaration !== false );\n                    return;\n\n                }\n\n                var previousMaterial = ( this.object && typeof this.object.currentMaterial === 'function' ? this.object.currentMaterial() : undefined );\n\n                if ( this.object && typeof this.object._finalize === 'function' ) {\n\n                    this.object._finalize( true );\n\n                }\n\n                this.object = {\n                    name : name || '',\n                    fromDeclaration : ( fromDeclaration !== false ),\n\n                    geometry : {\n                        vertices : [],\n                        normals  : [],\n                        uvs      : []\n                    },\n                    materials : [],\n                    smooth : true,\n\n                    startMaterial : function( name, libraries ) {\n\n                        var previous = this._finalize( false );\n\n                        // New usemtl declaration overwrites an inherited material, except if faces were declared\n                        // after the material, then it must be preserved for proper MultiMaterial continuation.\n                        if ( previous && ( previous.inherited || previous.groupCount <= 0 ) ) {\n\n                            this.materials.splice( previous.index, 1 );\n\n                        }\n\n                        var material = {\n                            index      : this.materials.length,\n                            name       : name || '',\n                            mtllib     : ( Array.isArray( libraries ) && libraries.length > 0 ? libraries[ libraries.length - 1 ] : '' ),\n                            smooth     : ( previous !== undefined ? previous.smooth : this.smooth ),\n                            groupStart : ( previous !== undefined ? previous.groupEnd : 0 ),\n                            groupEnd   : -1,\n                            groupCount : -1,\n                            inherited  : false,\n\n                            clone : function( index ) {\n                                var cloned = {\n                                    index      : ( typeof index === 'number' ? index : this.index ),\n                                    name       : this.name,\n                                    mtllib     : this.mtllib,\n                                    smooth     : this.smooth,\n                                    groupStart : 0,\n                                    groupEnd   : -1,\n                                    groupCount : -1,\n                                    inherited  : false\n                                };\n                                cloned.clone = this.clone.bind(cloned);\n                                return cloned;\n                            }\n                        };\n\n                        this.materials.push( material );\n\n                        return material;\n\n                    },\n\n                    currentMaterial : function() {\n\n                        if ( this.materials.length > 0 ) {\n                            return this.materials[ this.materials.length - 1 ];\n                        }\n\n                        return undefined;\n\n                    },\n\n                    _finalize : function( end ) {\n\n                        var lastMultiMaterial = this.currentMaterial();\n                        if ( lastMultiMaterial && lastMultiMaterial.groupEnd === -1 ) {\n\n                            lastMultiMaterial.groupEnd = this.geometry.vertices.length / 3;\n                            lastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart;\n                            lastMultiMaterial.inherited = false;\n\n                        }\n\n                        // Ignore objects tail materials if no face declarations followed them before a new o/g started.\n                        if ( end && this.materials.length > 1 ) {\n\n                            for ( var mi = this.materials.length - 1; mi >= 0; mi-- ) {\n                                if ( this.materials[mi].groupCount <= 0 ) {\n                                    this.materials.splice( mi, 1 );\n                                }\n                            }\n\n                        }\n\n                        // Guarantee at least one empty material, this makes the creation later more straight forward.\n                        if ( end && this.materials.length === 0 ) {\n\n                            this.materials.push({\n                                name   : '',\n                                smooth : this.smooth\n                            });\n\n                        }\n\n                        return lastMultiMaterial;\n\n                    }\n                };\n\n                // Inherit previous objects material.\n                // Spec tells us that a declared material must be set to all objects until a new material is declared.\n                // If a usemtl declaration is encountered while this new object is being parsed, it will\n                // overwrite the inherited material. Exception being that there was already face declarations\n                // to the inherited material, then it will be preserved for proper MultiMaterial continuation.\n\n                if ( previousMaterial && previousMaterial.name && typeof previousMaterial.clone === \"function\" ) {\n\n                    var declared = previousMaterial.clone( 0 );\n                    declared.inherited = true;\n                    this.object.materials.push( declared );\n\n                }\n\n                this.objects.push( this.object );\n\n            },\n\n            finalize : function() {\n\n                if ( this.object && typeof this.object._finalize === 'function' ) {\n\n                    this.object._finalize( true );\n\n                }\n\n            },\n\n            parseVertexIndex: function ( value, len ) {\n\n                var index = parseInt( value, 10 );\n                return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n            },\n\n            parseNormalIndex: function ( value, len ) {\n\n                var index = parseInt( value, 10 );\n                return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n            },\n\n            parseUVIndex: function ( value, len ) {\n\n                var index = parseInt( value, 10 );\n                return ( index >= 0 ? index - 1 : index + len / 2 ) * 2;\n\n            },\n\n            addVertex: function ( a, b, c ) {\n\n                var src = this.vertices;\n                var dst = this.object.geometry.vertices;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n                dst.push( src[ a + 2 ] );\n                dst.push( src[ b + 0 ] );\n                dst.push( src[ b + 1 ] );\n                dst.push( src[ b + 2 ] );\n                dst.push( src[ c + 0 ] );\n                dst.push( src[ c + 1 ] );\n                dst.push( src[ c + 2 ] );\n\n            },\n\n            addVertexLine: function ( a ) {\n\n                var src = this.vertices;\n                var dst = this.object.geometry.vertices;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n                dst.push( src[ a + 2 ] );\n\n            },\n\n            addNormal : function ( a, b, c ) {\n\n                var src = this.normals;\n                var dst = this.object.geometry.normals;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n                dst.push( src[ a + 2 ] );\n                dst.push( src[ b + 0 ] );\n                dst.push( src[ b + 1 ] );\n                dst.push( src[ b + 2 ] );\n                dst.push( src[ c + 0 ] );\n                dst.push( src[ c + 1 ] );\n                dst.push( src[ c + 2 ] );\n\n            },\n\n            addUV: function ( a, b, c ) {\n\n                var src = this.uvs;\n                var dst = this.object.geometry.uvs;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n                dst.push( src[ b + 0 ] );\n                dst.push( src[ b + 1 ] );\n                dst.push( src[ c + 0 ] );\n                dst.push( src[ c + 1 ] );\n\n            },\n\n            addUVLine: function ( a ) {\n\n                var src = this.uvs;\n                var dst = this.object.geometry.uvs;\n\n                dst.push( src[ a + 0 ] );\n                dst.push( src[ a + 1 ] );\n\n            },\n\n            addFace: function ( a, b, c, d, ua, ub, uc, ud, na, nb, nc, nd ) {\n\n                var vLen = this.vertices.length;\n\n                var ia = this.parseVertexIndex( a, vLen );\n                var ib = this.parseVertexIndex( b, vLen );\n                var ic = this.parseVertexIndex( c, vLen );\n                var id;\n\n                if ( d === undefined ) {\n\n                    this.addVertex( ia, ib, ic );\n\n                } else {\n\n                    id = this.parseVertexIndex( d, vLen );\n\n                    this.addVertex( ia, ib, id );\n                    this.addVertex( ib, ic, id );\n\n                }\n\n                if ( ua !== undefined ) {\n\n                    var uvLen = this.uvs.length;\n\n                    ia = this.parseUVIndex( ua, uvLen );\n                    ib = this.parseUVIndex( ub, uvLen );\n                    ic = this.parseUVIndex( uc, uvLen );\n\n                    if ( d === undefined ) {\n\n                        this.addUV( ia, ib, ic );\n\n                    } else {\n\n                        id = this.parseUVIndex( ud, uvLen );\n\n                        this.addUV( ia, ib, id );\n                        this.addUV( ib, ic, id );\n\n                    }\n\n                }\n\n                if ( na !== undefined ) {\n\n                    // Normals are many times the same. If so, skip function call and parseInt.\n                    var nLen = this.normals.length;\n                    ia = this.parseNormalIndex( na, nLen );\n\n                    ib = na === nb ? ia : this.parseNormalIndex( nb, nLen );\n                    ic = na === nc ? ia : this.parseNormalIndex( nc, nLen );\n\n                    if ( d === undefined ) {\n\n                        this.addNormal( ia, ib, ic );\n\n                    } else {\n\n                        id = this.parseNormalIndex( nd, nLen );\n\n                        this.addNormal( ia, ib, id );\n                        this.addNormal( ib, ic, id );\n\n                    }\n\n                }\n\n            },\n\n            addLineGeometry: function ( vertices, uvs ) {\n\n                this.object.geometry.type = 'Line';\n\n                var vLen = this.vertices.length;\n                var uvLen = this.uvs.length;\n\n                for ( var vi = 0, l = vertices.length; vi < l; vi ++ ) {\n\n                    this.addVertexLine( this.parseVertexIndex( vertices[ vi ], vLen ) );\n\n                }\n\n                for ( var uvi = 0, l = uvs.length; uvi < l; uvi ++ ) {\n\n                    this.addUVLine( this.parseUVIndex( uvs[ uvi ], uvLen ) );\n\n                }\n\n            }\n\n        };\n\n        state.startObject( '', false );\n\n        return state;\n\n    },\n\n    parse: function ( text ) {\n\n        //console.time( 'OBJLoader' );\n\n        var state = this._createParserState();\n\n        if ( text.indexOf( '\\r\\n' ) !== - 1 ) {\n\n            // This is faster than String.split with regex that splits on both\n            text = text.replace( /\\r\\n/g, '\\n' );\n\n        }\n\n        if ( text.indexOf( '\\\\\\n' ) !== - 1) {\n\n            // join lines separated by a line continuation character (\\)\n            text = text.replace( /\\\\\\n/g, '' );\n\n        }\n\n        var lines = text.split( '\\n' );\n        var line = '', lineFirstChar = '', lineSecondChar = '';\n        var lineLength = 0;\n        var result = [];\n\n        // Faster to just trim left side of the line. Use if available.\n        var trimLeft = ( typeof ''.trimLeft === 'function' );\n\n        for ( var i = 0, l = lines.length; i < l; i ++ ) {\n\n            line = lines[ i ];\n\n            line = trimLeft ? line.trimLeft() : line.trim();\n\n            lineLength = line.length;\n\n            if ( lineLength === 0 ) continue;\n\n            lineFirstChar = line.charAt( 0 );\n\n            // @todo invoke passed in handler if any\n            if ( lineFirstChar === '#' ) continue;\n\n            if ( lineFirstChar === 'v' ) {\n\n                lineSecondChar = line.charAt( 1 );\n\n                if ( lineSecondChar === ' ' && ( result = this.regexp.vertex_pattern.exec( line ) ) !== null ) {\n\n                    // 0                  1      2      3\n                    // [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n                    state.vertices.push(\n                        parseFloat( result[ 1 ] ),\n                        parseFloat( result[ 2 ] ),\n                        parseFloat( result[ 3 ] )\n                    );\n\n                } else if ( lineSecondChar === 'n' && ( result = this.regexp.normal_pattern.exec( line ) ) !== null ) {\n\n                    // 0                   1      2      3\n                    // [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n                    state.normals.push(\n                        parseFloat( result[ 1 ] ),\n                        parseFloat( result[ 2 ] ),\n                        parseFloat( result[ 3 ] )\n                    );\n\n                } else if ( lineSecondChar === 't' && ( result = this.regexp.uv_pattern.exec( line ) ) !== null ) {\n\n                    // 0               1      2\n                    // [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\n\n                    state.uvs.push(\n                        parseFloat( result[ 1 ] ),\n                        parseFloat( result[ 2 ] )\n                    );\n\n                } else {\n\n                    throw new Error( \"Unexpected vertex/normal/uv line: '\" + line  + \"'\" );\n\n                }\n\n            } else if ( lineFirstChar === \"f\" ) {\n\n                if ( ( result = this.regexp.face_vertex_uv_normal.exec( line ) ) !== null ) {\n\n                    // f vertex/uv/normal vertex/uv/normal vertex/uv/normal\n                    // 0                        1    2    3    4    5    6    7    8    9   10         11         12\n                    // [\"f 1/1/1 2/2/2 3/3/3\", \"1\", \"1\", \"1\", \"2\", \"2\", \"2\", \"3\", \"3\", \"3\", undefined, undefined, undefined]\n\n                    state.addFace(\n                        result[ 1 ], result[ 4 ], result[ 7 ], result[ 10 ],\n                        result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ],\n                        result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ]\n                    );\n\n                } else if ( ( result = this.regexp.face_vertex_uv.exec( line ) ) !== null ) {\n\n                    // f vertex/uv vertex/uv vertex/uv\n                    // 0                  1    2    3    4    5    6   7          8\n                    // [\"f 1/1 2/2 3/3\", \"1\", \"1\", \"2\", \"2\", \"3\", \"3\", undefined, undefined]\n\n                    state.addFace(\n                        result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],\n                        result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]\n                    );\n\n                } else if ( ( result = this.regexp.face_vertex_normal.exec( line ) ) !== null ) {\n\n                    // f vertex//normal vertex//normal vertex//normal\n                    // 0                     1    2    3    4    5    6   7          8\n                    // [\"f 1//1 2//2 3//3\", \"1\", \"1\", \"2\", \"2\", \"3\", \"3\", undefined, undefined]\n\n                    state.addFace(\n                        result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],\n                        undefined, undefined, undefined, undefined,\n                        result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]\n                    );\n\n                } else if ( ( result = this.regexp.face_vertex.exec( line ) ) !== null ) {\n\n                    // f vertex vertex vertex\n                    // 0            1    2    3   4\n                    // [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\n\n                    state.addFace(\n                        result[ 1 ], result[ 2 ], result[ 3 ], result[ 4 ]\n                    );\n\n                } else {\n\n                    throw new Error( \"Unexpected face line: '\" + line  + \"'\" );\n\n                }\n\n            } else if ( lineFirstChar === \"l\" ) {\n\n                var lineParts = line.substring( 1 ).trim().split( \" \" );\n                var lineVertices = [], lineUVs = [];\n\n                if ( line.indexOf( \"/\" ) === - 1 ) {\n\n                    lineVertices = lineParts;\n\n                } else {\n\n                    for ( var li = 0, llen = lineParts.length; li < llen; li ++ ) {\n\n                        var parts = lineParts[ li ].split( \"/\" );\n\n                        if ( parts[ 0 ] !== \"\" ) lineVertices.push( parts[ 0 ] );\n                        if ( parts[ 1 ] !== \"\" ) lineUVs.push( parts[ 1 ] );\n\n                    }\n\n                }\n                state.addLineGeometry( lineVertices, lineUVs );\n\n            } else if ( ( result = this.regexp.object_pattern.exec( line ) ) !== null ) {\n\n                // o object_name\n                // or\n                // g group_name\n\n                // WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869\n                // var name = result[ 0 ].substr( 1 ).trim();\n                var name = ( \" \" + result[ 0 ].substr( 1 ).trim() ).substr( 1 );\n\n                state.startObject( name );\n\n            } else if ( this.regexp.material_use_pattern.test( line ) ) {\n\n                // material\n\n                state.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries );\n\n            } else if ( this.regexp.material_library_pattern.test( line ) ) {\n\n                // mtl file\n\n                state.materialLibraries.push( line.substring( 7 ).trim() );\n\n            } else if ( ( result = this.regexp.smoothing_pattern.exec( line ) ) !== null ) {\n\n                // smooth shading\n\n                // @todo Handle files that have varying smooth values for a set of faces inside one geometry,\n                // but does not define a usemtl for each face set.\n                // This should be detected and a dummy material created (later MultiMaterial and geometry groups).\n                // This requires some care to not create extra material on each smooth value for \"normal\" obj files.\n                // where explicit usemtl defines geometry groups.\n                // Example asset: examples/models/obj/cerberus/Cerberus.obj\n\n                var value = result[ 1 ].trim().toLowerCase();\n                state.object.smooth = ( value === '1' || value === 'on' );\n\n                var material = state.object.currentMaterial();\n                if ( material ) {\n\n                    material.smooth = state.object.smooth;\n\n                }\n\n            } else {\n\n                // Handle null terminated files without exception\n                if ( line === '\\0' ) continue;\n\n                throw new Error( \"Unexpected line: '\" + line  + \"'\" );\n\n            }\n\n        }\n\n        state.finalize();\n\n        var container = new THREE.Group();\n        container.materialLibraries = [].concat( state.materialLibraries );\n\n        for ( var i = 0, l = state.objects.length; i < l; i ++ ) {\n\n            var object = state.objects[ i ];\n            var geometry = object.geometry;\n            var materials = object.materials;\n            var isLine = ( geometry.type === 'Line' );\n\n            // Skip o/g line declarations that did not follow with any faces\n            if ( geometry.vertices.length === 0 ) continue;\n\n            var buffergeometry = new THREE.BufferGeometry();\n\n            buffergeometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( geometry.vertices ), 3 ) );\n\n            if ( geometry.normals.length > 0 ) {\n\n                buffergeometry.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( geometry.normals ), 3 ) );\n\n            } else {\n\n                buffergeometry.computeVertexNormals();\n\n            }\n\n            if ( geometry.uvs.length > 0 ) {\n\n                buffergeometry.addAttribute( 'uv', new THREE.BufferAttribute( new Float32Array( geometry.uvs ), 2 ) );\n\n            }\n\n            // Create materials\n\n            var createdMaterials = [];\n\n            for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {\n\n                var sourceMaterial = materials[mi];\n                var material = undefined;\n\n                if ( this.materials !== null ) {\n\n                    material = this.materials.create( sourceMaterial.name );\n\n                    // mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.\n                    if ( isLine && material && ! ( material instanceof THREE.LineBasicMaterial ) ) {\n\n                        var materialLine = new THREE.LineBasicMaterial();\n                        materialLine.copy( material );\n                        materialLine.lights = false;\n                        material = materialLine;\n\n                    }\n\n                }\n\n                if ( ! material ) {\n\n                    material = ( ! isLine ? new THREE.MeshPhongMaterial() : new THREE.LineBasicMaterial() );\n                    material.name = sourceMaterial.name;\n\n                }\n\n                material.shading = sourceMaterial.smooth ? THREE.SmoothShading : THREE.FlatShading;\n\n                createdMaterials.push(material);\n\n            }\n\n            // Create mesh\n\n            var mesh;\n\n            if ( createdMaterials.length > 1 ) {\n\n                for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {\n\n                    var sourceMaterial = materials[mi];\n                    buffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );\n\n                }\n\n                var multiMaterial = new THREE.MultiMaterial( createdMaterials );\n                mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, multiMaterial ) : new THREE.LineSegments( buffergeometry, multiMaterial ) );\n\n            } else {\n\n                mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, createdMaterials[ 0 ] ) : new THREE.LineSegments( buffergeometry, createdMaterials[ 0 ] ) );\n            }\n\n            mesh.name = object.name;\n\n            container.add( mesh );\n\n        }\n\n        //console.timeEnd( 'OBJLoader' );\n\n        return container;\n\n    }\n\n};\n\nmodule.exports = exports = OBJLoader;"
  },
  {
    "path": "src/objects/objects.js",
    "content": "var utils = require(\"../utils/utils.js\");\nvar material = require(\"../utils/material.js\");\n\nconst AnimationManager = require(\"../animation/AnimationManager.js\");\n\n\nfunction Objects(){\n\n}\n\nObjects.prototype = {\n\n\t// standard 1px line with gl\n\tline: function(obj){\n\n\t\tobj = utils._validate(obj, this._defaults.line);\n\n\t\t//project to world and normalize\n        var straightProject = utils.lnglatsToWorld(obj.geometry);\n\t\tvar normalized = utils.normalizeVertices(straightProject);\n\n\t\t//flatten array for buffergeometry\n        var flattenedArray = utils.flattenVectors(normalized.vertices);\n\n\t\tvar positions = new Float32Array(flattenedArray); // 3 vertices per point\n\t\tvar geometry = new THREE.BufferGeometry();\n\t\tgeometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );\n\n\t\t// material\n\t\tvar material = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 21 } );\n\t\tvar line = new THREE.Line( geometry,  material );\n\n        line.options = options || {};\n        line.position.copy(normalized.position)\n\n  \t\treturn line  \n\t},\n\n\n\textrusion: function(options){\n\n\t},\n\n\t_addMethods: function(obj, static){\n\n\t\tvar root = this;\n\n\t\tif (static) {\n\n\t\t}\n\n\t\telse {\n\n\t\t\tif (!obj.coordinates) obj.coordinates = [0,0,0];\n\n\t    \t// Bestow this mesh with animation superpowers and keeps track of its movements in the global animation queue\t\t\t\n\t\t\troot.animationManager.enroll(obj); \n\t\t\tobj.setCoords = function(lnglat){\n\n\t\t        /** Place the given object on the map, centered around the provided longitude and latitude\n\t\t            The object's internal coordinates are assumed to be in meter-offset format, meaning\n\t\t            1 unit represents 1 meter distance away from the provided coordinate.\n\t\t        */\n\n\t\t        // If object already added, scale the model so that its units are interpreted as meters at the given latitude\n\t\t\t\tif (obj.userData.units === 'meters'){\n\t\t\t\t\tvar s = utils.projectedUnitsPerMeter(lnglat[1]);\n\t\t\t\t\tobj.scale.set(s,s,s);\n\t\t\t\t}\n\n\t\t\t\tobj.coordinates = lnglat;\n\t        \tobj.set({position:lnglat})\n\t\t        \n\n\t\t        return obj;\n\n\t\t\t}\n\n\t\t\tobj.setRotation = function(xyz) {\n\n\t\t\t\tif (typeof xyz === 'number') xyz = {z: xyz}\n\n\t\t\t\tvar r = {\n\t\t\t\t\tx: utils.radify(xyz.x) || obj.rotation.x,\n\t\t\t\t\ty: utils.radify(xyz.y) || obj.rotation.y,\n\t\t\t\t\tz: utils.radify(xyz.z) || obj.rotation.z\n\t\t\t\t}\n\n\t\t\t\tobj._setObject({rotation: [r.x, r.y, r.z]})\n\t\t\t}\n\n\t\t}\n\n\t\tobj.add = function(){\n\t        root.world.add(obj);\n\t        if (!static) obj.set({position:obj.coordinates});\n\t        return obj;\n\t\t}\n\n\n\t\tobj.remove = function(){\n\t\t\troot.world.remove(obj);\n\t\t\troot.map.repaint = true;\n\t\t}\n\n\t\tobj.duplicate = function(a) {\n\t\t\tvar dupe = obj.clone(); \n\t\t\tdupe.userData = obj.userData;\n\t\t\troot._addMethods(dupe);\n\t\t\treturn dupe\n\t\t}\n\t\n\t\treturn obj\n\t},\n\n\t_makeGroup: function(obj, options){\n        var geoGroup = new THREE.Group();\n        geoGroup.userData = options || {};\n        geoGroup.userData.isGeoGroup = true;\n\n        var isArrayOfObjects = obj.length;\n\n        if (isArrayOfObjects) for (o of obj) geoGroup.add(o)\n\n\n    \telse geoGroup.add(obj);\n\n        utils._flipMaterialSides(obj);\n\n        return geoGroup\n\t},\n\n\tanimationManager: new AnimationManager,\n\n\t_defaults: {\n\n\t\tline: {\n\t\t\tgeometry: null,\n\t\t\tcolor: 'black',\n\t\t\twidth:1,\n\t\t\topacity:1\n\t\t},\n\n\t\tsphere: {\n\t\t\tposition: [0,0,0],\n\t\t\tradius: 1,\n\t\t\tsides: 20,\n\t\t\tunits: 'scene',\n\t\t\tmaterial: 'MeshBasicMaterial'\n\t\t},\n\n\t\ttube: {                \n\t\t\tgeometry: null,\n            radius: 1,\n            sides:6,\n\t\t\tmaterial: 'MeshBasicMaterial'\n        },\n\n        extrusion:{\n        \tfootprint: null,\n        \tbase: 0,\n        \ttop: 100,\n        \tcolor:'black',\n\t\t\tmaterial: 'MeshBasicMaterial',\n\t\t\tscaleToLatitude: false\n        },\n\n        loadObj:{\n        \tobj: null,\n        \tmtl: null,\n        \trotation: 0,\n        \tscale: 1,\n\t\t\tunits: 'scene'\n        },\n\n        Object3D: {\n        \tobj: null, \n\t\t\tunits: 'scene'\n        }\n\t},\n\n\tgeometries:{\n\t\tline: ['LineString'],\n\t\ttube: ['LineString'],\n\t\tsphere: ['Point'],\n\t}\n}\n\nmodule.exports = exports = Objects;"
  },
  {
    "path": "src/objects/sphere.js",
    "content": "var utils = require(\"../utils/utils.js\");\nvar material = require(\"../utils/material.js\");\nvar Objects = require('./objects.js');\n\nfunction Sphere(obj){\n\n\tobj = utils._validate(obj,  Objects.prototype._defaults.sphere);\n\tvar geometry = new THREE.SphereBufferGeometry( obj.radius, obj.sides, obj.sides );\n\tvar mat = material(obj)\n\tvar output = new THREE.Mesh( geometry, mat );\n\n\tif (obj.units === 'meters') output = Objects.prototype._makeGroup(output, obj);\n    Objects.prototype._addMethods(output);\n    return output\n}\n\n\nmodule.exports = exports = Sphere;"
  },
  {
    "path": "src/objects/tube.js",
    "content": "var utils = require(\"../utils/utils.js\");\nvar material = require(\"../utils/material.js\");\nvar Objects = require('./objects.js');\nvar THREE = require(\"../three.js\");\n\nfunction tube(obj, world){\n\n\t// validate and prep input geometry\n\tvar obj = utils._validate(obj, Objects.prototype._defaults.tube);\n    var straightProject = utils.lnglatsToWorld(obj.geometry);\n\tvar normalized = utils.normalizeVertices(straightProject);\n\n\tvar crossSection = tube.prototype.defineCrossSection(obj);\n\tvar vertices = tube.prototype.buildVertices(crossSection, normalized.vertices, world);\n\tvar geom = tube.prototype.buildFaces(vertices, normalized.vertices, obj);\n\n\tvar mat = material(obj);\n\n    var mesh = new THREE.Mesh( geom, mat );\n    mesh.position.copy(normalized.position);\n\n    return mesh\n\n}\n\ntube.prototype = {\n\n\tbuildVertices: function (crossSection, spine, world){\n\n\t\t//create reusable plane for intersection calculations\n\t\tvar geometry = new THREE.PlaneBufferGeometry(99999999999, 9999999999);\n\t\tvar m = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} );\n\t\tm.opacity = 0\n\t\tvar plane = new THREE.Mesh( geometry, m );\n\t\t// world.add( plane );\n\n\t\tvar geom = new THREE.Geometry(); \n\t\tvar lastElbow = false;\n\n\n\t\t// BUILD VERTICES: iterate through points in spine and position each vertex in cross section\n\n\n\t\t// get normalized vectors for each spine segment\n\t\tvar spineSegments = [spine[0].clone().normalize()];\n\n\t\tfor (i in spine) {\n\n\t\t\ti = parseFloat(i);\n\n\t\t\tvar segment;\n\n\t\t\tif (spine[i+1]){\n\t\t\t\tsegment = new THREE.Vector3()\n\t\t\t\t\t.subVectors( spine[i+1], spine[i])\n\t\t\t\t\t.normalize();\n\n\t\t\t}\n\n\t\t\tspineSegments.push(segment);\n\t\t}\n\n\t\tspineSegments.push(new THREE.Vector3());\n\n\t\tfor (i in spine) {\n\n\t\t\ti = parseFloat(i);\n\t\t\tvar lineVertex = spine[i];\n\n\t\t\t// ROTATE cross section\n\n\t\t\tvar humerus = spineSegments[i]\n\n\t\t\tvar forearm = spineSegments[i+1]\n\n\t\t\tvar midpointToLookAt = humerus.clone()\n\t\t\t\t.add(forearm)\n\t\t\t\t.normalize();\n\n\t\t\tif (i === 0) midpointToLookAt = forearm;\n\t\t\t\n\t\t\telse if (i === spine.length - 1) midpointToLookAt = humerus;\n\n\t\t\t\t\t\t\n\t\t\t// if first point in input line, rotate and translate it to position\n\t\t\tif (!lastElbow) {\n\n\t\t\t\tvar elbow = crossSection.clone();\n\n\t\t\t\telbow\n\t\t\t\t\t.lookAt(midpointToLookAt)\n\n\t\t\t\telbow.vertices.forEach(function(vertex){\n\t\t\t\t\tgeom.vertices\n\t\t\t\t\t\t.push(vertex.add(lineVertex));\n\t\t\t\t})\n\n\t\t\t\tlastElbow = elbow.vertices;\n\n\t\t\t}\n\n\t\t\telse {\n\n\t\t\t\tvar elbow = [];\n\t\t\t\tplane.position.copy(lineVertex);\n\t\t\t\tplane.lookAt(midpointToLookAt.clone().add(lineVertex));\n\t\t\t\tplane.updateMatrixWorld();\n\n\t\t\t\tlastElbow.forEach(function(v3){\n\n\t\t\t\t\tvar raycaster = new THREE.Raycaster(v3, humerus);\n\n\t\t\t\t\tvar intersection = raycaster\n\t\t\t\t\t\t.intersectObject(plane)[0];\n\n\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\tgeom.vertices.push(intersection.point);\n\t\t\t\t\t\telbow.push(intersection.point);\n\t\t\t\t\t}\n\n\t\t\t\t\telse console.error('Tube geometry failed at vertex '+i+'. Consider reducing tube radius, or smoothening out the sharp angle at this vertex')\n\t\t\t\t})\n\n\t\t\t\tlastElbow = elbow\n\t\t\t}\n\n\t\t}\n\n\t\tworld.remove(plane);\n\n\t\treturn geom\n\t},\n\n\tdefineCrossSection: function(obj){\n        var crossSection = new THREE.Geometry();\n        var count = obj.sides;\n\n        for ( var i = 0; i < count; i ++ ) {\n\n            var l = obj.radius;\n            var a = (i+0.5) / count * Math.PI;\n\n            crossSection.vertices.push( \n            \tnew THREE.Vector3 ( \n            \t\t-Math.sin( 2 * a ), \n            \t\tMath.cos( 2 * a ),\n            \t\t0\n            \t)\n            \t.multiplyScalar(l)\n            );\n        }\n\n        return crossSection\n\t},\n\n\t//build faces between vertices\n\n\tbuildFaces: function(geom, spine, obj){\n\n\t\tfor (var i in spine) {\n\n\t\t\ti = parseFloat(i);\n\t\t\tvar vertex = spine[i];\n\n\t\t\tif (i < spine.length - 1) {\n\n\t\t\t\tfor (var p = 0; p < obj.sides; p++) {\n\n\t\t\t\t\tvar b1 = i * obj.sides + p;\n\t\t\t\t\tvar b2 = i * obj.sides + (p+1) % obj.sides\n\t\t\t\t\tvar t1 = b1 + obj.sides\n\t\t\t\t\tvar t2 = b2 + obj.sides;\n\n\t\t\t\t\tvar triangle1 = new THREE.Face3(t1, b1, b2);\n\t\t\t\t\tvar triangle2 = new THREE.Face3(t1, b2, t2);\n\t\t\t\t\tgeom.faces.push(triangle1, triangle2)\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t//add endcaps\n\t\tvar v = geom.vertices.length;\n\n\t\tfor (var c = 0; c+2<obj.sides; c++) {\n\t\t\tvar tri1 = new THREE.Face3(0, c+2, c+1);\n\t\t\tvar tri2 = new THREE.Face3(v-1, v-1-(c+2), v-1-(c+1))\n\t\t\tgeom.faces.push(tri1, tri2)\n\t\t}\n\n\t\t//compute normals to get shading to work properly\n\t\tgeom.computeFaceNormals();\n\n\t\tvar bufferGeom = new THREE.BufferGeometry().fromGeometry(geom);\n\t\treturn geom\n\t}\n}\n\nmodule.exports = exports = tube;\n\n"
  },
  {
    "path": "src/three.js",
    "content": "// threejs.org/license\n(function(k,za){\"object\"===typeof exports&&\"undefined\"!==typeof module?za(exports):\"function\"===typeof define&&define.amd?define([\"exports\"],za):za(k.THREE={})})(this,function(k){function za(){}function B(a,b){this.x=a||0;this.y=b||0}function R(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0<arguments.length&&console.error(\"THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.\")}function ca(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function p(a,\nb,c){this.x=a||0;this.y=b||0;this.z=c||0}function la(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&console.error(\"THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.\")}function ea(a,b,c,d,e,f,g,h,l,m){Object.defineProperty(this,\"id\",{value:Ff++});this.uuid=J.generateUUID();this.name=\"\";this.image=void 0!==a?a:ea.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==b?b:ea.DEFAULT_MAPPING;this.wrapS=void 0!==c?c:1001;this.wrapT=void 0!==d?d:1001;this.magFilter=void 0!==\ne?e:1006;this.minFilter=void 0!==f?f:1008;this.anisotropy=void 0!==l?l:1;this.format=void 0!==g?g:1023;this.type=void 0!==h?h:1009;this.offset=new B(0,0);this.repeat=new B(1,1);this.center=new B(0,0);this.rotation=0;this.matrixAutoUpdate=!0;this.matrix=new la;this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=void 0!==m?m:3E3;this.version=0;this.onUpdate=null}function W(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}function kb(a,\nb,c){this.width=a;this.height=b;this.scissor=new W(0,0,a,b);this.scissorTest=!1;this.viewport=new W(0,0,a,b);c=c||{};void 0===c.minFilter&&(c.minFilter=1006);this.texture=new ea(void 0,void 0,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy,c.encoding);this.texture.generateMipmaps=void 0!==c.generateMipmaps?c.generateMipmaps:!0;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.depthTexture=void 0!==c.depthTexture?\nc.depthTexture:null}function Lb(a,b,c){kb.call(this,a,b,c);this.activeMipMapLevel=this.activeCubeFace=0}function lb(a,b,c,d,e,f,g,h,l,m,v,n){ea.call(this,null,f,g,h,l,m,d,e,v,n);this.image={data:a,width:b,height:c};this.magFilter=void 0!==l?l:1003;this.minFilter=void 0!==m?m:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1}function Xa(a,b){this.min=void 0!==a?a:new p(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new p(-Infinity,-Infinity,-Infinity)}function Ha(a,b){this.center=void 0!==\na?a:new p;this.radius=void 0!==b?b:0}function Ia(a,b){this.normal=void 0!==a?a:new p(1,0,0);this.constant=void 0!==b?b:0}function td(a,b,c,d,e,f){this.planes=[void 0!==a?a:new Ia,void 0!==b?b:new Ia,void 0!==c?c:new Ia,void 0!==d?d:new Ia,void 0!==e?e:new Ia,void 0!==f?f:new Ia]}function G(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function Vd(){function a(e,f){!1!==c&&(d(e,f),b.requestAnimationFrame(a))}var b=null,c=!1,d=null;return{start:function(){!0!==c&&null!==d&&(b.requestAnimationFrame(a),\nc=!0)},stop:function(){c=!1},setAnimationLoop:function(a){d=a},setContext:function(a){b=a}}}function Gf(a){function b(b,c){var d=b.array,e=b.dynamic?a.DYNAMIC_DRAW:a.STATIC_DRAW,h=a.createBuffer();a.bindBuffer(c,h);a.bufferData(c,d,e);b.onUploadCallback();c=a.FLOAT;d instanceof Float32Array?c=a.FLOAT:d instanceof Float64Array?console.warn(\"THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.\"):d instanceof Uint16Array?c=a.UNSIGNED_SHORT:d instanceof Int16Array?c=a.SHORT:d instanceof\nUint32Array?c=a.UNSIGNED_INT:d instanceof Int32Array?c=a.INT:d instanceof Int8Array?c=a.BYTE:d instanceof Uint8Array&&(c=a.UNSIGNED_BYTE);return{buffer:h,type:c,bytesPerElement:d.BYTES_PER_ELEMENT,version:b.version}}var c=new WeakMap;return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return c.get(a)},remove:function(b){b.isInterleavedBufferAttribute&&(b=b.data);var d=c.get(b);d&&(a.deleteBuffer(d.buffer),c.delete(b))},update:function(d,e){d.isInterleavedBufferAttribute&&(d=d.data);\nvar f=c.get(d);if(void 0===f)c.set(d,b(d,e));else if(f.version<d.version){var g=d,h=g.array,l=g.updateRange;a.bindBuffer(e,f.buffer);!1===g.dynamic?a.bufferData(e,h,a.STATIC_DRAW):-1===l.count?a.bufferSubData(e,0,h):0===l.count?console.error(\"THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.\"):(a.bufferSubData(e,l.offset*h.BYTES_PER_ELEMENT,h.subarray(l.offset,l.offset+l.count)),l.count=\n-1);f.version=d.version}}}}function mb(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||mb.DefaultOrder}function Wd(){this.mask=1}function H(){Object.defineProperty(this,\"id\",{value:Hf++});this.uuid=J.generateUUID();this.name=\"\";this.type=\"Object3D\";this.parent=null;this.children=[];this.up=H.DefaultUp.clone();var a=new p,b=new mb,c=new ca,d=new p(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,\n{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d},modelViewMatrix:{value:new R},normalMatrix:{value:new la}});this.matrix=new R;this.matrixWorld=new R;this.matrixAutoUpdate=H.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new Wd;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}}function Ra(){H.call(this);this.type=\"Camera\";this.matrixWorldInverse=\nnew R;this.projectionMatrix=new R}function Mb(a,b,c,d,e,f){Ra.call(this);this.type=\"OrthographicCamera\";this.zoom=1;this.view=null;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function Ya(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d&&d.isVector3?d:new p;this.vertexNormals=Array.isArray(d)?d:[];this.color=e&&e.isColor?e:new G;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=void 0!==f?f:0}function P(){Object.defineProperty(this,\n\"id\",{value:If+=2});this.uuid=J.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.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function L(a,b,c){if(Array.isArray(a))throw new TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");\nthis.name=\"\";this.array=a;this.itemSize=b;this.count=void 0!==a?a.length/b:0;this.normalized=!0===c;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function yc(a,b,c){L.call(this,new Int8Array(a),b,c)}function zc(a,b,c){L.call(this,new Uint8Array(a),b,c)}function Ac(a,b,c){L.call(this,new Uint8ClampedArray(a),b,c)}function Bc(a,b,c){L.call(this,new Int16Array(a),b,c)}function nb(a,b,c){L.call(this,new Uint16Array(a),b,c)}function Cc(a,b,c){L.call(this,new Int32Array(a),b,c)}function ob(a,\nb,c){L.call(this,new Uint32Array(a),b,c)}function z(a,b,c){L.call(this,new Float32Array(a),b,c)}function Dc(a,b,c){L.call(this,new Float64Array(a),b,c)}function Ge(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function He(a){if(0===a.length)return-Infinity;\nfor(var b=a[0],c=1,d=a.length;c<d;++c)a[c]>b&&(b=a[c]);return b}function D(){Object.defineProperty(this,\"id\",{value:Jf+=2});this.uuid=J.generateUUID();this.name=\"\";this.type=\"BufferGeometry\";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function Nb(a,b,c,d,e,f){P.call(this);this.type=\"BoxGeometry\";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,\ndepthSegments:f};this.fromBufferGeometry(new pb(a,b,c,d,e,f));this.mergeVertices()}function pb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,k,Q,M,Ob){var r=f/Q,u=g/M,O=f/2,y=g/2,x=k/2;g=Q+1;var w=M+1,C=f=0,A,B,z=new p;for(B=0;B<w;B++){var H=B*u-y;for(A=0;A<g;A++)z[a]=(A*r-O)*d,z[b]=H*e,z[c]=x,m.push(z.x,z.y,z.z),z[a]=0,z[b]=0,z[c]=0<k?1:-1,v.push(z.x,z.y,z.z),n.push(A/Q),n.push(1-B/M),f+=1}for(B=0;B<M;B++)for(A=0;A<Q;A++)a=t+A+g*(B+1),b=t+(A+1)+g*(B+1),c=t+(A+1)+g*B,l.push(t+A+g*B,a,c),l.push(a,b,c),C+=\n6;h.addGroup(q,C,Ob);q+=C;t+=f}D.call(this);this.type=\"BoxBufferGeometry\";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};var h=this;a=a||1;b=b||1;c=c||1;d=Math.floor(d)||1;e=Math.floor(e)||1;f=Math.floor(f)||1;var l=[],m=[],v=[],n=[],t=0,q=0;g(\"z\",\"y\",\"x\",-1,-1,c,b,a,f,e,0);g(\"z\",\"y\",\"x\",1,-1,c,b,-a,f,e,1);g(\"x\",\"z\",\"y\",1,1,a,c,b,d,f,2);g(\"x\",\"z\",\"y\",1,-1,a,c,-b,d,f,3);g(\"x\",\"y\",\"z\",1,-1,a,b,c,d,e,4);g(\"x\",\"y\",\"z\",-1,-1,a,b,-c,d,e,5);this.setIndex(l);this.addAttribute(\"position\",\nnew z(m,3));this.addAttribute(\"normal\",new z(v,3));this.addAttribute(\"uv\",new z(n,2))}function Fc(a,b,c,d){P.call(this);this.type=\"PlaneGeometry\";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new rb(a,b,c,d));this.mergeVertices()}function rb(a,b,c,d){D.call(this);this.type=\"PlaneBufferGeometry\";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};a=a||1;b=b||1;var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,l=a/c,m=\nb/d,v=[],n=[],t=[],q=[];for(a=0;a<h;a++){var r=a*m-f;for(b=0;b<g;b++)n.push(b*l-e,-r,0),t.push(0,0,1),q.push(b/c),q.push(1-a/d)}for(a=0;a<d;a++)for(b=0;b<c;b++)e=b+g*(a+1),f=b+1+g*(a+1),h=b+1+g*a,v.push(b+g*a,e,h),v.push(e,f,h);this.setIndex(v);this.addAttribute(\"position\",new z(n,3));this.addAttribute(\"normal\",new z(t,3));this.addAttribute(\"uv\",new z(q,2))}function I(){Object.defineProperty(this,\"id\",{value:Kf++});this.uuid=J.generateUUID();this.name=\"\";this.type=\"Material\";this.lights=this.fog=\n!0;this.blending=1;this.side=0;this.flatShading=!1;this.vertexColors=0;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=3;this.depthWrite=this.depthTest=!0;this.clippingPlanes=null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.dithering=!1;\nthis.alphaTest=0;this.premultipliedAlpha=!1;this.overdraw=0;this.visible=!0;this.userData={};this.needsUpdate=!0}function ua(a){I.call(this);this.type=\"MeshBasicMaterial\";this.color=new G(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.lights=\nthis.morphTargets=this.skinning=!1;this.setValues(a)}function Fa(a){I.call(this);this.type=\"ShaderMaterial\";this.defines={};this.uniforms={};this.vertexShader=\"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";this.fragmentShader=\"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1;this.extensions=\n{derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.uniformsNeedUpdate=!1;void 0!==a&&(void 0!==a.attributes&&console.error(\"THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.\"),this.setValues(a))}function sb(a,b){this.origin=void 0!==a?a:new p;this.direction=void 0!==b?b:new p}function Qb(a,b){this.start=void 0!==a?a:new p;this.end=void 0!==b?b:new p}\nfunction ta(a,b,c){this.a=void 0!==a?a:new p;this.b=void 0!==b?b:new p;this.c=void 0!==c?c:new p}function va(a,b){H.call(this);this.type=\"Mesh\";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new ua({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function Lf(a,b,c,d){function e(a,c){b.buffers.color.setClear(a.r,a.g,a.b,c,d)}var f=new G(0),g=0,h,l,m;return{getClearColor:function(){return f},setClearColor:function(a,b){f.set(a);g=void 0!==b?b:1;e(f,g)},getClearAlpha:function(){return g},\nsetClearAlpha:function(a){g=a;e(f,g)},render:function(b,d,t,q){d=d.background;null===d?e(f,g):d&&d.isColor&&(e(d,1),q=!0);(a.autoClear||q)&&a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil);d&&d.isCubeTexture?(void 0===m&&(m=new va(new pb(1,1,1),new Fa({uniforms:tb.cube.uniforms,vertexShader:tb.cube.vertexShader,fragmentShader:tb.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1,fog:!1})),m.geometry.removeAttribute(\"normal\"),m.geometry.removeAttribute(\"uv\"),m.onBeforeRender=function(a,\nb,c){this.matrixWorld.copyPosition(c.matrixWorld)},c.update(m)),m.material.uniforms.tCube.value=d,b.push(m,m.geometry,m.material,0,null)):d&&d.isTexture&&(void 0===h&&(h=new Mb(-1,1,1,-1,0,1),l=new va(new rb(2,2),new ua({depthTest:!1,depthWrite:!1,fog:!1})),c.update(l)),l.material.map=d,a.renderBufferDirect(h,null,l.geometry,l.material,l,null))}}}function Mf(a,b,c){var d;this.setMode=function(a){d=a};this.render=function(b,f){a.drawArrays(d,b,f);c.update(f,d)};this.renderInstances=function(a,f,g){var e=\nb.get(\"ANGLE_instanced_arrays\");null===e?console.error(\"THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.\"):(e.drawArraysInstancedANGLE(d,f,g,a.maxInstancedCount),c.update(g,d,a.maxInstancedCount))}}function Nf(a,b,c){function d(b){if(\"highp\"===b){if(0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision)return\"highp\";b=\"mediump\"}return\"mediump\"===\nb&&0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision?\"mediump\":\"lowp\"}var e,f=void 0!==c.precision?c.precision:\"highp\",g=d(f);g!==f&&(console.warn(\"THREE.WebGLRenderer:\",f,\"not supported, using\",g,\"instead.\"),f=g);c=!0===c.logarithmicDepthBuffer;g=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS);var h=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=a.getParameter(a.MAX_TEXTURE_SIZE),m=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),\nv=a.getParameter(a.MAX_VERTEX_ATTRIBS),n=a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),t=a.getParameter(a.MAX_VARYING_VECTORS),q=a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),r=0<h,k=!!b.get(\"OES_texture_float\");return{getMaxAnisotropy:function(){if(void 0!==e)return e;var c=b.get(\"EXT_texture_filter_anisotropic\");return e=null!==c?a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:d,precision:f,logarithmicDepthBuffer:c,maxTextures:g,maxVertexTextures:h,maxTextureSize:l,maxCubemapSize:m,\nmaxAttributes:v,maxVertexUniforms:n,maxVaryings:t,maxFragmentUniforms:q,vertexTextures:r,floatFragmentTextures:k,floatVertexTextures:r&&k}}function Of(){function a(){m.value!==d&&(m.value=d,m.needsUpdate=0<e);c.numPlanes=e;c.numIntersection=0}function b(a,b,d,e){var f=null!==a?a.length:0,g=null;if(0!==f){g=m.value;if(!0!==e||null===g){e=d+4*f;b=b.matrixWorldInverse;l.getNormalMatrix(b);if(null===g||g.length<e)g=new Float32Array(e);for(e=0;e!==f;++e,d+=4)h.copy(a[e]).applyMatrix4(b,l),h.normal.toArray(g,\nd),g[d+3]=h.constant}m.value=g;m.needsUpdate=!0}c.numPlanes=f;return g}var c=this,d=null,e=0,f=!1,g=!1,h=new Ia,l=new la,m={value:null,needsUpdate:!1};this.uniform=m;this.numIntersection=this.numPlanes=0;this.init=function(a,c,g){var h=0!==a.length||c||0!==e||f;f=c;d=b(a,g,0);e=a.length;return h};this.beginShadows=function(){g=!0;b(null)};this.endShadows=function(){g=!1;a()};this.setState=function(c,h,l,q,r,k){if(!f||null===c||0===c.length||g&&!l)g?b(null):a();else{l=g?0:e;var n=4*l,v=r.clippingState||\nnull;m.value=v;v=b(c,q,n,k);for(c=0;c!==n;++c)v[c]=d[c];r.clippingState=v;this.numIntersection=h?this.numPlanes:0;this.numPlanes+=l}}}function Pf(a){var b={};return{get:function(c){if(void 0!==b[c])return b[c];switch(c){case \"WEBGL_depth_texture\":var d=a.getExtension(\"WEBGL_depth_texture\")||a.getExtension(\"MOZ_WEBGL_depth_texture\")||a.getExtension(\"WEBKIT_WEBGL_depth_texture\");break;case \"EXT_texture_filter_anisotropic\":d=a.getExtension(\"EXT_texture_filter_anisotropic\")||a.getExtension(\"MOZ_EXT_texture_filter_anisotropic\")||\na.getExtension(\"WEBKIT_EXT_texture_filter_anisotropic\");break;case \"WEBGL_compressed_texture_s3tc\":d=a.getExtension(\"WEBGL_compressed_texture_s3tc\")||a.getExtension(\"MOZ_WEBGL_compressed_texture_s3tc\")||a.getExtension(\"WEBKIT_WEBGL_compressed_texture_s3tc\");break;case \"WEBGL_compressed_texture_pvrtc\":d=a.getExtension(\"WEBGL_compressed_texture_pvrtc\")||a.getExtension(\"WEBKIT_WEBGL_compressed_texture_pvrtc\");break;default:d=a.getExtension(c)}null===d&&console.warn(\"THREE.WebGLRenderer: \"+c+\" extension not supported.\");\nreturn b[c]=d}}}function Qf(a,b,c){function d(a){a=a.target;var g=e[a.id];null!==g.index&&b.remove(g.index);for(var l in g.attributes)b.remove(g.attributes[l]);a.removeEventListener(\"dispose\",d);delete e[a.id];if(l=f[a.id])b.remove(l),delete f[a.id];if(l=f[g.id])b.remove(l),delete f[g.id];c.memory.geometries--}var e={},f={};return{get:function(a,b){var f=e[b.id];if(f)return f;b.addEventListener(\"dispose\",d);b.isBufferGeometry?f=b:b.isGeometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new D).setFromObject(a)),\nf=b._bufferGeometry);e[b.id]=f;c.memory.geometries++;return f},update:function(c){var d=c.index,e=c.attributes;null!==d&&b.update(d,a.ELEMENT_ARRAY_BUFFER);for(var f in e)b.update(e[f],a.ARRAY_BUFFER);c=c.morphAttributes;for(f in c){d=c[f];e=0;for(var g=d.length;e<g;e++)b.update(d[e],a.ARRAY_BUFFER)}},getWireframeAttribute:function(c){var d=f[c.id];if(d)return d;d=[];var e=c.index,g=c.attributes;if(null!==e){e=e.array;g=0;for(var v=e.length;g<v;g+=3){var n=e[g+0],t=e[g+1],q=e[g+2];d.push(n,t,t,q,\nq,n)}}else for(e=g.position.array,g=0,v=e.length/3-1;g<v;g+=3)n=g+0,t=g+1,q=g+2,d.push(n,t,t,q,q,n);d=new (65535<He(d)?ob:nb)(d,1);b.update(d,a.ELEMENT_ARRAY_BUFFER);return f[c.id]=d}}}function Rf(a,b,c){var d,e,f;this.setMode=function(a){d=a};this.setIndex=function(a){e=a.type;f=a.bytesPerElement};this.render=function(b,h){a.drawElements(d,h,e,b*f);c.update(h,d)};this.renderInstances=function(a,h,l){var g=b.get(\"ANGLE_instanced_arrays\");null===g?console.error(\"THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.\"):\n(g.drawElementsInstancedANGLE(d,l,e,h*f,a.maxInstancedCount),c.update(l,d,a.maxInstancedCount))}}function Sf(a){var b={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:b,programs:null,autoReset:!0,reset:function(){b.frame++;b.calls=0;b.triangles=0;b.points=0;b.lines=0},update:function(c,d,e){e=e||1;b.calls++;switch(d){case a.TRIANGLES:b.triangles+=c/3*e;break;case a.TRIANGLE_STRIP:case a.TRIANGLE_FAN:b.triangles+=e*(c-2);break;case a.LINES:b.lines+=c/2*\ne;break;case a.LINE_STRIP:b.lines+=e*(c-1);break;case a.LINE_LOOP:b.lines+=e*c;break;case a.POINTS:b.points+=e*c;break;default:console.error(\"THREE.WebGLInfo: Unknown draw mode:\",d)}}}}function Tf(a,b){return Math.abs(b[1])-Math.abs(a[1])}function Uf(a){var b={},c=new Float32Array(8);return{update:function(d,e,f,g){var h=d.morphTargetInfluences,l=h.length;d=b[e.id];if(void 0===d){d=[];for(var m=0;m<l;m++)d[m]=[m,0];b[e.id]=d}var v=f.morphTargets&&e.morphAttributes.position;f=f.morphNormals&&e.morphAttributes.normal;\nfor(m=0;m<l;m++){var n=d[m];0!==n[1]&&(v&&e.removeAttribute(\"morphTarget\"+m),f&&e.removeAttribute(\"morphNormal\"+m))}for(m=0;m<l;m++)n=d[m],n[0]=m,n[1]=h[m];d.sort(Tf);for(m=0;8>m;m++){if(n=d[m])if(h=n[0],l=n[1]){v&&e.addAttribute(\"morphTarget\"+m,v[h]);f&&e.addAttribute(\"morphNormal\"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a,\"morphTargetInfluences\",c)}}}function Vf(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),\na.update(g),c[g.id]=e);return g},dispose:function(){c={}}}}function Za(a,b,c,d,e,f,g,h,l,m){a=void 0!==a?a:[];ea.call(this,a,void 0!==b?b:301,c,d,e,f,g,h,l,m);this.flipY=!1}function Rb(a,b,c){var d=a[0];if(0>=d||0<d)return a;var e=b*c,f=Ie[e];void 0===f&&(f=new Float32Array(e),Ie[e]=f);if(0!==b)for(d.toArray(f,0),d=1,e=0;d!==b;++d)e+=c,a[d].toArray(f,e);return f}function da(a,b){if(a.length!==b.length)return!1;for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function qa(a,b){for(var c=\n0,d=b.length;c<d;c++)a[c]=b[c]}function Je(a,b){var c=Ke[b];void 0===c&&(c=new Int32Array(b),Ke[b]=c);for(var d=0;d!==b;++d)c[d]=a.allocTextureUnit();return c}function Wf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[0]=b)}function Xf(a,b){var c=this.cache;c[0]!==b&&(a.uniform1i(this.addr,b),c[0]=b)}function Yf(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y)a.uniform2f(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y}else da(c,b)||(a.uniform2fv(this.addr,b),qa(c,b))}function Zf(a,\nb){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z)a.uniform3f(this.addr,b.x,b.y,b.z),c[0]=b.x,c[1]=b.y,c[2]=b.z}else if(void 0!==b.r){if(c[0]!==b.r||c[1]!==b.g||c[2]!==b.b)a.uniform3f(this.addr,b.r,b.g,b.b),c[0]=b.r,c[1]=b.g,c[2]=b.b}else da(c,b)||(a.uniform3fv(this.addr,b),qa(c,b))}function $f(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)a.uniform4f(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w}else da(c,b)||(a.uniform4fv(this.addr,\nb),qa(c,b))}function ag(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),qa(c,b)):da(c,d)||(Le.set(d),a.uniformMatrix2fv(this.addr,!1,Le),qa(c,d))}function bg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),qa(c,b)):da(c,d)||(Me.set(d),a.uniformMatrix3fv(this.addr,!1,Me),qa(c,d))}function cg(a,b){var c=this.cache,d=b.elements;void 0===d?da(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),qa(c,b)):da(c,d)||(Ne.set(d),a.uniformMatrix4fv(this.addr,\n!1,Ne),qa(c,d))}function dg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture2D(b||Oe,e)}function eg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTextureCube(b||Pe,e)}function Qe(a,b){var c=this.cache;da(c,b)||(a.uniform2iv(this.addr,b),qa(c,b))}function Re(a,b){var c=this.cache;da(c,b)||(a.uniform3iv(this.addr,b),qa(c,b))}function Se(a,b){var c=this.cache;da(c,b)||(a.uniform4iv(this.addr,b),qa(c,\nb))}function fg(a){switch(a){case 5126:return Wf;case 35664:return Yf;case 35665:return Zf;case 35666:return $f;case 35674:return ag;case 35675:return bg;case 35676:return cg;case 35678:case 36198:return dg;case 35680:return eg;case 5124:case 35670:return Xf;case 35667:case 35671:return Qe;case 35668:case 35672:return Re;case 35669:case 35673:return Se}}function gg(a,b){var c=this.cache;da(c,b)||(a.uniform1fv(this.addr,b),qa(c,b))}function hg(a,b){var c=this.cache;da(c,b)||(a.uniform1iv(this.addr,\nb),qa(c,b))}function ig(a,b){var c=this.cache;b=Rb(b,this.size,2);da(c,b)||(a.uniform2fv(this.addr,b),this.updateCache(b))}function jg(a,b){var c=this.cache;b=Rb(b,this.size,3);da(c,b)||(a.uniform3fv(this.addr,b),this.updateCache(b))}function kg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.uniform4fv(this.addr,b),this.updateCache(b))}function lg(a,b){var c=this.cache;b=Rb(b,this.size,4);da(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),this.updateCache(b))}function mg(a,b){var c=this.cache;b=\nRb(b,this.size,9);da(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),this.updateCache(b))}function ng(a,b){var c=this.cache;b=Rb(b,this.size,16);da(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),this.updateCache(b))}function og(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(a.uniform1iv(this.addr,f),qa(d,f));for(a=0;a!==e;++a)c.setTexture2D(b[a]||Oe,f[a])}function pg(a,b,c){var d=this.cache,e=b.length,f=Je(c,e);!1===da(d,f)&&(a.uniform1iv(this.addr,f),qa(d,f));for(a=0;a!==e;++a)c.setTextureCube(b[a]||\nPe,f[a])}function qg(a){switch(a){case 5126:return gg;case 35664:return ig;case 35665:return jg;case 35666:return kg;case 35674:return lg;case 35675:return mg;case 35676:return ng;case 35678:return og;case 35680:return pg;case 5124:case 35670:return hg;case 35667:case 35671:return Qe;case 35668:case 35672:return Re;case 35669:case 35673:return Se}}function rg(a,b,c){this.id=a;this.addr=c;this.cache=[];this.setValue=fg(b.type)}function Te(a,b,c){this.id=a;this.addr=c;this.cache=[];this.size=b.size;\nthis.setValue=qg(b.type)}function Ue(a){this.id=a;this.seq=[];this.map={}}function eb(a,b,c){this.seq=[];this.map={};this.renderer=c;c=a.getProgramParameter(b,a.ACTIVE_UNIFORMS);for(var d=0;d<c;++d){var e=a.getActiveUniform(b,d),f=a.getUniformLocation(b,e.name),g=this,h=e.name,l=h.length;for(Xd.lastIndex=0;;){var m=Xd.exec(h),v=Xd.lastIndex,n=m[1],t=m[3];\"]\"===m[2]&&(n|=0);if(void 0===t||\"[\"===t&&v+2===l){h=g;e=void 0===t?new rg(n,e,f):new Te(n,e,f);h.seq.push(e);h.map[e.id]=e;break}else t=g.map[n],\nvoid 0===t&&(t=new Ue(n),n=g,g=t,n.seq.push(g),n.map[g.id]=g),g=t}}}function sg(a){a=a.split(\"\\n\");for(var b=0;b<a.length;b++)a[b]=b+1+\": \"+a[b];return a.join(\"\\n\")}function Ve(a,b,c){var d=a.createShader(b);a.shaderSource(d,c);a.compileShader(d);!1===a.getShaderParameter(d,a.COMPILE_STATUS)&&console.error(\"THREE.WebGLShader: Shader couldn't compile.\");\"\"!==a.getShaderInfoLog(d)&&console.warn(\"THREE.WebGLShader: gl.getShaderInfoLog()\",b===a.VERTEX_SHADER?\"vertex\":\"fragment\",a.getShaderInfoLog(d),\nsg(c));return d}function We(a){switch(a){case 3E3:return[\"Linear\",\"( value )\"];case 3001:return[\"sRGB\",\"( value )\"];case 3002:return[\"RGBE\",\"( value )\"];case 3004:return[\"RGBM\",\"( value, 7.0 )\"];case 3005:return[\"RGBM\",\"( value, 16.0 )\"];case 3006:return[\"RGBD\",\"( value, 256.0 )\"];case 3007:return[\"Gamma\",\"( value, float( GAMMA_FACTOR ) )\"];default:throw Error(\"unsupported encoding: \"+a);}}function Yd(a,b){b=We(b);return\"vec4 \"+a+\"( vec4 value ) { return \"+b[0]+\"ToLinear\"+b[1]+\"; }\"}function tg(a,\nb){b=We(b);return\"vec4 \"+a+\"( vec4 value ) { return LinearTo\"+b[0]+b[1]+\"; }\"}function ug(a,b){switch(b){case 1:b=\"Linear\";break;case 2:b=\"Reinhard\";break;case 3:b=\"Uncharted2\";break;case 4:b=\"OptimizedCineon\";break;default:throw Error(\"unsupported toneMapping: \"+b);}return\"vec3 \"+a+\"( vec3 color ) { return \"+b+\"ToneMapping( color ); }\"}function vg(a,b,c){a=a||{};return[a.derivatives||b.envMapCubeUV||b.bumpMap||b.normalMap&&!b.objectSpaceNormalMap||b.flatShading?\"#extension GL_OES_standard_derivatives : enable\":\n\"\",(a.fragDepth||b.logarithmicDepthBuffer)&&c.get(\"EXT_frag_depth\")?\"#extension GL_EXT_frag_depth : enable\":\"\",a.drawBuffers&&c.get(\"WEBGL_draw_buffers\")?\"#extension GL_EXT_draw_buffers : require\":\"\",(a.shaderTextureLOD||b.envMap)&&c.get(\"EXT_shader_texture_lod\")?\"#extension GL_EXT_shader_texture_lod : enable\":\"\"].filter(Gc).join(\"\\n\")}function wg(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push(\"#define \"+c+\" \"+d)}return b.join(\"\\n\")}function Gc(a){return\"\"!==a}function Xe(a,b){return a.replace(/NUM_DIR_LIGHTS/g,\nb.numDirLights).replace(/NUM_SPOT_LIGHTS/g,b.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,b.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,b.numPointLights).replace(/NUM_HEMI_LIGHTS/g,b.numHemiLights)}function Ye(a,b){return a.replace(/NUM_CLIPPING_PLANES/g,b.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,b.numClippingPlanes-b.numClipIntersection)}function Zd(a){return a.replace(/^[ \\t]*#include +<([\\w\\d.]+)>/gm,function(a,c){a=S[c];if(void 0===a)throw Error(\"Can not resolve #include <\"+c+\n\">\");return Zd(a)})}function Ze(a){return a.replace(/#pragma unroll_loop[\\s]+?for \\( int i = (\\d+); i < (\\d+); i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g,function(a,c,d,e){a=\"\";for(c=parseInt(c);c<parseInt(d);c++)a+=e.replace(/\\[ i \\]/g,\"[ \"+c+\" ]\");return a})}function xg(a,b,c,d,e,f){var g=a.context,h=d.defines,l=e.vertexShader,m=e.fragmentShader,v=\"SHADOWMAP_TYPE_BASIC\";1===f.shadowMapType?v=\"SHADOWMAP_TYPE_PCF\":2===f.shadowMapType&&(v=\"SHADOWMAP_TYPE_PCF_SOFT\");var n=\"ENVMAP_TYPE_CUBE\",t=\"ENVMAP_MODE_REFLECTION\",\nq=\"ENVMAP_BLENDING_MULTIPLY\";if(f.envMap){switch(d.envMap.mapping){case 301:case 302:n=\"ENVMAP_TYPE_CUBE\";break;case 306:case 307:n=\"ENVMAP_TYPE_CUBE_UV\";break;case 303:case 304:n=\"ENVMAP_TYPE_EQUIREC\";break;case 305:n=\"ENVMAP_TYPE_SPHERE\"}switch(d.envMap.mapping){case 302:case 304:t=\"ENVMAP_MODE_REFRACTION\"}switch(d.combine){case 0:q=\"ENVMAP_BLENDING_MULTIPLY\";break;case 1:q=\"ENVMAP_BLENDING_MIX\";break;case 2:q=\"ENVMAP_BLENDING_ADD\"}}var r=0<a.gammaFactor?a.gammaFactor:1,k=vg(d.extensions,f,b),p=\nwg(h),w=g.createProgram();d.isRawShaderMaterial?(h=[p].filter(Gc).join(\"\\n\"),0<h.length&&(h+=\"\\n\"),b=[k,p].filter(Gc).join(\"\\n\"),0<b.length&&(b+=\"\\n\")):(h=[\"precision \"+f.precision+\" float;\",\"precision \"+f.precision+\" int;\",\"#define SHADER_NAME \"+e.name,p,f.supportsVertexTextures?\"#define VERTEX_TEXTURES\":\"\",\"#define GAMMA_FACTOR \"+r,\"#define MAX_BONES \"+f.maxBones,f.useFog&&f.fog?\"#define USE_FOG\":\"\",f.useFog&&f.fogExp?\"#define FOG_EXP2\":\"\",f.map?\"#define USE_MAP\":\"\",f.envMap?\"#define USE_ENVMAP\":\n\"\",f.envMap?\"#define \"+t:\"\",f.lightMap?\"#define USE_LIGHTMAP\":\"\",f.aoMap?\"#define USE_AOMAP\":\"\",f.emissiveMap?\"#define USE_EMISSIVEMAP\":\"\",f.bumpMap?\"#define USE_BUMPMAP\":\"\",f.normalMap?\"#define USE_NORMALMAP\":\"\",f.normalMap&&f.objectSpaceNormalMap?\"#define OBJECTSPACE_NORMALMAP\":\"\",f.displacementMap&&f.supportsVertexTextures?\"#define USE_DISPLACEMENTMAP\":\"\",f.specularMap?\"#define USE_SPECULARMAP\":\"\",f.roughnessMap?\"#define USE_ROUGHNESSMAP\":\"\",f.metalnessMap?\"#define USE_METALNESSMAP\":\"\",f.alphaMap?\n\"#define USE_ALPHAMAP\":\"\",f.vertexColors?\"#define USE_COLOR\":\"\",f.flatShading?\"#define FLAT_SHADED\":\"\",f.skinning?\"#define USE_SKINNING\":\"\",f.useVertexTexture?\"#define BONE_TEXTURE\":\"\",f.morphTargets?\"#define USE_MORPHTARGETS\":\"\",f.morphNormals&&!1===f.flatShading?\"#define USE_MORPHNORMALS\":\"\",f.doubleSided?\"#define DOUBLE_SIDED\":\"\",f.flipSided?\"#define FLIP_SIDED\":\"\",f.shadowMapEnabled?\"#define USE_SHADOWMAP\":\"\",f.shadowMapEnabled?\"#define \"+v:\"\",f.sizeAttenuation?\"#define USE_SIZEATTENUATION\":\"\",\nf.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",f.logarithmicDepthBuffer&&b.get(\"EXT_frag_depth\")?\"#define USE_LOGDEPTHBUF_EXT\":\"\",\"uniform mat4 modelMatrix;\",\"uniform mat4 modelViewMatrix;\",\"uniform mat4 projectionMatrix;\",\"uniform mat4 viewMatrix;\",\"uniform mat3 normalMatrix;\",\"uniform vec3 cameraPosition;\",\"attribute vec3 position;\",\"attribute vec3 normal;\",\"attribute vec2 uv;\",\"#ifdef USE_COLOR\",\"\\tattribute vec3 color;\",\"#endif\",\"#ifdef USE_MORPHTARGETS\",\"\\tattribute vec3 morphTarget0;\",\n\"\\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;\",\n\"#endif\",\"\\n\"].filter(Gc).join(\"\\n\"),b=[k,\"precision \"+f.precision+\" float;\",\"precision \"+f.precision+\" int;\",\"#define SHADER_NAME \"+e.name,p,f.alphaTest?\"#define ALPHATEST \"+f.alphaTest+(f.alphaTest%1?\"\":\".0\"):\"\",\"#define GAMMA_FACTOR \"+r,f.useFog&&f.fog?\"#define USE_FOG\":\"\",f.useFog&&f.fogExp?\"#define FOG_EXP2\":\"\",f.map?\"#define USE_MAP\":\"\",f.envMap?\"#define USE_ENVMAP\":\"\",f.envMap?\"#define \"+n:\"\",f.envMap?\"#define \"+t:\"\",f.envMap?\"#define \"+q:\"\",f.lightMap?\"#define USE_LIGHTMAP\":\"\",f.aoMap?\"#define USE_AOMAP\":\n\"\",f.emissiveMap?\"#define USE_EMISSIVEMAP\":\"\",f.bumpMap?\"#define USE_BUMPMAP\":\"\",f.normalMap?\"#define USE_NORMALMAP\":\"\",f.normalMap&&f.objectSpaceNormalMap?\"#define OBJECTSPACE_NORMALMAP\":\"\",f.specularMap?\"#define USE_SPECULARMAP\":\"\",f.roughnessMap?\"#define USE_ROUGHNESSMAP\":\"\",f.metalnessMap?\"#define USE_METALNESSMAP\":\"\",f.alphaMap?\"#define USE_ALPHAMAP\":\"\",f.vertexColors?\"#define USE_COLOR\":\"\",f.gradientMap?\"#define USE_GRADIENTMAP\":\"\",f.flatShading?\"#define FLAT_SHADED\":\"\",f.doubleSided?\"#define DOUBLE_SIDED\":\n\"\",f.flipSided?\"#define FLIP_SIDED\":\"\",f.shadowMapEnabled?\"#define USE_SHADOWMAP\":\"\",f.shadowMapEnabled?\"#define \"+v:\"\",f.premultipliedAlpha?\"#define PREMULTIPLIED_ALPHA\":\"\",f.physicallyCorrectLights?\"#define PHYSICALLY_CORRECT_LIGHTS\":\"\",f.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",f.logarithmicDepthBuffer&&b.get(\"EXT_frag_depth\")?\"#define USE_LOGDEPTHBUF_EXT\":\"\",f.envMap&&b.get(\"EXT_shader_texture_lod\")?\"#define TEXTURE_LOD_EXT\":\"\",\"uniform mat4 viewMatrix;\",\"uniform vec3 cameraPosition;\",\n0!==f.toneMapping?\"#define TONE_MAPPING\":\"\",0!==f.toneMapping?S.tonemapping_pars_fragment:\"\",0!==f.toneMapping?ug(\"toneMapping\",f.toneMapping):\"\",f.dithering?\"#define DITHERING\":\"\",f.outputEncoding||f.mapEncoding||f.envMapEncoding||f.emissiveMapEncoding?S.encodings_pars_fragment:\"\",f.mapEncoding?Yd(\"mapTexelToLinear\",f.mapEncoding):\"\",f.envMapEncoding?Yd(\"envMapTexelToLinear\",f.envMapEncoding):\"\",f.emissiveMapEncoding?Yd(\"emissiveMapTexelToLinear\",f.emissiveMapEncoding):\"\",f.outputEncoding?tg(\"linearToOutputTexel\",\nf.outputEncoding):\"\",f.depthPacking?\"#define DEPTH_PACKING \"+d.depthPacking:\"\",\"\\n\"].filter(Gc).join(\"\\n\"));l=Zd(l);l=Xe(l,f);l=Ye(l,f);m=Zd(m);m=Xe(m,f);m=Ye(m,f);l=Ze(l);m=Ze(m);m=b+m;l=Ve(g,g.VERTEX_SHADER,h+l);m=Ve(g,g.FRAGMENT_SHADER,m);g.attachShader(w,l);g.attachShader(w,m);void 0!==d.index0AttributeName?g.bindAttribLocation(w,0,d.index0AttributeName):!0===f.morphTargets&&g.bindAttribLocation(w,0,\"position\");g.linkProgram(w);f=g.getProgramInfoLog(w).trim();v=g.getShaderInfoLog(l).trim();n=\ng.getShaderInfoLog(m).trim();q=t=!0;if(!1===g.getProgramParameter(w,g.LINK_STATUS))t=!1,console.error(\"THREE.WebGLProgram: shader error: \",g.getError(),\"gl.VALIDATE_STATUS\",g.getProgramParameter(w,g.VALIDATE_STATUS),\"gl.getProgramInfoLog\",f,v,n);else if(\"\"!==f)console.warn(\"THREE.WebGLProgram: gl.getProgramInfoLog()\",f);else if(\"\"===v||\"\"===n)q=!1;q&&(this.diagnostics={runnable:t,material:d,programLog:f,vertexShader:{log:v,prefix:h},fragmentShader:{log:n,prefix:b}});g.deleteShader(l);g.deleteShader(m);\nvar x;this.getUniforms=function(){void 0===x&&(x=new eb(g,w,a));return x};var A;this.getAttributes=function(){if(void 0===A){for(var a={},b=g.getProgramParameter(w,g.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=g.getActiveAttrib(w,c).name;a[d]=g.getAttribLocation(w,d)}A=a}return A};this.destroy=function(){g.deleteProgram(w);this.program=void 0};Object.defineProperties(this,{uniforms:{get:function(){console.warn(\"THREE.WebGLProgram: .uniforms is now .getUniforms().\");return this.getUniforms()}},attributes:{get:function(){console.warn(\"THREE.WebGLProgram: .attributes is now .getAttributes().\");\nreturn this.getAttributes()}}});this.name=e.name;this.id=yg++;this.code=c;this.usedTimes=1;this.program=w;this.vertexShader=l;this.fragmentShader=m;return this}function zg(a,b,c){function d(a,b){if(a)a.isTexture?c=a.encoding:a.isWebGLRenderTarget&&(console.warn(\"THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead.\"),c=a.texture.encoding);else var c=3E3;3E3===c&&b&&(c=3007);return c}var e=[],f={MeshDepthMaterial:\"depth\",MeshDistanceMaterial:\"distanceRGBA\",\nMeshNormalMaterial:\"normal\",MeshBasicMaterial:\"basic\",MeshLambertMaterial:\"lambert\",MeshPhongMaterial:\"phong\",MeshToonMaterial:\"phong\",MeshStandardMaterial:\"physical\",MeshPhysicalMaterial:\"physical\",LineBasicMaterial:\"basic\",LineDashedMaterial:\"dashed\",PointsMaterial:\"points\",ShadowMaterial:\"shadow\"},g=\"precision supportsVertexTextures map mapEncoding envMap envMapMode envMapEncoding lightMap aoMap emissiveMap emissiveMapEncoding bumpMap normalMap objectSpaceNormalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking dithering\".split(\" \");\nthis.getParameters=function(b,e,g,v,n,t,q){var h=f[b.type];if(q.isSkinnedMesh){var l=q.skeleton.bones;if(c.floatVertexTextures)l=1024;else{var m=Math.min(Math.floor((c.maxVertexUniforms-20)/4),l.length);m<l.length?(console.warn(\"THREE.WebGLRenderer: Skeleton has \"+l.length+\" bones. This GPU supports \"+m+\".\"),l=0):l=m}}else l=0;m=c.precision;null!==b.precision&&(m=c.getMaxPrecision(b.precision),m!==b.precision&&console.warn(\"THREE.WebGLProgram.getParameters:\",b.precision,\"not supported, using\",m,\"instead.\"));\nvar k=a.getRenderTarget();return{shaderID:h,precision:m,supportsVertexTextures:c.vertexTextures,outputEncoding:d(k?k.texture:null,a.gammaOutput),map:!!b.map,mapEncoding:d(b.map,a.gammaInput),envMap:!!b.envMap,envMapMode:b.envMap&&b.envMap.mapping,envMapEncoding:d(b.envMap,a.gammaInput),envMapCubeUV:!!b.envMap&&(306===b.envMap.mapping||307===b.envMap.mapping),lightMap:!!b.lightMap,aoMap:!!b.aoMap,emissiveMap:!!b.emissiveMap,emissiveMapEncoding:d(b.emissiveMap,a.gammaInput),bumpMap:!!b.bumpMap,normalMap:!!b.normalMap,\nobjectSpaceNormalMap:1===b.normalMapType,displacementMap:!!b.displacementMap,roughnessMap:!!b.roughnessMap,metalnessMap:!!b.metalnessMap,specularMap:!!b.specularMap,alphaMap:!!b.alphaMap,gradientMap:!!b.gradientMap,combine:b.combine,vertexColors:b.vertexColors,fog:!!v,useFog:b.fog,fogExp:v&&v.isFogExp2,flatShading:b.flatShading,sizeAttenuation:b.sizeAttenuation,logarithmicDepthBuffer:c.logarithmicDepthBuffer,skinning:b.skinning&&0<l,maxBones:l,useVertexTexture:c.floatVertexTextures,morphTargets:b.morphTargets,\nmorphNormals:b.morphNormals,maxMorphTargets:a.maxMorphTargets,maxMorphNormals:a.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numClippingPlanes:n,numClipIntersection:t,dithering:b.dithering,shadowMapEnabled:a.shadowMap.enabled&&q.receiveShadow&&0<g.length,shadowMapType:a.shadowMap.type,toneMapping:a.toneMapping,physicallyCorrectLights:a.physicallyCorrectLights,premultipliedAlpha:b.premultipliedAlpha,\nalphaTest:b.alphaTest,doubleSided:2===b.side,flipSided:1===b.side,depthPacking:void 0!==b.depthPacking?b.depthPacking:!1}};this.getProgramCode=function(b,c){var d=[];c.shaderID?d.push(c.shaderID):(d.push(b.fragmentShader),d.push(b.vertexShader));if(void 0!==b.defines)for(var e in b.defines)d.push(e),d.push(b.defines[e]);for(e=0;e<g.length;e++)d.push(c[g[e]]);d.push(b.onBeforeCompile.toString());d.push(a.gammaOutput);return d.join()};this.acquireProgram=function(c,d,f,g){for(var h,l=0,m=e.length;l<\nm;l++){var v=e[l];if(v.code===g){h=v;++h.usedTimes;break}}void 0===h&&(h=new xg(a,b,g,c,d,f),e.push(h));return h};this.releaseProgram=function(a){if(0===--a.usedTimes){var b=e.indexOf(a);e[b]=e[e.length-1];e.pop();a.destroy()}};this.programs=e}function Ag(){var a=new WeakMap;return{get:function(b){var c=a.get(b);void 0===c&&(c={},a.set(b,c));return c},remove:function(b){a.delete(b)},update:function(b,c,d){a.get(b)[c]=d},dispose:function(){a=new WeakMap}}}function Bg(a,b){return a.renderOrder!==b.renderOrder?\na.renderOrder-b.renderOrder:a.program&&b.program&&a.program!==b.program?a.program.id-b.program.id:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function Cg(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function Dg(){var a=[],b=0,c=[],d=[];return{opaque:c,transparent:d,init:function(){b=0;c.length=0;d.length=0},push:function(e,f,g,h,l){var m=a[b];void 0===m?(m={id:e.id,object:e,geometry:f,material:g,program:g.program,\nrenderOrder:e.renderOrder,z:h,group:l},a[b]=m):(m.id=e.id,m.object=e,m.geometry=f,m.material=g,m.program=g.program,m.renderOrder=e.renderOrder,m.z=h,m.group=l);(!0===g.transparent?d:c).push(m);b++},sort:function(){1<c.length&&c.sort(Bg);1<d.length&&d.sort(Cg)}}}function Eg(){var a={};return{get:function(b,c){b=b.id+\",\"+c.id;c=a[b];void 0===c&&(c=new Dg,a[b]=c);return c},dispose:function(){a={}}}}function Fg(){var a={};return{get:function(b){if(void 0!==a[b.id])return a[b.id];switch(b.type){case \"DirectionalLight\":var c=\n{direction:new p,color:new G,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new B};break;case \"SpotLight\":c={position:new p,direction:new p,color:new G,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new B};break;case \"PointLight\":c={position:new p,color:new G,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new B,shadowCameraNear:1,shadowCameraFar:1E3};break;case \"HemisphereLight\":c={direction:new p,skyColor:new G,groundColor:new G};\nbreak;case \"RectAreaLight\":c={color:new G,position:new p,halfWidth:new p,halfHeight:new p}}return a[b.id]=c}}}function Gg(){var a=new Fg,b={id:Hg++,hash:\"\",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},c=new p,d=new R,e=new R;return{setup:function(f,g,h){var l=0,m=0,v=0,n=0,t=0,q=0,r=0,k=0;h=h.matrixWorldInverse;for(var p=0,w=f.length;p<w;p++){var x=\nf[p],A=x.color,C=x.intensity,O=x.distance,Q=x.shadow&&x.shadow.map?x.shadow.map.texture:null;if(x.isAmbientLight)l+=A.r*C,m+=A.g*C,v+=A.b*C;else if(x.isDirectionalLight){var M=a.get(x);M.color.copy(x.color).multiplyScalar(x.intensity);M.direction.setFromMatrixPosition(x.matrixWorld);c.setFromMatrixPosition(x.target.matrixWorld);M.direction.sub(c);M.direction.transformDirection(h);if(M.shadow=x.castShadow)A=x.shadow,M.shadowBias=A.bias,M.shadowRadius=A.radius,M.shadowMapSize=A.mapSize;b.directionalShadowMap[n]=\nQ;b.directionalShadowMatrix[n]=x.shadow.matrix;b.directional[n]=M;n++}else if(x.isSpotLight){M=a.get(x);M.position.setFromMatrixPosition(x.matrixWorld);M.position.applyMatrix4(h);M.color.copy(A).multiplyScalar(C);M.distance=O;M.direction.setFromMatrixPosition(x.matrixWorld);c.setFromMatrixPosition(x.target.matrixWorld);M.direction.sub(c);M.direction.transformDirection(h);M.coneCos=Math.cos(x.angle);M.penumbraCos=Math.cos(x.angle*(1-x.penumbra));M.decay=0===x.distance?0:x.decay;if(M.shadow=x.castShadow)A=\nx.shadow,M.shadowBias=A.bias,M.shadowRadius=A.radius,M.shadowMapSize=A.mapSize;b.spotShadowMap[q]=Q;b.spotShadowMatrix[q]=x.shadow.matrix;b.spot[q]=M;q++}else if(x.isRectAreaLight)M=a.get(x),M.color.copy(A).multiplyScalar(C),M.position.setFromMatrixPosition(x.matrixWorld),M.position.applyMatrix4(h),e.identity(),d.copy(x.matrixWorld),d.premultiply(h),e.extractRotation(d),M.halfWidth.set(.5*x.width,0,0),M.halfHeight.set(0,.5*x.height,0),M.halfWidth.applyMatrix4(e),M.halfHeight.applyMatrix4(e),b.rectArea[r]=\nM,r++;else if(x.isPointLight){M=a.get(x);M.position.setFromMatrixPosition(x.matrixWorld);M.position.applyMatrix4(h);M.color.copy(x.color).multiplyScalar(x.intensity);M.distance=x.distance;M.decay=0===x.distance?0:x.decay;if(M.shadow=x.castShadow)A=x.shadow,M.shadowBias=A.bias,M.shadowRadius=A.radius,M.shadowMapSize=A.mapSize,M.shadowCameraNear=A.camera.near,M.shadowCameraFar=A.camera.far;b.pointShadowMap[t]=Q;b.pointShadowMatrix[t]=x.shadow.matrix;b.point[t]=M;t++}else x.isHemisphereLight&&(M=a.get(x),\nM.direction.setFromMatrixPosition(x.matrixWorld),M.direction.transformDirection(h),M.direction.normalize(),M.skyColor.copy(x.color).multiplyScalar(C),M.groundColor.copy(x.groundColor).multiplyScalar(C),b.hemi[k]=M,k++)}b.ambient[0]=l;b.ambient[1]=m;b.ambient[2]=v;b.directional.length=n;b.spot.length=q;b.rectArea.length=r;b.point.length=t;b.hemi.length=k;b.hash=b.id+\",\"+n+\",\"+t+\",\"+q+\",\"+r+\",\"+k+\",\"+g.length},state:b}}function Ig(){var a=new Gg,b=[],c=[],d=[];return{init:function(){b.length=0;c.length=\n0;d.length=0},state:{lightsArray:b,shadowsArray:c,spritesArray:d,lights:a},setupLights:function(d){a.setup(b,c,d)},pushLight:function(a){b.push(a)},pushShadow:function(a){c.push(a)},pushSprite:function(a){d.push(a)}}}function Jg(){var a={};return{get:function(b,c){b=b.id+\",\"+c.id;c=a[b];void 0===c&&(c=new Ig,a[b]=c);return c},dispose:function(){a={}}}}function fb(a){I.call(this);this.type=\"MeshDepthMaterial\";this.depthPacking=3200;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=\nthis.map=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.setValues(a)}function gb(a){I.call(this);this.type=\"MeshDistanceMaterial\";this.referencePosition=new p;this.nearDistance=1;this.farDistance=1E3;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.lights=this.fog=!1;this.setValues(a)}function $e(a,b,c){function d(b,c,d,e,f,g){var h=\nb.geometry;var l=n;var m=b.customDepthMaterial;d&&(l=t,m=b.customDistanceMaterial);m?l=m:(m=!1,c.morphTargets&&(h&&h.isBufferGeometry?m=h.morphAttributes&&h.morphAttributes.position&&0<h.morphAttributes.position.length:h&&h.isGeometry&&(m=h.morphTargets&&0<h.morphTargets.length)),b.isSkinnedMesh&&!1===c.skinning&&console.warn(\"THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:\",b),b=b.isSkinnedMesh&&c.skinning,h=0,m&&(h|=1),b&&(h|=2),l=l[h]);a.localClippingEnabled&&!0===\nc.clipShadows&&0!==c.clippingPlanes.length&&(h=l.uuid,m=c.uuid,b=q[h],void 0===b&&(b={},q[h]=b),h=b[m],void 0===h&&(h=l.clone(),b[m]=h),l=h);l.visible=c.visible;l.wireframe=c.wireframe;l.side=null!=c.shadowSide?c.shadowSide:r[c.side];l.clipShadows=c.clipShadows;l.clippingPlanes=c.clippingPlanes;l.clipIntersection=c.clipIntersection;l.wireframeLinewidth=c.wireframeLinewidth;l.linewidth=c.linewidth;d&&l.isMeshDistanceMaterial&&(l.referencePosition.copy(e),l.nearDistance=f,l.farDistance=g);return l}\nfunction e(c,g,h,l){if(!1!==c.visible){if(c.layers.test(g.layers)&&(c.isMesh||c.isLine||c.isPoints)&&c.castShadow&&(!c.frustumCulled||f.intersectsObject(c))){c.modelViewMatrix.multiplyMatrices(h.matrixWorldInverse,c.matrixWorld);var m=b.update(c),n=c.material;if(Array.isArray(n))for(var t=m.groups,q=0,r=t.length;q<r;q++){var k=t[q],O=n[k.materialIndex];O&&O.visible&&(O=d(c,O,l,v,h.near,h.far),a.renderBufferDirect(h,null,m,O,c,k))}else n.visible&&(O=d(c,n,l,v,h.near,h.far),a.renderBufferDirect(h,null,\nm,O,c,null))}c=c.children;m=0;for(n=c.length;m<n;m++)e(c[m],g,h,l)}}var f=new td,g=new R,h=new B,l=new B(c,c),m=new p,v=new p,n=Array(4),t=Array(4),q={},r={0:1,1:0,2:2},k=[new p(1,0,0),new p(-1,0,0),new p(0,0,1),new p(0,0,-1),new p(0,1,0),new p(0,-1,0)],y=[new p(0,1,0),new p(0,1,0),new p(0,1,0),new p(0,1,0),new p(0,0,1),new p(0,0,-1)],w=[new W,new W,new W,new W,new W,new W];for(c=0;4!==c;++c){var x=0!==(c&1),A=0!==(c&2),C=new fb({depthPacking:3201,morphTargets:x,skinning:A});n[c]=C;x=new gb({morphTargets:x,\nskinning:A});t[c]=x}var O=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(b,c,d){if(!1!==O.enabled&&(!1!==O.autoUpdate||!1!==O.needsUpdate)&&0!==b.length){var n=a.state;n.disable(a.context.BLEND);n.buffers.color.setClear(1,1,1,1);n.buffers.depth.setTest(!0);n.setScissorTest(!1);for(var t,q=0,r=b.length;q<r;q++){var u=b[q];t=u.shadow;var p=u&&u.isPointLight;if(void 0===t)console.warn(\"THREE.WebGLShadowMap:\",u,\"has no shadow.\");else{var Q=t.camera;h.copy(t.mapSize);\nh.min(l);if(p){var x=h.x,C=h.y;w[0].set(2*x,C,x,C);w[1].set(0,C,x,C);w[2].set(3*x,C,x,C);w[3].set(x,C,x,C);w[4].set(3*x,0,x,C);w[5].set(x,0,x,C);h.x*=4;h.y*=2}null===t.map&&(t.map=new kb(h.x,h.y,{minFilter:1003,magFilter:1003,format:1023}),t.map.texture.name=u.name+\".shadowMap\",Q.updateProjectionMatrix());t.isSpotLightShadow&&t.update(u);x=t.map;C=t.matrix;v.setFromMatrixPosition(u.matrixWorld);Q.position.copy(v);p?(t=6,C.makeTranslation(-v.x,-v.y,-v.z)):(t=1,m.setFromMatrixPosition(u.target.matrixWorld),\nQ.lookAt(m),Q.updateMatrixWorld(),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(Q.projectionMatrix),C.multiply(Q.matrixWorldInverse));a.setRenderTarget(x);a.clear();for(u=0;u<t;u++)p&&(m.copy(Q.position),m.add(k[u]),Q.up.copy(y[u]),Q.lookAt(m),Q.updateMatrixWorld(),n.viewport(w[u])),g.multiplyMatrices(Q.projectionMatrix,Q.matrixWorldInverse),f.setFromMatrix(g),e(c,d,Q,p)}}O.needsUpdate=!1}}}function Sb(a,b,c,d,e,f,g,h,l){ea.call(this,a,b,c,d,e,f,g,h,l);this.needsUpdate=!0}function Kg(a,\nb,c,d,e){var f,g,h,l,m,v,n,t,q,r,k,y,w,x,A,C,O,Q;function M(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:b.id-a.id}var B,qb,U,z,Ec=new p,H=new ca,D=new p;this.render=function(u,p,Ob){if(0!==u.length){if(void 0===U){var sa=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),Ca=new Uint16Array([0,1,2,0,2,3]);B=b.createBuffer();qb=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,B);b.bufferData(b.ARRAY_BUFFER,sa,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,\nqb);b.bufferData(b.ELEMENT_ARRAY_BUFFER,Ca,b.STATIC_DRAW);sa=b.createProgram();Ca=b.createShader(b.VERTEX_SHADER);var G=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(Ca,[\"precision \"+e.precision+\" float;\",\"#define SHADER_NAME SpriteMaterial\\nuniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\nuniform float rotation;\\nuniform vec2 center;\\nuniform vec2 scale;\\nuniform vec2 uvOffset;\\nuniform vec2 uvScale;\\nattribute vec2 position;\\nattribute vec2 uv;\\nvarying vec2 vUV;\\nvarying float fogDepth;\\nvoid main() {\\n\\tvUV = uvOffset + uv * uvScale;\\n\\tvec2 alignedPosition = ( position - center ) * 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\\tvec4 mvPosition;\\n\\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\tmvPosition.xy += rotatedPosition;\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\tfogDepth = - mvPosition.z;\\n}\"].join(\"\\n\"));\nb.shaderSource(G,[\"precision \"+e.precision+\" float;\",\"#define SHADER_NAME SpriteMaterial\\nuniform vec3 color;\\nuniform sampler2D map;\\nuniform float opacity;\\nuniform int fogType;\\nuniform vec3 fogColor;\\nuniform float fogDensity;\\nuniform float fogNear;\\nuniform float fogFar;\\nuniform float alphaTest;\\nvarying vec2 vUV;\\nvarying float fogDepth;\\nvoid main() {\\n\\tvec4 texture = texture2D( map, vUV );\\n\\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\\n\\tif ( gl_FragColor.a < alphaTest ) discard;\\n\\tif ( fogType > 0 ) {\\n\\t\\tfloat fogFactor = 0.0;\\n\\t\\tif ( fogType == 1 ) {\\n\\t\\t\\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );\\n\\t\\t} else {\\n\\t\\t\\tconst float LOG2 = 1.442695;\\n\\t\\t\\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );\\n\\t\\t\\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\\n\\t\\t}\\n\\t\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n\\t}\\n}\"].join(\"\\n\"));\nb.compileShader(Ca);b.compileShader(G);b.attachShader(sa,Ca);b.attachShader(sa,G);b.linkProgram(sa);U=sa;O=b.getAttribLocation(U,\"position\");Q=b.getAttribLocation(U,\"uv\");f=b.getUniformLocation(U,\"uvOffset\");g=b.getUniformLocation(U,\"uvScale\");h=b.getUniformLocation(U,\"rotation\");l=b.getUniformLocation(U,\"center\");m=b.getUniformLocation(U,\"scale\");v=b.getUniformLocation(U,\"color\");n=b.getUniformLocation(U,\"map\");t=b.getUniformLocation(U,\"opacity\");q=b.getUniformLocation(U,\"modelViewMatrix\");r=b.getUniformLocation(U,\n\"projectionMatrix\");k=b.getUniformLocation(U,\"fogType\");y=b.getUniformLocation(U,\"fogDensity\");w=b.getUniformLocation(U,\"fogNear\");x=b.getUniformLocation(U,\"fogFar\");A=b.getUniformLocation(U,\"fogColor\");b.getUniformLocation(U,\"fogDepth\");C=b.getUniformLocation(U,\"alphaTest\");sa=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\");sa.width=8;sa.height=8;Ca=sa.getContext(\"2d\");Ca.fillStyle=\"white\";Ca.fillRect(0,0,8,8);z=new Sb(sa)}c.useProgram(U);c.initAttributes();c.enableAttribute(O);\nc.enableAttribute(Q);c.disableUnusedAttributes();c.disable(b.CULL_FACE);c.enable(b.BLEND);b.bindBuffer(b.ARRAY_BUFFER,B);b.vertexAttribPointer(O,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(Q,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,qb);b.uniformMatrix4fv(r,!1,Ob.projectionMatrix.elements);c.activeTexture(b.TEXTURE0);b.uniform1i(n,0);Ca=sa=0;(G=p.fog)?(b.uniform3f(A,G.color.r,G.color.g,G.color.b),G.isFog?(b.uniform1f(w,G.near),b.uniform1f(x,G.far),b.uniform1i(k,1),Ca=sa=1):G.isFogExp2&&\n(b.uniform1f(y,G.density),b.uniform1i(k,2),Ca=sa=2)):(b.uniform1i(k,0),Ca=sa=0);G=0;for(var K=u.length;G<K;G++){var E=u[G];E.modelViewMatrix.multiplyMatrices(Ob.matrixWorldInverse,E.matrixWorld);E.z=-E.modelViewMatrix.elements[14]}u.sort(M);var P=[],R=[];G=0;for(K=u.length;G<K;G++){E=u[G];var V=E.material;if(!1!==V.visible){E.onBeforeRender(a,p,Ob,void 0,V,void 0);b.uniform1f(C,V.alphaTest);b.uniformMatrix4fv(q,!1,E.modelViewMatrix.elements);E.matrixWorld.decompose(Ec,H,D);P[0]=D.x;P[1]=D.y;R[0]=\nE.center.x-.5;R[1]=E.center.y-.5;var N=0;p.fog&&V.fog&&(N=Ca);sa!==N&&(b.uniform1i(k,N),sa=N);null!==V.map?(b.uniform2f(f,V.map.offset.x,V.map.offset.y),b.uniform2f(g,V.map.repeat.x,V.map.repeat.y)):(b.uniform2f(f,0,0),b.uniform2f(g,1,1));b.uniform1f(t,V.opacity);b.uniform3f(v,V.color.r,V.color.g,V.color.b);b.uniform1f(h,V.rotation);b.uniform2fv(l,R);b.uniform2fv(m,P);c.setBlending(V.blending,V.blendEquation,V.blendSrc,V.blendDst,V.blendEquationAlpha,V.blendSrcAlpha,V.blendDstAlpha,V.premultipliedAlpha);\nc.buffers.depth.setTest(V.depthTest);c.buffers.depth.setMask(V.depthWrite);c.buffers.color.setMask(V.colorWrite);d.setTexture2D(V.map||z,0);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);E.onAfterRender(a,p,Ob,void 0,V,void 0)}}c.enable(b.CULL_FACE);c.reset()}}}function Lg(a,b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(b,a.TEXTURE_MAG_FILTER,a.NEAREST);for(b=0;b<d;b++)a.texImage2D(c+b,0,a.RGBA,\n1,1,0,a.RGBA,a.UNSIGNED_BYTE,e);return f}function e(c,d){p[c]=1;0===w[c]&&(a.enableVertexAttribArray(c),w[c]=1);x[c]!==d&&(b.get(\"ANGLE_instanced_arrays\").vertexAttribDivisorANGLE(c,d),x[c]=d)}function f(b){!0!==A[b]&&(a.enable(b),A[b]=!0)}function g(b){!1!==A[b]&&(a.disable(b),A[b]=!1)}function h(b,d,e,h,l,m,n,v){0!==b?f(a.BLEND):g(a.BLEND);if(5!==b){if(b!==Q||v!==sa)switch(b){case 2:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,a.ONE,a.ONE,a.ONE)):(a.blendEquation(a.FUNC_ADD),\na.blendFunc(a.SRC_ALPHA,a.ONE));break;case 3:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.ZERO,a.ONE_MINUS_SRC_COLOR,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR));break;case 4:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ZERO,a.SRC_COLOR,a.ZERO,a.SRC_ALPHA)):(a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR));break;default:v?(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.ONE,\na.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)):(a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA))}Ec=z=U=qb=B=M=null}else{l=l||d;m=m||e;n=n||h;if(d!==M||l!==U)a.blendEquationSeparate(c.convert(d),c.convert(l)),M=d,U=l;if(e!==B||h!==qb||m!==z||n!==Ec)a.blendFuncSeparate(c.convert(e),c.convert(h),c.convert(m),c.convert(n)),B=e,qb=h,z=m,Ec=n}Q=b;sa=v}function l(b){G!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),G=b)}\nfunction m(b){0!==b?(f(a.CULL_FACE),b!==H&&(1===b?a.cullFace(a.BACK):2===b?a.cullFace(a.FRONT):a.cullFace(a.FRONT_AND_BACK))):g(a.CULL_FACE);H=b}function v(b,c,d){if(b){if(f(a.POLYGON_OFFSET_FILL),E!==c||K!==d)a.polygonOffset(c,d),E=c,K=d}else g(a.POLYGON_OFFSET_FILL)}function n(b){void 0===b&&(b=a.TEXTURE0+P-1);I!==b&&(a.activeTexture(b),I=b)}var t=new function(){var b=!1,c=new W,d=null,e=new W(0,0,0,0);return{setMask:function(c){d===c||b||(a.colorMask(c,c,c,c),d=c)},setLocked:function(a){b=a},setClear:function(b,\nd,f,g,h){!0===h&&(b*=g,d*=g,f*=g);c.set(b,d,f,g);!1===e.equals(c)&&(a.clearColor(b,d,f,g),e.copy(c))},reset:function(){b=!1;d=null;e.set(-1,0,0,0)}}},q=new function(){var b=!1,c=null,d=null,e=null;return{setTest:function(b){b?f(a.DEPTH_TEST):g(a.DEPTH_TEST)},setMask:function(d){c===d||b||(a.depthMask(d),c=d)},setFunc:function(b){if(d!==b){if(b)switch(b){case 0:a.depthFunc(a.NEVER);break;case 1:a.depthFunc(a.ALWAYS);break;case 2:a.depthFunc(a.LESS);break;case 3:a.depthFunc(a.LEQUAL);break;case 4:a.depthFunc(a.EQUAL);\nbreak;case 5:a.depthFunc(a.GEQUAL);break;case 6:a.depthFunc(a.GREATER);break;case 7:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);d=b}},setLocked:function(a){b=a},setClear:function(b){e!==b&&(a.clearDepth(b),e=b)},reset:function(){b=!1;e=d=c=null}}},k=new function(){var b=!1,c=null,d=null,e=null,h=null,l=null,m=null,n=null,v=null;return{setTest:function(b){b?f(a.STENCIL_TEST):g(a.STENCIL_TEST)},setMask:function(d){c===d||b||(a.stencilMask(d),c=d)},setFunc:function(b,\nc,f){if(d!==b||e!==c||h!==f)a.stencilFunc(b,c,f),d=b,e=c,h=f},setOp:function(b,c,d){if(l!==b||m!==c||n!==d)a.stencilOp(b,c,d),l=b,m=c,n=d},setLocked:function(a){b=a},setClear:function(b){v!==b&&(a.clearStencil(b),v=b)},reset:function(){b=!1;v=n=m=l=h=e=d=c=null}}},u=a.getParameter(a.MAX_VERTEX_ATTRIBS),p=new Uint8Array(u),w=new Uint8Array(u),x=new Uint8Array(u),A={},C=null,O=null,Q=null,M=null,B=null,qb=null,U=null,z=null,Ec=null,sa=!1,G=null,H=null,D=null,E=null,K=null,P=a.getParameter(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS),\nR=!1;u=0;u=a.getParameter(a.VERSION);-1!==u.indexOf(\"WebGL\")?(u=parseFloat(/^WebGL ([0-9])/.exec(u)[1]),R=1<=u):-1!==u.indexOf(\"OpenGL ES\")&&(u=parseFloat(/^OpenGL ES ([0-9])/.exec(u)[1]),R=2<=u);var I=null,L={},J=new W,fa=new W,V={};V[a.TEXTURE_2D]=d(a.TEXTURE_2D,a.TEXTURE_2D,1);V[a.TEXTURE_CUBE_MAP]=d(a.TEXTURE_CUBE_MAP,a.TEXTURE_CUBE_MAP_POSITIVE_X,6);t.setClear(0,0,0,1);q.setClear(1);k.setClear(0);f(a.DEPTH_TEST);q.setFunc(3);l(!1);m(1);f(a.CULL_FACE);f(a.BLEND);h(1);return{buffers:{color:t,depth:q,\nstencil:k},initAttributes:function(){for(var a=0,b=p.length;a<b;a++)p[a]=0},enableAttribute:function(a){e(a,0)},enableAttributeAndDivisor:e,disableUnusedAttributes:function(){for(var b=0,c=w.length;b!==c;++b)w[b]!==p[b]&&(a.disableVertexAttribArray(b),w[b]=0)},enable:f,disable:g,getCompressedTextureFormats:function(){if(null===C&&(C=[],b.get(\"WEBGL_compressed_texture_pvrtc\")||b.get(\"WEBGL_compressed_texture_s3tc\")||b.get(\"WEBGL_compressed_texture_etc1\")||b.get(\"WEBGL_compressed_texture_astc\")))for(var c=\na.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)C.push(c[d]);return C},useProgram:function(b){return O!==b?(a.useProgram(b),O=b,!0):!1},setBlending:h,setMaterial:function(b,c){2===b.side?g(a.CULL_FACE):f(a.CULL_FACE);var d=1===b.side;c&&(d=!d);l(d);1===b.blending&&!1===b.transparent?h(0):h(b.blending,b.blendEquation,b.blendSrc,b.blendDst,b.blendEquationAlpha,b.blendSrcAlpha,b.blendDstAlpha,b.premultipliedAlpha);q.setFunc(b.depthFunc);q.setTest(b.depthTest);q.setMask(b.depthWrite);\nt.setMask(b.colorWrite);v(b.polygonOffset,b.polygonOffsetFactor,b.polygonOffsetUnits)},setFlipSided:l,setCullFace:m,setLineWidth:function(b){b!==D&&(R&&a.lineWidth(b),D=b)},setPolygonOffset:v,setScissorTest:function(b){b?f(a.SCISSOR_TEST):g(a.SCISSOR_TEST)},activeTexture:n,bindTexture:function(b,c){null===I&&n();var d=L[I];void 0===d&&(d={type:void 0,texture:void 0},L[I]=d);if(d.type!==b||d.texture!==c)a.bindTexture(b,c||V[b]),d.type=b,d.texture=c},compressedTexImage2D:function(){try{a.compressedTexImage2D.apply(a,\narguments)}catch(N){console.error(\"THREE.WebGLState:\",N)}},texImage2D:function(){try{a.texImage2D.apply(a,arguments)}catch(N){console.error(\"THREE.WebGLState:\",N)}},scissor:function(b){!1===J.equals(b)&&(a.scissor(b.x,b.y,b.z,b.w),J.copy(b))},viewport:function(b){!1===fa.equals(b)&&(a.viewport(b.x,b.y,b.z,b.w),fa.copy(b))},reset:function(){for(var b=0;b<w.length;b++)1===w[b]&&(a.disableVertexAttribArray(b),w[b]=0);A={};I=C=null;L={};H=G=Q=O=null;t.reset();q.reset();k.reset()}}}function Mg(a,b,c,d,\ne,f,g){function h(a,b){if(a.width>b||a.height>b){if(\"data\"in a){console.warn(\"THREE.WebGLRenderer: image in DataTexture is too big (\"+a.width+\"x\"+a.height+\").\");return}b/=Math.max(a.width,a.height);var c=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\");c.width=Math.floor(a.width*b);c.height=Math.floor(a.height*b);c.getContext(\"2d\").drawImage(a,0,0,a.width,a.height,0,0,c.width,c.height);console.warn(\"THREE.WebGLRenderer: image is too big (\"+a.width+\"x\"+a.height+\"). Resized to \"+c.width+\n\"x\"+c.height,a);return c}return a}function l(a){return J.isPowerOfTwo(a.width)&&J.isPowerOfTwo(a.height)}function m(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function v(b,c,e,f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function n(b){return 1003===b||1004===b||1005===b?a.NEAREST:a.LINEAR}function t(b){b=b.target;b.removeEventListener(\"dispose\",t);a:{var c=d.get(b);if(b.image&&c.__image__webglTextureCube)a.deleteTexture(c.__image__webglTextureCube);\nelse{if(void 0===c.__webglInit)break a;a.deleteTexture(c.__webglTexture)}d.remove(b)}b.isVideoTexture&&delete A[b.id];g.memory.textures--}function q(b){b=b.target;b.removeEventListener(\"dispose\",q);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&&a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e=0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),\nc.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d.remove(b.texture);d.remove(b)}g.memory.textures--}function k(b,n){var q=d.get(b);if(b.isVideoTexture){var k=b.id,r=g.render.frame;A[k]!==r&&(A[k]=r,b.update())}if(0<b.version&&q.__version!==b.version)if(k=b.image,void 0===k)console.warn(\"THREE.WebGLRenderer: Texture marked for update but image is undefined\",b);else if(!1===k.complete)console.warn(\"THREE.WebGLRenderer: Texture marked for update but image is incomplete\",b);else{void 0===\nq.__webglInit&&(q.__webglInit=!0,b.addEventListener(\"dispose\",t),q.__webglTexture=a.createTexture(),g.memory.textures++);c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_2D,q.__webglTexture);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY);a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha);a.pixelStorei(a.UNPACK_ALIGNMENT,b.unpackAlignment);n=h(b.image,e.maxTextureSize);(1001!==b.wrapS||1001!==b.wrapT||1003!==b.minFilter&&1006!==b.minFilter)&&!1===l(n)&&(n instanceof HTMLImageElement||\nn instanceof HTMLCanvasElement||n instanceof ImageBitmap)&&(void 0===C&&(C=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\")),C.width=J.floorPowerOfTwo(n.width),C.height=J.floorPowerOfTwo(n.height),C.getContext(\"2d\").drawImage(n,0,0,C.width,C.height),console.warn(\"THREE.WebGLRenderer: image is not power of two (\"+n.width+\"x\"+n.height+\"). Resized to \"+C.width+\"x\"+C.height,n),n=C);k=l(n);r=f.convert(b.format);var p=f.convert(b.type);u(a.TEXTURE_2D,b,k);var O=b.mipmaps;if(b.isDepthTexture){var y=\na.DEPTH_COMPONENT;if(1015===b.type){if(!x)throw Error(\"Float Depth Texture only supported in WebGL2.0\");y=a.DEPTH_COMPONENT32F}else x&&(y=a.DEPTH_COMPONENT16);1026===b.format&&y===a.DEPTH_COMPONENT&&1012!==b.type&&1014!==b.type&&(console.warn(\"THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.\"),b.type=1012,p=f.convert(b.type));1027===b.format&&(y=a.DEPTH_STENCIL,1020!==b.type&&(console.warn(\"THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.\"),\nb.type=1020,p=f.convert(b.type)));c.texImage2D(a.TEXTURE_2D,0,y,n.width,n.height,0,r,p,null)}else if(b.isDataTexture)if(0<O.length&&k){for(var Q=0,w=O.length;Q<w;Q++)y=O[Q],c.texImage2D(a.TEXTURE_2D,Q,r,y.width,y.height,0,r,p,y.data);b.generateMipmaps=!1;q.__maxMipLevel=O.length-1}else c.texImage2D(a.TEXTURE_2D,0,r,n.width,n.height,0,r,p,n.data),q.__maxMipLevel=0;else if(b.isCompressedTexture){Q=0;for(w=O.length;Q<w;Q++)y=O[Q],1023!==b.format&&1022!==b.format?-1<c.getCompressedTextureFormats().indexOf(r)?\nc.compressedTexImage2D(a.TEXTURE_2D,Q,r,y.width,y.height,0,y.data):console.warn(\"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()\"):c.texImage2D(a.TEXTURE_2D,Q,r,y.width,y.height,0,r,p,y.data);q.__maxMipLevel=O.length-1}else if(0<O.length&&k){Q=0;for(w=O.length;Q<w;Q++)y=O[Q],c.texImage2D(a.TEXTURE_2D,Q,r,r,p,y);b.generateMipmaps=!1;q.__maxMipLevel=O.length-1}else c.texImage2D(a.TEXTURE_2D,0,r,r,p,n),q.__maxMipLevel=0;m(b,k)&&v(a.TEXTURE_2D,b,n.width,\nn.height);q.__version=b.version;if(b.onUpdate)b.onUpdate(b);return}c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_2D,q.__webglTexture)}function u(c,g,h){h?(a.texParameteri(c,a.TEXTURE_WRAP_S,f.convert(g.wrapS)),a.texParameteri(c,a.TEXTURE_WRAP_T,f.convert(g.wrapT)),a.texParameteri(c,a.TEXTURE_MAG_FILTER,f.convert(g.magFilter)),a.texParameteri(c,a.TEXTURE_MIN_FILTER,f.convert(g.minFilter))):(a.texParameteri(c,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(c,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),\n1001===g.wrapS&&1001===g.wrapT||console.warn(\"THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.\",g),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n(g.magFilter)),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n(g.minFilter)),1003!==g.minFilter&&1006!==g.minFilter&&console.warn(\"THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.\",g));!(h=b.get(\"EXT_texture_filter_anisotropic\"))||\n1015===g.type&&null===b.get(\"OES_texture_float_linear\")||1016===g.type&&null===b.get(\"OES_texture_half_float_linear\")||!(1<g.anisotropy||d.get(g).__currentAnisotropy)||(a.texParameterf(c,h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,e.getMaxAnisotropy())),d.get(g).__currentAnisotropy=g.anisotropy)}function p(b,e,g,h){var l=f.convert(e.texture.format),m=f.convert(e.texture.type);c.texImage2D(h,0,l,e.width,e.height,0,l,m,null);a.bindFramebuffer(a.FRAMEBUFFER,b);a.framebufferTexture2D(a.FRAMEBUFFER,\ng,h,d.get(e.texture).__webglTexture,0);a.bindFramebuffer(a.FRAMEBUFFER,null)}function w(b,c){a.bindRenderbuffer(a.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,\nb)):a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,c.width,c.height);a.bindRenderbuffer(a.RENDERBUFFER,null)}var x=\"undefined\"!==typeof WebGL2RenderingContext&&a instanceof WebGL2RenderingContext,A={},C;this.setTexture2D=k;this.setTextureCube=function(b,n){var q=d.get(b);if(6===b.image.length)if(0<b.version&&q.__version!==b.version){q.__image__webglTextureCube||(b.addEventListener(\"dispose\",t),q.__image__webglTextureCube=a.createTexture(),g.memory.textures++);c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_CUBE_MAP,\nq.__image__webglTextureCube);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY);n=b&&b.isCompressedTexture;for(var k=b.image[0]&&b.image[0].isDataTexture,r=[],p=0;6>p;p++)r[p]=n||k?k?b.image[p].image:b.image[p]:h(b.image[p],e.maxCubemapSize);var x=r[0],y=l(x),C=f.convert(b.format),w=f.convert(b.type);u(a.TEXTURE_CUBE_MAP,b,y);for(p=0;6>p;p++)if(n)for(var O,Q=r[p].mipmaps,A=0,B=Q.length;A<B;A++)O=Q[A],1023!==b.format&&1022!==b.format?-1<c.getCompressedTextureFormats().indexOf(C)?c.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+\np,A,C,O.width,O.height,0,O.data):console.warn(\"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()\"):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,A,C,O.width,O.height,0,C,w,O.data);else k?c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,C,r[p].width,r[p].height,0,C,w,r[p].data):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,C,C,w,r[p]);q.__maxMipLevel=n?Q.length-1:0;m(b,y)&&v(a.TEXTURE_CUBE_MAP,b,x.width,x.height);q.__version=b.version;if(b.onUpdate)b.onUpdate(b)}else c.activeTexture(a.TEXTURE0+\nn),c.bindTexture(a.TEXTURE_CUBE_MAP,q.__image__webglTextureCube)};this.setTextureCubeDynamic=function(b,e){c.activeTexture(a.TEXTURE0+e);c.bindTexture(a.TEXTURE_CUBE_MAP,d.get(b).__webglTexture)};this.setupRenderTarget=function(b){var e=d.get(b),f=d.get(b.texture);b.addEventListener(\"dispose\",q);f.__webglTexture=a.createTexture();g.memory.textures++;var h=!0===b.isWebGLRenderTargetCube,n=l(b);if(h){e.__webglFramebuffer=[];for(var t=0;6>t;t++)e.__webglFramebuffer[t]=a.createFramebuffer()}else e.__webglFramebuffer=\na.createFramebuffer();if(h){c.bindTexture(a.TEXTURE_CUBE_MAP,f.__webglTexture);u(a.TEXTURE_CUBE_MAP,b.texture,n);for(t=0;6>t;t++)p(e.__webglFramebuffer[t],b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+t);m(b.texture,n)&&v(a.TEXTURE_CUBE_MAP,b.texture,b.width,b.height);c.bindTexture(a.TEXTURE_CUBE_MAP,null)}else c.bindTexture(a.TEXTURE_2D,f.__webglTexture),u(a.TEXTURE_2D,b.texture,n),p(e.__webglFramebuffer,b,a.COLOR_ATTACHMENT0,a.TEXTURE_2D),m(b.texture,n)&&v(a.TEXTURE_2D,b.texture,b.width,b.height),\nc.bindTexture(a.TEXTURE_2D,null);if(b.depthBuffer){e=d.get(b);f=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(f)throw Error(\"target.depthTexture not supported in Cube render targets\");if(b&&b.isWebGLRenderTargetCube)throw Error(\"Depth Texture with cube render targets is not supported\");a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error(\"renderTarget.depthTexture must be an instance of THREE.DepthTexture\");d.get(b.depthTexture).__webglTexture&&\nb.depthTexture.image.width===b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0);k(b.depthTexture,0);e=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,e,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,e,0);else throw Error(\"Unknown depthTexture format\");\n}else if(f)for(e.__webglDepthbuffer=[],f=0;6>f;f++)a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer[f]),e.__webglDepthbuffer[f]=a.createRenderbuffer(),w(e.__webglDepthbuffer[f],b);else a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=a.createRenderbuffer(),w(e.__webglDepthbuffer,b);a.bindFramebuffer(a.FRAMEBUFFER,null)}};this.updateRenderTargetMipmap=function(b){var e=b.texture,f=l(b);if(m(e,f)){f=b.isWebGLRenderTargetCube?a.TEXTURE_CUBE_MAP:a.TEXTURE_2D;var g=d.get(e).__webglTexture;\nc.bindTexture(f,g);v(f,e,b.width,b.height);c.bindTexture(f,null)}}}function af(a,b){return{convert:function(c){if(1E3===c)return a.REPEAT;if(1001===c)return a.CLAMP_TO_EDGE;if(1002===c)return a.MIRRORED_REPEAT;if(1003===c)return a.NEAREST;if(1004===c)return a.NEAREST_MIPMAP_NEAREST;if(1005===c)return a.NEAREST_MIPMAP_LINEAR;if(1006===c)return a.LINEAR;if(1007===c)return a.LINEAR_MIPMAP_NEAREST;if(1008===c)return a.LINEAR_MIPMAP_LINEAR;if(1009===c)return a.UNSIGNED_BYTE;if(1017===c)return a.UNSIGNED_SHORT_4_4_4_4;\nif(1018===c)return a.UNSIGNED_SHORT_5_5_5_1;if(1019===c)return a.UNSIGNED_SHORT_5_6_5;if(1010===c)return a.BYTE;if(1011===c)return a.SHORT;if(1012===c)return a.UNSIGNED_SHORT;if(1013===c)return a.INT;if(1014===c)return a.UNSIGNED_INT;if(1015===c)return a.FLOAT;if(1016===c){var d=b.get(\"OES_texture_half_float\");if(null!==d)return d.HALF_FLOAT_OES}if(1021===c)return a.ALPHA;if(1022===c)return a.RGB;if(1023===c)return a.RGBA;if(1024===c)return a.LUMINANCE;if(1025===c)return a.LUMINANCE_ALPHA;if(1026===\nc)return a.DEPTH_COMPONENT;if(1027===c)return a.DEPTH_STENCIL;if(100===c)return a.FUNC_ADD;if(101===c)return a.FUNC_SUBTRACT;if(102===c)return a.FUNC_REVERSE_SUBTRACT;if(200===c)return a.ZERO;if(201===c)return a.ONE;if(202===c)return a.SRC_COLOR;if(203===c)return a.ONE_MINUS_SRC_COLOR;if(204===c)return a.SRC_ALPHA;if(205===c)return a.ONE_MINUS_SRC_ALPHA;if(206===c)return a.DST_ALPHA;if(207===c)return a.ONE_MINUS_DST_ALPHA;if(208===c)return a.DST_COLOR;if(209===c)return a.ONE_MINUS_DST_COLOR;if(210===\nc)return a.SRC_ALPHA_SATURATE;if(33776===c||33777===c||33778===c||33779===c)if(d=b.get(\"WEBGL_compressed_texture_s3tc\"),null!==d){if(33776===c)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===c)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===c)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===c)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===c||35841===c||35842===c||35843===c)if(d=b.get(\"WEBGL_compressed_texture_pvrtc\"),null!==d){if(35840===c)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===\nc)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===c)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===c)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===c&&(d=b.get(\"WEBGL_compressed_texture_etc1\"),null!==d))return d.COMPRESSED_RGB_ETC1_WEBGL;if(37808===c||37809===c||37810===c||37811===c||37812===c||37813===c||37814===c||37815===c||37816===c||37817===c||37818===c||37819===c||37820===c||37821===c)if(d=b.get(\"WEBGL_compressed_texture_astc\"),null!==d)return c;if(103===c||104===c)if(d=b.get(\"EXT_blend_minmax\"),\nnull!==d){if(103===c)return d.MIN_EXT;if(104===c)return d.MAX_EXT}return 1020===c&&(d=b.get(\"WEBGL_depth_texture\"),null!==d)?d.UNSIGNED_INT_24_8_WEBGL:0}}}function Ub(){H.call(this);this.type=\"Group\"}function Z(a,b,c,d){Ra.call(this);this.type=\"PerspectiveCamera\";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Hc(a){Z.call(this);\nthis.cameras=a||[]}function bf(a){function b(){return null!==e&&!0===e.isPresenting}function c(){if(b()){var c=e.getEyeParameters(\"left\"),f=c.renderWidth;c=c.renderHeight;w=a.getPixelRatio();y=a.getSize();a.setDrawingBufferSize(2*f,c,1);A.start()}else d.enabled&&(a.setDrawingBufferSize(y.width,y.height,w),A.stop())}var d=this,e=null,f=null,g=null,h=[],l=new R,m=new R;\"undefined\"!==typeof window&&\"VRFrameData\"in window&&(f=new window.VRFrameData,window.addEventListener(\"vrdisplaypresentchange\",c,!1));\nvar v=new R,n=new ca,t=new p,q=new Z;q.bounds=new W(0,0,.5,1);q.layers.enable(1);var k=new Z;k.bounds=new W(.5,0,.5,1);k.layers.enable(2);var u=new Hc([q,k]);u.layers.enable(1);u.layers.enable(2);var y,w,x=!1;this.enabled=!1;this.userHeight=1.6;this.getController=function(a){var b=h[a];void 0===b&&(b=new Ub,b.matrixAutoUpdate=!1,b.visible=!1,h[a]=b);return b};this.getDevice=function(){return e};this.setDevice=function(a){void 0!==a&&(e=a);A.setContext(a)};this.setPoseTarget=function(a){void 0!==a&&\n(g=a)};this.getCamera=function(a){if(null===e)return a.position.set(0,d.userHeight,0),a;e.depthNear=a.near;e.depthFar=a.far;e.getFrameData(f);var b=e.stageParameters;b?l.fromArray(b.sittingToStandingTransform):l.makeTranslation(0,d.userHeight,0);b=f.pose;var c=null!==g?g:a;c.matrix.copy(l);c.matrix.decompose(c.position,c.quaternion,c.scale);null!==b.orientation&&(n.fromArray(b.orientation),c.quaternion.multiply(n));null!==b.position&&(n.setFromRotationMatrix(l),t.fromArray(b.position),t.applyQuaternion(n),\nc.position.add(t));c.updateMatrixWorld();if(!1===e.isPresenting)return a;q.near=a.near;k.near=a.near;q.far=a.far;k.far=a.far;u.matrixWorld.copy(a.matrixWorld);u.matrixWorldInverse.copy(a.matrixWorldInverse);q.matrixWorldInverse.fromArray(f.leftViewMatrix);k.matrixWorldInverse.fromArray(f.rightViewMatrix);m.getInverse(l);q.matrixWorldInverse.multiply(m);k.matrixWorldInverse.multiply(m);a=c.parent;null!==a&&(v.getInverse(a.matrixWorld),q.matrixWorldInverse.multiply(v),k.matrixWorldInverse.multiply(v));\nq.matrixWorld.getInverse(q.matrixWorldInverse);k.matrixWorld.getInverse(k.matrixWorldInverse);q.projectionMatrix.fromArray(f.leftProjectionMatrix);k.projectionMatrix.fromArray(f.rightProjectionMatrix);u.projectionMatrix.copy(q.projectionMatrix);a=e.getLayers();a.length&&(a=a[0],null!==a.leftBounds&&4===a.leftBounds.length&&q.bounds.fromArray(a.leftBounds),null!==a.rightBounds&&4===a.rightBounds.length&&k.bounds.fromArray(a.rightBounds));a:for(a=0;a<h.length;a++){b=h[a];b:{c=a;for(var r=navigator.getGamepads&&\nnavigator.getGamepads(),p=0,y=0,w=r.length;p<w;p++){var C=r[p];if(C&&(\"Daydream Controller\"===C.id||\"Gear VR Controller\"===C.id||\"Oculus Go Controller\"===C.id||\"OpenVR Gamepad\"===C.id||C.id.startsWith(\"Oculus Touch\")||C.id.startsWith(\"Spatial Controller\"))){if(y===c){c=C;break b}y++}}c=void 0}if(void 0!==c&&void 0!==c.pose){if(null===c.pose)break a;r=c.pose;!1===r.hasPosition&&b.position.set(.2,-.6,-.05);null!==r.position&&b.position.fromArray(r.position);null!==r.orientation&&b.quaternion.fromArray(r.orientation);\nb.matrix.compose(b.position,b.quaternion,b.scale);b.matrix.premultiply(l);b.matrix.decompose(b.position,b.quaternion,b.scale);b.matrixWorldNeedsUpdate=!0;b.visible=!0;r=\"Daydream Controller\"===c.id?0:1;x!==c.buttons[r].pressed&&((x=c.buttons[r].pressed)?b.dispatchEvent({type:\"selectstart\"}):(b.dispatchEvent({type:\"selectend\"}),b.dispatchEvent({type:\"select\"})))}else b.visible=!1}return u};this.getStandingMatrix=function(){return l};this.isPresenting=b;var A=new Vd;this.setAnimationLoop=function(a){A.setAnimationLoop(a)};\nthis.submitFrame=function(){b()&&e.submitFrame()};this.dispose=function(){\"undefined\"!==typeof window&&window.removeEventListener(\"vrdisplaypresentchange\",c)}}function Ng(a){function b(){return null!==h&&null!==l}function c(a){var b=v[n.indexOf(a.inputSource)];b&&b.dispatchEvent({type:a.type})}function d(){a.setFramebuffer(null);p.stop()}function e(a,b){null===b?a.matrixWorld.copy(a.matrix):a.matrixWorld.multiplyMatrices(b.matrixWorld,a.matrix);a.matrixWorldInverse.getInverse(a.matrixWorld)}var f=\na.context,g=null,h=null,l=null,m=null,v=[],n=[],t=new Z;t.layers.enable(1);t.viewport=new W;var q=new Z;q.layers.enable(2);q.viewport=new W;var k=new Hc([t,q]);k.layers.enable(1);k.layers.enable(2);this.enabled=!1;this.getController=function(a){var b=v[a];void 0===b&&(b=new Ub,b.matrixAutoUpdate=!1,b.visible=!1,v[a]=b);return b};this.getDevice=function(){return g};this.setDevice=function(a){void 0!==a&&(g=a);f.setCompatibleXRDevice(a)};this.setSession=function(b,e){h=b;null!==h&&(h.addEventListener(\"select\",\nc),h.addEventListener(\"selectstart\",c),h.addEventListener(\"selectend\",c),h.addEventListener(\"end\",d),h.baseLayer=new XRWebGLLayer(h,f),h.requestFrameOfReference(e.frameOfReferenceType).then(function(b){l=b;a.setFramebuffer(h.baseLayer.framebuffer);p.setContext(h);p.start()}),n=h.getInputSources(),h.addEventListener(\"inputsourceschange\",function(){n=h.getInputSources();console.log(n)}))};this.getCamera=function(a){if(b()){var c=a.parent,d=k.cameras;e(k,c);for(var f=0;f<d.length;f++)e(d[f],c);a.matrixWorld.copy(k.matrixWorld);\na=a.children;f=0;for(c=a.length;f<c;f++)a[f].updateMatrixWorld(!0);return k}return a};this.isPresenting=b;var u=null,p=new Vd;p.setAnimationLoop(function(a,b){m=b.getDevicePose(l);if(null!==m)for(var c=h.baseLayer,d=b.views,e=0;e<d.length;e++){var f=d[e],g=c.getViewport(f),t=m.getViewMatrix(f),q=k.cameras[e];q.matrix.fromArray(t).getInverse(q.matrix);q.projectionMatrix.fromArray(f.projectionMatrix);q.viewport.set(g.x,g.y,g.width,g.height);0===e&&(k.matrix.copy(q.matrix),k.projectionMatrix.copy(q.projectionMatrix))}for(e=\n0;e<v.length;e++){c=v[e];if(d=n[e])if(d=b.getInputPose(d,l),null!==d){c.matrix.elements=d.pointerMatrix;c.matrix.decompose(c.position,c.rotation,c.scale);c.visible=!0;continue}c.visible=!1}u&&u(a)});this.setAnimationLoop=function(a){u=a};this.dispose=function(){};this.getStandingMatrix=function(){console.warn(\"THREE.WebXRManager: getStandingMatrix() is no longer needed.\");return new THREE.Matrix4};this.submitFrame=function(){}}function ae(a){function b(){ma=new Pf(F);ma.get(\"WEBGL_depth_texture\");\nma.get(\"OES_texture_float\");ma.get(\"OES_texture_float_linear\");ma.get(\"OES_texture_half_float\");ma.get(\"OES_texture_half_float_linear\");ma.get(\"OES_standard_derivatives\");ma.get(\"OES_element_index_uint\");ma.get(\"ANGLE_instanced_arrays\");ia=new af(F,ma);Sa=new Nf(F,ma,a);aa=new Lg(F,ma,ia);aa.scissor(S.copy(ba).multiplyScalar(V));aa.viewport(db.copy(N).multiplyScalar(V));hb=new Sf(F);Aa=new Ag;Z=new Mg(F,ma,aa,Aa,Sa,ia,hb);ja=new Gf(F);qa=new Qf(F,ja,hb);pa=new Vf(qa,hb);va=new Uf(F);na=new zg(U,ma,\nSa);ra=new Eg;oa=new Jg;la=new Lf(U,aa,pa,O);wa=new Mf(F,ma,hb);xa=new Rf(F,ma,hb);ya=new Kg(U,F,aa,Z,Sa);hb.programs=na.programs;U.context=F;U.capabilities=Sa;U.extensions=ma;U.properties=Aa;U.renderLists=ra;U.state=aa;U.info=hb}function c(a){a.preventDefault();console.log(\"THREE.WebGLRenderer: Context Lost.\");G=!0}function d(){console.log(\"THREE.WebGLRenderer: Context Restored.\");G=!1;b()}function e(a){a=a.target;a.removeEventListener(\"dispose\",e);f(a);Aa.remove(a)}function f(a){var b=Aa.get(a).program;\na.program=void 0;void 0!==b&&na.releaseProgram(b)}function g(a,b,c){a.render(function(a){U.renderBufferImmediate(a,b,c)})}function h(a,b,c){if(!1!==a.visible){if(a.layers.test(b.layers))if(a.isLight)z.pushLight(a),a.castShadow&&z.pushShadow(a);else if(a.isSprite)a.frustumCulled&&!da.intersectsSprite(a)||z.pushSprite(a);else if(a.isImmediateRenderObject)c&&Tb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(ud),B.push(a,null,a.material,Tb.z,null);else if(a.isMesh||a.isLine||a.isPoints)if(a.isSkinnedMesh&&\na.skeleton.update(),!a.frustumCulled||da.intersectsObject(a)){c&&Tb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(ud);var d=pa.update(a),e=a.material;if(Array.isArray(e))for(var f=d.groups,g=0,l=f.length;g<l;g++){var m=f[g],n=e[m.materialIndex];n&&n.visible&&B.push(a,d,n,Tb.z,m)}else e.visible&&B.push(a,d,e,Tb.z,null)}a=a.children;g=0;for(l=a.length;g<l;g++)h(a[g],b,c)}}function l(a,b,c,d){for(var e=0,f=a.length;e<f;e++){var g=a[e],h=g.object,l=g.geometry,n=void 0===d?g.material:d;g=g.group;if(c.isArrayCamera){Pb=\nc;for(var v=c.cameras,t=0,q=v.length;t<q;t++){var k=v[t];if(h.layers.test(k.layers)){if(\"viewport\"in k)aa.viewport(db.copy(k.viewport));else{var r=k.bounds;aa.viewport(db.set(r.x*Y,r.y*fa,r.z*Y,r.w*fa).multiplyScalar(V))}m(h,b,k,l,n,g)}}}else Pb=null,m(h,b,c,l,n,g)}}function m(a,b,c,d,e,f){a.onBeforeRender(U,b,c,d,e,f);z=oa.get(b,Pb||c);a.modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,a.matrixWorld);a.normalMatrix.getNormalMatrix(a.modelViewMatrix);if(a.isImmediateRenderObject){var h=a.isMesh&&\n0>a.matrixWorld.determinant();aa.setMaterial(e,h);h=n(c,b.fog,e,a);I=\"\";g(a,h,e)}else U.renderBufferDirect(c,b.fog,d,e,a,f);a.onAfterRender(U,b,c,d,e,f);z=oa.get(b,Pb||c)}function v(a,b,c){var d=Aa.get(a),g=z.state.lights;c=na.getParameters(a,g.state,z.state.shadowsArray,b,X.numPlanes,X.numIntersection,c);var h=na.getProgramCode(a,c),l=d.program,m=!0;if(void 0===l)a.addEventListener(\"dispose\",e);else if(l.code!==h)f(a);else{if(d.lightsHash!==g.state.hash)Aa.update(a,\"lightsHash\",g.state.hash);else if(void 0!==\nc.shaderID)return;m=!1}m&&(c.shaderID?(l=tb[c.shaderID],d.shader={name:a.type,uniforms:Ba.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}):d.shader={name:a.type,uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader},a.onBeforeCompile(d.shader,U),l=na.acquireProgram(a,d.shader,c,h),d.program=l,a.program=l);c=l.getAttributes();if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h<U.maxMorphTargets;h++)0<=c[\"morphTarget\"+h]&&a.numSupportedMorphTargets++;\nif(a.morphNormals)for(h=a.numSupportedMorphNormals=0;h<U.maxMorphNormals;h++)0<=c[\"morphNormal\"+h]&&a.numSupportedMorphNormals++;c=d.shader.uniforms;if(!a.isShaderMaterial&&!a.isRawShaderMaterial||!0===a.clipping)d.numClippingPlanes=X.numPlanes,d.numIntersection=X.numIntersection,c.clippingPlanes=X.uniform;d.fog=b;d.lightsHash=g.state.hash;a.lights&&(c.ambientLightColor.value=g.state.ambient,c.directionalLights.value=g.state.directional,c.spotLights.value=g.state.spot,c.rectAreaLights.value=g.state.rectArea,\nc.pointLights.value=g.state.point,c.hemisphereLights.value=g.state.hemi,c.directionalShadowMap.value=g.state.directionalShadowMap,c.directionalShadowMatrix.value=g.state.directionalShadowMatrix,c.spotShadowMap.value=g.state.spotShadowMap,c.spotShadowMatrix.value=g.state.spotShadowMatrix,c.pointShadowMap.value=g.state.pointShadowMap,c.pointShadowMatrix.value=g.state.pointShadowMatrix);a=d.program.getUniforms();a=eb.seqWithValue(a.seq,c);d.uniformsList=a}function n(a,b,c,d){$d=0;var e=Aa.get(c),f=z.state.lights;\nca&&(ha||a!==L)&&X.setState(c.clippingPlanes,c.clipIntersection,c.clipShadows,a,e,a===L&&c.id===P);!1===c.needsUpdate&&(void 0===e.program?c.needsUpdate=!0:c.fog&&e.fog!==b?c.needsUpdate=!0:c.lights&&e.lightsHash!==f.state.hash?c.needsUpdate=!0:void 0===e.numClippingPlanes||e.numClippingPlanes===X.numPlanes&&e.numIntersection===X.numIntersection||(c.needsUpdate=!0));c.needsUpdate&&(v(c,b,d),c.needsUpdate=!1);var g=!1,h=!1,l=!1;f=e.program;var m=f.getUniforms(),n=e.shader.uniforms;aa.useProgram(f.program)&&\n(l=h=g=!0);c.id!==P&&(P=c.id,h=!0);if(g||a!==L){m.setValue(F,\"projectionMatrix\",a.projectionMatrix);Sa.logarithmicDepthBuffer&&m.setValue(F,\"logDepthBufFC\",2/(Math.log(a.far+1)/Math.LN2));L!==(Pb||a)&&(L=Pb||a,l=h=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||c.isMeshStandardMaterial||c.envMap)g=m.map.cameraPosition,void 0!==g&&g.setValue(F,Tb.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||\nc.skinning)&&m.setValue(F,\"viewMatrix\",a.matrixWorldInverse)}if(c.skinning&&(m.setOptional(F,d,\"bindMatrix\"),m.setOptional(F,d,\"bindMatrixInverse\"),a=d.skeleton))if(g=a.bones,Sa.floatVertexTextures){if(void 0===a.boneTexture){g=Math.sqrt(4*g.length);g=J.ceilPowerOfTwo(g);g=Math.max(g,4);var r=new Float32Array(g*g*4);r.set(a.boneMatrices);var u=new lb(r,g,g,1023,1015);u.needsUpdate=!0;a.boneMatrices=r;a.boneTexture=u;a.boneTextureSize=g}m.setValue(F,\"boneTexture\",a.boneTexture);m.setValue(F,\"boneTextureSize\",\na.boneTextureSize)}else m.setOptional(F,a,\"boneMatrices\");h&&(m.setValue(F,\"toneMappingExposure\",U.toneMappingExposure),m.setValue(F,\"toneMappingWhitePoint\",U.toneMappingWhitePoint),c.lights&&(h=l,n.ambientLightColor.needsUpdate=h,n.directionalLights.needsUpdate=h,n.pointLights.needsUpdate=h,n.spotLights.needsUpdate=h,n.rectAreaLights.needsUpdate=h,n.hemisphereLights.needsUpdate=h),b&&c.fog&&(n.fogColor.value=b.color,b.isFog?(n.fogNear.value=b.near,n.fogFar.value=b.far):b.isFogExp2&&(n.fogDensity.value=\nb.density)),c.isMeshBasicMaterial?t(n,c):c.isMeshLambertMaterial?(t(n,c),c.emissiveMap&&(n.emissiveMap.value=c.emissiveMap)):c.isMeshPhongMaterial?(t(n,c),c.isMeshToonMaterial?(q(n,c),c.gradientMap&&(n.gradientMap.value=c.gradientMap)):q(n,c)):c.isMeshStandardMaterial?(t(n,c),c.isMeshPhysicalMaterial?(k(n,c),n.reflectivity.value=c.reflectivity,n.clearCoat.value=c.clearCoat,n.clearCoatRoughness.value=c.clearCoatRoughness):k(n,c)):c.isMeshDepthMaterial?(t(n,c),c.displacementMap&&(n.displacementMap.value=\nc.displacementMap,n.displacementScale.value=c.displacementScale,n.displacementBias.value=c.displacementBias)):c.isMeshDistanceMaterial?(t(n,c),c.displacementMap&&(n.displacementMap.value=c.displacementMap,n.displacementScale.value=c.displacementScale,n.displacementBias.value=c.displacementBias),n.referencePosition.value.copy(c.referencePosition),n.nearDistance.value=c.nearDistance,n.farDistance.value=c.farDistance):c.isMeshNormalMaterial?(t(n,c),c.bumpMap&&(n.bumpMap.value=c.bumpMap,n.bumpScale.value=\nc.bumpScale,1===c.side&&(n.bumpScale.value*=-1)),c.normalMap&&(n.normalMap.value=c.normalMap,n.normalScale.value.copy(c.normalScale),1===c.side&&n.normalScale.value.negate()),c.displacementMap&&(n.displacementMap.value=c.displacementMap,n.displacementScale.value=c.displacementScale,n.displacementBias.value=c.displacementBias)):c.isLineBasicMaterial?(n.diffuse.value=c.color,n.opacity.value=c.opacity,c.isLineDashedMaterial&&(n.dashSize.value=c.dashSize,n.totalSize.value=c.dashSize+c.gapSize,n.scale.value=\nc.scale)):c.isPointsMaterial?(n.diffuse.value=c.color,n.opacity.value=c.opacity,n.size.value=c.size*V,n.scale.value=.5*fa,n.map.value=c.map,null!==c.map&&(!0===c.map.matrixAutoUpdate&&c.map.updateMatrix(),n.uvTransform.value.copy(c.map.matrix))):c.isShadowMaterial&&(n.color.value=c.color,n.opacity.value=c.opacity),void 0!==n.ltc_1&&(n.ltc_1.value=K.LTC_1),void 0!==n.ltc_2&&(n.ltc_2.value=K.LTC_2),eb.upload(F,e.uniformsList,n,U));c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&(eb.upload(F,e.uniformsList,\nn,U),c.uniformsNeedUpdate=!1);m.setValue(F,\"modelViewMatrix\",d.modelViewMatrix);m.setValue(F,\"normalMatrix\",d.normalMatrix);m.setValue(F,\"modelMatrix\",d.matrixWorld);return f}function t(a,b){a.opacity.value=b.opacity;b.color&&(a.diffuse.value=b.color);b.emissive&&a.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity);b.map&&(a.map.value=b.map);b.alphaMap&&(a.alphaMap.value=b.alphaMap);b.specularMap&&(a.specularMap.value=b.specularMap);b.envMap&&(a.envMap.value=b.envMap,a.flipEnvMap.value=\nb.envMap&&b.envMap.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=Aa.get(b.envMap).__maxMipLevel);b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);if(b.map)var c=b.map;else b.specularMap?c=b.specularMap:b.displacementMap?c=b.displacementMap:b.normalMap?c=b.normalMap:b.bumpMap?c=b.bumpMap:b.roughnessMap?c=b.roughnessMap:\nb.metalnessMap?c=b.metalnessMap:b.alphaMap?c=b.alphaMap:b.emissiveMap&&(c=b.emissiveMap);void 0!==c&&(c.isWebGLRenderTarget&&(c=c.texture),!0===c.matrixAutoUpdate&&c.updateMatrix(),a.uvTransform.value.copy(c.matrix))}function q(a,b){a.specular.value=b.specular;a.shininess.value=Math.max(b.shininess,1E-4);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,\na.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias)}function k(a,b){a.roughness.value=b.roughness;a.metalness.value=b.metalness;b.roughnessMap&&(a.roughnessMap.value=b.roughnessMap);b.metalnessMap&&(a.metalnessMap.value=b.metalnessMap);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,\na.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}console.log(\"THREE.WebGLRenderer\",\"94\");a=a||{};var u=void 0!==a.canvas?a.canvas:document.createElementNS(\"http://www.w3.org/1999/xhtml\",\n\"canvas\"),y=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,x=void 0!==a.depth?a.depth:!0,A=void 0!==a.stencil?a.stencil:!0,C=void 0!==a.antialias?a.antialias:!1,O=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Q=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,M=void 0!==a.powerPreference?a.powerPreference:\"default\",B=null,z=null;this.domElement=u;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=\n[];this.localClippingEnabled=!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var U=this,G=!1,H=null,D=null,E=null,P=-1,I=\"\",L=null,Pb=null,db=new W,S=new W,T=null,$d=0,Y=u.width,fa=u.height,V=1,N=new W(0,0,Y,fa),ba=new W(0,0,Y,fa),ea=!1,da=new td,X=new Of,ca=!1,ha=!1,ud=new R,Tb=new p;try{w={alpha:w,depth:x,stencil:A,antialias:C,premultipliedAlpha:O,\npreserveDrawingBuffer:Q,powerPreference:M};u.addEventListener(\"webglcontextlost\",c,!1);u.addEventListener(\"webglcontextrestored\",d,!1);var F=y||u.getContext(\"webgl\",w)||u.getContext(\"experimental-webgl\",w);if(null===F){if(null!==u.getContext(\"webgl\"))throw Error(\"Error creating WebGL context with your selected attributes.\");throw Error(\"Error creating WebGL context.\");}void 0===F.getShaderPrecisionFormat&&(F.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Og){console.error(\"THREE.WebGLRenderer: \"+\nOg.message)}var ma,Sa,aa,hb,Aa,Z,ja,qa,pa,na,ra,oa,la,va,wa,xa,ya,ia;b();var ka=\"xr\"in navigator?new Ng(U):new bf(U);this.vr=ka;var za=new $e(U,pa,Sa.maxTextureSize);this.shadowMap=za;this.getContext=function(){return F};this.getContextAttributes=function(){return F.getContextAttributes()};this.forceContextLoss=function(){var a=ma.get(\"WEBGL_lose_context\");a&&a.loseContext()};this.forceContextRestore=function(){var a=ma.get(\"WEBGL_lose_context\");a&&a.restoreContext()};this.getPixelRatio=function(){return V};\nthis.setPixelRatio=function(a){void 0!==a&&(V=a,this.setSize(Y,fa,!1))};this.getSize=function(){return{width:Y,height:fa}};this.setSize=function(a,b,c){ka.isPresenting()?console.warn(\"THREE.WebGLRenderer: Can't change size while VR device is presenting.\"):(Y=a,fa=b,u.width=a*V,u.height=b*V,!1!==c&&(u.style.width=a+\"px\",u.style.height=b+\"px\"),this.setViewport(0,0,a,b))};this.getDrawingBufferSize=function(){return{width:Y*V,height:fa*V}};this.setDrawingBufferSize=function(a,b,c){Y=a;fa=b;V=c;u.width=\na*c;u.height=b*c;this.setViewport(0,0,a,b)};this.getCurrentViewport=function(){return db};this.setViewport=function(a,b,c,d){N.set(a,fa-b-d,c,d);aa.viewport(db.copy(N).multiplyScalar(V))};this.setScissor=function(a,b,c,d){ba.set(a,fa-b-d,c,d);aa.scissor(S.copy(ba).multiplyScalar(V))};this.setScissorTest=function(a){aa.setScissorTest(ea=a)};this.getClearColor=function(){return la.getClearColor()};this.setClearColor=function(){la.setClearColor.apply(la,arguments)};this.getClearAlpha=function(){return la.getClearAlpha()};\nthis.setClearAlpha=function(){la.setClearAlpha.apply(la,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=F.COLOR_BUFFER_BIT;if(void 0===b||b)d|=F.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=F.STENCIL_BUFFER_BIT;F.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.dispose=function(){u.removeEventListener(\"webglcontextlost\",\nc,!1);u.removeEventListener(\"webglcontextrestored\",d,!1);ra.dispose();oa.dispose();Aa.dispose();pa.dispose();ka.dispose();ta.stop()};this.renderBufferImmediate=function(a,b,c){aa.initAttributes();var d=Aa.get(a);a.hasPositions&&!d.position&&(d.position=F.createBuffer());a.hasNormals&&!d.normal&&(d.normal=F.createBuffer());a.hasUvs&&!d.uv&&(d.uv=F.createBuffer());a.hasColors&&!d.color&&(d.color=F.createBuffer());b=b.getAttributes();a.hasPositions&&(F.bindBuffer(F.ARRAY_BUFFER,d.position),F.bufferData(F.ARRAY_BUFFER,\na.positionArray,F.DYNAMIC_DRAW),aa.enableAttribute(b.position),F.vertexAttribPointer(b.position,3,F.FLOAT,!1,0,0));if(a.hasNormals){F.bindBuffer(F.ARRAY_BUFFER,d.normal);if(!c.isMeshPhongMaterial&&!c.isMeshStandardMaterial&&!c.isMeshNormalMaterial&&!0===c.flatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,l=(g[e+1]+g[e+4]+g[e+7])/3,m=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=l;g[e+2]=m;g[e+3]=h;g[e+4]=l;g[e+5]=m;g[e+6]=h;g[e+7]=l;g[e+8]=m}F.bufferData(F.ARRAY_BUFFER,\na.normalArray,F.DYNAMIC_DRAW);aa.enableAttribute(b.normal);F.vertexAttribPointer(b.normal,3,F.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(F.bindBuffer(F.ARRAY_BUFFER,d.uv),F.bufferData(F.ARRAY_BUFFER,a.uvArray,F.DYNAMIC_DRAW),aa.enableAttribute(b.uv),F.vertexAttribPointer(b.uv,2,F.FLOAT,!1,0,0));a.hasColors&&0!==c.vertexColors&&(F.bindBuffer(F.ARRAY_BUFFER,d.color),F.bufferData(F.ARRAY_BUFFER,a.colorArray,F.DYNAMIC_DRAW),aa.enableAttribute(b.color),F.vertexAttribPointer(b.color,3,F.FLOAT,!1,0,0));aa.disableUnusedAttributes();\nF.drawArrays(F.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){var g=e.isMesh&&0>e.matrixWorld.determinant();aa.setMaterial(d,g);var h=n(a,b,d,e);a=c.id+\"_\"+h.id+\"_\"+(!0===d.wireframe);var l=!1;a!==I&&(I=a,l=!0);e.morphTargetInfluences&&(va.update(e,c,d,h),l=!0);g=c.index;var m=c.attributes.position;b=1;!0===d.wireframe&&(g=qa.getWireframeAttribute(c),b=2);a=wa;if(null!==g){var v=ja.get(g);a=xa;a.setIndex(v)}if(l){if(c&&c.isInstancedBufferGeometry&&null===ma.get(\"ANGLE_instanced_arrays\"))console.error(\"THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.\");\nelse{aa.initAttributes();l=c.attributes;h=h.getAttributes();var t=d.defaultAttributeValues;for(A in h){var q=h[A];if(0<=q){var k=l[A];if(void 0!==k){var r=k.normalized,u=k.itemSize,p=ja.get(k);if(void 0!==p){var y=p.buffer,x=p.type;p=p.bytesPerElement;if(k.isInterleavedBufferAttribute){var w=k.data,C=w.stride;k=k.offset;w&&w.isInstancedInterleavedBuffer?(aa.enableAttributeAndDivisor(q,w.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=w.meshPerAttribute*w.count)):aa.enableAttribute(q);\nF.bindBuffer(F.ARRAY_BUFFER,y);F.vertexAttribPointer(q,u,x,r,C*p,k*p)}else k.isInstancedBufferAttribute?(aa.enableAttributeAndDivisor(q,k.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=k.meshPerAttribute*k.count)):aa.enableAttribute(q),F.bindBuffer(F.ARRAY_BUFFER,y),F.vertexAttribPointer(q,u,x,r,0,0)}}else if(void 0!==t&&(r=t[A],void 0!==r))switch(r.length){case 2:F.vertexAttrib2fv(q,r);break;case 3:F.vertexAttrib3fv(q,r);break;case 4:F.vertexAttrib4fv(q,r);break;default:F.vertexAttrib1fv(q,\nr)}}}aa.disableUnusedAttributes()}null!==g&&F.bindBuffer(F.ELEMENT_ARRAY_BUFFER,v.buffer)}v=Infinity;null!==g?v=g.count:void 0!==m&&(v=m.count);g=c.drawRange.start*b;m=null!==f?f.start*b:0;var A=Math.max(g,m);f=Math.max(0,Math.min(v,g+c.drawRange.count*b,m+(null!==f?f.count*b:Infinity))-1-A+1);if(0!==f){if(e.isMesh)if(!0===d.wireframe)aa.setLineWidth(d.wireframeLinewidth*(null===D?V:1)),a.setMode(F.LINES);else switch(e.drawMode){case 0:a.setMode(F.TRIANGLES);break;case 1:a.setMode(F.TRIANGLE_STRIP);\nbreak;case 2:a.setMode(F.TRIANGLE_FAN)}else e.isLine?(d=d.linewidth,void 0===d&&(d=1),aa.setLineWidth(d*(null===D?V:1)),e.isLineSegments?a.setMode(F.LINES):e.isLineLoop?a.setMode(F.LINE_LOOP):a.setMode(F.LINE_STRIP)):e.isPoints&&a.setMode(F.POINTS);c&&c.isInstancedBufferGeometry?0<c.maxInstancedCount&&a.renderInstances(c,A,f):a.render(A,f)}};this.compile=function(a,b){z=oa.get(a,b);z.init();a.traverse(function(a){a.isLight&&(z.pushLight(a),a.castShadow&&z.pushShadow(a))});z.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=\n0;c<b.material.length;c++)v(b.material[c],a.fog,b);else v(b.material,a.fog,b)})};var ua=null,ta=new Vd;ta.setAnimationLoop(function(a){ka.isPresenting()||ua&&ua(a)});\"undefined\"!==typeof window&&ta.setContext(window);this.setAnimationLoop=function(a){ua=a;ka.setAnimationLoop(a);ta.start()};this.render=function(a,b,c,d){if(!b||!b.isCamera)console.error(\"THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.\");else if(!G){I=\"\";P=-1;L=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===\nb.parent&&b.updateMatrixWorld();ka.enabled&&(b=ka.getCamera(b));z=oa.get(a,b);z.init();a.onBeforeRender(U,a,b,c);ud.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);da.setFromMatrix(ud);ha=this.localClippingEnabled;ca=X.init(this.clippingPlanes,ha,b);B=ra.get(a,b);B.init();h(a,b,U.sortObjects);!0===U.sortObjects&&B.sort();ca&&X.beginShadows();za.render(z.state.shadowsArray,a,b);z.setupLights(b);ca&&X.endShadows();this.info.autoReset&&this.info.reset();void 0===c&&(c=null);this.setRenderTarget(c);\nla.render(B,a,b,d);d=B.opaque;var e=B.transparent;if(a.overrideMaterial){var f=a.overrideMaterial;d.length&&l(d,a,b,f);e.length&&l(e,a,b,f)}else d.length&&l(d,a,b),e.length&&l(e,a,b);ya.render(z.state.spritesArray,a,b);c&&Z.updateRenderTargetMipmap(c);aa.buffers.depth.setTest(!0);aa.buffers.depth.setMask(!0);aa.buffers.color.setMask(!0);aa.setPolygonOffset(!1);a.onAfterRender(U,a,b);ka.enabled&&ka.submitFrame();z=B=null}};this.allocTextureUnit=function(){var a=$d;a>=Sa.maxTextures&&console.warn(\"THREE.WebGLRenderer: Trying to use \"+\na+\" texture units while this GPU supports only \"+Sa.maxTextures);$d+=1;return a};this.setTexture2D=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTarget&&(a||(console.warn(\"THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead.\"),a=!0),b=b.texture);Z.setTexture2D(b,c)}}();this.setTexture=function(){var a=!1;return function(b,c){a||(console.warn(\"THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead.\"),a=!0);Z.setTexture2D(b,\nc)}}();this.setTextureCube=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTargetCube&&(a||(console.warn(\"THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead.\"),a=!0),b=b.texture);b&&b.isCubeTexture||Array.isArray(b.image)&&6===b.image.length?Z.setTextureCube(b,c):Z.setTextureCubeDynamic(b,c)}}();this.setFramebuffer=function(a){H=a};this.getRenderTarget=function(){return D};this.setRenderTarget=function(a){(D=a)&&void 0===Aa.get(a).__webglFramebuffer&&\nZ.setupRenderTarget(a);var b=H,c=!1;a?(b=Aa.get(a).__webglFramebuffer,a.isWebGLRenderTargetCube&&(b=b[a.activeCubeFace],c=!0),db.copy(a.viewport),S.copy(a.scissor),T=a.scissorTest):(db.copy(N).multiplyScalar(V),S.copy(ba).multiplyScalar(V),T=ea);E!==b&&(F.bindFramebuffer(F.FRAMEBUFFER,b),E=b);aa.viewport(db);aa.scissor(S);aa.setScissorTest(T);c&&(c=Aa.get(a.texture),F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,c.__webglTexture,a.activeMipMapLevel))};\nthis.readRenderTargetPixels=function(a,b,c,d,e,f){if(a&&a.isWebGLRenderTarget){var g=Aa.get(a).__webglFramebuffer;if(g){var h=!1;g!==E&&(F.bindFramebuffer(F.FRAMEBUFFER,g),h=!0);try{var l=a.texture,m=l.format,n=l.type;1023!==m&&ia.convert(m)!==F.getParameter(F.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.\"):1009===n||ia.convert(n)===F.getParameter(F.IMPLEMENTATION_COLOR_READ_TYPE)||1015===\nn&&(ma.get(\"OES_texture_float\")||ma.get(\"WEBGL_color_buffer_float\"))||1016===n&&ma.get(\"EXT_color_buffer_half_float\")?F.checkFramebufferStatus(F.FRAMEBUFFER)===F.FRAMEBUFFER_COMPLETE?0<=b&&b<=a.width-d&&0<=c&&c<=a.height-e&&F.readPixels(b,c,d,e,ia.convert(m),ia.convert(n),f):console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.\"):console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.\")}finally{h&&\nF.bindFramebuffer(F.FRAMEBUFFER,E)}}}else console.error(\"THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.\")};this.copyFramebufferToTexture=function(a,b,c){var d=b.image.width,e=b.image.height,f=ia.convert(b.format);this.setTexture2D(b,0);F.copyTexImage2D(F.TEXTURE_2D,c||0,f,a.x,a.y,d,e,0)};this.copyTextureToTexture=function(a,b,c,d){var e=b.image.width,f=b.image.height,g=ia.convert(c.format),h=ia.convert(c.type);this.setTexture2D(c,0);b.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,\nd||0,a.x,a.y,e,f,g,h,b.image.data):F.texSubImage2D(F.TEXTURE_2D,d||0,a.x,a.y,g,h,b.image)}}function Vb(a,b){this.name=\"\";this.color=new G(a);this.density=void 0!==b?b:2.5E-4}function Wb(a,b,c){this.name=\"\";this.color=new G(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3}function vd(){H.call(this);this.type=\"Scene\";this.overrideMaterial=this.fog=this.background=null;this.autoUpdate=!0}function ib(a){I.call(this);this.type=\"SpriteMaterial\";this.color=new G(16777215);this.map=null;this.rotation=\n0;this.lights=this.fog=!1;this.setValues(a)}function Ic(a){H.call(this);this.type=\"Sprite\";this.material=void 0!==a?a:new ib;this.center=new B(.5,.5)}function Jc(){H.call(this);this.type=\"LOD\";Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Kc(a,b){a=a||[];this.bones=a.slice(0);this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn(\"THREE.Skeleton boneInverses is the wrong length.\"),\nthis.boneInverses=[],a=0,b=this.bones.length;a<b;a++)this.boneInverses.push(new R)}function wd(){H.call(this);this.type=\"Bone\"}function xd(a,b){va.call(this,a,b);this.type=\"SkinnedMesh\";this.bindMode=\"attached\";this.bindMatrix=new R;this.bindMatrixInverse=new R;a=this.initBones();a=new Kc(a);this.bind(a,this.matrixWorld);this.normalizeSkinWeights()}function T(a){I.call(this);this.type=\"LineBasicMaterial\";this.color=new G(16777215);this.linewidth=1;this.linejoin=this.linecap=\"round\";this.lights=!1;\nthis.setValues(a)}function wa(a,b,c){if(1===c)return console.warn(\"THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.\"),new Y(a,b);H.call(this);this.type=\"Line\";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new T({color:16777215*Math.random()})}function Y(a,b){wa.call(this,a,b);this.type=\"LineSegments\"}function yd(a,b){wa.call(this,a,b);this.type=\"LineLoop\"}function Ja(a){I.call(this);this.type=\"PointsMaterial\";this.color=new G(16777215);\nthis.map=null;this.size=1;this.sizeAttenuation=!0;this.lights=this.morphTargets=!1;this.setValues(a)}function Xb(a,b){H.call(this);this.type=\"Points\";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new Ja({color:16777215*Math.random()})}function be(a,b,c,d,e,f,g,h,l){ea.call(this,a,b,c,d,e,f,g,h,l);this.generateMipmaps=!1}function Yb(a,b,c,d,e,f,g,h,l,m,v,n){ea.call(this,null,f,g,h,l,m,d,e,v,n);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Lc(a,\nb,c,d,e,f,g,h,l,m){m=void 0!==m?m:1026;if(1026!==m&&1027!==m)throw Error(\"DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat\");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);ea.call(this,null,d,e,f,g,h,m,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==h?h:1003;this.generateMipmaps=this.flipY=!1}function Zb(a){D.call(this);this.type=\"WireframeGeometry\";var b=[],c,d,e,f=[0,0],g={},h=[\"a\",\"b\",\"c\"];if(a&&a.isGeometry){var l=\na.faces;var m=0;for(d=l.length;m<d;m++){var v=l[m];for(c=0;3>c;c++){var n=v[h[c]];var t=v[h[(c+1)%3]];f[0]=Math.min(n,t);f[1]=Math.max(n,t);n=f[0]+\",\"+f[1];void 0===g[n]&&(g[n]={index1:f[0],index2:f[1]})}}for(n in g)m=g[n],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isBufferGeometry)if(h=new p,null!==a.index){l=a.attributes.position;v=a.index;var q=a.groups;0===q.length&&(q=[{start:0,count:v.count,materialIndex:0}]);a=0;for(e=q.length;a<e;++a)for(m=\nq[a],c=m.start,d=m.count,m=c,d=c+d;m<d;m+=3)for(c=0;3>c;c++)n=v.getX(m+c),t=v.getX(m+(c+1)%3),f[0]=Math.min(n,t),f[1]=Math.max(n,t),n=f[0]+\",\"+f[1],void 0===g[n]&&(g[n]={index1:f[0],index2:f[1]});for(n in g)m=g[n],h.fromBufferAttribute(l,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(l,m.index2),b.push(h.x,h.y,h.z)}else for(l=a.attributes.position,m=0,d=l.count/3;m<d;m++)for(c=0;3>c;c++)g=3*m+c,h.fromBufferAttribute(l,g),b.push(h.x,h.y,h.z),g=3*m+(c+1)%3,h.fromBufferAttribute(l,g),b.push(h.x,\nh.y,h.z);this.addAttribute(\"position\",new z(b,3))}function Mc(a,b,c){P.call(this);this.type=\"ParametricGeometry\";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new $b(a,b,c));this.mergeVertices()}function $b(a,b,c){D.call(this);this.type=\"ParametricBufferGeometry\";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new p,l=new p,m=new p,v=new p,n=new p,t,q;3>a.length&&console.error(\"THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.\");\nvar k=b+1;for(t=0;t<=c;t++){var u=t/c;for(q=0;q<=b;q++){var y=q/b;a(y,u,l);e.push(l.x,l.y,l.z);0<=y-1E-5?(a(y-1E-5,u,m),v.subVectors(l,m)):(a(y+1E-5,u,m),v.subVectors(m,l));0<=u-1E-5?(a(y,u-1E-5,m),n.subVectors(l,m)):(a(y,u+1E-5,m),n.subVectors(m,l));h.crossVectors(v,n).normalize();f.push(h.x,h.y,h.z);g.push(y,u)}}for(t=0;t<c;t++)for(q=0;q<b;q++)a=t*k+q+1,h=(t+1)*k+q+1,l=(t+1)*k+q,d.push(t*k+q,a,l),d.push(a,h,l);this.setIndex(d);this.addAttribute(\"position\",new z(e,3));this.addAttribute(\"normal\",\nnew z(f,3));this.addAttribute(\"uv\",new z(g,2))}function Nc(a,b,c,d){P.call(this);this.type=\"PolyhedronGeometry\";this.parameters={vertices:a,indices:b,radius:c,detail:d};this.fromBufferGeometry(new xa(a,b,c,d));this.mergeVertices()}function xa(a,b,c,d){function e(a){h.push(a.x,a.y,a.z)}function f(b,c){b*=3;c.x=a[b+0];c.y=a[b+1];c.z=a[b+2]}function g(a,b,c,d){0>d&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}D.call(this);this.type=\"PolyhedronBufferGeometry\";this.parameters={vertices:a,\nindices:b,radius:c,detail:d};c=c||1;d=d||0;var h=[],l=[];(function(a){for(var c=new p,d=new p,g=new p,h=0;h<b.length;h+=3){f(b[h+0],c);f(b[h+1],d);f(b[h+2],g);var l,m,k=c,w=d,x=g,A=Math.pow(2,a),C=[];for(m=0;m<=A;m++){C[m]=[];var O=k.clone().lerp(x,m/A),Q=w.clone().lerp(x,m/A),M=A-m;for(l=0;l<=M;l++)C[m][l]=0===l&&m===A?O:O.clone().lerp(Q,l/M)}for(m=0;m<A;m++)for(l=0;l<2*(A-m)-1;l++)k=Math.floor(l/2),0===l%2?(e(C[m][k+1]),e(C[m+1][k]),e(C[m][k])):(e(C[m][k+1]),e(C[m+1][k+1]),e(C[m+1][k]))}})(d);(function(a){for(var b=\nnew p,c=0;c<h.length;c+=3)b.x=h[c+0],b.y=h[c+1],b.z=h[c+2],b.normalize().multiplyScalar(a),h[c+0]=b.x,h[c+1]=b.y,h[c+2]=b.z})(c);(function(){for(var a=new p,b=0;b<h.length;b+=3)a.x=h[b+0],a.y=h[b+1],a.z=h[b+2],l.push(Math.atan2(a.z,-a.x)/2/Math.PI+.5,1-(Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5));a=new p;b=new p;for(var c=new p,d=new p,e=new B,f=new B,k=new B,y=0,w=0;y<h.length;y+=9,w+=6){a.set(h[y+0],h[y+1],h[y+2]);b.set(h[y+3],h[y+4],h[y+5]);c.set(h[y+6],h[y+7],h[y+8]);e.set(l[w+0],\nl[w+1]);f.set(l[w+2],l[w+3]);k.set(l[w+4],l[w+5]);d.copy(a).add(b).add(c).divideScalar(3);var x=Math.atan2(d.z,-d.x);g(e,w+0,a,x);g(f,w+2,b,x);g(k,w+4,c,x)}for(a=0;a<l.length;a+=6)b=l[a+0],c=l[a+2],d=l[a+4],e=Math.min(b,c,d),.9<Math.max(b,c,d)&&.1>e&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.addAttribute(\"position\",new z(h,3));this.addAttribute(\"normal\",new z(h.slice(),3));this.addAttribute(\"uv\",new z(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Oc(a,\nb){P.call(this);this.type=\"TetrahedronGeometry\";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ac(a,b));this.mergeVertices()}function ac(a,b){xa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type=\"TetrahedronBufferGeometry\";this.parameters={radius:a,detail:b}}function Pc(a,b){P.call(this);this.type=\"OctahedronGeometry\";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ub(a,b));this.mergeVertices()}function ub(a,b){xa.call(this,[1,0,0,\n-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type=\"OctahedronBufferGeometry\";this.parameters={radius:a,detail:b}}function Qc(a,b){P.call(this);this.type=\"IcosahedronGeometry\";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new bc(a,b));this.mergeVertices()}function bc(a,b){var c=(1+Math.sqrt(5))/2;xa.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,\n11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type=\"IcosahedronBufferGeometry\";this.parameters={radius:a,detail:b}}function Rc(a,b){P.call(this);this.type=\"DodecahedronGeometry\";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new cc(a,b));this.mergeVertices()}function cc(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;xa.call(this,[-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,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,\n0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[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],a,b);this.type=\"DodecahedronBufferGeometry\";this.parameters={radius:a,detail:b}}function Sc(a,b,c,d,e,f){P.call(this);this.type=\"TubeGeometry\";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,\nclosed:e};void 0!==f&&console.warn(\"THREE.TubeGeometry: taper has been removed.\");a=new dc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function dc(a,b,c,d,e){function f(e){v=a.getPointAt(e/b,v);var f=g.normals[e];e=g.binormals[e];for(k=0;k<=d;k++){var m=k/d*Math.PI*2,n=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+n*e.x;l.y=m*f.y+n*e.y;l.z=m*f.z+n*e.z;l.normalize();r.push(l.x,l.y,l.z);h.x=v.x+c*l.x;h.y=v.y+c*l.y;h.z=\nv.z+c*l.z;q.push(h.x,h.y,h.z)}}D.call(this);this.type=\"TubeBufferGeometry\";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new p,l=new p,m=new B,v=new p,n,k,q=[],r=[],u=[],y=[];for(n=0;n<b;n++)f(n);f(!1===e?b:0);for(n=0;n<=b;n++)for(k=0;k<=d;k++)m.x=n/b,m.y=k/d,u.push(m.x,m.y);(function(){for(k=1;k<=b;k++)for(n=1;n<=d;n++){var a=\n(d+1)*k+(n-1),c=(d+1)*k+n,e=(d+1)*(k-1)+n;y.push((d+1)*(k-1)+(n-1),a,e);y.push(a,c,e)}})();this.setIndex(y);this.addAttribute(\"position\",new z(q,3));this.addAttribute(\"normal\",new z(r,3));this.addAttribute(\"uv\",new z(u,2))}function Tc(a,b,c,d,e,f,g){P.call(this);this.type=\"TorusKnotGeometry\";this.parameters={radius:a,tube:b,tubularSegments:c,radialSegments:d,p:e,q:f};void 0!==g&&console.warn(\"THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.\");this.fromBufferGeometry(new ec(a,\nb,c,d,e,f));this.mergeVertices()}function ec(a,b,c,d,e,f){function g(a,b,c,d,e){var f=Math.sin(a);b=c/b*a;c=Math.cos(b);e.x=d*(2+c)*.5*Math.cos(a);e.y=d*(2+c)*f*.5;e.z=d*Math.sin(b)*.5}D.call(this);this.type=\"TorusKnotBufferGeometry\";this.parameters={radius:a,tube:b,tubularSegments:c,radialSegments:d,p:e,q:f};a=a||1;b=b||.4;c=Math.floor(c)||64;d=Math.floor(d)||8;e=e||2;f=f||3;var h=[],l=[],m=[],v=[],n,k=new p,q=new p,r=new p,u=new p,y=new p,w=new p,x=new p;for(n=0;n<=c;++n){var A=n/c*e*Math.PI*2;\ng(A,e,f,a,r);g(A+.01,e,f,a,u);w.subVectors(u,r);x.addVectors(u,r);y.crossVectors(w,x);x.crossVectors(y,w);y.normalize();x.normalize();for(A=0;A<=d;++A){var C=A/d*Math.PI*2,O=-b*Math.cos(C);C=b*Math.sin(C);k.x=r.x+(O*x.x+C*y.x);k.y=r.y+(O*x.y+C*y.y);k.z=r.z+(O*x.z+C*y.z);l.push(k.x,k.y,k.z);q.subVectors(k,r).normalize();m.push(q.x,q.y,q.z);v.push(n/c);v.push(A/d)}}for(A=1;A<=c;A++)for(n=1;n<=d;n++)a=(d+1)*A+(n-1),b=(d+1)*A+n,e=(d+1)*(A-1)+n,h.push((d+1)*(A-1)+(n-1),a,e),h.push(a,b,e);this.setIndex(h);\nthis.addAttribute(\"position\",new z(l,3));this.addAttribute(\"normal\",new z(m,3));this.addAttribute(\"uv\",new z(v,2))}function Uc(a,b,c,d,e){P.call(this);this.type=\"TorusGeometry\";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};this.fromBufferGeometry(new fc(a,b,c,d,e));this.mergeVertices()}function fc(a,b,c,d,e){D.call(this);this.type=\"TorusBufferGeometry\";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||1;b=b||.4;c=Math.floor(c)||8;d=Math.floor(d)||\n6;e=e||2*Math.PI;var f=[],g=[],h=[],l=[],m=new p,v=new p,n=new p,k,q;for(k=0;k<=c;k++)for(q=0;q<=d;q++){var r=q/d*e,u=k/c*Math.PI*2;v.x=(a+b*Math.cos(u))*Math.cos(r);v.y=(a+b*Math.cos(u))*Math.sin(r);v.z=b*Math.sin(u);g.push(v.x,v.y,v.z);m.x=a*Math.cos(r);m.y=a*Math.sin(r);n.subVectors(v,m).normalize();h.push(n.x,n.y,n.z);l.push(q/d);l.push(k/c)}for(k=1;k<=c;k++)for(q=1;q<=d;q++)a=(d+1)*(k-1)+q-1,b=(d+1)*(k-1)+q,e=(d+1)*k+q,f.push((d+1)*k+q-1,a,e),f.push(a,b,e);this.setIndex(f);this.addAttribute(\"position\",\nnew z(g,3));this.addAttribute(\"normal\",new z(h,3));this.addAttribute(\"uv\",new z(l,2))}function cf(a,b,c,d,e){for(var f,g=0,h=b,l=c-d;h<c;h+=d)g+=(a[l]-a[h])*(a[h+1]+a[l+1]),l=h;if(e===0<g)for(e=b;e<c;e+=d)f=df(e,a[e],a[e+1],f);else for(e=c-d;e>=b;e-=d)f=df(e,a[e],a[e+1],f);f&&vb(f,f.next)&&(Vc(f),f=f.next);return f}function Wc(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!vb(a,a.next)&&0!==oa(a.prev,a,a.next))a=a.next;else{Vc(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}\nfunction Xc(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=ce(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==h);l.prevZ.nextZ=null;l.prevZ=null;h=l;var m,v,n,k,q=1;do{l=h;var r=h=null;for(v=0;l;){v++;var p=l;for(m=n=0;m<q&&(n++,p=p.nextZ,p);m++);for(k=q;0<n||0<k&&p;)0!==n&&(0===k||!p||l.z<=p.z)?(m=l,l=l.nextZ,n--):(m=p,p=p.nextZ,k--),r?r.nextZ=m:h=m,m.prevZ=r,r=m;l=p}r.nextZ=null;q*=2}while(1<v)}for(h=a;a.prev!==a.next;){l=a.prev;p=a.next;if(f)a:{r=a;k=d;var y=e,w=f;v=r.prev;\nn=r;q=r.next;if(0<=oa(v,n,q))r=!1;else{var x=v.x>n.x?v.x>q.x?v.x:q.x:n.x>q.x?n.x:q.x,A=v.y>n.y?v.y>q.y?v.y:q.y:n.y>q.y?n.y:q.y;m=ce(v.x<n.x?v.x<q.x?v.x:q.x:n.x<q.x?n.x:q.x,v.y<n.y?v.y<q.y?v.y:q.y:n.y<q.y?n.y:q.y,k,y,w);k=ce(x,A,k,y,w);for(y=r.nextZ;y&&y.z<=k;){if(y!==r.prev&&y!==r.next&&zd(v.x,v.y,n.x,n.y,q.x,q.y,y.x,y.y)&&0<=oa(y.prev,y,y.next)){r=!1;break a}y=y.nextZ}for(y=r.prevZ;y&&y.z>=m;){if(y!==r.prev&&y!==r.next&&zd(v.x,v.y,n.x,n.y,q.x,q.y,y.x,y.y)&&0<=oa(y.prev,y,y.next)){r=!1;break a}y=\ny.prevZ}r=!0}}else a:if(r=a,v=r.prev,n=r,q=r.next,0<=oa(v,n,q))r=!1;else{for(m=r.next.next;m!==r.prev;){if(zd(v.x,v.y,n.x,n.y,q.x,q.y,m.x,m.y)&&0<=oa(m.prev,m,m.next)){r=!1;break a}m=m.next}r=!0}if(r)b.push(l.i/c),b.push(a.i/c),b.push(p.i/c),Vc(a),h=a=p.next;else if(a=p,a===h){if(!g)Xc(Wc(a),b,c,d,e,f,1);else if(1===g){g=b;h=c;l=a;do p=l.prev,r=l.next.next,!vb(p,r)&&ef(p,l,l.next,r)&&Yc(p,r)&&Yc(r,p)&&(g.push(p.i/h),g.push(l.i/h),g.push(r.i/h),Vc(l),Vc(l.next),l=a=r),l=l.next;while(l!==a);a=l;Xc(a,\nb,c,d,e,f,2)}else if(2===g)a:{g=a;do{for(h=g.next.next;h!==g.prev;){if(l=g.i!==h.i){l=g;p=h;if(r=l.next.i!==p.i&&l.prev.i!==p.i){b:{r=l;do{if(r.i!==l.i&&r.next.i!==l.i&&r.i!==p.i&&r.next.i!==p.i&&ef(r,r.next,l,p)){r=!0;break b}r=r.next}while(r!==l);r=!1}r=!r}if(r=r&&Yc(l,p)&&Yc(p,l)){r=l;v=!1;n=(l.x+p.x)/2;p=(l.y+p.y)/2;do r.y>p!==r.next.y>p&&r.next.y!==r.y&&n<(r.next.x-r.x)*(p-r.y)/(r.next.y-r.y)+r.x&&(v=!v),r=r.next;while(r!==l);r=v}l=r}if(l){a=ff(g,h);g=Wc(g,g.next);a=Wc(a,a.next);Xc(g,b,c,d,e,\nf);Xc(a,b,c,d,e,f);break a}h=h.next}g=g.next}while(g!==a)}break}}}}function Pg(a,b){return a.x-b.x}function Qg(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var h=c.x<c.next.x?c:c.next}}c=c.next}while(c!==b);if(!h)return null;if(d===f)return h.prev;b=h;g=h.x;var l=h.y,m=Infinity;for(c=h.next;c!==b;){if(d>=c.x&&c.x>=g&&d!==c.x&&zd(e<l?d:f,e,\ng,l,e<l?f:d,e,c.x,c.y)){var v=Math.abs(e-c.y)/(d-c.x);(v<m||v===m&&c.x>h.x)&&Yc(c,a)&&(h=c,m=v)}c=c.next}return h}function ce(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function Rg(a){var b=a,c=a;do b.x<c.x&&(c=b),b=b.next;while(b!==a);return c}function zd(a,b,c,d,e,f,g,h){return 0<=(e-g)*(b-h)-(a-g)*(f-h)&&0<=(a-g)*(d-h)-(c-\ng)*(b-h)&&0<=(c-g)*(f-h)-(e-g)*(d-h)}function oa(a,b,c){return(b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y)}function vb(a,b){return a.x===b.x&&a.y===b.y}function ef(a,b,c,d){return vb(a,b)&&vb(c,d)||vb(a,d)&&vb(c,b)?!0:0<oa(a,b,c)!==0<oa(a,b,d)&&0<oa(c,d,a)!==0<oa(c,d,b)}function Yc(a,b){return 0>oa(a.prev,a,a.next)?0<=oa(a,b,a.next)&&0<=oa(a,a.prev,b):0>oa(a,b,a.prev)||0>oa(a,a.next,b)}function ff(a,b){var c=new de(a.i,a.x,a.y),d=new de(b.i,b.x,b.y),e=a.next,f=b.prev;a.next=b;b.prev=a;c.next=e;e.prev=\nc;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function df(a,b,c,d){a=new de(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function Vc(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function de(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function gf(a){var b=a.length;2<b&&a[b-1].equals(a[0])&&a.pop()}function hf(a,b){for(var c=0;c<b.length;c++)a.push(b[c].x),\na.push(b[c].y)}function wb(a,b){P.call(this);this.type=\"ExtrudeGeometry\";this.parameters={shapes:a,options:b};this.fromBufferGeometry(new Ta(a,b));this.mergeVertices()}function Ta(a,b){function c(a){function c(a,b,c){b||console.error(\"THREE.ExtrudeGeometry: vec does not exist\");return b.clone().multiplyScalar(c).add(a)}function g(a,b,c){var d=a.x-b.x;var e=a.y-b.y;var f=c.x-a.x;var g=c.y-a.y,h=d*d+e*e;if(Math.abs(d*g-e*f)>Number.EPSILON){var l=Math.sqrt(h),m=Math.sqrt(f*f+g*g);h=b.x-e/l;b=b.y+d/l;\ng=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new B(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new B(f/e,d/e)}function h(a,b){for(N=a.length;0<=--N;){var c=N;var f=N-1;0>f&&(f=a.length-1);var g,h=x+2*M;for(g=0;g<h;g++){var l=Z*g,m=Z*(g+1),n=b+f+l,v=b+f+m;m=b+c+m;r(b+c+l);r(n);r(m);r(n);\nr(v);r(m);l=e.length/3;l=G.generateSideWallUV(d,e,l-6,l-3,l-2,l-1);u(l[0]);u(l[1]);u(l[3]);u(l[1]);u(l[2]);u(l[3])}}}function l(a,b,c){y.push(a);y.push(b);y.push(c)}function k(a,b,c){r(a);r(b);r(c);a=e.length/3;a=G.generateTopUV(d,e,a-3,a-2,a-1);u(a[0]);u(a[1]);u(a[2])}function r(a){e.push(y[3*a]);e.push(y[3*a+1]);e.push(y[3*a+2])}function u(a){f.push(a.x);f.push(a.y)}var y=[],w=void 0!==b.curveSegments?b.curveSegments:12,x=void 0!==b.steps?b.steps:1,A=void 0!==b.depth?b.depth:100,C=void 0!==b.bevelEnabled?\nb.bevelEnabled:!0,O=void 0!==b.bevelThickness?b.bevelThickness:6,Q=void 0!==b.bevelSize?b.bevelSize:O-2,M=void 0!==b.bevelSegments?b.bevelSegments:3,z=b.extrudePath,G=void 0!==b.UVGenerator?b.UVGenerator:Sg;void 0!==b.amount&&(console.warn(\"THREE.ExtrudeBufferGeometry: amount has been renamed to depth.\"),A=b.amount);var H=!1;if(z){var D=z.getSpacedPoints(x);H=!0;C=!1;var E=z.computeFrenetFrames(x,!1);var K=new p;var P=new p;var R=new p}C||(Q=O=M=0);var I;w=a.extractPoints(w);a=w.shape;var L=w.holes;\nif(!$a.isClockWise(a)){a=a.reverse();var J=0;for(I=L.length;J<I;J++){var S=L[J];$a.isClockWise(S)&&(L[J]=S.reverse())}}var Y=$a.triangulateShape(a,L),X=a;J=0;for(I=L.length;J<I;J++)S=L[J],a=a.concat(S);var T,Z=a.length,fa,V=Y.length;w=[];var N=0;var ba=X.length;var W=ba-1;for(T=N+1;N<ba;N++,W++,T++)W===ba&&(W=0),T===ba&&(T=0),w[N]=g(X[N],X[W],X[T]);z=[];var ea=w.concat();J=0;for(I=L.length;J<I;J++){S=L[J];var ca=[];N=0;ba=S.length;W=ba-1;for(T=N+1;N<ba;N++,W++,T++)W===ba&&(W=0),T===ba&&(T=0),ca[N]=\ng(S[N],S[W],S[T]);z.push(ca);ea=ea.concat(ca)}for(W=0;W<M;W++){ba=W/M;var da=O*Math.cos(ba*Math.PI/2);T=Q*Math.sin(ba*Math.PI/2);N=0;for(ba=X.length;N<ba;N++){var ha=c(X[N],w[N],T);l(ha.x,ha.y,-da)}J=0;for(I=L.length;J<I;J++)for(S=L[J],ca=z[J],N=0,ba=S.length;N<ba;N++)ha=c(S[N],ca[N],T),l(ha.x,ha.y,-da)}T=Q;for(N=0;N<Z;N++)ha=C?c(a[N],ea[N],T):a[N],H?(P.copy(E.normals[0]).multiplyScalar(ha.x),K.copy(E.binormals[0]).multiplyScalar(ha.y),R.copy(D[0]).add(P).add(K),l(R.x,R.y,R.z)):l(ha.x,ha.y,0);for(ba=\n1;ba<=x;ba++)for(N=0;N<Z;N++)ha=C?c(a[N],ea[N],T):a[N],H?(P.copy(E.normals[ba]).multiplyScalar(ha.x),K.copy(E.binormals[ba]).multiplyScalar(ha.y),R.copy(D[ba]).add(P).add(K),l(R.x,R.y,R.z)):l(ha.x,ha.y,A/x*ba);for(W=M-1;0<=W;W--){ba=W/M;da=O*Math.cos(ba*Math.PI/2);T=Q*Math.sin(ba*Math.PI/2);N=0;for(ba=X.length;N<ba;N++)ha=c(X[N],w[N],T),l(ha.x,ha.y,A+da);J=0;for(I=L.length;J<I;J++)for(S=L[J],ca=z[J],N=0,ba=S.length;N<ba;N++)ha=c(S[N],ca[N],T),H?l(ha.x,ha.y+D[x-1].y,D[x-1].x+da):l(ha.x,ha.y,A+da)}(function(){var a=\ne.length/3;if(C){var b=0*Z;for(N=0;N<V;N++)fa=Y[N],k(fa[2]+b,fa[1]+b,fa[0]+b);b=Z*(x+2*M);for(N=0;N<V;N++)fa=Y[N],k(fa[0]+b,fa[1]+b,fa[2]+b)}else{for(N=0;N<V;N++)fa=Y[N],k(fa[2],fa[1],fa[0]);for(N=0;N<V;N++)fa=Y[N],k(fa[0]+Z*x,fa[1]+Z*x,fa[2]+Z*x)}d.addGroup(a,e.length/3-a,0)})();(function(){var a=e.length/3,b=0;h(X,b);b+=X.length;J=0;for(I=L.length;J<I;J++)S=L[J],h(S,b),b+=S.length;d.addGroup(a,e.length/3-a,1)})()}D.call(this);this.type=\"ExtrudeBufferGeometry\";this.parameters={shapes:a,options:b};\na=Array.isArray(a)?a:[a];for(var d=this,e=[],f=[],g=0,h=a.length;g<h;g++)c(a[g]);this.addAttribute(\"position\",new z(e,3));this.addAttribute(\"uv\",new z(f,2));this.computeVertexNormals()}function jf(a,b,c){c.shapes=[];if(Array.isArray(a))for(var d=0,e=a.length;d<e;d++)c.shapes.push(a[d].uuid);else c.shapes.push(a.uuid);void 0!==b.extrudePath&&(c.options.extrudePath=b.extrudePath.toJSON());return c}function Zc(a,b){P.call(this);this.type=\"TextGeometry\";this.parameters={text:a,parameters:b};this.fromBufferGeometry(new gc(a,\nb));this.mergeVertices()}function gc(a,b){b=b||{};var c=b.font;if(!c||!c.isFont)return console.error(\"THREE.TextGeometry: font parameter is not an instance of THREE.Font.\"),new P;a=c.generateShapes(a,b.size);b.depth=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);Ta.call(this,a,b);this.type=\"TextBufferGeometry\"}function $c(a,b,c,d,e,f,g){P.call(this);this.type=\"SphereGeometry\";this.parameters=\n{radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};this.fromBufferGeometry(new xb(a,b,c,d,e,f,g));this.mergeVertices()}function xb(a,b,c,d,e,f,g){D.call(this);this.type=\"SphereBufferGeometry\";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||1;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h=\nf+g,l,m,v=0,n=[],k=new p,q=new p,r=[],u=[],y=[],w=[];for(m=0;m<=c;m++){var x=[],A=m/c;for(l=0;l<=b;l++){var C=l/b;k.x=-a*Math.cos(d+C*e)*Math.sin(f+A*g);k.y=a*Math.cos(f+A*g);k.z=a*Math.sin(d+C*e)*Math.sin(f+A*g);u.push(k.x,k.y,k.z);q.set(k.x,k.y,k.z).normalize();y.push(q.x,q.y,q.z);w.push(C,1-A);x.push(v++)}n.push(x)}for(m=0;m<c;m++)for(l=0;l<b;l++)a=n[m][l+1],d=n[m][l],e=n[m+1][l],g=n[m+1][l+1],(0!==m||0<f)&&r.push(a,d,g),(m!==c-1||h<Math.PI)&&r.push(d,e,g);this.setIndex(r);this.addAttribute(\"position\",\nnew z(u,3));this.addAttribute(\"normal\",new z(y,3));this.addAttribute(\"uv\",new z(w,2))}function ad(a,b,c,d,e,f){P.call(this);this.type=\"RingGeometry\";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};this.fromBufferGeometry(new hc(a,b,c,d,e,f));this.mergeVertices()}function hc(a,b,c,d,e,f){D.call(this);this.type=\"RingBufferGeometry\";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||.5;b=b||\n1;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):1;var g=[],h=[],l=[],m=[],v=a,n=(b-a)/d,k=new p,q=new B,r,u;for(r=0;r<=d;r++){for(u=0;u<=c;u++)a=e+u/c*f,k.x=v*Math.cos(a),k.y=v*Math.sin(a),h.push(k.x,k.y,k.z),l.push(0,0,1),q.x=(k.x/b+1)/2,q.y=(k.y/b+1)/2,m.push(q.x,q.y);v+=n}for(r=0;r<d;r++)for(b=r*(c+1),u=0;u<c;u++)a=u+b,e=a+c+1,f=a+c+2,v=a+1,g.push(a,e,v),g.push(e,f,v);this.setIndex(g);this.addAttribute(\"position\",new z(h,3));this.addAttribute(\"normal\",\nnew z(l,3));this.addAttribute(\"uv\",new z(m,2))}function bd(a,b,c,d){P.call(this);this.type=\"LatheGeometry\";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};this.fromBufferGeometry(new ic(a,b,c,d));this.mergeVertices()}function ic(a,b,c,d){D.call(this);this.type=\"LatheBufferGeometry\";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=Math.floor(b)||12;c=c||0;d=d||2*Math.PI;d=J.clamp(d,0,2*Math.PI);var e=[],f=[],g=[],h=1/b,l=new p,m=new B,v;for(v=0;v<=b;v++){var n=c+v*h*d;var k=\nMath.sin(n),q=Math.cos(n);for(n=0;n<=a.length-1;n++)l.x=a[n].x*k,l.y=a[n].y,l.z=a[n].x*q,f.push(l.x,l.y,l.z),m.x=v/b,m.y=n/(a.length-1),g.push(m.x,m.y)}for(v=0;v<b;v++)for(n=0;n<a.length-1;n++)c=n+v*a.length,h=c+a.length,l=c+a.length+1,m=c+1,e.push(c,h,m),e.push(h,l,m);this.setIndex(e);this.addAttribute(\"position\",new z(f,3));this.addAttribute(\"uv\",new z(g,2));this.computeVertexNormals();if(d===2*Math.PI)for(d=this.attributes.normal.array,e=new p,f=new p,g=new p,c=b*a.length*3,n=v=0;v<a.length;v++,\nn+=3)e.x=d[n+0],e.y=d[n+1],e.z=d[n+2],f.x=d[c+n+0],f.y=d[c+n+1],f.z=d[c+n+2],g.addVectors(e,f).normalize(),d[n+0]=d[c+n+0]=g.x,d[n+1]=d[c+n+1]=g.y,d[n+2]=d[c+n+2]=g.z}function yb(a,b){P.call(this);this.type=\"ShapeGeometry\";\"object\"===typeof b&&(console.warn(\"THREE.ShapeGeometry: Options parameter has been removed.\"),b=b.curveSegments);this.parameters={shapes:a,curveSegments:b};this.fromBufferGeometry(new zb(a,b));this.mergeVertices()}function zb(a,b){function c(a){var c,h=e.length/3;a=a.extractPoints(b);\nvar m=a.shape,k=a.holes;if(!1===$a.isClockWise(m))for(m=m.reverse(),a=0,c=k.length;a<c;a++){var v=k[a];!0===$a.isClockWise(v)&&(k[a]=v.reverse())}var p=$a.triangulateShape(m,k);a=0;for(c=k.length;a<c;a++)v=k[a],m=m.concat(v);a=0;for(c=m.length;a<c;a++)v=m[a],e.push(v.x,v.y,0),f.push(0,0,1),g.push(v.x,v.y);a=0;for(c=p.length;a<c;a++)m=p[a],d.push(m[0]+h,m[1]+h,m[2]+h),l+=3}D.call(this);this.type=\"ShapeBufferGeometry\";this.parameters={shapes:a,curveSegments:b};b=b||12;var d=[],e=[],f=[],g=[],h=0,l=\n0;if(!1===Array.isArray(a))c(a);else for(var m=0;m<a.length;m++)c(a[m]),this.addGroup(h,l,m),h+=l,l=0;this.setIndex(d);this.addAttribute(\"position\",new z(e,3));this.addAttribute(\"normal\",new z(f,3));this.addAttribute(\"uv\",new z(g,2))}function kf(a,b){b.shapes=[];if(Array.isArray(a))for(var c=0,d=a.length;c<d;c++)b.shapes.push(a[c].uuid);else b.shapes.push(a.uuid);return b}function jc(a,b){D.call(this);this.type=\"EdgesGeometry\";this.parameters={thresholdAngle:b};var c=[];b=Math.cos(J.DEG2RAD*(void 0!==\nb?b:1));var d=[0,0],e={},f=[\"a\",\"b\",\"c\"];if(a.isBufferGeometry){var g=new P;g.fromBufferGeometry(a)}else g=a.clone();g.mergeVertices();g.computeFaceNormals();a=g.vertices;g=g.faces;for(var h=0,l=g.length;h<l;h++)for(var m=g[h],k=0;3>k;k++){var n=m[f[k]];var t=m[f[(k+1)%3]];d[0]=Math.min(n,t);d[1]=Math.max(n,t);n=d[0]+\",\"+d[1];void 0===e[n]?e[n]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[n].face2=h}for(n in e)if(d=e[n],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],\nc.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addAttribute(\"position\",new z(c,3))}function Ab(a,b,c,d,e,f,g,h){P.call(this);this.type=\"CylinderGeometry\";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new ab(a,b,c,d,e,f,g,h));this.mergeVertices()}function ab(a,b,c,d,e,f,g,h){function l(c){var e,f=new B,l=new p,v=0,u=!0===c?a:b,x=!0===c?1:-1;var z=r;for(e=1;e<=d;e++)n.push(0,y*x,0),t.push(0,\nx,0),q.push(.5,.5),r++;var G=r;for(e=0;e<=d;e++){var H=e/d*h+g,D=Math.cos(H);H=Math.sin(H);l.x=u*H;l.y=y*x;l.z=u*D;n.push(l.x,l.y,l.z);t.push(0,x,0);f.x=.5*D+.5;f.y=.5*H*x+.5;q.push(f.x,f.y);r++}for(e=0;e<d;e++)f=z+e,l=G+e,!0===c?k.push(l,l+1,f):k.push(l+1,l,f),v+=3;m.addGroup(w,v,!0===c?1:2);w+=v}D.call(this);this.type=\"CylinderBufferGeometry\";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};var m=this;a=void 0!==a?a:1;\nb=void 0!==b?b:1;c=c||1;d=Math.floor(d)||8;e=Math.floor(e)||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=[],n=[],t=[],q=[],r=0,u=[],y=c/2,w=0;(function(){var f,l,v=new p,O=new p,Q=0,z=(b-a)/c;for(l=0;l<=e;l++){var B=[],H=l/e,G=H*(b-a)+a;for(f=0;f<=d;f++){var D=f/d,E=D*h+g,J=Math.sin(E);E=Math.cos(E);O.x=G*J;O.y=-H*c+y;O.z=G*E;n.push(O.x,O.y,O.z);v.set(J,z,E).normalize();t.push(v.x,v.y,v.z);q.push(D,1-H);B.push(r++)}u.push(B)}for(f=0;f<d;f++)for(l=0;l<e;l++)v=u[l+1][f],O=u[l+\n1][f+1],z=u[l][f+1],k.push(u[l][f],v,z),k.push(v,O,z),Q+=6;m.addGroup(w,Q,0);w+=Q})();!1===f&&(0<a&&l(!0),0<b&&l(!1));this.setIndex(k);this.addAttribute(\"position\",new z(n,3));this.addAttribute(\"normal\",new z(t,3));this.addAttribute(\"uv\",new z(q,2))}function cd(a,b,c,d,e,f,g){Ab.call(this,0,a,b,c,d,e,f,g);this.type=\"ConeGeometry\";this.parameters={radius:a,height:b,radialSegments:c,heightSegments:d,openEnded:e,thetaStart:f,thetaLength:g}}function dd(a,b,c,d,e,f,g){ab.call(this,0,a,b,c,d,e,f,g);this.type=\n\"ConeBufferGeometry\";this.parameters={radius:a,height:b,radialSegments:c,heightSegments:d,openEnded:e,thetaStart:f,thetaLength:g}}function ed(a,b,c,d){P.call(this);this.type=\"CircleGeometry\";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};this.fromBufferGeometry(new kc(a,b,c,d));this.mergeVertices()}function kc(a,b,c,d){D.call(this);this.type=\"CircleBufferGeometry\";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||1;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:\n0;d=void 0!==d?d:2*Math.PI;var e=[],f=[],g=[],h=[],l,m=new p,k=new B;f.push(0,0,0);g.push(0,0,1);h.push(.5,.5);var n=0;for(l=3;n<=b;n++,l+=3){var t=c+n/b*d;m.x=a*Math.cos(t);m.y=a*Math.sin(t);f.push(m.x,m.y,m.z);g.push(0,0,1);k.x=(f[l]/a+1)/2;k.y=(f[l+1]/a+1)/2;h.push(k.x,k.y)}for(l=1;l<=b;l++)e.push(l,l+1,0);this.setIndex(e);this.addAttribute(\"position\",new z(f,3));this.addAttribute(\"normal\",new z(g,3));this.addAttribute(\"uv\",new z(h,2))}function Bb(a){I.call(this);this.type=\"ShadowMaterial\";this.color=\nnew G(0);this.transparent=!0;this.setValues(a)}function lc(a){Fa.call(this,a);this.type=\"RawShaderMaterial\"}function Ua(a){I.call(this);this.defines={STANDARD:\"\"};this.type=\"MeshStandardMaterial\";this.color=new G(16777215);this.metalness=this.roughness=.5;this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new G(0);this.emissiveIntensity=1;this.bumpMap=this.emissiveMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=\nnew B(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.envMap=this.alphaMap=this.metalnessMap=this.roughnessMap=null;this.envMapIntensity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function Cb(a){Ua.call(this);this.defines={PHYSICAL:\"\"};this.type=\"MeshPhysicalMaterial\";this.reflectivity=.5;this.clearCoatRoughness=\nthis.clearCoat=0;this.setValues(a)}function Ka(a){I.call(this);this.type=\"MeshPhongMaterial\";this.color=new G(16777215);this.specular=new G(1118481);this.shininess=30;this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new G(0);this.emissiveIntensity=1;this.bumpMap=this.emissiveMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=new B(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;\nthis.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function Db(a){Ka.call(this);this.defines={TOON:\"\"};this.type=\"MeshToonMaterial\";this.gradientMap=null;this.setValues(a)}function Eb(a){I.call(this);this.type=\"MeshNormalMaterial\";this.bumpMap=null;this.bumpScale=1;this.normalMap=\nnull;this.normalMapType=0;this.normalScale=new B(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.lights=this.fog=!1;this.setValues(a)}function Fb(a){I.call(this);this.type=\"MeshLambertMaterial\";this.color=new G(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new G(0);this.emissiveIntensity=1;this.envMap=\nthis.alphaMap=this.specularMap=this.emissiveMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function Gb(a){T.call(this);this.type=\"LineDashedMaterial\";this.scale=1;this.dashSize=3;this.gapSize=1;this.setValues(a)}function ee(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0;this.onStart=void 0;this.onLoad=a;this.onProgress=\nb;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()};this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h=a;return this}}function La(a){this.manager=void 0!==a?a:ya}function lf(a){this.manager=void 0!==a?a:ya;this._parser=null}function fe(a){this.manager=\nvoid 0!==a?a:ya;this._parser=null}function fd(a){this.manager=void 0!==a?a:ya}function ge(a){this.manager=void 0!==a?a:ya}function Ad(a){this.manager=void 0!==a?a:ya}function E(){this.type=\"Curve\";this.arcLengthDivisions=200}function Da(a,b,c,d,e,f,g,h){E.call(this);this.type=\"EllipseCurve\";this.aX=a||0;this.aY=b||0;this.xRadius=c||1;this.yRadius=d||1;this.aStartAngle=e||0;this.aEndAngle=f||2*Math.PI;this.aClockwise=g||!1;this.aRotation=h||0}function mc(a,b,c,d,e,f){Da.call(this,a,b,c,c,d,e,f);this.type=\n\"ArcCurve\"}function he(){var a=0,b=0,c=0,d=0;return{initCatmullRom:function(e,f,g,h,l){e=l*(g-e);h=l*(h-f);a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},initNonuniformCatmullRom:function(e,f,g,h,l,m,k){e=((f-e)/l-(g-e)/(l+m)+(g-f)/m)*m;h=((g-f)/m-(h-f)/(m+k)+(h-g)/k)*m;a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},calc:function(e){var f=e*e;return a+b*e+c*f+d*f*e}}}function pa(a,b,c,d){E.call(this);this.type=\"CatmullRomCurve3\";this.points=a||[];this.closed=b||!1;this.curveType=c||\"centripetal\";this.tension=d||\n.5}function mf(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return(2*c-2*d+b+e)*a*f+(-3*c+3*d-2*b-e)*f+b*a+c}function gd(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}function hd(a,b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*a*a*d+a*a*a*e}function Ma(a,b,c,d){E.call(this);this.type=\"CubicBezierCurve\";this.v0=a||new B;this.v1=b||new B;this.v2=c||new B;this.v3=d||new B}function Va(a,b,c,d){E.call(this);this.type=\"CubicBezierCurve3\";this.v0=a||new p;this.v1=b||new p;this.v2=c||new p;\nthis.v3=d||new p}function ia(a,b){E.call(this);this.type=\"LineCurve\";this.v1=a||new B;this.v2=b||new B}function Na(a,b){E.call(this);this.type=\"LineCurve3\";this.v1=a||new p;this.v2=b||new p}function Oa(a,b,c){E.call(this);this.type=\"QuadraticBezierCurve\";this.v0=a||new B;this.v1=b||new B;this.v2=c||new B}function Wa(a,b,c){E.call(this);this.type=\"QuadraticBezierCurve3\";this.v0=a||new p;this.v1=b||new p;this.v2=c||new p}function Pa(a){E.call(this);this.type=\"SplineCurve\";this.points=a||[]}function bb(){E.call(this);\nthis.type=\"CurvePath\";this.curves=[];this.autoClose=!1}function Qa(a){bb.call(this);this.type=\"Path\";this.currentPoint=new B;a&&this.setFromPoints(a)}function jb(a){Qa.call(this,a);this.uuid=J.generateUUID();this.type=\"Shape\";this.holes=[]}function X(a,b){H.call(this);this.type=\"Light\";this.color=new G(a);this.intensity=void 0!==b?b:1;this.receiveShadow=void 0}function Bd(a,b,c){X.call(this,a,c);this.type=\"HemisphereLight\";this.castShadow=void 0;this.position.copy(H.DefaultUp);this.updateMatrix();\nthis.groundColor=new G(b)}function Hb(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new B(512,512);this.map=null;this.matrix=new R}function Cd(){Hb.call(this,new Z(50,1,.5,500))}function Dd(a,b,c,d,e,f){X.call(this,a,b);this.type=\"SpotLight\";this.position.copy(H.DefaultUp);this.updateMatrix();this.target=new H;Object.defineProperty(this,\"power\",{get:function(){return this.intensity*Math.PI},set:function(a){this.intensity=a/Math.PI}});this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:\nMath.PI/3;this.penumbra=void 0!==e?e:0;this.decay=void 0!==f?f:1;this.shadow=new Cd}function Ed(a,b,c,d){X.call(this,a,b);this.type=\"PointLight\";Object.defineProperty(this,\"power\",{get:function(){return 4*this.intensity*Math.PI},set:function(a){this.intensity=a/(4*Math.PI)}});this.distance=void 0!==c?c:0;this.decay=void 0!==d?d:1;this.shadow=new Hb(new Z(90,1,.5,500))}function Fd(){Hb.call(this,new Mb(-5,5,5,-5,.5,500))}function Gd(a,b){X.call(this,a,b);this.type=\"DirectionalLight\";this.position.copy(H.DefaultUp);\nthis.updateMatrix();this.target=new H;this.shadow=new Fd}function Hd(a,b){X.call(this,a,b);this.type=\"AmbientLight\";this.castShadow=void 0}function Id(a,b,c,d){X.call(this,a,b);this.type=\"RectAreaLight\";this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function Jd(a,b,c,d){ja.call(this,a,b,c,d)}function Kd(a,b,c){ja.call(this,a,b,c)}function Ea(a,b,c,d){this.parameterPositions=a;this._cachedIndex=0;this.resultBuffer=void 0!==d?d:new b.constructor(c);this.sampleValues=b;this.valueSize=c}function Ld(a,\nb,c,d){Ea.call(this,a,b,c,d)}function id(a,b,c,d){ja.call(this,a,b,c,d)}function Md(a,b,c,d){ja.call(this,a,b,c,d)}function nc(a,b,c,d){ja.call(this,a,b,c,d)}function Nd(a,b,c,d){Ea.call(this,a,b,c,d);this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function jd(a,b,c,d){Ea.call(this,a,b,c,d)}function Od(a,b,c,d){Ea.call(this,a,b,c,d)}function ja(a,b,c,d){if(void 0===a)throw Error(\"THREE.KeyframeTrack: track name is undefined\");if(void 0===b||0===b.length)throw Error(\"THREE.KeyframeTrack: no keyframes in track named \"+\na);this.name=a;this.times=na.convertArray(b,this.TimeBufferType);this.values=na.convertArray(c,this.ValueBufferType);this.setInterpolation(d||this.DefaultInterpolation);this.validate();this.optimize()}function oc(a,b,c,d){ja.call(this,a,b,c,d)}function Ga(a,b,c){this.name=a;this.tracks=c;this.duration=void 0!==b?b:-1;this.uuid=J.generateUUID();0>this.duration&&this.resetDuration();this.optimize()}function Pd(a){this.manager=void 0!==a?a:ya;this.textures={}}function ie(a){this.manager=void 0!==a?a:\nya}function pc(){}function je(a){\"boolean\"===typeof a&&(console.warn(\"THREE.JSONLoader: showStatus parameter has been removed from constructor.\"),a=void 0);this.manager=void 0!==a?a:ya;this.withCredentials=!1}function nf(a){this.manager=void 0!==a?a:ya;this.texturePath=\"\"}function ke(a){\"undefined\"===typeof createImageBitmap&&console.warn(\"THREE.ImageBitmapLoader: createImageBitmap() not supported.\");\"undefined\"===typeof fetch&&console.warn(\"THREE.ImageBitmapLoader: fetch() not supported.\");this.manager=\nvoid 0!==a?a:ya;this.options=void 0}function le(){this.type=\"ShapePath\";this.color=new G;this.subPaths=[];this.currentPath=null}function me(a){this.type=\"Font\";this.data=a}function of(a){this.manager=void 0!==a?a:ya}function ne(a){this.manager=void 0!==a?a:ya}function pf(){this.type=\"StereoCamera\";this.aspect=1;this.eyeSep=.064;this.cameraL=new Z;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new Z;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1}function kd(a,\nb,c){H.call(this);this.type=\"CubeCamera\";var d=new Z(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new p(1,0,0));this.add(d);var e=new Z(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new p(-1,0,0));this.add(e);var f=new Z(90,1,a,b);f.up.set(0,0,1);f.lookAt(new p(0,1,0));this.add(f);var g=new Z(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new p(0,-1,0));this.add(g);var h=new Z(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new p(0,0,1));this.add(h);var l=new Z(90,1,a,b);l.up.set(0,-1,0);l.lookAt(new p(0,0,-1));this.add(l);this.renderTarget=\nnew Lb(c,c,{format:1022,magFilter:1006,minFilter:1006});this.renderTarget.texture.name=\"CubeCamera\";this.update=function(a,b){null===this.parent&&this.updateMatrixWorld();var c=this.renderTarget,m=c.texture.generateMipmaps;c.texture.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.texture.generateMipmaps=m;c.activeCubeFace=5;a.render(b,l,c);a.setRenderTarget(null)};\nthis.clear=function(a,b,c,d){for(var e=this.renderTarget,f=0;6>f;f++)e.activeCubeFace=f,a.setRenderTarget(e),a.clear(b,c,d);a.setRenderTarget(null)}}function oe(){H.call(this);this.type=\"AudioListener\";this.context=pe.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null}function qc(a){H.call(this);this.type=\"Audio\";this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.loop=\n!1;this.offset=this.startTime=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType=\"empty\";this.filters=[]}function qe(a){qc.call(this,a);this.panner=this.context.createPanner();this.panner.connect(this.gain)}function re(a,b){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function se(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case \"quaternion\":b=\nthis._slerp;break;case \"string\":case \"bool\":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function qf(a,b,c){c=c||ra.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function ra(a,b,c){this.path=b;this.parsedPath=c||ra.parseTrackName(b);this.node=ra.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function rf(){this.uuid=J.generateUUID();this._objects=Array.prototype.slice.call(arguments);\nthis.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function sf(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400,\nendingEnd:2400},e=0;e!==b;++e){var f=a[e].createInterpolant(null);c[e]=f;f.settings=d}this._interpolantSettings=d;this._interpolants=c;this._propertyBindings=Array(b);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null;this.loop=2201;this._loopCount=-1;this._startTime=null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd=\nthis.zeroSlopeAtStart=!0}function te(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Qd(a,b){\"string\"===typeof a&&(console.warn(\"THREE.Uniform: Type parameter is no longer needed.\"),a=b);this.value=a}function ue(){D.call(this);this.type=\"InstancedBufferGeometry\";this.maxInstancedCount=void 0}function ve(a,b,c,d){this.data=a;this.itemSize=b;this.offset=c;this.normalized=!0===d}function rc(a,b){this.array=a;this.stride=b;this.count=void 0!==a?a.length/\nb:0;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function we(a,b,c){rc.call(this,a,b);this.meshPerAttribute=c||1}function xe(a,b,c){L.call(this,a,b);this.meshPerAttribute=c||1}function tf(a,b,c,d){this.ray=new sb(a,b);this.near=c||0;this.far=d||Infinity;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn(\"THREE.Raycaster: params.PointCloud has been renamed to params.Points.\");return this.Points}}})}\nfunction uf(a,b){return a.distance-b.distance}function ye(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.children;d=0;for(var e=a.length;d<e;d++)ye(a[d],b,c,!0)}}function vf(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function wf(a,b,c){this.radius=void 0!==a?a:1;this.phi=void 0!==b?b:0;this.theta=void 0!==c?c:0;return this}function xf(a,b,c){this.radius=void 0!==a?a:1;this.theta=void 0!==b?b:0;this.y=void 0!==c?c:0;return this}function ze(a,\nb){this.min=void 0!==a?a:new B(Infinity,Infinity);this.max=void 0!==b?b:new B(-Infinity,-Infinity)}function ld(a){H.call(this);this.material=a;this.render=function(){}}function md(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16711680;d=void 0!==d?d:1;b=0;(c=this.object.geometry)&&c.isGeometry?b=3*c.faces.length:c&&c.isBufferGeometry&&(b=c.attributes.normal.count);c=new D;b=new z(6*b,3);c.addAttribute(\"position\",b);Y.call(this,c,new T({color:a,linewidth:d}));this.matrixAutoUpdate=\n!1;this.update()}function sc(a,b){H.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=b;a=new D;b=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(var c=0,d=1;32>c;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.addAttribute(\"position\",new z(b,3));b=new T({fog:!1});this.cone=new Y(a,b);this.add(this.cone);this.update()}function yf(a){var b=[];a&&a.isBone&&\nb.push(a);for(var c=0;c<a.children.length;c++)b.push.apply(b,yf(a.children[c]));return b}function tc(a){for(var b=yf(a),c=new D,d=[],e=[],f=new G(0,0,1),g=new G(0,1,0),h=0;h<b.length;h++){var l=b[h];l.parent&&l.parent.isBone&&(d.push(0,0,0),d.push(0,0,0),e.push(f.r,f.g,f.b),e.push(g.r,g.g,g.b))}c.addAttribute(\"position\",new z(d,3));c.addAttribute(\"color\",new z(e,3));d=new T({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Y.call(this,c,d);this.root=a;this.bones=b;this.matrix=a.matrixWorld;\nthis.matrixAutoUpdate=!1}function uc(a,b,c){this.light=a;this.light.updateMatrixWorld();this.color=c;a=new xb(b,4,2);b=new ua({wireframe:!0,fog:!1});va.call(this,a,b);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1;this.update()}function vc(a,b){H.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=b;a=new T({fog:!1});b=new D;b.addAttribute(\"position\",new L(new Float32Array(15),3));this.line=new wa(b,a);this.add(this.line);\nthis.update()}function wc(a,b,c){H.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=c;a=new ub(b);a.rotateY(.5*Math.PI);this.material=new ua({wireframe:!0,fog:!1});void 0===this.color&&(this.material.vertexColors=2);b=a.getAttribute(\"position\");b=new Float32Array(3*b.count);a.addAttribute(\"color\",new L(b,3));this.add(new va(a,this.material));this.update()}function nd(a,b,c,d){a=a||10;b=b||10;c=new G(void 0!==c?c:4473924);d=new G(void 0!==\nd?d:8947848);var e=b/2,f=a/b,g=a/2;a=[];for(var h=[],l=0,m=0,k=-g;l<=b;l++,k+=f){a.push(-g,0,k,g,0,k);a.push(k,0,-g,k,0,g);var n=l===e?c:d;n.toArray(h,m);m+=3;n.toArray(h,m);m+=3;n.toArray(h,m);m+=3;n.toArray(h,m);m+=3}b=new D;b.addAttribute(\"position\",new z(a,3));b.addAttribute(\"color\",new z(h,3));c=new T({vertexColors:2});Y.call(this,b,c)}function Rd(a,b,c,d,e,f){a=a||10;b=b||16;c=c||8;d=d||64;e=new G(void 0!==e?e:4473924);f=new G(void 0!==f?f:8947848);var g=[],h=[],l;for(l=0;l<=b;l++){var m=l/\nb*2*Math.PI;var k=Math.sin(m)*a;m=Math.cos(m)*a;g.push(0,0,0);g.push(k,0,m);var n=l&1?e:f;h.push(n.r,n.g,n.b);h.push(n.r,n.g,n.b)}for(l=0;l<=c;l++){n=l&1?e:f;var t=a-a/c*l;for(b=0;b<d;b++)m=b/d*2*Math.PI,k=Math.sin(m)*t,m=Math.cos(m)*t,g.push(k,0,m),h.push(n.r,n.g,n.b),m=(b+1)/d*2*Math.PI,k=Math.sin(m)*t,m=Math.cos(m)*t,g.push(k,0,m),h.push(n.r,n.g,n.b)}a=new D;a.addAttribute(\"position\",new z(g,3));a.addAttribute(\"color\",new z(h,3));g=new T({vertexColors:2});Y.call(this,a,g)}function od(a,b,c,d){this.object=\na;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=0;(c=this.object.geometry)&&c.isGeometry?b=c.faces.length:console.warn(\"THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.\");c=new D;b=new z(6*b,3);c.addAttribute(\"position\",b);Y.call(this,c,new T({color:a,linewidth:d}));this.matrixAutoUpdate=!1;this.update()}function xc(a,b,c){H.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=\n!1;this.color=c;void 0===b&&(b=1);a=new D;a.addAttribute(\"position\",new z([-b,b,0,b,b,0,b,-b,0,-b,-b,0,-b,b,0],3));b=new T({fog:!1});this.lightPlane=new wa(a,b);this.add(this.lightPlane);a=new D;a.addAttribute(\"position\",new z([0,0,0,0,0,1],3));this.targetLine=new wa(a,b);this.add(this.targetLine);this.update()}function pd(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){f.push(0,0,0);g.push(b.r,b.g,b.b);void 0===h[a]&&(h[a]=[]);h[a].push(f.length/3-1)}var d=new D,e=new T({color:16777215,vertexColors:1}),\nf=[],g=[],h={},l=new G(16755200),m=new G(16711680),k=new G(43775),n=new G(16777215),t=new G(3355443);b(\"n1\",\"n2\",l);b(\"n2\",\"n4\",l);b(\"n4\",\"n3\",l);b(\"n3\",\"n1\",l);b(\"f1\",\"f2\",l);b(\"f2\",\"f4\",l);b(\"f4\",\"f3\",l);b(\"f3\",\"f1\",l);b(\"n1\",\"f1\",l);b(\"n2\",\"f2\",l);b(\"n3\",\"f3\",l);b(\"n4\",\"f4\",l);b(\"p\",\"n1\",m);b(\"p\",\"n2\",m);b(\"p\",\"n3\",m);b(\"p\",\"n4\",m);b(\"u1\",\"u2\",k);b(\"u2\",\"u3\",k);b(\"u3\",\"u1\",k);b(\"c\",\"t\",n);b(\"p\",\"c\",t);b(\"cn1\",\"cn2\",t);b(\"cn3\",\"cn4\",t);b(\"cf1\",\"cf2\",t);b(\"cf3\",\"cf4\",t);d.addAttribute(\"position\",\nnew z(f,3));d.addAttribute(\"color\",new z(g,3));Y.call(this,d,e);this.camera=a;this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=h;this.update()}function Ib(a,b){this.object=a;void 0===b&&(b=16776960);a=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]);var c=new Float32Array(24),d=new D;d.setIndex(new L(a,1));d.addAttribute(\"position\",new L(c,3));Y.call(this,d,new T({color:b}));this.matrixAutoUpdate=\n!1;this.update()}function qd(a,b){this.type=\"Box3Helper\";this.box=a;a=void 0!==b?b:16776960;b=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]);var c=new D;c.setIndex(new L(b,1));c.addAttribute(\"position\",new z([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3));Y.call(this,c,new T({color:a}));this.geometry.computeBoundingSphere()}function rd(a,b,c){this.type=\"PlaneHelper\";this.plane=a;this.size=void 0===b?1:b;a=void 0!==c?c:16776960;b=new D;b.addAttribute(\"position\",\nnew z([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));b.computeBoundingSphere();wa.call(this,b,new T({color:a}));b=new D;b.addAttribute(\"position\",new z([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3));b.computeBoundingSphere();this.add(new va(b,new ua({color:a,opacity:.2,transparent:!0,depthWrite:!1})))}function Jb(a,b,c,d,e,f){H.call(this);void 0===d&&(d=16776960);void 0===c&&(c=1);void 0===e&&(e=.2*c);void 0===f&&(f=.2*e);void 0===Sd&&(Sd=new D,Sd.addAttribute(\"position\",\nnew z([0,0,0,0,1,0],3)),Ae=new ab(0,.5,1,5,1),Ae.translate(0,-.5,0));this.position.copy(b);this.line=new wa(Sd,new T({color:d}));this.line.matrixAutoUpdate=!1;this.add(this.line);this.cone=new va(Ae,new ua({color:d}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(a);this.setLength(c,e,f)}function sd(a){a=a||1;var b=[0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a];a=new D;a.addAttribute(\"position\",new z(b,3));a.addAttribute(\"color\",new z([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));b=new T({vertexColors:2});\nY.call(this,a,b)}function zf(a){console.warn(\"THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.\");pa.call(this,a);this.type=\"catmullrom\";this.closed=!0}function Af(a){console.warn(\"THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.\");pa.call(this,a);this.type=\"catmullrom\"}function Be(a){console.warn(\"THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.\");pa.call(this,a);this.type=\"catmullrom\"}void 0===Number.EPSILON&&(Number.EPSILON=\nMath.pow(2,-52));void 0===Number.isInteger&&(Number.isInteger=function(a){return\"number\"===typeof a&&isFinite(a)&&Math.floor(a)===a});void 0===Math.sign&&(Math.sign=function(a){return 0>a?-1:0<a?1:+a});!1===\"name\"in Function.prototype&&Object.defineProperty(Function.prototype,\"name\",{get:function(){return this.toString().match(/^\\s*function\\s*([^\\(\\s]*)/)[1]}});void 0===Object.assign&&function(){Object.assign=function(a){if(void 0===a||null===a)throw new TypeError(\"Cannot convert undefined or null to object\");\nfor(var b=Object(a),c=1;c<arguments.length;c++){var d=arguments[c];if(void 0!==d&&null!==d)for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&(b[e]=d[e])}return b}}();Object.assign(za.prototype,{addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)},removeEventListener:function(a,\nb){void 0!==this._listeners&&(a=this._listeners[a],void 0!==a&&(b=a.indexOf(b),-1!==b&&a.splice(b,1)))},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;b=b.slice(0);for(var c=0,d=b.length;c<d;c++)b[c].call(this,a)}}}});var J={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var a=[],b=0;256>b;b++)a[b]=(16>b?\"0\":\"\")+b.toString(16);return function(){var b=4294967295*Math.random()|0,d=4294967295*Math.random()|0,e=4294967295*\nMath.random()|0,f=4294967295*Math.random()|0;return(a[b&255]+a[b>>8&255]+a[b>>16&255]+a[b>>24&255]+\"-\"+a[d&255]+a[d>>8&255]+\"-\"+a[d>>16&15|64]+a[d>>24&255]+\"-\"+a[e&63|128]+a[e>>8&255]+\"-\"+a[e>>16&255]+a[e>>24&255]+a[f&255]+a[f>>8&255]+a[f>>16&255]+a[f>>24&255]).toUpperCase()}}(),clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a,\nb,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(a){return a*J.DEG2RAD},radToDeg:function(a){return a*J.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,\nMath.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(B.prototype,{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(B.prototype,{isVector2:!0,set:function(a,b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},\nsetComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error(\"index is out of range: \"+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error(\"index is out of range: \"+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),\nthis.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},\nsubVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},applyMatrix3:function(a){var b=this.x,c=this.y;a=a.elements;this.x=a[0]*b+a[3]*c+a[6];this.y=a[1]*b+a[4]*c+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},\nmax:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));return this},clampScalar:function(){var a=new B,b=new B;return function(c,d){a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);\nreturn this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*\nthis.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var a=Math.atan2(this.y,this.x);0>a&&(a+=2*Math.PI);return a},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)},setLength:function(a){return this.normalize().multiplyScalar(a)},\nlerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn(\"THREE.Vector2: offset has been removed from .fromBufferAttribute().\");\nthis.x=a.getX(b);this.y=a.getY(b);return this},rotateAround:function(a,b){var c=Math.cos(b);b=Math.sin(b);var d=this.x-a.x,e=this.y-a.y;this.x=d*c-e*b+a.x;this.y=d*b+e*c+a.y;return this}});Object.assign(R.prototype,{isMatrix4:!0,set:function(a,b,c,d,e,f,g,h,l,m,k,n,t,q,r,p){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=h;v[2]=l;v[6]=m;v[10]=k;v[14]=n;v[3]=t;v[7]=q;v[11]=r;v[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},\nclone:function(){return(new R).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return this},copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){a.setFromMatrixColumn(this,0);b.setFromMatrixColumn(this,1);c.setFromMatrixColumn(this,\n2);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a=new p;return function(b){var c=this.elements,d=b.elements,e=1/a.setFromMatrixColumn(b,0).length(),f=1/a.setFromMatrixColumn(b,1).length();b=1/a.setFromMatrixColumn(b,2).length();c[0]=d[0]*e;c[1]=d[1]*e;c[2]=d[2]*e;c[3]=0;c[4]=d[4]*f;c[5]=d[5]*f;c[6]=d[6]*f;c[7]=0;c[8]=d[8]*b;c[9]=d[9]*b;c[10]=d[10]*b;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return this}}(),\nmakeRotationFromEuler:function(a){a&&a.isEuler||console.error(\"THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.\");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c);c=Math.sin(c);var g=Math.cos(d);d=Math.sin(d);var h=Math.cos(e);e=Math.sin(e);if(\"XYZ\"===a.order){a=f*h;var l=f*e,m=c*h,k=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=l+m*d;b[5]=a-k*d;b[9]=-c*g;b[2]=k-a*d;b[6]=m+l*d;b[10]=f*g}else\"YXZ\"===a.order?(a=g*h,l=g*e,m=d*h,k=d*e,b[0]=a+k*c,b[4]=m*c-l,\nb[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=l*c-m,b[6]=k+a*c,b[10]=f*g):\"ZXY\"===a.order?(a=g*h,l=g*e,m=d*h,k=d*e,b[0]=a-k*c,b[4]=-f*e,b[8]=m+l*c,b[1]=l+m*c,b[5]=f*h,b[9]=k-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):\"ZYX\"===a.order?(a=f*h,l=f*e,m=c*h,k=c*e,b[0]=g*h,b[4]=m*d-l,b[8]=a*d+k,b[1]=g*e,b[5]=k*d+a,b[9]=l*d-m,b[2]=-d,b[6]=c*g,b[10]=f*g):\"YZX\"===a.order?(a=f*g,l=f*d,m=c*g,k=c*d,b[0]=g*h,b[4]=k-a*e,b[8]=m*e+l,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+m,b[10]=a-k*e):\"XZY\"===a.order&&(a=f*g,l=f*d,m=c*g,k=\nc*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+k,b[5]=f*h,b[9]=l*e-m,b[2]=m*e-l,b[6]=c*h,b[10]=k*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(){var a=new p(0,0,0),b=new p(1,1,1);return function(c){return this.compose(a,c,b)}}(),lookAt:function(){var a=new p,b=new p,c=new p;return function(d,e,f){var g=this.elements;c.subVectors(d,e);0===c.lengthSq()&&(c.z=1);c.normalize();a.crossVectors(f,c);0===a.lengthSq()&&(1===Math.abs(f.z)?c.x+=1E-4:c.z+=\n1E-4,c.normalize(),a.crossVectors(f,c));a.normalize();b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn(\"THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.\"),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;\nb=this.elements;a=c[0];var e=c[4],f=c[8],g=c[12],h=c[1],l=c[5],m=c[9],k=c[13],n=c[2],t=c[6],q=c[10],r=c[14],p=c[3],y=c[7],w=c[11];c=c[15];var x=d[0],A=d[4],C=d[8],O=d[12],Q=d[1],z=d[5],B=d[9],H=d[13],G=d[2],D=d[6],E=d[10],J=d[14],L=d[3],I=d[7],K=d[11];d=d[15];b[0]=a*x+e*Q+f*G+g*L;b[4]=a*A+e*z+f*D+g*I;b[8]=a*C+e*B+f*E+g*K;b[12]=a*O+e*H+f*J+g*d;b[1]=h*x+l*Q+m*G+k*L;b[5]=h*A+l*z+m*D+k*I;b[9]=h*C+l*B+m*E+k*K;b[13]=h*O+l*H+m*J+k*d;b[2]=n*x+t*Q+q*G+r*L;b[6]=n*A+t*z+q*D+r*I;b[10]=n*C+t*B+q*E+r*K;b[14]=n*\nO+t*H+q*J+r*d;b[3]=p*x+y*Q+w*G+c*L;b[7]=p*A+y*z+w*D+c*I;b[11]=p*C+y*B+w*E+c*K;b[15]=p*O+y*H+w*J+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applyToBufferAttribute:function(){var a=new p;return function(b){for(var c=0,d=b.count;c<d;c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(c,a.x,a.y,a.z);return b}}(),\ndeterminant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],l=a[13],m=a[2],k=a[6],n=a[10],t=a[14];return a[3]*(+e*h*k-d*l*k-e*g*n+c*l*n+d*g*t-c*h*t)+a[7]*(+b*h*t-b*l*n+e*f*n-d*f*t+d*l*m-e*h*m)+a[11]*(+b*l*k-b*g*t-e*f*k+c*f*t+e*g*m-c*l*m)+a[15]*(-d*g*m-b*h*k+b*g*n+d*f*k-c*f*n+c*h*m)},transpose:function(){var a=this.elements;var b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];\na[14]=b;return this},setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements;a=d[0];var e=d[1],f=d[2],g=d[3],h=d[4],l=d[5],m=d[6],k=d[7],n=d[8],t=d[9],q=d[10],r=d[11],p=d[12],y=d[13],w=d[14];d=d[15];var x=t*w*k-y*q*k+y*m*r-l*w*r-t*m*d+l*q*d,A=p*q*k-n*w*k-p*m*r+h*w*r+n*m*d-h*q*d,C=n*y*k-p*t*k+p*l*r-h*y*r-n*l*d+h*t*d,O=p*t*m-n*y*m-p*l*q+h*y*q+n*l*w-h*t*w,Q=a*x+e*A+f*C+g*O;if(0===Q){if(!0===b)throw Error(\"THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0\");\nconsole.warn(\"THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0\");return this.identity()}b=1/Q;c[0]=x*b;c[1]=(y*q*g-t*w*g-y*f*r+e*w*r+t*f*d-e*q*d)*b;c[2]=(l*w*g-y*m*g+y*f*k-e*w*k-l*f*d+e*m*d)*b;c[3]=(t*m*g-l*q*g-t*f*k+e*q*k+l*f*r-e*m*r)*b;c[4]=A*b;c[5]=(n*w*g-p*q*g+p*f*r-a*w*r-n*f*d+a*q*d)*b;c[6]=(p*m*g-h*w*g-p*f*k+a*w*k+h*f*d-a*m*d)*b;c[7]=(h*q*g-n*m*g+n*f*k-a*q*k-h*f*r+a*m*r)*b;c[8]=C*b;c[9]=(p*t*g-n*y*g-p*e*r+a*y*r+n*e*d-a*t*d)*b;c[10]=(h*y*g-p*l*g+p*e*k-a*y*k-h*e*d+a*l*d)*b;c[11]=\n(n*l*g-h*t*g-n*e*k+a*t*k+h*e*r-a*l*r)*b;c[12]=O*b;c[13]=(n*y*f-p*t*f+p*e*q-a*y*q-n*e*w+a*t*w)*b;c[14]=(p*l*f-h*y*f-p*e*m+a*y*m+h*e*w-a*l*w)*b;c[15]=(h*t*f-n*l*f+n*e*m-a*t*m-h*e*q+a*l*q)*b;return this},scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],a[4]*a[4]+a[5]*a[5]+a[6]*a[6],\na[8]*a[8]+a[9]*a[9]+a[10]*a[10]))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=\nMath.cos(b);b=Math.sin(b);var d=1-c,e=a.x,f=a.y;a=a.z;var g=d*e,h=d*f;this.set(g*e+c,g*f-b*a,g*a+b*f,0,g*f+b*a,h*f+c,h*a-b*e,0,g*a-b*f,h*a+b*e,d*a*a+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},makeShear:function(a,b,c){this.set(1,b,c,0,a,1,c,0,a,b,1,0,0,0,0,1);return this},compose:function(a,b,c){var d=this.elements,e=b._x,f=b._y,g=b._z,h=b._w,l=e+e,m=f+f,k=g+g;b=e*l;var n=e*m;e*=k;var t=f*m;f*=k;g*=k;l*=h;m*=h;h*=k;k=c.x;var q=c.y;c=\nc.z;d[0]=(1-(t+g))*k;d[1]=(n+h)*k;d[2]=(e-m)*k;d[3]=0;d[4]=(n-h)*q;d[5]=(1-(b+g))*q;d[6]=(f+l)*q;d[7]=0;d[8]=(e+m)*c;d[9]=(f-l)*c;d[10]=(1-(b+t))*c;d[11]=0;d[12]=a.x;d[13]=a.y;d[14]=a.z;d[15]=1;return this},decompose:function(){var a=new p,b=new R;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),l=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.copy(this);c=1/g;f=1/h;var m=1/l;b.elements[0]*=c;\nb.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=m;b.elements[9]*=m;b.elements[10]*=m;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=l;return this}}(),makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn(\"THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.\");var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(c-d);g[9]=(c+d)/(c-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+\ne)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=1/(b-a),l=1/(c-d),m=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);g[1]=0;g[5]=2*l;g[9]=0;g[13]=-((c+d)*l);g[2]=0;g[6]=0;g[10]=-2*m;g[14]=-((f+e)*m);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements;a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=\na[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});Object.assign(ca,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h=c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],n=e[f+2];e=e[f+3];if(c!==\ne||h!==d||l!==k||m!==n){f=1-g;var t=h*d+l*k+m*n+c*e,q=0<=t?1:-1,p=1-t*t;p>Number.EPSILON&&(p=Math.sqrt(p),t=Math.atan2(p,t*q),f=Math.sin(f*t)/p,g=Math.sin(g*t)/p);q*=g;h=h*f+d*q;l=l*f+k*q;m=m*f+n*q;c=c*f+e*q;f===1-g&&(g=1/Math.sqrt(h*h+l*l+m*m+c*c),h*=g,l*=g,m*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(ca.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},\nz:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this.onChangeCallback()}}});Object.assign(ca.prototype,{set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,\nb){if(!a||!a.isEuler)throw Error(\"THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.\");var c=a._x,d=a._y,e=a._z;a=a.order;var f=Math.cos,g=Math.sin,h=f(c/2),l=f(d/2);f=f(e/2);c=g(c/2);d=g(d/2);e=g(e/2);\"XYZ\"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f-c*d*e):\"YXZ\"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f+c*d*e):\"ZXY\"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e+c*d*\nf,this._w=h*l*f-c*d*e):\"ZYX\"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f+c*d*e):\"YZX\"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f-c*d*e):\"XZY\"===a&&(this._x=c*l*f-h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f+c*d*e);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,b){b/=2;var c=Math.sin(b);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=Math.cos(b);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=\na.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],l=b[6];b=b[10];var m=c+f+b;0<m?(c=.5/Math.sqrt(m+1),this._w=.25/c,this._x=(l-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(l-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+l)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+l)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a=\nnew p,b;return function(c,d){void 0===a&&(a=new p);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;return this.normalize()}}(),inverse:function(){return this.conjugate()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+\nthis._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},multiply:function(a,b){return void 0!==b?(console.warn(\"THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.\"),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,\na)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z;a=a._w;var f=b._x,g=b._y,h=b._z;b=b._w;this._x=c*b+a*f+d*h-e*g;this._y=d*b+a*g+e*f-c*h;this._z=e*b+a*h+c*g-d*f;this._w=a*b-c*f-d*g-e*h;this.onChangeCallback();return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,\ng=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;a=1-g*g;if(a<=Number.EPSILON)return g=1-b,this._w=g*f+b*this._w,this._x=g*c+b*this._x,this._y=g*d+b*this._y,this._z=g*e+b*this._z,this.normalize();a=Math.sqrt(a);var h=Math.atan2(a,g);g=Math.sin((1-b)*h)/a;b=Math.sin(b*h)/a;this._w=f*g+this._w*b;this._x=c*g+this._x*b;this._y=d*g+this._y*b;this._z=e*g+this._z*b;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&\na._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(p.prototype,{isVector3:!0,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setScalar:function(a){this.z=this.y=\nthis.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error(\"index is out of range: \"+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(\"index is out of range: \"+a);}},clone:function(){return new this.constructor(this.x,\nthis.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=\na.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.\"),\nthis.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a=new ca;return function(b){b&&b.isEuler||console.error(\"THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.\");return this.applyQuaternion(a.setFromEuler(b))}}(),applyAxisAngle:function(){var a=new ca;return function(b,\nc){return this.applyQuaternion(a.setFromAxisAngle(b,c))}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,\nc=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,l=a*c+g*b-e*d,m=a*d+e*c-f*b;b=-e*b-f*c-g*d;this.x=h*a+b*-e+l*-g-m*-f;this.y=l*a+b*-f+m*-e-h*-g;this.z=m*a+b*-g+h*-f-l*-e;return this},project:function(){var a=new R;return function(b){a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyMatrix4(a)}}(),unproject:function(){var a=new R;return function(b){a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix));return this.applyMatrix4(a)}}(),transformDirection:function(a){var b=\nthis.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;return this.normalize()},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);return this},clamp:function(a,\nb){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));return this},clampScalar:function(){var a=new p,b=new p;return function(c,d){a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=\nMath.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*\na.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpVectors:function(a,\nb,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},cross:function(a,b){return void 0!==b?(console.warn(\"THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.\"),this.crossVectors(a,b)):this.crossVectors(this,a)},crossVectors:function(a,b){var c=a.x,d=a.y;a=a.z;var e=b.x,f=b.y;b=b.z;this.x=d*b-a*f;this.y=a*e-c*b;this.z=c*f-d*e;return this},projectOnVector:function(a){var b=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(){var a=\nnew p;return function(b){a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a=new p;return function(b){return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(J.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-\na.x)+Math.abs(this.y-a.y)+Math.abs(this.z-a.z)},setFromSpherical:function(a){var b=Math.sin(a.phi)*a.radius;this.x=b*Math.sin(a.theta);this.y=Math.cos(a.phi)*a.radius;this.z=b*Math.cos(a.theta);return this},setFromCylindrical:function(a){this.x=a.radius*Math.sin(a.theta);this.y=a.y;this.z=a.radius*Math.cos(a.theta);return this},setFromMatrixPosition:function(a){a=a.elements;this.x=a[12];this.y=a[13];this.z=a[14];return this},setFromMatrixScale:function(a){var b=this.setFromMatrixColumn(a,0).length(),\nc=this.setFromMatrixColumn(a,1).length();a=this.setFromMatrixColumn(a,2).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){return this.fromArray(a.elements,4*b)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromBufferAttribute:function(a,b,c){void 0!==\nc&&console.warn(\"THREE.Vector3: offset has been removed from .fromBufferAttribute().\");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this}});Object.assign(la.prototype,{isMatrix3:!0,set:function(a,b,c,d,e,f,g,h,l){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=h;m[6]=c;m[7]=f;m[8]=l;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;\nb[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this},applyToBufferAttribute:function(){var a=new p;return function(b){for(var c=0,d=b.count;c<d;c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix3(this),b.setXYZ(c,a.x,a.y,a.z);return b}}(),multiply:function(a){return this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,\nthis)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;b=this.elements;a=c[0];var e=c[3],f=c[6],g=c[1],h=c[4],l=c[7],m=c[2],k=c[5];c=c[8];var n=d[0],t=d[3],q=d[6],p=d[1],u=d[4],y=d[7],w=d[2],x=d[5];d=d[8];b[0]=a*n+e*p+f*w;b[3]=a*t+e*u+f*x;b[6]=a*q+e*y+f*d;b[1]=g*n+h*p+l*w;b[4]=g*t+h*u+l*x;b[7]=g*q+h*y+l*d;b[2]=m*n+k*p+c*w;b[5]=m*t+k*u+c*x;b[8]=m*q+k*y+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=\na;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],l=a[7];a=a[8];return b*f*a-b*g*l-c*e*a+c*g*h+d*e*l-d*f*h},getInverse:function(a,b){a&&a.isMatrix4&&console.error(\"THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.\");var c=a.elements;a=this.elements;var d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],l=c[5],m=c[6],k=c[7];c=c[8];var n=c*h-l*k,p=l*m-c*g,q=k*g-h*m,r=d*n+e*p+f*q;if(0===r){if(!0===b)throw Error(\"THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0\");\nconsole.warn(\"THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0\");return this.identity()}b=1/r;a[0]=n*b;a[1]=(f*k-c*e)*b;a[2]=(l*e-f*h)*b;a[3]=p*b;a[4]=(c*d-f*m)*b;a[5]=(f*g-l*d)*b;a[6]=q*b;a[7]=(e*m-k*d)*b;a[8]=(h*d-e*g)*b;return this},transpose:function(){var a=this.elements;var b=a[1];a[1]=a[3];a[3]=b;b=a[2];a[2]=a[6];a[6]=b;b=a[5];a[5]=a[7];a[7]=b;return this},getNormalMatrix:function(a){return this.setFromMatrix4(a).getInverse(this).transpose()},transposeIntoArray:function(a){var b=\nthis.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},setUvTransform:function(a,b,c,d,e,f,g){var h=Math.cos(e);e=Math.sin(e);this.set(c*h,c*e,-c*(h*f+e*g)+f+a,-d*e,d*h,-d*(-e*f+h*g)+g+b,0,0,1)},scale:function(a,b){var c=this.elements;c[0]*=a;c[3]*=a;c[6]*=a;c[1]*=b;c[4]*=b;c[7]*=b;return this},rotate:function(a){var b=Math.cos(a);a=Math.sin(a);var c=this.elements,d=c[0],e=c[3],f=c[6],g=c[1],h=c[4],l=c[7];c[0]=b*d+a*g;c[3]=b*e+a*h;c[6]=\nb*f+a*l;c[1]=-a*d+b*g;c[4]=-a*e+b*h;c[7]=-a*f+b*l;return this},translate:function(a,b){var c=this.elements;c[0]+=a*c[2];c[3]+=a*c[5];c[6]+=a*c[8];c[1]+=b*c[2];c[4]+=b*c[5];c[7]+=b*c[8];return this},equals:function(a){var b=this.elements;a=a.elements;for(var c=0;9>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];\na[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}});var Ff=0;ea.DEFAULT_IMAGE=void 0;ea.DEFAULT_MAPPING=300;ea.prototype=Object.assign(Object.create(za.prototype),{constructor:ea,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(a){this.name=a.name;this.image=a.image;this.mipmaps=\na.mipmaps.slice(0);this.mapping=a.mapping;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy=a.anisotropy;this.format=a.format;this.type=a.type;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.center.copy(a.center);this.rotation=a.rotation;this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrix.copy(a.matrix);this.generateMipmaps=a.generateMipmaps;this.premultiplyAlpha=a.premultiplyAlpha;this.flipY=a.flipY;this.unpackAlignment=a.unpackAlignment;\nthis.encoding=a.encoding;return this},toJSON:function(a){function b(a){if(a instanceof HTMLCanvasElement)var b=a;else{b=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\");b.width=a.width;b.height=a.height;var c=b.getContext(\"2d\");a instanceof ImageData?c.putImageData(a,0,0):c.drawImage(a,0,0,a.width,a.height)}return 2048<b.width||2048<b.height?b.toDataURL(\"image/jpeg\",.6):b.toDataURL(\"image/png\")}var c=void 0===a||\"string\"===typeof a;if(!c&&void 0!==a.textures[this.uuid])return a.textures[this.uuid];\nvar d={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,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var e=this.image;void 0===e.uuid&&(e.uuid=J.generateUUID());if(!c&&void 0===a.images[e.uuid]){if(Array.isArray(e)){var f=\n[];for(var g=0,h=e.length;g<h;g++)f.push(b(e[g]))}else f=b(e);a.images[e.uuid]={uuid:e.uuid,url:f}}d.image=e.uuid}c||(a.textures[this.uuid]=d);return d},dispose:function(){this.dispatchEvent({type:\"dispose\"})},transformUv:function(a){if(300===this.mapping){a.applyMatrix3(this.matrix);if(0>a.x||1<a.x)switch(this.wrapS){case 1E3:a.x-=Math.floor(a.x);break;case 1001:a.x=0>a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0>a.y||1<a.y)switch(this.wrapT){case 1E3:a.y-=\nMath.floor(a.y);break;case 1001:a.y=0>a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y)}}});Object.defineProperty(ea.prototype,\"needsUpdate\",{set:function(a){!0===a&&this.version++}});Object.assign(W.prototype,{isVector4:!0,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},\nsetZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error(\"index is out of range: \"+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(\"index is out of range: \"+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,\nthis.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addScaledVector:function(a,\nb){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;this.w-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=\na;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/\nb);return this},setAxisAngleFromRotationMatrix:function(a){a=a.elements;var b=a[0];var c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9];var h=a[2];var l=a[6];var m=a[10];if(.01>Math.abs(c-e)&&.01>Math.abs(d-h)&&.01>Math.abs(g-l)){if(.1>Math.abs(c+e)&&.1>Math.abs(d+h)&&.1>Math.abs(g+l)&&.1>Math.abs(b+f+m-3))return this.set(1,0,0,0),this;a=Math.PI;b=(b+1)/2;f=(f+1)/2;m=(m+1)/2;c=(c+e)/4;d=(d+h)/4;g=(g+l)/4;b>f&&b>m?.01>b?(l=0,c=h=.707106781):(l=Math.sqrt(b),h=c/l,c=d/l):f>m?.01>f?(l=.707106781,h=0,c=.707106781):\n(h=Math.sqrt(f),l=c/h,c=g/h):.01>m?(h=l=.707106781,c=0):(c=Math.sqrt(m),l=d/c,h=g/c);this.set(l,h,c,a);return this}a=Math.sqrt((l-g)*(l-g)+(d-h)*(d-h)+(e-c)*(e-c));.001>Math.abs(a)&&(a=1);this.x=(l-g)/a;this.y=(d-h)/a;this.z=(e-c)/a;this.w=Math.acos((b+f+m-1)/2);return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);this.w=Math.min(this.w,a.w);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,\na.z);this.w=Math.max(this.w,a.w);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));this.w=Math.max(a.w,Math.min(b.w,this.w));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new W,b=new W);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},\nfloor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):\nMath.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+\nMath.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===\nb&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn(\"THREE.Vector4: offset has been removed from .fromBufferAttribute().\");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}});kb.prototype=Object.assign(Object.create(za.prototype),{constructor:kb,isWebGLRenderTarget:!0,\nsetSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport);this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:\"dispose\"})}});\nLb.prototype=Object.create(kb.prototype);Lb.prototype.constructor=Lb;Lb.prototype.isWebGLRenderTargetCube=!0;lb.prototype=Object.create(ea.prototype);lb.prototype.constructor=lb;lb.prototype.isDataTexture=!0;Object.assign(Xa.prototype,{isBox3:!0,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromArray:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.length;h<l;h+=3){var m=a[h],k=a[h+1],n=a[h+2];m<b&&(b=m);k<c&&(c=k);n<d&&(d=n);m>\ne&&(e=m);k>f&&(f=k);n>g&&(g=n)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.count;h<l;h++){var m=a.getX(h),k=a.getY(h),n=a.getZ(h);m<b&&(b=m);k<c&&(c=k);n<d&&(d=n);m>e&&(e=m);k>f&&(f=k);n>g&&(g=n)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=\nnew p;return function(b,c){c=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(c);this.max.copy(b).add(c);return this}}(),setFromObject:function(a){this.makeEmpty();return this.expandByObject(a)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=this.min.z=Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<\nthis.min.y||this.max.z<this.min.z},getCenter:function(a){void 0===a&&(console.warn(\"THREE.Box3: .getCenter() target is now required\"),a=new p);return this.isEmpty()?a.set(0,0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(a){void 0===a&&(console.warn(\"THREE.Box3: .getSize() target is now required\"),a=new p);return this.isEmpty()?a.set(0,0,0):a.subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);\nthis.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},expandByObject:function(){function a(a){var f=a.geometry;if(void 0!==f)if(f.isGeometry)for(f=f.vertices,c=0,d=f.length;c<d;c++)e.copy(f[c]),e.applyMatrix4(a.matrixWorld),b.expandByPoint(e);else if(f.isBufferGeometry&&(f=f.attributes.position,void 0!==f))for(c=0,d=f.count;c<d;c++)e.fromBufferAttribute(f,c).applyMatrix4(a.matrixWorld),b.expandByPoint(e)}var b,c,d,e=new p;return function(c){b=\nthis;c.updateMatrixWorld(!0);c.traverse(a);return this}}(),containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y||a.z<this.min.z||a.z>this.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getParameter:function(a,b){void 0===b&&(console.warn(\"THREE.Box3: .getParameter() target is now required\"),b=new p);return b.set((a.x-this.min.x)/(this.max.x-\nthis.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y||a.max.z<this.min.z||a.min.z>this.max.z?!1:!0},intersectsSphere:function(){var a=new p;return function(b){this.clampPoint(b.center,a);return a.distanceToSquared(b.center)<=b.radius*b.radius}}(),intersectsPlane:function(a){if(0<a.normal.x){var b=a.normal.x*this.min.x;var c=a.normal.x*this.max.x}else b=\na.normal.x*this.max.x,c=a.normal.x*this.min.x;0<a.normal.y?(b+=a.normal.y*this.min.y,c+=a.normal.y*this.max.y):(b+=a.normal.y*this.max.y,c+=a.normal.y*this.min.y);0<a.normal.z?(b+=a.normal.z*this.min.z,c+=a.normal.z*this.max.z):(b+=a.normal.z*this.max.z,c+=a.normal.z*this.min.z);return b<=a.constant&&c>=a.constant},intersectsTriangle:function(){function a(a){var e;var f=0;for(e=a.length-3;f<=e;f+=3){h.fromArray(a,f);var g=m.x*Math.abs(h.x)+m.y*Math.abs(h.y)+m.z*Math.abs(h.z),l=b.dot(h),k=c.dot(h),\nn=d.dot(h);if(Math.max(-Math.max(l,k,n),Math.min(l,k,n))>g)return!1}return!0}var b=new p,c=new p,d=new p,e=new p,f=new p,g=new p,h=new p,l=new p,m=new p,k=new p;return function(h){if(this.isEmpty())return!1;this.getCenter(l);m.subVectors(this.max,l);b.subVectors(h.a,l);c.subVectors(h.b,l);d.subVectors(h.c,l);e.subVectors(c,b);f.subVectors(d,c);g.subVectors(b,d);h=[0,-e.z,e.y,0,-f.z,f.y,0,-g.z,g.y,e.z,0,-e.x,f.z,0,-f.x,g.z,0,-g.x,-e.y,e.x,0,-f.y,f.x,0,-g.y,g.x,0];if(!a(h))return!1;h=[1,0,0,0,1,0,0,\n0,1];if(!a(h))return!1;k.crossVectors(e,f);h=[k.x,k.y,k.z];return a(h)}}(),clampPoint:function(a,b){void 0===b&&(console.warn(\"THREE.Box3: .clampPoint() target is now required\"),b=new p);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new p;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new p;return function(b){void 0===b&&(console.warn(\"THREE.Box3: .getBoundingSphere() target is now required\"),b=new Ha);\nthis.getCenter(b.center);b.radius=.5*this.getSize(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(a){if(this.isEmpty())return this;a=a.elements;var b=a[0]*this.min.x,c=a[1]*this.min.x,d=a[2]*this.min.x,e=a[0]*this.max.x,f=a[1]*this.max.x,g=a[2]*this.max.x,h=a[4]*this.min.y,l=a[5]*this.min.y,m=a[6]*this.min.y,k=a[4]*this.max.y,\nn=a[5]*this.max.y,p=a[6]*this.max.y,q=a[8]*this.min.z,r=a[9]*this.min.z,u=a[10]*this.min.z,y=a[8]*this.max.z,w=a[9]*this.max.z,x=a[10]*this.max.z;this.min.x=Math.min(b,e)+Math.min(h,k)+Math.min(q,y)+a[12];this.min.y=Math.min(c,f)+Math.min(l,n)+Math.min(r,w)+a[13];this.min.z=Math.min(d,g)+Math.min(m,p)+Math.min(u,x)+a[14];this.max.x=Math.max(b,e)+Math.max(h,k)+Math.max(q,y)+a[12];this.max.y=Math.max(c,f)+Math.max(l,n)+Math.max(r,w)+a[13];this.max.z=Math.max(d,g)+Math.max(m,p)+Math.max(u,x)+a[14];return this},\ntranslate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});Object.assign(Ha.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new Xa;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).getCenter(d);for(var e=c=0,f=b.length;e<f;e++)c=Math.max(c,d.distanceToSquared(b[e]));this.radius=Math.sqrt(c);return this}}(),clone:function(){return(new this.constructor).copy(this)},\ncopy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(a.distanceToPoint(this.center))<=\nthis.radius},clampPoint:function(a,b){var c=this.center.distanceToSquared(a);void 0===b&&(console.warn(\"THREE.Sphere: .clampPoint() target is now required\"),b=new p);b.copy(a);c>this.radius*this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center));return b},getBoundingBox:function(a){void 0===a&&(console.warn(\"THREE.Sphere: .getBoundingBox() target is now required\"),a=new Xa);a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);\nthis.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}});Object.assign(Ia.prototype,{set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=\nnew p,b=new p;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,c);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+\nthis.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){void 0===b&&(console.warn(\"THREE.Plane: .projectPoint() target is now required\"),b=new p);return b.copy(this.normal).multiplyScalar(-this.distanceToPoint(a)).add(a)},intersectLine:function(){var a=new p;return function(b,c){void 0===c&&(console.warn(\"THREE.Plane: .intersectLine() target is now required\"),c=new p);var d=b.delta(a),e=this.normal.dot(d);if(0===e){if(0===this.distanceToPoint(b.start))return c.copy(b.start)}else if(e=\n-(b.start.dot(this.normal)+this.constant)/e,!(0>e||1<e))return c.copy(d).multiplyScalar(e).add(b.start)}}(),intersectsLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0<a||0>a&&0<b},intersectsBox:function(a){return a.intersectsPlane(this)},intersectsSphere:function(a){return a.intersectsPlane(this)},coplanarPoint:function(a){void 0===a&&(console.warn(\"THREE.Plane: .coplanarPoint() target is now required\"),a=new p);return a.copy(this.normal).multiplyScalar(-this.constant)},\napplyMatrix4:function(){var a=new p,b=new la;return function(c,d){d=d||b.getNormalMatrix(c);c=this.coplanarPoint(a).applyMatrix4(c);d=this.normal.applyMatrix3(d).normalize();this.constant=-c.dot(d);return this}}(),translate:function(a){this.constant-=a.dot(this.normal);return this},equals:function(a){return a.normal.equals(this.normal)&&a.constant===this.constant}});Object.assign(td.prototype,{set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);\ng[5].copy(f);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],m=c[7],k=c[8],n=c[9],p=c[10],q=c[11],r=c[12],u=c[13],y=c[14];c=c[15];b[0].setComponents(f-a,m-g,q-k,c-r).normalize();b[1].setComponents(f+a,m+g,q+k,c+r).normalize();b[2].setComponents(f+d,m+h,q+n,c+u).normalize();b[3].setComponents(f-\nd,m-h,q-n,c-u).normalize();b[4].setComponents(f-e,m-l,q-p,c-y).normalize();b[5].setComponents(f+e,m+l,q+p,c+y).normalize();return this},intersectsObject:function(){var a=new Ha;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSprite:function(){var a=new Ha;return function(b){a.center.set(0,0,0);a.radius=.7071067811865476;a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),\nintersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new p,b=new p;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var g=f.distanceToPoint(a);f=f.distanceToPoint(b);if(0>\ng&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});var S={alphamap_fragment:\"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\\n#endif\\n\",alphamap_pars_fragment:\"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\\n\",alphatest_fragment:\"#ifdef ALPHATEST\\n\\tif ( diffuseColor.a < ALPHATEST ) discard;\\n#endif\\n\",aomap_fragment:\"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\\n\\t#endif\\n#endif\\n\",\naomap_pars_fragment:\"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\",begin_vertex:\"\\nvec3 transformed = vec3( position );\\n\",beginnormal_vertex:\"\\nvec3 objectNormal = vec3( normal );\\n\",bsdfs:\"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\\tif( decayExponent > 0.0 ) {\\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\treturn distanceFalloff * maxDistanceCutoffFactor;\\n#else\\n\\t\\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n#endif\\n\\t}\\n\\treturn 1.0;\\n}\\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\\n\\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\\n\\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\\n\\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\\n}\\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\treturn 1.0 / ( gl * gv );\\n}\\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\\n\\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\\n\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\\n\\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, dotLH );\\n\\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\tfloat D = D_GGX( alpha, dotNH );\\n\\treturn F * ( G * D );\\n}\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\n\\tconst float LUT_SIZE  = 64.0;\\n\\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\\n\\tconst float LUT_BIAS  = 0.5 / LUT_SIZE;\\n\\tfloat dotNV = saturate( dot( N, V ) );\\n\\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\\tfloat l = length( f );\\n\\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\\tfloat x = dot( v1, v2 );\\n\\tfloat y = abs( x );\\n\\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\\n\\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\\n\\tfloat v = a / b;\\n\\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\\tvec3 lightNormal = cross( v1, v2 );\\n\\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\\tvec3 T1, T2;\\n\\tT1 = normalize( V - N * dot( V, N ) );\\n\\tT2 = - cross( N, T1 );\\n\\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\\n\\tvec3 coords[ 4 ];\\n\\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\\tvec3 vectorFormFactor = vec3( 0.0 );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\\treturn vec3( result );\\n}\\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\\tvec4 r = roughness * c0 + c1;\\n\\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\\n\\treturn specularColor * AB.x + AB.y;\\n}\\nfloat G_BlinnPhong_Implicit( ) {\\n\\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\\n\\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\\n\\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\\n\\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, dotLH );\\n\\tfloat G = G_BlinnPhong_Implicit( );\\n\\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\\treturn F * ( G * D );\\n}\\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\\n\\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\\n}\\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\\n\\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\\n}\\n\",\nbumpmap_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\\n\",\nclipping_planes_fragment:\"#if NUM_CLIPPING_PLANES > 0\\n\\tvec4 plane;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\tplane = clippingPlanes[ i ];\\n\\t\\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\\n\\t}\\n\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\tbool clipped = true;\\n\\t\\t#pragma unroll_loop\\n\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t}\\n\\t\\tif ( clipped ) discard;\\n\\t#endif\\n#endif\\n\",\nclipping_planes_pars_fragment:\"#if NUM_CLIPPING_PLANES > 0\\n\\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\\n\\t\\tvarying vec3 vViewPosition;\\n\\t#endif\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\\n\",clipping_planes_pars_vertex:\"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n\",clipping_planes_vertex:\"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n\",\ncolor_fragment:\"#ifdef USE_COLOR\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\",color_pars_fragment:\"#ifdef USE_COLOR\\n\\tvarying vec3 vColor;\\n#endif\\n\",color_pars_vertex:\"#ifdef USE_COLOR\\n\\tvarying vec3 vColor;\\n#endif\",color_vertex:\"#ifdef USE_COLOR\\n\\tvColor.xyz = color.xyz;\\n#endif\",common:\"#define PI 3.14159265359\\n#define PI2 6.28318530718\\n#define PI_HALF 1.5707963267949\\n#define RECIPROCAL_PI 0.31830988618\\n#define RECIPROCAL_PI2 0.15915494\\n#define LOG2 1.442695\\n#define EPSILON 1e-6\\n#define saturate(a) clamp( a, 0.0, 1.0 )\\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\\treturn fract(sin(sn) * c);\\n}\\nstruct IncidentLight {\\n\\tvec3 color;\\n\\tvec3 direction;\\n\\tbool visible;\\n};\\nstruct ReflectedLight {\\n\\tvec3 directDiffuse;\\n\\tvec3 directSpecular;\\n\\tvec3 indirectDiffuse;\\n\\tvec3 indirectSpecular;\\n};\\nstruct GeometricContext {\\n\\tvec3 position;\\n\\tvec3 normal;\\n\\tvec3 viewDir;\\n};\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\\n\\tfloat distance = dot( planeNormal, point - pointOnPlane );\\n\\treturn - distance * planeNormal + point;\\n}\\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\\n\\treturn sign( dot( point - pointOnPlane, planeNormal ) );\\n}\\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\\n\\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\\n}\\nmat3 transposeMat3( const in mat3 m ) {\\n\\tmat3 tmp;\\n\\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\\n\\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\\n\\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\\n\\treturn tmp;\\n}\\nfloat linearToRelativeLuminance( const in vec3 color ) {\\n\\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\\n\\treturn dot( weights, color.rgb );\\n}\\n\",\ncube_uv_reflection_fragment:\"#ifdef ENVMAP_TYPE_CUBE_UV\\n#define cubeUV_textureSize (1024.0)\\nint getFaceFromDirection(vec3 direction) {\\n\\tvec3 absDirection = abs(direction);\\n\\tint face = -1;\\n\\tif( absDirection.x > absDirection.z ) {\\n\\t\\tif(absDirection.x > absDirection.y )\\n\\t\\t\\tface = direction.x > 0.0 ? 0 : 3;\\n\\t\\telse\\n\\t\\t\\tface = direction.y > 0.0 ? 1 : 4;\\n\\t}\\n\\telse {\\n\\t\\tif(absDirection.z > absDirection.y )\\n\\t\\t\\tface = direction.z > 0.0 ? 2 : 5;\\n\\t\\telse\\n\\t\\t\\tface = direction.y > 0.0 ? 1 : 4;\\n\\t}\\n\\treturn face;\\n}\\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\\n\\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\\n\\tfloat dxRoughness = dFdx(roughness);\\n\\tfloat dyRoughness = dFdy(roughness);\\n\\tvec3 dx = dFdx( vec * scale * dxRoughness );\\n\\tvec3 dy = dFdy( vec * scale * dyRoughness );\\n\\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\\n\\td = clamp(d, 1.0, cubeUV_rangeClamp);\\n\\tfloat mipLevel = 0.5 * log2(d);\\n\\treturn vec2(floor(mipLevel), fract(mipLevel));\\n}\\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\\n\\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\\n\\tfloat a = 16.0 * cubeUV_rcpTextureSize;\\n\\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\\n\\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\\n\\tfloat powScale = exp2_packed.x * exp2_packed.y;\\n\\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\\n\\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\\n\\tbool bRes = mipLevel == 0.0;\\n\\tscale =  bRes && (scale < a) ? a : scale;\\n\\tvec3 r;\\n\\tvec2 offset;\\n\\tint face = getFaceFromDirection(direction);\\n\\tfloat rcpPowScale = 1.0 / powScale;\\n\\tif( face == 0) {\\n\\t\\tr = vec3(direction.x, -direction.z, direction.y);\\n\\t\\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\\n\\t}\\n\\telse if( face == 1) {\\n\\t\\tr = vec3(direction.y, direction.x, direction.z);\\n\\t\\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\\n\\t}\\n\\telse if( face == 2) {\\n\\t\\tr = vec3(direction.z, direction.x, direction.y);\\n\\t\\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\\n\\t}\\n\\telse if( face == 3) {\\n\\t\\tr = vec3(direction.x, direction.z, direction.y);\\n\\t\\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\\n\\t}\\n\\telse if( face == 4) {\\n\\t\\tr = vec3(direction.y, direction.x, -direction.z);\\n\\t\\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\\n\\t}\\n\\telse {\\n\\t\\tr = vec3(direction.z, -direction.x, direction.y);\\n\\t\\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\\n\\t}\\n\\tr = normalize(r);\\n\\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\\n\\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\\n\\tvec2 base = offset + vec2( texelOffset );\\n\\treturn base + s * ( scale - 2.0 * texelOffset );\\n}\\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\\n\\tfloat roughnessVal = roughness* cubeUV_maxLods3;\\n\\tfloat r1 = floor(roughnessVal);\\n\\tfloat r2 = r1 + 1.0;\\n\\tfloat t = fract(roughnessVal);\\n\\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\\n\\tfloat s = mipInfo.y;\\n\\tfloat level0 = mipInfo.x;\\n\\tfloat level1 = level0 + 1.0;\\n\\tlevel1 = level1 > 5.0 ? 5.0 : level1;\\n\\tlevel0 += min( floor( s + 0.5 ), 5.0 );\\n\\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\\n\\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\\n\\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\\n\\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\\n\\tvec4 result = mix(color10, color20, t);\\n\\treturn vec4(result.rgb, 1.0);\\n}\\n#endif\\n\",\ndefaultnormal_vertex:\"vec3 transformedNormal = normalMatrix * objectNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\n\",displacementmap_pars_vertex:\"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\\n\",displacementmap_vertex:\"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\\n#endif\\n\",\nemissivemap_fragment:\"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\\n\\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\\n\",emissivemap_pars_fragment:\"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\\n\",encodings_fragment:\"  gl_FragColor = linearToOutputTexel( gl_FragColor );\\n\",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.xyz, vec3( gammaFactor ) ), value.w );\\n}\\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\\n}\\nvec4 sRGBToLinear( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\\n}\\nvec4 LinearTosRGB( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\\n}\\nvec4 RGBEToLinear( in vec4 value ) {\\n\\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\\n}\\nvec4 LinearToRGBE( in vec4 value ) {\\n\\tfloat maxComponent = max( max( value.r, value.g ), value.b );\\n\\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\\n\\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\\n}\\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\\n}\\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\\n\\tfloat M      = clamp( maxRGB / maxRange, 0.0, 1.0 );\\n\\tM            = ceil( M * 255.0 ) / 255.0;\\n\\treturn vec4( value.rgb / ( M * maxRange ), M );\\n}\\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\\n}\\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\\n\\tfloat D      = max( maxRange / maxRGB, 1.0 );\\n\\tD            = min( floor( D ) / 255.0, 1.0 );\\n\\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\\n}\\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\\nvec4 LinearToLogLuv( in vec4 value )  {\\n\\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\\n\\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\\n\\tvec4 vResult;\\n\\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\\n\\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\\n\\tvResult.w = fract(Le);\\n\\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\\n\\treturn vResult;\\n}\\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\\nvec4 LogLuvToLinear( in vec4 value ) {\\n\\tfloat Le = value.z * 255.0 + value.w;\\n\\tvec3 Xp_Y_XYZp;\\n\\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\\n\\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\\n\\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\\n\\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\\n\\treturn vec4( max(vRGB, 0.0), 1.0 );\\n}\\n\",\nenvmap_fragment:\"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\\n\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#else\\n\\t\\tvec3 reflectVec = vReflect;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t#elif defined( ENVMAP_TYPE_EQUIREC )\\n\\t\\tvec2 sampleUV;\\n\\t\\treflectVec = normalize( reflectVec );\\n\\t\\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\t\\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\\n\\t\\tvec4 envColor = texture2D( envMap, sampleUV );\\n\\t#elif defined( ENVMAP_TYPE_SPHERE )\\n\\t\\treflectVec = normalize( reflectVec );\\n\\t\\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\\n\\t\\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\\n\\t#else\\n\\t\\tvec4 envColor = vec4( 0.0 );\\n\\t#endif\\n\\tenvColor = envMapTexelToLinear( envColor );\\n\\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\\t\\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_MIX )\\n\\t\\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_ADD )\\n\\t\\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\\t#endif\\n#endif\\n\",\nenvmap_pars_fragment:\"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\\n\\tuniform float reflectivity;\\n\\tuniform float envMapIntensity;\\n#endif\\n#ifdef USE_ENVMAP\\n\\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tuniform samplerCube envMap;\\n\\t#else\\n\\t\\tuniform sampler2D envMap;\\n\\t#endif\\n\\tuniform float flipEnvMap;\\n\\tuniform int maxMipLevel;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\\n\\t\\tuniform float refractionRatio;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t#endif\\n#endif\\n\",\nenvmap_pars_vertex:\"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n#endif\\n\",envmap_vertex:\"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\tvWorldPosition = worldPosition.xyz;\\n\\t#else\\n\\t\\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\t\\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#endif\\n#endif\\n\",\nfog_vertex:\"\\n#ifdef USE_FOG\\nfogDepth = -mvPosition.z;\\n#endif\",fog_pars_vertex:\"#ifdef USE_FOG\\n  varying float fogDepth;\\n#endif\\n\",fog_fragment:\"#ifdef USE_FOG\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\\n\\t#endif\\n\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\\n\",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\\n\",\ngradientmap_pars_fragment:\"#ifdef TOON\\n\\tuniform sampler2D gradientMap;\\n\\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\\t\\tfloat dotNL = dot( normal, lightDirection );\\n\\t\\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\\t\\t#ifdef USE_GRADIENTMAP\\n\\t\\t\\treturn texture2D( gradientMap, coord ).rgb;\\n\\t\\t#else\\n\\t\\t\\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\\n\\t\\t#endif\\n\\t}\\n#endif\\n\",lightmap_fragment:\"#ifdef USE_LIGHTMAP\\n\\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\\n#endif\\n\",\nlightmap_pars_fragment:\"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\",lights_lambert_vertex:\"vec3 diffuse = vec3( 1.0 );\\nGeometricContext geometry;\\ngeometry.position = mvPosition.xyz;\\ngeometry.normal = normalize( transformedNormal );\\ngeometry.viewDir = normalize( -mvPosition.xyz );\\nGeometricContext backGeometry;\\nbackGeometry.position = geometry.position;\\nbackGeometry.normal = -geometry.normal;\\nbackGeometry.viewDir = geometry.viewDir;\\nvLightFront = vec3( 0.0 );\\n#ifdef DOUBLE_SIDED\\n\\tvLightBack = vec3( 0.0 );\\n#endif\\nIncidentLight directLight;\\nfloat dotNL;\\nvec3 directLightColor_Diffuse;\\n#if NUM_POINT_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = PI * directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = PI * directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n#endif\\n#if NUM_DIR_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = PI * directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\\n\\t\\t#endif\\n\\t}\\n#endif\\n\",\nlights_pars_begin:\"uniform vec3 ambientLightColor;\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\\tvec3 irradiance = ambientLightColor;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tirradiance *= PI;\\n\\t#endif\\n\\treturn irradiance;\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\\tstruct DirectionalLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tint shadow;\\n\\t\\tfloat shadowBias;\\n\\t\\tfloat shadowRadius;\\n\\t\\tvec2 shadowMapSize;\\n\\t};\\n\\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\\n\\t\\tdirectLight.color = directionalLight.color;\\n\\t\\tdirectLight.direction = directionalLight.direction;\\n\\t\\tdirectLight.visible = true;\\n\\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\tstruct PointLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tint shadow;\\n\\t\\tfloat shadowBias;\\n\\t\\tfloat shadowRadius;\\n\\t\\tvec2 shadowMapSize;\\n\\t\\tfloat shadowCameraNear;\\n\\t\\tfloat shadowCameraFar;\\n\\t};\\n\\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\\n\\t\\tvec3 lVector = pointLight.position - geometry.position;\\n\\t\\tdirectLight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tdirectLight.color = pointLight.color;\\n\\t\\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\\n\\t\\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\tstruct SpotLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tfloat coneCos;\\n\\t\\tfloat penumbraCos;\\n\\t\\tint shadow;\\n\\t\\tfloat shadowBias;\\n\\t\\tfloat shadowRadius;\\n\\t\\tvec2 shadowMapSize;\\n\\t};\\n\\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\\n\\t\\tvec3 lVector = spotLight.position - geometry.position;\\n\\t\\tdirectLight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tfloat angleCos = dot( directLight.direction, spotLight.direction );\\n\\t\\tif ( angleCos > spotLight.coneCos ) {\\n\\t\\t\\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\\t\\t\\tdirectLight.color = spotLight.color;\\n\\t\\t\\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\\n\\t\\t\\tdirectLight.visible = true;\\n\\t\\t} else {\\n\\t\\t\\tdirectLight.color = vec3( 0.0 );\\n\\t\\t\\tdirectLight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tstruct RectAreaLight {\\n\\t\\tvec3 color;\\n\\t\\tvec3 position;\\n\\t\\tvec3 halfWidth;\\n\\t\\tvec3 halfHeight;\\n\\t};\\n\\tuniform sampler2D ltc_1;\\tuniform sampler2D ltc_2;\\n\\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tstruct HemisphereLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 skyColor;\\n\\t\\tvec3 groundColor;\\n\\t};\\n\\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\\n\\t\\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\\t\\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tirradiance *= PI;\\n\\t\\t#endif\\n\\t\\treturn irradiance;\\n\\t}\\n#endif\\n\",\nlights_pars_maps:\"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\\n\\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\\n\\t\\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\t\\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\\n\\t\\t#else\\n\\t\\t\\tvec4 envMapColor = vec4( 0.0 );\\n\\t\\t#endif\\n\\t\\treturn PI * envMapColor.rgb * envMapIntensity;\\n\\t}\\n\\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\\n\\t\\tfloat maxMIPLevelScalar = float( maxMIPLevel );\\n\\t\\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\\n\\t\\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\\n\\t}\\n\\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\\n\\t\\t#endif\\n\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\t\\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\\n\\t\\t#elif defined( ENVMAP_TYPE_EQUIREC )\\n\\t\\t\\tvec2 sampleUV;\\n\\t\\t\\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\t\\t\\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#elif defined( ENVMAP_TYPE_SPHERE )\\n\\t\\t\\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#endif\\n\\t\\treturn envMapColor.rgb * envMapIntensity;\\n\\t}\\n#endif\\n\",\nlights_phong_fragment:\"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\\n\",lights_phong_pars_fragment:\"varying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\nstruct BlinnPhongMaterial {\\n\\tvec3\\tdiffuseColor;\\n\\tvec3\\tspecularColor;\\n\\tfloat\\tspecularShininess;\\n\\tfloat\\tspecularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t#ifdef TOON\\n\\t\\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\\n\\t#else\\n\\t\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\t\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#endif\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tirradiance *= PI;\\n\\t#endif\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_BlinnPhong\\n#define Material_LightProbeLOD( material )\\t(0)\\n\",\nlights_physical_fragment:\"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\\n#ifdef STANDARD\\n\\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\\n#else\\n\\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\\n\\tmaterial.clearCoat = saturate( clearCoat );\\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\\n#endif\\n\",\nlights_physical_pars_fragment:\"struct PhysicalMaterial {\\n\\tvec3\\tdiffuseColor;\\n\\tfloat\\tspecularRoughness;\\n\\tvec3\\tspecularColor;\\n\\t#ifndef STANDARD\\n\\t\\tfloat clearCoat;\\n\\t\\tfloat clearCoatRoughness;\\n\\t#endif\\n};\\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\\n\\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t\\tvec3 normal = geometry.normal;\\n\\t\\tvec3 viewDir = geometry.viewDir;\\n\\t\\tvec3 position = geometry.position;\\n\\t\\tvec3 lightPos = rectAreaLight.position;\\n\\t\\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\\t\\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\\t\\tvec3 lightColor = rectAreaLight.color;\\n\\t\\tfloat roughness = material.specularRoughness;\\n\\t\\tvec3 rectCoords[ 4 ];\\n\\t\\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\\t\\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\\n\\t\\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\\n\\t\\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\\n\\t\\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\\t\\tvec4 t1 = texture2D( ltc_1, uv );\\n\\t\\tvec4 t2 = texture2D( ltc_2, uv );\\n\\t\\tmat3 mInv = mat3(\\n\\t\\t\\tvec3( t1.x, 0, t1.y ),\\n\\t\\t\\tvec3(    0, 1,    0 ),\\n\\t\\t\\tvec3( t1.z, 0, t1.w )\\n\\t\\t);\\n\\t\\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\\n\\t\\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\\t\\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tirradiance *= PI;\\n\\t#endif\\n\\t#ifndef STANDARD\\n\\t\\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\\n\\t#else\\n\\t\\tfloat clearCoatDHR = 0.0;\\n\\t#endif\\n\\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\\n\\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n\\t#ifndef STANDARD\\n\\t\\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\\n\\t#endif\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t#ifndef STANDARD\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\tfloat dotNL = dotNV;\\n\\t\\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\\n\\t#else\\n\\t\\tfloat clearCoatDHR = 0.0;\\n\\t#endif\\n\\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\\n\\t#ifndef STANDARD\\n\\t\\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\\n\\t#endif\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Physical\\n#define RE_Direct_RectArea\\t\\tRE_Direct_RectArea_Physical\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\\t\\tRE_IndirectSpecular_Physical\\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\\n#define Material_ClearCoat_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\\n\",\nlights_fragment_begin:\"\\nGeometricContext geometry;\\ngeometry.position = - vViewPosition;\\ngeometry.normal = normal;\\ngeometry.viewDir = normalize( vViewPosition );\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tPointLight pointLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\\n\\t\\t#ifdef USE_SHADOWMAP\\n\\t\\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tSpotLight spotLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\\n\\t\\t#ifdef USE_SHADOWMAP\\n\\t\\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tDirectionalLight directionalLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\\n\\t\\t#ifdef USE_SHADOWMAP\\n\\t\\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\\tRectAreaLight rectAreaLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\\t\\trectAreaLight = rectAreaLights[ i ];\\n\\t\\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\\t\\t#pragma unroll_loop\\n\\t\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\\n\\t\\t}\\n\\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tvec3 radiance = vec3( 0.0 );\\n\\tvec3 clearCoatRadiance = vec3( 0.0 );\\n#endif\\n\",\nlights_fragment_maps:\"#if defined( RE_IndirectDiffuse )\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tlightMapIrradiance *= PI;\\n\\t\\t#endif\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\\n\\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\\n\\t#ifndef STANDARD\\n\\t\\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\\n\\t#endif\\n#endif\\n\",\nlights_fragment_end:\"#if defined( RE_IndirectDiffuse )\\n\\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\\n#endif\\n\",logdepthbuf_fragment:\"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\",logdepthbuf_pars_fragment:\"#ifdef USE_LOGDEPTHBUF\\n\\tuniform float logDepthBufFC;\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t#endif\\n#endif\\n\",\nlogdepthbuf_pars_vertex:\"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t#endif\\n\\tuniform float logDepthBufFC;\\n#endif\",logdepthbuf_vertex:\"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\t#else\\n\\t\\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\\n\\t\\tgl_Position.z *= gl_Position.w;\\n\\t#endif\\n#endif\\n\",map_fragment:\"#ifdef USE_MAP\\n\\tvec4 texelColor = texture2D( map, vUv );\\n\\ttexelColor = mapTexelToLinear( texelColor );\\n\\tdiffuseColor *= texelColor;\\n#endif\\n\",\nmap_pars_fragment:\"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n\",map_particle_fragment:\"#ifdef USE_MAP\\n\\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n\\tvec4 mapTexel = texture2D( map, uv );\\n\\tdiffuseColor *= mapTexelToLinear( mapTexel );\\n#endif\\n\",map_particle_pars_fragment:\"#ifdef USE_MAP\\n\\tuniform mat3 uvTransform;\\n\\tuniform sampler2D map;\\n#endif\\n\",metalnessmap_fragment:\"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\\n\",\nmetalnessmap_pars_fragment:\"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\",morphnormal_vertex:\"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\\n\\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\\n\\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\\n\\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\\n#endif\\n\",morphtarget_pars_vertex:\"#ifdef USE_MORPHTARGETS\\n\\t#ifndef USE_MORPHNORMALS\\n\\tuniform float morphTargetInfluences[ 8 ];\\n\\t#else\\n\\tuniform float morphTargetInfluences[ 4 ];\\n\\t#endif\\n#endif\",\nmorphtarget_vertex:\"#ifdef USE_MORPHTARGETS\\n\\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\\n\\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\\n\\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\\n\\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\\n\\t#ifndef USE_MORPHNORMALS\\n\\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\\n\\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\\n\\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\\n\\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\\n\\t#endif\\n#endif\\n\",\nnormal_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#endif\\n\",normal_fragment_maps:\"#ifdef USE_NORMALMAP\\n\\t#ifdef OBJECTSPACE_NORMALMAP\\n\\t\\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t\\t#ifdef FLIP_SIDED\\n\\t\\t\\tnormal = - normal;\\n\\t\\t#endif\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\\n\\t\\t#endif\\n\\t\\tnormal = normalize( normalMatrix * normal );\\n\\t#else\\n\\t\\tnormal = perturbNormal2Arb( -vViewPosition, normal );\\n\\t#endif\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\\n#endif\\n\",\nnormalmap_pars_fragment:\"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n\\t#ifdef OBJECTSPACE_NORMALMAP\\n\\t\\tuniform mat3 normalMatrix;\\n\\t#else\\n\\t\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\\n\\t\\t\\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\\n\\t\\t\\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\\n\\t\\t\\tvec2 st0 = dFdx( vUv.st );\\n\\t\\t\\tvec2 st1 = dFdy( vUv.st );\\n\\t\\t\\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\\n\\t\\t\\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\\n\\t\\t\\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\\n\\t\\t\\tvec3 N = normalize( surf_norm );\\n\\t\\t\\tmat3 tsn = mat3( S, T, N );\\n\\t\\t\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t\\t\\tmapN.xy *= normalScale;\\n\\t\\t\\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\\n\\t\\t\\treturn normalize( tsn * mapN );\\n\\t\\t}\\n\\t#endif\\n#endif\\n\",\npacking:\"vec3 packNormalToRGB( const in vec3 normal ) {\\n\\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\\nconst float ShiftRight8 = 1. / 256.;\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tvec4 r = vec4( fract( v * PackFactors ), v );\\n\\tr.yzw -= r.xyz * ShiftRight8;\\treturn r * PackUpscale;\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\\n\\treturn linearClipZ * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\\n\\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\\n}\\n\",\npremultiplied_alpha_fragment:\"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\\n\",project_vertex:\"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\\ngl_Position = projectionMatrix * mvPosition;\\n\",dithering_fragment:\"#if defined( DITHERING )\\n  gl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\\n\",dithering_pars_fragment:\"#if defined( DITHERING )\\n\\tvec3 dithering( vec3 color ) {\\n\\t\\tfloat grid_position = rand( gl_FragCoord.xy );\\n\\t\\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\\t\\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\\t\\treturn color + dither_shift_RGB;\\n\\t}\\n#endif\\n\",\nroughnessmap_fragment:\"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\\n\",roughnessmap_pars_fragment:\"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\",shadowmap_pars_fragment:\"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\t\\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\t\\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\t\\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\\n\\t#endif\\n\\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\\n\\t\\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\\n\\t}\\n\\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\\n\\t\\tconst vec2 offset = vec2( 0.0, 1.0 );\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / size;\\n\\t\\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\\n\\t\\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\\n\\t\\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\\n\\t\\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\\n\\t\\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\\n\\t\\tvec2 f = fract( uv * size + 0.5 );\\n\\t\\tfloat a = mix( lb, lt, f.y );\\n\\t\\tfloat b = mix( rb, rt, f.y );\\n\\t\\tfloat c = mix( a, b, f.x );\\n\\t\\treturn c;\\n\\t}\\n\\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;\\n\\t\\tshadowCoord.z += shadowBias;\\n\\t\\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\\n\\t\\tbool inFrustum = all( inFrustumVec );\\n\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\t\\tbool frustumTest = all( frustumTestVec );\\n\\t\\tif ( frustumTest ) {\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\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( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn shadow;\\n\\t}\\n\\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\\t\\tvec3 absV = abs( v );\\n\\t\\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\\t\\tabsV *= scaleToCube;\\n\\t\\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\\t\\tvec2 planar = v.xy;\\n\\t\\tfloat almostATexel = 1.5 * texelSizeY;\\n\\t\\tfloat almostOne = 1.0 - almostATexel;\\n\\t\\tif ( absV.z >= almostOne ) {\\n\\t\\t\\tif ( v.z > 0.0 )\\n\\t\\t\\t\\tplanar.x = 4.0 - v.x;\\n\\t\\t} else if ( absV.x >= almostOne ) {\\n\\t\\t\\tfloat signX = sign( v.x );\\n\\t\\t\\tplanar.x = v.z * signX + 2.0 * signX;\\n\\t\\t} else if ( absV.y >= almostOne ) {\\n\\t\\t\\tfloat signY = sign( v.y );\\n\\t\\t\\tplanar.x = v.x + 2.0 * signY + 2.0;\\n\\t\\t\\tplanar.y = v.z * signY - 2.0;\\n\\t\\t}\\n\\t\\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\\t}\\n\\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\tdp += shadowBias;\\n\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\\t\\t\\treturn (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t#endif\\n\\t}\\n#endif\\n\",\nshadowmap_pars_vertex:\"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\t\\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\t\\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\t\\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\\n\\t#endif\\n#endif\\n\",\nshadowmap_vertex:\"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\\n\\t}\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\\n\\t}\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\\n\\t}\\n\\t#endif\\n#endif\\n\",\nshadowmask_pars_fragment:\"float getShadowMask() {\\n\\tfloat shadow = 1.0;\\n\\t#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\tDirectionalLight directionalLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\tSpotLight spotLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\tPointLight pointLight;\\n\\t#pragma unroll_loop\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t}\\n\\t#endif\\n\\t#endif\\n\\treturn shadow;\\n}\\n\",\nskinbase_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 sampler2D boneTexture;\\n\\t\\tuniform int boneTextureSize;\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tfloat j = i * 4.0;\\n\\t\\t\\tfloat x = mod( j, float( boneTextureSize ) );\\n\\t\\t\\tfloat y = floor( j / float( boneTextureSize ) );\\n\\t\\t\\tfloat dx = 1.0 / float( boneTextureSize );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureSize );\\n\\t\\t\\ty = dy * ( y + 0.5 );\\n\\t\\t\\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\\n\\t\\t\\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\\n\\t\\t\\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\\n\\t\\t\\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\\n\\t\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#else\\n\\t\\tuniform mat4 boneMatrices[ MAX_BONES ];\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tmat4 bone = boneMatrices[ int(i) ];\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#endif\\n#endif\\n\",\nskinning_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\\n\",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#endif\\n\",\nspecularmap_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  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\\n\",tonemapping_pars_fragment:\"#ifndef saturate\\n\\t#define saturate(a) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nuniform float toneMappingWhitePoint;\\nvec3 LinearToneMapping( vec3 color ) {\\n\\treturn toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\\nvec3 Uncharted2ToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\n\",\nuv_pars_fragment:\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\\n\\tvarying vec2 vUv;\\n#endif\",uv_pars_vertex:\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\\n\\tvarying vec2 vUv;\\n\\tuniform mat3 uvTransform;\\n#endif\\n\",\nuv_vertex:\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n#endif\",uv2_pars_fragment:\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvarying vec2 vUv2;\\n#endif\",uv2_pars_vertex:\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tattribute vec2 uv2;\\n\\tvarying vec2 vUv2;\\n#endif\",\nuv2_vertex:\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvUv2 = uv2;\\n#endif\",worldpos_vertex:\"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\\n\\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\\n#endif\\n\",cube_frag:\"uniform samplerCube tCube;\\nuniform float tFlip;\\nuniform float opacity;\\nvarying vec3 vWorldPosition;\\nvoid main() {\\n\\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\\n\\tgl_FragColor.a *= opacity;\\n}\\n\",\ncube_vert:\"varying vec3 vWorldPosition;\\n#include <common>\\nvoid main() {\\n\\tvWorldPosition = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n\\tgl_Position.z = gl_Position.w;\\n}\\n\",depth_frag:\"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\\n\\t#elif DEPTH_PACKING == 3201\\n\\t\\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\\n\\t#endif\\n}\\n\",\ndepth_vert:\"#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n}\\n\",\ndistanceRGBA_frag:\"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main () {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\\n\",\ndistanceRGBA_vert:\"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvWorldPosition = worldPosition.xyz;\\n}\\n\",\nequirect_frag:\"uniform sampler2D tEquirect;\\nvarying vec3 vWorldPosition;\\n#include <common>\\nvoid main() {\\n\\tvec3 direction = normalize( vWorldPosition );\\n\\tvec2 sampleUV;\\n\\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\\n\\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n}\\n\",equirect_vert:\"varying vec3 vWorldPosition;\\n#include <common>\\nvoid main() {\\n\\tvWorldPosition = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n}\\n\",\nlinedashed_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <color_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\\n\",\nlinedashed_vert:\"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <color_vertex>\\n\\tvLineDistance = scale * lineDistance;\\n\\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nmeshbasic_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\\t#endif\\n\\t#include <aomap_fragment>\\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include <envmap_fragment>\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\\n\",\nmeshbasic_vert:\"#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_ENVMAP\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nmeshlambert_frag:\"uniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <fog_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <emissivemap_fragment>\\n\\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\\n\\t#include <lightmap_fragment>\\n\\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\\n\\t#else\\n\\t\\treflectedLight.directDiffuse = vLightFront;\\n\\t#endif\\n\\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\\n\",\nmeshlambert_vert:\"#define LAMBERT\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <lights_lambert_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nmeshphong_frag:\"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <gradientmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <lights_phong_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_phong_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\\n\",\nmeshphong_vert:\"#define PHONG\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nmeshphysical_frag:\"#define PHYSICAL\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifndef STANDARD\\n\\tuniform float clearCoat;\\n\\tuniform float clearCoatRoughness;\\n#endif\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <cube_uv_reflection_fragment>\\n#include <lights_pars_begin>\\n#include <lights_pars_maps>\\n#include <lights_physical_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <roughnessmap_pars_fragment>\\n#include <metalnessmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <roughnessmap_fragment>\\n\\t#include <metalnessmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_physical_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\\n\",\nmeshphysical_vert:\"#define PHYSICAL\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nnormal_frag:\"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\nvoid main() {\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\\n}\\n\",\nnormal_vert:\"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\\n\",\npoints_frag:\"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <color_pars_fragment>\\n#include <map_particle_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_particle_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\\n\",\npoints_vert:\"uniform float size;\\nuniform float scale;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <color_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tgl_PointSize = size * ( scale / - mvPosition.z );\\n\\t#else\\n\\t\\tgl_PointSize = size;\\n\\t#endif\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <fog_vertex>\\n}\\n\",\nshadow_frag:\"uniform vec3 color;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\nvoid main() {\\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\\t#include <fog_fragment>\\n}\\n\",shadow_vert:\"#include <fog_pars_vertex>\\n#include <shadowmap_pars_vertex>\\nvoid main() {\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\\n\"},\nBa={merge:function(a){for(var b={},c=0;c<a.length;c++){var d=this.clone(a[c]),e;for(e in d)b[e]=d[e]}return b},clone:function(a){var b={},c;for(c in a){b[c]={};for(var d in a[c]){var e=a[c][d];e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture)?b[c][d]=e.clone():Array.isArray(e)?b[c][d]=e.slice():b[c][d]=e}}return b}},Tg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,\nblue: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,\ndarkslategrey: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,\nlemonchiffon: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,\nmediumslateblue: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,\nrebeccapurple: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};Object.assign(G.prototype,\n{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):\"number\"===typeof a?this.setHex(a):\"string\"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(){function a(a,c,d){0>d&&(d+=1);1<d&&--d;return d<1/6?a+6*(c-a)*d:.5>d?c:d<2/3?a+6*(c-a)*(2/3-d):a}return function(b,\nc,d){b=J.euclideanModulo(b,1);c=J.clamp(c,0,1);d=J.clamp(d,0,1);0===c?this.r=this.g=this.b=d:(c=.5>=d?d*(1+c):d+c-d*c,d=2*d-c,this.r=a(d,c,b+1/3),this.g=a(d,c,b),this.b=a(d,c,b-1/3));return this}}(),setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn(\"THREE.Color: Alpha component of \"+a+\" will be ignored.\")}var c;if(c=/^((?:rgb|hsl)a?)\\(\\s*([^\\)]*)\\)/.exec(a)){var d=c[2];switch(c[1]){case \"rgb\":case \"rgba\":if(c=/^(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(d))return this.r=\nMath.min(255,parseInt(c[1],10))/255,this.g=Math.min(255,parseInt(c[2],10))/255,this.b=Math.min(255,parseInt(c[3],10))/255,b(c[5]),this;if(c=/^(\\d+)%\\s*,\\s*(\\d+)%\\s*,\\s*(\\d+)%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(d))return this.r=Math.min(100,parseInt(c[1],10))/100,this.g=Math.min(100,parseInt(c[2],10))/100,this.b=Math.min(100,parseInt(c[3],10))/100,b(c[5]),this;break;case \"hsl\":case \"hsla\":if(c=/^([0-9]*\\.?[0-9]+)\\s*,\\s*(\\d+)%\\s*,\\s*(\\d+)%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(d)){d=parseFloat(c[1])/\n360;var e=parseInt(c[2],10)/100,f=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,f)}}}else if(c=/^#([A-Fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)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===d)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}a&&0<a.length&&(c=Tg[a],\nvoid 0!==c?this.setHex(c):console.warn(\"THREE.Color: Unknown color \"+a));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a,b){void 0===b&&(b=2);this.r=Math.pow(a.r,b);this.g=Math.pow(a.g,b);this.b=Math.pow(a.b,b);return this},copyLinearToGamma:function(a,b){void 0===b&&(b=2);b=0<b?1/b:1;this.r=Math.pow(a.r,b);this.g=Math.pow(a.g,b);this.b=Math.pow(a.b,b);return this},convertGammaToLinear:function(a){this.copyGammaToLinear(this,\na);return this},convertLinearToGamma:function(a){this.copyLinearToGamma(this,a);return this},copySRGBToLinear:function(){function a(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}return function(b){this.r=a(b.r);this.g=a(b.g);this.b=a(b.b);return this}}(),copyLinearToSRGB:function(){function a(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}return function(b){this.r=a(b.r);this.g=a(b.g);this.b=a(b.b);return this}}(),convertSRGBToLinear:function(){this.copySRGBToLinear(this);\nreturn this},convertLinearToSRGB:function(){this.copyLinearToSRGB(this);return this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return(\"000000\"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){void 0===a&&(console.warn(\"THREE.Color: .getHSL() target is now required\"),a={h:0,s:0,l:0});var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var l=e-f;f=.5>=h?l/(e+f):l/(2-e-f);switch(e){case b:g=(c-\nd)/l+(c<d?6:0);break;case c:g=(d-b)/l+2;break;case d:g=(b-c)/l+4}g/=6}a.h=g;a.s=f;a.l=h;return a},getStyle:function(){return\"rgb(\"+(255*this.r|0)+\",\"+(255*this.g|0)+\",\"+(255*this.b|0)+\")\"},offsetHSL:function(){var a={};return function(b,c,d){this.getHSL(a);a.h+=b;a.s+=c;a.l+=d;this.setHSL(a.h,a.s,a.l);return this}}(),add:function(a){this.r+=a.r;this.g+=a.g;this.b+=a.b;return this},addColors:function(a,b){this.r=a.r+b.r;this.g=a.g+b.g;this.b=a.b+b.b;return this},addScalar:function(a){this.r+=a;this.g+=\na;this.b+=a;return this},sub:function(a){this.r=Math.max(0,this.r-a.r);this.g=Math.max(0,this.g-a.g);this.b=Math.max(0,this.b-a.b);return this},multiply:function(a){this.r*=a.r;this.g*=a.g;this.b*=a.b;return this},multiplyScalar:function(a){this.r*=a;this.g*=a;this.b*=a;return this},lerp:function(a,b){this.r+=(a.r-this.r)*b;this.g+=(a.g-this.g)*b;this.b+=(a.b-this.b)*b;return this},equals:function(a){return a.r===this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a,b){void 0===b&&(b=0);this.r=\na[b];this.g=a[b+1];this.b=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.r;a[b+1]=this.g;a[b+2]=this.b;return a},toJSON:function(){return this.getHex()}});var K={common:{diffuse:{value:new G(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new la},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},\naoMapIntensity:{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 B(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:2.5E-4},fogNear:{value:1},\nfogFar:{value:2E3},fogColor:{value:new G(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},\npointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new G(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new la}}},\ntb={basic:{uniforms:Ba.merge([K.common,K.specularmap,K.envmap,K.aomap,K.lightmap,K.fog]),vertexShader:S.meshbasic_vert,fragmentShader:S.meshbasic_frag},lambert:{uniforms:Ba.merge([K.common,K.specularmap,K.envmap,K.aomap,K.lightmap,K.emissivemap,K.fog,K.lights,{emissive:{value:new G(0)}}]),vertexShader:S.meshlambert_vert,fragmentShader:S.meshlambert_frag},phong:{uniforms:Ba.merge([K.common,K.specularmap,K.envmap,K.aomap,K.lightmap,K.emissivemap,K.bumpmap,K.normalmap,K.displacementmap,K.gradientmap,\nK.fog,K.lights,{emissive:{value:new G(0)},specular:{value:new G(1118481)},shininess:{value:30}}]),vertexShader:S.meshphong_vert,fragmentShader:S.meshphong_frag},standard:{uniforms:Ba.merge([K.common,K.envmap,K.aomap,K.lightmap,K.emissivemap,K.bumpmap,K.normalmap,K.displacementmap,K.roughnessmap,K.metalnessmap,K.fog,K.lights,{emissive:{value:new G(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:S.meshphysical_vert,fragmentShader:S.meshphysical_frag},points:{uniforms:Ba.merge([K.points,\nK.fog]),vertexShader:S.points_vert,fragmentShader:S.points_frag},dashed:{uniforms:Ba.merge([K.common,K.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:S.linedashed_vert,fragmentShader:S.linedashed_frag},depth:{uniforms:Ba.merge([K.common,K.displacementmap]),vertexShader:S.depth_vert,fragmentShader:S.depth_frag},normal:{uniforms:Ba.merge([K.common,K.bumpmap,K.normalmap,K.displacementmap,{opacity:{value:1}}]),vertexShader:S.normal_vert,fragmentShader:S.normal_frag},cube:{uniforms:{tCube:{value:null},\ntFlip:{value:-1},opacity:{value:1}},vertexShader:S.cube_vert,fragmentShader:S.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:S.equirect_vert,fragmentShader:S.equirect_frag},distanceRGBA:{uniforms:Ba.merge([K.common,K.displacementmap,{referencePosition:{value:new p},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:S.distanceRGBA_vert,fragmentShader:S.distanceRGBA_frag},shadow:{uniforms:Ba.merge([K.lights,K.fog,{color:{value:new G(0)},opacity:{value:1}}]),vertexShader:S.shadow_vert,\nfragmentShader:S.shadow_frag}};tb.physical={uniforms:Ba.merge([tb.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:S.meshphysical_vert,fragmentShader:S.meshphysical_frag};mb.RotationOrders=\"XYZ YZX ZXY XZY YXZ ZYX\".split(\" \");mb.DefaultOrder=\"XYZ\";Object.defineProperties(mb.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},\nset:function(a){this._z=a;this.onChangeCallback()}},order:{get:function(){return this._order},set:function(a){this._order=a;this.onChangeCallback()}}});Object.assign(mb.prototype,{isEuler:!0,set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},\nsetFromRotationMatrix:function(a,b,c){var d=J.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],l=e[5],m=e[9],k=e[2],n=e[6];e=e[10];b=b||this._order;\"XYZ\"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-m,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(n,l),this._z=0)):\"YXZ\"===b?(this._x=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-k,a),this._z=0)):\"ZXY\"===b?(this._x=Math.asin(d(n,-1,1)),.99999>Math.abs(n)?\n(this._y=Math.atan2(-k,e),this._z=Math.atan2(-f,l)):(this._y=0,this._z=Math.atan2(h,a))):\"ZYX\"===b?(this._y=Math.asin(-d(k,-1,1)),.99999>Math.abs(k)?(this._x=Math.atan2(n,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,l))):\"YZX\"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-m,l),this._y=Math.atan2(-k,a)):(this._x=0,this._y=Math.atan2(g,e))):\"XZY\"===b?(this._z=Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(n,l),this._y=Math.atan2(g,a)):(this._x=\nMath.atan2(-m,e),this._y=0)):console.warn(\"THREE.Euler: .setFromRotationMatrix() given unsupported order: \"+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a=new R;return function(b,c,d){a.makeRotationFromQuaternion(b);return this.setFromRotationMatrix(a,c,d)}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new ca;return function(b){a.setFromEuler(this);return this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===\nthis._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new p(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});\nObject.assign(Wd.prototype,{set:function(a){this.mask=1<<a|0},enable:function(a){this.mask=this.mask|1<<a|0},toggle:function(a){this.mask^=1<<a|0},disable:function(a){this.mask&=~(1<<a|0)},test:function(a){return 0!==(this.mask&a.mask)}});var Hf=0;H.DefaultUp=new p(0,1,0);H.DefaultMatrixAutoUpdate=!0;H.prototype=Object.assign(Object.create(za.prototype),{constructor:H,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix);\nthis.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(a){this.quaternion.premultiply(a);return this},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new ca;return function(b,c){a.setFromAxisAngle(b,\nc);this.quaternion.multiply(a);return this}}(),rotateOnWorldAxis:function(){var a=new ca;return function(b,c){a.setFromAxisAngle(b,c);this.quaternion.premultiply(a);return this}}(),rotateX:function(){var a=new p(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new p(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateZ:function(){var a=new p(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new p;return function(b,\nc){a.copy(b).applyQuaternion(this.quaternion);this.position.add(a.multiplyScalar(c));return this}}(),translateX:function(){var a=new p(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new p(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new p(0,0,1);return function(b){return this.translateOnAxis(a,b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new R;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),\nlookAt:function(){var a=new R,b=new p;return function(c,d,e){c.isVector3?b.copy(c):b.set(c,d,e);this.isCamera?a.lookAt(this.position,b,this.up):a.lookAt(b,this.position,this.up);this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.add(arguments[b]);return this}if(a===this)return console.error(\"THREE.Object3D.add: object can't be added as a child of itself.\",a),this;a&&a.isObject3D?(null!==a.parent&&a.parent.remove(a),a.parent=\nthis,a.dispatchEvent({type:\"added\"}),this.children.push(a)):console.error(\"THREE.Object3D.add: object not an instance of THREE.Object3D.\",a);return this},remove:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);return this}b=this.children.indexOf(a);-1!==b&&(a.parent=null,a.dispatchEvent({type:\"removed\"}),this.children.splice(b,1));return this},getObjectById:function(a){return this.getObjectByProperty(\"id\",a)},getObjectByName:function(a){return this.getObjectByProperty(\"name\",\na)},getObjectByProperty:function(a,b){if(this[a]===b)return this;for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c].getObjectByProperty(a,b);if(void 0!==e)return e}},getWorldPosition:function(a){void 0===a&&(console.warn(\"THREE.Object3D: .getWorldPosition() target is now required\"),a=new p);this.updateMatrixWorld(!0);return a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new p,b=new p;return function(c){void 0===c&&(console.warn(\"THREE.Object3D: .getWorldQuaternion() target is now required\"),\nc=new ca);this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,c,b);return c}}(),getWorldScale:function(){var a=new p,b=new ca;return function(c){void 0===c&&(console.warn(\"THREE.Object3D: .getWorldScale() target is now required\"),c=new p);this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,b,c);return c}}(),getWorldDirection:function(){var a=new ca;return function(b){void 0===b&&(console.warn(\"THREE.Object3D: .getWorldDirection() target is now required\"),b=new p);this.getWorldQuaternion(a);\nreturn b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverseVisible(a)}},traverseAncestors:function(a){var b=this.parent;null!==b&&(a(b),b.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){this.matrixAutoUpdate&&\nthis.updateMatrix();if(this.matrixWorldNeedsUpdate||a)null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].updateMatrixWorld(a)},toJSON:function(a){function b(b,c){void 0===b[c.uuid]&&(b[c.uuid]=c.toJSON(a));return c.uuid}function c(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var d=void 0===a||\"string\"===typeof a,\ne={};d&&(a={geometries:{},materials:{},textures:{},images:{},shapes:{}},e.metadata={version:4.5,type:\"Object\",generator:\"Object3D.toJSON\"});var f={};f.uuid=this.uuid;f.type=this.type;\"\"!==this.name&&(f.name=this.name);!0===this.castShadow&&(f.castShadow=!0);!0===this.receiveShadow&&(f.receiveShadow=!0);!1===this.visible&&(f.visible=!1);!1===this.frustumCulled&&(f.frustumCulled=!1);0!==this.renderOrder&&(f.renderOrder=this.renderOrder);\"{}\"!==JSON.stringify(this.userData)&&(f.userData=this.userData);\nf.layers=this.layers.mask;f.matrix=this.matrix.toArray();!1===this.matrixAutoUpdate&&(f.matrixAutoUpdate=!1);if(void 0!==this.geometry){f.geometry=b(a.geometries,this.geometry);var g=this.geometry.parameters;if(void 0!==g&&void 0!==g.shapes)if(g=g.shapes,Array.isArray(g))for(var h=0,l=g.length;h<l;h++)b(a.shapes,g[h]);else b(a.shapes,g)}if(void 0!==this.material)if(Array.isArray(this.material)){g=[];h=0;for(l=this.material.length;h<l;h++)g.push(b(a.materials,this.material[h]));f.material=g}else f.material=\nb(a.materials,this.material);if(0<this.children.length)for(f.children=[],h=0;h<this.children.length;h++)f.children.push(this.children[h].toJSON(a).object);if(d){d=c(a.geometries);h=c(a.materials);l=c(a.textures);var m=c(a.images);g=c(a.shapes);0<d.length&&(e.geometries=d);0<h.length&&(e.materials=h);0<l.length&&(e.textures=l);0<m.length&&(e.images=m);0<g.length&&(e.shapes=g)}e.object=f;return e},clone:function(a){return(new this.constructor).copy(this,a)},copy:function(a,b){void 0===b&&(b=!0);this.name=\na.name;this.up.copy(a.up);this.position.copy(a.position);this.quaternion.copy(a.quaternion);this.scale.copy(a.scale);this.matrix.copy(a.matrix);this.matrixWorld.copy(a.matrixWorld);this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrixWorldNeedsUpdate=a.matrixWorldNeedsUpdate;this.layers.mask=a.layers.mask;this.visible=a.visible;this.castShadow=a.castShadow;this.receiveShadow=a.receiveShadow;this.frustumCulled=a.frustumCulled;this.renderOrder=a.renderOrder;this.userData=JSON.parse(JSON.stringify(a.userData));\nif(!0===b)for(b=0;b<a.children.length;b++)this.add(a.children[b].clone());return this}});Ra.prototype=Object.assign(Object.create(H.prototype),{constructor:Ra,isCamera:!0,copy:function(a,b){H.prototype.copy.call(this,a,b);this.matrixWorldInverse.copy(a.matrixWorldInverse);this.projectionMatrix.copy(a.projectionMatrix);return this},getWorldDirection:function(){var a=new ca;return function(b){void 0===b&&(console.warn(\"THREE.Camera: .getWorldDirection() target is now required\"),b=new p);this.getWorldQuaternion(a);\nreturn b.set(0,0,-1).applyQuaternion(a)}}(),updateMatrixWorld:function(a){H.prototype.updateMatrixWorld.call(this,a);this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}});Mb.prototype=Object.assign(Object.create(Ra.prototype),{constructor:Mb,isOrthographicCamera:!0,copy:function(a,b){Ra.prototype.copy.call(this,a,b);this.left=a.left;this.right=a.right;this.top=a.top;this.bottom=a.bottom;this.near=a.near;this.far=a.far;this.zoom=a.zoom;this.view=\nnull===a.view?null:Object.assign({},a.view);return this},setViewOffset:function(a,b,c,d,e,f){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=a;this.view.fullHeight=b;this.view.offsetX=c;this.view.offsetY=d;this.view.width=e;this.view.height=f;this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1);this.updateProjectionMatrix()},updateProjectionMatrix:function(){var a=\n(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2,e=c-a;c+=a;a=d+b;b=d-b;if(null!==this.view&&this.view.enabled){c=this.zoom/(this.view.width/this.view.fullWidth);b=this.zoom/(this.view.height/this.view.fullHeight);var f=(this.right-this.left)/this.view.width;d=(this.top-this.bottom)/this.view.height;e+=this.view.offsetX/c*f;c=e+this.view.width/c*f;a-=this.view.offsetY/b*d;b=a-this.view.height/b*d}this.projectionMatrix.makeOrthographic(e,\nc,a,b,this.near,this.far)},toJSON:function(a){a=H.prototype.toJSON.call(this,a);a.object.zoom=this.zoom;a.object.left=this.left;a.object.right=this.right;a.object.top=this.top;a.object.bottom=this.bottom;a.object.near=this.near;a.object.far=this.far;null!==this.view&&(a.object.view=Object.assign({},this.view));return a}});Object.assign(Ya.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a=a.a;this.b=a.b;this.c=a.c;this.normal.copy(a.normal);this.color.copy(a.color);\nthis.materialIndex=a.materialIndex;for(var b=0,c=a.vertexNormals.length;b<c;b++)this.vertexNormals[b]=a.vertexNormals[b].clone();b=0;for(c=a.vertexColors.length;b<c;b++)this.vertexColors[b]=a.vertexColors[b].clone();return this}});var If=0;P.prototype=Object.assign(Object.create(za.prototype),{constructor:P,isGeometry:!0,applyMatrix:function(a){for(var b=(new la).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];\na.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=this.verticesNeedUpdate=!0;return this},rotateX:function(){var a=new R;return function(b){a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new R;return function(b){a.makeRotationY(b);this.applyMatrix(a);return this}}(),\nrotateZ:function(){var a=new R;return function(b){a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a=new R;return function(b,c,d){a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a=new R;return function(b,c,d){a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a=new H;return function(b){a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),fromBufferGeometry:function(a){function b(a,b,d,e){var f=void 0!==\ng?[k[a].clone(),k[b].clone(),k[d].clone()]:[],q=void 0!==h?[c.colors[a].clone(),c.colors[b].clone(),c.colors[d].clone()]:[];e=new Ya(a,b,d,f,q,e);c.faces.push(e);void 0!==l&&c.faceVertexUvs[0].push([n[a].clone(),n[b].clone(),n[d].clone()]);void 0!==m&&c.faceVertexUvs[1].push([t[a].clone(),t[b].clone(),t[d].clone()])}var c=this,d=null!==a.index?a.index.array:void 0,e=a.attributes,f=e.position.array,g=void 0!==e.normal?e.normal.array:void 0,h=void 0!==e.color?e.color.array:void 0,l=void 0!==e.uv?e.uv.array:\nvoid 0,m=void 0!==e.uv2?e.uv2.array:void 0;void 0!==m&&(this.faceVertexUvs[1]=[]);for(var k=[],n=[],t=[],q=e=0;e<f.length;e+=3,q+=2)c.vertices.push(new p(f[e],f[e+1],f[e+2])),void 0!==g&&k.push(new p(g[e],g[e+1],g[e+2])),void 0!==h&&c.colors.push(new G(h[e],h[e+1],h[e+2])),void 0!==l&&n.push(new B(l[q],l[q+1])),void 0!==m&&t.push(new B(m[q],m[q+1]));var r=a.groups;if(0<r.length)for(e=0;e<r.length;e++){f=r[e];var u=f.start,y=f.count;q=u;for(u+=y;q<u;q+=3)void 0!==d?b(d[q],d[q+1],d[q+2],f.materialIndex):\nb(q,q+1,q+2,f.materialIndex)}else if(void 0!==d)for(e=0;e<d.length;e+=3)b(d[e],d[e+1],d[e+2]);else for(e=0;e<f.length/3;e+=3)b(e,e+1,e+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){var a=new p;return function(){this.computeBoundingBox();this.boundingBox.getCenter(a).negate();this.translate(a.x,a.y,a.z);return this}}(),normalize:function(){this.computeBoundingSphere();\nvar a=this.boundingSphere.center,b=this.boundingSphere.radius;b=0===b?1:1/b;var c=new R;c.set(b,0,0,-b*a.x,0,b,0,-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);return this},computeFaceNormals:function(){for(var a=new p,b=new p,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){void 0===a&&(a=!0);var b;var c=Array(this.vertices.length);\nvar d=0;for(b=this.vertices.length;d<b;d++)c[d]=new p;if(a){var e=new p,f=new p;a=0;for(d=this.faces.length;a<d;a++){b=this.faces[a];var g=this.vertices[b.a];var h=this.vertices[b.b];var l=this.vertices[b.c];e.subVectors(l,h);f.subVectors(g,h);e.cross(f);c[b.a].add(e);c[b.b].add(e);c[b.c].add(e)}}else for(this.computeFaceNormals(),a=0,d=this.faces.length;a<d;a++)b=this.faces[a],c[b.a].add(b.normal),c[b.b].add(b.normal),c[b.c].add(b.normal);d=0;for(b=this.vertices.length;d<b;d++)c[d].normalize();a=\n0;for(d=this.faces.length;a<d;a++)b=this.faces[a],g=b.vertexNormals,3===g.length?(g[0].copy(c[b.a]),g[1].copy(c[b.b]),g[2].copy(c[b.c])):(g[0]=c[b.a].clone(),g[1]=c[b.b].clone(),g[2]=c[b.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var a;this.computeFaceNormals();var b=0;for(a=this.faces.length;b<a;b++){var c=this.faces[b];var d=c.vertexNormals;3===d.length?(d[0].copy(c.normal),d[1].copy(c.normal),d[2].copy(c.normal)):(d[0]=c.normal.clone(),d[1]=\nc.normal.clone(),d[2]=c.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var a,b;var c=0;for(b=this.faces.length;c<b;c++){var d=this.faces[c];d.__originalFaceNormal?d.__originalFaceNormal.copy(d.normal):d.__originalFaceNormal=d.normal.clone();d.__originalVertexNormals||(d.__originalVertexNormals=[]);var e=0;for(a=d.vertexNormals.length;e<a;e++)d.__originalVertexNormals[e]?d.__originalVertexNormals[e].copy(d.vertexNormals[e]):d.__originalVertexNormals[e]=\nd.vertexNormals[e].clone()}var f=new P;f.faces=this.faces;e=0;for(a=this.morphTargets.length;e<a;e++){if(!this.morphNormals[e]){this.morphNormals[e]={};this.morphNormals[e].faceNormals=[];this.morphNormals[e].vertexNormals=[];d=this.morphNormals[e].faceNormals;var g=this.morphNormals[e].vertexNormals;c=0;for(b=this.faces.length;c<b;c++){var h=new p;var l={a:new p,b:new p,c:new p};d.push(h);g.push(l)}}g=this.morphNormals[e];f.vertices=this.morphTargets[e].vertices;f.computeFaceNormals();f.computeVertexNormals();\nc=0;for(b=this.faces.length;c<b;c++)d=this.faces[c],h=g.faceNormals[c],l=g.vertexNormals[c],h.copy(d.normal),l.a.copy(d.vertexNormals[0]),l.b.copy(d.vertexNormals[1]),l.c.copy(d.vertexNormals[2])}c=0;for(b=this.faces.length;c<b;c++)d=this.faces[c],d.normal=d.__originalFaceNormal,d.vertexNormals=d.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Xa);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&\n(this.boundingSphere=new Ha);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(a&&a.isGeometry){var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,l=a.faces,m=this.faceVertexUvs[0],k=a.faceVertexUvs[0],n=this.colors,p=a.colors;void 0===c&&(c=0);void 0!==b&&(d=(new la).getNormalMatrix(b));a=0;for(var q=g.length;a<q;a++){var r=g[a].clone();void 0!==b&&r.applyMatrix4(b);f.push(r)}a=0;for(q=p.length;a<q;a++)n.push(p[a].clone());a=0;for(q=l.length;a<q;a++){g=\nl[a];var u=g.vertexNormals;p=g.vertexColors;n=new Ya(g.a+e,g.b+e,g.c+e);n.normal.copy(g.normal);void 0!==d&&n.normal.applyMatrix3(d).normalize();b=0;for(f=u.length;b<f;b++)r=u[b].clone(),void 0!==d&&r.applyMatrix3(d).normalize(),n.vertexNormals.push(r);n.color.copy(g.color);b=0;for(f=p.length;b<f;b++)r=p[b],n.vertexColors.push(r.clone());n.materialIndex=g.materialIndex+c;h.push(n)}a=0;for(q=k.length;a<q;a++)if(c=k[a],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());m.push(d)}}else console.error(\"THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.\",\na)},mergeMesh:function(a){a&&a.isMesh?(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix)):console.error(\"THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.\",a)},mergeVertices:function(){var a={},b=[],c=[],d=Math.pow(10,4),e;var f=0;for(e=this.vertices.length;f<e;f++){var g=this.vertices[f];g=Math.round(g.x*d)+\"_\"+Math.round(g.y*d)+\"_\"+Math.round(g.z*d);void 0===a[g]?(a[g]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[g]]}a=[];f=0;for(e=this.faces.length;f<e;f++)for(d=\nthis.faces[f],d.a=c[d.a],d.b=c[d.b],d.c=c[d.c],d=[d.a,d.b,d.c],g=0;3>g;g++)if(d[g]===d[(g+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(d=a[f],this.faces.splice(d,1),c=0,e=this.faceVertexUvs.length;c<e;c++)this.faceVertexUvs[c].splice(d,1);f=this.vertices.length-b.length;this.vertices=b;return f},setFromPoints:function(a){this.vertices=[];for(var b=0,c=a.length;b<c;b++){var d=a[b];this.vertices.push(new p(d.x,d.y,d.z||0))}return this},sortFacesByMaterialIndex:function(){for(var a=this.faces,\nb=a.length,c=0;c<b;c++)a[c]._id=c;a.sort(function(a,b){return a.materialIndex-b.materialIndex});var d=this.faceVertexUvs[0],e=this.faceVertexUvs[1],f,g;d&&d.length===b&&(f=[]);e&&e.length===b&&(g=[]);for(c=0;c<b;c++){var h=a[c]._id;f&&f.push(d[h]);g&&g.push(e[h])}f&&(this.faceVertexUvs[0]=f);g&&(this.faceVertexUvs[1]=g)},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==m[b])return m[b];m[b]=l.length/3;l.push(a.x,\na.y,a.z);return m[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==n[b])return n[b];n[b]=k.length;k.push(a.getHex());return n[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=p.length/2;p.push(a.x,a.y);return q[b]}var e={metadata:{version:4.5,type:\"Geometry\",generator:\"Geometry.toJSON\"}};e.uuid=this.uuid;e.type=this.type;\"\"!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&\n(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}h=[];var l=[],m={},k=[],n={},p=[],q={};for(g=0;g<this.faces.length;g++){var r=this.faces[g],u=void 0!==this.faceVertexUvs[0][g],y=0<r.normal.length(),w=0<r.vertexNormals.length,x=1!==r.color.r||1!==r.color.g||1!==r.color.b,A=0<r.vertexColors.length,C=0;C=a(C,0,0);C=a(C,1,!0);C=a(C,2,!1);C=a(C,3,u);C=a(C,4,y);C=a(C,5,w);C=a(C,6,x);C=a(C,7,A);h.push(C);h.push(r.a,r.b,r.c);h.push(r.materialIndex);\nu&&(u=this.faceVertexUvs[0][g],h.push(d(u[0]),d(u[1]),d(u[2])));y&&h.push(b(r.normal));w&&(y=r.vertexNormals,h.push(b(y[0]),b(y[1]),b(y[2])));x&&h.push(c(r.color));A&&(r=r.vertexColors,h.push(c(r[0]),c(r[1]),c(r[2])))}e.data={};e.data.vertices=f;e.data.normals=l;0<k.length&&(e.data.colors=k);0<p.length&&(e.data.uvs=[p]);e.data.faces=h;return e},clone:function(){return(new P).copy(this)},copy:function(a){var b,c,d;this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=\n[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.name=a.name;var e=a.vertices;var f=0;for(b=e.length;f<b;f++)this.vertices.push(e[f].clone());e=a.colors;f=0;for(b=e.length;f<b;f++)this.colors.push(e[f].clone());e=a.faces;f=0;for(b=e.length;f<b;f++)this.faces.push(e[f].clone());f=0;for(b=a.faceVertexUvs.length;f<b;f++){var g=a.faceVertexUvs[f];void 0===this.faceVertexUvs[f]&&(this.faceVertexUvs[f]=[]);e=0;for(c=g.length;e<\nc;e++){var h=g[e],l=[];var m=0;for(d=h.length;m<d;m++)l.push(h[m].clone());this.faceVertexUvs[f].push(l)}}m=a.morphTargets;f=0;for(b=m.length;f<b;f++){d={};d.name=m[f].name;if(void 0!==m[f].vertices)for(d.vertices=[],e=0,c=m[f].vertices.length;e<c;e++)d.vertices.push(m[f].vertices[e].clone());if(void 0!==m[f].normals)for(d.normals=[],e=0,c=m[f].normals.length;e<c;e++)d.normals.push(m[f].normals[e].clone());this.morphTargets.push(d)}m=a.morphNormals;f=0;for(b=m.length;f<b;f++){d={};if(void 0!==m[f].vertexNormals)for(d.vertexNormals=\n[],e=0,c=m[f].vertexNormals.length;e<c;e++)g=m[f].vertexNormals[e],h={},h.a=g.a.clone(),h.b=g.b.clone(),h.c=g.c.clone(),d.vertexNormals.push(h);if(void 0!==m[f].faceNormals)for(d.faceNormals=[],e=0,c=m[f].faceNormals.length;e<c;e++)d.faceNormals.push(m[f].faceNormals[e].clone());this.morphNormals.push(d)}e=a.skinWeights;f=0;for(b=e.length;f<b;f++)this.skinWeights.push(e[f].clone());e=a.skinIndices;f=0;for(b=e.length;f<b;f++)this.skinIndices.push(e[f].clone());e=a.lineDistances;f=0;for(b=e.length;f<\nb;f++)this.lineDistances.push(e[f]);f=a.boundingBox;null!==f&&(this.boundingBox=f.clone());f=a.boundingSphere;null!==f&&(this.boundingSphere=f.clone());this.elementsNeedUpdate=a.elementsNeedUpdate;this.verticesNeedUpdate=a.verticesNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.lineDistancesNeedUpdate=a.lineDistancesNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:\"dispose\"})}});\nObject.defineProperty(L.prototype,\"needsUpdate\",{set:function(a){!0===a&&this.version++}});Object.assign(L.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(a){if(Array.isArray(a))throw new TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");this.count=void 0!==a?a.length/this.itemSize:0;this.array=a;return this},setDynamic:function(a){this.dynamic=a;return this},copy:function(a){this.name=a.name;this.array=new a.array.constructor(a.array);this.itemSize=\na.itemSize;this.count=a.count;this.normalized=a.normalized;this.dynamic=a.dynamic;return this},copyAt:function(a,b,c){a*=this.itemSize;c*=b.itemSize;for(var d=0,e=this.itemSize;d<e;d++)this.array[a+d]=b.array[c+d];return this},copyArray:function(a){this.array.set(a);return this},copyColorsArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn(\"THREE.BufferAttribute.copyColorsArray(): color is undefined\",d),f=new G);b[c++]=f.r;b[c++]=f.g;b[c++]=f.b}return this},\ncopyVector2sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn(\"THREE.BufferAttribute.copyVector2sArray(): vector is undefined\",d),f=new B);b[c++]=f.x;b[c++]=f.y}return this},copyVector3sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn(\"THREE.BufferAttribute.copyVector3sArray(): vector is undefined\",d),f=new p);b[c++]=f.x;b[c++]=f.y;b[c++]=f.z}return this},copyVector4sArray:function(a){for(var b=\nthis.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn(\"THREE.BufferAttribute.copyVector4sArray(): vector is undefined\",d),f=new W);b[c++]=f.x;b[c++]=f.y;b[c++]=f.z;b[c++]=f.w}return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},getX:function(a){return this.array[a*this.itemSize]},setX:function(a,b){this.array[a*this.itemSize]=b;return this},getY:function(a){return this.array[a*this.itemSize+1]},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},\ngetZ:function(a){return this.array[a*this.itemSize+2]},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},getW:function(a){return this.array[a*this.itemSize+3]},setW:function(a,b){this.array[a*this.itemSize+3]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a+0]=b;this.array[a+\n1]=c;this.array[a+2]=d;this.array[a+3]=e;return this},onUpload:function(a){this.onUploadCallback=a;return this},clone:function(){return(new this.constructor(this.array,this.itemSize)).copy(this)}});yc.prototype=Object.create(L.prototype);yc.prototype.constructor=yc;zc.prototype=Object.create(L.prototype);zc.prototype.constructor=zc;Ac.prototype=Object.create(L.prototype);Ac.prototype.constructor=Ac;Bc.prototype=Object.create(L.prototype);Bc.prototype.constructor=Bc;nb.prototype=Object.create(L.prototype);\nnb.prototype.constructor=nb;Cc.prototype=Object.create(L.prototype);Cc.prototype.constructor=Cc;ob.prototype=Object.create(L.prototype);ob.prototype.constructor=ob;z.prototype=Object.create(L.prototype);z.prototype.constructor=z;Dc.prototype=Object.create(L.prototype);Dc.prototype.constructor=Dc;Object.assign(Ge.prototype,{computeGroups:function(a){var b=[],c=void 0;a=a.faces;for(var d=0;d<a.length;d++){var e=a[d];if(e.materialIndex!==c){c=e.materialIndex;void 0!==f&&(f.count=3*d-f.start,b.push(f));\nvar f={start:3*d,materialIndex:c}}}void 0!==f&&(f.count=3*d-f.start,b.push(f));this.groups=b},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,h=g.length;if(0<h){var l=[];for(var m=0;m<h;m++)l[m]=[];this.morphTargets.position=l}var k=a.morphNormals,n=k.length;if(0<n){var p=[];for(m=0;m<n;m++)p[m]=[];this.morphTargets.normal=p}var q=a.skinIndices,r=a.skinWeights,u=q.length===c.length,y=r.length===c.length;0<c.length&&\n0===b.length&&console.error(\"THREE.DirectGeometry: Faceless geometries are not supported.\");for(m=0;m<b.length;m++){var w=b[m];this.vertices.push(c[w.a],c[w.b],c[w.c]);var x=w.vertexNormals;3===x.length?this.normals.push(x[0],x[1],x[2]):(x=w.normal,this.normals.push(x,x,x));x=w.vertexColors;3===x.length?this.colors.push(x[0],x[1],x[2]):(x=w.color,this.colors.push(x,x,x));!0===e&&(x=d[0][m],void 0!==x?this.uvs.push(x[0],x[1],x[2]):(console.warn(\"THREE.DirectGeometry.fromGeometry(): Undefined vertexUv \",\nm),this.uvs.push(new B,new B,new B)));!0===f&&(x=d[1][m],void 0!==x?this.uvs2.push(x[0],x[1],x[2]):(console.warn(\"THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 \",m),this.uvs2.push(new B,new B,new B)));for(x=0;x<h;x++){var A=g[x].vertices;l[x].push(A[w.a],A[w.b],A[w.c])}for(x=0;x<n;x++)A=k[x].vertexNormals[m],p[x].push(A.a,A.b,A.c);u&&this.skinIndices.push(q[w.a],q[w.b],q[w.c]);y&&this.skinWeights.push(r[w.a],r[w.b],r[w.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;\nthis.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this}});var Jf=1;D.prototype=Object.assign(Object.create(za.prototype),{constructor:D,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(a){Array.isArray(a)?this.index=new (65535<He(a)?ob:nb)(a,1):this.index=a},addAttribute:function(a,b,c){if(!(b&&b.isBufferAttribute||b&&b.isInterleavedBufferAttribute))return console.warn(\"THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).\"),\nthis.addAttribute(a,new L(b,c));if(\"index\"===a)return console.warn(\"THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.\"),this.setIndex(b),this;this.attributes[a]=b;return this},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a];return this},addGroup:function(a,b,c){this.groups.push({start:a,count:b,materialIndex:void 0!==c?c:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(a,b){this.drawRange.start=a;this.drawRange.count=\nb},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToBufferAttribute(b),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new la).getNormalMatrix(a).applyToBufferAttribute(b),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();return this},rotateX:function(){var a=new R;return function(b){a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new R;return function(b){a.makeRotationY(b);\nthis.applyMatrix(a);return this}}(),rotateZ:function(){var a=new R;return function(b){a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a=new R;return function(b,c,d){a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a=new R;return function(b,c,d){a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a=new H;return function(b){a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),center:function(){var a=new p;\nreturn function(){this.computeBoundingBox();this.boundingBox.getCenter(a).negate();this.translate(a.x,a.y,a.z);return this}}(),setFromObject:function(a){var b=a.geometry;if(a.isPoints||a.isLine){a=new z(3*b.vertices.length,3);var c=new z(3*b.colors.length,3);this.addAttribute(\"position\",a.copyVector3sArray(b.vertices));this.addAttribute(\"color\",c.copyColorsArray(b.colors));b.lineDistances&&b.lineDistances.length===b.vertices.length&&(a=new z(b.lineDistances.length,1),this.addAttribute(\"lineDistance\",\na.copyArray(b.lineDistances)));null!==b.boundingSphere&&(this.boundingSphere=b.boundingSphere.clone());null!==b.boundingBox&&(this.boundingBox=b.boundingBox.clone())}else a.isMesh&&b&&b.isGeometry&&this.fromGeometry(b);return this},setFromPoints:function(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c];b.push(e.x,e.y,e.z||0)}this.addAttribute(\"position\",new z(b,3));return this},updateFromObject:function(a){var b=a.geometry;if(a.isMesh){var c=b.__directGeometry;!0===b.elementsNeedUpdate&&(c=void 0,\nb.elementsNeedUpdate=!1);if(void 0===c)return this.fromGeometry(b);c.verticesNeedUpdate=b.verticesNeedUpdate;c.normalsNeedUpdate=b.normalsNeedUpdate;c.colorsNeedUpdate=b.colorsNeedUpdate;c.uvsNeedUpdate=b.uvsNeedUpdate;c.groupsNeedUpdate=b.groupsNeedUpdate;b.verticesNeedUpdate=!1;b.normalsNeedUpdate=!1;b.colorsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.groupsNeedUpdate=!1;b=c}!0===b.verticesNeedUpdate&&(c=this.attributes.position,void 0!==c&&(c.copyVector3sArray(b.vertices),c.needsUpdate=!0),b.verticesNeedUpdate=\n!1);!0===b.normalsNeedUpdate&&(c=this.attributes.normal,void 0!==c&&(c.copyVector3sArray(b.normals),c.needsUpdate=!0),b.normalsNeedUpdate=!1);!0===b.colorsNeedUpdate&&(c=this.attributes.color,void 0!==c&&(c.copyColorsArray(b.colors),c.needsUpdate=!0),b.colorsNeedUpdate=!1);b.uvsNeedUpdate&&(c=this.attributes.uv,void 0!==c&&(c.copyVector2sArray(b.uvs),c.needsUpdate=!0),b.uvsNeedUpdate=!1);b.lineDistancesNeedUpdate&&(c=this.attributes.lineDistance,void 0!==c&&(c.copyArray(b.lineDistances),c.needsUpdate=\n!0),b.lineDistancesNeedUpdate=!1);b.groupsNeedUpdate&&(b.computeGroups(a.geometry),this.groups=b.groups,b.groupsNeedUpdate=!1);return this},fromGeometry:function(a){a.__directGeometry=(new Ge).fromGeometry(a);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){var b=new Float32Array(3*a.vertices.length);this.addAttribute(\"position\",(new L(b,3)).copyVector3sArray(a.vertices));0<a.normals.length&&(b=new Float32Array(3*a.normals.length),this.addAttribute(\"normal\",(new L(b,\n3)).copyVector3sArray(a.normals)));0<a.colors.length&&(b=new Float32Array(3*a.colors.length),this.addAttribute(\"color\",(new L(b,3)).copyColorsArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute(\"uv\",(new L(b,2)).copyVector2sArray(a.uvs)));0<a.uvs2.length&&(b=new Float32Array(2*a.uvs2.length),this.addAttribute(\"uv2\",(new L(b,2)).copyVector2sArray(a.uvs2)));this.groups=a.groups;for(var c in a.morphTargets){b=[];for(var d=a.morphTargets[c],e=0,f=d.length;e<f;e++){var g=\nd[e],h=new z(3*g.length,3);b.push(h.copyVector3sArray(g))}this.morphAttributes[c]=b}0<a.skinIndices.length&&(c=new z(4*a.skinIndices.length,4),this.addAttribute(\"skinIndex\",c.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&(c=new z(4*a.skinWeights.length,4),this.addAttribute(\"skinWeight\",c.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){null===\nthis.boundingBox&&(this.boundingBox=new Xa);var a=this.attributes.position;void 0!==a?this.boundingBox.setFromBufferAttribute(a):this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var a=new Xa,b=new p;return function(){null===this.boundingSphere&&\n(this.boundingSphere=new Ha);var c=this.attributes.position;if(c){var d=this.boundingSphere.center;a.setFromBufferAttribute(c);a.getCenter(d);for(var e=0,f=0,g=c.count;f<g;f++)b.x=c.getX(f),b.y=c.getY(f),b.z=c.getZ(f),e=Math.max(e,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(e);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},\ncomputeVertexNormals:function(){var a=this.index,b=this.attributes,c=this.groups;if(b.position){var d=b.position.array;if(void 0===b.normal)this.addAttribute(\"normal\",new L(new Float32Array(d.length),3));else for(var e=b.normal.array,f=0,g=e.length;f<g;f++)e[f]=0;e=b.normal.array;var h=new p,l=new p,m=new p,k=new p,n=new p;if(a){a=a.array;0===c.length&&this.addGroup(0,a.length);for(var t=0,q=c.length;t<q;++t){f=c[t];g=f.start;var r=f.count;f=g;for(g+=r;f<g;f+=3){r=3*a[f+0];var u=3*a[f+1];var y=3*\na[f+2];h.fromArray(d,r);l.fromArray(d,u);m.fromArray(d,y);k.subVectors(m,l);n.subVectors(h,l);k.cross(n);e[r]+=k.x;e[r+1]+=k.y;e[r+2]+=k.z;e[u]+=k.x;e[u+1]+=k.y;e[u+2]+=k.z;e[y]+=k.x;e[y+1]+=k.y;e[y+2]+=k.z}}}else for(f=0,g=d.length;f<g;f+=9)h.fromArray(d,f),l.fromArray(d,f+3),m.fromArray(d,f+6),k.subVectors(m,l),n.subVectors(h,l),k.cross(n),e[f]=k.x,e[f+1]=k.y,e[f+2]=k.z,e[f+3]=k.x,e[f+4]=k.y,e[f+5]=k.z,e[f+6]=k.x,e[f+7]=k.y,e[f+8]=k.z;this.normalizeNormals();b.normal.needsUpdate=!0}},merge:function(a,\nb){if(a&&a.isBufferGeometry){void 0===b&&(b=0,console.warn(\"THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.\"));var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d]){var e=c[d].array,f=a.attributes[d],g=f.array,h=0;for(f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h]}return this}console.error(\"THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.\",a)},normalizeNormals:function(){var a=\nnew p;return function(){for(var b=this.attributes.normal,c=0,d=b.count;c<d;c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.normalize(),b.setXYZ(c,a.x,a.y,a.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn(\"THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.\"),this;var a=new D,b=this.index.array,c=this.attributes,d;for(d in c){var e=c[d],f=e.array,g=e.itemSize,h=new f.constructor(b.length*g),l=0;e=0;for(var m=b.length;e<m;e++){var k=b[e]*g;for(var n=0;n<g;n++)h[l++]=\nf[k++]}a.addAttribute(d,new L(h,g))}b=this.groups;e=0;for(m=b.length;e<m;e++)c=b[e],a.addGroup(c.start,c.count,c.materialIndex);return a},toJSON:function(){var a={metadata:{version:4.5,type:\"BufferGeometry\",generator:\"BufferGeometry.toJSON\"}};a.uuid=this.uuid;a.type=this.type;\"\"!==this.name&&(a.name=this.name);0<Object.keys(this.userData).length&&(a.userData=this.userData);if(void 0!==this.parameters){var b=this.parameters;for(e in b)void 0!==b[e]&&(a[e]=b[e]);return a}a.data={attributes:{}};var c=\nthis.index;null!==c&&(b=Array.prototype.slice.call(c.array),a.data.index={type:c.array.constructor.name,array:b});c=this.attributes;for(e in c){var d=c[e];b=Array.prototype.slice.call(d.array);a.data.attributes[e]={itemSize:d.itemSize,type:d.array.constructor.name,array:b,normalized:d.normalized}}var e=this.groups;0<e.length&&(a.data.groups=JSON.parse(JSON.stringify(e)));e=this.boundingSphere;null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){return(new D).copy(this)},\ncopy:function(a){var b;this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.name=a.name;var c=a.index;null!==c&&this.setIndex(c.clone());c=a.attributes;for(g in c)this.addAttribute(g,c[g].clone());var d=a.morphAttributes;for(g in d){var e=[],f=d[g];c=0;for(b=f.length;c<b;c++)e.push(f[c].clone());this.morphAttributes[g]=e}var g=a.groups;c=0;for(b=g.length;c<b;c++)d=g[c],this.addGroup(d.start,d.count,d.materialIndex);g=a.boundingBox;\nnull!==g&&(this.boundingBox=g.clone());g=a.boundingSphere;null!==g&&(this.boundingSphere=g.clone());this.drawRange.start=a.drawRange.start;this.drawRange.count=a.drawRange.count;this.userData=a.userData;return this},dispose:function(){this.dispatchEvent({type:\"dispose\"})}});Nb.prototype=Object.create(P.prototype);Nb.prototype.constructor=Nb;pb.prototype=Object.create(D.prototype);pb.prototype.constructor=pb;Fc.prototype=Object.create(P.prototype);Fc.prototype.constructor=Fc;rb.prototype=Object.create(D.prototype);\nrb.prototype.constructor=rb;var Kf=0;I.prototype=Object.assign(Object.create(za.prototype),{constructor:I,isMaterial:!0,onBeforeCompile:function(){},setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn(\"THREE.Material: '\"+b+\"' parameter is undefined.\");else if(\"shading\"===b)console.warn(\"THREE.\"+this.type+\": .shading has been removed. Use the boolean .flatShading instead.\"),this.flatShading=1===c?!0:!1;else{var d=this[b];void 0===d?console.warn(\"THREE.\"+this.type+\n\": '\"+b+\"' is not a property of this material.\"):d&&d.isColor?d.set(c):d&&d.isVector3&&c&&c.isVector3?d.copy(c):this[b]=\"overdraw\"===b?Number(c):c}}},toJSON:function(a){function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var c=void 0===a||\"string\"===typeof a;c&&(a={textures:{},images:{}});var d={metadata:{version:4.5,type:\"Material\",generator:\"Material.toJSON\"}};d.uuid=this.uuid;d.type=this.type;\"\"!==this.name&&(d.name=this.name);this.color&&this.color.isColor&&(d.color=\nthis.color.getHex());void 0!==this.roughness&&(d.roughness=this.roughness);void 0!==this.metalness&&(d.metalness=this.metalness);this.emissive&&this.emissive.isColor&&(d.emissive=this.emissive.getHex());1!==this.emissiveIntensity&&(d.emissiveIntensity=this.emissiveIntensity);this.specular&&this.specular.isColor&&(d.specular=this.specular.getHex());void 0!==this.shininess&&(d.shininess=this.shininess);void 0!==this.clearCoat&&(d.clearCoat=this.clearCoat);void 0!==this.clearCoatRoughness&&(d.clearCoatRoughness=\nthis.clearCoatRoughness);this.map&&this.map.isTexture&&(d.map=this.map.toJSON(a).uuid);this.alphaMap&&this.alphaMap.isTexture&&(d.alphaMap=this.alphaMap.toJSON(a).uuid);this.lightMap&&this.lightMap.isTexture&&(d.lightMap=this.lightMap.toJSON(a).uuid);this.aoMap&&this.aoMap.isTexture&&(d.aoMap=this.aoMap.toJSON(a).uuid,d.aoMapIntensity=this.aoMapIntensity);this.bumpMap&&this.bumpMap.isTexture&&(d.bumpMap=this.bumpMap.toJSON(a).uuid,d.bumpScale=this.bumpScale);this.normalMap&&this.normalMap.isTexture&&\n(d.normalMap=this.normalMap.toJSON(a).uuid,d.normalMapType=this.normalMapType,d.normalScale=this.normalScale.toArray());this.displacementMap&&this.displacementMap.isTexture&&(d.displacementMap=this.displacementMap.toJSON(a).uuid,d.displacementScale=this.displacementScale,d.displacementBias=this.displacementBias);this.roughnessMap&&this.roughnessMap.isTexture&&(d.roughnessMap=this.roughnessMap.toJSON(a).uuid);this.metalnessMap&&this.metalnessMap.isTexture&&(d.metalnessMap=this.metalnessMap.toJSON(a).uuid);\nthis.emissiveMap&&this.emissiveMap.isTexture&&(d.emissiveMap=this.emissiveMap.toJSON(a).uuid);this.specularMap&&this.specularMap.isTexture&&(d.specularMap=this.specularMap.toJSON(a).uuid);this.envMap&&this.envMap.isTexture&&(d.envMap=this.envMap.toJSON(a).uuid,d.reflectivity=this.reflectivity);this.gradientMap&&this.gradientMap.isTexture&&(d.gradientMap=this.gradientMap.toJSON(a).uuid);void 0!==this.size&&(d.size=this.size);void 0!==this.sizeAttenuation&&(d.sizeAttenuation=this.sizeAttenuation);1!==\nthis.blending&&(d.blending=this.blending);!0===this.flatShading&&(d.flatShading=this.flatShading);0!==this.side&&(d.side=this.side);0!==this.vertexColors&&(d.vertexColors=this.vertexColors);1>this.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc;d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;0!==this.rotation&&(d.rotation=this.rotation);1!==this.linewidth&&(d.linewidth=this.linewidth);void 0!==this.dashSize&&(d.dashSize=\nthis.dashSize);void 0!==this.gapSize&&(d.gapSize=this.gapSize);void 0!==this.scale&&(d.scale=this.scale);!0===this.dithering&&(d.dithering=!0);0<this.alphaTest&&(d.alphaTest=this.alphaTest);!0===this.premultipliedAlpha&&(d.premultipliedAlpha=this.premultipliedAlpha);!0===this.wireframe&&(d.wireframe=this.wireframe);1<this.wireframeLinewidth&&(d.wireframeLinewidth=this.wireframeLinewidth);\"round\"!==this.wireframeLinecap&&(d.wireframeLinecap=this.wireframeLinecap);\"round\"!==this.wireframeLinejoin&&\n(d.wireframeLinejoin=this.wireframeLinejoin);!0===this.morphTargets&&(d.morphTargets=!0);!0===this.skinning&&(d.skinning=!0);!1===this.visible&&(d.visible=!1);\"{}\"!==JSON.stringify(this.userData)&&(d.userData=this.userData);c&&(c=b(a.textures),a=b(a.images),0<c.length&&(d.textures=c),0<a.length&&(d.images=a));return d},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.name=a.name;this.fog=a.fog;this.lights=a.lights;this.blending=a.blending;this.side=a.side;this.flatShading=\na.flatShading;this.vertexColors=a.vertexColors;this.opacity=a.opacity;this.transparent=a.transparent;this.blendSrc=a.blendSrc;this.blendDst=a.blendDst;this.blendEquation=a.blendEquation;this.blendSrcAlpha=a.blendSrcAlpha;this.blendDstAlpha=a.blendDstAlpha;this.blendEquationAlpha=a.blendEquationAlpha;this.depthFunc=a.depthFunc;this.depthTest=a.depthTest;this.depthWrite=a.depthWrite;this.colorWrite=a.colorWrite;this.precision=a.precision;this.polygonOffset=a.polygonOffset;this.polygonOffsetFactor=a.polygonOffsetFactor;\nthis.polygonOffsetUnits=a.polygonOffsetUnits;this.dithering=a.dithering;this.alphaTest=a.alphaTest;this.premultipliedAlpha=a.premultipliedAlpha;this.overdraw=a.overdraw;this.visible=a.visible;this.userData=JSON.parse(JSON.stringify(a.userData));this.clipShadows=a.clipShadows;this.clipIntersection=a.clipIntersection;var b=a.clippingPlanes,c=null;if(null!==b){var d=b.length;c=Array(d);for(var e=0;e!==d;++e)c[e]=b[e].clone()}this.clippingPlanes=c;this.shadowSide=a.shadowSide;return this},dispose:function(){this.dispatchEvent({type:\"dispose\"})}});\nua.prototype=Object.create(I.prototype);ua.prototype.constructor=ua;ua.prototype.isMeshBasicMaterial=!0;ua.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=\na.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;return this};Fa.prototype=Object.create(I.prototype);Fa.prototype.constructor=Fa;Fa.prototype.isShaderMaterial=!0;Fa.prototype.copy=function(a){I.prototype.copy.call(this,a);this.fragmentShader=a.fragmentShader;this.vertexShader=a.vertexShader;this.uniforms=Ba.clone(a.uniforms);this.defines=Object.assign({},\na.defines);this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.lights=a.lights;this.clipping=a.clipping;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;this.extensions=a.extensions;return this};Fa.prototype.toJSON=function(a){a=I.prototype.toJSON.call(this,a);a.uniforms=this.uniforms;a.vertexShader=this.vertexShader;a.fragmentShader=this.fragmentShader;return a};Object.assign(sb.prototype,{set:function(a,b){this.origin.copy(a);this.direction.copy(b);\nreturn this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){void 0===b&&(console.warn(\"THREE.Ray: .at() target is now required\"),b=new p);return b.copy(this.direction).multiplyScalar(a).add(this.origin)},lookAt:function(a){this.direction.copy(a).sub(this.origin).normalize();return this},recast:function(){var a=new p;return function(b){this.origin.copy(this.at(b,a));return this}}(),\nclosestPointToPoint:function(a,b){void 0===b&&(console.warn(\"THREE.Ray: .closestPointToPoint() target is now required\"),b=new p);b.subVectors(a,this.origin);a=b.dot(this.direction);return 0>a?b.copy(this.origin):b.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new p;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);\na.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(),distanceSqToSegment:function(){var a=new p,b=new p,c=new p;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),l=-this.direction.dot(b),m=c.dot(this.direction),k=-c.dot(b),n=c.lengthSq(),p=Math.abs(1-l*l);if(0<p){d=l*k-m;e=l*m-k;var q=h*p;0<=d?e>=-q?e<=q?(h=1/p,d*=h,e*=h,l=d*(d+l*e+2*m)+e*(l*d+e+2*k)+n):(e=h,d=Math.max(0,\n-(l*e+m)),l=-d*d+e*(e+2*k)+n):(e=-h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+n):e<=-q?(d=Math.max(0,-(-l*h+m)),e=0<d?-h:Math.min(Math.max(-h,-k),h),l=-d*d+e*(e+2*k)+n):e<=q?(d=0,e=Math.min(Math.max(-h,-k),h),l=e*(e+2*k)+n):(d=Math.max(0,-(l*h+m)),e=0<d?h:Math.min(Math.max(-h,-k),h),l=-d*d+e*(e+2*k)+n)}else e=0<l?-h:h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+n;f&&f.copy(this.direction).multiplyScalar(d).add(this.origin);g&&g.copy(b).multiplyScalar(e).add(a);return l}}(),intersectSphere:function(){var a=\nnew p;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d;b=b.radius*b.radius;if(e>b)return null;b=Math.sqrt(b-e);e=d-b;d+=b;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),intersectsSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,\nb){a=this.distanceToPlane(a);return null===a?null:this.at(a,b)},intersectsPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},intersectBox:function(a,b){var c=1/this.direction.x;var d=1/this.direction.y;var e=1/this.direction.z,f=this.origin;if(0<=c){var g=(a.min.x-f.x)*c;c*=a.max.x-f.x}else g=(a.max.x-f.x)*c,c*=a.min.x-f.x;if(0<=d){var h=(a.min.y-f.y)*d;d*=a.max.y-f.y}else h=(a.max.y-f.y)*d,d*=a.min.y-f.y;if(g>d||h>c)return null;if(h>g||g!==\ng)g=h;if(d<c||c!==c)c=d;0<=e?(h=(a.min.z-f.z)*e,a=(a.max.z-f.z)*e):(h=(a.max.z-f.z)*e,a=(a.min.z-f.z)*e);if(g>a||h>c)return null;if(h>g||g!==g)g=h;if(a<c||c!==c)c=a;return 0>c?null:this.at(0<=g?g:c,b)},intersectsBox:function(){var a=new p;return function(b){return null!==this.intersectBox(b,a)}}(),intersectTriangle:function(){var a=new p,b=new p,c=new p,d=new p;return function(e,f,g,h,l){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0<f){if(h)return null;h=1}else if(0>\nf)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/f,l)}}(),applyMatrix4:function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}});Object.assign(Qb.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);\nreturn this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},getCenter:function(a){void 0===a&&(console.warn(\"THREE.Line3: .getCenter() target is now required\"),a=new p);return a.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){void 0===a&&(console.warn(\"THREE.Line3: .delta() target is now required\"),a=new p);return a.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},\ndistance:function(){return this.start.distanceTo(this.end)},at:function(a,b){void 0===b&&(console.warn(\"THREE.Line3: .at() target is now required\"),b=new p);return this.delta(b).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new p,b=new p;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);c=b.dot(b);c=b.dot(a)/c;d&&(c=J.clamp(c,0,1));return c}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);void 0===c&&\n(console.warn(\"THREE.Line3: .closestPointToPoint() target is now required\"),c=new p);return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a);this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}});Object.assign(ta,{getNormal:function(){var a=new p;return function(b,c,d,e){void 0===e&&(console.warn(\"THREE.Triangle: .getNormal() target is now required\"),e=new p);e.subVectors(d,c);a.subVectors(b,\nc);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}(),getBarycoord:function(){var a=new p,b=new p,c=new p;return function(d,e,f,g,h){a.subVectors(g,e);b.subVectors(f,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);f=a.dot(c);var l=b.dot(b);g=b.dot(c);var m=d*l-e*e;void 0===h&&(console.warn(\"THREE.Triangle: .getBarycoord() target is now required\"),h=new p);if(0===m)return h.set(-2,-1,-1);m=1/m;l=(l*f-e*g)*m;d=(d*g-e*f)*m;return h.set(1-l-d,d,l)}}(),containsPoint:function(){var a=\nnew p;return function(b,c,d,e){ta.getBarycoord(b,c,d,e,a);return 0<=a.x&&0<=a.y&&1>=a.x+a.y}}()});Object.assign(ta.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){var a=new p,b=new p;return function(){a.subVectors(this.c,\nthis.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),getMidpoint:function(a){void 0===a&&(console.warn(\"THREE.Triangle: .getMidpoint() target is now required\"),a=new p);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return ta.getNormal(this.a,this.b,this.c,a)},getPlane:function(a){void 0===a&&(console.warn(\"THREE.Triangle: .getPlane() target is now required\"),a=new p);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,\nb){return ta.getBarycoord(a,this.a,this.b,this.c,b)},containsPoint:function(a){return ta.containsPoint(a,this.a,this.b,this.c)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(){var a=new Ia,b=[new Qb,new Qb,new Qb],c=new p,d=new p;return function(e,f){void 0===f&&(console.warn(\"THREE.Triangle: .closestPointToPoint() target is now required\"),f=new p);var g=Infinity;a.setFromCoplanarPoints(this.a,this.b,this.c);a.projectPoint(e,c);if(!0===this.containsPoint(c))f.copy(c);\nelse for(b[0].set(this.a,this.b),b[1].set(this.b,this.c),b[2].set(this.c,this.a),e=0;e<b.length;e++){b[e].closestPointToPoint(c,!0,d);var h=c.distanceToSquared(d);h<g&&(g=h,f.copy(d))}return f}}(),equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});va.prototype=Object.assign(Object.create(H.prototype),{constructor:va,isMesh:!0,setDrawMode:function(a){this.drawMode=a},copy:function(a){H.prototype.copy.call(this,a);this.drawMode=a.drawMode;void 0!==a.morphTargetInfluences&&\n(this.morphTargetInfluences=a.morphTargetInfluences.slice());void 0!==a.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},a.morphTargetDictionary));return this},updateMorphTargets:function(){var a=this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var b=Object.keys(a);if(0<b.length){var c=a[b[0]];if(void 0!==c)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},a=0,b=c.length;a<b;a++){var d=c[a].name||String(a);this.morphTargetInfluences.push(0);this.morphTargetDictionary[d]=\na}}}else if(c=a.morphTargets,void 0!==c&&0<c.length)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},a=0,b=c.length;a<b;a++)d=c[a].name||String(a),this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=a},raycast:function(){function a(a,b,c,d,e,f,g){ta.getBarycoord(a,b,c,d,u);e.multiplyScalar(u.x);f.multiplyScalar(u.y);g.multiplyScalar(u.z);e.add(f).add(g);return e.clone()}function b(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,\nf,g,2!==b.side,h)))return null;w.copy(h);w.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(w);return b<c.near||b>c.far?null:{distance:b,point:w.clone(),object:a}}function c(c,d,e,f,m,k,n,p,v){g.fromBufferAttribute(m,n);h.fromBufferAttribute(m,p);l.fromBufferAttribute(m,v);if(c=b(c,d,e,f,g,h,l,y))k&&(t.fromBufferAttribute(k,n),q.fromBufferAttribute(k,p),r.fromBufferAttribute(k,v),c.uv=a(y,g,h,l,t,q,r)),k=new Ya(n,p,v),ta.getNormal(g,h,l,k.normal),c.face=k;return c}var d=new R,e=new sb,f=new Ha,\ng=new p,h=new p,l=new p,m=new p,k=new p,n=new p,t=new B,q=new B,r=new B,u=new p,y=new p,w=new p;return function(p,v){var u=this.geometry,x=this.material,w=this.matrixWorld;if(void 0!==x&&(null===u.boundingSphere&&u.computeBoundingSphere(),f.copy(u.boundingSphere),f.applyMatrix4(w),!1!==p.ray.intersectsSphere(f)&&(d.getInverse(w),e.copy(p.ray).applyMatrix4(d),null===u.boundingBox||!1!==e.intersectsBox(u.boundingBox))))if(u.isBufferGeometry){var A=u.index,z=u.attributes.position,B=u.attributes.uv,H=\nu.groups;u=u.drawRange;var G;if(null!==A)if(Array.isArray(x)){var D=0;for(G=H.length;D<G;D++){var E=H[D];var J=x[E.materialIndex];w=Math.max(E.start,u.start);var L=Math.min(E.start+E.count,u.start+u.count);for(E=w;E<L;E+=3){w=A.getX(D);var I=A.getX(D+1);var K=A.getX(D+2);if(w=c(this,J,p,e,z,B,w,I,K))w.faceIndex=Math.floor(D/3),v.push(w)}}}else for(w=Math.max(0,u.start),L=Math.min(A.count,u.start+u.count),D=w,G=L;D<G;D+=3){if(w=A.getX(D),I=A.getX(D+1),K=A.getX(D+2),w=c(this,x,p,e,z,B,w,I,K))w.faceIndex=\nMath.floor(D/3),v.push(w)}else if(void 0!==z)if(Array.isArray(x))for(D=0,G=H.length;D<G;D++)for(E=H[D],J=x[E.materialIndex],w=Math.max(E.start,u.start),L=Math.min(E.start+E.count,u.start+u.count),E=w;E<L;E+=3){if(w=E,I=E+1,K=E+2,w=c(this,J,p,e,z,B,w,I,K))w.faceIndex=Math.floor(D/3),v.push(w)}else for(w=Math.max(0,u.start),L=Math.min(z.count,u.start+u.count),D=w,G=L;D<G;D+=3)if(w=D,I=D+1,K=D+2,w=c(this,x,p,e,z,B,w,I,K))w.faceIndex=Math.floor(D/3),v.push(w)}else if(u.isGeometry)for(z=Array.isArray(x),\nB=u.vertices,H=u.faces,w=u.faceVertexUvs[0],0<w.length&&(A=w),E=0,L=H.length;E<L;E++)if(I=H[E],w=z?x[I.materialIndex]:x,void 0!==w){D=B[I.a];G=B[I.b];J=B[I.c];if(!0===w.morphTargets){K=u.morphTargets;var R=this.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);l.set(0,0,0);for(var P=0,S=K.length;P<S;P++){var T=R[P];if(0!==T){var W=K[P].vertices;g.addScaledVector(m.subVectors(W[I.a],D),T);h.addScaledVector(k.subVectors(W[I.b],G),T);l.addScaledVector(n.subVectors(W[I.c],J),T)}}g.add(D);h.add(G);l.add(J);\nD=g;G=h;J=l}if(w=b(this,w,p,e,D,G,J,y))A&&A[E]&&(K=A[E],t.copy(K[0]),q.copy(K[1]),r.copy(K[2]),w.uv=a(y,D,G,J,t,q,r)),w.face=I,w.faceIndex=E,v.push(w)}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});Za.prototype=Object.create(ea.prototype);Za.prototype.constructor=Za;Za.prototype.isCubeTexture=!0;Object.defineProperty(Za.prototype,\"images\",{get:function(){return this.image},set:function(a){this.image=a}});var Oe=new ea,Pe=new Za,Ie=[],Ke=[],Ne=new Float32Array(16),\nMe=new Float32Array(9),Le=new Float32Array(4);Te.prototype.updateCache=function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));qa(b,a)};Ue.prototype.setValue=function(a,b){for(var c=this.seq,d=0,e=c.length;d!==e;++d){var f=c[d];f.setValue(a,b[f.id])}};var Xd=/([\\w\\d_]+)(\\])?(\\[|\\.)?/g;eb.prototype.setValue=function(a,b,c){b=this.map[b];void 0!==b&&b.setValue(a,c,this.renderer)};eb.prototype.setOptional=function(a,b,c){b=b[c];void 0!==b&&\nthis.setValue(a,c,b)};eb.upload=function(a,b,c,d){for(var e=0,f=b.length;e!==f;++e){var g=b[e],h=c[g.id];!1!==h.needsUpdate&&g.setValue(a,h.value,d)}};eb.seqWithValue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var f=a[d];f.id in b&&c.push(f)}return c};var yg=0,Hg=0;fb.prototype=Object.create(I.prototype);fb.prototype.constructor=fb;fb.prototype.isMeshDepthMaterial=!0;fb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.depthPacking=a.depthPacking;this.skinning=a.skinning;this.morphTargets=\na.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;return this};gb.prototype=Object.create(I.prototype);gb.prototype.constructor=gb;gb.prototype.isMeshDistanceMaterial=!0;gb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.referencePosition.copy(a.referencePosition);this.nearDistance=a.nearDistance;\nthis.farDistance=a.farDistance;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;return this};Sb.prototype=Object.create(ea.prototype);Sb.prototype.constructor=Sb;Sb.prototype.isCanvasTexture=!0;Ub.prototype=Object.assign(Object.create(H.prototype),{constructor:Ub,isGroup:!0});Z.prototype=Object.assign(Object.create(Ra.prototype),\n{constructor:Z,isPerspectiveCamera:!0,copy:function(a,b){Ra.prototype.copy.call(this,a,b);this.fov=a.fov;this.zoom=a.zoom;this.near=a.near;this.far=a.far;this.focus=a.focus;this.aspect=a.aspect;this.view=null===a.view?null:Object.assign({},a.view);this.filmGauge=a.filmGauge;this.filmOffset=a.filmOffset;return this},setFocalLength:function(a){a=.5*this.getFilmHeight()/a;this.fov=2*J.RAD2DEG*Math.atan(a);this.updateProjectionMatrix()},getFocalLength:function(){var a=Math.tan(.5*J.DEG2RAD*this.fov);\nreturn.5*this.getFilmHeight()/a},getEffectiveFOV:function(){return 2*J.RAD2DEG*Math.atan(Math.tan(.5*J.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(a,b,c,d,e,f){this.aspect=a/b;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=a;this.view.fullHeight=b;this.view.offsetX=\nc;this.view.offsetY=d;this.view.width=e;this.view.height=f;this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1);this.updateProjectionMatrix()},updateProjectionMatrix:function(){var a=this.near,b=a*Math.tan(.5*J.DEG2RAD*this.fov)/this.zoom,c=2*b,d=this.aspect*c,e=-.5*d,f=this.view;if(null!==this.view&&this.view.enabled){var g=f.fullWidth,h=f.fullHeight;e+=f.offsetX*d/g;b-=f.offsetY*c/h;d*=f.width/g;c*=f.height/h}f=this.filmOffset;0!==f&&(e+=a*f/this.getFilmWidth());\nthis.projectionMatrix.makePerspective(e,e+d,b,b-c,a,this.far)},toJSON:function(a){a=H.prototype.toJSON.call(this,a);a.object.fov=this.fov;a.object.zoom=this.zoom;a.object.near=this.near;a.object.far=this.far;a.object.focus=this.focus;a.object.aspect=this.aspect;null!==this.view&&(a.object.view=Object.assign({},this.view));a.object.filmGauge=this.filmGauge;a.object.filmOffset=this.filmOffset;return a}});Hc.prototype=Object.assign(Object.create(Z.prototype),{constructor:Hc,isArrayCamera:!0});Vb.prototype.isFogExp2=\n!0;Vb.prototype.clone=function(){return new Vb(this.color,this.density)};Vb.prototype.toJSON=function(){return{type:\"FogExp2\",color:this.color.getHex(),density:this.density}};Wb.prototype.isFog=!0;Wb.prototype.clone=function(){return new Wb(this.color,this.near,this.far)};Wb.prototype.toJSON=function(){return{type:\"Fog\",color:this.color.getHex(),near:this.near,far:this.far}};vd.prototype=Object.assign(Object.create(H.prototype),{constructor:vd,copy:function(a,b){H.prototype.copy.call(this,a,b);null!==\na.background&&(this.background=a.background.clone());null!==a.fog&&(this.fog=a.fog.clone());null!==a.overrideMaterial&&(this.overrideMaterial=a.overrideMaterial.clone());this.autoUpdate=a.autoUpdate;this.matrixAutoUpdate=a.matrixAutoUpdate;return this},toJSON:function(a){var b=H.prototype.toJSON.call(this,a);null!==this.background&&(b.object.background=this.background.toJSON(a));null!==this.fog&&(b.object.fog=this.fog.toJSON());return b}});ib.prototype=Object.create(I.prototype);ib.prototype.constructor=\nib;ib.prototype.isSpriteMaterial=!0;ib.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.rotation=a.rotation;return this};Ic.prototype=Object.assign(Object.create(H.prototype),{constructor:Ic,isSprite:!0,raycast:function(){function a(a,b,c,d,h,l){e.subVectors(a,c).addScalar(.5).multiply(d);void 0!==h?(f.x=l*e.x-h*e.y,f.y=h*e.x+l*e.y):f.copy(e);a.copy(b);a.x+=f.x;a.y+=f.y;a.applyMatrix4(g)}var b=new p,c=new p,d=new p,e=new B,f=new B,g=new R,h=new p,\nl=new p,m=new p;return function(e,f){c.setFromMatrixScale(this.matrixWorld);g.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld);d.setFromMatrixPosition(this.modelViewMatrix);var k=this.material.rotation;if(0!==k){var n=Math.cos(k);var p=Math.sin(k)}k=this.center;a(h.set(-.5,-.5,0),d,k,c,p,n);a(l.set(.5,-.5,0),d,k,c,p,n);a(m.set(.5,.5,0),d,k,c,p,n);var v=e.ray.intersectTriangle(h,l,m,!1,b);if(null===v&&(a(l.set(-.5,.5,0),d,k,c,p,n),v=e.ray.intersectTriangle(h,m,l,!1,b),null===v))return;\np=e.ray.origin.distanceTo(b);p<e.near||p>e.far||f.push({distance:p,point:b.clone(),face:null,object:this})}}(),clone:function(){return(new this.constructor(this.material)).copy(this)},copy:function(a){H.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}});Jc.prototype=Object.assign(Object.create(H.prototype),{constructor:Jc,copy:function(a){H.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b<c;b++){var d=a[b];this.addLevel(d.object.clone(),d.distance)}return this},\naddLevel:function(a,b){void 0===b&&(b=0);b=Math.abs(b);for(var c=this.levels,d=0;d<c.length&&!(b<c[d].distance);d++);c.splice(d,0,{distance:b,object:a});this.add(a)},getObjectForDistance:function(a){for(var b=this.levels,c=1,d=b.length;c<d&&!(a<b[c].distance);c++);return b[c-1].object},raycast:function(){var a=new p;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}(),update:function(){var a=new p,b=new p;return function(c){var d=\nthis.levels;if(1<d.length){a.setFromMatrixPosition(c.matrixWorld);b.setFromMatrixPosition(this.matrixWorld);c=a.distanceTo(b);d[0].object.visible=!0;for(var e=1,f=d.length;e<f;e++)if(c>=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;e<f;e++)d[e].object.visible=!1}}}(),toJSON:function(a){a=H.prototype.toJSON.call(this,a);a.object.levels=[];for(var b=this.levels,c=0,d=b.length;c<d;c++){var e=b[c];a.object.levels.push({object:e.object.uuid,distance:e.distance})}return a}});\nObject.assign(Kc.prototype,{calculateInverses:function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new R;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}},pose:function(){var a,b;var c=0;for(b=this.bones.length;c<b;c++)(a=this.bones[c])&&a.matrixWorld.getInverse(this.boneInverses[c]);c=0;for(b=this.bones.length;c<b;c++)if(a=this.bones[c])a.parent&&a.parent.isBone?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):\na.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale)},update:function(){var a=new R,b=new R;return function(){for(var c=this.bones,d=this.boneInverses,e=this.boneMatrices,f=this.boneTexture,g=0,h=c.length;g<h;g++)a.multiplyMatrices(c[g]?c[g].matrixWorld:b,d[g]),a.toArray(e,16*g);void 0!==f&&(f.needsUpdate=!0)}}(),clone:function(){return new Kc(this.bones,this.boneInverses)},getBoneByName:function(a){for(var b=0,c=this.bones.length;b<c;b++){var d=this.bones[b];if(d.name===\na)return d}}});wd.prototype=Object.assign(Object.create(H.prototype),{constructor:wd,isBone:!0});xd.prototype=Object.assign(Object.create(va.prototype),{constructor:xd,isSkinnedMesh:!0,initBones:function(){var a=[],b;if(this.geometry&&void 0!==this.geometry.bones){var c=0;for(b=this.geometry.bones.length;c<b;c++){var d=this.geometry.bones[c];var e=new wd;a.push(e);e.name=d.name;e.position.fromArray(d.pos);e.quaternion.fromArray(d.rotq);void 0!==d.scl&&e.scale.fromArray(d.scl)}c=0;for(b=this.geometry.bones.length;c<\nb;c++)d=this.geometry.bones[c],-1!==d.parent&&null!==d.parent&&void 0!==a[d.parent]?a[d.parent].add(a[c]):this.add(a[c])}this.updateMatrixWorld(!0);return a},bind:function(a,b){this.skeleton=a;void 0===b&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),b=this.matrixWorld);this.bindMatrix.copy(b);this.bindMatrixInverse.getInverse(b)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var a;if(this.geometry&&this.geometry.isGeometry)for(a=0;a<this.geometry.skinWeights.length;a++){var b=\nthis.geometry.skinWeights[a];var c=1/b.manhattanLength();Infinity!==c?b.multiplyScalar(c):b.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){b=new W;var d=this.geometry.attributes.skinWeight;for(a=0;a<d.count;a++)b.x=d.getX(a),b.y=d.getY(a),b.z=d.getZ(a),b.w=d.getW(a),c=1/b.manhattanLength(),Infinity!==c?b.multiplyScalar(c):b.set(1,0,0,0),d.setXYZW(a,b.x,b.y,b.z,b.w)}},updateMatrixWorld:function(a){va.prototype.updateMatrixWorld.call(this,a);\"attached\"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):\n\"detached\"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn(\"THREE.SkinnedMesh: Unrecognized bindMode: \"+this.bindMode)},clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});T.prototype=Object.create(I.prototype);T.prototype.constructor=T;T.prototype.isLineBasicMaterial=!0;T.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.linewidth=a.linewidth;this.linecap=a.linecap;this.linejoin=a.linejoin;return this};\nwa.prototype=Object.assign(Object.create(H.prototype),{constructor:wa,isLine:!0,computeLineDistances:function(){var a=new p,b=new p;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[0],f=1,g=d.count;f<g;f++)a.fromBufferAttribute(d,f-1),b.fromBufferAttribute(d,f),e[f]=e[f-1],e[f]+=a.distanceTo(b);c.addAttribute(\"lineDistance\",new z(e,1))}else console.warn(\"THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\");\nelse if(c.isGeometry)for(d=c.vertices,e=c.lineDistances,e[0]=0,f=1,g=d.length;f<g;f++)e[f]=e[f-1],e[f]+=d[f-1].distanceTo(d[f]);return this}}(),raycast:function(){var a=new R,b=new sb,c=new Ha;return function(d,e){var f=d.linePrecision;f*=f;var g=this.geometry,h=this.matrixWorld;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(h);if(!1!==d.ray.intersectsSphere(c)){a.getInverse(h);b.copy(d.ray).applyMatrix4(a);var l=new p,m=new p;h=new p;var k=new p,n=this&&\nthis.isLineSegments?2:1;if(g.isBufferGeometry){var t=g.index,q=g.attributes.position.array;if(null!==t){t=t.array;g=0;for(var r=t.length-1;g<r;g+=n){var u=t[g+1];l.fromArray(q,3*t[g]);m.fromArray(q,3*u);u=b.distanceSqToSegment(l,m,k,h);u>f||(k.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(k),u<d.near||u>d.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}else for(g=0,r=q.length/3-1;g<r;g+=n)l.fromArray(q,3*g),m.fromArray(q,\n3*g+3),u=b.distanceSqToSegment(l,m,k,h),u>f||(k.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(k),u<d.near||u>d.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g.isGeometry)for(l=g.vertices,m=l.length,g=0;g<m-1;g+=n)u=b.distanceSqToSegment(l[g],l[g+1],k,h),u>f||(k.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(k),u<d.near||u>d.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,\nface:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});Y.prototype=Object.assign(Object.create(wa.prototype),{constructor:Y,isLineSegments:!0,computeLineDistances:function(){var a=new p,b=new p;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[],f=0,g=d.count;f<g;f+=2)a.fromBufferAttribute(d,f),b.fromBufferAttribute(d,f+1),e[f]=0===f?0:e[f-1],e[f+1]=e[f]+a.distanceTo(b);\nc.addAttribute(\"lineDistance\",new z(e,1))}else console.warn(\"THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.\");else if(c.isGeometry)for(d=c.vertices,e=c.lineDistances,f=0,g=d.length;f<g;f+=2)a.copy(d[f]),b.copy(d[f+1]),e[f]=0===f?0:e[f-1],e[f+1]=e[f]+a.distanceTo(b);return this}}()});yd.prototype=Object.assign(Object.create(wa.prototype),{constructor:yd,isLineLoop:!0});Ja.prototype=Object.create(I.prototype);Ja.prototype.constructor=Ja;Ja.prototype.isPointsMaterial=\n!0;Ja.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.size=a.size;this.sizeAttenuation=a.sizeAttenuation;this.morphTargets=a.morphTargets;return this};Xb.prototype=Object.assign(Object.create(H.prototype),{constructor:Xb,isPoints:!0,raycast:function(){var a=new R,b=new sb,c=new Ha;return function(d,e){function f(a,c){var f=b.distanceSqToPoint(a);f<k&&(b.closestPointToPoint(a,n),n.applyMatrix4(l),a=d.ray.origin.distanceTo(n),a<d.near||a>d.far||\ne.push({distance:a,distanceToRay:Math.sqrt(f),point:n.clone(),index:c,face:null,object:g}))}var g=this,h=this.geometry,l=this.matrixWorld,m=d.params.Points.threshold;null===h.boundingSphere&&h.computeBoundingSphere();c.copy(h.boundingSphere);c.applyMatrix4(l);c.radius+=m;if(!1!==d.ray.intersectsSphere(c)){a.getInverse(l);b.copy(d.ray).applyMatrix4(a);m/=(this.scale.x+this.scale.y+this.scale.z)/3;var k=m*m;m=new p;var n=new p;if(h.isBufferGeometry){var t=h.index;h=h.attributes.position.array;if(null!==\nt){var q=t.array;t=0;for(var r=q.length;t<r;t++){var u=q[t];m.fromArray(h,3*u);f(m,u)}}else for(t=0,q=h.length/3;t<q;t++)m.fromArray(h,3*t),f(m,t)}else for(m=h.vertices,t=0,q=m.length;t<q;t++)f(m[t],t)}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});be.prototype=Object.assign(Object.create(ea.prototype),{constructor:be,isVideoTexture:!0,update:function(){var a=this.image;a.readyState>=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Yb.prototype=Object.create(ea.prototype);\nYb.prototype.constructor=Yb;Yb.prototype.isCompressedTexture=!0;Lc.prototype=Object.create(ea.prototype);Lc.prototype.constructor=Lc;Lc.prototype.isDepthTexture=!0;Zb.prototype=Object.create(D.prototype);Zb.prototype.constructor=Zb;Mc.prototype=Object.create(P.prototype);Mc.prototype.constructor=Mc;$b.prototype=Object.create(D.prototype);$b.prototype.constructor=$b;Nc.prototype=Object.create(P.prototype);Nc.prototype.constructor=Nc;xa.prototype=Object.create(D.prototype);xa.prototype.constructor=\nxa;Oc.prototype=Object.create(P.prototype);Oc.prototype.constructor=Oc;ac.prototype=Object.create(xa.prototype);ac.prototype.constructor=ac;Pc.prototype=Object.create(P.prototype);Pc.prototype.constructor=Pc;ub.prototype=Object.create(xa.prototype);ub.prototype.constructor=ub;Qc.prototype=Object.create(P.prototype);Qc.prototype.constructor=Qc;bc.prototype=Object.create(xa.prototype);bc.prototype.constructor=bc;Rc.prototype=Object.create(P.prototype);Rc.prototype.constructor=Rc;cc.prototype=Object.create(xa.prototype);\ncc.prototype.constructor=cc;Sc.prototype=Object.create(P.prototype);Sc.prototype.constructor=Sc;dc.prototype=Object.create(D.prototype);dc.prototype.constructor=dc;Tc.prototype=Object.create(P.prototype);Tc.prototype.constructor=Tc;ec.prototype=Object.create(D.prototype);ec.prototype.constructor=ec;Uc.prototype=Object.create(P.prototype);Uc.prototype.constructor=Uc;fc.prototype=Object.create(D.prototype);fc.prototype.constructor=fc;var Ug={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?\nb[0]*c:a.length,f=cf(a,0,e,c,!0),g=[];if(!f)return g;var h;if(d){var l=c;d=[];var m;var k=0;for(m=b.length;k<m;k++){var n=b[k]*l;var p=k<m-1?b[k+1]*l:a.length;n=cf(a,n,p,l,!1);n===n.next&&(n.steiner=!0);d.push(Rg(n))}d.sort(Pg);for(k=0;k<d.length;k++){b=d[k];l=f;if(l=Qg(b,l))b=ff(l,b),Wc(b,b.next);f=Wc(f,f.next)}}if(a.length>80*c){var q=h=a[0];var r=d=a[1];for(l=c;l<e;l+=c)k=a[l],b=a[l+1],k<q&&(q=k),b<r&&(r=b),k>h&&(h=k),b>d&&(d=b);h=Math.max(h-q,d-r);h=0!==h?1/h:0}Xc(f,g,c,q,r,h);return g}},$a={area:function(a){for(var b=\na.length,c=0,d=b-1,e=0;e<b;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*c},isClockWise:function(a){return 0>$a.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];gf(a);hf(c,a);var f=a.length;b.forEach(gf);for(a=0;a<b.length;a++)d.push(f),f+=b[a].length,hf(c,b[a]);b=Ug.triangulate(c,d);for(a=0;a<b.length;a+=3)e.push(b.slice(a,a+3));return e}};wb.prototype=Object.create(P.prototype);wb.prototype.constructor=wb;wb.prototype.toJSON=function(){var a=P.prototype.toJSON.call(this);return jf(this.parameters.shapes,\nthis.parameters.options,a)};Ta.prototype=Object.create(D.prototype);Ta.prototype.constructor=Ta;Ta.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);return jf(this.parameters.shapes,this.parameters.options,a)};var Sg={generateTopUV:function(a,b,c,d,e){a=b[3*d];d=b[3*d+1];var f=b[3*e];e=b[3*e+1];return[new B(b[3*c],b[3*c+1]),new B(a,d),new B(f,e)]},generateSideWallUV:function(a,b,c,d,e,f){a=b[3*c];var g=b[3*c+1];c=b[3*c+2];var h=b[3*d],l=b[3*d+1];d=b[3*d+2];var m=b[3*e],k=b[3*e+1];e=\nb[3*e+2];var n=b[3*f],p=b[3*f+1];b=b[3*f+2];return.01>Math.abs(g-l)?[new B(a,1-c),new B(h,1-d),new B(m,1-e),new B(n,1-b)]:[new B(g,1-c),new B(l,1-d),new B(k,1-e),new B(p,1-b)]}};Zc.prototype=Object.create(P.prototype);Zc.prototype.constructor=Zc;gc.prototype=Object.create(Ta.prototype);gc.prototype.constructor=gc;$c.prototype=Object.create(P.prototype);$c.prototype.constructor=$c;xb.prototype=Object.create(D.prototype);xb.prototype.constructor=xb;ad.prototype=Object.create(P.prototype);ad.prototype.constructor=\nad;hc.prototype=Object.create(D.prototype);hc.prototype.constructor=hc;bd.prototype=Object.create(P.prototype);bd.prototype.constructor=bd;ic.prototype=Object.create(D.prototype);ic.prototype.constructor=ic;yb.prototype=Object.create(P.prototype);yb.prototype.constructor=yb;yb.prototype.toJSON=function(){var a=P.prototype.toJSON.call(this);return kf(this.parameters.shapes,a)};zb.prototype=Object.create(D.prototype);zb.prototype.constructor=zb;zb.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);\nreturn kf(this.parameters.shapes,a)};jc.prototype=Object.create(D.prototype);jc.prototype.constructor=jc;Ab.prototype=Object.create(P.prototype);Ab.prototype.constructor=Ab;ab.prototype=Object.create(D.prototype);ab.prototype.constructor=ab;cd.prototype=Object.create(Ab.prototype);cd.prototype.constructor=cd;dd.prototype=Object.create(ab.prototype);dd.prototype.constructor=dd;ed.prototype=Object.create(P.prototype);ed.prototype.constructor=ed;kc.prototype=Object.create(D.prototype);kc.prototype.constructor=\nkc;var ka=Object.freeze({WireframeGeometry:Zb,ParametricGeometry:Mc,ParametricBufferGeometry:$b,TetrahedronGeometry:Oc,TetrahedronBufferGeometry:ac,OctahedronGeometry:Pc,OctahedronBufferGeometry:ub,IcosahedronGeometry:Qc,IcosahedronBufferGeometry:bc,DodecahedronGeometry:Rc,DodecahedronBufferGeometry:cc,PolyhedronGeometry:Nc,PolyhedronBufferGeometry:xa,TubeGeometry:Sc,TubeBufferGeometry:dc,TorusKnotGeometry:Tc,TorusKnotBufferGeometry:ec,TorusGeometry:Uc,TorusBufferGeometry:fc,TextGeometry:Zc,TextBufferGeometry:gc,\nSphereGeometry:$c,SphereBufferGeometry:xb,RingGeometry:ad,RingBufferGeometry:hc,PlaneGeometry:Fc,PlaneBufferGeometry:rb,LatheGeometry:bd,LatheBufferGeometry:ic,ShapeGeometry:yb,ShapeBufferGeometry:zb,ExtrudeGeometry:wb,ExtrudeBufferGeometry:Ta,EdgesGeometry:jc,ConeGeometry:cd,ConeBufferGeometry:dd,CylinderGeometry:Ab,CylinderBufferGeometry:ab,CircleGeometry:ed,CircleBufferGeometry:kc,BoxGeometry:Nb,BoxBufferGeometry:pb});Bb.prototype=Object.create(I.prototype);Bb.prototype.constructor=Bb;Bb.prototype.isShadowMaterial=\n!0;Bb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);return this};lc.prototype=Object.create(Fa.prototype);lc.prototype.constructor=lc;lc.prototype.isRawShaderMaterial=!0;Ua.prototype=Object.create(I.prototype);Ua.prototype.constructor=Ua;Ua.prototype.isMeshStandardMaterial=!0;Ua.prototype.copy=function(a){I.prototype.copy.call(this,a);this.defines={STANDARD:\"\"};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=\na.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.roughnessMap=\na.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Cb.prototype=Object.create(Ua.prototype);Cb.prototype.constructor=Cb;\nCb.prototype.isMeshPhysicalMaterial=!0;Cb.prototype.copy=function(a){Ua.prototype.copy.call(this,a);this.defines={PHYSICAL:\"\"};this.reflectivity=a.reflectivity;this.clearCoat=a.clearCoat;this.clearCoatRoughness=a.clearCoatRoughness;return this};Ka.prototype=Object.create(I.prototype);Ka.prototype.constructor=Ka;Ka.prototype.isMeshPhongMaterial=!0;Ka.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=\na.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;\nthis.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Db.prototype=Object.create(Ka.prototype);Db.prototype.constructor=Db;\nDb.prototype.isMeshToonMaterial=!0;Db.prototype.copy=function(a){Ka.prototype.copy.call(this,a);this.gradientMap=a.gradientMap;return this};Eb.prototype=Object.create(I.prototype);Eb.prototype.constructor=Eb;Eb.prototype.isMeshNormalMaterial=!0;Eb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=\na.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Fb.prototype=Object.create(I.prototype);Fb.prototype.constructor=Fb;Fb.prototype.isMeshLambertMaterial=!0;Fb.prototype.copy=function(a){I.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;\nthis.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=\na.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Gb.prototype=Object.create(T.prototype);Gb.prototype.constructor=Gb;Gb.prototype.isLineDashedMaterial=!0;Gb.prototype.copy=function(a){T.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var Vg=Object.freeze({ShadowMaterial:Bb,SpriteMaterial:ib,RawShaderMaterial:lc,ShaderMaterial:Fa,PointsMaterial:Ja,MeshPhysicalMaterial:Cb,MeshStandardMaterial:Ua,MeshPhongMaterial:Ka,\nMeshToonMaterial:Db,MeshNormalMaterial:Eb,MeshLambertMaterial:Fb,MeshDepthMaterial:fb,MeshDistanceMaterial:gb,MeshBasicMaterial:ua,LineDashedMaterial:Gb,LineBasicMaterial:T,Material:I}),Kb={enabled:!1,files:{},add:function(a,b){!1!==this.enabled&&(this.files[a]=b)},get:function(a){if(!1!==this.enabled)return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}},ya=new ee,cb={};Object.assign(La.prototype,{load:function(a,b,c,d){void 0===a&&(a=\"\");void 0!==this.path&&\n(a=this.path+a);a=this.manager.resolveURL(a);var e=this,f=Kb.get(a);if(void 0!==f)return e.manager.itemStart(a),setTimeout(function(){b&&b(f);e.manager.itemEnd(a)},0),f;if(void 0!==cb[a])cb[a].push({onLoad:b,onProgress:c,onError:d});else{var g=a.match(/^data:(.*?)(;base64)?,(.*)$/);if(g){c=g[1];var h=!!g[2];g=g[3];g=window.decodeURIComponent(g);h&&(g=window.atob(g));try{var l=(this.responseType||\"\").toLowerCase();switch(l){case \"arraybuffer\":case \"blob\":var m=new Uint8Array(g.length);for(h=0;h<g.length;h++)m[h]=\ng.charCodeAt(h);var k=\"blob\"===l?new Blob([m.buffer],{type:c}):m.buffer;break;case \"document\":k=(new DOMParser).parseFromString(g,c);break;case \"json\":k=JSON.parse(g);break;default:k=g}window.setTimeout(function(){b&&b(k);e.manager.itemEnd(a)},0)}catch(t){window.setTimeout(function(){d&&d(t);e.manager.itemEnd(a);e.manager.itemError(a)},0)}}else{cb[a]=[];cb[a].push({onLoad:b,onProgress:c,onError:d});var n=new XMLHttpRequest;n.open(\"GET\",a,!0);n.addEventListener(\"load\",function(b){var c=this.response;\nKb.add(a,c);var d=cb[a];delete cb[a];if(200===this.status||0===this.status){0===this.status&&console.warn(\"THREE.FileLoader: HTTP Status 0 received.\");for(var f=0,g=d.length;f<g;f++){var h=d[f];if(h.onLoad)h.onLoad(c)}e.manager.itemEnd(a)}else{f=0;for(g=d.length;f<g;f++)if(h=d[f],h.onError)h.onError(b);e.manager.itemEnd(a);e.manager.itemError(a)}},!1);n.addEventListener(\"progress\",function(b){for(var c=cb[a],d=0,e=c.length;d<e;d++){var f=c[d];if(f.onProgress)f.onProgress(b)}},!1);n.addEventListener(\"error\",\nfunction(b){var c=cb[a];delete cb[a];for(var d=0,f=c.length;d<f;d++){var g=c[d];if(g.onError)g.onError(b)}e.manager.itemEnd(a);e.manager.itemError(a)},!1);void 0!==this.responseType&&(n.responseType=this.responseType);void 0!==this.withCredentials&&(n.withCredentials=this.withCredentials);n.overrideMimeType&&n.overrideMimeType(void 0!==this.mimeType?this.mimeType:\"text/plain\");for(h in this.requestHeader)n.setRequestHeader(h,this.requestHeader[h]);n.send(null)}e.manager.itemStart(a);return n}},setPath:function(a){this.path=\na;return this},setResponseType:function(a){this.responseType=a;return this},setWithCredentials:function(a){this.withCredentials=a;return this},setMimeType:function(a){this.mimeType=a;return this},setRequestHeader:function(a){this.requestHeader=a;return this}});Object.assign(lf.prototype,{load:function(a,b,c,d){function e(e){l.load(a[e],function(a){a=f._parser(a,!0);g[e]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};m+=1;6===m&&(1===a.mipmapCount&&(h.minFilter=1006),h.format=a.format,\nh.needsUpdate=!0,b&&b(h))},c,d)}var f=this,g=[],h=new Yb;h.image=g;var l=new La(this.manager);l.setPath(this.path);l.setResponseType(\"arraybuffer\");if(Array.isArray(a))for(var m=0,k=0,n=a.length;k<n;++k)e(k);else l.load(a,function(a){a=f._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,d=0;d<c;d++){g[d]={mipmaps:[]};for(var e=0;e<a.mipmapCount;e++)g[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+e]),g[d].format=a.format,g[d].width=a.width,g[d].height=a.height}else h.image.width=a.width,\nh.image.height=a.height,h.mipmaps=a.mipmaps;1===a.mipmapCount&&(h.minFilter=1006);h.format=a.format;h.needsUpdate=!0;b&&b(h)},c,d);return h},setPath:function(a){this.path=a;return this}});Object.assign(fe.prototype,{load:function(a,b,c,d){var e=this,f=new lb,g=new La(this.manager);g.setResponseType(\"arraybuffer\");g.load(a,function(a){if(a=e._parser(a))void 0!==a.image?f.image=a.image:void 0!==a.data&&(f.image.width=a.width,f.image.height=a.height,f.image.data=a.data),f.wrapS=void 0!==a.wrapS?a.wrapS:\n1001,f.wrapT=void 0!==a.wrapT?a.wrapT:1001,f.magFilter=void 0!==a.magFilter?a.magFilter:1006,f.minFilter=void 0!==a.minFilter?a.minFilter:1008,f.anisotropy=void 0!==a.anisotropy?a.anisotropy:1,void 0!==a.format&&(f.format=a.format),void 0!==a.type&&(f.type=a.type),void 0!==a.mipmaps&&(f.mipmaps=a.mipmaps),1===a.mipmapCount&&(f.minFilter=1006),f.needsUpdate=!0,b&&b(f,a)},c,d);return f}});Object.assign(fd.prototype,{crossOrigin:\"anonymous\",load:function(a,b,c,d){function e(){l.removeEventListener(\"load\",\ne,!1);l.removeEventListener(\"error\",f,!1);Kb.add(a,this);b&&b(this);g.manager.itemEnd(a)}function f(b){l.removeEventListener(\"load\",e,!1);l.removeEventListener(\"error\",f,!1);d&&d(b);g.manager.itemEnd(a);g.manager.itemError(a)}void 0===a&&(a=\"\");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var g=this,h=Kb.get(a);if(void 0!==h)return g.manager.itemStart(a),setTimeout(function(){b&&b(h);g.manager.itemEnd(a)},0),h;var l=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"img\");\nl.addEventListener(\"load\",e,!1);l.addEventListener(\"error\",f,!1);\"data:\"!==a.substr(0,5)&&void 0!==this.crossOrigin&&(l.crossOrigin=this.crossOrigin);g.manager.itemStart(a);l.src=a;return l},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(ge.prototype,{crossOrigin:\"anonymous\",load:function(a,b,c,d){function e(c){g.load(a[c],function(a){f.images[c]=a;h++;6===h&&(f.needsUpdate=!0,b&&b(f))},void 0,d)}var f=new Za,g=new fd(this.manager);\ng.setCrossOrigin(this.crossOrigin);g.setPath(this.path);var h=0;for(c=0;c<a.length;++c)e(c);return f},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(Ad.prototype,{crossOrigin:\"anonymous\",load:function(a,b,c,d){var e=new ea,f=new fd(this.manager);f.setCrossOrigin(this.crossOrigin);f.setPath(this.path);f.load(a,function(c){e.image=c;c=0<a.search(/\\.(jpg|jpeg)$/)||0===a.search(/^data:image\\/jpeg/);e.format=c?1022:1023;e.needsUpdate=\n!0;void 0!==b&&b(e)},c,d);return e},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(E.prototype,{getPoint:function(){console.warn(\"THREE.Curve: .getPoint() not implemented.\");return null},getPointAt:function(a,b){a=this.getUtoTmapping(a);return this.getPoint(a,b)},getPoints:function(a){void 0===a&&(a=5);for(var b=[],c=0;c<=a;c++)b.push(this.getPoint(c/a));return b},getSpacedPoints:function(a){void 0===a&&(a=5);for(var b=[],c=\n0;c<=a;c++)b.push(this.getPointAt(c/a));return b},getLength:function(){var a=this.getLengths();return a[a.length-1]},getLengths:function(a){void 0===a&&(a=this.arcLengthDivisions);if(this.cacheArcLengths&&this.cacheArcLengths.length===a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c=this.getPoint(0),d,e=0;b.push(0);for(d=1;d<=a;d++){var f=this.getPoint(d/a);e+=f.distanceTo(c);b.push(e);c=f}return this.cacheArcLengths=b},updateArcLengths:function(){this.needsUpdate=\n!0;this.getLengths()},getUtoTmapping:function(a,b){var c=this.getLengths(),d=c.length;b=b?b:a*c[d-1];for(var e=0,f=d-1,g;e<=f;)if(a=Math.floor(e+(f-e)/2),g=c[a]-b,0>g)e=a+1;else if(0<g)f=a-1;else{f=a;break}a=f;if(c[a]===b)return a/(d-1);e=c[a];return(a+(b-e)/(c[a+1]-e))/(d-1)},getTangent:function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()},getTangentAt:function(a){a=this.getUtoTmapping(a);return this.getTangent(a)},computeFrenetFrames:function(a,\nb){var c=new p,d=[],e=[],f=[],g=new p,h=new R,l;for(l=0;l<=a;l++){var m=l/a;d[l]=this.getTangentAt(m);d[l].normalize()}e[0]=new p;f[0]=new p;l=Number.MAX_VALUE;m=Math.abs(d[0].x);var k=Math.abs(d[0].y),n=Math.abs(d[0].z);m<=l&&(l=m,c.set(1,0,0));k<=l&&(l=k,c.set(0,1,0));n<=l&&c.set(0,0,1);g.crossVectors(d[0],c).normalize();e[0].crossVectors(d[0],g);f[0].crossVectors(d[0],e[0]);for(l=1;l<=a;l++)e[l]=e[l-1].clone(),f[l]=f[l-1].clone(),g.crossVectors(d[l-1],d[l]),g.length()>Number.EPSILON&&(g.normalize(),\nc=Math.acos(J.clamp(d[l-1].dot(d[l]),-1,1)),e[l].applyMatrix4(h.makeRotationAxis(g,c))),f[l].crossVectors(d[l],e[l]);if(!0===b)for(c=Math.acos(J.clamp(e[0].dot(e[a]),-1,1)),c/=a,0<d[0].dot(g.crossVectors(e[0],e[a]))&&(c=-c),l=1;l<=a;l++)e[l].applyMatrix4(h.makeRotationAxis(d[l],c*l)),f[l].crossVectors(d[l],e[l]);return{tangents:d,normals:e,binormals:f}},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.arcLengthDivisions=a.arcLengthDivisions;return this},toJSON:function(){var a=\n{metadata:{version:4.5,type:\"Curve\",generator:\"Curve.toJSON\"}};a.arcLengthDivisions=this.arcLengthDivisions;a.type=this.type;return a},fromJSON:function(a){this.arcLengthDivisions=a.arcLengthDivisions;return this}});Da.prototype=Object.create(E.prototype);Da.prototype.constructor=Da;Da.prototype.isEllipseCurve=!0;Da.prototype.getPoint=function(a,b){b=b||new B;for(var c=2*Math.PI,d=this.aEndAngle-this.aStartAngle,e=Math.abs(d)<Number.EPSILON;0>d;)d+=c;for(;d>c;)d-=c;d<Number.EPSILON&&(d=e?0:c);!0!==\nthis.aClockwise||e||(d=d===c?-c:d-c);c=this.aStartAngle+a*d;a=this.aX+this.xRadius*Math.cos(c);var f=this.aY+this.yRadius*Math.sin(c);0!==this.aRotation&&(c=Math.cos(this.aRotation),d=Math.sin(this.aRotation),e=a-this.aX,f-=this.aY,a=e*c-f*d+this.aX,f=e*d+f*c+this.aY);return b.set(a,f)};Da.prototype.copy=function(a){E.prototype.copy.call(this,a);this.aX=a.aX;this.aY=a.aY;this.xRadius=a.xRadius;this.yRadius=a.yRadius;this.aStartAngle=a.aStartAngle;this.aEndAngle=a.aEndAngle;this.aClockwise=a.aClockwise;\nthis.aRotation=a.aRotation;return this};Da.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.aX=this.aX;a.aY=this.aY;a.xRadius=this.xRadius;a.yRadius=this.yRadius;a.aStartAngle=this.aStartAngle;a.aEndAngle=this.aEndAngle;a.aClockwise=this.aClockwise;a.aRotation=this.aRotation;return a};Da.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.aX=a.aX;this.aY=a.aY;this.xRadius=a.xRadius;this.yRadius=a.yRadius;this.aStartAngle=a.aStartAngle;this.aEndAngle=a.aEndAngle;\nthis.aClockwise=a.aClockwise;this.aRotation=a.aRotation;return this};mc.prototype=Object.create(Da.prototype);mc.prototype.constructor=mc;mc.prototype.isArcCurve=!0;var Td=new p,Ce=new he,De=new he,Ee=new he;pa.prototype=Object.create(E.prototype);pa.prototype.constructor=pa;pa.prototype.isCatmullRomCurve3=!0;pa.prototype.getPoint=function(a,b){b=b||new p;var c=this.points,d=c.length;a*=d-(this.closed?0:1);var e=Math.floor(a);a-=e;this.closed?e+=0<e?0:(Math.floor(Math.abs(e)/d)+1)*d:0===a&&e===d-\n1&&(e=d-2,a=1);if(this.closed||0<e)var f=c[(e-1)%d];else Td.subVectors(c[0],c[1]).add(c[0]),f=Td;var g=c[e%d];var h=c[(e+1)%d];this.closed||e+2<d?c=c[(e+2)%d]:(Td.subVectors(c[d-1],c[d-2]).add(c[d-1]),c=Td);if(\"centripetal\"===this.curveType||\"chordal\"===this.curveType){var l=\"chordal\"===this.curveType?.5:.25;d=Math.pow(f.distanceToSquared(g),l);e=Math.pow(g.distanceToSquared(h),l);l=Math.pow(h.distanceToSquared(c),l);1E-4>e&&(e=1);1E-4>d&&(d=e);1E-4>l&&(l=e);Ce.initNonuniformCatmullRom(f.x,g.x,h.x,\nc.x,d,e,l);De.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,l);Ee.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,l)}else\"catmullrom\"===this.curveType&&(Ce.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),De.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),Ee.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(Ce.calc(a),De.calc(a),Ee.calc(a));return b};pa.prototype.copy=function(a){E.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b<c;b++)this.points.push(a.points[b].clone());this.closed=\na.closed;this.curveType=a.curveType;this.tension=a.tension;return this};pa.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.points=[];for(var b=0,c=this.points.length;b<c;b++)a.points.push(this.points[b].toArray());a.closed=this.closed;a.curveType=this.curveType;a.tension=this.tension;return a};pa.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.points=[];for(var b=0,c=a.points.length;b<c;b++){var d=a.points[b];this.points.push((new p).fromArray(d))}this.closed=\na.closed;this.curveType=a.curveType;this.tension=a.tension;return this};Ma.prototype=Object.create(E.prototype);Ma.prototype.constructor=Ma;Ma.prototype.isCubicBezierCurve=!0;Ma.prototype.getPoint=function(a,b){b=b||new B;var c=this.v0,d=this.v1,e=this.v2,f=this.v3;b.set(hd(a,c.x,d.x,e.x,f.x),hd(a,c.y,d.y,e.y,f.y));return b};Ma.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);this.v3.copy(a.v3);return this};Ma.prototype.toJSON=function(){var a=\nE.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();a.v3=this.v3.toArray();return a};Ma.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);this.v3.fromArray(a.v3);return this};Va.prototype=Object.create(E.prototype);Va.prototype.constructor=Va;Va.prototype.isCubicBezierCurve3=!0;Va.prototype.getPoint=function(a,b){b=b||new p;var c=this.v0,d=this.v1,e=this.v2,f=this.v3;\nb.set(hd(a,c.x,d.x,e.x,f.x),hd(a,c.y,d.y,e.y,f.y),hd(a,c.z,d.z,e.z,f.z));return b};Va.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);this.v3.copy(a.v3);return this};Va.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();a.v3=this.v3.toArray();return a};Va.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);\nthis.v2.fromArray(a.v2);this.v3.fromArray(a.v3);return this};ia.prototype=Object.create(E.prototype);ia.prototype.constructor=ia;ia.prototype.isLineCurve=!0;ia.prototype.getPoint=function(a,b){b=b||new B;1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(a).add(this.v1));return b};ia.prototype.getPointAt=function(a,b){return this.getPoint(a,b)};ia.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()};ia.prototype.copy=function(a){E.prototype.copy.call(this,\na);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};ia.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};ia.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Na.prototype=Object.create(E.prototype);Na.prototype.constructor=Na;Na.prototype.isLineCurve3=!0;Na.prototype.getPoint=function(a,b){b=b||new p;1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),\nb.multiplyScalar(a).add(this.v1));return b};Na.prototype.getPointAt=function(a,b){return this.getPoint(a,b)};Na.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};Na.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};Na.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Oa.prototype=Object.create(E.prototype);\nOa.prototype.constructor=Oa;Oa.prototype.isQuadraticBezierCurve=!0;Oa.prototype.getPoint=function(a,b){b=b||new B;var c=this.v0,d=this.v1,e=this.v2;b.set(gd(a,c.x,d.x,e.x),gd(a,c.y,d.y,e.y));return b};Oa.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};Oa.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};Oa.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,\na);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Wa.prototype=Object.create(E.prototype);Wa.prototype.constructor=Wa;Wa.prototype.isQuadraticBezierCurve3=!0;Wa.prototype.getPoint=function(a,b){b=b||new p;var c=this.v0,d=this.v1,e=this.v2;b.set(gd(a,c.x,d.x,e.x),gd(a,c.y,d.y,e.y),gd(a,c.z,d.z,e.z));return b};Wa.prototype.copy=function(a){E.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};Wa.prototype.toJSON=function(){var a=\nE.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};Wa.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Pa.prototype=Object.create(E.prototype);Pa.prototype.constructor=Pa;Pa.prototype.isSplineCurve=!0;Pa.prototype.getPoint=function(a,b){b=b||new B;var c=this.points,d=(c.length-1)*a;a=Math.floor(d);d-=a;var e=c[0===a?a:a-1],f=c[a],g=c[a>c.length-\n2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(mf(d,e.x,f.x,g.x,c.x),mf(d,e.y,f.y,g.y,c.y));return b};Pa.prototype.copy=function(a){E.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b<c;b++)this.points.push(a.points[b].clone());return this};Pa.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);a.points=[];for(var b=0,c=this.points.length;b<c;b++)a.points.push(this.points[b].toArray());return a};Pa.prototype.fromJSON=function(a){E.prototype.fromJSON.call(this,\na);this.points=[];for(var b=0,c=a.points.length;b<c;b++){var d=a.points[b];this.points.push((new B).fromArray(d))}return this};var Bf=Object.freeze({ArcCurve:mc,CatmullRomCurve3:pa,CubicBezierCurve:Ma,CubicBezierCurve3:Va,EllipseCurve:Da,LineCurve:ia,LineCurve3:Na,QuadraticBezierCurve:Oa,QuadraticBezierCurve3:Wa,SplineCurve:Pa});bb.prototype=Object.assign(Object.create(E.prototype),{constructor:bb,add:function(a){this.curves.push(a)},closePath:function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-\n1].getPoint(1);a.equals(b)||this.curves.push(new ia(b,a))},getPoint:function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.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;\nfor(var a=[],b=0,c=0,d=this.curves.length;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a},getSpacedPoints:function(a){void 0===a&&(a=40);for(var b=[],c=0;c<=a;c++)b.push(this.getPoint(c/a));this.autoClose&&b.push(b[0]);return b},getPoints:function(a){a=a||12;for(var b=[],c,d=0,e=this.curves;d<e.length;d++){var f=e[d];f=f.getPoints(f&&f.isEllipseCurve?2*a:f&&(f.isLineCurve||f.isLineCurve3)?1:f&&f.isSplineCurve?a*f.points.length:a);for(var g=0;g<f.length;g++){var h=f[g];\nc&&c.equals(h)||(b.push(h),c=h)}}this.autoClose&&1<b.length&&!b[b.length-1].equals(b[0])&&b.push(b[0]);return b},copy:function(a){E.prototype.copy.call(this,a);this.curves=[];for(var b=0,c=a.curves.length;b<c;b++)this.curves.push(a.curves[b].clone());this.autoClose=a.autoClose;return this},toJSON:function(){var a=E.prototype.toJSON.call(this);a.autoClose=this.autoClose;a.curves=[];for(var b=0,c=this.curves.length;b<c;b++)a.curves.push(this.curves[b].toJSON());return a},fromJSON:function(a){E.prototype.fromJSON.call(this,\na);this.autoClose=a.autoClose;this.curves=[];for(var b=0,c=a.curves.length;b<c;b++){var d=a.curves[b];this.curves.push((new Bf[d.type]).fromJSON(d))}return this}});Qa.prototype=Object.assign(Object.create(bb.prototype),{constructor:Qa,setFromPoints:function(a){this.moveTo(a[0].x,a[0].y);for(var b=1,c=a.length;b<c;b++)this.lineTo(a[b].x,a[b].y)},moveTo:function(a,b){this.currentPoint.set(a,b)},lineTo:function(a,b){var c=new ia(this.currentPoint.clone(),new B(a,b));this.curves.push(c);this.currentPoint.set(a,\nb)},quadraticCurveTo:function(a,b,c,d){a=new Oa(this.currentPoint.clone(),new B(a,b),new B(c,d));this.curves.push(a);this.currentPoint.set(c,d)},bezierCurveTo:function(a,b,c,d,e,f){a=new Ma(this.currentPoint.clone(),new B(a,b),new B(c,d),new B(e,f));this.curves.push(a);this.currentPoint.set(e,f)},splineThru:function(a){var b=[this.currentPoint.clone()].concat(a);b=new Pa(b);this.curves.push(b);this.currentPoint.copy(a[a.length-1])},arc:function(a,b,c,d,e,f){this.absarc(a+this.currentPoint.x,b+this.currentPoint.y,\nc,d,e,f)},absarc:function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)},ellipse:function(a,b,c,d,e,f,g,h){this.absellipse(a+this.currentPoint.x,b+this.currentPoint.y,c,d,e,f,g,h)},absellipse:function(a,b,c,d,e,f,g,h){a=new Da(a,b,c,d,e,f,g,h);0<this.curves.length&&(b=a.getPoint(0),b.equals(this.currentPoint)||this.lineTo(b.x,b.y));this.curves.push(a);a=a.getPoint(1);this.currentPoint.copy(a)},copy:function(a){bb.prototype.copy.call(this,a);this.currentPoint.copy(a.currentPoint);return this},toJSON:function(){var a=\nbb.prototype.toJSON.call(this);a.currentPoint=this.currentPoint.toArray();return a},fromJSON:function(a){bb.prototype.fromJSON.call(this,a);this.currentPoint.fromArray(a.currentPoint);return this}});jb.prototype=Object.assign(Object.create(Qa.prototype),{constructor:jb,getPointsHoles:function(a){for(var b=[],c=0,d=this.holes.length;c<d;c++)b[c]=this.holes[c].getPoints(a);return b},extractPoints:function(a){return{shape:this.getPoints(a),holes:this.getPointsHoles(a)}},copy:function(a){Qa.prototype.copy.call(this,\na);this.holes=[];for(var b=0,c=a.holes.length;b<c;b++)this.holes.push(a.holes[b].clone());return this},toJSON:function(){var a=Qa.prototype.toJSON.call(this);a.uuid=this.uuid;a.holes=[];for(var b=0,c=this.holes.length;b<c;b++)a.holes.push(this.holes[b].toJSON());return a},fromJSON:function(a){Qa.prototype.fromJSON.call(this,a);this.uuid=a.uuid;this.holes=[];for(var b=0,c=a.holes.length;b<c;b++){var d=a.holes[b];this.holes.push((new Qa).fromJSON(d))}return this}});X.prototype=Object.assign(Object.create(H.prototype),\n{constructor:X,isLight:!0,copy:function(a){H.prototype.copy.call(this,a);this.color.copy(a.color);this.intensity=a.intensity;return this},toJSON:function(a){a=H.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();a.object.intensity=this.intensity;void 0!==this.groundColor&&(a.object.groundColor=this.groundColor.getHex());void 0!==this.distance&&(a.object.distance=this.distance);void 0!==this.angle&&(a.object.angle=this.angle);void 0!==this.decay&&(a.object.decay=this.decay);void 0!==\nthis.penumbra&&(a.object.penumbra=this.penumbra);void 0!==this.shadow&&(a.object.shadow=this.shadow.toJSON());return a}});Bd.prototype=Object.assign(Object.create(X.prototype),{constructor:Bd,isHemisphereLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.groundColor.copy(a.groundColor);return this}});Object.assign(Hb.prototype,{copy:function(a){this.camera=a.camera.clone();this.bias=a.bias;this.radius=a.radius;this.mapSize.copy(a.mapSize);return this},clone:function(){return(new this.constructor).copy(this)},\ntoJSON:function(){var a={};0!==this.bias&&(a.bias=this.bias);1!==this.radius&&(a.radius=this.radius);if(512!==this.mapSize.x||512!==this.mapSize.y)a.mapSize=this.mapSize.toArray();a.camera=this.camera.toJSON(!1).object;delete a.camera.matrix;return a}});Cd.prototype=Object.assign(Object.create(Hb.prototype),{constructor:Cd,isSpotLightShadow:!0,update:function(a){var b=this.camera,c=2*J.RAD2DEG*a.angle,d=this.mapSize.width/this.mapSize.height;a=a.distance||b.far;if(c!==b.fov||d!==b.aspect||a!==b.far)b.fov=\nc,b.aspect=d,b.far=a,b.updateProjectionMatrix()}});Dd.prototype=Object.assign(Object.create(X.prototype),{constructor:Dd,isSpotLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.distance=a.distance;this.angle=a.angle;this.penumbra=a.penumbra;this.decay=a.decay;this.target=a.target.clone();this.shadow=a.shadow.clone();return this}});Ed.prototype=Object.assign(Object.create(X.prototype),{constructor:Ed,isPointLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.distance=a.distance;\nthis.decay=a.decay;this.shadow=a.shadow.clone();return this}});Fd.prototype=Object.assign(Object.create(Hb.prototype),{constructor:Fd});Gd.prototype=Object.assign(Object.create(X.prototype),{constructor:Gd,isDirectionalLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.target=a.target.clone();this.shadow=a.shadow.clone();return this}});Hd.prototype=Object.assign(Object.create(X.prototype),{constructor:Hd,isAmbientLight:!0});Id.prototype=Object.assign(Object.create(X.prototype),{constructor:Id,\nisRectAreaLight:!0,copy:function(a){X.prototype.copy.call(this,a);this.width=a.width;this.height=a.height;return this},toJSON:function(a){a=X.prototype.toJSON.call(this,a);a.object.width=this.width;a.object.height=this.height;return a}});Jd.prototype=Object.assign(Object.create(ja.prototype),{constructor:Jd,ValueTypeName:\"string\",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Kd.prototype=Object.assign(Object.create(ja.prototype),\n{constructor:Kd,ValueTypeName:\"bool\",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Object.assign(Ea.prototype,{evaluate:function(a){var b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];a:{b:{c:{d:if(!(a<d)){for(var f=c+2;;){if(void 0===d){if(a<e)break d;this._cachedIndex=c=b.length;return this.afterEnd_(c-1,a,e)}if(c===f)break;e=d;d=b[++c];if(a<d)break b}d=b.length;break c}if(a>=e)break a;else{f=b[1];a<f&&\n(c=2,e=f);for(f=c-2;;){if(void 0===e)return this._cachedIndex=0,this.beforeStart_(0,a,d);if(c===f)break;d=e;e=b[--c-1];if(a>=e)break b}d=c;c=0}}for(;c<d;)e=c+d>>>1,a<b[e]?d=e:c=e+1;d=b[c];e=b[c-1];if(void 0===e)return this._cachedIndex=0,this.beforeStart_(0,a,d);if(void 0===d)return this._cachedIndex=c=b.length,this.afterEnd_(c-1,e,a)}this._cachedIndex=c;this.intervalChanged_(c,e,d)}return this.interpolate_(c,e,a,d)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||\nthis.DefaultSettings_},copySampleValue_:function(a){var b=this.resultBuffer,c=this.sampleValues,d=this.valueSize;a*=d;for(var e=0;e!==d;++e)b[e]=c[a+e];return b},interpolate_:function(){throw Error(\"call to abstract method\");},intervalChanged_:function(){}});Object.assign(Ea.prototype,{beforeStart_:Ea.prototype.copySampleValue_,afterEnd_:Ea.prototype.copySampleValue_});Ld.prototype=Object.assign(Object.create(Ea.prototype),{constructor:Ld,interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,\ng=this.valueSize;a*=g;b=(c-b)/(d-b);for(c=a+g;a!==c;a+=4)ca.slerpFlat(e,0,f,a-g,f,a,b);return e}});id.prototype=Object.assign(Object.create(ja.prototype),{constructor:id,ValueTypeName:\"quaternion\",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(a){return new Ld(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:void 0});Md.prototype=Object.assign(Object.create(ja.prototype),{constructor:Md,ValueTypeName:\"color\"});nc.prototype=Object.assign(Object.create(ja.prototype),\n{constructor:nc,ValueTypeName:\"number\"});Nd.prototype=Object.assign(Object.create(Ea.prototype),{constructor:Nd,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(a,b,c){var d=this.parameterPositions,e=a-2,f=a+1,g=d[e],h=d[f];if(void 0===g)switch(this.getSettings_().endingStart){case 2401:e=a;g=2*b-c;break;case 2402:e=d.length-2;g=b+d[e]-d[e+1];break;default:e=a,g=c}if(void 0===h)switch(this.getSettings_().endingEnd){case 2401:f=a;h=2*c-b;break;case 2402:f=1;h=c+d[1]-d[0];\nbreak;default:f=a-1,h=b}a=.5*(c-b);d=this.valueSize;this._weightPrev=a/(b-g);this._weightNext=a/(h-c);this._offsetPrev=e*d;this._offsetNext=f*d},interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;var h=a-g,l=this._offsetPrev,m=this._offsetNext,k=this._weightPrev,n=this._weightNext,p=(c-b)/(d-b);c=p*p;d=c*p;b=-k*d+2*k*c-k*p;k=(1+k)*d+(-1.5-2*k)*c+(-.5+k)*p+1;p=(-1-n)*d+(1.5+n)*c+.5*p;n=n*d-n*c;for(c=0;c!==g;++c)e[c]=b*f[l+c]+k*f[h+c]+p*f[a+c]+n*f[m+c];\nreturn e}});jd.prototype=Object.assign(Object.create(Ea.prototype),{constructor:jd,interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;var h=a-g;b=(c-b)/(d-b);c=1-b;for(d=0;d!==g;++d)e[d]=f[h+d]*c+f[a+d]*b;return e}});Od.prototype=Object.assign(Object.create(Ea.prototype),{constructor:Od,interpolate_:function(a){return this.copySampleValue_(a-1)}});var na={arraySlice:function(a,b,c){return na.isTypedArray(a)?new a.constructor(a.subarray(b,void 0!==c?c:\na.length)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:\"number\"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var b=a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a,b,c){for(var d=a.length,e=new a.constructor(d),f=0,g=0;g!==d;++f)for(var h=c[f]*b,l=0;l!==b;++l)e[g++]=\na[h+l];return e},flattenJSON:function(a,b,c,d){for(var e=1,f=a[0];void 0!==f&&void 0===f[d];)f=a[e++];if(void 0!==f){var g=f[d];if(void 0!==g)if(Array.isArray(g)){do g=f[d],void 0!==g&&(b.push(f.time),c.push.apply(c,g)),f=a[e++];while(void 0!==f)}else if(void 0!==g.toArray){do g=f[d],void 0!==g&&(b.push(f.time),g.toArray(c,c.length)),f=a[e++];while(void 0!==f)}else{do g=f[d],void 0!==g&&(b.push(f.time),c.push(g)),f=a[e++];while(void 0!==f)}}}};Object.assign(ja,{parse:function(a){if(void 0===a.type)throw Error(\"THREE.KeyframeTrack: track type undefined, can not parse\");\nvar b=ja._getTrackTypeForValueTypeName(a.type);if(void 0===a.times){var c=[],d=[];na.flattenJSON(a.keys,c,d,\"value\");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)},toJSON:function(a){var b=a.constructor;if(void 0!==b.toJSON)b=b.toJSON(a);else{b={name:a.name,times:na.convertArray(a.times,Array),values:na.convertArray(a.values,Array)};var c=a.getInterpolation();c!==a.DefaultInterpolation&&(b.interpolation=c)}b.type=a.ValueTypeName;return b},_getTrackTypeForValueTypeName:function(a){switch(a.toLowerCase()){case \"scalar\":case \"double\":case \"float\":case \"number\":case \"integer\":return nc;\ncase \"vector\":case \"vector2\":case \"vector3\":case \"vector4\":return oc;case \"color\":return Md;case \"quaternion\":return id;case \"bool\":case \"boolean\":return Kd;case \"string\":return Jd}throw Error(\"THREE.KeyframeTrack: Unsupported typeName: \"+a);}});Object.assign(ja.prototype,{constructor:ja,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(a){return new Od(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodLinear:function(a){return new jd(this.times,\nthis.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:function(a){return new Nd(this.times,this.values,this.getValueSize(),a)},setInterpolation:function(a){switch(a){case 2300:var b=this.InterpolantFactoryMethodDiscrete;break;case 2301:b=this.InterpolantFactoryMethodLinear;break;case 2302:b=this.InterpolantFactoryMethodSmooth}if(void 0===b){b=\"unsupported interpolation for \"+this.ValueTypeName+\" keyframe track named \"+this.name;if(void 0===this.createInterpolant)if(a!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);\nelse throw Error(b);console.warn(\"THREE.KeyframeTrack:\",b)}else this.createInterpolant=b},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(a){if(0!==a)for(var b=this.times,c=0,d=b.length;c!==d;++c)b[c]+=a;return this},scale:function(a){if(1!==a)for(var b=\nthis.times,c=0,d=b.length;c!==d;++c)b[c]*=a;return this},trim:function(a,b){for(var c=this.times,d=c.length,e=0,f=d-1;e!==d&&c[e]<a;)++e;for(;-1!==f&&c[f]>b;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=na.arraySlice(c,e,f),this.values=na.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error(\"THREE.KeyframeTrack: Invalid value size in track.\",this),a=!1);var c=this.times;b=this.values;\nvar d=c.length;0===d&&(console.error(\"THREE.KeyframeTrack: Track is empty.\",this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if(\"number\"===typeof g&&isNaN(g)){console.error(\"THREE.KeyframeTrack: Time is not a valid number.\",this,f,g);a=!1;break}if(null!==e&&e>g){console.error(\"THREE.KeyframeTrack: Out of order keys.\",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&na.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error(\"THREE.KeyframeTrack: Value is not a valid number.\",this,\nf,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values,c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;g<f;++g){var h=!1,l=a[g];if(l!==a[g+1]&&(1!==g||l!==l[0]))if(d)h=!0;else{var k=g*c,p=k-c,n=k+c;for(l=0;l!==c;++l){var t=b[k+l];if(t!==b[p+l]||t!==b[n+l]){h=!0;break}}}if(h){if(g!==e)for(a[e]=a[g],h=g*c,k=e*c,l=0;l!==c;++l)b[k+l]=b[h+l];++e}}if(0<f){a[e]=a[f];h=f*c;k=e*c;for(l=0;l!==c;++l)b[k+l]=b[h+l];++e}e!==a.length&&(this.times=na.arraySlice(a,\n0,e),this.values=na.arraySlice(b,0,e*c));return this}});oc.prototype=Object.assign(Object.create(ja.prototype),{constructor:oc,ValueTypeName:\"vector\"});Object.assign(Ga,{parse:function(a){for(var b=[],c=a.tracks,d=1/(a.fps||1),e=0,f=c.length;e!==f;++e)b.push(ja.parse(c[e]).scale(d));return new Ga(a.name,a.duration,b)},toJSON:function(a){var b=[],c=a.tracks;a={name:a.name,duration:a.duration,tracks:b,uuid:a.uuid};for(var d=0,e=c.length;d!==e;++d)b.push(ja.toJSON(c[d]));return a},CreateFromMorphTargetSequence:function(a,\nb,c,d){for(var e=b.length,f=[],g=0;g<e;g++){var h=[],l=[];h.push((g+e-1)%e,g,(g+1)%e);l.push(0,1,0);var k=na.getKeyframeOrder(h);h=na.sortedArray(h,1,k);l=na.sortedArray(l,1,k);d||0!==h[0]||(h.push(e),l.push(l[0]));f.push((new nc(\".morphTargetInfluences[\"+b[g].name+\"]\",h,l)).scale(1/c))}return new Ga(a,-1,f)},findByName:function(a,b){var c=a;Array.isArray(a)||(c=a.geometry&&a.geometry.animations||a.animations);for(a=0;a<c.length;a++)if(c[a].name===b)return c[a];return null},CreateClipsFromMorphTargetSequences:function(a,\nb,c){for(var d={},e=/^([\\w-]*?)([\\d]+)$/,f=0,g=a.length;f<g;f++){var h=a[f],l=h.name.match(e);if(l&&1<l.length){var k=l[1];(l=d[k])||(d[k]=l=[]);l.push(h)}}a=[];for(k in d)a.push(Ga.CreateFromMorphTargetSequence(k,d[k],b,c));return a},parseAnimation:function(a,b){if(!a)return console.error(\"THREE.AnimationClip: No animation in JSONLoader data.\"),null;var c=function(a,b,c,d,e){if(0!==c.length){var f=[],g=[];na.flattenJSON(c,f,g,d);0!==f.length&&e.push(new a(b,f,g))}},d=[],e=a.name||\"default\",f=a.length||\n-1,g=a.fps||30;a=a.hierarchy||[];for(var h=0;h<a.length;h++){var l=a[h].keys;if(l&&0!==l.length)if(l[0].morphTargets){f={};for(var k=0;k<l.length;k++)if(l[k].morphTargets)for(var p=0;p<l[k].morphTargets.length;p++)f[l[k].morphTargets[p]]=-1;for(var n in f){var t=[],q=[];for(p=0;p!==l[k].morphTargets.length;++p){var r=l[k];t.push(r.time);q.push(r.morphTarget===n?1:0)}d.push(new nc(\".morphTargetInfluence[\"+n+\"]\",t,q))}f=f.length*(g||1)}else k=\".bones[\"+b[h].name+\"]\",c(oc,k+\".position\",l,\"pos\",d),c(id,\nk+\".quaternion\",l,\"rot\",d),c(oc,k+\".scale\",l,\"scl\",d)}return 0===d.length?null:new Ga(e,f,d)}});Object.assign(Ga.prototype,{resetDuration:function(){for(var a=0,b=0,c=this.tracks.length;b!==c;++b){var d=this.tracks[b];a=Math.max(a,d.times[d.times.length-1])}this.duration=a},trim:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].trim(0,this.duration);return this},optimize:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].optimize();return this}});Object.assign(Pd.prototype,\n{load:function(a,b,c,d){var e=this;(new La(e.manager)).load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setTextures:function(a){this.textures=a},parse:function(a){function b(a){void 0===c[a]&&console.warn(\"THREE.MaterialLoader: Undefined texture\",a);return c[a]}var c=this.textures,d=new Vg[a.type];void 0!==a.uuid&&(d.uuid=a.uuid);void 0!==a.name&&(d.name=a.name);void 0!==a.color&&d.color.setHex(a.color);void 0!==a.roughness&&(d.roughness=a.roughness);void 0!==a.metalness&&(d.metalness=a.metalness);\nvoid 0!==a.emissive&&d.emissive.setHex(a.emissive);void 0!==a.specular&&d.specular.setHex(a.specular);void 0!==a.shininess&&(d.shininess=a.shininess);void 0!==a.clearCoat&&(d.clearCoat=a.clearCoat);void 0!==a.clearCoatRoughness&&(d.clearCoatRoughness=a.clearCoatRoughness);void 0!==a.uniforms&&(d.uniforms=a.uniforms);void 0!==a.vertexShader&&(d.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(d.fragmentShader=a.fragmentShader);void 0!==a.vertexColors&&(d.vertexColors=a.vertexColors);void 0!==\na.fog&&(d.fog=a.fog);void 0!==a.flatShading&&(d.flatShading=a.flatShading);void 0!==a.blending&&(d.blending=a.blending);void 0!==a.side&&(d.side=a.side);void 0!==a.opacity&&(d.opacity=a.opacity);void 0!==a.transparent&&(d.transparent=a.transparent);void 0!==a.alphaTest&&(d.alphaTest=a.alphaTest);void 0!==a.depthTest&&(d.depthTest=a.depthTest);void 0!==a.depthWrite&&(d.depthWrite=a.depthWrite);void 0!==a.colorWrite&&(d.colorWrite=a.colorWrite);void 0!==a.wireframe&&(d.wireframe=a.wireframe);void 0!==\na.wireframeLinewidth&&(d.wireframeLinewidth=a.wireframeLinewidth);void 0!==a.wireframeLinecap&&(d.wireframeLinecap=a.wireframeLinecap);void 0!==a.wireframeLinejoin&&(d.wireframeLinejoin=a.wireframeLinejoin);void 0!==a.rotation&&(d.rotation=a.rotation);1!==a.linewidth&&(d.linewidth=a.linewidth);void 0!==a.dashSize&&(d.dashSize=a.dashSize);void 0!==a.gapSize&&(d.gapSize=a.gapSize);void 0!==a.scale&&(d.scale=a.scale);void 0!==a.polygonOffset&&(d.polygonOffset=a.polygonOffset);void 0!==a.polygonOffsetFactor&&\n(d.polygonOffsetFactor=a.polygonOffsetFactor);void 0!==a.polygonOffsetUnits&&(d.polygonOffsetUnits=a.polygonOffsetUnits);void 0!==a.skinning&&(d.skinning=a.skinning);void 0!==a.morphTargets&&(d.morphTargets=a.morphTargets);void 0!==a.dithering&&(d.dithering=a.dithering);void 0!==a.visible&&(d.visible=a.visible);void 0!==a.userData&&(d.userData=a.userData);void 0!==a.shading&&(d.flatShading=1===a.shading);void 0!==a.size&&(d.size=a.size);void 0!==a.sizeAttenuation&&(d.sizeAttenuation=a.sizeAttenuation);\nvoid 0!==a.map&&(d.map=b(a.map));void 0!==a.alphaMap&&(d.alphaMap=b(a.alphaMap),d.transparent=!0);void 0!==a.bumpMap&&(d.bumpMap=b(a.bumpMap));void 0!==a.bumpScale&&(d.bumpScale=a.bumpScale);void 0!==a.normalMap&&(d.normalMap=b(a.normalMap));void 0!==a.normalMapType&&(d.normalMapType=a.normalMapType);if(void 0!==a.normalScale){var e=a.normalScale;!1===Array.isArray(e)&&(e=[e,e]);d.normalScale=(new B).fromArray(e)}void 0!==a.displacementMap&&(d.displacementMap=b(a.displacementMap));void 0!==a.displacementScale&&\n(d.displacementScale=a.displacementScale);void 0!==a.displacementBias&&(d.displacementBias=a.displacementBias);void 0!==a.roughnessMap&&(d.roughnessMap=b(a.roughnessMap));void 0!==a.metalnessMap&&(d.metalnessMap=b(a.metalnessMap));void 0!==a.emissiveMap&&(d.emissiveMap=b(a.emissiveMap));void 0!==a.emissiveIntensity&&(d.emissiveIntensity=a.emissiveIntensity);void 0!==a.specularMap&&(d.specularMap=b(a.specularMap));void 0!==a.envMap&&(d.envMap=b(a.envMap));void 0!==a.reflectivity&&(d.reflectivity=a.reflectivity);\nvoid 0!==a.lightMap&&(d.lightMap=b(a.lightMap));void 0!==a.lightMapIntensity&&(d.lightMapIntensity=a.lightMapIntensity);void 0!==a.aoMap&&(d.aoMap=b(a.aoMap));void 0!==a.aoMapIntensity&&(d.aoMapIntensity=a.aoMapIntensity);void 0!==a.gradientMap&&(d.gradientMap=b(a.gradientMap));return d}});Object.assign(ie.prototype,{load:function(a,b,c,d){var e=this;(new La(e.manager)).load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},parse:function(a){var b=new D,c=a.data.index;void 0!==c&&(c=new Cf[c.type](c.array),\nb.setIndex(new L(c,1)));var d=a.data.attributes;for(f in d){var e=d[f];c=new Cf[e.type](e.array);b.addAttribute(f,new L(c,e.itemSize,e.normalized))}var f=a.data.groups||a.data.drawcalls||a.data.offsets;if(void 0!==f)for(c=0,d=f.length;c!==d;++c)e=f[c],b.addGroup(e.start,e.count,e.materialIndex);a=a.data.boundingSphere;void 0!==a&&(f=new p,void 0!==a.center&&f.fromArray(a.center),b.boundingSphere=new Ha(f,a.radius));return b}});var Cf={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:\"undefined\"!==\ntypeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};pc.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=this.handlers,c=0,d=b.length;c<d;c+=2){var e=b[c+1];if(b[c].test(a))return e}return null}};Object.assign(pc.prototype,{crossOrigin:\"anonymous\",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},\ninitMaterials:function(a,b,c){for(var d=[],e=0;e<a.length;++e)d[e]=this.createMaterial(a[e],b,c);return d},createMaterial:function(){var a={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},b=new G,c=new Ad,d=new Pd;return function(e,f,g){function h(a,b,d,e,h){a=f+a;var k=pc.Handlers.get(a);null!==k?a=k.load(a):(c.setCrossOrigin(g),a=c.load(a));void 0!==b&&(a.repeat.fromArray(b),1!==b[0]&&(a.wrapS=1E3),1!==b[1]&&(a.wrapT=1E3));void 0!==d&&\na.offset.fromArray(d);void 0!==e&&(\"repeat\"===e[0]&&(a.wrapS=1E3),\"mirror\"===e[0]&&(a.wrapS=1002),\"repeat\"===e[1]&&(a.wrapT=1E3),\"mirror\"===e[1]&&(a.wrapT=1002));void 0!==h&&(a.anisotropy=h);b=J.generateUUID();l[b]=a;return b}var l={},k={uuid:J.generateUUID(),type:\"MeshLambertMaterial\"},p;for(p in e){var n=e[p];switch(p){case \"DbgColor\":case \"DbgIndex\":case \"opticalDensity\":case \"illumination\":break;case \"DbgName\":k.name=n;break;case \"blending\":k.blending=a[n];break;case \"colorAmbient\":case \"mapAmbient\":console.warn(\"THREE.Loader.createMaterial:\",\np,\"is no longer supported.\");break;case \"colorDiffuse\":k.color=b.fromArray(n).getHex();break;case \"colorSpecular\":k.specular=b.fromArray(n).getHex();break;case \"colorEmissive\":k.emissive=b.fromArray(n).getHex();break;case \"specularCoef\":k.shininess=n;break;case \"shading\":\"basic\"===n.toLowerCase()&&(k.type=\"MeshBasicMaterial\");\"phong\"===n.toLowerCase()&&(k.type=\"MeshPhongMaterial\");\"standard\"===n.toLowerCase()&&(k.type=\"MeshStandardMaterial\");break;case \"mapDiffuse\":k.map=h(n,e.mapDiffuseRepeat,e.mapDiffuseOffset,\ne.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case \"mapDiffuseRepeat\":case \"mapDiffuseOffset\":case \"mapDiffuseWrap\":case \"mapDiffuseAnisotropy\":break;case \"mapEmissive\":k.emissiveMap=h(n,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case \"mapEmissiveRepeat\":case \"mapEmissiveOffset\":case \"mapEmissiveWrap\":case \"mapEmissiveAnisotropy\":break;case \"mapLight\":k.lightMap=h(n,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case \"mapLightRepeat\":case \"mapLightOffset\":case \"mapLightWrap\":case \"mapLightAnisotropy\":break;\ncase \"mapAO\":k.aoMap=h(n,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case \"mapAORepeat\":case \"mapAOOffset\":case \"mapAOWrap\":case \"mapAOAnisotropy\":break;case \"mapBump\":k.bumpMap=h(n,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case \"mapBumpScale\":k.bumpScale=n;break;case \"mapBumpRepeat\":case \"mapBumpOffset\":case \"mapBumpWrap\":case \"mapBumpAnisotropy\":break;case \"mapNormal\":k.normalMap=h(n,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);\nbreak;case \"mapNormalFactor\":k.normalScale=n;break;case \"mapNormalRepeat\":case \"mapNormalOffset\":case \"mapNormalWrap\":case \"mapNormalAnisotropy\":break;case \"mapSpecular\":k.specularMap=h(n,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case \"mapSpecularRepeat\":case \"mapSpecularOffset\":case \"mapSpecularWrap\":case \"mapSpecularAnisotropy\":break;case \"mapMetalness\":k.metalnessMap=h(n,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);\nbreak;case \"mapMetalnessRepeat\":case \"mapMetalnessOffset\":case \"mapMetalnessWrap\":case \"mapMetalnessAnisotropy\":break;case \"mapRoughness\":k.roughnessMap=h(n,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case \"mapRoughnessRepeat\":case \"mapRoughnessOffset\":case \"mapRoughnessWrap\":case \"mapRoughnessAnisotropy\":break;case \"mapAlpha\":k.alphaMap=h(n,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case \"mapAlphaRepeat\":case \"mapAlphaOffset\":case \"mapAlphaWrap\":case \"mapAlphaAnisotropy\":break;\ncase \"flipSided\":k.side=1;break;case \"doubleSided\":k.side=2;break;case \"transparency\":console.warn(\"THREE.Loader.createMaterial: transparency has been renamed to opacity\");k.opacity=n;break;case \"depthTest\":case \"depthWrite\":case \"colorWrite\":case \"opacity\":case \"reflectivity\":case \"transparent\":case \"visible\":case \"wireframe\":k[p]=n;break;case \"vertexColors\":!0===n&&(k.vertexColors=2);\"face\"===n&&(k.vertexColors=1);break;default:console.error(\"THREE.Loader.createMaterial: Unsupported\",p,n)}}\"MeshBasicMaterial\"===\nk.type&&delete k.emissive;\"MeshPhongMaterial\"!==k.type&&delete k.specular;1>k.opacity&&(k.transparent=!0);d.setTextures(l);return d.parse(k)}}()});var Fe={decodeText:function(a){if(\"undefined\"!==typeof TextDecoder)return(new TextDecoder).decode(a);for(var b=\"\",c=0,d=a.length;c<d;c++)b+=String.fromCharCode(a[c]);return decodeURIComponent(escape(b))},extractUrlBase:function(a){var b=a.lastIndexOf(\"/\");return-1===b?\"./\":a.substr(0,b+1)}};Object.assign(je.prototype,{crossOrigin:\"anonymous\",load:function(a,\nb,c,d){var e=this,f=this.texturePath&&\"string\"===typeof this.texturePath?this.texturePath:Fe.extractUrlBase(a),g=new La(this.manager);g.setWithCredentials(this.withCredentials);g.load(a,function(c){c=JSON.parse(c);var d=c.metadata;if(void 0!==d&&(d=d.type,void 0!==d&&\"object\"===d.toLowerCase())){console.error(\"THREE.JSONLoader: \"+a+\" should be loaded with THREE.ObjectLoader instead.\");return}c=e.parse(c,f);b(c.geometry,c.materials)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a;return this},\nsetTexturePath:function(a){this.texturePath=a;return this},parse:function(){return function(a,b){void 0!==a.data&&(a=a.data);a.scale=void 0!==a.scale?1/a.scale:1;var c=new P,d=a,e,f,g,h=d.faces;var l=d.vertices;var k=d.normals,v=d.colors;var n=d.scale;var t=0;if(void 0!==d.uvs){for(e=0;e<d.uvs.length;e++)d.uvs[e].length&&t++;for(e=0;e<t;e++)c.faceVertexUvs[e]=[]}var q=0;for(g=l.length;q<g;)e=new p,e.x=l[q++]*n,e.y=l[q++]*n,e.z=l[q++]*n,c.vertices.push(e);q=0;for(g=h.length;q<g;){l=h[q++];var r=l&\n1;var u=l&2;e=l&8;var y=l&16;var w=l&32;n=l&64;l&=128;if(r){r=new Ya;r.a=h[q];r.b=h[q+1];r.c=h[q+3];var x=new Ya;x.a=h[q+1];x.b=h[q+2];x.c=h[q+3];q+=4;u&&(u=h[q++],r.materialIndex=u,x.materialIndex=u);u=c.faces.length;if(e)for(e=0;e<t;e++){var A=d.uvs[e];c.faceVertexUvs[e][u]=[];c.faceVertexUvs[e][u+1]=[];for(f=0;4>f;f++){var C=h[q++];var z=A[2*C];C=A[2*C+1];z=new B(z,C);2!==f&&c.faceVertexUvs[e][u].push(z);0!==f&&c.faceVertexUvs[e][u+1].push(z)}}y&&(y=3*h[q++],r.normal.set(k[y++],k[y++],k[y]),x.normal.copy(r.normal));\nif(w)for(e=0;4>e;e++)y=3*h[q++],w=new p(k[y++],k[y++],k[y]),2!==e&&r.vertexNormals.push(w),0!==e&&x.vertexNormals.push(w);n&&(n=h[q++],n=v[n],r.color.setHex(n),x.color.setHex(n));if(l)for(e=0;4>e;e++)n=h[q++],n=v[n],2!==e&&r.vertexColors.push(new G(n)),0!==e&&x.vertexColors.push(new G(n));c.faces.push(r);c.faces.push(x)}else{r=new Ya;r.a=h[q++];r.b=h[q++];r.c=h[q++];u&&(u=h[q++],r.materialIndex=u);u=c.faces.length;if(e)for(e=0;e<t;e++)for(A=d.uvs[e],c.faceVertexUvs[e][u]=[],f=0;3>f;f++)C=h[q++],z=\nA[2*C],C=A[2*C+1],z=new B(z,C),c.faceVertexUvs[e][u].push(z);y&&(y=3*h[q++],r.normal.set(k[y++],k[y++],k[y]));if(w)for(e=0;3>e;e++)y=3*h[q++],w=new p(k[y++],k[y++],k[y]),r.vertexNormals.push(w);n&&(n=h[q++],r.color.setHex(v[n]));if(l)for(e=0;3>e;e++)n=h[q++],r.vertexColors.push(new G(v[n]));c.faces.push(r)}}d=a;q=void 0!==d.influencesPerVertex?d.influencesPerVertex:2;if(d.skinWeights)for(g=0,h=d.skinWeights.length;g<h;g+=q)c.skinWeights.push(new W(d.skinWeights[g],1<q?d.skinWeights[g+1]:0,2<q?d.skinWeights[g+\n2]:0,3<q?d.skinWeights[g+3]:0));if(d.skinIndices)for(g=0,h=d.skinIndices.length;g<h;g+=q)c.skinIndices.push(new W(d.skinIndices[g],1<q?d.skinIndices[g+1]:0,2<q?d.skinIndices[g+2]:0,3<q?d.skinIndices[g+3]:0));c.bones=d.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn(\"When skinning, number of vertices (\"+c.vertices.length+\"), skinIndices (\"+c.skinIndices.length+\"), and skinWeights (\"+c.skinWeights.length+\") should match.\");\ng=a;h=g.scale;if(void 0!==g.morphTargets)for(d=0,q=g.morphTargets.length;d<q;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=g.morphTargets[d].name,c.morphTargets[d].vertices=[],k=c.morphTargets[d].vertices,v=g.morphTargets[d].vertices,t=0,l=v.length;t<l;t+=3)n=new p,n.x=v[t]*h,n.y=v[t+1]*h,n.z=v[t+2]*h,k.push(n);if(void 0!==g.morphColors&&0<g.morphColors.length)for(console.warn('THREE.JSONLoader: \"morphColors\" no longer supported. Using them as face colors.'),h=c.faces,g=g.morphColors[0].colors,\nd=0,q=h.length;d<q;d++)h[d].color.fromArray(g,3*d);g=a;d=[];q=[];void 0!==g.animation&&q.push(g.animation);void 0!==g.animations&&(g.animations.length?q=q.concat(g.animations):q.push(g.animations));for(g=0;g<q.length;g++)(h=Ga.parseAnimation(q[g],c.bones))&&d.push(h);c.morphTargets&&(q=Ga.CreateClipsFromMorphTargetSequences(c.morphTargets,10),d=d.concat(q));0<d.length&&(c.animations=d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};\na=pc.prototype.initMaterials(a.materials,b,this.crossOrigin);return{geometry:c,materials:a}}}()});Object.assign(nf.prototype,{crossOrigin:\"anonymous\",load:function(a,b,c,d){\"\"===this.texturePath&&(this.texturePath=a.substring(0,a.lastIndexOf(\"/\")+1));var e=this;(new La(e.manager)).load(a,function(c){var f=null;try{f=JSON.parse(c)}catch(h){void 0!==d&&d(h);console.error(\"THREE:ObjectLoader: Can't parse \"+a+\".\",h.message);return}c=f.metadata;void 0===c||void 0===c.type||\"geometry\"===c.type.toLowerCase()?\nconsole.error(\"THREE.ObjectLoader: Can't load \"+a+\". Use THREE.JSONLoader instead.\"):e.parse(f,b)},c,d)},setTexturePath:function(a){this.texturePath=a;return this},setCrossOrigin:function(a){this.crossOrigin=a;return this},parse:function(a,b){var c=this.parseShape(a.shapes);c=this.parseGeometries(a.geometries,c);var d=this.parseImages(a.images,function(){void 0!==b&&b(e)});d=this.parseTextures(a.textures,d);d=this.parseMaterials(a.materials,d);var e=this.parseObject(a.object,c,d);a.animations&&(e.animations=\nthis.parseAnimations(a.animations));void 0!==a.images&&0!==a.images.length||void 0===b||b(e);return e},parseShape:function(a){var b={};if(void 0!==a)for(var c=0,d=a.length;c<d;c++){var e=(new jb).fromJSON(a[c]);b[e.uuid]=e}return b},parseGeometries:function(a,b){var c={};if(void 0!==a)for(var d=new je,e=new ie,f=0,g=a.length;f<g;f++){var h=a[f];switch(h.type){case \"PlaneGeometry\":case \"PlaneBufferGeometry\":var l=new ka[h.type](h.width,h.height,h.widthSegments,h.heightSegments);break;case \"BoxGeometry\":case \"BoxBufferGeometry\":case \"CubeGeometry\":l=\nnew ka[h.type](h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case \"CircleGeometry\":case \"CircleBufferGeometry\":l=new ka[h.type](h.radius,h.segments,h.thetaStart,h.thetaLength);break;case \"CylinderGeometry\":case \"CylinderBufferGeometry\":l=new ka[h.type](h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded,h.thetaStart,h.thetaLength);break;case \"ConeGeometry\":case \"ConeBufferGeometry\":l=new ka[h.type](h.radius,h.height,h.radialSegments,\nh.heightSegments,h.openEnded,h.thetaStart,h.thetaLength);break;case \"SphereGeometry\":case \"SphereBufferGeometry\":l=new ka[h.type](h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case \"DodecahedronGeometry\":case \"DodecahedronBufferGeometry\":case \"IcosahedronGeometry\":case \"IcosahedronBufferGeometry\":case \"OctahedronGeometry\":case \"OctahedronBufferGeometry\":case \"TetrahedronGeometry\":case \"TetrahedronBufferGeometry\":l=new ka[h.type](h.radius,h.detail);\nbreak;case \"RingGeometry\":case \"RingBufferGeometry\":l=new ka[h.type](h.innerRadius,h.outerRadius,h.thetaSegments,h.phiSegments,h.thetaStart,h.thetaLength);break;case \"TorusGeometry\":case \"TorusBufferGeometry\":l=new ka[h.type](h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case \"TorusKnotGeometry\":case \"TorusKnotBufferGeometry\":l=new ka[h.type](h.radius,h.tube,h.tubularSegments,h.radialSegments,h.p,h.q);break;case \"LatheGeometry\":case \"LatheBufferGeometry\":l=new ka[h.type](h.points,\nh.segments,h.phiStart,h.phiLength);break;case \"PolyhedronGeometry\":case \"PolyhedronBufferGeometry\":l=new ka[h.type](h.vertices,h.indices,h.radius,h.details);break;case \"ShapeGeometry\":case \"ShapeBufferGeometry\":l=[];for(var k=0,p=h.shapes.length;k<p;k++){var n=b[h.shapes[k]];l.push(n)}l=new ka[h.type](l,h.curveSegments);break;case \"ExtrudeGeometry\":case \"ExtrudeBufferGeometry\":l=[];k=0;for(p=h.shapes.length;k<p;k++)n=b[h.shapes[k]],l.push(n);k=h.options.extrudePath;void 0!==k&&(h.options.extrudePath=\n(new Bf[k.type]).fromJSON(k));l=new ka[h.type](l,h.options);break;case \"BufferGeometry\":l=e.parse(h);break;case \"Geometry\":l=d.parse(h,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type \"'+h.type+'\"');continue}l.uuid=h.uuid;void 0!==h.name&&(l.name=h.name);!0===l.isBufferGeometry&&void 0!==h.userData&&(l.userData=h.userData);c[h.uuid]=l}return c},parseMaterials:function(a,b){var c={};if(void 0!==a){var d=new Pd;d.setTextures(b);b=0;for(var e=a.length;b<\ne;b++){var f=a[b];if(\"MultiMaterial\"===f.type){for(var g=[],h=0;h<f.materials.length;h++)g.push(d.parse(f.materials[h]));c[f.uuid]=g}else c[f.uuid]=d.parse(f)}}return c},parseAnimations:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=Ga.parse(d);void 0!==d.uuid&&(e.uuid=d.uuid);b.push(e)}return b},parseImages:function(a,b){function c(a){d.manager.itemStart(a);return f.load(a,function(){d.manager.itemEnd(a)},void 0,function(){d.manager.itemEnd(a);d.manager.itemError(a)})}var d=this,e={};\nif(void 0!==a&&0<a.length){b=new ee(b);var f=new fd(b);f.setCrossOrigin(this.crossOrigin);b=0;for(var g=a.length;b<g;b++){var h=a[b],l=h.url;if(Array.isArray(l)){e[h.uuid]=[];for(var k=0,p=l.length;k<p;k++){var n=l[k];n=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(n)?n:d.texturePath+n;e[h.uuid].push(c(n))}}else n=/^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(h.url)?h.url:d.texturePath+h.url,e[h.uuid]=c(n)}}return e},parseTextures:function(a,b){function c(a,b){if(\"number\"===typeof a)return a;console.warn(\"THREE.ObjectLoader.parseTexture: Constant should be in numeric form.\",\na);return b[a]}var d={};if(void 0!==a)for(var e=0,f=a.length;e<f;e++){var g=a[e];void 0===g.image&&console.warn('THREE.ObjectLoader: No \"image\" specified for',g.uuid);void 0===b[g.image]&&console.warn(\"THREE.ObjectLoader: Undefined image\",g.image);var h=Array.isArray(b[g.image])?new Za(b[g.image]):new ea(b[g.image]);h.needsUpdate=!0;h.uuid=g.uuid;void 0!==g.name&&(h.name=g.name);void 0!==g.mapping&&(h.mapping=c(g.mapping,Wg));void 0!==g.offset&&h.offset.fromArray(g.offset);void 0!==g.repeat&&h.repeat.fromArray(g.repeat);\nvoid 0!==g.center&&h.center.fromArray(g.center);void 0!==g.rotation&&(h.rotation=g.rotation);void 0!==g.wrap&&(h.wrapS=c(g.wrap[0],Df),h.wrapT=c(g.wrap[1],Df));void 0!==g.format&&(h.format=g.format);void 0!==g.minFilter&&(h.minFilter=c(g.minFilter,Ef));void 0!==g.magFilter&&(h.magFilter=c(g.magFilter,Ef));void 0!==g.anisotropy&&(h.anisotropy=g.anisotropy);void 0!==g.flipY&&(h.flipY=g.flipY);d[g.uuid]=h}return d},parseObject:function(a,b,c){function d(a){void 0===b[a]&&console.warn(\"THREE.ObjectLoader: Undefined geometry\",\na);return b[a]}function e(a){if(void 0!==a){if(Array.isArray(a)){for(var b=[],d=0,e=a.length;d<e;d++){var f=a[d];void 0===c[f]&&console.warn(\"THREE.ObjectLoader: Undefined material\",f);b.push(c[f])}return b}void 0===c[a]&&console.warn(\"THREE.ObjectLoader: Undefined material\",a);return c[a]}}switch(a.type){case \"Scene\":var f=new vd;void 0!==a.background&&Number.isInteger(a.background)&&(f.background=new G(a.background));void 0!==a.fog&&(\"Fog\"===a.fog.type?f.fog=new Wb(a.fog.color,a.fog.near,a.fog.far):\n\"FogExp2\"===a.fog.type&&(f.fog=new Vb(a.fog.color,a.fog.density)));break;case \"PerspectiveCamera\":f=new Z(a.fov,a.aspect,a.near,a.far);void 0!==a.focus&&(f.focus=a.focus);void 0!==a.zoom&&(f.zoom=a.zoom);void 0!==a.filmGauge&&(f.filmGauge=a.filmGauge);void 0!==a.filmOffset&&(f.filmOffset=a.filmOffset);void 0!==a.view&&(f.view=Object.assign({},a.view));break;case \"OrthographicCamera\":f=new Mb(a.left,a.right,a.top,a.bottom,a.near,a.far);void 0!==a.zoom&&(f.zoom=a.zoom);void 0!==a.view&&(f.view=Object.assign({},\na.view));break;case \"AmbientLight\":f=new Hd(a.color,a.intensity);break;case \"DirectionalLight\":f=new Gd(a.color,a.intensity);break;case \"PointLight\":f=new Ed(a.color,a.intensity,a.distance,a.decay);break;case \"RectAreaLight\":f=new Id(a.color,a.intensity,a.width,a.height);break;case \"SpotLight\":f=new Dd(a.color,a.intensity,a.distance,a.angle,a.penumbra,a.decay);break;case \"HemisphereLight\":f=new Bd(a.color,a.groundColor,a.intensity);break;case \"SkinnedMesh\":console.warn(\"THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.\");\ncase \"Mesh\":f=d(a.geometry);var g=e(a.material);f=f.bones&&0<f.bones.length?new xd(f,g):new va(f,g);break;case \"LOD\":f=new Jc;break;case \"Line\":f=new wa(d(a.geometry),e(a.material),a.mode);break;case \"LineLoop\":f=new yd(d(a.geometry),e(a.material));break;case \"LineSegments\":f=new Y(d(a.geometry),e(a.material));break;case \"PointCloud\":case \"Points\":f=new Xb(d(a.geometry),e(a.material));break;case \"Sprite\":f=new Ic(e(a.material));break;case \"Group\":f=new Ub;break;default:f=new H}f.uuid=a.uuid;void 0!==\na.name&&(f.name=a.name);void 0!==a.matrix?(f.matrix.fromArray(a.matrix),void 0!==a.matrixAutoUpdate&&(f.matrixAutoUpdate=a.matrixAutoUpdate),f.matrixAutoUpdate&&f.matrix.decompose(f.position,f.quaternion,f.scale)):(void 0!==a.position&&f.position.fromArray(a.position),void 0!==a.rotation&&f.rotation.fromArray(a.rotation),void 0!==a.quaternion&&f.quaternion.fromArray(a.quaternion),void 0!==a.scale&&f.scale.fromArray(a.scale));void 0!==a.castShadow&&(f.castShadow=a.castShadow);void 0!==a.receiveShadow&&\n(f.receiveShadow=a.receiveShadow);a.shadow&&(void 0!==a.shadow.bias&&(f.shadow.bias=a.shadow.bias),void 0!==a.shadow.radius&&(f.shadow.radius=a.shadow.radius),void 0!==a.shadow.mapSize&&f.shadow.mapSize.fromArray(a.shadow.mapSize),void 0!==a.shadow.camera&&(f.shadow.camera=this.parseObject(a.shadow.camera)));void 0!==a.visible&&(f.visible=a.visible);void 0!==a.frustumCulled&&(f.frustumCulled=a.frustumCulled);void 0!==a.renderOrder&&(f.renderOrder=a.renderOrder);void 0!==a.userData&&(f.userData=a.userData);\nvoid 0!==a.layers&&(f.layers.mask=a.layers);if(void 0!==a.children){g=a.children;for(var h=0;h<g.length;h++)f.add(this.parseObject(g[h],b,c))}if(\"LOD\"===a.type)for(a=a.levels,g=0;g<a.length;g++){h=a[g];var l=f.getObjectByProperty(\"uuid\",h.object);void 0!==l&&f.addLevel(l,h.distance)}return f}});var Wg={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,\nCubeUVRefractionMapping:307},Df={RepeatWrapping:1E3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Ef={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};ke.prototype={constructor:ke,setOptions:function(a){this.options=a;return this},load:function(a,b,c,d){void 0===a&&(a=\"\");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var e=this,f=Kb.get(a);if(void 0!==f)return e.manager.itemStart(a),\nsetTimeout(function(){b&&b(f);e.manager.itemEnd(a)},0),f;fetch(a).then(function(a){return a.blob()}).then(function(a){return createImageBitmap(a,e.options)}).then(function(c){Kb.add(a,c);b&&b(c);e.manager.itemEnd(a)}).catch(function(b){d&&d(b);e.manager.itemEnd(a);e.manager.itemError(a)})},setCrossOrigin:function(){return this},setPath:function(a){this.path=a;return this}};Object.assign(le.prototype,{moveTo:function(a,b){this.currentPath=new Qa;this.subPaths.push(this.currentPath);this.currentPath.moveTo(a,\nb)},lineTo:function(a,b){this.currentPath.lineTo(a,b)},quadraticCurveTo:function(a,b,c,d){this.currentPath.quadraticCurveTo(a,b,c,d)},bezierCurveTo:function(a,b,c,d,e,f){this.currentPath.bezierCurveTo(a,b,c,d,e,f)},splineThru:function(a){this.currentPath.splineThru(a)},toShapes:function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new jb;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],l=h.x-g.x,k=h.y-g.y;if(Math.abs(k)>\nNumber.EPSILON){if(0>k&&(g=b[f],l=-l,h=b[e],k=-k),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=k*(a.x-g.x)-l*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=$a.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new jb;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints());l=a?!l:l;h=[];var k=[],p=[],n=0;k[n]=void 0;p[n]=[];for(var t=\n0,q=f.length;t<q;t++){g=f[t];var r=g.getPoints();var u=e(r);(u=a?!u:u)?(!l&&k[n]&&n++,k[n]={s:new jb,p:r},k[n].s.curves=g.curves,l&&n++,p[n]=[]):p[n].push({h:g,p:r[0]})}if(!k[0])return c(f);if(1<k.length){t=!1;a=[];e=0;for(f=k.length;e<f;e++)h[e]=[];e=0;for(f=k.length;e<f;e++)for(g=p[e],u=0;u<g.length;u++){l=g[u];n=!0;for(r=0;r<k.length;r++)d(l.p,k[r].p)&&(e!==r&&a.push({froms:e,tos:r,hole:u}),n?(n=!1,h[r].push(l)):t=!0);n&&h[e].push(l)}0<a.length&&(t||(p=h))}t=0;for(e=k.length;t<e;t++)for(h=k[t].s,\nb.push(h),a=p[t],f=0,g=a.length;f<g;f++)h.holes.push(a[f].h);return b}});Object.assign(me.prototype,{isFont:!0,generateShapes:function(a,b){void 0===b&&(b=100);var c=[],d=b;b=this.data;var e=Array.from?Array.from(a):String(a).split(\"\");d/=b.resolution;var f=(b.boundingBox.yMax-b.boundingBox.yMin+b.underlineThickness)*d;a=[];for(var g=0,h=0,l=0;l<e.length;l++){var k=e[l];if(\"\\n\"===k)g=0,h-=f;else{var p=d;var n=g,t=h;if(k=b.glyphs[k]||b.glyphs[\"?\"]){var q=new le;if(k.o)for(var r=k._cachedOutline||(k._cachedOutline=\nk.o.split(\" \")),u=0,y=r.length;u<y;)switch(r[u++]){case \"m\":var w=r[u++]*p+n;var x=r[u++]*p+t;q.moveTo(w,x);break;case \"l\":w=r[u++]*p+n;x=r[u++]*p+t;q.lineTo(w,x);break;case \"q\":var z=r[u++]*p+n;var B=r[u++]*p+t;var D=r[u++]*p+n;var E=r[u++]*p+t;q.quadraticCurveTo(D,E,z,B);break;case \"b\":z=r[u++]*p+n,B=r[u++]*p+t,D=r[u++]*p+n,E=r[u++]*p+t,w=r[u++]*p+n,x=r[u++]*p+t,q.bezierCurveTo(D,E,w,x,z,B)}p={offsetX:k.ha*p,path:q}}else p=void 0;g+=p.offsetX;a.push(p.path)}}b=0;for(e=a.length;b<e;b++)Array.prototype.push.apply(c,\na[b].toShapes());return c}});Object.assign(of.prototype,{load:function(a,b,c,d){var e=this,f=new La(this.manager);f.setPath(this.path);f.load(a,function(a){try{var c=JSON.parse(a)}catch(l){console.warn(\"THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.\"),c=JSON.parse(a.substring(65,a.length-2))}a=e.parse(c);b&&b(a)},c,d)},parse:function(a){return new me(a)},setPath:function(a){this.path=a;return this}});var Ud,pe={getContext:function(){void 0===Ud&&(Ud=new (window.AudioContext||\nwindow.webkitAudioContext));return Ud},setContext:function(a){Ud=a}};Object.assign(ne.prototype,{load:function(a,b,c,d){var e=new La(this.manager);e.setResponseType(\"arraybuffer\");e.load(a,function(a){a=a.slice(0);pe.getContext().decodeAudioData(a,function(a){b(a)})},c,d)}});Object.assign(pf.prototype,{update:function(){var a,b,c,d,e,f,g,h,l=new R,k=new R;return function(m){if(a!==this||b!==m.focus||c!==m.fov||d!==m.aspect*this.aspect||e!==m.near||f!==m.far||g!==m.zoom||h!==this.eyeSep){a=this;b=\nm.focus;c=m.fov;d=m.aspect*this.aspect;e=m.near;f=m.far;g=m.zoom;var n=m.projectionMatrix.clone();h=this.eyeSep/2;var p=h*e/b,q=e*Math.tan(J.DEG2RAD*c*.5)/g;k.elements[12]=-h;l.elements[12]=h;var r=-q*d+p;var v=q*d+p;n.elements[0]=2*e/(v-r);n.elements[8]=(v+r)/(v-r);this.cameraL.projectionMatrix.copy(n);r=-q*d-p;v=q*d-p;n.elements[0]=2*e/(v-r);n.elements[8]=(v+r)/(v-r);this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(m.matrixWorld).multiply(k);this.cameraR.matrixWorld.copy(m.matrixWorld).multiply(l)}}()});\nkd.prototype=Object.create(H.prototype);kd.prototype.constructor=kd;oe.prototype=Object.assign(Object.create(H.prototype),{constructor:oe,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null);return this},getFilter:function(){return this.filter},setFilter:function(a){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):\nthis.gain.disconnect(this.context.destination);this.filter=a;this.gain.connect(this.filter);this.filter.connect(this.context.destination);return this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this},updateMatrixWorld:function(){var a=new p,b=new ca,c=new p,d=new p;return function(e){H.prototype.updateMatrixWorld.call(this,e);e=this.context.listener;var f=this.up;this.matrixWorld.decompose(a,\nb,c);d.set(0,0,-1).applyQuaternion(b);e.positionX?(e.positionX.setValueAtTime(a.x,this.context.currentTime),e.positionY.setValueAtTime(a.y,this.context.currentTime),e.positionZ.setValueAtTime(a.z,this.context.currentTime),e.forwardX.setValueAtTime(d.x,this.context.currentTime),e.forwardY.setValueAtTime(d.y,this.context.currentTime),e.forwardZ.setValueAtTime(d.z,this.context.currentTime),e.upX.setValueAtTime(f.x,this.context.currentTime),e.upY.setValueAtTime(f.y,this.context.currentTime),e.upZ.setValueAtTime(f.z,\nthis.context.currentTime)):(e.setPosition(a.x,a.y,a.z),e.setOrientation(d.x,d.y,d.z,f.x,f.y,f.z))}}()});qc.prototype=Object.assign(Object.create(H.prototype),{constructor:qc,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl=!1;this.sourceType=\"audioNode\";this.source=a;this.connect();return this},setMediaElementSource:function(a){this.hasPlaybackControl=!1;this.sourceType=\"mediaNode\";this.source=this.context.createMediaElementSource(a);this.connect();return this},\nsetBuffer:function(a){this.buffer=a;this.sourceType=\"buffer\";this.autoplay&&this.play();return this},play:function(){if(!0===this.isPlaying)console.warn(\"THREE.Audio: Audio is already playing.\");else if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else{var a=this.context.createBufferSource();a.buffer=this.buffer;a.loop=this.loop;a.onended=this.onEnded.bind(this);a.playbackRate.setValueAtTime(this.playbackRate,this.startTime);this.startTime=this.context.currentTime;\na.start(this.startTime,this.offset);this.isPlaying=!0;this.source=a;return this.connect()}},pause:function(){if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else return!0===this.isPlaying&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this},stop:function(){if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else return this.source.stop(),this.offset=\n0,this.isPlaying=!1,this},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].connect(this.filters[a]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].disconnect(this.filters[a]);this.filters[this.filters.length-\n1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(a){a||(a=[]);!0===this.isPlaying?(this.disconnect(),this.filters=a,this.connect()):this.filters=a;return this},getFilter:function(){return this.getFilters()[0]},setFilter:function(a){return this.setFilters(a?[a]:[])},setPlaybackRate:function(a){if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else return this.playbackRate=\na,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn(\"THREE.Audio: this Audio has no playback control.\"),!1):this.loop},setLoop:function(a){if(!1===this.hasPlaybackControl)console.warn(\"THREE.Audio: this Audio has no playback control.\");else return this.loop=a,!0===this.isPlaying&&\n(this.source.loop=this.loop),this},getVolume:function(){return this.gain.gain.value},setVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this}});qe.prototype=Object.assign(Object.create(qc.prototype),{constructor:qe,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(a){this.panner.refDistance=a;return this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(a){this.panner.rolloffFactor=\na;return this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(a){this.panner.distanceModel=a;return this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(a){this.panner.maxDistance=a;return this},setDirectionalCone:function(a,b,c){this.panner.coneInnerAngle=a;this.panner.coneOuterAngle=b;this.panner.coneOuterGain=c;return this},updateMatrixWorld:function(){var a=new p,b=new ca,c=new p,d=new p;return function(e){H.prototype.updateMatrixWorld.call(this,\ne);e=this.panner;this.matrixWorld.decompose(a,b,c);d.set(0,0,1).applyQuaternion(b);e.setPosition(a.x,a.y,a.z);e.setOrientation(d.x,d.y,d.z)}}()});Object.assign(re.prototype,{getFrequencyData:function(){this.analyser.getByteFrequencyData(this.data);return this.data},getAverageFrequency:function(){for(var a=0,b=this.getFrequencyData(),c=0;c<b.length;c++)a+=b[c];return a/b.length}});Object.assign(se.prototype,{accumulate:function(a,b){var c=this.buffer,d=this.valueSize;a=a*d+d;var e=this.cumulativeWeight;\nif(0===e){for(e=0;e!==d;++e)c[a+e]=c[e];e=b}else e+=b,this._mixBufferRegion(c,a,0,b/e,d);this.cumulativeWeight=e},apply:function(a){var b=this.valueSize,c=this.buffer;a=a*b+b;var d=this.cumulativeWeight,e=this.binding;this.cumulativeWeight=0;1>d&&this._mixBufferRegion(c,a,3*b,1-d,b);d=b;for(var f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a=this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=\n0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a,b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){ca.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f=1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});Object.assign(qf.prototype,{getValue:function(a,b){this.bind();var c=this._bindings[this._targetGroup.nCachedObjects_];void 0!==c&&c.getValue(a,b)},setValue:function(a,b){for(var c=this._bindings,d=this._targetGroup.nCachedObjects_,\ne=c.length;d!==e;++d)c[d].setValue(a,b)},bind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(ra,{Composite:qf,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new ra.Composite(a,b,c):new ra(a,b,c)},sanitizeNodeName:function(){var a=/[\\[\\]\\.:\\/]/g;return function(b){return b.replace(/\\s/g,\"_\").replace(a,\n\"\")}}(),parseTrackName:function(){var a=\"[^\"+\"\\\\[\\\\]\\\\.:\\\\/\".replace(\"\\\\.\",\"\")+\"]\",b=/((?:WC+[\\/:])*)/.source.replace(\"WC\",\"[^\\\\[\\\\]\\\\.:\\\\/]\");a=/(WCOD+)?/.source.replace(\"WCOD\",a);var c=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace(\"WC\",\"[^\\\\[\\\\]\\\\.:\\\\/]\"),d=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace(\"WC\",\"[^\\\\[\\\\]\\\\.:\\\\/]\"),e=new RegExp(\"^\"+b+a+c+d+\"$\"),f=[\"material\",\"materials\",\"bones\"];return function(a){var b=e.exec(a);if(!b)throw Error(\"PropertyBinding: Cannot parse trackName: \"+a);b={nodeName:b[2],\nobjectName:b[3],objectIndex:b[4],propertyName:b[5],propertyIndex:b[6]};var c=b.nodeName&&b.nodeName.lastIndexOf(\".\");if(void 0!==c&&-1!==c){var d=b.nodeName.substring(c+1);-1!==f.indexOf(d)&&(b.nodeName=b.nodeName.substring(0,c),b.objectName=d)}if(null===b.propertyName||0===b.propertyName.length)throw Error(\"PropertyBinding: can not parse propertyName from trackName: \"+a);return b}}(),findNode:function(a,b){if(!b||\"\"===b||\"root\"===b||\".\"===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){var c=\na.skeleton.getBoneByName(b);if(void 0!==c)return c}if(a.children){var d=function(a){for(var c=0;c<a.length;c++){var e=a[c];if(e.name===b||e.uuid===b||(e=d(e.children)))return e}return null};if(a=d(a.children))return a}return null}});Object.assign(ra.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(a,b){a[b]=this.node[this.propertyName]},\nfunction(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)a[b++]=c[d]},function(a,b){a[b]=this.resolvedProperty[this.propertyIndex]},function(a,b){this.resolvedProperty.toArray(a,b)}],SetterByBindingTypeAndVersioning:[[function(a,b){this.targetObject[this.propertyName]=a[b]},function(a,b){this.targetObject[this.propertyName]=a[b];this.targetObject.needsUpdate=!0},function(a,b){this.targetObject[this.propertyName]=a[b];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){for(var c=\nthis.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++]},function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.needsUpdate=!0},function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){this.resolvedProperty[this.propertyIndex]=a[b]},function(a,b){this.resolvedProperty[this.propertyIndex]=a[b];this.targetObject.needsUpdate=!0},function(a,b){this.resolvedProperty[this.propertyIndex]=\na[b];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){this.resolvedProperty.fromArray(a,b)},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.needsUpdate=!0},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(a,b){this.bind();this.getValue(a,b)},setValue:function(a,b){this.bind();this.setValue(a,b)},bind:function(){var a=this.node,b=this.parsedPath,c=b.objectName,d=b.propertyName,e=b.propertyIndex;a||(this.node=\na=ra.findNode(this.rootNode,b.nodeName)||this.rootNode);this.getValue=this._getValue_unavailable;this.setValue=this._setValue_unavailable;if(a){if(c){var f=b.objectIndex;switch(c){case \"materials\":if(!a.material){console.error(\"THREE.PropertyBinding: Can not bind to material as node does not have a material.\",this);return}if(!a.material.materials){console.error(\"THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.\",this);return}a=a.material.materials;\nbreak;case \"bones\":if(!a.skeleton){console.error(\"THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.\",this);return}a=a.skeleton.bones;for(c=0;c<a.length;c++)if(a[c].name===f){f=c;break}break;default:if(void 0===a[c]){console.error(\"THREE.PropertyBinding: Can not bind to objectName of node undefined.\",this);return}a=a[c]}if(void 0!==f){if(void 0===a[f]){console.error(\"THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.\",this,a);return}a=\na[f]}}f=a[d];if(void 0===f)console.error(\"THREE.PropertyBinding: Trying to update property for track: \"+b.nodeName+\".\"+d+\" but it wasn't found.\",a);else{b=this.Versioning.None;void 0!==a.needsUpdate?(b=this.Versioning.NeedsUpdate,this.targetObject=a):void 0!==a.matrixWorldNeedsUpdate&&(b=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=a);c=this.BindingType.Direct;if(void 0!==e){if(\"morphTargetInfluences\"===d){if(!a.geometry){console.error(\"THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.\",\nthis);return}if(a.geometry.isBufferGeometry){if(!a.geometry.morphAttributes){console.error(\"THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.\",this);return}for(c=0;c<this.node.geometry.morphAttributes.position.length;c++)if(a.geometry.morphAttributes.position[c].name===e){e=c;break}}else{if(!a.geometry.morphTargets){console.error(\"THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.\",\nthis);return}for(c=0;c<this.node.geometry.morphTargets.length;c++)if(a.geometry.morphTargets[c].name===e){e=c;break}}}c=this.BindingType.ArrayElement;this.resolvedProperty=f;this.propertyIndex=e}else void 0!==f.fromArray&&void 0!==f.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=f):Array.isArray(f)?(c=this.BindingType.EntireArray,this.resolvedProperty=f):this.propertyName=d;this.getValue=this.GetterByBindingType[c];this.setValue=this.SetterByBindingTypeAndVersioning[c][b]}}else console.error(\"THREE.PropertyBinding: Trying to update node for track: \"+\nthis.path+\" but it wasn't found.\")},unbind:function(){this.node=null;this.getValue=this._getValue_unbound;this.setValue=this._setValue_unbound}});Object.assign(ra.prototype,{_getValue_unbound:ra.prototype.getValue,_setValue_unbound:ra.prototype.setValue});Object.assign(rf.prototype,{isAnimationObjectGroup:!0,add:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._paths,f=this._parsedPaths,g=this._bindings,h=g.length,l=void 0,k=0,p=arguments.length;k!==\np;++k){var n=arguments[k],t=n.uuid,q=d[t];if(void 0===q){q=b++;d[t]=q;a.push(n);t=0;for(var r=h;t!==r;++t)g[t].push(new ra(n,e[t],f[t]))}else if(q<c){l=a[q];var u=--c;r=a[u];d[r.uuid]=q;a[q]=r;d[t]=u;a[u]=n;t=0;for(r=h;t!==r;++t){var y=g[t],w=y[q];y[q]=y[u];void 0===w&&(w=new ra(n,e[t],f[t]));y[u]=w}}else a[q]!==l&&console.error(\"THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.\")}this.nCachedObjects_=\nc},remove:function(){for(var a=this._objects,b=this.nCachedObjects_,c=this._indicesByUUID,d=this._bindings,e=d.length,f=0,g=arguments.length;f!==g;++f){var h=arguments[f],l=h.uuid,k=c[l];if(void 0!==k&&k>=b){var p=b++,n=a[p];c[n.uuid]=k;a[k]=n;c[l]=p;a[p]=h;h=0;for(l=e;h!==l;++h){n=d[h];var t=n[k];n[k]=n[p];n[p]=t}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var l=\narguments[g].uuid,k=d[l];if(void 0!==k)if(delete d[l],k<c){l=--c;var p=a[l],n=--b,t=a[n];d[p.uuid]=k;a[k]=p;d[t.uuid]=l;a[l]=t;a.pop();p=0;for(t=f;p!==t;++p){var q=e[p],r=q[n];q[k]=q[l];q[l]=r;q.pop()}}else for(n=--b,t=a[n],d[t.uuid]=k,a[k]=t,a.pop(),p=0,t=f;p!==t;++p)q=e[p],q[k]=q[n],q.pop()}this.nCachedObjects_=c},subscribe_:function(a,b){var c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];var f=this._paths,g=this._parsedPaths,h=this._objects,k=this.nCachedObjects_,\nm=Array(h.length);d=e.length;c[a]=d;f.push(a);g.push(b);e.push(m);c=k;for(d=h.length;c!==d;++c)m[c]=new ra(h[c],a,b);return m},unsubscribe_:function(a){var b=this._bindingsIndicesByPath,c=b[a];if(void 0!==c){var d=this._paths,e=this._parsedPaths,f=this._bindings,g=f.length-1,h=f[g];b[a[g]]=c;f[c]=h;f.pop();e[c]=e[g];e.pop();d[c]=d[g];d.pop()}}});Object.assign(sf.prototype,{play:function(){this._mixer._activateAction(this);return this},stop:function(){this._mixer._deactivateAction(this);return this.reset()},\nreset:function(){this.paused=!1;this.enabled=!0;this.time=0;this._loopCount=-1;this._startTime=null;return this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(a){this._startTime=a;return this},setLoop:function(a,b){this.loop=a;this.repetitions=b;return this},setEffectiveWeight:function(a){this.weight=a;\nthis._effectiveWeight=this.enabled?a:0;return this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(a){return this._scheduleFading(a,0,1)},fadeOut:function(a){return this._scheduleFading(a,1,0)},crossFadeFrom:function(a,b,c){a.fadeOut(b);this.fadeIn(b);if(c){c=this._clip.duration;var d=a._clip.duration,e=c/d;a.warp(1,d/c,b);this.warp(e,1,b)}return this},crossFadeTo:function(a,b,c){return a.crossFadeFrom(this,b,c)},stopFading:function(){var a=this._weightInterpolant;\nnull!==a&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},setEffectiveTimeScale:function(a){this.timeScale=a;this._effectiveTimeScale=this.paused?0:a;return this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(a){this.timeScale=this._clip.duration/a;return this.stopWarping()},syncWith:function(a){this.time=a.time;this.timeScale=a.timeScale;return this.stopWarping()},halt:function(a){return this.warp(this._effectiveTimeScale,\n0,a)},warp:function(a,b,c){var d=this._mixer,e=d.time,f=this._timeScaleInterpolant,g=this.timeScale;null===f&&(this._timeScaleInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;d[1]=e+c;f[0]=a/g;f[1]=b/g;return this},stopWarping:function(){var a=this._timeScaleInterpolant;null!==a&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||\nthis._mixer._root},_update:function(a,b,c,d){if(this.enabled){var e=this._startTime;if(null!==e){b=(a-e)*c;if(0>b||0===c)return;this._startTime=null;b*=c}b*=this._updateTimeScale(a);c=this._updateTime(b);a=this._updateWeight(a);if(0<a){b=this._interpolants;e=this._propertyBindings;for(var f=0,g=b.length;f!==g;++f)b[f].evaluate(c),e[f].accumulate(d,a)}}else this._updateWeight(a)},_updateWeight:function(a){var b=0;if(this.enabled){b=this.weight;var c=this._weightInterpolant;if(null!==c){var d=c.evaluate(a)[0];\nb*=d;a>c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight=b},_updateTimeScale:function(a){var b=0;if(!this.paused){b=this.timeScale;var c=this._timeScaleInterpolant;if(null!==c){var d=c.evaluate(a)[0];b*=d;a>c.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a;if(0===a)return b;var c=this._clip.duration,d=this.loop,e=this._loopCount;if(2200===\nd)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else break a;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:\"finished\",action:this,direction:0>a?-1:1})}else{d=2202===d;-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,d)):this._setEndings(0===this.repetitions,!0,d));if(b>=c||0>b){var f=Math.floor(b/c);b-=c*f;e+=Math.abs(f);var g=this.repetitions-e;0>=g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=\n0<a?c:0,this._mixer.dispatchEvent({type:\"finished\",action:this,direction:0<a?1:-1})):(1===g?(a=0>a,this._setEndings(a,!a,d)):this._setEndings(!1,!1,d),this._loopCount=e,this._mixer.dispatchEvent({type:\"loop\",action:this,loopDelta:f}))}if(d&&1===(e&1))return this.time=b,c-b}return this.time=b},_setEndings:function(a,b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,\nb,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}});te.prototype=Object.assign(Object.create(za.prototype),{constructor:te,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var m=\nd[h],p=m.name,n=k[p];if(void 0===n){n=f[h];if(void 0!==n){null===n._cacheIndex&&(++n.referenceCount,this._addInactiveBinding(n,g,p));continue}n=new se(ra.create(c,p,b&&b._propertyBindings[h].binding.parsedPath),m.ValueTypeName,m.getValueSize());++n.referenceCount;this._addInactiveBinding(n,g,p)}f[h]=n;a[h].resultBuffer=n.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,\nd&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip=\n{};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;\nreturn null!==a&&a<this._nActiveActions},_addInactiveAction:function(a,b,c){var d=this._actions,e=this._actionsByClip,f=e[b];void 0===f?(f={knownActions:[a],actionByRoot:{}},a._byClipCacheIndex=0,e[b]=f):(b=f.knownActions,a._byClipCacheIndex=b.length,b.push(a));a._cacheIndex=d.length;d.push(a);f.actionByRoot[c]=a},_removeInactiveAction:function(a){var b=this._actions,c=b[b.length-1],d=a._cacheIndex;c._cacheIndex=d;b[d]=c;b.pop();a._cacheIndex=null;b=a._clip.uuid;c=this._actionsByClip;d=c[b];var e=\nd.knownActions,f=e[e.length-1],g=a._byClipCacheIndex;f._byClipCacheIndex=g;e[g]=f;e.pop();a._byClipCacheIndex=null;delete d.actionByRoot[(a._localRoot||this._root).uuid];0===e.length&&delete c[b];this._removeInactiveBindingsForAction(a)},_removeInactiveBindingsForAction:function(a){a=a._propertyBindings;for(var b=0,c=a.length;b!==c;++b){var d=a[b];0===--d.referenceCount&&this._removeInactiveBinding(d)}},_lendAction:function(a){var b=this._actions,c=a._cacheIndex,d=this._nActiveActions++,e=b[d];a._cacheIndex=\nd;b[d]=a;e._cacheIndex=c;b[c]=e},_takeBackAction:function(a){var b=this._actions,c=a._cacheIndex,d=--this._nActiveActions,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_addInactiveBinding:function(a,b,c){var d=this._bindingsByRootAndName,e=d[b],f=this._bindings;void 0===e&&(e={},d[b]=e);e[c]=a;a._cacheIndex=f.length;f.push(a)},_removeInactiveBinding:function(a){var b=this._bindings,c=a.binding,d=c.rootNode.uuid;c=c.path;var e=this._bindingsByRootAndName,f=e[d],g=b[b.length-1];a=a._cacheIndex;\ng._cacheIndex=a;b[a]=g;b.pop();delete f[c];a:{for(var h in f)break a;delete e[d]}},_lendBinding:function(a){var b=this._bindings,c=a._cacheIndex,d=this._nActiveBindings++,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_takeBackBinding:function(a){var b=this._bindings,c=a._cacheIndex,d=--this._nActiveBindings,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_lendControlInterpolant:function(){var a=this._controlInterpolants,b=this._nActiveControlInterpolants++,c=a[b];void 0===c&&(c=new jd(new Float32Array(2),\nnew Float32Array(2),1,this._controlInterpolantsResultBuffer),c.__cacheIndex=b,a[b]=c);return c},_takeBackControlInterpolant:function(a){var b=this._controlInterpolants,c=a.__cacheIndex,d=--this._nActiveControlInterpolants,e=b[d];a.__cacheIndex=d;b[d]=a;e.__cacheIndex=c;b[c]=e},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(a,b){var c=b||this._root,d=c.uuid;c=\"string\"===typeof a?Ga.findByName(c,a):a;a=null!==c?c.uuid:a;var e=this._actionsByClip[a],f=null;if(void 0!==e){f=\ne.actionByRoot[d];if(void 0!==f)return f;f=e.knownActions[0];null===c&&(c=f._clip)}if(null===c)return null;b=new sf(this,c,b);this._bindAction(b,f);this._addInactiveAction(b,a,d);return b},existingAction:function(a,b){var c=b||this._root;b=c.uuid;c=\"string\"===typeof a?Ga.findByName(c,a):a;a=this._actionsByClip[c?c.uuid:a];return void 0!==a?a.actionByRoot[b]||null:null},stopAllAction:function(){for(var a=this._actions,b=this._nActiveActions,c=this._bindings,d=this._nActiveBindings,e=this._nActiveBindings=\nthis._nActiveActions=0;e!==b;++e)a[e].reset();for(e=0;e!==d;++e)c[e].useCount=0;return this},update:function(a){a*=this.timeScale;for(var b=this._actions,c=this._nActiveActions,d=this.time+=a,e=Math.sign(a),f=this._accuIndex^=1,g=0;g!==c;++g)b[g]._update(d,a,e,f);a=this._bindings;b=this._nActiveBindings;for(g=0;g!==b;++g)a[g].apply(f);return this},getRoot:function(){return this._root},uncacheClip:function(a){var b=this._actions;a=a.uuid;var c=this._actionsByClip,d=c[a];if(void 0!==d){d=d.knownActions;\nfor(var e=0,f=d.length;e!==f;++e){var g=d[e];this._deactivateAction(g);var h=g._cacheIndex,k=b[b.length-1];g._cacheIndex=null;g._byClipCacheIndex=null;k._cacheIndex=h;b[h]=k;b.pop();this._removeInactiveBindingsForAction(g)}delete c[a]}},uncacheRoot:function(a){a=a.uuid;var b=this._actionsByClip;for(d in b){var c=b[d].actionByRoot[a];void 0!==c&&(this._deactivateAction(c),this._removeInactiveAction(c))}var d=this._bindingsByRootAndName[a];if(void 0!==d)for(var e in d)a=d[e],a.restoreOriginalState(),\nthis._removeInactiveBinding(a)},uncacheAction:function(a,b){a=this.existingAction(a,b);null!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}});Qd.prototype.clone=function(){return new Qd(void 0===this.value.clone?this.value:this.value.clone())};ue.prototype=Object.assign(Object.create(D.prototype),{constructor:ue,isInstancedBufferGeometry:!0,copy:function(a){D.prototype.copy.call(this,a);this.maxInstancedCount=a.maxInstancedCount;return this},clone:function(){return(new this.constructor).copy(this)}});\nObject.defineProperties(ve.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}});Object.assign(ve.prototype,{isInterleavedBufferAttribute:!0,setX:function(a,b){this.data.array[a*this.data.stride+this.offset]=b;return this},setY:function(a,b){this.data.array[a*this.data.stride+this.offset+1]=b;return this},setZ:function(a,b){this.data.array[a*this.data.stride+this.offset+2]=b;return this},setW:function(a,b){this.data.array[a*this.data.stride+this.offset+\n3]=b;return this},getX:function(a){return this.data.array[a*this.data.stride+this.offset]},getY:function(a){return this.data.array[a*this.data.stride+this.offset+1]},getZ:function(a){return this.data.array[a*this.data.stride+this.offset+2]},getW:function(a){return this.data.array[a*this.data.stride+this.offset+3]},setXY:function(a,b,c){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data.array[a+\n0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;this.data.array[a+3]=e;return this}});Object.defineProperty(rc.prototype,\"needsUpdate\",{set:function(a){!0===a&&this.version++}});Object.assign(rc.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(a){if(Array.isArray(a))throw new TypeError(\"THREE.BufferAttribute: array should be a Typed Array.\");\nthis.count=void 0!==a?a.length/this.stride:0;this.array=a;return this},setDynamic:function(a){this.dynamic=a;return this},copy:function(a){this.array=new a.array.constructor(a.array);this.count=a.count;this.stride=a.stride;this.dynamic=a.dynamic;return this},copyAt:function(a,b,c){a*=this.stride;c*=b.stride;for(var d=0,e=this.stride;d<e;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},clone:function(){return(new this.constructor).copy(this)},\nonUpload:function(a){this.onUploadCallback=a;return this}});we.prototype=Object.assign(Object.create(rc.prototype),{constructor:we,isInstancedInterleavedBuffer:!0,copy:function(a){rc.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;return this}});xe.prototype=Object.assign(Object.create(L.prototype),{constructor:xe,isInstancedBufferAttribute:!0,copy:function(a){L.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;return this}});Object.assign(tf.prototype,{linePrecision:1,\nset:function(a,b){this.ray.set(a,b)},setFromCamera:function(a,b){b&&b.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(b.matrixWorld),this.ray.direction.set(a.x,a.y,.5).unproject(b).sub(this.ray.origin).normalize()):b&&b.isOrthographicCamera?(this.ray.origin.set(a.x,a.y,(b.near+b.far)/(b.near-b.far)).unproject(b),this.ray.direction.set(0,0,-1).transformDirection(b.matrixWorld)):console.error(\"THREE.Raycaster: Unsupported camera type.\")},intersectObject:function(a,b,c){c=c||[];ye(a,this,\nc,b);c.sort(uf);return c},intersectObjects:function(a,b,c){c=c||[];if(!1===Array.isArray(a))return console.warn(\"THREE.Raycaster.intersectObjects: objects is not an Array.\"),c;for(var d=0,e=a.length;d<e;d++)ye(a[d],this,c,b);c.sort(uf);return c}});Object.assign(vf.prototype,{start:function(){this.oldTime=this.startTime=(\"undefined\"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0},stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta();\nreturn this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=(\"undefined\"===typeof performance?Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});Object.assign(wf.prototype,{set:function(a,b,c){this.radius=a;this.phi=b;this.theta=c;return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.radius=a.radius;this.phi=a.phi;this.theta=a.theta;return this},\nmakeSafe:function(){this.phi=Math.max(1E-6,Math.min(Math.PI-1E-6,this.phi));return this},setFromVector3:function(a){this.radius=a.length();0===this.radius?this.phi=this.theta=0:(this.theta=Math.atan2(a.x,a.z),this.phi=Math.acos(J.clamp(a.y/this.radius,-1,1)));return this}});Object.assign(xf.prototype,{set:function(a,b,c){this.radius=a;this.theta=b;this.y=c;return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.radius=a.radius;this.theta=a.theta;this.y=a.y;return this},\nsetFromVector3:function(a){this.radius=Math.sqrt(a.x*a.x+a.z*a.z);this.theta=Math.atan2(a.x,a.z);this.y=a.y;return this}});Object.assign(ze.prototype,{set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new B;return function(b,c){c=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(c);this.max.copy(b).add(c);return this}}(),clone:function(){return(new this.constructor).copy(this)},\ncopy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=Infinity;this.max.x=this.max.y=-Infinity;return this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(a){void 0===a&&(console.warn(\"THREE.Box2: .getCenter() target is now required\"),a=new B);return this.isEmpty()?a.set(0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(a){void 0===a&&(console.warn(\"THREE.Box2: .getSize() target is now required\"),\na=new B);return this.isEmpty()?a.set(0,0):a.subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=\nthis.max.y},getParameter:function(a,b){void 0===b&&(console.warn(\"THREE.Box2: .getParameter() target is now required\"),b=new B);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn(\"THREE.Box2: .clampPoint() target is now required\"),b=new B);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=\nnew B;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});ld.prototype=Object.create(H.prototype);ld.prototype.constructor=ld;ld.prototype.isImmediateRenderObject=!0;md.prototype=Object.create(Y.prototype);\nmd.prototype.constructor=md;md.prototype.update=function(){var a=new p,b=new p,c=new la;return function(){var d=[\"a\",\"b\",\"c\"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,f=this.geometry.attributes.position,g=this.object.geometry;if(g&&g.isGeometry)for(var h=g.vertices,k=g.faces,m=g=0,p=k.length;m<p;m++)for(var n=k[m],t=0,q=n.vertexNormals.length;t<q;t++){var r=n.vertexNormals[t];a.copy(h[n[d[t]]]).applyMatrix4(e);b.copy(r).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);\nf.setXYZ(g,a.x,a.y,a.z);g+=1;f.setXYZ(g,b.x,b.y,b.z);g+=1}else if(g&&g.isBufferGeometry)for(d=g.attributes.position,h=g.attributes.normal,t=g=0,q=d.count;t<q;t++)a.set(d.getX(t),d.getY(t),d.getZ(t)).applyMatrix4(e),b.set(h.getX(t),h.getY(t),h.getZ(t)),b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a),f.setXYZ(g,a.x,a.y,a.z),g+=1,f.setXYZ(g,b.x,b.y,b.z),g+=1;f.needsUpdate=!0}}();sc.prototype=Object.create(H.prototype);sc.prototype.constructor=sc;sc.prototype.dispose=function(){this.cone.geometry.dispose();\nthis.cone.material.dispose()};sc.prototype.update=function(){var a=new p,b=new p;return function(){this.light.updateMatrixWorld();var c=this.light.distance?this.light.distance:1E3,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}();tc.prototype=Object.create(Y.prototype);\ntc.prototype.constructor=tc;tc.prototype.updateMatrixWorld=function(){var a=new p,b=new R,c=new R;return function(d){var e=this.bones,f=this.geometry,g=f.getAttribute(\"position\");c.getInverse(this.root.matrixWorld);for(var h=0,k=0;h<e.length;h++){var m=e[h];m.parent&&m.parent.isBone&&(b.multiplyMatrices(c,m.matrixWorld),a.setFromMatrixPosition(b),g.setXYZ(k,a.x,a.y,a.z),b.multiplyMatrices(c,m.parent.matrixWorld),a.setFromMatrixPosition(b),g.setXYZ(k+1,a.x,a.y,a.z),k+=2)}f.getAttribute(\"position\").needsUpdate=\n!0;H.prototype.updateMatrixWorld.call(this,d)}}();uc.prototype=Object.create(va.prototype);uc.prototype.constructor=uc;uc.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};uc.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};vc.prototype=Object.create(H.prototype);vc.prototype.constructor=vc;vc.prototype.dispose=function(){this.children[0].geometry.dispose();this.children[0].material.dispose()};\nvc.prototype.update=function(){var a=.5*this.light.width,b=.5*this.light.height,c=this.line.geometry.attributes.position,d=c.array;d[0]=a;d[1]=-b;d[2]=0;d[3]=a;d[4]=b;d[5]=0;d[6]=-a;d[7]=b;d[8]=0;d[9]=-a;d[10]=-b;d[11]=0;d[12]=a;d[13]=-b;d[14]=0;c.needsUpdate=!0;void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)};wc.prototype=Object.create(H.prototype);wc.prototype.constructor=wc;wc.prototype.dispose=function(){this.children[0].geometry.dispose();\nthis.children[0].material.dispose()};wc.prototype.update=function(){var a=new p,b=new G,c=new G;return function(){var d=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=d.geometry.getAttribute(\"color\");b.copy(this.light.color);c.copy(this.light.groundColor);for(var f=0,g=e.count;f<g;f++){var h=f<g/2?b:c;e.setXYZ(f,h.r,h.g,h.b)}e.needsUpdate=!0}d.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate())}}();nd.prototype=Object.create(Y.prototype);nd.prototype.constructor=\nnd;Rd.prototype=Object.create(Y.prototype);Rd.prototype.constructor=Rd;od.prototype=Object.create(Y.prototype);od.prototype.constructor=od;od.prototype.update=function(){var a=new p,b=new p,c=new la;return function(){this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var d=this.object.matrixWorld,e=this.geometry.attributes.position,f=this.object.geometry,g=f.vertices;f=f.faces;for(var h=0,k=0,m=f.length;k<m;k++){var p=f[k],n=p.normal;a.copy(g[p.a]).add(g[p.b]).add(g[p.c]).divideScalar(3).applyMatrix4(d);\nb.copy(n).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);e.setXYZ(h,a.x,a.y,a.z);h+=1;e.setXYZ(h,b.x,b.y,b.z);h+=1}e.needsUpdate=!0}}();xc.prototype=Object.create(H.prototype);xc.prototype.constructor=xc;xc.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};xc.prototype.update=function(){var a=new p,b=new p,c=new p;return function(){a.setFromMatrixPosition(this.light.matrixWorld);\nb.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color));this.targetLine.lookAt(c);this.targetLine.scale.z=c.length()}}();pd.prototype=Object.create(Y.prototype);pd.prototype.constructor=pd;pd.prototype.update=function(){function a(a,\ng,h,k){d.set(g,h,k).unproject(e);a=c[a];if(void 0!==a)for(g=b.getAttribute(\"position\"),h=0,k=a.length;h<k;h++)g.setXYZ(a[h],d.x,d.y,d.z)}var b,c,d=new p,e=new Ra;return function(){b=this.geometry;c=this.pointMap;e.projectionMatrix.copy(this.camera.projectionMatrix);a(\"c\",0,0,-1);a(\"t\",0,0,1);a(\"n1\",-1,-1,-1);a(\"n2\",1,-1,-1);a(\"n3\",-1,1,-1);a(\"n4\",1,1,-1);a(\"f1\",-1,-1,1);a(\"f2\",1,-1,1);a(\"f3\",-1,1,1);a(\"f4\",1,1,1);a(\"u1\",.7,1.1,-1);a(\"u2\",-.7,1.1,-1);a(\"u3\",0,2,-1);a(\"cf1\",-1,0,1);a(\"cf2\",1,0,1);a(\"cf3\",\n0,-1,1);a(\"cf4\",0,1,1);a(\"cn1\",-1,0,-1);a(\"cn2\",1,0,-1);a(\"cn3\",0,-1,-1);a(\"cn4\",0,1,-1);b.getAttribute(\"position\").needsUpdate=!0}}();Ib.prototype=Object.create(Y.prototype);Ib.prototype.constructor=Ib;Ib.prototype.update=function(){var a=new Xa;return function(b){void 0!==b&&console.warn(\"THREE.BoxHelper: .update() has no longer arguments.\");void 0!==this.object&&a.setFromObject(this.object);if(!a.isEmpty()){b=a.min;var c=a.max,d=this.geometry.attributes.position,e=d.array;e[0]=c.x;e[1]=c.y;e[2]=\nc.z;e[3]=b.x;e[4]=c.y;e[5]=c.z;e[6]=b.x;e[7]=b.y;e[8]=c.z;e[9]=c.x;e[10]=b.y;e[11]=c.z;e[12]=c.x;e[13]=c.y;e[14]=b.z;e[15]=b.x;e[16]=c.y;e[17]=b.z;e[18]=b.x;e[19]=b.y;e[20]=b.z;e[21]=c.x;e[22]=b.y;e[23]=b.z;d.needsUpdate=!0;this.geometry.computeBoundingSphere()}}}();Ib.prototype.setFromObject=function(a){this.object=a;this.update();return this};qd.prototype=Object.create(Y.prototype);qd.prototype.constructor=qd;qd.prototype.updateMatrixWorld=function(a){var b=this.box;b.isEmpty()||(b.getCenter(this.position),\nb.getSize(this.scale),this.scale.multiplyScalar(.5),H.prototype.updateMatrixWorld.call(this,a))};rd.prototype=Object.create(wa.prototype);rd.prototype.constructor=rd;rd.prototype.updateMatrixWorld=function(a){var b=-this.plane.constant;1E-8>Math.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);H.prototype.updateMatrixWorld.call(this,a)};var Sd,Ae;Jb.prototype=Object.create(H.prototype);Jb.prototype.constructor=Jb;Jb.prototype.setDirection=\nfunction(){var a=new p,b;return function(c){.99999<c.y?this.quaternion.set(0,0,0,1):-.99999>c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();Jb.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(0,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};Jb.prototype.setColor=function(a){this.line.material.color.copy(a);\nthis.cone.material.color.copy(a)};sd.prototype=Object.create(Y.prototype);sd.prototype.constructor=sd;E.create=function(a,b){console.log(\"THREE.Curve.create() has been deprecated\");a.prototype=Object.create(E.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(bb.prototype,{createPointsGeometry:function(a){console.warn(\"THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.\");a=this.getPoints(a);return this.createGeometry(a)},\ncreateSpacedPointsGeometry:function(a){console.warn(\"THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.\");a=this.getSpacedPoints(a);return this.createGeometry(a)},createGeometry:function(a){console.warn(\"THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.\");for(var b=new P,c=0,d=a.length;c<d;c++){var e=a[c];b.vertices.push(new p(e.x,e.y,e.z||0))}return b}});Object.assign(Qa.prototype,\n{fromPoints:function(a){console.warn(\"THREE.Path: .fromPoints() has been renamed to .setFromPoints().\");this.setFromPoints(a)}});zf.prototype=Object.create(pa.prototype);Af.prototype=Object.create(pa.prototype);Be.prototype=Object.create(pa.prototype);Object.assign(Be.prototype,{initFromArray:function(){console.error(\"THREE.Spline: .initFromArray() has been removed.\")},getControlPointsArray:function(){console.error(\"THREE.Spline: .getControlPointsArray() has been removed.\")},reparametrizeByArcLength:function(){console.error(\"THREE.Spline: .reparametrizeByArcLength() has been removed.\")}});\nnd.prototype.setColors=function(){console.error(\"THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.\")};tc.prototype.update=function(){console.error(\"THREE.SkeletonHelper: update() no longer needs to be called.\")};Object.assign(pc.prototype,{extractUrlBase:function(a){console.warn(\"THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.\");return Fe.extractUrlBase(a)}});Object.assign(ze.prototype,{center:function(a){console.warn(\"THREE.Box2: .center() has been renamed to .getCenter().\");\nreturn this.getCenter(a)},empty:function(){console.warn(\"THREE.Box2: .empty() has been renamed to .isEmpty().\");return this.isEmpty()},isIntersectionBox:function(a){console.warn(\"THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().\");return this.intersectsBox(a)},size:function(a){console.warn(\"THREE.Box2: .size() has been renamed to .getSize().\");return this.getSize(a)}});Object.assign(Xa.prototype,{center:function(a){console.warn(\"THREE.Box3: .center() has been renamed to .getCenter().\");\nreturn this.getCenter(a)},empty:function(){console.warn(\"THREE.Box3: .empty() has been renamed to .isEmpty().\");return this.isEmpty()},isIntersectionBox:function(a){console.warn(\"THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().\");return this.intersectsBox(a)},isIntersectionSphere:function(a){console.warn(\"THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().\");return this.intersectsSphere(a)},size:function(a){console.warn(\"THREE.Box3: .size() has been renamed to .getSize().\");\nreturn this.getSize(a)}});Qb.prototype.center=function(a){console.warn(\"THREE.Line3: .center() has been renamed to .getCenter().\");return this.getCenter(a)};Object.assign(J,{random16:function(){console.warn(\"THREE.Math: .random16() has been deprecated. Use Math.random() instead.\");return Math.random()},nearestPowerOfTwo:function(a){console.warn(\"THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo().\");return J.floorPowerOfTwo(a)},nextPowerOfTwo:function(a){console.warn(\"THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo().\");\nreturn J.ceilPowerOfTwo(a)}});Object.assign(la.prototype,{flattenToArrayOffset:function(a,b){console.warn(\"THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.\");return this.toArray(a,b)},multiplyVector3:function(a){console.warn(\"THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.\");return a.applyMatrix3(this)},multiplyVector3Array:function(){console.error(\"THREE.Matrix3: .multiplyVector3Array() has been removed.\")},applyToBuffer:function(a){console.warn(\"THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.\");\nreturn this.applyToBufferAttribute(a)},applyToVector3Array:function(){console.error(\"THREE.Matrix3: .applyToVector3Array() has been removed.\")}});Object.assign(R.prototype,{extractPosition:function(a){console.warn(\"THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().\");return this.copyPosition(a)},flattenToArrayOffset:function(a,b){console.warn(\"THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.\");return this.toArray(a,b)},getPosition:function(){var a;\nreturn function(){void 0===a&&(a=new p);console.warn(\"THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.\");return a.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(a){console.warn(\"THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().\");return this.makeRotationFromQuaternion(a)},multiplyToArray:function(){console.warn(\"THREE.Matrix4: .multiplyToArray() has been removed.\")},multiplyVector3:function(a){console.warn(\"THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.\");\nreturn a.applyMatrix4(this)},multiplyVector4:function(a){console.warn(\"THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.\");return a.applyMatrix4(this)},multiplyVector3Array:function(){console.error(\"THREE.Matrix4: .multiplyVector3Array() has been removed.\")},rotateAxis:function(a){console.warn(\"THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.\");a.transformDirection(this)},crossVector:function(a){console.warn(\"THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.\");\nreturn a.applyMatrix4(this)},translate:function(){console.error(\"THREE.Matrix4: .translate() has been removed.\")},rotateX:function(){console.error(\"THREE.Matrix4: .rotateX() has been removed.\")},rotateY:function(){console.error(\"THREE.Matrix4: .rotateY() has been removed.\")},rotateZ:function(){console.error(\"THREE.Matrix4: .rotateZ() has been removed.\")},rotateByAxis:function(){console.error(\"THREE.Matrix4: .rotateByAxis() has been removed.\")},applyToBuffer:function(a){console.warn(\"THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.\");\nreturn this.applyToBufferAttribute(a)},applyToVector3Array:function(){console.error(\"THREE.Matrix4: .applyToVector3Array() has been removed.\")},makeFrustum:function(a,b,c,d,e,f){console.warn(\"THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.\");return this.makePerspective(a,b,d,c,e,f)}});Ia.prototype.isIntersectionLine=function(a){console.warn(\"THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().\");return this.intersectsLine(a)};\nca.prototype.multiplyVector3=function(a){console.warn(\"THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.\");return a.applyQuaternion(this)};Object.assign(sb.prototype,{isIntersectionBox:function(a){console.warn(\"THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().\");return this.intersectsBox(a)},isIntersectionPlane:function(a){console.warn(\"THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().\");return this.intersectsPlane(a)},\nisIntersectionSphere:function(a){console.warn(\"THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().\");return this.intersectsSphere(a)}});Object.assign(ta.prototype,{area:function(){console.warn(\"THREE.Triangle: .area() has been renamed to .getArea().\");return this.getArea()},barycoordFromPoint:function(a,b){console.warn(\"THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().\");return this.getBarycoord(a,b)},midpoint:function(a){console.warn(\"THREE.Triangle: .midpoint() has been renamed to .getMidpoint().\");\nreturn this.getMidpoint(a)},normal:function(a){console.warn(\"THREE.Triangle: .normal() has been renamed to .getNormal().\");return this.getNormal(a)},plane:function(a){console.warn(\"THREE.Triangle: .plane() has been renamed to .getPlane().\");return this.getPlane(a)}});Object.assign(ta,{barycoordFromPoint:function(a,b,c,d,e){console.warn(\"THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().\");return ta.getBarycoord(a,b,c,d,e)},normal:function(a,b,c,d){console.warn(\"THREE.Triangle: .normal() has been renamed to .getNormal().\");\nreturn ta.getNormal(a,b,c,d)}});Object.assign(jb.prototype,{extractAllPoints:function(a){console.warn(\"THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.\");return this.extractPoints(a)},extrude:function(a){console.warn(\"THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.\");return new wb(this,a)},makeGeometry:function(a){console.warn(\"THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.\");return new yb(this,a)}});Object.assign(B.prototype,\n{fromAttribute:function(a,b,c){console.warn(\"THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().\");return this.fromBufferAttribute(a,b,c)},distanceToManhattan:function(a){console.warn(\"THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().\");return this.manhattanDistanceTo(a)},lengthManhattan:function(){console.warn(\"THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().\");return this.manhattanLength()}});Object.assign(p.prototype,\n{setEulerFromRotationMatrix:function(){console.error(\"THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.\")},setEulerFromQuaternion:function(){console.error(\"THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.\")},getPositionFromMatrix:function(a){console.warn(\"THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().\");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn(\"THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().\");\nreturn this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){console.warn(\"THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().\");return this.setFromMatrixColumn(b,a)},applyProjection:function(a){console.warn(\"THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.\");return this.applyMatrix4(a)},fromAttribute:function(a,b,c){console.warn(\"THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().\");return this.fromBufferAttribute(a,\nb,c)},distanceToManhattan:function(a){console.warn(\"THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().\");return this.manhattanDistanceTo(a)},lengthManhattan:function(){console.warn(\"THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().\");return this.manhattanLength()}});Object.assign(W.prototype,{fromAttribute:function(a,b,c){console.warn(\"THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().\");return this.fromBufferAttribute(a,\nb,c)},lengthManhattan:function(){console.warn(\"THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().\");return this.manhattanLength()}});Object.assign(P.prototype,{computeTangents:function(){console.error(\"THREE.Geometry: .computeTangents() has been removed.\")},computeLineDistances:function(){console.error(\"THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.\")}});Object.assign(H.prototype,{getChildByName:function(a){console.warn(\"THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().\");\nreturn this.getObjectByName(a)},renderDepth:function(){console.warn(\"THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.\")},translate:function(a,b){console.warn(\"THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.\");return this.translateOnAxis(b,a)},getWorldRotation:function(){console.error(\"THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.\")}});Object.defineProperties(H.prototype,\n{eulerOrder:{get:function(){console.warn(\"THREE.Object3D: .eulerOrder is now .rotation.order.\");return this.rotation.order},set:function(a){console.warn(\"THREE.Object3D: .eulerOrder is now .rotation.order.\");this.rotation.order=a}},useQuaternion:{get:function(){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")},set:function(){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")}}});\nObject.defineProperties(Jc.prototype,{objects:{get:function(){console.warn(\"THREE.LOD: .objects has been renamed to .levels.\");return this.levels}}});Object.defineProperty(Kc.prototype,\"useVertexTexture\",{get:function(){console.warn(\"THREE.Skeleton: useVertexTexture has been removed.\")},set:function(){console.warn(\"THREE.Skeleton: useVertexTexture has been removed.\")}});Object.defineProperty(E.prototype,\"__arcLengthDivisions\",{get:function(){console.warn(\"THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.\");\nreturn this.arcLengthDivisions},set:function(a){console.warn(\"THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.\");this.arcLengthDivisions=a}});Z.prototype.setLens=function(a,b){console.warn(\"THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup.\");void 0!==b&&(this.filmGauge=b);this.setFocalLength(a)};Object.defineProperties(X.prototype,{onlyShadow:{set:function(){console.warn(\"THREE.Light: .onlyShadow has been removed.\")}},shadowCameraFov:{set:function(a){console.warn(\"THREE.Light: .shadowCameraFov is now .shadow.camera.fov.\");\nthis.shadow.camera.fov=a}},shadowCameraLeft:{set:function(a){console.warn(\"THREE.Light: .shadowCameraLeft is now .shadow.camera.left.\");this.shadow.camera.left=a}},shadowCameraRight:{set:function(a){console.warn(\"THREE.Light: .shadowCameraRight is now .shadow.camera.right.\");this.shadow.camera.right=a}},shadowCameraTop:{set:function(a){console.warn(\"THREE.Light: .shadowCameraTop is now .shadow.camera.top.\");this.shadow.camera.top=a}},shadowCameraBottom:{set:function(a){console.warn(\"THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.\");\nthis.shadow.camera.bottom=a}},shadowCameraNear:{set:function(a){console.warn(\"THREE.Light: .shadowCameraNear is now .shadow.camera.near.\");this.shadow.camera.near=a}},shadowCameraFar:{set:function(a){console.warn(\"THREE.Light: .shadowCameraFar is now .shadow.camera.far.\");this.shadow.camera.far=a}},shadowCameraVisible:{set:function(){console.warn(\"THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.\")}},shadowBias:{set:function(a){console.warn(\"THREE.Light: .shadowBias is now .shadow.bias.\");\nthis.shadow.bias=a}},shadowDarkness:{set:function(){console.warn(\"THREE.Light: .shadowDarkness has been removed.\")}},shadowMapWidth:{set:function(a){console.warn(\"THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.\");this.shadow.mapSize.width=a}},shadowMapHeight:{set:function(a){console.warn(\"THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.\");this.shadow.mapSize.height=a}}});Object.defineProperties(L.prototype,{length:{get:function(){console.warn(\"THREE.BufferAttribute: .length has been deprecated. Use .count instead.\");\nreturn this.array.length}},copyIndicesArray:function(){console.error(\"THREE.BufferAttribute: .copyIndicesArray() has been removed.\")}});Object.assign(D.prototype,{addIndex:function(a){console.warn(\"THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().\");this.setIndex(a)},addDrawCall:function(a,b,c){void 0!==c&&console.warn(\"THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.\");console.warn(\"THREE.BufferGeometry: .addDrawCall() is now .addGroup().\");this.addGroup(a,b)},\nclearDrawCalls:function(){console.warn(\"THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().\");this.clearGroups()},computeTangents:function(){console.warn(\"THREE.BufferGeometry: .computeTangents() has been removed.\")},computeOffsets:function(){console.warn(\"THREE.BufferGeometry: .computeOffsets() has been removed.\")}});Object.defineProperties(D.prototype,{drawcalls:{get:function(){console.error(\"THREE.BufferGeometry: .drawcalls has been renamed to .groups.\");return this.groups}},offsets:{get:function(){console.warn(\"THREE.BufferGeometry: .offsets has been renamed to .groups.\");\nreturn this.groups}}});Object.assign(Ta.prototype,{getArrays:function(){console.error(\"THREE.ExtrudeBufferGeometry: .getArrays() has been removed.\")},addShapeList:function(){console.error(\"THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.\")},addShape:function(){console.error(\"THREE.ExtrudeBufferGeometry: .addShape() has been removed.\")}});Object.defineProperties(Qd.prototype,{dynamic:{set:function(){console.warn(\"THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.\")}},\nonUpdate:{value:function(){console.warn(\"THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.\");return this}}});Object.defineProperties(I.prototype,{wrapAround:{get:function(){console.warn(\"THREE.Material: .wrapAround has been removed.\")},set:function(){console.warn(\"THREE.Material: .wrapAround has been removed.\")}},wrapRGB:{get:function(){console.warn(\"THREE.Material: .wrapRGB has been removed.\");return new G}},shading:{get:function(){console.error(\"THREE.\"+this.type+\n\": .shading has been removed. Use the boolean .flatShading instead.\")},set:function(a){console.warn(\"THREE.\"+this.type+\": .shading has been removed. Use the boolean .flatShading instead.\");this.flatShading=1===a}}});Object.defineProperties(Ka.prototype,{metal:{get:function(){console.warn(\"THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.\");return!1},set:function(){console.warn(\"THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead\")}}});\nObject.defineProperties(Fa.prototype,{derivatives:{get:function(){console.warn(\"THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.\");return this.extensions.derivatives},set:function(a){console.warn(\"THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.\");this.extensions.derivatives=a}}});Object.assign(ae.prototype,{animate:function(a){console.warn(\"THREE.WebGLRenderer: .animate() is now .setAnimationLoop().\");this.setAnimationLoop(a)},getCurrentRenderTarget:function(){console.warn(\"THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().\");\nreturn this.getRenderTarget()},getMaxAnisotropy:function(){console.warn(\"THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().\");return this.capabilities.getMaxAnisotropy()},getPrecision:function(){console.warn(\"THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.\");return this.capabilities.precision},resetGLState:function(){console.warn(\"THREE.WebGLRenderer: .resetGLState() is now .state.reset().\");return this.state.reset()},supportsFloatTextures:function(){console.warn(\"THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).\");\nreturn this.extensions.get(\"OES_texture_float\")},supportsHalfFloatTextures:function(){console.warn(\"THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).\");return this.extensions.get(\"OES_texture_half_float\")},supportsStandardDerivatives:function(){console.warn(\"THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).\");return this.extensions.get(\"OES_standard_derivatives\")},supportsCompressedTextureS3TC:function(){console.warn(\"THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).\");\nreturn this.extensions.get(\"WEBGL_compressed_texture_s3tc\")},supportsCompressedTexturePVRTC:function(){console.warn(\"THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).\");return this.extensions.get(\"WEBGL_compressed_texture_pvrtc\")},supportsBlendMinMax:function(){console.warn(\"THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).\");return this.extensions.get(\"EXT_blend_minmax\")},supportsVertexTextures:function(){console.warn(\"THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.\");\nreturn this.capabilities.vertexTextures},supportsInstancedArrays:function(){console.warn(\"THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).\");return this.extensions.get(\"ANGLE_instanced_arrays\")},enableScissorTest:function(a){console.warn(\"THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().\");this.setScissorTest(a)},initMaterial:function(){console.warn(\"THREE.WebGLRenderer: .initMaterial() has been removed.\")},addPrePlugin:function(){console.warn(\"THREE.WebGLRenderer: .addPrePlugin() has been removed.\")},\naddPostPlugin:function(){console.warn(\"THREE.WebGLRenderer: .addPostPlugin() has been removed.\")},updateShadowMap:function(){console.warn(\"THREE.WebGLRenderer: .updateShadowMap() has been removed.\")},setFaceCulling:function(){console.warn(\"THREE.WebGLRenderer: .setFaceCulling() has been removed.\")}});Object.defineProperties(ae.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(a){console.warn(\"THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.\");\nthis.shadowMap.enabled=a}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(a){console.warn(\"THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.\");this.shadowMap.type=a}},shadowMapCullFace:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.\")}}});Object.defineProperties($e.prototype,\n{cullFace:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.\")}},renderReverseSided:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.\")}},\nrenderSingleSided:{get:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.\")},set:function(){console.warn(\"THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.\")}}});Object.defineProperties(kb.prototype,{wrapS:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.\");return this.texture.wrapS},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.\");\nthis.texture.wrapS=a}},wrapT:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.\");return this.texture.wrapT},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.\");this.texture.wrapT=a}},magFilter:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.\");return this.texture.magFilter},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.\");this.texture.magFilter=\na}},minFilter:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.\");return this.texture.minFilter},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.\");this.texture.minFilter=a}},anisotropy:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.\");return this.texture.anisotropy},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.\");this.texture.anisotropy=\na}},offset:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .offset is now .texture.offset.\");return this.texture.offset},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .offset is now .texture.offset.\");this.texture.offset=a}},repeat:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .repeat is now .texture.repeat.\");return this.texture.repeat},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .repeat is now .texture.repeat.\");this.texture.repeat=a}},format:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .format is now .texture.format.\");\nreturn this.texture.format},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .format is now .texture.format.\");this.texture.format=a}},type:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .type is now .texture.type.\");return this.texture.type},set:function(a){console.warn(\"THREE.WebGLRenderTarget: .type is now .texture.type.\");this.texture.type=a}},generateMipmaps:{get:function(){console.warn(\"THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.\");return this.texture.generateMipmaps},\nset:function(a){console.warn(\"THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.\");this.texture.generateMipmaps=a}}});Object.defineProperties(bf.prototype,{standing:{set:function(){console.warn(\"THREE.WebVRManager: .standing has been removed.\")}}});qc.prototype.load=function(a){console.warn(\"THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.\");var b=this;(new ne).load(a,function(a){b.setBuffer(a)});return this};re.prototype.getData=function(){console.warn(\"THREE.AudioAnalyser: .getData() is now .getFrequencyData().\");\nreturn this.getFrequencyData()};kd.prototype.updateCubeMap=function(a,b){console.warn(\"THREE.CubeCamera: .updateCubeMap() is now .update().\");return this.update(a,b)};k.WebGLRenderTargetCube=Lb;k.WebGLRenderTarget=kb;k.WebGLRenderer=ae;k.ShaderLib=tb;k.UniformsLib=K;k.UniformsUtils=Ba;k.ShaderChunk=S;k.FogExp2=Vb;k.Fog=Wb;k.Scene=vd;k.Sprite=Ic;k.LOD=Jc;k.SkinnedMesh=xd;k.Skeleton=Kc;k.Bone=wd;k.Mesh=va;k.LineSegments=Y;k.LineLoop=yd;k.Line=wa;k.Points=Xb;k.Group=Ub;k.VideoTexture=be;k.DataTexture=\nlb;k.CompressedTexture=Yb;k.CubeTexture=Za;k.CanvasTexture=Sb;k.DepthTexture=Lc;k.Texture=ea;k.CompressedTextureLoader=lf;k.DataTextureLoader=fe;k.CubeTextureLoader=ge;k.TextureLoader=Ad;k.ObjectLoader=nf;k.MaterialLoader=Pd;k.BufferGeometryLoader=ie;k.DefaultLoadingManager=ya;k.LoadingManager=ee;k.JSONLoader=je;k.ImageLoader=fd;k.ImageBitmapLoader=ke;k.FontLoader=of;k.FileLoader=La;k.Loader=pc;k.LoaderUtils=Fe;k.Cache=Kb;k.AudioLoader=ne;k.SpotLightShadow=Cd;k.SpotLight=Dd;k.PointLight=Ed;k.RectAreaLight=\nId;k.HemisphereLight=Bd;k.DirectionalLightShadow=Fd;k.DirectionalLight=Gd;k.AmbientLight=Hd;k.LightShadow=Hb;k.Light=X;k.StereoCamera=pf;k.PerspectiveCamera=Z;k.OrthographicCamera=Mb;k.CubeCamera=kd;k.ArrayCamera=Hc;k.Camera=Ra;k.AudioListener=oe;k.PositionalAudio=qe;k.AudioContext=pe;k.AudioAnalyser=re;k.Audio=qc;k.VectorKeyframeTrack=oc;k.StringKeyframeTrack=Jd;k.QuaternionKeyframeTrack=id;k.NumberKeyframeTrack=nc;k.ColorKeyframeTrack=Md;k.BooleanKeyframeTrack=Kd;k.PropertyMixer=se;k.PropertyBinding=\nra;k.KeyframeTrack=ja;k.AnimationUtils=na;k.AnimationObjectGroup=rf;k.AnimationMixer=te;k.AnimationClip=Ga;k.Uniform=Qd;k.InstancedBufferGeometry=ue;k.BufferGeometry=D;k.Geometry=P;k.InterleavedBufferAttribute=ve;k.InstancedInterleavedBuffer=we;k.InterleavedBuffer=rc;k.InstancedBufferAttribute=xe;k.Face3=Ya;k.Object3D=H;k.Raycaster=tf;k.Layers=Wd;k.EventDispatcher=za;k.Clock=vf;k.QuaternionLinearInterpolant=Ld;k.LinearInterpolant=jd;k.DiscreteInterpolant=Od;k.CubicInterpolant=Nd;k.Interpolant=Ea;\nk.Triangle=ta;k.Math=J;k.Spherical=wf;k.Cylindrical=xf;k.Plane=Ia;k.Frustum=td;k.Sphere=Ha;k.Ray=sb;k.Matrix4=R;k.Matrix3=la;k.Box3=Xa;k.Box2=ze;k.Line3=Qb;k.Euler=mb;k.Vector4=W;k.Vector3=p;k.Vector2=B;k.Quaternion=ca;k.Color=G;k.ImmediateRenderObject=ld;k.VertexNormalsHelper=md;k.SpotLightHelper=sc;k.SkeletonHelper=tc;k.PointLightHelper=uc;k.RectAreaLightHelper=vc;k.HemisphereLightHelper=wc;k.GridHelper=nd;k.PolarGridHelper=Rd;k.FaceNormalsHelper=od;k.DirectionalLightHelper=xc;k.CameraHelper=pd;\nk.BoxHelper=Ib;k.Box3Helper=qd;k.PlaneHelper=rd;k.ArrowHelper=Jb;k.AxesHelper=sd;k.Shape=jb;k.Path=Qa;k.ShapePath=le;k.Font=me;k.CurvePath=bb;k.Curve=E;k.ShapeUtils=$a;k.WebGLUtils=af;k.WireframeGeometry=Zb;k.ParametricGeometry=Mc;k.ParametricBufferGeometry=$b;k.TetrahedronGeometry=Oc;k.TetrahedronBufferGeometry=ac;k.OctahedronGeometry=Pc;k.OctahedronBufferGeometry=ub;k.IcosahedronGeometry=Qc;k.IcosahedronBufferGeometry=bc;k.DodecahedronGeometry=Rc;k.DodecahedronBufferGeometry=cc;k.PolyhedronGeometry=\nNc;k.PolyhedronBufferGeometry=xa;k.TubeGeometry=Sc;k.TubeBufferGeometry=dc;k.TorusKnotGeometry=Tc;k.TorusKnotBufferGeometry=ec;k.TorusGeometry=Uc;k.TorusBufferGeometry=fc;k.TextGeometry=Zc;k.TextBufferGeometry=gc;k.SphereGeometry=$c;k.SphereBufferGeometry=xb;k.RingGeometry=ad;k.RingBufferGeometry=hc;k.PlaneGeometry=Fc;k.PlaneBufferGeometry=rb;k.LatheGeometry=bd;k.LatheBufferGeometry=ic;k.ShapeGeometry=yb;k.ShapeBufferGeometry=zb;k.ExtrudeGeometry=wb;k.ExtrudeBufferGeometry=Ta;k.EdgesGeometry=jc;k.ConeGeometry=\ncd;k.ConeBufferGeometry=dd;k.CylinderGeometry=Ab;k.CylinderBufferGeometry=ab;k.CircleGeometry=ed;k.CircleBufferGeometry=kc;k.BoxGeometry=Nb;k.BoxBufferGeometry=pb;k.ShadowMaterial=Bb;k.SpriteMaterial=ib;k.RawShaderMaterial=lc;k.ShaderMaterial=Fa;k.PointsMaterial=Ja;k.MeshPhysicalMaterial=Cb;k.MeshStandardMaterial=Ua;k.MeshPhongMaterial=Ka;k.MeshToonMaterial=Db;k.MeshNormalMaterial=Eb;k.MeshLambertMaterial=Fb;k.MeshDepthMaterial=fb;k.MeshDistanceMaterial=gb;k.MeshBasicMaterial=ua;k.LineDashedMaterial=\nGb;k.LineBasicMaterial=T;k.Material=I;k.Float64BufferAttribute=Dc;k.Float32BufferAttribute=z;k.Uint32BufferAttribute=ob;k.Int32BufferAttribute=Cc;k.Uint16BufferAttribute=nb;k.Int16BufferAttribute=Bc;k.Uint8ClampedBufferAttribute=Ac;k.Uint8BufferAttribute=zc;k.Int8BufferAttribute=yc;k.BufferAttribute=L;k.ArcCurve=mc;k.CatmullRomCurve3=pa;k.CubicBezierCurve=Ma;k.CubicBezierCurve3=Va;k.EllipseCurve=Da;k.LineCurve=ia;k.LineCurve3=Na;k.QuadraticBezierCurve=Oa;k.QuadraticBezierCurve3=Wa;k.SplineCurve=Pa;\nk.REVISION=\"94\";k.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2};k.CullFaceNone=0;k.CullFaceBack=1;k.CullFaceFront=2;k.CullFaceFrontBack=3;k.FrontFaceDirectionCW=0;k.FrontFaceDirectionCCW=1;k.BasicShadowMap=0;k.PCFShadowMap=1;k.PCFSoftShadowMap=2;k.FrontSide=0;k.BackSide=1;k.DoubleSide=2;k.FlatShading=1;k.SmoothShading=2;k.NoColors=0;k.FaceColors=1;k.VertexColors=2;k.NoBlending=0;k.NormalBlending=1;k.AdditiveBlending=2;k.SubtractiveBlending=3;k.MultiplyBlending=4;k.CustomBlending=5;k.AddEquation=100;k.SubtractEquation=\n101;k.ReverseSubtractEquation=102;k.MinEquation=103;k.MaxEquation=104;k.ZeroFactor=200;k.OneFactor=201;k.SrcColorFactor=202;k.OneMinusSrcColorFactor=203;k.SrcAlphaFactor=204;k.OneMinusSrcAlphaFactor=205;k.DstAlphaFactor=206;k.OneMinusDstAlphaFactor=207;k.DstColorFactor=208;k.OneMinusDstColorFactor=209;k.SrcAlphaSaturateFactor=210;k.NeverDepth=0;k.AlwaysDepth=1;k.LessDepth=2;k.LessEqualDepth=3;k.EqualDepth=4;k.GreaterEqualDepth=5;k.GreaterDepth=6;k.NotEqualDepth=7;k.MultiplyOperation=0;k.MixOperation=\n1;k.AddOperation=2;k.NoToneMapping=0;k.LinearToneMapping=1;k.ReinhardToneMapping=2;k.Uncharted2ToneMapping=3;k.CineonToneMapping=4;k.UVMapping=300;k.CubeReflectionMapping=301;k.CubeRefractionMapping=302;k.EquirectangularReflectionMapping=303;k.EquirectangularRefractionMapping=304;k.SphericalReflectionMapping=305;k.CubeUVReflectionMapping=306;k.CubeUVRefractionMapping=307;k.RepeatWrapping=1E3;k.ClampToEdgeWrapping=1001;k.MirroredRepeatWrapping=1002;k.NearestFilter=1003;k.NearestMipMapNearestFilter=\n1004;k.NearestMipMapLinearFilter=1005;k.LinearFilter=1006;k.LinearMipMapNearestFilter=1007;k.LinearMipMapLinearFilter=1008;k.UnsignedByteType=1009;k.ByteType=1010;k.ShortType=1011;k.UnsignedShortType=1012;k.IntType=1013;k.UnsignedIntType=1014;k.FloatType=1015;k.HalfFloatType=1016;k.UnsignedShort4444Type=1017;k.UnsignedShort5551Type=1018;k.UnsignedShort565Type=1019;k.UnsignedInt248Type=1020;k.AlphaFormat=1021;k.RGBFormat=1022;k.RGBAFormat=1023;k.LuminanceFormat=1024;k.LuminanceAlphaFormat=1025;k.RGBEFormat=\n1023;k.DepthFormat=1026;k.DepthStencilFormat=1027;k.RGB_S3TC_DXT1_Format=33776;k.RGBA_S3TC_DXT1_Format=33777;k.RGBA_S3TC_DXT3_Format=33778;k.RGBA_S3TC_DXT5_Format=33779;k.RGB_PVRTC_4BPPV1_Format=35840;k.RGB_PVRTC_2BPPV1_Format=35841;k.RGBA_PVRTC_4BPPV1_Format=35842;k.RGBA_PVRTC_2BPPV1_Format=35843;k.RGB_ETC1_Format=36196;k.RGBA_ASTC_4x4_Format=37808;k.RGBA_ASTC_5x4_Format=37809;k.RGBA_ASTC_5x5_Format=37810;k.RGBA_ASTC_6x5_Format=37811;k.RGBA_ASTC_6x6_Format=37812;k.RGBA_ASTC_8x5_Format=37813;k.RGBA_ASTC_8x6_Format=\n37814;k.RGBA_ASTC_8x8_Format=37815;k.RGBA_ASTC_10x5_Format=37816;k.RGBA_ASTC_10x6_Format=37817;k.RGBA_ASTC_10x8_Format=37818;k.RGBA_ASTC_10x10_Format=37819;k.RGBA_ASTC_12x10_Format=37820;k.RGBA_ASTC_12x12_Format=37821;k.LoopOnce=2200;k.LoopRepeat=2201;k.LoopPingPong=2202;k.InterpolateDiscrete=2300;k.InterpolateLinear=2301;k.InterpolateSmooth=2302;k.ZeroCurvatureEnding=2400;k.ZeroSlopeEnding=2401;k.WrapAroundEnding=2402;k.TrianglesDrawMode=0;k.TriangleStripDrawMode=1;k.TriangleFanDrawMode=2;k.LinearEncoding=\n3E3;k.sRGBEncoding=3001;k.GammaEncoding=3007;k.RGBEEncoding=3002;k.LogLuvEncoding=3003;k.RGBM7Encoding=3004;k.RGBM16Encoding=3005;k.RGBDEncoding=3006;k.BasicDepthPacking=3200;k.RGBADepthPacking=3201;k.TangentSpaceNormalMap=0;k.ObjectSpaceNormalMap=1;k.CubeGeometry=Nb;k.Face4=function(a,b,c,d,e,f,g){console.warn(\"THREE.Face4 has been removed. A THREE.Face3 will be created instead.\");return new Ya(a,b,c,e,f,g)};k.LineStrip=0;k.LinePieces=1;k.MeshFaceMaterial=function(a){console.warn(\"THREE.MeshFaceMaterial has been removed. Use an Array instead.\");\nreturn a};k.MultiMaterial=function(a){void 0===a&&(a=[]);console.warn(\"THREE.MultiMaterial has been removed. Use an Array instead.\");a.isMultiMaterial=!0;a.materials=a;a.clone=function(){return a.slice()};return a};k.PointCloud=function(a,b){console.warn(\"THREE.PointCloud has been renamed to THREE.Points.\");return new Xb(a,b)};k.Particle=function(a){console.warn(\"THREE.Particle has been renamed to THREE.Sprite.\");return new Ic(a)};k.ParticleSystem=function(a,b){console.warn(\"THREE.ParticleSystem has been renamed to THREE.Points.\");\nreturn new Xb(a,b)};k.PointCloudMaterial=function(a){console.warn(\"THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.\");return new Ja(a)};k.ParticleBasicMaterial=function(a){console.warn(\"THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.\");return new Ja(a)};k.ParticleSystemMaterial=function(a){console.warn(\"THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.\");return new Ja(a)};k.Vertex=function(a,b,c){console.warn(\"THREE.Vertex has been removed. Use THREE.Vector3 instead.\");\nreturn new p(a,b,c)};k.DynamicBufferAttribute=function(a,b){console.warn(\"THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.\");return(new L(a,b)).setDynamic(!0)};k.Int8Attribute=function(a,b){console.warn(\"THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.\");return new yc(a,b)};k.Uint8Attribute=function(a,b){console.warn(\"THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.\");return new zc(a,\nb)};k.Uint8ClampedAttribute=function(a,b){console.warn(\"THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.\");return new Ac(a,b)};k.Int16Attribute=function(a,b){console.warn(\"THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.\");return new Bc(a,b)};k.Uint16Attribute=function(a,b){console.warn(\"THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.\");return new nb(a,b)};k.Int32Attribute=\nfunction(a,b){console.warn(\"THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.\");return new Cc(a,b)};k.Uint32Attribute=function(a,b){console.warn(\"THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.\");return new ob(a,b)};k.Float32Attribute=function(a,b){console.warn(\"THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.\");return new z(a,b)};k.Float64Attribute=function(a,b){console.warn(\"THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.\");\nreturn new Dc(a,b)};k.ClosedSplineCurve3=zf;k.SplineCurve3=Af;k.Spline=Be;k.AxisHelper=function(a){console.warn(\"THREE.AxisHelper has been renamed to THREE.AxesHelper.\");return new sd(a)};k.BoundingBoxHelper=function(a,b){console.warn(\"THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.\");return new Ib(a,b)};k.EdgesHelper=function(a,b){console.warn(\"THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.\");return new Y(new jc(a.geometry),new T({color:void 0!==\nb?b:16777215}))};k.WireframeHelper=function(a,b){console.warn(\"THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.\");return new Y(new Zb(a.geometry),new T({color:void 0!==b?b:16777215}))};k.XHRLoader=function(a){console.warn(\"THREE.XHRLoader has been renamed to THREE.FileLoader.\");return new La(a)};k.BinaryTextureLoader=function(a){console.warn(\"THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.\");return new fe(a)};k.GeometryUtils={merge:function(a,b,c){console.warn(\"THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.\");\nif(b.isMesh){b.matrixAutoUpdate&&b.updateMatrix();var d=b.matrix;b=b.geometry}a.merge(b,d,c)},center:function(a){console.warn(\"THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.\");return a.center()}};k.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){console.warn(\"THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.\");var e=new Ad;e.setCrossOrigin(this.crossOrigin);a=e.load(a,c,void 0,d);b&&(a.mapping=b);return a},\nloadTextureCube:function(a,b,c,d){console.warn(\"THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.\");var e=new ge;e.setCrossOrigin(this.crossOrigin);a=e.load(a,c,void 0,d);b&&(a.mapping=b);return a},loadCompressedTexture:function(){console.error(\"THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.\")},loadCompressedTextureCube:function(){console.error(\"THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.\")}};\nk.Projector=function(){console.error(\"THREE.Projector has been moved to /examples/js/renderers/Projector.js.\");this.projectVector=function(a,b){console.warn(\"THREE.Projector: .projectVector() is now vector.project().\");a.project(b)};this.unprojectVector=function(a,b){console.warn(\"THREE.Projector: .unprojectVector() is now vector.unproject().\");a.unproject(b)};this.pickingRay=function(){console.error(\"THREE.Projector: .pickingRay() is now raycaster.setFromCamera().\")}};k.CanvasRenderer=function(){console.error(\"THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js\");\nthis.domElement=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"canvas\");this.clear=function(){};this.render=function(){};this.setClearColor=function(){};this.setSize=function(){}};k.SceneUtils={createMultiMaterialObject:function(){console.error(\"THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js\")},detach:function(){console.error(\"THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js\")},attach:function(){console.error(\"THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js\")}};\nk.LensFlare=function(){console.error(\"THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js\")};Object.defineProperty(k,\"__esModule\",{value:!0})});"
  },
  {
    "path": "src/utils/constants.js",
    "content": "const WORLD_SIZE = 1024000;\nconst MERCATOR_A = 6378137.0;\n\nmodule.exports = exports = {\n    WORLD_SIZE: WORLD_SIZE,\n    PROJECTION_WORLD_SIZE: WORLD_SIZE / (MERCATOR_A * Math.PI * 2),\n    MERCATOR_A: MERCATOR_A, // 900913 projection property\n    DEG2RAD: Math.PI / 180,\n    RAD2DEG: 180 / Math.PI,\n    EARTH_CIRCUMFERENCE: 40075000, // In meters\n}"
  },
  {
    "path": "src/utils/material.js",
    "content": "// This module creates a THREE material from the options object provided into the Objects class.\n// Users can do this in one of three ways:\n\n// - provide a preset THREE.Material in the `material` parameter\n// - specify a `material` string, `color`, and/or `opacity` as modifications of the default material\n// - provide none of these parameters, to use the default material\n\nvar utils = require(\"../Utils/Utils.js\");\nvar THREE = require(\"../three.js\");\n\nvar defaults = {\n\tmaterial: 'MeshBasicMaterial',\n\tcolor: 'black',\n\topacity: 1\n};\n\n\nfunction material (options) {\n\n\tvar output;\n\n\tif (options) {\n\n\t\toptions = utils._validate(options, defaults);\n\n\t\t// check if user provided material object\n\t\tif (options.material && options.material.isMaterial) output = options.material;\n\n\t\t// check if user provided any material parameters. create new material object based on that.\n\t\telse if (options.material || options.color || options.opacity){\n\t\t    output = new THREE[options.material]({color: options.color, transparent: options.opacity<1});\n\t\t}\n\n\t\t// if neither, return default material\n\t\telse output = generateDefaultMaterial();\n\n\t\toutput.opacity = options.opacity;\n\n\t}\n\n\t// if no options, return default\n\telse output = generateDefaultMaterial();\n\n\tfunction generateDefaultMaterial(){\n\t\treturn new THREE[defaults.material]({color: defaults.color});\n\t}\n\n\treturn output\n}\n\nmodule.exports = exports = material;\n"
  },
  {
    "path": "src/utils/validate.js",
    "content": "// Type validator\n\nfunction Validate(){\n\n};\n\nValidate.prototype = {\n\n    Coords: function(input) {\n\n        if (input.constructor !== Array) {\n            console.error(\"Coords must be an array\")\n            return\n        }\n\n        if (input.length < 2) {\n            console.error(\"Coords length must be at least 2\")\n            return\n        }\n    \n        for (member of input) {\n            if (member.constructor !== Number) {\n                console.error(\"Coords values must be numbers\")\n                return\n            }\n        }\n\n        if (Math.abs(input[1]) > 90) {\n            console.error(\"Latitude must be between -90 and 90\")\n            return                    \n        }\n\n        return input\n    },\n\n    Line: function(input) {\n\n        var scope = this;\n\n        if (input.constructor !== Array) {\n            console.error(\"Line must be an array\")\n            return\n        }\n\n        for (coord of input){\n            if (!scope.Coords(coord)) {\n                console.error(\"Each coordinate in a line must be a valid Coords type\")\n                return                    \n            }\n\n        }\n\n        return input\n    },\n\n    Rotation: function(input) {\n\n        if (input.constructor === Number) input = {z: input}\n\n        else if (input.constructor === Object) {\n\n            for (key of Object.keys(input)){\n\n                if (!['x', 'y', 'z'].includes(key)) {\n                    console.error('Rotation parameters must be x, y, or z')\n                    return                            \n                }\n                if (input[key].constructor !== Number) {\n                    console.error('Individual rotation values must be numbers')\n                    return\n                }\n            }\n        }\n\n        else {\n            console.error('Rotation must be an object or a number')\n            return\n        }\n\n        return input\n    },\n\n    Scale: function(input) {\n\n        if (input.constructor === Number) {\n            input = {x:input, y:input, z: input}\n        }\n        \n        else if (input.constructor === Object) {\n\n            for (key of Object.keys(input)){\n\n                if (!['x', 'y', 'z'].includes(key)) {\n                    console.error('Scale parameters must be x, y, or z')\n                    return                            \n                }\n                if (input[key].constructor !== Number) {\n                    console.error('Individual scale values must be numbers')\n                    return\n                }\n            }\n        }\n\n        else {\n            console.error('Scale must be an object or a number')\n            return\n        }\n\n        return input\n    }\n\n}\n\n\nmodule.exports = exports = Validate;"
  },
  {
    "path": "tests/threebox-tests-bundle.js",
    "content": "(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n  lookup[i] = code[i]\n  revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n  var len = b64.length\n\n  if (len % 4 > 0) {\n    throw new Error('Invalid string. Length must be a multiple of 4')\n  }\n\n  // Trim off extra bytes after placeholder bytes are found\n  // See: https://github.com/beatgammit/base64-js/issues/42\n  var validLen = b64.indexOf('=')\n  if (validLen === -1) validLen = len\n\n  var placeHoldersLen = validLen === len\n    ? 0\n    : 4 - (validLen % 4)\n\n  return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n  var lens = getLens(b64)\n  var validLen = lens[0]\n  var placeHoldersLen = lens[1]\n  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n  var tmp\n  var lens = getLens(b64)\n  var validLen = lens[0]\n  var placeHoldersLen = lens[1]\n\n  var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n  var curByte = 0\n\n  // if there are placeholders, only get up to the last complete 4 chars\n  var len = placeHoldersLen > 0\n    ? validLen - 4\n    : validLen\n\n  for (var i = 0; i < len; i += 4) {\n    tmp =\n      (revLookup[b64.charCodeAt(i)] << 18) |\n      (revLookup[b64.charCodeAt(i + 1)] << 12) |\n      (revLookup[b64.charCodeAt(i + 2)] << 6) |\n      revLookup[b64.charCodeAt(i + 3)]\n    arr[curByte++] = (tmp >> 16) & 0xFF\n    arr[curByte++] = (tmp >> 8) & 0xFF\n    arr[curByte++] = tmp & 0xFF\n  }\n\n  if (placeHoldersLen === 2) {\n    tmp =\n      (revLookup[b64.charCodeAt(i)] << 2) |\n      (revLookup[b64.charCodeAt(i + 1)] >> 4)\n    arr[curByte++] = tmp & 0xFF\n  }\n\n  if (placeHoldersLen === 1) {\n    tmp =\n      (revLookup[b64.charCodeAt(i)] << 10) |\n      (revLookup[b64.charCodeAt(i + 1)] << 4) |\n      (revLookup[b64.charCodeAt(i + 2)] >> 2)\n    arr[curByte++] = (tmp >> 8) & 0xFF\n    arr[curByte++] = tmp & 0xFF\n  }\n\n  return arr\n}\n\nfunction tripletToBase64 (num) {\n  return lookup[num >> 18 & 0x3F] +\n    lookup[num >> 12 & 0x3F] +\n    lookup[num >> 6 & 0x3F] +\n    lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n  var tmp\n  var output = []\n  for (var i = start; i < end; i += 3) {\n    tmp =\n      ((uint8[i] << 16) & 0xFF0000) +\n      ((uint8[i + 1] << 8) & 0xFF00) +\n      (uint8[i + 2] & 0xFF)\n    output.push(tripletToBase64(tmp))\n  }\n  return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n  var tmp\n  var len = uint8.length\n  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n  var parts = []\n  var maxChunkLength = 16383 // must be multiple of 3\n\n  // go through the array every three bytes, we'll deal with trailing stuff later\n  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n    parts.push(encodeChunk(\n      uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n    ))\n  }\n\n  // pad the end with zeros, but make sure to not forget the extra bytes\n  if (extraBytes === 1) {\n    tmp = uint8[len - 1]\n    parts.push(\n      lookup[tmp >> 2] +\n      lookup[(tmp << 4) & 0x3F] +\n      '=='\n    )\n  } else if (extraBytes === 2) {\n    tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n    parts.push(\n      lookup[tmp >> 10] +\n      lookup[(tmp >> 4) & 0x3F] +\n      lookup[(tmp << 2) & 0x3F] +\n      '='\n    )\n  }\n\n  return parts.join('')\n}\n\n},{}],2:[function(require,module,exports){\n\n},{}],3:[function(require,module,exports){\narguments[4][2][0].apply(exports,arguments)\n},{\"dup\":2}],4:[function(require,module,exports){\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author   Feross Aboukhadijeh <https://feross.org>\n * @license  MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n *   === true    Use Uint8Array implementation (fastest)\n *   === false   Print warning and recommend using `buffer` v4.x which has an Object\n *               implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n    typeof console.error === 'function') {\n  console.error(\n    'This browser lacks typed array (Uint8Array) support which is required by ' +\n    '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n  )\n}\n\nfunction typedArraySupport () {\n  // Can typed array instances can be augmented?\n  try {\n    var arr = new Uint8Array(1)\n    arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }\n    return arr.foo() === 42\n  } catch (e) {\n    return false\n  }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n  enumerable: true,\n  get: function () {\n    if (!Buffer.isBuffer(this)) return undefined\n    return this.buffer\n  }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n  enumerable: true,\n  get: function () {\n    if (!Buffer.isBuffer(this)) return undefined\n    return this.byteOffset\n  }\n})\n\nfunction createBuffer (length) {\n  if (length > K_MAX_LENGTH) {\n    throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n  }\n  // Return an augmented `Uint8Array` instance\n  var buf = new Uint8Array(length)\n  buf.__proto__ = Buffer.prototype\n  return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n  // Common case.\n  if (typeof arg === 'number') {\n    if (typeof encodingOrOffset === 'string') {\n      throw new TypeError(\n        'The \"string\" argument must be of type string. Received type number'\n      )\n    }\n    return allocUnsafe(arg)\n  }\n  return from(arg, encodingOrOffset, length)\n}\n\n// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\nif (typeof Symbol !== 'undefined' && Symbol.species != null &&\n    Buffer[Symbol.species] === Buffer) {\n  Object.defineProperty(Buffer, Symbol.species, {\n    value: null,\n    configurable: true,\n    enumerable: false,\n    writable: false\n  })\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n  if (typeof value === 'string') {\n    return fromString(value, encodingOrOffset)\n  }\n\n  if (ArrayBuffer.isView(value)) {\n    return fromArrayLike(value)\n  }\n\n  if (value == null) {\n    throw TypeError(\n      'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n      'or Array-like Object. Received type ' + (typeof value)\n    )\n  }\n\n  if (isInstance(value, ArrayBuffer) ||\n      (value && isInstance(value.buffer, ArrayBuffer))) {\n    return fromArrayBuffer(value, encodingOrOffset, length)\n  }\n\n  if (typeof value === 'number') {\n    throw new TypeError(\n      'The \"value\" argument must not be of type number. Received type number'\n    )\n  }\n\n  var valueOf = value.valueOf && value.valueOf()\n  if (valueOf != null && valueOf !== value) {\n    return Buffer.from(valueOf, encodingOrOffset, length)\n  }\n\n  var b = fromObject(value)\n  if (b) return b\n\n  if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n      typeof value[Symbol.toPrimitive] === 'function') {\n    return Buffer.from(\n      value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n    )\n  }\n\n  throw new TypeError(\n    'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n    'or Array-like Object. Received type ' + (typeof value)\n  )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n  return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nBuffer.prototype.__proto__ = Uint8Array.prototype\nBuffer.__proto__ = Uint8Array\n\nfunction assertSize (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('\"size\" argument must be of type number')\n  } else if (size < 0) {\n    throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n  }\n}\n\nfunction alloc (size, fill, encoding) {\n  assertSize(size)\n  if (size <= 0) {\n    return createBuffer(size)\n  }\n  if (fill !== undefined) {\n    // Only pay attention to encoding if it's a string. This\n    // prevents accidentally sending in a number that would\n    // be interpretted as a start offset.\n    return typeof encoding === 'string'\n      ? createBuffer(size).fill(fill, encoding)\n      : createBuffer(size).fill(fill)\n  }\n  return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n  return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n  assertSize(size)\n  return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n  return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n  return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n  if (typeof encoding !== 'string' || encoding === '') {\n    encoding = 'utf8'\n  }\n\n  if (!Buffer.isEncoding(encoding)) {\n    throw new TypeError('Unknown encoding: ' + encoding)\n  }\n\n  var length = byteLength(string, encoding) | 0\n  var buf = createBuffer(length)\n\n  var actual = buf.write(string, encoding)\n\n  if (actual !== length) {\n    // Writing a hex string, for example, that contains invalid characters will\n    // cause everything after the first invalid character to be ignored. (e.g.\n    // 'abxxcd' will be treated as 'ab')\n    buf = buf.slice(0, actual)\n  }\n\n  return buf\n}\n\nfunction fromArrayLike (array) {\n  var length = array.length < 0 ? 0 : checked(array.length) | 0\n  var buf = createBuffer(length)\n  for (var i = 0; i < length; i += 1) {\n    buf[i] = array[i] & 255\n  }\n  return buf\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n  if (byteOffset < 0 || array.byteLength < byteOffset) {\n    throw new RangeError('\"offset\" is outside of buffer bounds')\n  }\n\n  if (array.byteLength < byteOffset + (length || 0)) {\n    throw new RangeError('\"length\" is outside of buffer bounds')\n  }\n\n  var buf\n  if (byteOffset === undefined && length === undefined) {\n    buf = new Uint8Array(array)\n  } else if (length === undefined) {\n    buf = new Uint8Array(array, byteOffset)\n  } else {\n    buf = new Uint8Array(array, byteOffset, length)\n  }\n\n  // Return an augmented `Uint8Array` instance\n  buf.__proto__ = Buffer.prototype\n  return buf\n}\n\nfunction fromObject (obj) {\n  if (Buffer.isBuffer(obj)) {\n    var len = checked(obj.length) | 0\n    var buf = createBuffer(len)\n\n    if (buf.length === 0) {\n      return buf\n    }\n\n    obj.copy(buf, 0, 0, len)\n    return buf\n  }\n\n  if (obj.length !== undefined) {\n    if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n      return createBuffer(0)\n    }\n    return fromArrayLike(obj)\n  }\n\n  if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n    return fromArrayLike(obj.data)\n  }\n}\n\nfunction checked (length) {\n  // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n  // length is NaN (which is otherwise coerced to zero.)\n  if (length >= K_MAX_LENGTH) {\n    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n                         'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n  }\n  return length | 0\n}\n\nfunction SlowBuffer (length) {\n  if (+length != length) { // eslint-disable-line eqeqeq\n    length = 0\n  }\n  return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n  return b != null && b._isBuffer === true &&\n    b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n  if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n  if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n    throw new TypeError(\n      'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n    )\n  }\n\n  if (a === b) return 0\n\n  var x = a.length\n  var y = b.length\n\n  for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n    if (a[i] !== b[i]) {\n      x = a[i]\n      y = b[i]\n      break\n    }\n  }\n\n  if (x < y) return -1\n  if (y < x) return 1\n  return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n  switch (String(encoding).toLowerCase()) {\n    case 'hex':\n    case 'utf8':\n    case 'utf-8':\n    case 'ascii':\n    case 'latin1':\n    case 'binary':\n    case 'base64':\n    case 'ucs2':\n    case 'ucs-2':\n    case 'utf16le':\n    case 'utf-16le':\n      return true\n    default:\n      return false\n  }\n}\n\nBuffer.concat = function concat (list, length) {\n  if (!Array.isArray(list)) {\n    throw new TypeError('\"list\" argument must be an Array of Buffers')\n  }\n\n  if (list.length === 0) {\n    return Buffer.alloc(0)\n  }\n\n  var i\n  if (length === undefined) {\n    length = 0\n    for (i = 0; i < list.length; ++i) {\n      length += list[i].length\n    }\n  }\n\n  var buffer = Buffer.allocUnsafe(length)\n  var pos = 0\n  for (i = 0; i < list.length; ++i) {\n    var buf = list[i]\n    if (isInstance(buf, Uint8Array)) {\n      buf = Buffer.from(buf)\n    }\n    if (!Buffer.isBuffer(buf)) {\n      throw new TypeError('\"list\" argument must be an Array of Buffers')\n    }\n    buf.copy(buffer, pos)\n    pos += buf.length\n  }\n  return buffer\n}\n\nfunction byteLength (string, encoding) {\n  if (Buffer.isBuffer(string)) {\n    return string.length\n  }\n  if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n    return string.byteLength\n  }\n  if (typeof string !== 'string') {\n    throw new TypeError(\n      'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n      'Received type ' + typeof string\n    )\n  }\n\n  var len = string.length\n  var mustMatch = (arguments.length > 2 && arguments[2] === true)\n  if (!mustMatch && len === 0) return 0\n\n  // Use a for loop to avoid recursion\n  var loweredCase = false\n  for (;;) {\n    switch (encoding) {\n      case 'ascii':\n      case 'latin1':\n      case 'binary':\n        return len\n      case 'utf8':\n      case 'utf-8':\n        return utf8ToBytes(string).length\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return len * 2\n      case 'hex':\n        return len >>> 1\n      case 'base64':\n        return base64ToBytes(string).length\n      default:\n        if (loweredCase) {\n          return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n        }\n        encoding = ('' + encoding).toLowerCase()\n        loweredCase = true\n    }\n  }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n  var loweredCase = false\n\n  // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n  // property of a typed array.\n\n  // This behaves neither like String nor Uint8Array in that we set start/end\n  // to their upper/lower bounds if the value passed is out of range.\n  // undefined is handled specially as per ECMA-262 6th Edition,\n  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n  if (start === undefined || start < 0) {\n    start = 0\n  }\n  // Return early if start > this.length. Done here to prevent potential uint32\n  // coercion fail below.\n  if (start > this.length) {\n    return ''\n  }\n\n  if (end === undefined || end > this.length) {\n    end = this.length\n  }\n\n  if (end <= 0) {\n    return ''\n  }\n\n  // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n  end >>>= 0\n  start >>>= 0\n\n  if (end <= start) {\n    return ''\n  }\n\n  if (!encoding) encoding = 'utf8'\n\n  while (true) {\n    switch (encoding) {\n      case 'hex':\n        return hexSlice(this, start, end)\n\n      case 'utf8':\n      case 'utf-8':\n        return utf8Slice(this, start, end)\n\n      case 'ascii':\n        return asciiSlice(this, start, end)\n\n      case 'latin1':\n      case 'binary':\n        return latin1Slice(this, start, end)\n\n      case 'base64':\n        return base64Slice(this, start, end)\n\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return utf16leSlice(this, start, end)\n\n      default:\n        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n        encoding = (encoding + '').toLowerCase()\n        loweredCase = true\n    }\n  }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n  var i = b[n]\n  b[n] = b[m]\n  b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n  var len = this.length\n  if (len % 2 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 16-bits')\n  }\n  for (var i = 0; i < len; i += 2) {\n    swap(this, i, i + 1)\n  }\n  return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n  var len = this.length\n  if (len % 4 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 32-bits')\n  }\n  for (var i = 0; i < len; i += 4) {\n    swap(this, i, i + 3)\n    swap(this, i + 1, i + 2)\n  }\n  return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n  var len = this.length\n  if (len % 8 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 64-bits')\n  }\n  for (var i = 0; i < len; i += 8) {\n    swap(this, i, i + 7)\n    swap(this, i + 1, i + 6)\n    swap(this, i + 2, i + 5)\n    swap(this, i + 3, i + 4)\n  }\n  return this\n}\n\nBuffer.prototype.toString = function toString () {\n  var length = this.length\n  if (length === 0) return ''\n  if (arguments.length === 0) return utf8Slice(this, 0, length)\n  return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n  if (this === b) return true\n  return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n  var str = ''\n  var max = exports.INSPECT_MAX_BYTES\n  str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n  if (this.length > max) str += ' ... '\n  return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n  if (isInstance(target, Uint8Array)) {\n    target = Buffer.from(target, target.offset, target.byteLength)\n  }\n  if (!Buffer.isBuffer(target)) {\n    throw new TypeError(\n      'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n      'Received type ' + (typeof target)\n    )\n  }\n\n  if (start === undefined) {\n    start = 0\n  }\n  if (end === undefined) {\n    end = target ? target.length : 0\n  }\n  if (thisStart === undefined) {\n    thisStart = 0\n  }\n  if (thisEnd === undefined) {\n    thisEnd = this.length\n  }\n\n  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n    throw new RangeError('out of range index')\n  }\n\n  if (thisStart >= thisEnd && start >= end) {\n    return 0\n  }\n  if (thisStart >= thisEnd) {\n    return -1\n  }\n  if (start >= end) {\n    return 1\n  }\n\n  start >>>= 0\n  end >>>= 0\n  thisStart >>>= 0\n  thisEnd >>>= 0\n\n  if (this === target) return 0\n\n  var x = thisEnd - thisStart\n  var y = end - start\n  var len = Math.min(x, y)\n\n  var thisCopy = this.slice(thisStart, thisEnd)\n  var targetCopy = target.slice(start, end)\n\n  for (var i = 0; i < len; ++i) {\n    if (thisCopy[i] !== targetCopy[i]) {\n      x = thisCopy[i]\n      y = targetCopy[i]\n      break\n    }\n  }\n\n  if (x < y) return -1\n  if (y < x) return 1\n  return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n  // Empty buffer means no match\n  if (buffer.length === 0) return -1\n\n  // Normalize byteOffset\n  if (typeof byteOffset === 'string') {\n    encoding = byteOffset\n    byteOffset = 0\n  } else if (byteOffset > 0x7fffffff) {\n    byteOffset = 0x7fffffff\n  } else if (byteOffset < -0x80000000) {\n    byteOffset = -0x80000000\n  }\n  byteOffset = +byteOffset // Coerce to Number.\n  if (numberIsNaN(byteOffset)) {\n    // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n    byteOffset = dir ? 0 : (buffer.length - 1)\n  }\n\n  // Normalize byteOffset: negative offsets start from the end of the buffer\n  if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n  if (byteOffset >= buffer.length) {\n    if (dir) return -1\n    else byteOffset = buffer.length - 1\n  } else if (byteOffset < 0) {\n    if (dir) byteOffset = 0\n    else return -1\n  }\n\n  // Normalize val\n  if (typeof val === 'string') {\n    val = Buffer.from(val, encoding)\n  }\n\n  // Finally, search either indexOf (if dir is true) or lastIndexOf\n  if (Buffer.isBuffer(val)) {\n    // Special case: looking for empty string/buffer always fails\n    if (val.length === 0) {\n      return -1\n    }\n    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n  } else if (typeof val === 'number') {\n    val = val & 0xFF // Search for a byte value [0-255]\n    if (typeof Uint8Array.prototype.indexOf === 'function') {\n      if (dir) {\n        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n      } else {\n        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n      }\n    }\n    return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n  }\n\n  throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n  var indexSize = 1\n  var arrLength = arr.length\n  var valLength = val.length\n\n  if (encoding !== undefined) {\n    encoding = String(encoding).toLowerCase()\n    if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n        encoding === 'utf16le' || encoding === 'utf-16le') {\n      if (arr.length < 2 || val.length < 2) {\n        return -1\n      }\n      indexSize = 2\n      arrLength /= 2\n      valLength /= 2\n      byteOffset /= 2\n    }\n  }\n\n  function read (buf, i) {\n    if (indexSize === 1) {\n      return buf[i]\n    } else {\n      return buf.readUInt16BE(i * indexSize)\n    }\n  }\n\n  var i\n  if (dir) {\n    var foundIndex = -1\n    for (i = byteOffset; i < arrLength; i++) {\n      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n        if (foundIndex === -1) foundIndex = i\n        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n      } else {\n        if (foundIndex !== -1) i -= i - foundIndex\n        foundIndex = -1\n      }\n    }\n  } else {\n    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n    for (i = byteOffset; i >= 0; i--) {\n      var found = true\n      for (var j = 0; j < valLength; j++) {\n        if (read(arr, i + j) !== read(val, j)) {\n          found = false\n          break\n        }\n      }\n      if (found) return i\n    }\n  }\n\n  return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n  return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n  offset = Number(offset) || 0\n  var remaining = buf.length - offset\n  if (!length) {\n    length = remaining\n  } else {\n    length = Number(length)\n    if (length > remaining) {\n      length = remaining\n    }\n  }\n\n  var strLen = string.length\n\n  if (length > strLen / 2) {\n    length = strLen / 2\n  }\n  for (var i = 0; i < length; ++i) {\n    var parsed = parseInt(string.substr(i * 2, 2), 16)\n    if (numberIsNaN(parsed)) return i\n    buf[offset + i] = parsed\n  }\n  return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n  return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n  return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n  return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n  // Buffer#write(string)\n  if (offset === undefined) {\n    encoding = 'utf8'\n    length = this.length\n    offset = 0\n  // Buffer#write(string, encoding)\n  } else if (length === undefined && typeof offset === 'string') {\n    encoding = offset\n    length = this.length\n    offset = 0\n  // Buffer#write(string, offset[, length][, encoding])\n  } else if (isFinite(offset)) {\n    offset = offset >>> 0\n    if (isFinite(length)) {\n      length = length >>> 0\n      if (encoding === undefined) encoding = 'utf8'\n    } else {\n      encoding = length\n      length = undefined\n    }\n  } else {\n    throw new Error(\n      'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n    )\n  }\n\n  var remaining = this.length - offset\n  if (length === undefined || length > remaining) length = remaining\n\n  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n    throw new RangeError('Attempt to write outside buffer bounds')\n  }\n\n  if (!encoding) encoding = 'utf8'\n\n  var loweredCase = false\n  for (;;) {\n    switch (encoding) {\n      case 'hex':\n        return hexWrite(this, string, offset, length)\n\n      case 'utf8':\n      case 'utf-8':\n        return utf8Write(this, string, offset, length)\n\n      case 'ascii':\n        return asciiWrite(this, string, offset, length)\n\n      case 'latin1':\n      case 'binary':\n        return latin1Write(this, string, offset, length)\n\n      case 'base64':\n        // Warning: maxLength not taken into account in base64Write\n        return base64Write(this, string, offset, length)\n\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return ucs2Write(this, string, offset, length)\n\n      default:\n        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n        encoding = ('' + encoding).toLowerCase()\n        loweredCase = true\n    }\n  }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n  return {\n    type: 'Buffer',\n    data: Array.prototype.slice.call(this._arr || this, 0)\n  }\n}\n\nfunction base64Slice (buf, start, end) {\n  if (start === 0 && end === buf.length) {\n    return base64.fromByteArray(buf)\n  } else {\n    return base64.fromByteArray(buf.slice(start, end))\n  }\n}\n\nfunction utf8Slice (buf, start, end) {\n  end = Math.min(buf.length, end)\n  var res = []\n\n  var i = start\n  while (i < end) {\n    var firstByte = buf[i]\n    var codePoint = null\n    var bytesPerSequence = (firstByte > 0xEF) ? 4\n      : (firstByte > 0xDF) ? 3\n        : (firstByte > 0xBF) ? 2\n          : 1\n\n    if (i + bytesPerSequence <= end) {\n      var secondByte, thirdByte, fourthByte, tempCodePoint\n\n      switch (bytesPerSequence) {\n        case 1:\n          if (firstByte < 0x80) {\n            codePoint = firstByte\n          }\n          break\n        case 2:\n          secondByte = buf[i + 1]\n          if ((secondByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n            if (tempCodePoint > 0x7F) {\n              codePoint = tempCodePoint\n            }\n          }\n          break\n        case 3:\n          secondByte = buf[i + 1]\n          thirdByte = buf[i + 2]\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n              codePoint = tempCodePoint\n            }\n          }\n          break\n        case 4:\n          secondByte = buf[i + 1]\n          thirdByte = buf[i + 2]\n          fourthByte = buf[i + 3]\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n              codePoint = tempCodePoint\n            }\n          }\n      }\n    }\n\n    if (codePoint === null) {\n      // we did not generate a valid codePoint so insert a\n      // replacement char (U+FFFD) and advance only 1 byte\n      codePoint = 0xFFFD\n      bytesPerSequence = 1\n    } else if (codePoint > 0xFFFF) {\n      // encode to utf16 (surrogate pair dance)\n      codePoint -= 0x10000\n      res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n      codePoint = 0xDC00 | codePoint & 0x3FF\n    }\n\n    res.push(codePoint)\n    i += bytesPerSequence\n  }\n\n  return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n  var len = codePoints.length\n  if (len <= MAX_ARGUMENTS_LENGTH) {\n    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n  }\n\n  // Decode in chunks to avoid \"call stack size exceeded\".\n  var res = ''\n  var i = 0\n  while (i < len) {\n    res += String.fromCharCode.apply(\n      String,\n      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n    )\n  }\n  return res\n}\n\nfunction asciiSlice (buf, start, end) {\n  var ret = ''\n  end = Math.min(buf.length, end)\n\n  for (var i = start; i < end; ++i) {\n    ret += String.fromCharCode(buf[i] & 0x7F)\n  }\n  return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n  var ret = ''\n  end = Math.min(buf.length, end)\n\n  for (var i = start; i < end; ++i) {\n    ret += String.fromCharCode(buf[i])\n  }\n  return ret\n}\n\nfunction hexSlice (buf, start, end) {\n  var len = buf.length\n\n  if (!start || start < 0) start = 0\n  if (!end || end < 0 || end > len) end = len\n\n  var out = ''\n  for (var i = start; i < end; ++i) {\n    out += toHex(buf[i])\n  }\n  return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n  var bytes = buf.slice(start, end)\n  var res = ''\n  for (var i = 0; i < bytes.length; i += 2) {\n    res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n  }\n  return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n  var len = this.length\n  start = ~~start\n  end = end === undefined ? len : ~~end\n\n  if (start < 0) {\n    start += len\n    if (start < 0) start = 0\n  } else if (start > len) {\n    start = len\n  }\n\n  if (end < 0) {\n    end += len\n    if (end < 0) end = 0\n  } else if (end > len) {\n    end = len\n  }\n\n  if (end < start) end = start\n\n  var newBuf = this.subarray(start, end)\n  // Return an augmented `Uint8Array` instance\n  newBuf.__proto__ = Buffer.prototype\n  return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  var val = this[offset]\n  var mul = 1\n  var i = 0\n  while (++i < byteLength && (mul *= 0x100)) {\n    val += this[offset + i] * mul\n  }\n\n  return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) {\n    checkOffset(offset, byteLength, this.length)\n  }\n\n  var val = this[offset + --byteLength]\n  var mul = 1\n  while (byteLength > 0 && (mul *= 0x100)) {\n    val += this[offset + --byteLength] * mul\n  }\n\n  return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 1, this.length)\n  return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return ((this[offset]) |\n      (this[offset + 1] << 8) |\n      (this[offset + 2] << 16)) +\n      (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset] * 0x1000000) +\n    ((this[offset + 1] << 16) |\n    (this[offset + 2] << 8) |\n    this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  var val = this[offset]\n  var mul = 1\n  var i = 0\n  while (++i < byteLength && (mul *= 0x100)) {\n    val += this[offset + i] * mul\n  }\n  mul *= 0x80\n\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n  return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  var i = byteLength\n  var mul = 1\n  var val = this[offset + --i]\n  while (i > 0 && (mul *= 0x100)) {\n    val += this[offset + --i] * mul\n  }\n  mul *= 0x80\n\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n  return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 1, this.length)\n  if (!(this[offset] & 0x80)) return (this[offset])\n  return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  var val = this[offset] | (this[offset + 1] << 8)\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  var val = this[offset + 1] | (this[offset] << 8)\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset]) |\n    (this[offset + 1] << 8) |\n    (this[offset + 2] << 16) |\n    (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset] << 24) |\n    (this[offset + 1] << 16) |\n    (this[offset + 2] << 8) |\n    (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n  return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n  return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 8, this.length)\n  return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 8, this.length)\n  return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n  if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n  if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n  if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) {\n    var maxBytes = Math.pow(2, 8 * byteLength) - 1\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\n  }\n\n  var mul = 1\n  var i = 0\n  this[offset] = value & 0xFF\n  while (++i < byteLength && (mul *= 0x100)) {\n    this[offset + i] = (value / mul) & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) {\n    var maxBytes = Math.pow(2, 8 * byteLength) - 1\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\n  }\n\n  var i = byteLength - 1\n  var mul = 1\n  this[offset + i] = value & 0xFF\n  while (--i >= 0 && (mul *= 0x100)) {\n    this[offset + i] = (value / mul) & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n  this[offset] = (value & 0xff)\n  return offset + 1\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n  this[offset] = (value & 0xff)\n  this[offset + 1] = (value >>> 8)\n  return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n  this[offset] = (value >>> 8)\n  this[offset + 1] = (value & 0xff)\n  return offset + 2\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n  this[offset + 3] = (value >>> 24)\n  this[offset + 2] = (value >>> 16)\n  this[offset + 1] = (value >>> 8)\n  this[offset] = (value & 0xff)\n  return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n  this[offset] = (value >>> 24)\n  this[offset + 1] = (value >>> 16)\n  this[offset + 2] = (value >>> 8)\n  this[offset + 3] = (value & 0xff)\n  return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) {\n    var limit = Math.pow(2, (8 * byteLength) - 1)\n\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\n  }\n\n  var i = 0\n  var mul = 1\n  var sub = 0\n  this[offset] = value & 0xFF\n  while (++i < byteLength && (mul *= 0x100)) {\n    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n      sub = 1\n    }\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) {\n    var limit = Math.pow(2, (8 * byteLength) - 1)\n\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\n  }\n\n  var i = byteLength - 1\n  var mul = 1\n  var sub = 0\n  this[offset + i] = value & 0xFF\n  while (--i >= 0 && (mul *= 0x100)) {\n    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n      sub = 1\n    }\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n  if (value < 0) value = 0xff + value + 1\n  this[offset] = (value & 0xff)\n  return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n  this[offset] = (value & 0xff)\n  this[offset + 1] = (value >>> 8)\n  return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n  this[offset] = (value >>> 8)\n  this[offset + 1] = (value & 0xff)\n  return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n  this[offset] = (value & 0xff)\n  this[offset + 1] = (value >>> 8)\n  this[offset + 2] = (value >>> 16)\n  this[offset + 3] = (value >>> 24)\n  return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n  if (value < 0) value = 0xffffffff + value + 1\n  this[offset] = (value >>> 24)\n  this[offset + 1] = (value >>> 16)\n  this[offset + 2] = (value >>> 8)\n  this[offset + 3] = (value & 0xff)\n  return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n  if (offset + ext > buf.length) throw new RangeError('Index out of range')\n  if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) {\n    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n  }\n  ieee754.write(buf, value, offset, littleEndian, 23, 4)\n  return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n  return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n  return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) {\n    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n  }\n  ieee754.write(buf, value, offset, littleEndian, 52, 8)\n  return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n  return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n  return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n  if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n  if (!start) start = 0\n  if (!end && end !== 0) end = this.length\n  if (targetStart >= target.length) targetStart = target.length\n  if (!targetStart) targetStart = 0\n  if (end > 0 && end < start) end = start\n\n  // Copy 0 bytes; we're done\n  if (end === start) return 0\n  if (target.length === 0 || this.length === 0) return 0\n\n  // Fatal error conditions\n  if (targetStart < 0) {\n    throw new RangeError('targetStart out of bounds')\n  }\n  if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n  if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n  // Are we oob?\n  if (end > this.length) end = this.length\n  if (target.length - targetStart < end - start) {\n    end = target.length - targetStart + start\n  }\n\n  var len = end - start\n\n  if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n    // Use built-in when available, missing from IE11\n    this.copyWithin(targetStart, start, end)\n  } else if (this === target && start < targetStart && targetStart < end) {\n    // descending copy from end\n    for (var i = len - 1; i >= 0; --i) {\n      target[i + targetStart] = this[i + start]\n    }\n  } else {\n    Uint8Array.prototype.set.call(\n      target,\n      this.subarray(start, end),\n      targetStart\n    )\n  }\n\n  return len\n}\n\n// Usage:\n//    buffer.fill(number[, offset[, end]])\n//    buffer.fill(buffer[, offset[, end]])\n//    buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n  // Handle string cases:\n  if (typeof val === 'string') {\n    if (typeof start === 'string') {\n      encoding = start\n      start = 0\n      end = this.length\n    } else if (typeof end === 'string') {\n      encoding = end\n      end = this.length\n    }\n    if (encoding !== undefined && typeof encoding !== 'string') {\n      throw new TypeError('encoding must be a string')\n    }\n    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n      throw new TypeError('Unknown encoding: ' + encoding)\n    }\n    if (val.length === 1) {\n      var code = val.charCodeAt(0)\n      if ((encoding === 'utf8' && code < 128) ||\n          encoding === 'latin1') {\n        // Fast path: If `val` fits into a single byte, use that numeric value.\n        val = code\n      }\n    }\n  } else if (typeof val === 'number') {\n    val = val & 255\n  }\n\n  // Invalid ranges are not set to a default, so can range check early.\n  if (start < 0 || this.length < start || this.length < end) {\n    throw new RangeError('Out of range index')\n  }\n\n  if (end <= start) {\n    return this\n  }\n\n  start = start >>> 0\n  end = end === undefined ? this.length : end >>> 0\n\n  if (!val) val = 0\n\n  var i\n  if (typeof val === 'number') {\n    for (i = start; i < end; ++i) {\n      this[i] = val\n    }\n  } else {\n    var bytes = Buffer.isBuffer(val)\n      ? val\n      : Buffer.from(val, encoding)\n    var len = bytes.length\n    if (len === 0) {\n      throw new TypeError('The value \"' + val +\n        '\" is invalid for argument \"value\"')\n    }\n    for (i = 0; i < end - start; ++i) {\n      this[i + start] = bytes[i % len]\n    }\n  }\n\n  return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n  // Node takes equal signs as end of the Base64 encoding\n  str = str.split('=')[0]\n  // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n  str = str.trim().replace(INVALID_BASE64_RE, '')\n  // Node converts strings with length < 2 to ''\n  if (str.length < 2) return ''\n  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n  while (str.length % 4 !== 0) {\n    str = str + '='\n  }\n  return str\n}\n\nfunction toHex (n) {\n  if (n < 16) return '0' + n.toString(16)\n  return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n  units = units || Infinity\n  var codePoint\n  var length = string.length\n  var leadSurrogate = null\n  var bytes = []\n\n  for (var i = 0; i < length; ++i) {\n    codePoint = string.charCodeAt(i)\n\n    // is surrogate component\n    if (codePoint > 0xD7FF && codePoint < 0xE000) {\n      // last char was a lead\n      if (!leadSurrogate) {\n        // no lead yet\n        if (codePoint > 0xDBFF) {\n          // unexpected trail\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n          continue\n        } else if (i + 1 === length) {\n          // unpaired lead\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n          continue\n        }\n\n        // valid lead\n        leadSurrogate = codePoint\n\n        continue\n      }\n\n      // 2 leads in a row\n      if (codePoint < 0xDC00) {\n        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n        leadSurrogate = codePoint\n        continue\n      }\n\n      // valid surrogate pair\n      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n    } else if (leadSurrogate) {\n      // valid bmp char, but last char was a lead\n      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n    }\n\n    leadSurrogate = null\n\n    // encode utf8\n    if (codePoint < 0x80) {\n      if ((units -= 1) < 0) break\n      bytes.push(codePoint)\n    } else if (codePoint < 0x800) {\n      if ((units -= 2) < 0) break\n      bytes.push(\n        codePoint >> 0x6 | 0xC0,\n        codePoint & 0x3F | 0x80\n      )\n    } else if (codePoint < 0x10000) {\n      if ((units -= 3) < 0) break\n      bytes.push(\n        codePoint >> 0xC | 0xE0,\n        codePoint >> 0x6 & 0x3F | 0x80,\n        codePoint & 0x3F | 0x80\n      )\n    } else if (codePoint < 0x110000) {\n      if ((units -= 4) < 0) break\n      bytes.push(\n        codePoint >> 0x12 | 0xF0,\n        codePoint >> 0xC & 0x3F | 0x80,\n        codePoint >> 0x6 & 0x3F | 0x80,\n        codePoint & 0x3F | 0x80\n      )\n    } else {\n      throw new Error('Invalid code point')\n    }\n  }\n\n  return bytes\n}\n\nfunction asciiToBytes (str) {\n  var byteArray = []\n  for (var i = 0; i < str.length; ++i) {\n    // Node's code seems to be doing this and not & 0x7F..\n    byteArray.push(str.charCodeAt(i) & 0xFF)\n  }\n  return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n  var c, hi, lo\n  var byteArray = []\n  for (var i = 0; i < str.length; ++i) {\n    if ((units -= 2) < 0) break\n\n    c = str.charCodeAt(i)\n    hi = c >> 8\n    lo = c % 256\n    byteArray.push(lo)\n    byteArray.push(hi)\n  }\n\n  return byteArray\n}\n\nfunction base64ToBytes (str) {\n  return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n  for (var i = 0; i < length; ++i) {\n    if ((i + offset >= dst.length) || (i >= src.length)) break\n    dst[i + offset] = src[i]\n  }\n  return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n  return obj instanceof type ||\n    (obj != null && obj.constructor != null && obj.constructor.name != null &&\n      obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n  // For IE11 support\n  return obj !== obj // eslint-disable-line no-self-compare\n}\n\n},{\"base64-js\":1,\"ieee754\":25}],5:[function(require,module,exports){\n(function (Buffer){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n  if (Array.isArray) {\n    return Array.isArray(arg);\n  }\n  return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n  return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n  return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n  return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n  return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n  return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n  return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n  return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n  return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n  return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n  return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n  return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n  return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n  return arg === null ||\n         typeof arg === 'boolean' ||\n         typeof arg === 'number' ||\n         typeof arg === 'string' ||\n         typeof arg === 'symbol' ||  // ES6 symbol\n         typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n  return Object.prototype.toString.call(o);\n}\n\n}).call(this,{\"isBuffer\":require(\"../../is-buffer/index.js\")})\n},{\"../../is-buffer/index.js\":27}],6:[function(require,module,exports){\nvar pSlice = Array.prototype.slice;\nvar objectKeys = require('./lib/keys.js');\nvar isArguments = require('./lib/is_arguments.js');\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n  if (!opts) opts = {};\n  // 7.1. All identical values are equivalent, as determined by ===.\n  if (actual === expected) {\n    return true;\n\n  } else if (actual instanceof Date && expected instanceof Date) {\n    return actual.getTime() === expected.getTime();\n\n  // 7.3. Other pairs that do not both pass typeof value == 'object',\n  // equivalence is determined by ==.\n  } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n    return opts.strict ? actual === expected : actual == expected;\n\n  // 7.4. For all other Object pairs, including Array objects, equivalence is\n  // determined by having the same number of owned properties (as verified\n  // with Object.prototype.hasOwnProperty.call), the same set of keys\n  // (although not necessarily the same order), equivalent values for every\n  // corresponding key, and an identical 'prototype' property. Note: this\n  // accounts for both named and indexed properties on Arrays.\n  } else {\n    return objEquiv(actual, expected, opts);\n  }\n}\n\nfunction isUndefinedOrNull(value) {\n  return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n  if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n  if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n    return false;\n  }\n  if (x.length > 0 && typeof x[0] !== 'number') return false;\n  return true;\n}\n\nfunction objEquiv(a, b, opts) {\n  var i, key;\n  if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n    return false;\n  // an identical 'prototype' property.\n  if (a.prototype !== b.prototype) return false;\n  //~~~I've managed to break Object.keys through screwy arguments passing.\n  //   Converting to array solves the problem.\n  if (isArguments(a)) {\n    if (!isArguments(b)) {\n      return false;\n    }\n    a = pSlice.call(a);\n    b = pSlice.call(b);\n    return deepEqual(a, b, opts);\n  }\n  if (isBuffer(a)) {\n    if (!isBuffer(b)) {\n      return false;\n    }\n    if (a.length !== b.length) return false;\n    for (i = 0; i < a.length; i++) {\n      if (a[i] !== b[i]) return false;\n    }\n    return true;\n  }\n  try {\n    var ka = objectKeys(a),\n        kb = objectKeys(b);\n  } catch (e) {//happens when one is a string literal and the other isn't\n    return false;\n  }\n  // having the same number of owned properties (keys incorporates\n  // hasOwnProperty)\n  if (ka.length != kb.length)\n    return false;\n  //the same set of keys (although not necessarily the same order),\n  ka.sort();\n  kb.sort();\n  //~~~cheap key test\n  for (i = ka.length - 1; i >= 0; i--) {\n    if (ka[i] != kb[i])\n      return false;\n  }\n  //equivalent values for every corresponding key, and\n  //~~~possibly expensive deep test\n  for (i = ka.length - 1; i >= 0; i--) {\n    key = ka[i];\n    if (!deepEqual(a[key], b[key], opts)) return false;\n  }\n  return typeof a === typeof b;\n}\n\n},{\"./lib/is_arguments.js\":7,\"./lib/keys.js\":8}],7:[function(require,module,exports){\nvar supportsArgumentsClass = (function(){\n  return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n  return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n  return object &&\n    typeof object == 'object' &&\n    typeof object.length == 'number' &&\n    Object.prototype.hasOwnProperty.call(object, 'callee') &&\n    !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n    false;\n};\n\n},{}],8:[function(require,module,exports){\nexports = module.exports = typeof Object.keys === 'function'\n  ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n  var keys = [];\n  for (var key in obj) keys.push(key);\n  return keys;\n}\n\n},{}],9:[function(require,module,exports){\n'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar origDefineProperty = Object.defineProperty;\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar arePropertyDescriptorsSupported = function () {\n\tvar obj = {};\n\ttry {\n\t\torigDefineProperty(obj, 'x', { enumerable: false, value: obj });\n\t\t// eslint-disable-next-line no-unused-vars, no-restricted-syntax\n\t\tfor (var _ in obj) { // jscs:ignore disallowUnusedVariables\n\t\t\treturn false;\n\t\t}\n\t\treturn obj.x === obj;\n\t} catch (e) { /* this is IE 8. */\n\t\treturn false;\n\t}\n};\nvar supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object && (!isFunction(predicate) || !predicate())) {\n\t\treturn;\n\t}\n\tif (supportsDescriptors) {\n\t\torigDefineProperty(object, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: value,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\tobject[name] = value;\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n\n},{\"object-keys\":32}],10:[function(require,module,exports){\nmodule.exports = function () {\n    for (var i = 0; i < arguments.length; i++) {\n        if (arguments[i] !== undefined) return arguments[i];\n    }\n};\n\n},{}],11:[function(require,module,exports){\n'use strict';\n\n/* globals\n\tSet,\n\tMap,\n\tWeakSet,\n\tWeakMap,\n\n\tPromise,\n\n\tSymbol,\n\tProxy,\n\n\tAtomics,\n\tSharedArrayBuffer,\n\n\tArrayBuffer,\n\tDataView,\n\tUint8Array,\n\tFloat32Array,\n\tFloat64Array,\n\tInt8Array,\n\tInt16Array,\n\tInt32Array,\n\tUint8ClampedArray,\n\tUint16Array,\n\tUint32Array,\n*/\n\nvar undefined; // eslint-disable-line no-shadow-restricted-names\n\nvar ThrowTypeError = Object.getOwnPropertyDescriptor\n\t? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }())\n\t: function () { throw new TypeError(); };\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto\n\nvar generator; // = function * () {};\nvar generatorFunction = generator ? getProto(generator) : undefined;\nvar asyncFn; // async function() {};\nvar asyncFunction = asyncFn ? asyncFn.constructor : undefined;\nvar asyncGen; // async function * () {};\nvar asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;\nvar asyncGenIterator = asyncGen ? asyncGen() : undefined;\n\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'$ %Array%': Array,\n\t'$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,\n\t'$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n\t'$ %ArrayPrototype%': Array.prototype,\n\t'$ %ArrayProto_entries%': Array.prototype.entries,\n\t'$ %ArrayProto_forEach%': Array.prototype.forEach,\n\t'$ %ArrayProto_keys%': Array.prototype.keys,\n\t'$ %ArrayProto_values%': Array.prototype.values,\n\t'$ %AsyncFromSyncIteratorPrototype%': undefined,\n\t'$ %AsyncFunction%': asyncFunction,\n\t'$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,\n\t'$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,\n\t'$ %AsyncGeneratorFunction%': asyncGenFunction,\n\t'$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,\n\t'$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,\n\t'$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'$ %Boolean%': Boolean,\n\t'$ %BooleanPrototype%': Boolean.prototype,\n\t'$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,\n\t'$ %Date%': Date,\n\t'$ %DatePrototype%': Date.prototype,\n\t'$ %decodeURI%': decodeURI,\n\t'$ %decodeURIComponent%': decodeURIComponent,\n\t'$ %encodeURI%': encodeURI,\n\t'$ %encodeURIComponent%': encodeURIComponent,\n\t'$ %Error%': Error,\n\t'$ %ErrorPrototype%': Error.prototype,\n\t'$ %eval%': eval, // eslint-disable-line no-eval\n\t'$ %EvalError%': EvalError,\n\t'$ %EvalErrorPrototype%': EvalError.prototype,\n\t'$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,\n\t'$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,\n\t'$ %Function%': Function,\n\t'$ %FunctionPrototype%': Function.prototype,\n\t'$ %Generator%': generator ? getProto(generator()) : undefined,\n\t'$ %GeneratorFunction%': generatorFunction,\n\t'$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,\n\t'$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,\n\t'$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,\n\t'$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,\n\t'$ %isFinite%': isFinite,\n\t'$ %isNaN%': isNaN,\n\t'$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'$ %JSON%': JSON,\n\t'$ %JSONParse%': JSON.parse,\n\t'$ %Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,\n\t'$ %Math%': Math,\n\t'$ %Number%': Number,\n\t'$ %NumberPrototype%': Number.prototype,\n\t'$ %Object%': Object,\n\t'$ %ObjectPrototype%': Object.prototype,\n\t'$ %ObjProto_toString%': Object.prototype.toString,\n\t'$ %ObjProto_valueOf%': Object.prototype.valueOf,\n\t'$ %parseFloat%': parseFloat,\n\t'$ %parseInt%': parseInt,\n\t'$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,\n\t'$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,\n\t'$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,\n\t'$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,\n\t'$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,\n\t'$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'$ %RangeError%': RangeError,\n\t'$ %RangeErrorPrototype%': RangeError.prototype,\n\t'$ %ReferenceError%': ReferenceError,\n\t'$ %ReferenceErrorPrototype%': ReferenceError.prototype,\n\t'$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'$ %RegExp%': RegExp,\n\t'$ %RegExpPrototype%': RegExp.prototype,\n\t'$ %Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,\n\t'$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,\n\t'$ %String%': String,\n\t'$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n\t'$ %StringPrototype%': String.prototype,\n\t'$ %Symbol%': hasSymbols ? Symbol : undefined,\n\t'$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,\n\t'$ %SyntaxError%': SyntaxError,\n\t'$ %SyntaxErrorPrototype%': SyntaxError.prototype,\n\t'$ %ThrowTypeError%': ThrowTypeError,\n\t'$ %TypedArray%': TypedArray,\n\t'$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,\n\t'$ %TypeError%': TypeError,\n\t'$ %TypeErrorPrototype%': TypeError.prototype,\n\t'$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,\n\t'$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,\n\t'$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,\n\t'$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,\n\t'$ %URIError%': URIError,\n\t'$ %URIErrorPrototype%': URIError.prototype,\n\t'$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,\n\t'$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,\n\t'$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tvar key = '$ ' + name;\n\tif (!(key in INTRINSICS)) {\n\t\tthrow new SyntaxError('intrinsic ' + name + ' does not exist!');\n\t}\n\n\t// istanbul ignore if // hopefully this is impossible to test :-)\n\tif (typeof INTRINSICS[key] === 'undefined' && !allowMissing) {\n\t\tthrow new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t}\n\treturn INTRINSICS[key];\n};\n\n},{}],12:[function(require,module,exports){\n'use strict';\n\nvar GetIntrinsic = require('./GetIntrinsic');\n\nvar $Object = GetIntrinsic('%Object%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $String = GetIntrinsic('%String%');\n\nvar assertRecord = require('./helpers/assertRecord');\nvar $isNaN = require('./helpers/isNaN');\nvar $isFinite = require('./helpers/isFinite');\n\nvar sign = require('./helpers/sign');\nvar mod = require('./helpers/mod');\n\nvar IsCallable = require('is-callable');\nvar toPrimitive = require('es-to-primitive/es5');\n\nvar has = require('has');\n\n// https://es5.github.io/#x9\nvar ES5 = {\n\tToPrimitive: toPrimitive,\n\n\tToBoolean: function ToBoolean(value) {\n\t\treturn !!value;\n\t},\n\tToNumber: function ToNumber(value) {\n\t\treturn +value; // eslint-disable-line no-implicit-coercion\n\t},\n\tToInteger: function ToInteger(value) {\n\t\tvar number = this.ToNumber(value);\n\t\tif ($isNaN(number)) { return 0; }\n\t\tif (number === 0 || !$isFinite(number)) { return number; }\n\t\treturn sign(number) * Math.floor(Math.abs(number));\n\t},\n\tToInt32: function ToInt32(x) {\n\t\treturn this.ToNumber(x) >> 0;\n\t},\n\tToUint32: function ToUint32(x) {\n\t\treturn this.ToNumber(x) >>> 0;\n\t},\n\tToUint16: function ToUint16(value) {\n\t\tvar number = this.ToNumber(value);\n\t\tif ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }\n\t\tvar posInt = sign(number) * Math.floor(Math.abs(number));\n\t\treturn mod(posInt, 0x10000);\n\t},\n\tToString: function ToString(value) {\n\t\treturn $String(value);\n\t},\n\tToObject: function ToObject(value) {\n\t\tthis.CheckObjectCoercible(value);\n\t\treturn $Object(value);\n\t},\n\tCheckObjectCoercible: function CheckObjectCoercible(value, optMessage) {\n\t\t/* jshint eqnull:true */\n\t\tif (value == null) {\n\t\t\tthrow new $TypeError(optMessage || 'Cannot call method on ' + value);\n\t\t}\n\t\treturn value;\n\t},\n\tIsCallable: IsCallable,\n\tSameValue: function SameValue(x, y) {\n\t\tif (x === y) { // 0 === -0, but they are not identical.\n\t\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\t\treturn true;\n\t\t}\n\t\treturn $isNaN(x) && $isNaN(y);\n\t},\n\n\t// https://www.ecma-international.org/ecma-262/5.1/#sec-8\n\tType: function Type(x) {\n\t\tif (x === null) {\n\t\t\treturn 'Null';\n\t\t}\n\t\tif (typeof x === 'undefined') {\n\t\t\treturn 'Undefined';\n\t\t}\n\t\tif (typeof x === 'function' || typeof x === 'object') {\n\t\t\treturn 'Object';\n\t\t}\n\t\tif (typeof x === 'number') {\n\t\t\treturn 'Number';\n\t\t}\n\t\tif (typeof x === 'boolean') {\n\t\t\treturn 'Boolean';\n\t\t}\n\t\tif (typeof x === 'string') {\n\t\t\treturn 'String';\n\t\t}\n\t},\n\n\t// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type\n\tIsPropertyDescriptor: function IsPropertyDescriptor(Desc) {\n\t\tif (this.Type(Desc) !== 'Object') {\n\t\t\treturn false;\n\t\t}\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1\n\tIsAccessorDescriptor: function IsAccessorDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2\n\tIsDataDescriptor: function IsDataDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3\n\tIsGenericDescriptor: function IsGenericDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4\n\tFromPropertyDescriptor: function FromPropertyDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn Desc;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (this.IsDataDescriptor(Desc)) {\n\t\t\treturn {\n\t\t\t\tvalue: Desc['[[Value]]'],\n\t\t\t\twritable: !!Desc['[[Writable]]'],\n\t\t\t\tenumerable: !!Desc['[[Enumerable]]'],\n\t\t\t\tconfigurable: !!Desc['[[Configurable]]']\n\t\t\t};\n\t\t} else if (this.IsAccessorDescriptor(Desc)) {\n\t\t\treturn {\n\t\t\t\tget: Desc['[[Get]]'],\n\t\t\t\tset: Desc['[[Set]]'],\n\t\t\t\tenumerable: !!Desc['[[Enumerable]]'],\n\t\t\t\tconfigurable: !!Desc['[[Configurable]]']\n\t\t\t};\n\t\t} else {\n\t\t\tthrow new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor');\n\t\t}\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5\n\tToPropertyDescriptor: function ToPropertyDescriptor(Obj) {\n\t\tif (this.Type(Obj) !== 'Object') {\n\t\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t\t}\n\n\t\tvar desc = {};\n\t\tif (has(Obj, 'enumerable')) {\n\t\t\tdesc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable);\n\t\t}\n\t\tif (has(Obj, 'configurable')) {\n\t\t\tdesc['[[Configurable]]'] = this.ToBoolean(Obj.configurable);\n\t\t}\n\t\tif (has(Obj, 'value')) {\n\t\t\tdesc['[[Value]]'] = Obj.value;\n\t\t}\n\t\tif (has(Obj, 'writable')) {\n\t\t\tdesc['[[Writable]]'] = this.ToBoolean(Obj.writable);\n\t\t}\n\t\tif (has(Obj, 'get')) {\n\t\t\tvar getter = Obj.get;\n\t\t\tif (typeof getter !== 'undefined' && !this.IsCallable(getter)) {\n\t\t\t\tthrow new TypeError('getter must be a function');\n\t\t\t}\n\t\t\tdesc['[[Get]]'] = getter;\n\t\t}\n\t\tif (has(Obj, 'set')) {\n\t\t\tvar setter = Obj.set;\n\t\t\tif (typeof setter !== 'undefined' && !this.IsCallable(setter)) {\n\t\t\t\tthrow new $TypeError('setter must be a function');\n\t\t\t}\n\t\t\tdesc['[[Set]]'] = setter;\n\t\t}\n\n\t\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t\t}\n\t\treturn desc;\n\t}\n};\n\nmodule.exports = ES5;\n\n},{\"./GetIntrinsic\":11,\"./helpers/assertRecord\":13,\"./helpers/isFinite\":14,\"./helpers/isNaN\":15,\"./helpers/mod\":16,\"./helpers/sign\":17,\"es-to-primitive/es5\":18,\"has\":24,\"is-callable\":28}],13:[function(require,module,exports){\n'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\n\nvar predicates = {\n  // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type\n  'Property Descriptor': function isPropertyDescriptor(ES, Desc) {\n    if (ES.Type(Desc) !== 'Object') {\n      return false;\n    }\n    var allowed = {\n      '[[Configurable]]': true,\n      '[[Enumerable]]': true,\n      '[[Get]]': true,\n      '[[Set]]': true,\n      '[[Value]]': true,\n      '[[Writable]]': true\n    };\n\n    for (var key in Desc) { // eslint-disable-line\n      if (has(Desc, key) && !allowed[key]) {\n        return false;\n      }\n    }\n\n    var isData = has(Desc, '[[Value]]');\n    var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n    if (isData && IsAccessor) {\n      throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n    }\n    return true;\n  }\n};\n\nmodule.exports = function assertRecord(ES, recordType, argumentName, value) {\n  var predicate = predicates[recordType];\n  if (typeof predicate !== 'function') {\n    throw new $SyntaxError('unknown record type: ' + recordType);\n  }\n  if (!predicate(ES, value)) {\n    throw new $TypeError(argumentName + ' must be a ' + recordType);\n  }\n  console.log(predicate(ES, value), value);\n};\n\n},{\"../GetIntrinsic\":11,\"has\":24}],14:[function(require,module,exports){\nvar $isNaN = Number.isNaN || function (a) { return a !== a; };\n\nmodule.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n\n},{}],15:[function(require,module,exports){\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n\n},{}],16:[function(require,module,exports){\nmodule.exports = function mod(number, modulo) {\n\tvar remain = number % modulo;\n\treturn Math.floor(remain >= 0 ? remain : remain + modulo);\n};\n\n},{}],17:[function(require,module,exports){\nmodule.exports = function sign(number) {\n\treturn number >= 0 ? 1 : -1;\n};\n\n},{}],18:[function(require,module,exports){\n'use strict';\n\nvar toStr = Object.prototype.toString;\n\nvar isPrimitive = require('./helpers/isPrimitive');\n\nvar isCallable = require('is-callable');\n\n// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8\nvar ES5internalSlots = {\n\t'[[DefaultValue]]': function (O) {\n\t\tvar actualHint;\n\t\tif (arguments.length > 1) {\n\t\t\tactualHint = arguments[1];\n\t\t} else {\n\t\t\tactualHint = toStr.call(O) === '[object Date]' ? String : Number;\n\t\t}\n\n\t\tif (actualHint === String || actualHint === Number) {\n\t\t\tvar methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\t\t\tvar value, i;\n\t\t\tfor (i = 0; i < methods.length; ++i) {\n\t\t\t\tif (isCallable(O[methods[i]])) {\n\t\t\t\t\tvalue = O[methods[i]]();\n\t\t\t\t\tif (isPrimitive(value)) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new TypeError('No default value');\n\t\t}\n\t\tthrow new TypeError('invalid [[DefaultValue]] hint supplied');\n\t}\n};\n\n// http://ecma-international.org/ecma-262/5.1/#sec-9.1\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tif (arguments.length > 1) {\n\t\treturn ES5internalSlots['[[DefaultValue]]'](input, arguments[1]);\n\t}\n\treturn ES5internalSlots['[[DefaultValue]]'](input);\n};\n\n},{\"./helpers/isPrimitive\":19,\"is-callable\":28}],19:[function(require,module,exports){\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n\n},{}],20:[function(require,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar objectCreate = Object.create || objectCreatePolyfill\nvar objectKeys = Object.keys || objectKeysPolyfill\nvar bind = Function.prototype.bind || functionBindPolyfill\n\nfunction EventEmitter() {\n  if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) {\n    this._events = objectCreate(null);\n    this._eventsCount = 0;\n  }\n\n  this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nvar hasDefineProperty;\ntry {\n  var o = {};\n  if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 });\n  hasDefineProperty = o.x === 0;\n} catch (err) { hasDefineProperty = false }\nif (hasDefineProperty) {\n  Object.defineProperty(EventEmitter, 'defaultMaxListeners', {\n    enumerable: true,\n    get: function() {\n      return defaultMaxListeners;\n    },\n    set: function(arg) {\n      // check whether the input is a positive number (whose value is zero or\n      // greater and not a NaN).\n      if (typeof arg !== 'number' || arg < 0 || arg !== arg)\n        throw new TypeError('\"defaultMaxListeners\" must be a positive number');\n      defaultMaxListeners = arg;\n    }\n  });\n} else {\n  EventEmitter.defaultMaxListeners = defaultMaxListeners;\n}\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n  if (typeof n !== 'number' || n < 0 || isNaN(n))\n    throw new TypeError('\"n\" argument must be a positive number');\n  this._maxListeners = n;\n  return this;\n};\n\nfunction $getMaxListeners(that) {\n  if (that._maxListeners === undefined)\n    return EventEmitter.defaultMaxListeners;\n  return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n  return $getMaxListeners(this);\n};\n\n// These standalone emit* functions are used to optimize calling of event\n// handlers for fast cases because emit() itself often has a variable number of\n// arguments and can be deoptimized because of that. These functions always have\n// the same number of arguments and thus do not get deoptimized, so the code\n// inside them can execute faster.\nfunction emitNone(handler, isFn, self) {\n  if (isFn)\n    handler.call(self);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].call(self);\n  }\n}\nfunction emitOne(handler, isFn, self, arg1) {\n  if (isFn)\n    handler.call(self, arg1);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].call(self, arg1);\n  }\n}\nfunction emitTwo(handler, isFn, self, arg1, arg2) {\n  if (isFn)\n    handler.call(self, arg1, arg2);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].call(self, arg1, arg2);\n  }\n}\nfunction emitThree(handler, isFn, self, arg1, arg2, arg3) {\n  if (isFn)\n    handler.call(self, arg1, arg2, arg3);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].call(self, arg1, arg2, arg3);\n  }\n}\n\nfunction emitMany(handler, isFn, self, args) {\n  if (isFn)\n    handler.apply(self, args);\n  else {\n    var len = handler.length;\n    var listeners = arrayClone(handler, len);\n    for (var i = 0; i < len; ++i)\n      listeners[i].apply(self, args);\n  }\n}\n\nEventEmitter.prototype.emit = function emit(type) {\n  var er, handler, len, args, i, events;\n  var doError = (type === 'error');\n\n  events = this._events;\n  if (events)\n    doError = (doError && events.error == null);\n  else if (!doError)\n    return false;\n\n  // If there is no 'error' event listener then throw.\n  if (doError) {\n    if (arguments.length > 1)\n      er = arguments[1];\n    if (er instanceof Error) {\n      throw er; // Unhandled 'error' event\n    } else {\n      // At least give some kind of context to the user\n      var err = new Error('Unhandled \"error\" event. (' + er + ')');\n      err.context = er;\n      throw err;\n    }\n    return false;\n  }\n\n  handler = events[type];\n\n  if (!handler)\n    return false;\n\n  var isFn = typeof handler === 'function';\n  len = arguments.length;\n  switch (len) {\n      // fast cases\n    case 1:\n      emitNone(handler, isFn, this);\n      break;\n    case 2:\n      emitOne(handler, isFn, this, arguments[1]);\n      break;\n    case 3:\n      emitTwo(handler, isFn, this, arguments[1], arguments[2]);\n      break;\n    case 4:\n      emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);\n      break;\n      // slower\n    default:\n      args = new Array(len - 1);\n      for (i = 1; i < len; i++)\n        args[i - 1] = arguments[i];\n      emitMany(handler, isFn, this, args);\n  }\n\n  return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n  var m;\n  var events;\n  var existing;\n\n  if (typeof listener !== 'function')\n    throw new TypeError('\"listener\" argument must be a function');\n\n  events = target._events;\n  if (!events) {\n    events = target._events = objectCreate(null);\n    target._eventsCount = 0;\n  } else {\n    // To avoid recursion in the case that type === \"newListener\"! Before\n    // adding it to the listeners, first emit \"newListener\".\n    if (events.newListener) {\n      target.emit('newListener', type,\n          listener.listener ? listener.listener : listener);\n\n      // Re-assign `events` because a newListener handler could have caused the\n      // this._events to be assigned to a new object\n      events = target._events;\n    }\n    existing = events[type];\n  }\n\n  if (!existing) {\n    // Optimize the case of one listener. Don't need the extra array object.\n    existing = events[type] = listener;\n    ++target._eventsCount;\n  } else {\n    if (typeof existing === 'function') {\n      // Adding the second element, need to change to array.\n      existing = events[type] =\n          prepend ? [listener, existing] : [existing, listener];\n    } else {\n      // If we've already got an array, just append.\n      if (prepend) {\n        existing.unshift(listener);\n      } else {\n        existing.push(listener);\n      }\n    }\n\n    // Check for listener leak\n    if (!existing.warned) {\n      m = $getMaxListeners(target);\n      if (m && m > 0 && existing.length > m) {\n        existing.warned = true;\n        var w = new Error('Possible EventEmitter memory leak detected. ' +\n            existing.length + ' \"' + String(type) + '\" listeners ' +\n            'added. Use emitter.setMaxListeners() to ' +\n            'increase limit.');\n        w.name = 'MaxListenersExceededWarning';\n        w.emitter = target;\n        w.type = type;\n        w.count = existing.length;\n        if (typeof console === 'object' && console.warn) {\n          console.warn('%s: %s', w.name, w.message);\n        }\n      }\n    }\n  }\n\n  return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n  return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n    function prependListener(type, listener) {\n      return _addListener(this, type, listener, true);\n    };\n\nfunction onceWrapper() {\n  if (!this.fired) {\n    this.target.removeListener(this.type, this.wrapFn);\n    this.fired = true;\n    switch (arguments.length) {\n      case 0:\n        return this.listener.call(this.target);\n      case 1:\n        return this.listener.call(this.target, arguments[0]);\n      case 2:\n        return this.listener.call(this.target, arguments[0], arguments[1]);\n      case 3:\n        return this.listener.call(this.target, arguments[0], arguments[1],\n            arguments[2]);\n      default:\n        var args = new Array(arguments.length);\n        for (var i = 0; i < args.length; ++i)\n          args[i] = arguments[i];\n        this.listener.apply(this.target, args);\n    }\n  }\n}\n\nfunction _onceWrap(target, type, listener) {\n  var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n  var wrapped = bind.call(onceWrapper, state);\n  wrapped.listener = listener;\n  state.wrapFn = wrapped;\n  return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n  if (typeof listener !== 'function')\n    throw new TypeError('\"listener\" argument must be a function');\n  this.on(type, _onceWrap(this, type, listener));\n  return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n    function prependOnceListener(type, listener) {\n      if (typeof listener !== 'function')\n        throw new TypeError('\"listener\" argument must be a function');\n      this.prependListener(type, _onceWrap(this, type, listener));\n      return this;\n    };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n    function removeListener(type, listener) {\n      var list, events, position, i, originalListener;\n\n      if (typeof listener !== 'function')\n        throw new TypeError('\"listener\" argument must be a function');\n\n      events = this._events;\n      if (!events)\n        return this;\n\n      list = events[type];\n      if (!list)\n        return this;\n\n      if (list === listener || list.listener === listener) {\n        if (--this._eventsCount === 0)\n          this._events = objectCreate(null);\n        else {\n          delete events[type];\n          if (events.removeListener)\n            this.emit('removeListener', type, list.listener || listener);\n        }\n      } else if (typeof list !== 'function') {\n        position = -1;\n\n        for (i = list.length - 1; i >= 0; i--) {\n          if (list[i] === listener || list[i].listener === listener) {\n            originalListener = list[i].listener;\n            position = i;\n            break;\n          }\n        }\n\n        if (position < 0)\n          return this;\n\n        if (position === 0)\n          list.shift();\n        else\n          spliceOne(list, position);\n\n        if (list.length === 1)\n          events[type] = list[0];\n\n        if (events.removeListener)\n          this.emit('removeListener', type, originalListener || listener);\n      }\n\n      return this;\n    };\n\nEventEmitter.prototype.removeAllListeners =\n    function removeAllListeners(type) {\n      var listeners, events, i;\n\n      events = this._events;\n      if (!events)\n        return this;\n\n      // not listening for removeListener, no need to emit\n      if (!events.removeListener) {\n        if (arguments.length === 0) {\n          this._events = objectCreate(null);\n          this._eventsCount = 0;\n        } else if (events[type]) {\n          if (--this._eventsCount === 0)\n            this._events = objectCreate(null);\n          else\n            delete events[type];\n        }\n        return this;\n      }\n\n      // emit removeListener for all listeners on all events\n      if (arguments.length === 0) {\n        var keys = objectKeys(events);\n        var key;\n        for (i = 0; i < keys.length; ++i) {\n          key = keys[i];\n          if (key === 'removeListener') continue;\n          this.removeAllListeners(key);\n        }\n        this.removeAllListeners('removeListener');\n        this._events = objectCreate(null);\n        this._eventsCount = 0;\n        return this;\n      }\n\n      listeners = events[type];\n\n      if (typeof listeners === 'function') {\n        this.removeListener(type, listeners);\n      } else if (listeners) {\n        // LIFO order\n        for (i = listeners.length - 1; i >= 0; i--) {\n          this.removeListener(type, listeners[i]);\n        }\n      }\n\n      return this;\n    };\n\nfunction _listeners(target, type, unwrap) {\n  var events = target._events;\n\n  if (!events)\n    return [];\n\n  var evlistener = events[type];\n  if (!evlistener)\n    return [];\n\n  if (typeof evlistener === 'function')\n    return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n  return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n  return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n  return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n  if (typeof emitter.listenerCount === 'function') {\n    return emitter.listenerCount(type);\n  } else {\n    return listenerCount.call(emitter, type);\n  }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n  var events = this._events;\n\n  if (events) {\n    var evlistener = events[type];\n\n    if (typeof evlistener === 'function') {\n      return 1;\n    } else if (evlistener) {\n      return evlistener.length;\n    }\n  }\n\n  return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n  return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];\n};\n\n// About 1.5x faster than the two-arg version of Array#splice().\nfunction spliceOne(list, index) {\n  for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)\n    list[i] = list[k];\n  list.pop();\n}\n\nfunction arrayClone(arr, n) {\n  var copy = new Array(n);\n  for (var i = 0; i < n; ++i)\n    copy[i] = arr[i];\n  return copy;\n}\n\nfunction unwrapListeners(arr) {\n  var ret = new Array(arr.length);\n  for (var i = 0; i < ret.length; ++i) {\n    ret[i] = arr[i].listener || arr[i];\n  }\n  return ret;\n}\n\nfunction objectCreatePolyfill(proto) {\n  var F = function() {};\n  F.prototype = proto;\n  return new F;\n}\nfunction objectKeysPolyfill(obj) {\n  var keys = [];\n  for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) {\n    keys.push(k);\n  }\n  return k;\n}\nfunction functionBindPolyfill(context) {\n  var fn = this;\n  return function () {\n    return fn.apply(context, arguments);\n  };\n}\n\n},{}],21:[function(require,module,exports){\n'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n    for (var i = 0, len = array.length; i < len; i++) {\n        if (hasOwnProperty.call(array, i)) {\n            if (receiver == null) {\n                iterator(array[i], i, array);\n            } else {\n                iterator.call(receiver, array[i], i, array);\n            }\n        }\n    }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n    for (var i = 0, len = string.length; i < len; i++) {\n        // no such thing as a sparse string.\n        if (receiver == null) {\n            iterator(string.charAt(i), i, string);\n        } else {\n            iterator.call(receiver, string.charAt(i), i, string);\n        }\n    }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n    for (var k in object) {\n        if (hasOwnProperty.call(object, k)) {\n            if (receiver == null) {\n                iterator(object[k], k, object);\n            } else {\n                iterator.call(receiver, object[k], k, object);\n            }\n        }\n    }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n    if (!isCallable(iterator)) {\n        throw new TypeError('iterator must be a function');\n    }\n\n    var receiver;\n    if (arguments.length >= 3) {\n        receiver = thisArg;\n    }\n\n    if (toStr.call(list) === '[object Array]') {\n        forEachArray(list, iterator, receiver);\n    } else if (typeof list === 'string') {\n        forEachString(list, iterator, receiver);\n    } else {\n        forEachObject(list, iterator, receiver);\n    }\n};\n\nmodule.exports = forEach;\n\n},{\"is-callable\":28}],22:[function(require,module,exports){\n'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n    var target = this;\n    if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n        throw new TypeError(ERROR_MESSAGE + target);\n    }\n    var args = slice.call(arguments, 1);\n\n    var bound;\n    var binder = function () {\n        if (this instanceof bound) {\n            var result = target.apply(\n                this,\n                args.concat(slice.call(arguments))\n            );\n            if (Object(result) === result) {\n                return result;\n            }\n            return this;\n        } else {\n            return target.apply(\n                that,\n                args.concat(slice.call(arguments))\n            );\n        }\n    };\n\n    var boundLength = Math.max(0, target.length - args.length);\n    var boundArgs = [];\n    for (var i = 0; i < boundLength; i++) {\n        boundArgs.push('$' + i);\n    }\n\n    bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n    if (target.prototype) {\n        var Empty = function Empty() {};\n        Empty.prototype = target.prototype;\n        bound.prototype = new Empty();\n        Empty.prototype = null;\n    }\n\n    return bound;\n};\n\n},{}],23:[function(require,module,exports){\n'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n\n},{\"./implementation\":22}],24:[function(require,module,exports){\n'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n\n},{\"function-bind\":23}],25:[function(require,module,exports){\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n  var e, m\n  var eLen = (nBytes * 8) - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var nBits = -7\n  var i = isLE ? (nBytes - 1) : 0\n  var d = isLE ? -1 : 1\n  var s = buffer[offset + i]\n\n  i += d\n\n  e = s & ((1 << (-nBits)) - 1)\n  s >>= (-nBits)\n  nBits += eLen\n  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n  m = e & ((1 << (-nBits)) - 1)\n  e >>= (-nBits)\n  nBits += mLen\n  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n  if (e === 0) {\n    e = 1 - eBias\n  } else if (e === eMax) {\n    return m ? NaN : ((s ? -1 : 1) * Infinity)\n  } else {\n    m = m + Math.pow(2, mLen)\n    e = e - eBias\n  }\n  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n  var e, m, c\n  var eLen = (nBytes * 8) - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n  var i = isLE ? 0 : (nBytes - 1)\n  var d = isLE ? 1 : -1\n  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n  value = Math.abs(value)\n\n  if (isNaN(value) || value === Infinity) {\n    m = isNaN(value) ? 1 : 0\n    e = eMax\n  } else {\n    e = Math.floor(Math.log(value) / Math.LN2)\n    if (value * (c = Math.pow(2, -e)) < 1) {\n      e--\n      c *= 2\n    }\n    if (e + eBias >= 1) {\n      value += rt / c\n    } else {\n      value += rt * Math.pow(2, 1 - eBias)\n    }\n    if (value * c >= 2) {\n      e++\n      c /= 2\n    }\n\n    if (e + eBias >= eMax) {\n      m = 0\n      e = eMax\n    } else if (e + eBias >= 1) {\n      m = ((value * c) - 1) * Math.pow(2, mLen)\n      e = e + eBias\n    } else {\n      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n      e = 0\n    }\n  }\n\n  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n  e = (e << mLen) | m\n  eLen += mLen\n  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n  buffer[offset + i - d] |= s * 128\n}\n\n},{}],26:[function(require,module,exports){\nif (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    var TempCtor = function () {}\n    TempCtor.prototype = superCtor.prototype\n    ctor.prototype = new TempCtor()\n    ctor.prototype.constructor = ctor\n  }\n}\n\n},{}],27:[function(require,module,exports){\n/*!\n * Determine if an object is a Buffer\n *\n * @author   Feross Aboukhadijeh <https://feross.org>\n * @license  MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n  return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n  return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n  return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n\n},{}],28:[function(require,module,exports){\n'use strict';\n\nvar fnToStr = Function.prototype.toString;\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';\n\nmodule.exports = function isCallable(value) {\n\tif (!value) { return false; }\n\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\tif (typeof value === 'function' && !value.prototype) { return true; }\n\tif (hasToStringTag) { return tryFunctionObject(value); }\n\tif (isES6ClassFn(value)) { return false; }\n\tvar strClass = toStr.call(value);\n\treturn strClass === fnClass || strClass === genClass;\n};\n\n},{}],29:[function(require,module,exports){\nvar toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n  return toString.call(arr) == '[object Array]';\n};\n\n},{}],30:[function(require,module,exports){\nvar hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\n\nvar inspectCustom = require('./util.inspect').custom;\nvar inspectSymbol = (inspectCustom && isSymbol(inspectCustom)) ? inspectCustom : null;\n\nmodule.exports = function inspect_ (obj, opts, depth, seen) {\n    if (!opts) opts = {};\n\n    if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n        throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n    }\n\n    if (typeof obj === 'undefined') {\n        return 'undefined';\n    }\n    if (obj === null) {\n        return 'null';\n    }\n    if (typeof obj === 'boolean') {\n        return obj ? 'true' : 'false';\n    }\n\n    if (typeof obj === 'string') {\n        return inspectString(obj, opts);\n    }\n    if (typeof obj === 'number') {\n      if (obj === 0) {\n        return Infinity / obj > 0 ? '0' : '-0';\n      }\n      return String(obj);\n    }\n    if (typeof obj === 'bigint') {\n      return String(obj) + 'n';\n    }\n\n    var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n    if (typeof depth === 'undefined') depth = 0;\n    if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n        return '[Object]';\n    }\n\n    if (typeof seen === 'undefined') seen = [];\n    else if (indexOf(seen, obj) >= 0) {\n        return '[Circular]';\n    }\n\n    function inspect (value, from) {\n        if (from) {\n            seen = seen.slice();\n            seen.push(from);\n        }\n        return inspect_(value, opts, depth + 1, seen);\n    }\n\n    if (typeof obj === 'function') {\n        var name = nameOf(obj);\n        return '[Function' + (name ? ': ' + name : '') + ']';\n    }\n    if (isSymbol(obj)) {\n        var symString = Symbol.prototype.toString.call(obj);\n        return typeof obj === 'object' ? markBoxed(symString) : symString;\n    }\n    if (isElement(obj)) {\n        var s = '<' + String(obj.nodeName).toLowerCase();\n        var attrs = obj.attributes || [];\n        for (var i = 0; i < attrs.length; i++) {\n            s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n        }\n        s += '>';\n        if (obj.childNodes && obj.childNodes.length) s += '...';\n        s += '</' + String(obj.nodeName).toLowerCase() + '>';\n        return s;\n    }\n    if (isArray(obj)) {\n        if (obj.length === 0) return '[]';\n        return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]';\n    }\n    if (isError(obj)) {\n        var parts = arrObjKeys(obj, inspect);\n        if (parts.length === 0) return '[' + String(obj) + ']';\n        return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';\n    }\n    if (typeof obj === 'object') {\n        if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {\n            return obj[inspectSymbol]();\n        } else if (typeof obj.inspect === 'function') {\n            return obj.inspect();\n        }\n    }\n    if (isMap(obj)) {\n        var parts = [];\n        mapForEach.call(obj, function (value, key) {\n            parts.push(inspect(key, obj) + ' => ' + inspect(value, obj));\n        });\n        return collectionOf('Map', mapSize.call(obj), parts);\n    }\n    if (isSet(obj)) {\n        var parts = [];\n        setForEach.call(obj, function (value ) {\n            parts.push(inspect(value, obj));\n        });\n        return collectionOf('Set', setSize.call(obj), parts);\n    }\n    if (isNumber(obj)) {\n        return markBoxed(inspect(Number(obj)));\n    }\n    if (isBigInt(obj)) {\n        return markBoxed(inspect(bigIntValueOf.call(obj)));\n    }\n    if (isBoolean(obj)) {\n        return markBoxed(booleanValueOf.call(obj));\n    }\n    if (isString(obj)) {\n        return markBoxed(inspect(String(obj)));\n    }\n    if (!isDate(obj) && !isRegExp(obj)) {\n        var xs = arrObjKeys(obj, inspect);\n        if (xs.length === 0) return '{}';\n        return '{ ' + xs.join(', ') + ' }';\n    }\n    return String(obj);\n};\n\nfunction wrapQuotes (s, defaultStyle, opts) {\n    var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n    return quoteChar + s + quoteChar;\n}\n\nfunction quote (s) {\n    return String(s).replace(/\"/g, '&quot;');\n}\n\nfunction isArray (obj) { return toStr(obj) === '[object Array]'; }\nfunction isDate (obj) { return toStr(obj) === '[object Date]'; }\nfunction isRegExp (obj) { return toStr(obj) === '[object RegExp]'; }\nfunction isError (obj) { return toStr(obj) === '[object Error]'; }\nfunction isSymbol (obj) { return toStr(obj) === '[object Symbol]'; }\nfunction isString (obj) { return toStr(obj) === '[object String]'; }\nfunction isNumber (obj) { return toStr(obj) === '[object Number]'; }\nfunction isBigInt (obj) { return toStr(obj) === '[object BigInt]'; }\nfunction isBoolean (obj) { return toStr(obj) === '[object Boolean]'; }\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has (obj, key) {\n    return hasOwn.call(obj, key);\n}\n\nfunction toStr (obj) {\n    return objectToString.call(obj);\n}\n\nfunction nameOf (f) {\n    if (f.name) return f.name;\n    var m = String(f).match(/^function\\s*([\\w$]+)/);\n    if (m) return m[1];\n}\n\nfunction indexOf (xs, x) {\n    if (xs.indexOf) return xs.indexOf(x);\n    for (var i = 0, l = xs.length; i < l; i++) {\n        if (xs[i] === x) return i;\n    }\n    return -1;\n}\n\nfunction isMap (x) {\n    if (!mapSize) {\n        return false;\n    }\n    try {\n        mapSize.call(x);\n        try {\n            setSize.call(x);\n        } catch (s) {\n            return true;\n        }\n        return x instanceof Map; // core-js workaround, pre-v2.5.0\n    } catch (e) {}\n    return false;\n}\n\nfunction isSet (x) {\n    if (!setSize) {\n        return false;\n    }\n    try {\n        setSize.call(x);\n        try {\n            mapSize.call(x);\n        } catch (m) {\n            return true;\n        }\n        return x instanceof Set; // core-js workaround, pre-v2.5.0\n    } catch (e) {}\n    return false;\n}\n\nfunction isElement (x) {\n    if (!x || typeof x !== 'object') return false;\n    if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n        return true;\n    }\n    return typeof x.nodeName === 'string'\n        && typeof x.getAttribute === 'function'\n    ;\n}\n\nfunction inspectString (str, opts) {\n    var s = str.replace(/(['\\\\])/g, '\\\\$1').replace(/[\\x00-\\x1f]/g, lowbyte);\n    return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte (c) {\n    var n = c.charCodeAt(0);\n    var x = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[n];\n    if (x) return '\\\\' + x;\n    return '\\\\x' + (n < 0x10 ? '0' : '') + n.toString(16);\n}\n\nfunction markBoxed (str) {\n    return 'Object(' + str + ')';\n}\n\nfunction collectionOf (type, size, entries) {\n    return type + ' (' + size + ') {' + entries.join(', ') + '}';\n}\n\nfunction arrObjKeys (obj, inspect) {\n    var isArr = isArray(obj);\n    var xs = [];\n    if (isArr) {\n        xs.length = obj.length;\n        for (var i = 0; i < obj.length; i++) {\n            xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n        }\n    }\n    for (var key in obj) {\n        if (!has(obj, key)) continue;\n        if (isArr && String(Number(key)) === key && key < obj.length) continue;\n        if (/[^\\w$]/.test(key)) {\n            xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n        } else {\n            xs.push(key + ': ' + inspect(obj[key], obj));\n        }\n    }\n    return xs;\n}\n\n},{\"./util.inspect\":2}],31:[function(require,module,exports){\n'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n\n},{\"./isArguments\":33}],32:[function(require,module,exports){\n'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n\n},{\"./implementation\":31,\"./isArguments\":33}],33:[function(require,module,exports){\n'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n\n},{}],34:[function(require,module,exports){\n(function (process){\n// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n  // if the path tries to go above the root, `up` ends up > 0\n  var up = 0;\n  for (var i = parts.length - 1; i >= 0; i--) {\n    var last = parts[i];\n    if (last === '.') {\n      parts.splice(i, 1);\n    } else if (last === '..') {\n      parts.splice(i, 1);\n      up++;\n    } else if (up) {\n      parts.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (allowAboveRoot) {\n    for (; up--; up) {\n      parts.unshift('..');\n    }\n  }\n\n  return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n  var resolvedPath = '',\n      resolvedAbsolute = false;\n\n  for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n    var path = (i >= 0) ? arguments[i] : process.cwd();\n\n    // Skip empty and invalid entries\n    if (typeof path !== 'string') {\n      throw new TypeError('Arguments to path.resolve must be strings');\n    } else if (!path) {\n      continue;\n    }\n\n    resolvedPath = path + '/' + resolvedPath;\n    resolvedAbsolute = path.charAt(0) === '/';\n  }\n\n  // At this point the path should be resolved to a full absolute path, but\n  // handle relative paths to be safe (might happen when process.cwd() fails)\n\n  // Normalize the path\n  resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n    return !!p;\n  }), !resolvedAbsolute).join('/');\n\n  return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n  var isAbsolute = exports.isAbsolute(path),\n      trailingSlash = substr(path, -1) === '/';\n\n  // Normalize the path\n  path = normalizeArray(filter(path.split('/'), function(p) {\n    return !!p;\n  }), !isAbsolute).join('/');\n\n  if (!path && !isAbsolute) {\n    path = '.';\n  }\n  if (path && trailingSlash) {\n    path += '/';\n  }\n\n  return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n  return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n  var paths = Array.prototype.slice.call(arguments, 0);\n  return exports.normalize(filter(paths, function(p, index) {\n    if (typeof p !== 'string') {\n      throw new TypeError('Arguments to path.join must be strings');\n    }\n    return p;\n  }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n  from = exports.resolve(from).substr(1);\n  to = exports.resolve(to).substr(1);\n\n  function trim(arr) {\n    var start = 0;\n    for (; start < arr.length; start++) {\n      if (arr[start] !== '') break;\n    }\n\n    var end = arr.length - 1;\n    for (; end >= 0; end--) {\n      if (arr[end] !== '') break;\n    }\n\n    if (start > end) return [];\n    return arr.slice(start, end - start + 1);\n  }\n\n  var fromParts = trim(from.split('/'));\n  var toParts = trim(to.split('/'));\n\n  var length = Math.min(fromParts.length, toParts.length);\n  var samePartsLength = length;\n  for (var i = 0; i < length; i++) {\n    if (fromParts[i] !== toParts[i]) {\n      samePartsLength = i;\n      break;\n    }\n  }\n\n  var outputParts = [];\n  for (var i = samePartsLength; i < fromParts.length; i++) {\n    outputParts.push('..');\n  }\n\n  outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n  return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n  if (typeof path !== 'string') path = path + '';\n  if (path.length === 0) return '.';\n  var code = path.charCodeAt(0);\n  var hasRoot = code === 47 /*/*/;\n  var end = -1;\n  var matchedSlash = true;\n  for (var i = path.length - 1; i >= 1; --i) {\n    code = path.charCodeAt(i);\n    if (code === 47 /*/*/) {\n        if (!matchedSlash) {\n          end = i;\n          break;\n        }\n      } else {\n      // We saw the first non-path separator\n      matchedSlash = false;\n    }\n  }\n\n  if (end === -1) return hasRoot ? '/' : '.';\n  if (hasRoot && end === 1) {\n    // return '//';\n    // Backwards-compat fix:\n    return '/';\n  }\n  return path.slice(0, end);\n};\n\nfunction basename(path) {\n  if (typeof path !== 'string') path = path + '';\n\n  var start = 0;\n  var end = -1;\n  var matchedSlash = true;\n  var i;\n\n  for (i = path.length - 1; i >= 0; --i) {\n    if (path.charCodeAt(i) === 47 /*/*/) {\n        // If we reached a path separator that was not part of a set of path\n        // separators at the end of the string, stop now\n        if (!matchedSlash) {\n          start = i + 1;\n          break;\n        }\n      } else if (end === -1) {\n      // We saw the first non-path separator, mark this as the end of our\n      // path component\n      matchedSlash = false;\n      end = i + 1;\n    }\n  }\n\n  if (end === -1) return '';\n  return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n  var f = basename(path);\n  if (ext && f.substr(-1 * ext.length) === ext) {\n    f = f.substr(0, f.length - ext.length);\n  }\n  return f;\n};\n\nexports.extname = function (path) {\n  if (typeof path !== 'string') path = path + '';\n  var startDot = -1;\n  var startPart = 0;\n  var end = -1;\n  var matchedSlash = true;\n  // Track the state of characters (if any) we see before our first dot and\n  // after any path separator we find\n  var preDotState = 0;\n  for (var i = path.length - 1; i >= 0; --i) {\n    var code = path.charCodeAt(i);\n    if (code === 47 /*/*/) {\n        // If we reached a path separator that was not part of a set of path\n        // separators at the end of the string, stop now\n        if (!matchedSlash) {\n          startPart = i + 1;\n          break;\n        }\n        continue;\n      }\n    if (end === -1) {\n      // We saw the first non-path separator, mark this as the end of our\n      // extension\n      matchedSlash = false;\n      end = i + 1;\n    }\n    if (code === 46 /*.*/) {\n        // If this is our first dot, mark it as the start of our extension\n        if (startDot === -1)\n          startDot = i;\n        else if (preDotState !== 1)\n          preDotState = 1;\n    } else if (startDot !== -1) {\n      // We saw a non-dot and non-path separator before our dot, so we should\n      // have a good chance at having a non-empty extension\n      preDotState = -1;\n    }\n  }\n\n  if (startDot === -1 || end === -1 ||\n      // We saw a non-dot character immediately before the dot\n      preDotState === 0 ||\n      // The (right-most) trimmed path component is exactly '..'\n      preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n    return '';\n  }\n  return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n    if (xs.filter) return xs.filter(f);\n    var res = [];\n    for (var i = 0; i < xs.length; i++) {\n        if (f(xs[i], i, xs)) res.push(xs[i]);\n    }\n    return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n    ? function (str, start, len) { return str.substr(start, len) }\n    : function (str, start, len) {\n        if (start < 0) start = str.length + start;\n        return str.substr(start, len);\n    }\n;\n\n}).call(this,require('_process'))\n},{\"_process\":36}],35:[function(require,module,exports){\n(function (process){\n'use strict';\n\nif (!process.version ||\n    process.version.indexOf('v0.') === 0 ||\n    process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n  module.exports = { nextTick: nextTick };\n} else {\n  module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n  if (typeof fn !== 'function') {\n    throw new TypeError('\"callback\" argument must be a function');\n  }\n  var len = arguments.length;\n  var args, i;\n  switch (len) {\n  case 0:\n  case 1:\n    return process.nextTick(fn);\n  case 2:\n    return process.nextTick(function afterTickOne() {\n      fn.call(null, arg1);\n    });\n  case 3:\n    return process.nextTick(function afterTickTwo() {\n      fn.call(null, arg1, arg2);\n    });\n  case 4:\n    return process.nextTick(function afterTickThree() {\n      fn.call(null, arg1, arg2, arg3);\n    });\n  default:\n    args = new Array(len - 1);\n    i = 0;\n    while (i < args.length) {\n      args[i++] = arguments[i];\n    }\n    return process.nextTick(function afterTick() {\n      fn.apply(null, args);\n    });\n  }\n}\n\n\n}).call(this,require('_process'))\n},{\"_process\":36}],36:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\n(function () {\n    try {\n        if (typeof setTimeout === 'function') {\n            cachedSetTimeout = setTimeout;\n        } else {\n            cachedSetTimeout = defaultSetTimout;\n        }\n    } catch (e) {\n        cachedSetTimeout = defaultSetTimout;\n    }\n    try {\n        if (typeof clearTimeout === 'function') {\n            cachedClearTimeout = clearTimeout;\n        } else {\n            cachedClearTimeout = defaultClearTimeout;\n        }\n    } catch (e) {\n        cachedClearTimeout = defaultClearTimeout;\n    }\n} ())\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],37:[function(require,module,exports){\nmodule.exports = require('./lib/_stream_duplex.js');\n\n},{\"./lib/_stream_duplex.js\":38}],38:[function(require,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n  var keys = [];\n  for (var key in obj) {\n    keys.push(key);\n  }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\n{\n  // avoid scope creep, the keys array can then be collected\n  var keys = objectKeys(Writable.prototype);\n  for (var v = 0; v < keys.length; v++) {\n    var method = keys[v];\n    if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n  }\n}\n\nfunction Duplex(options) {\n  if (!(this instanceof Duplex)) return new Duplex(options);\n\n  Readable.call(this, options);\n  Writable.call(this, options);\n\n  if (options && options.readable === false) this.readable = false;\n\n  if (options && options.writable === false) this.writable = false;\n\n  this.allowHalfOpen = true;\n  if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n  this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n  // making it explicit this property is not enumerable\n  // because otherwise some prototype manipulation in\n  // userland will fail\n  enumerable: false,\n  get: function () {\n    return this._writableState.highWaterMark;\n  }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n  // if we allow half-open state, or if the writable side ended,\n  // then we're ok.\n  if (this.allowHalfOpen || this._writableState.ended) return;\n\n  // no more data can be written.\n  // But allow more writes to happen in this tick.\n  pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n  self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n  get: function () {\n    if (this._readableState === undefined || this._writableState === undefined) {\n      return false;\n    }\n    return this._readableState.destroyed && this._writableState.destroyed;\n  },\n  set: function (value) {\n    // we ignore the value if the stream\n    // has not been initialized yet\n    if (this._readableState === undefined || this._writableState === undefined) {\n      return;\n    }\n\n    // backward compatibility, the user is explicitly\n    // managing destroyed\n    this._readableState.destroyed = value;\n    this._writableState.destroyed = value;\n  }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n  this.push(null);\n  this.end();\n\n  pna.nextTick(cb, err);\n};\n},{\"./_stream_readable\":40,\"./_stream_writable\":42,\"core-util-is\":5,\"inherits\":26,\"process-nextick-args\":35}],39:[function(require,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n  if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n  Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n  cb(null, chunk);\n};\n},{\"./_stream_transform\":41,\"core-util-is\":5,\"inherits\":26}],40:[function(require,module,exports){\n(function (process,global){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = require('isarray');\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n  return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n  return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n  debug = debugUtil.debuglog('stream');\n} else {\n  debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar destroyImpl = require('./internal/streams/destroy');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n  // Sadly this is not cacheable as some libraries bundle their own\n  // event emitter implementation with them.\n  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n  // This is a hack to make sure that our error handler is attached before any\n  // userland ones.  NEVER DO THIS. This is here only because this code needs\n  // to continue to work with older versions of Node.js that do not include\n  // the prependListener() method. The goal is to eventually remove this hack.\n  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n  Duplex = Duplex || require('./_stream_duplex');\n\n  options = options || {};\n\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream.\n  // These options can be provided separately as readableXXX and writableXXX.\n  var isDuplex = stream instanceof Duplex;\n\n  // object stream flag. Used to make read(n) ignore n and to\n  // make all the buffer merging and length checks go away\n  this.objectMode = !!options.objectMode;\n\n  if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n  // the point at which it stops calling _read() to fill the buffer\n  // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n  var hwm = options.highWaterMark;\n  var readableHwm = options.readableHighWaterMark;\n  var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n  // cast to ints.\n  this.highWaterMark = Math.floor(this.highWaterMark);\n\n  // A linked list is used to store data chunks instead of an array because the\n  // linked list can remove elements from the beginning faster than\n  // array.shift()\n  this.buffer = new BufferList();\n  this.length = 0;\n  this.pipes = null;\n  this.pipesCount = 0;\n  this.flowing = null;\n  this.ended = false;\n  this.endEmitted = false;\n  this.reading = false;\n\n  // a flag to be able to tell if the event 'readable'/'data' is emitted\n  // immediately, or on a later tick.  We set this to true at first, because\n  // any actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first read call.\n  this.sync = true;\n\n  // whenever we return null, then we set a flag to say\n  // that we're awaiting a 'readable' event emission.\n  this.needReadable = false;\n  this.emittedReadable = false;\n  this.readableListening = false;\n  this.resumeScheduled = false;\n\n  // has it been destroyed\n  this.destroyed = false;\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n  // the number of writers that are awaiting a drain event in .pipe()s\n  this.awaitDrain = 0;\n\n  // if true, a maybeReadMore has been scheduled\n  this.readingMore = false;\n\n  this.decoder = null;\n  this.encoding = null;\n  if (options.encoding) {\n    if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n    this.decoder = new StringDecoder(options.encoding);\n    this.encoding = options.encoding;\n  }\n}\n\nfunction Readable(options) {\n  Duplex = Duplex || require('./_stream_duplex');\n\n  if (!(this instanceof Readable)) return new Readable(options);\n\n  this._readableState = new ReadableState(options, this);\n\n  // legacy\n  this.readable = true;\n\n  if (options) {\n    if (typeof options.read === 'function') this._read = options.read;\n\n    if (typeof options.destroy === 'function') this._destroy = options.destroy;\n  }\n\n  Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n  get: function () {\n    if (this._readableState === undefined) {\n      return false;\n    }\n    return this._readableState.destroyed;\n  },\n  set: function (value) {\n    // we ignore the value if the stream\n    // has not been initialized yet\n    if (!this._readableState) {\n      return;\n    }\n\n    // backward compatibility, the user is explicitly\n    // managing destroyed\n    this._readableState.destroyed = value;\n  }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n  this.push(null);\n  cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n  var state = this._readableState;\n  var skipChunkCheck;\n\n  if (!state.objectMode) {\n    if (typeof chunk === 'string') {\n      encoding = encoding || state.defaultEncoding;\n      if (encoding !== state.encoding) {\n        chunk = Buffer.from(chunk, encoding);\n        encoding = '';\n      }\n      skipChunkCheck = true;\n    }\n  } else {\n    skipChunkCheck = true;\n  }\n\n  return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n  return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n  var state = stream._readableState;\n  if (chunk === null) {\n    state.reading = false;\n    onEofChunk(stream, state);\n  } else {\n    var er;\n    if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n    if (er) {\n      stream.emit('error', er);\n    } else if (state.objectMode || chunk && chunk.length > 0) {\n      if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n        chunk = _uint8ArrayToBuffer(chunk);\n      }\n\n      if (addToFront) {\n        if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n      } else if (state.ended) {\n        stream.emit('error', new Error('stream.push() after EOF'));\n      } else {\n        state.reading = false;\n        if (state.decoder && !encoding) {\n          chunk = state.decoder.write(chunk);\n          if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n        } else {\n          addChunk(stream, state, chunk, false);\n        }\n      }\n    } else if (!addToFront) {\n      state.reading = false;\n    }\n  }\n\n  return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n  if (state.flowing && state.length === 0 && !state.sync) {\n    stream.emit('data', chunk);\n    stream.read(0);\n  } else {\n    // update the buffer info.\n    state.length += state.objectMode ? 1 : chunk.length;\n    if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n    if (state.needReadable) emitReadable(stream);\n  }\n  maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n  var er;\n  if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n    er = new TypeError('Invalid non-string/buffer chunk');\n  }\n  return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes.  This is to work around cases where hwm=0,\n// such as the repl.  Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n  return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n  return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n  if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n  this._readableState.decoder = new StringDecoder(enc);\n  this._readableState.encoding = enc;\n  return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n  if (n >= MAX_HWM) {\n    n = MAX_HWM;\n  } else {\n    // Get the next highest power of 2 to prevent increasing hwm excessively in\n    // tiny amounts\n    n--;\n    n |= n >>> 1;\n    n |= n >>> 2;\n    n |= n >>> 4;\n    n |= n >>> 8;\n    n |= n >>> 16;\n    n++;\n  }\n  return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n  if (n <= 0 || state.length === 0 && state.ended) return 0;\n  if (state.objectMode) return 1;\n  if (n !== n) {\n    // Only flow one buffer at a time\n    if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n  }\n  // If we're asking for more than the current hwm, then raise the hwm.\n  if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n  if (n <= state.length) return n;\n  // Don't have enough\n  if (!state.ended) {\n    state.needReadable = true;\n    return 0;\n  }\n  return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n  debug('read', n);\n  n = parseInt(n, 10);\n  var state = this._readableState;\n  var nOrig = n;\n\n  if (n !== 0) state.emittedReadable = false;\n\n  // if we're doing read(0) to trigger a readable event, but we\n  // already have a bunch of data in the buffer, then just trigger\n  // the 'readable' event and move on.\n  if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n    debug('read: emitReadable', state.length, state.ended);\n    if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n    return null;\n  }\n\n  n = howMuchToRead(n, state);\n\n  // if we've ended, and we're now clear, then finish it up.\n  if (n === 0 && state.ended) {\n    if (state.length === 0) endReadable(this);\n    return null;\n  }\n\n  // All the actual chunk generation logic needs to be\n  // *below* the call to _read.  The reason is that in certain\n  // synthetic stream cases, such as passthrough streams, _read\n  // may be a completely synchronous operation which may change\n  // the state of the read buffer, providing enough data when\n  // before there was *not* enough.\n  //\n  // So, the steps are:\n  // 1. Figure out what the state of things will be after we do\n  // a read from the buffer.\n  //\n  // 2. If that resulting state will trigger a _read, then call _read.\n  // Note that this may be asynchronous, or synchronous.  Yes, it is\n  // deeply ugly to write APIs this way, but that still doesn't mean\n  // that the Readable class should behave improperly, as streams are\n  // designed to be sync/async agnostic.\n  // Take note if the _read call is sync or async (ie, if the read call\n  // has returned yet), so that we know whether or not it's safe to emit\n  // 'readable' etc.\n  //\n  // 3. Actually pull the requested chunks out of the buffer and return.\n\n  // if we need a readable event, then we need to do some reading.\n  var doRead = state.needReadable;\n  debug('need readable', doRead);\n\n  // if we currently have less than the highWaterMark, then also read some\n  if (state.length === 0 || state.length - n < state.highWaterMark) {\n    doRead = true;\n    debug('length less than watermark', doRead);\n  }\n\n  // however, if we've ended, then there's no point, and if we're already\n  // reading, then it's unnecessary.\n  if (state.ended || state.reading) {\n    doRead = false;\n    debug('reading or ended', doRead);\n  } else if (doRead) {\n    debug('do read');\n    state.reading = true;\n    state.sync = true;\n    // if the length is currently zero, then we *need* a readable event.\n    if (state.length === 0) state.needReadable = true;\n    // call internal read method\n    this._read(state.highWaterMark);\n    state.sync = false;\n    // If _read pushed data synchronously, then `reading` will be false,\n    // and we need to re-evaluate how much data we can return to the user.\n    if (!state.reading) n = howMuchToRead(nOrig, state);\n  }\n\n  var ret;\n  if (n > 0) ret = fromList(n, state);else ret = null;\n\n  if (ret === null) {\n    state.needReadable = true;\n    n = 0;\n  } else {\n    state.length -= n;\n  }\n\n  if (state.length === 0) {\n    // If we have nothing in the buffer, then we want to know\n    // as soon as we *do* get something into the buffer.\n    if (!state.ended) state.needReadable = true;\n\n    // If we tried to read() past the EOF, then emit end on the next tick.\n    if (nOrig !== n && state.ended) endReadable(this);\n  }\n\n  if (ret !== null) this.emit('data', ret);\n\n  return ret;\n};\n\nfunction onEofChunk(stream, state) {\n  if (state.ended) return;\n  if (state.decoder) {\n    var chunk = state.decoder.end();\n    if (chunk && chunk.length) {\n      state.buffer.push(chunk);\n      state.length += state.objectMode ? 1 : chunk.length;\n    }\n  }\n  state.ended = true;\n\n  // emit 'readable' now to make sure it gets picked up.\n  emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow.  This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n  var state = stream._readableState;\n  state.needReadable = false;\n  if (!state.emittedReadable) {\n    debug('emitReadable', state.flowing);\n    state.emittedReadable = true;\n    if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n  }\n}\n\nfunction emitReadable_(stream) {\n  debug('emit readable');\n  stream.emit('readable');\n  flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data.  that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n  if (!state.readingMore) {\n    state.readingMore = true;\n    pna.nextTick(maybeReadMore_, stream, state);\n  }\n}\n\nfunction maybeReadMore_(stream, state) {\n  var len = state.length;\n  while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n    debug('maybeReadMore read 0');\n    stream.read(0);\n    if (len === state.length)\n      // didn't get any data, stop spinning.\n      break;else len = state.length;\n  }\n  state.readingMore = false;\n}\n\n// abstract method.  to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n  this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n  var src = this;\n  var state = this._readableState;\n\n  switch (state.pipesCount) {\n    case 0:\n      state.pipes = dest;\n      break;\n    case 1:\n      state.pipes = [state.pipes, dest];\n      break;\n    default:\n      state.pipes.push(dest);\n      break;\n  }\n  state.pipesCount += 1;\n  debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n  var endFn = doEnd ? onend : unpipe;\n  if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n  dest.on('unpipe', onunpipe);\n  function onunpipe(readable, unpipeInfo) {\n    debug('onunpipe');\n    if (readable === src) {\n      if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n        unpipeInfo.hasUnpiped = true;\n        cleanup();\n      }\n    }\n  }\n\n  function onend() {\n    debug('onend');\n    dest.end();\n  }\n\n  // when the dest drains, it reduces the awaitDrain counter\n  // on the source.  This would be more elegant with a .once()\n  // handler in flow(), but adding and removing repeatedly is\n  // too slow.\n  var ondrain = pipeOnDrain(src);\n  dest.on('drain', ondrain);\n\n  var cleanedUp = false;\n  function cleanup() {\n    debug('cleanup');\n    // cleanup event handlers once the pipe is broken\n    dest.removeListener('close', onclose);\n    dest.removeListener('finish', onfinish);\n    dest.removeListener('drain', ondrain);\n    dest.removeListener('error', onerror);\n    dest.removeListener('unpipe', onunpipe);\n    src.removeListener('end', onend);\n    src.removeListener('end', unpipe);\n    src.removeListener('data', ondata);\n\n    cleanedUp = true;\n\n    // if the reader is waiting for a drain event from this\n    // specific writer, then it would cause it to never start\n    // flowing again.\n    // So, if this is awaiting a drain, then we just call it now.\n    // If we don't know, then assume that we are waiting for one.\n    if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n  }\n\n  // If the user pushes more data while we're writing to dest then we'll end up\n  // in ondata again. However, we only want to increase awaitDrain once because\n  // dest will only emit one 'drain' event for the multiple writes.\n  // => Introduce a guard on increasing awaitDrain.\n  var increasedAwaitDrain = false;\n  src.on('data', ondata);\n  function ondata(chunk) {\n    debug('ondata');\n    increasedAwaitDrain = false;\n    var ret = dest.write(chunk);\n    if (false === ret && !increasedAwaitDrain) {\n      // If the user unpiped during `dest.write()`, it is possible\n      // to get stuck in a permanently paused state if that write\n      // also returned false.\n      // => Check whether `dest` is still a piping destination.\n      if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n        debug('false write response, pause', src._readableState.awaitDrain);\n        src._readableState.awaitDrain++;\n        increasedAwaitDrain = true;\n      }\n      src.pause();\n    }\n  }\n\n  // if the dest has an error, then stop piping into it.\n  // however, don't suppress the throwing behavior for this.\n  function onerror(er) {\n    debug('onerror', er);\n    unpipe();\n    dest.removeListener('error', onerror);\n    if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n  }\n\n  // Make sure our error handler is attached before userland ones.\n  prependListener(dest, 'error', onerror);\n\n  // Both close and finish should trigger unpipe, but only once.\n  function onclose() {\n    dest.removeListener('finish', onfinish);\n    unpipe();\n  }\n  dest.once('close', onclose);\n  function onfinish() {\n    debug('onfinish');\n    dest.removeListener('close', onclose);\n    unpipe();\n  }\n  dest.once('finish', onfinish);\n\n  function unpipe() {\n    debug('unpipe');\n    src.unpipe(dest);\n  }\n\n  // tell the dest that it's being piped to\n  dest.emit('pipe', src);\n\n  // start the flow if it hasn't been started already.\n  if (!state.flowing) {\n    debug('pipe resume');\n    src.resume();\n  }\n\n  return dest;\n};\n\nfunction pipeOnDrain(src) {\n  return function () {\n    var state = src._readableState;\n    debug('pipeOnDrain', state.awaitDrain);\n    if (state.awaitDrain) state.awaitDrain--;\n    if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n      state.flowing = true;\n      flow(src);\n    }\n  };\n}\n\nReadable.prototype.unpipe = function (dest) {\n  var state = this._readableState;\n  var unpipeInfo = { hasUnpiped: false };\n\n  // if we're not piping anywhere, then do nothing.\n  if (state.pipesCount === 0) return this;\n\n  // just one destination.  most common case.\n  if (state.pipesCount === 1) {\n    // passed in one, but it's not the right one.\n    if (dest && dest !== state.pipes) return this;\n\n    if (!dest) dest = state.pipes;\n\n    // got a match.\n    state.pipes = null;\n    state.pipesCount = 0;\n    state.flowing = false;\n    if (dest) dest.emit('unpipe', this, unpipeInfo);\n    return this;\n  }\n\n  // slow case. multiple pipe destinations.\n\n  if (!dest) {\n    // remove all.\n    var dests = state.pipes;\n    var len = state.pipesCount;\n    state.pipes = null;\n    state.pipesCount = 0;\n    state.flowing = false;\n\n    for (var i = 0; i < len; i++) {\n      dests[i].emit('unpipe', this, unpipeInfo);\n    }return this;\n  }\n\n  // try to find the right one.\n  var index = indexOf(state.pipes, dest);\n  if (index === -1) return this;\n\n  state.pipes.splice(index, 1);\n  state.pipesCount -= 1;\n  if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n  dest.emit('unpipe', this, unpipeInfo);\n\n  return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n  var res = Stream.prototype.on.call(this, ev, fn);\n\n  if (ev === 'data') {\n    // Start flowing on next tick if stream isn't explicitly paused\n    if (this._readableState.flowing !== false) this.resume();\n  } else if (ev === 'readable') {\n    var state = this._readableState;\n    if (!state.endEmitted && !state.readableListening) {\n      state.readableListening = state.needReadable = true;\n      state.emittedReadable = false;\n      if (!state.reading) {\n        pna.nextTick(nReadingNextTick, this);\n      } else if (state.length) {\n        emitReadable(this);\n      }\n    }\n  }\n\n  return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n  debug('readable nexttick read 0');\n  self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n  var state = this._readableState;\n  if (!state.flowing) {\n    debug('resume');\n    state.flowing = true;\n    resume(this, state);\n  }\n  return this;\n};\n\nfunction resume(stream, state) {\n  if (!state.resumeScheduled) {\n    state.resumeScheduled = true;\n    pna.nextTick(resume_, stream, state);\n  }\n}\n\nfunction resume_(stream, state) {\n  if (!state.reading) {\n    debug('resume read 0');\n    stream.read(0);\n  }\n\n  state.resumeScheduled = false;\n  state.awaitDrain = 0;\n  stream.emit('resume');\n  flow(stream);\n  if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n  debug('call pause flowing=%j', this._readableState.flowing);\n  if (false !== this._readableState.flowing) {\n    debug('pause');\n    this._readableState.flowing = false;\n    this.emit('pause');\n  }\n  return this;\n};\n\nfunction flow(stream) {\n  var state = stream._readableState;\n  debug('flow', state.flowing);\n  while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n  var _this = this;\n\n  var state = this._readableState;\n  var paused = false;\n\n  stream.on('end', function () {\n    debug('wrapped end');\n    if (state.decoder && !state.ended) {\n      var chunk = state.decoder.end();\n      if (chunk && chunk.length) _this.push(chunk);\n    }\n\n    _this.push(null);\n  });\n\n  stream.on('data', function (chunk) {\n    debug('wrapped data');\n    if (state.decoder) chunk = state.decoder.write(chunk);\n\n    // don't skip over falsy values in objectMode\n    if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n    var ret = _this.push(chunk);\n    if (!ret) {\n      paused = true;\n      stream.pause();\n    }\n  });\n\n  // proxy all the other methods.\n  // important when wrapping filters and duplexes.\n  for (var i in stream) {\n    if (this[i] === undefined && typeof stream[i] === 'function') {\n      this[i] = function (method) {\n        return function () {\n          return stream[method].apply(stream, arguments);\n        };\n      }(i);\n    }\n  }\n\n  // proxy certain important events.\n  for (var n = 0; n < kProxyEvents.length; n++) {\n    stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n  }\n\n  // when we try to consume some more bytes, simply unpause the\n  // underlying stream.\n  this._read = function (n) {\n    debug('wrapped _read', n);\n    if (paused) {\n      paused = false;\n      stream.resume();\n    }\n  };\n\n  return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n  // making it explicit this property is not enumerable\n  // because otherwise some prototype manipulation in\n  // userland will fail\n  enumerable: false,\n  get: function () {\n    return this._readableState.highWaterMark;\n  }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n  // nothing buffered\n  if (state.length === 0) return null;\n\n  var ret;\n  if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n    // read it all, truncate the list\n    if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n    state.buffer.clear();\n  } else {\n    // read part of list\n    ret = fromListPartial(n, state.buffer, state.decoder);\n  }\n\n  return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n  var ret;\n  if (n < list.head.data.length) {\n    // slice is the same for buffers and strings\n    ret = list.head.data.slice(0, n);\n    list.head.data = list.head.data.slice(n);\n  } else if (n === list.head.data.length) {\n    // first chunk is a perfect match\n    ret = list.shift();\n  } else {\n    // result spans more than one buffer\n    ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n  }\n  return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n  var p = list.head;\n  var c = 1;\n  var ret = p.data;\n  n -= ret.length;\n  while (p = p.next) {\n    var str = p.data;\n    var nb = n > str.length ? str.length : n;\n    if (nb === str.length) ret += str;else ret += str.slice(0, n);\n    n -= nb;\n    if (n === 0) {\n      if (nb === str.length) {\n        ++c;\n        if (p.next) list.head = p.next;else list.head = list.tail = null;\n      } else {\n        list.head = p;\n        p.data = str.slice(nb);\n      }\n      break;\n    }\n    ++c;\n  }\n  list.length -= c;\n  return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n  var ret = Buffer.allocUnsafe(n);\n  var p = list.head;\n  var c = 1;\n  p.data.copy(ret);\n  n -= p.data.length;\n  while (p = p.next) {\n    var buf = p.data;\n    var nb = n > buf.length ? buf.length : n;\n    buf.copy(ret, ret.length - n, 0, nb);\n    n -= nb;\n    if (n === 0) {\n      if (nb === buf.length) {\n        ++c;\n        if (p.next) list.head = p.next;else list.head = list.tail = null;\n      } else {\n        list.head = p;\n        p.data = buf.slice(nb);\n      }\n      break;\n    }\n    ++c;\n  }\n  list.length -= c;\n  return ret;\n}\n\nfunction endReadable(stream) {\n  var state = stream._readableState;\n\n  // If we get here before consuming all the bytes, then that is a\n  // bug in node.  Should never happen.\n  if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n  if (!state.endEmitted) {\n    state.ended = true;\n    pna.nextTick(endReadableNT, state, stream);\n  }\n}\n\nfunction endReadableNT(state, stream) {\n  // Check that we didn't get one last unshift.\n  if (!state.endEmitted && state.length === 0) {\n    state.endEmitted = true;\n    stream.readable = false;\n    stream.emit('end');\n  }\n}\n\nfunction indexOf(xs, x) {\n  for (var i = 0, l = xs.length; i < l; i++) {\n    if (xs[i] === x) return i;\n  }\n  return -1;\n}\n}).call(this,require('_process'),typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./_stream_duplex\":38,\"./internal/streams/BufferList\":43,\"./internal/streams/destroy\":44,\"./internal/streams/stream\":45,\"_process\":36,\"core-util-is\":5,\"events\":20,\"inherits\":26,\"isarray\":29,\"process-nextick-args\":35,\"safe-buffer\":51,\"string_decoder/\":57,\"util\":2}],41:[function(require,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data.  Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored.  (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation.  For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes.  When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up.  When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer.  When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks.  If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk.  However,\n// a pathological inflate type of transform can cause excessive buffering\n// here.  For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output.  In this case, you could write a very small\n// amount of input, and end up with a very large amount of output.  In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform.  A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n  var ts = this._transformState;\n  ts.transforming = false;\n\n  var cb = ts.writecb;\n\n  if (!cb) {\n    return this.emit('error', new Error('write callback called multiple times'));\n  }\n\n  ts.writechunk = null;\n  ts.writecb = null;\n\n  if (data != null) // single equals check for both `null` and `undefined`\n    this.push(data);\n\n  cb(er);\n\n  var rs = this._readableState;\n  rs.reading = false;\n  if (rs.needReadable || rs.length < rs.highWaterMark) {\n    this._read(rs.highWaterMark);\n  }\n}\n\nfunction Transform(options) {\n  if (!(this instanceof Transform)) return new Transform(options);\n\n  Duplex.call(this, options);\n\n  this._transformState = {\n    afterTransform: afterTransform.bind(this),\n    needTransform: false,\n    transforming: false,\n    writecb: null,\n    writechunk: null,\n    writeencoding: null\n  };\n\n  // start out asking for a readable event once data is transformed.\n  this._readableState.needReadable = true;\n\n  // we have implemented the _read method, and done the other things\n  // that Readable wants before the first _read call, so unset the\n  // sync guard flag.\n  this._readableState.sync = false;\n\n  if (options) {\n    if (typeof options.transform === 'function') this._transform = options.transform;\n\n    if (typeof options.flush === 'function') this._flush = options.flush;\n  }\n\n  // When the writable side finishes, then flush out anything remaining.\n  this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n  var _this = this;\n\n  if (typeof this._flush === 'function') {\n    this._flush(function (er, data) {\n      done(_this, er, data);\n    });\n  } else {\n    done(this, null, null);\n  }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n  this._transformState.needTransform = false;\n  return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side.  You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk.  If you pass\n// an error, then that'll put the hurt on the whole operation.  If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n  throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n  var ts = this._transformState;\n  ts.writecb = cb;\n  ts.writechunk = chunk;\n  ts.writeencoding = encoding;\n  if (!ts.transforming) {\n    var rs = this._readableState;\n    if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n  }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n  var ts = this._transformState;\n\n  if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n    ts.transforming = true;\n    this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n  } else {\n    // mark that we need a transform, so that any data that comes in\n    // will get processed, now that we've asked for it.\n    ts.needTransform = true;\n  }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n  var _this2 = this;\n\n  Duplex.prototype._destroy.call(this, err, function (err2) {\n    cb(err2);\n    _this2.emit('close');\n  });\n};\n\nfunction done(stream, er, data) {\n  if (er) return stream.emit('error', er);\n\n  if (data != null) // single equals check for both `null` and `undefined`\n    stream.push(data);\n\n  // if there's nothing in the write buffer, then that means\n  // that nothing more will ever be provided\n  if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n  if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n  return stream.push(null);\n}\n},{\"./_stream_duplex\":38,\"core-util-is\":5,\"inherits\":26}],42:[function(require,module,exports){\n(function (process,global,setImmediate){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n  this.chunk = chunk;\n  this.encoding = encoding;\n  this.callback = cb;\n  this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n  var _this = this;\n\n  this.next = null;\n  this.entry = null;\n  this.finish = function () {\n    onCorkedFinish(_this, state);\n  };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n  deprecate: require('util-deprecate')\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = require('./internal/streams/stream');\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n  return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n  Duplex = Duplex || require('./_stream_duplex');\n\n  options = options || {};\n\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream.\n  // These options can be provided separately as readableXXX and writableXXX.\n  var isDuplex = stream instanceof Duplex;\n\n  // object stream flag to indicate whether or not this stream\n  // contains buffers or objects.\n  this.objectMode = !!options.objectMode;\n\n  if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n  // the point at which write() starts returning false\n  // Note: 0 is a valid value, means that we always return false if\n  // the entire buffer is not flushed immediately on write()\n  var hwm = options.highWaterMark;\n  var writableHwm = options.writableHighWaterMark;\n  var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n  // cast to ints.\n  this.highWaterMark = Math.floor(this.highWaterMark);\n\n  // if _final has been called\n  this.finalCalled = false;\n\n  // drain event flag.\n  this.needDrain = false;\n  // at the start of calling end()\n  this.ending = false;\n  // when end() has been called, and returned\n  this.ended = false;\n  // when 'finish' is emitted\n  this.finished = false;\n\n  // has it been destroyed\n  this.destroyed = false;\n\n  // should we decode strings into buffers before passing to _write?\n  // this is here so that some node-core streams can optimize string\n  // handling at a lower level.\n  var noDecode = options.decodeStrings === false;\n  this.decodeStrings = !noDecode;\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n  // not an actual buffer we keep track of, but a measurement\n  // of how much we're waiting to get pushed to some underlying\n  // socket or file.\n  this.length = 0;\n\n  // a flag to see when we're in the middle of a write.\n  this.writing = false;\n\n  // when true all writes will be buffered until .uncork() call\n  this.corked = 0;\n\n  // a flag to be able to tell if the onwrite cb is called immediately,\n  // or on a later tick.  We set this to true at first, because any\n  // actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first write call.\n  this.sync = true;\n\n  // a flag to know if we're processing previously buffered items, which\n  // may call the _write() callback in the same tick, so that we don't\n  // end up in an overlapped onwrite situation.\n  this.bufferProcessing = false;\n\n  // the callback that's passed to _write(chunk,cb)\n  this.onwrite = function (er) {\n    onwrite(stream, er);\n  };\n\n  // the callback that the user supplies to write(chunk,encoding,cb)\n  this.writecb = null;\n\n  // the amount that is being written when _write is called.\n  this.writelen = 0;\n\n  this.bufferedRequest = null;\n  this.lastBufferedRequest = null;\n\n  // number of pending user-supplied write callbacks\n  // this must be 0 before 'finish' can be emitted\n  this.pendingcb = 0;\n\n  // emit prefinish if the only thing we're waiting for is _write cbs\n  // This is relevant for synchronous Transform streams\n  this.prefinished = false;\n\n  // True if the error was already emitted and should not be thrown again\n  this.errorEmitted = false;\n\n  // count buffered requests\n  this.bufferedRequestCount = 0;\n\n  // allocate the first CorkedRequest, there is always\n  // one allocated and free to use, and we maintain at most two\n  this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n  var current = this.bufferedRequest;\n  var out = [];\n  while (current) {\n    out.push(current);\n    current = current.next;\n  }\n  return out;\n};\n\n(function () {\n  try {\n    Object.defineProperty(WritableState.prototype, 'buffer', {\n      get: internalUtil.deprecate(function () {\n        return this.getBuffer();\n      }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n    });\n  } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n  realHasInstance = Function.prototype[Symbol.hasInstance];\n  Object.defineProperty(Writable, Symbol.hasInstance, {\n    value: function (object) {\n      if (realHasInstance.call(this, object)) return true;\n      if (this !== Writable) return false;\n\n      return object && object._writableState instanceof WritableState;\n    }\n  });\n} else {\n  realHasInstance = function (object) {\n    return object instanceof this;\n  };\n}\n\nfunction Writable(options) {\n  Duplex = Duplex || require('./_stream_duplex');\n\n  // Writable ctor is applied to Duplexes, too.\n  // `realHasInstance` is necessary because using plain `instanceof`\n  // would return false, as no `_writableState` property is attached.\n\n  // Trying to use the custom `instanceof` for Writable here will also break the\n  // Node.js LazyTransform implementation, which has a non-trivial getter for\n  // `_writableState` that would lead to infinite recursion.\n  if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n    return new Writable(options);\n  }\n\n  this._writableState = new WritableState(options, this);\n\n  // legacy.\n  this.writable = true;\n\n  if (options) {\n    if (typeof options.write === 'function') this._write = options.write;\n\n    if (typeof options.writev === 'function') this._writev = options.writev;\n\n    if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n    if (typeof options.final === 'function') this._final = options.final;\n  }\n\n  Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n  this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n  var er = new Error('write after end');\n  // TODO: defer error events consistently everywhere, not just the cb\n  stream.emit('error', er);\n  pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n  var valid = true;\n  var er = false;\n\n  if (chunk === null) {\n    er = new TypeError('May not write null values to stream');\n  } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n    er = new TypeError('Invalid non-string/buffer chunk');\n  }\n  if (er) {\n    stream.emit('error', er);\n    pna.nextTick(cb, er);\n    valid = false;\n  }\n  return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n  var state = this._writableState;\n  var ret = false;\n  var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n  if (isBuf && !Buffer.isBuffer(chunk)) {\n    chunk = _uint8ArrayToBuffer(chunk);\n  }\n\n  if (typeof encoding === 'function') {\n    cb = encoding;\n    encoding = null;\n  }\n\n  if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n  if (typeof cb !== 'function') cb = nop;\n\n  if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n    state.pendingcb++;\n    ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n  }\n\n  return ret;\n};\n\nWritable.prototype.cork = function () {\n  var state = this._writableState;\n\n  state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n  var state = this._writableState;\n\n  if (state.corked) {\n    state.corked--;\n\n    if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n  }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n  // node::ParseEncoding() requires lower case.\n  if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n  if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n  this._writableState.defaultEncoding = encoding;\n  return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n    chunk = Buffer.from(chunk, encoding);\n  }\n  return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n  // making it explicit this property is not enumerable\n  // because otherwise some prototype manipulation in\n  // userland will fail\n  enumerable: false,\n  get: function () {\n    return this._writableState.highWaterMark;\n  }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn.  Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n  if (!isBuf) {\n    var newChunk = decodeChunk(state, chunk, encoding);\n    if (chunk !== newChunk) {\n      isBuf = true;\n      encoding = 'buffer';\n      chunk = newChunk;\n    }\n  }\n  var len = state.objectMode ? 1 : chunk.length;\n\n  state.length += len;\n\n  var ret = state.length < state.highWaterMark;\n  // we must ensure that previous needDrain will not be reset to false.\n  if (!ret) state.needDrain = true;\n\n  if (state.writing || state.corked) {\n    var last = state.lastBufferedRequest;\n    state.lastBufferedRequest = {\n      chunk: chunk,\n      encoding: encoding,\n      isBuf: isBuf,\n      callback: cb,\n      next: null\n    };\n    if (last) {\n      last.next = state.lastBufferedRequest;\n    } else {\n      state.bufferedRequest = state.lastBufferedRequest;\n    }\n    state.bufferedRequestCount += 1;\n  } else {\n    doWrite(stream, state, false, len, chunk, encoding, cb);\n  }\n\n  return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n  state.writelen = len;\n  state.writecb = cb;\n  state.writing = true;\n  state.sync = true;\n  if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n  state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n  --state.pendingcb;\n\n  if (sync) {\n    // defer the callback if we are being called synchronously\n    // to avoid piling up things on the stack\n    pna.nextTick(cb, er);\n    // this can emit finish, and it will always happen\n    // after error\n    pna.nextTick(finishMaybe, stream, state);\n    stream._writableState.errorEmitted = true;\n    stream.emit('error', er);\n  } else {\n    // the caller expect this to happen before if\n    // it is async\n    cb(er);\n    stream._writableState.errorEmitted = true;\n    stream.emit('error', er);\n    // this can emit finish, but finish must\n    // always follow error\n    finishMaybe(stream, state);\n  }\n}\n\nfunction onwriteStateUpdate(state) {\n  state.writing = false;\n  state.writecb = null;\n  state.length -= state.writelen;\n  state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n  var state = stream._writableState;\n  var sync = state.sync;\n  var cb = state.writecb;\n\n  onwriteStateUpdate(state);\n\n  if (er) onwriteError(stream, state, sync, er, cb);else {\n    // Check if we're actually ready to finish, but don't emit yet\n    var finished = needFinish(state);\n\n    if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n      clearBuffer(stream, state);\n    }\n\n    if (sync) {\n      /*<replacement>*/\n      asyncWrite(afterWrite, stream, state, finished, cb);\n      /*</replacement>*/\n    } else {\n      afterWrite(stream, state, finished, cb);\n    }\n  }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n  if (!finished) onwriteDrain(stream, state);\n  state.pendingcb--;\n  cb();\n  finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n  if (state.length === 0 && state.needDrain) {\n    state.needDrain = false;\n    stream.emit('drain');\n  }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n  state.bufferProcessing = true;\n  var entry = state.bufferedRequest;\n\n  if (stream._writev && entry && entry.next) {\n    // Fast case, write everything using _writev()\n    var l = state.bufferedRequestCount;\n    var buffer = new Array(l);\n    var holder = state.corkedRequestsFree;\n    holder.entry = entry;\n\n    var count = 0;\n    var allBuffers = true;\n    while (entry) {\n      buffer[count] = entry;\n      if (!entry.isBuf) allBuffers = false;\n      entry = entry.next;\n      count += 1;\n    }\n    buffer.allBuffers = allBuffers;\n\n    doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n    // doWrite is almost always async, defer these to save a bit of time\n    // as the hot path ends with doWrite\n    state.pendingcb++;\n    state.lastBufferedRequest = null;\n    if (holder.next) {\n      state.corkedRequestsFree = holder.next;\n      holder.next = null;\n    } else {\n      state.corkedRequestsFree = new CorkedRequest(state);\n    }\n    state.bufferedRequestCount = 0;\n  } else {\n    // Slow case, write chunks one-by-one\n    while (entry) {\n      var chunk = entry.chunk;\n      var encoding = entry.encoding;\n      var cb = entry.callback;\n      var len = state.objectMode ? 1 : chunk.length;\n\n      doWrite(stream, state, false, len, chunk, encoding, cb);\n      entry = entry.next;\n      state.bufferedRequestCount--;\n      // if we didn't call the onwrite immediately, then\n      // it means that we need to wait until it does.\n      // also, that means that the chunk and cb are currently\n      // being processed, so move the buffer counter past them.\n      if (state.writing) {\n        break;\n      }\n    }\n\n    if (entry === null) state.lastBufferedRequest = null;\n  }\n\n  state.bufferedRequest = entry;\n  state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n  cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n  var state = this._writableState;\n\n  if (typeof chunk === 'function') {\n    cb = chunk;\n    chunk = null;\n    encoding = null;\n  } else if (typeof encoding === 'function') {\n    cb = encoding;\n    encoding = null;\n  }\n\n  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n  // .end() fully uncorks\n  if (state.corked) {\n    state.corked = 1;\n    this.uncork();\n  }\n\n  // ignore unnecessary end() calls.\n  if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n  return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n  stream._final(function (err) {\n    state.pendingcb--;\n    if (err) {\n      stream.emit('error', err);\n    }\n    state.prefinished = true;\n    stream.emit('prefinish');\n    finishMaybe(stream, state);\n  });\n}\nfunction prefinish(stream, state) {\n  if (!state.prefinished && !state.finalCalled) {\n    if (typeof stream._final === 'function') {\n      state.pendingcb++;\n      state.finalCalled = true;\n      pna.nextTick(callFinal, stream, state);\n    } else {\n      state.prefinished = true;\n      stream.emit('prefinish');\n    }\n  }\n}\n\nfunction finishMaybe(stream, state) {\n  var need = needFinish(state);\n  if (need) {\n    prefinish(stream, state);\n    if (state.pendingcb === 0) {\n      state.finished = true;\n      stream.emit('finish');\n    }\n  }\n  return need;\n}\n\nfunction endWritable(stream, state, cb) {\n  state.ending = true;\n  finishMaybe(stream, state);\n  if (cb) {\n    if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n  }\n  state.ended = true;\n  stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n  var entry = corkReq.entry;\n  corkReq.entry = null;\n  while (entry) {\n    var cb = entry.callback;\n    state.pendingcb--;\n    cb(err);\n    entry = entry.next;\n  }\n  if (state.corkedRequestsFree) {\n    state.corkedRequestsFree.next = corkReq;\n  } else {\n    state.corkedRequestsFree = corkReq;\n  }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n  get: function () {\n    if (this._writableState === undefined) {\n      return false;\n    }\n    return this._writableState.destroyed;\n  },\n  set: function (value) {\n    // we ignore the value if the stream\n    // has not been initialized yet\n    if (!this._writableState) {\n      return;\n    }\n\n    // backward compatibility, the user is explicitly\n    // managing destroyed\n    this._writableState.destroyed = value;\n  }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n  this.end();\n  cb(err);\n};\n}).call(this,require('_process'),typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {},require(\"timers\").setImmediate)\n},{\"./_stream_duplex\":38,\"./internal/streams/destroy\":44,\"./internal/streams/stream\":45,\"_process\":36,\"core-util-is\":5,\"inherits\":26,\"process-nextick-args\":35,\"safe-buffer\":51,\"timers\":63,\"util-deprecate\":64}],43:[function(require,module,exports){\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = require('safe-buffer').Buffer;\nvar util = require('util');\n\nfunction copyBuffer(src, target, offset) {\n  src.copy(target, offset);\n}\n\nmodule.exports = function () {\n  function BufferList() {\n    _classCallCheck(this, BufferList);\n\n    this.head = null;\n    this.tail = null;\n    this.length = 0;\n  }\n\n  BufferList.prototype.push = function push(v) {\n    var entry = { data: v, next: null };\n    if (this.length > 0) this.tail.next = entry;else this.head = entry;\n    this.tail = entry;\n    ++this.length;\n  };\n\n  BufferList.prototype.unshift = function unshift(v) {\n    var entry = { data: v, next: this.head };\n    if (this.length === 0) this.tail = entry;\n    this.head = entry;\n    ++this.length;\n  };\n\n  BufferList.prototype.shift = function shift() {\n    if (this.length === 0) return;\n    var ret = this.head.data;\n    if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n    --this.length;\n    return ret;\n  };\n\n  BufferList.prototype.clear = function clear() {\n    this.head = this.tail = null;\n    this.length = 0;\n  };\n\n  BufferList.prototype.join = function join(s) {\n    if (this.length === 0) return '';\n    var p = this.head;\n    var ret = '' + p.data;\n    while (p = p.next) {\n      ret += s + p.data;\n    }return ret;\n  };\n\n  BufferList.prototype.concat = function concat(n) {\n    if (this.length === 0) return Buffer.alloc(0);\n    if (this.length === 1) return this.head.data;\n    var ret = Buffer.allocUnsafe(n >>> 0);\n    var p = this.head;\n    var i = 0;\n    while (p) {\n      copyBuffer(p.data, ret, i);\n      i += p.data.length;\n      p = p.next;\n    }\n    return ret;\n  };\n\n  return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n  module.exports.prototype[util.inspect.custom] = function () {\n    var obj = util.inspect({ length: this.length });\n    return this.constructor.name + ' ' + obj;\n  };\n}\n},{\"safe-buffer\":51,\"util\":2}],44:[function(require,module,exports){\n'use strict';\n\n/*<replacement>*/\n\nvar pna = require('process-nextick-args');\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n  var _this = this;\n\n  var readableDestroyed = this._readableState && this._readableState.destroyed;\n  var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n  if (readableDestroyed || writableDestroyed) {\n    if (cb) {\n      cb(err);\n    } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n      pna.nextTick(emitErrorNT, this, err);\n    }\n    return this;\n  }\n\n  // we set destroyed to true before firing error callbacks in order\n  // to make it re-entrance safe in case destroy() is called within callbacks\n\n  if (this._readableState) {\n    this._readableState.destroyed = true;\n  }\n\n  // if this is a duplex stream mark the writable part as destroyed as well\n  if (this._writableState) {\n    this._writableState.destroyed = true;\n  }\n\n  this._destroy(err || null, function (err) {\n    if (!cb && err) {\n      pna.nextTick(emitErrorNT, _this, err);\n      if (_this._writableState) {\n        _this._writableState.errorEmitted = true;\n      }\n    } else if (cb) {\n      cb(err);\n    }\n  });\n\n  return this;\n}\n\nfunction undestroy() {\n  if (this._readableState) {\n    this._readableState.destroyed = false;\n    this._readableState.reading = false;\n    this._readableState.ended = false;\n    this._readableState.endEmitted = false;\n  }\n\n  if (this._writableState) {\n    this._writableState.destroyed = false;\n    this._writableState.ended = false;\n    this._writableState.ending = false;\n    this._writableState.finished = false;\n    this._writableState.errorEmitted = false;\n  }\n}\n\nfunction emitErrorNT(self, err) {\n  self.emit('error', err);\n}\n\nmodule.exports = {\n  destroy: destroy,\n  undestroy: undestroy\n};\n},{\"process-nextick-args\":35}],45:[function(require,module,exports){\nmodule.exports = require('events').EventEmitter;\n\n},{\"events\":20}],46:[function(require,module,exports){\nmodule.exports = require('./readable').PassThrough\n\n},{\"./readable\":47}],47:[function(require,module,exports){\nexports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n\n},{\"./lib/_stream_duplex.js\":38,\"./lib/_stream_passthrough.js\":39,\"./lib/_stream_readable.js\":40,\"./lib/_stream_transform.js\":41,\"./lib/_stream_writable.js\":42}],48:[function(require,module,exports){\nmodule.exports = require('./readable').Transform\n\n},{\"./readable\":47}],49:[function(require,module,exports){\nmodule.exports = require('./lib/_stream_writable.js');\n\n},{\"./lib/_stream_writable.js\":42}],50:[function(require,module,exports){\n(function (process,setImmediate){\nvar through = require('through');\nvar nextTick = typeof setImmediate !== 'undefined'\n    ? setImmediate\n    : process.nextTick\n;\n\nmodule.exports = function (write, end) {\n    var tr = through(write, end);\n    tr.pause();\n    var resume = tr.resume;\n    var pause = tr.pause;\n    var paused = false;\n    \n    tr.pause = function () {\n        paused = true;\n        return pause.apply(this, arguments);\n    };\n    \n    tr.resume = function () {\n        paused = false;\n        return resume.apply(this, arguments);\n    };\n    \n    nextTick(function () {\n        if (!paused) tr.resume();\n    });\n    \n    return tr;\n};\n\n}).call(this,require('_process'),require(\"timers\").setImmediate)\n},{\"_process\":36,\"through\":62,\"timers\":63}],51:[function(require,module,exports){\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n  for (var key in src) {\n    dst[key] = src[key]\n  }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n  module.exports = buffer\n} else {\n  // Copy properties from require('buffer')\n  copyProps(buffer, exports)\n  exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n  return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n  if (typeof arg === 'number') {\n    throw new TypeError('Argument must not be a number')\n  }\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  var buf = Buffer(size)\n  if (fill !== undefined) {\n    if (typeof encoding === 'string') {\n      buf.fill(fill, encoding)\n    } else {\n      buf.fill(fill)\n    }\n  } else {\n    buf.fill(0)\n  }\n  return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return buffer.SlowBuffer(size)\n}\n\n},{\"buffer\":4}],52:[function(require,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = require('events').EventEmitter;\nvar inherits = require('inherits');\n\ninherits(Stream, EE);\nStream.Readable = require('readable-stream/readable.js');\nStream.Writable = require('readable-stream/writable.js');\nStream.Duplex = require('readable-stream/duplex.js');\nStream.Transform = require('readable-stream/transform.js');\nStream.PassThrough = require('readable-stream/passthrough.js');\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams.  Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n  EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n  var source = this;\n\n  function ondata(chunk) {\n    if (dest.writable) {\n      if (false === dest.write(chunk) && source.pause) {\n        source.pause();\n      }\n    }\n  }\n\n  source.on('data', ondata);\n\n  function ondrain() {\n    if (source.readable && source.resume) {\n      source.resume();\n    }\n  }\n\n  dest.on('drain', ondrain);\n\n  // If the 'end' option is not supplied, dest.end() will be called when\n  // source gets the 'end' or 'close' events.  Only dest.end() once.\n  if (!dest._isStdio && (!options || options.end !== false)) {\n    source.on('end', onend);\n    source.on('close', onclose);\n  }\n\n  var didOnEnd = false;\n  function onend() {\n    if (didOnEnd) return;\n    didOnEnd = true;\n\n    dest.end();\n  }\n\n\n  function onclose() {\n    if (didOnEnd) return;\n    didOnEnd = true;\n\n    if (typeof dest.destroy === 'function') dest.destroy();\n  }\n\n  // don't leave dangling pipes when there are errors.\n  function onerror(er) {\n    cleanup();\n    if (EE.listenerCount(this, 'error') === 0) {\n      throw er; // Unhandled stream error in pipe.\n    }\n  }\n\n  source.on('error', onerror);\n  dest.on('error', onerror);\n\n  // remove all the event listeners that were added.\n  function cleanup() {\n    source.removeListener('data', ondata);\n    dest.removeListener('drain', ondrain);\n\n    source.removeListener('end', onend);\n    source.removeListener('close', onclose);\n\n    source.removeListener('error', onerror);\n    dest.removeListener('error', onerror);\n\n    source.removeListener('end', cleanup);\n    source.removeListener('close', cleanup);\n\n    dest.removeListener('close', cleanup);\n  }\n\n  source.on('end', cleanup);\n  source.on('close', cleanup);\n\n  dest.on('close', cleanup);\n\n  dest.emit('pipe', source);\n\n  // Allow for unix-like usage: A.pipe(B).pipe(C)\n  return dest;\n};\n\n},{\"events\":20,\"inherits\":26,\"readable-stream/duplex.js\":37,\"readable-stream/passthrough.js\":46,\"readable-stream/readable.js\":47,\"readable-stream/transform.js\":48,\"readable-stream/writable.js\":49}],53:[function(require,module,exports){\n'use strict';\n\nvar bind = require('function-bind');\nvar ES = require('es-abstract/es5');\nvar replace = bind.call(Function.call, String.prototype.replace);\n\nvar leftWhitespace = /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n\nmodule.exports = function trim() {\n\tvar S = ES.ToString(ES.CheckObjectCoercible(this));\n\treturn replace(replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n\n},{\"es-abstract/es5\":12,\"function-bind\":23}],54:[function(require,module,exports){\n'use strict';\n\nvar bind = require('function-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundTrim = bind.call(Function.call, getPolyfill());\n\ndefine(boundTrim, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundTrim;\n\n},{\"./implementation\":53,\"./polyfill\":55,\"./shim\":56,\"define-properties\":9,\"function-bind\":23}],55:[function(require,module,exports){\n'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.trim && zeroWidthSpace.trim() === zeroWidthSpace) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n\n},{\"./implementation\":53}],56:[function(require,module,exports){\n'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, { trim: function () { return String.prototype.trim !== polyfill; } });\n\treturn polyfill;\n};\n\n},{\"./polyfill\":55,\"define-properties\":9}],57:[function(require,module,exports){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/*<replacement>*/\n\nvar Buffer = require('safe-buffer').Buffer;\n/*</replacement>*/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n  encoding = '' + encoding;\n  switch (encoding && encoding.toLowerCase()) {\n    case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n      return true;\n    default:\n      return false;\n  }\n};\n\nfunction _normalizeEncoding(enc) {\n  if (!enc) return 'utf8';\n  var retried;\n  while (true) {\n    switch (enc) {\n      case 'utf8':\n      case 'utf-8':\n        return 'utf8';\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return 'utf16le';\n      case 'latin1':\n      case 'binary':\n        return 'latin1';\n      case 'base64':\n      case 'ascii':\n      case 'hex':\n        return enc;\n      default:\n        if (retried) return; // undefined\n        enc = ('' + enc).toLowerCase();\n        retried = true;\n    }\n  }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n  var nenc = _normalizeEncoding(enc);\n  if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n  return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n  this.encoding = normalizeEncoding(encoding);\n  var nb;\n  switch (this.encoding) {\n    case 'utf16le':\n      this.text = utf16Text;\n      this.end = utf16End;\n      nb = 4;\n      break;\n    case 'utf8':\n      this.fillLast = utf8FillLast;\n      nb = 4;\n      break;\n    case 'base64':\n      this.text = base64Text;\n      this.end = base64End;\n      nb = 3;\n      break;\n    default:\n      this.write = simpleWrite;\n      this.end = simpleEnd;\n      return;\n  }\n  this.lastNeed = 0;\n  this.lastTotal = 0;\n  this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n  if (buf.length === 0) return '';\n  var r;\n  var i;\n  if (this.lastNeed) {\n    r = this.fillLast(buf);\n    if (r === undefined) return '';\n    i = this.lastNeed;\n    this.lastNeed = 0;\n  } else {\n    i = 0;\n  }\n  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n  return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n  this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n  return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n  var j = buf.length - 1;\n  if (j < i) return 0;\n  var nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 1;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 2;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) {\n      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n    }\n    return nb;\n  }\n  return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n  if ((buf[0] & 0xC0) !== 0x80) {\n    self.lastNeed = 0;\n    return '\\ufffd';\n  }\n  if (self.lastNeed > 1 && buf.length > 1) {\n    if ((buf[1] & 0xC0) !== 0x80) {\n      self.lastNeed = 1;\n      return '\\ufffd';\n    }\n    if (self.lastNeed > 2 && buf.length > 2) {\n      if ((buf[2] & 0xC0) !== 0x80) {\n        self.lastNeed = 2;\n        return '\\ufffd';\n      }\n    }\n  }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n  var p = this.lastTotal - this.lastNeed;\n  var r = utf8CheckExtraBytes(this, buf, p);\n  if (r !== undefined) return r;\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, p, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, p, 0, buf.length);\n  this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n  var total = utf8CheckIncomplete(this, buf, i);\n  if (!this.lastNeed) return buf.toString('utf8', i);\n  this.lastTotal = total;\n  var end = buf.length - (total - this.lastNeed);\n  buf.copy(this.lastChar, 0, end);\n  return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + '\\ufffd';\n  return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n  if ((buf.length - i) % 2 === 0) {\n    var r = buf.toString('utf16le', i);\n    if (r) {\n      var c = r.charCodeAt(r.length - 1);\n      if (c >= 0xD800 && c <= 0xDBFF) {\n        this.lastNeed = 2;\n        this.lastTotal = 4;\n        this.lastChar[0] = buf[buf.length - 2];\n        this.lastChar[1] = buf[buf.length - 1];\n        return r.slice(0, -1);\n      }\n    }\n    return r;\n  }\n  this.lastNeed = 1;\n  this.lastTotal = 2;\n  this.lastChar[0] = buf[buf.length - 1];\n  return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) {\n    var end = this.lastTotal - this.lastNeed;\n    return r + this.lastChar.toString('utf16le', 0, end);\n  }\n  return r;\n}\n\nfunction base64Text(buf, i) {\n  var n = (buf.length - i) % 3;\n  if (n === 0) return buf.toString('base64', i);\n  this.lastNeed = 3 - n;\n  this.lastTotal = 3;\n  if (n === 1) {\n    this.lastChar[0] = buf[buf.length - 1];\n  } else {\n    this.lastChar[0] = buf[buf.length - 2];\n    this.lastChar[1] = buf[buf.length - 1];\n  }\n  return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n  return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n  return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n  return buf && buf.length ? this.write(buf) : '';\n}\n},{\"safe-buffer\":51}],58:[function(require,module,exports){\n(function (process,setImmediate){\nvar defined = require('defined');\nvar createDefaultStream = require('./lib/default_stream');\nvar Test = require('./lib/test');\nvar createResult = require('./lib/results');\nvar through = require('through');\n\nvar canEmitExit = typeof process !== 'undefined' && process\n    && typeof process.on === 'function' && process.browser !== true\n;\nvar canExit = typeof process !== 'undefined' && process\n    && typeof process.exit === 'function'\n;\n\nvar nextTick = typeof setImmediate !== 'undefined'\n    ? setImmediate\n    : process.nextTick\n;\n\nexports = module.exports = (function () {\n    var harness;\n    var lazyLoad = function () {\n        return getHarness().apply(this, arguments);\n    };\n\n    lazyLoad.only = function () {\n        return getHarness().only.apply(this, arguments);\n    };\n\n    lazyLoad.createStream = function (opts) {\n        if (!opts) opts = {};\n        if (!harness) {\n            var output = through();\n            getHarness({ stream: output, objectMode: opts.objectMode });\n            return output;\n        }\n        return harness.createStream(opts);\n    };\n\n    lazyLoad.onFinish = function () {\n        return getHarness().onFinish.apply(this, arguments);\n    };\n\n    lazyLoad.onFailure = function () {\n        return getHarness().onFailure.apply(this, arguments);\n    };\n\n    lazyLoad.getHarness = getHarness\n\n    return lazyLoad\n\n    function getHarness(opts) {\n        if (!opts) opts = {};\n        opts.autoclose = !canEmitExit;\n        if (!harness) harness = createExitHarness(opts);\n        return harness;\n    }\n})();\n\nfunction createExitHarness(conf) {\n    if (!conf) conf = {};\n    var harness = createHarness({\n        autoclose: defined(conf.autoclose, false)\n    });\n\n    var stream = harness.createStream({ objectMode: conf.objectMode });\n    var es = stream.pipe(conf.stream || createDefaultStream());\n    if (canEmitExit) {\n        es.on('error', function (err) { harness._exitCode = 1 });\n    }\n\n    var ended = false;\n    stream.on('end', function () { ended = true });\n\n    if (conf.exit === false) return harness;\n    if (!canEmitExit || !canExit) return harness;\n\n    var inErrorState = false;\n\n    process.on('exit', function (code) {\n        // let the process exit cleanly.\n        if (code !== 0) {\n            return\n        }\n\n        if (!ended) {\n            var only = harness._results._only;\n            for (var i = 0; i < harness._tests.length; i++) {\n                var t = harness._tests[i];\n                if (only && t !== only) continue;\n                t._exit();\n            }\n        }\n        harness.close();\n        process.exit(code || harness._exitCode);\n    });\n\n    return harness;\n}\n\nexports.createHarness = createHarness;\nexports.Test = Test;\nexports.test = exports; // tap compat\nexports.test.skip = Test.skip;\n\nvar exitInterval;\n\nfunction createHarness(conf_) {\n    if (!conf_) conf_ = {};\n    var results = createResult();\n    if (conf_.autoclose !== false) {\n        results.once('done', function () { results.close() });\n    }\n\n    var test = function (name, conf, cb) {\n        var t = new Test(name, conf, cb);\n        test._tests.push(t);\n\n        (function inspectCode(st) {\n            st.on('test', function sub(st_) {\n                inspectCode(st_);\n            });\n            st.on('result', function (r) {\n                if (!r.ok && typeof r !== 'string') test._exitCode = 1\n            });\n        })(t);\n\n        results.push(t);\n        return t;\n    };\n    test._results = results;\n\n    test._tests = [];\n\n    test.createStream = function (opts) {\n        return results.createStream(opts);\n    };\n\n    test.onFinish = function (cb) {\n        results.on('done', cb);\n    };\n\n    test.onFailure = function (cb) {\n        results.on('fail', cb);\n    };\n\n    var only = false;\n    test.only = function () {\n        if (only) throw new Error('there can only be one only test');\n        only = true;\n        var t = test.apply(null, arguments);\n        results.only(t);\n        return t;\n    };\n    test._exitCode = 0;\n\n    test.close = function () { results.close() };\n\n    return test;\n}\n\n}).call(this,require('_process'),require(\"timers\").setImmediate)\n},{\"./lib/default_stream\":59,\"./lib/results\":60,\"./lib/test\":61,\"_process\":36,\"defined\":10,\"through\":62,\"timers\":63}],59:[function(require,module,exports){\n(function (process){\nvar through = require('through');\nvar fs = require('fs');\n\nmodule.exports = function () {\n    var line = '';\n    var stream = through(write, flush);\n    return stream;\n\n    function write(buf) {\n        for (var i = 0; i < buf.length; i++) {\n            var c = typeof buf === 'string'\n                ? buf.charAt(i)\n                : String.fromCharCode(buf[i])\n            ;\n            if (c === '\\n') flush();\n            else line += c;\n        }\n    }\n\n    function flush() {\n        if (fs.writeSync && /^win/.test(process.platform)) {\n            try { fs.writeSync(1, line + '\\n'); }\n            catch (e) { stream.emit('error', e) }\n        } else {\n            try { console.log(line) }\n            catch (e) { stream.emit('error', e) }\n        }\n        line = '';\n    }\n};\n\n}).call(this,require('_process'))\n},{\"_process\":36,\"fs\":3,\"through\":62}],60:[function(require,module,exports){\n(function (process,setImmediate){\nvar defined = require('defined');\nvar EventEmitter = require('events').EventEmitter;\nvar inherits = require('inherits');\nvar through = require('through');\nvar resumer = require('resumer');\nvar inspect = require('object-inspect');\nvar bind = require('function-bind');\nvar has = require('has');\nvar regexpTest = bind.call(Function.call, RegExp.prototype.test);\nvar yamlIndicators = /\\:|\\-|\\?/;\nvar nextTick = typeof setImmediate !== 'undefined'\n    ? setImmediate\n    : process.nextTick\n;\n\nmodule.exports = Results;\ninherits(Results, EventEmitter);\n\nfunction Results() {\n    if (!(this instanceof Results)) return new Results;\n    this.count = 0;\n    this.fail = 0;\n    this.pass = 0;\n    this.todo = 0;\n    this._stream = through();\n    this.tests = [];\n    this._only = null;\n    this._isRunning = false;\n}\n\nResults.prototype.createStream = function (opts) {\n    if (!opts) opts = {};\n    var self = this;\n    var output, testId = 0;\n    if (opts.objectMode) {\n        output = through();\n        self.on('_push', function ontest(t, extra) {\n            if (!extra) extra = {};\n            var id = testId++;\n            t.once('prerun', function () {\n                var row = {\n                    type: 'test',\n                    name: t.name,\n                    id: id\n                };\n                if (has(extra, 'parent')) {\n                    row.parent = extra.parent;\n                }\n                output.queue(row);\n            });\n            t.on('test', function (st) {\n                ontest(st, { parent: id });\n            });\n            t.on('result', function (res) {\n                res.test = id;\n                res.type = 'assert';\n                output.queue(res);\n            });\n            t.on('end', function () {\n                output.queue({ type: 'end', test: id });\n            });\n        });\n        self.on('done', function () { output.queue(null) });\n    } else {\n        output = resumer();\n        output.queue('TAP version 13\\n');\n        self._stream.pipe(output);\n    }\n\n    if (!this._isRunning) {\n        this._isRunning = true;\n        nextTick(function next() {\n            var t;\n            while (t = getNextTest(self)) {\n                t.run();\n                if (!t.ended) return t.once('end', function () { nextTick(next); });\n            }\n            self.emit('done');\n        });\n    }\n\n    return output;\n};\n\nResults.prototype.push = function (t) {\n    var self = this;\n    self.tests.push(t);\n    self._watch(t);\n    self.emit('_push', t);\n};\n\nResults.prototype.only = function (t) {\n    this._only = t;\n};\n\nResults.prototype._watch = function (t) {\n    var self = this;\n    var write = function (s) { self._stream.queue(s) };\n    t.once('prerun', function () {\n        write('# ' + t.name + '\\n');\n    });\n\n    t.on('result', function (res) {\n        if (typeof res === 'string') {\n            write('# ' + res + '\\n');\n            return;\n        }\n        write(encodeResult(res, self.count + 1));\n        self.count ++;\n\n        if (res.ok || res.todo) self.pass ++\n        else {\n            self.fail ++;\n            self.emit('fail');\n        }\n    });\n\n    t.on('test', function (st) { self._watch(st) });\n};\n\nResults.prototype.close = function () {\n    var self = this;\n    if (self.closed) self._stream.emit('error', new Error('ALREADY CLOSED'));\n    self.closed = true;\n    var write = function (s) { self._stream.queue(s) };\n\n    write('\\n1..' + self.count + '\\n');\n    write('# tests ' + self.count + '\\n');\n    write('# pass  ' + (self.pass + self.todo) + '\\n');\n    if (self.todo) write('# todo  ' + self.todo + '\\n');\n    if (self.fail) write('# fail  ' + self.fail + '\\n');\n    else write('\\n# ok\\n');\n\n    self._stream.queue(null);\n};\n\nfunction encodeResult(res, count) {\n    var output = '';\n    output += (res.ok ? 'ok ' : 'not ok ') + count;\n    output += res.name ? ' ' + res.name.toString().replace(/\\s+/g, ' ') : '';\n\n    if (res.skip) output += ' # SKIP';\n    else if (res.todo) output += ' # TODO';\n\n    output += '\\n';\n    if (res.ok) return output;\n\n    var outer = '  ';\n    var inner = outer + '  ';\n    output += outer + '---\\n';\n    output += inner + 'operator: ' + res.operator + '\\n';\n\n    if (has(res, 'expected') || has(res, 'actual')) {\n        var ex = inspect(res.expected, {depth: res.objectPrintDepth});\n        var ac = inspect(res.actual, {depth: res.objectPrintDepth});\n\n        if (Math.max(ex.length, ac.length) > 65 || invalidYaml(ex) || invalidYaml(ac)) {\n            output += inner + 'expected: |-\\n' + inner + '  ' + ex + '\\n';\n            output += inner + 'actual: |-\\n' + inner + '  ' + ac + '\\n';\n        } else {\n            output += inner + 'expected: ' + ex + '\\n';\n            output += inner + 'actual:   ' + ac + '\\n';\n        }\n    }\n    if (res.at) {\n        output += inner + 'at: ' + res.at + '\\n';\n    }\n\n    var actualStack = res.actual && (typeof res.actual === 'object' || typeof res.actual === 'function') ? res.actual.stack : undefined;\n    var errorStack = res.error && res.error.stack;\n    var stack = defined(actualStack, errorStack);\n    if (stack) {\n        var lines = String(stack).split('\\n');\n        output += inner + 'stack: |-\\n';\n        for (var i = 0; i < lines.length; i++) {\n            output += inner + '  ' + lines[i] + '\\n';\n        }\n    }\n\n    output += outer + '...\\n';\n    return output;\n}\n\nfunction getNextTest(results) {\n    if (!results._only) {\n        return results.tests.shift();\n    }\n\n    do {\n        var t = results.tests.shift();\n        if (!t) continue;\n        if (results._only === t) {\n            return t;\n        }\n    } while (results.tests.length !== 0)\n}\n\nfunction invalidYaml(str) {\n    return regexpTest(yamlIndicators, str);\n}\n\n}).call(this,require('_process'),require(\"timers\").setImmediate)\n},{\"_process\":36,\"defined\":10,\"events\":20,\"function-bind\":23,\"has\":24,\"inherits\":26,\"object-inspect\":30,\"resumer\":50,\"through\":62,\"timers\":63}],61:[function(require,module,exports){\n(function (process,setImmediate,__dirname){\nvar deepEqual = require('deep-equal');\nvar defined = require('defined');\nvar path = require('path');\nvar inherits = require('inherits');\nvar EventEmitter = require('events').EventEmitter;\nvar has = require('has');\nvar trim = require('string.prototype.trim');\nvar bind = require('function-bind');\nvar forEach = require('for-each');\nvar isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);\nvar toLowerCase = bind.call(Function.call, String.prototype.toLowerCase);\n\nmodule.exports = Test;\n\nvar nextTick = typeof setImmediate !== 'undefined'\n    ? setImmediate\n    : process.nextTick;\nvar safeSetTimeout = setTimeout;\nvar safeClearTimeout = clearTimeout;\n\ninherits(Test, EventEmitter);\n\nvar getTestArgs = function (name_, opts_, cb_) {\n    var name = '(anonymous)';\n    var opts = {};\n    var cb;\n\n    for (var i = 0; i < arguments.length; i++) {\n        var arg = arguments[i];\n        var t = typeof arg;\n        if (t === 'string') {\n            name = arg;\n        } else if (t === 'object') {\n            opts = arg || opts;\n        } else if (t === 'function') {\n            cb = arg;\n        }\n    }\n    return { name: name, opts: opts, cb: cb };\n};\n\nfunction Test(name_, opts_, cb_) {\n    if (! (this instanceof Test)) {\n        return new Test(name_, opts_, cb_);\n    }\n\n    var args = getTestArgs(name_, opts_, cb_);\n\n    this.readable = true;\n    this.name = args.name || '(anonymous)';\n    this.assertCount = 0;\n    this.pendingCount = 0;\n    this._skip = args.opts.skip || false;\n    this._todo = args.opts.todo || false;\n    this._timeout = args.opts.timeout;\n    this._plan = undefined;\n    this._cb = args.cb;\n    this._progeny = [];\n    this._ok = true;\n    var depthEnvVar = process.env.NODE_TAPE_OBJECT_PRINT_DEPTH;\n    if (args.opts.objectPrintDepth) {\n        this._objectPrintDepth = args.opts.objectPrintDepth;\n    } else if (depthEnvVar) {\n        if (toLowerCase(depthEnvVar) === 'infinity') {\n            this._objectPrintDepth = Infinity;\n        } else {\n            this._objectPrintDepth = depthEnvVar;\n        }\n    } else {\n        this._objectPrintDepth = 5;\n    }\n\n    for (var prop in this) {\n        this[prop] = (function bind(self, val) {\n            if (typeof val === 'function') {\n                return function bound() {\n                    return val.apply(self, arguments);\n                };\n            }\n            return val;\n        })(this, this[prop]);\n    }\n}\n\nTest.prototype.run = function () {\n    if (this._skip) {\n        this.comment('SKIP ' + this.name);\n    }\n    if (!this._cb || this._skip) {\n        return this._end();\n    }\n    if (this._timeout != null) {\n        this.timeoutAfter(this._timeout);\n    }\n    this.emit('prerun');\n    this._cb(this);\n    this.emit('run');\n};\n\nTest.prototype.test = function (name, opts, cb) {\n    var self = this;\n    var t = new Test(name, opts, cb);\n    this._progeny.push(t);\n    this.pendingCount++;\n    this.emit('test', t);\n    t.on('prerun', function () {\n        self.assertCount++;\n    })\n\n    if (!self._pendingAsserts()) {\n        nextTick(function () {\n            self._end();\n        });\n    }\n\n    nextTick(function () {\n        if (!self._plan && self.pendingCount == self._progeny.length) {\n            self._end();\n        }\n    });\n};\n\nTest.prototype.comment = function (msg) {\n    var that = this;\n    forEach(trim(msg).split('\\n'), function (aMsg) {\n        that.emit('result', trim(aMsg).replace(/^#\\s*/, ''));\n    });\n};\n\nTest.prototype.plan = function (n) {\n    this._plan = n;\n    this.emit('plan', n);\n};\n\nTest.prototype.timeoutAfter = function (ms) {\n    if (!ms) throw new Error('timeoutAfter requires a timespan');\n    var self = this;\n    var timeout = safeSetTimeout(function () {\n        self.fail('test timed out after ' + ms + 'ms');\n        self.end();\n    }, ms);\n    this.once('end', function () {\n        safeClearTimeout(timeout);\n    });\n}\n\nTest.prototype.end = function (err) {\n    var self = this;\n    if (arguments.length >= 1 && !!err) {\n        this.ifError(err);\n    }\n\n    if (this.calledEnd) {\n        this.fail('.end() called twice');\n    }\n    this.calledEnd = true;\n    this._end();\n};\n\nTest.prototype._end = function (err) {\n    var self = this;\n    if (this._progeny.length) {\n        var t = this._progeny.shift();\n        t.on('end', function () { self._end() });\n        t.run();\n        return;\n    }\n\n    if (!this.ended) this.emit('end');\n    var pendingAsserts = this._pendingAsserts();\n    if (!this._planError && this._plan !== undefined && pendingAsserts) {\n        this._planError = true;\n        this.fail('plan != count', {\n            expected : this._plan,\n            actual : this.assertCount\n        });\n    }\n    this.ended = true;\n};\n\nTest.prototype._exit = function () {\n    if (this._plan !== undefined &&\n        !this._planError && this.assertCount !== this._plan) {\n        this._planError = true;\n        this.fail('plan != count', {\n            expected : this._plan,\n            actual : this.assertCount,\n            exiting : true\n        });\n    } else if (!this.ended) {\n        this.fail('test exited without ending', {\n            exiting: true\n        });\n    }\n};\n\nTest.prototype._pendingAsserts = function () {\n    if (this._plan === undefined) {\n        return 1;\n    }\n    return this._plan - (this._progeny.length + this.assertCount);\n};\n\nTest.prototype._assert = function assert(ok, opts) {\n    var self = this;\n    var extra = opts.extra || {};\n\n    var res = {\n        id: self.assertCount++,\n        ok: Boolean(ok),\n        skip: defined(extra.skip, opts.skip),\n        todo: defined(extra.todo, opts.todo, self._todo),\n        name: defined(extra.message, opts.message, '(unnamed assert)'),\n        operator: defined(extra.operator, opts.operator),\n        objectPrintDepth: self._objectPrintDepth\n    };\n    if (has(opts, 'actual') || has(extra, 'actual')) {\n        res.actual = defined(extra.actual, opts.actual);\n    }\n    if (has(opts, 'expected') || has(extra, 'expected')) {\n        res.expected = defined(extra.expected, opts.expected);\n    }\n    this._ok = Boolean(this._ok && ok);\n\n    if (!ok && !res.todo) {\n        res.error = defined(extra.error, opts.error, new Error(res.name));\n    }\n\n    if (!ok) {\n        var e = new Error('exception');\n        var err = (e.stack || '').split('\\n');\n        var dir = __dirname + path.sep;\n\n        for (var i = 0; i < err.length; i++) {\n            /*\n                Stack trace lines may resemble one of the following. We need\n                to should correctly extract a function name (if any) and\n                path / line no. for each line.\n\n                    at myFunction (/path/to/file.js:123:45)\n                    at myFunction (/path/to/file.other-ext:123:45)\n                    at myFunction (/path to/file.js:123:45)\n                    at myFunction (C:\\path\\to\\file.js:123:45)\n                    at myFunction (/path/to/file.js:123)\n                    at Test.<anonymous> (/path/to/file.js:123:45)\n                    at Test.bound [as run] (/path/to/file.js:123:45)\n                    at /path/to/file.js:123:45\n\n                Regex has three parts. First is non-capturing group for 'at '\n                (plus anything preceding it).\n\n                    /^(?:[^\\s]*\\s*\\bat\\s+)/\n\n                Second captures function call description (optional). This is\n                not necessarily a valid JS function name, but just what the\n                stack trace is using to represent a function call. It may look\n                like `<anonymous>` or 'Test.bound [as run]'.\n\n                For our purposes, we assume that, if there is a function\n                name, it's everything leading up to the first open\n                parentheses (trimmed) before our pathname.\n\n                    /(?:(.*)\\s+\\()?/\n\n                Last part captures file path plus line no (and optional\n                column no).\n\n                    /((?:\\/|[a-zA-Z]:\\\\)[^:\\)]+:(\\d+)(?::(\\d+))?)/\n            */\n            var re = /^(?:[^\\s]*\\s*\\bat\\s+)(?:(.*)\\s+\\()?((?:\\/|[a-zA-Z]:\\\\)[^:\\)]+:(\\d+)(?::(\\d+))?)/\n            var m = re.exec(err[i]);\n\n            if (!m) {\n                continue;\n            }\n\n            var callDescription = m[1] || '<anonymous>';\n            var filePath = m[2];\n\n            if (filePath.slice(0, dir.length) === dir) {\n                continue;\n            }\n\n            // Function call description may not (just) be a function name.\n            // Try to extract function name by looking at first \"word\" only.\n            res.functionName = callDescription.split(/\\s+/)[0]\n            res.file = filePath;\n            res.line = Number(m[3]);\n            if (m[4]) res.column = Number(m[4]);\n\n            res.at = callDescription + ' (' + filePath + ')';\n            break;\n        }\n    }\n\n    self.emit('result', res);\n\n    var pendingAsserts = self._pendingAsserts();\n    if (!pendingAsserts) {\n        if (extra.exiting) {\n            self._end();\n        } else {\n            nextTick(function () {\n                self._end();\n            });\n        }\n    }\n\n    if (!self._planError && pendingAsserts < 0) {\n        self._planError = true;\n        self.fail('plan != count', {\n            expected : self._plan,\n            actual : self._plan - pendingAsserts\n        });\n    }\n};\n\nTest.prototype.fail = function (msg, extra) {\n    this._assert(false, {\n        message : msg,\n        operator : 'fail',\n        extra : extra\n    });\n};\n\nTest.prototype.pass = function (msg, extra) {\n    this._assert(true, {\n        message : msg,\n        operator : 'pass',\n        extra : extra\n    });\n};\n\nTest.prototype.skip = function (msg, extra) {\n    this._assert(true, {\n        message : msg,\n        operator : 'skip',\n        skip : true,\n        extra : extra\n    });\n};\n\nfunction assert(value, msg, extra) {\n    this._assert(value, {\n        message : defined(msg, 'should be truthy'),\n        operator : 'ok',\n        expected : true,\n        actual : value,\n        extra : extra\n    });\n}\nTest.prototype.ok\n= Test.prototype['true']\n= Test.prototype.assert\n= assert;\n\nfunction notOK(value, msg, extra) {\n    this._assert(!value, {\n        message : defined(msg, 'should be falsy'),\n        operator : 'notOk',\n        expected : false,\n        actual : value,\n        extra : extra\n    });\n}\nTest.prototype.notOk\n= Test.prototype['false']\n= Test.prototype.notok\n= notOK;\n\nfunction error(err, msg, extra) {\n    this._assert(!err, {\n        message : defined(msg, String(err)),\n        operator : 'error',\n        actual : err,\n        extra : extra\n    });\n}\nTest.prototype.error\n= Test.prototype.ifError\n= Test.prototype.ifErr\n= Test.prototype.iferror\n= error;\n\nfunction equal(a, b, msg, extra) {\n    this._assert(a === b, {\n        message : defined(msg, 'should be equal'),\n        operator : 'equal',\n        actual : a,\n        expected : b,\n        extra : extra\n    });\n}\nTest.prototype.equal\n= Test.prototype.equals\n= Test.prototype.isEqual\n= Test.prototype.is\n= Test.prototype.strictEqual\n= Test.prototype.strictEquals\n= equal;\n\nfunction notEqual(a, b, msg, extra) {\n    this._assert(a !== b, {\n        message : defined(msg, 'should not be equal'),\n        operator : 'notEqual',\n        actual : a,\n        expected : b,\n        extra : extra\n    });\n}\nTest.prototype.notEqual\n= Test.prototype.notEquals\n= Test.prototype.notStrictEqual\n= Test.prototype.notStrictEquals\n= Test.prototype.isNotEqual\n= Test.prototype.isNot\n= Test.prototype.not\n= Test.prototype.doesNotEqual\n= Test.prototype.isInequal\n= notEqual;\n\nfunction tapeDeepEqual(a, b, msg, extra) {\n    this._assert(deepEqual(a, b, { strict: true }), {\n        message : defined(msg, 'should be equivalent'),\n        operator : 'deepEqual',\n        actual : a,\n        expected : b,\n        extra : extra\n    });\n}\nTest.prototype.deepEqual\n= Test.prototype.deepEquals\n= Test.prototype.isEquivalent\n= Test.prototype.same\n= tapeDeepEqual;\n\nfunction deepLooseEqual(a, b, msg, extra) {\n    this._assert(deepEqual(a, b), {\n        message : defined(msg, 'should be equivalent'),\n        operator : 'deepLooseEqual',\n        actual : a,\n        expected : b,\n        extra : extra\n    });\n}\nTest.prototype.deepLooseEqual\n= Test.prototype.looseEqual\n= Test.prototype.looseEquals\n= deepLooseEqual;\n\nfunction notDeepEqual(a, b, msg, extra) {\n    this._assert(!deepEqual(a, b, { strict: true }), {\n        message : defined(msg, 'should not be equivalent'),\n        operator : 'notDeepEqual',\n        actual : a,\n        expected : b,\n        extra : extra\n    });\n}\nTest.prototype.notDeepEqual\n= Test.prototype.notDeepEquals\n= Test.prototype.notEquivalent\n= Test.prototype.notDeeply\n= Test.prototype.notSame\n= Test.prototype.isNotDeepEqual\n= Test.prototype.isNotDeeply\n= Test.prototype.isNotEquivalent\n= Test.prototype.isInequivalent\n= notDeepEqual;\n\nfunction notDeepLooseEqual(a, b, msg, extra) {\n    this._assert(!deepEqual(a, b), {\n        message : defined(msg, 'should be equivalent'),\n        operator : 'notDeepLooseEqual',\n        actual : a,\n        expected : b,\n        extra : extra\n    });\n}\nTest.prototype.notDeepLooseEqual\n= Test.prototype.notLooseEqual\n= Test.prototype.notLooseEquals\n= notDeepLooseEqual;\n\nTest.prototype['throws'] = function (fn, expected, msg, extra) {\n    if (typeof expected === 'string') {\n        msg = expected;\n        expected = undefined;\n    }\n\n    var caught = undefined;\n\n    try {\n        fn();\n    } catch (err) {\n        caught = { error : err };\n        if ((err != null) && (!isEnumerable(err, 'message') || !has(err, 'message'))) {\n            var message = err.message;\n            delete err.message;\n            err.message = message;\n        }\n    }\n\n    var passed = caught;\n\n    if (expected instanceof RegExp) {\n        passed = expected.test(caught && caught.error);\n        expected = String(expected);\n    }\n\n    if (typeof expected === 'function' && caught) {\n        passed = caught.error instanceof expected;\n        caught.error = caught.error.constructor;\n    }\n\n    this._assert(typeof fn === 'function' && passed, {\n        message : defined(msg, 'should throw'),\n        operator : 'throws',\n        actual : caught && caught.error,\n        expected : expected,\n        error: !passed && caught && caught.error,\n        extra : extra\n    });\n};\n\nTest.prototype.doesNotThrow = function (fn, expected, msg, extra) {\n    if (typeof expected === 'string') {\n        msg = expected;\n        expected = undefined;\n    }\n    var caught = undefined;\n    try {\n        fn();\n    }\n    catch (err) {\n        caught = { error : err };\n    }\n    this._assert(!caught, {\n        message : defined(msg, 'should not throw'),\n        operator : 'throws',\n        actual : caught && caught.error,\n        expected : expected,\n        error : caught && caught.error,\n        extra : extra\n    });\n};\n\nTest.skip = function (name_, _opts, _cb) {\n    var args = getTestArgs.apply(null, arguments);\n    args.opts.skip = true;\n    return Test(args.name, args.opts, args.cb);\n};\n\n// vim: set softtabstop=4 shiftwidth=4:\n\n}).call(this,require('_process'),require(\"timers\").setImmediate,\"/node_modules/tape/lib\")\n},{\"_process\":36,\"deep-equal\":6,\"defined\":10,\"events\":20,\"for-each\":21,\"function-bind\":23,\"has\":24,\"inherits\":26,\"path\":34,\"string.prototype.trim\":54,\"timers\":63}],62:[function(require,module,exports){\n(function (process){\nvar Stream = require('stream')\n\n// through\n//\n// a stream that does nothing but re-emit the input.\n// useful for aggregating a series of changing but not ending streams into one stream)\n\nexports = module.exports = through\nthrough.through = through\n\n//create a readable writable stream.\n\nfunction through (write, end, opts) {\n  write = write || function (data) { this.queue(data) }\n  end = end || function () { this.queue(null) }\n\n  var ended = false, destroyed = false, buffer = [], _ended = false\n  var stream = new Stream()\n  stream.readable = stream.writable = true\n  stream.paused = false\n\n//  stream.autoPause   = !(opts && opts.autoPause   === false)\n  stream.autoDestroy = !(opts && opts.autoDestroy === false)\n\n  stream.write = function (data) {\n    write.call(this, data)\n    return !stream.paused\n  }\n\n  function drain() {\n    while(buffer.length && !stream.paused) {\n      var data = buffer.shift()\n      if(null === data)\n        return stream.emit('end')\n      else\n        stream.emit('data', data)\n    }\n  }\n\n  stream.queue = stream.push = function (data) {\n//    console.error(ended)\n    if(_ended) return stream\n    if(data === null) _ended = true\n    buffer.push(data)\n    drain()\n    return stream\n  }\n\n  //this will be registered as the first 'end' listener\n  //must call destroy next tick, to make sure we're after any\n  //stream piped from here.\n  //this is only a problem if end is not emitted synchronously.\n  //a nicer way to do this is to make sure this is the last listener for 'end'\n\n  stream.on('end', function () {\n    stream.readable = false\n    if(!stream.writable && stream.autoDestroy)\n      process.nextTick(function () {\n        stream.destroy()\n      })\n  })\n\n  function _end () {\n    stream.writable = false\n    end.call(stream)\n    if(!stream.readable && stream.autoDestroy)\n      stream.destroy()\n  }\n\n  stream.end = function (data) {\n    if(ended) return\n    ended = true\n    if(arguments.length) stream.write(data)\n    _end() // will emit or queue\n    return stream\n  }\n\n  stream.destroy = function () {\n    if(destroyed) return\n    destroyed = true\n    ended = true\n    buffer.length = 0\n    stream.writable = stream.readable = false\n    stream.emit('close')\n    return stream\n  }\n\n  stream.pause = function () {\n    if(stream.paused) return\n    stream.paused = true\n    return stream\n  }\n\n  stream.resume = function () {\n    if(stream.paused) {\n      stream.paused = false\n      stream.emit('resume')\n    }\n    drain()\n    //may have become paused again,\n    //as drain emits 'data'.\n    if(!stream.paused)\n      stream.emit('drain')\n    return stream\n  }\n  return stream\n}\n\n\n}).call(this,require('_process'))\n},{\"_process\":36,\"stream\":52}],63:[function(require,module,exports){\n(function (setImmediate,clearImmediate){\nvar nextTick = require('process/browser.js').nextTick;\nvar apply = Function.prototype.apply;\nvar slice = Array.prototype.slice;\nvar immediateIds = {};\nvar nextImmediateId = 0;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n  return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n  return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) { timeout.close(); };\n\nfunction Timeout(id, clearFn) {\n  this._id = id;\n  this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n  this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n  clearTimeout(item._idleTimeoutId);\n  item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n  clearTimeout(item._idleTimeoutId);\n  item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n  clearTimeout(item._idleTimeoutId);\n\n  var msecs = item._idleTimeout;\n  if (msecs >= 0) {\n    item._idleTimeoutId = setTimeout(function onTimeout() {\n      if (item._onTimeout)\n        item._onTimeout();\n    }, msecs);\n  }\n};\n\n// That's not how node.js implements it but the exposed api is the same.\nexports.setImmediate = typeof setImmediate === \"function\" ? setImmediate : function(fn) {\n  var id = nextImmediateId++;\n  var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n\n  immediateIds[id] = true;\n\n  nextTick(function onNextTick() {\n    if (immediateIds[id]) {\n      // fn.call() is faster so we optimize for the common use-case\n      // @see http://jsperf.com/call-apply-segu\n      if (args) {\n        fn.apply(null, args);\n      } else {\n        fn.call(null);\n      }\n      // Prevent ids from leaking\n      exports.clearImmediate(id);\n    }\n  });\n\n  return id;\n};\n\nexports.clearImmediate = typeof clearImmediate === \"function\" ? clearImmediate : function(id) {\n  delete immediateIds[id];\n};\n}).call(this,require(\"timers\").setImmediate,require(\"timers\").clearImmediate)\n},{\"process/browser.js\":36,\"timers\":63}],64:[function(require,module,exports){\n(function (global){\n\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n  if (config('noDeprecation')) {\n    return fn;\n  }\n\n  var warned = false;\n  function deprecated() {\n    if (!warned) {\n      if (config('throwDeprecation')) {\n        throw new Error(msg);\n      } else if (config('traceDeprecation')) {\n        console.trace(msg);\n      } else {\n        console.warn(msg);\n      }\n      warned = true;\n    }\n    return fn.apply(this, arguments);\n  }\n\n  return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n  // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n  try {\n    if (!global.localStorage) return false;\n  } catch (_) {\n    return false;\n  }\n  var val = global.localStorage[name];\n  if (null == val) return false;\n  return String(val).toLowerCase() === 'true';\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],65:[function(require,module,exports){\nwindow.test = require('tape');\n// Threebox = require(\"../src/Threebox.js\");\n// THREE = require(\"../src/three.js\");\n\n// window.runTests = function () {\n//     // material(instance);\n// }\n\nfunction vector3Equals(t, input, expected, allowableError, epsilon) {\n    // Check that two Vector3s are equal to each other, allowing for a certain percentage of error due to floating point math\n    if (allowableError === undefined) allowableError = 0.0000001;\n    if (epsilon === undefined) epsilon = 0.00000000000001;\n    var dX, dY, dZ;\n    dX = Math.abs(input.x - expected.x) / (expected.x === 0 ? 1 : expected.x);\n    dY = Math.abs(input.y - expected.y) / (expected.y === 0 ? 1 : expected.y);\n    dZ = Math.abs(input.z - expected.z) / (expected.z === 0 ? 1 : expected.z);\n    \n    if (dX < epsilon) dX = 0;\n    if (dY < epsilon) dY = 0;\n    if (dZ < epsilon) dZ = 0;\n\n    if(dX > allowableError || dY > allowableError || dZ > allowableError) {\n        t.fail(\"Vector3 Equivalence failed: (\" +  input.x + \", \" + input.y + \", \" + input.z + \") expected: (\" +  expected.x + \", \" + expected.y + \", \" + expected.z + \")\");\n        console.log(dY);\n    }\n    t.pass(\"ok Vector3 equivalence\");\n}\n\n\nfunction precisionRound(number, precision) {\n    var factor = Math.pow(10, precision);\n    var tempNumber = number * factor;\n    var roundedTempNumber = Math.round(tempNumber);\n    return roundedTempNumber / factor;\n};\n},{\"tape\":58}]},{},[65]);\n"
  },
  {
    "path": "tests/threebox-tests.html",
    "content": "<!doctype html>\n<head>\n    <title>Threebox tests</title>\n    <script src=\"threebox-tests-bundle.js\" type=\"text/javascript\"></script>\n    <script src=\"../examples/config.js\"></script>\n    <script src='../dist/threebox.js'></script>\n    <script src='https://api.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.js'></script>\n    <link href='https://api.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.css' rel='stylesheet' />\n\n    <script src='unit/material.test.js'></script>\n    <script src='unit/utilities.test.js'></script>\n    <script src='unit/object.test.js'></script>\n    <script src='unit/validate.test.js'></script>\n\n    <style>\n        body, html { \n            width: 100%;\n            height: 100%;\n            margin: 0;\n        }\n        #map { \n            width: 100%;\n            height: 100%;\n        }\n    </style>\n</head>\n<body>\n    Open the console to see test results\n    <div id='map' style=\"width: 800px; height: 600px;\"></div>\n\n    <script>\n        if(!config) console.error(\"Config not set! Make a copy of 'config_template.js', add in your access token, and save the file as 'config.js'.\");\n        \n        mapboxgl.accessToken = config.accessToken;\n        var map = new mapboxgl.Map({\n          container: 'map',\n          style: 'mapbox://styles/mapbox/streets-v8',\n          center: [-122.4131, 37.7743],\n          zoom: 14,\n          pitch: 60\n        });\n\n        map.on('style.load', function() {\n\n            map.addLayer({\n                id: 'custom_layer',\n                type: 'custom',\n                onAdd: function(map, gl){\n                    onAdd(map, gl);\n                },\n                render: function(gl, matrix){\n                    tb.update(true);\n                }\n            });\n        });\n\n\n        function onAdd(map, mbxContext) {\n\n            tb = new Threebox(map, mbxContext);\n            tb.setupDefaultLights();\n\n            materialTest(tb);\n            objectTest(tb);\n            utilitiesTest(tb);\n            validateTest(tb);\n\n        }\n\n        function vector3Equals(t, input, expected, allowableError, epsilon) {\n            // Check that two Vector3s are equal to each other, allowing for a certain percentage of error due to floating point math\n            if (allowableError === undefined) allowableError = 0.0000001;\n            if (epsilon === undefined) epsilon = 0.00000000000001;\n            var dX, dY, dZ;\n            dX = Math.abs(input.x - expected.x) / (expected.x === 0 ? 1 : expected.x);\n            dY = Math.abs(input.y - expected.y) / (expected.y === 0 ? 1 : expected.y);\n            dZ = Math.abs(input.z - expected.z) / (expected.z === 0 ? 1 : expected.z);\n            \n            if (dX < epsilon) dX = 0;\n            if (dY < epsilon) dY = 0;\n            if (dZ < epsilon) dZ = 0;\n\n            if(dX > allowableError || dY > allowableError || dZ > allowableError) {\n                t.fail(\"Vector3 Equivalence failed: (\" +  input.x + \", \" + input.y + \", \" + input.z + \") expected: (\" +  expected.x + \", \" + expected.y + \", \" + expected.z + \")\");\n            }\n            t.pass(\"ok Vector3 equivalence\");\n        }\n\n\n        function precisionRound(number, precision) {\n            var factor = Math.pow(10, precision);\n            var tempNumber = number * factor;\n            var roundedTempNumber = Math.round(tempNumber);\n            return roundedTempNumber / factor;\n        };\n    </script>\n</body>"
  },
  {
    "path": "tests/threebox-tests.js",
    "content": "window.test = require('tape');\n// Threebox = require(\"../src/Threebox.js\");\n// THREE = require(\"../src/three.js\");\n\n// window.runTests = function () {\n//     // material(instance);\n// }\n\nfunction vector3Equals(t, input, expected, allowableError, epsilon) {\n    // Check that two Vector3s are equal to each other, allowing for a certain percentage of error due to floating point math\n    if (allowableError === undefined) allowableError = 0.0000001;\n    if (epsilon === undefined) epsilon = 0.00000000000001;\n    var dX, dY, dZ;\n    dX = Math.abs(input.x - expected.x) / (expected.x === 0 ? 1 : expected.x);\n    dY = Math.abs(input.y - expected.y) / (expected.y === 0 ? 1 : expected.y);\n    dZ = Math.abs(input.z - expected.z) / (expected.z === 0 ? 1 : expected.z);\n    \n    if (dX < epsilon) dX = 0;\n    if (dY < epsilon) dY = 0;\n    if (dZ < epsilon) dZ = 0;\n\n    if(dX > allowableError || dY > allowableError || dZ > allowableError) {\n        t.fail(\"Vector3 Equivalence failed: (\" +  input.x + \", \" + input.y + \", \" + input.z + \") expected: (\" +  expected.x + \", \" + expected.y + \", \" + expected.z + \")\");\n        console.log(dY);\n    }\n    t.pass(\"ok Vector3 equivalence\");\n}\n\n\nfunction precisionRound(number, precision) {\n    var factor = Math.pow(10, precision);\n    var tempNumber = number * factor;\n    var roundedTempNumber = Math.round(tempNumber);\n    return roundedTempNumber / factor;\n};"
  },
  {
    "path": "tests/unit/camera.test.js",
    "content": "function cameraTest(instance){\n\n\n}\n\n    \n"
  },
  {
    "path": "tests/unit/material.test.js",
    "content": "function materialTest(instance){\n\n    var material;\n\n    test('MATERIAL default type, color, opacity', function(t) {        \n        material = instance.material();\n        t.equal(material.type, 'MeshBasicMaterial');\n        t.deepEqual(material.color, { r: 0, g: 0, b: 0 });\n        t.equal(material.opacity, 1);\n        t.end();\n    });\n\n    test('MATERIAL custom type', function(t) { \n        material = instance.material({material:'MeshPhysicalMaterial'});\n        t.equal(material.opacity, 1);\n        t.equal(material.type, 'MeshPhysicalMaterial');\n        t.deepEqual(material.color, { r: 0, g: 0, b: 0 });\n        t.end();\n    });\n\n    test('MATERIAL custom color', function(t) { \n        material = instance.material({color:'red'});\n        t.equal(material.opacity, 1);\n        t.equal(material.type, 'MeshBasicMaterial');\n        t.deepEqual(material.color, { r: 1, g: 0, b: 0 });\n        t.end();\n    });\n\n    test('MATERIAL custom opacity', function(t) { \n        material = instance.material({opacity:0.5});\n        t.equal(material.opacity, 0.5);\n        t.equal(material.type, 'MeshBasicMaterial');\n        t.deepEqual(material.color, { r: 0, g: 0, b: 0 });\n        t.end();\n    });\n\n    test('MATERIAL custom color, opacity, type', function(t) { \n        allCustom = instance.material({\n            material: 'MeshBasicMaterial', \n            opacity: 0.5, \n            color: 'blue'\n        });\n        t.equal(allCustom.opacity, 0.5);\n        t.equal(allCustom.type, 'MeshBasicMaterial');\n        t.deepEqual(allCustom.color, { r: 0, g: 0, b: 1 });\n        t.end();\n    });\n\n    test('MATERIAL when THREE.Material provided, other material params ignored except opacity', function(t) { \n        threeMaterial = instance.material({\n            material: new THREE.MeshBasicMaterial({color: 'cyan'}), \n            opacity: 0.5, \n            color: 'blue'\n        });\n\n        t.equal(threeMaterial.opacity, 0.5);\n        t.equal(threeMaterial.type, 'MeshBasicMaterial');\n        t.deepEqual(threeMaterial.color, { r: 0, g: 1, b: 1 });\n        t.end();\n    });\n}\n\n    \n"
  },
  {
    "path": "tests/unit/object.test.js",
    "content": "function objectTest(instance){\n\n    var mesh = new THREE.Mesh();\n    var group \n\n    test('OBJECT _makeGroup from one object', function(t){\n        group = instance.objects._makeGroup(mesh, {foo: true});\n\n        t.equal(group.userData.foo, true);\n        t.equal(group.type, 'Group');\n        t.equal(group.children.length, 1);\n        t.end();\n\n    });\n\n    test('OBJECT _makeGroup from multiple objects', function(t){\n        var mesh2 = new THREE.Mesh();\n        group = instance.objects._makeGroup([mesh, mesh2], {foo: false});\n\n        t.equal(group.userData.foo, false);\n        t.equal(group.type, 'Group');\n        t.equal(group.children.length, 2);\n        t.end();\n\n    })\n\n    test('OBJECT _addMethods static', function(t){\n\n        group = instance.objects._makeGroup(mesh, {});\n        var addedMethods = instance.objects._addMethods(group, true);\n        \n        t.equal(addedMethods.setCoords, undefined);\n        t.equal(addedMethods.type, 'Group');\n        t.end();\n\n    })\n\n    test('OBJECT _addMethods dynamic', function(t){\n\n        var sphere = instance.sphere({units: 'meters'});\n\n        t.equal(sphere.type, 'Group');\n        t.equal(typeof sphere.followPath, 'function');\n        t.deepEqual(sphere.coordinates, [0,0,0]);\n        t.end();\n\n    })\n\n    test('OBJECT setCoords updates both position and scale', function(t){\n\n        var sphere = instance.sphere({units: 'meters'});\n        var newPosition = [0,-20];\n\n        sphere.setCoords(newPosition)\n        var scaleFactor = instance.projectedUnitsPerMeter(newPosition[1]);\n\n        vector3Equals(t, sphere.position, instance.projectToWorld(newPosition));\n        t.equal(sphere.scale.x, scaleFactor);\n        t.deepEqual(sphere.coordinates, newPosition)\n        t.end();\n\n    })\n\n}\n\n    \n"
  },
  {
    "path": "tests/unit/utilities.test.js",
    "content": "function utilitiesTest(instance){\n\n    test('PROJECTION project / unproject', function(t) {\n        \n        var coord, projected, expected;\n        \n        coord = [0,0,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(0,0,0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n        coord = [30,30,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(-85333.33333333333, -89522.98305691125, 0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n        coord = [30,-30,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(-85333.33333333333, -89522.9830569113, 0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n        coord = [-30,30,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(-85333.33333333333, -89522.9830569113, 0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n        coord = [-30,-30,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(-85333.33333333333, 89522.9830569113, 0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n        t.end();\n    });\n\n    test('PROJECTION project / unproject extended lat/lng range', function(t) {\n        var coord, projected, expected;\n        \n        coord = [180,0,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(-511999.99999999994,1.8093822187881337e-11,0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n        coord = [-180,0,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(511999.99999999994,1.8093822187881337e-11,0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n        coord = [0,90,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(0,-3042.073317352722,0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n\n        coord = [0, 85.051129,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(0, -512000.00726036413, 0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n        coord = [0, -85.051129,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(0, -512000.00726036413, 0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n\n        coord = [300,0,0];\n        var projected = instance.projectToWorld(coord);\n        var unprojected = instance.unprojectFromWorld(projected);\n        var expected = new THREE.Vector3(-853333.3333333333,1.8093822187881337e-11,0);\n        vector3Equals(t, projected, expected);\n        vector3Equals(t, new THREE.Vector3(unprojected), new THREE.Vector3(expected));\n\n        t.end();\n    });\n\n\n    test('PROJECTION with altitude', function(t) {\n        var coord, projected, expected;\n        \n        coord = [0,0,10000];\n        var projected = instance.projectToWorld(coord);\n        var expected = new THREE.Vector3(0,0,255.52089831565812);\n        vector3Equals(t, projected, expected);\n\n\n        coord = [0,0,-10000];\n        var projected = instance.projectToWorld(coord);\n        var expected = new THREE.Vector3(0,0,-255.52089831565812);\n        vector3Equals(t, projected, expected);\n\n        t.end();\n    });\n\n    test('PROJECTION projectedUnitsPerMeter', function(t) {\n\n        var pupm1 = instance.projectedUnitsPerMeter(10);\n        var pupm2 = instance.projectedUnitsPerMeter(-35);\n\n        t.equals(pupm1, 0.025946272004267072);\n        t.equals(pupm2, 0.03119334195612554);\n\n        t.end();\n    });\n\n\n    // test('PROJECTION project / unproject invalid input', function(t) {\n    //     // TODO: Check for null/undefined/NaN values\n    //     t.end();\n    // });\n\n\n    test('NORMALIZEVERTICES', function(t){\n        \n        var input = [\n            new THREE.Vector3(100, 101, 102), \n            new THREE.Vector3(103, 104, 105)\n        ];\n        \n        var normalized = instance.utils.normalizeVertices(input);\n\n        t.deepEqual(\n            normalized.position, \n            {\n                x: 101.5, \n                y: 102.5, \n                z: 103.5\n            }\n        );\n\n        t.deepEqual(\n            normalized.vertices, \n            [\n                {x: -1.5, y: -1.5, z: -1.5}, \n                {x: 1.5, y: 1.5, z: 1.5}\n            ]\n        );\n\n        t.end();\n    })\n\n    var defaults = {\n        foo: 'bar',\n        biz: false\n    }\n\n    test('VALIDATOR empty input', function(t) {\n        var output = instance.utils._validate({}, defaults);\n        t.deepEqual(output, defaults);\n        t.end();\n    });\n\n    test('VALIDATOR does not overwrite unknown props', function(t) {\n        var output = instance.utils._validate({a:true}, defaults);\n\n        t.deepEqual(output, {\n            foo: 'bar',\n            biz: false,\n            a: true\n        });\n\n        t.end();\n    });  \n\n    test('VALIDATOR missing required params throw error', function(t) {\n        var output = instance.utils._validate({}, {b: null});\n        t.error(output, 'proper error');\n        t.end();\n    });     \n}\n"
  },
  {
    "path": "tests/unit/validate.test.js",
    "content": "function validateTest(instance){\n\n    var v = instance.utils.Validator;\n\n    // Coords validation\n\n    test('VALIDATE invalid Coords', function(t){\n\n        t.error(v.Coords(true), 'error');\n        t.error(v.Coords(['a']), 'error');\n        t.error(v.Coords([1]), 'error');\n        t.error(v.Coords([3, false]), 'error');\n\n        t.end();\n\n    });\n\n    test('VALIDATE valid Coords', function(t){\n\n        t.deepEqual(v.Coords([22,33]), [22,33]);\n        t.deepEqual(v.Coords([22,33,-10]), [22,33, -10]);\n        t.end();\n\n    });\n\n    // Line validation\n\n    test('VALIDATE invalid Line', function(t){\n\n        t.error(v.Line([[1,2], [false, 4]]), 'error');\n        t.end();\n\n    });\n\n    test('VALIDATE valid Line', function(t){\n\n        t.deepEqual(v.Line([[-100, 20], [22,33]]), [[-100, 20], [22,33]]);\n        t.end();\n\n    });\n\n    // Rotation validation\n    \n    test('VALIDATE invalid Rotation', function(t){\n\n        t.error(v.Rotation('rotate'), 'error');\n        t.end();\n\n    });\n\n    test('VALIDATE valid Rotation', function(t){\n\n        t.deepEqual(v.Rotation(40), {z:40});\n        t.deepEqual(v.Rotation({x:20, y:10, z:90}), {x:20, y:10, z:90});\n\n        t.end();\n\n    });\n\n    // Scale validation\n    \n    test('VALIDATE invalid Scale', function(t){\n\n        t.error(v.Scale('scale'), 'error');\n        t.end();\n\n    });\n\n    test('VALIDATE valid Scale', function(t){\n\n        t.deepEqual(v.Scale(22), {x:22, y:22, z:22});\n        t.deepEqual(v.Scale({x:20, y:10, z:90}), {x:20, y:10, z:90});\n\n        t.end();\n\n    });\n}\n\n    \n"
  }
]